Docs
This commit is contained in:
18
dist/sigpro-ui.esm.js
vendored
18
dist/sigpro-ui.esm.js
vendored
@@ -992,17 +992,25 @@ var IndicatorModule = /*#__PURE__*/Object.freeze({
|
||||
|
||||
/** LIST */
|
||||
const List = (props) => {
|
||||
const { items, header, render, keyFn, class: className } = props;
|
||||
const { items, header, render, keyFn, class: className, ...rest } = props;
|
||||
|
||||
const headerItem = header
|
||||
? $html("li", { class: "p-4 pb-2 text-xs opacity-60 tracking-wide" }, [val(header)])
|
||||
: null;
|
||||
|
||||
const listItems = $for(
|
||||
items,
|
||||
(item, index) => $html("li", { class: "list-row" }, [render(item, index)]),
|
||||
keyFn
|
||||
);
|
||||
|
||||
return $html(
|
||||
"ul",
|
||||
{
|
||||
...rest,
|
||||
class: joinClass("list bg-base-100 rounded-box shadow-md", className),
|
||||
},
|
||||
[
|
||||
$if(header, () => $html("li", { class: "p-4 pb-2 text-xs opacity-60 tracking-wide" }, [val(header)])),
|
||||
$for(items, (item, index) => $html("li", { class: "list-row" }, [render(item, index)]), keyFn),
|
||||
],
|
||||
header ? [headerItem, listItems] : listItems
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user