@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,259 @@
|
|
|
1
|
+
import { html } from 'lit';
|
|
2
|
+
import { query, property } from 'lit/decorators.js';
|
|
3
|
+
import { classMap } from 'lit/directives/class-map.js';
|
|
4
|
+
import { parseDuration, stopAnimations, animateTo } from '../../internal/animate.mjs';
|
|
5
|
+
import { boolean } from '../../internal/boolean.mjs';
|
|
6
|
+
import { waitForEvent } from '../../internal/event.mjs';
|
|
7
|
+
import FlowRdfElement from '../../internal/flow-ui-rdf-element.mjs';
|
|
8
|
+
import { watch } from '../../internal/watch.mjs';
|
|
9
|
+
import { getAnimation, setDefaultAnimation } from '../../utilities/animation-registry.mjs';
|
|
10
|
+
import { LocalizeController } from '../../utilities/localize.mjs';
|
|
11
|
+
import styles from './tooltip.styles.mjs';
|
|
12
|
+
|
|
13
|
+
var __defProp = Object.defineProperty;
|
|
14
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
15
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
16
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
17
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
18
|
+
if (decorator = decorators[i])
|
|
19
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
20
|
+
if (kind && result)
|
|
21
|
+
__defProp(target, key, result);
|
|
22
|
+
return result;
|
|
23
|
+
};
|
|
24
|
+
class FlowUiTooltip extends FlowRdfElement {
|
|
25
|
+
constructor() {
|
|
26
|
+
super(...arguments);
|
|
27
|
+
this.localize = new LocalizeController(this);
|
|
28
|
+
this.content = "";
|
|
29
|
+
this.placement = "top";
|
|
30
|
+
this.disabled = false;
|
|
31
|
+
this.distance = 8;
|
|
32
|
+
this.open = false;
|
|
33
|
+
this.skidding = 0;
|
|
34
|
+
this.trigger = "hover focus";
|
|
35
|
+
this.hoist = false;
|
|
36
|
+
}
|
|
37
|
+
connectedCallback() {
|
|
38
|
+
super.connectedCallback();
|
|
39
|
+
this.open = boolean(this.open, true);
|
|
40
|
+
this.disabled = boolean(this.disabled, true);
|
|
41
|
+
this.hoist = boolean(this.hoist, true);
|
|
42
|
+
this.handleBlur = this.handleBlur.bind(this);
|
|
43
|
+
this.handleClick = this.handleClick.bind(this);
|
|
44
|
+
this.handleFocus = this.handleFocus.bind(this);
|
|
45
|
+
this.handleKeyDown = this.handleKeyDown.bind(this);
|
|
46
|
+
this.handleMouseOver = this.handleMouseOver.bind(this);
|
|
47
|
+
this.handleMouseOut = this.handleMouseOut.bind(this);
|
|
48
|
+
this.updateComplete.then(() => {
|
|
49
|
+
this.addEventListener("blur", this.handleBlur, true);
|
|
50
|
+
this.addEventListener("focus", this.handleFocus, true);
|
|
51
|
+
this.addEventListener("click", this.handleClick);
|
|
52
|
+
this.addEventListener("keydown", this.handleKeyDown);
|
|
53
|
+
this.addEventListener("mouseover", this.handleMouseOver);
|
|
54
|
+
this.addEventListener("mouseout", this.handleMouseOut);
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
firstUpdated() {
|
|
58
|
+
this.body.hidden = !this.open;
|
|
59
|
+
if (this.open) {
|
|
60
|
+
this.popup.active = true;
|
|
61
|
+
this.popup.reposition();
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
disconnectedCallback() {
|
|
65
|
+
super.disconnectedCallback();
|
|
66
|
+
this.removeEventListener("blur", this.handleBlur, true);
|
|
67
|
+
this.removeEventListener("focus", this.handleFocus, true);
|
|
68
|
+
this.removeEventListener("click", this.handleClick);
|
|
69
|
+
this.removeEventListener("keydown", this.handleKeyDown);
|
|
70
|
+
this.removeEventListener("mouseover", this.handleMouseOver);
|
|
71
|
+
this.removeEventListener("mouseout", this.handleMouseOut);
|
|
72
|
+
}
|
|
73
|
+
handleBlur() {
|
|
74
|
+
if (this.hasTrigger("focus")) {
|
|
75
|
+
this.hide();
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
handleClick() {
|
|
79
|
+
if (this.hasTrigger("click")) {
|
|
80
|
+
if (this.open) {
|
|
81
|
+
this.hide();
|
|
82
|
+
} else {
|
|
83
|
+
this.show();
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
handleFocus() {
|
|
88
|
+
if (this.hasTrigger("focus")) {
|
|
89
|
+
this.show();
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
handleKeyDown(event) {
|
|
93
|
+
if (this.open && event.key === "Escape") {
|
|
94
|
+
event.stopPropagation();
|
|
95
|
+
this.hide();
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
handleMouseOver() {
|
|
99
|
+
if (this.hasTrigger("hover")) {
|
|
100
|
+
const delay = parseDuration(getComputedStyle(this).getPropertyValue("--show-delay"));
|
|
101
|
+
clearTimeout(this.hoverTimeout);
|
|
102
|
+
this.hoverTimeout = window.setTimeout(() => this.show(), delay);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
handleMouseOut() {
|
|
106
|
+
if (this.hasTrigger("hover")) {
|
|
107
|
+
const delay = parseDuration(getComputedStyle(this).getPropertyValue("--hide-delay"));
|
|
108
|
+
clearTimeout(this.hoverTimeout);
|
|
109
|
+
this.hoverTimeout = window.setTimeout(() => this.hide(), delay);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
hasTrigger(triggerType) {
|
|
113
|
+
const triggers = this.trigger.split(" ");
|
|
114
|
+
return triggers.includes(triggerType);
|
|
115
|
+
}
|
|
116
|
+
async handleOpenChange() {
|
|
117
|
+
if (this.open) {
|
|
118
|
+
if (this.disabled) {
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
this.emit("flow-ui-show");
|
|
122
|
+
await stopAnimations(this.body);
|
|
123
|
+
this.body.hidden = false;
|
|
124
|
+
this.popup.active = true;
|
|
125
|
+
const { keyframes, options } = getAnimation(this, "tooltip.show", { dir: this.localize.dir() });
|
|
126
|
+
await animateTo(this.popup.popup, keyframes, options);
|
|
127
|
+
this.emit("flow-ui-after-show");
|
|
128
|
+
} else {
|
|
129
|
+
this.emit("flow-ui-hide");
|
|
130
|
+
await stopAnimations(this.body);
|
|
131
|
+
const { keyframes, options } = getAnimation(this, "tooltip.hide", { dir: this.localize.dir() });
|
|
132
|
+
await animateTo(this.popup.popup, keyframes, options);
|
|
133
|
+
this.popup.active = false;
|
|
134
|
+
this.body.hidden = true;
|
|
135
|
+
this.emit("flow-ui-after-hide");
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
async handleOptionsChange() {
|
|
139
|
+
if (this.hasUpdated) {
|
|
140
|
+
await this.updateComplete;
|
|
141
|
+
this.popup.reposition();
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
handleDisabledChange() {
|
|
145
|
+
if (this.disabled && this.open) {
|
|
146
|
+
this.hide();
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
/** Shows the tooltip. */
|
|
150
|
+
async show() {
|
|
151
|
+
if (this.open) {
|
|
152
|
+
return void 0;
|
|
153
|
+
}
|
|
154
|
+
this.open = true;
|
|
155
|
+
return waitForEvent(this, "flow-ui-after-show");
|
|
156
|
+
}
|
|
157
|
+
/** Hides the tooltip */
|
|
158
|
+
async hide() {
|
|
159
|
+
if (!this.open) {
|
|
160
|
+
return void 0;
|
|
161
|
+
}
|
|
162
|
+
this.open = false;
|
|
163
|
+
return waitForEvent(this, "flow-ui-after-hide");
|
|
164
|
+
}
|
|
165
|
+
render() {
|
|
166
|
+
return html`
|
|
167
|
+
<flow-ui-popup
|
|
168
|
+
part="base"
|
|
169
|
+
exportparts="
|
|
170
|
+
popup:base__popup,
|
|
171
|
+
arrow:base__arrow
|
|
172
|
+
"
|
|
173
|
+
class=${classMap({
|
|
174
|
+
tooltip: true,
|
|
175
|
+
"tooltip--open": this.open
|
|
176
|
+
})}
|
|
177
|
+
placement=${this.placement}
|
|
178
|
+
distance=${this.distance}
|
|
179
|
+
skidding=${this.skidding}
|
|
180
|
+
strategy=${this.hoist ? "fixed" : "absolute"}
|
|
181
|
+
flip
|
|
182
|
+
shift
|
|
183
|
+
arrow
|
|
184
|
+
>
|
|
185
|
+
<slot slot="anchor" aria-describedby="tooltip"></slot>
|
|
186
|
+
|
|
187
|
+
<slot
|
|
188
|
+
name="content"
|
|
189
|
+
part="body"
|
|
190
|
+
id="tooltip"
|
|
191
|
+
class="tooltip__body"
|
|
192
|
+
role="tooltip"
|
|
193
|
+
aria-live=${this.open ? "polite" : "off"}
|
|
194
|
+
>
|
|
195
|
+
${this.content}
|
|
196
|
+
</slot>
|
|
197
|
+
</flow-ui-popup>
|
|
198
|
+
`;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
FlowUiTooltip.styles = styles;
|
|
202
|
+
__decorateClass([
|
|
203
|
+
query("slot:not([name])")
|
|
204
|
+
], FlowUiTooltip.prototype, "defaultSlot", 2);
|
|
205
|
+
__decorateClass([
|
|
206
|
+
query(".tooltip__body")
|
|
207
|
+
], FlowUiTooltip.prototype, "body", 2);
|
|
208
|
+
__decorateClass([
|
|
209
|
+
query("flow-ui-popup")
|
|
210
|
+
], FlowUiTooltip.prototype, "popup", 2);
|
|
211
|
+
__decorateClass([
|
|
212
|
+
property()
|
|
213
|
+
], FlowUiTooltip.prototype, "content", 2);
|
|
214
|
+
__decorateClass([
|
|
215
|
+
property()
|
|
216
|
+
], FlowUiTooltip.prototype, "placement", 2);
|
|
217
|
+
__decorateClass([
|
|
218
|
+
property({ type: Boolean, reflect: true })
|
|
219
|
+
], FlowUiTooltip.prototype, "disabled", 2);
|
|
220
|
+
__decorateClass([
|
|
221
|
+
property({ type: Number })
|
|
222
|
+
], FlowUiTooltip.prototype, "distance", 2);
|
|
223
|
+
__decorateClass([
|
|
224
|
+
property({ type: Boolean, reflect: true })
|
|
225
|
+
], FlowUiTooltip.prototype, "open", 2);
|
|
226
|
+
__decorateClass([
|
|
227
|
+
property({ type: Number })
|
|
228
|
+
], FlowUiTooltip.prototype, "skidding", 2);
|
|
229
|
+
__decorateClass([
|
|
230
|
+
property()
|
|
231
|
+
], FlowUiTooltip.prototype, "trigger", 2);
|
|
232
|
+
__decorateClass([
|
|
233
|
+
property({ type: Boolean })
|
|
234
|
+
], FlowUiTooltip.prototype, "hoist", 2);
|
|
235
|
+
__decorateClass([
|
|
236
|
+
watch("open", { waitUntilFirstUpdate: true })
|
|
237
|
+
], FlowUiTooltip.prototype, "handleOpenChange", 1);
|
|
238
|
+
__decorateClass([
|
|
239
|
+
watch(["content", "distance", "hoist", "placement", "skidding"])
|
|
240
|
+
], FlowUiTooltip.prototype, "handleOptionsChange", 1);
|
|
241
|
+
__decorateClass([
|
|
242
|
+
watch("disabled")
|
|
243
|
+
], FlowUiTooltip.prototype, "handleDisabledChange", 1);
|
|
244
|
+
setDefaultAnimation("tooltip.show", {
|
|
245
|
+
keyframes: [
|
|
246
|
+
{ opacity: 0, scale: 0.8 },
|
|
247
|
+
{ opacity: 1, scale: 1 }
|
|
248
|
+
],
|
|
249
|
+
options: { duration: 150, easing: "ease" }
|
|
250
|
+
});
|
|
251
|
+
setDefaultAnimation("tooltip.hide", {
|
|
252
|
+
keyframes: [
|
|
253
|
+
{ opacity: 1, scale: 1 },
|
|
254
|
+
{ opacity: 0, scale: 0.8 }
|
|
255
|
+
],
|
|
256
|
+
options: { duration: 150, easing: "ease" }
|
|
257
|
+
});
|
|
258
|
+
|
|
259
|
+
export { FlowUiTooltip as default };
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
import componentStyles from '../../styles/component.styles.mjs';
|
|
3
|
+
|
|
4
|
+
const styles = css`
|
|
5
|
+
${componentStyles}
|
|
6
|
+
|
|
7
|
+
:host {
|
|
8
|
+
--max-width: 20rem;
|
|
9
|
+
--hide-delay: 0ms;
|
|
10
|
+
--show-delay: var(--flow-ui-tooltip-delay-fast);
|
|
11
|
+
|
|
12
|
+
display: contents;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.tooltip {
|
|
16
|
+
--arrow-size: var(--flow-ui-tooltip-arrow-size);
|
|
17
|
+
--arrow-color: var(--flow-ui-tooltip-background-color);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.tooltip::part(popup) {
|
|
21
|
+
pointer-events: none;
|
|
22
|
+
z-index: var(--flow-ui-z-index-tooltip);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.tooltip[placement^='top']::part(popup) {
|
|
26
|
+
transform-origin: bottom;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.tooltip[placement^='bottom']::part(popup) {
|
|
30
|
+
transform-origin: top;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.tooltip[placement^='left']::part(popup) {
|
|
34
|
+
transform-origin: right;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.tooltip[placement^='right']::part(popup) {
|
|
38
|
+
transform-origin: left;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.tooltip__body {
|
|
42
|
+
display: block;
|
|
43
|
+
width: max-content;
|
|
44
|
+
max-width: var(--max-width);
|
|
45
|
+
border-radius: var(--flow-ui-tooltip-border-radius);
|
|
46
|
+
background-color: var(--flow-ui-tooltip-background-color);
|
|
47
|
+
font-family: var(--flow-ui-tooltip-font-family);
|
|
48
|
+
font-size: var(--flow-ui-tooltip-font-size);
|
|
49
|
+
font-weight: var(--flow-ui-tooltip-font-weight);
|
|
50
|
+
line-height: var(--flow-ui-tooltip-line-height);
|
|
51
|
+
color: var(--flow-ui-tooltip-color);
|
|
52
|
+
padding: var(--flow-ui-tooltip-padding);
|
|
53
|
+
pointer-events: none;
|
|
54
|
+
}
|
|
55
|
+
`;
|
|
56
|
+
|
|
57
|
+
export { styles as default };
|
|
@@ -0,0 +1,368 @@
|
|
|
1
|
+
import { html } from 'lit';
|
|
2
|
+
import { query, property } from 'lit/decorators.js';
|
|
3
|
+
import { classMap } from 'lit/directives/class-map.js';
|
|
4
|
+
import { ensureArray } from '../../internal/ensure-array.mjs';
|
|
5
|
+
import FlowRdfElement, { FlowRdfFormControl } from '../../internal/flow-ui-rdf-element.mjs';
|
|
6
|
+
import { clamp } from '../../internal/math.mjs';
|
|
7
|
+
import { isStringFull } from '../../internal/type-checks.mjs';
|
|
8
|
+
import { watch } from '../../internal/watch.mjs';
|
|
9
|
+
import { LocalizeController } from '../../utilities/localize.mjs';
|
|
10
|
+
import FlowUiTreeItem from '../tree-item/tree-item.component.mjs';
|
|
11
|
+
import styles from './tree.styles.mjs';
|
|
12
|
+
|
|
13
|
+
var __defProp = Object.defineProperty;
|
|
14
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
15
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
16
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
17
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
18
|
+
if (decorator = decorators[i])
|
|
19
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
20
|
+
if (kind && result)
|
|
21
|
+
__defProp(target, key, result);
|
|
22
|
+
return result;
|
|
23
|
+
};
|
|
24
|
+
function syncCheckboxes(changedTreeItem, initialSync = false) {
|
|
25
|
+
function syncParentItem(treeItem) {
|
|
26
|
+
const children = treeItem.getChildrenItems({ includeDisabled: false });
|
|
27
|
+
if (children.length) {
|
|
28
|
+
const allChecked = children.every((item) => item.selected);
|
|
29
|
+
const allUnchecked = children.every((item) => !item.selected && !item.indeterminate);
|
|
30
|
+
treeItem.selected = allChecked;
|
|
31
|
+
treeItem.indeterminate = !allChecked && !allUnchecked;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
function syncAncestors(treeItem) {
|
|
35
|
+
const parentItem = treeItem.parentElement;
|
|
36
|
+
if (FlowUiTreeItem.isTreeItem(parentItem)) {
|
|
37
|
+
syncParentItem(parentItem);
|
|
38
|
+
syncAncestors(parentItem);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
function syncDescendants(treeItem) {
|
|
42
|
+
for (const childItem of treeItem.getChildrenItems()) {
|
|
43
|
+
childItem.selected = initialSync ? treeItem.selected || childItem.selected : !childItem.disabled && treeItem.selected;
|
|
44
|
+
syncDescendants(childItem);
|
|
45
|
+
}
|
|
46
|
+
if (initialSync) {
|
|
47
|
+
syncParentItem(treeItem);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
syncDescendants(changedTreeItem);
|
|
51
|
+
syncAncestors(changedTreeItem);
|
|
52
|
+
}
|
|
53
|
+
class FlowUiTree extends FlowRdfElement {
|
|
54
|
+
constructor() {
|
|
55
|
+
super(...arguments);
|
|
56
|
+
this.value = [];
|
|
57
|
+
this.selectionMode = "multiple";
|
|
58
|
+
this.size = "medium";
|
|
59
|
+
this.localize = new LocalizeController(this);
|
|
60
|
+
this.clickTarget = null;
|
|
61
|
+
// Initializes new items by setting the `selectable` property and the expanded/collapsed icons if any
|
|
62
|
+
this.initTreeItem = (item) => {
|
|
63
|
+
item.selectable = this.selectionMode === "multiple";
|
|
64
|
+
["expand", "collapse"].filter((status) => !!this.querySelector(`[slot="${status}-icon"]`)).forEach((status) => {
|
|
65
|
+
const existingIcon = item.querySelector(`[slot="${status}-icon"]`);
|
|
66
|
+
if (existingIcon === null) {
|
|
67
|
+
item.append(this.getExpandButtonIcon(status));
|
|
68
|
+
} else if (existingIcon.hasAttribute("data-default")) {
|
|
69
|
+
existingIcon.replaceWith(this.getExpandButtonIcon(status));
|
|
70
|
+
} else ;
|
|
71
|
+
});
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
async connectedCallback() {
|
|
75
|
+
super.connectedCallback();
|
|
76
|
+
this.classList.add(FlowRdfFormControl.FLOW_UI_FORM_CONTROL_CLASS);
|
|
77
|
+
this.handleTreeChanged = this.handleTreeChanged.bind(this);
|
|
78
|
+
this.handleFocusIn = this.handleFocusIn.bind(this);
|
|
79
|
+
this.handleFocusOut = this.handleFocusOut.bind(this);
|
|
80
|
+
this.setAttribute("role", "tree");
|
|
81
|
+
this.setAttribute("tabindex", "0");
|
|
82
|
+
this.addEventListener("focusin", this.handleFocusIn);
|
|
83
|
+
this.addEventListener("focusout", this.handleFocusOut);
|
|
84
|
+
this.addEventListener("flow-ui-lazy-change", this.handleSlotChange);
|
|
85
|
+
await this.updateComplete;
|
|
86
|
+
this.mutationObserver = new MutationObserver(this.handleTreeChanged);
|
|
87
|
+
this.mutationObserver.observe(this, { childList: true, subtree: true });
|
|
88
|
+
}
|
|
89
|
+
disconnectedCallback() {
|
|
90
|
+
super.disconnectedCallback();
|
|
91
|
+
this.mutationObserver.disconnect();
|
|
92
|
+
this.removeEventListener("focusin", this.handleFocusIn);
|
|
93
|
+
this.removeEventListener("focusout", this.handleFocusOut);
|
|
94
|
+
this.removeEventListener("flow-ui-lazy-change", this.handleSlotChange);
|
|
95
|
+
}
|
|
96
|
+
handleClassChange() {
|
|
97
|
+
this.classList.add(FlowRdfFormControl.FLOW_UI_FORM_CONTROL_CLASS);
|
|
98
|
+
}
|
|
99
|
+
// Generates a clone of the expand icon element to use for each tree item
|
|
100
|
+
getExpandButtonIcon(status) {
|
|
101
|
+
const slot = status === "expand" ? this.expandedIconSlot : this.collapsedIconSlot;
|
|
102
|
+
const icon = slot.assignedElements({ flatten: true })[0];
|
|
103
|
+
if (icon) {
|
|
104
|
+
const clone = icon.cloneNode(true);
|
|
105
|
+
[clone, ...clone.querySelectorAll("[id]")].forEach((el) => el.removeAttribute("id"));
|
|
106
|
+
clone.setAttribute("data-default", "");
|
|
107
|
+
clone.slot = `${status}-icon`;
|
|
108
|
+
return clone;
|
|
109
|
+
}
|
|
110
|
+
return null;
|
|
111
|
+
}
|
|
112
|
+
handleTreeChanged(mutations) {
|
|
113
|
+
for (const mutation of mutations) {
|
|
114
|
+
const addedNodes = [...mutation.addedNodes].filter(FlowUiTreeItem.isTreeItem);
|
|
115
|
+
const removedNodes = [...mutation.removedNodes].filter(FlowUiTreeItem.isTreeItem);
|
|
116
|
+
addedNodes.forEach(this.initTreeItem);
|
|
117
|
+
if (removedNodes.includes(this.lastFocusedItem)) {
|
|
118
|
+
this.focusItem(this.getFocusableItems()[0]);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
handleSizeChange() {
|
|
123
|
+
this.syncTreeItems();
|
|
124
|
+
}
|
|
125
|
+
syncTreeItems(selectedItem) {
|
|
126
|
+
const items = this.getAllTreeItems();
|
|
127
|
+
items.forEach((items2) => {
|
|
128
|
+
items2.size = this.size;
|
|
129
|
+
});
|
|
130
|
+
if (selectedItem) {
|
|
131
|
+
if (this.selectionMode === "multiple") {
|
|
132
|
+
syncCheckboxes(selectedItem);
|
|
133
|
+
} else {
|
|
134
|
+
for (const item of items) {
|
|
135
|
+
if (item !== selectedItem) {
|
|
136
|
+
item.selected = false;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
selectItem(selectedItem) {
|
|
143
|
+
const previousSelection = [...this.selectedItems];
|
|
144
|
+
if (this.selectionMode === "multiple") {
|
|
145
|
+
selectedItem.selected = !selectedItem.selected;
|
|
146
|
+
if (selectedItem.lazy) {
|
|
147
|
+
selectedItem.expanded = true;
|
|
148
|
+
}
|
|
149
|
+
this.syncTreeItems(selectedItem);
|
|
150
|
+
} else if (this.selectionMode === "single" || selectedItem.isLeaf) {
|
|
151
|
+
selectedItem.expanded = !selectedItem.expanded;
|
|
152
|
+
selectedItem.selected = true;
|
|
153
|
+
this.syncTreeItems(selectedItem);
|
|
154
|
+
} else if (this.selectionMode === "leaf") {
|
|
155
|
+
selectedItem.expanded = !selectedItem.expanded;
|
|
156
|
+
}
|
|
157
|
+
const nextSelection = this.selectedItems;
|
|
158
|
+
if (previousSelection.length !== nextSelection.length || nextSelection.some((item) => !previousSelection.includes(item))) {
|
|
159
|
+
Promise.all(nextSelection.map((el) => el.updateComplete)).then(() => {
|
|
160
|
+
this.value = nextSelection.map((item) => item.value).filter((value) => isStringFull(value));
|
|
161
|
+
this.emit("flow-ui-input");
|
|
162
|
+
this.emit("flow-ui-change");
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
getAllTreeItems() {
|
|
167
|
+
return [...this.querySelectorAll("flow-ui-tree-item")];
|
|
168
|
+
}
|
|
169
|
+
focusItem(item) {
|
|
170
|
+
item?.focus();
|
|
171
|
+
}
|
|
172
|
+
handleKeyDown(event) {
|
|
173
|
+
if (!["ArrowDown", "ArrowUp", "ArrowRight", "ArrowLeft", "Home", "End", "Enter", " "].includes(event.key)) {
|
|
174
|
+
return;
|
|
175
|
+
}
|
|
176
|
+
const items = this.getFocusableItems();
|
|
177
|
+
const isLtr = this.localize.dir() === "ltr";
|
|
178
|
+
const isRtl = this.localize.dir() === "rtl";
|
|
179
|
+
if (items.length > 0) {
|
|
180
|
+
event.preventDefault();
|
|
181
|
+
const activeItemIndex = items.findIndex((item) => item.matches(":focus"));
|
|
182
|
+
const activeItem = items[activeItemIndex];
|
|
183
|
+
const focusItemAt = (index) => {
|
|
184
|
+
const item = items[clamp(index, 0, items.length - 1)];
|
|
185
|
+
this.focusItem(item);
|
|
186
|
+
};
|
|
187
|
+
const toggleExpand = (expanded) => {
|
|
188
|
+
activeItem.expanded = expanded;
|
|
189
|
+
};
|
|
190
|
+
if (event.key === "ArrowDown") {
|
|
191
|
+
focusItemAt(activeItemIndex + 1);
|
|
192
|
+
} else if (event.key === "ArrowUp") {
|
|
193
|
+
focusItemAt(activeItemIndex - 1);
|
|
194
|
+
} else if (isLtr && event.key === "ArrowRight" || isRtl && event.key === "ArrowLeft") {
|
|
195
|
+
if (!activeItem || activeItem.disabled || activeItem.expanded || activeItem.isLeaf && !activeItem.lazy) {
|
|
196
|
+
focusItemAt(activeItemIndex + 1);
|
|
197
|
+
} else {
|
|
198
|
+
toggleExpand(true);
|
|
199
|
+
}
|
|
200
|
+
} else if (isLtr && event.key === "ArrowLeft" || isRtl && event.key === "ArrowRight") {
|
|
201
|
+
if (!activeItem || activeItem.disabled || activeItem.isLeaf || !activeItem.expanded) {
|
|
202
|
+
focusItemAt(activeItemIndex - 1);
|
|
203
|
+
} else {
|
|
204
|
+
toggleExpand(false);
|
|
205
|
+
}
|
|
206
|
+
} else if (event.key === "Home") {
|
|
207
|
+
focusItemAt(0);
|
|
208
|
+
} else if (event.key === "End") {
|
|
209
|
+
focusItemAt(items.length - 1);
|
|
210
|
+
} else if (event.key === "Enter" || event.key === " ") {
|
|
211
|
+
if (!activeItem.disabled) {
|
|
212
|
+
this.selectItem(activeItem);
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
handleClick(event) {
|
|
218
|
+
const target = event.target;
|
|
219
|
+
const treeItem = target.closest("flow-ui-tree-item");
|
|
220
|
+
const isExpandButton = event.composedPath().some((el) => el?.classList?.contains("tree-item__expand-button"));
|
|
221
|
+
if (!treeItem || treeItem.disabled || target !== this.clickTarget) {
|
|
222
|
+
return;
|
|
223
|
+
}
|
|
224
|
+
if (this.selectionMode === "multiple" && isExpandButton) {
|
|
225
|
+
treeItem.expanded = !treeItem.expanded;
|
|
226
|
+
} else {
|
|
227
|
+
this.selectItem(treeItem);
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
handleMouseDown(event) {
|
|
231
|
+
this.clickTarget = event.target;
|
|
232
|
+
}
|
|
233
|
+
handleFocusOut(event) {
|
|
234
|
+
const relatedTarget = event.relatedTarget;
|
|
235
|
+
if (!relatedTarget || !this.contains(relatedTarget)) {
|
|
236
|
+
this.tabIndex = 0;
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
handleFocusIn(event) {
|
|
240
|
+
const target = event.target;
|
|
241
|
+
if (event.target === this) {
|
|
242
|
+
this.focusItem(this.lastFocusedItem || this.getAllTreeItems()[0]);
|
|
243
|
+
}
|
|
244
|
+
if (FlowUiTreeItem.isTreeItem(target) && !target.disabled) {
|
|
245
|
+
if (this.lastFocusedItem) {
|
|
246
|
+
this.lastFocusedItem.tabIndex = -1;
|
|
247
|
+
}
|
|
248
|
+
this.lastFocusedItem = target;
|
|
249
|
+
this.tabIndex = -1;
|
|
250
|
+
target.tabIndex = 0;
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
handleSlotChange() {
|
|
254
|
+
const items = this.getAllTreeItems();
|
|
255
|
+
items.forEach(this.initTreeItem);
|
|
256
|
+
}
|
|
257
|
+
async handleSelectionChange() {
|
|
258
|
+
const isSelectionMultiple = this.selectionMode === "multiple";
|
|
259
|
+
const items = this.getAllTreeItems();
|
|
260
|
+
this.setAttribute("aria-multiselectable", isSelectionMultiple ? "true" : "false");
|
|
261
|
+
for (const item of items) {
|
|
262
|
+
item.selectable = isSelectionMultiple;
|
|
263
|
+
}
|
|
264
|
+
if (isSelectionMultiple) {
|
|
265
|
+
await this.updateComplete;
|
|
266
|
+
[...this.querySelectorAll(":scope > flow-ui-tree-item")].forEach(
|
|
267
|
+
(treeItem) => syncCheckboxes(treeItem, true)
|
|
268
|
+
);
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
handleValueChange(previousValue) {
|
|
272
|
+
this.value = ensureArray(this.value);
|
|
273
|
+
if (previousValue.length !== this.value.length || this.value.some((val) => !previousValue.includes(val)) || previousValue.some((val) => !this.value.includes(val))) {
|
|
274
|
+
const selected = this.value.filter((val) => !previousValue.includes(val));
|
|
275
|
+
const deselected = previousValue.filter((val) => !this.value.includes(val));
|
|
276
|
+
const allItems = this.getAllTreeItems();
|
|
277
|
+
const selectedItems = allItems.filter((item) => selected.includes(item.value));
|
|
278
|
+
const deselectedItems = allItems.filter((item) => deselected.includes(item.value));
|
|
279
|
+
selectedItems.forEach((item) => {
|
|
280
|
+
item.selected = true;
|
|
281
|
+
syncCheckboxes(item);
|
|
282
|
+
});
|
|
283
|
+
deselectedItems.forEach((item) => {
|
|
284
|
+
item.selected = false;
|
|
285
|
+
syncCheckboxes(item);
|
|
286
|
+
});
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
/** @internal Returns the list of tree items that are selected in the tree. */
|
|
290
|
+
get selectedItems() {
|
|
291
|
+
const items = this.getAllTreeItems();
|
|
292
|
+
const isSelected = (item) => item.selected;
|
|
293
|
+
return items.filter(isSelected);
|
|
294
|
+
}
|
|
295
|
+
/** @internal Gets focusable tree items in the tree. */
|
|
296
|
+
getFocusableItems() {
|
|
297
|
+
const items = this.getAllTreeItems();
|
|
298
|
+
const collapsedItems = /* @__PURE__ */ new Set();
|
|
299
|
+
return items.filter((item) => {
|
|
300
|
+
if (item.disabled)
|
|
301
|
+
return false;
|
|
302
|
+
const parent = item.parentElement?.closest("[role=treeitem]");
|
|
303
|
+
if (parent && (!parent.expanded || parent.loading || collapsedItems.has(parent))) {
|
|
304
|
+
collapsedItems.add(item);
|
|
305
|
+
}
|
|
306
|
+
return !collapsedItems.has(item);
|
|
307
|
+
});
|
|
308
|
+
}
|
|
309
|
+
render() {
|
|
310
|
+
return html`
|
|
311
|
+
<div
|
|
312
|
+
part="base"
|
|
313
|
+
class=${classMap({
|
|
314
|
+
tree: true,
|
|
315
|
+
"tree--multiple": this.selectionMode === "multiple",
|
|
316
|
+
"tree--small": this.size === "small",
|
|
317
|
+
"tree--medium": this.size === "medium",
|
|
318
|
+
"tree--large": this.size === "large"
|
|
319
|
+
})}
|
|
320
|
+
@click=${this.handleClick}
|
|
321
|
+
@keydown=${this.handleKeyDown}
|
|
322
|
+
@mousedown=${this.handleMouseDown}
|
|
323
|
+
>
|
|
324
|
+
<slot @slotchange=${this.handleSlotChange}></slot>
|
|
325
|
+
<slot name="expand-icon" hidden aria-hidden="true"></slot>
|
|
326
|
+
<slot name="collapse-icon" hidden aria-hidden="true"></slot>
|
|
327
|
+
</div>
|
|
328
|
+
`;
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
FlowUiTree.styles = styles;
|
|
332
|
+
__decorateClass([
|
|
333
|
+
query("slot[name=expand-icon]")
|
|
334
|
+
], FlowUiTree.prototype, "expandedIconSlot", 2);
|
|
335
|
+
__decorateClass([
|
|
336
|
+
query("slot[name=collapse-icon]")
|
|
337
|
+
], FlowUiTree.prototype, "collapsedIconSlot", 2);
|
|
338
|
+
__decorateClass([
|
|
339
|
+
property({ reflect: true })
|
|
340
|
+
], FlowUiTree.prototype, "class", 2);
|
|
341
|
+
__decorateClass([
|
|
342
|
+
property({
|
|
343
|
+
converter: {
|
|
344
|
+
fromAttribute: (value) => value.split(" "),
|
|
345
|
+
toAttribute: (value) => value.join(" ")
|
|
346
|
+
}
|
|
347
|
+
})
|
|
348
|
+
], FlowUiTree.prototype, "value", 2);
|
|
349
|
+
__decorateClass([
|
|
350
|
+
property({ attribute: "selection-mode" })
|
|
351
|
+
], FlowUiTree.prototype, "selectionMode", 2);
|
|
352
|
+
__decorateClass([
|
|
353
|
+
property({ reflect: true })
|
|
354
|
+
], FlowUiTree.prototype, "size", 2);
|
|
355
|
+
__decorateClass([
|
|
356
|
+
watch("class")
|
|
357
|
+
], FlowUiTree.prototype, "handleClassChange", 1);
|
|
358
|
+
__decorateClass([
|
|
359
|
+
watch("size", { waitUntilFirstUpdate: true })
|
|
360
|
+
], FlowUiTree.prototype, "handleSizeChange", 1);
|
|
361
|
+
__decorateClass([
|
|
362
|
+
watch("selectionMode")
|
|
363
|
+
], FlowUiTree.prototype, "handleSelectionChange", 1);
|
|
364
|
+
__decorateClass([
|
|
365
|
+
watch("value", { waitUntilFirstUpdate: true })
|
|
366
|
+
], FlowUiTree.prototype, "handleValueChange", 1);
|
|
367
|
+
|
|
368
|
+
export { FlowUiTree as default };
|