@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,270 +0,0 @@
|
|
|
1
|
-
import { Input as e, Select as t } from "../native-control.js";
|
|
2
|
-
import { SegmentedSwitch as n } from "../segmented-switch/index.js";
|
|
3
|
-
import { SingleValueSlider as r } from "../filter/filters/slider/single.js";
|
|
4
|
-
import { n as i } from "./editor-commit-D6Rf5rGz.js";
|
|
5
|
-
import { EditorActions as a } from "../editor-actions.js";
|
|
6
|
-
import { useEffect as o, useRef as s, useState as c } from "preact/hooks";
|
|
7
|
-
import { Fragment as l, jsx as u, jsxs as d } from "preact/jsx-runtime";
|
|
8
|
-
//#region ../dates/src/duration.ts
|
|
9
|
-
var f = {
|
|
10
|
-
m: "minute",
|
|
11
|
-
min: "minute",
|
|
12
|
-
mins: "minute",
|
|
13
|
-
minute: "minute",
|
|
14
|
-
minutes: "minute",
|
|
15
|
-
h: "hour",
|
|
16
|
-
hr: "hour",
|
|
17
|
-
hrs: "hour",
|
|
18
|
-
hour: "hour",
|
|
19
|
-
hours: "hour",
|
|
20
|
-
d: "day",
|
|
21
|
-
day: "day",
|
|
22
|
-
days: "day",
|
|
23
|
-
w: "week",
|
|
24
|
-
wk: "week",
|
|
25
|
-
wks: "week",
|
|
26
|
-
week: "week",
|
|
27
|
-
weeks: "week",
|
|
28
|
-
mo: "month",
|
|
29
|
-
mon: "month",
|
|
30
|
-
mons: "month",
|
|
31
|
-
month: "month",
|
|
32
|
-
months: "month",
|
|
33
|
-
q: "quarter",
|
|
34
|
-
qr: "quarter",
|
|
35
|
-
qtr: "quarter",
|
|
36
|
-
qtrs: "quarter",
|
|
37
|
-
quarter: "quarter",
|
|
38
|
-
quarters: "quarter",
|
|
39
|
-
y: "year",
|
|
40
|
-
yr: "year",
|
|
41
|
-
yrs: "year",
|
|
42
|
-
year: "year",
|
|
43
|
-
years: "year"
|
|
44
|
-
}, p = {
|
|
45
|
-
minute: ["minute", "minutes"],
|
|
46
|
-
hour: ["hour", "hours"],
|
|
47
|
-
day: ["day", "days"],
|
|
48
|
-
week: ["week", "weeks"],
|
|
49
|
-
month: ["month", "months"],
|
|
50
|
-
quarter: ["quarter", "quarters"],
|
|
51
|
-
year: ["year", "years"]
|
|
52
|
-
};
|
|
53
|
-
function m(e) {
|
|
54
|
-
return typeof e == "number" && Number.isFinite(e) ? Math.min(20, Math.max(0, Math.floor(e))) : 1;
|
|
55
|
-
}
|
|
56
|
-
function h(e, t) {
|
|
57
|
-
let n = t?.defaultUnit ?? "day";
|
|
58
|
-
if (typeof e == "number") return Number.isFinite(e) && e >= 0 ? {
|
|
59
|
-
value: e,
|
|
60
|
-
unit: n,
|
|
61
|
-
elapsed: !1
|
|
62
|
-
} : null;
|
|
63
|
-
if (typeof e != "string") return null;
|
|
64
|
-
let r = e.trim().toLowerCase();
|
|
65
|
-
if (!r) return null;
|
|
66
|
-
let i = r.match(/^([+]?(?:\d+(?:\.\d+)?|\.\d+))\s*(.*)$/);
|
|
67
|
-
if (!i) return null;
|
|
68
|
-
let a = Number(i[1]);
|
|
69
|
-
if (!Number.isFinite(a) || a < 0) return null;
|
|
70
|
-
let o = i[2].trim().replace(/\s+/g, " "), s = !1;
|
|
71
|
-
if (o.startsWith("elapsed ") ? (s = !0, o = o.slice(8).trim()) : o.startsWith("e") && o.length > 1 && f[o.slice(1)] && (s = !0, o = o.slice(1)), s && t?.allowElapsed === !1) return null;
|
|
72
|
-
let c = o ? f[o] : n;
|
|
73
|
-
return c ? {
|
|
74
|
-
value: a,
|
|
75
|
-
unit: c,
|
|
76
|
-
elapsed: s
|
|
77
|
-
} : null;
|
|
78
|
-
}
|
|
79
|
-
function g(e, t) {
|
|
80
|
-
return Number(e.toFixed(m(t)));
|
|
81
|
-
}
|
|
82
|
-
function _(e, t, n) {
|
|
83
|
-
let r = g(e, n?.maximumFractionDigits ?? 1), i = p[t], a = Math.abs(Math.abs(r) - 1) < 1e-9 ? i[0] : i[1];
|
|
84
|
-
return `${r} ${n?.elapsed ? "elapsed " : ""}${a}`;
|
|
85
|
-
}
|
|
86
|
-
//#endregion
|
|
87
|
-
//#region ../dates/src/duration-control.ts
|
|
88
|
-
function v(e, t) {
|
|
89
|
-
if (e == null || typeof e == "string" && !e.trim()) return {
|
|
90
|
-
valid: !t.required,
|
|
91
|
-
value: null
|
|
92
|
-
};
|
|
93
|
-
let n = h(typeof e == "object" && e && "unit" in e && "value" in e ? `${String(e.value)}${"elapsed" in e && e.elapsed ? " elapsed " : " "}${String(e.unit)}` : e, {
|
|
94
|
-
...t,
|
|
95
|
-
allowElapsed: t.allowElapsed ?? !1
|
|
96
|
-
}), r = !!n && (!t.allowedUnits || t.allowedUnits.includes(n.unit)) && (t.min === void 0 || n.value >= t.min) && (t.max === void 0 || n.value <= t.max);
|
|
97
|
-
return {
|
|
98
|
-
valid: r,
|
|
99
|
-
value: r ? n : null
|
|
100
|
-
};
|
|
101
|
-
}
|
|
102
|
-
//#endregion
|
|
103
|
-
//#region src/duration/controls.tsx
|
|
104
|
-
var y = {
|
|
105
|
-
minute: "min",
|
|
106
|
-
hour: "hour",
|
|
107
|
-
day: "day",
|
|
108
|
-
week: "week",
|
|
109
|
-
month: "month",
|
|
110
|
-
quarter: "qtr",
|
|
111
|
-
year: "year"
|
|
112
|
-
};
|
|
113
|
-
function b(e) {
|
|
114
|
-
let { unit: i, amount: a } = e, o = e.onCommit ?? e.onChange, s = [...new Set(e.allowedUnits ?? Object.keys(y))], c = typeof e.slider == "object" ? e.slider : {}, f = Number.isFinite(e.min) ? Math.max(0, e.min) : 0, p = Math.max(f + 100, a), m = Number.isFinite(e.max) ? e.max : Number.isFinite(c.max) ? c.max : p, h = Number.isFinite(c.step) && c.step > 0 ? c.step : 1;
|
|
115
|
-
return /* @__PURE__ */ d(l, { children: [e.slider && /* @__PURE__ */ d("span", {
|
|
116
|
-
class: "rv-duration-field__slider",
|
|
117
|
-
children: [/* @__PURE__ */ u(r, {
|
|
118
|
-
min: f,
|
|
119
|
-
max: m,
|
|
120
|
-
step: h,
|
|
121
|
-
value: e.amount,
|
|
122
|
-
disabled: e.disabled || m <= f,
|
|
123
|
-
ariaLabel: e.label ?? "Duration",
|
|
124
|
-
ariaValueText: e.draft,
|
|
125
|
-
onChange: (t) => e.onChange(t),
|
|
126
|
-
onCommit: e.onCommit ? (t) => e.onCommit?.(t) : void 0
|
|
127
|
-
}), /* @__PURE__ */ d("span", {
|
|
128
|
-
class: "rv-duration-field__bounds",
|
|
129
|
-
"aria-hidden": "true",
|
|
130
|
-
children: [/* @__PURE__ */ u("span", { children: f }), /* @__PURE__ */ d("span", { children: [
|
|
131
|
-
m,
|
|
132
|
-
" ",
|
|
133
|
-
e.unitLabels?.[i] ?? y[i]
|
|
134
|
-
] })]
|
|
135
|
-
})]
|
|
136
|
-
}), e.unitButtons && /* @__PURE__ */ d("span", {
|
|
137
|
-
class: "rv-duration-field__modes",
|
|
138
|
-
children: [s.length === 0 ? null : s.length > 5 ? /* @__PURE__ */ u(t, {
|
|
139
|
-
"aria-label": e.unitLabel ?? "Duration unit",
|
|
140
|
-
value: i,
|
|
141
|
-
disabled: e.disabled,
|
|
142
|
-
onChange: (e) => o(a, e.currentTarget.value),
|
|
143
|
-
children: s.map((t) => /* @__PURE__ */ u("option", {
|
|
144
|
-
value: t,
|
|
145
|
-
children: e.unitLabels?.[t] ?? y[t]
|
|
146
|
-
}, t))
|
|
147
|
-
}) : /* @__PURE__ */ u(n, {
|
|
148
|
-
role: "radiogroup",
|
|
149
|
-
ariaLabel: e.unitLabel ?? "Duration unit",
|
|
150
|
-
value: i,
|
|
151
|
-
options: s.map((t) => ({
|
|
152
|
-
value: t,
|
|
153
|
-
label: e.unitLabels?.[t] ?? y[t],
|
|
154
|
-
ariaLabel: e.unitLabels?.[t] ?? t
|
|
155
|
-
})),
|
|
156
|
-
disabled: e.disabled,
|
|
157
|
-
onChange: (e) => o(a, e)
|
|
158
|
-
}), e.allowElapsed && /* @__PURE__ */ u(n, {
|
|
159
|
-
role: "radiogroup",
|
|
160
|
-
ariaLabel: e.modeLabel ?? "Duration mode",
|
|
161
|
-
value: e.elapsed ? "elapsed" : "working",
|
|
162
|
-
options: [{
|
|
163
|
-
value: "working",
|
|
164
|
-
label: e.workingLabel ?? "Working"
|
|
165
|
-
}, {
|
|
166
|
-
value: "elapsed",
|
|
167
|
-
label: e.elapsedLabel ?? "Elapsed"
|
|
168
|
-
}],
|
|
169
|
-
disabled: e.disabled,
|
|
170
|
-
onChange: (e) => o(a, i, e === "elapsed")
|
|
171
|
-
})]
|
|
172
|
-
})] });
|
|
173
|
-
}
|
|
174
|
-
//#endregion
|
|
175
|
-
//#region src/duration/index.tsx
|
|
176
|
-
function x(t) {
|
|
177
|
-
let n = (e) => e && typeof e == "object" ? _(e.value, e.unit, {
|
|
178
|
-
elapsed: e.elapsed,
|
|
179
|
-
maximumFractionDigits: t.maximumFractionDigits ?? 10
|
|
180
|
-
}) : e === null ? "" : String(e), [r, i] = c(() => v(t.value, t).value?.unit ?? t.defaultUnit), [a, l] = c(() => n(t.value)), f = s(t.value);
|
|
181
|
-
o(() => {
|
|
182
|
-
t.value !== f.current && (f.current = t.value, l(n(t.value)), i(v(t.value, t).value?.unit ?? t.defaultUnit));
|
|
183
|
-
}, [t.value]);
|
|
184
|
-
let p = {
|
|
185
|
-
...t,
|
|
186
|
-
defaultUnit: t.unitButtons ? r : t.defaultUnit
|
|
187
|
-
}, m = v(a, p);
|
|
188
|
-
o(() => t.onValidityChange?.(m.valid), [m.valid]);
|
|
189
|
-
let h = t.disabled || t.readOnly, g = m.value, y = g?.unit ?? r, x = g?.value ?? 0, S = (e) => {
|
|
190
|
-
l(e), t.onDraftChange?.(e);
|
|
191
|
-
let n = v(e, p);
|
|
192
|
-
n.valid && (n.value && i(n.value.unit), f.current = n.value, t.onChange(n.value));
|
|
193
|
-
}, C = (e, n = y, r = g?.elapsed ?? !1, i = !1) => {
|
|
194
|
-
if (h) return;
|
|
195
|
-
let a = _(e, n, {
|
|
196
|
-
elapsed: r,
|
|
197
|
-
maximumFractionDigits: t.maximumFractionDigits ?? 10
|
|
198
|
-
});
|
|
199
|
-
S(a);
|
|
200
|
-
let o = v(a, p);
|
|
201
|
-
i && o.valid && t.onCommit?.(o.value);
|
|
202
|
-
};
|
|
203
|
-
return /* @__PURE__ */ d("span", {
|
|
204
|
-
class: `rv-duration-field ${t.className ?? ""}`,
|
|
205
|
-
children: [
|
|
206
|
-
/* @__PURE__ */ u(e, {
|
|
207
|
-
type: "text",
|
|
208
|
-
"aria-label": t.label ?? "Duration",
|
|
209
|
-
"aria-invalid": !m.valid,
|
|
210
|
-
value: a,
|
|
211
|
-
disabled: t.disabled,
|
|
212
|
-
readOnly: t.readOnly,
|
|
213
|
-
placeholder: t.placeholder ?? `2 ${t.unitLabels?.[t.defaultUnit] ?? t.defaultUnit}`,
|
|
214
|
-
onInput: (e) => S(e.currentTarget.value)
|
|
215
|
-
}),
|
|
216
|
-
/* @__PURE__ */ u(b, {
|
|
217
|
-
...t,
|
|
218
|
-
unit: y,
|
|
219
|
-
amount: x,
|
|
220
|
-
draft: a,
|
|
221
|
-
elapsed: g?.elapsed ?? !1,
|
|
222
|
-
disabled: h || !m.valid && !!a.trim(),
|
|
223
|
-
onChange: C,
|
|
224
|
-
onCommit: (e, t, n) => C(e, t, n, !0)
|
|
225
|
-
}),
|
|
226
|
-
!m.valid && /* @__PURE__ */ u("span", {
|
|
227
|
-
role: "alert",
|
|
228
|
-
class: "rv-editor-error",
|
|
229
|
-
children: t.invalidText ?? "Enter a valid duration within the allowed units and bounds."
|
|
230
|
-
})
|
|
231
|
-
]
|
|
232
|
-
});
|
|
233
|
-
}
|
|
234
|
-
function S({ value: e, options: t, apply: n, cancel: r }) {
|
|
235
|
-
let [o, l] = c(!1), [f, p] = c(e), [m, h] = c(0), g = t.autoApply !== !1, _ = s(!1), y = s(e), b = (e = !1) => {
|
|
236
|
-
let r = v(y.current, t);
|
|
237
|
-
return r.valid ? ((e || !g || _.current) && (_.current = !1, n(r.value)), !0) : !1;
|
|
238
|
-
};
|
|
239
|
-
return i(b, g), /* @__PURE__ */ d("div", {
|
|
240
|
-
onKeyDown: (e) => {
|
|
241
|
-
let t = e.target instanceof HTMLInputElement && e.target.type === "text";
|
|
242
|
-
!e.isComposing && e.key === "Enter" && (g && t || e.ctrlKey || e.metaKey) && (e.preventDefault(), b(!0));
|
|
243
|
-
},
|
|
244
|
-
children: [/* @__PURE__ */ u(x, {
|
|
245
|
-
...t,
|
|
246
|
-
value: f,
|
|
247
|
-
onChange: (e) => {
|
|
248
|
-
_.current = !0, p(e);
|
|
249
|
-
},
|
|
250
|
-
onDraftChange: (e) => {
|
|
251
|
-
_.current = !0, y.current = e;
|
|
252
|
-
},
|
|
253
|
-
onCommit: g ? (e) => {
|
|
254
|
-
_.current = !1, n(e);
|
|
255
|
-
} : void 0,
|
|
256
|
-
onValidityChange: l
|
|
257
|
-
}, m), /* @__PURE__ */ u(a, {
|
|
258
|
-
showConfirm: t.showActions ?? !g,
|
|
259
|
-
text: t.actions,
|
|
260
|
-
disabled: !o,
|
|
261
|
-
apply: () => b(!0),
|
|
262
|
-
cancel: r,
|
|
263
|
-
clear: t.required ? void 0 : () => {
|
|
264
|
-
g ? n(null) : (y.current = null, p(null), h((e) => e + 1));
|
|
265
|
-
}
|
|
266
|
-
})]
|
|
267
|
-
});
|
|
268
|
-
}
|
|
269
|
-
//#endregion
|
|
270
|
-
export { x as n, S as t };
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { createContext as e } from "preact";
|
|
2
|
-
import { useContext as t, useLayoutEffect as n, useRef as r } from "preact/hooks";
|
|
3
|
-
//#region src/core/editor-commit.tsx
|
|
4
|
-
var i = e(void 0);
|
|
5
|
-
function a(e, a = !0) {
|
|
6
|
-
let o = t(i), s = r(e);
|
|
7
|
-
s.current = e, n(() => {
|
|
8
|
-
if (a) return o?.(() => s.current());
|
|
9
|
-
}, [o, a]);
|
|
10
|
-
}
|
|
11
|
-
//#endregion
|
|
12
|
-
export { a as n, i as t };
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import { calculateAnchoredPopoverPosition as e } from "../core/anchored-popover.js";
|
|
2
|
-
import { createPreactElement as t, releasePreactElement as n } from "../preact-mount.js";
|
|
3
|
-
import { hideTopLayerPopup as r, showTopLayerPopup as i } from "../core/top-layer-popup.js";
|
|
4
|
-
import { t as a } from "./editor-commit-D6Rf5rGz.js";
|
|
5
|
-
import { jsx as o } from "preact/jsx-runtime";
|
|
6
|
-
//#region src/core/editor-popup-position.ts
|
|
7
|
-
function s(t, n, r, i = 4, a = 8) {
|
|
8
|
-
let o = Math.max(0, r.height - a - t.bottom - i), s = Math.max(0, t.top - a - i), c = n.height <= o || o >= s ? "below" : "above", l = c === "below" ? o : s, u = Math.min(n.height, l);
|
|
9
|
-
return {
|
|
10
|
-
...e(t, n, r, i, a),
|
|
11
|
-
placementY: c,
|
|
12
|
-
maxHeight: l,
|
|
13
|
-
top: c === "below" ? t.bottom + i : t.top - u - i
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
//#endregion
|
|
17
|
-
//#region src/core/editor-popup.tsx
|
|
18
|
-
var c = /* @__PURE__ */ new WeakMap();
|
|
19
|
-
function l(e, l, u) {
|
|
20
|
-
let d = e.ownerDocument, f = d.defaultView;
|
|
21
|
-
c.get(d)?.close();
|
|
22
|
-
let p = !1, m, h = (e) => (m = e, () => {
|
|
23
|
-
m === e && (m = void 0);
|
|
24
|
-
}), g = () => {
|
|
25
|
-
p || (p = !0, T.disconnect(), w?.disconnect(), d.removeEventListener("pointerdown", v, !0), d.removeEventListener("keydown", y, !0), d.removeEventListener("scroll", b, !0), f.removeEventListener("resize", g), r(x, S), n(x), x.remove(), c.get(d)?.element === x && c.delete(d), u.onClose?.(), e.isConnected && e.focus({ preventScroll: !0 }));
|
|
26
|
-
}, _ = (e) => e ? x.contains(e) ? !0 : [...x.querySelectorAll("[aria-controls]")].some((t) => t.getAttribute("aria-controls")?.split(" ").some((t) => d.getElementById(t)?.contains(e))) : !1, v = (t) => {
|
|
27
|
-
_(t.target) || e.contains(t.target) || (u.isAvailable && !u.isAvailable() ? g() : m?.() === !1 ? (t.preventDefault(), t.stopPropagation()) : g());
|
|
28
|
-
}, y = (e) => {
|
|
29
|
-
if (e.key === "Escape") {
|
|
30
|
-
if (x.querySelector("[aria-expanded=\"true\"]")) return;
|
|
31
|
-
e.preventDefault(), e.stopPropagation(), g();
|
|
32
|
-
}
|
|
33
|
-
if (e.key === "Tab" && x.contains(e.target)) {
|
|
34
|
-
let t = [...x.querySelectorAll("button:not(:disabled),input:not(:disabled),textarea:not(:disabled),select:not(:disabled),[contenteditable=\"true\"],[tabindex=\"0\"]")].filter((e) => e.tabIndex >= 0 && e.getClientRects().length), n = t[0], r = t.at(-1);
|
|
35
|
-
e.shiftKey && d.activeElement === n ? (e.preventDefault(), r?.focus()) : !e.shiftKey && d.activeElement === r && (e.preventDefault(), n?.focus());
|
|
36
|
-
}
|
|
37
|
-
}, b = (t) => {
|
|
38
|
-
let n = t.target;
|
|
39
|
-
_(n) || n && (n.contains(e) || E?.contains(n)) && C();
|
|
40
|
-
}, x = t(d, /* @__PURE__ */ o("div", {
|
|
41
|
-
class: `rv-editor-popup ${u.className ?? ""}`,
|
|
42
|
-
role: "dialog",
|
|
43
|
-
"aria-label": u.label,
|
|
44
|
-
onKeyDown: (e) => e.stopPropagation(),
|
|
45
|
-
onKeyUp: (e) => e.stopPropagation(),
|
|
46
|
-
onMouseDown: (e) => e.stopPropagation(),
|
|
47
|
-
onClick: (e) => e.stopPropagation(),
|
|
48
|
-
children: /* @__PURE__ */ o(a.Provider, {
|
|
49
|
-
value: h,
|
|
50
|
-
children: l(g)
|
|
51
|
-
})
|
|
52
|
-
}));
|
|
53
|
-
x.style.direction = f.getComputedStyle(e).direction, (e.closest("dialog, [role=\"dialog\"], [role=\"menu\"]") ?? e.closest("revo-grid") ?? d.body).append(x);
|
|
54
|
-
let S = i(x, "block"), C = () => {
|
|
55
|
-
x.style.maxHeight = "";
|
|
56
|
-
let t = s(e.getBoundingClientRect(), x.getBoundingClientRect(), {
|
|
57
|
-
width: f.innerWidth,
|
|
58
|
-
height: f.innerHeight
|
|
59
|
-
});
|
|
60
|
-
x.style.maxHeight = `${t.maxHeight}px`, x.style.left = `${t.left}px`, x.style.top = `${t.top}px`, x.dataset.placement = t.placementY;
|
|
61
|
-
};
|
|
62
|
-
C();
|
|
63
|
-
let w = typeof f.ResizeObserver == "function" ? new f.ResizeObserver(C) : void 0;
|
|
64
|
-
w?.observe(x), w?.observe(e);
|
|
65
|
-
let T = new MutationObserver(() => {
|
|
66
|
-
(!e.isConnected || !x.isConnected || u.isAvailable && !u.isAvailable()) && g();
|
|
67
|
-
});
|
|
68
|
-
T.observe(d.body, {
|
|
69
|
-
childList: !0,
|
|
70
|
-
subtree: !0
|
|
71
|
-
});
|
|
72
|
-
let E = e.closest("revo-grid");
|
|
73
|
-
E && u.isAvailable && T.observe(E, { attributes: !0 }), d.addEventListener("pointerdown", v, !0), d.addEventListener("keydown", y, !0), d.addEventListener("scroll", b, !0), f.addEventListener("resize", g);
|
|
74
|
-
let D = {
|
|
75
|
-
element: x,
|
|
76
|
-
close: g
|
|
77
|
-
};
|
|
78
|
-
return c.set(d, D), x.querySelector("[autofocus],input,textarea,button,[tabindex=\"0\"]")?.focus({ preventScroll: !0 }), D;
|
|
79
|
-
}
|
|
80
|
-
//#endregion
|
|
81
|
-
export { l as t };
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { n as e } from "./component-metadata-BENbgTjU.js";
|
|
2
|
-
import { h as t, render as n } from "preact";
|
|
3
|
-
import { useLayoutEffect as r, useRef as i } from "preact/hooks";
|
|
4
|
-
//#region src/framework-mount.ts
|
|
5
|
-
function a(e, a) {
|
|
6
|
-
let o = /* @__PURE__ */ new Map(), s = !1, c = 0;
|
|
7
|
-
function l({ content: e, scope: n }) {
|
|
8
|
-
let l = i(null);
|
|
9
|
-
return r(() => {
|
|
10
|
-
let t = l.current;
|
|
11
|
-
if (!t || s) return;
|
|
12
|
-
let r = o.get(t)?.id ?? c++;
|
|
13
|
-
o.set(t, {
|
|
14
|
-
id: r,
|
|
15
|
-
element: t,
|
|
16
|
-
content: e,
|
|
17
|
-
scope: n
|
|
18
|
-
}), a([...o.values()]);
|
|
19
|
-
}, [e, n]), r(() => {
|
|
20
|
-
let e = l.current;
|
|
21
|
-
return () => {
|
|
22
|
-
e && o.delete(e), s || a([...o.values()]);
|
|
23
|
-
};
|
|
24
|
-
}, []), t("span", {
|
|
25
|
-
ref: l,
|
|
26
|
-
style: { display: "contents" },
|
|
27
|
-
"data-rv-framework-content": ""
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
let u = (e, n = {}) => t(l, {
|
|
31
|
-
content: e,
|
|
32
|
-
scope: n
|
|
33
|
-
});
|
|
34
|
-
return {
|
|
35
|
-
render(r, i, a) {
|
|
36
|
-
if (s) throw Error("Cannot update a destroyed UI mount");
|
|
37
|
-
n(t(r, a ? a(i, u) : i), e);
|
|
38
|
-
},
|
|
39
|
-
destroy() {
|
|
40
|
-
s || (s = !0, n(null, e), o.clear());
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
function o(t, n, r, i) {
|
|
45
|
-
let a = { ...n }, o = e(t);
|
|
46
|
-
for (let [e, t] of Object.entries(r)) {
|
|
47
|
-
if (t == null) continue;
|
|
48
|
-
let n = o[e];
|
|
49
|
-
n ? a[n.prop] = (...e) => (n.skipFactory && (e = e.slice(1)), i(t, Object.fromEntries(n.args.map((t, n) => [t, e[n]])))) : a[e === "default" ? "children" : e] = i(t);
|
|
50
|
-
}
|
|
51
|
-
return a;
|
|
52
|
-
}
|
|
53
|
-
//#endregion
|
|
54
|
-
export { o as n, a as t };
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import { a as e, i as t, l as n, n as r, o as i, r as a, t as o } from "./request-trail-D0oVzdRd.js";
|
|
2
|
-
import { n as s } from "./controls-NEL5tDaz.js";
|
|
3
|
-
import { render as c } from "preact";
|
|
4
|
-
import { useEffect as l, useRef as u, useState as d } from "preact/hooks";
|
|
5
|
-
import { jsx as f, jsxs as p } from "preact/jsx-runtime";
|
|
6
|
-
//#region src/ai/mount.tsx
|
|
7
|
-
function m(m, h) {
|
|
8
|
-
let g = (e) => n(e, h.translations), _ = !1;
|
|
9
|
-
function v({ state: n }) {
|
|
10
|
-
let [c, _] = d(""), v = u(), y = n.phase === "understanding" || n.phase === "applying", b = n.steps ?? [];
|
|
11
|
-
l(() => {
|
|
12
|
-
if (y || n.phase === "idle" || v.current === void 0) return;
|
|
13
|
-
let e = v.current;
|
|
14
|
-
v.current = void 0, n.phase === "completed" && _((t) => t.trim() === e ? "" : t);
|
|
15
|
-
}, [n]);
|
|
16
|
-
let x = (e) => {
|
|
17
|
-
v.current = e.trim(), h.onSubmit(e);
|
|
18
|
-
};
|
|
19
|
-
return /* @__PURE__ */ p(a, {
|
|
20
|
-
translations: h.translations,
|
|
21
|
-
label: h.label,
|
|
22
|
-
busy: y,
|
|
23
|
-
footer: h.footer,
|
|
24
|
-
children: [
|
|
25
|
-
/* @__PURE__ */ f(i, {
|
|
26
|
-
items: n.suggestions?.length ? n.suggestions : h.suggestions ?? [],
|
|
27
|
-
onSelect: (e) => {
|
|
28
|
-
y || (_(e), x(e));
|
|
29
|
-
},
|
|
30
|
-
disabled: y
|
|
31
|
-
}),
|
|
32
|
-
/* @__PURE__ */ f(t, {
|
|
33
|
-
...h.prompt,
|
|
34
|
-
value: c,
|
|
35
|
-
onValueChange: _,
|
|
36
|
-
onSubmit: x,
|
|
37
|
-
onStop: h.onStop,
|
|
38
|
-
busy: y,
|
|
39
|
-
hint: b.length ? "" : h.prompt?.hint,
|
|
40
|
-
actions: /* @__PURE__ */ f(o, {
|
|
41
|
-
...h.trail,
|
|
42
|
-
items: b,
|
|
43
|
-
onRemove: (e) => h.onRemoveStep?.(e),
|
|
44
|
-
onClear: h.onReset,
|
|
45
|
-
onEmpty: () => m.querySelector("textarea")?.focus(),
|
|
46
|
-
disabled: y,
|
|
47
|
-
removalsDisabled: !h.onRemoveStep || n.canEditSteps === !1,
|
|
48
|
-
clearDescription: h.trail?.clearDescription ?? "Restore the starting view",
|
|
49
|
-
clearLabel: h.trail?.clearLabel ?? h.resetLabel ?? "Clear all",
|
|
50
|
-
changedMessage: !y && b.length > 0 && n.canEditSteps === !1 ? h.trail?.changedMessage ?? "The view changed manually. Start a new request to continue." : void 0
|
|
51
|
-
})
|
|
52
|
-
}),
|
|
53
|
-
/* @__PURE__ */ f(r, {
|
|
54
|
-
phase: n.phase,
|
|
55
|
-
message: n.phase === "completed" ? "" : n.message
|
|
56
|
-
}),
|
|
57
|
-
n.phase === "completed" && /* @__PURE__ */ f(e, {
|
|
58
|
-
summary: n.message,
|
|
59
|
-
matchedRows: n.matchedRows,
|
|
60
|
-
countLabel: h.countLabel
|
|
61
|
-
}),
|
|
62
|
-
/* @__PURE__ */ p("div", {
|
|
63
|
-
class: "rv-ai-result-actions",
|
|
64
|
-
children: [/* @__PURE__ */ f(s, {
|
|
65
|
-
disabled: y || !n.canRestore,
|
|
66
|
-
onClick: h.onRestore,
|
|
67
|
-
size: "compact",
|
|
68
|
-
children: g(h.restoreLabel ?? "Restore previous view")
|
|
69
|
-
}), !b.length && /* @__PURE__ */ f(s, {
|
|
70
|
-
disabled: y,
|
|
71
|
-
onClick: h.onReset,
|
|
72
|
-
size: "compact",
|
|
73
|
-
variant: "ghost",
|
|
74
|
-
children: g(h.resetLabel ?? "Reset view")
|
|
75
|
-
})]
|
|
76
|
-
})
|
|
77
|
-
]
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
return {
|
|
81
|
-
update(e) {
|
|
82
|
-
_ || c(/* @__PURE__ */ f(v, { state: e }), m);
|
|
83
|
-
},
|
|
84
|
-
destroy() {
|
|
85
|
-
_ || (_ = !0, c(null, m));
|
|
86
|
-
}
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
//#endregion
|
|
90
|
-
export { m as t };
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { createPreactElement as e } from "../preact-mount.js";
|
|
2
|
-
import { controlClassName as t } from "../control-attributes.js";
|
|
3
|
-
import { renderControl as n } from "../control-presentation.js";
|
|
4
|
-
import { h as r } from "preact";
|
|
5
|
-
import { jsx as i } from "preact/jsx-runtime";
|
|
6
|
-
//#region src/search-input/native.view.tsx
|
|
7
|
-
function a(e, r) {
|
|
8
|
-
let { shortcut: i, hideIcon: a, inputAttributes: o = {} } = r;
|
|
9
|
-
return e("div", {
|
|
10
|
-
class: t("rv-search-input", a && "rv-search-input--no-icon", i === void 0 && "rv-search-input--no-shortcut", r.rootClassName),
|
|
11
|
-
"data-testid": r.testId
|
|
12
|
-
}, !a && e("span", {
|
|
13
|
-
class: t("rv-search-input-icon", r.iconClassName),
|
|
14
|
-
"aria-hidden": "true"
|
|
15
|
-
}, r.icon), r.leading, n(e, "input", {
|
|
16
|
-
type: "search",
|
|
17
|
-
...o,
|
|
18
|
-
class: t(r.inputClassName, o.class)
|
|
19
|
-
}), i !== void 0 && e("span", { class: t("rv-search-input-shortcut", r.shortcutClassName) }, i), r.trailing);
|
|
20
|
-
}
|
|
21
|
-
function o(t, n) {
|
|
22
|
-
let o = e(t, a(r, {
|
|
23
|
-
...n,
|
|
24
|
-
icon: /* @__PURE__ */ i("span", { dangerouslySetInnerHTML: { __html: n.iconSvg } })
|
|
25
|
-
}));
|
|
26
|
-
return {
|
|
27
|
-
root: o,
|
|
28
|
-
input: o.querySelector("input")
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
//#endregion
|
|
32
|
-
export { a as n, o as t };
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
import { ButtonControl as e } from "../native-control.js";
|
|
2
|
-
import { DEFAULT_CALENDAR_TRANSLATIONS as t } from "../calendar/translations.js";
|
|
3
|
-
import { n } from "./iso-B0YHBK7m.js";
|
|
4
|
-
import { f as r, h as i, m as a, o, p as s } from "./model-mPO2tG2f.js";
|
|
5
|
-
import { t as c } from "./calendar-BsDxCYhI.js";
|
|
6
|
-
import { useState as l } from "preact/hooks";
|
|
7
|
-
import { Fragment as u, jsx as d, jsxs as f } from "preact/jsx-runtime";
|
|
8
|
-
//#region src/calendar/picker.tsx
|
|
9
|
-
function p(p) {
|
|
10
|
-
let { selected: m, onSelectionChange: ee, presets: h, mode: g = "single", min: _ = 0, max: v = Infinity, required: y = !1, excludeDisabled: b = !1, month: x, defaultMonth: S, onMonthChange: C, ...w } = p, T = typeof m == "string" ? m : Array.isArray(m) ? m[0] : m?.from, [E, D] = l(S ?? T ?? p.referenceDate ?? i()), [O, k] = l(T ?? E), [A, j] = l(), [M, N] = l(), P = (e) => {
|
|
11
|
-
j(e), N(void 0);
|
|
12
|
-
}, F = x ?? E, I = p.views?.filter((e) => e === "month" || e === "year"), L = I?.length ? I : p.views || p.enableYearView === !1 ? ["month"] : ["month", "year"], [R, z] = l(p.defaultView && L.includes(p.defaultView) ? p.defaultView : L[0]), B = L.includes(R) ? R : L[0], V = (e) => {
|
|
13
|
-
D(e), P(), C?.(e);
|
|
14
|
-
}, H = p.translations?.invalidSelection ?? t.invalidSelection, U = (e, t = H) => {
|
|
15
|
-
j(e), N(t), p.onInvalidSelection?.(t, e);
|
|
16
|
-
}, W = (e) => !!(p.minDate && e < p.minDate || p.maxDate && e > p.maxDate || p.isDateDisabled?.(e) || p.isMonthDisabled?.(r(e, p.calendarSystem))), G = (e) => {
|
|
17
|
-
if (!e.to) return !W(e.from);
|
|
18
|
-
let t = a(e.from, e.to);
|
|
19
|
-
if (t < _ || t > v || t < 0 || W(e.from) || W(e.to)) return !1;
|
|
20
|
-
if (b) {
|
|
21
|
-
if (t > 366e3) return !1;
|
|
22
|
-
for (let t = e.from; t <= e.to; t = s(t, 1)) if (W(t)) return !1;
|
|
23
|
-
}
|
|
24
|
-
return !0;
|
|
25
|
-
}, K = (e) => {
|
|
26
|
-
if (p.mode === "multiple") {
|
|
27
|
-
let t = p.selected ?? [], n = t.includes(e), r = n ? t.filter((t) => t !== e) : [...t, e];
|
|
28
|
-
if (n && r.length < Math.max(_, +!!y) || r.length > v) {
|
|
29
|
-
U(e);
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
|
-
p.onSelectionChange(r);
|
|
33
|
-
} else if (p.mode === "range") {
|
|
34
|
-
let t = p.selected;
|
|
35
|
-
if (!t || t.to) {
|
|
36
|
-
p.onSelectionChange({ from: e }), P();
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
let n = o(t.from, e);
|
|
40
|
-
if (!G(n)) {
|
|
41
|
-
b && a(n.from, n.to) >= _ && a(n.from, n.to) <= v && p.onSelectionChange({ from: e }), U(e);
|
|
42
|
-
return;
|
|
43
|
-
}
|
|
44
|
-
p.onSelectionChange(n), P();
|
|
45
|
-
} else p.onSelectionChange(p.selected === e && !y ? void 0 : e);
|
|
46
|
-
}, q = p.mode === "range" ? p.selected : void 0, J = typeof m == "string" ? {
|
|
47
|
-
from: m,
|
|
48
|
-
to: m
|
|
49
|
-
} : q ? {
|
|
50
|
-
from: q.from,
|
|
51
|
-
to: q.to ?? q.from
|
|
52
|
-
} : void 0, Y = q && !q.to && A ? o(q.from, A) : void 0, X = (e) => {
|
|
53
|
-
let t = p.validateSelection?.(e, {
|
|
54
|
-
month: r(F, p.calendarSystem),
|
|
55
|
-
view: B,
|
|
56
|
-
selection: J,
|
|
57
|
-
preview: Y,
|
|
58
|
-
referenceDate: p.referenceDate ?? (p.referenceInstant ? n(p.referenceInstant, p.timeZone ?? "UTC") : void 0)
|
|
59
|
-
});
|
|
60
|
-
if (t === !1 || typeof t == "string") return typeof t == "string" ? t : H;
|
|
61
|
-
}, Z = Y && !G(Y) ? H : void 0, Q = M ?? Z, $ = (e) => {
|
|
62
|
-
let t = X(e);
|
|
63
|
-
return !t || (U(e, t), !1);
|
|
64
|
-
}, te = (e) => {
|
|
65
|
-
let t = e.selection, n;
|
|
66
|
-
if (p.mode === "multiple") {
|
|
67
|
-
if (!Array.isArray(t) || t.length < Math.max(_, +!!y) || t.length > v || t.some(W)) return;
|
|
68
|
-
let e = [...new Set(t)];
|
|
69
|
-
if (e.length < Math.max(_, +!!y) || !e.every($)) return;
|
|
70
|
-
p.onSelectionChange(e), n = e[0] ?? F;
|
|
71
|
-
} else if (p.mode === "range") {
|
|
72
|
-
if (!t?.from || !G(t) || !$(t.from) || t.to && !$(t.to)) return;
|
|
73
|
-
p.onSelectionChange(t), n = t.from;
|
|
74
|
-
} else {
|
|
75
|
-
if (typeof t != "string" || W(t) || !$(t)) return;
|
|
76
|
-
p.onSelectionChange(t), n = t;
|
|
77
|
-
}
|
|
78
|
-
k(n), V(r(n, p.calendarSystem)), P();
|
|
79
|
-
};
|
|
80
|
-
return /* @__PURE__ */ d(c, {
|
|
81
|
-
...w,
|
|
82
|
-
onViewChange: (e) => {
|
|
83
|
-
z(e), P(), p.onViewChange?.(e);
|
|
84
|
-
},
|
|
85
|
-
month: F,
|
|
86
|
-
focusedDate: O,
|
|
87
|
-
onFocusedDateChange: k,
|
|
88
|
-
onMonthChange: V,
|
|
89
|
-
selection: J,
|
|
90
|
-
selectedDates: p.mode === "multiple" ? p.selected : void 0,
|
|
91
|
-
preview: Y,
|
|
92
|
-
previewInvalid: !!(Y && Q),
|
|
93
|
-
previewDescription: g === "range" ? Q ?? "" : void 0,
|
|
94
|
-
onInvalidSelection: (e, t) => U(t, e),
|
|
95
|
-
fixedWeeks: p.fixedWeeks ?? !1,
|
|
96
|
-
showOutsideDays: p.showOutsideDays ?? !0,
|
|
97
|
-
allowOutsideMonthSelection: p.allowOutsideMonthSelection ?? !0,
|
|
98
|
-
onPresetSelect: (e) => {
|
|
99
|
-
if (p.mode === "multiple") {
|
|
100
|
-
let t = p.selected ?? [];
|
|
101
|
-
if (t.includes(e)) return;
|
|
102
|
-
if (t.length >= v) {
|
|
103
|
-
U(e);
|
|
104
|
-
return;
|
|
105
|
-
}
|
|
106
|
-
p.onSelectionChange([...t, e]);
|
|
107
|
-
} else p.mode === "range" ? p.onSelectionChange({ from: e }) : p.onSelectionChange(e);
|
|
108
|
-
},
|
|
109
|
-
onSelect: K,
|
|
110
|
-
onPreviewDateChange: P,
|
|
111
|
-
footer: h?.length || p.footer ? /* @__PURE__ */ f(u, { children: [h?.length ? /* @__PURE__ */ d("div", {
|
|
112
|
-
class: "revo-calendar__presets",
|
|
113
|
-
children: h.map((t) => /* @__PURE__ */ d(e, {
|
|
114
|
-
onClick: () => te(t),
|
|
115
|
-
children: t.label
|
|
116
|
-
}, t.label))
|
|
117
|
-
}) : null, p.footer] }) : void 0
|
|
118
|
-
});
|
|
119
|
-
}
|
|
120
|
-
//#endregion
|
|
121
|
-
export { p as t };
|