@editora/ui-core 0.1.21 → 0.1.23
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 +292 -221
- package/dist/{ElementBase-YlTLMsGk.mjs → ElementBase-BeZT54Hj.mjs} +3 -2
- package/dist/ElementBase-DxbvhLJs.js +1 -0
- package/dist/ElementBase.d.ts +2 -1
- package/dist/ElementBase.d.ts.map +1 -1
- package/dist/__tests__/setup.d.ts +0 -2
- package/dist/__tests__/setup.d.ts.map +1 -1
- package/dist/accordion.cjs.js +4 -4
- package/dist/accordion.esm.js +4 -4
- package/dist/alert-dialog.cjs.js +32 -32
- package/dist/alert-dialog.esm.js +95 -75
- package/dist/alert.cjs.js +7 -7
- package/dist/alert.esm.js +7 -7
- package/dist/anchor.cjs.js +3 -3
- package/dist/anchor.esm.js +6 -5
- package/dist/animated-beam.cjs.js +1 -1
- package/dist/animated-beam.esm.js +1 -1
- package/dist/animated-list.cjs.js +5 -5
- package/dist/animated-list.esm.js +5 -5
- package/dist/animated-text.cjs.js +5 -5
- package/dist/animated-text.esm.js +5 -5
- package/dist/app-header.cjs.js +4 -4
- package/dist/app-header.esm.js +4 -4
- package/dist/aspect-ratio.cjs.js +4 -4
- package/dist/aspect-ratio.esm.js +4 -4
- package/dist/avatar.cjs.js +14 -14
- package/dist/avatar.esm.js +31 -29
- package/dist/badge.cjs.js +5 -5
- package/dist/badge.esm.js +5 -5
- package/dist/block-controls.cjs.js +5 -5
- package/dist/block-controls.esm.js +5 -5
- package/dist/box.cjs.js +3 -3
- package/dist/box.esm.js +3 -3
- package/dist/breadcrumb.cjs.js +6 -6
- package/dist/breadcrumb.esm.js +6 -6
- package/dist/button.cjs.js +1 -1
- package/dist/button.esm.js +1 -1
- package/dist/{calendar-DLY4acgn.mjs → calendar-B3PUKHQm.mjs} +227 -183
- package/dist/{calendar-Dkof-FTK.js → calendar-D-mXMgqc.js} +74 -35
- package/dist/calendar.cjs.js +1 -1
- package/dist/calendar.esm.js +1 -1
- package/dist/card.cjs.js +8 -8
- package/dist/card.esm.js +63 -20
- package/dist/chart.cjs.js +5 -5
- package/dist/chart.esm.js +7 -7
- package/dist/checkbox.cjs.js +3 -3
- package/dist/checkbox.esm.js +3 -3
- package/dist/collapsible.cjs.js +8 -8
- package/dist/collapsible.esm.js +8 -8
- package/dist/collection.cjs.js +1 -1
- package/dist/collection.esm.js +9 -8
- package/dist/color-picker.cjs.js +30 -10
- package/dist/color-picker.esm.js +84 -62
- package/dist/combobox.cjs.js +29 -27
- package/dist/combobox.esm.js +51 -45
- package/dist/command-palette.cjs.js +1 -1
- package/dist/command-palette.esm.js +1 -1
- package/dist/command.cjs.js +2 -2
- package/dist/command.esm.js +3 -3
- package/dist/components/ui-alert-dialog.d.ts +1 -0
- package/dist/components/ui-alert-dialog.d.ts.map +1 -1
- package/dist/components/ui-anchor.d.ts +2 -1
- package/dist/components/ui-anchor.d.ts.map +1 -1
- package/dist/components/ui-avatar.d.ts +1 -0
- package/dist/components/ui-avatar.d.ts.map +1 -1
- package/dist/components/ui-button.d.ts +1 -0
- package/dist/components/ui-button.d.ts.map +1 -1
- package/dist/components/ui-calendar.d.ts.map +1 -1
- package/dist/components/ui-card.d.ts +3 -0
- package/dist/components/ui-card.d.ts.map +1 -1
- package/dist/components/ui-checkbox.d.ts.map +1 -1
- package/dist/components/ui-collection.d.ts +2 -1
- package/dist/components/ui-collection.d.ts.map +1 -1
- package/dist/components/ui-color-picker.d.ts.map +1 -1
- package/dist/components/ui-combobox.d.ts.map +1 -1
- package/dist/components/ui-data-table.d.ts.map +1 -1
- package/dist/components/ui-date-field.d.ts.map +1 -1
- package/dist/components/ui-date-picker.d.ts.map +1 -1
- package/dist/components/ui-date-range-picker.d.ts.map +1 -1
- package/dist/components/ui-date-range-time-picker.d.ts.map +1 -1
- package/dist/components/ui-date-time-picker.d.ts.map +1 -1
- package/dist/components/ui-dock.d.ts +1 -0
- package/dist/components/ui-dock.d.ts.map +1 -1
- package/dist/components/ui-drawer.d.ts.map +1 -1
- package/dist/components/ui-dropdown.d.ts.map +1 -1
- package/dist/components/ui-field.d.ts.map +1 -1
- package/dist/components/ui-file-upload.d.ts.map +1 -1
- package/dist/components/ui-form.d.ts +1 -0
- package/dist/components/ui-form.d.ts.map +1 -1
- package/dist/components/ui-gantt.d.ts.map +1 -1
- package/dist/components/ui-input.d.ts.map +1 -1
- package/dist/components/ui-menu.d.ts.map +1 -1
- package/dist/components/ui-multi-select.d.ts.map +1 -1
- package/dist/components/ui-number-field.d.ts.map +1 -1
- package/dist/components/ui-password-field.d.ts.map +1 -1
- package/dist/components/ui-pin-input.d.ts +1 -0
- package/dist/components/ui-pin-input.d.ts.map +1 -1
- package/dist/components/ui-placement-grid.d.ts.map +1 -1
- package/dist/components/ui-progress.d.ts.map +1 -1
- package/dist/components/ui-radio.d.ts.map +1 -1
- package/dist/components/ui-rating.d.ts +1 -0
- package/dist/components/ui-rating.d.ts.map +1 -1
- package/dist/components/ui-roving-focus-group.d.ts +2 -1
- package/dist/components/ui-roving-focus-group.d.ts.map +1 -1
- package/dist/components/ui-select.d.ts.map +1 -1
- package/dist/components/ui-sortable.d.ts.map +1 -1
- package/dist/components/ui-switch.d.ts.map +1 -1
- package/dist/components/ui-table.d.ts.map +1 -1
- package/dist/components/ui-tabs.d.ts +1 -0
- package/dist/components/ui-tabs.d.ts.map +1 -1
- package/dist/components/ui-tags-input.d.ts +1 -0
- package/dist/components/ui-tags-input.d.ts.map +1 -1
- package/dist/components/ui-textarea.d.ts.map +1 -1
- package/dist/components/ui-time-field.d.ts.map +1 -1
- package/dist/components/ui-toggle-group.d.ts.map +1 -1
- package/dist/components/ui-toggle.d.ts.map +1 -1
- package/dist/components/ui-tree.d.ts.map +1 -1
- package/dist/components/ui-wizard.d.ts.map +1 -1
- package/dist/container.cjs.js +1 -1
- package/dist/container.esm.js +1 -1
- package/dist/context-menu.cjs.js +3 -3
- package/dist/context-menu.esm.js +5 -5
- package/dist/control-group.cjs.js +1 -1
- package/dist/control-group.esm.js +1 -1
- package/dist/control-name-BmoI1m3a.js +1 -0
- package/dist/control-name-Bpj7F34X.mjs +48 -0
- package/dist/data-table.cjs.js +6 -3
- package/dist/data-table.esm.js +146 -143
- package/dist/date-field.cjs.js +5 -5
- package/dist/date-field.esm.js +34 -31
- package/dist/date-picker.cjs.js +16 -16
- package/dist/date-picker.esm.js +49 -45
- package/dist/date-range-picker.cjs.js +5 -5
- package/dist/date-range-picker.esm.js +120 -118
- package/dist/date-range-time-picker.cjs.js +22 -22
- package/dist/date-range-time-picker.esm.js +89 -85
- package/dist/date-time-picker.cjs.js +23 -23
- package/dist/date-time-picker.esm.js +103 -99
- package/dist/{date-time-utils-y1N2gvG2.mjs → date-time-utils-BTlxnz5j.mjs} +1 -1
- package/dist/{date-time-utils-Dmost5Ee.js → date-time-utils-y3AvNvGe.js} +1 -1
- package/dist/description.cjs.js +4 -4
- package/dist/description.esm.js +4 -4
- package/dist/dialog.cjs.js +3 -3
- package/dist/dialog.esm.js +3 -3
- package/dist/direction-provider.cjs.js +1 -1
- package/dist/direction-provider.esm.js +1 -1
- package/dist/dismissable-layer.cjs.js +1 -1
- package/dist/dismissable-layer.esm.js +1 -1
- package/dist/dock.cjs.js +12 -12
- package/dist/dock.esm.js +73 -75
- package/dist/domElement-DazSZBjV.js +1 -0
- package/dist/domElement-ZlSGVP0l.mjs +5 -0
- package/dist/domElement.d.ts +2 -0
- package/dist/domElement.d.ts.map +1 -0
- package/dist/drawer.cjs.js +19 -19
- package/dist/drawer.esm.js +58 -58
- package/dist/dropdown.cjs.js +13 -13
- package/dist/dropdown.esm.js +50 -49
- package/dist/empty-state.cjs.js +4 -4
- package/dist/empty-state.esm.js +4 -4
- package/dist/field-error.cjs.js +2 -2
- package/dist/field-error.esm.js +2 -2
- package/dist/field.cjs.js +12 -12
- package/dist/field.esm.js +84 -75
- package/dist/fieldset.cjs.js +5 -5
- package/dist/fieldset.esm.js +5 -5
- package/dist/file-upload.cjs.js +4 -4
- package/dist/file-upload.esm.js +6 -4
- package/dist/flex.cjs.js +1 -1
- package/dist/flex.esm.js +1 -1
- package/dist/floating-toolbar.cjs.js +8 -8
- package/dist/floating-toolbar.esm.js +10 -10
- package/dist/focus-scope.cjs.js +1 -1
- package/dist/focus-scope.esm.js +1 -1
- package/dist/form.cjs.js +13 -13
- package/dist/form.esm.js +23 -13
- package/dist/gantt.cjs.js +43 -32
- package/dist/gantt.esm.js +100 -89
- package/dist/grid.cjs.js +1 -1
- package/dist/grid.esm.js +1 -1
- package/dist/hover-card.cjs.js +1 -1
- package/dist/hover-card.esm.js +1 -1
- package/dist/icon-cloud.cjs.js +4 -4
- package/dist/icon-cloud.esm.js +4 -4
- package/dist/icon.cjs.js +1 -1
- package/dist/icon.esm.js +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +121 -118
- package/dist/inline-edit.cjs.js +2 -2
- package/dist/inline-edit.esm.js +2 -2
- package/dist/input.cjs.js +14 -14
- package/dist/input.esm.js +40 -33
- package/dist/label.cjs.js +4 -4
- package/dist/label.esm.js +4 -4
- package/dist/layout.cjs.js +1 -1
- package/dist/layout.esm.js +1 -1
- package/dist/{listbox-B6QgECax.js → listbox-CTpRpuF7.js} +1 -1
- package/dist/{listbox-DJamVeFj.mjs → listbox-hMVOhKHC.mjs} +1 -1
- package/dist/listbox.cjs.js +1 -1
- package/dist/listbox.esm.js +1 -1
- package/dist/marquee.cjs.js +4 -4
- package/dist/marquee.esm.js +4 -4
- package/dist/masonry-grid.cjs.js +1 -1
- package/dist/masonry-grid.esm.js +1 -1
- package/dist/{menu-item-styles-CbNUEwP2.js → menu-item-styles-B4onAr4C.js} +3 -3
- package/dist/{menu-item-styles-CZiPwPwl.mjs → menu-item-styles-IGSFLAHu.mjs} +3 -3
- package/dist/menu.cjs.js +7 -7
- package/dist/menu.esm.js +30 -29
- package/dist/menubar.cjs.js +1 -1
- package/dist/menubar.esm.js +3 -3
- package/dist/meter.cjs.js +2 -2
- package/dist/meter.esm.js +2 -2
- package/dist/multi-select.cjs.js +17 -17
- package/dist/multi-select.esm.js +52 -44
- package/dist/navigation-menu.cjs.js +2 -2
- package/dist/navigation-menu.esm.js +2 -2
- package/dist/number-field.cjs.js +11 -13
- package/dist/number-field.esm.js +30 -28
- package/dist/number-ticker.cjs.js +5 -5
- package/dist/number-ticker.esm.js +5 -5
- package/dist/odometer.cjs.js +3 -3
- package/dist/odometer.esm.js +3 -3
- package/dist/orbiter.cjs.js +4 -4
- package/dist/orbiter.esm.js +4 -4
- package/dist/pagination.cjs.js +2 -2
- package/dist/pagination.esm.js +2 -2
- package/dist/{panel-group-CaD0_KQf.js → panel-group-BVHJEdfx.js} +1 -1
- package/dist/{panel-group-8sVNnGxg.mjs → panel-group-BxO_eNW6.mjs} +1 -1
- package/dist/panel-group.cjs.js +1 -1
- package/dist/panel-group.esm.js +1 -1
- package/dist/panel.cjs.js +1 -1
- package/dist/panel.esm.js +1 -1
- package/dist/password-field.cjs.js +23 -23
- package/dist/password-field.esm.js +48 -47
- package/dist/pin-input.cjs.js +8 -6
- package/dist/pin-input.esm.js +21 -15
- package/dist/placement-grid.cjs.js +4 -4
- package/dist/placement-grid.esm.js +58 -58
- package/dist/plugin-panel.cjs.js +2 -2
- package/dist/plugin-panel.esm.js +2 -2
- package/dist/popover.cjs.js +6 -6
- package/dist/popover.esm.js +5 -5
- package/dist/portal.cjs.js +1 -1
- package/dist/portal.esm.js +1 -1
- package/dist/positioner.cjs.js +1 -1
- package/dist/positioner.esm.js +1 -1
- package/dist/presence.cjs.js +1 -1
- package/dist/presence.esm.js +1 -1
- package/dist/primitives/control-name.d.ts +30 -0
- package/dist/primitives/control-name.d.ts.map +1 -0
- package/dist/primitives/trigger.d.ts +2 -0
- package/dist/primitives/trigger.d.ts.map +1 -0
- package/dist/progress.cjs.js +4 -4
- package/dist/progress.esm.js +20 -18
- package/dist/quick-actions.cjs.js +4 -4
- package/dist/quick-actions.esm.js +4 -4
- package/dist/radio-group.cjs.js +2 -2
- package/dist/radio-group.esm.js +2 -2
- package/dist/radio.cjs.js +3 -3
- package/dist/radio.esm.js +3 -3
- package/dist/rating.cjs.js +18 -17
- package/dist/rating.esm.js +91 -92
- package/dist/roving-focus-group.cjs.js +1 -1
- package/dist/roving-focus-group.esm.js +11 -10
- package/dist/{runtime-D1gFh1fS.mjs → runtime-CFnK53iC.mjs} +133 -94
- package/dist/runtime-DwE-tizc.js +1 -0
- package/dist/runtime.cjs.js +1 -1
- package/dist/runtime.d.ts +1 -1
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.esm.js +29 -26
- package/dist/scroll-area.cjs.js +1 -1
- package/dist/scroll-area.esm.js +1 -1
- package/dist/section.cjs.js +1 -1
- package/dist/section.esm.js +1 -1
- package/dist/select.cjs.js +20 -19
- package/dist/select.esm.js +37 -33
- package/dist/selection-popup.cjs.js +3 -3
- package/dist/selection-popup.esm.js +3 -3
- package/dist/separator.cjs.js +8 -8
- package/dist/separator.esm.js +8 -8
- package/dist/sidebar.cjs.js +9 -9
- package/dist/sidebar.esm.js +16 -16
- package/dist/skeleton.cjs.js +8 -8
- package/dist/skeleton.esm.js +8 -8
- package/dist/slider.cjs.js +4 -4
- package/dist/slider.esm.js +4 -4
- package/dist/slot.cjs.js +4 -4
- package/dist/slot.esm.js +4 -4
- package/dist/sortable.cjs.js +43 -44
- package/dist/sortable.esm.js +100 -101
- package/dist/spinning-text.cjs.js +4 -4
- package/dist/spinning-text.esm.js +4 -4
- package/dist/split-button.cjs.js +1 -1
- package/dist/split-button.esm.js +2 -2
- package/dist/splitter.cjs.js +1 -1
- package/dist/splitter.esm.js +1 -1
- package/dist/stepper.cjs.js +2 -2
- package/dist/stepper.esm.js +2 -2
- package/dist/switch.cjs.js +11 -13
- package/dist/switch.esm.js +11 -13
- package/dist/table.cjs.js +10 -7
- package/dist/table.esm.js +47 -44
- package/dist/tabs.cjs.js +21 -22
- package/dist/tabs.esm.js +71 -67
- package/dist/tags-input.cjs.js +9 -9
- package/dist/tags-input.esm.js +32 -25
- package/dist/textarea.cjs.js +10 -10
- package/dist/textarea.esm.js +30 -21
- package/dist/theme.d.ts +18 -0
- package/dist/theme.d.ts.map +1 -1
- package/dist/time-field.cjs.js +5 -5
- package/dist/time-field.esm.js +21 -18
- package/dist/time-picker.cjs.js +4 -4
- package/dist/time-picker.esm.js +6 -6
- package/dist/timeline.cjs.js +3 -3
- package/dist/timeline.esm.js +5 -5
- package/dist/toast.cjs.js +7 -7
- package/dist/toast.esm.js +14 -14
- package/dist/toggle-group.cjs.js +6 -7
- package/dist/toggle-group.esm.js +64 -61
- package/dist/toggle.cjs.js +18 -18
- package/dist/toggle.esm.js +32 -31
- package/dist/toolbar.cjs.js +1 -1
- package/dist/toolbar.esm.js +1 -1
- package/dist/tooltip.cjs.js +5 -5
- package/dist/tooltip.esm.js +5 -5
- package/dist/transfer-list.cjs.js +4 -4
- package/dist/transfer-list.esm.js +4 -4
- package/dist/{tree-B3kE8ESs.mjs → tree-B_oQput6.mjs} +35 -34
- package/dist/tree-SivHxcAy.js +39 -0
- package/dist/tree-item.cjs.js +1 -1
- package/dist/tree-item.esm.js +1 -1
- package/dist/tree.cjs.js +1 -1
- package/dist/tree.esm.js +1 -1
- package/dist/trigger-BjnxLCeQ.mjs +9 -0
- package/dist/trigger-DkPsKxsP.js +1 -0
- package/dist/{ui-button-rXQOS9QJ.js → ui-button-BPrzJScZ.js} +29 -28
- package/dist/{ui-button-Q0GNNWKC.mjs → ui-button-Co8Sid6t.mjs} +70 -49
- package/dist/{ui-icon-BzVNC_lr.js → ui-icon-D3avtxX_.js} +5 -5
- package/dist/{ui-icon-YI6lyuqU.mjs → ui-icon-DLhB08Fo.mjs} +3 -3
- package/dist/visually-hidden.cjs.js +1 -1
- package/dist/visually-hidden.esm.js +1 -1
- package/dist/wizard.cjs.js +12 -13
- package/dist/wizard.esm.js +18 -16
- package/package.json +2 -2
- package/dist/ElementBase-EV6mVBUV.js +0 -1
- package/dist/runtime-CTaOSmBj.js +0 -1
- package/dist/tree-Dx_kv_ih.js +0 -39
package/dist/rating.esm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { E as
|
|
2
|
-
const
|
|
1
|
+
import { E as M } from "./ElementBase-BeZT54Hj.mjs";
|
|
2
|
+
const V = `
|
|
3
3
|
:host {
|
|
4
4
|
--ui-rating-size: var(--ui-control-size, var(--ui-font-size-lg, 20px));
|
|
5
5
|
--ui-rating-gap: var(--ui-control-gap, 6px);
|
|
@@ -13,6 +13,8 @@ const M = `
|
|
|
13
13
|
--ui-rating-easing: var(--ui-motion-easing, cubic-bezier(0.2, 0.8, 0.2, 1));
|
|
14
14
|
--ui-rating-radius: var(--ui-control-radius, var(--ui-radius, 4px));
|
|
15
15
|
display: inline-flex;
|
|
16
|
+
flex-wrap: wrap;
|
|
17
|
+
max-inline-size: 100%;
|
|
16
18
|
align-items: center;
|
|
17
19
|
gap: var(--ui-rating-gap);
|
|
18
20
|
color-scheme: light dark;
|
|
@@ -28,7 +30,7 @@ const M = `
|
|
|
28
30
|
}
|
|
29
31
|
|
|
30
32
|
:host([tone="neutral"]) {
|
|
31
|
-
--ui-rating-color: color-mix(in srgb, var(--ui-color-muted, #
|
|
33
|
+
--ui-rating-color: color-mix(in srgb, var(--ui-color-muted, #526175) 74%, var(--ui-color-text, #0f172a) 26%);
|
|
32
34
|
}
|
|
33
35
|
|
|
34
36
|
:host([tone="info"]) {
|
|
@@ -36,7 +38,7 @@ const M = `
|
|
|
36
38
|
}
|
|
37
39
|
|
|
38
40
|
:host([tone="success"]) {
|
|
39
|
-
--ui-rating-color: var(--ui-color-success, #
|
|
41
|
+
--ui-rating-color: var(--ui-color-success, #15803d);
|
|
40
42
|
}
|
|
41
43
|
|
|
42
44
|
:host([tone="warning"]) {
|
|
@@ -253,7 +255,7 @@ const M = `
|
|
|
253
255
|
|
|
254
256
|
.label {
|
|
255
257
|
font-size: var(--ui-font-size-sm, 12px);
|
|
256
|
-
color: var(--ui-color-muted, #
|
|
258
|
+
color: var(--ui-color-muted, #526175);
|
|
257
259
|
white-space: nowrap;
|
|
258
260
|
}
|
|
259
261
|
|
|
@@ -317,68 +319,68 @@ const M = `
|
|
|
317
319
|
}
|
|
318
320
|
}
|
|
319
321
|
`;
|
|
320
|
-
function x(
|
|
321
|
-
return
|
|
322
|
+
function x(i) {
|
|
323
|
+
return i !== null && i.toLowerCase() !== "false" && i !== "0";
|
|
322
324
|
}
|
|
323
|
-
function C(
|
|
324
|
-
return
|
|
325
|
+
function C(i) {
|
|
326
|
+
return i === "soft" || i === "glass" || i === "contrast" || i === "minimal" ? i : "default";
|
|
325
327
|
}
|
|
326
|
-
function $(
|
|
327
|
-
return
|
|
328
|
+
function $(i) {
|
|
329
|
+
return i === "sm" || i === "lg" ? i : "md";
|
|
328
330
|
}
|
|
329
|
-
function N(
|
|
330
|
-
return
|
|
331
|
+
function N(i) {
|
|
332
|
+
return i === "square" || i === "pill" ? i : "rounded";
|
|
331
333
|
}
|
|
332
|
-
function T(
|
|
333
|
-
return
|
|
334
|
+
function T(i) {
|
|
335
|
+
return i === "neutral" || i === "info" || i === "success" || i === "warning" || i === "danger" ? i : null;
|
|
334
336
|
}
|
|
335
|
-
function I(
|
|
336
|
-
return
|
|
337
|
+
function I(i) {
|
|
338
|
+
return i === "hover" || i === "focus" || i === "disabled" ? i : "idle";
|
|
337
339
|
}
|
|
338
|
-
function y(
|
|
339
|
-
return
|
|
340
|
+
function y(i) {
|
|
341
|
+
return i === "scale" || i === "pulse" || i === "none" ? i : null;
|
|
340
342
|
}
|
|
341
|
-
function q(
|
|
342
|
-
if (!
|
|
343
|
-
const t =
|
|
343
|
+
function q(i) {
|
|
344
|
+
if (!i) return null;
|
|
345
|
+
const t = i.trim();
|
|
344
346
|
return t ? t === "full" ? "999px" : /^-?\\d+(\\.\\d+)?$/.test(t) ? `${t}px` : t : null;
|
|
345
347
|
}
|
|
346
|
-
function A(
|
|
347
|
-
const t = Number(
|
|
348
|
+
function A(i) {
|
|
349
|
+
const t = Number(i);
|
|
348
350
|
return !Number.isFinite(t) || t <= 0 ? 1 : t === 0.5 ? 0.5 : 1;
|
|
349
351
|
}
|
|
350
|
-
function
|
|
351
|
-
return Math.min(
|
|
352
|
+
function n(i, t, e) {
|
|
353
|
+
return Math.min(e, Math.max(t, i));
|
|
352
354
|
}
|
|
353
|
-
function u(
|
|
354
|
-
const
|
|
355
|
-
return Number(
|
|
355
|
+
function u(i, t) {
|
|
356
|
+
const e = Math.round(i / t) * t;
|
|
357
|
+
return Number(e.toFixed(2));
|
|
356
358
|
}
|
|
357
|
-
function o(
|
|
358
|
-
const
|
|
359
|
-
if (
|
|
360
|
-
const r =
|
|
359
|
+
function o(i, t) {
|
|
360
|
+
const e = i.getAttribute(t);
|
|
361
|
+
if (e != null) return e;
|
|
362
|
+
const r = i[t];
|
|
361
363
|
return typeof r == "string" && r.length > 0 ? r : null;
|
|
362
364
|
}
|
|
363
|
-
function
|
|
364
|
-
const
|
|
365
|
-
if (
|
|
366
|
-
const r =
|
|
365
|
+
function g(i, t) {
|
|
366
|
+
const e = i.getAttribute(t);
|
|
367
|
+
if (e != null) return x(e);
|
|
368
|
+
const r = i[t];
|
|
367
369
|
return typeof r == "boolean" ? r : typeof r == "string" ? x(r) : !1;
|
|
368
370
|
}
|
|
369
|
-
function w(
|
|
370
|
-
return
|
|
371
|
+
function w(i) {
|
|
372
|
+
return i.replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<").replace(/>/g, ">");
|
|
371
373
|
}
|
|
372
|
-
function z(
|
|
374
|
+
function z(i) {
|
|
373
375
|
return `
|
|
374
|
-
<svg viewBox="0 0 24 24" aria-hidden="true"${
|
|
376
|
+
<svg viewBox="0 0 24 24" aria-hidden="true"${i ? ` class="${i}"` : ""}>
|
|
375
377
|
<path d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"></path>
|
|
376
378
|
</svg>
|
|
377
379
|
`;
|
|
378
380
|
}
|
|
379
|
-
class B extends
|
|
381
|
+
class B extends M {
|
|
380
382
|
constructor() {
|
|
381
|
-
super(), this._stars = [], this._value = 0, this._max = 5, this._precision = 1, this._disabled = !1, this._readonly = !1, this._hoverValue = 0, this._onRootClick = this._onRootClick.bind(this), this._onRootMouseMove = this._onRootMouseMove.bind(this), this._onRootMouseLeave = this._onRootMouseLeave.bind(this), this._onRootFocusIn = this._onRootFocusIn.bind(this), this._onRootFocusOut = this._onRootFocusOut.bind(this), this._onRootKeyDown = this._onRootKeyDown.bind(this);
|
|
383
|
+
super(), this._autoAriaLabel = !1, this._stars = [], this._value = 0, this._max = 5, this._precision = 1, this._disabled = !1, this._readonly = !1, this._hoverValue = 0, this._onRootClick = this._onRootClick.bind(this), this._onRootMouseMove = this._onRootMouseMove.bind(this), this._onRootMouseLeave = this._onRootMouseLeave.bind(this), this._onRootFocusIn = this._onRootFocusIn.bind(this), this._onRootFocusOut = this._onRootFocusOut.bind(this), this._onRootKeyDown = this._onRootKeyDown.bind(this);
|
|
382
384
|
}
|
|
383
385
|
static get observedAttributes() {
|
|
384
386
|
return [
|
|
@@ -409,17 +411,17 @@ class B extends V {
|
|
|
409
411
|
disconnectedCallback() {
|
|
410
412
|
this.root.removeEventListener("click", this._onRootClick, !0), this.root.removeEventListener("mousemove", this._onRootMouseMove, !0), this.root.removeEventListener("mouseleave", this._onRootMouseLeave, !0), this.root.removeEventListener("focusin", this._onRootFocusIn, !0), this.root.removeEventListener("focusout", this._onRootFocusOut, !0), this.root.removeEventListener("keydown", this._onRootKeyDown, !0), super.disconnectedCallback();
|
|
411
413
|
}
|
|
412
|
-
attributeChangedCallback(t,
|
|
413
|
-
if (
|
|
414
|
+
attributeChangedCallback(t, e, r) {
|
|
415
|
+
if (e !== r) {
|
|
414
416
|
if (t === "value") {
|
|
415
417
|
const s = Number(r);
|
|
416
|
-
Number.isFinite(s) && (this._value =
|
|
418
|
+
Number.isFinite(s) && (this._value = n(u(s, this._precision), 0, this._max), this._syncStars(), this._syncAria());
|
|
417
419
|
}
|
|
418
420
|
if (t === "max") {
|
|
419
421
|
const s = Number(r);
|
|
420
422
|
Number.isFinite(s) && s > 0 && (this._max = Math.max(1, s), this._value > this._max && (this._value = this._max), this._syncStars(), this._syncAria());
|
|
421
423
|
}
|
|
422
|
-
if (t === "precision" && (this._precision = A(r), this._value =
|
|
424
|
+
if (t === "precision" && (this._precision = A(r), this._value = n(u(this._value, this._precision), 0, this._max), this._hoverValue = this._hoverValue > 0 ? n(u(this._hoverValue, this._precision), 0, this._max) : 0, this._syncStars(), this._syncAria()), t === "disabled" && (this._disabled = r !== null), t === "readonly" && (this._readonly = r !== null), t === "animation") {
|
|
423
425
|
const s = y(r);
|
|
424
426
|
s ? this.setAttribute("data-animation", s) : this.removeAttribute("data-animation");
|
|
425
427
|
}
|
|
@@ -430,23 +432,23 @@ class B extends V {
|
|
|
430
432
|
return this._value;
|
|
431
433
|
}
|
|
432
434
|
set value(t) {
|
|
433
|
-
const
|
|
434
|
-
if (!Number.isFinite(
|
|
435
|
-
const r =
|
|
435
|
+
const e = Number(t);
|
|
436
|
+
if (!Number.isFinite(e)) return;
|
|
437
|
+
const r = n(u(e, this._precision), 0, this._max);
|
|
436
438
|
this._value !== r && (this._value = r, this.setAttribute("value", String(this._value)), this._syncStars(), this._syncAria(), this._emit("change"), this._emit("input"));
|
|
437
439
|
}
|
|
438
440
|
get max() {
|
|
439
441
|
return this._max;
|
|
440
442
|
}
|
|
441
443
|
set max(t) {
|
|
442
|
-
const
|
|
443
|
-
Number.isFinite(
|
|
444
|
+
const e = Number(t);
|
|
445
|
+
Number.isFinite(e) && (this._max = Math.max(1, e), this.setAttribute("max", String(this._max)), this._value > this._max && (this._value = this._max, this.setAttribute("value", String(this._value))), this.requestRender());
|
|
444
446
|
}
|
|
445
447
|
get precision() {
|
|
446
448
|
return this._precision;
|
|
447
449
|
}
|
|
448
450
|
set precision(t) {
|
|
449
|
-
this._precision = t === 0.5 ? 0.5 : 1, this.setAttribute("precision", String(this._precision)), this._value =
|
|
451
|
+
this._precision = t === 0.5 ? 0.5 : 1, this.setAttribute("precision", String(this._precision)), this._value = n(u(this._value, this._precision), 0, this._max), this.requestRender();
|
|
450
452
|
}
|
|
451
453
|
get disabled() {
|
|
452
454
|
return this._disabled;
|
|
@@ -465,16 +467,16 @@ class B extends V {
|
|
|
465
467
|
}
|
|
466
468
|
_getStarIndex(t) {
|
|
467
469
|
if (!t) return -1;
|
|
468
|
-
const
|
|
469
|
-
return Number.isFinite(
|
|
470
|
+
const e = Number(t.dataset.index);
|
|
471
|
+
return Number.isFinite(e) ? e : -1;
|
|
470
472
|
}
|
|
471
|
-
_getValueFromPointer(t,
|
|
472
|
-
const r = this._getStarIndex(
|
|
473
|
+
_getValueFromPointer(t, e) {
|
|
474
|
+
const r = this._getStarIndex(e);
|
|
473
475
|
if (r === -1) return this._value;
|
|
474
476
|
if (this._precision !== 0.5)
|
|
475
477
|
return r + 1;
|
|
476
|
-
const s =
|
|
477
|
-
return r +
|
|
478
|
+
const s = e.getBoundingClientRect(), l = t.clientX - s.left <= s.width / 2 ? 0.5 : 1;
|
|
479
|
+
return r + l;
|
|
478
480
|
}
|
|
479
481
|
_formatValue(t) {
|
|
480
482
|
return Number.isInteger(t) ? String(t) : t.toFixed(1);
|
|
@@ -484,20 +486,20 @@ class B extends V {
|
|
|
484
486
|
}
|
|
485
487
|
_onRootClick(t) {
|
|
486
488
|
if (this._disabled || this._readonly) return;
|
|
487
|
-
const
|
|
488
|
-
r && (this.value = this._getValueFromPointer(
|
|
489
|
+
const e = t, r = this._getStarFromEventTarget(e.target);
|
|
490
|
+
r && (this.value = this._getValueFromPointer(e, r));
|
|
489
491
|
}
|
|
490
492
|
_onRootMouseMove(t) {
|
|
491
493
|
if (this._disabled || this._readonly) return;
|
|
492
|
-
const
|
|
493
|
-
r && (this._hoverValue = this._getValueFromPointer(
|
|
494
|
+
const e = t, r = this._getStarFromEventTarget(e.target);
|
|
495
|
+
r && (this._hoverValue = this._getValueFromPointer(e, r), this.setAttribute("state", "hover"), this._syncStars());
|
|
494
496
|
}
|
|
495
497
|
_onRootMouseLeave() {
|
|
496
498
|
this._disabled || this._readonly || (this._hoverValue = 0, this.removeAttribute("state"), this._syncStars());
|
|
497
499
|
}
|
|
498
500
|
_onRootFocusIn(t) {
|
|
499
501
|
if (this._disabled || this._readonly) return;
|
|
500
|
-
const
|
|
502
|
+
const e = this._getStarFromEventTarget(t.target), r = this._getStarIndex(e);
|
|
501
503
|
r !== -1 && (this._hoverValue = r + 1, this.setAttribute("state", "focus"), this._syncStars());
|
|
502
504
|
}
|
|
503
505
|
_onRootFocusOut() {
|
|
@@ -505,20 +507,20 @@ class B extends V {
|
|
|
505
507
|
}
|
|
506
508
|
_onRootKeyDown(t) {
|
|
507
509
|
if (this._disabled || this._readonly) return;
|
|
508
|
-
const
|
|
510
|
+
const e = t, r = this._getStarFromEventTarget(e.target), s = this._getStarIndex(r);
|
|
509
511
|
if (s === -1) return;
|
|
510
512
|
let a = this._value;
|
|
511
|
-
const
|
|
512
|
-
switch (
|
|
513
|
+
const l = this._precision;
|
|
514
|
+
switch (e.key) {
|
|
513
515
|
case "ArrowRight":
|
|
514
516
|
case "ArrowUp":
|
|
515
517
|
case "+":
|
|
516
|
-
a =
|
|
518
|
+
a = n(this._value + l, 0, this._max);
|
|
517
519
|
break;
|
|
518
520
|
case "ArrowLeft":
|
|
519
521
|
case "ArrowDown":
|
|
520
522
|
case "-":
|
|
521
|
-
a =
|
|
523
|
+
a = n(this._value - l, 0, this._max);
|
|
522
524
|
break;
|
|
523
525
|
case "Home":
|
|
524
526
|
a = 0;
|
|
@@ -533,34 +535,32 @@ class B extends V {
|
|
|
533
535
|
default:
|
|
534
536
|
return;
|
|
535
537
|
}
|
|
536
|
-
|
|
538
|
+
e.preventDefault(), this.value = a;
|
|
537
539
|
}
|
|
538
|
-
_getFillPercent(t,
|
|
539
|
-
const r =
|
|
540
|
+
_getFillPercent(t, e) {
|
|
541
|
+
const r = e - (t - 1);
|
|
540
542
|
return r >= 1 ? 100 : r <= 0 ? 0 : r * 100;
|
|
541
543
|
}
|
|
542
544
|
_syncStars() {
|
|
543
545
|
const t = this._hoverValue > 0 ? this._hoverValue : this._value;
|
|
544
|
-
this._stars.forEach((
|
|
546
|
+
this._stars.forEach((e, r) => {
|
|
545
547
|
const s = r + 1, a = this._getFillPercent(s, t);
|
|
546
|
-
if (
|
|
547
|
-
|
|
548
|
+
if (e.style.setProperty("--fill-percent", `${a}%`), this._disabled) {
|
|
549
|
+
e.setAttribute("data-state", "disabled"), e.setAttribute("aria-disabled", "true");
|
|
548
550
|
return;
|
|
549
551
|
}
|
|
550
|
-
if (
|
|
551
|
-
a > 0 ?
|
|
552
|
+
if (e.removeAttribute("aria-disabled"), this._hoverValue > 0) {
|
|
553
|
+
a > 0 ? e.setAttribute("data-state", "hover") : e.removeAttribute("data-state");
|
|
552
554
|
return;
|
|
553
555
|
}
|
|
554
|
-
a > 0 ?
|
|
556
|
+
a > 0 ? e.setAttribute("data-state", "active") : e.removeAttribute("data-state");
|
|
555
557
|
}), this._syncAria();
|
|
556
558
|
}
|
|
557
559
|
_syncAria() {
|
|
558
560
|
const t = this._getAriaValueText(this._value);
|
|
559
|
-
this.setAttribute("role", "slider"), this.setAttribute("tabindex", this._disabled || this._readonly ? "-1" : "0"), this.setAttribute("aria-valuemin", "0"), this.setAttribute("aria-valuemax", String(this._max)), this.setAttribute("aria-valuenow", String(this._value)), this.setAttribute("aria-valuetext", t), this.setAttribute("aria-orientation", "horizontal"), this.setAttribute("aria-disabled", this._disabled ? "true" : "false"), this.setAttribute("aria-readonly", this._readonly ? "true" : "false"), this._stars.forEach((
|
|
561
|
+
this.setAttribute("role", "slider"), this.setAttribute("tabindex", this._disabled || this._readonly ? "-1" : "0"), this.setAttribute("aria-valuemin", "0"), this.setAttribute("aria-valuemax", String(this._max)), this.setAttribute("aria-valuenow", String(this._value)), this.setAttribute("aria-valuetext", t), this.setAttribute("aria-orientation", "horizontal"), this.setAttribute("aria-disabled", this._disabled ? "true" : "false"), this.setAttribute("aria-readonly", this._readonly ? "true" : "false"), this._stars.forEach((e, r) => {
|
|
560
562
|
const s = r + 1, a = this._getFillPercent(s, this._hoverValue > 0 ? this._hoverValue : this._value);
|
|
561
|
-
|
|
562
|
-
const n = this._precision === 0.5 ? `${r + 0.5} to ${r + 1}` : `${r + 1}`;
|
|
563
|
-
i.setAttribute("data-fill", String(a)), i.setAttribute("data-star-value", String(s)), i.setAttribute("aria-label", `${n}`);
|
|
563
|
+
e.setAttribute("aria-hidden", "true"), e.setAttribute("data-fill", String(a)), e.setAttribute("data-star-value", String(s));
|
|
564
564
|
});
|
|
565
565
|
}
|
|
566
566
|
_emit(t) {
|
|
@@ -579,13 +579,12 @@ class B extends V {
|
|
|
579
579
|
);
|
|
580
580
|
}
|
|
581
581
|
render() {
|
|
582
|
-
const t =
|
|
583
|
-
this._max = Math.max(1, Number(S) || 5), this._precision = k, this._value =
|
|
582
|
+
const t = g(this, "disabled"), e = g(this, "readonly"), r = C(o(this, "variant")), s = $(o(this, "size")), a = o(this, "theme"), l = T(o(this, "tone")), c = I(o(this, "state")), m = y(o(this, "animation")), d = N(o(this, "shape")), v = q(o(this, "radius")), k = A(o(this, "precision")), p = this._autoAriaLabel ? null : o(this, "aria-label"), f = o(this, "aria-labelledby"), _ = o(this, "aria-describedby"), h = o(this, "label"), b = g(this, "show-value"), R = o(this, "value"), S = o(this, "max");
|
|
583
|
+
this._max = Math.max(1, Number(S) || 5), this._precision = k, this._value = n(u(Number(R) || 0, this._precision), 0, this._max), this._disabled = t, this._readonly = e, m ? this.setAttribute("data-animation", m) : this.removeAttribute("data-animation"), a === "dark" || a === "brand" ? this.setAttribute("theme", a) : this.removeAttribute("theme"), l ? this.setAttribute("tone", l) : this.removeAttribute("tone"), c === "disabled" ? this.setAttribute("state", "disabled") : c !== "idle" ? this.setAttribute("state", c) : this.removeAttribute("state"), d === "square" || d === "pill" ? this.setAttribute("shape", d) : this.removeAttribute("shape"), r === "default" ? this.removeAttribute("variant") : this.setAttribute("variant", r), s === "md" ? this.removeAttribute("size") : this.setAttribute("size", s), v ? this.style.setProperty("--ui-rating-radius", v) : this.style.removeProperty("--ui-rating-radius"), this.setAttribute("precision", String(this._precision));
|
|
584
584
|
const E = Array.from({ length: this._max }, (P, L) => `
|
|
585
|
-
<
|
|
586
|
-
type="button"
|
|
585
|
+
<span
|
|
587
586
|
class="star"
|
|
588
|
-
|
|
587
|
+
aria-hidden="true"
|
|
589
588
|
data-index="${L}"
|
|
590
589
|
part="star"
|
|
591
590
|
style="--fill-percent: 0%;"
|
|
@@ -598,10 +597,10 @@ class B extends V {
|
|
|
598
597
|
</span>
|
|
599
598
|
</span>
|
|
600
599
|
</span>
|
|
601
|
-
</
|
|
600
|
+
</span>
|
|
602
601
|
`).join(""), F = b ? `${this._formatValue(this._value)} / ${this._max}` : "";
|
|
603
602
|
this.setContent(`
|
|
604
|
-
<style>${
|
|
603
|
+
<style>${V}</style>
|
|
605
604
|
<div
|
|
606
605
|
class="stars"
|
|
607
606
|
part="stars"
|
|
@@ -609,15 +608,15 @@ class B extends V {
|
|
|
609
608
|
>
|
|
610
609
|
${E}
|
|
611
610
|
</div>
|
|
612
|
-
${
|
|
611
|
+
${h || b ? `
|
|
613
612
|
<div class="label" part="label">
|
|
614
|
-
${
|
|
613
|
+
${h ? `<span class="label-text">${w(h)}</span>` : ""}
|
|
615
614
|
${b ? `<span class="value">${w(F)}</span>` : ""}
|
|
616
615
|
</div>
|
|
617
616
|
` : ""}
|
|
618
617
|
`), queueMicrotask(() => {
|
|
619
618
|
this._stars = Array.from(this.root.querySelectorAll(".star")), this._syncStars();
|
|
620
|
-
}),
|
|
619
|
+
}), this._autoAriaLabel = !1, p ? this.setAttribute("aria-label", p) : f ? this.removeAttribute("aria-label") : (this.setAttribute("aria-label", (h || "").trim() || "Rating"), this._autoAriaLabel = !0), f ? this.setAttribute("aria-labelledby", f) : this.removeAttribute("aria-labelledby"), _ ? this.setAttribute("aria-describedby", _) : this.removeAttribute("aria-describedby"), this._disabled ? this.setAttribute("disabled", "") : this.removeAttribute("disabled"), this._readonly ? this.setAttribute("readonly", "") : this.removeAttribute("readonly"), this._syncAria();
|
|
621
620
|
}
|
|
622
621
|
}
|
|
623
622
|
typeof customElements < "u" && !customElements.get("ui-rating") && customElements.define("ui-rating", B);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("./roving-focus-group-BdJ_4Njm.js");function
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const d=require("./domElement-DazSZBjV.js"),s=require("./roving-focus-group-BdJ_4Njm.js");function m(n){if(!n.isConnected||n.hidden)return!1;const e=window.getComputedStyle(n);return!(e.display==="none"||e.visibility==="hidden")}function u(n){const e=n.getAttribute("aria-disabled");return n.hasAttribute("disabled")||e==="true"||n.disabled===!0}class l extends d.DOMElement{constructor(){super(...arguments),this._container=null}static get observedAttributes(){return["item-selector","direct-item-selector","active-attribute","loop"]}get container(){return this._container}set container(e){this._container=e}get itemSelector(){return this.getAttribute("item-selector")||'[tabindex], button, [role="tab"], [role="radio"]'}get directItemSelector(){return this.getAttribute("direct-item-selector")||""}get activeAttribute(){const e=this.getAttribute("active-attribute");return e===""?null:e||null}queryItems(){const e=this._container||this,i=this.directItemSelector.trim();let t=i?Array.from(e.querySelectorAll(i)):[];return t.length||(t=Array.from(e.querySelectorAll(this.itemSelector))),t.filter(r=>m(r))}queryEnabledItems(){return this.queryItems().filter(e=>!u(e))}getActiveItem(){return this.queryItems().find(e=>e.getAttribute("tabindex")==="0")||null}setActiveItem(e,i={}){const t=this.queryItems(),r=e&&t.includes(e)&&!u(e)?e:null;return s.syncRovingTabStops(t,r,{activeAttribute:this.activeAttribute}),r&&i.focus&&s.focusRovingItem(r),this.dispatchEvent(new CustomEvent("active-item-change",{detail:{item:r},bubbles:!0,composed:!0})),r}focusBoundary(e,i={}){const t=this.queryItems(),r=s.getRovingFocusBoundaryIndex(t,e,u);return r<0?null:this.setActiveItem(t[r],i)}move(e,i={}){const t=this.queryItems();if(!t.length)return null;const r=i.current||this.getActiveItem(),o=r?t.indexOf(r):-1,a=s.resolveRovingFocusIndex(t,{activeIndex:o,getDisabled:u}),c=s.moveRovingFocusIndex(t,o,e,{wrap:i.wrap!==!1&&this.getAttribute("loop")!=="false",fallbackIndex:a,getDisabled:u});return c<0?null:this.setActiveItem(t[c],{focus:i.focus})}}typeof customElements<"u"&&!customElements.get("ui-roving-focus-group")&&customElements.define("ui-roving-focus-group",l);exports.UIRovingFocusGroup=l;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { D as l } from "./domElement-ZlSGVP0l.mjs";
|
|
2
|
+
import { s as a, f as d, g as m, r as f, m as b } from "./roving-focus-group-Dbm1Jko_.mjs";
|
|
3
|
+
function g(s) {
|
|
3
4
|
if (!s.isConnected || s.hidden) return !1;
|
|
4
5
|
const t = window.getComputedStyle(s);
|
|
5
6
|
return !(t.display === "none" || t.visibility === "hidden");
|
|
@@ -8,7 +9,7 @@ function n(s) {
|
|
|
8
9
|
const t = s.getAttribute("aria-disabled");
|
|
9
10
|
return s.hasAttribute("disabled") || t === "true" || s.disabled === !0;
|
|
10
11
|
}
|
|
11
|
-
class
|
|
12
|
+
class h extends l {
|
|
12
13
|
constructor() {
|
|
13
14
|
super(...arguments), this._container = null;
|
|
14
15
|
}
|
|
@@ -34,7 +35,7 @@ class g extends HTMLElement {
|
|
|
34
35
|
queryItems() {
|
|
35
36
|
const t = this._container || this, i = this.directItemSelector.trim();
|
|
36
37
|
let e = i ? Array.from(t.querySelectorAll(i)) : [];
|
|
37
|
-
return e.length || (e = Array.from(t.querySelectorAll(this.itemSelector))), e.filter((r) =>
|
|
38
|
+
return e.length || (e = Array.from(t.querySelectorAll(this.itemSelector))), e.filter((r) => g(r));
|
|
38
39
|
}
|
|
39
40
|
queryEnabledItems() {
|
|
40
41
|
return this.queryItems().filter((t) => !n(t));
|
|
@@ -44,19 +45,19 @@ class g extends HTMLElement {
|
|
|
44
45
|
}
|
|
45
46
|
setActiveItem(t, i = {}) {
|
|
46
47
|
const e = this.queryItems(), r = t && e.includes(t) && !n(t) ? t : null;
|
|
47
|
-
return
|
|
48
|
+
return a(e, r, { activeAttribute: this.activeAttribute }), r && i.focus && d(r), this.dispatchEvent(new CustomEvent("active-item-change", { detail: { item: r }, bubbles: !0, composed: !0 })), r;
|
|
48
49
|
}
|
|
49
50
|
focusBoundary(t, i = {}) {
|
|
50
|
-
const e = this.queryItems(), r =
|
|
51
|
+
const e = this.queryItems(), r = m(e, t, n);
|
|
51
52
|
return r < 0 ? null : this.setActiveItem(e[r], i);
|
|
52
53
|
}
|
|
53
54
|
move(t, i = {}) {
|
|
54
55
|
const e = this.queryItems();
|
|
55
56
|
if (!e.length) return null;
|
|
56
|
-
const r = i.current || this.getActiveItem(), u = r ? e.indexOf(r) : -1, c =
|
|
57
|
+
const r = i.current || this.getActiveItem(), u = r ? e.indexOf(r) : -1, c = f(e, {
|
|
57
58
|
activeIndex: u,
|
|
58
59
|
getDisabled: n
|
|
59
|
-
}), o =
|
|
60
|
+
}), o = b(e, u, t, {
|
|
60
61
|
wrap: i.wrap !== !1 && this.getAttribute("loop") !== "false",
|
|
61
62
|
fallbackIndex: c,
|
|
62
63
|
getDisabled: n
|
|
@@ -64,7 +65,7 @@ class g extends HTMLElement {
|
|
|
64
65
|
return o < 0 ? null : this.setActiveItem(e[o], { focus: i.focus });
|
|
65
66
|
}
|
|
66
67
|
}
|
|
67
|
-
typeof customElements < "u" && !customElements.get("ui-roving-focus-group") && customElements.define("ui-roving-focus-group",
|
|
68
|
+
typeof customElements < "u" && !customElements.get("ui-roving-focus-group") && customElements.define("ui-roving-focus-group", h);
|
|
68
69
|
export {
|
|
69
|
-
|
|
70
|
+
h as UIRovingFocusGroup
|
|
70
71
|
};
|