changed to new functions
All checks were successful
Deploy Docs to Synology / deploy (push) Successful in 3s
All checks were successful
Deploy Docs to Synology / deploy (push) Successful in 3s
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
// components/Select.js
|
||||
import { Tag, For } from "sigpro";
|
||||
import { h, each } from "sigpro";
|
||||
import { val, ui } from "../utils.js";
|
||||
|
||||
/**
|
||||
@@ -14,17 +14,17 @@ import { val, ui } from "../utils.js";
|
||||
export const Select = (props) => {
|
||||
const { class: className, label, items, value, ...rest } = props;
|
||||
|
||||
const selectEl = Tag(
|
||||
const selectEl = h(
|
||||
"select",
|
||||
{
|
||||
...rest,
|
||||
class: ui('select select-bordered w-full', className),
|
||||
value: value
|
||||
},
|
||||
For(
|
||||
each(
|
||||
() => val(items) || [],
|
||||
(opt) =>
|
||||
Tag(
|
||||
h(
|
||||
"option",
|
||||
{
|
||||
value: opt.value,
|
||||
@@ -38,8 +38,8 @@ export const Select = (props) => {
|
||||
|
||||
if (!label) return selectEl;
|
||||
|
||||
return Tag("label", { class: "fieldset-label flex flex-col gap-1" }, [
|
||||
Tag("span", {}, label),
|
||||
return h("label", { class: "fieldset-label flex flex-col gap-1" }, [
|
||||
h("span", {}, label),
|
||||
selectEl
|
||||
]);
|
||||
};
|
||||
Reference in New Issue
Block a user