@editora/ui-core 0.2.1 → 0.3.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/dist/{ElementBase-DxbvhLJs.js → ElementBase-CbUsP3D6.js} +1 -1
- package/dist/{ElementBase-BeZT54Hj.mjs → ElementBase-D5QsC5Vw.mjs} +10 -1
- package/dist/ElementBase.d.ts +7 -0
- package/dist/ElementBase.d.ts.map +1 -1
- package/dist/accordion.cjs.js +1 -1
- package/dist/accordion.esm.js +1 -1
- package/dist/add-icons-CVeHOsWl.js +1 -0
- package/dist/add-icons-DBUZJ0g7.mjs +14 -0
- package/dist/add-icons.cjs.js +1 -0
- package/dist/add-icons.d.ts +16 -0
- package/dist/add-icons.d.ts.map +1 -0
- package/dist/add-icons.esm.js +4 -0
- package/dist/alert-dialog.cjs.js +24 -24
- package/dist/alert-dialog.esm.js +112 -107
- package/dist/alert.cjs.js +8 -8
- package/dist/alert.esm.js +22 -22
- package/dist/animated-beam.cjs.js +1 -1
- package/dist/animated-beam.esm.js +1 -1
- package/dist/animated-list.cjs.js +1 -1
- package/dist/animated-list.esm.js +1 -1
- package/dist/animated-text.cjs.js +1 -1
- package/dist/animated-text.esm.js +1 -1
- package/dist/app-header.cjs.js +15 -3
- package/dist/app-header.esm.js +31 -4
- package/dist/aspect-ratio.cjs.js +1 -1
- package/dist/aspect-ratio.esm.js +1 -1
- package/dist/avatar.cjs.js +1 -1
- package/dist/avatar.esm.js +1 -1
- package/dist/badge.cjs.js +1 -1
- package/dist/badge.esm.js +1 -1
- package/dist/block-controls.cjs.js +1 -1
- package/dist/block-controls.esm.js +1 -1
- package/dist/box.cjs.js +1 -1
- package/dist/box.esm.js +1 -1
- package/dist/breadcrumb.cjs.js +4 -4
- package/dist/breadcrumb.esm.js +93 -84
- package/dist/button.cjs.js +520 -1
- package/dist/button.esm.js +682 -2
- package/dist/{calendar-CzpWDxLc.js → calendar-BsVqtpjM.js} +6 -6
- package/dist/{calendar-DkSDFg33.mjs → calendar-CFafqZVA.mjs} +6 -6
- package/dist/calendar.cjs.js +1 -1
- package/dist/calendar.esm.js +1 -1
- package/dist/card.cjs.js +6 -5
- package/dist/card.esm.js +52 -39
- package/dist/chart.cjs.js +2 -2
- package/dist/chart.esm.js +2 -2
- package/dist/checkbox.cjs.js +4 -4
- package/dist/checkbox.esm.js +36 -15
- package/dist/clone-source-BxK2pEVw.mjs +11 -0
- package/dist/clone-source-C7E_ri5f.js +1 -0
- package/dist/collapsible.cjs.js +1 -1
- package/dist/collapsible.esm.js +1 -1
- package/dist/color-picker.cjs.js +2 -2
- package/dist/color-picker.esm.js +3 -3
- package/dist/combobox.cjs.js +4 -4
- package/dist/combobox.esm.js +22 -19
- package/dist/command-palette.cjs.js +1 -1
- package/dist/command-palette.esm.js +1 -1
- package/dist/command.cjs.js +1 -1
- package/dist/command.esm.js +1 -1
- package/dist/components/ui-alert-dialog.d.ts.map +1 -1
- package/dist/components/ui-alert.d.ts.map +1 -1
- package/dist/components/ui-app-header.d.ts +1 -0
- package/dist/components/ui-app-header.d.ts.map +1 -1
- package/dist/components/ui-breadcrumb.d.ts.map +1 -1
- package/dist/components/ui-card.d.ts +7 -0
- package/dist/components/ui-card.d.ts.map +1 -1
- package/dist/components/ui-checkbox.d.ts +6 -0
- package/dist/components/ui-checkbox.d.ts.map +1 -1
- package/dist/components/ui-combobox.d.ts.map +1 -1
- package/dist/components/ui-date-time-picker.d.ts.map +1 -1
- package/dist/components/ui-dialog.d.ts +1 -0
- package/dist/components/ui-dialog.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-empty-state.d.ts.map +1 -1
- package/dist/components/ui-hover-card.d.ts.map +1 -1
- package/dist/components/ui-icon.d.ts +1 -0
- package/dist/components/ui-icon.d.ts.map +1 -1
- package/dist/components/ui-input.d.ts +16 -0
- package/dist/components/ui-input.d.ts.map +1 -1
- package/dist/components/ui-layout.d.ts +20 -0
- package/dist/components/ui-layout.d.ts.map +1 -1
- package/dist/components/ui-menu.d.ts +1 -0
- package/dist/components/ui-menu.d.ts.map +1 -1
- package/dist/components/ui-menubar.d.ts.map +1 -1
- package/dist/components/ui-multi-select.d.ts +6 -0
- package/dist/components/ui-multi-select.d.ts.map +1 -1
- package/dist/components/ui-number-field.d.ts +6 -0
- package/dist/components/ui-number-field.d.ts.map +1 -1
- package/dist/components/ui-pagination.d.ts.map +1 -1
- package/dist/components/ui-password-field.d.ts +11 -0
- package/dist/components/ui-password-field.d.ts.map +1 -1
- package/dist/components/ui-popover.d.ts.map +1 -1
- package/dist/components/ui-positioner.d.ts.map +1 -1
- package/dist/components/ui-radio-group.d.ts +6 -0
- package/dist/components/ui-radio-group.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-select.d.ts +7 -0
- package/dist/components/ui-select.d.ts.map +1 -1
- package/dist/components/ui-sidebar.d.ts +1 -0
- package/dist/components/ui-sidebar.d.ts.map +1 -1
- package/dist/components/ui-slider.d.ts +6 -0
- package/dist/components/ui-slider.d.ts.map +1 -1
- package/dist/components/ui-sortable.d.ts +1 -0
- package/dist/components/ui-sortable.d.ts.map +1 -1
- package/dist/components/ui-switch.d.ts +6 -0
- package/dist/components/ui-switch.d.ts.map +1 -1
- package/dist/components/ui-tabs.d.ts +2 -0
- package/dist/components/ui-tabs.d.ts.map +1 -1
- package/dist/components/ui-textarea.d.ts +6 -0
- package/dist/components/ui-textarea.d.ts.map +1 -1
- package/dist/components/ui-toast.d.ts.map +1 -1
- package/dist/components/ui-tooltip.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 +2 -2
- package/dist/context-menu.esm.js +2 -2
- package/dist/control-group.cjs.js +1 -1
- package/dist/control-group.esm.js +1 -1
- package/dist/data-table.cjs.js +5 -5
- package/dist/data-table.esm.js +7 -7
- package/dist/date-field.cjs.js +1 -1
- package/dist/date-field.esm.js +3 -3
- package/dist/date-picker.cjs.js +2 -2
- package/dist/date-picker.esm.js +17 -17
- package/dist/date-range-picker.cjs.js +2 -2
- package/dist/date-range-picker.esm.js +4 -4
- package/dist/date-range-time-picker.cjs.js +3 -3
- package/dist/date-range-time-picker.esm.js +16 -16
- package/dist/date-time-picker.cjs.js +26 -23
- package/dist/date-time-picker.esm.js +49 -46
- package/dist/{date-time-utils-zAx4ghvC.mjs → date-time-utils-CJUksWj3.mjs} +1 -1
- package/dist/{date-time-utils-C-4eHTyy.js → date-time-utils-D3hQQ5Om.js} +1 -1
- package/dist/description.cjs.js +1 -1
- package/dist/description.esm.js +1 -1
- package/dist/dialog.cjs.js +7 -7
- package/dist/dialog.esm.js +51 -47
- 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 +1 -1
- package/dist/dock.esm.js +1 -1
- package/dist/drawer.cjs.js +5 -5
- package/dist/drawer.esm.js +18 -17
- package/dist/dropdown.cjs.js +7 -7
- package/dist/dropdown.esm.js +39 -38
- package/dist/empty-state.cjs.js +12 -2
- package/dist/empty-state.esm.js +17 -7
- package/dist/field-error.cjs.js +1 -1
- package/dist/field-error.esm.js +1 -1
- package/dist/field.cjs.js +2 -2
- package/dist/field.esm.js +2 -2
- package/dist/fieldset.cjs.js +1 -1
- package/dist/fieldset.esm.js +1 -1
- package/dist/file-upload.cjs.js +1 -1
- package/dist/file-upload.esm.js +1 -1
- package/dist/flex.cjs.js +1 -1
- package/dist/flex.esm.js +1 -1
- package/dist/floating-toolbar.cjs.js +2 -2
- package/dist/floating-toolbar.esm.js +2 -2
- package/dist/focus-scope-Dl0qk5GP.mjs +177 -0
- package/dist/focus-scope-Doz0bnE1.js +1 -0
- package/dist/focus-scope.cjs.js +1 -1
- package/dist/focus-scope.esm.js +2 -2
- package/dist/form-control-B90_3kYN.js +1 -0
- package/dist/form-control-D9wWUMBl.mjs +86 -0
- package/dist/form.cjs.js +2 -2
- package/dist/form.esm.js +2 -2
- package/dist/gantt.cjs.js +2 -2
- package/dist/gantt.esm.js +2 -2
- package/dist/grid.cjs.js +1 -1
- package/dist/grid.esm.js +1 -1
- package/dist/hover-card.cjs.js +5 -5
- package/dist/hover-card.esm.js +19 -18
- package/dist/icon-cloud.cjs.js +1 -1
- package/dist/icon-cloud.esm.js +1 -1
- package/dist/icon.cjs.js +207 -1
- package/dist/icon.esm.js +294 -2
- package/dist/icons-CpCpPXV5.js +1 -0
- package/dist/icons-DWYbbhb0.mjs +115 -0
- package/dist/icons.d.ts +11 -1
- package/dist/icons.d.ts.map +1 -1
- package/dist/implicit-submit-B6M5Uc56.js +1 -0
- package/dist/implicit-submit-Lr0-q2LR.mjs +44 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +309 -299
- package/dist/inline-edit.cjs.js +1 -1
- package/dist/inline-edit.esm.js +1 -1
- package/dist/input.cjs.js +62 -20
- package/dist/input.esm.js +164 -58
- package/dist/label.cjs.js +1 -1
- package/dist/label.esm.js +1 -1
- package/dist/layout.cjs.js +145 -4
- package/dist/layout.esm.js +278 -40
- package/dist/marquee.cjs.js +1 -1
- package/dist/marquee.esm.js +1 -1
- package/dist/masonry-grid.cjs.js +1 -1
- package/dist/masonry-grid.esm.js +1 -1
- package/dist/menu.cjs.js +8 -8
- package/dist/menu.esm.js +51 -47
- package/dist/menubar.cjs.js +9 -9
- package/dist/menubar.esm.js +41 -40
- package/dist/meter.cjs.js +1 -1
- package/dist/meter.esm.js +1 -1
- package/dist/multi-select.cjs.js +7 -7
- package/dist/multi-select.esm.js +55 -34
- package/dist/navigate-CXebafwF.mjs +18 -0
- package/dist/navigate-ChJVIIuS.js +1 -0
- package/dist/navigation-menu.cjs.js +1 -1
- package/dist/navigation-menu.esm.js +1 -1
- package/dist/number-attribute-BAF07JrU.mjs +8 -0
- package/dist/number-attribute-C4Rrl7d3.js +1 -0
- package/dist/number-field.cjs.js +8 -8
- package/dist/number-field.esm.js +90 -69
- package/dist/number-ticker.cjs.js +1 -1
- package/dist/number-ticker.esm.js +1 -1
- package/dist/odometer.cjs.js +1 -1
- package/dist/odometer.esm.js +1 -1
- package/dist/orbiter.cjs.js +1 -1
- package/dist/orbiter.esm.js +1 -1
- package/dist/pagination.cjs.js +24 -23
- package/dist/pagination.esm.js +61 -46
- package/dist/{panel-group-BVHJEdfx.js → panel-group-BIzzpQ5i.js} +1 -1
- package/dist/{panel-group-BxO_eNW6.mjs → panel-group-CFLjzRWI.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 +36 -16
- package/dist/password-field.esm.js +113 -44
- package/dist/pin-input.cjs.js +1 -1
- package/dist/pin-input.esm.js +1 -1
- package/dist/placement-grid.cjs.js +1 -1
- package/dist/placement-grid.esm.js +1 -1
- package/dist/plugin-panel.cjs.js +1 -1
- package/dist/plugin-panel.esm.js +1 -1
- package/dist/popover.cjs.js +2 -2
- package/dist/popover.esm.js +28 -26
- package/dist/portal.cjs.js +1 -1
- package/dist/portal.esm.js +1 -1
- package/dist/positioner.cjs.js +2 -2
- package/dist/positioner.esm.js +35 -38
- package/dist/preload.cjs.js +221 -0
- package/dist/preload.css +220 -0
- package/dist/preload.d.ts +17 -0
- package/dist/preload.d.ts.map +1 -0
- package/dist/preload.esm.js +224 -0
- package/dist/presence.cjs.js +1 -1
- package/dist/presence.esm.js +1 -1
- package/dist/primitives/clone-source.d.ts +3 -0
- package/dist/primitives/clone-source.d.ts.map +1 -0
- package/dist/primitives/focus-scope.d.ts +6 -0
- package/dist/primitives/focus-scope.d.ts.map +1 -1
- package/dist/primitives/form-control.d.ts +68 -0
- package/dist/primitives/form-control.d.ts.map +1 -0
- package/dist/primitives/implicit-submit.d.ts +17 -0
- package/dist/primitives/implicit-submit.d.ts.map +1 -0
- package/dist/primitives/navigate.d.ts +27 -0
- package/dist/primitives/navigate.d.ts.map +1 -0
- package/dist/primitives/number-attribute.d.ts +7 -0
- package/dist/primitives/number-attribute.d.ts.map +1 -0
- package/dist/primitives/slotted-input.d.ts +19 -0
- package/dist/primitives/slotted-input.d.ts.map +1 -0
- package/dist/progress.cjs.js +3 -3
- package/dist/progress.esm.js +3 -3
- package/dist/quick-actions.cjs.js +5 -5
- package/dist/quick-actions.esm.js +3 -3
- package/dist/radio-group.cjs.js +9 -9
- package/dist/radio-group.esm.js +47 -24
- package/dist/radio.cjs.js +1 -1
- package/dist/radio.esm.js +1 -1
- package/dist/rating.cjs.js +6 -6
- package/dist/rating.esm.js +21 -10
- package/dist/{runtime-BRT7E4A8.mjs → runtime-CORXjP7e.mjs} +379 -357
- package/dist/runtime-uCly3ECd.js +5 -0
- package/dist/runtime.cjs.js +1 -1
- package/dist/runtime.esm.js +1 -1
- 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 +21 -21
- package/dist/select.esm.js +111 -71
- package/dist/selection-popup.cjs.js +2 -2
- package/dist/selection-popup.esm.js +2 -2
- package/dist/semantic-tokens.d.ts.map +1 -1
- package/dist/separator.cjs.js +1 -1
- package/dist/separator.esm.js +1 -1
- package/dist/sidebar.cjs.js +15 -15
- package/dist/sidebar.esm.js +48 -42
- package/dist/skeleton.cjs.js +1 -1
- package/dist/skeleton.esm.js +1 -1
- package/dist/slider.cjs.js +11 -11
- package/dist/slider.esm.js +40 -23
- package/dist/slot.cjs.js +1 -1
- package/dist/slot.esm.js +1 -1
- package/dist/slotted-input-BVq2QQg2.js +1 -0
- package/dist/slotted-input-atWznLfm.mjs +13 -0
- package/dist/sortable.cjs.js +25 -25
- package/dist/sortable.esm.js +29 -21
- package/dist/spinning-text.cjs.js +1 -1
- package/dist/spinning-text.esm.js +1 -1
- package/dist/split-button.cjs.js +1 -1
- package/dist/split-button.esm.js +1 -1
- package/dist/splitter.cjs.js +1 -1
- package/dist/splitter.esm.js +1 -1
- package/dist/standalone/add-icons.d.ts +2 -0
- package/dist/standalone/add-icons.d.ts.map +1 -0
- package/dist/standalone/preload.d.ts +2 -0
- package/dist/standalone/preload.d.ts.map +1 -0
- package/dist/stepper.cjs.js +3 -3
- package/dist/stepper.esm.js +3 -3
- package/dist/switch.cjs.js +9 -9
- package/dist/switch.esm.js +56 -35
- package/dist/table.cjs.js +1 -1
- package/dist/table.esm.js +1 -1
- package/dist/tabs.cjs.js +14 -14
- package/dist/tabs.esm.js +129 -115
- package/dist/tags-input.cjs.js +1 -1
- package/dist/tags-input.esm.js +1 -1
- package/dist/textarea.cjs.js +33 -11
- package/dist/textarea.esm.js +74 -35
- package/dist/theme.d.ts +6 -0
- package/dist/theme.d.ts.map +1 -1
- package/dist/time-field.cjs.js +1 -1
- package/dist/time-field.esm.js +2 -2
- package/dist/time-picker.cjs.js +1 -1
- package/dist/time-picker.esm.js +3 -3
- package/dist/timeline.cjs.js +2 -2
- package/dist/timeline.esm.js +2 -2
- package/dist/toast.cjs.js +4 -4
- package/dist/toast.esm.js +17 -16
- package/dist/toggle-group.cjs.js +1 -1
- package/dist/toggle-group.esm.js +1 -1
- package/dist/toggle.cjs.js +3 -3
- package/dist/toggle.esm.js +9 -9
- package/dist/toolbar.cjs.js +1 -1
- package/dist/toolbar.esm.js +1 -1
- package/dist/tooltip.cjs.js +2 -2
- package/dist/tooltip.esm.js +12 -14
- package/dist/transfer-list.cjs.js +1 -1
- package/dist/transfer-list.esm.js +1 -1
- package/dist/{tree-33fVNnaf.mjs → tree-CD2k2lIC.mjs} +1 -1
- package/dist/{tree-Dc02MChE.js → tree-ChQfhxya.js} +1 -1
- 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/visually-hidden.cjs.js +1 -1
- package/dist/visually-hidden.esm.js +1 -1
- package/dist/wizard.cjs.js +4 -4
- package/dist/wizard.esm.js +4 -4
- package/package.json +3 -2
- package/dist/focus-scope-Bwug2gDv.js +0 -1
- package/dist/focus-scope-CmEsG5UZ.mjs +0 -138
- package/dist/runtime-CXw4SGV9.js +0 -5
- package/dist/ui-button-C3OmI7Sn.mjs +0 -684
- package/dist/ui-button-CnLwXBnx.js +0 -520
- package/dist/ui-icon-D3avtxX_.js +0 -207
- package/dist/ui-icon-DLhB08Fo.mjs +0 -361
package/dist/sortable.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { E as dt } from "./ElementBase-
|
|
1
|
+
import { E as dt } from "./ElementBase-D5QsC5Vw.mjs";
|
|
2
2
|
function K(u, t, e, i = 56, r = 18) {
|
|
3
3
|
if (!Number.isFinite(u) || !(e > t)) return 0;
|
|
4
4
|
const s = Math.min(i, (e - t) / 2);
|
|
@@ -999,7 +999,7 @@ function H(u, t) {
|
|
|
999
999
|
function ft(u) {
|
|
1000
1000
|
return u === "item" ? "item" : "handle";
|
|
1001
1001
|
}
|
|
1002
|
-
function
|
|
1002
|
+
function z(u) {
|
|
1003
1003
|
return { ...u };
|
|
1004
1004
|
}
|
|
1005
1005
|
function B(u) {
|
|
@@ -1024,15 +1024,15 @@ function j(u, t, e, i, r, s) {
|
|
|
1024
1024
|
!S || d.has(m) || (d.add(m), o.push(m), (a.get(w(S.listId, m)) || []).forEach(c));
|
|
1025
1025
|
};
|
|
1026
1026
|
i.forEach(c);
|
|
1027
|
-
const l = u.map(
|
|
1027
|
+
const l = u.map(z), p = l.filter((m) => d.has(m.id)), g = r ? l.map(z) : l.filter((m) => !d.has(m.id)), b = r ? p.map((m) => s(m, o)) : p.map(z), y = /* @__PURE__ */ new Map(), h = /* @__PURE__ */ new Map();
|
|
1028
1028
|
r && p.forEach((m, S) => {
|
|
1029
1029
|
y.set(m.id, b[S].id), h.set(b[S].id, m.id);
|
|
1030
1030
|
}), b.forEach((m) => {
|
|
1031
1031
|
const S = r ? h.get(m.id) : m.id, L = S ? n.get(S) : null;
|
|
1032
1032
|
L && (r && (m.parentId = L.parentId && y.has(L.parentId) && y.get(L.parentId) || null), m.listId = e.listId);
|
|
1033
1033
|
});
|
|
1034
|
-
const f = i.map((m) => y.get(m) || m), x = [...g, ...b], D = M(g), C = w(e.listId, e.parentId),
|
|
1035
|
-
|
|
1034
|
+
const f = i.map((m) => y.get(m) || m), x = [...g, ...b], D = M(g), C = w(e.listId, e.parentId), A = [...D.get(C) || []], E = e.beforeId ? A.indexOf(e.beforeId) : A.length, F = E >= 0 ? E : A.length;
|
|
1035
|
+
A.splice(F, 0, ...f), D.set(C, A), M(b).forEach((m, S) => {
|
|
1036
1036
|
const [, L] = S.split("::");
|
|
1037
1037
|
(L || "") !== "__root__" && D.set(S, [...m]);
|
|
1038
1038
|
});
|
|
@@ -1050,7 +1050,7 @@ function j(u, t, e, i, r, s) {
|
|
|
1050
1050
|
return t.forEach((m) => R(m.id, null)), x.forEach((m) => {
|
|
1051
1051
|
k.has(m.id) || (m.parentId = null, P.push(m));
|
|
1052
1052
|
}), {
|
|
1053
|
-
items: P.map(
|
|
1053
|
+
items: P.map(z),
|
|
1054
1054
|
insertedRootIds: f
|
|
1055
1055
|
};
|
|
1056
1056
|
}
|
|
@@ -1129,7 +1129,7 @@ function U(u, t) {
|
|
|
1129
1129
|
};
|
|
1130
1130
|
return u.forEach((o) => d(o.id, null)), i.forEach((o) => {
|
|
1131
1131
|
a.has(o.id) || (o.parentId = null, n.push(o));
|
|
1132
|
-
}), n.map(
|
|
1132
|
+
}), n.map(z);
|
|
1133
1133
|
}
|
|
1134
1134
|
function bt(u) {
|
|
1135
1135
|
return JSON.stringify(u.map((t) => ({
|
|
@@ -1403,7 +1403,7 @@ const $ = class $ extends dt {
|
|
|
1403
1403
|
}
|
|
1404
1404
|
render() {
|
|
1405
1405
|
this._syncStateFromAttributes();
|
|
1406
|
-
const t = this._measureItemShellRects(), e = new Set(this._draggingIds()), i = new Set(this._selection), s = !!this._dragState?.keyboard ? this._projectedMoveResult() : null, n = s?.items || this._items, a = new Set(s?.insertedRootIds || []), d = !!this._dragState && !this._dragState.keyboard && !!this._dragState.dropTarget, o = nt(n, i, e, this.filterQuery, this.sort), c = this._resolvedFocusedId(o), l = this._isDragLocked(), p = this._selection.length, g = this.getAttribute("allow-nesting") !== "false", b = this.getAttribute("drop-indicator-visibility") === "always" ? "always" : "active", y = this._dropzoneStyle(), h = this.getAttribute("show-selection-badge") !== "false", f = this._dragHandleMode(), x = this._usesCustomHandleSelector(), D = l ? this.sort === "label" ? this._t("hintPausedSort") : this.filterQuery && !this.hasAttribute("allow-filtered-drag") ? this._t("hintPausedFilter") : this._t("hintDisabled") : this._dragState?.keyboard ? this._t("hintKeyboard") : f === "item" ? this._t("hintItem") : x ? this._t("hintCustom") : this._t("hintHandle"), C = this.hasAttribute("hide-toolbar"),
|
|
1406
|
+
const t = this._measureItemShellRects(), e = new Set(this._draggingIds()), i = new Set(this._selection), s = !!this._dragState?.keyboard ? this._projectedMoveResult() : null, n = s?.items || this._items, a = new Set(s?.insertedRootIds || []), d = !!this._dragState && !this._dragState.keyboard && !!this._dragState.dropTarget, o = nt(n, i, e, this.filterQuery, this.sort), c = this._resolvedFocusedId(o), l = this._isDragLocked(), p = this._selection.length, g = this.getAttribute("allow-nesting") !== "false", b = this.getAttribute("drop-indicator-visibility") === "always" ? "always" : "active", y = this._dropzoneStyle(), h = this.getAttribute("show-selection-badge") !== "false", f = this._dragHandleMode(), x = this._usesCustomHandleSelector(), D = l ? this.sort === "label" ? this._t("hintPausedSort") : this.filterQuery && !this.hasAttribute("allow-filtered-drag") ? this._t("hintPausedFilter") : this._t("hintDisabled") : this._dragState?.keyboard ? this._t("hintKeyboard") : f === "item" ? this._t("hintItem") : x ? this._t("hintCustom") : this._t("hintHandle"), C = this.hasAttribute("hide-toolbar"), A = g && !l && !this._dragState?.keyboard ? this._t(this._nestTrigger() === "area" ? "hintNestArea" : this._nestTrigger() === "modifier" ? "hintNestModifier" : "hintNestGutter") : "", E = `
|
|
1407
1407
|
<style>${gt}</style>
|
|
1408
1408
|
<div
|
|
1409
1409
|
class="root"
|
|
@@ -1414,7 +1414,7 @@ const $ = class $ extends dt {
|
|
|
1414
1414
|
data-dropzone-style="${y}"
|
|
1415
1415
|
>
|
|
1416
1416
|
<div class="toolbar" part="toolbar"${C ? ' data-hidden="true"' : ""}>
|
|
1417
|
-
<div class="helper" id="ui-sortable-helper">${v(
|
|
1417
|
+
<div class="helper" id="ui-sortable-helper">${v(A ? `${D} ${A}` : D)}</div>
|
|
1418
1418
|
<div class="helper selection-summary" data-count="${p}">
|
|
1419
1419
|
<span class="selection-pill" part="selection-count">${p}</span>
|
|
1420
1420
|
<span class="selection-text">${v(p === 1 ? this._t("selectedOne") : this._t("selectedMany"))}</span>
|
|
@@ -1462,7 +1462,7 @@ const $ = class $ extends dt {
|
|
|
1462
1462
|
`, F = this._captureScroll();
|
|
1463
1463
|
this._focusWasInside = !!this.root.activeElement, this.setContent(E), this._restoreScroll(F), this._fillCustomTargets(), queueMicrotask(() => {
|
|
1464
1464
|
this._restorePendingFocus(), this._dragState?.keyboard && this.root.querySelector(".item-placeholder")?.scrollIntoView?.({ block: "nearest", inline: "nearest" }), this._applyCurrentDropTargetVisualState(), this._applyLiveMessage(), this._animateItemShellReflow(t);
|
|
1465
|
-
});
|
|
1465
|
+
}), this._syncScrollTabStops();
|
|
1466
1466
|
}
|
|
1467
1467
|
_syncStateFromAttributes() {
|
|
1468
1468
|
const t = this.getAttribute("lists");
|
|
@@ -1655,6 +1655,14 @@ const $ = class $ extends dt {
|
|
|
1655
1655
|
const e = new Set(this._items.map((i) => i.id));
|
|
1656
1656
|
this._selection = V(t).filter((i) => e.has(i)), !this._selection.length && this._focusedId && !e.has(this._focusedId) && (this._focusedId = null);
|
|
1657
1657
|
}
|
|
1658
|
+
// A scrolling list with no item that is the tab stop (the single roving stop is in another
|
|
1659
|
+
// list) could not be reached, and so not scrolled, from the keyboard: the list itself is then
|
|
1660
|
+
// the tab stop.
|
|
1661
|
+
_syncScrollTabStops() {
|
|
1662
|
+
this.root.querySelectorAll('.items[data-scroll="true"]').forEach((t) => {
|
|
1663
|
+
t.querySelector('.item[tabindex="0"]') ? t.removeAttribute("tabindex") : t.setAttribute("tabindex", "0");
|
|
1664
|
+
});
|
|
1665
|
+
}
|
|
1658
1666
|
_syncSelectionVisualState() {
|
|
1659
1667
|
const t = new Set(this._selection), e = this.getAttribute("show-selection-badge") !== "false", i = /* @__PURE__ */ new Set();
|
|
1660
1668
|
this.root.querySelectorAll(".item[data-id]").forEach((n) => {
|
|
@@ -1669,7 +1677,7 @@ const $ = class $ extends dt {
|
|
|
1669
1677
|
const l = d && e;
|
|
1670
1678
|
c.hidden = !l, c.textContent = l ? this._t("badgeSelected") : "";
|
|
1671
1679
|
}
|
|
1672
|
-
}), i.size && this._renderItemFn && this._fillCustomTargets({ itemIds: i }), this.root.querySelector(".selection-summary")?.setAttribute("data-count", String(this._selection.length));
|
|
1680
|
+
}), this._syncScrollTabStops(), i.size && this._renderItemFn && this._fillCustomTargets({ itemIds: i }), this.root.querySelector(".selection-summary")?.setAttribute("data-count", String(this._selection.length));
|
|
1673
1681
|
const r = this.root.querySelector(".selection-pill");
|
|
1674
1682
|
r && (r.textContent = String(this._selection.length));
|
|
1675
1683
|
const s = this.root.querySelector(".selection-text");
|
|
@@ -1869,15 +1877,15 @@ const $ = class $ extends dt {
|
|
|
1869
1877
|
_renderChildBranch(t, e, i, r, s, n, a) {
|
|
1870
1878
|
const d = v(t.id), o = n.has(t.id), c = o ? "" : r(t.id), l = st(c), p = o ? !1 : this._selection.includes(t.id), g = o ? !1 : i.has(t.id), b = t.disabled, y = b || t.dragDisabled || this._isDragLocked(), h = this._dragState?.dropTarget?.mode === "inside" && this._dragState.dropTarget.parentId === t.id, f = this._t(this._dragState?.clone ? "copyPreview" : "dropPreview"), x = this._t(
|
|
1871
1879
|
this._dragState?.clone ? "releaseCopy" : this._dragState && this._dragState.movedRootIds.length > 1 ? "releaseMoveMany" : "releaseMove"
|
|
1872
|
-
), D = this._dragHandleMode(), C = this._usesCustomHandleSelector(),
|
|
1880
|
+
), D = this._dragHandleMode(), C = this._usesCustomHandleSelector(), A = C ? "custom" : D, E = !C && D === "handle";
|
|
1873
1881
|
return `
|
|
1874
1882
|
<div class="item-shell" data-item-shell="${d}">
|
|
1875
1883
|
<div
|
|
1876
1884
|
class="item${o ? " item-placeholder" : ""}"
|
|
1877
1885
|
part="item"
|
|
1878
1886
|
data-id="${d}"
|
|
1879
|
-
data-drag-handle-mode="${
|
|
1880
|
-
${!o &&
|
|
1887
|
+
data-drag-handle-mode="${A}"
|
|
1888
|
+
${!o && A === "item" ? 'data-drag-trigger="item"' : ""}
|
|
1881
1889
|
data-selected="${p}"
|
|
1882
1890
|
data-focused="${o ? "false" : e === t.id}"
|
|
1883
1891
|
data-dragging="${g}"
|
|
@@ -2019,7 +2027,7 @@ const $ = class $ extends dt {
|
|
|
2019
2027
|
if (!l.length) return;
|
|
2020
2028
|
const p = this._itemClonesOnDrag(i);
|
|
2021
2029
|
this._dragState = {
|
|
2022
|
-
snapshot: this._items.map(
|
|
2030
|
+
snapshot: this._items.map(z),
|
|
2023
2031
|
movedRootIds: l,
|
|
2024
2032
|
originId: i,
|
|
2025
2033
|
clone: p,
|
|
@@ -2142,7 +2150,7 @@ const $ = class $ extends dt {
|
|
|
2142
2150
|
if (i && i.clone === e && i.rootIds.join() === t.join()) return i;
|
|
2143
2151
|
const r = T(this._items), s = M(this._items), n = /* @__PURE__ */ new Set(), a = [], d = (c) => {
|
|
2144
2152
|
const l = r.get(c);
|
|
2145
|
-
!l || n.has(c) || (n.add(c), a.push(
|
|
2153
|
+
!l || n.has(c) || (n.add(c), a.push(z(l)), (s.get(w(l.listId, c)) || []).forEach(d));
|
|
2146
2154
|
};
|
|
2147
2155
|
t.forEach(d);
|
|
2148
2156
|
const o = {
|
|
@@ -2174,7 +2182,7 @@ const $ = class $ extends dt {
|
|
|
2174
2182
|
const c = a.items.map((h) => {
|
|
2175
2183
|
const f = a.rootIds.indexOf(h.id);
|
|
2176
2184
|
return {
|
|
2177
|
-
...
|
|
2185
|
+
...z(h),
|
|
2178
2186
|
id: o.get(h.id) || h.id,
|
|
2179
2187
|
parentId: h.parentId && o.has(h.parentId) && o.get(h.parentId) || null,
|
|
2180
2188
|
listId: e.listId,
|
|
@@ -2202,7 +2210,7 @@ const $ = class $ extends dt {
|
|
|
2202
2210
|
if (!r) {
|
|
2203
2211
|
const h = new Set(a.items.map((f) => f.id));
|
|
2204
2212
|
y = {
|
|
2205
|
-
items: U(this._lists, this._items.filter((f) => !h.has(f.id)).map(
|
|
2213
|
+
items: U(this._lists, this._items.filter((f) => !h.has(f.id)).map(z)),
|
|
2206
2214
|
movedIds: [...a.rootIds],
|
|
2207
2215
|
nextSelection: this._selection.filter((f) => !h.has(f)),
|
|
2208
2216
|
operation: "transfer",
|
|
@@ -2282,7 +2290,7 @@ const $ = class $ extends dt {
|
|
|
2282
2290
|
if (!this._pointerGesture || this._dragState) return;
|
|
2283
2291
|
const i = this._items.find((r) => r.id === this._pointerGesture?.originId);
|
|
2284
2292
|
i && (this._dragState = {
|
|
2285
|
-
snapshot: this._items.map(
|
|
2293
|
+
snapshot: this._items.map(z),
|
|
2286
2294
|
movedRootIds: [...this._pointerGesture.movedRootIds],
|
|
2287
2295
|
originId: this._pointerGesture.originId,
|
|
2288
2296
|
clone: this._pointerGesture.clone,
|
|
@@ -2583,7 +2591,7 @@ const $ = class $ extends dt {
|
|
|
2583
2591
|
// events and the announcement.
|
|
2584
2592
|
_applyPlan(t) {
|
|
2585
2593
|
const e = [...this._selection];
|
|
2586
|
-
this._dragState && (this._dragState.committed = !0), this._items = t.items.map(
|
|
2594
|
+
this._dragState && (this._dragState.committed = !0), this._items = t.items.map(z), this._clearPointerDragPreview(), this._dragState = null, this._removeDragImage(), this._selection = [...t.nextSelection], this._focusedId = t.nextSelection[0] || null, this._pendingFocusId = this._focusedId, this._syncAttributesFromState();
|
|
2587
2595
|
const i = J(this._items);
|
|
2588
2596
|
this._persistSnapshot(i);
|
|
2589
2597
|
const r = {
|
|
@@ -2644,7 +2652,7 @@ const $ = class $ extends dt {
|
|
|
2644
2652
|
this._liveMessage = t, this._applyLiveMessage();
|
|
2645
2653
|
}
|
|
2646
2654
|
_cancelDrag(t) {
|
|
2647
|
-
this._stopAutoScroll(), this._dragState && (this._setDraggingVisualState(this._draggingIds(), !1), this._pendingDropTarget = null, this._setExternal(null), this._setDropTargetVisualState(this._dragState.dropTarget, !1), this._clearPointerDragPreview(), this._items = this._dragState.snapshot.map(
|
|
2655
|
+
this._stopAutoScroll(), this._dragState && (this._setDraggingVisualState(this._draggingIds(), !1), this._pendingDropTarget = null, this._setExternal(null), this._setDropTargetVisualState(this._dragState.dropTarget, !1), this._clearPointerDragPreview(), this._items = this._dragState.snapshot.map(z), this._dragState = null, this._clearHoldTimer(), this._pointerGesture = null, this._removeDragImage(), t && this._announce(this._t("announceCancelled")), this._syncAttributesFromState(), this.requestRender());
|
|
2648
2656
|
}
|
|
2649
2657
|
_removeDragImage() {
|
|
2650
2658
|
this._dragImage?.remove(), this._dragImage = null;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const C=require("./ElementBase-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const C=require("./ElementBase-CbUsP3D6.js"),D="14s",I=" • ",h="linear",N=4,L=1,O=12,F=new Set(["clockwise","counterclockwise"]),Q=new Set(["default","surface","soft","solid","glass","contrast","minimal"]),U=new Set(["brand","neutral","info","success","warning","danger"]),B=new Set(["sm","md","lg","xl","1","2","3","4"]),j=new Set(["none","low","high"]),r={sm:{fontSize:"12px",fontSizePx:12,radius:"56px",radiusPx:56,padding:"12px",letterSpacing:"0.16em",letterSpacingPx:1.92,surfaceRadius:"24px"},md:{fontSize:"14px",fontSizePx:14,radius:"78px",radiusPx:78,padding:"16px",letterSpacing:"0.16em",letterSpacingPx:2.24,surfaceRadius:"28px"},lg:{fontSize:"16px",fontSizePx:16,radius:"96px",radiusPx:96,padding:"20px",letterSpacing:"0.18em",letterSpacingPx:2.88,surfaceRadius:"32px"},xl:{fontSize:"20px",fontSizePx:20,radius:"122px",radiusPx:122,padding:"24px",letterSpacing:"0.2em",letterSpacingPx:4,surfaceRadius:"36px"}},q=`
|
|
2
2
|
:host {
|
|
3
3
|
--ui-spinning-text-duration: ${D};
|
|
4
4
|
--ui-spinning-text-easing: ${h};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { E as k } from "./ElementBase-
|
|
1
|
+
import { E as k } from "./ElementBase-D5QsC5Vw.mjs";
|
|
2
2
|
const C = "14s", D = " • ", h = "linear", N = 4, I = 1, L = 12, O = /* @__PURE__ */ new Set(["clockwise", "counterclockwise"]), F = /* @__PURE__ */ new Set(["default", "surface", "soft", "solid", "glass", "contrast", "minimal"]), Q = /* @__PURE__ */ new Set(["brand", "neutral", "info", "success", "warning", "danger"]), U = /* @__PURE__ */ new Set(["sm", "md", "lg", "xl", "1", "2", "3", "4"]), B = /* @__PURE__ */ new Set(["none", "low", "high"]), r = {
|
|
3
3
|
sm: {
|
|
4
4
|
fontSize: "12px",
|
package/dist/split-button.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const b=require("./ElementBase-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const b=require("./ElementBase-CbUsP3D6.js"),f=require("./portal-XbYR3m_q.js"),g=require("./dismissable-layer-DNfrKA20.js"),h=require("./positioner-DZ1FW6A9.js"),x=require("./overlay-motion-B56x1GoY.js");require("./listbox-CTpRpuF7.js");const l=160,v=["--ui-split-button-menu-bg","--ui-split-button-menu-color","--ui-split-button-menu-border","--ui-split-button-menu-radius","--ui-split-button-menu-shadow","--ui-split-button-menu-accent","--ui-split-button-menu-accent-strong","--ui-split-button-menu-shortcut","--ui-split-button-menu-separator","--ui-split-button-menu-muted","--ui-split-button-menu-danger","--ui-split-button-menu-option-border","--ui-split-button-menu-option-border-strong","--ui-split-button-menu-option-shadow","--ui-split-button-menu-affordance-bg","--ui-split-button-menu-affordance-border","--ui-split-button-menu-affordance-size","--ui-split-button-menu-list-gap","--ui-split-button-menu-list-padding-top","--ui-split-button-menu-item-min-height","--ui-split-button-menu-item-radius","--ui-split-button-menu-item-padding"],_=`
|
|
2
2
|
:host {
|
|
3
3
|
--ui-split-button-radius: 12px;
|
|
4
4
|
--ui-split-button-border: 1px solid color-mix(in srgb, var(--ui-color-border, #cbd5e1) 70%, transparent);
|
package/dist/split-button.esm.js
CHANGED
package/dist/splitter.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("./ElementBase-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("./ElementBase-CbUsP3D6.js"),l=`
|
|
2
2
|
:host {
|
|
3
3
|
--ui-splitter-size: 10px;
|
|
4
4
|
--ui-splitter-hit-area: 10px;
|
package/dist/splitter.esm.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add-icons.d.ts","sourceRoot":"","sources":["../../src/standalone/add-icons.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preload.d.ts","sourceRoot":"","sources":["../../src/standalone/preload.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC"}
|
package/dist/stepper.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const g=require("./ElementBase-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const g=require("./ElementBase-CbUsP3D6.js"),b=`
|
|
2
2
|
:host {
|
|
3
3
|
--ui-stepper-gap: 8px;
|
|
4
4
|
--ui-stepper-radius: calc(var(--ui-radius, 6px) + 2px);
|
|
@@ -153,8 +153,8 @@
|
|
|
153
153
|
--ui-stepper-border: #334155;
|
|
154
154
|
--ui-stepper-text: #e2e8f0;
|
|
155
155
|
--ui-stepper-muted: #93a4bd;
|
|
156
|
-
--ui-stepper-accent: #93c5fd;
|
|
157
|
-
--ui-stepper-focus: #93c5fd;
|
|
156
|
+
--ui-stepper-accent: var(--ui-color-accent-on-dark, #93c5fd);
|
|
157
|
+
--ui-stepper-focus: var(--ui-color-accent-on-dark, #93c5fd);
|
|
158
158
|
}
|
|
159
159
|
|
|
160
160
|
:host([variant="minimal"]) .frame {
|
package/dist/stepper.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { E as d } from "./ElementBase-
|
|
1
|
+
import { E as d } from "./ElementBase-D5QsC5Vw.mjs";
|
|
2
2
|
const g = `
|
|
3
3
|
:host {
|
|
4
4
|
--ui-stepper-gap: 8px;
|
|
@@ -154,8 +154,8 @@ const g = `
|
|
|
154
154
|
--ui-stepper-border: #334155;
|
|
155
155
|
--ui-stepper-text: #e2e8f0;
|
|
156
156
|
--ui-stepper-muted: #93a4bd;
|
|
157
|
-
--ui-stepper-accent: #93c5fd;
|
|
158
|
-
--ui-stepper-focus: #93c5fd;
|
|
157
|
+
--ui-stepper-accent: var(--ui-color-accent-on-dark, #93c5fd);
|
|
158
|
+
--ui-stepper-focus: var(--ui-color-accent-on-dark, #93c5fd);
|
|
159
159
|
}
|
|
160
160
|
|
|
161
161
|
:host([variant="minimal"]) .frame {
|
package/dist/switch.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const g=require("./ElementBase-CbUsP3D6.js"),d=require("./form-control-B90_3kYN.js"),m=`
|
|
2
2
|
:host {
|
|
3
3
|
--ui-switch-width: 36px;
|
|
4
4
|
--ui-switch-height: 20px;
|
|
@@ -297,10 +297,10 @@
|
|
|
297
297
|
--ui-switch-thumb-color: #334155;
|
|
298
298
|
--ui-switch-label: #e2e8f0;
|
|
299
299
|
--ui-switch-description: #9ca3af;
|
|
300
|
-
--ui-switch-accent: #93c5fd;
|
|
300
|
+
--ui-switch-accent: var(--ui-color-accent-on-dark, #93c5fd);
|
|
301
301
|
--ui-switch-accent-hover: #60a5fa;
|
|
302
302
|
--ui-switch-accent-contrast: #0f172a;
|
|
303
|
-
--ui-switch-focus: #93c5fd;
|
|
303
|
+
--ui-switch-focus: var(--ui-color-accent-on-dark, #93c5fd);
|
|
304
304
|
}
|
|
305
305
|
|
|
306
306
|
:host([tone="success"]) {
|
|
@@ -370,8 +370,8 @@
|
|
|
370
370
|
background: HighlightText;
|
|
371
371
|
}
|
|
372
372
|
}
|
|
373
|
-
`,
|
|
374
|
-
<style>${
|
|
373
|
+
`,b=new Set(["label","description"]);function p(o){if(o==null)return!1;const t=String(o).toLowerCase();return t!=="false"&&t!=="0"&&t!=="off"}function w(o){return String(o).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function v(o){for(const t of o)if(t instanceof HTMLElement&&t.matches('a,button,input,select,textarea,[contenteditable="true"],[data-ui-switch-no-toggle]'))return!0;return!1}const h=class h extends g.ElementBase{constructor(){super(),this._formControl=new d.FormControl(this,{getValue:()=>this.checked?this.getAttribute("value")??"on":null,getValidity:()=>({valueMissing:d.isRequired(this)&&!this.checked,message:"Please turn this on if you want to proceed."}),defaultAttribute:"checked",onFormDisabled:()=>this.requestRender()}),this._control=null,this._onClick=this._onClick.bind(this),this._onKeyDown=this._onKeyDown.bind(this),this._onSlotChange=this._onSlotChange.bind(this)}static get observedAttributes(){return["checked","disabled","headless","loading","size","variant","tone","shape","elevation","label","description","name","value","required","tabindex","aria-label"]}formResetCallback(){this._formControl.formResetCallback()}formDisabledCallback(t){this._formControl.formDisabledCallback(t)}get form(){return this._formControl.form}connectedCallback(){super.connectedCallback(),this._formControl.connect(),this.root.addEventListener("click",this._onClick),this.root.addEventListener("keydown",this._onKeyDown),this.root.addEventListener("slotchange",this._onSlotChange),this._syncAria()}disconnectedCallback(){this._formControl.disconnect(),this.root.removeEventListener("click",this._onClick),this.root.removeEventListener("keydown",this._onKeyDown),this.root.removeEventListener("slotchange",this._onSlotChange),super.disconnectedCallback()}attributeChangedCallback(t,i,e){if(i!==e){if(b.has(t)){super.attributeChangedCallback(t,i,e);return}this._syncAria()}}get checked(){return this.hasAttribute("checked")}set checked(t){t?this.setAttribute("checked",""):this.removeAttribute("checked")}get disabled(){return this.hasAttribute("disabled")||this.hasAttribute("loading")||!!this._formControl?.disabledByForm}set disabled(t){t?this.setAttribute("disabled",""):this.removeAttribute("disabled")}toggle(t){if(this.disabled)return;const i=typeof t=="boolean"?t:!this.checked;if(i===this.checked){this._syncAria();return}this.checked=i,this._syncAria();const e={checked:i,value:this.getAttribute("value")||"on",name:this.getAttribute("name")||"",required:p(this.getAttribute("required"))};this.dispatchEvent(new CustomEvent("input",{detail:e,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("change",{detail:e,bubbles:!0,composed:!0}))}_syncAria(){const t=this.checked,i=this.disabled,e=this.hasAttribute("loading"),s=p(this.getAttribute("required"));this.setAttribute("role","switch"),this.setAttribute("aria-checked",t?"true":"false"),this.setAttribute("aria-disabled",i?"true":"false"),this.setAttribute("aria-busy",e?"true":"false"),s?this.setAttribute("aria-required","true"):this.removeAttribute("aria-required");const r=this.getAttribute("data-ui-switch-tabindex");i?(r==null&&this.setAttribute("data-ui-switch-tabindex",this.getAttribute("tabindex")||""),this.getAttribute("tabindex")!=="-1"&&this.setAttribute("tabindex","-1")):r!=null?(r?this.setAttribute("tabindex",r):this.removeAttribute("tabindex"),this.removeAttribute("data-ui-switch-tabindex")):this.hasAttribute("tabindex")||this.setAttribute("tabindex","0"),this._control&&this._control.toggleAttribute("data-disabled",i)}_onClick(t){if(this.disabled)return;const i=t.composedPath();if(!i.some(a=>a instanceof HTMLElement&&a.classList.contains("control"))&&v(i))return;const s=t.target;s instanceof HTMLElement&&s.closest(".shell")&&(this.toggle(),this.focus({preventScroll:!0}))}_onKeyDown(t){if(this.disabled||t.defaultPrevented)return;const i=t.target;if(i instanceof HTMLElement&&i!==this&&!i.closest(".control"))return;const e=getComputedStyle(this).direction==="rtl";if(t.key===" "||t.key==="Enter"){t.preventDefault(),this.toggle();return}if(t.key==="ArrowLeft"){t.preventDefault(),this.toggle(e);return}if(t.key==="ArrowRight"){t.preventDefault(),this.toggle(!e);return}if(t.key==="Home"){t.preventDefault(),this.toggle(!1);return}t.key==="End"&&(t.preventDefault(),this.toggle(!0))}_onSlotChange(){this.requestRender()}render(){const t=this.checked,i=this.disabled,e=(this.getAttribute("label")||"").trim(),s=(this.getAttribute("description")||"").trim(),r=Array.from(this.childNodes).some(n=>n.nodeType===Node.TEXT_NODE?!!n.textContent?.trim():n.nodeType!==Node.ELEMENT_NODE?!1:!n.getAttribute("slot")),a=!!this.querySelector('[slot="description"]'),l=!!e||r,u=!!s||a,f=l||u;this.setContent(`
|
|
374
|
+
<style>${m}</style>
|
|
375
375
|
<span class="shell" part="shell">
|
|
376
376
|
<span
|
|
377
377
|
class="control"
|
|
@@ -385,9 +385,9 @@
|
|
|
385
385
|
<span class="thumb-icon icon-off" aria-hidden="true">•</span>
|
|
386
386
|
</span>
|
|
387
387
|
</span>
|
|
388
|
-
<span class="label-wrap" part="label-wrap" ${
|
|
389
|
-
<span class="label" part="label" ${
|
|
390
|
-
<span class="description" part="description" ${
|
|
388
|
+
<span class="label-wrap" part="label-wrap" ${f?"":"hidden"}>
|
|
389
|
+
<span class="label" part="label" ${l?"":"hidden"}><slot>${w(e)}</slot></span>
|
|
390
|
+
<span class="description" part="description" ${u?"":"hidden"}><slot name="description">${w(s)}</slot></span>
|
|
391
391
|
</span>
|
|
392
392
|
</span>
|
|
393
|
-
`),this._control=this.root.querySelector(".control"),this._syncAria(),this.setAttribute("aria-checked",t?"true":"false")}shouldRenderOnAttributeChange(t,i,e){return
|
|
393
|
+
`),this._control=this.root.querySelector(".control"),this._syncAria(),this.setAttribute("aria-checked",t?"true":"false")}shouldRenderOnAttributeChange(t,i,e){return b.has(t)}};h.formAssociated=!0;let c=h;typeof customElements<"u"&&!customElements.get("ui-switch")&&customElements.define("ui-switch",c);exports.UISwitch=c;
|
package/dist/switch.esm.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { E as
|
|
2
|
-
|
|
1
|
+
import { E as w } from "./ElementBase-D5QsC5Vw.mjs";
|
|
2
|
+
import { F as g, i as m } from "./form-control-D9wWUMBl.mjs";
|
|
3
|
+
const v = `
|
|
3
4
|
:host {
|
|
4
5
|
--ui-switch-width: 36px;
|
|
5
6
|
--ui-switch-height: 20px;
|
|
@@ -298,10 +299,10 @@ const w = `
|
|
|
298
299
|
--ui-switch-thumb-color: #334155;
|
|
299
300
|
--ui-switch-label: #e2e8f0;
|
|
300
301
|
--ui-switch-description: #9ca3af;
|
|
301
|
-
--ui-switch-accent: #93c5fd;
|
|
302
|
+
--ui-switch-accent: var(--ui-color-accent-on-dark, #93c5fd);
|
|
302
303
|
--ui-switch-accent-hover: #60a5fa;
|
|
303
304
|
--ui-switch-accent-contrast: #0f172a;
|
|
304
|
-
--ui-switch-focus: #93c5fd;
|
|
305
|
+
--ui-switch-focus: var(--ui-color-accent-on-dark, #93c5fd);
|
|
305
306
|
}
|
|
306
307
|
|
|
307
308
|
:host([tone="success"]) {
|
|
@@ -371,26 +372,34 @@ const w = `
|
|
|
371
372
|
background: HighlightText;
|
|
372
373
|
}
|
|
373
374
|
}
|
|
374
|
-
`,
|
|
375
|
-
function
|
|
376
|
-
if (
|
|
377
|
-
const t = String(
|
|
375
|
+
`, d = /* @__PURE__ */ new Set(["label", "description"]);
|
|
376
|
+
function b(o) {
|
|
377
|
+
if (o == null) return !1;
|
|
378
|
+
const t = String(o).toLowerCase();
|
|
378
379
|
return t !== "false" && t !== "0" && t !== "off";
|
|
379
380
|
}
|
|
380
|
-
function
|
|
381
|
-
return String(
|
|
381
|
+
function p(o) {
|
|
382
|
+
return String(o).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
382
383
|
}
|
|
383
|
-
function
|
|
384
|
-
for (const t of
|
|
384
|
+
function k(o) {
|
|
385
|
+
for (const t of o)
|
|
385
386
|
if (t instanceof HTMLElement && t.matches(
|
|
386
387
|
'a,button,input,select,textarea,[contenteditable="true"],[data-ui-switch-no-toggle]'
|
|
387
388
|
))
|
|
388
389
|
return !0;
|
|
389
390
|
return !1;
|
|
390
391
|
}
|
|
391
|
-
class
|
|
392
|
+
const h = class h extends w {
|
|
392
393
|
constructor() {
|
|
393
|
-
super(), this.
|
|
394
|
+
super(), this._formControl = new g(this, {
|
|
395
|
+
getValue: () => this.checked ? this.getAttribute("value") ?? "on" : null,
|
|
396
|
+
getValidity: () => ({
|
|
397
|
+
valueMissing: m(this) && !this.checked,
|
|
398
|
+
message: "Please turn this on if you want to proceed."
|
|
399
|
+
}),
|
|
400
|
+
defaultAttribute: "checked",
|
|
401
|
+
onFormDisabled: () => this.requestRender()
|
|
402
|
+
}), this._control = null, this._onClick = this._onClick.bind(this), this._onKeyDown = this._onKeyDown.bind(this), this._onSlotChange = this._onSlotChange.bind(this);
|
|
394
403
|
}
|
|
395
404
|
static get observedAttributes() {
|
|
396
405
|
return [
|
|
@@ -412,15 +421,25 @@ class f extends p {
|
|
|
412
421
|
"aria-label"
|
|
413
422
|
];
|
|
414
423
|
}
|
|
424
|
+
formResetCallback() {
|
|
425
|
+
this._formControl.formResetCallback();
|
|
426
|
+
}
|
|
427
|
+
formDisabledCallback(t) {
|
|
428
|
+
this._formControl.formDisabledCallback(t);
|
|
429
|
+
}
|
|
430
|
+
/** The `<form>` this field belongs to, if any. */
|
|
431
|
+
get form() {
|
|
432
|
+
return this._formControl.form;
|
|
433
|
+
}
|
|
415
434
|
connectedCallback() {
|
|
416
|
-
super.connectedCallback(), this.root.addEventListener("click", this._onClick), this.root.addEventListener("keydown", this._onKeyDown), this.root.addEventListener("slotchange", this._onSlotChange), this._syncAria();
|
|
435
|
+
super.connectedCallback(), this._formControl.connect(), this.root.addEventListener("click", this._onClick), this.root.addEventListener("keydown", this._onKeyDown), this.root.addEventListener("slotchange", this._onSlotChange), this._syncAria();
|
|
417
436
|
}
|
|
418
437
|
disconnectedCallback() {
|
|
419
|
-
this.root.removeEventListener("click", this._onClick), this.root.removeEventListener("keydown", this._onKeyDown), this.root.removeEventListener("slotchange", this._onSlotChange), super.disconnectedCallback();
|
|
438
|
+
this._formControl.disconnect(), this.root.removeEventListener("click", this._onClick), this.root.removeEventListener("keydown", this._onKeyDown), this.root.removeEventListener("slotchange", this._onSlotChange), super.disconnectedCallback();
|
|
420
439
|
}
|
|
421
440
|
attributeChangedCallback(t, i, e) {
|
|
422
441
|
if (i !== e) {
|
|
423
|
-
if (
|
|
442
|
+
if (d.has(t)) {
|
|
424
443
|
super.attributeChangedCallback(t, i, e);
|
|
425
444
|
return;
|
|
426
445
|
}
|
|
@@ -434,7 +453,7 @@ class f extends p {
|
|
|
434
453
|
t ? this.setAttribute("checked", "") : this.removeAttribute("checked");
|
|
435
454
|
}
|
|
436
455
|
get disabled() {
|
|
437
|
-
return this.hasAttribute("disabled") || this.hasAttribute("loading");
|
|
456
|
+
return this.hasAttribute("disabled") || this.hasAttribute("loading") || !!this._formControl?.disabledByForm;
|
|
438
457
|
}
|
|
439
458
|
set disabled(t) {
|
|
440
459
|
t ? this.setAttribute("disabled", "") : this.removeAttribute("disabled");
|
|
@@ -451,24 +470,24 @@ class f extends p {
|
|
|
451
470
|
checked: i,
|
|
452
471
|
value: this.getAttribute("value") || "on",
|
|
453
472
|
name: this.getAttribute("name") || "",
|
|
454
|
-
required:
|
|
473
|
+
required: b(this.getAttribute("required"))
|
|
455
474
|
};
|
|
456
475
|
this.dispatchEvent(new CustomEvent("input", { detail: e, bubbles: !0, composed: !0 })), this.dispatchEvent(new CustomEvent("change", { detail: e, bubbles: !0, composed: !0 }));
|
|
457
476
|
}
|
|
458
477
|
_syncAria() {
|
|
459
|
-
const t = this.checked, i = this.disabled, e = this.hasAttribute("loading"),
|
|
460
|
-
this.setAttribute("role", "switch"), this.setAttribute("aria-checked", t ? "true" : "false"), this.setAttribute("aria-disabled", i ? "true" : "false"), this.setAttribute("aria-busy", e ? "true" : "false"),
|
|
461
|
-
const
|
|
462
|
-
i ? (
|
|
478
|
+
const t = this.checked, i = this.disabled, e = this.hasAttribute("loading"), s = b(this.getAttribute("required"));
|
|
479
|
+
this.setAttribute("role", "switch"), this.setAttribute("aria-checked", t ? "true" : "false"), this.setAttribute("aria-disabled", i ? "true" : "false"), this.setAttribute("aria-busy", e ? "true" : "false"), s ? this.setAttribute("aria-required", "true") : this.removeAttribute("aria-required");
|
|
480
|
+
const r = this.getAttribute("data-ui-switch-tabindex");
|
|
481
|
+
i ? (r == null && this.setAttribute("data-ui-switch-tabindex", this.getAttribute("tabindex") || ""), this.getAttribute("tabindex") !== "-1" && this.setAttribute("tabindex", "-1")) : r != null ? (r ? this.setAttribute("tabindex", r) : this.removeAttribute("tabindex"), this.removeAttribute("data-ui-switch-tabindex")) : this.hasAttribute("tabindex") || this.setAttribute("tabindex", "0"), this._control && this._control.toggleAttribute("data-disabled", i);
|
|
463
482
|
}
|
|
464
483
|
_onClick(t) {
|
|
465
484
|
if (this.disabled) return;
|
|
466
485
|
const i = t.composedPath();
|
|
467
486
|
if (!i.some(
|
|
468
487
|
(a) => a instanceof HTMLElement && a.classList.contains("control")
|
|
469
|
-
) &&
|
|
470
|
-
const
|
|
471
|
-
|
|
488
|
+
) && k(i)) return;
|
|
489
|
+
const s = t.target;
|
|
490
|
+
s instanceof HTMLElement && s.closest(".shell") && (this.toggle(), this.focus({ preventScroll: !0 }));
|
|
472
491
|
}
|
|
473
492
|
_onKeyDown(t) {
|
|
474
493
|
if (this.disabled || t.defaultPrevented) return;
|
|
@@ -498,9 +517,9 @@ class f extends p {
|
|
|
498
517
|
this.requestRender();
|
|
499
518
|
}
|
|
500
519
|
render() {
|
|
501
|
-
const t = this.checked, i = this.disabled, e = (this.getAttribute("label") || "").trim(),
|
|
520
|
+
const t = this.checked, i = this.disabled, e = (this.getAttribute("label") || "").trim(), s = (this.getAttribute("description") || "").trim(), r = Array.from(this.childNodes).some((n) => n.nodeType === Node.TEXT_NODE ? !!n.textContent?.trim() : n.nodeType !== Node.ELEMENT_NODE ? !1 : !n.getAttribute("slot")), a = !!this.querySelector('[slot="description"]'), l = !!e || r, u = !!s || a, f = l || u;
|
|
502
521
|
this.setContent(`
|
|
503
|
-
<style>${
|
|
522
|
+
<style>${v}</style>
|
|
504
523
|
<span class="shell" part="shell">
|
|
505
524
|
<span
|
|
506
525
|
class="control"
|
|
@@ -514,18 +533,20 @@ class f extends p {
|
|
|
514
533
|
<span class="thumb-icon icon-off" aria-hidden="true">•</span>
|
|
515
534
|
</span>
|
|
516
535
|
</span>
|
|
517
|
-
<span class="label-wrap" part="label-wrap" ${
|
|
518
|
-
<span class="label" part="label" ${
|
|
519
|
-
<span class="description" part="description" ${
|
|
536
|
+
<span class="label-wrap" part="label-wrap" ${f ? "" : "hidden"}>
|
|
537
|
+
<span class="label" part="label" ${l ? "" : "hidden"}><slot>${p(e)}</slot></span>
|
|
538
|
+
<span class="description" part="description" ${u ? "" : "hidden"}><slot name="description">${p(s)}</slot></span>
|
|
520
539
|
</span>
|
|
521
540
|
</span>
|
|
522
541
|
`), this._control = this.root.querySelector(".control"), this._syncAria(), this.setAttribute("aria-checked", t ? "true" : "false");
|
|
523
542
|
}
|
|
524
543
|
shouldRenderOnAttributeChange(t, i, e) {
|
|
525
|
-
return
|
|
544
|
+
return d.has(t);
|
|
526
545
|
}
|
|
527
|
-
}
|
|
528
|
-
|
|
546
|
+
};
|
|
547
|
+
h.formAssociated = !0;
|
|
548
|
+
let c = h;
|
|
549
|
+
typeof customElements < "u" && !customElements.get("ui-switch") && customElements.define("ui-switch", c);
|
|
529
550
|
export {
|
|
530
|
-
|
|
551
|
+
c as UISwitch
|
|
531
552
|
};
|
package/dist/table.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const p=require("./ElementBase-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const p=require("./ElementBase-CbUsP3D6.js"),y=`
|
|
2
2
|
:host {
|
|
3
3
|
display: block;
|
|
4
4
|
/* A wide table scrolls inside its own frame. Without this a grid or flex parent grows to the table's width. */
|
package/dist/table.esm.js
CHANGED