@editora/ui-core 0.1.21 → 0.1.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +292 -221
- package/dist/{ElementBase-YlTLMsGk.mjs → ElementBase-BeZT54Hj.mjs} +3 -2
- package/dist/ElementBase-DxbvhLJs.js +1 -0
- package/dist/ElementBase.d.ts +2 -1
- package/dist/ElementBase.d.ts.map +1 -1
- package/dist/__tests__/setup.d.ts +0 -2
- package/dist/__tests__/setup.d.ts.map +1 -1
- package/dist/accordion.cjs.js +4 -4
- package/dist/accordion.esm.js +4 -4
- package/dist/alert-dialog.cjs.js +32 -32
- package/dist/alert-dialog.esm.js +95 -75
- package/dist/alert.cjs.js +7 -7
- package/dist/alert.esm.js +7 -7
- package/dist/anchor.cjs.js +3 -3
- package/dist/anchor.esm.js +6 -5
- package/dist/animated-beam.cjs.js +1 -1
- package/dist/animated-beam.esm.js +1 -1
- package/dist/animated-list.cjs.js +5 -5
- package/dist/animated-list.esm.js +5 -5
- package/dist/animated-text.cjs.js +5 -5
- package/dist/animated-text.esm.js +5 -5
- package/dist/app-header.cjs.js +4 -4
- package/dist/app-header.esm.js +4 -4
- package/dist/aspect-ratio.cjs.js +4 -4
- package/dist/aspect-ratio.esm.js +4 -4
- package/dist/avatar.cjs.js +14 -14
- package/dist/avatar.esm.js +31 -29
- package/dist/badge.cjs.js +5 -5
- package/dist/badge.esm.js +5 -5
- package/dist/block-controls.cjs.js +5 -5
- package/dist/block-controls.esm.js +5 -5
- package/dist/box.cjs.js +3 -3
- package/dist/box.esm.js +3 -3
- package/dist/breadcrumb.cjs.js +6 -6
- package/dist/breadcrumb.esm.js +6 -6
- package/dist/button.cjs.js +1 -1
- package/dist/button.esm.js +1 -1
- package/dist/{calendar-DLY4acgn.mjs → calendar-B3PUKHQm.mjs} +227 -183
- package/dist/{calendar-Dkof-FTK.js → calendar-D-mXMgqc.js} +74 -35
- package/dist/calendar.cjs.js +1 -1
- package/dist/calendar.esm.js +1 -1
- package/dist/card.cjs.js +8 -8
- package/dist/card.esm.js +63 -20
- package/dist/chart.cjs.js +5 -5
- package/dist/chart.esm.js +7 -7
- package/dist/checkbox.cjs.js +3 -3
- package/dist/checkbox.esm.js +3 -3
- package/dist/collapsible.cjs.js +8 -8
- package/dist/collapsible.esm.js +8 -8
- package/dist/collection.cjs.js +1 -1
- package/dist/collection.esm.js +9 -8
- package/dist/color-picker.cjs.js +30 -10
- package/dist/color-picker.esm.js +84 -62
- package/dist/combobox.cjs.js +29 -27
- package/dist/combobox.esm.js +51 -45
- package/dist/command-palette.cjs.js +1 -1
- package/dist/command-palette.esm.js +1 -1
- package/dist/command.cjs.js +2 -2
- package/dist/command.esm.js +3 -3
- package/dist/components/ui-alert-dialog.d.ts +1 -0
- package/dist/components/ui-alert-dialog.d.ts.map +1 -1
- package/dist/components/ui-anchor.d.ts +2 -1
- package/dist/components/ui-anchor.d.ts.map +1 -1
- package/dist/components/ui-avatar.d.ts +1 -0
- package/dist/components/ui-avatar.d.ts.map +1 -1
- package/dist/components/ui-button.d.ts +1 -0
- package/dist/components/ui-button.d.ts.map +1 -1
- package/dist/components/ui-calendar.d.ts.map +1 -1
- package/dist/components/ui-card.d.ts +3 -0
- package/dist/components/ui-card.d.ts.map +1 -1
- package/dist/components/ui-checkbox.d.ts.map +1 -1
- package/dist/components/ui-collection.d.ts +2 -1
- package/dist/components/ui-collection.d.ts.map +1 -1
- package/dist/components/ui-color-picker.d.ts.map +1 -1
- package/dist/components/ui-combobox.d.ts.map +1 -1
- package/dist/components/ui-data-table.d.ts.map +1 -1
- package/dist/components/ui-date-field.d.ts.map +1 -1
- package/dist/components/ui-date-picker.d.ts.map +1 -1
- package/dist/components/ui-date-range-picker.d.ts.map +1 -1
- package/dist/components/ui-date-range-time-picker.d.ts.map +1 -1
- package/dist/components/ui-date-time-picker.d.ts.map +1 -1
- package/dist/components/ui-dock.d.ts +1 -0
- package/dist/components/ui-dock.d.ts.map +1 -1
- package/dist/components/ui-drawer.d.ts.map +1 -1
- package/dist/components/ui-dropdown.d.ts.map +1 -1
- package/dist/components/ui-field.d.ts.map +1 -1
- package/dist/components/ui-file-upload.d.ts.map +1 -1
- package/dist/components/ui-form.d.ts +1 -0
- package/dist/components/ui-form.d.ts.map +1 -1
- package/dist/components/ui-gantt.d.ts.map +1 -1
- package/dist/components/ui-input.d.ts.map +1 -1
- package/dist/components/ui-menu.d.ts.map +1 -1
- package/dist/components/ui-multi-select.d.ts.map +1 -1
- package/dist/components/ui-number-field.d.ts.map +1 -1
- package/dist/components/ui-password-field.d.ts.map +1 -1
- package/dist/components/ui-pin-input.d.ts +1 -0
- package/dist/components/ui-pin-input.d.ts.map +1 -1
- package/dist/components/ui-placement-grid.d.ts.map +1 -1
- package/dist/components/ui-progress.d.ts.map +1 -1
- package/dist/components/ui-radio.d.ts.map +1 -1
- package/dist/components/ui-rating.d.ts +1 -0
- package/dist/components/ui-rating.d.ts.map +1 -1
- package/dist/components/ui-roving-focus-group.d.ts +2 -1
- package/dist/components/ui-roving-focus-group.d.ts.map +1 -1
- package/dist/components/ui-select.d.ts.map +1 -1
- package/dist/components/ui-sortable.d.ts.map +1 -1
- package/dist/components/ui-switch.d.ts.map +1 -1
- package/dist/components/ui-table.d.ts.map +1 -1
- package/dist/components/ui-tabs.d.ts +1 -0
- package/dist/components/ui-tabs.d.ts.map +1 -1
- package/dist/components/ui-tags-input.d.ts +1 -0
- package/dist/components/ui-tags-input.d.ts.map +1 -1
- package/dist/components/ui-textarea.d.ts.map +1 -1
- package/dist/components/ui-time-field.d.ts.map +1 -1
- package/dist/components/ui-toggle-group.d.ts.map +1 -1
- package/dist/components/ui-toggle.d.ts.map +1 -1
- package/dist/components/ui-tree.d.ts.map +1 -1
- package/dist/components/ui-wizard.d.ts.map +1 -1
- package/dist/container.cjs.js +1 -1
- package/dist/container.esm.js +1 -1
- package/dist/context-menu.cjs.js +3 -3
- package/dist/context-menu.esm.js +5 -5
- package/dist/control-group.cjs.js +1 -1
- package/dist/control-group.esm.js +1 -1
- package/dist/control-name-BmoI1m3a.js +1 -0
- package/dist/control-name-Bpj7F34X.mjs +48 -0
- package/dist/data-table.cjs.js +6 -3
- package/dist/data-table.esm.js +146 -143
- package/dist/date-field.cjs.js +5 -5
- package/dist/date-field.esm.js +34 -31
- package/dist/date-picker.cjs.js +16 -16
- package/dist/date-picker.esm.js +49 -45
- package/dist/date-range-picker.cjs.js +5 -5
- package/dist/date-range-picker.esm.js +120 -118
- package/dist/date-range-time-picker.cjs.js +22 -22
- package/dist/date-range-time-picker.esm.js +89 -85
- package/dist/date-time-picker.cjs.js +23 -23
- package/dist/date-time-picker.esm.js +103 -99
- package/dist/{date-time-utils-y1N2gvG2.mjs → date-time-utils-BTlxnz5j.mjs} +1 -1
- package/dist/{date-time-utils-Dmost5Ee.js → date-time-utils-y3AvNvGe.js} +1 -1
- package/dist/description.cjs.js +4 -4
- package/dist/description.esm.js +4 -4
- package/dist/dialog.cjs.js +3 -3
- package/dist/dialog.esm.js +3 -3
- package/dist/direction-provider.cjs.js +1 -1
- package/dist/direction-provider.esm.js +1 -1
- package/dist/dismissable-layer.cjs.js +1 -1
- package/dist/dismissable-layer.esm.js +1 -1
- package/dist/dock.cjs.js +12 -12
- package/dist/dock.esm.js +73 -75
- package/dist/domElement-DazSZBjV.js +1 -0
- package/dist/domElement-ZlSGVP0l.mjs +5 -0
- package/dist/domElement.d.ts +2 -0
- package/dist/domElement.d.ts.map +1 -0
- package/dist/drawer.cjs.js +19 -19
- package/dist/drawer.esm.js +58 -58
- package/dist/dropdown.cjs.js +13 -13
- package/dist/dropdown.esm.js +50 -49
- package/dist/empty-state.cjs.js +4 -4
- package/dist/empty-state.esm.js +4 -4
- package/dist/field-error.cjs.js +2 -2
- package/dist/field-error.esm.js +2 -2
- package/dist/field.cjs.js +12 -12
- package/dist/field.esm.js +84 -75
- package/dist/fieldset.cjs.js +5 -5
- package/dist/fieldset.esm.js +5 -5
- package/dist/file-upload.cjs.js +4 -4
- package/dist/file-upload.esm.js +6 -4
- package/dist/flex.cjs.js +1 -1
- package/dist/flex.esm.js +1 -1
- package/dist/floating-toolbar.cjs.js +8 -8
- package/dist/floating-toolbar.esm.js +10 -10
- package/dist/focus-scope.cjs.js +1 -1
- package/dist/focus-scope.esm.js +1 -1
- package/dist/form.cjs.js +13 -13
- package/dist/form.esm.js +23 -13
- package/dist/gantt.cjs.js +43 -32
- package/dist/gantt.esm.js +100 -89
- package/dist/grid.cjs.js +1 -1
- package/dist/grid.esm.js +1 -1
- package/dist/hover-card.cjs.js +1 -1
- package/dist/hover-card.esm.js +1 -1
- package/dist/icon-cloud.cjs.js +4 -4
- package/dist/icon-cloud.esm.js +4 -4
- package/dist/icon.cjs.js +1 -1
- package/dist/icon.esm.js +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +121 -118
- package/dist/inline-edit.cjs.js +2 -2
- package/dist/inline-edit.esm.js +2 -2
- package/dist/input.cjs.js +14 -14
- package/dist/input.esm.js +40 -33
- package/dist/label.cjs.js +4 -4
- package/dist/label.esm.js +4 -4
- package/dist/layout.cjs.js +1 -1
- package/dist/layout.esm.js +1 -1
- package/dist/{listbox-B6QgECax.js → listbox-CTpRpuF7.js} +1 -1
- package/dist/{listbox-DJamVeFj.mjs → listbox-hMVOhKHC.mjs} +1 -1
- package/dist/listbox.cjs.js +1 -1
- package/dist/listbox.esm.js +1 -1
- package/dist/marquee.cjs.js +4 -4
- package/dist/marquee.esm.js +4 -4
- package/dist/masonry-grid.cjs.js +1 -1
- package/dist/masonry-grid.esm.js +1 -1
- package/dist/{menu-item-styles-CbNUEwP2.js → menu-item-styles-B4onAr4C.js} +3 -3
- package/dist/{menu-item-styles-CZiPwPwl.mjs → menu-item-styles-IGSFLAHu.mjs} +3 -3
- package/dist/menu.cjs.js +7 -7
- package/dist/menu.esm.js +30 -29
- package/dist/menubar.cjs.js +1 -1
- package/dist/menubar.esm.js +3 -3
- package/dist/meter.cjs.js +2 -2
- package/dist/meter.esm.js +2 -2
- package/dist/multi-select.cjs.js +17 -17
- package/dist/multi-select.esm.js +52 -44
- package/dist/navigation-menu.cjs.js +2 -2
- package/dist/navigation-menu.esm.js +2 -2
- package/dist/number-field.cjs.js +11 -13
- package/dist/number-field.esm.js +30 -28
- package/dist/number-ticker.cjs.js +5 -5
- package/dist/number-ticker.esm.js +5 -5
- package/dist/odometer.cjs.js +3 -3
- package/dist/odometer.esm.js +3 -3
- package/dist/orbiter.cjs.js +4 -4
- package/dist/orbiter.esm.js +4 -4
- package/dist/pagination.cjs.js +2 -2
- package/dist/pagination.esm.js +2 -2
- package/dist/{panel-group-CaD0_KQf.js → panel-group-BVHJEdfx.js} +1 -1
- package/dist/{panel-group-8sVNnGxg.mjs → panel-group-BxO_eNW6.mjs} +1 -1
- package/dist/panel-group.cjs.js +1 -1
- package/dist/panel-group.esm.js +1 -1
- package/dist/panel.cjs.js +1 -1
- package/dist/panel.esm.js +1 -1
- package/dist/password-field.cjs.js +23 -23
- package/dist/password-field.esm.js +48 -47
- package/dist/pin-input.cjs.js +8 -6
- package/dist/pin-input.esm.js +21 -15
- package/dist/placement-grid.cjs.js +4 -4
- package/dist/placement-grid.esm.js +58 -58
- package/dist/plugin-panel.cjs.js +2 -2
- package/dist/plugin-panel.esm.js +2 -2
- package/dist/popover.cjs.js +6 -6
- package/dist/popover.esm.js +5 -5
- package/dist/portal.cjs.js +1 -1
- package/dist/portal.esm.js +1 -1
- package/dist/positioner.cjs.js +1 -1
- package/dist/positioner.esm.js +1 -1
- package/dist/presence.cjs.js +1 -1
- package/dist/presence.esm.js +1 -1
- package/dist/primitives/control-name.d.ts +30 -0
- package/dist/primitives/control-name.d.ts.map +1 -0
- package/dist/primitives/trigger.d.ts +2 -0
- package/dist/primitives/trigger.d.ts.map +1 -0
- package/dist/progress.cjs.js +4 -4
- package/dist/progress.esm.js +20 -18
- package/dist/quick-actions.cjs.js +4 -4
- package/dist/quick-actions.esm.js +4 -4
- package/dist/radio-group.cjs.js +2 -2
- package/dist/radio-group.esm.js +2 -2
- package/dist/radio.cjs.js +3 -3
- package/dist/radio.esm.js +3 -3
- package/dist/rating.cjs.js +18 -17
- package/dist/rating.esm.js +91 -92
- package/dist/roving-focus-group.cjs.js +1 -1
- package/dist/roving-focus-group.esm.js +11 -10
- package/dist/{runtime-D1gFh1fS.mjs → runtime-CFnK53iC.mjs} +133 -94
- package/dist/runtime-DwE-tizc.js +1 -0
- package/dist/runtime.cjs.js +1 -1
- package/dist/runtime.d.ts +1 -1
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.esm.js +29 -26
- package/dist/scroll-area.cjs.js +1 -1
- package/dist/scroll-area.esm.js +1 -1
- package/dist/section.cjs.js +1 -1
- package/dist/section.esm.js +1 -1
- package/dist/select.cjs.js +20 -19
- package/dist/select.esm.js +37 -33
- package/dist/selection-popup.cjs.js +3 -3
- package/dist/selection-popup.esm.js +3 -3
- package/dist/separator.cjs.js +8 -8
- package/dist/separator.esm.js +8 -8
- package/dist/sidebar.cjs.js +9 -9
- package/dist/sidebar.esm.js +16 -16
- package/dist/skeleton.cjs.js +8 -8
- package/dist/skeleton.esm.js +8 -8
- package/dist/slider.cjs.js +4 -4
- package/dist/slider.esm.js +4 -4
- package/dist/slot.cjs.js +4 -4
- package/dist/slot.esm.js +4 -4
- package/dist/sortable.cjs.js +43 -44
- package/dist/sortable.esm.js +100 -101
- package/dist/spinning-text.cjs.js +4 -4
- package/dist/spinning-text.esm.js +4 -4
- package/dist/split-button.cjs.js +1 -1
- package/dist/split-button.esm.js +2 -2
- package/dist/splitter.cjs.js +1 -1
- package/dist/splitter.esm.js +1 -1
- package/dist/stepper.cjs.js +2 -2
- package/dist/stepper.esm.js +2 -2
- package/dist/switch.cjs.js +11 -13
- package/dist/switch.esm.js +11 -13
- package/dist/table.cjs.js +10 -7
- package/dist/table.esm.js +47 -44
- package/dist/tabs.cjs.js +21 -22
- package/dist/tabs.esm.js +71 -67
- package/dist/tags-input.cjs.js +9 -9
- package/dist/tags-input.esm.js +32 -25
- package/dist/textarea.cjs.js +10 -10
- package/dist/textarea.esm.js +30 -21
- package/dist/theme.d.ts +18 -0
- package/dist/theme.d.ts.map +1 -1
- package/dist/time-field.cjs.js +5 -5
- package/dist/time-field.esm.js +21 -18
- package/dist/time-picker.cjs.js +4 -4
- package/dist/time-picker.esm.js +6 -6
- package/dist/timeline.cjs.js +3 -3
- package/dist/timeline.esm.js +5 -5
- package/dist/toast.cjs.js +7 -7
- package/dist/toast.esm.js +14 -14
- package/dist/toggle-group.cjs.js +6 -7
- package/dist/toggle-group.esm.js +64 -61
- package/dist/toggle.cjs.js +18 -18
- package/dist/toggle.esm.js +32 -31
- package/dist/toolbar.cjs.js +1 -1
- package/dist/toolbar.esm.js +1 -1
- package/dist/tooltip.cjs.js +5 -5
- package/dist/tooltip.esm.js +5 -5
- package/dist/transfer-list.cjs.js +4 -4
- package/dist/transfer-list.esm.js +4 -4
- package/dist/{tree-B3kE8ESs.mjs → tree-B_oQput6.mjs} +35 -34
- package/dist/tree-SivHxcAy.js +39 -0
- package/dist/tree-item.cjs.js +1 -1
- package/dist/tree-item.esm.js +1 -1
- package/dist/tree.cjs.js +1 -1
- package/dist/tree.esm.js +1 -1
- package/dist/trigger-BjnxLCeQ.mjs +9 -0
- package/dist/trigger-DkPsKxsP.js +1 -0
- package/dist/{ui-button-rXQOS9QJ.js → ui-button-BPrzJScZ.js} +29 -28
- package/dist/{ui-button-Q0GNNWKC.mjs → ui-button-Co8Sid6t.mjs} +70 -49
- package/dist/{ui-icon-BzVNC_lr.js → ui-icon-D3avtxX_.js} +5 -5
- package/dist/{ui-icon-YI6lyuqU.mjs → ui-icon-DLhB08Fo.mjs} +3 -3
- package/dist/visually-hidden.cjs.js +1 -1
- package/dist/visually-hidden.esm.js +1 -1
- package/dist/wizard.cjs.js +12 -13
- package/dist/wizard.esm.js +18 -16
- package/package.json +2 -2
- package/dist/ElementBase-EV6mVBUV.js +0 -1
- package/dist/runtime-CTaOSmBj.js +0 -1
- package/dist/tree-Dx_kv_ih.js +0 -39
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import { E as tt } from "./ElementBase-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { r as
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { E as tt } from "./ElementBase-BeZT54Hj.mjs";
|
|
2
|
+
import { s as et, a as it } from "./control-name-Bpj7F34X.mjs";
|
|
3
|
+
import { c as rt } from "./dismissable-layer-BmPIoK80.mjs";
|
|
4
|
+
import { r as st } from "./calendar-B3PUKHQm.mjs";
|
|
5
|
+
import { r as nt, e as at, i as C, s as ot, b as lt, j as I, k as A, f as dt, m as D, o as P, l as ut, c as ct, q as k, g as pt, h as ht } from "./date-time-utils-BTlxnz5j.mjs";
|
|
6
|
+
let mt = 0;
|
|
7
|
+
const ft = `
|
|
7
8
|
<svg viewBox="0 0 20 20" class="icon-svg" aria-hidden="true" focusable="false">
|
|
8
9
|
<path d="M6 2a1 1 0 0 1 1 1v1h6V3a1 1 0 1 1 2 0v1h.5A2.5 2.5 0 0 1 18 6.5v9A2.5 2.5 0 0 1 15.5 18h-11A2.5 2.5 0 0 1 2 15.5v-9A2.5 2.5 0 0 1 4.5 4H5V3a1 1 0 0 1 1-1Zm10 7H4v6.5c0 .276.224.5.5.5h11a.5.5 0 0 0 .5-.5V9ZM4.5 6a.5.5 0 0 0-.5.5V7h12v-.5a.5.5 0 0 0-.5-.5h-11Z" fill="currentColor"/>
|
|
9
10
|
</svg>
|
|
10
|
-
`,
|
|
11
|
+
`, bt = `
|
|
11
12
|
<svg viewBox="0 0 20 20" class="icon-svg" aria-hidden="true" focusable="false">
|
|
12
13
|
<path d="M5.23 7.21a.75.75 0 0 1 1.06.02L10 11.12l3.71-3.9a.75.75 0 1 1 1.08 1.04l-4.25 4.47a.75.75 0 0 1-1.08 0L5.2 8.27a.75.75 0 0 1 .02-1.06Z" fill="currentColor"/>
|
|
13
14
|
</svg>
|
|
14
|
-
`,
|
|
15
|
+
`, gt = `
|
|
15
16
|
<svg viewBox="0 0 20 20" class="icon-svg" aria-hidden="true" focusable="false">
|
|
16
17
|
<path d="M5.22 5.22a.75.75 0 0 1 1.06 0L10 8.94l3.72-3.72a.75.75 0 1 1 1.06 1.06L11.06 10l3.72 3.72a.75.75 0 1 1-1.06 1.06L10 11.06l-3.72 3.72a.75.75 0 1 1-1.06-1.06L8.94 10 5.22 6.28a.75.75 0 0 1 0-1.06Z" fill="currentColor"/>
|
|
17
18
|
</svg>
|
|
@@ -19,7 +20,7 @@ const ht = `
|
|
|
19
20
|
<svg viewBox="0 0 20 20" class="icon-svg" aria-hidden="true" focusable="false">
|
|
20
21
|
<path d="M10 2a8 8 0 1 1 0 16 8 8 0 0 1 0-16Zm0 1.5a6.5 6.5 0 1 0 0 13 6.5 6.5 0 0 0 0-13Zm.75 2.75a.75.75 0 0 0-1.5 0v3.88c0 .2.08.4.22.54l2.5 2.5a.75.75 0 1 0 1.06-1.06l-2.28-2.28V6.25Z" fill="currentColor"/>
|
|
21
22
|
</svg>
|
|
22
|
-
`,
|
|
23
|
+
`, _t = `
|
|
23
24
|
:host {
|
|
24
25
|
--ui-drtp-bg: color-mix(in srgb, var(--ui-color-surface, #ffffff) 96%, transparent);
|
|
25
26
|
--ui-drtp-surface: linear-gradient(
|
|
@@ -29,9 +30,9 @@ const ht = `
|
|
|
29
30
|
);
|
|
30
31
|
--ui-drtp-border: color-mix(in srgb, var(--ui-color-border, #cbd5e1) 78%, transparent);
|
|
31
32
|
--ui-dp-text: var(--ui-color-text, #0f172a);
|
|
32
|
-
--ui-dp-muted: var(--ui-color-muted, #
|
|
33
|
+
--ui-dp-muted: var(--ui-color-muted, #526175);
|
|
33
34
|
--ui-drtp-accent: var(--ui-color-primary, #2563eb);
|
|
34
|
-
--ui-drtp-success: var(--ui-color-success, #
|
|
35
|
+
--ui-drtp-success: var(--ui-color-success, #15803d);
|
|
35
36
|
--ui-drtp-error: var(--ui-color-danger, #dc2626);
|
|
36
37
|
--ui-drtp-radius: 12px;
|
|
37
38
|
--ui-drtp-panel-radius: 14px;
|
|
@@ -270,7 +271,7 @@ const ht = `
|
|
|
270
271
|
outline-color: Highlight;
|
|
271
272
|
}
|
|
272
273
|
}
|
|
273
|
-
`,
|
|
274
|
+
`, yt = `
|
|
274
275
|
.ui-date-range-time-picker-overlay-host {
|
|
275
276
|
--ui-drtp-bg: color-mix(in srgb, var(--ui-color-surface, #ffffff) 96%, transparent);
|
|
276
277
|
--ui-drtp-surface: linear-gradient(
|
|
@@ -280,7 +281,7 @@ const ht = `
|
|
|
280
281
|
);
|
|
281
282
|
--ui-drtp-border: color-mix(in srgb, var(--ui-color-border, #cbd5e1) 78%, transparent);
|
|
282
283
|
--ui-dp-text: var(--ui-color-text, #0f172a);
|
|
283
|
-
--ui-dp-muted: var(--ui-color-muted, #
|
|
284
|
+
--ui-dp-muted: var(--ui-color-muted, #526175);
|
|
284
285
|
--ui-drtp-accent: var(--ui-color-primary, #2563eb);
|
|
285
286
|
--ui-drtp-panel-radius: 14px;
|
|
286
287
|
--ui-drtp-shadow: none;
|
|
@@ -339,7 +340,7 @@ const ht = `
|
|
|
339
340
|
.head-meta {
|
|
340
341
|
margin: 0;
|
|
341
342
|
font: 500 12px/1.3 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
|
|
342
|
-
color: var(--ui-dp-muted, #
|
|
343
|
+
color: var(--ui-dp-muted, #526175);
|
|
343
344
|
}
|
|
344
345
|
.presets {
|
|
345
346
|
display: flex;
|
|
@@ -354,7 +355,7 @@ const ht = `
|
|
|
354
355
|
padding: 0 10px;
|
|
355
356
|
min-block-size: 28px;
|
|
356
357
|
font: 600 11px/1 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
|
|
357
|
-
color: var(--ui-dp-muted, #
|
|
358
|
+
color: var(--ui-dp-muted, #526175);
|
|
358
359
|
background: color-mix(in srgb, var(--ui-drtp-bg, #fff) 96%, transparent);
|
|
359
360
|
cursor: pointer;
|
|
360
361
|
}
|
|
@@ -392,7 +393,7 @@ const ht = `
|
|
|
392
393
|
}
|
|
393
394
|
.time-col-label {
|
|
394
395
|
font-size: 10px;
|
|
395
|
-
color: var(--ui-dp-muted, #
|
|
396
|
+
color: var(--ui-dp-muted, #526175);
|
|
396
397
|
font-weight: 700;
|
|
397
398
|
text-transform: uppercase;
|
|
398
399
|
letter-spacing: .06em;
|
|
@@ -539,29 +540,32 @@ function X(h) {
|
|
|
539
540
|
...h.end ? { end: h.end } : {}
|
|
540
541
|
});
|
|
541
542
|
}
|
|
542
|
-
function
|
|
543
|
+
function x(h) {
|
|
543
544
|
return String(h).padStart(2, "0");
|
|
544
545
|
}
|
|
545
546
|
function c(h) {
|
|
546
547
|
return h.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
547
548
|
}
|
|
548
|
-
function
|
|
549
|
-
const t = /* @__PURE__ */ new Date(), e = `${
|
|
549
|
+
function v(h) {
|
|
550
|
+
const t = /* @__PURE__ */ new Date(), e = `${x(t.getHours())}:${x(t.getMinutes())}`, i = `${x((t.getHours() + 1) % 24)}:${x(t.getMinutes())}`, r = A(h.start || null), o = A(h.end || null);
|
|
550
551
|
return {
|
|
551
552
|
startDate: r?.date || null,
|
|
552
|
-
endDate:
|
|
553
|
+
endDate: o?.date || null,
|
|
553
554
|
startTime: r?.time?.slice(0, 5) || e,
|
|
554
|
-
endTime:
|
|
555
|
+
endTime: o?.time?.slice(0, 5) || i
|
|
555
556
|
};
|
|
556
557
|
}
|
|
557
|
-
class
|
|
558
|
+
class vt extends tt {
|
|
558
559
|
constructor() {
|
|
559
|
-
super(...arguments), this._value = { start: null, end: null }, this._pending =
|
|
560
|
-
|
|
560
|
+
super(...arguments), this._value = { start: null, end: null }, this._pending = v({ start: null, end: null }), this._display = "", this._inlineError = "", this._open = !1, this._syncing = !1, this._overlay = null, this._dismissableLayer = null, this._releaseScrollLock = null, this._isInitialized = !1, this._hasView = !1, this._restoreFocusEl = null, this._overlayKey = null, this._uid = `ui-drtp-${++mt}`, this._inputId = `${this._uid}-input`, this._labelId = `${this._uid}-label`, this._hintId = `${this._uid}-hint`, this._errorId = `${this._uid}-error`, this._panelId = `${this._uid}-panel`, this._schedulePosition = nt(() => this._positionOverlay()), this._onRootClickBound = (t) => this._onRootClick(t), this._onRootChangeBound = (t) => this._onRootChange(t), this._onRootKeyDownBound = (t) => this._onRootKeyDown(t), this._onOverlayClickBound = (t) => this._onOverlayClick(t), this._onOverlayChangeBound = (t) => this._onOverlayChange(t), this._onOverlayCalendarBound = (t) => this._onOverlayCalendar(t), this._onDocumentPointerDownBound = (t) => this._onDocumentPointerDown(t), this._onDocumentKeyDownBound = (t) => this._onDocumentKeyDown(t), this._onWindowResizeBound = () => this._schedulePosition.run(), this._onWindowScrollBound = (t) => {
|
|
561
|
+
at(t, [this._overlay]) || this._schedulePosition.run();
|
|
561
562
|
};
|
|
562
563
|
}
|
|
563
564
|
static get observedAttributes() {
|
|
564
565
|
return [
|
|
566
|
+
"aria-label",
|
|
567
|
+
"aria-description",
|
|
568
|
+
"aria-describedby",
|
|
565
569
|
"open",
|
|
566
570
|
"default-open",
|
|
567
571
|
"value",
|
|
@@ -595,7 +599,7 @@ class _t extends tt {
|
|
|
595
599
|
connectedCallback() {
|
|
596
600
|
if (super.connectedCallback(), this.root.addEventListener("click", this._onRootClickBound), this.root.addEventListener("change", this._onRootChangeBound), this.root.addEventListener("keydown", this._onRootKeyDownBound), !this._isInitialized) {
|
|
597
601
|
const t = Q(this.getAttribute("value") || this.getAttribute("default-value"));
|
|
598
|
-
this._value = t, this._pending =
|
|
602
|
+
this._value = t, this._pending = v(t), this._display = this._formatDisplay(), this._open = this.hasAttribute("open") || C(this.getAttribute("default-open")), this._isInitialized = !0;
|
|
599
603
|
}
|
|
600
604
|
this._open && !this._isInlineMode() && this._ensureOverlay();
|
|
601
605
|
}
|
|
@@ -603,7 +607,7 @@ class _t extends tt {
|
|
|
603
607
|
this.root.removeEventListener("click", this._onRootClickBound), this.root.removeEventListener("change", this._onRootChangeBound), this.root.removeEventListener("keydown", this._onRootKeyDownBound), this._destroyOverlay(), super.disconnectedCallback();
|
|
604
608
|
}
|
|
605
609
|
attributeChangedCallback(t, e, i) {
|
|
606
|
-
if (e !== i && (t === "value" && !this._syncing && (this._value = Q(i), this._pending =
|
|
610
|
+
if (e !== i && (t === "value" && !this._syncing && (this._value = Q(i), this._pending = v(this._value), this._display = this._formatDisplay(), this._inlineError = ""), t === "open" && !this._syncing && (this._open = this.hasAttribute("open"), this._syncOverlay("attribute")), t === "mode" && this._syncOverlay("attribute"), t === "disabled" && this.hasAttribute("disabled") && this._setOpen(!1, "outside"), t === "state" && this._state() === "loading" && this._setOpen(!1, "outside"), !!this.isConnected)) {
|
|
607
611
|
if (!this._hasView) {
|
|
608
612
|
this.requestRender();
|
|
609
613
|
return;
|
|
@@ -615,7 +619,7 @@ class _t extends tt {
|
|
|
615
619
|
return (this.getAttribute("mode") || "popover") === "inline";
|
|
616
620
|
}
|
|
617
621
|
_isMobileSheet() {
|
|
618
|
-
return
|
|
622
|
+
return ot(this.getAttribute("mode"));
|
|
619
623
|
}
|
|
620
624
|
_isDisabled() {
|
|
621
625
|
return this.hasAttribute("disabled");
|
|
@@ -628,7 +632,7 @@ class _t extends tt {
|
|
|
628
632
|
return this._isDisabled() || this._state() === "loading";
|
|
629
633
|
}
|
|
630
634
|
_locale() {
|
|
631
|
-
return
|
|
635
|
+
return lt(this.getAttribute("locale"));
|
|
632
636
|
}
|
|
633
637
|
_isReadonly() {
|
|
634
638
|
return this.hasAttribute("readonly");
|
|
@@ -656,7 +660,7 @@ class _t extends tt {
|
|
|
656
660
|
return !Number.isFinite(t) || t < 1 ? 5 : Math.min(60, Math.trunc(t));
|
|
657
661
|
}
|
|
658
662
|
_translations() {
|
|
659
|
-
return
|
|
663
|
+
return st(
|
|
660
664
|
this.getAttribute("locale"),
|
|
661
665
|
this.getAttribute("translations")
|
|
662
666
|
);
|
|
@@ -703,31 +707,31 @@ class _t extends tt {
|
|
|
703
707
|
}
|
|
704
708
|
_valueFromPending() {
|
|
705
709
|
return {
|
|
706
|
-
start:
|
|
707
|
-
end:
|
|
710
|
+
start: I(this._pending.startDate, this._pending.startTime),
|
|
711
|
+
end: I(this._pending.endDate, this._pending.endTime)
|
|
708
712
|
};
|
|
709
713
|
}
|
|
710
714
|
_formatDateTimeDisplay(t) {
|
|
711
715
|
const e = A(t);
|
|
712
|
-
return e ? `${
|
|
716
|
+
return e ? `${dt(e.date, this._locale(), "locale", null)} ${e.time}` : t || "";
|
|
713
717
|
}
|
|
714
718
|
_formatDisplay() {
|
|
715
719
|
const t = this._value.start, e = this._value.end;
|
|
716
720
|
return !t && !e ? "" : t && e ? `${this._formatDateTimeDisplay(t)} — ${this._formatDateTimeDisplay(e)}` : this._formatDateTimeDisplay(t || e);
|
|
717
721
|
}
|
|
718
722
|
_normalizePendingState(t) {
|
|
719
|
-
let e =
|
|
720
|
-
if (e && i &&
|
|
723
|
+
let e = I(t.startDate, t.startTime), i = I(t.endDate, t.endTime);
|
|
724
|
+
if (e && i && D(e, i) > 0 && this._autoNormalize()) {
|
|
721
725
|
const p = e;
|
|
722
726
|
e = i, i = p;
|
|
723
727
|
}
|
|
724
|
-
const r = P(this.getAttribute("min")),
|
|
725
|
-
let n = r ? `${r.date}T${r.time}` : null, s =
|
|
726
|
-
if (n && s &&
|
|
728
|
+
const r = P(this.getAttribute("min")), o = P(this.getAttribute("max"));
|
|
729
|
+
let n = r ? `${r.date}T${r.time}` : null, s = o ? `${o.date}T${o.time}` : null;
|
|
730
|
+
if (n && s && D(n, s) > 0) {
|
|
727
731
|
const p = n;
|
|
728
732
|
n = s, s = p;
|
|
729
733
|
}
|
|
730
|
-
e && n &&
|
|
734
|
+
e && n && D(e, n) < 0 && (e = n), e && s && D(e, s) > 0 && (e = s), i && n && D(i, n) < 0 && (i = n), i && s && D(i, s) > 0 && (i = s);
|
|
731
735
|
const a = A(e || ""), u = A(i || "");
|
|
732
736
|
return {
|
|
733
737
|
startDate: a?.date || null,
|
|
@@ -739,14 +743,14 @@ class _t extends tt {
|
|
|
739
743
|
_commit(t, e) {
|
|
740
744
|
if (this._isInteractionBlocked() || this._isReadonly()) return;
|
|
741
745
|
const i = this._normalizePendingState(t), r = {
|
|
742
|
-
start:
|
|
743
|
-
end:
|
|
746
|
+
start: I(i.startDate, i.startTime),
|
|
747
|
+
end: I(i.endDate, i.endTime)
|
|
744
748
|
};
|
|
745
749
|
if (!this._allowPartial() && (!r.start || !r.end)) {
|
|
746
750
|
this._inlineError = this.getAttribute("error") || this._translations().rangeIncomplete, this._emitInvalid(JSON.stringify(r), "partial"), this._updateHostState();
|
|
747
751
|
return;
|
|
748
752
|
}
|
|
749
|
-
if (r.start && r.end &&
|
|
753
|
+
if (r.start && r.end && D(r.start, r.end) > 0) {
|
|
750
754
|
this._inlineError = this.getAttribute("error") || this._translations().invalidRangeOrder, this._emitInvalid(JSON.stringify(r), "order"), this._updateHostState();
|
|
751
755
|
return;
|
|
752
756
|
}
|
|
@@ -775,7 +779,7 @@ class _t extends tt {
|
|
|
775
779
|
_ensureOverlay() {
|
|
776
780
|
if (this._overlay || typeof document > "u") return;
|
|
777
781
|
const t = document.createElement("div");
|
|
778
|
-
t.className = "ui-date-range-time-picker-overlay-host", t.style.position = "fixed", t.style.left = "0", t.style.top = "0", t.style.pointerEvents = "none", t.addEventListener("click", this._onOverlayClickBound), t.addEventListener("change", this._onOverlayChangeBound), t.addEventListener("change", this._onOverlayCalendarBound), document.body.appendChild(t), this._overlay = t, this._syncOverlayHostZIndex(), document.addEventListener("pointerdown", this._onDocumentPointerDownBound, !0), document.addEventListener("keydown", this._onDocumentKeyDownBound), window.addEventListener("resize", this._onWindowResizeBound), window.addEventListener("scroll", this._onWindowScrollBound, { passive: !0, capture: !0 }), this._isMobileSheet() && (this._releaseScrollLock =
|
|
782
|
+
t.className = "ui-date-range-time-picker-overlay-host", t.style.position = "fixed", t.style.left = "0", t.style.top = "0", t.style.pointerEvents = "none", t.addEventListener("click", this._onOverlayClickBound), t.addEventListener("change", this._onOverlayChangeBound), t.addEventListener("change", this._onOverlayCalendarBound), document.body.appendChild(t), this._overlay = t, this._syncOverlayHostZIndex(), document.addEventListener("pointerdown", this._onDocumentPointerDownBound, !0), document.addEventListener("keydown", this._onDocumentKeyDownBound), window.addEventListener("resize", this._onWindowResizeBound), window.addEventListener("scroll", this._onWindowScrollBound, { passive: !0, capture: !0 }), this._isMobileSheet() && (this._releaseScrollLock = ut());
|
|
779
783
|
}
|
|
780
784
|
_syncOverlayHostZIndex() {
|
|
781
785
|
if (!this._overlay || typeof window > "u") return;
|
|
@@ -788,7 +792,7 @@ class _t extends tt {
|
|
|
788
792
|
_syncDismissableLayer() {
|
|
789
793
|
if (this._dismissableLayer?.destroy(), this._dismissableLayer = null, !this._open || !this._overlay) return;
|
|
790
794
|
const t = this._overlay.querySelector(".panel, .sheet"), e = this.root.querySelector(".field");
|
|
791
|
-
t && (this._dismissableLayer =
|
|
795
|
+
t && (this._dismissableLayer = rt({
|
|
792
796
|
node: t,
|
|
793
797
|
trigger: e,
|
|
794
798
|
closeOnEscape: !0,
|
|
@@ -801,7 +805,7 @@ class _t extends tt {
|
|
|
801
805
|
if (!this._overlay || !this._open || this._isMobileSheet()) return;
|
|
802
806
|
const t = this.root.querySelector(".field"), e = this._overlay.querySelector(".panel");
|
|
803
807
|
if (!t || !e) return;
|
|
804
|
-
const i = e.getAttribute("data-placement"), r =
|
|
808
|
+
const i = e.getAttribute("data-placement"), r = ct(
|
|
805
809
|
t.getBoundingClientRect(),
|
|
806
810
|
e.getBoundingClientRect(),
|
|
807
811
|
8,
|
|
@@ -811,14 +815,14 @@ class _t extends tt {
|
|
|
811
815
|
e.style.position = "absolute", e.style.top = `${Math.round(r.top)}px`, e.style.left = `${Math.round(r.left)}px`, e.setAttribute("data-placement", r.placement);
|
|
812
816
|
}
|
|
813
817
|
_timeOptions(t) {
|
|
814
|
-
const e = k(t) || { hours: 0, minutes: 0 }, i = this._step(), r = Array.from({ length: 24 }, (n, s) => `<option value="${s}" ${s === e.hours ? "selected" : ""}>${
|
|
818
|
+
const e = k(t) || { hours: 0, minutes: 0 }, i = this._step(), r = Array.from({ length: 24 }, (n, s) => `<option value="${s}" ${s === e.hours ? "selected" : ""}>${x(s)}</option>`).join(""), o = Array.from({ length: Math.ceil(60 / i) }, (n, s) => {
|
|
815
819
|
const a = Math.min(59, s * i);
|
|
816
|
-
return `<option value="${a}" ${a === e.minutes ? "selected" : ""}>${
|
|
820
|
+
return `<option value="${a}" ${a === e.minutes ? "selected" : ""}>${x(a)}</option>`;
|
|
817
821
|
}).join("");
|
|
818
|
-
return { hours: r, minutes:
|
|
822
|
+
return { hours: r, minutes: o };
|
|
819
823
|
}
|
|
820
824
|
_renderSurfaceInner(t, e = !1) {
|
|
821
|
-
const i = this._translations(), r = this._timeOptions(this._pending.startTime),
|
|
825
|
+
const i = this._translations(), r = this._timeOptions(this._pending.startTime), o = this._timeOptions(this._pending.endTime), n = (this.getAttribute("label") || "").trim(), s = c(n), a = c(n || i.selectDateRange), u = this._valueFromPending(), p = u.start && u.end ? `${this._formatDateTimeDisplay(u.start)} — ${this._formatDateTimeDisplay(u.end)}` : i.selectDateRange, g = c(`${i.startTime} ${i.hour}`), w = c(`${i.startTime} ${i.minute}`), y = c(`${i.endTime} ${i.hour}`), l = c(`${i.endTime} ${i.minute}`), f = `
|
|
822
826
|
<header class="head">
|
|
823
827
|
<div>
|
|
824
828
|
<p class="head-title" ${n ? "" : "hidden"}>${s}</p>
|
|
@@ -839,12 +843,12 @@ class _t extends tt {
|
|
|
839
843
|
<div class="time-row">
|
|
840
844
|
<p class="time-row-label"><span class="icon-inline">${B}</span>${c(i.startTime)}</p>
|
|
841
845
|
<select data-time="start" data-segment="hours" aria-label="${g}">${r.hours}</select>
|
|
842
|
-
<select data-time="start" data-segment="minutes" aria-label="${
|
|
846
|
+
<select data-time="start" data-segment="minutes" aria-label="${w}">${r.minutes}</select>
|
|
843
847
|
</div>
|
|
844
848
|
<div class="time-row">
|
|
845
849
|
<p class="time-row-label"><span class="icon-inline">${B}</span>${c(i.endTime)}</p>
|
|
846
|
-
<select data-time="end" data-segment="hours" aria-label="${y}">${
|
|
847
|
-
<select data-time="end" data-segment="minutes" aria-label="${
|
|
850
|
+
<select data-time="end" data-segment="hours" aria-label="${y}">${o.hours}</select>
|
|
851
|
+
<select data-time="end" data-segment="minutes" aria-label="${l}">${o.minutes}</select>
|
|
848
852
|
</div>
|
|
849
853
|
</div>
|
|
850
854
|
</div>
|
|
@@ -861,10 +865,10 @@ class _t extends tt {
|
|
|
861
865
|
<button type="button" class="action" data-action="apply" data-tone="primary">${c(i.apply)}</button>
|
|
862
866
|
</footer>
|
|
863
867
|
`;
|
|
864
|
-
return e ?
|
|
865
|
-
<style>${
|
|
868
|
+
return e ? f : `
|
|
869
|
+
<style>${yt}</style>
|
|
866
870
|
${t ? '<div class="sheet-backdrop" data-action="backdrop"></div>' : ""}
|
|
867
|
-
<section class="${t ? "sheet" : "panel"}" id="${this._panelId}" role="dialog" aria-modal="${t ? "true" : "false"}" aria-label="${a}" part="${t ? "sheet" : "popover"}">${
|
|
871
|
+
<section class="${t ? "sheet" : "panel"}" id="${this._panelId}" role="dialog" aria-modal="${t ? "true" : "false"}" aria-label="${a}" part="${t ? "sheet" : "popover"}">${f}</section>
|
|
868
872
|
`;
|
|
869
873
|
}
|
|
870
874
|
_syncCalendar(t) {
|
|
@@ -881,8 +885,8 @@ class _t extends tt {
|
|
|
881
885
|
...this._pending.startDate ? { start: this._pending.startDate } : {},
|
|
882
886
|
...this._pending.endDate ? { end: this._pending.endDate } : {}
|
|
883
887
|
}));
|
|
884
|
-
const r = P(this.getAttribute("min")),
|
|
885
|
-
e("min", r?.date || null), e("max",
|
|
888
|
+
const r = P(this.getAttribute("min")), o = P(this.getAttribute("max"));
|
|
889
|
+
e("min", r?.date || null), e("max", o?.date || null), e("locale", this.getAttribute("locale")), e("translations", this.getAttribute("translations")), e("week-start", this.getAttribute("week-start"));
|
|
886
890
|
const s = this.getAttribute("size") || "sm", a = t.classList.contains("drtp-calendar-inline");
|
|
887
891
|
e("size", s === "lg" ? "md" : "sm"), e("variant", this.getAttribute("variant")), i("readonly", this._isReadonly()), i("disabled", this._isInteractionBlocked()), i("bare", this._isBare()), e("tabindex", "-1"), s === "lg" ? (t.style.setProperty("--ui-calendar-day-height", "1.95em"), t.style.setProperty("--ui-calendar-day-padding-block", "0.2em"), t.style.setProperty("--ui-calendar-day-padding-inline", "0.26em"), t.style.setProperty("--ui-calendar-gap", "0.42em"), t.style.setProperty("--ui-calendar-day-font-size", "0.78em"), t.style.setProperty("--ui-calendar-weekday-font-size", "0.7em"), t.style.setProperty("--ui-calendar-title-font-size", "0.88em")) : (t.style.setProperty("--ui-calendar-day-height", "2.4em"), t.style.setProperty("--ui-calendar-day-padding-block", "0.14em"), t.style.setProperty("--ui-calendar-day-padding-inline", "0.22em"), t.style.setProperty("--ui-calendar-gap", "0.34em"), t.style.setProperty("--ui-calendar-day-font-size", "0.72em"), t.style.setProperty("--ui-calendar-weekday-font-size", "0.64em"), t.style.setProperty("--ui-calendar-title-font-size", "0.8em")), a ? (t.style.setProperty("--ui-calendar-frame-padding", "0.32em"), t.style.setProperty("--ui-calendar-week-gap", "0.18em"), t.style.setProperty("--ui-calendar-control-height", "1.72em"), t.style.setProperty("--ui-calendar-gap", "0.24em")) : (t.style.removeProperty("--ui-calendar-frame-padding"), t.style.removeProperty("--ui-calendar-week-gap"), t.style.removeProperty("--ui-calendar-control-height")), e("aria-label", this.getAttribute("label") || this._translations().selectDateRange);
|
|
888
892
|
}
|
|
@@ -903,10 +907,10 @@ class _t extends tt {
|
|
|
903
907
|
_setClosestOptionValue(t, e) {
|
|
904
908
|
const i = Array.from(t.options).map((n) => Number(n.value)).filter((n) => Number.isFinite(n));
|
|
905
909
|
if (!i.length) return;
|
|
906
|
-
let r = i[0],
|
|
910
|
+
let r = i[0], o = Math.abs(r - e);
|
|
907
911
|
for (let n = 1; n < i.length; n += 1) {
|
|
908
912
|
const s = i[n], a = Math.abs(s - e);
|
|
909
|
-
a <
|
|
913
|
+
a < o && (r = s, o = a);
|
|
910
914
|
}
|
|
911
915
|
t.value = String(r);
|
|
912
916
|
}
|
|
@@ -915,10 +919,10 @@ class _t extends tt {
|
|
|
915
919
|
this._syncOverlayHostZIndex();
|
|
916
920
|
const t = this._isMobileSheet();
|
|
917
921
|
this._ensureOverlayContent(t), this._syncDismissableLayer();
|
|
918
|
-
const e = this._translations(), i = this._overlay.querySelector(".panel, .sheet"), r = this._overlay.querySelector(".presets"),
|
|
922
|
+
const e = this._translations(), i = this._overlay.querySelector(".panel, .sheet"), r = this._overlay.querySelector(".presets"), o = this._overlay.querySelector(".footer");
|
|
919
923
|
i && (i.dataset.bare = this._isBare() ? "true" : "false");
|
|
920
924
|
const n = this._showFooter();
|
|
921
|
-
r && (r.hidden = !n),
|
|
925
|
+
r && (r.hidden = !n), o && (o.hidden = !n);
|
|
922
926
|
const s = this._overlay.querySelector(".head-title");
|
|
923
927
|
if (s) {
|
|
924
928
|
const m = (this.getAttribute("label") || "").trim();
|
|
@@ -928,10 +932,10 @@ class _t extends tt {
|
|
|
928
932
|
a && (a.textContent = u.start && u.end ? `${this._formatDateTimeDisplay(u.start)} — ${this._formatDateTimeDisplay(u.end)}` : e.selectDateRange);
|
|
929
933
|
const p = this._overlay.querySelector(".drtp-calendar");
|
|
930
934
|
p && this._syncCalendar(p);
|
|
931
|
-
const g = k(this._pending.startTime) || { hours: 0, minutes: 0 },
|
|
932
|
-
y && this._setClosestOptionValue(y, g.hours),
|
|
935
|
+
const g = k(this._pending.startTime) || { hours: 0, minutes: 0 }, w = k(this._pending.endTime) || { hours: 0, minutes: 0 }, y = this._overlay.querySelector('select[data-time="start"][data-segment="hours"]'), l = this._overlay.querySelector('select[data-time="start"][data-segment="minutes"]'), f = this._overlay.querySelector('select[data-time="end"][data-segment="hours"]'), b = this._overlay.querySelector('select[data-time="end"][data-segment="minutes"]');
|
|
936
|
+
y && this._setClosestOptionValue(y, g.hours), l && this._setClosestOptionValue(l, g.minutes), f && this._setClosestOptionValue(f, w.hours), b && this._setClosestOptionValue(b, w.minutes);
|
|
933
937
|
const _ = this._isInteractionBlocked() || this._isReadonly();
|
|
934
|
-
[y,
|
|
938
|
+
[y, l, f, b].forEach((m) => {
|
|
935
939
|
m && (m.disabled = _);
|
|
936
940
|
}), this._overlay.querySelectorAll(".action, .preset").forEach((m) => {
|
|
937
941
|
m.disabled = _;
|
|
@@ -943,9 +947,9 @@ class _t extends tt {
|
|
|
943
947
|
_applyTimeFromOverlay(t) {
|
|
944
948
|
const e = t.getAttribute("data-time"), i = this._overlay?.querySelector(`select[data-time="${e}"][data-segment="hours"]`), r = this._overlay?.querySelector(`select[data-time="${e}"][data-segment="minutes"]`);
|
|
945
949
|
if (!e || !i || !r) return;
|
|
946
|
-
const
|
|
947
|
-
if (!Number.isFinite(
|
|
948
|
-
const s = `${
|
|
950
|
+
const o = Number(i.value), n = Number(r.value);
|
|
951
|
+
if (!Number.isFinite(o) || !Number.isFinite(n)) return;
|
|
952
|
+
const s = `${x(o)}:${x(n)}`;
|
|
949
953
|
e === "start" && (this._pending.startTime = s), e === "end" && (this._pending.endTime = s), this._pending = this._normalizePendingState(this._pending), this._emitInput("time");
|
|
950
954
|
}
|
|
951
955
|
_todayIso() {
|
|
@@ -959,11 +963,11 @@ class _t extends tt {
|
|
|
959
963
|
return;
|
|
960
964
|
}
|
|
961
965
|
if (t === "preset-last7") {
|
|
962
|
-
const r =
|
|
966
|
+
const r = pt(e, 7);
|
|
963
967
|
this._pending.startDate = r.start, this._pending.endDate = r.end, this._pending = this._normalizePendingState(this._pending), this._emitInput("preset-last7");
|
|
964
968
|
return;
|
|
965
969
|
}
|
|
966
|
-
const i =
|
|
970
|
+
const i = ht(e);
|
|
967
971
|
this._pending.startDate = i.start, this._pending.endDate = i.end, this._pending = this._normalizePendingState(this._pending), this._emitInput("preset-month");
|
|
968
972
|
}
|
|
969
973
|
_onRootClick(t) {
|
|
@@ -976,7 +980,7 @@ class _t extends tt {
|
|
|
976
980
|
return;
|
|
977
981
|
}
|
|
978
982
|
if (i === "clear") {
|
|
979
|
-
this._isInlineMode() ? (this._pending =
|
|
983
|
+
this._isInlineMode() ? (this._pending = v({ start: null, end: null }), this._emitInput("clear"), this._updateHostState()) : (this._pending = v({ start: null, end: null }), this._commit(this._pending, "clear"));
|
|
980
984
|
return;
|
|
981
985
|
}
|
|
982
986
|
if (this._isInlineMode() && (i === "preset-today" || i === "preset-last7" || i === "preset-month")) {
|
|
@@ -984,7 +988,7 @@ class _t extends tt {
|
|
|
984
988
|
return;
|
|
985
989
|
}
|
|
986
990
|
if (this._isInlineMode() && i === "cancel") {
|
|
987
|
-
this._pending =
|
|
991
|
+
this._pending = v(this._value), this._updateHostState();
|
|
988
992
|
return;
|
|
989
993
|
}
|
|
990
994
|
this._isInlineMode() && i === "apply" && this._commit(this._pending, "apply");
|
|
@@ -1031,11 +1035,11 @@ class _t extends tt {
|
|
|
1031
1035
|
return;
|
|
1032
1036
|
}
|
|
1033
1037
|
if (i === "cancel") {
|
|
1034
|
-
this._pending =
|
|
1038
|
+
this._pending = v(this._value), this._setOpen(!1, "cancel");
|
|
1035
1039
|
return;
|
|
1036
1040
|
}
|
|
1037
1041
|
if (i === "clear") {
|
|
1038
|
-
this._pending =
|
|
1042
|
+
this._pending = v({ start: null, end: null }), this._emitInput("clear"), this._renderOverlay();
|
|
1039
1043
|
return;
|
|
1040
1044
|
}
|
|
1041
1045
|
if (i === "preset-today" || i === "preset-last7" || i === "preset-month") {
|
|
@@ -1075,12 +1079,12 @@ class _t extends tt {
|
|
|
1075
1079
|
}
|
|
1076
1080
|
_updateHostState() {
|
|
1077
1081
|
if (!this._hasView) return;
|
|
1078
|
-
const t = this.getAttribute("label") || "", e = this.getAttribute("hint") || "", i = this.getAttribute("error") || "", r = this._inlineError || i,
|
|
1082
|
+
const t = this.getAttribute("label") || "", e = this.getAttribute("hint") || "", i = this.getAttribute("error") || "", r = this._inlineError || i, o = !!(this._value.start || this._value.end), n = this.getAttribute("name") || "", s = this._isInlineMode(), a = this._translations(), u = r ? "error" : this._state(), p = this._formatDisplay();
|
|
1079
1083
|
this._display = p, this._state() === "loading" ? this.setAttribute("aria-busy", "true") : this.removeAttribute("aria-busy");
|
|
1080
|
-
const g = this.root.querySelector(".label"),
|
|
1081
|
-
if (g && (g.hidden = !t, g.id = this._labelId, g.setAttribute("for", this._inputId)),
|
|
1082
|
-
const
|
|
1083
|
-
e && _ && !_.hidden &&
|
|
1084
|
+
const g = this.root.querySelector(".label"), w = this.root.querySelector(".label-text"), y = this.root.querySelector(".required"), l = this.root.querySelector(".input"), f = this.root.querySelector('.btn[data-action="clear"]'), b = this.root.querySelector('.btn[data-action="toggle"]'), _ = this.root.querySelector(".hint"), m = this.root.querySelector(".error"), $ = this.root.querySelector(".hidden-input");
|
|
1085
|
+
if (g && (g.hidden = !t, g.id = this._labelId, g.setAttribute("for", this._inputId)), w && (w.textContent = t), y && (y.hidden = !this.hasAttribute("required")), l && (l.value !== p && (l.value = p), l.id = this._inputId, l.placeholder = a.dateRangeTimePlaceholder, l.readOnly = !0, l.disabled = this._isInteractionBlocked(), l.required = this.hasAttribute("required"), l.autocomplete = "off", l.setAttribute("role", "combobox"), l.setAttribute("aria-haspopup", "dialog"), l.setAttribute("aria-expanded", s ? "false" : String(this._open)), l.setAttribute("aria-controls", this._panelId), l.setAttribute("aria-invalid", r ? "true" : "false"), et(l, this, t ? this._labelId : null, l.placeholder)), f && (f.hidden = !(this._clearable() && o), f.setAttribute("aria-label", a.clearDateRange), f.disabled = this._isInteractionBlocked()), b && (b.hidden = s, b.setAttribute("aria-label", a.toggleCalendar), b.setAttribute("aria-expanded", s ? "false" : String(this._open)), b.setAttribute("aria-controls", this._panelId), b.disabled = this._isInteractionBlocked()), _ && (_.id = this._hintId, _.hidden = !e, _.textContent = e), m && (m.id = this._errorId, m.hidden = !r, m.textContent = r), l) {
|
|
1086
|
+
const S = [];
|
|
1087
|
+
e && _ && !_.hidden && S.push(this._hintId), r && S.push(this._errorId), it(l, this, this._uid, S);
|
|
1084
1088
|
}
|
|
1085
1089
|
$ && ($.disabled = !n, $.name = n, $.value = X(this._value) || "");
|
|
1086
1090
|
const O = this.root.querySelector(".field");
|
|
@@ -1088,8 +1092,8 @@ class _t extends tt {
|
|
|
1088
1092
|
const d = this.root.querySelector(".inline-panel");
|
|
1089
1093
|
if (d) {
|
|
1090
1094
|
d.hidden = !s, d.id = this._panelId, d.dataset.bare = this._isBare() ? "true" : "false", d.setAttribute("role", "dialog"), d.setAttribute("aria-modal", "false"), d.setAttribute("aria-label", t || a.selectDateRange);
|
|
1091
|
-
const
|
|
1092
|
-
|
|
1095
|
+
const S = d.querySelector(".panel-title");
|
|
1096
|
+
S && (S.textContent = t, S.hidden = !t);
|
|
1093
1097
|
const R = d.querySelector(".head-title");
|
|
1094
1098
|
R && (R.textContent = t, R.hidden = !t);
|
|
1095
1099
|
const H = d.querySelector(".head-meta"), z = this._valueFromPending();
|
|
@@ -1121,18 +1125,18 @@ class _t extends tt {
|
|
|
1121
1125
|
if (!this._hasView) {
|
|
1122
1126
|
const t = this._translations();
|
|
1123
1127
|
this.setContent(`
|
|
1124
|
-
<style>${
|
|
1128
|
+
<style>${_t}</style>
|
|
1125
1129
|
<div class="root">
|
|
1126
1130
|
<label class="label" part="label" id="${this._labelId}">
|
|
1127
1131
|
<span class="label-text"></span>
|
|
1128
1132
|
<span class="required">*</span>
|
|
1129
1133
|
</label>
|
|
1130
1134
|
<div class="field" part="field input">
|
|
1131
|
-
<span class="icon" part="icon">${
|
|
1135
|
+
<span class="icon" part="icon">${ft}</span>
|
|
1132
1136
|
<input class="input" id="${this._inputId}" part="input" readonly />
|
|
1133
1137
|
<span class="icon" part="icon">${B}</span>
|
|
1134
|
-
<button type="button" class="btn" part="clear" data-action="clear">${
|
|
1135
|
-
<button type="button" class="btn" part="toggle" data-action="toggle">${
|
|
1138
|
+
<button type="button" class="btn" part="clear" data-action="clear">${gt}</button>
|
|
1139
|
+
<button type="button" class="btn" part="toggle" data-action="toggle">${bt}</button>
|
|
1136
1140
|
</div>
|
|
1137
1141
|
<div class="hint" id="${this._hintId}" part="hint"></div>
|
|
1138
1142
|
<div class="error" id="${this._errorId}" part="error" role="alert"></div>
|
|
@@ -1150,7 +1154,7 @@ class _t extends tt {
|
|
|
1150
1154
|
return !1;
|
|
1151
1155
|
}
|
|
1152
1156
|
}
|
|
1153
|
-
typeof customElements < "u" && !customElements.get("ui-date-range-time-picker") && customElements.define("ui-date-range-time-picker",
|
|
1157
|
+
typeof customElements < "u" && !customElements.get("ui-date-range-time-picker") && customElements.define("ui-date-range-time-picker", vt);
|
|
1154
1158
|
export {
|
|
1155
|
-
|
|
1159
|
+
vt as UIDateRangeTimePicker
|
|
1156
1160
|
};
|