@ecopages/radiant-ui 0.1.0-rc.7 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -3
- package/dist/components/ui/alert/alert.d.ts +2 -4
- package/dist/components/ui/alert/alert.script.d.ts +25 -15
- package/dist/components/ui/autocomplete/autocomplete.css +1 -2
- package/dist/components/ui/autocomplete/autocomplete.d.ts +8 -3
- package/dist/components/ui/autocomplete/autocomplete.script.d.ts +29 -4
- package/dist/components/ui/avatar/avatar.css +10 -8
- package/dist/components/ui/avatar/avatar.d.ts +3 -1
- package/dist/components/ui/breadcrumb/breadcrumb.d.ts +11 -11
- package/dist/components/ui/breadcrumb/breadcrumb.script.d.ts +10 -10
- package/dist/components/ui/calendar/calendar.css +10 -5
- package/dist/components/ui/calendar/calendar.script.d.ts +24 -21
- package/dist/components/ui/calendar/index.js +1 -1
- package/dist/components/ui/calendar/index.js.map +3 -3
- package/dist/components/ui/carousel/carousel-autoplay.d.ts +22 -0
- package/dist/components/ui/carousel/carousel-swipe.d.ts +17 -0
- package/dist/components/ui/carousel/carousel-window.d.ts +63 -0
- package/dist/components/ui/carousel/carousel.css +71 -18
- package/dist/components/ui/carousel/carousel.d.ts +8 -4
- package/dist/components/ui/carousel/carousel.script.d.ts +73 -40
- package/dist/components/ui/carousel/index.js +1 -1
- package/dist/components/ui/carousel/index.js.map +4 -4
- package/dist/components/ui/checkbox/checkbox.d.ts +11 -0
- package/dist/components/ui/checkbox/checkbox.script.d.ts +31 -8
- package/dist/components/ui/checkbox/index.js +1 -1
- package/dist/components/ui/checkbox/index.js.map +4 -4
- package/dist/components/ui/checkbox-group/checkbox-group.d.ts +4 -2
- package/dist/components/ui/checkbox-group/checkbox-group.script.d.ts +39 -20
- package/dist/components/ui/checkbox-group/index.js +1 -1
- package/dist/components/ui/checkbox-group/index.js.map +4 -4
- package/dist/components/ui/combobox/combobox.css +9 -1
- package/dist/components/ui/combobox/combobox.d.ts +12 -4
- package/dist/components/ui/combobox/combobox.script.d.ts +74 -25
- package/dist/components/ui/combobox/index.d.ts +2 -2
- package/dist/components/ui/combobox/index.js +1 -1
- package/dist/components/ui/combobox/index.js.map +4 -4
- package/dist/components/ui/cycle-toggle/cycle-toggle.d.ts +6 -2
- package/dist/components/ui/cycle-toggle/cycle-toggle.script.d.ts +35 -4
- package/dist/components/ui/cycle-toggle/index.js +1 -1
- package/dist/components/ui/cycle-toggle/index.js.map +3 -3
- package/dist/components/ui/date-field/date-field.css +13 -17
- package/dist/components/ui/date-field/date-field.d.ts +10 -8
- package/dist/components/ui/date-field/date-field.script.d.ts +35 -52
- package/dist/components/ui/date-field/index.js +1 -1
- package/dist/components/ui/date-field/index.js.map +4 -4
- package/dist/components/ui/date-input/date-input-segment-dom.d.ts +24 -0
- package/dist/components/ui/date-input/date-input.css +50 -0
- package/dist/components/ui/date-input/date-input.d.ts +8 -0
- package/dist/components/ui/date-input/date-input.script.d.ts +137 -0
- package/dist/components/ui/date-input/index.d.ts +2 -0
- package/dist/components/ui/date-input/index.js +2 -0
- package/dist/components/ui/date-input/index.js.map +7 -0
- package/dist/components/ui/date-range-picker/date-range-picker.css +18 -19
- package/dist/components/ui/date-range-picker/date-range-picker.d.ts +11 -9
- package/dist/components/ui/date-range-picker/date-range-picker.script.d.ts +42 -51
- package/dist/components/ui/date-range-picker/index.js +1 -1
- package/dist/components/ui/date-range-picker/index.js.map +4 -4
- package/dist/components/ui/dialog/dialog.css +18 -14
- package/dist/components/ui/dialog/dialog.d.ts +6 -0
- package/dist/components/ui/dialog/dialog.script.d.ts +43 -10
- package/dist/components/ui/dialog/index.js +1 -1
- package/dist/components/ui/dialog/index.js.map +4 -4
- package/dist/components/ui/disclosure/disclosure-group.script.d.ts +19 -3
- package/dist/components/ui/disclosure/disclosure.css +3 -6
- package/dist/components/ui/disclosure/disclosure.d.ts +23 -7
- package/dist/components/ui/disclosure/disclosure.script.d.ts +31 -7
- package/dist/components/ui/disclosure/index.d.ts +1 -1
- package/dist/components/ui/disclosure/index.js +1 -1
- package/dist/components/ui/disclosure/index.js.map +4 -4
- package/dist/components/ui/field/field-description.d.ts +1 -0
- package/dist/components/ui/field/field-error.d.ts +2 -2
- package/dist/components/ui/field/field.d.ts +4 -4
- package/dist/components/ui/field/field.script.d.ts +54 -24
- package/dist/components/ui/field/index.js +1 -1
- package/dist/components/ui/field/index.js.map +4 -4
- package/dist/components/ui/form/control-protocol.d.ts +38 -1
- package/dist/components/ui/form/form-context.d.ts +3 -0
- package/dist/components/ui/form/form.d.ts +6 -0
- package/dist/components/ui/form/form.script.d.ts +29 -12
- package/dist/components/ui/form/index.d.ts +2 -1
- package/dist/components/ui/form/index.js +1 -1
- package/dist/components/ui/form/index.js.map +4 -4
- package/dist/components/ui/grid/grid.d.ts +4 -3
- package/dist/components/ui/grid/grid.script.d.ts +19 -11
- package/dist/components/ui/hover-card/hover-card.css +12 -101
- package/dist/components/ui/hover-card/hover-card.d.ts +7 -2
- package/dist/components/ui/hover-card/hover-card.script.d.ts +36 -5
- package/dist/components/ui/hover-card/index.js +1 -1
- package/dist/components/ui/hover-card/index.js.map +4 -4
- package/dist/components/ui/input/index.js +1 -1
- package/dist/components/ui/input/index.js.map +4 -4
- package/dist/components/ui/input/input.css +1 -1
- package/dist/components/ui/knob/index.js +1 -1
- package/dist/components/ui/knob/index.js.map +3 -3
- package/dist/components/ui/knob/knob.css +6 -1
- package/dist/components/ui/knob/knob.d.ts +4 -4
- package/dist/components/ui/knob/knob.script.d.ts +55 -20
- package/dist/components/ui/label/index.js +1 -1
- package/dist/components/ui/label/index.js.map +4 -4
- package/dist/components/ui/label/label.d.ts +2 -1
- package/dist/components/ui/listbox/index.d.ts +2 -2
- package/dist/components/ui/listbox/index.js +1 -1
- package/dist/components/ui/listbox/index.js.map +4 -4
- package/dist/components/ui/listbox/listbox.css +14 -0
- package/dist/components/ui/listbox/listbox.d.ts +16 -2
- package/dist/components/ui/listbox/listbox.script.d.ts +55 -12
- package/dist/components/ui/menu-button/index.js +1 -1
- package/dist/components/ui/menu-button/index.js.map +4 -4
- package/dist/components/ui/menu-button/menu-button.d.ts +2 -2
- package/dist/components/ui/menu-button/menu-button.script.d.ts +30 -27
- package/dist/components/ui/menubar/index.js +1 -1
- package/dist/components/ui/menubar/index.js.map +4 -4
- package/dist/components/ui/menubar/menubar.script.d.ts +41 -15
- package/dist/components/ui/meter/index.js +1 -1
- package/dist/components/ui/meter/index.js.map +3 -3
- package/dist/components/ui/meter/meter.css +27 -2
- package/dist/components/ui/meter/meter.script.d.ts +19 -14
- package/dist/components/ui/navigation-menu/index.d.ts +1 -1
- package/dist/components/ui/navigation-menu/index.js +1 -1
- package/dist/components/ui/navigation-menu/index.js.map +4 -4
- package/dist/components/ui/navigation-menu/navigation-menu.css +32 -34
- package/dist/components/ui/navigation-menu/navigation-menu.d.ts +34 -5
- package/dist/components/ui/navigation-menu/navigation-menu.script.d.ts +93 -12
- package/dist/components/ui/number-field/index.js +1 -1
- package/dist/components/ui/number-field/index.js.map +4 -4
- package/dist/components/ui/number-field/number-field.css +1 -1
- package/dist/components/ui/number-field/number-field.d.ts +8 -19
- package/dist/components/ui/number-field/number-field.script.d.ts +30 -9
- package/dist/components/ui/pagination/index.d.ts +1 -1
- package/dist/components/ui/pagination/index.js +1 -1
- package/dist/components/ui/pagination/index.js.map +3 -3
- package/dist/components/ui/pagination/pagination.css +50 -13
- package/dist/components/ui/pagination/pagination.d.ts +33 -9
- package/dist/components/ui/pagination/pagination.script.d.ts +29 -9
- package/dist/components/ui/popover/index.js +1 -1
- package/dist/components/ui/popover/index.js.map +4 -4
- package/dist/components/ui/popover/popover.d.ts +17 -1
- package/dist/components/ui/popover/popover.script.d.ts +57 -9
- package/dist/components/ui/radio-group/index.js +1 -1
- package/dist/components/ui/radio-group/index.js.map +4 -4
- package/dist/components/ui/radio-group/radio-group.d.ts +2 -2
- package/dist/components/ui/radio-group/radio-group.script.d.ts +35 -16
- package/dist/components/ui/select/index.d.ts +2 -2
- package/dist/components/ui/select/index.js +1 -1
- package/dist/components/ui/select/index.js.map +4 -4
- package/dist/components/ui/select/select.css +8 -6
- package/dist/components/ui/select/select.d.ts +18 -9
- package/dist/components/ui/select/select.script.d.ts +74 -26
- package/dist/components/ui/shared/calendar-popover-behavior.d.ts +27 -0
- package/dist/components/ui/shared/control-toggle.css +8 -4
- package/dist/components/ui/shared/field-label.d.ts +5 -0
- package/dist/components/ui/shared/listbox-host-controller.d.ts +41 -0
- package/dist/components/ui/shared/listbox-option.d.ts +4 -0
- package/dist/components/ui/shared/multi-value.d.ts +23 -1
- package/dist/components/ui/shared/numeric-range.d.ts +8 -0
- package/dist/components/ui/shared/popover.css +10 -99
- package/dist/components/ui/sidebar/index.d.ts +2 -1
- package/dist/components/ui/sidebar/index.js +1 -1
- package/dist/components/ui/sidebar/index.js.map +4 -4
- package/dist/components/ui/sidebar/sidebar-trigger.d.ts +12 -0
- package/dist/components/ui/sidebar/sidebar-trigger.script.d.ts +52 -31
- package/dist/components/ui/sidebar/sidebar.css +67 -61
- package/dist/components/ui/sidebar/sidebar.d.ts +9 -4
- package/dist/components/ui/sidebar/sidebar.script.d.ts +42 -20
- package/dist/components/ui/slider/index.js +1 -1
- package/dist/components/ui/slider/index.js.map +4 -4
- package/dist/components/ui/slider/slider.css +5 -5
- package/dist/components/ui/slider/slider.d.ts +20 -10
- package/dist/components/ui/slider/slider.script.d.ts +103 -27
- package/dist/components/ui/switch/index.js +1 -1
- package/dist/components/ui/switch/index.js.map +4 -4
- package/dist/components/ui/switch/switch.css +28 -22
- package/dist/components/ui/switch/switch.d.ts +13 -0
- package/dist/components/ui/switch/switch.script.d.ts +34 -8
- package/dist/components/ui/table/index.js +1 -1
- package/dist/components/ui/table/index.js.map +4 -4
- package/dist/components/ui/table/table.d.ts +9 -7
- package/dist/components/ui/table/table.script.d.ts +55 -12
- package/dist/components/ui/tabs/tabs.css +18 -12
- package/dist/components/ui/tabs/tabs.d.ts +7 -4
- package/dist/components/ui/tabs/tabs.script.d.ts +39 -9
- package/dist/components/ui/tag-group/index.js +1 -1
- package/dist/components/ui/tag-group/index.js.map +4 -4
- package/dist/components/ui/tag-group/tag-group.d.ts +19 -7
- package/dist/components/ui/tag-group/tag-group.script.d.ts +58 -10
- package/dist/components/ui/textarea/index.js +1 -1
- package/dist/components/ui/textarea/index.js.map +4 -4
- package/dist/components/ui/textarea/textarea.css +1 -1
- package/dist/components/ui/toast/index.js +1 -1
- package/dist/components/ui/toast/index.js.map +4 -4
- package/dist/components/ui/toast/toast.css +35 -32
- package/dist/components/ui/toast/toast.script.d.ts +17 -31
- package/dist/components/ui/toast/toaster.script.d.ts +24 -12
- package/dist/components/ui/toc/toc.script.d.ts +19 -8
- package/dist/components/ui/toolbar/toolbar.d.ts +5 -0
- package/dist/components/ui/toolbar/toolbar.script.d.ts +24 -4
- package/dist/components/ui/tooltip/index.js +1 -1
- package/dist/components/ui/tooltip/index.js.map +4 -4
- package/dist/components/ui/tooltip/tooltip.css +14 -94
- package/dist/components/ui/tooltip/tooltip.d.ts +7 -0
- package/dist/components/ui/tooltip/tooltip.script.d.ts +36 -6
- package/dist/components/ui/tree/tree.d.ts +4 -3
- package/dist/components/ui/tree/tree.script.d.ts +28 -15
- package/dist/components/ui/treegrid/treegrid.d.ts +5 -3
- package/dist/components/ui/treegrid/treegrid.script.d.ts +33 -14
- package/dist/components/ui/window-splitter/index.d.ts +1 -1
- package/dist/components/ui/window-splitter/index.js +1 -1
- package/dist/components/ui/window-splitter/index.js.map +3 -3
- package/dist/components/ui/window-splitter/window-splitter.d.ts +10 -1
- package/dist/components/ui/window-splitter/window-splitter.script.d.ts +26 -8
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +4 -4
- package/dist/lib/icons/check.d.ts +3 -0
- package/dist/lib/icons/chevron-down.d.ts +0 -1
- package/dist/lib/icons/index.d.ts +2 -0
- package/dist/lib/icons/x.d.ts +5 -0
- package/dist/lib/intl-date/index.d.ts +4 -2
- package/dist/lib/intl-date/segment-editing.d.ts +34 -0
- package/dist/lib/intl-date/segments.d.ts +26 -4
- package/dist/lib/non-empty.d.ts +6 -0
- package/dist/lib/unique-id.d.ts +11 -0
- package/dist/lib/viewport/breakpoints.d.ts +6 -0
- package/dist/lib/viewport/mobile-layout.d.ts +15 -0
- package/dist/styles/primitives.css +14 -11
- package/dist/styles/radiant-ui-core.css +10 -0
- package/dist/styles/radiant-ui.css +40 -11
- package/dist/styles/style-dependencies.json +38 -13
- package/dist/styles/styles.css +485 -252
- package/dist/styles/tailwind.css +40 -101
- package/dist/styles/tokens/presets/colors/aurora.css +2 -0
- package/dist/styles/tokens/presets/colors/basalt.css +2 -0
- package/dist/styles/tokens/presets/colors/ember.css +2 -0
- package/dist/styles/tokens/presets/colors/glacier.css +2 -0
- package/dist/styles/tokens/semantic.css +1 -0
- package/dist/styles/tokens/system.css +11 -3
- package/dist/styles/tokens/typography/default.css +8 -0
- package/package.json +27 -13
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
import type { JsxCustomElementAttributes } from '@ecopages/jsx';
|
|
2
2
|
import { type RuiCheckbox as RuiCheckboxElement, type RuiCheckboxProps } from './checkbox.script';
|
|
3
3
|
import './checkbox.script';
|
|
4
|
+
/**
|
|
5
|
+
* Checkbox view. Stamps `[data-ref="input"]` on a native checkbox inside a label row.
|
|
6
|
+
*
|
|
7
|
+
* @cssclass rui-checkbox - Label row: box + visible label.
|
|
8
|
+
* @cssclass rui-checkbox__input - Native input (visually hidden, receives focus).
|
|
9
|
+
* @cssclass rui-checkbox__control - Visible box with check / indeterminate glyph.
|
|
10
|
+
* @cssclass rui-checkbox__label - Light-DOM label text.
|
|
11
|
+
*
|
|
12
|
+
* @remarks Children render in `rui-checkbox__label`. The input always carries
|
|
13
|
+
* `data-rui-control` and `data-rui-control-type="boolean"`.
|
|
14
|
+
*/
|
|
4
15
|
export declare function RuiCheckbox({ children, checked, disabled, indeterminate, name, value, ...props }: JsxCustomElementAttributes<RuiCheckboxElement, RuiCheckboxProps>): import("@ecopages/jsx").JsxRenderable;
|
|
@@ -35,21 +35,47 @@ export declare const CHECKBOX_DEFAULT_VALUE = "on";
|
|
|
35
35
|
/**
|
|
36
36
|
* `<rui-checkbox>` — a dual-state or tri-state checkbox.
|
|
37
37
|
*
|
|
38
|
+
* The custom element is a behavior host: it does not render checkbox markup.
|
|
39
|
+
* Import the script and place light-DOM children that match the contract below,
|
|
40
|
+
* or use `RuiCheckbox`, which stamps the same targets.
|
|
41
|
+
*
|
|
38
42
|
* Implements the WAI-ARIA APG Checkbox pattern on a native
|
|
39
43
|
* `<input type="checkbox">`. Checked state uses the HTML `checked` attribute;
|
|
40
44
|
* the mixed state uses the `indeterminate` IDL property with `aria-checked="mixed"`.
|
|
41
45
|
*
|
|
46
|
+
* ## Light-DOM contract
|
|
47
|
+
*
|
|
48
|
+
* Required:
|
|
49
|
+
* - `[data-ref="input"]` — native `<input type="checkbox">`. Host syncs `checked`,
|
|
50
|
+
* `indeterminate`, `disabled`, `value`, `name`, and `aria-checked="mixed"` when
|
|
51
|
+
* `indeterminate` is true.
|
|
52
|
+
*
|
|
53
|
+
* Optional:
|
|
54
|
+
* - Label row and visible label text — presentation only; the host does not query them.
|
|
55
|
+
*
|
|
56
|
+
* Do not fight host-owned input state (`checked`, `indeterminate`, `disabled`, `value`,
|
|
57
|
+
* `name`, `aria-checked`). Author `data-disabled` on the host when the view needs a
|
|
58
|
+
* stable disabled marker for group controllers.
|
|
59
|
+
*
|
|
60
|
+
* Nested hosts: none.
|
|
61
|
+
*
|
|
42
62
|
* @see https://www.w3.org/WAI/ARIA/apg/patterns/checkbox/
|
|
43
63
|
*
|
|
44
64
|
* Keyboard interaction (native to the checkbox):
|
|
45
65
|
* - `Space`: toggle checked state
|
|
46
66
|
*
|
|
47
67
|
* @element rui-checkbox
|
|
48
|
-
* @
|
|
49
|
-
* @
|
|
50
|
-
* @
|
|
51
|
-
* @
|
|
52
|
-
* @
|
|
68
|
+
* @attr {boolean} checked - Whether the checkbox is checked. Default: `false`.
|
|
69
|
+
* @attr {boolean} indeterminate - Partially checked (mixed) state. Default: `false`.
|
|
70
|
+
* @attr {boolean} disabled - Disable the checkbox. Default: `false`.
|
|
71
|
+
* @attr {string} value - Value submitted with forms when checked. Default: `on`.
|
|
72
|
+
* @attr {string} name - Form field name on the inner input. Default: `''`.
|
|
73
|
+
* @fires rui-change - Emitted after the checked/indeterminate state changes;
|
|
74
|
+
* `detail.checked` and `detail.indeterminate`.
|
|
75
|
+
*
|
|
76
|
+
* @remarks
|
|
77
|
+
* Minimum tree: `<input type="checkbox" data-ref="input" data-rui-control>`.
|
|
78
|
+
* BEM classes live on the view; the host never queries them.
|
|
53
79
|
*/
|
|
54
80
|
export declare class RuiCheckbox extends RadiantElement {
|
|
55
81
|
checked: boolean;
|
|
@@ -57,9 +83,6 @@ export declare class RuiCheckbox extends RadiantElement {
|
|
|
57
83
|
disabled: boolean;
|
|
58
84
|
value: string;
|
|
59
85
|
name: string;
|
|
60
|
-
inputTarget: HTMLInputElement;
|
|
61
86
|
changeEvent: EventEmitter<RuiCheckboxChangeDetail>;
|
|
62
|
-
protected onConnected(): void;
|
|
63
|
-
syncInputState(): void;
|
|
64
87
|
onInputChange(event: Event): void;
|
|
65
88
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{RadiantElement as
|
|
1
|
+
import{RadiantElement as Ee,bindTo as C,customElement as De,event as Re,onEvent as Ve,prop as S}from"@ecopages/radiant";function ae(e){return e||void 0}var ce,ue,se,le,de,pe,fe,he,me,be,ve,_e,ye,ge;function je(e,t,c,b,T,E){var v,o,L,U,D,K,k,W=Symbol.metadata||Symbol.for("Symbol.metadata"),Y=Object.defineProperty,z=Object.create,Z=[z(null),z(null)],$=t.length;function R(n,p,l){return function(i,r){p&&(r=i,i=e);for(var f=0;f<n.length;f++)r=n[f].apply(i,l?[r]:[]);return l?r:i}}function _(n,p,l,i){if(typeof n!="function"&&(i||n!==void 0))throw new TypeError(p+" must "+(l||"be")+" a function"+(i?"":" or undefined"));return n}function H(n,p,l,i,r,f,g,d,h,m,P){function X(u){if(!P(u))throw new TypeError("Attempted to access private element on non-instance")}var q=[].concat(p[0]),N=p[3],G=!g,w=r===1,ee=r===3,te=r===4,V=r===2;function I(u,x,re){return function(B,oe){return x&&(oe=B,B=n),re&&re(B),a[u].call(B,oe)}}if(!G){var a={},J=[],y=ee?"get":te||w?"set":"value";if(h?(m||w?a={get:xe(function(){return N(this)},i,"get"),set:function(u){p[4](this,u)}}:a[y]=N,m||xe(a[y],i,V?"":y)):m||(a=Object.getOwnPropertyDescriptor(n,i)),!m&&!h){if((o=Z[+d][i])&&(o^r)!==7)throw Error("Decorating two elements with the same name ("+a[y].name+") is not supported yet");Z[+d][i]=r<3?1:r}}for(var s=n,A=q.length-1;A>=0;A-=l?2:1){var ne=_(q[A],"A decorator","be",!0),ie=l?q[A-1]:void 0,M={},j={kind:["field","accessor","method","getter","setter","class"][r],name:i,metadata:v,addInitializer:function(u,x){if(u.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(x,"An initializer","be",!0),f.push(x)}.bind(null,M)};if(G)o=ne.call(ie,s,j),M.v=1,_(o,"class decorators","return")&&(s=o);else if(j.static=d,j.private=h,o=j.access={has:h?P.bind():function(u){return i in u}},te||(o.get=h?V?function(u){return X(u),a.value}:I("get",0,X):function(u){return u[i]}),V||ee||(o.set=h?I("set",0,X):function(u,x){u[i]=x}),s=ne.call(ie,w?{get:a.get,set:a.set}:a[y],j),M.v=1,w){if(typeof s=="object"&&s)(o=_(s.get,"accessor.get"))&&(a.get=o),(o=_(s.set,"accessor.set"))&&(a.set=o),(o=_(s.init,"accessor.init"))&&J.unshift(o);else if(s!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(s,(m?"field":"method")+" decorators","return")&&(m?J.unshift(s):a[y]=s)}return r<2&&g.push(R(J,d,1),R(f,d,0)),m||G||(h?w?g.splice(-1,0,I("get",d),I("set",d)):g.push(V?a[y]:_.call.bind(a[y])):Y(n,i,a)),s}function F(n){return Y(n,W,{configurable:!0,enumerable:!0,value:v})}return E!==void 0&&(v=E[W]),v=z(v??null),D=[],K=function(n){n&&D.push(R(n))},k=function(n,p){for(var l=0;l<c.length;l++){var i=c[l],r=i[1],f=7&r;if((8&r)==n&&!f==p){var g=i[2],d=!!i[3],h=16&r;H(n?e:e.prototype,i,h,d?"#"+g:Ce(g),f,f<2?[]:n?U=U||[]:L=L||[],D,!!n,d,p,n&&d?function(m){return Te(m)===e}:T)}}},k(8,0),k(0,0),k(8,1),k(0,1),K(L),K(U),o=D,$||F(e),{e:o,get c(){var n=[];return $&&[F(e=H(e,[t],b,e.name,5,n)),R(n,1)]}}}function Ce(e){var t=Se(e,"string");return typeof t=="symbol"?t:t+""}function Se(e,t){if(typeof e!="object"||!e)return e;var c=e[Symbol.toPrimitive];if(c!==void 0){var b=c.call(e,t||"default");if(typeof b!="object")return b;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function xe(e,t,c){typeof t=="symbol"&&(t=(t=t.description)?"["+t+"]":"");try{Object.defineProperty(e,"name",{configurable:!0,value:c?c+" "+t:t})}catch{}return e}function Te(e){if(Object(e)!==e)throw TypeError("right-hand side of 'in' should be an object, got "+(e!==null?typeof e:"null"));return e}var Q="on",we,ke=class extends Ee{static{({e:[se,le,de,pe,fe,he,me,be,ve,_e,ye,ge,ce],c:[we,ue]}=je(this,[De("rui-checkbox")],[[[S({type:Boolean,reflect:!0,defaultValue:!1}),C({ref:"input",prop:"checked"})],0,"checked"],[[S({type:Boolean,reflect:!0,defaultValue:!1}),C([{ref:"input",prop:"indeterminate"},{ref:"input",attr:"aria-checked",map:t=>t?"mixed":void 0}])],0,"indeterminate"],[[S({type:Boolean,reflect:!0,defaultValue:!1}),C({ref:"input",prop:"disabled"})],0,"disabled"],[[S({type:String,defaultValue:Q}),C({ref:"input",prop:"value"})],0,"value"],[[S({type:String,defaultValue:""}),C({ref:"input",attr:"name",map:ae})],0,"name"],[Re({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[Ve({ref:"input",type:"change"}),2,"onInputChange"]],0,void 0,Ee))}constructor(...t){super(...t),ge(this)}checked=(ce(this),se(this));indeterminate=(le(this),de(this));disabled=(pe(this),fe(this));value=(he(this),me(this));name=(be(this),ve(this));changeEvent=(_e(this),ye(this));onInputChange(t){let c=t.target;this.checked=c.checked,c.indeterminate=this.indeterminate,this.changeEvent.emit({checked:this.checked,indeterminate:this.indeterminate})}static{ue()}};import{jsx as O,jsxs as Ie}from"@ecopages/jsx/jsx-runtime";function Ae({children:e,checked:t,disabled:c,indeterminate:b,name:T,value:E=Q,...v}){return O("rui-checkbox",{...v,checked:t,disabled:c,indeterminate:b,name:T,value:E,"data-disabled":c?"":void 0,children:Ie("label",{class:"rui-checkbox",children:[O("input",{type:"checkbox","data-ref":"input","data-rui-control":!0,"data-rui-control-type":"boolean",class:"rui-checkbox__input",checked:t,disabled:c,value:E,name:T||void 0,"aria-checked":b?"mixed":void 0}),O("span",{class:"rui-checkbox__control","aria-hidden":"true"}),O("span",{class:"rui-checkbox__label",children:e})]})})}export{Ae as RuiCheckbox,we as RuiCheckboxElement};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../../src/components/ui/checkbox/checkbox.script.tsx", "../../../../src/components/ui/checkbox/checkbox.tsx"],
|
|
4
|
-
"sourcesContent": ["let _initProto, _initClass, _init_checked, _init_extra_checked, _init_indeterminate, _init_extra_indeterminate, _init_disabled, _init_extra_disabled, _init_value, _init_extra_value, _init_name, _init_extra_name,
|
|
5
|
-
"mappings": "AAMA,OAAS,kBAAAA,GAAgB,
|
|
6
|
-
"names": ["RadiantElement", "
|
|
3
|
+
"sources": ["../../../../src/components/ui/checkbox/checkbox.script.tsx", "../../../../src/lib/non-empty.ts", "../../../../src/components/ui/checkbox/checkbox.tsx"],
|
|
4
|
+
"sourcesContent": ["let _initProto, _initClass, _init_checked, _init_extra_checked, _init_indeterminate, _init_extra_indeterminate, _init_disabled, _init_extra_disabled, _init_value, _init_extra_value, _init_name, _init_extra_name, _init_changeEvent, _init_extra_changeEvent;\nfunction _applyDecs(e, t, n, r, o, i) { var a, c, u, s, f, l, p, d = Symbol.metadata || Symbol.for(\"Symbol.metadata\"), m = Object.defineProperty, h = Object.create, y = [h(null), h(null)], v = t.length; function g(t, n, r) { return function (o, i) { n && (i = o, o = e); for (var a = 0; a < t.length; a++) i = t[a].apply(o, r ? [i] : []); return r ? i : o; }; } function b(e, t, n, r) { if (\"function\" != typeof e && (r || void 0 !== e)) throw new TypeError(t + \" must \" + (n || \"be\") + \" a function\" + (r ? \"\" : \" or undefined\")); return e; } function applyDec(e, t, n, r, o, i, u, s, f, l, p) { function d(e) { if (!p(e)) throw new TypeError(\"Attempted to access private element on non-instance\"); } var h = [].concat(t[0]), v = t[3], w = !u, D = 1 === o, S = 3 === o, j = 4 === o, E = 2 === o; function I(t, n, r) { return function (o, i) { return n && (i = o, o = e), r && r(o), P[t].call(o, i); }; } if (!w) { var P = {}, k = [], F = S ? \"get\" : j || D ? \"set\" : \"value\"; if (f ? (l || D ? P = { get: _setFunctionName(function () { return v(this); }, r, \"get\"), set: function (e) { t[4](this, e); } } : P[F] = v, l || _setFunctionName(P[F], r, E ? \"\" : F)) : l || (P = Object.getOwnPropertyDescriptor(e, r)), !l && !f) { if ((c = y[+s][r]) && 7 !== (c ^ o)) throw Error(\"Decorating two elements with the same name (\" + P[F].name + \") is not supported yet\"); y[+s][r] = o < 3 ? 1 : o; } } for (var N = e, O = h.length - 1; O >= 0; O -= n ? 2 : 1) { var T = b(h[O], \"A decorator\", \"be\", !0), z = n ? h[O - 1] : void 0, A = {}, H = { kind: [\"field\", \"accessor\", \"method\", \"getter\", \"setter\", \"class\"][o], name: r, metadata: a, addInitializer: function (e, t) { if (e.v) throw new TypeError(\"attempted to call addInitializer after decoration was finished\"); b(t, \"An initializer\", \"be\", !0), i.push(t); }.bind(null, A) }; if (w) c = T.call(z, N, H), A.v = 1, b(c, \"class decorators\", \"return\") && (N = c);else if (H.static = s, H.private = f, c = H.access = { has: f ? p.bind() : function (e) { return r in e; } }, j || (c.get = f ? E ? function (e) { return d(e), P.value; } : I(\"get\", 0, d) : function (e) { return e[r]; }), E || S || (c.set = f ? I(\"set\", 0, d) : function (e, t) { e[r] = t; }), N = T.call(z, D ? { get: P.get, set: P.set } : P[F], H), A.v = 1, D) { if (\"object\" == typeof N && N) (c = b(N.get, \"accessor.get\")) && (P.get = c), (c = b(N.set, \"accessor.set\")) && (P.set = c), (c = b(N.init, \"accessor.init\")) && k.unshift(c);else if (void 0 !== N) throw new TypeError(\"accessor decorators must return an object with get, set, or init properties or undefined\"); } else b(N, (l ? \"field\" : \"method\") + \" decorators\", \"return\") && (l ? k.unshift(N) : P[F] = N); } return o < 2 && u.push(g(k, s, 1), g(i, s, 0)), l || w || (f ? D ? u.splice(-1, 0, I(\"get\", s), I(\"set\", s)) : u.push(E ? P[F] : b.call.bind(P[F])) : m(e, r, P)), N; } function w(e) { return m(e, d, { configurable: !0, enumerable: !0, value: a }); } return void 0 !== i && (a = i[d]), a = h(null == a ? null : a), f = [], l = function (e) { e && f.push(g(e)); }, p = function (t, r) { for (var i = 0; i < n.length; i++) { var a = n[i], c = a[1], l = 7 & c; if ((8 & c) == t && !l == r) { var p = a[2], d = !!a[3], m = 16 & c; applyDec(t ? e : e.prototype, a, m, d ? \"#\" + p : _toPropertyKey(p), l, l < 2 ? [] : t ? s = s || [] : u = u || [], f, !!t, d, r, t && d ? function (t) { return _checkInRHS(t) === e; } : o); } } }, p(8, 0), p(0, 0), p(8, 1), p(0, 1), l(u), l(s), c = f, v || w(e), { e: c, get c() { var n = []; return v && [w(e = applyDec(e, [t], r, e.name, 5, n)), g(n, 1)]; } }; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == typeof i ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != typeof i) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _setFunctionName(e, t, n) { \"symbol\" == typeof t && (t = (t = t.description) ? \"[\" + t + \"]\" : \"\"); try { Object.defineProperty(e, \"name\", { configurable: !0, value: n ? n + \" \" + t : t }); } catch (e) {} return e; }\nfunction _checkInRHS(e) { if (Object(e) !== e) throw TypeError(\"right-hand side of 'in' should be an object, got \" + (null !== e ? typeof e : \"null\")); return e; }\nimport { RadiantElement, bindTo, customElement, event, onEvent, prop } from \"@ecopages/radiant\";\nimport { nonEmpty } from \"@/lib/non-empty\";\nexport const CHECKBOX_DEFAULT_VALUE = \"on\";\nlet _RuiCheckbox;\nclass RuiCheckbox extends RadiantElement {\n static {\n ({\n e: [_init_checked, _init_extra_checked, _init_indeterminate, _init_extra_indeterminate, _init_disabled, _init_extra_disabled, _init_value, _init_extra_value, _init_name, _init_extra_name, _init_changeEvent, _init_extra_changeEvent, _initProto],\n c: [_RuiCheckbox, _initClass]\n } = _applyDecs(this, [customElement(\"rui-checkbox\")], [[[prop({\n type: Boolean,\n reflect: true,\n defaultValue: false\n }), bindTo({\n ref: \"input\",\n prop: \"checked\"\n })], 0, \"checked\"], [[prop({\n type: Boolean,\n reflect: true,\n defaultValue: false\n }), bindTo([{\n ref: \"input\",\n prop: \"indeterminate\"\n }, {\n ref: \"input\",\n attr: \"aria-checked\",\n map: value => value ? \"mixed\" : void 0\n }])], 0, \"indeterminate\"], [[prop({\n type: Boolean,\n reflect: true,\n defaultValue: false\n }), bindTo({\n ref: \"input\",\n prop: \"disabled\"\n })], 0, \"disabled\"], [[prop({\n type: String,\n defaultValue: CHECKBOX_DEFAULT_VALUE\n }), bindTo({\n ref: \"input\",\n prop: \"value\"\n })], 0, \"value\"], [[prop({\n type: String,\n defaultValue: \"\"\n }), bindTo({\n ref: \"input\",\n attr: \"name\",\n map: nonEmpty\n })], 0, \"name\"], [event({\n name: \"rui-change\",\n bubbles: true,\n composed: true\n }), 0, \"changeEvent\"], [onEvent({\n ref: \"input\",\n type: \"change\"\n }), 2, \"onInputChange\"]], 0, void 0, RadiantElement));\n }\n constructor(...args) {\n super(...args);\n _init_extra_changeEvent(this);\n }\n checked = (_initProto(this), _init_checked(this));\n indeterminate = (_init_extra_checked(this), _init_indeterminate(this));\n disabled = (_init_extra_indeterminate(this), _init_disabled(this));\n value = (_init_extra_disabled(this), _init_value(this));\n name = (_init_extra_value(this), _init_name(this));\n changeEvent = (_init_extra_name(this), _init_changeEvent(this));\n onInputChange(event2) {\n const input = event2.target;\n this.checked = input.checked;\n input.indeterminate = this.indeterminate;\n this.changeEvent.emit({\n checked: this.checked,\n indeterminate: this.indeterminate\n });\n }\n static {\n _initClass();\n }\n}\nexport { _RuiCheckbox as RuiCheckbox };", "export function nonEmpty(value) {\n return value || void 0;\n}", "import { jsx, jsxs } from \"@ecopages/jsx/jsx-runtime\";\nimport { CHECKBOX_DEFAULT_VALUE } from \"./checkbox.script\";\nimport \"./checkbox.script\";\nexport function RuiCheckbox({\n children,\n checked,\n disabled,\n indeterminate,\n name,\n value = CHECKBOX_DEFAULT_VALUE,\n ...props\n}) {\n return /* @__PURE__ */jsx(\"rui-checkbox\", {\n ...props,\n checked,\n disabled,\n indeterminate,\n name,\n value,\n \"data-disabled\": disabled ? \"\" : void 0,\n children: /* @__PURE__ */jsxs(\"label\", {\n class: \"rui-checkbox\",\n children: [/* @__PURE__ */jsx(\"input\", {\n type: \"checkbox\",\n \"data-ref\": \"input\",\n \"data-rui-control\": true,\n \"data-rui-control-type\": \"boolean\",\n class: \"rui-checkbox__input\",\n checked,\n disabled,\n value,\n name: name || void 0,\n \"aria-checked\": indeterminate ? \"mixed\" : void 0\n }), /* @__PURE__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C,EACA,KAAAC,EACA,MAAAC,EAAQC,EACR,GAAGC,CACL,EAAG,CACD,OAAsBC,EAAI,eAAgB,CACxC,GAAGD,EACH,QAAAN,EACA,SAAAC,EACA,cAAAC,EACA,KAAAC,EACA,MAAAC,EACA,gBAAiBH,EAAW,GAAK,OACjC,SAAyBO,GAAK,QAAS,CACrC,MAAO,eACP,SAAU,CAAgBD,EAAI,QAAS,CACrC,KAAM,WACN,WAAY,QACZ,mBAAoB,GACpB,wBAAyB,UACzB,MAAO,sBACP,QAAAP,EACA,SAAAC,EACA,MAAAG,EACA,KAAMD,GAAQ,OACd,eAAgBD,EAAgB,QAAU,MAC5C,CAAC,EAAkBK,EAAI,OAAQ,CAC7B,MAAO,wBACP,cAAe,MACjB,CAAC,EAAkBA,EAAI,OAAQ,CAC7B,MAAO,sBACP,SAAAR,CACF,CAAC,CAAC,CACJ,CAAC,CACH,CAAC,CACH",
|
|
6
|
+
"names": ["RadiantElement", "bindTo", "customElement", "event", "onEvent", "prop", "nonEmpty", "value", "_initProto", "_initClass", "_init_checked", "_init_extra_checked", "_init_indeterminate", "_init_extra_indeterminate", "_init_disabled", "_init_extra_disabled", "_init_value", "_init_extra_value", "_init_name", "_init_extra_name", "_init_changeEvent", "_init_extra_changeEvent", "_applyDecs", "n", "r", "o", "i", "a", "c", "u", "s", "f", "l", "p", "d", "m", "h", "y", "v", "g", "t", "b", "e", "applyDec", "w", "D", "S", "j", "E", "P", "k", "F", "_setFunctionName", "N", "O", "T", "z", "A", "H", "_toPropertyKey", "_checkInRHS", "_toPrimitive", "CHECKBOX_DEFAULT_VALUE", "_RuiCheckbox", "RuiCheckbox", "RadiantElement", "customElement", "prop", "bindTo", "value", "nonEmpty", "event", "onEvent", "args", "event2", "input", "jsx", "jsxs", "RuiCheckbox", "children", "checked", "disabled", "indeterminate", "name", "value", "CHECKBOX_DEFAULT_VALUE", "props", "jsx", "jsxs"]
|
|
7
7
|
}
|
|
@@ -9,13 +9,15 @@ export type RuiCheckboxOption = {
|
|
|
9
9
|
export type RuiCheckboxGroupControlProps = JsxElementProps<HTMLDivElement> & {
|
|
10
10
|
orientation?: RuiCheckboxGroupOrientation;
|
|
11
11
|
};
|
|
12
|
-
/** Accessible surface that contains checkbox options. */
|
|
12
|
+
/** Accessible surface that contains checkbox options. Stamps `[data-checkbox-group-root]`. */
|
|
13
13
|
export declare function RuiCheckboxGroupControl({ children, class: className, orientation, ...props }: RuiCheckboxGroupControlProps): JsxRenderable;
|
|
14
14
|
/**
|
|
15
15
|
* Checkbox group with an `options` convenience API; renders one `RuiCheckbox`
|
|
16
16
|
* per option inside `<rui-checkbox-group>`.
|
|
17
|
+
*
|
|
18
|
+
* @remarks `RuiCheckboxGroupControl` stamps `[data-checkbox-group-root]`.
|
|
19
|
+
* Each `RuiCheckbox` is a nested `rui-checkbox` host.
|
|
17
20
|
*/
|
|
18
21
|
export declare function RuiCheckboxGroup({ options, children, value, orientation, ...props }: JsxCustomElementAttributes<RuiCheckboxGroupElement, RuiCheckboxGroupProps & {
|
|
19
22
|
options?: RuiCheckboxOption[];
|
|
20
|
-
value?: string | string[];
|
|
21
23
|
}>): JsxRenderable;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { RadiantElement } from '@ecopages/radiant';
|
|
2
2
|
import type { EventEmitter } from '@ecopages/radiant/tools/event-emitter';
|
|
3
|
+
import { type ViewMultiValue } from '../shared/multi-value';
|
|
3
4
|
export type RuiCheckboxGroupOrientation = 'horizontal' | 'vertical';
|
|
4
5
|
export type RuiCheckboxGroupProps = {
|
|
5
|
-
/**
|
|
6
|
-
value?:
|
|
6
|
+
/** Selected checkbox values. The attribute is comma-separated. */
|
|
7
|
+
value?: ViewMultiValue;
|
|
7
8
|
/** Form field name shared by all checkboxes in the group. */
|
|
8
9
|
name?: string;
|
|
9
10
|
/** Accessible name for the group when no visible legend is composed. */
|
|
@@ -14,42 +15,60 @@ export type RuiCheckboxGroupProps = {
|
|
|
14
15
|
orientation?: RuiCheckboxGroupOrientation;
|
|
15
16
|
};
|
|
16
17
|
export type RuiCheckboxGroupChangeDetail = {
|
|
17
|
-
value: string;
|
|
18
|
+
value: string[];
|
|
18
19
|
};
|
|
19
20
|
/**
|
|
20
|
-
* `<rui-checkbox-group>` —
|
|
21
|
-
* may be selected independently.
|
|
21
|
+
* `<rui-checkbox-group>` — checkbox group behavior host.
|
|
22
22
|
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
23
|
+
* The custom element is a behavior host: it does not render the composed tree.
|
|
24
|
+
* Import the script and place light-DOM children that match the contract below,
|
|
25
|
+
* or use the `RuiCheckboxGroup` view helpers which stamp the same targets.
|
|
26
26
|
*
|
|
27
|
-
*
|
|
27
|
+
* Group `value` is a `string[]` property; the attribute is comma-separated.
|
|
28
|
+
*
|
|
29
|
+
* ## Light-DOM contract
|
|
30
|
+
*
|
|
31
|
+
* Required:
|
|
32
|
+
* - `[data-checkbox-group-root]` — group container. Host sets `aria-label`, `aria-disabled`, `data-orientation`.
|
|
33
|
+
* - `rui-checkbox` — one per option (nested host). Host sets `checked`, `disabled`, `name`.
|
|
34
|
+
*
|
|
35
|
+
* Per checkbox (`rui-checkbox`):
|
|
36
|
+
* - `value` — selection identity.
|
|
37
|
+
* - `data-disabled` — per-item disabled flag preserved when the group is enabled.
|
|
28
38
|
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
39
|
+
* Do not set `checked`, `disabled`, or `name` on `rui-checkbox` children — the host owns those.
|
|
40
|
+
* After connect, group `value` wins over per-item `checked`.
|
|
41
|
+
*
|
|
42
|
+
* Nested hosts: `rui-checkbox` (listens for `rui-change`; stops propagation and re-emits group-shaped detail).
|
|
43
|
+
*
|
|
44
|
+
* @see https://www.w3.org/WAI/ARIA/apg/patterns/checkbox/
|
|
32
45
|
*
|
|
33
46
|
* @element rui-checkbox-group
|
|
34
47
|
*
|
|
35
|
-
* @attr {string} value - Comma-separated selected values
|
|
48
|
+
* @attr {string} value - Comma-separated selected values in markup; the property is `string[]`. Default: `[]`.
|
|
36
49
|
* @attr {string} name - Form field name shared by all checkboxes in the group. Default: `''`.
|
|
37
50
|
* @attr {string} label - Accessible name when no visible legend is composed. Default: `''`.
|
|
38
51
|
* @attr {boolean} disabled - Disables every checkbox in the group. Default: `false`.
|
|
39
52
|
* @attr {('horizontal'|'vertical')} orientation - Layout axis for checkbox items. Default: `vertical`.
|
|
40
53
|
*
|
|
41
|
-
* @fires rui-change - Emitted after the selected values change; `detail.value`
|
|
54
|
+
* @fires rui-change - Emitted after the selected values change; `detail.value` is `string[]`.
|
|
42
55
|
*
|
|
43
56
|
* @remarks
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
57
|
+
* Minimum headless tree:
|
|
58
|
+
*
|
|
59
|
+
* ```html
|
|
60
|
+
* <rui-checkbox-group value="news" name="topics" label="Topics">
|
|
61
|
+
* <div data-checkbox-group-root role="group">
|
|
62
|
+
* <rui-checkbox value="news">News</rui-checkbox>
|
|
63
|
+
* <rui-checkbox value="travel">Travel</rui-checkbox>
|
|
64
|
+
* </div>
|
|
65
|
+
* </rui-checkbox-group>
|
|
66
|
+
* ```
|
|
48
67
|
*
|
|
49
|
-
*
|
|
68
|
+
* BEM classes are presentation-only; see view `@cssclass`.
|
|
50
69
|
*/
|
|
51
70
|
export declare class RuiCheckboxGroup extends RadiantElement {
|
|
52
|
-
value: string;
|
|
71
|
+
value: string[];
|
|
53
72
|
name: string;
|
|
54
73
|
label: string;
|
|
55
74
|
disabled: boolean;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{RadiantElement as Qe,customElement as lt,event as ht,onEvent as dt,onUpdated as ft,prop as ne}from"@ecopages/radiant";import{RadiantElement as Ae,bound as et,customElement as tt,event as it,onEvent as nt,onUpdated as rt,prop as ie,query as at}from"@ecopages/radiant";var he,de,fe,pe,me,be,ve,ge,_e,ye,xe,ke,we,Ee,Ce,je;function He(e,t,c,l,x,w){var v,r,D,z,S,B,E,q=Symbol.metadata||Symbol.for("Symbol.metadata"),X=Object.defineProperty,G=Object.create,J=[G(null),G(null)],Q=t.length;function A(i,f,h){return function(n,a){f&&(a=n,n=e);for(var p=0;p<i.length;p++)a=i[p].apply(n,h?[a]:[]);return h?a:n}}function g(i,f,h,n){if(typeof i!="function"&&(n||i!==void 0))throw new TypeError(f+" must "+(h||"be")+" a function"+(n?"":" or undefined"));return i}function W(i,f,h,n,a,p,y,d,m,b,Z){function O(u){if(!Z(u))throw new TypeError("Attempted to access private element on non-instance")}var M=[].concat(f[0]),$=f[3],U=!y,C=a===1,H=a===3,F=a===4,V=a===2;function R(u,k,ee){return function(I,te){return k&&(te=I,I=i),ee&&ee(I),o[u].call(I,te)}}if(!U){var o={},K=[],_=H?"get":F||C?"set":"value";if(m?(b||C?o={get:Se(function(){return $(this)},n,"get"),set:function(u){f[4](this,u)}}:o[_]=$,b||Se(o[_],n,V?"":_)):b||(o=Object.getOwnPropertyDescriptor(i,n)),!b&&!m){if((r=J[+d][n])&&(r^a)!==7)throw Error("Decorating two elements with the same name ("+o[_].name+") is not supported yet");J[+d][n]=a<3?1:a}}for(var s=i,T=M.length-1;T>=0;T-=h?2:1){var P=g(M[T],"A decorator","be",!0),N=h?M[T-1]:void 0,L={},j={kind:["field","accessor","method","getter","setter","class"][a],name:n,metadata:v,addInitializer:function(u,k){if(u.v)throw new TypeError("attempted to call addInitializer after decoration was finished");g(k,"An initializer","be",!0),p.push(k)}.bind(null,L)};if(U)r=P.call(N,s,j),L.v=1,g(r,"class decorators","return")&&(s=r);else if(j.static=d,j.private=m,r=j.access={has:m?Z.bind():function(u){return n in u}},F||(r.get=m?V?function(u){return O(u),o.value}:R("get",0,O):function(u){return u[n]}),V||H||(r.set=m?R("set",0,O):function(u,k){u[n]=k}),s=P.call(N,C?{get:o.get,set:o.set}:o[_],j),L.v=1,C){if(typeof s=="object"&&s)(r=g(s.get,"accessor.get"))&&(o.get=r),(r=g(s.set,"accessor.set"))&&(o.set=r),(r=g(s.init,"accessor.init"))&&K.unshift(r);else if(s!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else g(s,(b?"field":"method")+" decorators","return")&&(b?K.unshift(s):o[_]=s)}return a<2&&y.push(A(K,d,1),A(p,d,0)),b||U||(m?C?y.splice(-1,0,R("get",d),R("set",d)):y.push(V?o[_]:g.call.bind(o[_])):X(i,n,o)),s}function Y(i){return X(i,q,{configurable:!0,enumerable:!0,value:v})}return w!==void 0&&(v=w[q]),v=G(v??null),S=[],B=function(i){i&&S.push(A(i))},E=function(i,f){for(var h=0;h<c.length;h++){var n=c[h],a=n[1],p=7&a;if((8&a)==i&&!p==f){var y=n[2],d=!!n[3],m=16&a;W(i?e:e.prototype,n,m,d?"#"+y:Fe(y),p,p<2?[]:i?z=z||[]:D=D||[],S,!!i,d,f,i&&d?function(b){return Ne(b)===e}:x)}}},E(8,0),E(0,0),E(8,1),E(0,1),B(D),B(z),r=S,Q||Y(e),{e:r,get c(){var i=[];return Q&&[Y(e=W(e,[t],l,e.name,5,i)),A(i,1)]}}}function Fe(e){var t=Pe(e,"string");return typeof t=="symbol"?t:t+""}function Pe(e,t){if(typeof e!="object"||!e)return e;var c=e[Symbol.toPrimitive];if(c!==void 0){var l=c.call(e,t||"default");if(typeof l!="object")return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Se(e,t,c){typeof t=="symbol"&&(t=(t=t.description)?"["+t+"]":"");try{Object.defineProperty(e,"name",{configurable:!0,value:c?c+" "+t:t})}catch{}return e}function Ne(e){if(Object(e)!==e)throw TypeError("right-hand side of 'in' should be an object, got "+(e!==null?typeof e:"null"));return e}var ue="on",se,Ve=class extends Ae{static{({e:[fe,pe,me,be,ve,ge,_e,ye,xe,ke,we,Ee,Ce,je,he],c:[se,de]}=He(this,[tt("rui-checkbox")],[[ie({type:Boolean,reflect:!0,defaultValue:!1}),0,"checked"],[ie({type:Boolean,reflect:!0,defaultValue:!1}),0,"indeterminate"],[ie({type:Boolean,reflect:!0,defaultValue:!1}),0,"disabled"],[ie({type:String,defaultValue:ue}),0,"value"],[ie({type:String,defaultValue:""}),0,"name"],[at({ref:"input"}),0,"inputTarget"],[it({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[[et,rt(["checked","indeterminate","disabled","value","name"])],2,"syncInputState"],[nt({ref:"input",type:"change"}),2,"onInputChange"]],0,void 0,Ae))}constructor(...t){super(...t),je(this)}checked=(he(this),fe(this));indeterminate=(pe(this),me(this));disabled=(be(this),ve(this));value=(ge(this),_e(this));name=(ye(this),xe(this));inputTarget=(ke(this),we(this));changeEvent=(Ee(this),Ce(this));onConnected(){this.syncInputState()}syncInputState(){let t=this.inputTarget;t&&(t.checked=this.checked,t.indeterminate=this.indeterminate,t.disabled=this.disabled,t.value=this.value,this.name?t.name=this.name:t.removeAttribute("name"),this.indeterminate?t.setAttribute("aria-checked","mixed"):t.removeAttribute("aria-checked"))}onInputChange(t){let c=t.target;this.checked=c.checked,c.indeterminate=this.indeterminate,this.changeEvent.emit({checked:this.checked,indeterminate:this.indeterminate})}static{de()}};function re(e){return e?e.split(",").map(t=>t.trim()).filter(Boolean):[]}function ae(e){return e.join(",")}var Re,Te,Ie,De,ze,Be,Ge,Oe,Me,Ue,Ke,Le,qe,Xe;function ot(e,t,c,l,x,w){var v,r,D,z,S,B,E,q=Symbol.metadata||Symbol.for("Symbol.metadata"),X=Object.defineProperty,G=Object.create,J=[G(null),G(null)],Q=t.length;function A(i,f,h){return function(n,a){f&&(a=n,n=e);for(var p=0;p<i.length;p++)a=i[p].apply(n,h?[a]:[]);return h?a:n}}function g(i,f,h,n){if(typeof i!="function"&&(n||i!==void 0))throw new TypeError(f+" must "+(h||"be")+" a function"+(n?"":" or undefined"));return i}function W(i,f,h,n,a,p,y,d,m,b,Z){function O(u){if(!Z(u))throw new TypeError("Attempted to access private element on non-instance")}var M=[].concat(f[0]),$=f[3],U=!y,C=a===1,H=a===3,F=a===4,V=a===2;function R(u,k,ee){return function(I,te){return k&&(te=I,I=i),ee&&ee(I),o[u].call(I,te)}}if(!U){var o={},K=[],_=H?"get":F||C?"set":"value";if(m?(b||C?o={get:Je(function(){return $(this)},n,"get"),set:function(u){f[4](this,u)}}:o[_]=$,b||Je(o[_],n,V?"":_)):b||(o=Object.getOwnPropertyDescriptor(i,n)),!b&&!m){if((r=J[+d][n])&&(r^a)!==7)throw Error("Decorating two elements with the same name ("+o[_].name+") is not supported yet");J[+d][n]=a<3?1:a}}for(var s=i,T=M.length-1;T>=0;T-=h?2:1){var P=g(M[T],"A decorator","be",!0),N=h?M[T-1]:void 0,L={},j={kind:["field","accessor","method","getter","setter","class"][a],name:n,metadata:v,addInitializer:function(u,k){if(u.v)throw new TypeError("attempted to call addInitializer after decoration was finished");g(k,"An initializer","be",!0),p.push(k)}.bind(null,L)};if(U)r=P.call(N,s,j),L.v=1,g(r,"class decorators","return")&&(s=r);else if(j.static=d,j.private=m,r=j.access={has:m?Z.bind():function(u){return n in u}},F||(r.get=m?V?function(u){return O(u),o.value}:R("get",0,O):function(u){return u[n]}),V||H||(r.set=m?R("set",0,O):function(u,k){u[n]=k}),s=P.call(N,C?{get:o.get,set:o.set}:o[_],j),L.v=1,C){if(typeof s=="object"&&s)(r=g(s.get,"accessor.get"))&&(o.get=r),(r=g(s.set,"accessor.set"))&&(o.set=r),(r=g(s.init,"accessor.init"))&&K.unshift(r);else if(s!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else g(s,(b?"field":"method")+" decorators","return")&&(b?K.unshift(s):o[_]=s)}return a<2&&y.push(A(K,d,1),A(p,d,0)),b||U||(m?C?y.splice(-1,0,R("get",d),R("set",d)):y.push(V?o[_]:g.call.bind(o[_])):X(i,n,o)),s}function Y(i){return X(i,q,{configurable:!0,enumerable:!0,value:v})}return w!==void 0&&(v=w[q]),v=G(v??null),S=[],B=function(i){i&&S.push(A(i))},E=function(i,f){for(var h=0;h<c.length;h++){var n=c[h],a=n[1],p=7&a;if((8&a)==i&&!p==f){var y=n[2],d=!!n[3],m=16&a;W(i?e:e.prototype,n,m,d?"#"+y:ct(y),p,p<2?[]:i?z=z||[]:D=D||[],S,!!i,d,f,i&&d?function(b){return st(b)===e}:x)}}},E(8,0),E(0,0),E(8,1),E(0,1),B(D),B(z),r=S,Q||Y(e),{e:r,get c(){var i=[];return Q&&[Y(e=W(e,[t],l,e.name,5,i)),A(i,1)]}}}function ct(e){var t=ut(e,"string");return typeof t=="symbol"?t:t+""}function ut(e,t){if(typeof e!="object"||!e)return e;var c=e[Symbol.toPrimitive];if(c!==void 0){var l=c.call(e,t||"default");if(typeof l!="object")return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Je(e,t,c){typeof t=="symbol"&&(t=(t=t.description)?"["+t+"]":"");try{Object.defineProperty(e,"name",{configurable:!0,value:c?c+" "+t:t})}catch{}return e}function st(e){if(Object(e)!==e)throw TypeError("right-hand side of 'in' should be an object, got "+(e!==null?typeof e:"null"));return e}var Ye,We=class extends Qe{static{({e:[Ie,De,ze,Be,Ge,Oe,Me,Ue,Ke,Le,qe,Xe,Re],c:[Ye,Te]}=ot(this,[lt("rui-checkbox-group")],[[ne({type:String,reflect:!0,defaultValue:""}),0,"value"],[ne({type:String,defaultValue:""}),0,"name"],[ne({type:String,defaultValue:""}),0,"label"],[ne({type:Boolean,reflect:!0,defaultValue:!1}),0,"disabled"],[ne({type:String,reflect:!0,defaultValue:"vertical"}),0,"orientation"],[ht({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[ft(["value","name","label","disabled","orientation"]),2,"syncCheckboxes"],[dt({selector:"rui-checkbox",type:"rui-change"}),2,"onCheckboxChange"]],0,void 0,Qe))}constructor(...t){super(...t),Xe(this)}value=(Re(this),Ie(this));name=(De(this),ze(this));label=(Be(this),Ge(this));disabled=(Oe(this),Me(this));orientation=(Ue(this),Ke(this));changeEvent=(Le(this),qe(this));onConnected(){this.syncCheckboxes()}syncCheckboxes(){let t=this.querySelector("[data-checkbox-group-root]");t&&(this.label?t.setAttribute("aria-label",this.label):t.removeAttribute("aria-label"),this.disabled?t.setAttribute("aria-disabled","true"):t.removeAttribute("aria-disabled"),t.setAttribute("data-orientation",this.orientation));let c=new Set(re(this.value)),l=this.name||this.getAttribute("name")||"";for(let x of this.getCheckboxes())x.checked=c.has(x.value),x.disabled=this.disabled||x.hasAttribute("data-disabled"),l&&(x.name=l)}onCheckboxChange(t){t.stopImmediatePropagation();let c=this.getCheckboxes().filter(l=>l.checked).map(l=>l.value);this.value=ae(c),this.changeEvent.emit({value:this.value})}getCheckboxes(){return Array.from(this.querySelectorAll("rui-checkbox")).filter(t=>t instanceof se)}static{Te()}};import{jsx as ce}from"@ecopages/jsx/jsx-runtime";function Ze(...e){return e.filter(Boolean).join(" ")}import{jsx as oe,jsxs as pt}from"@ecopages/jsx/jsx-runtime";function le({children:e,checked:t,disabled:c,indeterminate:l,name:x,value:w=ue,...v}){return oe("rui-checkbox",{...v,checked:t,disabled:c,indeterminate:l,name:x,value:w,"data-disabled":c?"":void 0,children:pt("label",{class:"rui-checkbox",children:[oe("input",{type:"checkbox","data-ref":"input","data-rui-control":!0,"data-rui-control-type":"boolean",class:"rui-checkbox__input",checked:t,disabled:c,value:w,name:x||void 0,"aria-checked":l?"mixed":void 0}),oe("span",{class:"rui-checkbox__control","aria-hidden":"true"}),oe("span",{class:"rui-checkbox__label",children:e})]})})}function $e({children:e,class:t,orientation:c="vertical",...l}){return ce("div",{...l,"data-checkbox-group-root":!0,"data-orientation":c,class:Ze("rui-checkbox-group",t),role:"group","data-rui-control":!0,"data-rui-control-type":"text",children:e})}function mt(e){if(e!==void 0)return Array.isArray(e)?ae(e):e}function bt({options:e,children:t,value:c,orientation:l="vertical",...x}){let w=mt(c),v=new Set(re(w??""));return ce("rui-checkbox-group",{...x,value:w,orientation:l,children:e==null?t:ce($e,{orientation:l,children:e.map(r=>ce(le,{value:r.value,disabled:r.disabled,checked:v.has(r.value),children:r.label}))})})}export{bt as RuiCheckboxGroup,$e as RuiCheckboxGroupControl,Ye as RuiCheckboxGroupElement};
|
|
1
|
+
import{RadiantElement as $e,bindTo as le,customElement as pt,event as ht,onEvent as dt,onUpdated as mt,prop as ie}from"@ecopages/radiant";function oe(e){return e||void 0}import{RadiantElement as Se,bindTo as re,customElement as it,event as ot,onEvent as at,prop as ne}from"@ecopages/radiant";var pe,he,de,me,be,ve,ge,ye,_e,xe,ke,we,Ee,Ce;function et(e,t,a,s,D,k){var v,i,I,O,j,B,w,M=Symbol.metadata||Symbol.for("Symbol.metadata"),X=Object.defineProperty,G=Object.create,J=[G(null),G(null)],Q=t.length;function S(r,h,f){return function(n,o){h&&(o=n,n=e);for(var d=0;d<r.length;d++)o=r[d].apply(n,f?[o]:[]);return f?o:n}}function g(r,h,f,n){if(typeof r!="function"&&(n||r!==void 0))throw new TypeError(h+" must "+(f||"be")+" a function"+(n?"":" or undefined"));return r}function W(r,h,f,n,o,d,_,p,m,b,Z){function z(u){if(!Z(u))throw new TypeError("Attempted to access private element on non-instance")}var U=[].concat(h[0]),$=h[3],K=!_,E=o===1,H=o===3,F=o===4,A=o===2;function V(u,x,ee){return function(T,te){return x&&(te=T,T=r),ee&&ee(T),c[u].call(T,te)}}if(!K){var c={},L=[],y=H?"get":F||E?"set":"value";if(m?(b||E?c={get:je(function(){return $(this)},n,"get"),set:function(u){h[4](this,u)}}:c[y]=$,b||je(c[y],n,A?"":y)):b||(c=Object.getOwnPropertyDescriptor(r,n)),!b&&!m){if((i=J[+p][n])&&(i^o)!==7)throw Error("Decorating two elements with the same name ("+c[y].name+") is not supported yet");J[+p][n]=o<3?1:o}}for(var l=r,R=U.length-1;R>=0;R-=f?2:1){var P=g(U[R],"A decorator","be",!0),N=f?U[R-1]:void 0,q={},C={kind:["field","accessor","method","getter","setter","class"][o],name:n,metadata:v,addInitializer:function(u,x){if(u.v)throw new TypeError("attempted to call addInitializer after decoration was finished");g(x,"An initializer","be",!0),d.push(x)}.bind(null,q)};if(K)i=P.call(N,l,C),q.v=1,g(i,"class decorators","return")&&(l=i);else if(C.static=p,C.private=m,i=C.access={has:m?Z.bind():function(u){return n in u}},F||(i.get=m?A?function(u){return z(u),c.value}:V("get",0,z):function(u){return u[n]}),A||H||(i.set=m?V("set",0,z):function(u,x){u[n]=x}),l=P.call(N,E?{get:c.get,set:c.set}:c[y],C),q.v=1,E){if(typeof l=="object"&&l)(i=g(l.get,"accessor.get"))&&(c.get=i),(i=g(l.set,"accessor.set"))&&(c.set=i),(i=g(l.init,"accessor.init"))&&L.unshift(i);else if(l!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else g(l,(b?"field":"method")+" decorators","return")&&(b?L.unshift(l):c[y]=l)}return o<2&&_.push(S(L,p,1),S(d,p,0)),b||K||(m?E?_.splice(-1,0,V("get",p),V("set",p)):_.push(A?c[y]:g.call.bind(c[y])):X(r,n,c)),l}function Y(r){return X(r,M,{configurable:!0,enumerable:!0,value:v})}return k!==void 0&&(v=k[M]),v=G(v??null),j=[],B=function(r){r&&j.push(S(r))},w=function(r,h){for(var f=0;f<a.length;f++){var n=a[f],o=n[1],d=7&o;if((8&o)==r&&!d==h){var _=n[2],p=!!n[3],m=16&o;W(r?e:e.prototype,n,m,p?"#"+_:tt(_),d,d<2?[]:r?O=O||[]:I=I||[],j,!!r,p,h,r&&p?function(b){return nt(b)===e}:D)}}},w(8,0),w(0,0),w(8,1),w(0,1),B(I),B(O),i=j,Q||Y(e),{e:i,get c(){var r=[];return Q&&[Y(e=W(e,[t],s,e.name,5,r)),S(r,1)]}}}function tt(e){var t=rt(e,"string");return typeof t=="symbol"?t:t+""}function rt(e,t){if(typeof e!="object"||!e)return e;var a=e[Symbol.toPrimitive];if(a!==void 0){var s=a.call(e,t||"default");if(typeof s!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function je(e,t,a){typeof t=="symbol"&&(t=(t=t.description)?"["+t+"]":"");try{Object.defineProperty(e,"name",{configurable:!0,value:a?a+" "+t:t})}catch{}return e}function nt(e){if(Object(e)!==e)throw TypeError("right-hand side of 'in' should be an object, got "+(e!==null?typeof e:"null"));return e}var se="on",ae,Ae=class extends Se{static{({e:[de,me,be,ve,ge,ye,_e,xe,ke,we,Ee,Ce,pe],c:[ae,he]}=et(this,[it("rui-checkbox")],[[[ne({type:Boolean,reflect:!0,defaultValue:!1}),re({ref:"input",prop:"checked"})],0,"checked"],[[ne({type:Boolean,reflect:!0,defaultValue:!1}),re([{ref:"input",prop:"indeterminate"},{ref:"input",attr:"aria-checked",map:t=>t?"mixed":void 0}])],0,"indeterminate"],[[ne({type:Boolean,reflect:!0,defaultValue:!1}),re({ref:"input",prop:"disabled"})],0,"disabled"],[[ne({type:String,defaultValue:se}),re({ref:"input",prop:"value"})],0,"value"],[[ne({type:String,defaultValue:""}),re({ref:"input",attr:"name",map:oe})],0,"name"],[ot({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[at({ref:"input",type:"change"}),2,"onInputChange"]],0,void 0,Se))}constructor(...t){super(...t),Ce(this)}checked=(pe(this),de(this));indeterminate=(me(this),be(this));disabled=(ve(this),ge(this));value=(ye(this),_e(this));name=(xe(this),ke(this));changeEvent=(we(this),Ee(this));onInputChange(t){let a=t.target;this.checked=a.checked,a.indeterminate=this.indeterminate,this.changeEvent.emit({checked:this.checked,indeterminate:this.indeterminate})}static{he()}};function Ve(e){return e?Ie(e.split(",")):[]}function ct(e){return e.join(",")}var Re={fromAttribute:e=>Ve(e),toAttribute:e=>e.length>0?ct(e):null,fromProperty:e=>Array.isArray(e)?Ie(e.map(String)):typeof e=="string"?Ve(e):[]},Te={type:Array,reflect:!0,transform:Re};function De(e){return Re.fromProperty?.(e)??[]}function Ie(e){return[...new Set(e.map(t=>t.trim()).filter(Boolean))]}var Oe,Be,Ge,ze,Ue,Ke,Le,qe,Me,Xe,Je,Qe,We,Ye;function ut(e,t,a,s,D,k){var v,i,I,O,j,B,w,M=Symbol.metadata||Symbol.for("Symbol.metadata"),X=Object.defineProperty,G=Object.create,J=[G(null),G(null)],Q=t.length;function S(r,h,f){return function(n,o){h&&(o=n,n=e);for(var d=0;d<r.length;d++)o=r[d].apply(n,f?[o]:[]);return f?o:n}}function g(r,h,f,n){if(typeof r!="function"&&(n||r!==void 0))throw new TypeError(h+" must "+(f||"be")+" a function"+(n?"":" or undefined"));return r}function W(r,h,f,n,o,d,_,p,m,b,Z){function z(u){if(!Z(u))throw new TypeError("Attempted to access private element on non-instance")}var U=[].concat(h[0]),$=h[3],K=!_,E=o===1,H=o===3,F=o===4,A=o===2;function V(u,x,ee){return function(T,te){return x&&(te=T,T=r),ee&&ee(T),c[u].call(T,te)}}if(!K){var c={},L=[],y=H?"get":F||E?"set":"value";if(m?(b||E?c={get:Ze(function(){return $(this)},n,"get"),set:function(u){h[4](this,u)}}:c[y]=$,b||Ze(c[y],n,A?"":y)):b||(c=Object.getOwnPropertyDescriptor(r,n)),!b&&!m){if((i=J[+p][n])&&(i^o)!==7)throw Error("Decorating two elements with the same name ("+c[y].name+") is not supported yet");J[+p][n]=o<3?1:o}}for(var l=r,R=U.length-1;R>=0;R-=f?2:1){var P=g(U[R],"A decorator","be",!0),N=f?U[R-1]:void 0,q={},C={kind:["field","accessor","method","getter","setter","class"][o],name:n,metadata:v,addInitializer:function(u,x){if(u.v)throw new TypeError("attempted to call addInitializer after decoration was finished");g(x,"An initializer","be",!0),d.push(x)}.bind(null,q)};if(K)i=P.call(N,l,C),q.v=1,g(i,"class decorators","return")&&(l=i);else if(C.static=p,C.private=m,i=C.access={has:m?Z.bind():function(u){return n in u}},F||(i.get=m?A?function(u){return z(u),c.value}:V("get",0,z):function(u){return u[n]}),A||H||(i.set=m?V("set",0,z):function(u,x){u[n]=x}),l=P.call(N,E?{get:c.get,set:c.set}:c[y],C),q.v=1,E){if(typeof l=="object"&&l)(i=g(l.get,"accessor.get"))&&(c.get=i),(i=g(l.set,"accessor.set"))&&(c.set=i),(i=g(l.init,"accessor.init"))&&L.unshift(i);else if(l!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else g(l,(b?"field":"method")+" decorators","return")&&(b?L.unshift(l):c[y]=l)}return o<2&&_.push(S(L,p,1),S(d,p,0)),b||K||(m?E?_.splice(-1,0,V("get",p),V("set",p)):_.push(A?c[y]:g.call.bind(c[y])):X(r,n,c)),l}function Y(r){return X(r,M,{configurable:!0,enumerable:!0,value:v})}return k!==void 0&&(v=k[M]),v=G(v??null),j=[],B=function(r){r&&j.push(S(r))},w=function(r,h){for(var f=0;f<a.length;f++){var n=a[f],o=n[1],d=7&o;if((8&o)==r&&!d==h){var _=n[2],p=!!n[3],m=16&o;W(r?e:e.prototype,n,m,p?"#"+_:st(_),d,d<2?[]:r?O=O||[]:I=I||[],j,!!r,p,h,r&&p?function(b){return ft(b)===e}:D)}}},w(8,0),w(0,0),w(8,1),w(0,1),B(I),B(O),i=j,Q||Y(e),{e:i,get c(){var r=[];return Q&&[Y(e=W(e,[t],s,e.name,5,r)),S(r,1)]}}}function st(e){var t=lt(e,"string");return typeof t=="symbol"?t:t+""}function lt(e,t){if(typeof e!="object"||!e)return e;var a=e[Symbol.toPrimitive];if(a!==void 0){var s=a.call(e,t||"default");if(typeof s!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ze(e,t,a){typeof t=="symbol"&&(t=(t=t.description)?"["+t+"]":"");try{Object.defineProperty(e,"name",{configurable:!0,value:a?a+" "+t:t})}catch{}return e}function ft(e){if(Object(e)!==e)throw TypeError("right-hand side of 'in' should be an object, got "+(e!==null?typeof e:"null"));return e}var Fe,He=class extends $e{static{({e:[Ge,ze,Ue,Ke,Le,qe,Me,Xe,Je,Qe,We,Ye,Oe],c:[Fe,Be]}=ut(this,[pt("rui-checkbox-group")],[[ie({...Te,defaultValue:[]}),0,"value"],[ie({type:String,defaultValue:""}),0,"name"],[[ie({type:String,defaultValue:""}),le({selector:"[data-checkbox-group-root]",attr:"aria-label",map:oe})],0,"label"],[[ie({type:Boolean,reflect:!0,defaultValue:!1}),le({selector:"[data-checkbox-group-root]",attr:"aria-disabled",map:t=>t?"true":void 0})],0,"disabled"],[[ie({type:String,reflect:!0,defaultValue:"vertical"}),le({selector:"[data-checkbox-group-root]",attr:"data-orientation"})],0,"orientation"],[ht({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[mt(["value","name","disabled"]),2,"syncCheckboxes"],[dt({selector:"rui-checkbox",type:"rui-change"}),2,"onCheckboxChange"]],0,void 0,$e))}constructor(...t){super(...t),Ye(this)}value=(Oe(this),Ge(this));name=(ze(this),Ue(this));label=(Ke(this),Le(this));disabled=(qe(this),Me(this));orientation=(Xe(this),Je(this));changeEvent=(Qe(this),We(this));onConnected(){this.syncCheckboxes()}syncCheckboxes(){let t=new Set(this.value),a=this.name||this.getAttribute("name")||"";for(let s of this.getCheckboxes())s.checked=t.has(s.value),s.disabled=this.disabled||s.hasAttribute("data-disabled"),a&&(s.name=a)}onCheckboxChange(t){t.stopImmediatePropagation();let a=this.getCheckboxes().filter(s=>s.checked).map(s=>s.value);this.value=a,this.changeEvent.emit({value:this.value})}getCheckboxes(){return Array.from(this.querySelectorAll("rui-checkbox")).filter(t=>t instanceof ae)}static{Be()}};import{jsx as ue}from"@ecopages/jsx/jsx-runtime";function Pe(...e){return e.filter(Boolean).join(" ")}import{jsx as ce,jsxs as bt}from"@ecopages/jsx/jsx-runtime";function fe({children:e,checked:t,disabled:a,indeterminate:s,name:D,value:k=se,...v}){return ce("rui-checkbox",{...v,checked:t,disabled:a,indeterminate:s,name:D,value:k,"data-disabled":a?"":void 0,children:bt("label",{class:"rui-checkbox",children:[ce("input",{type:"checkbox","data-ref":"input","data-rui-control":!0,"data-rui-control-type":"boolean",class:"rui-checkbox__input",checked:t,disabled:a,value:k,name:D||void 0,"aria-checked":s?"mixed":void 0}),ce("span",{class:"rui-checkbox__control","aria-hidden":"true"}),ce("span",{class:"rui-checkbox__label",children:e})]})})}function Ne({children:e,class:t,orientation:a="vertical",...s}){return ue("div",{...s,"data-checkbox-group-root":!0,"data-orientation":a,class:Pe("rui-checkbox-group",t),role:"group","data-rui-control":!0,"data-rui-control-type":"text",children:e})}function vt({options:e,children:t,value:a,orientation:s="vertical",...D}){let k=De(a),v=new Set(k);return ue("rui-checkbox-group",{...D,value:k,orientation:s,children:e==null?t:ue(Ne,{orientation:s,children:e.map(i=>ue(fe,{value:i.value,disabled:i.disabled,checked:v.has(i.value),children:i.label}))})})}export{vt as RuiCheckboxGroup,Ne as RuiCheckboxGroupControl,Fe as RuiCheckboxGroupElement};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|