Rebuild all components
All checks were successful
Deploy Docs to Synology / deploy (push) Successful in 4s

This commit is contained in:
2026-04-21 18:00:17 +02:00
parent d900659d88
commit 16afea2768
67 changed files with 1820 additions and 2132 deletions

View File

@@ -2,23 +2,19 @@
import { Tag } from "sigpro";
export const Rating = (props, children) => {
const { class: className, count, mask = "mask-star", value, onchange, ...rest } = props;
children === undefined && (children = props, props = {});
const name = `rating-${Math.random().toString(36).slice(2, 7)}`;
return Tag("div", {
...rest,
class: `rating ${className || ''}`.trim()
}, children || Array.from({ length: count || 5 }, (_, i) => {
return Tag("div", { ...props, class: `rating ${props.class ?? ''}` }, children || Array.from({ length: props.count || 5 }, (_, i) => {
const starValue = i + 1;
return Tag("input", {
type: "radio",
name,
class: `mask ${mask}`,
checked: () => typeof value === "function" ? value() === starValue : value === starValue,
class: `mask ${props.mask || "mask-star"}`,
checked: () => typeof props.value === "function" ? props.value() === starValue : props.value === starValue,
onchange: () => {
if (onchange) onchange(starValue);
else if (typeof value === "function") value(starValue);
if (props.onchange) props.onchange(starValue);
else if (typeof props.value === "function") props.value(starValue);
}
});
}));