Updateing Docs
This commit is contained in:
@@ -1,14 +1,25 @@
|
||||
// components/Checkbox.js
|
||||
import { $html } from "sigpro";
|
||||
import { val } from "../core/utils.js";
|
||||
import { val, ui } from "../core/utils.js";
|
||||
|
||||
/** CHECKBOX */
|
||||
/**
|
||||
* Checkbox component
|
||||
*
|
||||
* daisyUI classes used:
|
||||
* - checkbox, checkbox-primary, checkbox-secondary, checkbox-accent
|
||||
* - checkbox-info, checkbox-success, checkbox-warning, checkbox-error
|
||||
* - checkbox-xs, checkbox-sm, checkbox-md, checkbox-lg
|
||||
* - toggle, toggle-primary, toggle-secondary, toggle-accent
|
||||
* - toggle-xs, toggle-sm, toggle-md, toggle-lg
|
||||
* - label, label-text, cursor-pointer
|
||||
*/
|
||||
export const Checkbox = (props) => {
|
||||
const { value, tooltip, toggle, label, ...rest } = props;
|
||||
const { class: className, value, tooltip, toggle, label, ...rest } = props;
|
||||
|
||||
const checkEl = $html("input", {
|
||||
...rest,
|
||||
type: "checkbox",
|
||||
class: () => (val(toggle) ? "toggle" : "checkbox"),
|
||||
class: () => ui(val(toggle) ? "toggle" : "checkbox", className),
|
||||
checked: value
|
||||
});
|
||||
|
||||
@@ -18,4 +29,4 @@ export const Checkbox = (props) => {
|
||||
]);
|
||||
|
||||
return tooltip ? $html("div", { class: "tooltip", "data-tip": tooltip }, layout) : layout;
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user