@revolist/ui 4.0.1-rc → 4.0.1
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/LICENSE +21 -0
- package/MIGRATION.md +36 -0
- package/OWNERSHIP.md +32 -32
- package/README.md +405 -264
- package/_button.scss +6 -2
- package/_chunks/arrow-up-Cw8hW9vp.js +4 -0
- package/_chunks/calculator-CDWOuAcp.js +4 -0
- package/_chunks/calendar-DJqiFwFT.js +258 -0
- package/_chunks/chart-frame-hcOlnQ1K.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-yr6Uzmof.js +126 -0
- package/_chunks/clock-BOhPNlW3.js +4 -0
- package/_chunks/color-palette-DMJUChWC.js +92 -0
- package/_chunks/{color-picker-BRv-__AM.js → color-picker-CMWxQlWt.js} +61 -56
- package/_chunks/component-DyWiItBR.js +878 -0
- package/_chunks/{component-metadata-BENbgTjU.js → component-metadata-BKd7U8OW.js} +0 -12
- package/_chunks/configurator-actions-DCodxcUw.js +155 -0
- package/_chunks/configurator-field-icon-CmcM_sPs.js +53 -0
- package/_chunks/control-CbOYUakE.js +118 -0
- package/_chunks/{controller-CmLo-Ajc.js → controller-hRBm_Lfz.js} +15 -15
- package/_chunks/controls-DD1qvPfE.js +650 -0
- package/_chunks/{date-control-CYCkb1aQ.js → date-control-XI2cpKI_.js} +21 -21
- package/_chunks/date-time-CGJdC1Qa.js +807 -0
- package/_chunks/{delete-button-DnpmDNEJ.js → delete-button-CW9vjLnk.js} +7 -7
- package/_chunks/dialog.parts-CJ3FVxC9.js +131 -0
- package/_chunks/duration-CBJWK82T.js +272 -0
- package/_chunks/editor-commit-Bq3wSgvr.js +12 -0
- package/_chunks/editor-popup-ByU7qiub.js +82 -0
- package/_chunks/field-configurator-B-qtIwx1.js +288 -0
- package/_chunks/field-context-D57PnBbH.js +5 -0
- package/_chunks/framework-mount-Bk4O_T7T.js +54 -0
- package/_chunks/hooks.module-CG3gN83z.js +157 -0
- package/_chunks/icon-toolbar-DSjOdwM7.js +134 -0
- package/_chunks/jsxRuntime.module-F6UFnpT-.js +30 -0
- package/_chunks/magnifying-glass-CvrTDSkB.js +4 -0
- package/_chunks/minus-BOAR3A1C.js +4 -0
- package/_chunks/mount-C7i5gsKI.js +267 -0
- package/_chunks/native-Blr3byjO.js +32 -0
- package/_chunks/native-control-B9MNibfa.js +649 -0
- package/_chunks/{number-input-NnH57J4j.js → number-input-CgbZes5B.js} +89 -89
- package/_chunks/picker-DqpjDC90.js +122 -0
- package/_chunks/plus-CbGRkIGl.js +4 -0
- package/_chunks/popover-controller-D-AvKQ7B.js +102 -0
- package/_chunks/popup-C35Isk7p.js +378 -0
- package/_chunks/preact.module-BBM36DnO.js +290 -0
- package/_chunks/{rating-choice-CWAsNQNS.js → rating-choice-WDrfiluf.js} +10 -10
- package/_chunks/render-m5eMMwFR.js +83 -0
- package/_chunks/reorder-list-C4HSda4n.js +59 -0
- package/_chunks/request-trail-SHynDFdM.js +762 -0
- package/_chunks/rich-text-CtjqRvv8.js +842 -0
- package/_chunks/rotate-left-BF6G883o.js +4 -0
- package/_chunks/rotate-right-Iha5ScJ1.js +4 -0
- package/_chunks/selection-list-tooltips-BtWjpP6M.js +41 -0
- package/_chunks/title-tooltip-Cw6LOZhb.js +11 -0
- package/_chunks/tooltip-D4xkio5G.js +54 -0
- package/_chunks/tooltip-owner-DjdvqKzz.js +19 -0
- package/_chunks/tooltip-session-B6X6x8G_.js +110 -0
- package/_chunks/tooltip-text-BXsUEmBH.js +12 -0
- package/_chunks/top-layer-popup-CNSDdfJV.js +59 -0
- package/_dialog.scss +55 -21
- package/_form.scss +71 -21
- package/_legend.scss +25 -7
- package/_shared/data-query/index.d.ts +2 -2
- package/_shared/data-query/load-options.d.ts +2 -2
- package/_variables.scss +34 -32
- package/_vendor/preact/LICENSE +21 -0
- package/_vendor/preact/compat/src/index.d.ts +353 -0
- package/_vendor/preact/compat/src/suspense-list.d.ts +16 -0
- package/_vendor/preact/compat/src/suspense.d.ts +19 -0
- package/_vendor/preact/hooks/src/index.d.ts +145 -0
- package/_vendor/preact/src/dom.d.ts +2548 -0
- package/_vendor/preact/src/index.d.ts +373 -0
- package/_vendor/preact/src/jsx.d.ts +2958 -0
- package/_view-switcher.scss +6 -0
- package/activity-message.d.ts +2 -2
- package/activity-message.js +16 -16
- package/ai/_chat.scss +227 -0
- package/ai/_style.scss +170 -39
- package/ai/chat.d.ts +65 -0
- package/ai/components.d.ts +35 -6
- package/ai/index.d.ts +3 -0
- package/ai/index.js +3 -3
- package/ai/mount.d.ts +59 -6
- package/ai/prompt-history.d.ts +13 -0
- 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 +27 -0
- package/ai/translation-context.d.ts +1 -1
- package/ai/translations.d.ts +1 -1
- package/alert.d.ts +2 -2
- package/angular/angular.d.ts +1 -1
- package/angular/angular.js +13 -10
- package/assignee/assignee.scss +28 -6
- package/assignee/field.d.ts +2 -2
- package/assignee/index.js +86 -87
- package/assignee/layout.d.ts +2 -2
- package/assignee/picker.d.ts +1 -1
- package/avatar/avatar.style.scss +23 -6
- package/avatar/index.d.ts +25 -2
- package/avatar/index.js +42 -41
- package/badge.d.ts +1 -1
- package/badge.view.d.ts +8 -0
- package/brush-range/_brush-range.scss +55 -49
- package/brush-range/component.d.ts +2 -4
- package/brush-range/component.js +19 -19
- package/buttons/delete-button.d.ts +2 -1
- package/buttons/delete-button.js +1 -1
- package/buttons/delete-button.style.scss +6 -2
- package/buttons/remove-button.d.ts +2 -2
- package/buttons/remove-button.js +3 -3
- package/buttons/remove-button.style.scss +1 -1
- package/buttons/svg-button.d.ts +3 -2
- package/buttons/svg-button.js +23 -23
- package/calendar/_calendar.scss +27 -26
- package/calendar/calendar.d.ts +1 -1
- package/calendar/calendar.js +1 -1
- package/calendar/caption.d.ts +1 -1
- package/calendar/day.d.ts +1 -1
- package/calendar/day.js +4 -4
- package/calendar/header.d.ts +1 -1
- package/calendar/header.js +34 -35
- package/calendar/index.js +2 -2
- package/calendar/month-grid.d.ts +1 -1
- package/calendar/month-grid.js +37 -37
- package/calendar/picker.d.ts +1 -1
- package/calendar/types.d.ts +1 -1
- package/calendar/year-grid.d.ts +1 -1
- package/calendar/year-grid.js +12 -12
- 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/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.d.ts +2 -2
- package/checkbox/index.js +9 -9
- package/choice-chips/index.d.ts +4 -2
- package/choice-chips/index.js +1 -1
- package/color-palette/color-palette.d.ts +1 -1
- package/color-palette/color-palette.js +1 -1
- package/color-palette/color-palette.style.scss +88 -25
- package/color-palette/color-picker.d.ts +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 +1 -1
- package/color-palette/native.d.ts +15 -2
- package/component-catalog.d.ts +42 -29
- 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 +7 -7
- package/control-presentation.d.ts +8 -2
- package/control-presentation.js +31 -26
- package/controls.d.ts +23 -11
- package/controls.js +4 -3
- package/core/editor-commit.d.ts +1 -1
- package/core/editor-popup-position.d.ts +6 -2
- package/core/editor-popup.d.ts +5 -1
- package/core/editor-popup.js +1 -1
- package/core/popover-controller.d.ts +35 -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 +2 -2
- package/date-time/field.d.ts +4 -3
- package/date-time/index.js +1 -1
- package/date-time/picker.d.ts +1 -1
- package/date-time/style.scss +242 -39
- package/date-time/time-control.d.ts +1 -1
- package/date-time/time-selection.d.ts +3 -1
- package/date-time/types.d.ts +6 -2
- package/dialog/dialog-action-footer.d.ts +17 -2
- package/dialog/dialog.dom.d.ts +15 -2
- package/dialog/dialog.dom.js +53 -53
- package/dialog/dialog.parts.d.ts +18 -18
- package/dialog/dialog.parts.js +1 -1
- package/dialog/dialog.preact.d.ts +1 -1
- package/dialog/dialog.preact.js +6 -6
- package/distribution-chart/_distribution-chart.scss +113 -77
- package/distribution-chart/area-chart.d.ts +1 -1
- package/distribution-chart/area-chart.js +25 -25
- package/distribution-chart/bar-chart.d.ts +6 -3
- package/distribution-chart/bar-chart.js +10 -6
- package/distribution-chart/chart-frame.d.ts +3 -2
- package/distribution-chart/index.d.ts +2 -2
- package/distribution-chart/index.js +6 -6
- package/distribution-chart/line-chart.d.ts +1 -1
- package/distribution-chart/line-chart.js +9 -9
- package/distribution-chart/types.d.ts +1 -1
- package/dropdown/content.d.ts +3 -2
- package/dropdown/content.js +1 -141
- package/dropdown/control.d.ts +14 -0
- package/dropdown/control.js +1 -0
- package/dropdown/control.view.d.ts +6 -0
- package/dropdown/dropdown.service.d.ts +1 -1
- package/dropdown/dropdown.service.js +9 -9
- package/dropdown/dropdown.types.d.ts +5 -1
- package/dropdown/editor-dropdown.style.scss +54 -16
- package/dropdown/index.d.ts +1 -1
- package/dropdown/index.js +3 -4
- package/dropdown/lookup-field.d.ts +6 -1
- package/dropdown/lookup-field.js +42 -41
- package/dropdown/popup.d.ts +2 -2
- package/dropdown/popup.js +1 -140
- package/duration/controls.d.ts +1 -1
- package/duration/index.d.ts +2 -2
- package/duration/index.js +1 -1
- package/duration/style.scss +1 -1
- package/editor-actions.d.ts +1 -1
- package/editor-actions.js +21 -20
- package/editor-layout/index.d.ts +5 -5
- package/editor-layout/index.js +43 -38
- package/editor-layout/style.scss +82 -18
- package/field-configurator.d.ts +40 -2
- package/field-configurator.js +4 -170
- package/field-expansion.d.ts +9 -0
- package/field-reorder.hook.js +32 -32
- package/fieldset.d.ts +3 -0
- package/filter/filters/slider/_single-slider.scss +57 -38
- package/filter/filters/slider/_slider.scss +41 -33
- package/filter/filters/slider/control.js +2 -0
- package/filter/filters/slider/preact.js +3 -3
- package/filter/filters/slider/runtime.js +49 -22
- package/filter/filters/slider/single.d.ts +1 -1
- package/filter/filters/slider/single.js +23 -23
- package/filter-badge.d.ts +1 -1
- package/filter-badge.js +23 -22
- package/filter-controls.d.ts +1 -2
- package/filter-controls.js +29 -30
- package/form-controls/field-context.d.ts +5 -0
- package/form-controls/index.d.ts +10 -2
- package/form-controls/index.js +17 -22
- package/form-controls/presentation.d.ts +2 -2
- package/form-controls/presentation.js +59 -51
- package/formatting/comparison-preview.d.ts +1 -1
- package/formatting/icon-controls.d.ts +1 -1
- package/formatting/index.d.ts +1 -1
- package/formatting/index.js +106 -100
- package/formatting/inspector-section.d.ts +1 -1
- package/formatting/styles.scss +14 -57
- package/formatting/typography-controls.d.ts +1 -1
- package/framework-mount.d.ts +1 -1
- package/framework.js +237 -226
- package/history-controls.d.ts +14 -0
- package/history-controls.js +27 -0
- package/icon-toolbar.d.ts +62 -0
- package/icon-toolbar.js +1 -0
- package/icons/icon.d.ts +2 -2
- package/icons/icon.js +1 -1
- package/legend.d.ts +2 -2
- package/legend.js +12 -12
- package/masked-input/index.d.ts +1 -1
- package/masked-input/index.js +109 -109
- package/native-control.d.ts +14 -13
- package/native-control.js +3 -26
- 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 +49 -45
- package/number-input/index.d.ts +2 -2
- package/number-input/index.js +1 -1
- package/package.json +88 -15
- package/pagination.d.ts +3 -0
- package/pagination.js +50 -40
- package/pdf-viewer/component.d.ts +1 -1
- package/pdf-viewer/controller.js +1 -1
- package/pdf-viewer/header.d.ts +2 -2
- package/pdf-viewer/index.d.ts +2 -2
- package/pdf-viewer/index.js +13 -13
- package/pdf-viewer/search-bar.d.ts +2 -2
- package/pdf-viewer/status.d.ts +2 -2
- package/pdf-viewer/style.scss +205 -45
- package/pdf-viewer/toolbar.d.ts +1 -1
- package/pickers.d.ts +6 -2
- package/preact-mount.d.ts +1 -1
- package/preact-mount.js +2 -2
- package/preact.d.ts +15 -10
- package/preact.js +109 -64
- package/progress/_bar.scss +9 -3
- package/progress/_circular.scss +2 -1
- package/rating-choice.d.ts +1 -1
- package/rating-choice.js +1 -1
- package/react-adapter.d.ts +5 -3
- package/react-control.d.ts +1 -0
- package/react.d.ts +20 -11
- package/react.js +72 -88
- package/reorder-list.d.ts +2 -2
- package/reorder-list.js +1 -1
- package/reorder-list.scss +59 -17
- package/resource-picker/resource-picker-avatar.d.ts +1 -1
- package/resource-picker/resource-picker-avatar.js +14 -14
- package/resource-picker/resource-picker-option.d.ts +1 -1
- package/resource-picker/resource-picker-option.js +28 -28
- package/resource-picker/resource-picker-popup.d.ts +1 -1
- package/resource-picker/resource-picker-popup.js +3 -3
- package/resource-picker/resource-picker.d.ts +1 -1
- package/resource-picker/resource-picker.js +68 -66
- package/resource-picker/resource-picker.scss +66 -35
- package/rich-text/engine.d.ts +17 -19
- package/rich-text/format-html.d.ts +2 -0
- package/rich-text/index.d.ts +11 -7
- package/rich-text/index.js +1 -1
- package/rich-text/model.d.ts +6 -3
- package/rich-text/render-model.d.ts +4 -5
- package/rich-text/style.scss +295 -55
- package/rich-text/syntax.d.ts +5 -2
- package/rich-text/toolbar.d.ts +7 -7
- package/rich-text/translations.d.ts +5 -15
- package/search-input/index.js +12 -12
- package/search-input/native.d.ts +21 -2
- package/segmented-switch/index.d.ts +1 -1
- package/segmented-switch/index.js +1 -1
- package/select.d.ts +22 -0
- package/select.js +1 -0
- package/selection-list.d.ts +1 -0
- package/selection-list.js +3 -1
- package/status-feedback/exit-snapshot.js +1 -1
- package/status-feedback/index.js +2 -2
- package/status-feedback/popover.js +9 -9
- package/status-feedback/render.d.ts +2 -2
- package/status-feedback/render.js +3 -44
- package/status-feedback/status-feedback.scss +130 -34
- package/status-feedback/types.d.ts +4 -0
- package/status-feedback/use-auto-dismiss.d.ts +3 -0
- 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 +404 -82
- package/styles/_control.scss +42 -12
- 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 +376 -116
- 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/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.server.js +1 -48
- package/svelte/UiComponent.svelte +44 -32
- package/svelte.d.ts +1 -1
- package/svelte.js +33 -68
- package/switch/index.js +3 -2
- package/time-grid.d.ts +1 -2
- package/time-grid.js +43 -42
- package/timeline-track/_style.scss +96 -24
- package/timeline-track/component.d.ts +5 -1
- package/timeline-track/index.js +91 -74
- package/timeline-track/model.d.ts +9 -0
- package/timeline-track/model.js +10 -1
- package/ui.css +1 -1
- package/view-switcher.d.ts +23 -0
- package/vue-adapter.d.ts +1 -1
- package/vue.d.ts +160 -144
- package/vue.js +149 -178
- package/_chunks/calendar-BsDxCYhI.js +0 -248
- package/_chunks/chart-frame-BvxbmEU9.js +0 -126
- package/_chunks/choice-chips-0HfOnK_4.js +0 -110
- package/_chunks/color-palette-BmZ7kH9R.js +0 -94
- package/_chunks/component-D4PH5UZT.js +0 -859
- package/_chunks/control-tooltip-BCNzQCXE.js +0 -100
- package/_chunks/controls-NEL5tDaz.js +0 -615
- package/_chunks/date-time-DjucJmbc.js +0 -769
- package/_chunks/dialog.parts-Dt3KinUz.js +0 -134
- package/_chunks/dropdown-CkGQBm1Q.js +0 -357
- package/_chunks/duration-BCaktcvz.js +0 -270
- package/_chunks/editor-commit-D6Rf5rGz.js +0 -12
- package/_chunks/editor-popup-B7fu_A_T.js +0 -81
- package/_chunks/framework-mount-BKIOsvY-.js +0 -54
- package/_chunks/mount-0-8opf1j.js +0 -90
- package/_chunks/native.view-8q_nwQ7x.js +0 -32
- package/_chunks/picker-oazJ7sO_.js +0 -121
- package/_chunks/reorder-list-BV3kZXso.js +0 -59
- package/_chunks/request-trail-D0oVzdRd.js +0 -347
- package/_chunks/rich-text-2Rla349o.js +0 -477
- 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 -12
- package/formatting/control-tooltip.d.ts +0 -27
- package/native-controls.view.d.ts +0 -54
- package/react-native-select.d.ts +0 -6
- package/search-input/native.view.d.ts +0 -21
- package/styles/legacy-pagination.css +0 -112
- package/surfaces.view.d.ts +0 -63
- package/vue-native-select.d.ts +0 -9
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { createControlId as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
import { c as e, i as t, t as n } from "./hooks.module-CG3gN83z.js";
|
|
2
|
+
import { t as r } from "./jsxRuntime.module-F6UFnpT-.js";
|
|
3
|
+
import { createControlId as i } from "../core/control-id.js";
|
|
4
|
+
import { n as a } from "./native-control-B9MNibfa.js";
|
|
5
|
+
import { t as o } from "./controls-DD1qvPfE.js";
|
|
6
|
+
import { EditorActions as s } from "../editor-actions.js";
|
|
7
7
|
//#region src/number-input/model.ts
|
|
8
|
-
var
|
|
8
|
+
var c = {
|
|
9
9
|
invalid: "Enter a valid number in the configured locale.",
|
|
10
10
|
configuration: "The number input configuration is unsupported or invalid.",
|
|
11
11
|
required: "Enter a value.",
|
|
@@ -14,14 +14,14 @@ var l = {
|
|
|
14
14
|
maximum: "The value is above the maximum.",
|
|
15
15
|
increase: "Increase",
|
|
16
16
|
decrease: "Decrease"
|
|
17
|
-
},
|
|
18
|
-
function
|
|
17
|
+
}, l = /[\u061c\u200e\u200f]/g, u = (e) => e.replace(l, "").trim(), d = (e) => typeof e == "number" && Number.isFinite(e);
|
|
18
|
+
function f(e) {
|
|
19
19
|
let t = e.kind ?? "number", n = e.precision ?? 2;
|
|
20
20
|
if (![
|
|
21
21
|
"number",
|
|
22
22
|
"currency",
|
|
23
23
|
"percent"
|
|
24
|
-
].includes(t) || !Number.isInteger(n) || n < 0 || n > 20 || e.min !== void 0 && !
|
|
24
|
+
].includes(t) || !Number.isInteger(n) || n < 0 || n > 20 || e.min !== void 0 && !d(e.min) || e.max !== void 0 && !d(e.max) || e.step !== void 0 && (!d(e.step) || e.step <= 0) || e.min !== void 0 && e.max !== void 0 && e.min > e.max || e.useGrouping !== void 0 && typeof e.useGrouping != "boolean" || e.required !== void 0 && typeof e.required != "boolean" || e.locale !== void 0 && (typeof e.locale != "string" || !e.locale.trim() || !Intl.NumberFormat.supportedLocalesOf(e.locale).length)) throw RangeError();
|
|
25
25
|
let r = e.currency ?? "USD";
|
|
26
26
|
if (t === "currency" && (typeof r != "string" || !/^[A-Z]{3}$/.test(r))) throw RangeError();
|
|
27
27
|
if (e.step !== void 0) {
|
|
@@ -43,23 +43,23 @@ function p(e) {
|
|
|
43
43
|
formatter: a
|
|
44
44
|
};
|
|
45
45
|
}
|
|
46
|
-
function
|
|
47
|
-
let { formatter: n } =
|
|
46
|
+
function p(e, t = {}) {
|
|
47
|
+
let { formatter: n } = f(t);
|
|
48
48
|
if (e == null) return "";
|
|
49
|
-
if (!
|
|
49
|
+
if (!d(e)) throw TypeError("Expected a finite number or null.");
|
|
50
50
|
return n.format(e);
|
|
51
51
|
}
|
|
52
|
-
function
|
|
53
|
-
let { kind: n, currency: r } =
|
|
52
|
+
function m(e, t) {
|
|
53
|
+
let { kind: n, currency: r } = f(t);
|
|
54
54
|
if (e == null) return "";
|
|
55
|
-
if (!
|
|
55
|
+
if (!d(e)) return String(e);
|
|
56
56
|
let i = new Intl.NumberFormat(t.locale, {
|
|
57
57
|
style: n === "number" ? "decimal" : n,
|
|
58
58
|
...n === "currency" ? { currency: r } : {},
|
|
59
59
|
useGrouping: t.useGrouping ?? !0,
|
|
60
60
|
minimumFractionDigits: 0,
|
|
61
61
|
maximumFractionDigits: 20
|
|
62
|
-
}).format(e), a =
|
|
62
|
+
}).format(e), a = h(i, {
|
|
63
63
|
...t,
|
|
64
64
|
precision: 20,
|
|
65
65
|
min: void 0,
|
|
@@ -68,29 +68,29 @@ function h(e, t) {
|
|
|
68
68
|
});
|
|
69
69
|
return a.error === void 0 && Object.is(a.value, e) ? i : e.toExponential();
|
|
70
70
|
}
|
|
71
|
-
function
|
|
71
|
+
function h(e, t = {}) {
|
|
72
72
|
let n = {
|
|
73
|
-
...
|
|
73
|
+
...c,
|
|
74
74
|
...t.text
|
|
75
75
|
};
|
|
76
76
|
try {
|
|
77
|
-
let { kind: r, precision: i, currency: a } =
|
|
77
|
+
let { kind: r, precision: i, currency: a } = f(t), o = u(e);
|
|
78
78
|
if (!o) return t.required ? { error: n.required } : { value: null };
|
|
79
79
|
let s = new Intl.NumberFormat(t.locale, {
|
|
80
80
|
useGrouping: !1,
|
|
81
81
|
minimumFractionDigits: 1
|
|
82
|
-
}).formatToParts(1.1).find((e) => e.type === "decimal").value, c = new Intl.NumberFormat(t.locale, { useGrouping: !1 }), l = new Map(Array.from({ length: 10 }, (e, t) => [
|
|
82
|
+
}).formatToParts(1.1).find((e) => e.type === "decimal").value, c = new Intl.NumberFormat(t.locale, { useGrouping: !1 }), l = new Map(Array.from({ length: 10 }, (e, t) => [u(c.format(t)), String(t)])), d = (e) => [...e].map((e) => l.get(e) ?? e).join(""), p = new Intl.NumberFormat(t.locale, {
|
|
83
83
|
useGrouping: !0,
|
|
84
84
|
maximumFractionDigits: 0
|
|
85
|
-
}), m =
|
|
86
|
-
r === "currency" && o.startsWith("(") && o.endsWith(")") && (g = !0, _ = !0, o =
|
|
85
|
+
}), m = p.formatToParts(123456789).find((e) => e.type === "group")?.value, h = c.formatToParts(-1).find((e) => e.type === "minusSign")?.value ?? "-", g = !1, _ = !1;
|
|
86
|
+
r === "currency" && o.startsWith("(") && o.endsWith(")") && (g = !0, _ = !0, o = u(o.slice(1, -1)));
|
|
87
87
|
let v = () => {
|
|
88
88
|
let e = [
|
|
89
89
|
h,
|
|
90
90
|
"-",
|
|
91
91
|
"+"
|
|
92
92
|
].find((e) => o.startsWith(e));
|
|
93
|
-
return !e || !_ && (_ = !0, g = e !== "+", o =
|
|
93
|
+
return !e || !_ && (_ = !0, g = e !== "+", o = u(o.slice(e.length)), !0);
|
|
94
94
|
};
|
|
95
95
|
if (!v()) return { error: n.invalid };
|
|
96
96
|
if (r === "currency") {
|
|
@@ -102,27 +102,27 @@ function g(e, t = {}) {
|
|
|
102
102
|
}).formatToParts(1)) r.type === "currency" && e.add(r.value);
|
|
103
103
|
for (let t of [...e].sort((e, t) => t.length - e.length)) {
|
|
104
104
|
if (o.startsWith(t)) {
|
|
105
|
-
o =
|
|
105
|
+
o = u(o.slice(t.length));
|
|
106
106
|
break;
|
|
107
107
|
}
|
|
108
108
|
if (o.endsWith(t)) {
|
|
109
|
-
o =
|
|
109
|
+
o = u(o.slice(0, -t.length));
|
|
110
110
|
break;
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
113
|
if (!v()) return { error: n.invalid };
|
|
114
114
|
} else if (r === "percent") {
|
|
115
115
|
let e = new Intl.NumberFormat(t.locale, { style: "percent" }).formatToParts(1).find((e) => e.type === "percentSign").value;
|
|
116
|
-
o.endsWith(e) ? o =
|
|
116
|
+
o.endsWith(e) ? o = u(o.slice(0, -e.length)) : o.startsWith(e) && (o = u(o.slice(e.length)));
|
|
117
117
|
}
|
|
118
|
-
o =
|
|
118
|
+
o = d(o);
|
|
119
119
|
let y = o.split(s);
|
|
120
120
|
if (y.length > 2) return { error: n.invalid };
|
|
121
121
|
let b = y[0], x = y[1] ?? "";
|
|
122
122
|
if (!/^\d*$/.test(x) || y.length === 2 && !x) return { error: n.invalid };
|
|
123
123
|
if (m && b.includes(m)) {
|
|
124
124
|
let e = b.split(m).join("");
|
|
125
|
-
if (!/^\d+$/.test(e) || u(
|
|
125
|
+
if (!/^\d+$/.test(e) || d(u(p.format(BigInt(e)))) !== b) return { error: n.invalid };
|
|
126
126
|
b = e;
|
|
127
127
|
}
|
|
128
128
|
if (!/^\d*$/.test(b) || !b && !x) return { error: n.invalid };
|
|
@@ -133,7 +133,7 @@ function g(e, t = {}) {
|
|
|
133
133
|
return { error: n.configuration };
|
|
134
134
|
}
|
|
135
135
|
}
|
|
136
|
-
function
|
|
136
|
+
function g(e, t) {
|
|
137
137
|
let n = (e) => {
|
|
138
138
|
let [t, n = "0"] = String(e).split("e"), r = t.split(".")[1]?.length ?? 0;
|
|
139
139
|
return {
|
|
@@ -143,100 +143,100 @@ function _(e, t) {
|
|
|
143
143
|
}, r = n(e), i = n(t), a = Math.max(r.scale, i.scale, 0), o = r.integer * 10n ** BigInt(a - r.scale) + i.integer * 10n ** BigInt(a - i.scale);
|
|
144
144
|
return Number(`${o}e-${a}`);
|
|
145
145
|
}
|
|
146
|
-
function
|
|
147
|
-
let r =
|
|
146
|
+
function _(e, t, n = {}) {
|
|
147
|
+
let r = h(e, n);
|
|
148
148
|
if (r.error !== void 0) return r;
|
|
149
|
-
let { kind: i, precision: a } =
|
|
150
|
-
return !Number.isFinite(
|
|
149
|
+
let { kind: i, precision: a } = f(n), o = n.step ?? 10 ** -(a + (i === "percent" ? 2 : 0)), s = r.value ?? Math.max(n.min ?? -Infinity, Math.min(n.max ?? Infinity, 0)), l = Math.max(n.min ?? -Infinity, Math.min(n.max ?? Infinity, g(s, t * o)));
|
|
150
|
+
return !Number.isFinite(l) || Math.abs(l) > 2 ** 53 - 1 ? { error: n.text?.invalid ?? c.invalid } : h(m(l, n), n);
|
|
151
151
|
}
|
|
152
152
|
//#endregion
|
|
153
153
|
//#region src/number-input/index.tsx
|
|
154
|
-
function
|
|
155
|
-
let [
|
|
154
|
+
function v({ value: l, options: u, apply: d, cancel: f, initialSelection: p = "all" }) {
|
|
155
|
+
let [g, v] = t(() => {
|
|
156
156
|
try {
|
|
157
|
-
return
|
|
157
|
+
return m(l, u);
|
|
158
158
|
} catch {
|
|
159
|
-
return String(
|
|
159
|
+
return String(l ?? "");
|
|
160
160
|
}
|
|
161
|
-
}), [
|
|
162
|
-
...
|
|
163
|
-
...
|
|
164
|
-
},
|
|
165
|
-
if (
|
|
166
|
-
let e = g
|
|
167
|
-
e.error === void 0 && !
|
|
161
|
+
}), [y, b] = t(""), [x] = t(() => i("rv-number")), S = n(null), C = n(!1), w = {
|
|
162
|
+
...c,
|
|
163
|
+
...u.text
|
|
164
|
+
}, T = h(g, u), E = T.error ?? y, D = T.error !== void 0 || !!y, O = () => {
|
|
165
|
+
if (C.current) return;
|
|
166
|
+
let e = h(g, u);
|
|
167
|
+
e.error === void 0 && !y && d(e.value);
|
|
168
|
+
}, k = (e) => {
|
|
169
|
+
b(""), v(e);
|
|
168
170
|
}, A = (e) => {
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
let t = v(_, e, d);
|
|
173
|
-
t.error === void 0 ? (x(""), y(h(t.value, d))) : x(t.error || T.invalid);
|
|
171
|
+
if (C.current) return;
|
|
172
|
+
let t = _(g, e, u);
|
|
173
|
+
t.error === void 0 ? (b(""), v(m(t.value, u))) : b(t.error || w.invalid);
|
|
174
174
|
};
|
|
175
|
-
return
|
|
176
|
-
if (
|
|
177
|
-
let e =
|
|
178
|
-
|
|
179
|
-
} else
|
|
180
|
-
}, []), /* @__PURE__ */
|
|
175
|
+
return e(() => {
|
|
176
|
+
if (S.current?.focus(), p === "end") {
|
|
177
|
+
let e = S.current?.value.length ?? 0;
|
|
178
|
+
S.current?.setSelectionRange(e, e);
|
|
179
|
+
} else S.current?.select();
|
|
180
|
+
}, []), /* @__PURE__ */ r("div", {
|
|
181
181
|
class: "rv-number-draft",
|
|
182
182
|
onKeyDown: (e) => {
|
|
183
|
-
e.isComposing ||
|
|
183
|
+
e.isComposing || C.current || (e.key === "Enter" && (e.target === S.current || e.ctrlKey || e.metaKey) ? (e.preventDefault(), O()) : e.target === S.current && ["ArrowUp", "ArrowDown"].includes(e.key) && (e.preventDefault(), A(e.key === "ArrowUp" ? 1 : -1)));
|
|
184
184
|
},
|
|
185
185
|
children: [
|
|
186
|
-
/* @__PURE__ */
|
|
187
|
-
htmlFor:
|
|
188
|
-
children:
|
|
186
|
+
/* @__PURE__ */ r("label", {
|
|
187
|
+
htmlFor: x,
|
|
188
|
+
children: u.label ?? (u.kind === "currency" ? "Currency amount" : u.kind === "percent" ? "Percentage" : "Number")
|
|
189
189
|
}),
|
|
190
|
-
/* @__PURE__ */
|
|
190
|
+
/* @__PURE__ */ r("div", {
|
|
191
191
|
class: "rv-number-draft__entry",
|
|
192
192
|
children: [
|
|
193
|
-
/* @__PURE__ */
|
|
194
|
-
ref:
|
|
195
|
-
id:
|
|
193
|
+
/* @__PURE__ */ r(a, {
|
|
194
|
+
ref: S,
|
|
195
|
+
id: x,
|
|
196
196
|
class: "rv-control",
|
|
197
197
|
type: "text",
|
|
198
198
|
inputMode: "decimal",
|
|
199
|
-
value:
|
|
200
|
-
"aria-invalid":
|
|
201
|
-
"aria-describedby":
|
|
202
|
-
required:
|
|
199
|
+
value: g,
|
|
200
|
+
"aria-invalid": D,
|
|
201
|
+
"aria-describedby": D ? `${x}-error` : void 0,
|
|
202
|
+
required: u.required,
|
|
203
203
|
onCompositionStart: () => {
|
|
204
|
-
|
|
204
|
+
C.current = !0;
|
|
205
205
|
},
|
|
206
206
|
onCompositionEnd: () => {
|
|
207
|
-
|
|
207
|
+
C.current = !1;
|
|
208
208
|
},
|
|
209
|
-
onInput: (e) =>
|
|
209
|
+
onInput: (e) => k(e.currentTarget.value)
|
|
210
210
|
}),
|
|
211
|
-
/* @__PURE__ */
|
|
212
|
-
"aria-label":
|
|
213
|
-
disabled:
|
|
214
|
-
onClick: () =>
|
|
211
|
+
/* @__PURE__ */ r(o, {
|
|
212
|
+
"aria-label": w.decrease,
|
|
213
|
+
disabled: T.error !== void 0,
|
|
214
|
+
onClick: () => A(-1),
|
|
215
215
|
children: "−"
|
|
216
216
|
}),
|
|
217
|
-
/* @__PURE__ */
|
|
218
|
-
"aria-label":
|
|
219
|
-
disabled:
|
|
220
|
-
onClick: () =>
|
|
217
|
+
/* @__PURE__ */ r(o, {
|
|
218
|
+
"aria-label": w.increase,
|
|
219
|
+
disabled: T.error !== void 0,
|
|
220
|
+
onClick: () => A(1),
|
|
221
221
|
children: "+"
|
|
222
222
|
})
|
|
223
223
|
]
|
|
224
224
|
}),
|
|
225
|
-
|
|
225
|
+
D && /* @__PURE__ */ r("p", {
|
|
226
226
|
class: "rv-editor-error",
|
|
227
|
-
id: `${
|
|
227
|
+
id: `${x}-error`,
|
|
228
228
|
role: "alert",
|
|
229
|
-
children:
|
|
229
|
+
children: E || w.invalid || c.invalid
|
|
230
230
|
}),
|
|
231
|
-
/* @__PURE__ */ s
|
|
232
|
-
text:
|
|
233
|
-
apply:
|
|
234
|
-
cancel:
|
|
235
|
-
disabled:
|
|
236
|
-
clear:
|
|
231
|
+
/* @__PURE__ */ r(s, {
|
|
232
|
+
text: u.actions,
|
|
233
|
+
apply: O,
|
|
234
|
+
cancel: f,
|
|
235
|
+
disabled: D,
|
|
236
|
+
clear: u.required ? void 0 : () => k("")
|
|
237
237
|
})
|
|
238
238
|
]
|
|
239
239
|
});
|
|
240
240
|
}
|
|
241
241
|
//#endregion
|
|
242
|
-
export {
|
|
242
|
+
export { _ as a, h as i, m as n, p as r, v as t };
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { i as e } from "./preact.module-BBM36DnO.js";
|
|
2
|
+
import { i as t } from "./hooks.module-CG3gN83z.js";
|
|
3
|
+
import { t as n } from "./jsxRuntime.module-F6UFnpT-.js";
|
|
4
|
+
import { t as r } from "./native-control-B9MNibfa.js";
|
|
5
|
+
import { DEFAULT_CALENDAR_TRANSLATIONS as i } from "../calendar/translations.js";
|
|
6
|
+
import { n as a } from "./iso-B0YHBK7m.js";
|
|
7
|
+
import { f as o, h as s, m as c, o as l, p as u } from "./model-mPO2tG2f.js";
|
|
8
|
+
import { t as d } from "./calendar-DJqiFwFT.js";
|
|
9
|
+
//#region src/calendar/picker.tsx
|
|
10
|
+
function f(f) {
|
|
11
|
+
let { selected: p, onSelectionChange: ee, presets: m, mode: h = "single", min: g = 0, max: _ = Infinity, required: v = !1, excludeDisabled: y = !1, month: b, defaultMonth: x, onMonthChange: S, ...C } = f, w = typeof p == "string" ? p : Array.isArray(p) ? p[0] : p?.from, [T, E] = t(x ?? w ?? f.referenceDate ?? s()), [D, O] = t(w ?? T), [k, A] = t(), [j, M] = t(), N = (e) => {
|
|
12
|
+
A(e), M(void 0);
|
|
13
|
+
}, P = b ?? T, F = f.views?.filter((e) => e === "month" || e === "year"), I = F?.length ? F : f.views || f.enableYearView === !1 ? ["month"] : ["month", "year"], [L, R] = t(f.defaultView && I.includes(f.defaultView) ? f.defaultView : I[0]), z = I.includes(L) ? L : I[0], B = (e) => {
|
|
14
|
+
E(e), N(), S?.(e);
|
|
15
|
+
}, V = f.translations?.invalidSelection ?? i.invalidSelection, H = (e, t = V) => {
|
|
16
|
+
A(e), M(t), f.onInvalidSelection?.(t, e);
|
|
17
|
+
}, U = (e) => !!(f.minDate && e < f.minDate || f.maxDate && e > f.maxDate || f.isDateDisabled?.(e) || f.isMonthDisabled?.(o(e, f.calendarSystem))), W = (e) => {
|
|
18
|
+
if (!e.to) return !U(e.from);
|
|
19
|
+
let t = c(e.from, e.to);
|
|
20
|
+
if (t < g || t > _ || t < 0 || U(e.from) || U(e.to)) return !1;
|
|
21
|
+
if (y) {
|
|
22
|
+
if (t > 366e3) return !1;
|
|
23
|
+
for (let t = e.from; t <= e.to; t = u(t, 1)) if (U(t)) return !1;
|
|
24
|
+
}
|
|
25
|
+
return !0;
|
|
26
|
+
}, G = (e) => {
|
|
27
|
+
if (f.mode === "multiple") {
|
|
28
|
+
let t = f.selected ?? [], n = t.includes(e), r = n ? t.filter((t) => t !== e) : [...t, e];
|
|
29
|
+
if (n && r.length < Math.max(g, +!!v) || r.length > _) {
|
|
30
|
+
H(e);
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
f.onSelectionChange(r);
|
|
34
|
+
} else if (f.mode === "range") {
|
|
35
|
+
let t = f.selected;
|
|
36
|
+
if (!t || t.to) {
|
|
37
|
+
f.onSelectionChange({ from: e }), N();
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
let n = l(t.from, e);
|
|
41
|
+
if (!W(n)) {
|
|
42
|
+
y && c(n.from, n.to) >= g && c(n.from, n.to) <= _ && f.onSelectionChange({ from: e }), H(e);
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
f.onSelectionChange(n), N();
|
|
46
|
+
} else f.onSelectionChange(f.selected === e && !v ? void 0 : e);
|
|
47
|
+
}, K = f.mode === "range" ? f.selected : void 0, q = typeof p == "string" ? {
|
|
48
|
+
from: p,
|
|
49
|
+
to: p
|
|
50
|
+
} : K ? {
|
|
51
|
+
from: K.from,
|
|
52
|
+
to: K.to ?? K.from
|
|
53
|
+
} : void 0, J = K && !K.to && k ? l(K.from, k) : void 0, Y = (e) => {
|
|
54
|
+
let t = f.validateSelection?.(e, {
|
|
55
|
+
month: o(P, f.calendarSystem),
|
|
56
|
+
view: z,
|
|
57
|
+
selection: q,
|
|
58
|
+
preview: J,
|
|
59
|
+
referenceDate: f.referenceDate ?? (f.referenceInstant ? a(f.referenceInstant, f.timeZone ?? "UTC") : void 0)
|
|
60
|
+
});
|
|
61
|
+
if (t === !1 || typeof t == "string") return typeof t == "string" ? t : V;
|
|
62
|
+
}, X = J && !W(J) ? V : void 0, Z = j ?? X, Q = (e) => {
|
|
63
|
+
let t = Y(e);
|
|
64
|
+
return !t || (H(e, t), !1);
|
|
65
|
+
}, $ = (e) => {
|
|
66
|
+
let t = e.selection, n;
|
|
67
|
+
if (f.mode === "multiple") {
|
|
68
|
+
if (!Array.isArray(t) || t.length < Math.max(g, +!!v) || t.length > _ || t.some(U)) return;
|
|
69
|
+
let e = [...new Set(t)];
|
|
70
|
+
if (e.length < Math.max(g, +!!v) || !e.every(Q)) return;
|
|
71
|
+
f.onSelectionChange(e), n = e[0] ?? P;
|
|
72
|
+
} else if (f.mode === "range") {
|
|
73
|
+
if (!t?.from || !W(t) || !Q(t.from) || t.to && !Q(t.to)) return;
|
|
74
|
+
f.onSelectionChange(t), n = t.from;
|
|
75
|
+
} else {
|
|
76
|
+
if (typeof t != "string" || U(t) || !Q(t)) return;
|
|
77
|
+
f.onSelectionChange(t), n = t;
|
|
78
|
+
}
|
|
79
|
+
O(n), B(o(n, f.calendarSystem)), N();
|
|
80
|
+
};
|
|
81
|
+
return /* @__PURE__ */ n(d, {
|
|
82
|
+
...C,
|
|
83
|
+
onViewChange: (e) => {
|
|
84
|
+
R(e), N(), f.onViewChange?.(e);
|
|
85
|
+
},
|
|
86
|
+
month: P,
|
|
87
|
+
focusedDate: D,
|
|
88
|
+
onFocusedDateChange: O,
|
|
89
|
+
onMonthChange: B,
|
|
90
|
+
selection: q,
|
|
91
|
+
selectedDates: f.mode === "multiple" ? f.selected : void 0,
|
|
92
|
+
preview: J,
|
|
93
|
+
previewInvalid: !!(J && Z),
|
|
94
|
+
previewDescription: h === "range" ? Z ?? "" : void 0,
|
|
95
|
+
onInvalidSelection: (e, t) => H(t, e),
|
|
96
|
+
fixedWeeks: f.fixedWeeks ?? !1,
|
|
97
|
+
showOutsideDays: f.showOutsideDays ?? !0,
|
|
98
|
+
allowOutsideMonthSelection: f.allowOutsideMonthSelection ?? !0,
|
|
99
|
+
onPresetSelect: (e) => {
|
|
100
|
+
if (f.mode === "multiple") {
|
|
101
|
+
let t = f.selected ?? [];
|
|
102
|
+
if (t.includes(e)) return;
|
|
103
|
+
if (t.length >= _) {
|
|
104
|
+
H(e);
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
f.onSelectionChange([...t, e]);
|
|
108
|
+
} else f.mode === "range" ? f.onSelectionChange({ from: e }) : f.onSelectionChange(e);
|
|
109
|
+
},
|
|
110
|
+
onSelect: G,
|
|
111
|
+
onPreviewDateChange: N,
|
|
112
|
+
footer: m?.length || f.footer ? /* @__PURE__ */ n(e, { children: [m?.length ? /* @__PURE__ */ n("div", {
|
|
113
|
+
class: "revo-calendar__presets",
|
|
114
|
+
children: m.map((e) => /* @__PURE__ */ n(r, {
|
|
115
|
+
onClick: () => $(e),
|
|
116
|
+
children: e.label
|
|
117
|
+
}, e.label))
|
|
118
|
+
}) : null, f.footer] }) : void 0
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
//#endregion
|
|
122
|
+
export { f as t };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
//#region ../../node_modules/.pnpm/@fortawesome+fontawesome-free@7.3.1/node_modules/@fortawesome/fontawesome-free/svgs/solid/plus.svg?raw
|
|
2
|
+
var e = "<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=\"M256 64c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 160-160 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l160 0 0 160c0 17.7 14.3 32 32 32s32-14.3 32-32l0-160 160 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-160 0 0-160z\"/></svg>";
|
|
3
|
+
//#endregion
|
|
4
|
+
export { e as t };
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { calculateAnchoredPopoverPosition as e } from "../core/anchored-popover.js";
|
|
2
|
+
import { t } from "./jsxRuntime.module-F6UFnpT-.js";
|
|
3
|
+
import { createPreactElement as n, releasePreactElement as r } from "../preact-mount.js";
|
|
4
|
+
import { o as i, r as a, t as o } from "./top-layer-popup-CNSDdfJV.js";
|
|
5
|
+
import { t as s } from "./tooltip-session-B6X6x8G_.js";
|
|
6
|
+
import { createControlId as c } from "../core/control-id.js";
|
|
7
|
+
import { inheritUiMotion as l } from "../core/motion.js";
|
|
8
|
+
//#region src/core/popover-controller.tsx
|
|
9
|
+
var u = /* @__PURE__ */ new WeakMap(), d = class {
|
|
10
|
+
active;
|
|
11
|
+
get isOpen() {
|
|
12
|
+
return !!this.active;
|
|
13
|
+
}
|
|
14
|
+
open(t) {
|
|
15
|
+
this.close(!1);
|
|
16
|
+
let { anchor: n, content: r } = t, s = n.ownerDocument, c = s.defaultView, d = u.get(s) ?? [];
|
|
17
|
+
u.set(s, d);
|
|
18
|
+
let f = r.parentNode, p = r.nextSibling, m = r.hidden, h = r.getAttribute("style"), g = r.getAttribute("popover"), _ = l(n, r), v = () => {
|
|
19
|
+
if (!n.isConnected) {
|
|
20
|
+
x(!1);
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
let a = (t.placement === "above" ? i : e)(n.getBoundingClientRect(), r.getBoundingClientRect(), {
|
|
24
|
+
width: s.documentElement.clientWidth || c?.innerWidth || 0,
|
|
25
|
+
height: s.documentElement.clientHeight || c?.innerHeight || 0
|
|
26
|
+
});
|
|
27
|
+
Object.assign(r.style, {
|
|
28
|
+
left: `${a.left}px`,
|
|
29
|
+
top: `${a.top}px`
|
|
30
|
+
});
|
|
31
|
+
}, y, b = !1, x = (e = t.restoreFocus !== !1) => {
|
|
32
|
+
if (b) return;
|
|
33
|
+
b = !0, s.removeEventListener("pointerdown", S, !0), r.removeEventListener("keydown", C), s.removeEventListener("keydown", C), c?.removeEventListener("resize", v), s.removeEventListener("scroll", v, !0), w?.disconnect();
|
|
34
|
+
let i = d.indexOf(r);
|
|
35
|
+
i !== -1 && d.splice(i, 1), o(r, y), _(), f?.isConnected ? f.insertBefore(r, p?.parentNode === f ? p : null) : r.remove(), h === null ? r.removeAttribute("style") : r.setAttribute("style", h), r.hidden = m, g === null ? r.removeAttribute("popover") : r.setAttribute("popover", g), this.active?.content === r && (this.active = void 0), e && n.isConnected && n.focus({ preventScroll: !0 }), t.onClose?.();
|
|
36
|
+
}, S = (e) => {
|
|
37
|
+
if (d.at(-1) !== r) return;
|
|
38
|
+
let i = e.composedPath();
|
|
39
|
+
t.closeOnOutside !== !1 && !i.includes(n) && !i.includes(r) && x(!1);
|
|
40
|
+
}, C = (e) => {
|
|
41
|
+
d.at(-1) === r && e.key === "Escape" && t.closeOnEscape !== !1 && !e.defaultPrevented && (e.preventDefault(), e.stopPropagation(), x());
|
|
42
|
+
};
|
|
43
|
+
(t.appendTo ?? s.body).append(r), r.hidden = !1, Object.assign(r.style, {
|
|
44
|
+
position: "fixed",
|
|
45
|
+
inset: "auto",
|
|
46
|
+
margin: "0"
|
|
47
|
+
}), y = a(r, t.display ?? "block");
|
|
48
|
+
let w = c?.ResizeObserver ? new c.ResizeObserver(v) : void 0;
|
|
49
|
+
return w?.observe(n), w?.observe(r), this.active = {
|
|
50
|
+
content: r,
|
|
51
|
+
close: x,
|
|
52
|
+
position: v
|
|
53
|
+
}, d.push(r), s.addEventListener("pointerdown", S, !0), r.addEventListener("keydown", C), s.addEventListener("keydown", C), c?.addEventListener("resize", v), s.addEventListener("scroll", v, !0), v(), {
|
|
54
|
+
close: x,
|
|
55
|
+
refresh: v
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
refresh() {
|
|
59
|
+
this.active?.position();
|
|
60
|
+
}
|
|
61
|
+
close(e) {
|
|
62
|
+
this.active?.close(e);
|
|
63
|
+
}
|
|
64
|
+
destroy() {
|
|
65
|
+
this.close(!1);
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
function f(e, r = "grid-tooltip") {
|
|
69
|
+
return n(e, /* @__PURE__ */ t("div", {
|
|
70
|
+
id: c("rv-tooltip"),
|
|
71
|
+
class: r,
|
|
72
|
+
role: "tooltip",
|
|
73
|
+
hidden: !0
|
|
74
|
+
}));
|
|
75
|
+
}
|
|
76
|
+
var p = class {
|
|
77
|
+
release;
|
|
78
|
+
bind(e, t, n = {}) {
|
|
79
|
+
this.destroy();
|
|
80
|
+
let i = n.surface ?? f(e.ownerDocument, "rv-tooltip");
|
|
81
|
+
i.textContent = t;
|
|
82
|
+
let a = new s();
|
|
83
|
+
a.setSurface(i), a.onEscape = n.onEscape;
|
|
84
|
+
let o = n.trigger === "click", c = e.getAttribute("aria-expanded");
|
|
85
|
+
o && e.setAttribute("aria-expanded", "false"), a.onHide = () => {
|
|
86
|
+
o && e.setAttribute("aria-expanded", "false");
|
|
87
|
+
};
|
|
88
|
+
let l = () => {
|
|
89
|
+
a.show(e), o && e.setAttribute("aria-expanded", String(a.isOpen));
|
|
90
|
+
}, u = () => a.isOpen ? a.hide() : l(), d = () => a.focus(e), p = () => a.blur(), m = () => a.leave(e), h = () => {
|
|
91
|
+
a.pointerDown(), a.hide();
|
|
92
|
+
}, g = (e) => a.keyDown(e);
|
|
93
|
+
return o ? e.addEventListener("click", u) : (e.addEventListener("pointerenter", l), e.addEventListener("pointerleave", m), e.addEventListener("focus", d), e.addEventListener("blur", p), e.addEventListener("pointerdown", h), e.addEventListener("keydown", g)), this.release = () => {
|
|
94
|
+
a.destroy(), e.removeEventListener("click", u), e.removeEventListener("pointerenter", l), e.removeEventListener("pointerleave", m), e.removeEventListener("focus", d), e.removeEventListener("blur", p), e.removeEventListener("pointerdown", h), e.removeEventListener("keydown", g), o && (c === null ? e.removeAttribute("aria-expanded") : e.setAttribute("aria-expanded", c)), n.surface || r(i);
|
|
95
|
+
}, () => this.destroy();
|
|
96
|
+
}
|
|
97
|
+
destroy() {
|
|
98
|
+
this.release?.(), this.release = void 0;
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
//#endregion
|
|
102
|
+
export { p as n, f as r, d as t };
|