@editora/ui-core 0.1.19 → 0.1.21
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-1b301e7f.js → ElementBase-EV6mVBUV.js} +1 -1
- package/dist/{ElementBase-909688f3.mjs → ElementBase-YlTLMsGk.mjs} +3 -3
- package/dist/accordion.cjs.js +3 -3
- package/dist/accordion.esm.js +39 -62
- package/dist/alert-dialog.cjs.js +19 -19
- package/dist/alert-dialog.esm.js +69 -87
- package/dist/alert.cjs.js +1 -1
- package/dist/alert.esm.js +4 -7
- package/dist/anchor.cjs.js +2 -2
- package/dist/anchor.esm.js +3 -3
- package/dist/animated-beam.cjs.js +83 -83
- package/dist/animated-beam.esm.js +250 -277
- package/dist/animated-list.cjs.js +4 -4
- package/dist/animated-list.esm.js +47 -61
- package/dist/animated-text.cjs.js +2 -2
- package/dist/animated-text.esm.js +13 -24
- package/dist/app-header.cjs.js +3 -3
- package/dist/app-header.esm.js +11 -13
- package/dist/aspect-ratio.cjs.js +1 -1
- package/dist/aspect-ratio.esm.js +4 -7
- package/dist/avatar.cjs.js +1 -1
- package/dist/avatar.esm.js +7 -13
- package/dist/badge.cjs.js +1 -1
- package/dist/badge.esm.js +4 -7
- package/dist/block-controls.cjs.js +2 -2
- package/dist/block-controls.esm.js +19 -35
- package/dist/box.cjs.js +1 -1
- package/dist/box.esm.js +8 -15
- package/dist/breadcrumb.cjs.js +2 -2
- package/dist/breadcrumb.esm.js +20 -37
- package/dist/button.cjs.js +1 -521
- package/dist/button.esm.js +2 -671
- package/dist/{calendar-2c11b824.mjs → calendar-DLY4acgn.mjs} +293 -342
- package/dist/{calendar-a8735e40.js → calendar-Dkof-FTK.js} +25 -25
- package/dist/calendar.cjs.js +1 -1
- package/dist/calendar.esm.js +8 -9
- package/dist/card.cjs.js +4 -4
- package/dist/card.esm.js +13 -19
- package/dist/chart.cjs.js +64 -64
- package/dist/chart.esm.js +223 -254
- package/dist/checkbox.cjs.js +1 -1
- package/dist/checkbox.esm.js +2 -3
- package/dist/collapsible.cjs.js +1 -1
- package/dist/collapsible.esm.js +5 -9
- package/dist/{collection-a1aac0c6.mjs → collection-C7URGjEI.mjs} +8 -14
- package/dist/collection.cjs.js +1 -1
- package/dist/collection.esm.js +30 -29
- package/dist/color-picker.cjs.js +10 -10
- package/dist/color-picker.esm.js +190 -253
- package/dist/combobox.cjs.js +13 -13
- package/dist/combobox.esm.js +93 -126
- package/dist/command-palette.cjs.js +3 -3
- package/dist/command-palette.esm.js +19 -30
- package/dist/command.cjs.js +4 -4
- package/dist/command.esm.js +41 -53
- package/dist/components/ui-collection.d.ts.map +1 -1
- package/dist/components/ui-multi-select.d.ts.map +1 -1
- package/dist/components/ui-orbiter.d.ts.map +1 -1
- package/dist/components/ui-portal.d.ts.map +1 -1
- package/dist/components/ui-positioner.d.ts.map +1 -1
- package/dist/components/ui-skeleton.d.ts.map +1 -1
- package/dist/components/ui-sortable.d.ts +8 -0
- package/dist/components/ui-sortable.d.ts.map +1 -1
- package/dist/components/ui-split-button.d.ts +1 -0
- package/dist/components/ui-split-button.d.ts.map +1 -1
- package/dist/components/ui-tabs.d.ts.map +1 -1
- package/dist/components/ui-textarea.d.ts.map +1 -1
- package/dist/components/ui-time-picker.d.ts.map +1 -1
- package/dist/container.cjs.js +2 -2
- package/dist/container.esm.js +2 -3
- package/dist/context-menu.cjs.js +8 -8
- package/dist/context-menu.esm.js +157 -219
- package/dist/control-group.cjs.js +1 -1
- package/dist/control-group.esm.js +2 -3
- package/dist/data-table.cjs.js +4 -4
- package/dist/data-table.esm.js +299 -381
- package/dist/date-field.cjs.js +3 -3
- package/dist/date-field.esm.js +68 -80
- package/dist/date-picker.cjs.js +9 -9
- package/dist/date-picker.esm.js +69 -97
- package/dist/date-range-picker.cjs.js +3 -3
- package/dist/date-range-picker.esm.js +32 -56
- package/dist/date-range-time-picker.cjs.js +9 -9
- package/dist/date-range-time-picker.esm.js +111 -140
- package/dist/date-time-picker.cjs.js +7 -7
- package/dist/date-time-picker.esm.js +115 -147
- package/dist/date-time-utils-Dmost5Ee.js +1 -0
- package/dist/date-time-utils-y1N2gvG2.mjs +268 -0
- package/dist/description.cjs.js +1 -1
- package/dist/description.esm.js +3 -5
- package/dist/dialog.cjs.js +12 -12
- package/dist/dialog.esm.js +44 -63
- package/dist/direction-provider.cjs.js +1 -1
- package/dist/direction-provider.esm.js +2 -3
- package/dist/{dismissable-layer-9c7e6b58.mjs → dismissable-layer-BmPIoK80.mjs} +29 -33
- package/dist/dismissable-layer-DNfrKA20.js +1 -0
- package/dist/dismissable-layer.cjs.js +2 -2
- package/dist/dismissable-layer.esm.js +4 -6
- package/dist/dock.cjs.js +5 -5
- package/dist/dock.esm.js +134 -155
- package/dist/drawer.cjs.js +2 -2
- package/dist/drawer.esm.js +18 -35
- package/dist/dropdown.cjs.js +2 -2
- package/dist/dropdown.esm.js +119 -149
- package/dist/dropzone.cjs.js +1 -1
- package/dist/dropzone.esm.js +0 -1
- package/dist/empty-state.cjs.js +1 -1
- package/dist/empty-state.esm.js +1 -1
- package/dist/field-error.cjs.js +1 -1
- package/dist/field-error.esm.js +3 -5
- package/dist/field.cjs.js +5 -5
- package/dist/field.esm.js +27 -34
- package/dist/fieldset.cjs.js +4 -4
- package/dist/fieldset.esm.js +19 -24
- package/dist/file-upload.cjs.js +4 -4
- package/dist/file-upload.esm.js +69 -93
- package/dist/flex.cjs.js +1 -1
- package/dist/flex.esm.js +5 -9
- package/dist/floating-toolbar.cjs.js +4 -4
- package/dist/floating-toolbar.esm.js +60 -85
- package/dist/focus-scope-Bwug2gDv.js +1 -0
- package/dist/{focus-scope-103833ee.mjs → focus-scope-CmEsG5UZ.mjs} +39 -48
- package/dist/focus-scope.cjs.js +2 -2
- package/dist/focus-scope.esm.js +15 -20
- package/dist/form.cjs.js +2 -2
- package/dist/form.esm.js +26 -53
- package/dist/gantt.cjs.js +43 -43
- package/dist/gantt.esm.js +295 -322
- package/dist/grid.cjs.js +1 -1
- package/dist/grid.esm.js +5 -9
- package/dist/hover-card.cjs.js +4 -4
- package/dist/hover-card.esm.js +22 -28
- package/dist/icon-cloud.cjs.js +7 -7
- package/dist/icon-cloud.esm.js +48 -62
- package/dist/icon.cjs.js +1 -1
- package/dist/icon.esm.js +2 -4
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +378 -390
- package/dist/inline-edit.cjs.js +11 -11
- package/dist/inline-edit.esm.js +32 -36
- package/dist/input.cjs.js +17 -17
- package/dist/input.esm.js +50 -63
- package/dist/label.cjs.js +2 -2
- package/dist/label.esm.js +8 -17
- package/dist/layout.cjs.js +2 -2
- package/dist/layout.esm.js +20 -26
- package/dist/listbox-B6QgECax.js +46 -0
- package/dist/listbox-DJamVeFj.mjs +200 -0
- package/dist/listbox.cjs.js +1 -1
- package/dist/listbox.esm.js +2 -4
- package/dist/marquee.cjs.js +5 -5
- package/dist/marquee.esm.js +33 -50
- package/dist/masonry-grid.cjs.js +1 -1
- package/dist/masonry-grid.esm.js +5 -9
- package/dist/menu.cjs.js +3 -3
- package/dist/menu.esm.js +106 -126
- package/dist/menubar.cjs.js +5 -5
- package/dist/menubar.esm.js +118 -164
- package/dist/meter.cjs.js +2 -2
- package/dist/meter.esm.js +4 -4
- package/dist/multi-select.cjs.js +5 -5
- package/dist/multi-select.esm.js +125 -137
- package/dist/navigation-menu.cjs.js +4 -4
- package/dist/navigation-menu.esm.js +44 -55
- package/dist/number-field.cjs.js +2 -2
- package/dist/number-field.esm.js +73 -98
- package/dist/number-ticker.cjs.js +3 -3
- package/dist/number-ticker.esm.js +22 -43
- package/dist/odometer.cjs.js +1 -1
- package/dist/odometer.esm.js +5 -9
- package/dist/orbiter.cjs.js +13 -13
- package/dist/orbiter.esm.js +79 -90
- package/dist/{overlayManager-5bbd4dc3.mjs → overlayManager-BJjU1VA8.mjs} +4 -5
- package/dist/{overlayManager-0eda4e08.js → overlayManager-CSy3fJmJ.js} +1 -1
- package/dist/pagination.cjs.js +2 -2
- package/dist/pagination.esm.js +14 -18
- package/dist/{panel-group-a376cc5e.mjs → panel-group-8sVNnGxg.mjs} +24 -46
- package/dist/panel-group-CaD0_KQf.js +36 -0
- package/dist/panel-group.cjs.js +1 -1
- package/dist/panel-group.esm.js +2 -5
- package/dist/panel.cjs.js +4 -4
- package/dist/panel.esm.js +8 -10
- package/dist/password-field.cjs.js +9 -9
- package/dist/password-field.esm.js +62 -82
- package/dist/pin-input.cjs.js +3 -3
- package/dist/pin-input.esm.js +33 -39
- package/dist/placement-grid.cjs.js +4 -4
- package/dist/placement-grid.esm.js +108 -131
- package/dist/plugin-panel.cjs.js +7 -7
- package/dist/plugin-panel.esm.js +13 -15
- package/dist/popover.cjs.js +2 -2
- package/dist/popover.esm.js +21 -31
- package/dist/portal-DgpQ3Jo1.js +1 -0
- package/dist/{portal-fe73e5cc.mjs → portal-bR42gHvG.mjs} +43 -48
- package/dist/portal.cjs.js +3 -3
- package/dist/portal.esm.js +20 -28
- package/dist/{positioner-e9770c66.mjs → positioner-D0VGxtYU.mjs} +189 -209
- package/dist/positioner-D_fqyx_j.js +1 -0
- package/dist/positioner.cjs.js +2 -2
- package/dist/positioner.esm.js +22 -28
- package/dist/presence.cjs.js +1 -1
- package/dist/presence.esm.js +7 -13
- package/dist/primitives/auto-scroll.d.ts +9 -0
- package/dist/primitives/auto-scroll.d.ts.map +1 -0
- package/dist/primitives/selector.d.ts +4 -0
- package/dist/primitives/selector.d.ts.map +1 -0
- package/dist/progress.cjs.js +1 -1
- package/dist/progress.esm.js +5 -9
- package/dist/quick-actions.cjs.js +6 -6
- package/dist/quick-actions.esm.js +52 -62
- package/dist/radio-group.cjs.js +13 -13
- package/dist/radio-group.esm.js +39 -51
- package/dist/radio.cjs.js +1 -1
- package/dist/radio.esm.js +5 -9
- package/dist/rating.cjs.js +1 -1
- package/dist/rating.esm.js +12 -23
- package/dist/{roving-focus-group-4350c9a7.mjs → roving-focus-group-Dbm1Jko_.mjs} +3 -6
- package/dist/roving-focus-group.cjs.js +1 -1
- package/dist/roving-focus-group.esm.js +3 -5
- package/dist/runtime-CTaOSmBj.js +1 -0
- package/dist/{runtime-161f68a2.mjs → runtime-D1gFh1fS.mjs} +338 -366
- package/dist/runtime.cjs.js +1 -1
- package/dist/runtime.esm.js +6 -6
- package/dist/scroll-area.cjs.js +3 -3
- package/dist/scroll-area.esm.js +38 -46
- package/dist/{scroll-lock-31da444f.mjs → scroll-lock-LfqXXqsu.mjs} +5 -9
- package/dist/section.cjs.js +1 -1
- package/dist/section.esm.js +1 -1
- package/dist/select.cjs.js +7 -7
- package/dist/select.esm.js +67 -97
- package/dist/selection-popup.cjs.js +1 -1
- package/dist/selection-popup.esm.js +8 -15
- package/dist/selector-BvAh35ve.js +1 -0
- package/dist/selector-WI8pD7YO.mjs +18 -0
- package/dist/separator.cjs.js +1 -1
- package/dist/separator.esm.js +1 -1
- package/dist/sidebar.cjs.js +18 -18
- package/dist/sidebar.esm.js +117 -139
- package/dist/skeleton.cjs.js +11 -11
- package/dist/skeleton.esm.js +27 -24
- package/dist/slider.cjs.js +1 -1
- package/dist/slider.esm.js +6 -11
- package/dist/slot.cjs.js +4 -4
- package/dist/slot.esm.js +16 -19
- package/dist/sortable.cjs.js +79 -65
- package/dist/sortable.esm.js +714 -734
- package/dist/spinning-text.cjs.js +12 -12
- package/dist/spinning-text.esm.js +80 -92
- package/dist/split-button.cjs.js +4 -4
- package/dist/split-button.esm.js +77 -62
- package/dist/splitter.cjs.js +1 -1
- package/dist/splitter.esm.js +1 -1
- package/dist/stepper.cjs.js +8 -8
- package/dist/stepper.esm.js +32 -52
- package/dist/switch.cjs.js +7 -7
- package/dist/switch.esm.js +23 -31
- package/dist/table.cjs.js +2 -2
- package/dist/table.esm.js +46 -56
- package/dist/tabs.cjs.js +8 -8
- package/dist/tabs.esm.js +89 -109
- package/dist/tags-input.cjs.js +4 -4
- package/dist/tags-input.esm.js +45 -62
- package/dist/textarea.cjs.js +10 -10
- package/dist/textarea.esm.js +49 -52
- package/dist/time-field.cjs.js +4 -4
- package/dist/time-field.esm.js +70 -84
- package/dist/time-picker.cjs.js +22 -22
- package/dist/time-picker.esm.js +88 -110
- package/dist/timeline.cjs.js +1 -1
- package/dist/timeline.esm.js +3 -5
- package/dist/toast.cjs.js +2 -2
- package/dist/toast.esm.js +33 -47
- package/dist/toggle-group.cjs.js +6 -6
- package/dist/toggle-group.esm.js +85 -105
- package/dist/toggle.cjs.js +1 -1
- package/dist/toggle.esm.js +3 -5
- package/dist/toolbar.cjs.js +1 -1
- package/dist/toolbar.esm.js +13 -24
- package/dist/tooltip.cjs.js +2 -2
- package/dist/tooltip.esm.js +31 -42
- package/dist/transfer-list.cjs.js +31 -31
- package/dist/transfer-list.esm.js +114 -127
- package/dist/{tree-dcd74a4a.mjs → tree-B3kE8ESs.mjs} +55 -62
- package/dist/tree-Dx_kv_ih.js +39 -0
- package/dist/tree-item.cjs.js +2 -2
- package/dist/tree-item.esm.js +2 -3
- package/dist/tree.cjs.js +1 -1
- package/dist/tree.esm.js +2 -5
- package/dist/ui-button-Q0GNNWKC.mjs +665 -0
- package/dist/ui-button-rXQOS9QJ.js +521 -0
- package/dist/{icon-9e9da03b.js → ui-icon-BzVNC_lr.js} +4 -4
- package/dist/{icon-e2a85cc1.mjs → ui-icon-YI6lyuqU.mjs} +58 -65
- package/dist/visually-hidden.cjs.js +1 -1
- package/dist/visually-hidden.esm.js +1 -1
- package/dist/wizard.cjs.js +14 -14
- package/dist/wizard.esm.js +85 -105
- package/package.json +2 -2
- package/dist/date-time-utils-66480de4.js +0 -1
- package/dist/date-time-utils-a2c7af25.mjs +0 -307
- package/dist/dismissable-layer-193e3bed.js +0 -1
- package/dist/focus-scope-2b12b4e7.js +0 -1
- package/dist/listbox-308789a0.mjs +0 -210
- package/dist/listbox-ef2f708e.js +0 -46
- package/dist/panel-group-40254cdd.js +0 -36
- package/dist/portal-c69756c0.js +0 -1
- package/dist/positioner-33529bb8.js +0 -1
- package/dist/runtime-3f13807b.js +0 -1
- package/dist/tree-0a7a8d05.js +0 -39
- /package/dist/{collection-a2969ad2.js → collection-qv8A8rq4.js} +0 -0
- /package/dist/{menu-item-styles-27fdbac4.mjs → menu-item-styles-CZiPwPwl.mjs} +0 -0
- /package/dist/{menu-item-styles-83ad1e22.js → menu-item-styles-CbNUEwP2.js} +0 -0
- /package/dist/{roving-focus-group-5c059bf9.js → roving-focus-group-BdJ_4Njm.js} +0 -0
- /package/dist/{scroll-lock-d7b0df21.js → scroll-lock-BX6e3Ced.js} +0 -0
package/dist/alert-dialog.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { E as
|
|
2
|
-
import { a as
|
|
3
|
-
const
|
|
1
|
+
import { E as K } from "./ElementBase-YlTLMsGk.mjs";
|
|
2
|
+
import { a as F, r as z } from "./scroll-lock-LfqXXqsu.mjs";
|
|
3
|
+
const Y = `
|
|
4
4
|
:host {
|
|
5
5
|
display: block;
|
|
6
6
|
color-scheme: light dark;
|
|
@@ -499,47 +499,44 @@ const Q = `
|
|
|
499
499
|
border: 1px solid CanvasText;
|
|
500
500
|
}
|
|
501
501
|
}
|
|
502
|
-
`,
|
|
502
|
+
`, N = 'button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';
|
|
503
503
|
function p(e, t) {
|
|
504
|
-
if (e == null)
|
|
505
|
-
return t;
|
|
504
|
+
if (e == null) return t;
|
|
506
505
|
const i = e.trim().toLowerCase();
|
|
507
506
|
return i !== "false" && i !== "0" && i !== "off";
|
|
508
507
|
}
|
|
509
508
|
function a(e) {
|
|
510
509
|
return String(e).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
511
510
|
}
|
|
512
|
-
function
|
|
511
|
+
function Z(e) {
|
|
513
512
|
return e === "info" || e === "success" || e === "warning" || e === "danger" ? e : "neutral";
|
|
514
513
|
}
|
|
515
|
-
function
|
|
514
|
+
function G(e) {
|
|
516
515
|
return e === "sm" || e === "1" ? "sm" : e === "lg" || e === "3" ? "lg" : "md";
|
|
517
516
|
}
|
|
518
|
-
function
|
|
517
|
+
function J(e) {
|
|
519
518
|
return e === "soft" || e === "outline" || e === "solid" ? e : "surface";
|
|
520
519
|
}
|
|
521
|
-
function
|
|
520
|
+
function Q(e) {
|
|
522
521
|
return e === "none" || e === "high" ? e : "low";
|
|
523
522
|
}
|
|
524
|
-
function
|
|
523
|
+
function U(e) {
|
|
525
524
|
return e === "none" ? "none" : "line";
|
|
526
525
|
}
|
|
527
|
-
function
|
|
528
|
-
if (e == null)
|
|
529
|
-
return t;
|
|
526
|
+
function X(e, t = "var(--base-alert-dialog-radius, var(--ui-radius, 4px))") {
|
|
527
|
+
if (e == null) return t;
|
|
530
528
|
const i = e.trim().toLowerCase();
|
|
531
529
|
return i ? i === "full" || i === "pill" ? "999px" : /^-?\d+(\.\d+)?$/.test(i) ? `${i}px` : e : t;
|
|
532
530
|
}
|
|
533
|
-
const
|
|
534
|
-
function
|
|
531
|
+
const tt = /* @__PURE__ */ new Set(["tone", "size", "variant", "elevation", "indicator", "radius"]);
|
|
532
|
+
function it(e) {
|
|
535
533
|
return e === "success" ? '<svg width="16" height="16" viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><path d="M5 10.2 8.3 13.4 15 6.8"></path></svg>' : e === "warning" ? '<svg width="16" height="16" viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><path d="M10 3.6 17 16.4H3L10 3.6Z"></path><path d="M10 8v3.4"></path><circle cx="10" cy="14.1" r="0.9" fill="currentColor" stroke="none"></circle></svg>' : e === "danger" ? '<svg width="16" height="16" viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><circle cx="10" cy="10" r="7.1"></circle><path d="m7.5 7.5 5 5M12.5 7.5l-5 5"></path></svg>' : e === "info" ? '<svg width="16" height="16" viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><circle cx="10" cy="10" r="7.1"></circle><path d="M10 13v-3.8"></path><circle cx="10" cy="6.5" r="0.9" fill="currentColor" stroke="none"></circle></svg>' : '<svg width="16" height="16" viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><path d="M6 10h8"></path><circle cx="10" cy="10" r="7.1"></circle></svg>';
|
|
536
534
|
}
|
|
537
|
-
function
|
|
535
|
+
function c() {
|
|
538
536
|
return typeof window < "u" && typeof document < "u";
|
|
539
537
|
}
|
|
540
|
-
function
|
|
541
|
-
if (!
|
|
542
|
-
return null;
|
|
538
|
+
function E() {
|
|
539
|
+
if (!c()) return null;
|
|
543
540
|
const e = document.activeElement;
|
|
544
541
|
return e instanceof HTMLElement ? e : null;
|
|
545
542
|
}
|
|
@@ -555,7 +552,7 @@ function h(e) {
|
|
|
555
552
|
window.clearTimeout(e);
|
|
556
553
|
}
|
|
557
554
|
}
|
|
558
|
-
const
|
|
555
|
+
const l = class l extends K {
|
|
559
556
|
constructor() {
|
|
560
557
|
super(), this._lastActive = null, this._active = !1, this._terminalEmitted = !1, this._closeMeta = null, this._uid = Math.random().toString(36).slice(2, 10), this._dialogId = "", this._config = {}, this._inputValue = "", this._checked = !1, this._runtimeError = "", this._activeHeadless = !1, this._focusInitialFrame = 0, this._restoreFocusFrame = 0, this._onClick = this._onClick.bind(this), this._onKeyDown = this._onKeyDown.bind(this), this._onFocusIn = this._onFocusIn.bind(this), this._onInput = this._onInput.bind(this), this._dialogId = this._uid;
|
|
561
558
|
}
|
|
@@ -595,7 +592,7 @@ const B = class c extends J {
|
|
|
595
592
|
}
|
|
596
593
|
attributeChangedCallback(t, i, r) {
|
|
597
594
|
if (i !== r) {
|
|
598
|
-
if (
|
|
595
|
+
if (tt.has(t)) {
|
|
599
596
|
this._syncVisualTokens();
|
|
600
597
|
return;
|
|
601
598
|
}
|
|
@@ -653,7 +650,7 @@ const B = class c extends J {
|
|
|
653
650
|
this.setAttribute("role", t);
|
|
654
651
|
}
|
|
655
652
|
get tone() {
|
|
656
|
-
return
|
|
653
|
+
return Z(this.getAttribute("tone"));
|
|
657
654
|
}
|
|
658
655
|
set tone(t) {
|
|
659
656
|
if (t === "neutral") {
|
|
@@ -663,7 +660,7 @@ const B = class c extends J {
|
|
|
663
660
|
this.setAttribute("tone", t);
|
|
664
661
|
}
|
|
665
662
|
get size() {
|
|
666
|
-
return
|
|
663
|
+
return G(this.getAttribute("size"));
|
|
667
664
|
}
|
|
668
665
|
set size(t) {
|
|
669
666
|
if (t === "md") {
|
|
@@ -673,7 +670,7 @@ const B = class c extends J {
|
|
|
673
670
|
this.setAttribute("size", t);
|
|
674
671
|
}
|
|
675
672
|
get variant() {
|
|
676
|
-
return
|
|
673
|
+
return J(this.getAttribute("variant"));
|
|
677
674
|
}
|
|
678
675
|
set variant(t) {
|
|
679
676
|
if (t === "surface") {
|
|
@@ -683,7 +680,7 @@ const B = class c extends J {
|
|
|
683
680
|
this.setAttribute("variant", t);
|
|
684
681
|
}
|
|
685
682
|
get elevation() {
|
|
686
|
-
return
|
|
683
|
+
return Q(this.getAttribute("elevation"));
|
|
687
684
|
}
|
|
688
685
|
set elevation(t) {
|
|
689
686
|
if (t === "low") {
|
|
@@ -693,7 +690,7 @@ const B = class c extends J {
|
|
|
693
690
|
this.setAttribute("elevation", t);
|
|
694
691
|
}
|
|
695
692
|
get indicator() {
|
|
696
|
-
return
|
|
693
|
+
return U(this.getAttribute("indicator"));
|
|
697
694
|
}
|
|
698
695
|
set indicator(t) {
|
|
699
696
|
if (t === "line") {
|
|
@@ -743,12 +740,10 @@ const B = class c extends J {
|
|
|
743
740
|
return this._config;
|
|
744
741
|
}
|
|
745
742
|
set config(t) {
|
|
746
|
-
|
|
747
|
-
this._config = t || {}, this._config.id && (this._dialogId = this._config.id), this._config.dismissible != null && (this.dismissible = !!this._config.dismissible), this._config.closeOnEsc != null && (this.closeOnEsc = !!this._config.closeOnEsc), this._config.closeOnBackdrop != null && (this.closeOnBackdrop = !!this._config.closeOnBackdrop), this._config.lockWhileLoading != null && (this.lockWhileLoading = !!this._config.lockWhileLoading), this._config.role && (this.roleType = this._config.role), this._config.tone && (this.tone = this._config.tone), this._config.size && (this.size = this._config.size), this._config.variant && (this.variant = this._config.variant), this._config.elevation && (this.elevation = this._config.elevation), this._config.indicator && (this.indicator = this._config.indicator), this._config.radius != null && (this.radius = String(this._config.radius)), this._config.ariaLabel && this.setAttribute("aria-label", this._config.ariaLabel), this._config.ariaLabelledby && this.setAttribute("aria-labelledby", this._config.ariaLabelledby), this._config.ariaDescribedby && this.setAttribute("aria-describedby", this._config.ariaDescribedby), this._config.initialFocus && (this.initialFocus = this._config.initialFocus), this._config.headless != null && (this.headless = !!this._config.headless), this._inputValue = ((i = this._config.input) == null ? void 0 : i.value) ?? this._inputValue, this._checked = ((r = this._config.checkbox) == null ? void 0 : r.checked) ?? this._checked, this._runtimeError = this._config.errorMessage || "", this._syncVisualTokens(), this.requestRender();
|
|
743
|
+
this._config = t || {}, this._config.id && (this._dialogId = this._config.id), this._config.dismissible != null && (this.dismissible = !!this._config.dismissible), this._config.closeOnEsc != null && (this.closeOnEsc = !!this._config.closeOnEsc), this._config.closeOnBackdrop != null && (this.closeOnBackdrop = !!this._config.closeOnBackdrop), this._config.lockWhileLoading != null && (this.lockWhileLoading = !!this._config.lockWhileLoading), this._config.role && (this.roleType = this._config.role), this._config.tone && (this.tone = this._config.tone), this._config.size && (this.size = this._config.size), this._config.variant && (this.variant = this._config.variant), this._config.elevation && (this.elevation = this._config.elevation), this._config.indicator && (this.indicator = this._config.indicator), this._config.radius != null && (this.radius = String(this._config.radius)), this._config.ariaLabel && this.setAttribute("aria-label", this._config.ariaLabel), this._config.ariaLabelledby && this.setAttribute("aria-labelledby", this._config.ariaLabelledby), this._config.ariaDescribedby && this.setAttribute("aria-describedby", this._config.ariaDescribedby), this._config.initialFocus && (this.initialFocus = this._config.initialFocus), this._config.headless != null && (this.headless = !!this._config.headless), this._inputValue = this._config.input?.value ?? this._inputValue, this._checked = this._config.checkbox?.checked ?? this._checked, this._runtimeError = this._config.errorMessage || "", this._syncVisualTokens(), this.requestRender();
|
|
748
744
|
}
|
|
749
745
|
getInputValue() {
|
|
750
|
-
|
|
751
|
-
return (t == null ? void 0 : t.value) ?? this._inputValue;
|
|
746
|
+
return this.root.querySelector(".input")?.value ?? this._inputValue;
|
|
752
747
|
}
|
|
753
748
|
setInputValue(t) {
|
|
754
749
|
this._inputValue = t;
|
|
@@ -756,8 +751,7 @@ const B = class c extends J {
|
|
|
756
751
|
i && (i.value = t);
|
|
757
752
|
}
|
|
758
753
|
getChecked() {
|
|
759
|
-
|
|
760
|
-
return (t == null ? void 0 : t.checked) ?? this._checked;
|
|
754
|
+
return this.root.querySelector(".checkbox-input")?.checked ?? this._checked;
|
|
761
755
|
}
|
|
762
756
|
setChecked(t) {
|
|
763
757
|
this._checked = t;
|
|
@@ -777,7 +771,7 @@ const B = class c extends J {
|
|
|
777
771
|
this.hasAttribute("role") || this.setAttribute("role", "alertdialog");
|
|
778
772
|
}
|
|
779
773
|
_syncVisualTokens() {
|
|
780
|
-
this.style.setProperty("--ui-alert-radius",
|
|
774
|
+
this.style.setProperty("--ui-alert-radius", X(this.getAttribute("radius")));
|
|
781
775
|
}
|
|
782
776
|
_syncOpenState() {
|
|
783
777
|
const t = this.hasAttribute("open");
|
|
@@ -788,18 +782,17 @@ const B = class c extends J {
|
|
|
788
782
|
!t && this._active && this._deactivate();
|
|
789
783
|
}
|
|
790
784
|
_activate() {
|
|
791
|
-
this._active = !0, this._activeHeadless = this.headless, this._terminalEmitted = !1, this._closeMeta = null,
|
|
785
|
+
this._active = !0, this._activeHeadless = this.headless, this._terminalEmitted = !1, this._closeMeta = null, l._openStack.includes(this) || l._openStack.push(this), this._lastActive = this.headless ? null : E(), this.headless || F(), c() && !this.headless && document.addEventListener("focusin", this._onFocusIn, !0);
|
|
792
786
|
const t = this.dialogId || this._uid;
|
|
793
787
|
this._dispatchWithLegacy("ui-open", "open", { id: t }), this.headless || (this._focusInitialFrame && h(this._focusInitialFrame), this._focusInitialFrame = v(() => {
|
|
794
788
|
this._focusInitialFrame = 0, this._focusInitial();
|
|
795
789
|
})), this.requestRender();
|
|
796
790
|
}
|
|
797
791
|
_deactivate() {
|
|
798
|
-
if (!this._active)
|
|
799
|
-
return;
|
|
792
|
+
if (!this._active) return;
|
|
800
793
|
this._active = !1;
|
|
801
|
-
const t =
|
|
802
|
-
if (t >= 0 &&
|
|
794
|
+
const t = l._openStack.lastIndexOf(this);
|
|
795
|
+
if (t >= 0 && l._openStack.splice(t, 1), c() && !this._activeHeadless && document.removeEventListener("focusin", this._onFocusIn, !0), this._activeHeadless || z(), !this._terminalEmitted) {
|
|
803
796
|
const r = this._closeMeta || { action: "dismiss", source: "abort" }, s = this.dialogId || this._uid;
|
|
804
797
|
r.action === "cancel" ? this._dispatchWithLegacy("ui-cancel", "cancel", { id: s }) : r.action === "dismiss" && this._dispatchWithLegacy("ui-dismiss", "dismiss", {
|
|
805
798
|
id: s,
|
|
@@ -824,10 +817,10 @@ const B = class c extends J {
|
|
|
824
817
|
_syncActiveEnvironment() {
|
|
825
818
|
if (this._active && this.headless !== this._activeHeadless) {
|
|
826
819
|
if (this.headless) {
|
|
827
|
-
|
|
820
|
+
c() && document.removeEventListener("focusin", this._onFocusIn, !0), z(), this._lastActive = null, this._activeHeadless = !0;
|
|
828
821
|
return;
|
|
829
822
|
}
|
|
830
|
-
this._lastActive =
|
|
823
|
+
this._lastActive = E(), F(), c() && document.addEventListener("focusin", this._onFocusIn, !0), this._activeHeadless = !1, this._focusInitialFrame && h(this._focusInitialFrame), this._focusInitialFrame = v(() => {
|
|
831
824
|
this._focusInitialFrame = 0, this._focusInitial();
|
|
832
825
|
});
|
|
833
826
|
}
|
|
@@ -849,28 +842,24 @@ const B = class c extends J {
|
|
|
849
842
|
return this.dispatchEvent(n), o;
|
|
850
843
|
}
|
|
851
844
|
_isTopMost() {
|
|
852
|
-
if (!this._active)
|
|
853
|
-
|
|
854
|
-
const t = c._openStack;
|
|
845
|
+
if (!this._active) return !1;
|
|
846
|
+
const t = l._openStack;
|
|
855
847
|
return t.length > 0 && t[t.length - 1] === this;
|
|
856
848
|
}
|
|
857
849
|
_queryPanel() {
|
|
858
850
|
return this.root.querySelector(".dialog");
|
|
859
851
|
}
|
|
860
852
|
_collectFocusable(t) {
|
|
861
|
-
return Array.from(t.querySelectorAll(
|
|
862
|
-
if (i.disabled || i.getAttribute("aria-hidden") === "true")
|
|
863
|
-
|
|
864
|
-
const s = l() ? window.getComputedStyle(i) : null;
|
|
853
|
+
return Array.from(t.querySelectorAll(N)).filter((i) => {
|
|
854
|
+
if (i.disabled || i.getAttribute("aria-hidden") === "true") return !1;
|
|
855
|
+
const s = c() ? window.getComputedStyle(i) : null;
|
|
865
856
|
return !(s && (s.display === "none" || s.visibility === "hidden"));
|
|
866
857
|
});
|
|
867
858
|
}
|
|
868
859
|
_focusInitial() {
|
|
869
|
-
if (!this.open)
|
|
870
|
-
return;
|
|
860
|
+
if (!this.open) return;
|
|
871
861
|
const t = this._queryPanel();
|
|
872
|
-
if (!t)
|
|
873
|
-
return;
|
|
862
|
+
if (!t) return;
|
|
874
863
|
const i = this.initialFocus;
|
|
875
864
|
if (i) {
|
|
876
865
|
const n = t.querySelector(i);
|
|
@@ -887,11 +876,9 @@ const B = class c extends J {
|
|
|
887
876
|
}
|
|
888
877
|
}
|
|
889
878
|
_handleTab(t) {
|
|
890
|
-
if (t.key !== "Tab")
|
|
891
|
-
return;
|
|
879
|
+
if (t.key !== "Tab") return;
|
|
892
880
|
const i = this._queryPanel();
|
|
893
|
-
if (!i)
|
|
894
|
-
return;
|
|
881
|
+
if (!i) return;
|
|
895
882
|
const r = this._collectFocusable(i);
|
|
896
883
|
if (!r.length) {
|
|
897
884
|
t.preventDefault(), i.focus();
|
|
@@ -905,11 +892,9 @@ const B = class c extends J {
|
|
|
905
892
|
s === n && (t.preventDefault(), o.focus());
|
|
906
893
|
}
|
|
907
894
|
_onFocusIn(t) {
|
|
908
|
-
if (!this.open || !this._isTopMost())
|
|
909
|
-
return;
|
|
895
|
+
if (!this.open || !this._isTopMost()) return;
|
|
910
896
|
const i = this._queryPanel();
|
|
911
|
-
if (!i)
|
|
912
|
-
return;
|
|
897
|
+
if (!i) return;
|
|
913
898
|
const r = t.target;
|
|
914
899
|
(typeof t.composedPath == "function" ? t.composedPath() : []).includes(i) || r && i.contains(r) || this._focusInitial();
|
|
915
900
|
}
|
|
@@ -939,8 +924,7 @@ const B = class c extends J {
|
|
|
939
924
|
this._isInteractionLocked() || this.close("cancel");
|
|
940
925
|
}
|
|
941
926
|
_onClick(t) {
|
|
942
|
-
if (!this.open || !this._isTopMost())
|
|
943
|
-
return;
|
|
927
|
+
if (!this.open || !this._isTopMost()) return;
|
|
944
928
|
const i = t.target;
|
|
945
929
|
if (i) {
|
|
946
930
|
if (i.classList.contains("backdrop") && this.closeOnBackdrop) {
|
|
@@ -961,8 +945,7 @@ const B = class c extends J {
|
|
|
961
945
|
_onKeyDown(t) {
|
|
962
946
|
if (!(!this.open || !this._isTopMost())) {
|
|
963
947
|
if (t.key === "Escape") {
|
|
964
|
-
if (!this.closeOnEsc)
|
|
965
|
-
return;
|
|
948
|
+
if (!this.closeOnEsc) return;
|
|
966
949
|
t.preventDefault(), t.stopPropagation(), this._requestDismiss("esc");
|
|
967
950
|
return;
|
|
968
951
|
}
|
|
@@ -970,77 +953,76 @@ const B = class c extends J {
|
|
|
970
953
|
}
|
|
971
954
|
}
|
|
972
955
|
render() {
|
|
973
|
-
var A, F, z, I, E, C;
|
|
974
956
|
if (!this.open) {
|
|
975
957
|
this.setContent("");
|
|
976
958
|
return;
|
|
977
959
|
}
|
|
978
|
-
const t = this._config.title ?? this.getAttribute("title") ?? "", i = this._config.description ?? this.getAttribute("description") ?? "", r = this._config.confirmText ?? this.getAttribute("confirm-text") ?? "Confirm", s = this._config.cancelText ?? this.getAttribute("cancel-text") ?? "Cancel", o = this._config.loadingText ?? this.getAttribute("loading-text") ?? "Working...", n = !!
|
|
979
|
-
|
|
980
|
-
const d =
|
|
960
|
+
const t = this._config.title ?? this.getAttribute("title") ?? "", i = this._config.description ?? this.getAttribute("description") ?? "", r = this._config.confirmText ?? this.getAttribute("confirm-text") ?? "Confirm", s = this._config.cancelText ?? this.getAttribute("cancel-text") ?? "Cancel", o = this._config.loadingText ?? this.getAttribute("loading-text") ?? "Working...", n = !!this._config.input?.enabled, I = this._config.input?.label || "Value", C = this._config.input?.placeholder || "", L = !!this._config.input?.required, S = !!this._config.checkbox?.enabled, $ = this._config.checkbox?.label || "Remember this choice", B = this.state, f = this._runtimeError || this._config.errorMessage || this.getAttribute("error-message") || "", _ = `ui-alert-title-${this._uid}`, k = `ui-alert-description-${this._uid}`, y = `ui-alert-error-${this._uid}`, T = !!this.querySelector('[slot="title"]'), q = !!this.querySelector('[slot="description"]'), M = !!this.querySelector('[slot="icon"]'), O = !!this.querySelector('[slot="footer"]'), D = !!this.querySelector('[slot="content"]'), g = T || !!t, b = q || !!i, V = M || g || b, H = this._config.showCancel ?? this.dismissible, W = this._config.showClose ?? this.dismissible, R = this.tone, P = this.getAttribute("aria-label") || "", j = this.getAttribute("aria-labelledby") || "", w = this.getAttribute("aria-describedby") || "", m = j || (g ? _ : ""), A = P || (m ? "" : t || i || "Dialog"), u = [];
|
|
961
|
+
w ? u.push(w) : (b && u.push(k), f && u.push(y));
|
|
962
|
+
const d = B === "loading";
|
|
981
963
|
this.setContent(`
|
|
982
|
-
<style>${
|
|
964
|
+
<style>${Y}</style>
|
|
983
965
|
<div class="backdrop" part="backdrop" role="presentation" data-open="${String(this.open)}">
|
|
984
966
|
<section
|
|
985
967
|
class="dialog"
|
|
986
968
|
part="dialog"
|
|
987
969
|
role="${a(this.roleType)}"
|
|
988
970
|
aria-modal="true"
|
|
989
|
-
${
|
|
971
|
+
${A ? `aria-label="${a(A)}"` : ""}
|
|
990
972
|
${m ? `aria-labelledby="${a(m)}"` : ""}
|
|
991
973
|
${u.length ? `aria-describedby="${a(u.join(" "))}"` : ""}
|
|
992
974
|
tabindex="-1"
|
|
993
975
|
>
|
|
994
|
-
${
|
|
976
|
+
${W ? `<button class="close" part="close" aria-label="Close dialog">
|
|
995
977
|
<svg width="14" height="14" viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round">
|
|
996
978
|
<path d="m6 6 8 8M14 6l-8 8"></path>
|
|
997
979
|
</svg>
|
|
998
980
|
</button>` : ""}
|
|
999
981
|
|
|
1000
|
-
${
|
|
982
|
+
${V ? `<header class="header">
|
|
1001
983
|
<div class="header-main">
|
|
1002
984
|
<span class="icon-wrap" part="icon-wrap" aria-hidden="true">
|
|
1003
985
|
<span class="icon" part="icon">
|
|
1004
|
-
<slot name="icon">${
|
|
986
|
+
<slot name="icon">${it(R)}</slot>
|
|
1005
987
|
</span>
|
|
1006
988
|
</span>
|
|
1007
989
|
<div class="heading">
|
|
1008
|
-
${g ? `<h2 id="${
|
|
1009
|
-
${b ? `<p id="${
|
|
990
|
+
${g ? `<h2 id="${_}" class="title" part="title"><slot name="title">${a(t)}</slot></h2>` : ""}
|
|
991
|
+
${b ? `<p id="${k}" class="description" part="description"><slot name="description">${a(i)}</slot></p>` : ""}
|
|
1010
992
|
</div>
|
|
1011
993
|
</div>
|
|
1012
994
|
</header>` : ""}
|
|
1013
995
|
|
|
1014
996
|
<div class="content" part="content">
|
|
1015
|
-
${
|
|
997
|
+
${D ? '<slot name="content"></slot>' : "<slot></slot>"}
|
|
1016
998
|
|
|
1017
999
|
${n ? `<label class="input-wrap">
|
|
1018
|
-
<span class="label">${a(
|
|
1000
|
+
<span class="label">${a(I)}</span>
|
|
1019
1001
|
<input
|
|
1020
1002
|
class="input"
|
|
1021
1003
|
part="input"
|
|
1022
1004
|
type="text"
|
|
1023
1005
|
value="${a(this.getInputValue())}"
|
|
1024
|
-
placeholder="${a(
|
|
1025
|
-
${
|
|
1006
|
+
placeholder="${a(C)}"
|
|
1007
|
+
${L ? "required" : ""}
|
|
1026
1008
|
${d ? "disabled" : ""}
|
|
1027
1009
|
/>
|
|
1028
1010
|
</label>` : ""}
|
|
1029
1011
|
|
|
1030
|
-
${
|
|
1012
|
+
${S ? `<label class="checkbox" part="checkbox">
|
|
1031
1013
|
<span class="checkbox-line">
|
|
1032
1014
|
<input class="checkbox-input" type="checkbox" ${this.getChecked() ? "checked" : ""} ${d ? "disabled" : ""} />
|
|
1033
|
-
<span>${a(
|
|
1015
|
+
<span>${a($)}</span>
|
|
1034
1016
|
</span>
|
|
1035
1017
|
</label>` : ""}
|
|
1036
1018
|
</div>
|
|
1037
1019
|
|
|
1038
|
-
<div class="error" id="${
|
|
1020
|
+
<div class="error" id="${y}" part="error" aria-live="polite" data-empty="${String(!f)}">${a(f)}</div>
|
|
1039
1021
|
|
|
1040
1022
|
<footer class="footer" part="footer">
|
|
1041
1023
|
${d ? `<span class="loading"><span class="spinner" aria-hidden="true"></span><span>${a(o)}</span></span>` : '<span aria-hidden="true"></span>'}
|
|
1042
1024
|
|
|
1043
|
-
${
|
|
1025
|
+
${O ? '<slot name="footer"></slot>' : `${H ? `<button class="btn btn-cancel" part="cancel" type="button" ${d ? "disabled" : ""}>${a(s)}</button>` : ""}
|
|
1044
1026
|
<button class="btn btn-confirm" part="confirm" type="button" ${d ? "disabled" : ""}>${a(r)}</button>`}
|
|
1045
1027
|
</footer>
|
|
1046
1028
|
</section>
|
|
@@ -1048,9 +1030,9 @@ const B = class c extends J {
|
|
|
1048
1030
|
`);
|
|
1049
1031
|
}
|
|
1050
1032
|
};
|
|
1051
|
-
|
|
1052
|
-
let
|
|
1053
|
-
typeof customElements < "u" && !customElements.get("ui-alert-dialog") && customElements.define("ui-alert-dialog",
|
|
1033
|
+
l._openStack = [];
|
|
1034
|
+
let x = l;
|
|
1035
|
+
typeof customElements < "u" && !customElements.get("ui-alert-dialog") && customElements.define("ui-alert-dialog", x);
|
|
1054
1036
|
export {
|
|
1055
|
-
|
|
1037
|
+
x as UIAlertDialog
|
|
1056
1038
|
};
|
package/dist/alert.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const y=require("./ElementBase-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const y=require("./ElementBase-EV6mVBUV.js"),z=`
|
|
2
2
|
:host {
|
|
3
3
|
display: block;
|
|
4
4
|
--ui-alert-radius: var(--base-alert-radius, var(--ui-radius, 4px));
|
package/dist/alert.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { E as w } from "./ElementBase-
|
|
1
|
+
import { E as w } from "./ElementBase-YlTLMsGk.mjs";
|
|
2
2
|
const y = `
|
|
3
3
|
:host {
|
|
4
4
|
display: block;
|
|
@@ -349,15 +349,13 @@ function A(i) {
|
|
|
349
349
|
return i === "none" ? "none" : "line";
|
|
350
350
|
}
|
|
351
351
|
function $(i, r = "var(--base-alert-radius, var(--ui-radius, 4px))") {
|
|
352
|
-
if (!i || !i.trim())
|
|
353
|
-
return r;
|
|
352
|
+
if (!i || !i.trim()) return r;
|
|
354
353
|
const t = i.trim().toLowerCase();
|
|
355
354
|
return t === "full" || t === "pill" ? "999px" : t === "square" || t === "none" ? "0px" : /^-?\d+(\.\d+)?$/.test(t) ? `${t}px` : i.trim();
|
|
356
355
|
}
|
|
357
356
|
function s(i, r) {
|
|
358
357
|
return Array.from(i.children).some((t) => {
|
|
359
|
-
if (!(t instanceof HTMLElement))
|
|
360
|
-
return !1;
|
|
358
|
+
if (!(t instanceof HTMLElement)) return !1;
|
|
361
359
|
const e = t.getAttribute("slot") || "";
|
|
362
360
|
return r ? e === r : e === "";
|
|
363
361
|
});
|
|
@@ -400,8 +398,7 @@ class B extends w {
|
|
|
400
398
|
}
|
|
401
399
|
_onSlotChange() {
|
|
402
400
|
const r = this.root.querySelector(".actions");
|
|
403
|
-
if (!r || !this._actionsSlot)
|
|
404
|
-
return;
|
|
401
|
+
if (!r || !this._actionsSlot) return;
|
|
405
402
|
const t = this._actionsSlot.assignedNodes({ flatten: !0 }).length > 0;
|
|
406
403
|
r.setAttribute("data-empty", t ? "false" : "true");
|
|
407
404
|
}
|
package/dist/anchor.cjs.js
CHANGED
|
@@ -22,9 +22,9 @@
|
|
|
22
22
|
cursor: default;
|
|
23
23
|
opacity: 0.6;
|
|
24
24
|
}
|
|
25
|
-
`;class i extends HTMLElement{constructor(){super();const t=this.attachShadow({mode:"open"});t.innerHTML=`
|
|
25
|
+
`;class i extends HTMLElement{static get observedAttributes(){return["href","target","rel","download","hreflang","referrerpolicy","ping","type","aria-label","title"]}constructor(){super();const t=this.attachShadow({mode:"open"});t.innerHTML=`
|
|
26
26
|
<style>${r}</style>
|
|
27
27
|
<a part="anchor">
|
|
28
28
|
<slot></slot>
|
|
29
29
|
</a>
|
|
30
|
-
`,this.anchorEl=t.querySelector("a")}
|
|
30
|
+
`,this.anchorEl=t.querySelector("a")}connectedCallback(){this.syncAttributes()}attributeChangedCallback(){this.syncAttributes()}syncAttributes(){const t=this.getAttribute("href");this.syncAttribute("href"),this.syncAttribute("target"),this.syncAttribute("rel"),this.syncAttribute("download"),this.syncAttribute("hreflang"),this.syncAttribute("referrerpolicy"),this.syncAttribute("ping"),this.syncAttribute("type"),this.syncAttribute("aria-label"),this.syncAttribute("title"),t?this.anchorEl.removeAttribute("aria-disabled"):(this.anchorEl.removeAttribute("href"),this.anchorEl.setAttribute("aria-disabled","true"))}syncAttribute(t){const e=this.getAttribute(t);if(e==null){this.anchorEl.removeAttribute(t);return}this.anchorEl.setAttribute(t,e)}}typeof customElements<"u"&&!customElements.get("ui-anchor")&&customElements.define("ui-anchor",i);exports.UIAnchor=i;
|
package/dist/anchor.esm.js
CHANGED
|
@@ -24,6 +24,9 @@ const i = `
|
|
|
24
24
|
}
|
|
25
25
|
`;
|
|
26
26
|
class r extends HTMLElement {
|
|
27
|
+
static get observedAttributes() {
|
|
28
|
+
return ["href", "target", "rel", "download", "hreflang", "referrerpolicy", "ping", "type", "aria-label", "title"];
|
|
29
|
+
}
|
|
27
30
|
constructor() {
|
|
28
31
|
super();
|
|
29
32
|
const t = this.attachShadow({ mode: "open" });
|
|
@@ -34,9 +37,6 @@ class r extends HTMLElement {
|
|
|
34
37
|
</a>
|
|
35
38
|
`, this.anchorEl = t.querySelector("a");
|
|
36
39
|
}
|
|
37
|
-
static get observedAttributes() {
|
|
38
|
-
return ["href", "target", "rel", "download", "hreflang", "referrerpolicy", "ping", "type", "aria-label", "title"];
|
|
39
|
-
}
|
|
40
40
|
connectedCallback() {
|
|
41
41
|
this.syncAttributes();
|
|
42
42
|
}
|