Updateing Docs
This commit is contained in:
@@ -1,19 +1,28 @@
|
||||
// components/Select.js
|
||||
import { $html, $for } from "sigpro";
|
||||
import { val, joinClass } from "../core/utils.js";
|
||||
import { val, ui } from "../core/utils.js";
|
||||
|
||||
/** SELECT */
|
||||
/**
|
||||
* Select component
|
||||
*
|
||||
* daisyUI classes used:
|
||||
* - select, select-bordered, select-primary, select-secondary
|
||||
* - select-accent, select-info, select-success, select-warning, select-error
|
||||
* - select-xs, select-sm, select-md, select-lg
|
||||
* - fieldset-label, flex, flex-col, gap-1, w-full
|
||||
*/
|
||||
export const Select = (props) => {
|
||||
const { label, options, value, ...rest } = props;
|
||||
const { class: className, label, items, value, ...rest } = props;
|
||||
|
||||
const selectEl = $html(
|
||||
"select",
|
||||
{
|
||||
...rest,
|
||||
class: joinClass("select select-bordered w-full", props.class),
|
||||
class: ui('select select-bordered w-full', className),
|
||||
value: value
|
||||
},
|
||||
$for(
|
||||
() => val(options) || [],
|
||||
() => val(items) || [],
|
||||
(opt) =>
|
||||
$html(
|
||||
"option",
|
||||
@@ -33,4 +42,4 @@ export const Select = (props) => {
|
||||
$html("span", {}, label),
|
||||
selectEl
|
||||
]);
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user