Before repair nav components
All checks were successful
Deploy Docs to Synology / deploy (push) Successful in 4s

This commit is contained in:
2026-04-25 11:24:39 +02:00
parent e842ed8041
commit 910c6ab3c7
71 changed files with 4260 additions and 2819 deletions

View File

@@ -0,0 +1,30 @@
// components/Select.js
import { h, each } from "sigpro";
export const Select = (props) => {
const { items, placeholder, placeholderDisabled = true, keyFn, children, ...rest } = props;
if (children !== undefined) {
return h("select", { ...rest, class: `select ${rest.class ?? ''}` }, children);
}
const placeholderOption = placeholder
? h("option", { disabled: placeholderDisabled, selected: true }, placeholder)
: null;
const dynamicOptions = each(
() => [...(typeof items === "function" ? items() : items || [])],
(item) => {
const value = typeof item === "string" ? item : item.value;
const label = typeof item === "string" ? item : item.label;
return h("option", { value }, label);
},
keyFn || ((item) => (typeof item === "string" ? item : item.value))
);
const options = placeholderOption
? [placeholderOption, dynamicOptions]
: dynamicOptions;
return h("select", { ...rest, class: `select ${rest.class ?? ''}` }, options);
};