@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
package/dialog/dialog.preact.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { c as e } from "../_chunks/hooks.module-CG3gN83z.js";
|
|
2
|
+
import { attachDialogDrag as t } from "./dialog.drag.js";
|
|
3
3
|
//#region src/dialog/dialog.preact.ts
|
|
4
4
|
function n({ targetRef: n, handleRef: r, enabled: i = !0 }) {
|
|
5
|
-
|
|
6
|
-
let
|
|
7
|
-
if (i &&
|
|
8
|
-
target:
|
|
5
|
+
e(() => {
|
|
6
|
+
let e = n.current, a = r.current;
|
|
7
|
+
if (i && e && a) return t({
|
|
8
|
+
target: e,
|
|
9
9
|
handle: a
|
|
10
10
|
});
|
|
11
11
|
}, [
|
|
@@ -15,7 +15,9 @@
|
|
|
15
15
|
height: 100%;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
.rv-distribution-chart__plot {
|
|
18
|
+
.rv-distribution-chart__plot {
|
|
19
|
+
overflow: visible;
|
|
20
|
+
}
|
|
19
21
|
|
|
20
22
|
.rv-distribution-chart__series {
|
|
21
23
|
fill: none;
|
|
@@ -23,7 +25,8 @@
|
|
|
23
25
|
stroke-linecap: round;
|
|
24
26
|
stroke-linejoin: round;
|
|
25
27
|
stroke-width: 2.25px;
|
|
26
|
-
transition: stroke var(--rv-ui-motion-fast, 120ms)
|
|
28
|
+
transition: stroke var(--rv-ui-motion-fast, 120ms)
|
|
29
|
+
var(--rv-ui-motion-ease, cubic-bezier(0.2, 0, 0, 1));
|
|
27
30
|
}
|
|
28
31
|
|
|
29
32
|
.rv-distribution-chart__series.is-selected {
|
|
@@ -31,13 +34,22 @@
|
|
|
31
34
|
}
|
|
32
35
|
|
|
33
36
|
.rv-distribution-chart__area {
|
|
34
|
-
fill: color-mix(
|
|
37
|
+
fill: color-mix(
|
|
38
|
+
in srgb,
|
|
39
|
+
var(--rv-distribution-muted, var(--rv-ui-border)) 22%,
|
|
40
|
+
transparent
|
|
41
|
+
);
|
|
35
42
|
stroke: none;
|
|
36
|
-
transition: fill var(--rv-ui-motion-fast, 120ms)
|
|
43
|
+
transition: fill var(--rv-ui-motion-fast, 120ms)
|
|
44
|
+
var(--rv-ui-motion-ease, cubic-bezier(0.2, 0, 0, 1));
|
|
37
45
|
}
|
|
38
46
|
|
|
39
47
|
.rv-distribution-chart__area.is-selected {
|
|
40
|
-
fill: color-mix(
|
|
48
|
+
fill: color-mix(
|
|
49
|
+
in srgb,
|
|
50
|
+
var(--rv-distribution-accent, var(--rv-ui-accent)) 22%,
|
|
51
|
+
transparent
|
|
52
|
+
);
|
|
41
53
|
}
|
|
42
54
|
|
|
43
55
|
.rv-distribution-chart__data {
|
|
@@ -55,7 +67,9 @@
|
|
|
55
67
|
// A datum's tooltip is contained by its stacking context. Raise the active datum,
|
|
56
68
|
// rather than only the tooltip, so it can paint above later bar siblings.
|
|
57
69
|
.rv-distribution-chart__datum:hover,
|
|
58
|
-
.rv-distribution-chart__datum:focus-visible {
|
|
70
|
+
.rv-distribution-chart__datum:focus-visible {
|
|
71
|
+
z-index: 2;
|
|
72
|
+
}
|
|
59
73
|
|
|
60
74
|
.rv-distribution-chart__datum.is-bar {
|
|
61
75
|
display: flex;
|
|
@@ -76,7 +90,11 @@
|
|
|
76
90
|
min-height: 3px;
|
|
77
91
|
border-radius: 2px 2px 0 0;
|
|
78
92
|
background: var(--rv-distribution-muted, var(--rv-ui-border));
|
|
79
|
-
transition:
|
|
93
|
+
transition:
|
|
94
|
+
background-color var(--rv-ui-motion-fast, 120ms)
|
|
95
|
+
var(--rv-ui-motion-ease, cubic-bezier(0.2, 0, 0, 1)),
|
|
96
|
+
opacity var(--rv-ui-motion-fast, 120ms)
|
|
97
|
+
var(--rv-ui-motion-ease, cubic-bezier(0.2, 0, 0, 1));
|
|
80
98
|
}
|
|
81
99
|
|
|
82
100
|
.rv-distribution-chart__datum.is-selected .rv-distribution-chart__bar {
|
|
@@ -94,7 +112,11 @@
|
|
|
94
112
|
border: 2px solid var(--rv-distribution-muted, var(--rv-ui-border));
|
|
95
113
|
border-radius: 50%;
|
|
96
114
|
background: var(--rv-distribution-surface, var(--rv-ui-surface));
|
|
97
|
-
transition:
|
|
115
|
+
transition:
|
|
116
|
+
border-color var(--rv-ui-motion-fast, 120ms)
|
|
117
|
+
var(--rv-ui-motion-ease, cubic-bezier(0.2, 0, 0, 1)),
|
|
118
|
+
background-color var(--rv-ui-motion-fast, 120ms)
|
|
119
|
+
var(--rv-ui-motion-ease, cubic-bezier(0.2, 0, 0, 1));
|
|
98
120
|
}
|
|
99
121
|
|
|
100
122
|
.rv-distribution-chart__datum.is-selected .rv-distribution-chart__point {
|
|
@@ -108,89 +130,103 @@
|
|
|
108
130
|
outline-offset: 2px;
|
|
109
131
|
}
|
|
110
132
|
|
|
111
|
-
.rv-distribution-chart__tooltip {
|
|
112
|
-
position: absolute;
|
|
113
|
-
z-index: 3;
|
|
114
|
-
top: 4px;
|
|
115
|
-
bottom: auto;
|
|
116
|
-
left: 50%;
|
|
117
|
-
display: none;
|
|
118
|
-
width: max-content;
|
|
119
|
-
max-width: 220px;
|
|
120
|
-
padding: 7px 9px;
|
|
121
|
-
transform: translateX(-50%);
|
|
122
|
-
border: 1px solid var(--rv-distribution-border, var(--rv-ui-border));
|
|
123
|
-
border-radius: 7px;
|
|
124
|
-
background: var(--tooltip-bg, var(--rv-ui-text));
|
|
125
|
-
box-shadow: 0 8px 24px var(--rv-ui-shadow);
|
|
126
|
-
color: var(--tooltip-color, var(--rv-ui-surface));
|
|
127
|
-
font: 11px/1.35 system-ui, sans-serif;
|
|
128
|
-
pointer-events: none;
|
|
129
|
-
white-space: nowrap;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
.rv-distribution-chart__datum.is-point .rv-distribution-chart__tooltip {
|
|
133
|
-
top: calc(100% + 7px);
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
.rv-distribution-chart__tooltip strong,
|
|
137
|
-
.rv-distribution-chart__tooltip span { display: block; }
|
|
138
|
-
.rv-distribution-chart__tooltip strong { font-weight: 600; }
|
|
139
|
-
.rv-distribution-chart__tooltip span { opacity: 0.82; }
|
|
140
|
-
|
|
141
|
-
.rv-distribution-chart__datum:first-child .rv-distribution-chart__tooltip {
|
|
142
|
-
left: 0;
|
|
143
|
-
transform: none;
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
.rv-distribution-chart__datum:last-child .rv-distribution-chart__tooltip {
|
|
147
|
-
right: 0;
|
|
148
|
-
left: auto;
|
|
149
|
-
transform: none;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
.rv-distribution-chart__datum:hover .rv-distribution-chart__tooltip,
|
|
153
|
-
.rv-distribution-chart__datum:focus-visible .rv-distribution-chart__tooltip {
|
|
154
|
-
display: block;
|
|
155
|
-
}
|
|
156
|
-
|
|
157
133
|
@media (prefers-reduced-motion: reduce) {
|
|
158
|
-
.rv-distribution-chart__bar {
|
|
134
|
+
.rv-distribution-chart__bar {
|
|
135
|
+
transition: none;
|
|
136
|
+
}
|
|
159
137
|
}
|
|
160
138
|
|
|
161
|
-
.rv-distribution-chart__region {
|
|
139
|
+
.rv-distribution-chart__region {
|
|
140
|
+
position: relative;
|
|
141
|
+
min-width: 0;
|
|
142
|
+
}
|
|
162
143
|
.rv-distribution-chart__grid {
|
|
163
|
-
position: absolute;
|
|
144
|
+
position: absolute;
|
|
145
|
+
inset: 0;
|
|
146
|
+
display: flex;
|
|
147
|
+
flex-direction: column;
|
|
148
|
+
justify-content: space-between;
|
|
164
149
|
pointer-events: none;
|
|
165
|
-
span {
|
|
150
|
+
span {
|
|
151
|
+
border-top: 1px dashed var(--rv-ui-border);
|
|
152
|
+
}
|
|
166
153
|
}
|
|
167
154
|
.rv-distribution-chart__labels {
|
|
168
|
-
display: flex;
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
155
|
+
display: flex;
|
|
156
|
+
justify-content: space-between;
|
|
157
|
+
gap: 8px;
|
|
158
|
+
margin-top: 10px;
|
|
159
|
+
color: var(--rv-ui-text-muted);
|
|
160
|
+
font-size: 11px;
|
|
161
|
+
span {
|
|
162
|
+
min-width: 0;
|
|
163
|
+
max-width: 22%;
|
|
164
|
+
overflow: hidden;
|
|
165
|
+
text-overflow: ellipsis;
|
|
166
|
+
white-space: nowrap;
|
|
167
|
+
}
|
|
168
|
+
&.is-bar span {
|
|
169
|
+
flex: 1;
|
|
170
|
+
text-align: center;
|
|
171
|
+
}
|
|
172
172
|
}
|
|
173
173
|
.rv-distribution-chart__value {
|
|
174
|
-
position: absolute;
|
|
175
|
-
|
|
174
|
+
position: absolute;
|
|
175
|
+
top: 0;
|
|
176
|
+
left: 50%;
|
|
177
|
+
transform: translateX(-50%);
|
|
178
|
+
font-size: 11px;
|
|
179
|
+
font-variant-numeric: tabular-nums;
|
|
180
|
+
color: var(--rv-ui-text);
|
|
181
|
+
}
|
|
182
|
+
.rv-distribution-chart__datum.is-point .rv-distribution-chart__value {
|
|
183
|
+
top: -20px;
|
|
176
184
|
}
|
|
177
|
-
.rv-distribution-chart__datum.is-point .rv-distribution-chart__value { top: -20px; }
|
|
178
185
|
.rv-distribution-chart__legend {
|
|
179
|
-
display: flex;
|
|
180
|
-
|
|
186
|
+
display: flex;
|
|
187
|
+
align-items: center;
|
|
188
|
+
justify-content: center;
|
|
189
|
+
gap: 7px;
|
|
190
|
+
margin-top: 16px;
|
|
191
|
+
font-size: 12px;
|
|
192
|
+
color: var(--rv-ui-text-muted);
|
|
193
|
+
}
|
|
194
|
+
.rv-distribution-chart__legend i {
|
|
195
|
+
display: block;
|
|
196
|
+
width: 8px;
|
|
197
|
+
height: 8px;
|
|
198
|
+
border-radius: 2px;
|
|
199
|
+
background: var(--rv-distribution-accent, var(--rv-ui-accent));
|
|
181
200
|
}
|
|
182
|
-
.rv-distribution-chart__legend i,
|
|
183
|
-
.rv-distribution-chart__tooltip i { display: block; width: 8px; height: 8px; border-radius: 2px; background: var(--rv-distribution-accent, var(--rv-ui-accent)); }
|
|
184
201
|
.rv-distribution-chart__tooltip {
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
202
|
+
strong,
|
|
203
|
+
span {
|
|
204
|
+
display: block;
|
|
205
|
+
}
|
|
206
|
+
i {
|
|
207
|
+
display: block;
|
|
208
|
+
float: inline-start;
|
|
209
|
+
width: 8px;
|
|
210
|
+
height: 8px;
|
|
211
|
+
margin-inline-end: 7px;
|
|
212
|
+
margin-block-start: 3px;
|
|
213
|
+
border-radius: 2px;
|
|
214
|
+
background: var(--rv-distribution-accent, var(--rv-ui-accent));
|
|
215
|
+
}
|
|
216
|
+
&--line i {
|
|
217
|
+
width: 3px;
|
|
218
|
+
height: 22px;
|
|
219
|
+
}
|
|
220
|
+
&--dashed i {
|
|
221
|
+
height: 0;
|
|
222
|
+
background: transparent;
|
|
223
|
+
border-top: 2px dashed var(--rv-distribution-accent, var(--rv-ui-accent));
|
|
224
|
+
margin-block-start: 7px;
|
|
225
|
+
}
|
|
191
226
|
}
|
|
192
|
-
|
|
193
227
|
// Numeric/category progression stays left-to-right, including on RTL pages.
|
|
194
228
|
// Keep SVG points, flex bars, labels and arrow-key order on the same axis.
|
|
195
229
|
.rv-distribution-chart__region,
|
|
196
|
-
.rv-distribution-chart__labels {
|
|
230
|
+
.rv-distribution-chart__labels {
|
|
231
|
+
direction: ltr;
|
|
232
|
+
}
|
|
@@ -1,49 +1,49 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { a as e } from "../_chunks/hooks.module-CG3gN83z.js";
|
|
2
|
+
import { t } from "../_chunks/jsxRuntime.module-F6UFnpT-.js";
|
|
3
|
+
import { i as n, n as r, r as i, t as a } from "../_chunks/chart-frame-hcOlnQ1K.js";
|
|
4
4
|
//#region src/distribution-chart/area-chart.tsx
|
|
5
|
-
function
|
|
6
|
-
let
|
|
7
|
-
let r =
|
|
5
|
+
function o(o) {
|
|
6
|
+
let s = `rv-area-${e().replace(/[^a-zA-Z0-9_-]/g, "")}`, { points: c } = i(o.data), l = o.data.some((e) => e.selected !== void 0), u = c.slice(1).map((e, t) => {
|
|
7
|
+
let r = c[t], i = n(r, e, o.interpolation);
|
|
8
8
|
return {
|
|
9
|
-
key:
|
|
10
|
-
selected: !
|
|
9
|
+
key: o.data[t].key,
|
|
10
|
+
selected: !l || !!(o.data[t].selected && o.data[t + 1].selected),
|
|
11
11
|
line: i,
|
|
12
|
-
area: `${i} L ${
|
|
12
|
+
area: `${i} L ${e.x} 100 L ${r.x} 100 Z`
|
|
13
13
|
};
|
|
14
14
|
});
|
|
15
|
-
return /* @__PURE__ */ a
|
|
16
|
-
...
|
|
15
|
+
return /* @__PURE__ */ t(a, {
|
|
16
|
+
...o,
|
|
17
17
|
variant: "area",
|
|
18
|
-
positions:
|
|
19
|
-
renderDatum: () =>
|
|
18
|
+
positions: c,
|
|
19
|
+
renderDatum: () => o.showPoints === !1 ? null : /* @__PURE__ */ t("span", {
|
|
20
20
|
class: "rv-distribution-chart__point",
|
|
21
21
|
"aria-hidden": "true"
|
|
22
22
|
}),
|
|
23
|
-
children:
|
|
24
|
-
let
|
|
25
|
-
return /* @__PURE__ */
|
|
26
|
-
id: `${
|
|
23
|
+
children: c.length > 0 && /* @__PURE__ */ t(r, { children: [o.areaFill === "gradient" && /* @__PURE__ */ t("defs", { children: [!0, !1].map((e) => {
|
|
24
|
+
let n = e ? "var(--rv-distribution-accent, var(--rv-ui-accent))" : "var(--rv-distribution-muted, var(--rv-ui-border))";
|
|
25
|
+
return /* @__PURE__ */ t("linearGradient", {
|
|
26
|
+
id: `${s}${e ? "" : "-muted"}`,
|
|
27
27
|
gradientUnits: "userSpaceOnUse",
|
|
28
28
|
x1: "0",
|
|
29
29
|
y1: "8",
|
|
30
30
|
x2: "0",
|
|
31
31
|
y2: "100",
|
|
32
|
-
children: [/* @__PURE__ */
|
|
32
|
+
children: [/* @__PURE__ */ t("stop", {
|
|
33
33
|
offset: "0%",
|
|
34
|
-
"stop-color":
|
|
34
|
+
"stop-color": n,
|
|
35
35
|
"stop-opacity": "0.4"
|
|
36
|
-
}), /* @__PURE__ */
|
|
36
|
+
}), /* @__PURE__ */ t("stop", {
|
|
37
37
|
offset: "100%",
|
|
38
|
-
"stop-color":
|
|
38
|
+
"stop-color": n,
|
|
39
39
|
"stop-opacity": "0.02"
|
|
40
40
|
})]
|
|
41
41
|
}, String(e));
|
|
42
|
-
}) }),
|
|
42
|
+
}) }), u.map((e) => /* @__PURE__ */ t("g", { children: [/* @__PURE__ */ t("path", {
|
|
43
43
|
class: `rv-distribution-chart__area${e.selected ? " is-selected" : ""}`,
|
|
44
44
|
d: e.area,
|
|
45
|
-
style:
|
|
46
|
-
}), /* @__PURE__ */
|
|
45
|
+
style: o.areaFill === "gradient" ? { fill: `url(#${s}${e.selected ? "" : "-muted"})` } : void 0
|
|
46
|
+
}), /* @__PURE__ */ t("path", {
|
|
47
47
|
class: `rv-distribution-chart__series rv-distribution-chart__segment${e.selected ? " is-selected" : ""}`,
|
|
48
48
|
d: e.line,
|
|
49
49
|
"vector-effect": "non-scaling-stroke"
|
|
@@ -51,4 +51,4 @@ function s(s) {
|
|
|
51
51
|
});
|
|
52
52
|
}
|
|
53
53
|
//#endregion
|
|
54
|
-
export {
|
|
54
|
+
export { o as AreaChart };
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import { h } from 'preact';
|
|
2
|
-
import { StandaloneChartProps } from './types';
|
|
3
|
-
export
|
|
1
|
+
import { h } from '../_vendor/preact/src/index';
|
|
2
|
+
import { DistributionChartDatum, StandaloneChartProps } from './types';
|
|
3
|
+
export interface BarChartProps extends StandaloneChartProps {
|
|
4
|
+
/** CSS color or per-bar rule. Return undefined to retain the theme color. */
|
|
5
|
+
readonly barColor?: string | ((datum: DistributionChartDatum, index: number) => string | undefined);
|
|
6
|
+
}
|
|
4
7
|
/** Compact bar chart, independent of sliders, filters and grid instances. */
|
|
5
8
|
export declare function BarChart(props: BarChartProps): h.JSX.Element;
|
|
@@ -1,14 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { t as e } from "../_chunks/jsxRuntime.module-F6UFnpT-.js";
|
|
2
|
+
import { r as t, t as n } from "../_chunks/chart-frame-hcOlnQ1K.js";
|
|
3
3
|
//#region src/distribution-chart/bar-chart.tsx
|
|
4
4
|
function r(r) {
|
|
5
|
-
let { values: i, max: a } =
|
|
6
|
-
return /* @__PURE__ */ n
|
|
5
|
+
let { values: i, max: a } = t(r.data), o = r.data.map((e, t) => typeof r.barColor == "function" ? r.barColor(e, t) : r.barColor);
|
|
6
|
+
return /* @__PURE__ */ e(n, {
|
|
7
7
|
...r,
|
|
8
|
+
datumColors: o,
|
|
8
9
|
variant: "bar",
|
|
9
|
-
renderDatum: (
|
|
10
|
+
renderDatum: (t, n) => /* @__PURE__ */ e("span", {
|
|
10
11
|
class: "rv-distribution-chart__bar",
|
|
11
|
-
style: {
|
|
12
|
+
style: {
|
|
13
|
+
backgroundColor: o[n],
|
|
14
|
+
height: `${Math.max(3, i[n] / a * 100)}%`
|
|
15
|
+
},
|
|
12
16
|
"aria-hidden": "true"
|
|
13
17
|
})
|
|
14
18
|
});
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { h, ComponentChildren } from 'preact';
|
|
1
|
+
import { h, ComponentChildren } from '../_vendor/preact/src/index';
|
|
2
2
|
import { DistributionChartDatum, DistributionChartType, StandaloneChartProps } from './types';
|
|
3
3
|
export interface ChartPoint {
|
|
4
4
|
readonly x: number;
|
|
5
5
|
readonly y: number;
|
|
6
6
|
}
|
|
7
7
|
/** Shared accessibility, focus and tooltip lifecycle for the chart primitives. */
|
|
8
|
-
export declare function ChartFrame({ data, ariaLabel, variant, height, className, showGrid, showLabels, showValues, legend, formatValue, tooltip, tooltipIndicator, renderTooltip, positions, renderDatum, children }: StandaloneChartProps & {
|
|
8
|
+
export declare function ChartFrame({ data, ariaLabel, variant, height, className, showGrid, showLabels, showValues, legend, formatValue, tooltip, tooltipIndicator, renderTooltip, positions, datumColors, renderDatum, children, }: StandaloneChartProps & {
|
|
9
9
|
variant: DistributionChartType;
|
|
10
10
|
positions?: readonly ChartPoint[];
|
|
11
|
+
datumColors?: readonly (string | undefined)[];
|
|
11
12
|
renderDatum: (datum: DistributionChartDatum, index: number) => ComponentChildren;
|
|
12
13
|
children?: ComponentChildren;
|
|
13
14
|
}): h.JSX.Element;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { h } from 'preact';
|
|
1
|
+
import { h } from '../_vendor/preact/src/index';
|
|
2
2
|
import { DistributionChartProps } from './types';
|
|
3
3
|
export * from './types';
|
|
4
4
|
export { BarChart, type BarChartProps } from './bar-chart';
|
|
5
5
|
export { LineChart, type LineChartProps } from './line-chart';
|
|
6
6
|
export { AreaChart, type AreaChartProps } from './area-chart';
|
|
7
|
-
/**
|
|
7
|
+
/** Chart-type composition; each presentation has its own standalone owner. */
|
|
8
8
|
export declare function DistributionChart({ type, ...props }: DistributionChartProps): h.JSX.Element;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { t as e } from "../_chunks/jsxRuntime.module-F6UFnpT-.js";
|
|
2
|
+
import { BarChart as t } from "./bar-chart.js";
|
|
3
|
+
import { LineChart as n } from "./line-chart.js";
|
|
4
|
+
import { AreaChart as r } from "./area-chart.js";
|
|
5
5
|
//#region src/distribution-chart/index.tsx
|
|
6
6
|
function i({ type: i = "bar", ...a }) {
|
|
7
|
-
return
|
|
7
|
+
return e(i === "line" ? n : i === "area" ? r : t, { ...a });
|
|
8
8
|
}
|
|
9
9
|
//#endregion
|
|
10
|
-
export {
|
|
10
|
+
export { r as AreaChart, t as BarChart, i as DistributionChart, n as LineChart };
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { t as e } from "../_chunks/jsxRuntime.module-F6UFnpT-.js";
|
|
2
|
+
import { i as t, n, r, t as i } from "../_chunks/chart-frame-hcOlnQ1K.js";
|
|
3
3
|
//#region src/distribution-chart/line-chart.tsx
|
|
4
4
|
function a(a) {
|
|
5
|
-
let { points: o } =
|
|
6
|
-
return /* @__PURE__ */ i
|
|
5
|
+
let { points: o } = r(a.data);
|
|
6
|
+
return /* @__PURE__ */ e(i, {
|
|
7
7
|
...a,
|
|
8
8
|
variant: "line",
|
|
9
9
|
positions: o,
|
|
10
|
-
renderDatum: () => a.showPoints === !1 ? null : /* @__PURE__ */
|
|
10
|
+
renderDatum: () => a.showPoints === !1 ? null : /* @__PURE__ */ e("span", {
|
|
11
11
|
class: "rv-distribution-chart__point",
|
|
12
12
|
"aria-hidden": "true"
|
|
13
13
|
}),
|
|
14
|
-
children: o.length > 0 && /* @__PURE__ */
|
|
15
|
-
class: `rv-distribution-chart__series rv-distribution-chart__segment${a.data[
|
|
16
|
-
d:
|
|
14
|
+
children: o.length > 0 && /* @__PURE__ */ e(n, { children: o.slice(1).map((n, r) => /* @__PURE__ */ e("path", {
|
|
15
|
+
class: `rv-distribution-chart__series rv-distribution-chart__segment${a.data[r].selected && a.data[r + 1].selected ? " is-selected" : ""}`,
|
|
16
|
+
d: t(o[r], n, a.interpolation),
|
|
17
17
|
"vector-effect": "non-scaling-stroke"
|
|
18
|
-
}, a.data[
|
|
18
|
+
}, a.data[r].key)) })
|
|
19
19
|
});
|
|
20
20
|
}
|
|
21
21
|
//#endregion
|
package/dropdown/content.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { h, ComponentChildren, RefObject } from 'preact';
|
|
1
|
+
import { h, ComponentChildren, RefObject } from '../_vendor/preact/src/index';
|
|
2
2
|
import { DropdownConfig, DropdownOption } from './dropdown.types';
|
|
3
3
|
import { RemoteDropdownState, DropdownRemoteText } from './remote';
|
|
4
4
|
type DropdownContentProps<T = any> = {
|
|
@@ -16,7 +16,7 @@ type DropdownContentProps<T = any> = {
|
|
|
16
16
|
theme?: string | null;
|
|
17
17
|
optionIdPrefix: string;
|
|
18
18
|
};
|
|
19
|
-
export declare function DropdownPopupContent<T = any>({ options, selectedValues, remote, value, onChange, config, multiSelect, search, searchPlaceholder, listboxId, searchId, renderOption, renderNoResults, onClose, theme, }: {
|
|
19
|
+
export declare function DropdownPopupContent<T = any>({ options, selectedValues, remote, value, onChange, config, multiSelect, search, searchPlaceholder, listboxId, searchId, renderOption, renderNoResults, onClose, onTabNavigation, theme, }: {
|
|
20
20
|
options: DropdownOption<T>[];
|
|
21
21
|
selectedValues?: DropdownOption<T>[];
|
|
22
22
|
remote?: RemoteDropdownState<T> & {
|
|
@@ -36,6 +36,7 @@ export declare function DropdownPopupContent<T = any>({ options, selectedValues,
|
|
|
36
36
|
renderOption?: (h: any, option: DropdownOption<T>, isSelected: boolean) => ComponentChildren;
|
|
37
37
|
renderNoResults?: (h: any) => ComponentChildren;
|
|
38
38
|
onClose: (focusNext?: boolean) => void;
|
|
39
|
+
onTabNavigation?: () => void;
|
|
39
40
|
theme?: string | null;
|
|
40
41
|
}): h.JSX.Element;
|
|
41
42
|
export declare function DropdownContent<T = any>({ options, filteredOptions, multiSelect, focusedIndex, selectedOptions, onKeyDown, onSelect, onFocusChange, renderOption, renderNoResults, dropdownListRef, theme, optionIdPrefix, }: DropdownContentProps<T>): h.JSX.Element;
|
package/dropdown/content.js
CHANGED
|
@@ -1,141 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { useDropdownService as t } from "./dropdown.service.js";
|
|
3
|
-
import { h as n } from "preact";
|
|
4
|
-
import { Fragment as r, jsx as i, jsxs as a } from "preact/jsx-runtime";
|
|
5
|
-
import { useCallback as o, useEffect as s, useRef as c } from "preact/compat";
|
|
6
|
-
//#region src/dropdown/content.tsx
|
|
7
|
-
function l({ options: n, selectedValues: r, remote: o, value: l, onChange: d, config: f, multiSelect: p, search: m, searchPlaceholder: h, listboxId: g, searchId: _, renderOption: v, renderNoResults: y, onClose: b, theme: x }) {
|
|
8
|
-
let S = c(null), C = c(null), w = c(null), { searchValue: T, focusedIndex: E, selectedOptions: D, filteredOptions: O, handleSelect: k, handleKeyDown: A, handleSearchChange: j, setFocusedIndex: M } = t(n, l, d, f, b, o && {
|
|
9
|
-
selected: r ?? [],
|
|
10
|
-
search: o.search
|
|
11
|
-
}), N = E >= 0 && E < O.length && !O[E].disabled ? `${g}-option-${E}` : void 0;
|
|
12
|
-
return s(() => {
|
|
13
|
-
if (!f.autoFocus) return;
|
|
14
|
-
let e = () => {
|
|
15
|
-
m && S.current ? S.current.focus({ preventScroll: !0 }) : C.current?.focus({ preventScroll: !0 });
|
|
16
|
-
}, t = C.current?.ownerDocument.defaultView ?? (typeof window < "u" ? window : void 0);
|
|
17
|
-
if (!t) return;
|
|
18
|
-
e();
|
|
19
|
-
let n = t.setTimeout(e, 0), r = t.requestAnimationFrame(e), i = t.setTimeout(e, 16);
|
|
20
|
-
return () => {
|
|
21
|
-
t.clearTimeout(n), t.cancelAnimationFrame(r), t.clearTimeout(i);
|
|
22
|
-
};
|
|
23
|
-
}, [f.autoFocus, m]), /* @__PURE__ */ a("div", {
|
|
24
|
-
ref: C,
|
|
25
|
-
className: "dropdown-listbox",
|
|
26
|
-
"data-theme": x ?? "default",
|
|
27
|
-
role: "listbox",
|
|
28
|
-
id: g,
|
|
29
|
-
"aria-multiselectable": p,
|
|
30
|
-
"aria-activedescendant": N,
|
|
31
|
-
tabIndex: -1,
|
|
32
|
-
"aria-busy": o?.loading,
|
|
33
|
-
onScrollCapture: (e) => {
|
|
34
|
-
let t = e.target;
|
|
35
|
-
o && t.scrollHeight - t.scrollTop - t.clientHeight < 48 && o.loadMore();
|
|
36
|
-
},
|
|
37
|
-
onKeyUp: (e) => e.stopPropagation(),
|
|
38
|
-
onKeyDown: (e) => {
|
|
39
|
-
e.stopPropagation(), e.key === "Escape" ? (e.preventDefault(), e.stopPropagation(), b(!1)) : e.key === "Tab" ? (e.preventDefault(), e.stopPropagation(), f.closeOnTab && b(!0)) : (e.key !== " " || e.target !== S.current) && A(e);
|
|
40
|
-
},
|
|
41
|
-
children: [
|
|
42
|
-
m && /* @__PURE__ */ i("div", {
|
|
43
|
-
className: "dropdown-search",
|
|
44
|
-
children: /* @__PURE__ */ i("input", {
|
|
45
|
-
ref: S,
|
|
46
|
-
type: "text",
|
|
47
|
-
id: _,
|
|
48
|
-
className: `dropdown-search-input ${x ? `theme-${x}` : ""}`,
|
|
49
|
-
placeholder: h,
|
|
50
|
-
value: T,
|
|
51
|
-
onChange: j,
|
|
52
|
-
onInput: j,
|
|
53
|
-
"aria-label": f.searchAriaLabel ?? "Search options"
|
|
54
|
-
})
|
|
55
|
-
}),
|
|
56
|
-
o?.loading && /* @__PURE__ */ i("div", {
|
|
57
|
-
role: "status",
|
|
58
|
-
children: o.text.loading
|
|
59
|
-
}),
|
|
60
|
-
o?.error && /* @__PURE__ */ a("div", {
|
|
61
|
-
role: "alert",
|
|
62
|
-
children: [
|
|
63
|
-
o.text.error,
|
|
64
|
-
" ",
|
|
65
|
-
/* @__PURE__ */ i(e, {
|
|
66
|
-
onClick: o.retry,
|
|
67
|
-
children: o.text.retry
|
|
68
|
-
})
|
|
69
|
-
]
|
|
70
|
-
}),
|
|
71
|
-
/* @__PURE__ */ i(u, {
|
|
72
|
-
options: n,
|
|
73
|
-
filteredOptions: O,
|
|
74
|
-
multiSelect: p,
|
|
75
|
-
focusedIndex: E,
|
|
76
|
-
selectedOptions: D,
|
|
77
|
-
onKeyDown: A,
|
|
78
|
-
onSelect: k,
|
|
79
|
-
onFocusChange: M,
|
|
80
|
-
renderOption: v,
|
|
81
|
-
renderNoResults: o ? () => o.loading || o.error ? null : o.text.empty : y,
|
|
82
|
-
dropdownListRef: w,
|
|
83
|
-
theme: x,
|
|
84
|
-
optionIdPrefix: g
|
|
85
|
-
}),
|
|
86
|
-
o?.hasMore && /* @__PURE__ */ i(e, {
|
|
87
|
-
disabled: o.loading,
|
|
88
|
-
onClick: o.loadMore,
|
|
89
|
-
children: o.text.loadMore
|
|
90
|
-
})
|
|
91
|
-
]
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
function u({ options: e, filteredOptions: t, multiSelect: s, focusedIndex: c, selectedOptions: l, onKeyDown: u, onSelect: d, onFocusChange: f, renderOption: p, renderNoResults: m, dropdownListRef: h, theme: g, optionIdPrefix: _ }) {
|
|
95
|
-
let v = o((e) => l.some((t) => JSON.stringify(t.value) === JSON.stringify(e.value)), [l]), y = o((e, t) => {
|
|
96
|
-
let r = v(e), o = c === t;
|
|
97
|
-
return /* @__PURE__ */ i("li", {
|
|
98
|
-
id: `${_}-option-${t}`,
|
|
99
|
-
role: "option",
|
|
100
|
-
"aria-selected": r,
|
|
101
|
-
"aria-disabled": e.disabled,
|
|
102
|
-
tabIndex: -1,
|
|
103
|
-
className: `dropdown-option ${r ? "selected" : ""} ${o ? "focused" : ""} ${e.disabled ? "disabled" : ""} ${g ? `theme-${g}` : ""}`,
|
|
104
|
-
onClick: () => d(e),
|
|
105
|
-
onMouseEnter: () => {
|
|
106
|
-
e.disabled || f(t);
|
|
107
|
-
},
|
|
108
|
-
children: p ? p(n, e, r) : /* @__PURE__ */ a("div", {
|
|
109
|
-
className: "option-content",
|
|
110
|
-
children: [s && /* @__PURE__ */ i("input", {
|
|
111
|
-
type: "checkbox",
|
|
112
|
-
checked: r,
|
|
113
|
-
readOnly: !0,
|
|
114
|
-
disabled: e.disabled,
|
|
115
|
-
tabIndex: -1,
|
|
116
|
-
"aria-hidden": "true"
|
|
117
|
-
}), /* @__PURE__ */ i("span", { children: e.label })]
|
|
118
|
-
})
|
|
119
|
-
}, `${e.label}-${t}`);
|
|
120
|
-
}, [
|
|
121
|
-
c,
|
|
122
|
-
d,
|
|
123
|
-
v,
|
|
124
|
-
s,
|
|
125
|
-
p,
|
|
126
|
-
f,
|
|
127
|
-
g
|
|
128
|
-
]);
|
|
129
|
-
return /* @__PURE__ */ i(r, { children: /* @__PURE__ */ i("ul", {
|
|
130
|
-
ref: h,
|
|
131
|
-
className: "dropdown-options",
|
|
132
|
-
role: "presentation",
|
|
133
|
-
tabIndex: -1,
|
|
134
|
-
children: t.length > 0 ? t.map(y) : /* @__PURE__ */ i("li", {
|
|
135
|
-
className: "no-results",
|
|
136
|
-
children: m ? m(n) : /* @__PURE__ */ i("span", { children: "No results found" })
|
|
137
|
-
})
|
|
138
|
-
}) });
|
|
139
|
-
}
|
|
140
|
-
//#endregion
|
|
141
|
-
export { u as DropdownContent, l as DropdownPopupContent };
|
|
1
|
+
export { f as DropdownContent, p as DropdownPopupContent } from "../_chunks/native-control-B9MNibfa.js";
|