@emuanalytics/flow-rdf-ui 4.0.4 → 4.0.6
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 +293 -0
- package/dist/components/timer/timer.mjs +5 -0
- package/dist/components/timer/timer.styles.mjs +94 -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 +6494 -6508
- package/dist/index.d.mts +141 -132
- package/dist/index.d.ts +141 -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 +429 -429
- package/package.json +5 -8
- 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,310 @@
|
|
|
1
|
+
import { html } from 'lit';
|
|
2
|
+
import { query, state, property } from 'lit/decorators.js';
|
|
3
|
+
import { classMap } from 'lit/directives/class-map.js';
|
|
4
|
+
import { boolean } from '../../internal/boolean.mjs';
|
|
5
|
+
import { FlowRdfFormControl } from '../../internal/flow-ui-rdf-element.mjs';
|
|
6
|
+
import { FormControlController, customErrorValidityState, valueMissingValidityState, validValidityState } from '../../internal/form.mjs';
|
|
7
|
+
import { HasSlotController } from '../../internal/slot.mjs';
|
|
8
|
+
import { watch } from '../../internal/watch.mjs';
|
|
9
|
+
import styles from './radio-group.styles.mjs';
|
|
10
|
+
|
|
11
|
+
var __defProp = Object.defineProperty;
|
|
12
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
13
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
14
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
15
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
16
|
+
if (decorator = decorators[i])
|
|
17
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
18
|
+
if (kind && result)
|
|
19
|
+
__defProp(target, key, result);
|
|
20
|
+
return result;
|
|
21
|
+
};
|
|
22
|
+
class FlowUiRadioGroup extends FlowRdfFormControl {
|
|
23
|
+
constructor() {
|
|
24
|
+
super(...arguments);
|
|
25
|
+
this.formControlController = new FormControlController(this);
|
|
26
|
+
this.hasSlotController = new HasSlotController(this, "help-text", "label");
|
|
27
|
+
this.customValidityMessage = "";
|
|
28
|
+
this.errorMessage = "";
|
|
29
|
+
this.defaultValue = "";
|
|
30
|
+
this.label = "";
|
|
31
|
+
this.helpText = "";
|
|
32
|
+
this.name = "option";
|
|
33
|
+
this.value = "";
|
|
34
|
+
this.size = "medium";
|
|
35
|
+
this.variant = "secondary";
|
|
36
|
+
this.form = "";
|
|
37
|
+
this.required = false;
|
|
38
|
+
this.fullWidth = false;
|
|
39
|
+
}
|
|
40
|
+
/** Gets the validity state object */
|
|
41
|
+
get validity() {
|
|
42
|
+
const isRequiredAndEmpty = this.required && !this.value;
|
|
43
|
+
const hasCustomValidityMessage = this.customValidityMessage !== "";
|
|
44
|
+
if (hasCustomValidityMessage) {
|
|
45
|
+
return customErrorValidityState;
|
|
46
|
+
} else if (isRequiredAndEmpty) {
|
|
47
|
+
return valueMissingValidityState;
|
|
48
|
+
}
|
|
49
|
+
return validValidityState;
|
|
50
|
+
}
|
|
51
|
+
/** Gets the validation message */
|
|
52
|
+
get validationMessage() {
|
|
53
|
+
const isRequiredAndEmpty = this.required && !this.value;
|
|
54
|
+
const hasCustomValidityMessage = this.customValidityMessage !== "";
|
|
55
|
+
if (hasCustomValidityMessage) {
|
|
56
|
+
return this.customValidityMessage;
|
|
57
|
+
} else if (isRequiredAndEmpty) {
|
|
58
|
+
return this.validationInput.validationMessage;
|
|
59
|
+
}
|
|
60
|
+
return "";
|
|
61
|
+
}
|
|
62
|
+
connectedCallback() {
|
|
63
|
+
super.connectedCallback();
|
|
64
|
+
this.required = boolean(this.required, true);
|
|
65
|
+
this.fullWidth = boolean(this.fullWidth, true);
|
|
66
|
+
this.defaultValue = this.value;
|
|
67
|
+
}
|
|
68
|
+
firstUpdated() {
|
|
69
|
+
this.formControlController.updateValidity();
|
|
70
|
+
}
|
|
71
|
+
getAllRadios() {
|
|
72
|
+
return [...this.querySelectorAll("flow-ui-radio")];
|
|
73
|
+
}
|
|
74
|
+
handleRadioClick(event) {
|
|
75
|
+
const target = event.target.closest("flow-ui-radio");
|
|
76
|
+
const radios = this.getAllRadios();
|
|
77
|
+
const oldValue = this.value;
|
|
78
|
+
if (target.disabled) {
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
this.value = target.value;
|
|
82
|
+
radios.forEach((radio) => radio.checked = radio === target);
|
|
83
|
+
if (this.value !== oldValue) {
|
|
84
|
+
this.emit("flow-ui-change");
|
|
85
|
+
this.emit("flow-ui-input");
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
handleKeyDown(event) {
|
|
89
|
+
if (!["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight", " "].includes(event.key)) {
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
const radios = this.getAllRadios().filter((radio) => !radio.disabled);
|
|
93
|
+
const checkedRadio = radios.find((radio) => radio.checked) ?? radios[0];
|
|
94
|
+
const incr = event.key === " " ? 0 : ["ArrowUp", "ArrowLeft"].includes(event.key) ? -1 : 1;
|
|
95
|
+
const oldValue = this.value;
|
|
96
|
+
let index = radios.indexOf(checkedRadio) + incr;
|
|
97
|
+
if (index < 0) {
|
|
98
|
+
index = radios.length - 1;
|
|
99
|
+
}
|
|
100
|
+
if (index > radios.length - 1) {
|
|
101
|
+
index = 0;
|
|
102
|
+
}
|
|
103
|
+
this.getAllRadios().forEach((radio) => {
|
|
104
|
+
radio.checked = false;
|
|
105
|
+
radio.tabIndex = -1;
|
|
106
|
+
});
|
|
107
|
+
this.value = radios[index].value;
|
|
108
|
+
radios[index].checked = true;
|
|
109
|
+
radios[index].tabIndex = 0;
|
|
110
|
+
radios[index].focus();
|
|
111
|
+
if (this.value !== oldValue) {
|
|
112
|
+
this.emit("flow-ui-change");
|
|
113
|
+
this.emit("flow-ui-input");
|
|
114
|
+
}
|
|
115
|
+
event.preventDefault();
|
|
116
|
+
}
|
|
117
|
+
handleLabelClick() {
|
|
118
|
+
const radios = this.getAllRadios();
|
|
119
|
+
const checked = radios.find((radio) => radio.checked);
|
|
120
|
+
const radioToFocus = checked || radios[0];
|
|
121
|
+
if (radioToFocus) {
|
|
122
|
+
radioToFocus.focus();
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
handleInvalid(event) {
|
|
126
|
+
this.formControlController.setValidity(false);
|
|
127
|
+
this.formControlController.emitInvalidEvent(event);
|
|
128
|
+
}
|
|
129
|
+
syncRadios() {
|
|
130
|
+
if (customElements.get("flow-ui-radio")) {
|
|
131
|
+
const radios = this.getAllRadios();
|
|
132
|
+
radios.forEach((radio) => {
|
|
133
|
+
radio.checked = radio.value === this.value;
|
|
134
|
+
radio.size = this.size;
|
|
135
|
+
radio.variant = this.variant;
|
|
136
|
+
radio.fullWidth = this.fullWidth;
|
|
137
|
+
});
|
|
138
|
+
if (!radios.some((radio) => radio.checked)) {
|
|
139
|
+
radios[0].tabIndex = 0;
|
|
140
|
+
}
|
|
141
|
+
} else {
|
|
142
|
+
customElements.whenDefined("flow-ui-radio").then(() => this.syncRadios());
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
updateCheckedRadio() {
|
|
146
|
+
const radios = this.getAllRadios();
|
|
147
|
+
radios.forEach((radio) => radio.checked = radio.value === this.value);
|
|
148
|
+
this.formControlController.setValidity(this.validity.valid);
|
|
149
|
+
}
|
|
150
|
+
handleStyleChange() {
|
|
151
|
+
this.syncRadios();
|
|
152
|
+
}
|
|
153
|
+
handleValueChange() {
|
|
154
|
+
if (this.hasUpdated) {
|
|
155
|
+
this.updateCheckedRadio();
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
/** Checks for validity but does not show a validation message. Returns `true` when valid and `false` when invalid. */
|
|
159
|
+
checkValidity() {
|
|
160
|
+
const isRequiredAndEmpty = this.required && !this.value;
|
|
161
|
+
const hasCustomValidityMessage = this.customValidityMessage !== "";
|
|
162
|
+
if (isRequiredAndEmpty || hasCustomValidityMessage) {
|
|
163
|
+
this.formControlController.emitInvalidEvent();
|
|
164
|
+
return false;
|
|
165
|
+
}
|
|
166
|
+
return true;
|
|
167
|
+
}
|
|
168
|
+
/** Gets the associated form, if one exists. */
|
|
169
|
+
getForm() {
|
|
170
|
+
return this.formControlController.getForm();
|
|
171
|
+
}
|
|
172
|
+
/** Checks for validity and shows the browser's validation message if the control is invalid. */
|
|
173
|
+
reportValidity() {
|
|
174
|
+
const isValid = this.validity.valid;
|
|
175
|
+
this.errorMessage = this.customValidityMessage || isValid ? "" : this.validationInput.validationMessage;
|
|
176
|
+
this.formControlController.setValidity(isValid);
|
|
177
|
+
this.validationInput.hidden = true;
|
|
178
|
+
clearTimeout(this.validationTimeout);
|
|
179
|
+
if (!isValid) {
|
|
180
|
+
this.validationInput.hidden = false;
|
|
181
|
+
this.validationInput.reportValidity();
|
|
182
|
+
this.validationTimeout = setTimeout(() => this.validationInput.hidden = true, 1e4);
|
|
183
|
+
}
|
|
184
|
+
return isValid;
|
|
185
|
+
}
|
|
186
|
+
/** Sets a custom validation message. Pass an empty string to restore validity. */
|
|
187
|
+
setCustomValidity(message = "") {
|
|
188
|
+
this.customValidityMessage = message;
|
|
189
|
+
this.errorMessage = message;
|
|
190
|
+
this.validationInput.setCustomValidity(message);
|
|
191
|
+
this.formControlController.updateValidity();
|
|
192
|
+
}
|
|
193
|
+
render() {
|
|
194
|
+
const hasLabelSlot = this.hasSlotController.test("label");
|
|
195
|
+
const hasHelpTextSlot = this.hasSlotController.test("help-text");
|
|
196
|
+
const hasLabel = this.label ? true : !!hasLabelSlot;
|
|
197
|
+
const hasHelpText = this.helpText ? true : !!hasHelpTextSlot;
|
|
198
|
+
const defaultSlot = html`
|
|
199
|
+
<slot
|
|
200
|
+
@click=${this.handleRadioClick}
|
|
201
|
+
@keydown=${this.handleKeyDown}
|
|
202
|
+
@slotchange=${this.syncRadios}
|
|
203
|
+
role="presentation"
|
|
204
|
+
></slot>
|
|
205
|
+
`;
|
|
206
|
+
return html`
|
|
207
|
+
<fieldset
|
|
208
|
+
part="form-control"
|
|
209
|
+
class=${classMap({
|
|
210
|
+
"form-control": true,
|
|
211
|
+
"form-control--small": this.size === "small",
|
|
212
|
+
"form-control--medium": this.size === "medium",
|
|
213
|
+
"form-control--large": this.size === "large",
|
|
214
|
+
"form-control--radio-group": true,
|
|
215
|
+
"form-control--has-label": hasLabel,
|
|
216
|
+
"form-control--has-help-text": hasHelpText
|
|
217
|
+
})}
|
|
218
|
+
role="radiogroup"
|
|
219
|
+
aria-labelledby="label"
|
|
220
|
+
aria-describedby="help-text"
|
|
221
|
+
aria-errormessage="error-message"
|
|
222
|
+
>
|
|
223
|
+
<label
|
|
224
|
+
part="form-control-label"
|
|
225
|
+
id="label"
|
|
226
|
+
class="form-control__label"
|
|
227
|
+
aria-hidden=${hasLabel ? "false" : "true"}
|
|
228
|
+
@click=${this.handleLabelClick}
|
|
229
|
+
>
|
|
230
|
+
<slot name="label">${this.label}</slot>
|
|
231
|
+
</label>
|
|
232
|
+
|
|
233
|
+
<div part="form-control-input" class="form-control-input">
|
|
234
|
+
<div class="visually-hidden">
|
|
235
|
+
<div id="error-message" aria-live="assertive">${this.errorMessage}</div>
|
|
236
|
+
<label class="radio-group__validation">
|
|
237
|
+
<input
|
|
238
|
+
type="text"
|
|
239
|
+
class="radio-group__validation-input"
|
|
240
|
+
?required=${this.required}
|
|
241
|
+
tabindex="-1"
|
|
242
|
+
hidden
|
|
243
|
+
@invalid=${this.handleInvalid}
|
|
244
|
+
/>
|
|
245
|
+
</label>
|
|
246
|
+
</div>
|
|
247
|
+
${defaultSlot}
|
|
248
|
+
</div>
|
|
249
|
+
|
|
250
|
+
<slot
|
|
251
|
+
name="help-text"
|
|
252
|
+
part="form-control-help-text"
|
|
253
|
+
id="help-text"
|
|
254
|
+
class="form-control__help-text"
|
|
255
|
+
aria-hidden=${hasHelpText ? "false" : "true"}
|
|
256
|
+
>
|
|
257
|
+
${this.helpText}
|
|
258
|
+
</slot>
|
|
259
|
+
</fieldset>
|
|
260
|
+
`;
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
FlowUiRadioGroup.styles = styles;
|
|
264
|
+
__decorateClass([
|
|
265
|
+
query("slot:not([name])")
|
|
266
|
+
], FlowUiRadioGroup.prototype, "defaultSlot", 2);
|
|
267
|
+
__decorateClass([
|
|
268
|
+
query(".radio-group__validation-input")
|
|
269
|
+
], FlowUiRadioGroup.prototype, "validationInput", 2);
|
|
270
|
+
__decorateClass([
|
|
271
|
+
state()
|
|
272
|
+
], FlowUiRadioGroup.prototype, "errorMessage", 2);
|
|
273
|
+
__decorateClass([
|
|
274
|
+
state()
|
|
275
|
+
], FlowUiRadioGroup.prototype, "defaultValue", 2);
|
|
276
|
+
__decorateClass([
|
|
277
|
+
property()
|
|
278
|
+
], FlowUiRadioGroup.prototype, "label", 2);
|
|
279
|
+
__decorateClass([
|
|
280
|
+
property({ attribute: "help-text" })
|
|
281
|
+
], FlowUiRadioGroup.prototype, "helpText", 2);
|
|
282
|
+
__decorateClass([
|
|
283
|
+
property()
|
|
284
|
+
], FlowUiRadioGroup.prototype, "name", 2);
|
|
285
|
+
__decorateClass([
|
|
286
|
+
property({ reflect: true })
|
|
287
|
+
], FlowUiRadioGroup.prototype, "value", 2);
|
|
288
|
+
__decorateClass([
|
|
289
|
+
property({ reflect: true })
|
|
290
|
+
], FlowUiRadioGroup.prototype, "size", 2);
|
|
291
|
+
__decorateClass([
|
|
292
|
+
property()
|
|
293
|
+
], FlowUiRadioGroup.prototype, "variant", 2);
|
|
294
|
+
__decorateClass([
|
|
295
|
+
property({ reflect: true })
|
|
296
|
+
], FlowUiRadioGroup.prototype, "form", 2);
|
|
297
|
+
__decorateClass([
|
|
298
|
+
property({ type: Boolean, reflect: true })
|
|
299
|
+
], FlowUiRadioGroup.prototype, "required", 2);
|
|
300
|
+
__decorateClass([
|
|
301
|
+
property({ type: Boolean, reflect: true, attribute: "full-width" })
|
|
302
|
+
], FlowUiRadioGroup.prototype, "fullWidth", 2);
|
|
303
|
+
__decorateClass([
|
|
304
|
+
watch(["size", "variant", "fullWidth"], { waitUntilFirstUpdate: true })
|
|
305
|
+
], FlowUiRadioGroup.prototype, "handleStyleChange", 1);
|
|
306
|
+
__decorateClass([
|
|
307
|
+
watch("value")
|
|
308
|
+
], FlowUiRadioGroup.prototype, "handleValueChange", 1);
|
|
309
|
+
|
|
310
|
+
export { FlowUiRadioGroup as default };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
import componentStyles from '../../styles/component.styles.mjs';
|
|
3
|
+
import formControlStyles from '../../styles/form-control.styles.mjs';
|
|
4
|
+
|
|
5
|
+
const styles = css`
|
|
6
|
+
${componentStyles}
|
|
7
|
+
${formControlStyles}
|
|
8
|
+
|
|
9
|
+
:host {
|
|
10
|
+
display: block;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.form-control-input {
|
|
14
|
+
line-height: 1;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
::slotted(flow-ui-radio:not(:first-child)) {
|
|
18
|
+
margin-top: var(--flow-ui-form-spacing, var(--flow-ui-form-spacing-dense));
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.form-control {
|
|
22
|
+
border: none;
|
|
23
|
+
padding: 0;
|
|
24
|
+
margin: 0;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.form-control__label {
|
|
28
|
+
padding: 0;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.radio-group--required .radio-group__label::after {
|
|
32
|
+
content: var(--flow-ui-input-required-content);
|
|
33
|
+
margin-inline-start: var(--flow-ui-input-required-content-offset);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.visually-hidden {
|
|
37
|
+
position: absolute;
|
|
38
|
+
width: 1px;
|
|
39
|
+
height: 1px;
|
|
40
|
+
padding: 0;
|
|
41
|
+
margin: -1px;
|
|
42
|
+
overflow: hidden;
|
|
43
|
+
clip: rect(0, 0, 0, 0);
|
|
44
|
+
white-space: nowrap;
|
|
45
|
+
border: 0;
|
|
46
|
+
}
|
|
47
|
+
`;
|
|
48
|
+
|
|
49
|
+
export { styles as default };
|
|
@@ -0,0 +1,324 @@
|
|
|
1
|
+
import { html } from 'lit';
|
|
2
|
+
import { query, state, property, eventOptions } from 'lit/decorators.js';
|
|
3
|
+
import { classMap } from 'lit/directives/class-map.js';
|
|
4
|
+
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
5
|
+
import { live } from 'lit/directives/live.js';
|
|
6
|
+
import { boolean } from '../../internal/boolean.mjs';
|
|
7
|
+
import { defaultValue } from '../../internal/default-value.mjs';
|
|
8
|
+
import { FlowRdfFormControl } from '../../internal/flow-ui-rdf-element.mjs';
|
|
9
|
+
import { FormControlController } from '../../internal/form.mjs';
|
|
10
|
+
import { HasSlotController } from '../../internal/slot.mjs';
|
|
11
|
+
import { watch } from '../../internal/watch.mjs';
|
|
12
|
+
import { LocalizeController } from '../../utilities/localize.mjs';
|
|
13
|
+
import styles from './range.styles.mjs';
|
|
14
|
+
|
|
15
|
+
var __defProp = Object.defineProperty;
|
|
16
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
17
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
18
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
19
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
20
|
+
if (decorator = decorators[i])
|
|
21
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
22
|
+
if (kind && result)
|
|
23
|
+
__defProp(target, key, result);
|
|
24
|
+
return result;
|
|
25
|
+
};
|
|
26
|
+
class FlowUiRange extends FlowRdfFormControl {
|
|
27
|
+
constructor() {
|
|
28
|
+
super(...arguments);
|
|
29
|
+
this.formControlController = new FormControlController(this);
|
|
30
|
+
this.hasSlotController = new HasSlotController(this, "help-text", "label");
|
|
31
|
+
this.localize = new LocalizeController(this);
|
|
32
|
+
this.hasFocus = false;
|
|
33
|
+
this.hasTooltip = false;
|
|
34
|
+
this.title = "";
|
|
35
|
+
this.name = "";
|
|
36
|
+
this.value = 0;
|
|
37
|
+
this.label = "";
|
|
38
|
+
this.helpText = "";
|
|
39
|
+
this.disabled = false;
|
|
40
|
+
this.min = 0;
|
|
41
|
+
this.max = 100;
|
|
42
|
+
this.step = 1;
|
|
43
|
+
this.tooltip = "top";
|
|
44
|
+
this.tooltipFormatter = (value) => value.toString();
|
|
45
|
+
this.form = "";
|
|
46
|
+
this.defaultValue = 0;
|
|
47
|
+
}
|
|
48
|
+
/** Gets the validity state object */
|
|
49
|
+
get validity() {
|
|
50
|
+
return this.input.validity;
|
|
51
|
+
}
|
|
52
|
+
/** Gets the validation message */
|
|
53
|
+
get validationMessage() {
|
|
54
|
+
return this.input.validationMessage;
|
|
55
|
+
}
|
|
56
|
+
connectedCallback() {
|
|
57
|
+
super.connectedCallback();
|
|
58
|
+
this.disabled = boolean(this.disabled, true);
|
|
59
|
+
this.resizeObserver = new ResizeObserver(() => this.syncRange());
|
|
60
|
+
if (this.value < this.min) {
|
|
61
|
+
this.value = this.min;
|
|
62
|
+
}
|
|
63
|
+
if (this.value > this.max) {
|
|
64
|
+
this.value = this.max;
|
|
65
|
+
}
|
|
66
|
+
this.updateComplete.then(() => {
|
|
67
|
+
this.syncRange();
|
|
68
|
+
this.resizeObserver.observe(this.input);
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
disconnectedCallback() {
|
|
72
|
+
super.disconnectedCallback();
|
|
73
|
+
this.resizeObserver.unobserve(this.input);
|
|
74
|
+
}
|
|
75
|
+
handleChange() {
|
|
76
|
+
this.emit("flow-ui-change");
|
|
77
|
+
}
|
|
78
|
+
handleInput() {
|
|
79
|
+
this.value = parseFloat(this.input.value);
|
|
80
|
+
this.emit("flow-ui-input");
|
|
81
|
+
this.syncRange();
|
|
82
|
+
}
|
|
83
|
+
handleBlur() {
|
|
84
|
+
this.hasFocus = false;
|
|
85
|
+
this.hasTooltip = false;
|
|
86
|
+
this.emit("flow-ui-blur");
|
|
87
|
+
}
|
|
88
|
+
handleFocus() {
|
|
89
|
+
this.hasFocus = true;
|
|
90
|
+
this.hasTooltip = true;
|
|
91
|
+
this.emit("flow-ui-focus");
|
|
92
|
+
}
|
|
93
|
+
handleThumbDragStart() {
|
|
94
|
+
this.hasTooltip = true;
|
|
95
|
+
}
|
|
96
|
+
handleThumbDragEnd() {
|
|
97
|
+
this.hasTooltip = false;
|
|
98
|
+
}
|
|
99
|
+
syncProgress(percent) {
|
|
100
|
+
this.input.style.setProperty("--percent", `${percent * 100}%`);
|
|
101
|
+
}
|
|
102
|
+
syncTooltip(percent) {
|
|
103
|
+
if (this.output !== null) {
|
|
104
|
+
const inputWidth = this.input.offsetWidth;
|
|
105
|
+
const tooltipWidth = this.output.offsetWidth;
|
|
106
|
+
const thumbSize = getComputedStyle(this.input).getPropertyValue("--thumb-size");
|
|
107
|
+
const isRtl = this.localize.dir() === "rtl";
|
|
108
|
+
const percentAsWidth = inputWidth * percent;
|
|
109
|
+
if (isRtl) {
|
|
110
|
+
const x = `${inputWidth - percentAsWidth}px + ${percent} * ${thumbSize}`;
|
|
111
|
+
this.output.style.translate = `calc((${x} - ${tooltipWidth / 2}px - ${thumbSize} / 2))`;
|
|
112
|
+
} else {
|
|
113
|
+
const x = `${percentAsWidth}px - ${percent} * ${thumbSize}`;
|
|
114
|
+
this.output.style.translate = `calc(${x} - ${tooltipWidth / 2}px + ${thumbSize} / 2)`;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
handleValueChange() {
|
|
119
|
+
this.formControlController.updateValidity();
|
|
120
|
+
this.input.value = this.value.toString();
|
|
121
|
+
this.value = parseFloat(this.input.value);
|
|
122
|
+
this.syncRange();
|
|
123
|
+
}
|
|
124
|
+
handleDisabledChange() {
|
|
125
|
+
this.formControlController.setValidity(this.disabled);
|
|
126
|
+
}
|
|
127
|
+
syncRange() {
|
|
128
|
+
const percent = Math.max(0, (this.value - this.min) / (this.max - this.min));
|
|
129
|
+
this.syncProgress(percent);
|
|
130
|
+
if (this.tooltip !== "none") {
|
|
131
|
+
this.syncTooltip(percent);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
handleInvalid(event) {
|
|
135
|
+
this.formControlController.setValidity(false);
|
|
136
|
+
this.formControlController.emitInvalidEvent(event);
|
|
137
|
+
}
|
|
138
|
+
/** Sets focus on the range. */
|
|
139
|
+
focus(options) {
|
|
140
|
+
this.input.focus(options);
|
|
141
|
+
}
|
|
142
|
+
/** Removes focus from the range. */
|
|
143
|
+
blur() {
|
|
144
|
+
this.input.blur();
|
|
145
|
+
}
|
|
146
|
+
/** Increments the value of the range by the value of the step attribute. */
|
|
147
|
+
stepUp() {
|
|
148
|
+
this.input.stepUp();
|
|
149
|
+
if (this.value !== Number(this.input.value)) {
|
|
150
|
+
this.value = Number(this.input.value);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
/** Decrements the value of the range by the value of the step attribute. */
|
|
154
|
+
stepDown() {
|
|
155
|
+
this.input.stepDown();
|
|
156
|
+
if (this.value !== Number(this.input.value)) {
|
|
157
|
+
this.value = Number(this.input.value);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
/** Checks for validity but does not show a validation message. Returns `true` when valid and `false` when invalid. */
|
|
161
|
+
checkValidity() {
|
|
162
|
+
return this.input.checkValidity();
|
|
163
|
+
}
|
|
164
|
+
/** Gets the associated form, if one exists. */
|
|
165
|
+
getForm() {
|
|
166
|
+
return this.formControlController.getForm();
|
|
167
|
+
}
|
|
168
|
+
/** Checks for validity and shows the browser's validation message if the control is invalid. */
|
|
169
|
+
reportValidity() {
|
|
170
|
+
return this.input.reportValidity();
|
|
171
|
+
}
|
|
172
|
+
/** Sets a custom validation message. Pass an empty string to restore validity. */
|
|
173
|
+
setCustomValidity(message) {
|
|
174
|
+
this.input.setCustomValidity(message);
|
|
175
|
+
this.formControlController.updateValidity();
|
|
176
|
+
}
|
|
177
|
+
render() {
|
|
178
|
+
const hasLabelSlot = this.hasSlotController.test("label");
|
|
179
|
+
const hasHelpTextSlot = this.hasSlotController.test("help-text");
|
|
180
|
+
const hasLabel = this.label ? true : !!hasLabelSlot;
|
|
181
|
+
const hasHelpText = this.helpText ? true : !!hasHelpTextSlot;
|
|
182
|
+
return html`
|
|
183
|
+
<div
|
|
184
|
+
part="form-control"
|
|
185
|
+
class=${classMap({
|
|
186
|
+
"form-control": true,
|
|
187
|
+
"form-control--medium": true,
|
|
188
|
+
// range only has one size
|
|
189
|
+
"form-control--has-label": hasLabel,
|
|
190
|
+
"form-control--has-help-text": hasHelpText
|
|
191
|
+
})}
|
|
192
|
+
>
|
|
193
|
+
<label
|
|
194
|
+
part="form-control-label"
|
|
195
|
+
class="form-control__label"
|
|
196
|
+
for="input"
|
|
197
|
+
aria-hidden=${hasLabel ? "false" : "true"}
|
|
198
|
+
>
|
|
199
|
+
<slot name="label">${this.label}</slot>
|
|
200
|
+
</label>
|
|
201
|
+
|
|
202
|
+
<div part="form-control-input" class="form-control-input">
|
|
203
|
+
<div
|
|
204
|
+
part="base"
|
|
205
|
+
class=${classMap({
|
|
206
|
+
range: true,
|
|
207
|
+
"range--disabled": this.disabled,
|
|
208
|
+
"range--focused": this.hasFocus,
|
|
209
|
+
"range--rtl": this.localize.dir() === "rtl",
|
|
210
|
+
"range--tooltip-visible": this.hasTooltip,
|
|
211
|
+
"range--tooltip-top": this.tooltip === "top",
|
|
212
|
+
"range--tooltip-bottom": this.tooltip === "bottom"
|
|
213
|
+
})}
|
|
214
|
+
@mousedown=${this.handleThumbDragStart}
|
|
215
|
+
@mouseup=${this.handleThumbDragEnd}
|
|
216
|
+
@touchstart=${this.handleThumbDragStart}
|
|
217
|
+
@touchend=${this.handleThumbDragEnd}
|
|
218
|
+
>
|
|
219
|
+
<input
|
|
220
|
+
part="input"
|
|
221
|
+
id="input"
|
|
222
|
+
class="range__control"
|
|
223
|
+
title=${this.title}
|
|
224
|
+
type="range"
|
|
225
|
+
name=${ifDefined(this.name)}
|
|
226
|
+
?disabled=${this.disabled}
|
|
227
|
+
min=${ifDefined(this.min)}
|
|
228
|
+
max=${ifDefined(this.max)}
|
|
229
|
+
step=${ifDefined(this.step)}
|
|
230
|
+
.value=${live(this.value.toString())}
|
|
231
|
+
aria-describedby="help-text"
|
|
232
|
+
@change=${this.handleChange}
|
|
233
|
+
@focus=${this.handleFocus}
|
|
234
|
+
@input=${this.handleInput}
|
|
235
|
+
@invalid=${this.handleInvalid}
|
|
236
|
+
@blur=${this.handleBlur}
|
|
237
|
+
/>
|
|
238
|
+
${this.tooltip !== "none" && !this.disabled ? html`
|
|
239
|
+
<output part="tooltip" class="range__tooltip">
|
|
240
|
+
${typeof this.tooltipFormatter === "function" ? this.tooltipFormatter(this.value) : this.value}
|
|
241
|
+
</output>
|
|
242
|
+
` : ""}
|
|
243
|
+
</div>
|
|
244
|
+
</div>
|
|
245
|
+
|
|
246
|
+
<slot
|
|
247
|
+
name="help-text"
|
|
248
|
+
part="form-control-help-text"
|
|
249
|
+
id="help-text"
|
|
250
|
+
class="form-control__help-text"
|
|
251
|
+
aria-hidden=${hasHelpText ? "false" : "true"}
|
|
252
|
+
>
|
|
253
|
+
${this.helpText}
|
|
254
|
+
</slot>
|
|
255
|
+
</div>
|
|
256
|
+
`;
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
FlowUiRange.styles = styles;
|
|
260
|
+
__decorateClass([
|
|
261
|
+
query(".range__control")
|
|
262
|
+
], FlowUiRange.prototype, "input", 2);
|
|
263
|
+
__decorateClass([
|
|
264
|
+
query(".range__tooltip")
|
|
265
|
+
], FlowUiRange.prototype, "output", 2);
|
|
266
|
+
__decorateClass([
|
|
267
|
+
state()
|
|
268
|
+
], FlowUiRange.prototype, "hasFocus", 2);
|
|
269
|
+
__decorateClass([
|
|
270
|
+
state()
|
|
271
|
+
], FlowUiRange.prototype, "hasTooltip", 2);
|
|
272
|
+
__decorateClass([
|
|
273
|
+
property()
|
|
274
|
+
], FlowUiRange.prototype, "title", 2);
|
|
275
|
+
__decorateClass([
|
|
276
|
+
property()
|
|
277
|
+
], FlowUiRange.prototype, "name", 2);
|
|
278
|
+
__decorateClass([
|
|
279
|
+
property({ type: Number })
|
|
280
|
+
], FlowUiRange.prototype, "value", 2);
|
|
281
|
+
__decorateClass([
|
|
282
|
+
property()
|
|
283
|
+
], FlowUiRange.prototype, "label", 2);
|
|
284
|
+
__decorateClass([
|
|
285
|
+
property({ attribute: "help-text" })
|
|
286
|
+
], FlowUiRange.prototype, "helpText", 2);
|
|
287
|
+
__decorateClass([
|
|
288
|
+
property({ type: Boolean, reflect: true })
|
|
289
|
+
], FlowUiRange.prototype, "disabled", 2);
|
|
290
|
+
__decorateClass([
|
|
291
|
+
property({ type: Number })
|
|
292
|
+
], FlowUiRange.prototype, "min", 2);
|
|
293
|
+
__decorateClass([
|
|
294
|
+
property({ type: Number })
|
|
295
|
+
], FlowUiRange.prototype, "max", 2);
|
|
296
|
+
__decorateClass([
|
|
297
|
+
property({ type: Number })
|
|
298
|
+
], FlowUiRange.prototype, "step", 2);
|
|
299
|
+
__decorateClass([
|
|
300
|
+
property()
|
|
301
|
+
], FlowUiRange.prototype, "tooltip", 2);
|
|
302
|
+
__decorateClass([
|
|
303
|
+
property({ attribute: false })
|
|
304
|
+
], FlowUiRange.prototype, "tooltipFormatter", 2);
|
|
305
|
+
__decorateClass([
|
|
306
|
+
property({ reflect: true })
|
|
307
|
+
], FlowUiRange.prototype, "form", 2);
|
|
308
|
+
__decorateClass([
|
|
309
|
+
defaultValue()
|
|
310
|
+
], FlowUiRange.prototype, "defaultValue", 2);
|
|
311
|
+
__decorateClass([
|
|
312
|
+
eventOptions({ passive: true })
|
|
313
|
+
], FlowUiRange.prototype, "handleThumbDragStart", 1);
|
|
314
|
+
__decorateClass([
|
|
315
|
+
watch("value", { waitUntilFirstUpdate: true })
|
|
316
|
+
], FlowUiRange.prototype, "handleValueChange", 1);
|
|
317
|
+
__decorateClass([
|
|
318
|
+
watch("disabled", { waitUntilFirstUpdate: true })
|
|
319
|
+
], FlowUiRange.prototype, "handleDisabledChange", 1);
|
|
320
|
+
__decorateClass([
|
|
321
|
+
watch("hasTooltip", { waitUntilFirstUpdate: true })
|
|
322
|
+
], FlowUiRange.prototype, "syncRange", 1);
|
|
323
|
+
|
|
324
|
+
export { FlowUiRange as default };
|