@emuanalytics/flow-rdf-ui 4.0.5 → 4.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/alert/alert.component.mjs +202 -0
- package/dist/components/alert/alert.mjs +5 -0
- package/dist/components/alert/alert.styles.mjs +107 -0
- package/dist/components/animation/animation.component.mjs +207 -0
- package/dist/components/animation/animation.mjs +5 -0
- package/dist/components/animation/animation.styles.mjs +12 -0
- package/dist/components/animation/animations.mjs +11 -0
- package/dist/components/avatar/avatar.component.mjs +95 -0
- package/dist/components/avatar/avatar.mjs +5 -0
- package/dist/components/avatar/avatar.styles.mjs +70 -0
- package/dist/components/badge/badge.component.mjs +62 -0
- package/dist/components/badge/badge.mjs +5 -0
- package/dist/components/badge/badge.styles.mjs +105 -0
- package/dist/components/breadcrumb/breadcrumb.component.mjs +82 -0
- package/dist/components/breadcrumb/breadcrumb.mjs +5 -0
- package/dist/components/breadcrumb/breadcrumb.styles.mjs +14 -0
- package/dist/components/breadcrumb-item/breadcrumb-item.component.mjs +73 -0
- package/dist/components/breadcrumb-item/breadcrumb-item.mjs +5 -0
- package/dist/components/breadcrumb-item/breadcrumb-item.styles.mjs +90 -0
- package/dist/components/button/button.component.mjs +310 -0
- package/dist/components/button/button.mjs +5 -0
- package/dist/components/button/button.styles.mjs +690 -0
- package/dist/components/button-group/button-group.component.mjs +108 -0
- package/dist/components/button-group/button-group.mjs +5 -0
- package/dist/components/button-group/button-group.styles.mjs +21 -0
- package/dist/components/calendar/calendar.component.mjs +320 -0
- package/dist/components/calendar/calendar.mjs +5 -0
- package/dist/components/calendar/calendar.styles.mjs +145 -0
- package/dist/components/card/card.component.mjs +33 -0
- package/dist/components/card/card.mjs +5 -0
- package/dist/components/card/card.styles.mjs +73 -0
- package/dist/components/carousel/autoplay-controller.mjs +56 -0
- package/dist/components/carousel/carousel.component.mjs +406 -0
- package/dist/components/carousel/carousel.mjs +5 -0
- package/dist/components/carousel/carousel.styles.mjs +162 -0
- package/dist/components/carousel/scroll-controller.mjs +148 -0
- package/dist/components/carousel-item/carousel-item.component.mjs +22 -0
- package/dist/components/carousel-item/carousel-item.mjs +5 -0
- package/dist/components/carousel-item/carousel-item.styles.mjs +28 -0
- package/dist/components/chart/chart.component.mjs +82 -0
- package/dist/components/chart/chart.mjs +5 -0
- package/dist/components/chart/chart.styles.mjs +80 -0
- package/dist/components/chart/chartjs-plugins/interaction.interpolate.mjs +80 -0
- package/dist/components/chart/chartjs-plugins/plugin.flow-ui-colors.mjs +135 -0
- package/dist/components/chart/chartjs-plugins/positioner.cursor.mjs +14 -0
- package/dist/components/chart/chartjs-plugins/symlog.scale.mjs +42 -0
- package/dist/components/chart/chartjs-support.mjs +59 -0
- package/dist/components/checkbox/checkbox.component.mjs +246 -0
- package/dist/components/checkbox/checkbox.mjs +5 -0
- package/dist/components/checkbox/checkbox.styles.mjs +177 -0
- package/dist/components/color-mapper/color-mapper.component.mjs +260 -0
- package/dist/components/color-mapper/color-mapper.mjs +5 -0
- package/dist/components/color-mapper/color-mapper.styles.mjs +92 -0
- package/dist/components/color-mapper/helpers.mjs +55 -0
- package/dist/components/color-picker/color-picker.component.mjs +919 -0
- package/dist/components/color-picker/color-picker.mjs +5 -0
- package/dist/components/color-picker/color-picker.styles.mjs +337 -0
- package/dist/components/color-stop/color-stop.component.mjs +289 -0
- package/dist/components/color-stop/color-stop.mjs +5 -0
- package/dist/components/color-stop/color-stop.styles.mjs +103 -0
- package/dist/components/date-time-picker/date-time-picker.component.mjs +532 -0
- package/dist/components/date-time-picker/date-time-picker.mjs +5 -0
- package/dist/components/date-time-picker/date-time-picker.styles.mjs +260 -0
- package/dist/components/details/details.component.mjs +194 -0
- package/dist/components/details/details.mjs +5 -0
- package/dist/components/details/details.styles.mjs +85 -0
- package/dist/components/dialog/dialog.component.mjs +256 -0
- package/dist/components/dialog/dialog.mjs +5 -0
- package/dist/components/dialog/dialog.styles.mjs +125 -0
- package/dist/components/divider/divider.component.mjs +45 -0
- package/dist/components/divider/divider.mjs +5 -0
- package/dist/components/divider/divider.styles.mjs +34 -0
- package/dist/components/drawer/drawer.component.mjs +354 -0
- package/dist/components/drawer/drawer.mjs +5 -0
- package/dist/components/drawer/drawer.styles.mjs +161 -0
- package/dist/components/dropdown/dropdown.component.mjs +381 -0
- package/dist/components/dropdown/dropdown.mjs +5 -0
- package/dist/components/dropdown/dropdown.styles.mjs +56 -0
- package/dist/components/gauge/gauge.component.mjs +151 -0
- package/dist/components/gauge/gauge.mjs +5 -0
- package/dist/components/gauge/gauge.styles.mjs +127 -0
- package/dist/components/icon/icon.component.mjs +146 -0
- package/dist/components/icon/icon.mjs +5 -0
- package/dist/components/icon/icon.styles.mjs +35 -0
- package/dist/components/icon/library.default.mjs +38 -0
- package/dist/components/icon/library.mjs +38 -0
- package/dist/components/icon/library.system.mjs +158 -0
- package/dist/components/icon-button/icon-button.component.mjs +239 -0
- package/dist/components/icon-button/icon-button.mjs +5 -0
- package/dist/components/icon-button/icon-button.styles.mjs +81 -0
- package/dist/components/input/input.component.mjs +574 -0
- package/dist/components/input/input.mjs +5 -0
- package/dist/components/input/input.styles.mjs +310 -0
- package/dist/components/map/map.component.mjs +196 -0
- package/dist/components/map/map.mjs +5 -0
- package/dist/components/map/map.styles.mjs +90 -0
- package/dist/components/menu/menu.component.mjs +125 -0
- package/dist/components/menu/menu.mjs +5 -0
- package/dist/components/menu/menu.styles.mjs +23 -0
- package/dist/components/menu-item/menu-item.component.mjs +143 -0
- package/dist/components/menu-item/menu-item.mjs +5 -0
- package/dist/components/menu-item/menu-item.styles.mjs +103 -0
- package/dist/components/menu-label/menu-label.component.mjs +14 -0
- package/dist/components/menu-label/menu-label.mjs +5 -0
- package/dist/components/menu-label/menu-label.styles.mjs +24 -0
- package/dist/components/mutation-observer/mutation-observer.component.mjs +115 -0
- package/dist/components/mutation-observer/mutation-observer.mjs +5 -0
- package/dist/components/mutation-observer/mutation-observer.styles.mjs +12 -0
- package/dist/components/option/option.component.mjs +152 -0
- package/dist/components/option/option.mjs +5 -0
- package/dist/components/option/option.styles.mjs +102 -0
- package/dist/components/panel/panel.component.mjs +90 -0
- package/dist/components/panel/panel.mjs +5 -0
- package/dist/components/panel/panel.styles.mjs +51 -0
- package/dist/components/panel-header/panel-header.component.mjs +131 -0
- package/dist/components/panel-header/panel-header.mjs +5 -0
- package/dist/components/panel-header/panel-header.styles.mjs +67 -0
- package/dist/components/popup/popup.component.mjs +420 -0
- package/dist/components/popup/popup.mjs +5 -0
- package/dist/components/popup/popup.styles.mjs +63 -0
- package/dist/components/progress-bar/progress-bar.component.mjs +70 -0
- package/dist/components/progress-bar/progress-bar.mjs +5 -0
- package/dist/components/progress-bar/progress-bar.styles.mjs +87 -0
- package/dist/components/progress-ring/progress-ring.component.mjs +71 -0
- package/dist/components/progress-ring/progress-ring.mjs +5 -0
- package/dist/components/progress-ring/progress-ring.styles.mjs +72 -0
- package/dist/components/query-builder/converters/flow-query-converters.mjs +111 -0
- package/dist/components/query-builder/converters/map-layer-filter-converter.mjs +99 -0
- package/dist/components/query-builder/default-value-templates.mjs +151 -0
- package/dist/components/query-builder/helpers.mjs +42 -0
- package/dist/components/query-builder/query-builder.component.mjs +466 -0
- package/dist/components/query-builder/query-builder.mjs +5 -0
- package/dist/components/query-builder/query-builder.styles.mjs +261 -0
- package/dist/components/radio/radio.component.mjs +144 -0
- package/dist/components/radio/radio.mjs +5 -0
- package/dist/components/radio/radio.styles.mjs +164 -0
- package/dist/components/radio-group/radio-group.component.mjs +310 -0
- package/dist/components/radio-group/radio-group.mjs +5 -0
- package/dist/components/radio-group/radio-group.styles.mjs +49 -0
- package/dist/components/range/range.component.mjs +324 -0
- package/dist/components/range/range.mjs +5 -0
- package/dist/components/range/range.styles.mjs +233 -0
- package/dist/components/resize-observer/resize-observer.component.mjs +80 -0
- package/dist/components/resize-observer/resize-observer.mjs +5 -0
- package/dist/components/resize-observer/resize-observer.styles.mjs +12 -0
- package/dist/components/scroll-view/overlay-scrollbar.styles.mjs +686 -0
- package/dist/components/scroll-view/scroll-view.component.mjs +128 -0
- package/dist/components/scroll-view/scroll-view.mjs +5 -0
- package/dist/components/scroll-view/scroll-view.styles.mjs +57 -0
- package/dist/components/select/select.component.mjs +785 -0
- package/dist/components/select/select.mjs +5 -0
- package/dist/components/select/select.styles.mjs +339 -0
- package/dist/components/spinner/spinner.component.mjs +22 -0
- package/dist/components/spinner/spinner.mjs +5 -0
- package/dist/components/spinner/spinner.styles.mjs +64 -0
- package/dist/components/split-view/split-view.component.mjs +500 -0
- package/dist/components/split-view/split-view.mjs +5 -0
- package/dist/components/split-view/split-view.styles.mjs +33 -0
- package/dist/components/split-view-divider/split-view-divider.component.mjs +98 -0
- package/dist/components/split-view-divider/split-view-divider.mjs +5 -0
- package/dist/components/split-view-divider/split-view-divider.styles.mjs +96 -0
- package/dist/components/split-view-pane/split-view-pane.component.mjs +126 -0
- package/dist/components/split-view-pane/split-view-pane.mjs +5 -0
- package/dist/components/split-view-pane/split-view-pane.styles.mjs +49 -0
- package/dist/components/split-view-toggle-button/split-view-toggle-button.component.mjs +76 -0
- package/dist/components/split-view-toggle-button/split-view-toggle-button.mjs +5 -0
- package/dist/components/split-view-toggle-button/split-view-toggle-button.styles.mjs +40 -0
- package/dist/components/stepper/stepper.component.mjs +139 -0
- package/dist/components/stepper/stepper.mjs +5 -0
- package/dist/components/stepper/stepper.styles.mjs +103 -0
- package/dist/components/stepper-panel/stepper-panel.component.mjs +76 -0
- package/dist/components/stepper-panel/stepper-panel.mjs +5 -0
- package/dist/components/stepper-panel/stepper-panel.styles.mjs +22 -0
- package/dist/components/switch/switch.component.mjs +211 -0
- package/dist/components/switch/switch.mjs +5 -0
- package/dist/components/switch/switch.styles.mjs +166 -0
- package/dist/components/tab/tab.component.mjs +159 -0
- package/dist/components/tab/tab.mjs +5 -0
- package/dist/components/tab/tab.styles.mjs +107 -0
- package/dist/components/tab-group/tab-group.component.mjs +402 -0
- package/dist/components/tab-group/tab-group.mjs +5 -0
- package/dist/components/tab-group/tab-group.styles.mjs +386 -0
- package/dist/components/tab-panel/tab-panel.component.mjs +72 -0
- package/dist/components/tab-panel/tab-panel.mjs +5 -0
- package/dist/components/tab-panel/tab-panel.styles.mjs +55 -0
- package/dist/components/tag/tag.component.mjs +94 -0
- package/dist/components/tag/tag.mjs +5 -0
- package/dist/components/tag/tag.styles.mjs +130 -0
- package/dist/components/textarea/textarea.component.mjs +359 -0
- package/dist/components/textarea/textarea.mjs +5 -0
- package/dist/components/textarea/textarea.styles.mjs +171 -0
- package/dist/components/timer/ticker.mjs +78 -0
- package/dist/components/timer/timer.component.mjs +297 -0
- package/dist/components/timer/timer.mjs +5 -0
- package/dist/components/timer/timer.styles.mjs +95 -0
- package/dist/components/tool-button/tool-button.component.mjs +208 -0
- package/dist/components/tool-button/tool-button.mjs +5 -0
- package/dist/components/tool-button/tool-button.styles.mjs +251 -0
- package/dist/components/tool-button-group/tool-button-group.component.mjs +347 -0
- package/dist/components/tool-button-group/tool-button-group.mjs +5 -0
- package/dist/components/tool-button-group/tool-button-group.styles.mjs +59 -0
- package/dist/components/tooltip/tooltip.component.mjs +259 -0
- package/dist/components/tooltip/tooltip.mjs +5 -0
- package/dist/components/tooltip/tooltip.styles.mjs +57 -0
- package/dist/components/tree/tree.component.mjs +368 -0
- package/dist/components/tree/tree.mjs +5 -0
- package/dist/components/tree/tree.styles.mjs +41 -0
- package/dist/components/tree-item/tree-item.component.mjs +324 -0
- package/dist/components/tree-item/tree-item.mjs +5 -0
- package/dist/components/tree-item/tree-item.styles.mjs +178 -0
- package/dist/components/visually-hidden/visually-hidden.component.mjs +14 -0
- package/dist/components/visually-hidden/visually-hidden.mjs +5 -0
- package/dist/components/visually-hidden/visually-hidden.styles.mjs +20 -0
- package/dist/custom-elements.json +1535 -1530
- package/dist/index.d.mts +145 -132
- package/dist/index.d.ts +145 -132
- package/dist/index.mjs +78 -25094
- package/dist/internal/animate.mjs +47 -0
- package/dist/internal/animations/attention_seekers/bounce.mjs +17 -0
- package/dist/internal/animations/attention_seekers/flash.mjs +9 -0
- package/dist/internal/animations/attention_seekers/headShake.mjs +10 -0
- package/dist/internal/animations/attention_seekers/heartBeat.mjs +9 -0
- package/dist/internal/animations/attention_seekers/jello.mjs +14 -0
- package/dist/internal/animations/attention_seekers/pulse.mjs +7 -0
- package/dist/internal/animations/attention_seekers/rubberBand.mjs +11 -0
- package/dist/internal/animations/attention_seekers/shake.mjs +15 -0
- package/dist/internal/animations/attention_seekers/shakeX.mjs +15 -0
- package/dist/internal/animations/attention_seekers/shakeY.mjs +15 -0
- package/dist/internal/animations/attention_seekers/swing.mjs +9 -0
- package/dist/internal/animations/attention_seekers/tada.mjs +15 -0
- package/dist/internal/animations/attention_seekers/wobble.mjs +11 -0
- package/dist/internal/animations/back_entrances/backInDown.mjs +7 -0
- package/dist/internal/animations/back_entrances/backInLeft.mjs +7 -0
- package/dist/internal/animations/back_entrances/backInRight.mjs +7 -0
- package/dist/internal/animations/back_entrances/backInUp.mjs +7 -0
- package/dist/internal/animations/back_exits/backOutDown.mjs +7 -0
- package/dist/internal/animations/back_exits/backOutLeft.mjs +7 -0
- package/dist/internal/animations/back_exits/backOutRight.mjs +7 -0
- package/dist/internal/animations/back_exits/backOutUp.mjs +7 -0
- package/dist/internal/animations/bouncing_entrances/bounceIn.mjs +16 -0
- package/dist/internal/animations/bouncing_entrances/bounceInDown.mjs +14 -0
- package/dist/internal/animations/bouncing_entrances/bounceInLeft.mjs +14 -0
- package/dist/internal/animations/bouncing_entrances/bounceInRight.mjs +14 -0
- package/dist/internal/animations/bouncing_entrances/bounceInUp.mjs +14 -0
- package/dist/internal/animations/bouncing_exits/bounceOut.mjs +8 -0
- package/dist/internal/animations/bouncing_exits/bounceOutDown.mjs +8 -0
- package/dist/internal/animations/bouncing_exits/bounceOutLeft.mjs +6 -0
- package/dist/internal/animations/bouncing_exits/bounceOutRight.mjs +6 -0
- package/dist/internal/animations/bouncing_exits/bounceOutUp.mjs +8 -0
- package/dist/internal/animations/easings/easings.mjs +33 -0
- package/dist/internal/animations/fading_entrances/fadeIn.mjs +6 -0
- package/dist/internal/animations/fading_entrances/fadeInBottomLeft.mjs +6 -0
- package/dist/internal/animations/fading_entrances/fadeInBottomRight.mjs +6 -0
- package/dist/internal/animations/fading_entrances/fadeInDown.mjs +6 -0
- package/dist/internal/animations/fading_entrances/fadeInDownBig.mjs +6 -0
- package/dist/internal/animations/fading_entrances/fadeInLeft.mjs +6 -0
- package/dist/internal/animations/fading_entrances/fadeInLeftBig.mjs +6 -0
- package/dist/internal/animations/fading_entrances/fadeInRight.mjs +6 -0
- package/dist/internal/animations/fading_entrances/fadeInRightBig.mjs +6 -0
- package/dist/internal/animations/fading_entrances/fadeInTopLeft.mjs +6 -0
- package/dist/internal/animations/fading_entrances/fadeInTopRight.mjs +6 -0
- package/dist/internal/animations/fading_entrances/fadeInUp.mjs +6 -0
- package/dist/internal/animations/fading_entrances/fadeInUpBig.mjs +6 -0
- package/dist/internal/animations/fading_exits/fadeOut.mjs +6 -0
- package/dist/internal/animations/fading_exits/fadeOutBottomLeft.mjs +6 -0
- package/dist/internal/animations/fading_exits/fadeOutBottomRight.mjs +6 -0
- package/dist/internal/animations/fading_exits/fadeOutDown.mjs +6 -0
- package/dist/internal/animations/fading_exits/fadeOutDownBig.mjs +6 -0
- package/dist/internal/animations/fading_exits/fadeOutLeft.mjs +6 -0
- package/dist/internal/animations/fading_exits/fadeOutLeftBig.mjs +6 -0
- package/dist/internal/animations/fading_exits/fadeOutRight.mjs +6 -0
- package/dist/internal/animations/fading_exits/fadeOutRightBig.mjs +6 -0
- package/dist/internal/animations/fading_exits/fadeOutTopLeft.mjs +6 -0
- package/dist/internal/animations/fading_exits/fadeOutTopRight.mjs +6 -0
- package/dist/internal/animations/fading_exits/fadeOutUp.mjs +6 -0
- package/dist/internal/animations/fading_exits/fadeOutUpBig.mjs +6 -0
- package/dist/internal/animations/flippers/flip.mjs +29 -0
- package/dist/internal/animations/flippers/flipInX.mjs +9 -0
- package/dist/internal/animations/flippers/flipInY.mjs +9 -0
- package/dist/internal/animations/flippers/flipOutX.mjs +7 -0
- package/dist/internal/animations/flippers/flipOutY.mjs +7 -0
- package/dist/internal/animations/index.mjs +99 -0
- package/dist/internal/animations/lightspeed/lightSpeedInLeft.mjs +8 -0
- package/dist/internal/animations/lightspeed/lightSpeedInRight.mjs +8 -0
- package/dist/internal/animations/lightspeed/lightSpeedOutLeft.mjs +6 -0
- package/dist/internal/animations/lightspeed/lightSpeedOutRight.mjs +6 -0
- package/dist/internal/animations/rotating_entrances/rotateIn.mjs +6 -0
- package/dist/internal/animations/rotating_entrances/rotateInDownLeft.mjs +6 -0
- package/dist/internal/animations/rotating_entrances/rotateInDownRight.mjs +6 -0
- package/dist/internal/animations/rotating_entrances/rotateInUpLeft.mjs +6 -0
- package/dist/internal/animations/rotating_entrances/rotateInUpRight.mjs +6 -0
- package/dist/internal/animations/rotating_exits/rotateOut.mjs +6 -0
- package/dist/internal/animations/rotating_exits/rotateOutDownLeft.mjs +6 -0
- package/dist/internal/animations/rotating_exits/rotateOutDownRight.mjs +6 -0
- package/dist/internal/animations/rotating_exits/rotateOutUpLeft.mjs +6 -0
- package/dist/internal/animations/rotating_exits/rotateOutUpRight.mjs +6 -0
- package/dist/internal/animations/sliding_entrances/slideInDown.mjs +6 -0
- package/dist/internal/animations/sliding_entrances/slideInLeft.mjs +6 -0
- package/dist/internal/animations/sliding_entrances/slideInRight.mjs +6 -0
- package/dist/internal/animations/sliding_entrances/slideInUp.mjs +6 -0
- package/dist/internal/animations/sliding_exits/slideOutDown.mjs +6 -0
- package/dist/internal/animations/sliding_exits/slideOutLeft.mjs +6 -0
- package/dist/internal/animations/sliding_exits/slideOutRight.mjs +6 -0
- package/dist/internal/animations/sliding_exits/slideOutUp.mjs +6 -0
- package/dist/internal/animations/specials/hinge.mjs +10 -0
- package/dist/internal/animations/specials/jackInTheBox.mjs +8 -0
- package/dist/internal/animations/specials/rollIn.mjs +6 -0
- package/dist/internal/animations/specials/rollOut.mjs +6 -0
- package/dist/internal/animations/zooming_entrances/zoomIn.mjs +6 -0
- package/dist/internal/animations/zooming_entrances/zoomInDown.mjs +16 -0
- package/dist/internal/animations/zooming_entrances/zoomInLeft.mjs +16 -0
- package/dist/internal/animations/zooming_entrances/zoomInRight.mjs +16 -0
- package/dist/internal/animations/zooming_entrances/zoomInUp.mjs +16 -0
- package/dist/internal/animations/zooming_exits/zoomOut.mjs +7 -0
- package/dist/internal/animations/zooming_exits/zoomOutDown.mjs +16 -0
- package/dist/internal/animations/zooming_exits/zoomOutLeft.mjs +6 -0
- package/dist/internal/animations/zooming_exits/zoomOutRight.mjs +6 -0
- package/dist/internal/animations/zooming_exits/zoomOutUp.mjs +16 -0
- package/dist/internal/boolean.mjs +17 -0
- package/dist/internal/datetime.mjs +65 -0
- package/dist/internal/debounce.mjs +14 -0
- package/dist/internal/default-value.mjs +21 -0
- package/dist/internal/drag.mjs +30 -0
- package/dist/internal/ensure-array.mjs +16 -0
- package/dist/internal/event.mjs +13 -0
- package/dist/internal/flow-ui-rdf-element.mjs +61 -0
- package/dist/internal/form.mjs +264 -0
- package/dist/internal/localize.mjs +124 -0
- package/dist/internal/math.mjs +12 -0
- package/dist/internal/modal.mjs +52 -0
- package/dist/internal/offset.mjs +8 -0
- package/dist/internal/orderby.mjs +18 -0
- package/dist/internal/scroll.mjs +47 -0
- package/dist/internal/slot.mjs +59 -0
- package/dist/internal/string.mjs +5 -0
- package/dist/internal/tabbable.mjs +49 -0
- package/dist/internal/throttle.mjs +28 -0
- package/dist/internal/type-checks.mjs +16 -0
- package/dist/internal/watch.mjs +27 -0
- package/dist/package.json.mjs +3 -0
- package/dist/public-api.mjs +10 -0
- package/dist/styles/component.styles.mjs +19 -0
- package/dist/styles/form-control.styles.mjs +63 -0
- package/dist/translations/en.mjs +34 -0
- package/dist/utilities/animation-registry.mjs +33 -0
- package/dist/utilities/announce.mjs +12 -0
- package/dist/utilities/locale.mjs +10 -0
- package/dist/utilities/localize.mjs +7 -0
- package/dist/utilities/register-components.mjs +203 -0
- package/dist/vscode.html-custom-data.json +193 -181
- package/package.json +5 -8
- package/themes/dark.css +6 -2
- package/themes/dark.styles.js +6 -2
- package/themes/light.css +6 -2
- package/themes/light.styles.js +6 -2
- package/dist/icons/index.cjs +0 -4053
- package/dist/icons/index.d.cts +0 -2027
- package/dist/index.cjs +0 -25187
- package/dist/index.d.cts +0 -5678
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
import componentStyles from '../../styles/component.styles.mjs';
|
|
3
|
+
|
|
4
|
+
const styles = css`
|
|
5
|
+
${componentStyles}
|
|
6
|
+
|
|
7
|
+
:host {
|
|
8
|
+
--border-color: var(--flow-ui-color-neutral-200);
|
|
9
|
+
--border-radius: var(--flow-ui-border-radius-medium);
|
|
10
|
+
--border-width: 1px;
|
|
11
|
+
--padding: var(--flow-ui-spacing-large);
|
|
12
|
+
|
|
13
|
+
display: inline-block;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.card {
|
|
17
|
+
display: flex;
|
|
18
|
+
flex-direction: column;
|
|
19
|
+
background-color: var(--flow-ui-panel-background-color);
|
|
20
|
+
box-shadow: var(--flow-ui-shadow-x-small);
|
|
21
|
+
border: solid var(--border-width) var(--border-color);
|
|
22
|
+
border-radius: var(--border-radius);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.card__image {
|
|
26
|
+
display: flex;
|
|
27
|
+
border-top-left-radius: var(--border-radius);
|
|
28
|
+
border-top-right-radius: var(--border-radius);
|
|
29
|
+
margin: calc(-1 * var(--border-width));
|
|
30
|
+
overflow: hidden;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.card__image::slotted(img) {
|
|
34
|
+
display: block;
|
|
35
|
+
width: 100%;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.card:not(.card--has-image) .card__image {
|
|
39
|
+
display: none;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.card__header {
|
|
43
|
+
display: block;
|
|
44
|
+
border-bottom: solid var(--border-width) var(--border-color);
|
|
45
|
+
padding: calc(var(--padding) / 2) var(--padding);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.card:not(.card--has-header) .card__header {
|
|
49
|
+
display: none;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.card:not(.card--has-image) .card__header {
|
|
53
|
+
border-top-left-radius: var(--border-radius);
|
|
54
|
+
border-top-right-radius: var(--border-radius);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.card__body {
|
|
58
|
+
display: block;
|
|
59
|
+
padding: var(--padding);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.card--has-footer .card__footer {
|
|
63
|
+
display: block;
|
|
64
|
+
border-top: solid var(--border-width) var(--border-color);
|
|
65
|
+
padding: var(--padding);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.card:not(.card--has-footer) .card__footer {
|
|
69
|
+
display: none;
|
|
70
|
+
}
|
|
71
|
+
`;
|
|
72
|
+
|
|
73
|
+
export { styles as default };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
class AutoplayController {
|
|
2
|
+
constructor(host, tickCallback) {
|
|
3
|
+
this.timerId = 0;
|
|
4
|
+
this.activeInteractions = 0;
|
|
5
|
+
this.paused = false;
|
|
6
|
+
this.stopped = true;
|
|
7
|
+
this.pause = () => {
|
|
8
|
+
if (!this.activeInteractions++) {
|
|
9
|
+
this.paused = true;
|
|
10
|
+
this.host.requestUpdate();
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
this.resume = () => {
|
|
14
|
+
if (!--this.activeInteractions) {
|
|
15
|
+
this.paused = false;
|
|
16
|
+
this.host.requestUpdate();
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
host.addController(this);
|
|
20
|
+
this.host = host;
|
|
21
|
+
this.tickCallback = tickCallback;
|
|
22
|
+
}
|
|
23
|
+
hostConnected() {
|
|
24
|
+
this.host.addEventListener("mouseenter", this.pause);
|
|
25
|
+
this.host.addEventListener("mouseleave", this.resume);
|
|
26
|
+
this.host.addEventListener("focusin", this.pause);
|
|
27
|
+
this.host.addEventListener("focusout", this.resume);
|
|
28
|
+
this.host.addEventListener("touchstart", this.pause, { passive: true });
|
|
29
|
+
this.host.addEventListener("touchend", this.resume);
|
|
30
|
+
}
|
|
31
|
+
hostDisconnected() {
|
|
32
|
+
this.stop();
|
|
33
|
+
this.host.removeEventListener("mouseenter", this.pause);
|
|
34
|
+
this.host.removeEventListener("mouseleave", this.resume);
|
|
35
|
+
this.host.removeEventListener("focusin", this.pause);
|
|
36
|
+
this.host.removeEventListener("focusout", this.resume);
|
|
37
|
+
this.host.removeEventListener("touchstart", this.pause);
|
|
38
|
+
this.host.removeEventListener("touchend", this.resume);
|
|
39
|
+
}
|
|
40
|
+
start(interval) {
|
|
41
|
+
this.stop();
|
|
42
|
+
this.stopped = false;
|
|
43
|
+
this.timerId = window.setInterval(() => {
|
|
44
|
+
if (!this.paused) {
|
|
45
|
+
this.tickCallback();
|
|
46
|
+
}
|
|
47
|
+
}, interval);
|
|
48
|
+
}
|
|
49
|
+
stop() {
|
|
50
|
+
clearInterval(this.timerId);
|
|
51
|
+
this.stopped = true;
|
|
52
|
+
this.host.requestUpdate();
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export { AutoplayController };
|
|
@@ -0,0 +1,406 @@
|
|
|
1
|
+
import { html } from 'lit';
|
|
2
|
+
import { property, query, state } from 'lit/decorators.js';
|
|
3
|
+
import { classMap } from 'lit/directives/class-map.js';
|
|
4
|
+
import { map } from 'lit/directives/map.js';
|
|
5
|
+
import { range } from 'lit/directives/range.js';
|
|
6
|
+
import { prefersReducedMotion } from '../../internal/animate.mjs';
|
|
7
|
+
import { boolean } from '../../internal/boolean.mjs';
|
|
8
|
+
import FlowRdfElement from '../../internal/flow-ui-rdf-element.mjs';
|
|
9
|
+
import { clamp } from '../../internal/math.mjs';
|
|
10
|
+
import { watch } from '../../internal/watch.mjs';
|
|
11
|
+
import { LocalizeController } from '../../utilities/localize.mjs';
|
|
12
|
+
import FlowUiCarouselItem from '../carousel-item/carousel-item.component.mjs';
|
|
13
|
+
import { AutoplayController } from './autoplay-controller.mjs';
|
|
14
|
+
import styles from './carousel.styles.mjs';
|
|
15
|
+
import { ScrollController } from './scroll-controller.mjs';
|
|
16
|
+
|
|
17
|
+
var __defProp = Object.defineProperty;
|
|
18
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
19
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
20
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
21
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
22
|
+
if (decorator = decorators[i])
|
|
23
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
24
|
+
if (kind && result)
|
|
25
|
+
__defProp(target, key, result);
|
|
26
|
+
return result;
|
|
27
|
+
};
|
|
28
|
+
class FlowUiCarousel extends FlowRdfElement {
|
|
29
|
+
constructor() {
|
|
30
|
+
super(...arguments);
|
|
31
|
+
this.loop = false;
|
|
32
|
+
this.navigation = false;
|
|
33
|
+
this.pagination = false;
|
|
34
|
+
this.autoplay = false;
|
|
35
|
+
this.autoplayInterval = 3e3;
|
|
36
|
+
this.slidesPerPage = 1;
|
|
37
|
+
this.slidesPerMove = 1;
|
|
38
|
+
this.orientation = "horizontal";
|
|
39
|
+
this.mouseDragging = false;
|
|
40
|
+
this.activeSlide = 0;
|
|
41
|
+
this.autoplayController = new AutoplayController(this, () => this.next());
|
|
42
|
+
this.scrollController = new ScrollController(this);
|
|
43
|
+
this.slides = this.getElementsByTagName("flow-ui-carousel-item");
|
|
44
|
+
// determines which slide is displayed
|
|
45
|
+
// A map containing the state of all the slides
|
|
46
|
+
this.intersectionObserverEntries = /* @__PURE__ */ new Map();
|
|
47
|
+
this.localize = new LocalizeController(this);
|
|
48
|
+
}
|
|
49
|
+
connectedCallback() {
|
|
50
|
+
super.connectedCallback();
|
|
51
|
+
this.loop = boolean(this.loop, true);
|
|
52
|
+
this.navigation = boolean(this.navigation, true);
|
|
53
|
+
this.pagination = boolean(this.pagination, true);
|
|
54
|
+
this.autoplay = boolean(this.autoplay, true);
|
|
55
|
+
this.mouseDragging = boolean(this.mouseDragging, true);
|
|
56
|
+
this.setAttribute("role", "region");
|
|
57
|
+
this.setAttribute("aria-label", this.localize.term("carousel"));
|
|
58
|
+
const intersectionObserver = new IntersectionObserver(
|
|
59
|
+
(entries) => {
|
|
60
|
+
entries.forEach((entry) => {
|
|
61
|
+
this.intersectionObserverEntries.set(entry.target, entry);
|
|
62
|
+
const slide = entry.target;
|
|
63
|
+
slide.toggleAttribute("inert", !entry.isIntersecting);
|
|
64
|
+
slide.classList.toggle("--in-view", entry.isIntersecting);
|
|
65
|
+
slide.setAttribute("aria-hidden", entry.isIntersecting ? "false" : "true");
|
|
66
|
+
});
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
root: this,
|
|
70
|
+
threshold: 0.6
|
|
71
|
+
}
|
|
72
|
+
);
|
|
73
|
+
this.intersectionObserver = intersectionObserver;
|
|
74
|
+
intersectionObserver.takeRecords().forEach((entry) => {
|
|
75
|
+
this.intersectionObserverEntries.set(entry.target, entry);
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
disconnectedCallback() {
|
|
79
|
+
super.disconnectedCallback();
|
|
80
|
+
this.intersectionObserver.disconnect();
|
|
81
|
+
this.mutationObserver.disconnect();
|
|
82
|
+
}
|
|
83
|
+
firstUpdated() {
|
|
84
|
+
this.initializeSlides();
|
|
85
|
+
this.mutationObserver = new MutationObserver(this.handleSlotChange.bind(this));
|
|
86
|
+
this.mutationObserver.observe(this, { childList: true, subtree: false });
|
|
87
|
+
}
|
|
88
|
+
getPageCount() {
|
|
89
|
+
return Math.ceil(this.getSlides().length / this.slidesPerPage);
|
|
90
|
+
}
|
|
91
|
+
getCurrentPage() {
|
|
92
|
+
return Math.floor(this.activeSlide / this.slidesPerPage);
|
|
93
|
+
}
|
|
94
|
+
getSlides({ excludeClones = true } = {}) {
|
|
95
|
+
return [...this.slides].filter((slide) => !excludeClones || !slide.hasAttribute("data-clone"));
|
|
96
|
+
}
|
|
97
|
+
handleKeyDown(event) {
|
|
98
|
+
if (["ArrowLeft", "ArrowRight", "ArrowUp", "ArrowDown", "Home", "End"].includes(event.key)) {
|
|
99
|
+
const target = event.target;
|
|
100
|
+
const isRtl = this.localize.dir() === "rtl";
|
|
101
|
+
const isFocusInPagination = target.closest('[part~="pagination-item"]') !== null;
|
|
102
|
+
const isNext = event.key === "ArrowDown" || !isRtl && event.key === "ArrowRight" || isRtl && event.key === "ArrowLeft";
|
|
103
|
+
const isPrevious = event.key === "ArrowUp" || !isRtl && event.key === "ArrowLeft" || isRtl && event.key === "ArrowRight";
|
|
104
|
+
event.preventDefault();
|
|
105
|
+
if (isPrevious) {
|
|
106
|
+
this.previous();
|
|
107
|
+
}
|
|
108
|
+
if (isNext) {
|
|
109
|
+
this.next();
|
|
110
|
+
}
|
|
111
|
+
if (event.key === "Home") {
|
|
112
|
+
this.goToSlide(0);
|
|
113
|
+
}
|
|
114
|
+
if (event.key === "End") {
|
|
115
|
+
this.goToSlide(this.getSlides().length - 1);
|
|
116
|
+
}
|
|
117
|
+
if (isFocusInPagination) {
|
|
118
|
+
this.updateComplete.then(() => {
|
|
119
|
+
const activePaginationItem = this.shadowRoot?.querySelector(
|
|
120
|
+
'[part~="pagination-item--active"]'
|
|
121
|
+
);
|
|
122
|
+
if (activePaginationItem) {
|
|
123
|
+
activePaginationItem.focus();
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
handleScrollEnd() {
|
|
130
|
+
const slides = this.getSlides();
|
|
131
|
+
const entries = [...this.intersectionObserverEntries.values()];
|
|
132
|
+
const firstIntersecting = entries.find((entry) => entry.isIntersecting);
|
|
133
|
+
if (this.loop && firstIntersecting?.target.hasAttribute("data-clone")) {
|
|
134
|
+
const clonePosition = Number(firstIntersecting.target.getAttribute("data-clone"));
|
|
135
|
+
this.goToSlide(clonePosition, "auto");
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
if (firstIntersecting) {
|
|
139
|
+
this.activeSlide = slides.indexOf(firstIntersecting.target);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
handleSlotChange(mutations) {
|
|
143
|
+
const needsInitialization = mutations.some(
|
|
144
|
+
(mutation) => [...mutation.addedNodes, ...mutation.removedNodes].some(
|
|
145
|
+
(node) => FlowUiCarouselItem.isCarouselItem(node) && !node.hasAttribute("data-clone")
|
|
146
|
+
)
|
|
147
|
+
);
|
|
148
|
+
if (needsInitialization) {
|
|
149
|
+
this.initializeSlides();
|
|
150
|
+
}
|
|
151
|
+
this.requestUpdate();
|
|
152
|
+
}
|
|
153
|
+
initializeSlides() {
|
|
154
|
+
const slides = this.getSlides();
|
|
155
|
+
const intersectionObserver = this.intersectionObserver;
|
|
156
|
+
this.intersectionObserverEntries.clear();
|
|
157
|
+
this.getSlides({ excludeClones: false }).forEach((slide, index) => {
|
|
158
|
+
intersectionObserver.unobserve(slide);
|
|
159
|
+
slide.classList.remove("--in-view");
|
|
160
|
+
slide.classList.remove("--is-active");
|
|
161
|
+
slide.setAttribute("aria-label", this.localize.term("slideNum", index + 1));
|
|
162
|
+
if (slide.hasAttribute("data-clone")) {
|
|
163
|
+
slide.remove();
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
if (this.loop) {
|
|
167
|
+
const slidesPerPage = this.slidesPerPage;
|
|
168
|
+
const lastSlides = slides.slice(-slidesPerPage);
|
|
169
|
+
const firstSlides = slides.slice(0, slidesPerPage);
|
|
170
|
+
lastSlides.reverse().forEach((slide, i) => {
|
|
171
|
+
const clone = slide.cloneNode(true);
|
|
172
|
+
clone.setAttribute("data-clone", String(slides.length - i - 1));
|
|
173
|
+
this.prepend(clone);
|
|
174
|
+
});
|
|
175
|
+
firstSlides.forEach((slide, i) => {
|
|
176
|
+
const clone = slide.cloneNode(true);
|
|
177
|
+
clone.setAttribute("data-clone", String(i));
|
|
178
|
+
this.append(clone);
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
this.getSlides({ excludeClones: false }).forEach((slide) => {
|
|
182
|
+
intersectionObserver.observe(slide);
|
|
183
|
+
});
|
|
184
|
+
this.goToSlide(this.activeSlide, "auto");
|
|
185
|
+
}
|
|
186
|
+
handelSlideChange() {
|
|
187
|
+
const slides = this.getSlides();
|
|
188
|
+
slides.forEach((slide, i) => {
|
|
189
|
+
slide.classList.toggle("--is-active", i === this.activeSlide);
|
|
190
|
+
});
|
|
191
|
+
if (this.hasUpdated) {
|
|
192
|
+
this.emit("flow-ui-slide-change", {
|
|
193
|
+
detail: {
|
|
194
|
+
index: this.activeSlide,
|
|
195
|
+
slide: slides[this.activeSlide]
|
|
196
|
+
}
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
handleSlidesPerMoveChange() {
|
|
201
|
+
const slides = this.getSlides({ excludeClones: false });
|
|
202
|
+
const slidesPerMove = this.slidesPerMove;
|
|
203
|
+
slides.forEach((slide, i) => {
|
|
204
|
+
const shouldSnap = Math.abs(i - slidesPerMove) % slidesPerMove === 0;
|
|
205
|
+
if (shouldSnap) {
|
|
206
|
+
slide.style.removeProperty("scroll-snap-align");
|
|
207
|
+
} else {
|
|
208
|
+
slide.style.setProperty("scroll-snap-align", "none");
|
|
209
|
+
}
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
handleAutoplayChange() {
|
|
213
|
+
this.autoplayController.stop();
|
|
214
|
+
if (this.autoplay) {
|
|
215
|
+
this.autoplayController.start(this.autoplayInterval);
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
handleMouseDraggingChange() {
|
|
219
|
+
this.scrollController.mouseDragging = this.mouseDragging;
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Move the carousel backward by `slides-per-move` slides.
|
|
223
|
+
*
|
|
224
|
+
* @param behavior - The behavior used for scrolling.
|
|
225
|
+
*/
|
|
226
|
+
previous(behavior = "smooth") {
|
|
227
|
+
this.goToSlide(this.activeSlide - this.slidesPerMove, behavior);
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* Move the carousel forward by `slides-per-move` slides.
|
|
231
|
+
*
|
|
232
|
+
* @param behavior - The behavior used for scrolling.
|
|
233
|
+
*/
|
|
234
|
+
next(behavior = "smooth") {
|
|
235
|
+
this.goToSlide(this.activeSlide + this.slidesPerMove, behavior);
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* Scrolls the carousel to the slide specified by `index`.
|
|
239
|
+
*
|
|
240
|
+
* @param index - The slide index.
|
|
241
|
+
* @param behavior - The behavior used for scrolling.
|
|
242
|
+
*/
|
|
243
|
+
goToSlide(index, behavior = "smooth") {
|
|
244
|
+
const { slidesPerPage, loop, scrollContainer } = this;
|
|
245
|
+
const slides = this.getSlides();
|
|
246
|
+
const slidesWithClones = this.getSlides({ excludeClones: false });
|
|
247
|
+
const newActiveSlide = (index + slides.length) % slides.length;
|
|
248
|
+
this.activeSlide = newActiveSlide;
|
|
249
|
+
const nextSlideIndex = clamp(index + (loop ? slidesPerPage : 0), 0, slidesWithClones.length - 1);
|
|
250
|
+
const nextSlide = slidesWithClones[nextSlideIndex];
|
|
251
|
+
const scrollContainerRect = scrollContainer.getBoundingClientRect();
|
|
252
|
+
const nextSlideRect = nextSlide.getBoundingClientRect();
|
|
253
|
+
scrollContainer.scrollTo({
|
|
254
|
+
left: nextSlideRect.left - scrollContainerRect.left + scrollContainer.scrollLeft,
|
|
255
|
+
top: nextSlideRect.top - scrollContainerRect.top + scrollContainer.scrollTop,
|
|
256
|
+
behavior: prefersReducedMotion() ? "auto" : behavior
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
render() {
|
|
260
|
+
const { scrollController, slidesPerPage } = this;
|
|
261
|
+
const pagesCount = this.getPageCount();
|
|
262
|
+
const currentPage = this.getCurrentPage();
|
|
263
|
+
const prevEnabled = this.loop || currentPage > 0;
|
|
264
|
+
const nextEnabled = this.loop || currentPage < pagesCount - 1;
|
|
265
|
+
const isLtr = this.localize.dir() === "ltr";
|
|
266
|
+
return html`
|
|
267
|
+
<div part="base" class="carousel">
|
|
268
|
+
<div
|
|
269
|
+
id="scroll-container"
|
|
270
|
+
part="scroll-container"
|
|
271
|
+
class="${classMap({
|
|
272
|
+
carousel__slides: true,
|
|
273
|
+
"carousel__slides--horizontal": this.orientation === "horizontal",
|
|
274
|
+
"carousel__slides--vertical": this.orientation === "vertical"
|
|
275
|
+
})}"
|
|
276
|
+
style="--slides-per-page: ${this.slidesPerPage};"
|
|
277
|
+
aria-busy="${scrollController.scrolling ? "true" : "false"}"
|
|
278
|
+
aria-atomic="true"
|
|
279
|
+
tabindex="0"
|
|
280
|
+
@keydown=${this.handleKeyDown}
|
|
281
|
+
@scrollend=${this.handleScrollEnd}
|
|
282
|
+
>
|
|
283
|
+
<slot></slot>
|
|
284
|
+
</div>
|
|
285
|
+
|
|
286
|
+
${this.navigation ? html`
|
|
287
|
+
<div part="navigation" class="carousel__navigation">
|
|
288
|
+
<button
|
|
289
|
+
part="navigation-button navigation-button--previous"
|
|
290
|
+
class="${classMap({
|
|
291
|
+
"carousel__navigation-button": true,
|
|
292
|
+
"carousel__navigation-button--previous": true,
|
|
293
|
+
"carousel__navigation-button--disabled": !prevEnabled
|
|
294
|
+
})}"
|
|
295
|
+
aria-label="${this.localize.term("previousSlide")}"
|
|
296
|
+
aria-controls="scroll-container"
|
|
297
|
+
aria-disabled="${prevEnabled ? "false" : "true"}"
|
|
298
|
+
@click=${prevEnabled ? () => this.previous() : null}
|
|
299
|
+
>
|
|
300
|
+
<slot name="previous-icon">
|
|
301
|
+
<flow-ui-icon library="system" name="${isLtr ? "chevron-left" : "chevron-right"}"></flow-ui-icon>
|
|
302
|
+
</slot>
|
|
303
|
+
</button>
|
|
304
|
+
|
|
305
|
+
<button
|
|
306
|
+
part="navigation-button navigation-button--next"
|
|
307
|
+
class=${classMap({
|
|
308
|
+
"carousel__navigation-button": true,
|
|
309
|
+
"carousel__navigation-button--next": true,
|
|
310
|
+
"carousel__navigation-button--disabled": !nextEnabled
|
|
311
|
+
})}
|
|
312
|
+
aria-label="${this.localize.term("nextSlide")}"
|
|
313
|
+
aria-controls="scroll-container"
|
|
314
|
+
aria-disabled="${nextEnabled ? "false" : "true"}"
|
|
315
|
+
@click=${nextEnabled ? () => this.next() : null}
|
|
316
|
+
>
|
|
317
|
+
<slot name="next-icon">
|
|
318
|
+
<flow-ui-icon library="system" name="${isLtr ? "chevron-right" : "chevron-left"}"></flow-ui-icon>
|
|
319
|
+
</slot>
|
|
320
|
+
</button>
|
|
321
|
+
</div>
|
|
322
|
+
` : ""}
|
|
323
|
+
${this.pagination ? html`
|
|
324
|
+
<div part="pagination" role="tablist" class="carousel__pagination" aria-controls="scroll-container">
|
|
325
|
+
${map(range(pagesCount), (index) => {
|
|
326
|
+
const isActive = index === currentPage;
|
|
327
|
+
return html`
|
|
328
|
+
<button
|
|
329
|
+
part="pagination-item ${isActive ? "pagination-item--active" : ""}"
|
|
330
|
+
class="${classMap({
|
|
331
|
+
"carousel__pagination-item": true,
|
|
332
|
+
"carousel__pagination-item--active": isActive
|
|
333
|
+
})}"
|
|
334
|
+
role="tab"
|
|
335
|
+
aria-selected="${isActive ? "true" : "false"}"
|
|
336
|
+
aria-label="${this.localize.term("goToSlide", index + 1, pagesCount)}"
|
|
337
|
+
tabindex=${isActive ? "0" : "-1"}
|
|
338
|
+
@click=${() => this.goToSlide(index * slidesPerPage)}
|
|
339
|
+
@keydown=${this.handleKeyDown}
|
|
340
|
+
></button>
|
|
341
|
+
`;
|
|
342
|
+
})}
|
|
343
|
+
</div>
|
|
344
|
+
` : ""}
|
|
345
|
+
</div>
|
|
346
|
+
`;
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
FlowUiCarousel.styles = styles;
|
|
350
|
+
__decorateClass([
|
|
351
|
+
property({ type: Boolean, reflect: true })
|
|
352
|
+
], FlowUiCarousel.prototype, "loop", 2);
|
|
353
|
+
__decorateClass([
|
|
354
|
+
property({ type: Boolean, reflect: true })
|
|
355
|
+
], FlowUiCarousel.prototype, "navigation", 2);
|
|
356
|
+
__decorateClass([
|
|
357
|
+
property({ type: Boolean, reflect: true })
|
|
358
|
+
], FlowUiCarousel.prototype, "pagination", 2);
|
|
359
|
+
__decorateClass([
|
|
360
|
+
property({ type: Boolean, reflect: true })
|
|
361
|
+
], FlowUiCarousel.prototype, "autoplay", 2);
|
|
362
|
+
__decorateClass([
|
|
363
|
+
property({ type: Number, attribute: "autoplay-interval" })
|
|
364
|
+
], FlowUiCarousel.prototype, "autoplayInterval", 2);
|
|
365
|
+
__decorateClass([
|
|
366
|
+
property({ type: Number, attribute: "slides-per-page" })
|
|
367
|
+
], FlowUiCarousel.prototype, "slidesPerPage", 2);
|
|
368
|
+
__decorateClass([
|
|
369
|
+
property({ type: Number, attribute: "slides-per-move" })
|
|
370
|
+
], FlowUiCarousel.prototype, "slidesPerMove", 2);
|
|
371
|
+
__decorateClass([
|
|
372
|
+
property()
|
|
373
|
+
], FlowUiCarousel.prototype, "orientation", 2);
|
|
374
|
+
__decorateClass([
|
|
375
|
+
property({ type: Boolean, reflect: true, attribute: "mouse-dragging" })
|
|
376
|
+
], FlowUiCarousel.prototype, "mouseDragging", 2);
|
|
377
|
+
__decorateClass([
|
|
378
|
+
query("slot:not([name])")
|
|
379
|
+
], FlowUiCarousel.prototype, "defaultSlot", 2);
|
|
380
|
+
__decorateClass([
|
|
381
|
+
query(".carousel__slides")
|
|
382
|
+
], FlowUiCarousel.prototype, "scrollContainer", 2);
|
|
383
|
+
__decorateClass([
|
|
384
|
+
query(".carousel__pagination")
|
|
385
|
+
], FlowUiCarousel.prototype, "paginationContainer", 2);
|
|
386
|
+
__decorateClass([
|
|
387
|
+
state()
|
|
388
|
+
], FlowUiCarousel.prototype, "activeSlide", 2);
|
|
389
|
+
__decorateClass([
|
|
390
|
+
watch("loop", { waitUntilFirstUpdate: true }),
|
|
391
|
+
watch("slidesPerPage", { waitUntilFirstUpdate: true })
|
|
392
|
+
], FlowUiCarousel.prototype, "initializeSlides", 1);
|
|
393
|
+
__decorateClass([
|
|
394
|
+
watch("activeSlide")
|
|
395
|
+
], FlowUiCarousel.prototype, "handelSlideChange", 1);
|
|
396
|
+
__decorateClass([
|
|
397
|
+
watch("slidesPerMove")
|
|
398
|
+
], FlowUiCarousel.prototype, "handleSlidesPerMoveChange", 1);
|
|
399
|
+
__decorateClass([
|
|
400
|
+
watch("autoplay")
|
|
401
|
+
], FlowUiCarousel.prototype, "handleAutoplayChange", 1);
|
|
402
|
+
__decorateClass([
|
|
403
|
+
watch("mouseDragging")
|
|
404
|
+
], FlowUiCarousel.prototype, "handleMouseDraggingChange", 1);
|
|
405
|
+
|
|
406
|
+
export { FlowUiCarousel as default };
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
import componentStyles from '../../styles/component.styles.mjs';
|
|
3
|
+
|
|
4
|
+
const styles = css`
|
|
5
|
+
${componentStyles}
|
|
6
|
+
|
|
7
|
+
:host {
|
|
8
|
+
--slide-gap: var(--flow-ui-spacing-medium, 1rem);
|
|
9
|
+
--aspect-ratio: 16 / 9;
|
|
10
|
+
--scroll-hint: 0px;
|
|
11
|
+
|
|
12
|
+
display: flex;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.carousel {
|
|
16
|
+
display: grid;
|
|
17
|
+
grid-template-columns: min-content 1fr min-content;
|
|
18
|
+
grid-template-rows: 1fr min-content;
|
|
19
|
+
grid-template-areas:
|
|
20
|
+
'. slides .'
|
|
21
|
+
'. pagination .';
|
|
22
|
+
gap: var(--flow-ui-spacing-medium);
|
|
23
|
+
align-items: center;
|
|
24
|
+
min-height: 100%;
|
|
25
|
+
min-width: 100%;
|
|
26
|
+
position: relative;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.carousel__pagination {
|
|
30
|
+
grid-area: pagination;
|
|
31
|
+
display: flex;
|
|
32
|
+
flex-wrap: wrap;
|
|
33
|
+
justify-content: center;
|
|
34
|
+
gap: var(--flow-ui-spacing-small);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.carousel__slides {
|
|
38
|
+
grid-area: slides;
|
|
39
|
+
|
|
40
|
+
display: grid;
|
|
41
|
+
height: 100%;
|
|
42
|
+
width: 100%;
|
|
43
|
+
align-items: center;
|
|
44
|
+
justify-items: center;
|
|
45
|
+
overflow: auto;
|
|
46
|
+
overscroll-behavior-x: contain;
|
|
47
|
+
scrollbar-width: none;
|
|
48
|
+
aspect-ratio: calc(var(--aspect-ratio) * var(--slides-per-page));
|
|
49
|
+
border-radius: var(--flow-ui-border-radius-small);
|
|
50
|
+
|
|
51
|
+
--slide-size: calc((100% - (var(--slides-per-page) - 1) * var(--slide-gap)) / var(--slides-per-page));
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
@media (prefers-reduced-motion) {
|
|
55
|
+
:where(.carousel__slides) {
|
|
56
|
+
scroll-behavior: auto;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.carousel__slides--horizontal {
|
|
61
|
+
grid-auto-flow: column;
|
|
62
|
+
grid-auto-columns: var(--slide-size);
|
|
63
|
+
grid-auto-rows: 100%;
|
|
64
|
+
column-gap: var(--slide-gap);
|
|
65
|
+
scroll-snap-type: x mandatory;
|
|
66
|
+
scroll-padding-inline: var(--scroll-hint);
|
|
67
|
+
padding-inline: var(--scroll-hint);
|
|
68
|
+
overflow-y: hidden;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.carousel__slides--vertical {
|
|
72
|
+
grid-auto-flow: row;
|
|
73
|
+
grid-auto-columns: 100%;
|
|
74
|
+
grid-auto-rows: var(--slide-size);
|
|
75
|
+
row-gap: var(--slide-gap);
|
|
76
|
+
scroll-snap-type: y mandatory;
|
|
77
|
+
scroll-padding-block: var(--scroll-hint);
|
|
78
|
+
padding-block: var(--scroll-hint);
|
|
79
|
+
overflow-x: hidden;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.carousel__slides--dragging,
|
|
83
|
+
.carousel__slides--dropping {
|
|
84
|
+
scroll-snap-type: unset;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
:host([vertical]) ::slotted(flow-ui-carousel-item) {
|
|
88
|
+
height: 100%;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.carousel__slides::-webkit-scrollbar {
|
|
92
|
+
display: none;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.carousel__navigation {
|
|
96
|
+
grid-area: navigation;
|
|
97
|
+
display: contents;
|
|
98
|
+
font-size: var(--flow-ui-font-size-x-large);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.carousel__navigation-button {
|
|
102
|
+
flex: 0 0 auto;
|
|
103
|
+
display: flex;
|
|
104
|
+
align-items: center;
|
|
105
|
+
background: none;
|
|
106
|
+
border: none;
|
|
107
|
+
border-radius: var(--flow-ui-border-radius-small);
|
|
108
|
+
font-size: inherit;
|
|
109
|
+
color: var(--flow-ui-color-neutral-600);
|
|
110
|
+
padding: var(--flow-ui-spacing-x-small);
|
|
111
|
+
cursor: pointer;
|
|
112
|
+
transition: var(--flow-ui-transition-medium) color;
|
|
113
|
+
appearance: none;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.carousel__navigation-button--disabled {
|
|
117
|
+
opacity: 0.5;
|
|
118
|
+
cursor: not-allowed;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.carousel__navigation-button--disabled::part(base) {
|
|
122
|
+
pointer-events: none;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.carousel__navigation-button--previous {
|
|
126
|
+
grid-column: 1;
|
|
127
|
+
grid-row: 1;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.carousel__navigation-button--next {
|
|
131
|
+
grid-column: 3;
|
|
132
|
+
grid-row: 1;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.carousel__pagination-item {
|
|
136
|
+
display: block;
|
|
137
|
+
cursor: pointer;
|
|
138
|
+
background: none;
|
|
139
|
+
border: 0;
|
|
140
|
+
border-radius: var(--flow-ui-border-radius-circle);
|
|
141
|
+
width: var(--flow-ui-spacing-small);
|
|
142
|
+
height: var(--flow-ui-spacing-small);
|
|
143
|
+
background-color: var(--flow-ui-color-neutral-300);
|
|
144
|
+
padding: 0;
|
|
145
|
+
margin: 0;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.carousel__pagination-item--active {
|
|
149
|
+
background-color: var(--flow-ui-color-neutral-700);
|
|
150
|
+
transform: scale(1.2);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/* Focus styles */
|
|
154
|
+
.carousel__slides:focus-visible,
|
|
155
|
+
.carousel__navigation-button:focus-visible,
|
|
156
|
+
.carousel__pagination-item:focus-visible {
|
|
157
|
+
outline: var(--flow-ui-focus-ring);
|
|
158
|
+
outline-offset: var(--flow-ui-focus-ring-offset);
|
|
159
|
+
}
|
|
160
|
+
`;
|
|
161
|
+
|
|
162
|
+
export { styles as default };
|