improved
This commit is contained in:
@@ -890,13 +890,20 @@ export const UI = ($, defaultLang = "es") => {
|
||||
|
||||
/** FIELDSET */
|
||||
ui.Fieldset = (props, children) =>
|
||||
$.html("fieldset", { ...props, class: joinClass("fieldset bg-base-200 border border-base-300 p-4 rounded-lg", props.$class || props.class) }, [
|
||||
ui.If(
|
||||
() => props.legend,
|
||||
() => $.html("legend", { class: "fieldset-legend font-bold" }, props.legend),
|
||||
),
|
||||
children,
|
||||
]);
|
||||
$.html(
|
||||
"fieldset",
|
||||
{
|
||||
...props,
|
||||
class: joinClass("fieldset bg-base-200 border border-base-300 p-4 rounded-lg", props.$class || props.class),
|
||||
},
|
||||
[
|
||||
() => {
|
||||
const legendText = val(props.legend);
|
||||
return legendText ? $.html("legend", { class: "fieldset-legend font-bold" }, [legendText]) : null;
|
||||
},
|
||||
children,
|
||||
],
|
||||
);
|
||||
|
||||
/** STACK */
|
||||
ui.Stack = (props, children) => $.html("div", { ...props, class: joinClass("stack", props.$class || props.class) }, children);
|
||||
|
||||
Reference in New Issue
Block a user