Filter colours to match group
Expand units tick box
This commit is contained in:
fraxle
2026-05-25 00:30:56 +01:00
parent 5574690887
commit 8aee90a56f
6 changed files with 182 additions and 98 deletions
+4 -3
View File
@@ -39,7 +39,7 @@ const html = htm.bind(h);
// groupedLeft - bool - fuse right side with a VentPill
// isLastChild - bool - restore right border-radius when no sibling follows
// -------------------------------------------------------------------
export function CustomSelect({ value, options, onChange, hideLabel, hidingLabel, buttonLabel, isOn, noHide, groupedLeft, isLastChild }) {
export function CustomSelect({ value, options, onChange, hideLabel, hidingLabel, buttonLabel, isOn, noHide, groupedLeft, isLastChild, grpClass }) {
const [open, setOpen] = useState(false);
const wrapRef = useRef(null);
@@ -68,6 +68,7 @@ export function CustomSelect({ value, options, onChange, hideLabel, hidingLabel,
const btnClass = [
'cs-btn',
grpClass || '',
isOn ? 'on' : '',
groupedLeft ? 'grouped-left' : '',
(groupedLeft && isLastChild) ? 'last-child' : '',
@@ -120,9 +121,9 @@ export function CustomSelect({ value, options, onChange, hideLabel, hidingLabel,
// label - string
// title - tooltip string
// -------------------------------------------------------------------
export function VentPill({ checked, onChange, label, title }) {
export function VentPill({ checked, onChange, label, title, grpClass }) {
return html`
<label class=${`cs-vent${checked ? ' on' : ''}`} title=${title}>
<label class=${[`cs-vent`, grpClass || '', checked ? 'on' : ''].filter(Boolean).join(' ')} title=${title}>
<input
type="checkbox"
checked=${checked}