@revolist/ui 4.0.4-rc → 4.0.4
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/MIGRATION.md +36 -0
- package/OWNERSHIP.md +36 -36
- package/README.md +65 -392
- package/_button.scss +6 -2
- package/_chunks/arrow-up-Cw8hW9vp.js +4 -0
- package/_chunks/calculator-CDWOuAcp.js +4 -0
- package/_chunks/{calendar-xpZ0v3xf.js → calendar-BQYQLu8Q.js} +23 -23
- package/_chunks/{cell-visuals-E-2oEKHg.js → cell-visuals-r6DOOhGh.js} +7 -7
- package/_chunks/chart-frame-GprenwEg.js +145 -0
- package/_chunks/{chevron-right-sxHQMSkq.js → check-BwI7iCAm.js} +2 -2
- package/_chunks/{chevron-left-D0nc4Z5S.js → chevron-right-CM3ljziP.js} +2 -2
- package/_chunks/choice-chips-C5OxD0GV.js +126 -0
- package/_chunks/{color-palette-D8vyPfld.js → color-palette-7siNch__.js} +22 -24
- package/_chunks/color-picker-Cfc9eqZb.js +143 -0
- package/_chunks/{component-C_T2VN5u.js → component-C3k_8uIq.js} +290 -275
- package/_chunks/{component-metadata-BMOOmqx5.js → component-metadata-DlVkpW3h.js} +1 -9
- package/_chunks/configurator-actions-vRnI54mO.js +155 -0
- package/_chunks/configurator-field-icon-CmcM_sPs.js +53 -0
- package/_chunks/control-BRfF5DWQ.js +118 -0
- package/_chunks/{controller-hRBm_Lfz.js → controller-BbiQuRt-.js} +5 -5
- package/_chunks/controls-B3EgM_DS.js +650 -0
- package/_chunks/{date-control-DrVFX13g.js → date-control-87dcA5br.js} +5 -5
- package/_chunks/{date-time-qIhp5vaX.js → date-time-CfiFYodx.js} +332 -293
- package/_chunks/{delete-button-CW9vjLnk.js → delete-button-jneO24wa.js} +1 -1
- package/_chunks/dialog.parts-NqEEVc9P.js +131 -0
- package/_chunks/{duration-CL68Em0o.js → duration-BGZ_qJ99.js} +10 -10
- package/_chunks/{editor-commit-Bq3wSgvr.js → editor-commit-Dyo-FMgD.js} +1 -1
- package/_chunks/editor-popup-NNP9Fh9U.js +82 -0
- package/_chunks/field-configurator-DPulsY3l.js +288 -0
- package/_chunks/{field-context-D57PnBbH.js → field-context-C4_WrO2z.js} +1 -1
- package/_chunks/{framework-mount--RTLIqE-.js → framework-mount-D4I8HpVp.js} +2 -2
- package/_chunks/icon-toolbar-BAAdEvr9.js +134 -0
- package/_chunks/{icons-Ci5mADVc.js → icons-B4qN13Yj.js} +1 -1
- package/_chunks/{iso-B0YHBK7m.js → iso-CJQl2kmq.js} +1 -1
- package/_chunks/magnifying-glass-CvrTDSkB.js +4 -0
- package/_chunks/minus-BOAR3A1C.js +4 -0
- package/_chunks/{model-mPO2tG2f.js → model-CFrBgRHm.js} +3 -3
- package/_chunks/mount-C8CnIW9k.js +267 -0
- package/_chunks/{native.view-ByyZ1CT5.js → native-CJm3eq3-.js} +1 -1
- package/_chunks/native-control-um1L1wgZ.js +649 -0
- package/_chunks/{number-input-BKwA5FnM.js → number-input-CKiA4d1N.js} +9 -9
- package/_chunks/{picker-h1P5RUgp.js → picker-igNshTRC.js} +5 -5
- package/_chunks/plus-CbGRkIGl.js +4 -0
- package/_chunks/{popup-CT2uD3go.js → popup-DECYM9FI.js} +116 -105
- package/_chunks/{rating-choice-DZgmaic0.js → rating-choice-CepVfGUq.js} +2 -2
- package/_chunks/{render-m5eMMwFR.js → render-bTk3curw.js} +2 -2
- package/_chunks/{reorder-list-CSlqAGHw.js → reorder-list-B4w3aARt.js} +2 -2
- package/_chunks/request-trail-B1zVRPEf.js +762 -0
- package/_chunks/rich-text-Ci4d6dHn.js +842 -0
- package/_chunks/rotate-left-BF6G883o.js +4 -0
- package/_chunks/selection-list-tooltips-m00U3L6z.js +42 -0
- package/_chunks/title-tooltip-ncldbUwS.js +11 -0
- package/_chunks/tooltip-h-Z8yFBY.js +54 -0
- package/_chunks/tooltip-owner-BYho-vJl.js +19 -0
- package/_chunks/tooltip-session-CBtRMBPr.js +110 -0
- package/_chunks/tooltip-text-BN5WdGHn.js +12 -0
- package/_chunks/top-layer-popup-CKJ7VJOF.js +59 -0
- package/_dialog.scss +57 -22
- package/_form.scss +71 -21
- package/_legend.scss +25 -7
- package/_variables.scss +34 -32
- package/_view-switcher.scss +6 -0
- package/activity-message.d.ts +1 -1
- package/activity-message.js +1 -1
- package/ai/_chat.scss +35 -3
- package/ai/_style.scss +76 -16
- package/ai/chat.d.ts +3 -1
- package/ai/components.d.ts +16 -3
- package/ai/index.d.ts +1 -0
- package/ai/index.js +3 -3
- package/ai/mount.d.ts +30 -6
- package/ai/request-trail.d.ts +9 -3
- package/ai/results/_style.scss +83 -0
- package/ai/results/index.d.ts +11 -0
- package/ai/results/metrics.d.ts +5 -0
- package/ai/results/table.d.ts +5 -0
- package/ai/results/text.d.ts +5 -0
- package/ai/results/types.d.ts +29 -0
- package/ai/transcript.d.ts +2 -0
- package/ai/translations.d.ts +1 -1
- package/angular/angular.d.ts +1 -1
- package/angular/angular.js +13 -7
- package/assignee/assignee.scss +28 -6
- package/assignee/index.js +6 -6
- package/avatar/avatar.style.scss +23 -6
- package/avatar/index.d.ts +25 -2
- package/avatar/index.js +33 -32
- package/badge.d.ts +1 -1
- package/badge.js +1 -1
- package/badge.view.d.ts +8 -0
- package/brush-range/_brush-range.scss +55 -49
- package/brush-range/component.d.ts +1 -3
- package/brush-range/component.js +28 -28
- package/buttons/delete-button.js +1 -1
- package/buttons/delete-button.style.scss +6 -2
- package/buttons/remove-button.d.ts +1 -1
- package/buttons/remove-button.js +2 -2
- package/buttons/remove-button.style.scss +1 -1
- package/buttons/svg-button.d.ts +1 -1
- package/buttons/svg-button.js +17 -17
- package/calendar/_calendar.scss +21 -25
- package/calendar/calendar.js +1 -1
- package/calendar/day.js +2 -2
- package/calendar/header.js +2 -3
- package/calendar/index.js +3 -3
- package/calendar/model.js +1 -1
- package/calendar/month-grid.js +2 -2
- package/calendar/translations.js +1 -1
- package/calendar/year-grid.js +2 -2
- package/cell-input.js +1 -1
- package/cell-input.scss +3 -7
- package/cell-visuals/badge.style.scss +6 -3
- package/cell-visuals/bar-chart.style.scss +2 -1
- package/cell-visuals/column-type.style.css +12 -0
- package/cell-visuals/index.js +1 -1
- package/cell-visuals/progress-line-value.renderer.style.scss +4 -2
- package/cell-visuals/progress-line.style.scss +1 -4
- package/cell-visuals/sparkline.style.scss +2 -1
- package/cell-visuals/timeline.style.css +4 -2
- package/checkbox/checkbox.scss +6 -24
- package/checkbox/index.js +1 -1
- package/choice-chips/index.d.ts +3 -1
- package/choice-chips/index.js +1 -1
- package/color-palette/built-in-palettes.js +1 -1
- package/color-palette/chart-palettes.js +1 -1
- package/color-palette/color-palette.js +1 -1
- package/color-palette/color-palette.style.scss +88 -25
- package/color-palette/color-picker.constants.js +1 -1
- package/color-palette/color-picker.js +2 -2
- package/color-palette/color-picker.style.scss +23 -10
- package/color-palette/common-palettes.d.ts +1 -1
- package/color-palette/common-palettes.js +2 -2
- package/color-palette/gantt-palettes.js +1 -1
- package/color-palette/native.d.ts +15 -2
- package/color-palette/palette.js +1 -1
- package/color-palette/pivot-palettes.js +1 -1
- package/color-palette/platform-palettes.js +1 -1
- package/color-palette/pro-palettes.js +1 -1
- package/color-palette/scheduler-palettes.js +1 -1
- package/component-catalog.d.ts +9 -7
- package/configurator-actions.d.ts +67 -0
- package/configurator-actions.js +1 -0
- package/configurator-aggregation-list.d.ts +14 -0
- package/configurator-aggregation-list.js +63 -0
- package/configurator-drop-zone.d.ts +39 -0
- package/configurator-drop-zone.js +66 -0
- package/configurator-field-icon.d.ts +10 -0
- package/configurator-field-icon.js +1 -0
- package/configurator-focus.d.ts +4 -0
- package/configurator-focus.js +39 -0
- package/configurator-sections.d.ts +42 -0
- package/configurator-sections.js +71 -0
- package/control-attributes.js +1 -1
- package/control-presentation.d.ts +8 -2
- package/control-presentation.js +25 -20
- package/controls.d.ts +12 -2
- package/controls.js +4 -3
- package/core/anchored-popover.js +1 -1
- package/core/control-id.js +1 -1
- package/core/editor-popup-position.d.ts +6 -2
- package/core/editor-popup.d.ts +4 -0
- package/core/editor-popup.js +1 -1
- package/core/motion.js +1 -1
- package/core/popover-controller.d.ts +35 -0
- package/core/popover-controller.js +102 -0
- package/core/popup-ownership.d.ts +2 -0
- package/core/selection-list-tooltips.d.ts +2 -0
- package/core/title-tooltip.d.ts +2 -0
- package/core/tooltip-session.d.ts +29 -0
- package/core/tooltip-surface.d.ts +13 -0
- package/core/tooltip-text.d.ts +6 -0
- package/core/tooltip.d.ts +35 -0
- package/core/top-layer-popup.d.ts +4 -0
- package/core/top-layer-popup.js +1 -23
- package/date-time/attach.d.ts +1 -1
- package/date-time/date-control.d.ts +1 -1
- package/date-time/field.d.ts +4 -2
- package/date-time/index.js +1 -1
- package/date-time/style.scss +239 -36
- package/date-time/time-selection.d.ts +3 -1
- package/date-time/types.d.ts +5 -1
- package/dialog/dialog-action-footer.d.ts +17 -2
- package/dialog/dialog.dom.d.ts +15 -2
- package/dialog/dialog.dom.js +9 -9
- package/dialog/dialog.drag.js +1 -1
- package/dialog/dialog.parts.d.ts +1 -1
- package/dialog/dialog.parts.js +1 -1
- package/dialog/dialog.preact.js +1 -1
- package/distribution-chart/_distribution-chart.scss +113 -77
- package/distribution-chart/area-chart.js +2 -2
- package/distribution-chart/bar-chart.js +2 -2
- package/distribution-chart/chart-frame.d.ts +1 -1
- package/distribution-chart/index.d.ts +1 -1
- package/distribution-chart/index.js +1 -1
- package/distribution-chart/line-chart.js +2 -2
- package/dropdown/content.js +1 -1
- package/dropdown/control.js +1 -1
- package/dropdown/dropdown.service.js +1 -1
- package/dropdown/dropdown.types.d.ts +1 -1
- package/dropdown/editor-dropdown.style.scss +19 -9
- package/dropdown/index.js +2 -2
- package/dropdown/lookup-field.d.ts +5 -0
- package/dropdown/lookup-field.js +4 -3
- package/dropdown/popup.d.ts +2 -2
- package/dropdown/popup.js +1 -1
- package/duration/index.js +1 -1
- package/editor-actions.js +2 -2
- package/editor-layout/index.d.ts +4 -4
- package/editor-layout/index.js +40 -35
- package/editor-layout/style.scss +82 -18
- package/favicon.svg +9 -0
- package/field-configurator.d.ts +39 -1
- package/field-configurator.js +4 -170
- package/field-expansion.d.ts +9 -0
- package/field-reorder.hook.js +1 -1
- package/field-reorder.js +1 -1
- package/filter/filters/slider/_single-slider.scss +57 -38
- package/filter/filters/slider/_slider.scss +41 -33
- package/filter/filters/slider/component.js +1 -1
- package/filter/filters/slider/control.js +3 -1
- package/filter/filters/slider/inputs.js +1 -1
- package/filter/filters/slider/logic.js +1 -1
- package/filter/filters/slider/preact.js +1 -1
- package/filter/filters/slider/runtime.js +50 -23
- package/filter/filters/slider/single.js +2 -2
- package/filter-badge.js +2 -2
- package/filter-controls.d.ts +0 -1
- package/filter-controls.js +6 -7
- package/form-controls/index.d.ts +10 -2
- package/form-controls/index.js +7 -7
- package/form-controls/presentation.d.ts +1 -1
- package/form-controls/presentation.js +13 -13
- package/formatting/index.d.ts +1 -1
- package/formatting/index.js +26 -25
- package/formatting/styles.scss +14 -57
- package/framework.js +228 -225
- package/history-controls.js +27 -1
- package/html-controls.js +1 -1
- package/icon-toolbar.d.ts +62 -0
- package/icon-toolbar.js +1 -0
- package/icons/icon.d.ts +1 -1
- package/icons/icon.js +1 -1
- package/legend.d.ts +1 -1
- package/legend.js +1 -1
- package/masked-input/index.js +4 -4
- package/native-control.d.ts +1 -2
- package/native-control.js +1 -1
- package/native-controls.d.ts +54 -2
- package/native-styles.css +1 -1
- package/native-styles.scss +6 -2
- package/native.d.ts +3 -3
- package/native.js +48 -45
- package/number-input/index.d.ts +1 -1
- package/number-input/index.js +1 -1
- package/package.json +84 -1
- package/pagination.js +12 -12
- package/pdf-viewer/controller.js +1 -1
- package/pdf-viewer/header.d.ts +1 -1
- package/pdf-viewer/index.d.ts +2 -2
- package/pdf-viewer/index.js +3 -3
- package/pdf-viewer/search-bar.d.ts +1 -1
- package/pdf-viewer/status.d.ts +1 -1
- package/pdf-viewer/style.scss +203 -42
- package/pickers.d.ts +5 -1
- package/preact-mount.js +1 -1
- package/preact.d.ts +13 -10
- package/preact.js +109 -64
- package/progress/_bar.scss +9 -3
- package/progress/_circular.scss +2 -1
- package/progress/bar.js +1 -1
- package/progress/circular.js +1 -1
- package/progress/range.js +1 -1
- package/rating-choice.js +1 -1
- package/react-adapter.d.ts +4 -2
- package/react-control.d.ts +2 -0
- package/react-control.js +3 -3
- package/react.d.ts +7 -8
- package/react.js +69 -68
- package/reorder-list.d.ts +1 -1
- package/reorder-list.js +1 -1
- package/reorder-list.scss +59 -17
- package/resource-picker/resource-picker-avatar.js +1 -1
- package/resource-picker/resource-picker-option.js +1 -1
- package/resource-picker/resource-picker-popup.js +2 -2
- package/resource-picker/resource-picker.js +75 -73
- package/resource-picker/resource-picker.scss +62 -34
- package/resource-picker/resource-picker.utils.js +1 -1
- package/rich-text/engine.d.ts +1 -0
- package/rich-text/format-html.d.ts +2 -0
- package/rich-text/index.d.ts +4 -0
- package/rich-text/index.js +1 -1
- package/rich-text/model.d.ts +2 -0
- package/rich-text/style.scss +293 -44
- package/rich-text/syntax.d.ts +5 -0
- package/rich-text/toolbar.d.ts +1 -1
- package/rich-text/translations.d.ts +2 -0
- package/robots.txt +4 -0
- package/search-input/index.js +2 -2
- package/search-input/native.d.ts +21 -2
- package/segmented-switch/index.js +1 -1
- package/select.d.ts +3 -1
- package/select.js +1 -1
- package/selection-list.d.ts +1 -0
- package/selection-list.js +3 -1
- package/status-feedback/badge.js +2 -2
- package/status-feedback/exit-snapshot.js +5 -5
- package/status-feedback/header.js +2 -2
- package/status-feedback/icons.js +1 -1
- package/status-feedback/index.js +1 -1
- package/status-feedback/item.js +2 -2
- package/status-feedback/motion.js +1 -1
- package/status-feedback/placement.js +1 -1
- package/status-feedback/popover.js +5 -5
- package/status-feedback/render.js +1 -1
- package/status-feedback/status-feedback.scss +124 -35
- package/styles/_activity-message.scss +24 -7
- package/styles/_alert.scss +78 -17
- package/styles/_cell-editor-frame.scss +11 -0
- package/styles/_compositions.scss +400 -80
- package/styles/_control.scss +30 -8
- package/styles/_disclosure.scss +15 -5
- package/styles/_editor-counter.scss +16 -6
- package/styles/_editor-slider.scss +8 -4
- package/styles/_field-configurator.scss +321 -23
- package/styles/_fields-grid.scss +49 -0
- package/styles/_filter-controls.scss +10 -2
- package/styles/_icon-action.scss +48 -15
- package/styles/_loading.scss +12 -3
- package/styles/_motion.scss +32 -9
- package/styles/_palette.scss +0 -24
- package/styles/_primitives.scss +369 -110
- package/styles/_theme.scss +130 -86
- package/styles/_thresholds.scss +28 -25
- package/styles/_time-grid.scss +8 -3
- package/styles/_tokens.scss +6 -1
- package/styles/color-roles.js +1 -1
- package/styles/configurator-actions.scss +241 -0
- package/styles/pagination.css +213 -0
- package/styles/{legacy-rating.css → rating.css} +8 -3
- package/styles.css +1 -1
- package/styles.scss +3 -5
- package/surfaces.d.ts +38 -2
- package/surfaces.js +37 -134
- package/svelte/UiComponent.svelte +44 -11
- package/svelte-control.js +1 -1
- package/svelte.d.ts +1 -1
- package/svelte.js +5 -5
- package/switch/index.js +16 -15
- package/time-grid.d.ts +0 -1
- package/time-grid.js +39 -38
- package/timeline-track/_style.scss +96 -24
- package/timeline-track/index.js +3 -3
- package/timeline-track/model.js +1 -1
- package/ui.css +1 -1
- package/view-switcher.d.ts +23 -0
- package/vue-badge.js +1 -1
- package/vue-control.js +1 -1
- package/vue-segmented-switch.js +1 -1
- package/vue.d.ts +29 -32
- package/vue.js +118 -123
- package/_chunks/chart-frame-Cmc7xU1i.js +0 -130
- package/_chunks/choice-chips-CHQTUdLs.js +0 -110
- package/_chunks/color-picker-CudqPYZo.js +0 -138
- package/_chunks/control-AHKXD5Eu.js +0 -93
- package/_chunks/control-tooltip-uscKfAnV.js +0 -100
- package/_chunks/controls-DsNi8V8I.js +0 -630
- package/_chunks/dialog.parts-CKGkC5zP.js +0 -134
- package/_chunks/editor-popup-WDdtVDNA.js +0 -81
- package/_chunks/history-controls-B3u3INEK.js +0 -27
- package/_chunks/mount-DQ1cpppK.js +0 -257
- package/_chunks/native-control-C_yok8_-.js +0 -605
- package/_chunks/request-trail-DSlFix6i.js +0 -618
- package/_chunks/rich-text-CH7gIqOS.js +0 -636
- package/_shared/data-query/binding.d.ts +0 -30
- package/_shared/data-query/blocks.d.ts +0 -30
- package/_shared/data-query/commands.d.ts +0 -47
- package/_shared/data-query/contracts.d.ts +0 -106
- package/_shared/data-query/cursor-reader.d.ts +0 -25
- package/_shared/data-query/direct-binding.d.ts +0 -3
- package/_shared/data-query/index.d.ts +0 -23
- package/_shared/data-query/infinite-binding.d.ts +0 -18
- package/_shared/data-query/keys.d.ts +0 -9
- package/_shared/data-query/limiter.d.ts +0 -12
- package/_shared/data-query/load-options.d.ts +0 -25
- package/_shared/data-query/materialize.d.ts +0 -2
- package/_shared/data-query/policy.d.ts +0 -14
- package/_shared/data-query/provider-queries.d.ts +0 -22
- package/_shared/data-query/reader.d.ts +0 -23
- package/_shared/data-query/remote-load.d.ts +0 -7
- package/_shared/data-query/source.d.ts +0 -40
- package/avatar/index.view.d.ts +0 -25
- package/color-palette/native.view.d.ts +0 -15
- package/control-presentation.view.d.ts +0 -8
- package/dialog/dialog-action-footer.view.d.ts +0 -20
- package/dialog/dialog.dom.view.d.ts +0 -15
- package/form-controls/index.view.d.ts +0 -10
- package/formatting/control-tooltip.d.ts +0 -27
- package/native-controls.view.d.ts +0 -54
- package/search-input/native.view.d.ts +0 -21
- package/styles/legacy-pagination.css +0 -112
- package/surfaces.view.d.ts +0 -63
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
import { i as e } from "./preact.module-BBM36DnO.js";
|
|
2
|
-
import {
|
|
2
|
+
import { a as t, i as n, n as r, r as i, t as a } from "./hooks.module-CG3gN83z.js";
|
|
3
3
|
import { t as o } from "./jsxRuntime.module-F6UFnpT-.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
4
|
+
import { createPreactElement as s, releasePreactElement as c } from "../preact-mount.js";
|
|
5
|
+
import { createControlId as l } from "../core/control-id.js";
|
|
6
|
+
import { SvgIcon as u } from "../icons/icon.js";
|
|
7
|
+
import { n as d } from "./native-control-um1L1wgZ.js";
|
|
8
|
+
import "./chevron-down-GbplLa6s.js";
|
|
9
|
+
import { R as f, t as p } from "./controls-B3EgM_DS.js";
|
|
9
10
|
import { EditorList as m, EditorListItem as h } from "../editor-layout/index.js";
|
|
10
11
|
import { t as g } from "./clock-BOhPNlW3.js";
|
|
11
|
-
import { i as _, s as v } from "./iso-
|
|
12
|
-
import { f as y, h as b, m as x, p as S } from "./model-
|
|
13
|
-
import { n as C, t as w } from "./date-control-
|
|
14
|
-
import { t as T } from "./picker-
|
|
15
|
-
import { t as E } from "./editor-popup-
|
|
16
|
-
import { n as D } from "./editor-commit-
|
|
12
|
+
import { i as _, s as v } from "./iso-CJQl2kmq.js";
|
|
13
|
+
import { f as y, h as b, m as x, p as S } from "./model-CFrBgRHm.js";
|
|
14
|
+
import { n as C, t as w } from "./date-control-87dcA5br.js";
|
|
15
|
+
import { t as T } from "./picker-igNshTRC.js";
|
|
16
|
+
import { t as E } from "./editor-popup-NNP9Fh9U.js";
|
|
17
|
+
import { n as D } from "./editor-commit-Dyo-FMgD.js";
|
|
17
18
|
import { EditorActions as O } from "../editor-actions.js";
|
|
18
|
-
//#region
|
|
19
|
+
//#region internal/dates/src/date-controls.ts
|
|
19
20
|
var k = /^(\d{4})-(\d{2})-(\d{2})$/, A = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{1,3}))?)?$/, j = /^(\d{2}):(\d{2})(?::(\d{2}))?$/;
|
|
20
21
|
function M(e, t, n = "minute") {
|
|
21
22
|
if (Number.isNaN(t.getTime())) return "";
|
|
@@ -42,7 +43,7 @@ function P(e) {
|
|
|
42
43
|
return String(e).padStart(2, "0");
|
|
43
44
|
}
|
|
44
45
|
//#endregion
|
|
45
|
-
//#region
|
|
46
|
+
//#region internal/dates/src/civil-time.ts
|
|
46
47
|
var F = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(?::(\d{2}))?$/;
|
|
47
48
|
function I(e) {
|
|
48
49
|
let t = /* @__PURE__ */ new Date(0);
|
|
@@ -69,7 +70,7 @@ function L(e) {
|
|
|
69
70
|
return Object.keys(n).every((e) => n[e] === i[e]) ? n : void 0;
|
|
70
71
|
}
|
|
71
72
|
//#endregion
|
|
72
|
-
//#region
|
|
73
|
+
//#region internal/dates/src/temporal-controls.ts
|
|
73
74
|
function R(e) {
|
|
74
75
|
return e.split("T")[0];
|
|
75
76
|
}
|
|
@@ -82,20 +83,20 @@ function B(e, t, n) {
|
|
|
82
83
|
function V(e, t, n) {
|
|
83
84
|
return n === "datetime" ? `${R(e)}T${t}` : t;
|
|
84
85
|
}
|
|
85
|
-
function
|
|
86
|
+
function ee(e, t) {
|
|
86
87
|
return e === "date" ? v(t) : e === "datetime" ? !!L(t.replace(/(\d{2}:\d{2}:\d{2})\.\d{1,3}$/, "$1")) : !!N(e, t);
|
|
87
88
|
}
|
|
88
|
-
function
|
|
89
|
+
function H(e) {
|
|
89
90
|
let t = N("time", e);
|
|
90
91
|
return t ? t.getHours() * 3600 + t.getMinutes() * 60 + t.getSeconds() : void 0;
|
|
91
92
|
}
|
|
92
|
-
function
|
|
93
|
-
let n =
|
|
93
|
+
function U(e, t) {
|
|
94
|
+
let n = H(e);
|
|
94
95
|
if (n === void 0) return !1;
|
|
95
|
-
let r = t.min ?
|
|
96
|
+
let r = t.min ? H(t.min) : void 0, i = t.max ? H(t.max) : void 0;
|
|
96
97
|
return (r === void 0 || n >= r) && (i === void 0 || n <= i) && (t.step === void 0 || t.step > 0 && (n - (r ?? 0)) % t.step === 0);
|
|
97
98
|
}
|
|
98
|
-
function
|
|
99
|
+
function W(e, t, n = "minute", r) {
|
|
99
100
|
let i = N("time", e);
|
|
100
101
|
return i ? new Intl.DateTimeFormat(r ?? (t === "12h" ? "en-US" : "en-GB"), {
|
|
101
102
|
hour: "2-digit",
|
|
@@ -104,7 +105,7 @@ function G(e, t, n = "minute", r) {
|
|
|
104
105
|
hourCycle: t === "12h" ? "h12" : "h23"
|
|
105
106
|
}).format(i) : e;
|
|
106
107
|
}
|
|
107
|
-
function
|
|
108
|
+
function G(e, t = "minute", n) {
|
|
108
109
|
if (e = e.replace(/[\u200e\u200f\u061c]/g, "").trim(), n) {
|
|
109
110
|
let t = new Intl.NumberFormat(n, { useGrouping: !1 });
|
|
110
111
|
for (let n = 0; n < 10; n++) e = e.split(t.format(n)).join(String(n));
|
|
@@ -135,19 +136,19 @@ function K(e, t = "minute", n) {
|
|
|
135
136
|
return o ? M("time", o, t) : void 0;
|
|
136
137
|
}
|
|
137
138
|
//#endregion
|
|
138
|
-
//#region
|
|
139
|
-
function
|
|
140
|
-
let t = e.min ?
|
|
139
|
+
//#region internal/dates/src/time-selection.ts
|
|
140
|
+
function K(e) {
|
|
141
|
+
let t = e.min ? H(e.min) : void 0, n = e.max ? H(e.max) : void 0, r = e.step ?? (e.precision === "second" ? 1 : 60);
|
|
141
142
|
if (!Number.isFinite(r) || r <= 0) return [];
|
|
142
143
|
let i = e.precision === "second" ? 1 : 60, a = [];
|
|
143
144
|
for (let e = 0; e < 86400; e += i) (t === void 0 || e >= t) && (n === void 0 || e <= n) && (e - (t ?? 0)) % r === 0 && a.push(e);
|
|
144
145
|
return a;
|
|
145
146
|
}
|
|
146
|
-
function
|
|
147
|
+
function q(e, t = "minute") {
|
|
147
148
|
let n = (e) => String(e).padStart(2, "0");
|
|
148
149
|
return `${n(Math.floor(e / 3600))}:${n(Math.floor(e / 60) % 60)}${t === "second" ? `:${n(e % 60)}` : ""}`;
|
|
149
150
|
}
|
|
150
|
-
function
|
|
151
|
+
function J(e, t) {
|
|
151
152
|
return e === "12h" || e === "locale" && !!new Intl.DateTimeFormat(t, { hour: "numeric" }).resolvedOptions().hour12;
|
|
152
153
|
}
|
|
153
154
|
function te(e, t) {
|
|
@@ -157,7 +158,7 @@ function te(e, t) {
|
|
|
157
158
|
}).formatToParts(new Date(2e3, 0, 1, e ? 13 : 1)).find((e) => e.type === "dayPeriod")?.value ?? (e ? "PM" : "AM");
|
|
158
159
|
}
|
|
159
160
|
function ne(e, t, n) {
|
|
160
|
-
let r =
|
|
161
|
+
let r = H(t), i = r ?? e[0] ?? 0, a = Math.floor(i / 3600), o = Math.floor(i / 60) % 60, s = i % 60, c = {
|
|
161
162
|
hour: /* @__PURE__ */ new Map(),
|
|
162
163
|
minute: /* @__PURE__ */ new Map(),
|
|
163
164
|
second: /* @__PURE__ */ new Map(),
|
|
@@ -182,7 +183,7 @@ function ne(e, t, n) {
|
|
|
182
183
|
};
|
|
183
184
|
}
|
|
184
185
|
//#endregion
|
|
185
|
-
//#region
|
|
186
|
+
//#region package/date-time/types.ts
|
|
186
187
|
var Y = {
|
|
187
188
|
date: "Date",
|
|
188
189
|
dates: "Dates",
|
|
@@ -207,15 +208,15 @@ var Y = {
|
|
|
207
208
|
chooseTime: "Choose time"
|
|
208
209
|
};
|
|
209
210
|
function X(e, t) {
|
|
210
|
-
return (e === "time" ? t?.chooseTime
|
|
211
|
+
return (e === "time" ? t?.chooseTime : t?.chooseDate) ?? (e === "time" ? Y.chooseTime : Y.chooseDate);
|
|
211
212
|
}
|
|
212
213
|
//#endregion
|
|
213
|
-
//#region
|
|
214
|
-
function
|
|
214
|
+
//#region package/date-time/validation.ts
|
|
215
|
+
function re(e, t, n = "") {
|
|
215
216
|
let { kind: r = "date", selection: i = "single", value: a, calendar: o = {} } = e, s = {
|
|
216
217
|
...Y,
|
|
217
218
|
...e.text
|
|
218
|
-
}, c = a && !Array.isArray(a) && typeof a == "object" ? a : void 0, l = typeof a == "string" ? a : "", u = c?.from ?? "", d = c?.to ?? "", f = e.required ?? o.required ?? !1, p = c ? [u, d] : Array.isArray(a) ? a : l ? [l] : [], m = (e) => v(e) && (!o.minDate || e >= o.minDate) && (!o.maxDate || e <= o.maxDate) && !o.isDateDisabled?.(e) && !o.isMonthDisabled?.(y(e, o.calendarSystem)), h = (t) =>
|
|
219
|
+
}, c = a && !Array.isArray(a) && typeof a == "object" ? a : void 0, l = typeof a == "string" ? a : "", u = c?.from ?? "", d = c?.to ?? "", f = e.required ?? o.required ?? !1, p = c ? [u, d] : Array.isArray(a) ? a : l ? [l] : [], m = (e) => v(e) && (!o.minDate || e >= o.minDate) && (!o.maxDate || e <= o.maxDate) && !o.isDateDisabled?.(e) && !o.isMonthDisabled?.(y(e, o.calendarSystem)), h = (t) => ee(r, t) && (r === "time" || m(R(t))) && (r === "date" || U(z(t), {
|
|
219
220
|
min: e.minTime,
|
|
220
221
|
max: e.maxTime,
|
|
221
222
|
step: e.timeStep
|
|
@@ -248,27 +249,27 @@ function Z(e, t, n = "") {
|
|
|
248
249
|
};
|
|
249
250
|
}
|
|
250
251
|
//#endregion
|
|
251
|
-
//#region
|
|
252
|
-
function
|
|
252
|
+
//#region package/date-time/time-control.tsx
|
|
253
|
+
function ie({ value: e, label: t, format: r = "locale", precision: i = "minute", locale: a, min: s, max: c, step: l, onChange: u }) {
|
|
253
254
|
let [f, p] = n(!1), [m, h] = n("");
|
|
254
|
-
if (r === "locale") return /* @__PURE__ */ o(
|
|
255
|
+
if (r === "locale") return /* @__PURE__ */ o(d, {
|
|
255
256
|
type: "time",
|
|
256
257
|
"aria-label": t,
|
|
257
258
|
value: e,
|
|
258
259
|
min: s,
|
|
259
|
-
max:
|
|
260
|
-
step:
|
|
261
|
-
onInput: (e) =>
|
|
260
|
+
max: c,
|
|
261
|
+
step: l ?? (i === "second" ? 1 : 60),
|
|
262
|
+
onInput: (e) => u(e.currentTarget.value)
|
|
262
263
|
});
|
|
263
|
-
let g =
|
|
264
|
-
return /* @__PURE__ */ o(
|
|
264
|
+
let g = W(e, r, i, a);
|
|
265
|
+
return /* @__PURE__ */ o(d, {
|
|
265
266
|
type: "text",
|
|
266
267
|
"aria-label": t,
|
|
267
268
|
value: f ? m : g,
|
|
268
|
-
"aria-invalid": !!e && !
|
|
269
|
+
"aria-invalid": !!e && !U(e, {
|
|
269
270
|
min: s,
|
|
270
|
-
max:
|
|
271
|
-
step:
|
|
271
|
+
max: c,
|
|
272
|
+
step: l
|
|
272
273
|
}),
|
|
273
274
|
placeholder: r === "12h" ? "09:00 AM" : "09:00",
|
|
274
275
|
onFocus: () => {
|
|
@@ -277,13 +278,13 @@ function re({ value: e, label: t, format: r = "locale", precision: i = "minute",
|
|
|
277
278
|
onBlur: () => p(!1),
|
|
278
279
|
onInput: (e) => {
|
|
279
280
|
let t = e.currentTarget.value;
|
|
280
|
-
h(t),
|
|
281
|
+
h(t), u(t ? G(t, i, a) ?? t : "");
|
|
281
282
|
}
|
|
282
283
|
});
|
|
283
284
|
}
|
|
284
285
|
//#endregion
|
|
285
|
-
//#region
|
|
286
|
-
function
|
|
286
|
+
//#region package/date-time/time-selection.tsx
|
|
287
|
+
function ae({ label: e, accessibleLabel: t, values: n, selected: r, choices: s, display: c, onSelect: l }) {
|
|
287
288
|
let u = a(null), d = r !== void 0 && s.has(r), f = d ? r : n.find((e) => s.has(e));
|
|
288
289
|
i(() => {
|
|
289
290
|
let e = u.current;
|
|
@@ -302,7 +303,7 @@ function ie({ label: e, accessibleLabel: t, values: n, selected: r, choices: s,
|
|
|
302
303
|
};
|
|
303
304
|
return /* @__PURE__ */ o("div", {
|
|
304
305
|
class: "rv-time-selection__column",
|
|
305
|
-
children: [/* @__PURE__ */ o("span", {
|
|
306
|
+
children: [e && /* @__PURE__ */ o("span", {
|
|
306
307
|
class: "rv-time-selection__label",
|
|
307
308
|
children: e
|
|
308
309
|
}), /* @__PURE__ */ o(m, {
|
|
@@ -322,398 +323,432 @@ function ie({ label: e, accessibleLabel: t, values: n, selected: r, choices: s,
|
|
|
322
323
|
})]
|
|
323
324
|
});
|
|
324
325
|
}
|
|
325
|
-
function
|
|
326
|
-
let
|
|
327
|
-
min:
|
|
328
|
-
max:
|
|
329
|
-
step:
|
|
330
|
-
precision:
|
|
326
|
+
function Z({ value: e, label: i, text: a, onChange: s, format: c = "locale", precision: l = "minute", locale: d, min: f, max: m, step: h, collapsible: g = !1 }) {
|
|
327
|
+
let [_, v] = n(!1), y = t(), b = J(c, d), x = r(() => K({
|
|
328
|
+
min: f,
|
|
329
|
+
max: m,
|
|
330
|
+
step: h,
|
|
331
|
+
precision: l
|
|
331
332
|
}), [
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
]),
|
|
337
|
-
|
|
333
|
+
f,
|
|
334
|
+
m,
|
|
335
|
+
h,
|
|
336
|
+
l
|
|
337
|
+
]), S = r(() => ne(x, e, b), [
|
|
338
|
+
x,
|
|
338
339
|
e,
|
|
339
|
-
|
|
340
|
-
]),
|
|
340
|
+
b
|
|
341
|
+
]), C = r(() => new Intl.NumberFormat(d, {
|
|
341
342
|
minimumIntegerDigits: 2,
|
|
342
343
|
useGrouping: !1
|
|
343
|
-
}), [
|
|
344
|
-
label:
|
|
345
|
-
accessibleLabel: `${
|
|
346
|
-
values:
|
|
347
|
-
selected:
|
|
348
|
-
choices:
|
|
349
|
-
display:
|
|
350
|
-
onSelect:
|
|
351
|
-
}),
|
|
344
|
+
}), [d]), w = (e) => s(q(e, l)), T = (e, t, n, r = (e) => C.format(e)) => /* @__PURE__ */ o(ae, {
|
|
345
|
+
label: e === "period" ? void 0 : t,
|
|
346
|
+
accessibleLabel: `${i}: ${t}`,
|
|
347
|
+
values: n,
|
|
348
|
+
selected: S.hasValue ? S[e] : void 0,
|
|
349
|
+
choices: S.columns[e],
|
|
350
|
+
display: r,
|
|
351
|
+
onSelect: w
|
|
352
|
+
}), E = (e, t = 0) => Array.from({ length: e }, (e, n) => t + n);
|
|
352
353
|
return /* @__PURE__ */ o("section", {
|
|
353
354
|
class: "rv-time-selection",
|
|
354
|
-
children: [
|
|
355
|
-
|
|
355
|
+
children: [/* @__PURE__ */ o("div", {
|
|
356
|
+
class: "rv-time-selection__entry-row",
|
|
357
|
+
children: [/* @__PURE__ */ o("label", {
|
|
356
358
|
class: "rv-time-selection__entry",
|
|
357
|
-
children: [/* @__PURE__ */ o("span", { children:
|
|
359
|
+
children: [/* @__PURE__ */ o("span", { children: i }), /* @__PURE__ */ o(ie, {
|
|
358
360
|
value: e,
|
|
359
|
-
label:
|
|
360
|
-
format:
|
|
361
|
-
precision:
|
|
362
|
-
locale:
|
|
363
|
-
min:
|
|
364
|
-
max:
|
|
365
|
-
step:
|
|
366
|
-
onChange:
|
|
361
|
+
label: i,
|
|
362
|
+
format: c,
|
|
363
|
+
precision: l,
|
|
364
|
+
locale: d,
|
|
365
|
+
min: f,
|
|
366
|
+
max: m,
|
|
367
|
+
step: h,
|
|
368
|
+
onChange: s
|
|
367
369
|
})]
|
|
368
|
-
}),
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
})
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
370
|
+
}), g && /* @__PURE__ */ o(p, {
|
|
371
|
+
variant: "ghost",
|
|
372
|
+
className: "rv-time-selection__toggle",
|
|
373
|
+
"aria-label": a.chooseTime ?? a.time,
|
|
374
|
+
"aria-expanded": _,
|
|
375
|
+
"aria-controls": _ ? y : void 0,
|
|
376
|
+
onClick: () => v(!_),
|
|
377
|
+
children: /* @__PURE__ */ o(u, { svg: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 448 512\"><!--! Font Awesome Free 7.3.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2026 Fonticons, Inc. --><path fill=\"currentColor\" d=\"M201.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L224 338.7 54.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z\"/></svg>" })
|
|
378
|
+
})]
|
|
379
|
+
}), (!g || _) && /* @__PURE__ */ o("div", {
|
|
380
|
+
id: y,
|
|
381
|
+
class: "rv-time-selection__clock",
|
|
382
|
+
children: [
|
|
383
|
+
/* @__PURE__ */ o("div", {
|
|
384
|
+
class: `rv-time-selection__columns${l === "second" ? " rv-time-selection__columns--seconds" : ""}`,
|
|
385
|
+
children: [
|
|
386
|
+
T("hour", a.hours, E(b ? 12 : 24, b ? S.period * 12 : 0), (e) => C.format(b ? e % 12 || 12 : e)),
|
|
387
|
+
T("minute", a.minutes, E(60)),
|
|
388
|
+
l === "second" && T("second", a.seconds, E(60))
|
|
389
|
+
]
|
|
390
|
+
}),
|
|
391
|
+
b && /* @__PURE__ */ o("div", {
|
|
392
|
+
class: "rv-time-selection__period",
|
|
393
|
+
children: T("period", a.dayPeriod, [0, 1], (e) => te(e, d))
|
|
394
|
+
}),
|
|
395
|
+
!x.length && /* @__PURE__ */ o("p", {
|
|
396
|
+
class: "rv-time-selection__empty",
|
|
397
|
+
role: "status",
|
|
398
|
+
children: a.noTimes
|
|
399
|
+
})
|
|
400
|
+
]
|
|
401
|
+
})]
|
|
387
402
|
});
|
|
388
403
|
}
|
|
389
404
|
//#endregion
|
|
390
|
-
//#region
|
|
391
|
-
function
|
|
392
|
-
let { kind:
|
|
405
|
+
//#region package/date-time/picker.tsx
|
|
406
|
+
function oe(t) {
|
|
407
|
+
let { kind: r = "date", selection: a = "single", value: s, onChange: c, calendar: u = {} } = t, d = (u.numberOfMonths ?? 1) >= 2, m = {
|
|
393
408
|
...Y,
|
|
394
|
-
...
|
|
395
|
-
}, [
|
|
396
|
-
locale:
|
|
397
|
-
...typeof
|
|
398
|
-
}, [
|
|
399
|
-
|
|
400
|
-
let H = (e) => {
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
H(e), i === "date" && a !== "multiple" && Z({
|
|
404
|
-
...r,
|
|
409
|
+
...t.text
|
|
410
|
+
}, [h] = n(() => l("rv-date-error")), g = (e) => r === "date" ? e : R(e), _ = {
|
|
411
|
+
locale: u.locale,
|
|
412
|
+
...typeof t.dateInput == "object" ? t.dateInput : {}
|
|
413
|
+
}, [x, S] = n(t.endpoint === "to" ? "to" : void 0), [C, E] = n(""), D = s && !Array.isArray(s) && typeof s == "object" ? s : void 0, O = typeof s == "string" ? s : "", k = Array.isArray(s) ? s : [], A = D?.from ?? "", j = D?.to ?? "", M = R(r === "time" ? b() : t.endpoint === "to" ? j : A || O || k[0] || ""), [N, P] = n(() => u.defaultMonth ?? y(v(M) ? M : b(), u.calendarSystem)), F = t.required ?? u.required ?? !1, { valid: I, errorMessage: L, validDate: ee } = re(t, N, C);
|
|
414
|
+
i(() => t.onValidityChange?.(!!I), [I]);
|
|
415
|
+
let H = (e, n = !1) => {
|
|
416
|
+
E(""), c(e), (t.onValidChange || n) && re({
|
|
417
|
+
...t,
|
|
405
418
|
value: e
|
|
406
|
-
},
|
|
419
|
+
}, N).valid && (t.onValidChange?.(e), n && t.onSelectionComplete?.(e));
|
|
420
|
+
}, U = (e) => {
|
|
421
|
+
H(e, r === "date" && a !== "multiple");
|
|
407
422
|
}, W = (e) => {
|
|
408
|
-
if (!
|
|
409
|
-
let t = y(e,
|
|
410
|
-
t !== (
|
|
423
|
+
if (!ee(e)) return;
|
|
424
|
+
let t = y(e, u.calendarSystem);
|
|
425
|
+
t !== (u.month ?? N) && (P(t), u.onMonthChange?.(t));
|
|
411
426
|
}, G = (e, t) => {
|
|
412
427
|
if (typeof t != "string") return;
|
|
413
428
|
W(t);
|
|
414
429
|
let n = {
|
|
415
|
-
from:
|
|
416
|
-
to:
|
|
417
|
-
[e]: t ? B(t, e === "from" ?
|
|
430
|
+
from: A,
|
|
431
|
+
to: j,
|
|
432
|
+
[e]: t ? B(t, e === "from" ? A : j, r) : ""
|
|
418
433
|
};
|
|
419
434
|
H(!n.from && !n.to ? null : n);
|
|
420
|
-
}, K = (e,
|
|
435
|
+
}, K = (e, n, r, i = !0) => /* @__PURE__ */ o("label", {
|
|
421
436
|
class: `rv-temporal-picker__time${i ? "" : " rv-temporal-picker__time--single"}`,
|
|
422
|
-
children: [i && /* @__PURE__ */ o("span", { children:
|
|
423
|
-
label:
|
|
437
|
+
children: [i && /* @__PURE__ */ o("span", { children: n }), /* @__PURE__ */ o(ie, {
|
|
438
|
+
label: n,
|
|
424
439
|
value: e ? z(e) : "",
|
|
425
|
-
min:
|
|
426
|
-
max:
|
|
427
|
-
step:
|
|
428
|
-
precision:
|
|
429
|
-
format:
|
|
430
|
-
locale:
|
|
431
|
-
onChange:
|
|
440
|
+
min: t.minTime,
|
|
441
|
+
max: t.maxTime,
|
|
442
|
+
step: t.timeStep,
|
|
443
|
+
precision: t.precision,
|
|
444
|
+
format: t.timeFormat,
|
|
445
|
+
locale: u.locale,
|
|
446
|
+
onChange: r
|
|
432
447
|
})]
|
|
433
448
|
}), q = {
|
|
434
|
-
...
|
|
435
|
-
month:
|
|
449
|
+
...u,
|
|
450
|
+
month: u.month ?? N,
|
|
436
451
|
onMonthChange: (e) => {
|
|
437
|
-
|
|
452
|
+
P(e), u.onMonthChange?.(e);
|
|
438
453
|
},
|
|
439
|
-
required:
|
|
454
|
+
required: F,
|
|
440
455
|
onInvalidSelection: (e, t) => {
|
|
441
|
-
|
|
456
|
+
E(e || m.invalid), u.onInvalidSelection?.(e, t);
|
|
442
457
|
}
|
|
443
458
|
}, J;
|
|
444
459
|
if (a === "multiple") J = {
|
|
445
460
|
...q,
|
|
446
461
|
mode: "multiple",
|
|
447
|
-
selected:
|
|
462
|
+
selected: k.filter(v),
|
|
448
463
|
onSelectionChange: (e) => U([...e])
|
|
449
464
|
};
|
|
450
|
-
else if (a === "range" && !
|
|
465
|
+
else if (a === "range" && !x) J = {
|
|
451
466
|
...q,
|
|
452
467
|
mode: "range",
|
|
453
|
-
selected:
|
|
454
|
-
from: R(
|
|
455
|
-
...
|
|
468
|
+
selected: A && v(R(A)) ? {
|
|
469
|
+
from: R(A),
|
|
470
|
+
...j && v(R(j)) ? { to: R(j) } : {}
|
|
456
471
|
} : void 0,
|
|
457
472
|
onSelectionChange: (e) => U(e ? {
|
|
458
|
-
from: B(e.from,
|
|
459
|
-
...e.to ? { to: B(e.to,
|
|
473
|
+
from: B(e.from, A, r),
|
|
474
|
+
...e.to ? { to: B(e.to, j, r) } : {}
|
|
460
475
|
} : null)
|
|
461
476
|
};
|
|
462
477
|
else {
|
|
463
|
-
let e = a === "range" ?
|
|
478
|
+
let e = a === "range" ? x === "to" ? j : A : O;
|
|
464
479
|
J = {
|
|
465
480
|
...q,
|
|
466
481
|
mode: "single",
|
|
467
482
|
selected: e && v(R(e)) ? R(e) : void 0,
|
|
468
483
|
onSelectionChange: (t) => {
|
|
469
484
|
U(a === "range" ? t ? {
|
|
470
|
-
from:
|
|
471
|
-
to:
|
|
472
|
-
[
|
|
473
|
-
} : null : t ? B(t,
|
|
485
|
+
from: A,
|
|
486
|
+
to: j,
|
|
487
|
+
[x ?? "from"]: B(t, e, r)
|
|
488
|
+
} : null : t ? B(t, O, r) : null);
|
|
474
489
|
}
|
|
475
490
|
};
|
|
476
491
|
}
|
|
477
492
|
return /* @__PURE__ */ o("div", {
|
|
478
|
-
class: `rv-temporal-picker rv-temporal-picker--${
|
|
493
|
+
class: `rv-temporal-picker rv-temporal-picker--${r}${d ? " rv-temporal-picker--multi-month" : ""}`,
|
|
479
494
|
children: [
|
|
480
|
-
|
|
481
|
-
class: `rv-temporal-picker__endpoints ${
|
|
482
|
-
children: [/* @__PURE__ */ o(
|
|
483
|
-
"aria-label": `${
|
|
484
|
-
"aria-pressed":
|
|
495
|
+
t.dateInput === !1 && a === "range" && r !== "time" && /* @__PURE__ */ o("div", {
|
|
496
|
+
class: `rv-temporal-picker__endpoints ${t.classNames?.endpoints ?? ""}`,
|
|
497
|
+
children: [/* @__PURE__ */ o(p, {
|
|
498
|
+
"aria-label": `${m.startDate}: ${A}`,
|
|
499
|
+
"aria-pressed": x !== "to",
|
|
485
500
|
onClick: () => {
|
|
486
|
-
|
|
501
|
+
S(void 0), A && P(y(R(A), u.calendarSystem)), E("");
|
|
487
502
|
},
|
|
488
|
-
children:
|
|
489
|
-
}), /* @__PURE__ */ o(
|
|
490
|
-
"aria-label": `${
|
|
491
|
-
"aria-pressed":
|
|
503
|
+
children: A ? R(A) : "—"
|
|
504
|
+
}), /* @__PURE__ */ o(p, {
|
|
505
|
+
"aria-label": `${m.endDate}: ${j}`,
|
|
506
|
+
"aria-pressed": x === "to",
|
|
492
507
|
onClick: () => {
|
|
493
|
-
|
|
508
|
+
S("to"), j && P(y(R(j), u.calendarSystem)), E("");
|
|
494
509
|
},
|
|
495
|
-
children:
|
|
510
|
+
children: j ? R(j) : "—"
|
|
496
511
|
})]
|
|
497
512
|
}),
|
|
498
513
|
/* @__PURE__ */ o("div", {
|
|
499
514
|
class: "rv-temporal-picker__header",
|
|
500
|
-
children:
|
|
501
|
-
class: `rv-temporal-picker__dates ${a === "range" ? `rv-temporal-picker__endpoints ${
|
|
515
|
+
children: r !== "time" && t.dateInput !== !1 && /* @__PURE__ */ o("div", {
|
|
516
|
+
class: `rv-temporal-picker__dates ${a === "range" ? `rv-temporal-picker__endpoints ${t.classNames?.endpoints ?? ""}` : ""}`,
|
|
502
517
|
children: a === "range" ? /* @__PURE__ */ o(e, { children: [/* @__PURE__ */ o("div", {
|
|
503
518
|
class: "rv-temporal-picker__endpoint",
|
|
504
519
|
role: "group",
|
|
505
|
-
"aria-label":
|
|
520
|
+
"aria-label": m.startDate,
|
|
506
521
|
children: [/* @__PURE__ */ o(w, {
|
|
507
|
-
label:
|
|
508
|
-
value:
|
|
509
|
-
options:
|
|
510
|
-
invalid: !
|
|
511
|
-
errorId:
|
|
512
|
-
onFocus: () =>
|
|
522
|
+
label: m.startDate,
|
|
523
|
+
value: g(A),
|
|
524
|
+
options: _,
|
|
525
|
+
invalid: !I,
|
|
526
|
+
errorId: h,
|
|
527
|
+
onFocus: () => S(void 0),
|
|
513
528
|
onChange: (e) => G("from", e)
|
|
514
|
-
}),
|
|
515
|
-
from: V(
|
|
516
|
-
...
|
|
529
|
+
}), r === "datetime" && K(A, m.startTime, (e) => H({
|
|
530
|
+
from: V(A, e, r),
|
|
531
|
+
...j ? { to: j } : {}
|
|
517
532
|
}), !1)]
|
|
518
533
|
}), /* @__PURE__ */ o("div", {
|
|
519
534
|
class: "rv-temporal-picker__endpoint",
|
|
520
535
|
role: "group",
|
|
521
|
-
"aria-label":
|
|
536
|
+
"aria-label": m.endDate,
|
|
522
537
|
children: [/* @__PURE__ */ o(w, {
|
|
523
|
-
label:
|
|
524
|
-
value:
|
|
525
|
-
options:
|
|
526
|
-
invalid: !
|
|
527
|
-
errorId:
|
|
528
|
-
onFocus: () =>
|
|
538
|
+
label: m.endDate,
|
|
539
|
+
value: g(j),
|
|
540
|
+
options: _,
|
|
541
|
+
invalid: !I,
|
|
542
|
+
errorId: h,
|
|
543
|
+
onFocus: () => S("to"),
|
|
529
544
|
onChange: (e) => G("to", e)
|
|
530
|
-
}),
|
|
531
|
-
from:
|
|
532
|
-
to: V(
|
|
545
|
+
}), r === "datetime" && K(j, m.endTime, (e) => H({
|
|
546
|
+
from: A,
|
|
547
|
+
to: V(j, e, r)
|
|
533
548
|
}), !1)]
|
|
534
549
|
})] }) : /* @__PURE__ */ o(w, {
|
|
535
|
-
label: a === "multiple" ?
|
|
536
|
-
value: a === "multiple" ?
|
|
550
|
+
label: a === "multiple" ? m.dates : m.date,
|
|
551
|
+
value: a === "multiple" ? k : g(O),
|
|
537
552
|
multiple: a === "multiple",
|
|
538
|
-
options:
|
|
539
|
-
invalid: !
|
|
540
|
-
errorId:
|
|
553
|
+
options: _,
|
|
554
|
+
invalid: !I,
|
|
555
|
+
errorId: h,
|
|
541
556
|
onChange: (e) => {
|
|
542
|
-
typeof e == "string" && W(e), H(Array.isArray(e) ? e : e ? B(e,
|
|
557
|
+
typeof e == "string" && W(e), H(Array.isArray(e) ? e : e ? B(e, O, r) : null);
|
|
543
558
|
}
|
|
544
559
|
})
|
|
545
560
|
})
|
|
546
561
|
}),
|
|
547
562
|
/* @__PURE__ */ o("div", {
|
|
548
563
|
class: "rv-temporal-picker__body",
|
|
549
|
-
children: [
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
564
|
+
children: [r !== "time" && /* @__PURE__ */ o(T, { ...J }), r !== "date" && a !== "range" && /* @__PURE__ */ o(Z, {
|
|
565
|
+
collapsible: r === "datetime" && d,
|
|
566
|
+
value: z(O),
|
|
567
|
+
label: m.time,
|
|
568
|
+
text: m,
|
|
569
|
+
format: t.timeFormat,
|
|
570
|
+
precision: t.precision,
|
|
571
|
+
locale: u.locale,
|
|
572
|
+
min: t.minTime,
|
|
573
|
+
max: t.maxTime,
|
|
574
|
+
step: t.timeStep,
|
|
575
|
+
onChange: (e) => H(V(O, e, r))
|
|
560
576
|
})]
|
|
561
577
|
}),
|
|
562
|
-
|
|
578
|
+
r !== "date" && a === "range" && (r === "time" || t.dateInput === !1) && /* @__PURE__ */ o("div", {
|
|
563
579
|
class: "rv-temporal-picker__times",
|
|
564
|
-
children: [
|
|
565
|
-
value: z(
|
|
566
|
-
label:
|
|
567
|
-
text:
|
|
568
|
-
format:
|
|
569
|
-
precision:
|
|
570
|
-
locale:
|
|
571
|
-
min:
|
|
572
|
-
max:
|
|
573
|
-
step:
|
|
580
|
+
children: [r === "time" ? /* @__PURE__ */ o(Z, {
|
|
581
|
+
value: z(A),
|
|
582
|
+
label: m.startTime,
|
|
583
|
+
text: m,
|
|
584
|
+
format: t.timeFormat,
|
|
585
|
+
precision: t.precision,
|
|
586
|
+
locale: u.locale,
|
|
587
|
+
min: t.minTime,
|
|
588
|
+
max: t.maxTime,
|
|
589
|
+
step: t.timeStep,
|
|
574
590
|
onChange: (e) => H({
|
|
575
591
|
from: e,
|
|
576
|
-
...
|
|
592
|
+
...j ? { to: j } : {}
|
|
577
593
|
})
|
|
578
|
-
}) : K(
|
|
579
|
-
from: V(
|
|
580
|
-
...
|
|
581
|
-
})),
|
|
582
|
-
value: z(
|
|
583
|
-
label:
|
|
584
|
-
text:
|
|
585
|
-
format:
|
|
586
|
-
precision:
|
|
587
|
-
locale:
|
|
588
|
-
min:
|
|
589
|
-
max:
|
|
590
|
-
step:
|
|
594
|
+
}) : K(A, m.startTime, (e) => H({
|
|
595
|
+
from: V(A, e, r),
|
|
596
|
+
...j ? { to: j } : {}
|
|
597
|
+
})), r === "time" ? /* @__PURE__ */ o(Z, {
|
|
598
|
+
value: z(j),
|
|
599
|
+
label: m.endTime,
|
|
600
|
+
text: m,
|
|
601
|
+
format: t.timeFormat,
|
|
602
|
+
precision: t.precision,
|
|
603
|
+
locale: u.locale,
|
|
604
|
+
min: t.minTime,
|
|
605
|
+
max: t.maxTime,
|
|
606
|
+
step: t.timeStep,
|
|
591
607
|
onChange: (e) => H({
|
|
592
|
-
from:
|
|
608
|
+
from: A,
|
|
593
609
|
to: e
|
|
594
610
|
})
|
|
595
|
-
}) : K(
|
|
596
|
-
from:
|
|
597
|
-
to: V(
|
|
611
|
+
}) : K(j, m.endTime, (e) => H({
|
|
612
|
+
from: A,
|
|
613
|
+
to: V(j, e, r)
|
|
598
614
|
}))]
|
|
599
615
|
}),
|
|
600
|
-
!
|
|
616
|
+
!I && /* @__PURE__ */ o(f, {
|
|
601
617
|
tone: "danger",
|
|
602
618
|
children: /* @__PURE__ */ o("span", {
|
|
603
|
-
id:
|
|
604
|
-
children:
|
|
619
|
+
id: h,
|
|
620
|
+
children: L
|
|
605
621
|
})
|
|
606
622
|
})
|
|
607
623
|
]
|
|
608
624
|
});
|
|
609
625
|
}
|
|
610
626
|
//#endregion
|
|
611
|
-
//#region
|
|
612
|
-
function
|
|
613
|
-
let [
|
|
614
|
-
|
|
615
|
-
},
|
|
627
|
+
//#region package/date-time/field.tsx
|
|
628
|
+
function Q({ value: e, options: t, apply: r, cancel: i, onValidChange: a, clearable: s = !0 }) {
|
|
629
|
+
let [c, l] = n(e), [u, d] = n(!1), [p, m] = n(""), h = (e) => {
|
|
630
|
+
l(e), m("");
|
|
631
|
+
}, g = t.autoApply !== !1, _ = JSON.stringify(c) !== JSON.stringify(e), v = (e) => {
|
|
616
632
|
let t = r(e) || "";
|
|
617
|
-
return
|
|
618
|
-
},
|
|
619
|
-
return D(() => !
|
|
633
|
+
return m(t), !t;
|
|
634
|
+
}, y = () => u ? v(c) : !1;
|
|
635
|
+
return D(() => !_ || y(), g), /* @__PURE__ */ o("div", {
|
|
620
636
|
class: `rv-temporal-draft${t.kind === "time" ? " rv-temporal-draft--time" : ""}`,
|
|
621
637
|
onKeyDown: (e) => {
|
|
622
|
-
e.key === "Enter" && !e.isComposing && (e.ctrlKey || e.metaKey ||
|
|
638
|
+
e.key === "Enter" && !e.isComposing && (e.ctrlKey || e.metaKey || g && e.target instanceof HTMLInputElement) && (e.preventDefault(), y());
|
|
623
639
|
},
|
|
624
640
|
children: [
|
|
625
|
-
/* @__PURE__ */ o(
|
|
641
|
+
/* @__PURE__ */ o(oe, {
|
|
626
642
|
...t,
|
|
627
|
-
value:
|
|
628
|
-
onChange:
|
|
629
|
-
|
|
630
|
-
|
|
643
|
+
value: c,
|
|
644
|
+
onChange: h,
|
|
645
|
+
onValidChange: a,
|
|
646
|
+
onValidityChange: d,
|
|
647
|
+
onSelectionComplete: g ? v : void 0
|
|
631
648
|
}),
|
|
632
|
-
|
|
649
|
+
p && /* @__PURE__ */ o(f, {
|
|
633
650
|
tone: "danger",
|
|
634
|
-
children:
|
|
651
|
+
children: p
|
|
635
652
|
}),
|
|
636
653
|
/* @__PURE__ */ o(O, {
|
|
637
654
|
text: t.actions,
|
|
638
|
-
showConfirm: t.showActions ?? !
|
|
639
|
-
disabled: !
|
|
640
|
-
apply:
|
|
655
|
+
showConfirm: t.showActions ?? !g,
|
|
656
|
+
disabled: !u,
|
|
657
|
+
apply: y,
|
|
641
658
|
cancel: i,
|
|
642
|
-
clear: !
|
|
659
|
+
clear: !s || (t.required ?? t.calendar?.required) ? void 0 : () => {
|
|
643
660
|
let e = t.selection === "multiple" ? [] : null;
|
|
644
|
-
|
|
661
|
+
h(e), g && v(e);
|
|
645
662
|
}
|
|
646
663
|
})
|
|
647
664
|
]
|
|
648
665
|
});
|
|
649
666
|
}
|
|
650
|
-
function
|
|
651
|
-
let
|
|
667
|
+
function se({ value: e, kind: t = "date", picker: n, livePickerUpdates: r, onValueChange: s, onInput: c, formatValue: l, parseValue: f, ...m }) {
|
|
668
|
+
let h = a(null), _ = a(), v = a({
|
|
652
669
|
value: e,
|
|
653
670
|
kind: t,
|
|
654
671
|
picker: n,
|
|
655
|
-
onValueChange:
|
|
656
|
-
input:
|
|
672
|
+
onValueChange: s,
|
|
673
|
+
input: m
|
|
657
674
|
});
|
|
658
|
-
return
|
|
675
|
+
return v.current = {
|
|
659
676
|
value: e,
|
|
660
677
|
kind: t,
|
|
661
678
|
picker: n,
|
|
662
|
-
onValueChange:
|
|
663
|
-
input:
|
|
664
|
-
}, i(() => () =>
|
|
665
|
-
(
|
|
666
|
-
}, [
|
|
679
|
+
onValueChange: s,
|
|
680
|
+
input: m
|
|
681
|
+
}, i(() => () => _.current?.close(), []), i(() => {
|
|
682
|
+
(m.disabled || m.readOnly) && _.current?.close();
|
|
683
|
+
}, [m.disabled, m.readOnly]), /* @__PURE__ */ o("span", {
|
|
667
684
|
class: "rv-date-time-field",
|
|
668
|
-
children: [/* @__PURE__ */ o(
|
|
669
|
-
...
|
|
685
|
+
children: [/* @__PURE__ */ o(d, {
|
|
686
|
+
...m,
|
|
670
687
|
type: "text",
|
|
671
|
-
value:
|
|
672
|
-
placeholder:
|
|
688
|
+
value: l?.(e) ?? e,
|
|
689
|
+
placeholder: m.placeholder ?? (t === "date" ? "YYYY-MM-DD" : t === "time" ? "HH:mm" : "YYYY-MM-DDTHH:mm"),
|
|
673
690
|
onInput: (e) => {
|
|
674
|
-
|
|
675
|
-
let t =
|
|
676
|
-
t !== void 0 &&
|
|
691
|
+
c?.(e);
|
|
692
|
+
let t = f ? f(e.currentTarget.value) : e.currentTarget.value;
|
|
693
|
+
t !== void 0 && s?.(t);
|
|
677
694
|
}
|
|
678
|
-
}), /* @__PURE__ */ o(
|
|
679
|
-
ref:
|
|
695
|
+
}), /* @__PURE__ */ o(p, {
|
|
696
|
+
ref: h,
|
|
680
697
|
variant: "ghost",
|
|
681
698
|
"aria-label": X(t, n?.text),
|
|
682
|
-
disabled:
|
|
699
|
+
disabled: m.disabled || m.readOnly,
|
|
683
700
|
onClick: () => {
|
|
684
|
-
|
|
701
|
+
if (!h.current) return;
|
|
702
|
+
if (_.current) {
|
|
703
|
+
_.current.close();
|
|
704
|
+
return;
|
|
705
|
+
}
|
|
706
|
+
let i, a = (e) => {
|
|
707
|
+
let t = typeof e == "string" ? e : "";
|
|
708
|
+
t === i || v.current.input.disabled || v.current.input.readOnly || (i = t, v.current.onValueChange?.(t));
|
|
709
|
+
};
|
|
710
|
+
_.current = E(h.current, (i) => /* @__PURE__ */ o(Q, {
|
|
685
711
|
value: e || null,
|
|
686
712
|
options: {
|
|
687
713
|
...n,
|
|
688
|
-
|
|
714
|
+
calendar: {
|
|
715
|
+
fixedWeeks: !0,
|
|
716
|
+
...n?.calendar
|
|
717
|
+
},
|
|
718
|
+
required: n?.required ?? m.required,
|
|
689
719
|
kind: t,
|
|
690
720
|
selection: "single"
|
|
691
721
|
},
|
|
692
|
-
cancel:
|
|
722
|
+
cancel: i,
|
|
723
|
+
onValidChange: r && n?.autoApply !== !1 ? a : void 0,
|
|
693
724
|
apply: (e) => {
|
|
694
|
-
|
|
725
|
+
a(e), i();
|
|
695
726
|
}
|
|
696
727
|
}), {
|
|
697
728
|
label: X(t, n?.text),
|
|
729
|
+
fitViewport: t === "datetime",
|
|
698
730
|
className: t === "time" ? "rv-editor-popup--time" : t === "datetime" ? "rv-editor-popup--datetime" : void 0,
|
|
699
731
|
onClose: () => {
|
|
700
|
-
|
|
732
|
+
_.current = void 0;
|
|
701
733
|
}
|
|
702
|
-
})
|
|
734
|
+
});
|
|
703
735
|
},
|
|
704
|
-
children: /* @__PURE__ */ o(
|
|
736
|
+
children: /* @__PURE__ */ o(u, { svg: t === "time" ? g : C })
|
|
705
737
|
})]
|
|
706
738
|
});
|
|
707
739
|
}
|
|
708
740
|
//#endregion
|
|
709
|
-
//#region
|
|
710
|
-
|
|
711
|
-
|
|
741
|
+
//#region package/date-time/attach.tsx
|
|
742
|
+
var $ = /* @__PURE__ */ new WeakMap();
|
|
743
|
+
function ce(e, t, n) {
|
|
744
|
+
$.get(e)?.();
|
|
745
|
+
let r, i = s(e.ownerDocument, /* @__PURE__ */ o(p, {
|
|
746
|
+
className: "rv-temporal-picker-trigger",
|
|
712
747
|
variant: "ghost",
|
|
713
748
|
disabled: e.disabled || e.readOnly,
|
|
714
749
|
"aria-label": X(t.kind ?? "date", t.text),
|
|
715
750
|
onClick: () => {
|
|
716
|
-
e.disabled || e.readOnly || r
|
|
751
|
+
e.disabled || e.readOnly || (r ? r.close() : r = E(e, (r) => /* @__PURE__ */ o(Q, {
|
|
717
752
|
value: e.value || null,
|
|
718
753
|
options: {
|
|
719
754
|
...t,
|
|
@@ -725,29 +760,33 @@ function se(e, t, n) {
|
|
|
725
760
|
!e.disabled && !e.readOnly && n(typeof t == "string" ? t : ""), r();
|
|
726
761
|
}
|
|
727
762
|
}), {
|
|
763
|
+
fitViewport: t.kind === "datetime",
|
|
728
764
|
className: t.kind === "time" ? "rv-editor-popup--time" : t.kind === "datetime" ? "rv-editor-popup--datetime" : void 0,
|
|
729
765
|
label: X(t.kind ?? "date", t.text),
|
|
766
|
+
trigger: i,
|
|
730
767
|
onClose: () => {
|
|
731
768
|
r = void 0;
|
|
732
769
|
}
|
|
733
770
|
}));
|
|
734
771
|
},
|
|
735
|
-
children: /* @__PURE__ */ o(
|
|
772
|
+
children: /* @__PURE__ */ o(u, { svg: t.kind === "time" ? g : C })
|
|
736
773
|
}));
|
|
737
774
|
e.after(i);
|
|
738
|
-
let a = e.ownerDocument.defaultView?.MutationObserver,
|
|
775
|
+
let a = e.ownerDocument.defaultView?.MutationObserver, l = a ? new a(() => {
|
|
739
776
|
i.disabled = e.disabled || e.readOnly, i.disabled && r?.close();
|
|
740
777
|
}) : void 0;
|
|
741
|
-
|
|
778
|
+
l?.observe(e, {
|
|
742
779
|
attributes: !0,
|
|
743
780
|
attributeFilter: ["disabled", "readonly"]
|
|
744
|
-
})
|
|
745
|
-
|
|
781
|
+
});
|
|
782
|
+
let d = () => {
|
|
783
|
+
$.get(e) === d && ($.delete(e), l?.disconnect(), r?.close(), c(i), i.remove());
|
|
746
784
|
};
|
|
785
|
+
return $.set(e, d), d;
|
|
747
786
|
}
|
|
748
787
|
//#endregion
|
|
749
|
-
//#region
|
|
750
|
-
function
|
|
788
|
+
//#region package/date-time/value.tsx
|
|
789
|
+
function le(e, t) {
|
|
751
790
|
let n = Number.isFinite(t.maxVisibleDates) ? Math.max(1, Math.floor(t.maxVisibleDates)) : 2, r = t.multiple ? t.values.slice(0, n) : t.values, i = t.values.length - r.length;
|
|
752
791
|
return e("span", {
|
|
753
792
|
class: "rv-temporal-value",
|
|
@@ -765,4 +804,4 @@ function ce(e, t) {
|
|
|
765
804
|
}, `+${i}`) : null]);
|
|
766
805
|
}
|
|
767
806
|
//#endregion
|
|
768
|
-
export {
|
|
807
|
+
export { oe as a, Q as i, ce as n, Y as o, se as r, X as s, le as t };
|