@sdata/web-vue 1.19.0 → 2.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -7
- package/dist/sd.css +4083 -2512
- package/dist/sd.min.css +1 -1
- package/es/_components/feedback-icon.js +1 -1
- package/es/_components/icon-hover.js +9 -6
- package/es/_components/icon-hover.vue.d.ts +5 -3
- package/es/_components/icon-hover.vue_vue_type_script_lang.js +1 -0
- package/es/_components/input-label/input-label.d.ts +1 -1
- package/es/_components/input-label/style/index.css +27 -27
- package/es/_components/picker/input-range.js +1 -1
- package/es/_components/picker/input-range.vue.d.ts +6 -4
- package/es/_components/picker/input.js +1 -1
- package/es/_components/picker/input.vue.d.ts +6 -4
- package/es/_components/resize-trigger.js +1 -1
- package/es/_components/select-view/select-view.d.ts +3 -3
- package/es/_components/select-view/style/index.css +199 -199
- package/es/_components/transition/expand-transition.js +1 -1
- package/es/_components/virtual-list/virtual-list.js +1 -1
- package/es/_components/virtual-list/virtual-list.vue.d.ts +8 -5
- package/es/_components/virtual-list/virtual-list.vue_vue_type_script_lang.js +9 -16
- package/es/_hooks/use-form-item.d.ts +1 -1
- package/es/_hooks/use-input.d.ts +1 -1
- package/es/_hooks/use-pagination.d.ts +7 -4
- package/es/_hooks/use-popup-overflow-hidden.js +2 -1
- package/es/_hooks/use-scrollbar.d.ts +2 -3
- package/es/_hooks/use-scrollbar.js +4 -8
- package/es/_hooks/use-size.d.ts +1 -1
- package/es/_utils/color.d.ts +9 -0
- package/es/_utils/color.js +38 -2
- package/es/_utils/date.d.ts +1 -2
- package/es/_utils/date.js +74 -25
- package/es/_utils/debounce.d.ts +1 -1
- package/es/_utils/get-value-by-path.d.ts +2 -2
- package/es/_utils/global-config.d.ts +4 -0
- package/es/_utils/global-config.js +10 -2
- package/es/_utils/is-equal.js +1 -1
- package/es/_utils/is.d.ts +3 -3
- package/es/_utils/is.js +1 -1
- package/es/_utils/omit.d.ts +1 -1
- package/es/_utils/omit.js +1 -1
- package/es/_utils/pick.d.ts +1 -1
- package/es/_utils/pick.js +1 -2
- package/es/_utils/responsive-observe.js +1 -1
- package/es/_utils/throttle-by-raf.d.ts +2 -2
- package/es/_utils/types.d.ts +1 -1
- package/es/_utils/virtual-dropdown.js +1 -1
- package/es/_virtual/{_@oxc-project_runtime@0.130.0/helpers → _@oxc-project_runtime@0.133.0/helpers/esm}/asyncToGenerator.js +1 -1
- package/es/_virtual/{_@oxc-project_runtime@0.130.0/helpers → _@oxc-project_runtime@0.133.0/helpers/esm}/defineProperty.js +1 -1
- package/es/_virtual/{_@oxc-project_runtime@0.130.0/helpers → _@oxc-project_runtime@0.133.0/helpers/esm}/extends.js +1 -1
- package/es/_virtual/{_@oxc-project_runtime@0.130.0/helpers → _@oxc-project_runtime@0.133.0/helpers/esm}/objectDestructuringEmpty.js +1 -1
- package/es/_virtual/{_@oxc-project_runtime@0.130.0/helpers → _@oxc-project_runtime@0.133.0/helpers/esm}/objectSpread2.js +1 -1
- package/es/_virtual/{_@oxc-project_runtime@0.130.0/helpers → _@oxc-project_runtime@0.133.0/helpers/esm}/objectWithoutProperties.js +1 -1
- package/es/_virtual/{_@oxc-project_runtime@0.130.0/helpers → _@oxc-project_runtime@0.133.0/helpers/esm}/objectWithoutPropertiesLoose.js +1 -1
- package/es/_virtual/{_@oxc-project_runtime@0.130.0/helpers → _@oxc-project_runtime@0.133.0/helpers/esm}/toPrimitive.js +1 -1
- package/es/_virtual/{_@oxc-project_runtime@0.130.0/helpers → _@oxc-project_runtime@0.133.0/helpers/esm}/toPropertyKey.js +1 -1
- package/es/_virtual/{_@oxc-project_runtime@0.130.0/helpers → _@oxc-project_runtime@0.133.0/helpers/esm}/typeof.js +1 -1
- package/es/affix/affix.js +1 -1
- package/es/affix/affix.vue.d.ts +1 -1
- package/es/affix/affix.vue_vue_type_script_lang.js +1 -1
- package/es/affix/index.d.ts +3 -3
- package/es/alert/alert.js +1 -1
- package/es/alert/alert.vue.d.ts +5 -3
- package/es/alert/index.d.ts +10 -6
- package/es/alert/style/index.css +28 -28
- package/es/anchor/anchor-link.js +1 -1
- package/es/anchor/anchor.js +1 -1
- package/es/anchor/style/index.css +9 -9
- package/es/auto-complete/auto-complete.d.ts +3 -3
- package/es/auto-complete/auto-complete.js +25 -12
- package/es/auto-complete/index.d.ts +9 -9
- package/es/auto-complete/style/index.css +3 -3
- package/es/avatar/avatar.js +1 -1
- package/es/avatar/avatar.vue_vue_type_script_lang.js +1 -1
- package/es/avatar/style/index.css +15 -15
- package/es/back-top/back-top.js +1 -1
- package/es/back-top/style/index.css +4 -4
- package/es/badge/badge.d.ts +1 -1
- package/es/badge/badge.js +1 -1
- package/es/badge/index.d.ts +3 -3
- package/es/badge/style/index.css +25 -25
- package/es/breadcrumb/style/index.css +12 -12
- package/es/button/button-group.js +1 -1
- package/es/button/button.js +1 -1
- package/es/button/button.vue.d.ts +2 -2
- package/es/button/index.d.ts +6 -6
- package/es/button/style/index.css +37 -37
- package/es/calendar/components/body.js +5 -0
- package/es/calendar/components/body.vue.d.ts +100 -0
- package/es/calendar/components/body.vue_vue_type_script_setup_true_lang.js +158 -0
- package/es/calendar/components/cell.js +5 -0
- package/es/calendar/components/cell.vue.d.ts +220 -0
- package/es/calendar/components/cell.vue_vue_type_script_setup_true_lang.js +813 -0
- package/es/calendar/components/event.js +5 -0
- package/es/calendar/components/event.vue.d.ts +73 -0
- package/es/calendar/components/event.vue_vue_type_script_setup_true_lang.js +291 -0
- package/es/calendar/components/header.js +5 -0
- package/es/calendar/components/header.vue.d.ts +34 -0
- package/es/calendar/components/header.vue_vue_type_script_setup_true_lang.js +84 -0
- package/es/calendar/components/headings-bar.js +5 -0
- package/es/calendar/components/headings-bar.vue.d.ts +40 -0
- package/es/calendar/components/headings-bar.vue_vue_type_script_setup_true_lang.js +201 -0
- package/es/calendar/components/index.js +5 -0
- package/es/calendar/components/index.vue.d.ts +616 -0
- package/es/calendar/components/index.vue_vue_type_script_setup_true_lang.js +314 -0
- package/es/calendar/components/time-column.js +5 -0
- package/es/calendar/components/time-column.vue.d.ts +27 -0
- package/es/calendar/components/time-column.vue_vue_type_script_setup_true_lang.js +66 -0
- package/es/calendar/context.d.ts +17 -0
- package/es/calendar/context.js +5 -0
- package/es/calendar/core/config.d.ts +126 -0
- package/es/calendar/core/config.js +522 -0
- package/es/calendar/core/events.d.ts +1 -0
- package/es/calendar/core/events.js +921 -0
- package/es/calendar/core/i18n.d.ts +1 -0
- package/es/calendar/core/i18n.js +72 -0
- package/es/calendar/core/index.d.ts +112 -0
- package/es/calendar/core/index.js +66 -0
- package/es/calendar/core/props-definitions.d.ts +263 -0
- package/es/calendar/core/props-definitions.js +70 -0
- package/es/calendar/core/view.d.ts +60 -0
- package/es/calendar/core/view.js +761 -0
- package/es/calendar/default-theme.scss +1012 -0
- package/es/calendar/hooks/use-calendar-theme.d.ts +4 -0
- package/es/calendar/hooks/use-calendar-theme.js +32 -0
- package/es/calendar/index.d.ts +836 -98
- package/es/calendar/index.js +3 -3
- package/es/calendar/index.scss +331 -0
- package/es/calendar/modules/drag-and-drop.d.ts +8 -0
- package/es/calendar/modules/drag-and-drop.js +442 -0
- package/es/calendar/style/body.scss +51 -0
- package/es/calendar/style/cell.scss +153 -0
- package/es/calendar/style/css.js +0 -1
- package/es/calendar/style/event.scss +69 -0
- package/es/calendar/style/header.scss +104 -0
- package/es/calendar/style/headings-bar.scss +94 -0
- package/es/calendar/style/index.css +1514 -264
- package/es/calendar/style/index.d.ts +1 -3
- package/es/calendar/style/index.js +0 -1
- package/es/calendar/style/index.scss +9 -496
- package/es/calendar/style/time-column.scss +109 -0
- package/es/calendar/style/token.scss +64 -60
- package/es/calendar/utils/conversions.d.ts +3 -0
- package/es/calendar/utils/conversions.js +31 -0
- package/es/calendar/utils/date.d.ts +26 -0
- package/es/calendar/utils/date.js +253 -0
- package/es/calendar/utils/special-hours-allow-events.d.ts +28 -0
- package/es/calendar/utils/special-hours-allow-events.js +230 -0
- package/es/card/card-grid.js +1 -1
- package/es/card/style/index.css +16 -16
- package/es/carousel/carousel-arrow.js +1 -1
- package/es/carousel/carousel-indicator.js +1 -1
- package/es/carousel/carousel-indicator.vue.d.ts +1 -1
- package/es/carousel/carousel-item.js +1 -1
- package/es/carousel/carousel.js +1 -1
- package/es/carousel/style/index.css +11 -11
- package/es/cascader/base-cascader-panel.js +4 -5
- package/es/cascader/cascader-option.d.ts +1 -1
- package/es/cascader/cascader-option.js +7 -9
- package/es/cascader/cascader-panel.vue.d.ts +1 -1
- package/es/cascader/cascader-panel.vue_vue_type_script_setup_true_lang.js +2 -2
- package/es/cascader/cascader.vue.d.ts +5 -5
- package/es/cascader/cascader.vue_vue_type_script_setup_true_lang.js +5 -5
- package/es/cascader/style/index.css +36 -36
- package/es/checkbox/checkbox.d.ts +5 -3
- package/es/checkbox/index.d.ts +10 -6
- package/es/checkbox/style/index.css +18 -18
- package/es/collapse/collapse-item.d.ts +5 -3
- package/es/collapse/collapse.js +1 -1
- package/es/collapse/index.d.ts +5 -3
- package/es/collapse/style/index.css +15 -15
- package/es/color-picker/color-picker.d.ts +1 -1
- package/es/color-picker/color-picker.js +1 -1
- package/es/color-picker/index.d.ts +3 -3
- package/es/color-picker/palette.js +1 -1
- package/es/color-picker/panel.d.ts +1 -1
- package/es/color-picker/panel.js +2 -2
- package/es/color-picker/style/index.css +13 -13
- package/es/color-picker/utils.js +1 -1
- package/es/comment/comment.js +2 -2
- package/es/comment/style/index.css +5 -5
- package/es/components.d.ts +2 -2
- package/es/config-provider/config-provider.js +1 -1
- package/es/config-provider/config-provider.vue.d.ts +1 -1
- package/es/config-provider/context.d.ts +3 -0
- package/es/config-provider/index.d.ts +3 -3
- package/es/config-provider/theme-provider.vue_vue_type_script_setup_true_lang.js +2 -2
- package/es/config-provider/theme.js +1 -1
- package/es/copy/copy.vue_vue_type_script_setup_true_lang.js +3 -3
- package/es/cropper/cropper.vue_vue_type_script_setup_true_lang.js +3 -3
- package/es/cropper/style/index.css +3 -3
- package/es/date-picker/context.d.ts +1 -1
- package/es/date-picker/hooks/use-inject-datepicker-transform.d.ts +1 -1
- package/es/date-picker/hooks/use-provide-datepicker-transform.d.ts +1 -1
- package/es/date-picker/hooks/use-range-header-value.d.ts +3 -3
- package/es/date-picker/hooks/use-range-time-picker-value.js +1 -1
- package/es/date-picker/index.d.ts +63 -61
- package/es/date-picker/interface.d.ts +1 -1
- package/es/date-picker/panels/body.js +1 -1
- package/es/date-picker/panels/date/index.js +2 -2
- package/es/date-picker/panels/date/index.vue.d.ts +8 -8
- package/es/date-picker/panels/date/index.vue_vue_type_script_lang.js +1 -1
- package/es/date-picker/panels/footer.js +1 -1
- package/es/date-picker/panels/footer.vue.d.ts +10 -10
- package/es/date-picker/panels/header.js +1 -1
- package/es/date-picker/panels/month/index.js +2 -2
- package/es/date-picker/panels/month/index.vue.d.ts +1 -1
- package/es/date-picker/panels/quarter/index.js +2 -2
- package/es/date-picker/panels/shortcuts.js +1 -1
- package/es/date-picker/panels/shortcuts.vue.d.ts +7 -7
- package/es/date-picker/panels/week/index.js +1 -1
- package/es/date-picker/panels/week/index.vue.d.ts +8 -8
- package/es/date-picker/panels/week-list.js +1 -1
- package/es/date-picker/panels/year/index.js +2 -2
- package/es/date-picker/picker-panel.js +1 -1
- package/es/date-picker/picker-panel.vue.d.ts +35 -35
- package/es/date-picker/picker.js +2 -2
- package/es/date-picker/picker.vue.d.ts +57 -55
- package/es/date-picker/picker.vue_vue_type_script_lang.js +1 -1
- package/es/date-picker/range-picker-panel.js +1 -1
- package/es/date-picker/range-picker-panel.vue.d.ts +38 -38
- package/es/date-picker/range-picker-panel.vue_vue_type_script_lang.js +1 -1
- package/es/date-picker/range-picker.js +2 -2
- package/es/date-picker/range-picker.vue.d.ts +63 -61
- package/es/date-picker/range-picker.vue_vue_type_script_lang.js +1 -1
- package/es/date-picker/style/index.css +72 -72
- package/es/descriptions/descriptions-item.js +1 -1
- package/es/descriptions/descriptions.d.ts +2 -2
- package/es/descriptions/descriptions.js +1 -1
- package/es/descriptions/index.d.ts +6 -6
- package/es/descriptions/style/index.css +10 -10
- package/es/divider/divider.d.ts +1 -1
- package/es/divider/index.d.ts +3 -3
- package/es/divider/style/index.css +4 -4
- package/es/drawer/drawer.js +9 -2
- package/es/drawer/drawer.vue.d.ts +2910 -13
- package/es/drawer/drawer.vue_vue_type_script_lang.js +26 -7
- package/es/drawer/index.d.ts +6557 -767
- package/es/drawer/index.js +2 -2
- package/es/drawer/style/index.css +12 -7
- package/es/drawer/style/index.scss +6 -0
- package/es/dropdown/dropdown-button.js +1 -1
- package/es/dropdown/dropdown-button.vue.d.ts +26 -23
- package/es/dropdown/dropdown-group.js +1 -1
- package/es/dropdown/dropdown-option.js +1 -1
- package/es/dropdown/dropdown-option.vue.d.ts +1 -1
- package/es/dropdown/dropdown-panel.js +1 -1
- package/es/dropdown/dropdown-panel.vue.d.ts +6 -3
- package/es/dropdown/dropdown-submenu.js +1 -1
- package/es/dropdown/dropdown-submenu.vue.d.ts +18 -15
- package/es/dropdown/dropdown.js +1 -1
- package/es/dropdown/dropdown.vue.d.ts +18 -15
- package/es/dropdown/index.d.ts +85 -73
- package/es/dropdown/interface.d.ts +2 -2
- package/es/dropdown/style/index.css +1 -1
- package/es/ellipsis/ellipsis.js +1 -1
- package/es/ellipsis/ellipsis.vue.d.ts +24 -24
- package/es/ellipsis/ellipsis.vue_vue_type_script_lang.js +2 -2
- package/es/ellipsis/index.d.ts +96 -96
- package/es/ellipsis/performant-ellipsis.js +1 -1
- package/es/ellipsis/performant-ellipsis.vue.d.ts +24 -24
- package/es/ellipsis/performant-ellipsis.vue_vue_type_script_lang.js +1 -1
- package/es/empty/style/index.css +2 -2
- package/es/form/context.d.ts +7 -6
- package/es/form/form-item-label.js +1 -1
- package/es/form/form-item-label.vue.d.ts +24 -24
- package/es/form/form-item-message.js +1 -1
- package/es/form/form-item.js +1 -1
- package/es/form/form-item.vue.d.ts +35 -39
- package/es/form/form-item.vue_vue_type_script_lang.js +3 -3
- package/es/form/form.js +1 -1
- package/es/form/form.vue.d.ts +1 -1
- package/es/form/index.d.ts +41 -45
- package/es/form/interface.d.ts +2 -2
- package/es/form/style/index.css +6 -6
- package/es/grid/grid-col.js +1 -1
- package/es/grid/grid-col.vue.d.ts +3 -7
- package/es/grid/grid-col.vue_vue_type_script_lang.js +1 -1
- package/es/grid/grid-item.js +1 -1
- package/es/grid/grid-item.vue_vue_type_script_lang.js +1 -1
- package/es/grid/grid-row.js +1 -1
- package/es/grid/grid-row.vue.d.ts +4 -4
- package/es/grid/grid.js +1 -1
- package/es/grid/hook/use-responsive-value.d.ts +7 -19
- package/es/grid/index.d.ts +6 -10
- package/es/grid/interface.d.ts +11 -18
- package/es/icon/icon-calendar/icon-calendar.js +1 -1
- package/es/icon/icon-caret-down/icon-caret-down.js +1 -1
- package/es/icon/icon-caret-left/icon-caret-left.js +1 -1
- package/es/icon/icon-caret-right/icon-caret-right.js +1 -1
- package/es/icon/icon-caret-up/icon-caret-up.js +1 -1
- package/es/icon/icon-check/icon-check.js +1 -1
- package/es/icon/icon-check-circle-fill/icon-check-circle-fill.js +1 -1
- package/es/icon/icon-clock-circle/icon-clock-circle.js +1 -1
- package/es/icon/icon-close/icon-close.js +1 -1
- package/es/icon/icon-close-circle-fill/icon-close-circle-fill.js +1 -1
- package/es/icon/icon-copy/icon-copy.js +1 -1
- package/es/icon/icon-delete/icon-delete.js +1 -1
- package/es/icon/icon-double-left/icon-double-left.js +1 -1
- package/es/icon/icon-double-right/icon-double-right.js +1 -1
- package/es/icon/icon-down/icon-down.js +1 -1
- package/es/icon/icon-drag-dot/icon-drag-dot.js +1 -1
- package/es/icon/icon-drag-dot-vertical/icon-drag-dot-vertical.js +1 -1
- package/es/icon/icon-edit/icon-edit.js +1 -1
- package/es/icon/icon-empty/icon-empty.js +1 -1
- package/es/icon/icon-exclamation/icon-exclamation.js +1 -1
- package/es/icon/icon-exclamation-circle-fill/icon-exclamation-circle-fill.js +1 -1
- package/es/icon/icon-eye/icon-eye.js +1 -1
- package/es/icon/icon-eye-invisible/icon-eye-invisible.js +1 -1
- package/es/icon/icon-face-frown-fill/icon-face-frown-fill.js +1 -1
- package/es/icon/icon-face-meh-fill/icon-face-meh-fill.js +1 -1
- package/es/icon/icon-face-smile-fill/icon-face-smile-fill.js +1 -1
- package/es/icon/icon-file/icon-file.js +1 -1
- package/es/icon/icon-file-audio/icon-file-audio.js +1 -1
- package/es/icon/icon-file-image/icon-file-image.js +1 -1
- package/es/icon/icon-file-pdf/icon-file-pdf.js +1 -1
- package/es/icon/icon-file-video/icon-file-video.js +1 -1
- package/es/icon/icon-filter/icon-filter.js +1 -1
- package/es/icon/icon-fullscreen/icon-fullscreen.js +1 -1
- package/es/icon/icon-image-close/icon-image-close.js +1 -1
- package/es/icon/icon-info/icon-info.js +1 -1
- package/es/icon/icon-info-circle-fill/icon-info-circle-fill.js +1 -1
- package/es/icon/icon-left/icon-left.js +1 -1
- package/es/icon/icon-link/icon-link.js +1 -1
- package/es/icon/icon-loading/icon-loading.js +1 -1
- package/es/icon/icon-menu-fold/icon-menu-fold.js +1 -1
- package/es/icon/icon-menu-unfold/icon-menu-unfold.js +1 -1
- package/es/icon/icon-minus/icon-minus.js +1 -1
- package/es/icon/icon-more/icon-more.js +1 -1
- package/es/icon/icon-oblique-line/icon-oblique-line.js +1 -1
- package/es/icon/icon-original-size/icon-original-size.js +1 -1
- package/es/icon/icon-pause/icon-pause.js +1 -1
- package/es/icon/icon-play-arrow-fill/icon-play-arrow-fill.js +1 -1
- package/es/icon/icon-plus/icon-plus.js +1 -1
- package/es/icon/icon-question-circle/icon-question-circle.js +1 -1
- package/es/icon/icon-right/icon-right.js +1 -1
- package/es/icon/icon-rotate-left/icon-rotate-left.js +1 -1
- package/es/icon/icon-rotate-right/icon-rotate-right.js +1 -1
- package/es/icon/icon-search/icon-search.js +1 -1
- package/es/icon/icon-star-fill/icon-star-fill.js +1 -1
- package/es/icon/icon-to-top/icon-to-top.js +1 -1
- package/es/icon/icon-up/icon-up.js +1 -1
- package/es/icon/icon-upload/icon-upload.js +1 -1
- package/es/icon/icon-zoom-in/icon-zoom-in.js +1 -1
- package/es/icon/icon-zoom-out/icon-zoom-out.js +1 -1
- package/es/icon-component/icon.js +1 -1
- package/es/icon.js +292 -292
- package/es/image/image-footer.js +1 -1
- package/es/image/image.js +2 -2
- package/es/image/image.vue.d.ts +26 -26
- package/es/image/interface.d.ts +1 -1
- package/es/image/preview-action.d.ts +24 -24
- package/es/image/preview-arrow.js +1 -1
- package/es/image/preview-group.js +2 -2
- package/es/image/preview-group.vue.d.ts +26 -26
- package/es/image/preview-toolbar.js +1 -1
- package/es/image/preview-toolbar.vue.d.ts +24 -24
- package/es/image/preview.js +1 -1
- package/es/image/preview.vue.d.ts +25 -25
- package/es/image/preview.vue_vue_type_script_lang.js +1 -1
- package/es/image/style/index.css +32 -32
- package/es/index.css +4083 -2512
- package/es/index.d.ts +8 -2
- package/es/index.js +11 -10
- package/es/index.scss +3 -1
- package/es/input/index.d.ts +13 -11
- package/es/input/input-group.js +1 -1
- package/es/input/input-password.js +1 -1
- package/es/input/input-password.vue.d.ts +7 -5
- package/es/input/input.d.ts +2 -2
- package/es/input/input.js +4 -5
- package/es/input/style/index.css +50 -50
- package/es/input-number/index.d.ts +6 -6
- package/es/input-number/input-number.d.ts +2 -2
- package/es/input-number/input-number.js +21 -20
- package/es/input-number/style/index.css +16 -16
- package/es/input-tag/index.d.ts +6 -6
- package/es/input-tag/input-tag.d.ts +2 -2
- package/es/input-tag/input-tag.js +11 -13
- package/es/input-tag/style/index.css +172 -172
- package/es/input-tag/utils.js +1 -1
- package/es/json-form/json-form-component.vue_vue_type_script_setup_true_lang.js +3 -3
- package/es/json-form/json-form-item.vue_vue_type_script_setup_true_lang.js +3 -3
- package/es/json-form/json-form.vue_vue_type_script_setup_true_lang.js +3 -3
- package/es/json-form/utils.js +3 -3
- package/es/layout/content.js +1 -1
- package/es/layout/footer.js +1 -1
- package/es/layout/header.vue.d.ts +1 -1
- package/es/layout/header.vue_vue_type_script_setup_true_lang.js +2 -2
- package/es/layout/index.d.ts +21 -21
- package/es/layout/layout.js +1 -1
- package/es/layout/sider.js +1 -1
- package/es/layout/sider.vue.d.ts +16 -16
- package/es/layout/sider.vue_vue_type_script_lang.js +1 -1
- package/es/layout/style/index.css +12 -12
- package/es/link/index.d.ts +3 -3
- package/es/link/link.vue.d.ts +1 -1
- package/es/link/link.vue_vue_type_script_setup_true_lang.js +2 -2
- package/es/link/style/index.css +23 -23
- package/es/list/index.d.ts +9 -9
- package/es/list/list-item-meta.js +1 -1
- package/es/list/list.d.ts +3 -3
- package/es/list/list.js +4 -4
- package/es/list/style/index.css +9 -9
- package/es/list/use-pagination.d.ts +7 -4
- package/es/locale/index.d.ts +1 -1
- package/es/locale/index.js +1 -1
- package/es/locale/interface.d.ts +7 -0
- package/es/locale/lang/ar-eg.js +7 -1
- package/es/locale/lang/de-de.js +7 -1
- package/es/locale/lang/en-us.js +7 -1
- package/es/locale/lang/es-es.js +7 -1
- package/es/locale/lang/fr-fr.js +7 -1
- package/es/locale/lang/id-id.js +7 -1
- package/es/locale/lang/it-it.js +7 -1
- package/es/locale/lang/ja-jp.js +7 -1
- package/es/locale/lang/km-kh.js +7 -1
- package/es/locale/lang/ko-kr.js +7 -1
- package/es/locale/lang/ms-my.js +7 -1
- package/es/locale/lang/nl-nl.js +7 -1
- package/es/locale/lang/pt-pt.js +7 -1
- package/es/locale/lang/ru-ru.js +7 -1
- package/es/locale/lang/th-th.js +7 -1
- package/es/locale/lang/vi-vn.js +7 -1
- package/es/locale/lang/zh-cn.js +7 -1
- package/es/locale/lang/zh-tw.js +7 -1
- package/es/mention/index.d.ts +9 -9
- package/es/mention/mention.d.ts +3 -3
- package/es/mention/mention.js +34 -20
- package/es/menu/base-menu.js +1 -1
- package/es/menu/indent.js +1 -1
- package/es/menu/interface.d.ts +1 -3
- package/es/menu/item-group.js +1 -1
- package/es/menu/item-group.vue.d.ts +48 -48
- package/es/menu/item.js +1 -1
- package/es/menu/menu.js +1 -1
- package/es/menu/style/index.css +62 -62
- package/es/menu/sub-menu-inline.js +1 -1
- package/es/menu/sub-menu-inline.vue.d.ts +48 -48
- package/es/menu/sub-menu-pop.js +1 -1
- package/es/menu/sub-menu-pop.vue.d.ts +59 -59
- package/es/menu/sub-menu.js +1 -1
- package/es/message/index.js +1 -1
- package/es/message/message-list.d.ts +1 -1
- package/es/message/message.js +1 -1
- package/es/message/message.vue.d.ts +5 -3
- package/es/message/style/index.css +26 -26
- package/es/modal/index.d.ts +6374 -572
- package/es/modal/index.js +2 -2
- package/es/modal/interface.d.ts +2 -2
- package/es/modal/modal.js +15 -4
- package/es/modal/modal.vue.d.ts +2911 -10
- package/es/modal/modal.vue_vue_type_script_lang.js +28 -5
- package/es/modal/style/index.css +28 -12
- package/es/modal/style/index.scss +23 -0
- package/es/notification/index.js +1 -1
- package/es/notification/notification.js +1 -1
- package/es/notification/notification.vue.d.ts +5 -3
- package/es/notification/style/index.css +26 -26
- package/es/page-header/index.d.ts +10 -6
- package/es/page-header/page-header.js +1 -1
- package/es/page-header/page-header.vue.d.ts +5 -3
- package/es/page-header/style/index.css +6 -6
- package/es/pagination/page-item-ellipsis.js +1 -1
- package/es/pagination/page-item-step.js +1 -1
- package/es/pagination/page-item.js +1 -1
- package/es/pagination/page-jumper.js +1 -1
- package/es/pagination/page-jumper.vue.d.ts +7 -7
- package/es/pagination/page-options.js +1 -1
- package/es/pagination/page-options.vue.d.ts +656 -470
- package/es/pagination/style/index.css +21 -21
- package/es/popconfirm/index.d.ts +36 -36
- package/es/popconfirm/popconfirm.js +1 -1
- package/es/popconfirm/popconfirm.vue.d.ts +17 -17
- package/es/popconfirm/popconfirm.vue_vue_type_script_lang.js +1 -1
- package/es/popconfirm/style/index.css +11 -11
- package/es/popover/index.d.ts +899 -21
- package/es/popover/popover.js +7 -3
- package/es/popover/popover.vue.d.ts +451 -10
- package/es/popover/popover.vue_vue_type_script_lang.js +15 -3
- package/es/popover/style/index.css +7 -7
- package/es/popover/style/index.d.ts +1 -0
- package/es/progress/circle.js +1 -1
- package/es/progress/circle.vue.d.ts +1 -1
- package/es/progress/index.d.ts +7 -7
- package/es/progress/line.js +1 -1
- package/es/progress/line.vue.d.ts +1 -1
- package/es/progress/line.vue_vue_type_script_lang.js +1 -1
- package/es/progress/progress.js +1 -1
- package/es/progress/progress.vue.d.ts +3 -3
- package/es/progress/steps.js +1 -1
- package/es/progress/style/index.css +32 -32
- package/es/qr-code/index.d.ts +294 -0
- package/es/qr-code/index.js +10 -0
- package/es/qr-code/qr-code-status.js +5 -0
- package/es/qr-code/qr-code-status.vue.d.ts +8 -0
- package/es/qr-code/qr-code-status.vue_vue_type_script_setup_true_lang.js +30 -0
- package/es/qr-code/qr-code.js +5 -0
- package/es/qr-code/qr-code.vue.d.ts +167 -0
- package/es/qr-code/qr-code.vue_vue_type_script_setup_true_lang.js +313 -0
- package/es/qr-code/style/css.js +2 -0
- package/es/qr-code/style/index.css +106 -0
- package/es/qr-code/style/index.d.ts +2 -0
- package/es/qr-code/style/index.js +2 -0
- package/es/qr-code/style/index.scss +111 -0
- package/es/qr-code/style/token.scss +36 -0
- package/es/qr-code/types.d.ts +19 -0
- package/es/radio/index.d.ts +13 -9
- package/es/radio/radio.d.ts +6 -4
- package/es/radio/style/index.css +33 -33
- package/es/rate/index.d.ts +3 -3
- package/es/rate/rate.d.ts +1 -1
- package/es/rate/style/index.css +3 -3
- package/es/resize-box/index.d.ts +6 -6
- package/es/resize-box/resize-box.js +1 -1
- package/es/resize-box/resize-box.vue.d.ts +2 -2
- package/es/resize-box/resize-box.vue_vue_type_script_lang.js +1 -1
- package/es/resize-box/style/index.css +2 -2
- package/es/result/result.js +1 -1
- package/es/result/style/index.css +2 -2
- package/es/scrollbar/index.d.ts +6 -3
- package/es/scrollbar/interface.d.ts +1 -1
- package/es/scrollbar/scrollbar.js +2 -1
- package/es/scrollbar/scrollbar.vue.d.ts +2 -1
- package/es/scrollbar/scrollbar.vue_vue_type_script_lang.js +52 -2
- package/es/scrollbar/style/index.css +13 -13
- package/es/sd-vue.js +13 -12
- package/es/secret/secret.vue_vue_type_script_setup_true_lang.js +3 -3
- package/es/secret/style/index.css +4 -4
- package/es/select/context.d.ts +1 -4
- package/es/select/hooks/use-options.d.ts +1 -4
- package/es/select/hooks/use-options.js +2 -23
- package/es/select/hooks/use-select.d.ts +1 -3
- package/es/select/hooks/use-select.js +2 -7
- package/es/select/index.d.ts +656 -475
- package/es/select/index.js +5 -13
- package/es/select/interface.d.ts +1 -1
- package/es/select/select-dropdown.js +3 -2
- package/es/select/select-dropdown.vue.d.ts +56 -54
- package/es/select/select-dropdown.vue_vue_type_script_lang.js +2 -3
- package/es/select/select.d.ts +264 -18
- package/es/select/select.js +50 -27
- package/es/select/style/index.css +14 -14
- package/es/select/utils.d.ts +1 -1
- package/es/select/utils.js +1 -1
- package/es/skeleton/line.js +1 -1
- package/es/skeleton/shape.js +1 -1
- package/es/skeleton/skeleton.js +1 -1
- package/es/skeleton/style/index.css +4 -4
- package/es/slider/index.d.ts +67 -67
- package/es/slider/slider-button.js +1 -1
- package/es/slider/slider-button.vue.d.ts +25 -25
- package/es/slider/slider-dots.js +1 -1
- package/es/slider/slider-input.js +1 -1
- package/es/slider/slider-input.vue.d.ts +7 -7
- package/es/slider/slider-marks.js +1 -1
- package/es/slider/slider-ticks.js +1 -1
- package/es/slider/slider.js +1 -1
- package/es/slider/slider.vue.d.ts +33 -33
- package/es/slider/style/index.css +18 -18
- package/es/space/index.d.ts +9 -9
- package/es/space/space.d.ts +2 -2
- package/es/spin/index.d.ts +1 -0
- package/es/spin/style/index.css +9 -9
- package/es/split/split.js +1 -1
- package/es/split/split.vue_vue_type_script_lang.js +1 -1
- package/es/split/style/index.css +2 -2
- package/es/statistic/countdown.js +1 -1
- package/es/statistic/countdown.vue.d.ts +1 -1
- package/es/statistic/countdown.vue_vue_type_script_lang.js +5 -5
- package/es/statistic/index.d.ts +1 -1
- package/es/statistic/statistic.js +1 -1
- package/es/statistic/statistic.vue_vue_type_script_lang.js +4 -4
- package/es/statistic/style/index.css +4 -4
- package/es/steps/index.d.ts +4 -4
- package/es/steps/step.js +1 -1
- package/es/steps/step.vue.d.ts +1 -1
- package/es/steps/steps.js +1 -1
- package/es/steps/steps.vue.d.ts +1 -1
- package/es/steps/style/index.css +79 -79
- package/es/style/color/colors.scss +1 -1
- package/es/style/theme/global.scss +8 -8
- package/es/style/theme/index.scss +4 -12
- package/es/style/theme/z-index.js +1 -2
- package/es/switch/style/index.css +30 -30
- package/es/switch/switch.js +1 -1
- package/es/switch/switch.vue_vue_type_script_lang.js +1 -1
- package/es/table/index.d.ts +14 -14
- package/es/table/style/index.css +65 -65
- package/es/table/table-operation-td.d.ts +23 -15
- package/es/table/table-operation-td.js +11 -14
- package/es/table/table-operation-th.js +1 -1
- package/es/table/table-td.d.ts +1 -1
- package/es/table/table-td.js +1 -1
- package/es/table/table-th.d.ts +1 -1
- package/es/table/table-th.js +19 -8
- package/es/table/table.d.ts +5 -5
- package/es/table/table.js +45 -48
- package/es/table/utils.js +1 -1
- package/es/tabs/index.d.ts +9 -9
- package/es/tabs/style/index.css +56 -56
- package/es/tabs/tab-pane.js +1 -1
- package/es/tabs/tab-pane.vue_vue_type_script_lang.js +1 -1
- package/es/tabs/tabs-nav-ink.js +1 -1
- package/es/tabs/tabs-nav.d.ts +1 -1
- package/es/tabs/tabs-tab.js +1 -1
- package/es/tabs/tabs-tab.vue.d.ts +5 -3
- package/es/tabs/tabs.d.ts +3 -3
- package/es/tag/index.d.ts +66 -29688
- package/es/tag/interface.d.ts +2 -0
- package/es/tag/style/index.css +134 -134
- package/es/tag/style/index.scss +33 -13
- package/es/tag/tag.js +2 -64
- package/es/tag/tag.vue.d.ts +53 -11936
- package/es/tag/tag.vue_vue_type_script_setup_true_lang.js +368 -0
- package/es/tag-group/tag-group.vue_vue_type_script_setup_true_lang.js +4 -4
- package/es/textarea/index.d.ts +16 -12
- package/es/textarea/style/index.css +28 -28
- package/es/textarea/textarea.js +1 -1
- package/es/textarea/textarea.vue.d.ts +7 -5
- package/es/textarea/textarea.vue_vue_type_script_lang.js +1 -1
- package/es/time-picker/hooks/use-time-list.js +1 -1
- package/es/time-picker/index.d.ts +79 -71
- package/es/time-picker/panel.js +1 -1
- package/es/time-picker/panel.vue.d.ts +7 -7
- package/es/time-picker/range-panel.d.ts +7 -7
- package/es/time-picker/range-panel.js +6 -7
- package/es/time-picker/style/index.css +11 -11
- package/es/time-picker/time-column.js +1 -1
- package/es/time-picker/time-picker.js +2 -2
- package/es/time-picker/time-picker.vue.d.ts +38 -34
- package/es/time-picker/utils/index.d.ts +1 -1
- package/es/timeline/item.js +1 -1
- package/es/timeline/item.vue_vue_type_script_lang.js +1 -1
- package/es/timeline/style/index.css +11 -11
- package/es/tooltip/index.d.ts +24 -24
- package/es/tooltip/style/index.css +3 -3
- package/es/tooltip/tooltip.js +1 -1
- package/es/tooltip/tooltip.vue.d.ts +11 -11
- package/es/tooltip/tooltip.vue_vue_type_script_lang.js +1 -1
- package/es/tour/index.d.ts +664 -0
- package/es/tour/index.js +10 -0
- package/es/tour/style/css.js +1 -0
- package/es/tour/style/index.css +226 -0
- package/es/tour/style/index.d.ts +1 -0
- package/es/tour/style/index.js +1 -0
- package/es/tour/style/index.scss +218 -0
- package/es/tour/style/token.scss +27 -0
- package/es/tour/tour.js +5 -0
- package/es/tour/tour.vue.d.ts +411 -0
- package/es/tour/tour.vue_vue_type_script_setup_true_lang.js +1219 -0
- package/es/tour/types.d.ts +143 -0
- package/es/transfer/index.d.ts +75 -57
- package/es/transfer/style/index.css +20 -20
- package/es/transfer/transfer-list-item.js +2 -5
- package/es/transfer/transfer-view.js +2 -3
- package/es/transfer/transfer-view.vue.d.ts +30 -21
- package/es/transfer/transfer-view.vue_vue_type_script_lang.js +1 -1
- package/es/transfer/transfer.js +1 -1
- package/es/transfer/transfer.vue.d.ts +37 -28
- package/es/tree/base-node.js +1 -1
- package/es/tree/base-node.vue.d.ts +10 -6
- package/es/tree/expand-transition.js +1 -1
- package/es/tree/interface.d.ts +1 -1
- package/es/tree/node.js +1 -1
- package/es/tree/style/index.css +25 -25
- package/es/tree/transition-node-list.js +1 -1
- package/es/tree/transition-node-list.vue.d.ts +10 -6
- package/es/tree/tree.js +1 -1
- package/es/tree/tree.vue.d.ts +14 -11
- package/es/tree/tree.vue_vue_type_script_lang.js +2 -2
- package/es/tree/utils/tree-data.js +1 -1
- package/es/tree-select/hooks/use-selected-state.js +1 -1
- package/es/tree-select/panel.js +9 -10
- package/es/tree-select/style/index.css +5 -5
- package/es/tree-select/tree-select.js +2 -2
- package/es/tree-select/tree-select.vue.d.ts +22 -22
- package/es/tree-select/tree-select.vue_vue_type_script_lang.js +1 -1
- package/es/trigger/context.d.ts +3 -3
- package/es/trigger/index.d.ts +9 -9
- package/es/trigger/interface.d.ts +3 -2
- package/es/trigger/style/index.css +5 -5
- package/es/trigger/trigger.d.ts +3 -3
- package/es/trigger/trigger.js +18 -17
- package/es/trigger/utils.js +1 -1
- package/es/typography/base.d.ts +4 -4
- package/es/typography/base.js +3 -3
- package/es/typography/edit-content.js +1 -1
- package/es/typography/edit-content.vue.d.ts +40 -34
- package/es/typography/interface.d.ts +1 -1
- package/es/typography/operations.js +1 -1
- package/es/typography/operations.vue.d.ts +25 -25
- package/es/typography/style/index.css +22 -22
- package/es/typography/typography.js +1 -1
- package/es/upload/index.d.ts +6 -6
- package/es/upload/interfaces.d.ts +3 -3
- package/es/upload/style/index.css +51 -51
- package/es/upload/upload-button.d.ts +1 -1
- package/es/upload/upload-list.js +2 -5
- package/es/upload/upload.d.ts +2 -2
- package/es/upload/upload.js +6 -7
- package/es/verification-code/index.d.ts +3 -3
- package/es/verification-code/verification-code.d.ts +1 -1
- package/es/verification-code/verification-code.js +7 -6
- package/es/watermark/hooks/use-mutation-observer.js +1 -1
- package/es/watermark/watermark.js +1 -1
- package/json/vetur-attributes.json +125 -107
- package/json/vetur-tags.json +39 -36
- package/json/web-types.json +182 -163
- package/package.json +19 -15
- package/es/calendar/calendar.d.ts +0 -104
- package/es/calendar/calendar.js +0 -207
- package/es/calendar/header.d.ts +0 -104
- package/es/calendar/header.js +0 -131
- package/es/calendar/hooks/useCellClassName.d.ts +0 -19
- package/es/calendar/hooks/useCellClassName.js +0 -43
- package/es/calendar/month.d.ts +0 -83
- package/es/calendar/month.js +0 -149
- package/es/calendar/week.d.ts +0 -61
- package/es/calendar/week.js +0 -45
- package/es/calendar/year.d.ts +0 -69
- package/es/calendar/year.js +0 -101
- package/es/select/optgroup.js +0 -10
- package/es/select/optgroup.vue.d.ts +0 -13
- package/es/select/optgroup.vue_vue_type_script_lang.js +0 -23
- package/es/select/option.js +0 -51
- package/es/select/option.vue.d.ts +0 -299
- package/es/select/option.vue_vue_type_script_lang.js +0 -149
- package/es/tag/tag.vue_vue_type_script_lang.js +0 -264
|
@@ -0,0 +1,1219 @@
|
|
|
1
|
+
import { _objectSpread2 } from "../_virtual/_@oxc-project_runtime@0.133.0/helpers/esm/objectSpread2.js";
|
|
2
|
+
import { getPrefixCls } from "../_utils/global-config.js";
|
|
3
|
+
import { _asyncToGenerator } from "../_virtual/_@oxc-project_runtime@0.133.0/helpers/esm/asyncToGenerator.js";
|
|
4
|
+
import Button from "../button/index.js";
|
|
5
|
+
import usePopupManager from "../_hooks/use-popup-manager.js";
|
|
6
|
+
import { Fragment, Teleport, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, mergeProps, nextTick, normalizeClass, normalizeStyle, onBeforeUnmount, onMounted, openBlock, renderSlot, shallowRef, toDisplayString, unref, useSlots, watch, withCtx } from "vue";
|
|
7
|
+
import { unrefElement, useElementBounding, useEventListener, useResizeObserver, useWindowSize } from "@vueuse/core";
|
|
8
|
+
import { Motion } from "motion-v";
|
|
9
|
+
//#region components/tour/tour.vue?vue&type=script&setup=true&lang.ts
|
|
10
|
+
var _hoisted_1 = ["viewBox"];
|
|
11
|
+
var _hoisted_2 = [
|
|
12
|
+
"d",
|
|
13
|
+
"fill",
|
|
14
|
+
"opacity"
|
|
15
|
+
];
|
|
16
|
+
var DEFAULT_PREVIOUS_TEXT = "上一步";
|
|
17
|
+
var DEFAULT_NEXT_TEXT = "下一步";
|
|
18
|
+
var DEFAULT_DONE_TEXT = "完成";
|
|
19
|
+
var DEFAULT_PROGRESS_TEXT = "{{current}} / {{total}}";
|
|
20
|
+
var tour_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent(_objectSpread2(_objectSpread2({}, {
|
|
21
|
+
name: "Tour",
|
|
22
|
+
inheritAttrs: false
|
|
23
|
+
}), {}, {
|
|
24
|
+
__name: "tour",
|
|
25
|
+
props: {
|
|
26
|
+
visible: {
|
|
27
|
+
type: Boolean,
|
|
28
|
+
default: void 0
|
|
29
|
+
},
|
|
30
|
+
defaultVisible: {
|
|
31
|
+
type: Boolean,
|
|
32
|
+
default: false
|
|
33
|
+
},
|
|
34
|
+
current: {
|
|
35
|
+
type: Number,
|
|
36
|
+
default: void 0
|
|
37
|
+
},
|
|
38
|
+
defaultCurrent: {
|
|
39
|
+
type: Number,
|
|
40
|
+
default: 0
|
|
41
|
+
},
|
|
42
|
+
steps: {
|
|
43
|
+
type: Array,
|
|
44
|
+
default: () => []
|
|
45
|
+
},
|
|
46
|
+
zIndex: {
|
|
47
|
+
type: Number,
|
|
48
|
+
default: void 0
|
|
49
|
+
},
|
|
50
|
+
animate: {
|
|
51
|
+
type: Boolean,
|
|
52
|
+
default: void 0
|
|
53
|
+
},
|
|
54
|
+
allowClose: {
|
|
55
|
+
type: Boolean,
|
|
56
|
+
default: void 0
|
|
57
|
+
},
|
|
58
|
+
allowKeyboardControl: {
|
|
59
|
+
type: Boolean,
|
|
60
|
+
default: void 0
|
|
61
|
+
},
|
|
62
|
+
overlayClickBehavior: {
|
|
63
|
+
type: [String, Function],
|
|
64
|
+
default: void 0
|
|
65
|
+
},
|
|
66
|
+
overlayOpacity: {
|
|
67
|
+
type: Number,
|
|
68
|
+
default: void 0
|
|
69
|
+
},
|
|
70
|
+
overlayColor: {
|
|
71
|
+
type: String,
|
|
72
|
+
default: void 0
|
|
73
|
+
},
|
|
74
|
+
smoothScroll: {
|
|
75
|
+
type: Boolean,
|
|
76
|
+
default: void 0
|
|
77
|
+
},
|
|
78
|
+
disableActiveInteraction: {
|
|
79
|
+
type: Boolean,
|
|
80
|
+
default: void 0
|
|
81
|
+
},
|
|
82
|
+
showProgress: {
|
|
83
|
+
type: Boolean,
|
|
84
|
+
default: void 0
|
|
85
|
+
},
|
|
86
|
+
stagePadding: {
|
|
87
|
+
type: Number,
|
|
88
|
+
default: void 0
|
|
89
|
+
},
|
|
90
|
+
stageRadius: {
|
|
91
|
+
type: Number,
|
|
92
|
+
default: void 0
|
|
93
|
+
},
|
|
94
|
+
popoverOffset: {
|
|
95
|
+
type: Number,
|
|
96
|
+
default: void 0
|
|
97
|
+
},
|
|
98
|
+
showButtons: {
|
|
99
|
+
type: Array,
|
|
100
|
+
default: void 0
|
|
101
|
+
},
|
|
102
|
+
disableButtons: {
|
|
103
|
+
type: Array,
|
|
104
|
+
default: void 0
|
|
105
|
+
},
|
|
106
|
+
prevBtnText: {
|
|
107
|
+
type: String,
|
|
108
|
+
default: void 0
|
|
109
|
+
},
|
|
110
|
+
nextBtnText: {
|
|
111
|
+
type: String,
|
|
112
|
+
default: void 0
|
|
113
|
+
},
|
|
114
|
+
doneBtnText: {
|
|
115
|
+
type: String,
|
|
116
|
+
default: void 0
|
|
117
|
+
},
|
|
118
|
+
progressText: {
|
|
119
|
+
type: String,
|
|
120
|
+
default: void 0
|
|
121
|
+
},
|
|
122
|
+
popoverClass: {
|
|
123
|
+
type: String,
|
|
124
|
+
default: void 0
|
|
125
|
+
},
|
|
126
|
+
buttonProps: {
|
|
127
|
+
type: Object,
|
|
128
|
+
default: void 0
|
|
129
|
+
},
|
|
130
|
+
onHighlightStarted: {
|
|
131
|
+
type: Function,
|
|
132
|
+
default: void 0
|
|
133
|
+
},
|
|
134
|
+
onHighlighted: {
|
|
135
|
+
type: Function,
|
|
136
|
+
default: void 0
|
|
137
|
+
},
|
|
138
|
+
onDeselected: {
|
|
139
|
+
type: Function,
|
|
140
|
+
default: void 0
|
|
141
|
+
},
|
|
142
|
+
onDestroyed: {
|
|
143
|
+
type: Function,
|
|
144
|
+
default: void 0
|
|
145
|
+
},
|
|
146
|
+
onDestroyStarted: {
|
|
147
|
+
type: Function,
|
|
148
|
+
default: void 0
|
|
149
|
+
},
|
|
150
|
+
onPopoverRender: {
|
|
151
|
+
type: Function,
|
|
152
|
+
default: void 0
|
|
153
|
+
},
|
|
154
|
+
onNextClick: {
|
|
155
|
+
type: Function,
|
|
156
|
+
default: void 0
|
|
157
|
+
},
|
|
158
|
+
onPrevClick: {
|
|
159
|
+
type: Function,
|
|
160
|
+
default: void 0
|
|
161
|
+
},
|
|
162
|
+
onCloseClick: {
|
|
163
|
+
type: Function,
|
|
164
|
+
default: void 0
|
|
165
|
+
}
|
|
166
|
+
},
|
|
167
|
+
emits: [
|
|
168
|
+
"update:visible",
|
|
169
|
+
"visibleChange",
|
|
170
|
+
"update:current",
|
|
171
|
+
"change",
|
|
172
|
+
"close"
|
|
173
|
+
],
|
|
174
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
175
|
+
const DEFAULT_SHOW_BUTTONS = [
|
|
176
|
+
"next",
|
|
177
|
+
"previous",
|
|
178
|
+
"close"
|
|
179
|
+
];
|
|
180
|
+
const props = __props;
|
|
181
|
+
const emit = __emit;
|
|
182
|
+
const slots = useSlots();
|
|
183
|
+
const prefixCls = getPrefixCls("tour");
|
|
184
|
+
const overlayClass = `${prefixCls}-overlay`;
|
|
185
|
+
const overlayAnimatedClass = `${prefixCls}-overlay-animated`;
|
|
186
|
+
const popoverShellClass = `${prefixCls}-popover-shell`;
|
|
187
|
+
const popoverTitleId = `${prefixCls}-popover-title`;
|
|
188
|
+
const popoverDescriptionId = `${prefixCls}-popover-description`;
|
|
189
|
+
const popoverContentId = `${prefixCls}-popover-content`;
|
|
190
|
+
const activeElementClass = `${prefixCls}-active-element`;
|
|
191
|
+
const noInteractionClass = `${prefixCls}-no-interaction`;
|
|
192
|
+
const activeBodyClass = `${prefixCls}-active`;
|
|
193
|
+
const fadeBodyClass = `${prefixCls}-fade`;
|
|
194
|
+
const staticBodyClass = `${prefixCls}-static`;
|
|
195
|
+
const dummyElementId = `${prefixCls}-dummy-element`;
|
|
196
|
+
const internalVisible = shallowRef(props.defaultVisible);
|
|
197
|
+
const internalCurrent = shallowRef(props.defaultCurrent);
|
|
198
|
+
const configOverride = shallowRef({});
|
|
199
|
+
const stepOverride = shallowRef(null);
|
|
200
|
+
const highlightedStep = shallowRef(null);
|
|
201
|
+
const activeIndex = shallowRef(void 0);
|
|
202
|
+
const activeStep = shallowRef(void 0);
|
|
203
|
+
const activeElement = shallowRef(null);
|
|
204
|
+
const previousStep = shallowRef(void 0);
|
|
205
|
+
const previousElement = shallowRef(null);
|
|
206
|
+
const activeRect = shallowRef(null);
|
|
207
|
+
const mounted = shallowRef(false);
|
|
208
|
+
const isInitialized = shallowRef(false);
|
|
209
|
+
const activeOnDestroyed = shallowRef(null);
|
|
210
|
+
const popoverRef = shallowRef(null);
|
|
211
|
+
const arrowRef = shallowRef(null);
|
|
212
|
+
const titleRef = shallowRef(null);
|
|
213
|
+
const descriptionRef = shallowRef(null);
|
|
214
|
+
const footerRef = shallowRef(null);
|
|
215
|
+
const previousButtonVmRef = shallowRef(null);
|
|
216
|
+
const nextButtonVmRef = shallowRef(null);
|
|
217
|
+
const closeButtonVmRef = shallowRef(null);
|
|
218
|
+
const footerButtonsRef = shallowRef(null);
|
|
219
|
+
const progressRef = shallowRef(null);
|
|
220
|
+
const { width: viewportWidth, height: viewportHeight } = useWindowSize();
|
|
221
|
+
const viewport = computed(() => ({
|
|
222
|
+
width: viewportWidth.value,
|
|
223
|
+
height: viewportHeight.value
|
|
224
|
+
}));
|
|
225
|
+
const mergedVisible = computed(() => {
|
|
226
|
+
var _props$visible;
|
|
227
|
+
return (_props$visible = props.visible) !== null && _props$visible !== void 0 ? _props$visible : internalVisible.value;
|
|
228
|
+
});
|
|
229
|
+
const { zIndex: dialogZIndex, close: releaseDialogLayer } = usePopupManager("dialog", { visible: mergedVisible });
|
|
230
|
+
const mergedZIndex = computed(() => {
|
|
231
|
+
if (typeof props.zIndex === "number" && !Number.isNaN(props.zIndex)) return props.zIndex;
|
|
232
|
+
return dialogZIndex.value > 0 ? dialogZIndex.value - 1 : 1e3;
|
|
233
|
+
});
|
|
234
|
+
const mergedSteps = computed(() => {
|
|
235
|
+
var _stepOverride$value;
|
|
236
|
+
return (_stepOverride$value = stepOverride.value) !== null && _stepOverride$value !== void 0 ? _stepOverride$value : props.steps;
|
|
237
|
+
});
|
|
238
|
+
const userConfig = computed(() => {
|
|
239
|
+
return Object.fromEntries(Object.entries({
|
|
240
|
+
animate: props.animate,
|
|
241
|
+
allowClose: props.allowClose,
|
|
242
|
+
allowKeyboardControl: props.allowKeyboardControl,
|
|
243
|
+
overlayClickBehavior: props.overlayClickBehavior,
|
|
244
|
+
overlayOpacity: props.overlayOpacity,
|
|
245
|
+
overlayColor: props.overlayColor,
|
|
246
|
+
smoothScroll: props.smoothScroll,
|
|
247
|
+
disableActiveInteraction: props.disableActiveInteraction,
|
|
248
|
+
showProgress: props.showProgress,
|
|
249
|
+
stagePadding: props.stagePadding,
|
|
250
|
+
stageRadius: props.stageRadius,
|
|
251
|
+
popoverOffset: props.popoverOffset,
|
|
252
|
+
showButtons: props.showButtons,
|
|
253
|
+
disableButtons: props.disableButtons,
|
|
254
|
+
prevBtnText: props.prevBtnText,
|
|
255
|
+
nextBtnText: props.nextBtnText,
|
|
256
|
+
doneBtnText: props.doneBtnText,
|
|
257
|
+
progressText: props.progressText,
|
|
258
|
+
popoverClass: props.popoverClass,
|
|
259
|
+
buttonProps: props.buttonProps,
|
|
260
|
+
onHighlightStarted: props.onHighlightStarted,
|
|
261
|
+
onHighlighted: props.onHighlighted,
|
|
262
|
+
onDeselected: props.onDeselected,
|
|
263
|
+
onDestroyed: props.onDestroyed,
|
|
264
|
+
onDestroyStarted: props.onDestroyStarted,
|
|
265
|
+
onPopoverRender: props.onPopoverRender,
|
|
266
|
+
onNextClick: props.onNextClick,
|
|
267
|
+
onPrevClick: props.onPrevClick,
|
|
268
|
+
onCloseClick: props.onCloseClick
|
|
269
|
+
}).filter(([, value]) => value !== void 0));
|
|
270
|
+
});
|
|
271
|
+
const mergedConfig = computed(() => {
|
|
272
|
+
const override = configOverride.value;
|
|
273
|
+
return _objectSpread2(_objectSpread2({
|
|
274
|
+
animate: true,
|
|
275
|
+
allowClose: true,
|
|
276
|
+
allowKeyboardControl: true,
|
|
277
|
+
overlayClickBehavior: "close",
|
|
278
|
+
overlayOpacity: .7,
|
|
279
|
+
smoothScroll: false,
|
|
280
|
+
disableActiveInteraction: false,
|
|
281
|
+
showProgress: false,
|
|
282
|
+
stagePadding: 10,
|
|
283
|
+
stageRadius: 5,
|
|
284
|
+
popoverOffset: 10,
|
|
285
|
+
showButtons: DEFAULT_SHOW_BUTTONS,
|
|
286
|
+
disableButtons: [],
|
|
287
|
+
overlayColor: "#000",
|
|
288
|
+
prevBtnText: DEFAULT_PREVIOUS_TEXT,
|
|
289
|
+
nextBtnText: DEFAULT_NEXT_TEXT,
|
|
290
|
+
doneBtnText: DEFAULT_DONE_TEXT,
|
|
291
|
+
progressText: DEFAULT_PROGRESS_TEXT
|
|
292
|
+
}, userConfig.value), override);
|
|
293
|
+
});
|
|
294
|
+
const isActive = computed(() => isInitialized.value && Boolean(activeStep.value && activeRect.value));
|
|
295
|
+
const isFirstStep = computed(() => activeIndex.value === 0);
|
|
296
|
+
const isLastStep = computed(() => {
|
|
297
|
+
if (highlightedStep.value) return true;
|
|
298
|
+
const steps = mergedSteps.value;
|
|
299
|
+
return typeof activeIndex.value === "number" && activeIndex.value === steps.length - 1;
|
|
300
|
+
});
|
|
301
|
+
const displayCurrent = computed(() => typeof activeIndex.value === "number" ? activeIndex.value + 1 : 1);
|
|
302
|
+
const displayTotal = computed(() => highlightedStep.value ? 1 : Math.max(mergedSteps.value.length, 1));
|
|
303
|
+
const popoverElement = computed(() => getElementFromRef(popoverRef.value));
|
|
304
|
+
const { x: activeX, y: activeY, width: activeWidth, height: activeHeight, update: updateActiveBounding } = useElementBounding(activeElement, {
|
|
305
|
+
immediate: true,
|
|
306
|
+
windowResize: true,
|
|
307
|
+
windowScroll: true,
|
|
308
|
+
updateTiming: "next-frame"
|
|
309
|
+
});
|
|
310
|
+
const getComponentElement = (instance) => {
|
|
311
|
+
if (!instance) return null;
|
|
312
|
+
const element = instance.$el;
|
|
313
|
+
return element instanceof HTMLElement ? element : null;
|
|
314
|
+
};
|
|
315
|
+
const getElementFromRef = (value) => {
|
|
316
|
+
const element = unrefElement(value);
|
|
317
|
+
return element instanceof HTMLElement ? element : null;
|
|
318
|
+
};
|
|
319
|
+
const popoverDom = computed(() => ({
|
|
320
|
+
wrapper: getElementFromRef(popoverRef.value),
|
|
321
|
+
arrow: arrowRef.value,
|
|
322
|
+
title: titleRef.value,
|
|
323
|
+
description: descriptionRef.value,
|
|
324
|
+
footer: footerRef.value,
|
|
325
|
+
previousButton: getComponentElement(previousButtonVmRef.value),
|
|
326
|
+
nextButton: getComponentElement(nextButtonVmRef.value),
|
|
327
|
+
closeButton: getComponentElement(closeButtonVmRef.value),
|
|
328
|
+
footerButtons: footerButtonsRef.value,
|
|
329
|
+
progress: progressRef.value
|
|
330
|
+
}));
|
|
331
|
+
const tourState = computed(() => ({
|
|
332
|
+
isInitialized: isInitialized.value,
|
|
333
|
+
activeIndex: activeIndex.value,
|
|
334
|
+
activeStep: activeStep.value,
|
|
335
|
+
activeElement: activeElement.value,
|
|
336
|
+
previousStep: previousStep.value,
|
|
337
|
+
previousElement: previousElement.value,
|
|
338
|
+
popover: popoverDom.value
|
|
339
|
+
}));
|
|
340
|
+
const resolvedPopover = computed(() => {
|
|
341
|
+
var _activeStep$value$pop, _activeStep$value;
|
|
342
|
+
const popover = (_activeStep$value$pop = (_activeStep$value = activeStep.value) === null || _activeStep$value === void 0 ? void 0 : _activeStep$value.popover) !== null && _activeStep$value$pop !== void 0 ? _activeStep$value$pop : {};
|
|
343
|
+
const contentProps = normalizeElementProps(popover.contentClass, popover.contentStyle);
|
|
344
|
+
const titleProps = normalizeHtmlProps(popover.titleProps);
|
|
345
|
+
const descriptionProps = normalizeHtmlProps(popover.descriptionProps);
|
|
346
|
+
const footerProps = normalizeHtmlProps(popover.footerProps);
|
|
347
|
+
return _objectSpread2(_objectSpread2({}, popover), {}, {
|
|
348
|
+
contentProps,
|
|
349
|
+
contentStyle: contentProps.style,
|
|
350
|
+
titleProps,
|
|
351
|
+
descriptionProps,
|
|
352
|
+
footerProps
|
|
353
|
+
});
|
|
354
|
+
});
|
|
355
|
+
const hasTitle = computed(() => Boolean(resolvedPopover.value.title || slots.title));
|
|
356
|
+
const hasDescription = computed(() => Boolean(resolvedPopover.value.description || slots.description));
|
|
357
|
+
const resolvedShowButtons = computed(() => {
|
|
358
|
+
var _mergedConfig$value$s;
|
|
359
|
+
const popoverButtons = resolvedPopover.value.showButtons;
|
|
360
|
+
const configButtons = (_mergedConfig$value$s = mergedConfig.value.showButtons) !== null && _mergedConfig$value$s !== void 0 ? _mergedConfig$value$s : DEFAULT_SHOW_BUTTONS;
|
|
361
|
+
const sourceButtons = (popoverButtons === null || popoverButtons === void 0 ? void 0 : popoverButtons.length) ? popoverButtons : configButtons;
|
|
362
|
+
return [
|
|
363
|
+
"previous",
|
|
364
|
+
"next",
|
|
365
|
+
...mergedConfig.value.allowClose !== false ? ["close"] : []
|
|
366
|
+
].filter((button) => {
|
|
367
|
+
return !(sourceButtons === null || sourceButtons === void 0 ? void 0 : sourceButtons.length) || sourceButtons.includes(button);
|
|
368
|
+
});
|
|
369
|
+
});
|
|
370
|
+
const resolvedDisableButtons = computed(() => {
|
|
371
|
+
var _mergedConfig$value$d, _resolvedPopover$valu;
|
|
372
|
+
const disabledButtons = [...(_mergedConfig$value$d = mergedConfig.value.disableButtons) !== null && _mergedConfig$value$d !== void 0 ? _mergedConfig$value$d : [], ...(_resolvedPopover$valu = resolvedPopover.value.disableButtons) !== null && _resolvedPopover$valu !== void 0 ? _resolvedPopover$valu : []];
|
|
373
|
+
if (isFirstStep.value) disabledButtons.push("previous");
|
|
374
|
+
return Array.from(new Set(disabledButtons));
|
|
375
|
+
});
|
|
376
|
+
const showProgress = computed(() => {
|
|
377
|
+
var _ref, _resolvedPopover$valu2;
|
|
378
|
+
return (_ref = (_resolvedPopover$valu2 = resolvedPopover.value.showProgress) !== null && _resolvedPopover$valu2 !== void 0 ? _resolvedPopover$valu2 : mergedConfig.value.showProgress) !== null && _ref !== void 0 ? _ref : false;
|
|
379
|
+
});
|
|
380
|
+
const showCloseButton = computed(() => resolvedShowButtons.value.includes("close"));
|
|
381
|
+
const showPreviousButton = computed(() => resolvedShowButtons.value.includes("previous"));
|
|
382
|
+
const showNextButton = computed(() => resolvedShowButtons.value.includes("next"));
|
|
383
|
+
const showFooter = computed(() => {
|
|
384
|
+
if (slots.footer) return true;
|
|
385
|
+
return showProgress.value || showCloseButton.value || showPreviousButton.value || showNextButton.value;
|
|
386
|
+
});
|
|
387
|
+
const progressVisibilityStyle = computed(() => ({ display: showProgress.value ? "block" : "none" }));
|
|
388
|
+
const previousButtonText = computed(() => {
|
|
389
|
+
var _ref2, _resolvedPopover$valu3;
|
|
390
|
+
return (_ref2 = (_resolvedPopover$valu3 = resolvedPopover.value.prevBtnText) !== null && _resolvedPopover$valu3 !== void 0 ? _resolvedPopover$valu3 : mergedConfig.value.prevBtnText) !== null && _ref2 !== void 0 ? _ref2 : DEFAULT_PREVIOUS_TEXT;
|
|
391
|
+
});
|
|
392
|
+
const nextButtonText = computed(() => {
|
|
393
|
+
var _ref4, _resolvedPopover$valu5;
|
|
394
|
+
if (isLastStep.value) {
|
|
395
|
+
var _ref3, _resolvedPopover$valu4;
|
|
396
|
+
return (_ref3 = (_resolvedPopover$valu4 = resolvedPopover.value.doneBtnText) !== null && _resolvedPopover$valu4 !== void 0 ? _resolvedPopover$valu4 : mergedConfig.value.doneBtnText) !== null && _ref3 !== void 0 ? _ref3 : DEFAULT_DONE_TEXT;
|
|
397
|
+
}
|
|
398
|
+
return (_ref4 = (_resolvedPopover$valu5 = resolvedPopover.value.nextBtnText) !== null && _resolvedPopover$valu5 !== void 0 ? _resolvedPopover$valu5 : mergedConfig.value.nextBtnText) !== null && _ref4 !== void 0 ? _ref4 : DEFAULT_NEXT_TEXT;
|
|
399
|
+
});
|
|
400
|
+
const progressText = computed(() => {
|
|
401
|
+
var _ref5, _resolvedPopover$valu6;
|
|
402
|
+
return ((_ref5 = (_resolvedPopover$valu6 = resolvedPopover.value.progressText) !== null && _resolvedPopover$valu6 !== void 0 ? _resolvedPopover$valu6 : mergedConfig.value.progressText) !== null && _ref5 !== void 0 ? _ref5 : DEFAULT_PROGRESS_TEXT).replaceAll("{{current}}", `${displayCurrent.value}`).replaceAll("{{total}}", `${displayTotal.value}`).replaceAll("{current}", `${displayCurrent.value}`).replaceAll("{total}", `${displayTotal.value}`);
|
|
403
|
+
});
|
|
404
|
+
const previousButtonProps = computed(() => mergeButtonProps("previous", { type: "secondary" }));
|
|
405
|
+
const nextButtonProps = computed(() => mergeButtonProps(isLastStep.value ? "done" : "next", { type: "primary" }));
|
|
406
|
+
const closeButtonProps = computed(() => mergeButtonProps("close", {
|
|
407
|
+
type: "text",
|
|
408
|
+
htmlType: "button"
|
|
409
|
+
}));
|
|
410
|
+
const popoverClasses = computed(() => {
|
|
411
|
+
return [
|
|
412
|
+
`${prefixCls}-popover`,
|
|
413
|
+
mergedConfig.value.popoverClass,
|
|
414
|
+
resolvedPopover.value.popoverClass
|
|
415
|
+
].filter(Boolean).join(" ");
|
|
416
|
+
});
|
|
417
|
+
const overlayStyle = computed(() => ({
|
|
418
|
+
zIndex: `${mergedZIndex.value}`,
|
|
419
|
+
position: "fixed",
|
|
420
|
+
inset: "0",
|
|
421
|
+
width: "100%",
|
|
422
|
+
height: "100%",
|
|
423
|
+
fillRule: "evenodd",
|
|
424
|
+
clipRule: "evenodd",
|
|
425
|
+
strokeLinejoin: "round",
|
|
426
|
+
strokeMiterlimit: "2"
|
|
427
|
+
}));
|
|
428
|
+
const overlayPath = computed(() => {
|
|
429
|
+
var _mergedConfig$value$s2, _mergedConfig$value$s3;
|
|
430
|
+
if (!activeRect.value) return "";
|
|
431
|
+
return buildOverlayPath(activeRect.value, viewport.value, (_mergedConfig$value$s2 = mergedConfig.value.stagePadding) !== null && _mergedConfig$value$s2 !== void 0 ? _mergedConfig$value$s2 : 0, (_mergedConfig$value$s3 = mergedConfig.value.stageRadius) !== null && _mergedConfig$value$s3 !== void 0 ? _mergedConfig$value$s3 : 0);
|
|
432
|
+
});
|
|
433
|
+
const popoverPlacement = shallowRef({
|
|
434
|
+
side: "bottom",
|
|
435
|
+
align: "start"
|
|
436
|
+
});
|
|
437
|
+
const popoverShellStyle = shallowRef({ zIndex: `${mergedZIndex.value + 1}` });
|
|
438
|
+
const popoverStyle = shallowRef({ zIndex: `${mergedZIndex.value + 1}` });
|
|
439
|
+
const motionState = {
|
|
440
|
+
initial: {
|
|
441
|
+
opacity: 0,
|
|
442
|
+
scale: .92,
|
|
443
|
+
y: 8
|
|
444
|
+
},
|
|
445
|
+
animate: {
|
|
446
|
+
opacity: 1,
|
|
447
|
+
scale: 1,
|
|
448
|
+
y: 0
|
|
449
|
+
},
|
|
450
|
+
transition: {
|
|
451
|
+
type: "spring",
|
|
452
|
+
stiffness: 320,
|
|
453
|
+
damping: 28,
|
|
454
|
+
mass: .9,
|
|
455
|
+
layout: {
|
|
456
|
+
type: "spring",
|
|
457
|
+
stiffness: 300,
|
|
458
|
+
damping: 30,
|
|
459
|
+
mass: .85
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
};
|
|
463
|
+
const arrowClasses = computed(() => {
|
|
464
|
+
return [
|
|
465
|
+
popoverPlacement.value.side ? `${prefixCls}-popover-arrow-side-${popoverPlacement.value.side}` : "",
|
|
466
|
+
popoverPlacement.value.align ? `${prefixCls}-popover-arrow-align-${popoverPlacement.value.align}` : "",
|
|
467
|
+
popoverPlacement.value.side ? "" : `${prefixCls}-popover-arrow-none`
|
|
468
|
+
];
|
|
469
|
+
});
|
|
470
|
+
const normalizeIndex = (value) => {
|
|
471
|
+
const steps = mergedSteps.value;
|
|
472
|
+
if (!steps.length) return 0;
|
|
473
|
+
if (typeof value !== "number" || Number.isNaN(value)) return 0;
|
|
474
|
+
return Math.min(Math.max(value, 0), steps.length - 1);
|
|
475
|
+
};
|
|
476
|
+
const syncVisible = (value) => {
|
|
477
|
+
if (internalVisible.value !== value) internalVisible.value = value;
|
|
478
|
+
emit("update:visible", value);
|
|
479
|
+
emit("visibleChange", value);
|
|
480
|
+
};
|
|
481
|
+
const syncCurrent = (value) => {
|
|
482
|
+
if (typeof value !== "number" || Number.isNaN(value)) return;
|
|
483
|
+
const normalized = normalizeIndex(value);
|
|
484
|
+
const previous = internalCurrent.value;
|
|
485
|
+
internalCurrent.value = normalized;
|
|
486
|
+
if (previous !== normalized) {
|
|
487
|
+
emit("update:current", normalized);
|
|
488
|
+
emit("change", normalized, previous);
|
|
489
|
+
}
|
|
490
|
+
};
|
|
491
|
+
function normalizeHtmlProps(propsValue) {
|
|
492
|
+
return propsValue !== null && propsValue !== void 0 ? propsValue : {};
|
|
493
|
+
}
|
|
494
|
+
function normalizeElementProps(className, style) {
|
|
495
|
+
const normalized = {};
|
|
496
|
+
if (className) normalized.class = className;
|
|
497
|
+
if (style) normalized.style = style;
|
|
498
|
+
return normalized;
|
|
499
|
+
}
|
|
500
|
+
function mergeButtonProps(kind, fallback) {
|
|
501
|
+
var _mergedConfig$value$b, _resolvedPopover$valu7;
|
|
502
|
+
return _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({ size: "small" }, kind === "close" ? { type: "text" } : {}), fallback), (_mergedConfig$value$b = mergedConfig.value.buttonProps) === null || _mergedConfig$value$b === void 0 ? void 0 : _mergedConfig$value$b[kind]), (_resolvedPopover$valu7 = resolvedPopover.value.buttonProps) === null || _resolvedPopover$valu7 === void 0 ? void 0 : _resolvedPopover$valu7[kind]);
|
|
503
|
+
}
|
|
504
|
+
function getActiveHookOptions() {
|
|
505
|
+
return {
|
|
506
|
+
config: mergedConfig.value,
|
|
507
|
+
state: tourState.value,
|
|
508
|
+
controller: controllerRef.value
|
|
509
|
+
};
|
|
510
|
+
}
|
|
511
|
+
function invokeHook(hook, element, step) {
|
|
512
|
+
hook === null || hook === void 0 || hook(element, step, getActiveHookOptions());
|
|
513
|
+
}
|
|
514
|
+
function invokePopoverRender() {
|
|
515
|
+
var _resolvedPopover$valu8;
|
|
516
|
+
const hook = (_resolvedPopover$valu8 = resolvedPopover.value.onPopoverRender) !== null && _resolvedPopover$valu8 !== void 0 ? _resolvedPopover$valu8 : mergedConfig.value.onPopoverRender;
|
|
517
|
+
hook === null || hook === void 0 || hook(popoverDom.value, getActiveHookOptions());
|
|
518
|
+
}
|
|
519
|
+
function ensureDummyElement() {
|
|
520
|
+
if (typeof document === "undefined") return null;
|
|
521
|
+
const existing = document.getElementById(dummyElementId);
|
|
522
|
+
if (existing instanceof HTMLElement) return existing;
|
|
523
|
+
const element = document.createElement("div");
|
|
524
|
+
element.id = dummyElementId;
|
|
525
|
+
element.style.width = "0";
|
|
526
|
+
element.style.height = "0";
|
|
527
|
+
element.style.pointerEvents = "none";
|
|
528
|
+
element.style.opacity = "0";
|
|
529
|
+
element.style.position = "fixed";
|
|
530
|
+
element.style.top = "50%";
|
|
531
|
+
element.style.left = "50%";
|
|
532
|
+
document.body.appendChild(element);
|
|
533
|
+
return element;
|
|
534
|
+
}
|
|
535
|
+
function resolveStepElement(step) {
|
|
536
|
+
if (typeof document === "undefined") return null;
|
|
537
|
+
const rawElement = step.element;
|
|
538
|
+
if (typeof rawElement === "function") {
|
|
539
|
+
const resolved = rawElement();
|
|
540
|
+
return resolved instanceof HTMLElement ? resolved : ensureDummyElement();
|
|
541
|
+
}
|
|
542
|
+
if (typeof rawElement === "string") {
|
|
543
|
+
const resolved = document.querySelector(rawElement);
|
|
544
|
+
return resolved instanceof HTMLElement ? resolved : ensureDummyElement();
|
|
545
|
+
}
|
|
546
|
+
if (rawElement instanceof HTMLElement) return rawElement;
|
|
547
|
+
return ensureDummyElement();
|
|
548
|
+
}
|
|
549
|
+
function focusFirstInteractive() {
|
|
550
|
+
var _candidates$;
|
|
551
|
+
(_candidates$ = [
|
|
552
|
+
getComponentElement(previousButtonVmRef.value),
|
|
553
|
+
getComponentElement(nextButtonVmRef.value),
|
|
554
|
+
getComponentElement(closeButtonVmRef.value),
|
|
555
|
+
activeElement.value
|
|
556
|
+
].filter((item) => Boolean(item && !item.hasAttribute("disabled")))[0]) === null || _candidates$ === void 0 || _candidates$.focus();
|
|
557
|
+
}
|
|
558
|
+
function clearElementState(element) {
|
|
559
|
+
if (!element) return;
|
|
560
|
+
element.classList.remove(activeElementClass, noInteractionClass);
|
|
561
|
+
element.style.removeProperty("--sd-tour-active-z-index");
|
|
562
|
+
element.removeAttribute("aria-haspopup");
|
|
563
|
+
element.removeAttribute("aria-expanded");
|
|
564
|
+
element.removeAttribute("aria-controls");
|
|
565
|
+
}
|
|
566
|
+
function applyElementState(element, step) {
|
|
567
|
+
var _step$disableActiveIn;
|
|
568
|
+
clearElementState(element);
|
|
569
|
+
const disableInteraction = (_step$disableActiveIn = step.disableActiveInteraction) !== null && _step$disableActiveIn !== void 0 ? _step$disableActiveIn : mergedConfig.value.disableActiveInteraction;
|
|
570
|
+
element.classList.add(activeElementClass);
|
|
571
|
+
if (disableInteraction) element.classList.add(noInteractionClass);
|
|
572
|
+
element.style.setProperty("--sd-tour-active-z-index", `${mergedZIndex.value + 1}`);
|
|
573
|
+
element.setAttribute("aria-haspopup", "dialog");
|
|
574
|
+
element.setAttribute("aria-expanded", "true");
|
|
575
|
+
element.setAttribute("aria-controls", popoverContentId);
|
|
576
|
+
}
|
|
577
|
+
function updateLayout() {
|
|
578
|
+
return _updateLayout.apply(this, arguments);
|
|
579
|
+
}
|
|
580
|
+
function _updateLayout() {
|
|
581
|
+
_updateLayout = _asyncToGenerator(function* () {
|
|
582
|
+
if (!activeElement.value) return;
|
|
583
|
+
yield nextTick();
|
|
584
|
+
activeRect.value = activeElement.value.getBoundingClientRect();
|
|
585
|
+
updateActiveBounding();
|
|
586
|
+
yield nextTick();
|
|
587
|
+
placePopover();
|
|
588
|
+
});
|
|
589
|
+
return _updateLayout.apply(this, arguments);
|
|
590
|
+
}
|
|
591
|
+
function teardown(triggerCloseEvent, currentStepIndex, previousActiveStep = activeStep.value) {
|
|
592
|
+
var _mergedConfig$value$o, _mergedConfig$value, _activeOnDestroyed$va;
|
|
593
|
+
const element = activeElement.value;
|
|
594
|
+
clearElementState(element);
|
|
595
|
+
previousElement.value = element;
|
|
596
|
+
previousStep.value = previousActiveStep;
|
|
597
|
+
activeElement.value = null;
|
|
598
|
+
activeStep.value = void 0;
|
|
599
|
+
activeRect.value = null;
|
|
600
|
+
activeIndex.value = void 0;
|
|
601
|
+
highlightedStep.value = null;
|
|
602
|
+
isInitialized.value = false;
|
|
603
|
+
syncVisible(false);
|
|
604
|
+
(_mergedConfig$value$o = (_mergedConfig$value = mergedConfig.value).onDestroyed) === null || _mergedConfig$value$o === void 0 || _mergedConfig$value$o.call(_mergedConfig$value, element !== null && element !== void 0 ? element : void 0, previousActiveStep, getActiveHookOptions());
|
|
605
|
+
if (triggerCloseEvent) emit("close", currentStepIndex);
|
|
606
|
+
(_activeOnDestroyed$va = activeOnDestroyed.value) === null || _activeOnDestroyed$va === void 0 || _activeOnDestroyed$va.focus();
|
|
607
|
+
activeOnDestroyed.value = null;
|
|
608
|
+
}
|
|
609
|
+
function requestDestroy(allowGuard = true) {
|
|
610
|
+
const currentStepIndex = activeIndex.value;
|
|
611
|
+
const step = activeStep.value;
|
|
612
|
+
const element = activeElement.value;
|
|
613
|
+
if (allowGuard && mergedConfig.value.onDestroyStarted) {
|
|
614
|
+
mergedConfig.value.onDestroyStarted(element !== null && element !== void 0 ? element : void 0, step, getActiveHookOptions());
|
|
615
|
+
return;
|
|
616
|
+
}
|
|
617
|
+
if (step) {
|
|
618
|
+
var _step$onDeselected;
|
|
619
|
+
invokeHook((_step$onDeselected = step.onDeselected) !== null && _step$onDeselected !== void 0 ? _step$onDeselected : mergedConfig.value.onDeselected, element !== null && element !== void 0 ? element : void 0, step);
|
|
620
|
+
}
|
|
621
|
+
teardown(true, currentStepIndex, step);
|
|
622
|
+
}
|
|
623
|
+
function activateStep(_x, _x2) {
|
|
624
|
+
return _activateStep.apply(this, arguments);
|
|
625
|
+
}
|
|
626
|
+
function _activateStep() {
|
|
627
|
+
_activateStep = _asyncToGenerator(function* (step, stepIndex) {
|
|
628
|
+
var _activeOnDestroyed$va2, _step$onHighlightStar, _step$onHighlighted;
|
|
629
|
+
const element = resolveStepElement(step);
|
|
630
|
+
if (!element) return;
|
|
631
|
+
const previousActiveStep = activeStep.value;
|
|
632
|
+
const previousActiveElement = activeElement.value;
|
|
633
|
+
if (previousActiveStep && previousActiveElement && previousActiveElement !== element) {
|
|
634
|
+
var _previousActiveStep$o;
|
|
635
|
+
invokeHook((_previousActiveStep$o = previousActiveStep.onDeselected) !== null && _previousActiveStep$o !== void 0 ? _previousActiveStep$o : mergedConfig.value.onDeselected, previousActiveElement, previousActiveStep);
|
|
636
|
+
clearElementState(previousActiveElement);
|
|
637
|
+
}
|
|
638
|
+
(_activeOnDestroyed$va2 = activeOnDestroyed.value) !== null && _activeOnDestroyed$va2 !== void 0 || (activeOnDestroyed.value = document.activeElement instanceof HTMLElement ? document.activeElement : null);
|
|
639
|
+
previousStep.value = previousActiveStep;
|
|
640
|
+
previousElement.value = previousActiveElement;
|
|
641
|
+
activeStep.value = step;
|
|
642
|
+
activeElement.value = element;
|
|
643
|
+
activeIndex.value = stepIndex;
|
|
644
|
+
isInitialized.value = true;
|
|
645
|
+
syncVisible(true);
|
|
646
|
+
if (typeof stepIndex === "number") syncCurrent(stepIndex);
|
|
647
|
+
invokeHook((_step$onHighlightStar = step.onHighlightStarted) !== null && _step$onHighlightStar !== void 0 ? _step$onHighlightStar : mergedConfig.value.onHighlightStarted, element, step);
|
|
648
|
+
if (mergedConfig.value.smoothScroll) {
|
|
649
|
+
var _element$scrollIntoVi;
|
|
650
|
+
(_element$scrollIntoVi = element.scrollIntoView) === null || _element$scrollIntoVi === void 0 || _element$scrollIntoVi.call(element, {
|
|
651
|
+
behavior: "smooth",
|
|
652
|
+
block: "center",
|
|
653
|
+
inline: "center"
|
|
654
|
+
});
|
|
655
|
+
} else {
|
|
656
|
+
var _element$scrollIntoVi2;
|
|
657
|
+
(_element$scrollIntoVi2 = element.scrollIntoView) === null || _element$scrollIntoVi2 === void 0 || _element$scrollIntoVi2.call(element, {
|
|
658
|
+
behavior: "auto",
|
|
659
|
+
block: "center",
|
|
660
|
+
inline: "center"
|
|
661
|
+
});
|
|
662
|
+
}
|
|
663
|
+
applyElementState(element, step);
|
|
664
|
+
yield updateLayout();
|
|
665
|
+
yield nextTick();
|
|
666
|
+
invokeHook((_step$onHighlighted = step.onHighlighted) !== null && _step$onHighlighted !== void 0 ? _step$onHighlighted : mergedConfig.value.onHighlighted, element, step);
|
|
667
|
+
invokePopoverRender();
|
|
668
|
+
focusFirstInteractive();
|
|
669
|
+
});
|
|
670
|
+
return _activateStep.apply(this, arguments);
|
|
671
|
+
}
|
|
672
|
+
function driveTo() {
|
|
673
|
+
return _driveTo.apply(this, arguments);
|
|
674
|
+
}
|
|
675
|
+
function _driveTo() {
|
|
676
|
+
_driveTo = _asyncToGenerator(function* (stepIndex = ((_props$current) => (_props$current = props.current) !== null && _props$current !== void 0 ? _props$current : internalCurrent.value)()) {
|
|
677
|
+
if (!mergedSteps.value.length) return;
|
|
678
|
+
highlightedStep.value = null;
|
|
679
|
+
const targetIndex = normalizeIndex(stepIndex);
|
|
680
|
+
yield activateStep(mergedSteps.value[targetIndex], targetIndex);
|
|
681
|
+
});
|
|
682
|
+
return _driveTo.apply(this, arguments);
|
|
683
|
+
}
|
|
684
|
+
function isButtonDisabled(button) {
|
|
685
|
+
return resolvedDisableButtons.value.includes(button);
|
|
686
|
+
}
|
|
687
|
+
function moveTo(stepIndex) {
|
|
688
|
+
if (!mergedSteps.value.length) return;
|
|
689
|
+
driveTo(stepIndex);
|
|
690
|
+
}
|
|
691
|
+
function movePrevious() {
|
|
692
|
+
if (typeof activeIndex.value !== "number") return;
|
|
693
|
+
const nextIndex = activeIndex.value - 1;
|
|
694
|
+
if (nextIndex < 0) {
|
|
695
|
+
requestDestroy();
|
|
696
|
+
return;
|
|
697
|
+
}
|
|
698
|
+
moveTo(nextIndex);
|
|
699
|
+
}
|
|
700
|
+
function moveNext() {
|
|
701
|
+
if (highlightedStep.value) {
|
|
702
|
+
requestDestroy();
|
|
703
|
+
return;
|
|
704
|
+
}
|
|
705
|
+
if (typeof activeIndex.value !== "number") return;
|
|
706
|
+
const nextIndex = activeIndex.value + 1;
|
|
707
|
+
if (mergedSteps.value[nextIndex]) {
|
|
708
|
+
moveTo(nextIndex);
|
|
709
|
+
return;
|
|
710
|
+
}
|
|
711
|
+
requestDestroy();
|
|
712
|
+
}
|
|
713
|
+
function highlight(_x3) {
|
|
714
|
+
return _highlight.apply(this, arguments);
|
|
715
|
+
}
|
|
716
|
+
function _highlight() {
|
|
717
|
+
_highlight = _asyncToGenerator(function* (step) {
|
|
718
|
+
highlightedStep.value = step;
|
|
719
|
+
yield activateStep(_objectSpread2(_objectSpread2({}, step), {}, { popover: _objectSpread2(_objectSpread2({}, step.popover), {}, {
|
|
720
|
+
showButtons: [],
|
|
721
|
+
showProgress: false,
|
|
722
|
+
progressText: ""
|
|
723
|
+
}) }), void 0);
|
|
724
|
+
});
|
|
725
|
+
return _highlight.apply(this, arguments);
|
|
726
|
+
}
|
|
727
|
+
function closeTour() {
|
|
728
|
+
requestDestroy();
|
|
729
|
+
}
|
|
730
|
+
function closeTourForce() {
|
|
731
|
+
requestDestroy(false);
|
|
732
|
+
}
|
|
733
|
+
function resolveHook(hook) {
|
|
734
|
+
return hook;
|
|
735
|
+
}
|
|
736
|
+
function handlePreviousButtonClick() {
|
|
737
|
+
var _resolvedPopover$valu9;
|
|
738
|
+
if (isButtonDisabled("previous")) return;
|
|
739
|
+
const hook = resolveHook((_resolvedPopover$valu9 = resolvedPopover.value.onPrevClick) !== null && _resolvedPopover$valu9 !== void 0 ? _resolvedPopover$valu9 : mergedConfig.value.onPrevClick);
|
|
740
|
+
if (hook) {
|
|
741
|
+
var _activeElement$value;
|
|
742
|
+
hook((_activeElement$value = activeElement.value) !== null && _activeElement$value !== void 0 ? _activeElement$value : void 0, activeStep.value, getActiveHookOptions());
|
|
743
|
+
return;
|
|
744
|
+
}
|
|
745
|
+
movePrevious();
|
|
746
|
+
}
|
|
747
|
+
function handleNextButtonClick() {
|
|
748
|
+
var _resolvedPopover$valu10;
|
|
749
|
+
if (isButtonDisabled("next")) return;
|
|
750
|
+
const hook = resolveHook((_resolvedPopover$valu10 = resolvedPopover.value.onNextClick) !== null && _resolvedPopover$valu10 !== void 0 ? _resolvedPopover$valu10 : mergedConfig.value.onNextClick);
|
|
751
|
+
if (hook) {
|
|
752
|
+
var _activeElement$value2;
|
|
753
|
+
hook((_activeElement$value2 = activeElement.value) !== null && _activeElement$value2 !== void 0 ? _activeElement$value2 : void 0, activeStep.value, getActiveHookOptions());
|
|
754
|
+
return;
|
|
755
|
+
}
|
|
756
|
+
moveNext();
|
|
757
|
+
}
|
|
758
|
+
function handleCloseButtonClick() {
|
|
759
|
+
var _resolvedPopover$valu11;
|
|
760
|
+
if (isButtonDisabled("close")) return;
|
|
761
|
+
const hook = resolveHook((_resolvedPopover$valu11 = resolvedPopover.value.onCloseClick) !== null && _resolvedPopover$valu11 !== void 0 ? _resolvedPopover$valu11 : mergedConfig.value.onCloseClick);
|
|
762
|
+
if (hook) {
|
|
763
|
+
var _activeElement$value3;
|
|
764
|
+
hook((_activeElement$value3 = activeElement.value) !== null && _activeElement$value3 !== void 0 ? _activeElement$value3 : void 0, activeStep.value, getActiveHookOptions());
|
|
765
|
+
return;
|
|
766
|
+
}
|
|
767
|
+
closeTour();
|
|
768
|
+
}
|
|
769
|
+
function handleOverlayClick() {
|
|
770
|
+
const behavior = mergedConfig.value.overlayClickBehavior;
|
|
771
|
+
if (behavior === "close") {
|
|
772
|
+
if (mergedConfig.value.allowClose !== false) closeTour();
|
|
773
|
+
return;
|
|
774
|
+
}
|
|
775
|
+
if (behavior === "nextStep") {
|
|
776
|
+
moveNext();
|
|
777
|
+
return;
|
|
778
|
+
}
|
|
779
|
+
if (typeof behavior === "function") {
|
|
780
|
+
var _activeElement$value4;
|
|
781
|
+
behavior((_activeElement$value4 = activeElement.value) !== null && _activeElement$value4 !== void 0 ? _activeElement$value4 : void 0, activeStep.value, getActiveHookOptions());
|
|
782
|
+
}
|
|
783
|
+
}
|
|
784
|
+
function syncTourActivityClasses(active) {
|
|
785
|
+
if (typeof document === "undefined") return;
|
|
786
|
+
document.body.classList.toggle(activeBodyClass, active);
|
|
787
|
+
document.body.classList.toggle(fadeBodyClass, active && mergedConfig.value.animate !== false);
|
|
788
|
+
document.body.classList.toggle(staticBodyClass, active && mergedConfig.value.animate === false);
|
|
789
|
+
}
|
|
790
|
+
function handleDocumentClick(event) {
|
|
791
|
+
var _activeElement$value5, _popoverElement$value;
|
|
792
|
+
if (!isActive.value) return;
|
|
793
|
+
const target = event.target;
|
|
794
|
+
if (!(target instanceof Node)) return;
|
|
795
|
+
if (((_activeElement$value5 = activeElement.value) === null || _activeElement$value5 === void 0 ? void 0 : _activeElement$value5.contains(target)) || ((_popoverElement$value = popoverElement.value) === null || _popoverElement$value === void 0 ? void 0 : _popoverElement$value.contains(target))) return;
|
|
796
|
+
event.preventDefault();
|
|
797
|
+
event.stopPropagation();
|
|
798
|
+
event.stopImmediatePropagation();
|
|
799
|
+
handleOverlayClick();
|
|
800
|
+
}
|
|
801
|
+
function handleKeyup(event) {
|
|
802
|
+
if (!isActive.value || mergedConfig.value.allowKeyboardControl === false) return;
|
|
803
|
+
if (event.key === "Escape") {
|
|
804
|
+
closeTour();
|
|
805
|
+
return;
|
|
806
|
+
}
|
|
807
|
+
if (event.key === "ArrowRight") {
|
|
808
|
+
handleNextButtonClick();
|
|
809
|
+
return;
|
|
810
|
+
}
|
|
811
|
+
if (event.key === "ArrowLeft") handlePreviousButtonClick();
|
|
812
|
+
}
|
|
813
|
+
function placePopover() {
|
|
814
|
+
var _mergedConfig$value$s4, _mergedConfig$value$p, _resolvedPopover$valu12, _resolvedPopover$valu13;
|
|
815
|
+
if (!activeRect.value || !popoverElement.value || !activeElement.value) return;
|
|
816
|
+
const rect = activeRect.value;
|
|
817
|
+
const popover = popoverElement.value.getBoundingClientRect();
|
|
818
|
+
const arrowSize = 10;
|
|
819
|
+
const padding = (_mergedConfig$value$s4 = mergedConfig.value.stagePadding) !== null && _mergedConfig$value$s4 !== void 0 ? _mergedConfig$value$s4 : 0;
|
|
820
|
+
const offset = (_mergedConfig$value$p = mergedConfig.value.popoverOffset) !== null && _mergedConfig$value$p !== void 0 ? _mergedConfig$value$p : 10;
|
|
821
|
+
const preferredSide = activeElement.value.id === dummyElementId ? "over" : (_resolvedPopover$valu12 = resolvedPopover.value.side) !== null && _resolvedPopover$valu12 !== void 0 ? _resolvedPopover$valu12 : "bottom";
|
|
822
|
+
const preferredAlign = (_resolvedPopover$valu13 = resolvedPopover.value.align) !== null && _resolvedPopover$valu13 !== void 0 ? _resolvedPopover$valu13 : "start";
|
|
823
|
+
const positions = calculatePopoverPosition({
|
|
824
|
+
rect,
|
|
825
|
+
popover,
|
|
826
|
+
size: viewport.value,
|
|
827
|
+
side: preferredSide,
|
|
828
|
+
align: preferredAlign,
|
|
829
|
+
offset,
|
|
830
|
+
padding,
|
|
831
|
+
arrowSize
|
|
832
|
+
});
|
|
833
|
+
popoverPlacement.value = positions.placement;
|
|
834
|
+
popoverShellStyle.value = {
|
|
835
|
+
left: positions.style.left,
|
|
836
|
+
top: positions.style.top,
|
|
837
|
+
right: positions.style.right,
|
|
838
|
+
bottom: positions.style.bottom,
|
|
839
|
+
zIndex: `${mergedZIndex.value + 1}`
|
|
840
|
+
};
|
|
841
|
+
popoverStyle.value = { zIndex: `${mergedZIndex.value + 1}` };
|
|
842
|
+
}
|
|
843
|
+
useResizeObserver(activeElement, () => {
|
|
844
|
+
if (!mounted.value || !activeElement.value) return;
|
|
845
|
+
updateLayout();
|
|
846
|
+
});
|
|
847
|
+
useResizeObserver(popoverElement, () => {
|
|
848
|
+
if (!mounted.value || !isActive.value) return;
|
|
849
|
+
placePopover();
|
|
850
|
+
});
|
|
851
|
+
useEventListener("keyup", handleKeyup);
|
|
852
|
+
useEventListener(document, "click", handleDocumentClick, { capture: true });
|
|
853
|
+
const controllerRef = shallowRef({
|
|
854
|
+
isActive: () => isActive.value,
|
|
855
|
+
refresh: () => {
|
|
856
|
+
updateLayout();
|
|
857
|
+
},
|
|
858
|
+
drive: (stepIndex = 0) => {
|
|
859
|
+
driveTo(stepIndex);
|
|
860
|
+
},
|
|
861
|
+
setConfig: (config) => {
|
|
862
|
+
configOverride.value = _objectSpread2(_objectSpread2({}, configOverride.value), config);
|
|
863
|
+
},
|
|
864
|
+
setSteps: (steps) => {
|
|
865
|
+
stepOverride.value = steps;
|
|
866
|
+
},
|
|
867
|
+
getConfig: () => mergedConfig.value,
|
|
868
|
+
getState: () => tourState.value,
|
|
869
|
+
getActiveIndex: () => activeIndex.value,
|
|
870
|
+
isFirstStep: () => isFirstStep.value,
|
|
871
|
+
isLastStep: () => isLastStep.value,
|
|
872
|
+
getActiveStep: () => activeStep.value,
|
|
873
|
+
getActiveElement: () => activeElement.value,
|
|
874
|
+
getPreviousElement: () => previousElement.value,
|
|
875
|
+
getPreviousStep: () => previousStep.value,
|
|
876
|
+
moveNext,
|
|
877
|
+
movePrevious,
|
|
878
|
+
moveTo,
|
|
879
|
+
hasNextStep: () => {
|
|
880
|
+
return typeof activeIndex.value === "number" && Boolean(mergedSteps.value[activeIndex.value + 1]);
|
|
881
|
+
},
|
|
882
|
+
hasPreviousStep: () => {
|
|
883
|
+
return typeof activeIndex.value === "number" && Boolean(activeIndex.value > 0);
|
|
884
|
+
},
|
|
885
|
+
highlight: (step) => {
|
|
886
|
+
highlight(step);
|
|
887
|
+
},
|
|
888
|
+
destroy: () => {
|
|
889
|
+
closeTourForce();
|
|
890
|
+
}
|
|
891
|
+
});
|
|
892
|
+
function buildOverlayPath(rect, size, stagePadding, stageRadius) {
|
|
893
|
+
const width = rect.width + stagePadding * 2;
|
|
894
|
+
const height = rect.height + stagePadding * 2;
|
|
895
|
+
const radius = Math.floor(Math.max(Math.min(stageRadius, width / 2, height / 2), 0));
|
|
896
|
+
const x = rect.x - stagePadding + radius;
|
|
897
|
+
const y = rect.y - stagePadding;
|
|
898
|
+
const horizontal = width - radius * 2;
|
|
899
|
+
const vertical = height - radius * 2;
|
|
900
|
+
return `M${size.width},0L0,0L0,${size.height}L${size.width},${size.height}L${size.width},0Z M${x},${y} h${horizontal} a${radius},${radius} 0 0 1 ${radius},${radius} v${vertical} a${radius},${radius} 0 0 1 -${radius},${radius} h-${horizontal} a${radius},${radius} 0 0 1 -${radius},-${radius} v-${vertical} a${radius},${radius} 0 0 1 ${radius},-${radius} z`;
|
|
901
|
+
}
|
|
902
|
+
function calculateAxisPosition(align, rectStart, rectSize, popoverSize, viewportSize, arrowSize) {
|
|
903
|
+
if (align === "center") return Math.max(Math.min(rectStart + rectSize / 2 - popoverSize / 2, viewportSize - popoverSize - arrowSize), arrowSize);
|
|
904
|
+
if (align === "end") return Math.max(Math.min(rectStart + rectSize - popoverSize, viewportSize - popoverSize - arrowSize), arrowSize);
|
|
905
|
+
return Math.max(Math.min(rectStart, viewportSize - popoverSize - arrowSize), arrowSize);
|
|
906
|
+
}
|
|
907
|
+
function calculatePopoverPosition(options) {
|
|
908
|
+
const { rect, popover, size, side, align, offset, padding, arrowSize } = options;
|
|
909
|
+
const topSpace = rect.top - (popover.height + offset + padding);
|
|
910
|
+
const bottomSpace = size.height - (rect.bottom + popover.height + offset + padding);
|
|
911
|
+
const leftSpace = rect.left - (popover.width + offset + padding);
|
|
912
|
+
const rightSpace = size.width - (rect.right + popover.width + offset + padding);
|
|
913
|
+
const style = {
|
|
914
|
+
left: "auto",
|
|
915
|
+
top: "auto",
|
|
916
|
+
right: "auto",
|
|
917
|
+
bottom: "auto"
|
|
918
|
+
};
|
|
919
|
+
const placement = {
|
|
920
|
+
side: side !== null && side !== void 0 ? side : "bottom",
|
|
921
|
+
align: align !== null && align !== void 0 ? align : "start"
|
|
922
|
+
};
|
|
923
|
+
const applyTop = () => {
|
|
924
|
+
style.top = `${Math.max(topSpace, arrowSize)}px`;
|
|
925
|
+
style.left = `${calculateAxisPosition(align, rect.left, rect.width, popover.width, size.width, arrowSize)}px`;
|
|
926
|
+
placement.side = "top";
|
|
927
|
+
};
|
|
928
|
+
const applyBottom = () => {
|
|
929
|
+
style.top = `${Math.min(rect.bottom + offset, size.height - popover.height - arrowSize)}px`;
|
|
930
|
+
style.left = `${calculateAxisPosition(align, rect.left, rect.width, popover.width, size.width, arrowSize)}px`;
|
|
931
|
+
placement.side = "bottom";
|
|
932
|
+
};
|
|
933
|
+
const applyLeft = () => {
|
|
934
|
+
style.left = `${Math.max(leftSpace, arrowSize)}px`;
|
|
935
|
+
style.top = `${calculateAxisPosition(align, rect.top, rect.height, popover.height, size.height, arrowSize)}px`;
|
|
936
|
+
placement.side = "left";
|
|
937
|
+
};
|
|
938
|
+
const applyRight = () => {
|
|
939
|
+
style.left = `${Math.min(rect.right + offset, size.width - popover.width - arrowSize)}px`;
|
|
940
|
+
style.top = `${calculateAxisPosition(align, rect.top, rect.height, popover.height, size.height, arrowSize)}px`;
|
|
941
|
+
placement.side = "right";
|
|
942
|
+
};
|
|
943
|
+
const applyCenter = () => {
|
|
944
|
+
style.left = `${Math.max((size.width - popover.width) / 2, arrowSize)}px`;
|
|
945
|
+
style.top = `${Math.max((size.height - popover.height) / 2, arrowSize)}px`;
|
|
946
|
+
placement.side = "over";
|
|
947
|
+
placement.align = "center";
|
|
948
|
+
};
|
|
949
|
+
if (side === "over") {
|
|
950
|
+
applyCenter();
|
|
951
|
+
return {
|
|
952
|
+
style,
|
|
953
|
+
placement
|
|
954
|
+
};
|
|
955
|
+
}
|
|
956
|
+
if (side === "top" && topSpace >= 0) {
|
|
957
|
+
applyTop();
|
|
958
|
+
return {
|
|
959
|
+
style,
|
|
960
|
+
placement
|
|
961
|
+
};
|
|
962
|
+
}
|
|
963
|
+
if (side === "bottom" && bottomSpace >= 0) {
|
|
964
|
+
applyBottom();
|
|
965
|
+
return {
|
|
966
|
+
style,
|
|
967
|
+
placement
|
|
968
|
+
};
|
|
969
|
+
}
|
|
970
|
+
if (side === "left" && leftSpace >= 0) {
|
|
971
|
+
applyLeft();
|
|
972
|
+
return {
|
|
973
|
+
style,
|
|
974
|
+
placement
|
|
975
|
+
};
|
|
976
|
+
}
|
|
977
|
+
if (side === "right" && rightSpace >= 0) {
|
|
978
|
+
applyRight();
|
|
979
|
+
return {
|
|
980
|
+
style,
|
|
981
|
+
placement
|
|
982
|
+
};
|
|
983
|
+
}
|
|
984
|
+
if (bottomSpace >= 0) applyBottom();
|
|
985
|
+
else if (topSpace >= 0) applyTop();
|
|
986
|
+
else if (rightSpace >= 0) applyRight();
|
|
987
|
+
else if (leftSpace >= 0) applyLeft();
|
|
988
|
+
else applyCenter();
|
|
989
|
+
return {
|
|
990
|
+
style,
|
|
991
|
+
placement
|
|
992
|
+
};
|
|
993
|
+
}
|
|
994
|
+
onMounted(() => {
|
|
995
|
+
mounted.value = true;
|
|
996
|
+
syncTourActivityClasses(isActive.value);
|
|
997
|
+
if (mergedVisible.value) driveTo();
|
|
998
|
+
});
|
|
999
|
+
onBeforeUnmount(() => {
|
|
1000
|
+
syncTourActivityClasses(false);
|
|
1001
|
+
closeTourForce();
|
|
1002
|
+
releaseDialogLayer();
|
|
1003
|
+
});
|
|
1004
|
+
watch(mergedVisible, (visible) => {
|
|
1005
|
+
if (!mounted.value) return;
|
|
1006
|
+
if (visible) {
|
|
1007
|
+
driveTo();
|
|
1008
|
+
return;
|
|
1009
|
+
}
|
|
1010
|
+
closeTourForce();
|
|
1011
|
+
});
|
|
1012
|
+
watch(() => props.current, (value) => {
|
|
1013
|
+
if (!mounted.value || !mergedVisible.value || typeof value !== "number") return;
|
|
1014
|
+
moveTo(value);
|
|
1015
|
+
});
|
|
1016
|
+
watch(() => [props.steps, userConfig.value], () => {
|
|
1017
|
+
var _activeIndex$value;
|
|
1018
|
+
if (!mounted.value || !mergedVisible.value) return;
|
|
1019
|
+
if (highlightedStep.value) {
|
|
1020
|
+
highlight(highlightedStep.value);
|
|
1021
|
+
return;
|
|
1022
|
+
}
|
|
1023
|
+
driveTo((_activeIndex$value = activeIndex.value) !== null && _activeIndex$value !== void 0 ? _activeIndex$value : internalCurrent.value);
|
|
1024
|
+
}, { deep: true });
|
|
1025
|
+
watch(mergedZIndex, () => {
|
|
1026
|
+
if (!isActive.value) return;
|
|
1027
|
+
placePopover();
|
|
1028
|
+
});
|
|
1029
|
+
watch(isActive, (active) => {
|
|
1030
|
+
syncTourActivityClasses(active);
|
|
1031
|
+
});
|
|
1032
|
+
watch([
|
|
1033
|
+
activeX,
|
|
1034
|
+
activeY,
|
|
1035
|
+
activeWidth,
|
|
1036
|
+
activeHeight,
|
|
1037
|
+
viewportWidth,
|
|
1038
|
+
viewportHeight
|
|
1039
|
+
], () => {
|
|
1040
|
+
if (!mounted.value || !activeElement.value) return;
|
|
1041
|
+
activeRect.value = new DOMRect(activeX.value, activeY.value, activeWidth.value, activeHeight.value);
|
|
1042
|
+
if (!isActive.value) return;
|
|
1043
|
+
placePopover();
|
|
1044
|
+
});
|
|
1045
|
+
__expose({
|
|
1046
|
+
drive: driveTo,
|
|
1047
|
+
moveNext,
|
|
1048
|
+
movePrevious,
|
|
1049
|
+
moveTo,
|
|
1050
|
+
highlight,
|
|
1051
|
+
destroy: closeTourForce,
|
|
1052
|
+
refresh: () => controllerRef.value.refresh(),
|
|
1053
|
+
isActive: () => controllerRef.value.isActive(),
|
|
1054
|
+
getController: () => controllerRef.value,
|
|
1055
|
+
getState: () => controllerRef.value.getState()
|
|
1056
|
+
});
|
|
1057
|
+
return (_ctx, _cache) => {
|
|
1058
|
+
var _mergedConfig$value$o2, _mergedConfig$value$o3;
|
|
1059
|
+
return openBlock(), createElementBlock(Fragment, null, [renderSlot(_ctx.$slots, "default"), (openBlock(), createBlock(Teleport, { to: "body" }, [mounted.value && isActive.value && activeRect.value && activeStep.value ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [(openBlock(), createElementBlock("svg", {
|
|
1060
|
+
class: normalizeClass([overlayClass, { [overlayAnimatedClass]: mergedConfig.value.animate !== false }]),
|
|
1061
|
+
style: normalizeStyle(overlayStyle.value),
|
|
1062
|
+
viewBox: `0 0 ${viewport.value.width} ${viewport.value.height}`,
|
|
1063
|
+
"fill-rule": "evenodd",
|
|
1064
|
+
"clip-rule": "evenodd",
|
|
1065
|
+
"xml:space": "preserve",
|
|
1066
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1067
|
+
preserveAspectRatio: "xMinYMin slice",
|
|
1068
|
+
version: "1.1"
|
|
1069
|
+
}, [createElementVNode("path", {
|
|
1070
|
+
d: overlayPath.value,
|
|
1071
|
+
fill: (_mergedConfig$value$o2 = mergedConfig.value.overlayColor) !== null && _mergedConfig$value$o2 !== void 0 ? _mergedConfig$value$o2 : "#000",
|
|
1072
|
+
opacity: `${(_mergedConfig$value$o3 = mergedConfig.value.overlayOpacity) !== null && _mergedConfig$value$o3 !== void 0 ? _mergedConfig$value$o3 : .7}`,
|
|
1073
|
+
"fill-rule": "evenodd",
|
|
1074
|
+
"clip-rule": "evenodd"
|
|
1075
|
+
}, null, 8, _hoisted_2)], 14, _hoisted_1)), createElementVNode("dialog", {
|
|
1076
|
+
open: "",
|
|
1077
|
+
class: normalizeClass(popoverShellClass),
|
|
1078
|
+
style: normalizeStyle(popoverShellStyle.value),
|
|
1079
|
+
"aria-labelledby": popoverTitleId,
|
|
1080
|
+
"aria-describedby": popoverDescriptionId
|
|
1081
|
+
}, [createVNode(unref(Motion), {
|
|
1082
|
+
ref_key: "popoverRef",
|
|
1083
|
+
ref: popoverRef,
|
|
1084
|
+
class: normalizeClass(popoverClasses.value),
|
|
1085
|
+
style: normalizeStyle(popoverStyle.value),
|
|
1086
|
+
layout: true,
|
|
1087
|
+
initial: motionState.initial,
|
|
1088
|
+
animate: motionState.animate,
|
|
1089
|
+
transition: motionState.transition
|
|
1090
|
+
}, {
|
|
1091
|
+
default: withCtx(() => [
|
|
1092
|
+
showCloseButton.value ? (openBlock(), createBlock(unref(Button), mergeProps({
|
|
1093
|
+
key: 0,
|
|
1094
|
+
ref_key: "closeButtonVmRef",
|
|
1095
|
+
ref: closeButtonVmRef
|
|
1096
|
+
}, closeButtonProps.value, {
|
|
1097
|
+
class: `${unref(prefixCls)}-popover-close-btn`,
|
|
1098
|
+
disabled: isButtonDisabled("close"),
|
|
1099
|
+
onClick: handleCloseButtonClick
|
|
1100
|
+
}), {
|
|
1101
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "close-button", {
|
|
1102
|
+
step: activeStep.value,
|
|
1103
|
+
current: activeIndex.value,
|
|
1104
|
+
controller: controllerRef.value,
|
|
1105
|
+
state: tourState.value
|
|
1106
|
+
}, () => [_cache[0] || (_cache[0] = createTextVNode(" × ", -1))])]),
|
|
1107
|
+
_: 3
|
|
1108
|
+
}, 16, ["class", "disabled"])) : createCommentVNode("", true),
|
|
1109
|
+
createElementVNode("div", {
|
|
1110
|
+
ref_key: "arrowRef",
|
|
1111
|
+
ref: arrowRef,
|
|
1112
|
+
class: normalizeClass([`${unref(prefixCls)}-popover-arrow`, arrowClasses.value])
|
|
1113
|
+
}, null, 2),
|
|
1114
|
+
createElementVNode("div", mergeProps({ class: `${unref(prefixCls)}-content` }, resolvedPopover.value.contentProps, { style: resolvedPopover.value.contentStyle }), [hasTitle.value ? (openBlock(), createElementBlock("header", mergeProps({
|
|
1115
|
+
key: 0,
|
|
1116
|
+
id: popoverTitleId,
|
|
1117
|
+
ref_key: "titleRef",
|
|
1118
|
+
ref: titleRef,
|
|
1119
|
+
class: `${unref(prefixCls)}-popover-title`
|
|
1120
|
+
}, resolvedPopover.value.titleProps), [renderSlot(_ctx.$slots, "title", {
|
|
1121
|
+
step: activeStep.value,
|
|
1122
|
+
current: activeIndex.value,
|
|
1123
|
+
title: resolvedPopover.value.title,
|
|
1124
|
+
controller: controllerRef.value,
|
|
1125
|
+
state: tourState.value
|
|
1126
|
+
}, () => [createTextVNode(toDisplayString(resolvedPopover.value.title), 1)])], 16)) : createCommentVNode("", true), hasDescription.value ? (openBlock(), createElementBlock("div", mergeProps({
|
|
1127
|
+
key: 1,
|
|
1128
|
+
id: popoverDescriptionId,
|
|
1129
|
+
ref_key: "descriptionRef",
|
|
1130
|
+
ref: descriptionRef,
|
|
1131
|
+
class: `${unref(prefixCls)}-popover-description`
|
|
1132
|
+
}, resolvedPopover.value.descriptionProps), [renderSlot(_ctx.$slots, "description", {
|
|
1133
|
+
step: activeStep.value,
|
|
1134
|
+
current: activeIndex.value,
|
|
1135
|
+
description: resolvedPopover.value.description,
|
|
1136
|
+
controller: controllerRef.value,
|
|
1137
|
+
state: tourState.value
|
|
1138
|
+
}, () => [createTextVNode(toDisplayString(resolvedPopover.value.description), 1)])], 16)) : createCommentVNode("", true)], 16),
|
|
1139
|
+
showFooter.value ? (openBlock(), createElementBlock("footer", mergeProps({
|
|
1140
|
+
key: 1,
|
|
1141
|
+
ref_key: "footerRef",
|
|
1142
|
+
ref: footerRef,
|
|
1143
|
+
class: `${unref(prefixCls)}-popover-footer`
|
|
1144
|
+
}, resolvedPopover.value.footerProps), [createElementVNode("div", {
|
|
1145
|
+
ref_key: "progressRef",
|
|
1146
|
+
ref: progressRef,
|
|
1147
|
+
class: normalizeClass(`${unref(prefixCls)}-popover-progress-text`),
|
|
1148
|
+
style: normalizeStyle(progressVisibilityStyle.value)
|
|
1149
|
+
}, [renderSlot(_ctx.$slots, "progress", {
|
|
1150
|
+
step: activeStep.value,
|
|
1151
|
+
current: displayCurrent.value,
|
|
1152
|
+
total: displayTotal.value,
|
|
1153
|
+
text: progressText.value,
|
|
1154
|
+
controller: controllerRef.value,
|
|
1155
|
+
state: tourState.value
|
|
1156
|
+
}, () => [createTextVNode(toDisplayString(progressText.value), 1)])], 6), createElementVNode("div", {
|
|
1157
|
+
ref_key: "footerButtonsRef",
|
|
1158
|
+
ref: footerButtonsRef,
|
|
1159
|
+
class: normalizeClass(`${unref(prefixCls)}-popover-navigation-btns`)
|
|
1160
|
+
}, [renderSlot(_ctx.$slots, "footer", {
|
|
1161
|
+
step: activeStep.value,
|
|
1162
|
+
current: activeIndex.value,
|
|
1163
|
+
isFirst: isFirstStep.value,
|
|
1164
|
+
isLast: isLastStep.value,
|
|
1165
|
+
moveNext,
|
|
1166
|
+
movePrevious,
|
|
1167
|
+
close: closeTour,
|
|
1168
|
+
controller: controllerRef.value,
|
|
1169
|
+
state: tourState.value
|
|
1170
|
+
}, () => [showPreviousButton.value ? (openBlock(), createBlock(unref(Button), mergeProps({
|
|
1171
|
+
key: 0,
|
|
1172
|
+
ref_key: "previousButtonVmRef",
|
|
1173
|
+
ref: previousButtonVmRef
|
|
1174
|
+
}, previousButtonProps.value, {
|
|
1175
|
+
class: `${unref(prefixCls)}-popover-prev-btn`,
|
|
1176
|
+
disabled: isButtonDisabled("previous"),
|
|
1177
|
+
onClick: handlePreviousButtonClick
|
|
1178
|
+
}), {
|
|
1179
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "previous-button", {
|
|
1180
|
+
step: activeStep.value,
|
|
1181
|
+
current: activeIndex.value,
|
|
1182
|
+
text: previousButtonText.value,
|
|
1183
|
+
controller: controllerRef.value,
|
|
1184
|
+
state: tourState.value
|
|
1185
|
+
}, () => [createTextVNode(toDisplayString(previousButtonText.value), 1)])]),
|
|
1186
|
+
_: 3
|
|
1187
|
+
}, 16, ["class", "disabled"])) : createCommentVNode("", true), showNextButton.value ? (openBlock(), createBlock(unref(Button), mergeProps({
|
|
1188
|
+
key: 1,
|
|
1189
|
+
ref_key: "nextButtonVmRef",
|
|
1190
|
+
ref: nextButtonVmRef
|
|
1191
|
+
}, nextButtonProps.value, {
|
|
1192
|
+
class: `${unref(prefixCls)}-popover-next-btn`,
|
|
1193
|
+
disabled: isButtonDisabled("next"),
|
|
1194
|
+
onClick: handleNextButtonClick
|
|
1195
|
+
}), {
|
|
1196
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "next-button", {
|
|
1197
|
+
step: activeStep.value,
|
|
1198
|
+
current: activeIndex.value,
|
|
1199
|
+
isLast: isLastStep.value,
|
|
1200
|
+
text: nextButtonText.value,
|
|
1201
|
+
controller: controllerRef.value,
|
|
1202
|
+
state: tourState.value
|
|
1203
|
+
}, () => [createTextVNode(toDisplayString(nextButtonText.value), 1)])]),
|
|
1204
|
+
_: 3
|
|
1205
|
+
}, 16, ["class", "disabled"])) : createCommentVNode("", true)])], 2)], 16)) : createCommentVNode("", true)
|
|
1206
|
+
]),
|
|
1207
|
+
_: 3
|
|
1208
|
+
}, 8, [
|
|
1209
|
+
"class",
|
|
1210
|
+
"style",
|
|
1211
|
+
"initial",
|
|
1212
|
+
"animate",
|
|
1213
|
+
"transition"
|
|
1214
|
+
])], 4)], 64)) : createCommentVNode("", true)]))], 64);
|
|
1215
|
+
};
|
|
1216
|
+
}
|
|
1217
|
+
}));
|
|
1218
|
+
//#endregion
|
|
1219
|
+
export { tour_vue_vue_type_script_setup_true_lang_default as default };
|