Update new functions
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
// components/Select.js
|
||||
import { $html, $for } from "../sigpro.js";
|
||||
import { Tag, For } from "../sigpro.js";
|
||||
import { val, ui } from "../core/utils.js";
|
||||
|
||||
/**
|
||||
@@ -14,17 +14,17 @@ import { val, ui } from "../core/utils.js";
|
||||
export const Select = (props) => {
|
||||
const { class: className, label, items, value, ...rest } = props;
|
||||
|
||||
const selectEl = $html(
|
||||
const selectEl = Tag(
|
||||
"select",
|
||||
{
|
||||
...rest,
|
||||
class: ui('select select-bordered w-full', className),
|
||||
value: value
|
||||
},
|
||||
$for(
|
||||
For(
|
||||
() => val(items) || [],
|
||||
(opt) =>
|
||||
$html(
|
||||
Tag(
|
||||
"option",
|
||||
{
|
||||
value: opt.value,
|
||||
@@ -38,8 +38,8 @@ export const Select = (props) => {
|
||||
|
||||
if (!label) return selectEl;
|
||||
|
||||
return $html("label", { class: "fieldset-label flex flex-col gap-1" }, [
|
||||
$html("span", {}, label),
|
||||
return Tag("label", { class: "fieldset-label flex flex-col gap-1" }, [
|
||||
Tag("span", {}, label),
|
||||
selectEl
|
||||
]);
|
||||
};
|
||||
Reference in New Issue
Block a user