@emuanalytics/flow-rdf-ui 4.0.5 → 4.0.7
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/dist/components/alert/alert.component.mjs +202 -0
- package/dist/components/alert/alert.mjs +5 -0
- package/dist/components/alert/alert.styles.mjs +107 -0
- package/dist/components/animation/animation.component.mjs +207 -0
- package/dist/components/animation/animation.mjs +5 -0
- package/dist/components/animation/animation.styles.mjs +12 -0
- package/dist/components/animation/animations.mjs +11 -0
- package/dist/components/avatar/avatar.component.mjs +95 -0
- package/dist/components/avatar/avatar.mjs +5 -0
- package/dist/components/avatar/avatar.styles.mjs +70 -0
- package/dist/components/badge/badge.component.mjs +62 -0
- package/dist/components/badge/badge.mjs +5 -0
- package/dist/components/badge/badge.styles.mjs +105 -0
- package/dist/components/breadcrumb/breadcrumb.component.mjs +82 -0
- package/dist/components/breadcrumb/breadcrumb.mjs +5 -0
- package/dist/components/breadcrumb/breadcrumb.styles.mjs +14 -0
- package/dist/components/breadcrumb-item/breadcrumb-item.component.mjs +73 -0
- package/dist/components/breadcrumb-item/breadcrumb-item.mjs +5 -0
- package/dist/components/breadcrumb-item/breadcrumb-item.styles.mjs +90 -0
- package/dist/components/button/button.component.mjs +310 -0
- package/dist/components/button/button.mjs +5 -0
- package/dist/components/button/button.styles.mjs +690 -0
- package/dist/components/button-group/button-group.component.mjs +108 -0
- package/dist/components/button-group/button-group.mjs +5 -0
- package/dist/components/button-group/button-group.styles.mjs +21 -0
- package/dist/components/calendar/calendar.component.mjs +320 -0
- package/dist/components/calendar/calendar.mjs +5 -0
- package/dist/components/calendar/calendar.styles.mjs +145 -0
- package/dist/components/card/card.component.mjs +33 -0
- package/dist/components/card/card.mjs +5 -0
- package/dist/components/card/card.styles.mjs +73 -0
- package/dist/components/carousel/autoplay-controller.mjs +56 -0
- package/dist/components/carousel/carousel.component.mjs +406 -0
- package/dist/components/carousel/carousel.mjs +5 -0
- package/dist/components/carousel/carousel.styles.mjs +162 -0
- package/dist/components/carousel/scroll-controller.mjs +148 -0
- package/dist/components/carousel-item/carousel-item.component.mjs +22 -0
- package/dist/components/carousel-item/carousel-item.mjs +5 -0
- package/dist/components/carousel-item/carousel-item.styles.mjs +28 -0
- package/dist/components/chart/chart.component.mjs +82 -0
- package/dist/components/chart/chart.mjs +5 -0
- package/dist/components/chart/chart.styles.mjs +80 -0
- package/dist/components/chart/chartjs-plugins/interaction.interpolate.mjs +80 -0
- package/dist/components/chart/chartjs-plugins/plugin.flow-ui-colors.mjs +135 -0
- package/dist/components/chart/chartjs-plugins/positioner.cursor.mjs +14 -0
- package/dist/components/chart/chartjs-plugins/symlog.scale.mjs +42 -0
- package/dist/components/chart/chartjs-support.mjs +59 -0
- package/dist/components/checkbox/checkbox.component.mjs +246 -0
- package/dist/components/checkbox/checkbox.mjs +5 -0
- package/dist/components/checkbox/checkbox.styles.mjs +177 -0
- package/dist/components/color-mapper/color-mapper.component.mjs +260 -0
- package/dist/components/color-mapper/color-mapper.mjs +5 -0
- package/dist/components/color-mapper/color-mapper.styles.mjs +92 -0
- package/dist/components/color-mapper/helpers.mjs +55 -0
- package/dist/components/color-picker/color-picker.component.mjs +919 -0
- package/dist/components/color-picker/color-picker.mjs +5 -0
- package/dist/components/color-picker/color-picker.styles.mjs +337 -0
- package/dist/components/color-stop/color-stop.component.mjs +289 -0
- package/dist/components/color-stop/color-stop.mjs +5 -0
- package/dist/components/color-stop/color-stop.styles.mjs +103 -0
- package/dist/components/date-time-picker/date-time-picker.component.mjs +532 -0
- package/dist/components/date-time-picker/date-time-picker.mjs +5 -0
- package/dist/components/date-time-picker/date-time-picker.styles.mjs +260 -0
- package/dist/components/details/details.component.mjs +194 -0
- package/dist/components/details/details.mjs +5 -0
- package/dist/components/details/details.styles.mjs +85 -0
- package/dist/components/dialog/dialog.component.mjs +256 -0
- package/dist/components/dialog/dialog.mjs +5 -0
- package/dist/components/dialog/dialog.styles.mjs +125 -0
- package/dist/components/divider/divider.component.mjs +45 -0
- package/dist/components/divider/divider.mjs +5 -0
- package/dist/components/divider/divider.styles.mjs +34 -0
- package/dist/components/drawer/drawer.component.mjs +354 -0
- package/dist/components/drawer/drawer.mjs +5 -0
- package/dist/components/drawer/drawer.styles.mjs +161 -0
- package/dist/components/dropdown/dropdown.component.mjs +381 -0
- package/dist/components/dropdown/dropdown.mjs +5 -0
- package/dist/components/dropdown/dropdown.styles.mjs +56 -0
- package/dist/components/gauge/gauge.component.mjs +151 -0
- package/dist/components/gauge/gauge.mjs +5 -0
- package/dist/components/gauge/gauge.styles.mjs +127 -0
- package/dist/components/icon/icon.component.mjs +146 -0
- package/dist/components/icon/icon.mjs +5 -0
- package/dist/components/icon/icon.styles.mjs +35 -0
- package/dist/components/icon/library.default.mjs +38 -0
- package/dist/components/icon/library.mjs +38 -0
- package/dist/components/icon/library.system.mjs +158 -0
- package/dist/components/icon-button/icon-button.component.mjs +239 -0
- package/dist/components/icon-button/icon-button.mjs +5 -0
- package/dist/components/icon-button/icon-button.styles.mjs +81 -0
- package/dist/components/input/input.component.mjs +574 -0
- package/dist/components/input/input.mjs +5 -0
- package/dist/components/input/input.styles.mjs +310 -0
- package/dist/components/map/map.component.mjs +196 -0
- package/dist/components/map/map.mjs +5 -0
- package/dist/components/map/map.styles.mjs +90 -0
- package/dist/components/menu/menu.component.mjs +125 -0
- package/dist/components/menu/menu.mjs +5 -0
- package/dist/components/menu/menu.styles.mjs +23 -0
- package/dist/components/menu-item/menu-item.component.mjs +143 -0
- package/dist/components/menu-item/menu-item.mjs +5 -0
- package/dist/components/menu-item/menu-item.styles.mjs +103 -0
- package/dist/components/menu-label/menu-label.component.mjs +14 -0
- package/dist/components/menu-label/menu-label.mjs +5 -0
- package/dist/components/menu-label/menu-label.styles.mjs +24 -0
- package/dist/components/mutation-observer/mutation-observer.component.mjs +115 -0
- package/dist/components/mutation-observer/mutation-observer.mjs +5 -0
- package/dist/components/mutation-observer/mutation-observer.styles.mjs +12 -0
- package/dist/components/option/option.component.mjs +152 -0
- package/dist/components/option/option.mjs +5 -0
- package/dist/components/option/option.styles.mjs +102 -0
- package/dist/components/panel/panel.component.mjs +90 -0
- package/dist/components/panel/panel.mjs +5 -0
- package/dist/components/panel/panel.styles.mjs +51 -0
- package/dist/components/panel-header/panel-header.component.mjs +131 -0
- package/dist/components/panel-header/panel-header.mjs +5 -0
- package/dist/components/panel-header/panel-header.styles.mjs +67 -0
- package/dist/components/popup/popup.component.mjs +420 -0
- package/dist/components/popup/popup.mjs +5 -0
- package/dist/components/popup/popup.styles.mjs +63 -0
- package/dist/components/progress-bar/progress-bar.component.mjs +70 -0
- package/dist/components/progress-bar/progress-bar.mjs +5 -0
- package/dist/components/progress-bar/progress-bar.styles.mjs +87 -0
- package/dist/components/progress-ring/progress-ring.component.mjs +71 -0
- package/dist/components/progress-ring/progress-ring.mjs +5 -0
- package/dist/components/progress-ring/progress-ring.styles.mjs +72 -0
- package/dist/components/query-builder/converters/flow-query-converters.mjs +111 -0
- package/dist/components/query-builder/converters/map-layer-filter-converter.mjs +99 -0
- package/dist/components/query-builder/default-value-templates.mjs +151 -0
- package/dist/components/query-builder/helpers.mjs +42 -0
- package/dist/components/query-builder/query-builder.component.mjs +466 -0
- package/dist/components/query-builder/query-builder.mjs +5 -0
- package/dist/components/query-builder/query-builder.styles.mjs +261 -0
- package/dist/components/radio/radio.component.mjs +144 -0
- package/dist/components/radio/radio.mjs +5 -0
- package/dist/components/radio/radio.styles.mjs +164 -0
- package/dist/components/radio-group/radio-group.component.mjs +310 -0
- package/dist/components/radio-group/radio-group.mjs +5 -0
- package/dist/components/radio-group/radio-group.styles.mjs +49 -0
- package/dist/components/range/range.component.mjs +324 -0
- package/dist/components/range/range.mjs +5 -0
- package/dist/components/range/range.styles.mjs +233 -0
- package/dist/components/resize-observer/resize-observer.component.mjs +80 -0
- package/dist/components/resize-observer/resize-observer.mjs +5 -0
- package/dist/components/resize-observer/resize-observer.styles.mjs +12 -0
- package/dist/components/scroll-view/overlay-scrollbar.styles.mjs +686 -0
- package/dist/components/scroll-view/scroll-view.component.mjs +128 -0
- package/dist/components/scroll-view/scroll-view.mjs +5 -0
- package/dist/components/scroll-view/scroll-view.styles.mjs +57 -0
- package/dist/components/select/select.component.mjs +785 -0
- package/dist/components/select/select.mjs +5 -0
- package/dist/components/select/select.styles.mjs +339 -0
- package/dist/components/spinner/spinner.component.mjs +22 -0
- package/dist/components/spinner/spinner.mjs +5 -0
- package/dist/components/spinner/spinner.styles.mjs +64 -0
- package/dist/components/split-view/split-view.component.mjs +500 -0
- package/dist/components/split-view/split-view.mjs +5 -0
- package/dist/components/split-view/split-view.styles.mjs +33 -0
- package/dist/components/split-view-divider/split-view-divider.component.mjs +98 -0
- package/dist/components/split-view-divider/split-view-divider.mjs +5 -0
- package/dist/components/split-view-divider/split-view-divider.styles.mjs +96 -0
- package/dist/components/split-view-pane/split-view-pane.component.mjs +126 -0
- package/dist/components/split-view-pane/split-view-pane.mjs +5 -0
- package/dist/components/split-view-pane/split-view-pane.styles.mjs +49 -0
- package/dist/components/split-view-toggle-button/split-view-toggle-button.component.mjs +76 -0
- package/dist/components/split-view-toggle-button/split-view-toggle-button.mjs +5 -0
- package/dist/components/split-view-toggle-button/split-view-toggle-button.styles.mjs +40 -0
- package/dist/components/stepper/stepper.component.mjs +139 -0
- package/dist/components/stepper/stepper.mjs +5 -0
- package/dist/components/stepper/stepper.styles.mjs +103 -0
- package/dist/components/stepper-panel/stepper-panel.component.mjs +76 -0
- package/dist/components/stepper-panel/stepper-panel.mjs +5 -0
- package/dist/components/stepper-panel/stepper-panel.styles.mjs +22 -0
- package/dist/components/switch/switch.component.mjs +211 -0
- package/dist/components/switch/switch.mjs +5 -0
- package/dist/components/switch/switch.styles.mjs +166 -0
- package/dist/components/tab/tab.component.mjs +159 -0
- package/dist/components/tab/tab.mjs +5 -0
- package/dist/components/tab/tab.styles.mjs +107 -0
- package/dist/components/tab-group/tab-group.component.mjs +402 -0
- package/dist/components/tab-group/tab-group.mjs +5 -0
- package/dist/components/tab-group/tab-group.styles.mjs +386 -0
- package/dist/components/tab-panel/tab-panel.component.mjs +72 -0
- package/dist/components/tab-panel/tab-panel.mjs +5 -0
- package/dist/components/tab-panel/tab-panel.styles.mjs +55 -0
- package/dist/components/tag/tag.component.mjs +94 -0
- package/dist/components/tag/tag.mjs +5 -0
- package/dist/components/tag/tag.styles.mjs +130 -0
- package/dist/components/textarea/textarea.component.mjs +359 -0
- package/dist/components/textarea/textarea.mjs +5 -0
- package/dist/components/textarea/textarea.styles.mjs +171 -0
- package/dist/components/timer/ticker.mjs +78 -0
- package/dist/components/timer/timer.component.mjs +297 -0
- package/dist/components/timer/timer.mjs +5 -0
- package/dist/components/timer/timer.styles.mjs +95 -0
- package/dist/components/tool-button/tool-button.component.mjs +208 -0
- package/dist/components/tool-button/tool-button.mjs +5 -0
- package/dist/components/tool-button/tool-button.styles.mjs +251 -0
- package/dist/components/tool-button-group/tool-button-group.component.mjs +347 -0
- package/dist/components/tool-button-group/tool-button-group.mjs +5 -0
- package/dist/components/tool-button-group/tool-button-group.styles.mjs +59 -0
- package/dist/components/tooltip/tooltip.component.mjs +259 -0
- package/dist/components/tooltip/tooltip.mjs +5 -0
- package/dist/components/tooltip/tooltip.styles.mjs +57 -0
- package/dist/components/tree/tree.component.mjs +368 -0
- package/dist/components/tree/tree.mjs +5 -0
- package/dist/components/tree/tree.styles.mjs +41 -0
- package/dist/components/tree-item/tree-item.component.mjs +324 -0
- package/dist/components/tree-item/tree-item.mjs +5 -0
- package/dist/components/tree-item/tree-item.styles.mjs +178 -0
- package/dist/components/visually-hidden/visually-hidden.component.mjs +14 -0
- package/dist/components/visually-hidden/visually-hidden.mjs +5 -0
- package/dist/components/visually-hidden/visually-hidden.styles.mjs +20 -0
- package/dist/custom-elements.json +1535 -1530
- package/dist/index.d.mts +145 -132
- package/dist/index.d.ts +145 -132
- package/dist/index.mjs +78 -25094
- package/dist/internal/animate.mjs +47 -0
- package/dist/internal/animations/attention_seekers/bounce.mjs +17 -0
- package/dist/internal/animations/attention_seekers/flash.mjs +9 -0
- package/dist/internal/animations/attention_seekers/headShake.mjs +10 -0
- package/dist/internal/animations/attention_seekers/heartBeat.mjs +9 -0
- package/dist/internal/animations/attention_seekers/jello.mjs +14 -0
- package/dist/internal/animations/attention_seekers/pulse.mjs +7 -0
- package/dist/internal/animations/attention_seekers/rubberBand.mjs +11 -0
- package/dist/internal/animations/attention_seekers/shake.mjs +15 -0
- package/dist/internal/animations/attention_seekers/shakeX.mjs +15 -0
- package/dist/internal/animations/attention_seekers/shakeY.mjs +15 -0
- package/dist/internal/animations/attention_seekers/swing.mjs +9 -0
- package/dist/internal/animations/attention_seekers/tada.mjs +15 -0
- package/dist/internal/animations/attention_seekers/wobble.mjs +11 -0
- package/dist/internal/animations/back_entrances/backInDown.mjs +7 -0
- package/dist/internal/animations/back_entrances/backInLeft.mjs +7 -0
- package/dist/internal/animations/back_entrances/backInRight.mjs +7 -0
- package/dist/internal/animations/back_entrances/backInUp.mjs +7 -0
- package/dist/internal/animations/back_exits/backOutDown.mjs +7 -0
- package/dist/internal/animations/back_exits/backOutLeft.mjs +7 -0
- package/dist/internal/animations/back_exits/backOutRight.mjs +7 -0
- package/dist/internal/animations/back_exits/backOutUp.mjs +7 -0
- package/dist/internal/animations/bouncing_entrances/bounceIn.mjs +16 -0
- package/dist/internal/animations/bouncing_entrances/bounceInDown.mjs +14 -0
- package/dist/internal/animations/bouncing_entrances/bounceInLeft.mjs +14 -0
- package/dist/internal/animations/bouncing_entrances/bounceInRight.mjs +14 -0
- package/dist/internal/animations/bouncing_entrances/bounceInUp.mjs +14 -0
- package/dist/internal/animations/bouncing_exits/bounceOut.mjs +8 -0
- package/dist/internal/animations/bouncing_exits/bounceOutDown.mjs +8 -0
- package/dist/internal/animations/bouncing_exits/bounceOutLeft.mjs +6 -0
- package/dist/internal/animations/bouncing_exits/bounceOutRight.mjs +6 -0
- package/dist/internal/animations/bouncing_exits/bounceOutUp.mjs +8 -0
- package/dist/internal/animations/easings/easings.mjs +33 -0
- package/dist/internal/animations/fading_entrances/fadeIn.mjs +6 -0
- package/dist/internal/animations/fading_entrances/fadeInBottomLeft.mjs +6 -0
- package/dist/internal/animations/fading_entrances/fadeInBottomRight.mjs +6 -0
- package/dist/internal/animations/fading_entrances/fadeInDown.mjs +6 -0
- package/dist/internal/animations/fading_entrances/fadeInDownBig.mjs +6 -0
- package/dist/internal/animations/fading_entrances/fadeInLeft.mjs +6 -0
- package/dist/internal/animations/fading_entrances/fadeInLeftBig.mjs +6 -0
- package/dist/internal/animations/fading_entrances/fadeInRight.mjs +6 -0
- package/dist/internal/animations/fading_entrances/fadeInRightBig.mjs +6 -0
- package/dist/internal/animations/fading_entrances/fadeInTopLeft.mjs +6 -0
- package/dist/internal/animations/fading_entrances/fadeInTopRight.mjs +6 -0
- package/dist/internal/animations/fading_entrances/fadeInUp.mjs +6 -0
- package/dist/internal/animations/fading_entrances/fadeInUpBig.mjs +6 -0
- package/dist/internal/animations/fading_exits/fadeOut.mjs +6 -0
- package/dist/internal/animations/fading_exits/fadeOutBottomLeft.mjs +6 -0
- package/dist/internal/animations/fading_exits/fadeOutBottomRight.mjs +6 -0
- package/dist/internal/animations/fading_exits/fadeOutDown.mjs +6 -0
- package/dist/internal/animations/fading_exits/fadeOutDownBig.mjs +6 -0
- package/dist/internal/animations/fading_exits/fadeOutLeft.mjs +6 -0
- package/dist/internal/animations/fading_exits/fadeOutLeftBig.mjs +6 -0
- package/dist/internal/animations/fading_exits/fadeOutRight.mjs +6 -0
- package/dist/internal/animations/fading_exits/fadeOutRightBig.mjs +6 -0
- package/dist/internal/animations/fading_exits/fadeOutTopLeft.mjs +6 -0
- package/dist/internal/animations/fading_exits/fadeOutTopRight.mjs +6 -0
- package/dist/internal/animations/fading_exits/fadeOutUp.mjs +6 -0
- package/dist/internal/animations/fading_exits/fadeOutUpBig.mjs +6 -0
- package/dist/internal/animations/flippers/flip.mjs +29 -0
- package/dist/internal/animations/flippers/flipInX.mjs +9 -0
- package/dist/internal/animations/flippers/flipInY.mjs +9 -0
- package/dist/internal/animations/flippers/flipOutX.mjs +7 -0
- package/dist/internal/animations/flippers/flipOutY.mjs +7 -0
- package/dist/internal/animations/index.mjs +99 -0
- package/dist/internal/animations/lightspeed/lightSpeedInLeft.mjs +8 -0
- package/dist/internal/animations/lightspeed/lightSpeedInRight.mjs +8 -0
- package/dist/internal/animations/lightspeed/lightSpeedOutLeft.mjs +6 -0
- package/dist/internal/animations/lightspeed/lightSpeedOutRight.mjs +6 -0
- package/dist/internal/animations/rotating_entrances/rotateIn.mjs +6 -0
- package/dist/internal/animations/rotating_entrances/rotateInDownLeft.mjs +6 -0
- package/dist/internal/animations/rotating_entrances/rotateInDownRight.mjs +6 -0
- package/dist/internal/animations/rotating_entrances/rotateInUpLeft.mjs +6 -0
- package/dist/internal/animations/rotating_entrances/rotateInUpRight.mjs +6 -0
- package/dist/internal/animations/rotating_exits/rotateOut.mjs +6 -0
- package/dist/internal/animations/rotating_exits/rotateOutDownLeft.mjs +6 -0
- package/dist/internal/animations/rotating_exits/rotateOutDownRight.mjs +6 -0
- package/dist/internal/animations/rotating_exits/rotateOutUpLeft.mjs +6 -0
- package/dist/internal/animations/rotating_exits/rotateOutUpRight.mjs +6 -0
- package/dist/internal/animations/sliding_entrances/slideInDown.mjs +6 -0
- package/dist/internal/animations/sliding_entrances/slideInLeft.mjs +6 -0
- package/dist/internal/animations/sliding_entrances/slideInRight.mjs +6 -0
- package/dist/internal/animations/sliding_entrances/slideInUp.mjs +6 -0
- package/dist/internal/animations/sliding_exits/slideOutDown.mjs +6 -0
- package/dist/internal/animations/sliding_exits/slideOutLeft.mjs +6 -0
- package/dist/internal/animations/sliding_exits/slideOutRight.mjs +6 -0
- package/dist/internal/animations/sliding_exits/slideOutUp.mjs +6 -0
- package/dist/internal/animations/specials/hinge.mjs +10 -0
- package/dist/internal/animations/specials/jackInTheBox.mjs +8 -0
- package/dist/internal/animations/specials/rollIn.mjs +6 -0
- package/dist/internal/animations/specials/rollOut.mjs +6 -0
- package/dist/internal/animations/zooming_entrances/zoomIn.mjs +6 -0
- package/dist/internal/animations/zooming_entrances/zoomInDown.mjs +16 -0
- package/dist/internal/animations/zooming_entrances/zoomInLeft.mjs +16 -0
- package/dist/internal/animations/zooming_entrances/zoomInRight.mjs +16 -0
- package/dist/internal/animations/zooming_entrances/zoomInUp.mjs +16 -0
- package/dist/internal/animations/zooming_exits/zoomOut.mjs +7 -0
- package/dist/internal/animations/zooming_exits/zoomOutDown.mjs +16 -0
- package/dist/internal/animations/zooming_exits/zoomOutLeft.mjs +6 -0
- package/dist/internal/animations/zooming_exits/zoomOutRight.mjs +6 -0
- package/dist/internal/animations/zooming_exits/zoomOutUp.mjs +16 -0
- package/dist/internal/boolean.mjs +17 -0
- package/dist/internal/datetime.mjs +65 -0
- package/dist/internal/debounce.mjs +14 -0
- package/dist/internal/default-value.mjs +21 -0
- package/dist/internal/drag.mjs +30 -0
- package/dist/internal/ensure-array.mjs +16 -0
- package/dist/internal/event.mjs +13 -0
- package/dist/internal/flow-ui-rdf-element.mjs +61 -0
- package/dist/internal/form.mjs +264 -0
- package/dist/internal/localize.mjs +124 -0
- package/dist/internal/math.mjs +12 -0
- package/dist/internal/modal.mjs +52 -0
- package/dist/internal/offset.mjs +8 -0
- package/dist/internal/orderby.mjs +18 -0
- package/dist/internal/scroll.mjs +47 -0
- package/dist/internal/slot.mjs +59 -0
- package/dist/internal/string.mjs +5 -0
- package/dist/internal/tabbable.mjs +49 -0
- package/dist/internal/throttle.mjs +28 -0
- package/dist/internal/type-checks.mjs +16 -0
- package/dist/internal/watch.mjs +27 -0
- package/dist/package.json.mjs +3 -0
- package/dist/public-api.mjs +10 -0
- package/dist/styles/component.styles.mjs +19 -0
- package/dist/styles/form-control.styles.mjs +63 -0
- package/dist/translations/en.mjs +34 -0
- package/dist/utilities/animation-registry.mjs +33 -0
- package/dist/utilities/announce.mjs +12 -0
- package/dist/utilities/locale.mjs +10 -0
- package/dist/utilities/localize.mjs +7 -0
- package/dist/utilities/register-components.mjs +203 -0
- package/dist/vscode.html-custom-data.json +193 -181
- package/package.json +5 -8
- package/themes/dark.css +6 -2
- package/themes/dark.styles.js +6 -2
- package/themes/light.css +6 -2
- package/themes/light.styles.js +6 -2
- package/dist/icons/index.cjs +0 -4053
- package/dist/icons/index.d.cts +0 -2027
- package/dist/index.cjs +0 -25187
- package/dist/index.d.cts +0 -5678
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
function _roundDateTime(direction, dateTime, unit, precision) {
|
|
2
|
+
const units = {
|
|
3
|
+
hour: {
|
|
4
|
+
maxValue: 24
|
|
5
|
+
},
|
|
6
|
+
minute: {
|
|
7
|
+
maxValue: 60
|
|
8
|
+
},
|
|
9
|
+
second: {
|
|
10
|
+
maxValue: 60
|
|
11
|
+
},
|
|
12
|
+
millisecond: {
|
|
13
|
+
maxValue: 1e3
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
let maxValue = Number.MAX_SAFE_INTEGER;
|
|
17
|
+
let value = 0;
|
|
18
|
+
let rounded = false;
|
|
19
|
+
let subRatio = 1;
|
|
20
|
+
Object.keys(units).forEach((k) => {
|
|
21
|
+
if (k === unit) {
|
|
22
|
+
value = dateTime.get(k);
|
|
23
|
+
maxValue = units[k].maxValue;
|
|
24
|
+
rounded = true;
|
|
25
|
+
} else if (rounded) {
|
|
26
|
+
subRatio *= units[k].maxValue;
|
|
27
|
+
value += dateTime.get(k) / subRatio;
|
|
28
|
+
dateTime = dateTime.set({ [k]: 0 });
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
value = Math[direction](value / precision) * precision;
|
|
32
|
+
value = Math.min(value, maxValue);
|
|
33
|
+
dateTime = dateTime.set({ [unit]: value });
|
|
34
|
+
return dateTime;
|
|
35
|
+
}
|
|
36
|
+
const ceilDateTime = (dateTime, unit, precision) => _roundDateTime("ceil", dateTime, unit, precision);
|
|
37
|
+
const floorDateTime = (dateTime, unit, precision) => _roundDateTime("floor", dateTime, unit, precision);
|
|
38
|
+
const durationRegex = /(-?\d*\.?\d+(?:e[-+]?\d+)?)\s*([a-zμ]*)/i;
|
|
39
|
+
const UNIT_MULTIPLIERS = {
|
|
40
|
+
milliseconds: 1,
|
|
41
|
+
millisecond: 1,
|
|
42
|
+
second: 1e3,
|
|
43
|
+
seconds: 1e3,
|
|
44
|
+
minute: 60 * 1e3,
|
|
45
|
+
minutes: 60 * 1e3,
|
|
46
|
+
hour: 60 * 60 * 1e3,
|
|
47
|
+
hours: 60 * 60 * 1e3,
|
|
48
|
+
day: 24 * 60 * 60 * 1e3,
|
|
49
|
+
days: 24 * 60 * 60 * 1e3
|
|
50
|
+
};
|
|
51
|
+
function parseDuration(str) {
|
|
52
|
+
const match = durationRegex.exec(str);
|
|
53
|
+
if (!match) {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
const value = parseFloat(match[1]);
|
|
57
|
+
const unit = match[2].toLowerCase().replace(/s$/, "");
|
|
58
|
+
if (unit in UNIT_MULTIPLIERS) {
|
|
59
|
+
return {
|
|
60
|
+
[unit]: value
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export { ceilDateTime, floorDateTime, parseDuration };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
const TIMER_ID_KEY = Symbol();
|
|
2
|
+
const debounce = (delay) => {
|
|
3
|
+
return (_target, _propertyKey, descriptor) => {
|
|
4
|
+
const fn = descriptor.value;
|
|
5
|
+
descriptor.value = function(...args) {
|
|
6
|
+
clearTimeout(this[TIMER_ID_KEY]);
|
|
7
|
+
this[TIMER_ID_KEY] = window.setTimeout(() => {
|
|
8
|
+
fn.apply(this, args);
|
|
9
|
+
}, delay);
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export { debounce };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { defaultConverter } from 'lit';
|
|
2
|
+
|
|
3
|
+
const defaultValue = (propertyName = "value") => (proto, key) => {
|
|
4
|
+
const ctor = proto.constructor;
|
|
5
|
+
const attributeChangedCallback = ctor.prototype.attributeChangedCallback;
|
|
6
|
+
ctor.prototype.attributeChangedCallback = function(name, old, value) {
|
|
7
|
+
const options = ctor.getPropertyOptions(propertyName);
|
|
8
|
+
const attributeName = typeof options.attribute === "string" ? options.attribute : propertyName;
|
|
9
|
+
if (name === attributeName) {
|
|
10
|
+
const converter = options.converter || defaultConverter;
|
|
11
|
+
const fromAttribute = typeof converter === "function" ? converter : converter?.fromAttribute ?? defaultConverter.fromAttribute;
|
|
12
|
+
const newValue = fromAttribute(value, options.type);
|
|
13
|
+
if (this[propertyName] !== newValue) {
|
|
14
|
+
this[key] = newValue;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
attributeChangedCallback.call(this, name, old, value);
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export { defaultValue };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
function drag(container, options) {
|
|
2
|
+
function move(pointerEvent) {
|
|
3
|
+
const dims = container.getBoundingClientRect();
|
|
4
|
+
const defaultView = container.ownerDocument.defaultView;
|
|
5
|
+
const offsetX = dims.left + defaultView.pageXOffset;
|
|
6
|
+
const offsetY = dims.top + defaultView.pageYOffset;
|
|
7
|
+
const x = pointerEvent.pageX - offsetX;
|
|
8
|
+
const y = pointerEvent.pageY - offsetY;
|
|
9
|
+
if (options?.onMove) {
|
|
10
|
+
options.onMove(x, y);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
function stop() {
|
|
14
|
+
document.removeEventListener("pointermove", move);
|
|
15
|
+
document.removeEventListener("pointerup", stop);
|
|
16
|
+
if (options?.onStop) {
|
|
17
|
+
options.onStop();
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
document.addEventListener("pointermove", move, { passive: true });
|
|
21
|
+
document.addEventListener("pointerup", stop);
|
|
22
|
+
if (options?.initialEvent instanceof PointerEvent) {
|
|
23
|
+
move(options.initialEvent);
|
|
24
|
+
}
|
|
25
|
+
return () => {
|
|
26
|
+
stop();
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export { drag };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
function ensureArray(a, ..._rest) {
|
|
2
|
+
if (arguments.length === 0) {
|
|
3
|
+
return [];
|
|
4
|
+
}
|
|
5
|
+
if (arguments.length === 1) {
|
|
6
|
+
if (a === void 0 || a === null) {
|
|
7
|
+
return [];
|
|
8
|
+
}
|
|
9
|
+
if (Array.isArray(a)) {
|
|
10
|
+
return a;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
return Array.prototype.slice.call(arguments);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export { ensureArray };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
function waitForEvent(el, eventName) {
|
|
2
|
+
return new Promise((resolve) => {
|
|
3
|
+
function done(event) {
|
|
4
|
+
if (event.target === el) {
|
|
5
|
+
el.removeEventListener(eventName, done);
|
|
6
|
+
resolve();
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
el.addEventListener(eventName, done);
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export { waitForEvent };
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import { property } from 'lit/decorators.js';
|
|
3
|
+
import { watch } from './watch.mjs';
|
|
4
|
+
|
|
5
|
+
var __defProp = Object.defineProperty;
|
|
6
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
7
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
8
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
9
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
10
|
+
if (decorator = decorators[i])
|
|
11
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
12
|
+
if (kind && result)
|
|
13
|
+
__defProp(target, key, result);
|
|
14
|
+
return result;
|
|
15
|
+
};
|
|
16
|
+
class FlowRdfElement extends LitElement {
|
|
17
|
+
emit(name, options) {
|
|
18
|
+
const event = new CustomEvent(name, {
|
|
19
|
+
bubbles: true,
|
|
20
|
+
cancelable: false,
|
|
21
|
+
composed: true,
|
|
22
|
+
detail: {},
|
|
23
|
+
...options
|
|
24
|
+
});
|
|
25
|
+
this.dispatchEvent(event);
|
|
26
|
+
return event;
|
|
27
|
+
}
|
|
28
|
+
static define(name, elementConstructor = this, options = {}) {
|
|
29
|
+
const currentlyRegisteredConstructor = customElements.get(name);
|
|
30
|
+
if (!currentlyRegisteredConstructor) {
|
|
31
|
+
customElements.define(name, class extends elementConstructor {
|
|
32
|
+
}, options);
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
__decorateClass([
|
|
38
|
+
property()
|
|
39
|
+
], FlowRdfElement.prototype, "dir", 2);
|
|
40
|
+
__decorateClass([
|
|
41
|
+
property()
|
|
42
|
+
], FlowRdfElement.prototype, "lang", 2);
|
|
43
|
+
const _FlowRdfFormControl = class _FlowRdfFormControl extends FlowRdfElement {
|
|
44
|
+
handleClassChange() {
|
|
45
|
+
this.classList.add(_FlowRdfFormControl.FLOW_UI_FORM_CONTROL_CLASS);
|
|
46
|
+
}
|
|
47
|
+
connectedCallback() {
|
|
48
|
+
super.connectedCallback();
|
|
49
|
+
this.classList.add(_FlowRdfFormControl.FLOW_UI_FORM_CONTROL_CLASS);
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
_FlowRdfFormControl.FLOW_UI_FORM_CONTROL_CLASS = "flow-ui-form-control";
|
|
53
|
+
__decorateClass([
|
|
54
|
+
property({ reflect: true })
|
|
55
|
+
], _FlowRdfFormControl.prototype, "class", 2);
|
|
56
|
+
__decorateClass([
|
|
57
|
+
watch("class")
|
|
58
|
+
], _FlowRdfFormControl.prototype, "handleClassChange", 1);
|
|
59
|
+
let FlowRdfFormControl = _FlowRdfFormControl;
|
|
60
|
+
|
|
61
|
+
export { FlowRdfFormControl, FlowRdfElement as default };
|
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
const formCollections = /* @__PURE__ */ new WeakMap();
|
|
2
|
+
const reportValidityOverloads = /* @__PURE__ */ new WeakMap();
|
|
3
|
+
const userInteractedControls = /* @__PURE__ */ new WeakSet();
|
|
4
|
+
const interactions = /* @__PURE__ */ new WeakMap();
|
|
5
|
+
class FormControlController {
|
|
6
|
+
constructor(host, options) {
|
|
7
|
+
(this.host = host).addController(this);
|
|
8
|
+
this.options = {
|
|
9
|
+
form: (input) => {
|
|
10
|
+
if (input.hasAttribute("form") && input.getAttribute("form") !== "") {
|
|
11
|
+
const root = input.getRootNode();
|
|
12
|
+
const formId = input.getAttribute("form");
|
|
13
|
+
if (formId) {
|
|
14
|
+
return root.getElementById(formId);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
return input.closest("form");
|
|
18
|
+
},
|
|
19
|
+
name: (input) => input.name,
|
|
20
|
+
value: (input) => input.value,
|
|
21
|
+
defaultValue: (input) => input.defaultValue,
|
|
22
|
+
disabled: (input) => input.disabled ?? false,
|
|
23
|
+
reportValidity: (input) => typeof input.reportValidity === "function" ? input.reportValidity() : true,
|
|
24
|
+
setValue: (input, value) => input.value = value,
|
|
25
|
+
assumeInteractionOn: ["flow-ui-input"],
|
|
26
|
+
...options
|
|
27
|
+
};
|
|
28
|
+
this.handleFormData = this.handleFormData.bind(this);
|
|
29
|
+
this.handleFormSubmit = this.handleFormSubmit.bind(this);
|
|
30
|
+
this.handleFormReset = this.handleFormReset.bind(this);
|
|
31
|
+
this.reportFormValidity = this.reportFormValidity.bind(this);
|
|
32
|
+
this.handleInteraction = this.handleInteraction.bind(this);
|
|
33
|
+
}
|
|
34
|
+
hostConnected() {
|
|
35
|
+
const form = this.options.form(this.host);
|
|
36
|
+
if (form) {
|
|
37
|
+
this.attachForm(form);
|
|
38
|
+
}
|
|
39
|
+
interactions.set(this.host, []);
|
|
40
|
+
this.options.assumeInteractionOn.forEach((event) => {
|
|
41
|
+
this.host.addEventListener(event, this.handleInteraction);
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
hostDisconnected() {
|
|
45
|
+
this.detachForm();
|
|
46
|
+
interactions.delete(this.host);
|
|
47
|
+
this.options.assumeInteractionOn.forEach((event) => {
|
|
48
|
+
this.host.removeEventListener(event, this.handleInteraction);
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
hostUpdated() {
|
|
52
|
+
const form = this.options.form(this.host);
|
|
53
|
+
if (!form) {
|
|
54
|
+
this.detachForm();
|
|
55
|
+
}
|
|
56
|
+
if (form && this.form !== form) {
|
|
57
|
+
this.detachForm();
|
|
58
|
+
this.attachForm(form);
|
|
59
|
+
}
|
|
60
|
+
if (this.host.hasUpdated) {
|
|
61
|
+
this.setValidity(this.host.validity.valid);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
attachForm(form) {
|
|
65
|
+
if (form) {
|
|
66
|
+
this.form = form;
|
|
67
|
+
if (formCollections.has(this.form)) {
|
|
68
|
+
formCollections.get(this.form).add(this.host);
|
|
69
|
+
} else {
|
|
70
|
+
formCollections.set(this.form, /* @__PURE__ */ new Set([this.host]));
|
|
71
|
+
}
|
|
72
|
+
this.form.addEventListener("formdata", this.handleFormData);
|
|
73
|
+
this.form.addEventListener("submit", this.handleFormSubmit);
|
|
74
|
+
this.form.addEventListener("reset", this.handleFormReset);
|
|
75
|
+
if (!reportValidityOverloads.has(this.form)) {
|
|
76
|
+
reportValidityOverloads.set(this.form, this.form.reportValidity);
|
|
77
|
+
this.form.reportValidity = () => this.reportFormValidity();
|
|
78
|
+
}
|
|
79
|
+
} else {
|
|
80
|
+
this.form = void 0;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
detachForm() {
|
|
84
|
+
if (this.form) {
|
|
85
|
+
formCollections.get(this.form)?.delete(this.host);
|
|
86
|
+
this.form.removeEventListener("formdata", this.handleFormData);
|
|
87
|
+
this.form.removeEventListener("submit", this.handleFormSubmit);
|
|
88
|
+
this.form.removeEventListener("reset", this.handleFormReset);
|
|
89
|
+
if (reportValidityOverloads.has(this.form)) {
|
|
90
|
+
this.form.reportValidity = reportValidityOverloads.get(this.form);
|
|
91
|
+
reportValidityOverloads.delete(this.form);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
this.form = void 0;
|
|
95
|
+
}
|
|
96
|
+
handleFormData(event) {
|
|
97
|
+
const disabled = this.options.disabled(this.host);
|
|
98
|
+
const name = this.options.name(this.host);
|
|
99
|
+
const value = this.options.value(this.host);
|
|
100
|
+
const isButton = this.host.tagName.toLowerCase() === "flow-ui-button";
|
|
101
|
+
if (!disabled && !isButton && typeof name === "string" && name.length > 0 && typeof value !== "undefined") {
|
|
102
|
+
if (Array.isArray(value)) {
|
|
103
|
+
value.forEach((val) => {
|
|
104
|
+
event.formData.append(name, val.toString());
|
|
105
|
+
});
|
|
106
|
+
} else {
|
|
107
|
+
event.formData.append(name, value.toString());
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
handleFormSubmit(event) {
|
|
112
|
+
const disabled = this.options.disabled(this.host);
|
|
113
|
+
const reportValidity = this.options.reportValidity;
|
|
114
|
+
if (this.form && !this.form.noValidate) {
|
|
115
|
+
formCollections.get(this.form)?.forEach((control) => {
|
|
116
|
+
this.setUserInteracted(control, true);
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
if (this.form && !this.form.noValidate && !disabled && !reportValidity(this.host)) {
|
|
120
|
+
event.preventDefault();
|
|
121
|
+
event.stopImmediatePropagation();
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
handleFormReset() {
|
|
125
|
+
this.options.setValue(this.host, this.options.defaultValue(this.host));
|
|
126
|
+
this.setUserInteracted(this.host, false);
|
|
127
|
+
interactions.set(this.host, []);
|
|
128
|
+
}
|
|
129
|
+
handleInteraction(event) {
|
|
130
|
+
const emittedEvents = interactions.get(this.host);
|
|
131
|
+
if (!emittedEvents.includes(event.type)) {
|
|
132
|
+
emittedEvents.push(event.type);
|
|
133
|
+
}
|
|
134
|
+
if (emittedEvents.length === this.options.assumeInteractionOn.length) {
|
|
135
|
+
this.setUserInteracted(this.host, true);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
reportFormValidity() {
|
|
139
|
+
if (this.form && !this.form.noValidate) {
|
|
140
|
+
const elements = this.form.querySelectorAll("*");
|
|
141
|
+
for (const element of elements) {
|
|
142
|
+
if (typeof element.reportValidity === "function") {
|
|
143
|
+
if (!element.reportValidity()) {
|
|
144
|
+
return false;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
return true;
|
|
150
|
+
}
|
|
151
|
+
setUserInteracted(el, hasInteracted) {
|
|
152
|
+
if (hasInteracted) {
|
|
153
|
+
userInteractedControls.add(el);
|
|
154
|
+
} else {
|
|
155
|
+
userInteractedControls.delete(el);
|
|
156
|
+
}
|
|
157
|
+
el.requestUpdate();
|
|
158
|
+
}
|
|
159
|
+
doAction(type, submitter) {
|
|
160
|
+
if (this.form) {
|
|
161
|
+
const button = document.createElement("button");
|
|
162
|
+
button.type = type;
|
|
163
|
+
button.style.position = "absolute";
|
|
164
|
+
button.style.width = "0";
|
|
165
|
+
button.style.height = "0";
|
|
166
|
+
button.style.clipPath = "inset(50%)";
|
|
167
|
+
button.style.overflow = "hidden";
|
|
168
|
+
button.style.whiteSpace = "nowrap";
|
|
169
|
+
if (submitter) {
|
|
170
|
+
button.name = submitter.name;
|
|
171
|
+
button.value = submitter.value;
|
|
172
|
+
["formaction", "formenctype", "formmethod", "formnovalidate", "formtarget"].forEach((attr) => {
|
|
173
|
+
if (submitter.hasAttribute(attr)) {
|
|
174
|
+
button.setAttribute(attr, submitter.getAttribute(attr));
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
this.form.append(button);
|
|
179
|
+
button.click();
|
|
180
|
+
button.remove();
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
/** Returns the associated `<form>` element, if one exists. */
|
|
184
|
+
getForm() {
|
|
185
|
+
return this.form ?? null;
|
|
186
|
+
}
|
|
187
|
+
/** Resets the form, restoring all the control to their default value */
|
|
188
|
+
reset(submitter) {
|
|
189
|
+
this.doAction("reset", submitter);
|
|
190
|
+
}
|
|
191
|
+
/** Submits the form, triggering validation and form data injection. */
|
|
192
|
+
submit(submitter) {
|
|
193
|
+
this.doAction("submit", submitter);
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* Synchronously sets the form control's validity. Call this when you know the future validity but need to update
|
|
197
|
+
* the host element immediately, i.e. before Lit updates the component in the next update.
|
|
198
|
+
*/
|
|
199
|
+
setValidity(isValid) {
|
|
200
|
+
const host = this.host;
|
|
201
|
+
const hasInteracted = Boolean(userInteractedControls.has(host));
|
|
202
|
+
const required = Boolean(host.required);
|
|
203
|
+
host.toggleAttribute("data-required", required);
|
|
204
|
+
host.toggleAttribute("data-optional", !required);
|
|
205
|
+
host.toggleAttribute("data-invalid", !isValid);
|
|
206
|
+
host.toggleAttribute("data-valid", isValid);
|
|
207
|
+
host.toggleAttribute("data-user-invalid", !isValid && hasInteracted);
|
|
208
|
+
host.toggleAttribute("data-user-valid", isValid && hasInteracted);
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* Updates the form control's validity based on the current value of `host.validity.valid`. Call this when anything
|
|
212
|
+
* that affects constraint validation changes so the component receives the correct validity states.
|
|
213
|
+
*/
|
|
214
|
+
updateValidity() {
|
|
215
|
+
const host = this.host;
|
|
216
|
+
this.setValidity(host.validity.valid);
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* Dispatches a non-bubbling, cancelable custom event of type `flow-ui-invalid`.
|
|
220
|
+
* If the `flow-ui-invalid` event will be cancelled then the original `invalid`
|
|
221
|
+
* event (which may have been passed as argument) will also be cancelled.
|
|
222
|
+
* If no original `invalid` event has been passed then the `flow-ui-invalid`
|
|
223
|
+
* event will be cancelled before being dispatched.
|
|
224
|
+
*/
|
|
225
|
+
emitInvalidEvent(originalInvalidEvent) {
|
|
226
|
+
const slInvalidEvent = new CustomEvent("flow-ui-invalid", {
|
|
227
|
+
bubbles: false,
|
|
228
|
+
composed: false,
|
|
229
|
+
cancelable: true,
|
|
230
|
+
detail: {}
|
|
231
|
+
});
|
|
232
|
+
if (!originalInvalidEvent) {
|
|
233
|
+
slInvalidEvent.preventDefault();
|
|
234
|
+
}
|
|
235
|
+
if (!this.host.dispatchEvent(slInvalidEvent)) {
|
|
236
|
+
originalInvalidEvent?.preventDefault();
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
const validValidityState = Object.freeze({
|
|
241
|
+
badInput: false,
|
|
242
|
+
customError: false,
|
|
243
|
+
patternMismatch: false,
|
|
244
|
+
rangeOverflow: false,
|
|
245
|
+
rangeUnderflow: false,
|
|
246
|
+
stepMismatch: false,
|
|
247
|
+
tooLong: false,
|
|
248
|
+
tooShort: false,
|
|
249
|
+
typeMismatch: false,
|
|
250
|
+
valid: true,
|
|
251
|
+
valueMissing: false
|
|
252
|
+
});
|
|
253
|
+
const valueMissingValidityState = Object.freeze({
|
|
254
|
+
...validValidityState,
|
|
255
|
+
valid: false,
|
|
256
|
+
valueMissing: true
|
|
257
|
+
});
|
|
258
|
+
const customErrorValidityState = Object.freeze({
|
|
259
|
+
...validValidityState,
|
|
260
|
+
valid: false,
|
|
261
|
+
customError: true
|
|
262
|
+
});
|
|
263
|
+
|
|
264
|
+
export { FormControlController, customErrorValidityState, formCollections, validValidityState, valueMissingValidityState };
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { isDefined } from './type-checks.mjs';
|
|
2
|
+
|
|
3
|
+
const connectedElements = /* @__PURE__ */ new Set();
|
|
4
|
+
const translations = /* @__PURE__ */ new Map();
|
|
5
|
+
let fallback;
|
|
6
|
+
let documentDirection = "ltr";
|
|
7
|
+
let documentLanguage = "en";
|
|
8
|
+
function registerTranslation(...translation) {
|
|
9
|
+
translation.map((t) => {
|
|
10
|
+
const code = t.$code.toLowerCase();
|
|
11
|
+
if (translations.has(code)) {
|
|
12
|
+
translations.set(code, { ...translations.get(code), ...t });
|
|
13
|
+
} else {
|
|
14
|
+
translations.set(code, t);
|
|
15
|
+
}
|
|
16
|
+
if (!fallback) {
|
|
17
|
+
fallback = t;
|
|
18
|
+
const isClient = isDefined(MutationObserver) && isDefined(document) && isDefined(document.documentElement);
|
|
19
|
+
if (isClient) {
|
|
20
|
+
const documentElementObserver = new MutationObserver(update);
|
|
21
|
+
documentDirection = document.documentElement.dir || "ltr";
|
|
22
|
+
documentLanguage = document.documentElement.lang || navigator.language;
|
|
23
|
+
documentElementObserver.observe(document.documentElement, {
|
|
24
|
+
attributes: true,
|
|
25
|
+
attributeFilter: ["dir", "lang"]
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
update();
|
|
31
|
+
}
|
|
32
|
+
function update() {
|
|
33
|
+
const isClient = isDefined(document) && isDefined(document.documentElement);
|
|
34
|
+
if (isClient) {
|
|
35
|
+
documentDirection = document.documentElement.dir || "ltr";
|
|
36
|
+
documentLanguage = document.documentElement.lang || navigator.language;
|
|
37
|
+
}
|
|
38
|
+
[...connectedElements.keys()].map((el) => {
|
|
39
|
+
if (typeof el.requestUpdate === "function") {
|
|
40
|
+
el.requestUpdate();
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
let LocalizeController$1 = class LocalizeController {
|
|
45
|
+
constructor(host) {
|
|
46
|
+
this.host = host;
|
|
47
|
+
this.host.addController(this);
|
|
48
|
+
}
|
|
49
|
+
hostConnected() {
|
|
50
|
+
connectedElements.add(this.host);
|
|
51
|
+
}
|
|
52
|
+
hostDisconnected() {
|
|
53
|
+
connectedElements.delete(this.host);
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Gets the host element's directionality as determined by the `dir` attribute. The return value is transformed to
|
|
57
|
+
* lowercase.
|
|
58
|
+
*/
|
|
59
|
+
dir() {
|
|
60
|
+
return `${this.host.dir || documentDirection}`.toLowerCase();
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Gets the host element's language as determined by the `lang` attribute. The return value is transformed to
|
|
64
|
+
* lowercase.
|
|
65
|
+
*/
|
|
66
|
+
lang() {
|
|
67
|
+
return `${this.host.lang || documentLanguage}`.toLowerCase();
|
|
68
|
+
}
|
|
69
|
+
getTranslationData(lang) {
|
|
70
|
+
const locale = new Intl.Locale(lang.replace(/_/g, "-"));
|
|
71
|
+
const language = locale?.language.toLowerCase();
|
|
72
|
+
const region = locale?.region?.toLowerCase() ?? "";
|
|
73
|
+
const primary = translations.get(`${language}-${region}`);
|
|
74
|
+
const secondary = translations.get(language);
|
|
75
|
+
return { locale, language, region, primary, secondary };
|
|
76
|
+
}
|
|
77
|
+
/** Determines if the specified term exists, optionally checking the fallback translation. */
|
|
78
|
+
exists(key, options) {
|
|
79
|
+
const { primary, secondary } = this.getTranslationData(options.lang ?? this.lang());
|
|
80
|
+
options = {
|
|
81
|
+
includeFallback: false,
|
|
82
|
+
...options
|
|
83
|
+
};
|
|
84
|
+
if (primary && primary[key] || secondary && secondary[key] || options.includeFallback && fallback && fallback[key]) {
|
|
85
|
+
return true;
|
|
86
|
+
}
|
|
87
|
+
return false;
|
|
88
|
+
}
|
|
89
|
+
/** Outputs a translated term. */
|
|
90
|
+
term(key, ...args) {
|
|
91
|
+
const { primary, secondary } = this.getTranslationData(this.lang());
|
|
92
|
+
let term;
|
|
93
|
+
if (primary && primary[key]) {
|
|
94
|
+
term = primary[key];
|
|
95
|
+
} else if (secondary && secondary[key]) {
|
|
96
|
+
term = secondary[key];
|
|
97
|
+
} else if (fallback && fallback[key]) {
|
|
98
|
+
term = fallback[key];
|
|
99
|
+
} else {
|
|
100
|
+
console.error(`No translation found for: ${String(key)}`);
|
|
101
|
+
return String(key);
|
|
102
|
+
}
|
|
103
|
+
if (typeof term === "function") {
|
|
104
|
+
return term(...args);
|
|
105
|
+
}
|
|
106
|
+
return term;
|
|
107
|
+
}
|
|
108
|
+
/** Outputs a localized date in the specified format. */
|
|
109
|
+
date(dateToFormat, options) {
|
|
110
|
+
dateToFormat = new Date(dateToFormat);
|
|
111
|
+
return new Intl.DateTimeFormat(this.lang(), options).format(dateToFormat);
|
|
112
|
+
}
|
|
113
|
+
/** Outputs a localized number in the specified format. */
|
|
114
|
+
number(numberToFormat, options) {
|
|
115
|
+
numberToFormat = Number(numberToFormat);
|
|
116
|
+
return isNaN(numberToFormat) ? "" : new Intl.NumberFormat(this.lang(), options).format(numberToFormat);
|
|
117
|
+
}
|
|
118
|
+
/** Outputs a localized time in relative format. */
|
|
119
|
+
relativeTime(value, unit, options) {
|
|
120
|
+
return new Intl.RelativeTimeFormat(this.lang(), options).format(value, unit);
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
export { LocalizeController$1 as LocalizeController, registerTranslation, update };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
function clamp(value, min, max) {
|
|
2
|
+
const noNegativeZero = (n) => Object.is(n, -0) ? 0 : n;
|
|
3
|
+
if (value < min) {
|
|
4
|
+
return noNegativeZero(min);
|
|
5
|
+
}
|
|
6
|
+
if (value > max) {
|
|
7
|
+
return noNegativeZero(max);
|
|
8
|
+
}
|
|
9
|
+
return noNegativeZero(value);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export { clamp };
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { getTabbableBoundary } from './tabbable.mjs';
|
|
2
|
+
|
|
3
|
+
let activeModals = [];
|
|
4
|
+
class Modal {
|
|
5
|
+
constructor(element) {
|
|
6
|
+
this.tabDirection = "forward";
|
|
7
|
+
this.element = element;
|
|
8
|
+
this.handleFocusIn = this.handleFocusIn.bind(this);
|
|
9
|
+
this.handleKeyDown = this.handleKeyDown.bind(this);
|
|
10
|
+
this.handleKeyUp = this.handleKeyUp.bind(this);
|
|
11
|
+
}
|
|
12
|
+
activate() {
|
|
13
|
+
activeModals.push(this.element);
|
|
14
|
+
document.addEventListener("focusin", this.handleFocusIn);
|
|
15
|
+
document.addEventListener("keydown", this.handleKeyDown);
|
|
16
|
+
document.addEventListener("keyup", this.handleKeyUp);
|
|
17
|
+
}
|
|
18
|
+
deactivate() {
|
|
19
|
+
activeModals = activeModals.filter((modal) => modal !== this.element);
|
|
20
|
+
document.removeEventListener("focusin", this.handleFocusIn);
|
|
21
|
+
document.removeEventListener("keydown", this.handleKeyDown);
|
|
22
|
+
document.removeEventListener("keyup", this.handleKeyUp);
|
|
23
|
+
}
|
|
24
|
+
isActive() {
|
|
25
|
+
return activeModals[activeModals.length - 1] === this.element;
|
|
26
|
+
}
|
|
27
|
+
checkFocus() {
|
|
28
|
+
if (this.isActive()) {
|
|
29
|
+
if (!this.element.matches(":focus-within")) {
|
|
30
|
+
const { start, end } = getTabbableBoundary(this.element);
|
|
31
|
+
const target = this.tabDirection === "forward" ? start : end;
|
|
32
|
+
if (typeof target?.focus === "function") {
|
|
33
|
+
target.focus({ preventScroll: true });
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
handleFocusIn() {
|
|
39
|
+
this.checkFocus();
|
|
40
|
+
}
|
|
41
|
+
handleKeyDown(event) {
|
|
42
|
+
if (event.key === "Tab" && event.shiftKey) {
|
|
43
|
+
this.tabDirection = "backward";
|
|
44
|
+
requestAnimationFrame(() => this.checkFocus());
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
handleKeyUp() {
|
|
48
|
+
this.tabDirection = "forward";
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export { Modal as default };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
function getOffset(element, parent) {
|
|
2
|
+
return {
|
|
3
|
+
top: Math.round(element.getBoundingClientRect().top - parent.getBoundingClientRect().top),
|
|
4
|
+
left: Math.round(element.getBoundingClientRect().left - parent.getBoundingClientRect().left)
|
|
5
|
+
};
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export { getOffset };
|