@privyid/persona 1.2.1 → 1.2.2-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/accordion/Accordion.vue +111 -0
- package/dist/components/accordion/Accordion.vue.d.ts +80 -0
- package/dist/components/accordion/AccordionItem.vue +224 -0
- package/dist/components/accordion/AccordionItem.vue.d.ts +121 -0
- package/dist/components/accordion/AccordionItems.vue +50 -0
- package/dist/components/accordion/AccordionItems.vue.d.ts +41 -0
- package/dist/components/accordion/index.d.ts +7 -0
- package/dist/components/accordion/index.mjs +3 -0
- package/dist/components/aspect-ratio/index.d.ts +3 -0
- package/dist/components/aspect-ratio/index.mjs +21 -0
- package/dist/components/aspect-ratio/utils/calculate-ratio.d.ts +7 -0
- package/dist/components/aspect-ratio/utils/calculate-ratio.mjs +10 -0
- package/dist/components/aspect-ratio/utils/resize-observer.d.ts +1 -0
- package/dist/components/aspect-ratio/utils/resize-observer.mjs +22 -0
- package/dist/components/avatar/Avatar.vue +167 -0
- package/dist/components/avatar/Avatar.vue.d.ts +91 -0
- package/dist/components/avatar/AvatarGroup.vue +39 -0
- package/dist/components/avatar/AvatarGroup.vue.d.ts +40 -0
- package/dist/components/avatar/AvatarTruncate.vue +33 -0
- package/dist/components/avatar/AvatarTruncate.vue.d.ts +31 -0
- package/dist/components/avatar/assets/avatar-old.png +0 -0
- package/dist/components/avatar/assets/avatar.png +0 -0
- package/dist/components/avatar/index.d.ts +2 -0
- package/dist/components/avatar/index.mjs +0 -0
- package/dist/components/avatar/utils/color-hash.d.ts +2 -0
- package/dist/components/avatar/utils/color-hash.mjs +22 -0
- package/dist/components/avatar/utils/create-image.d.ts +5 -0
- package/dist/components/avatar/utils/create-image.mjs +19 -0
- package/dist/components/avatar/utils/load-image.d.ts +1 -0
- package/dist/components/avatar/utils/load-image.mjs +22 -0
- package/dist/components/badge/Badge.vue +210 -0
- package/dist/components/badge/Badge.vue.d.ts +41 -0
- package/dist/components/badge/index.d.ts +1 -0
- package/dist/components/badge/index.mjs +0 -0
- package/dist/components/banner/Banner.vue +183 -0
- package/dist/components/banner/Banner.vue.d.ts +91 -0
- package/dist/components/banner/index.d.ts +1 -0
- package/dist/components/banner/index.mjs +0 -0
- package/dist/components/breadcrumbs/Breadcrumb.vue +55 -0
- package/dist/components/breadcrumbs/Breadcrumb.vue.d.ts +59 -0
- package/dist/components/breadcrumbs/BreadcrumbItem.vue +83 -0
- package/dist/components/breadcrumbs/BreadcrumbItem.vue.d.ts +40 -0
- package/dist/components/breadcrumbs/BreadcrumbItemDropdown.vue +73 -0
- package/dist/components/breadcrumbs/BreadcrumbItemDropdown.vue.d.ts +38 -0
- package/dist/components/breadcrumbs/index.d.ts +11 -0
- package/dist/components/breadcrumbs/index.mjs +3 -0
- package/dist/components/button/Button.vue +391 -0
- package/dist/components/button/Button.vue.d.ts +108 -0
- package/dist/components/button/index.d.ts +5 -0
- package/dist/components/button/index.mjs +0 -0
- package/dist/components/button-group/ButtonGroup.vue +211 -0
- package/dist/components/button-group/ButtonGroup.vue.d.ts +40 -0
- package/dist/components/button-group/index.d.ts +6 -0
- package/dist/components/button-group/index.mjs +1 -0
- package/dist/components/calendar/Calendar.vue +396 -0
- package/dist/components/calendar/Calendar.vue.d.ts +120 -0
- package/dist/components/calendar/adapter/adapter.d.ts +32 -0
- package/dist/components/calendar/adapter/adapter.mjs +43 -0
- package/dist/components/calendar/adapter/date.d.ts +2 -0
- package/dist/components/calendar/adapter/date.mjs +86 -0
- package/dist/components/calendar/adapter/month.d.ts +2 -0
- package/dist/components/calendar/adapter/month.mjs +66 -0
- package/dist/components/calendar/adapter/year.d.ts +2 -0
- package/dist/components/calendar/adapter/year.mjs +63 -0
- package/dist/components/camera/Camera.vue +356 -0
- package/dist/components/camera/Camera.vue.d.ts +123 -0
- package/dist/components/camera/adapter/adapter.d.ts +41 -0
- package/dist/components/camera/adapter/adapter.mjs +3 -0
- package/dist/components/camera/adapter/capture.d.ts +5 -0
- package/dist/components/camera/adapter/capture.mjs +12 -0
- package/dist/components/camera/adapter/liveness.d.ts +5 -0
- package/dist/components/camera/adapter/liveness.mjs +46 -0
- package/dist/components/camera/adapter/qr-code.d.ts +2 -0
- package/dist/components/camera/adapter/qr-code.mjs +19 -0
- package/dist/components/camera/assets/shutter.wav +0 -0
- package/dist/components/camera/utils/motion.d.ts +29 -0
- package/dist/components/camera/utils/motion.mjs +88 -0
- package/dist/components/camera/utils/take-picture.d.ts +1 -0
- package/dist/components/camera/utils/take-picture.mjs +14 -0
- package/dist/components/caption/Caption.vue +112 -0
- package/dist/components/caption/Caption.vue.d.ts +50 -0
- package/dist/components/caption/index.d.ts +1 -0
- package/dist/components/caption/index.mjs +0 -0
- package/dist/components/card/Card.vue +330 -0
- package/dist/components/card/Card.vue.d.ts +118 -0
- package/dist/components/card/CardSection.vue +69 -0
- package/dist/components/card/CardSection.vue.d.ts +56 -0
- package/dist/components/card/index.d.ts +2 -0
- package/dist/components/card/index.mjs +0 -0
- package/dist/components/carousel/Carousel.vue +177 -0
- package/dist/components/carousel/Carousel.vue.d.ts +123 -0
- package/dist/components/carousel/CarouselBody.vue +16 -0
- package/dist/components/carousel/CarouselBody.vue.d.ts +17 -0
- package/dist/components/carousel/CarouselItem.vue +10 -0
- package/dist/components/carousel/CarouselItem.vue.d.ts +17 -0
- package/dist/components/carousel/index.d.ts +4 -0
- package/dist/components/carousel/index.mjs +1 -0
- package/dist/components/chart/Chart.vue +129 -0
- package/dist/components/chart/Chart.vue.d.ts +63 -0
- package/dist/components/chart/ChartSet.vue +28 -0
- package/dist/components/chart/ChartSet.vue.d.ts +57 -0
- package/dist/components/chart/ChartVal.vue +32 -0
- package/dist/components/chart/ChartVal.vue.d.ts +67 -0
- package/dist/components/chart/adapter/adapter.d.ts +7 -0
- package/dist/components/chart/adapter/adapter.mjs +3 -0
- package/dist/components/chart/adapter/bubble.d.ts +2 -0
- package/dist/components/chart/adapter/bubble.mjs +26 -0
- package/dist/components/chart/adapter/index.d.ts +3 -0
- package/dist/components/chart/adapter/index.mjs +16 -0
- package/dist/components/chart/adapter/line.d.ts +2 -0
- package/dist/components/chart/adapter/line.mjs +66 -0
- package/dist/components/chart/adapter/pie.d.ts +2 -0
- package/dist/components/chart/adapter/pie.mjs +34 -0
- package/dist/components/chart/index.d.ts +2 -0
- package/dist/components/chart/index.mjs +0 -0
- package/dist/components/chart/utils/use-chart.d.ts +2 -0
- package/dist/components/chart/utils/use-chart.mjs +9 -0
- package/dist/components/checkbox/Checkbox.vue +213 -0
- package/dist/components/checkbox/Checkbox.vue.d.ts +105 -0
- package/dist/components/checkbox/icon/IconCheckbox.vue +13 -0
- package/dist/components/checkbox/icon/IconCheckbox.vue.d.ts +2 -0
- package/dist/components/checkbox/icon/IconInderteminate.vue +12 -0
- package/dist/components/checkbox/icon/IconInderteminate.vue.d.ts +2 -0
- package/dist/components/checkbox/index.d.ts +7 -0
- package/dist/components/checkbox/index.mjs +34 -0
- package/dist/components/collapse/Collapse.vue +58 -0
- package/dist/components/collapse/Collapse.vue.d.ts +42 -0
- package/dist/components/contextual-bar/ContextualBar.vue +433 -0
- package/dist/components/contextual-bar/ContextualBar.vue.d.ts +124 -0
- package/dist/components/contextual-bar/index.d.ts +1 -0
- package/dist/components/contextual-bar/index.mjs +0 -0
- package/dist/components/cropper/Cropper.vue +382 -0
- package/dist/components/cropper/Cropper.vue.d.ts +195 -0
- package/dist/components/cropper/index.d.ts +1 -0
- package/dist/components/cropper/index.mjs +3 -0
- package/dist/components/cropper/utils/crop-image.d.ts +44 -0
- package/dist/components/cropper/utils/crop-image.mjs +43 -0
- package/dist/components/cropper/utils/use-pinch.d.ts +8 -0
- package/dist/components/cropper/utils/use-pinch.mjs +50 -0
- package/dist/components/cropper/utils/use-preview.d.ts +3 -0
- package/dist/components/cropper/utils/use-preview.mjs +21 -0
- package/dist/components/cropper/utils/use-ratio.d.ts +9 -0
- package/dist/components/cropper/utils/use-ratio.mjs +24 -0
- package/dist/components/datepicker/Datepicker.vue +204 -0
- package/dist/components/datepicker/Datepicker.vue.d.ts +181 -0
- package/dist/components/dialog/Dialog.vue +130 -0
- package/dist/components/dialog/Dialog.vue.d.ts +8 -0
- package/dist/components/dialog/DialogFooter.vue +121 -0
- package/dist/components/dialog/DialogFooter.vue.d.ts +132 -0
- package/dist/components/dialog/index.d.ts +52 -0
- package/dist/components/dialog/index.mjs +86 -0
- package/dist/components/divider/Divider.vue +61 -0
- package/dist/components/divider/Divider.vue.d.ts +14 -0
- package/dist/components/dot/Dot.vue +95 -0
- package/dist/components/dot/Dot.vue.d.ts +26 -0
- package/dist/components/dot/index.d.ts +1 -0
- package/dist/components/dot/index.mjs +0 -0
- package/dist/components/dropdown/Dropdown.vue +381 -0
- package/dist/components/dropdown/Dropdown.vue.d.ts +301 -0
- package/dist/components/dropdown/DropdownHeader.vue +33 -0
- package/dist/components/dropdown/DropdownHeader.vue.d.ts +18 -0
- package/dist/components/dropdown/DropdownItem.vue +87 -0
- package/dist/components/dropdown/DropdownItem.vue.d.ts +62 -0
- package/dist/components/dropdown/DropdownText.vue +34 -0
- package/dist/components/dropdown/DropdownText.vue.d.ts +17 -0
- package/dist/components/dropdown/index.d.ts +10 -0
- package/dist/components/dropdown/index.mjs +1 -0
- package/dist/components/dropdown/utils/use-focus.d.ts +5 -0
- package/dist/components/dropdown/utils/use-focus.mjs +22 -0
- package/dist/components/dropdown-subitem/DropdownSubitem.vue +153 -0
- package/dist/components/dropdown-subitem/DropdownSubitem.vue.d.ts +58 -0
- package/dist/components/dropdown-subitem/index.d.ts +12 -0
- package/dist/components/dropdown-subitem/index.mjs +1 -0
- package/dist/components/dropzone/Dropzone.vue +205 -0
- package/dist/components/dropzone/Dropzone.vue.d.ts +139 -0
- package/dist/components/dropzone/index.d.ts +4 -0
- package/dist/components/dropzone/index.mjs +0 -0
- package/dist/components/dropzone/utils/accept.d.ts +1 -0
- package/dist/components/dropzone/utils/accept.mjs +17 -0
- package/dist/components/filterbar/Filterbar.vue +103 -0
- package/dist/components/filterbar/Filterbar.vue.d.ts +2495 -0
- package/dist/components/filterbar/index.d.ts +45 -0
- package/dist/components/filterbar/index.mjs +7 -0
- package/dist/components/filterbar/pinned/PinnedDate.vue +100 -0
- package/dist/components/filterbar/pinned/PinnedDate.vue.d.ts +508 -0
- package/dist/components/filterbar/pinned/PinnedMultiselect.vue +113 -0
- package/dist/components/filterbar/pinned/PinnedMultiselect.vue.d.ts +675 -0
- package/dist/components/filterbar/pinned/PinnedSelect.vue +100 -0
- package/dist/components/filterbar/pinned/PinnedSelect.vue.d.ts +607 -0
- package/dist/components/filterbar/pinned/PinnedToggle.vue +77 -0
- package/dist/components/filterbar/pinned/PinnedToggle.vue.d.ts +220 -0
- package/dist/components/form-group/FormGroup.vue +155 -0
- package/dist/components/form-group/FormGroup.vue.d.ts +105 -0
- package/dist/components/global/router.d.ts +24 -0
- package/dist/components/global/router.mjs +7 -0
- package/dist/components/global/store.d.ts +49 -0
- package/dist/components/global/store.mjs +52 -0
- package/dist/components/global/types.d.ts +4 -0
- package/dist/components/global/types.mjs +0 -0
- package/dist/components/global/use-singleton.d.ts +21 -0
- package/dist/components/global/use-singleton.mjs +60 -0
- package/dist/components/global/utils/queue.d.ts +16 -0
- package/dist/components/global/utils/queue.mjs +35 -0
- package/dist/components/heading/Heading.vue +128 -0
- package/dist/components/heading/Heading.vue.d.ts +49 -0
- package/dist/components/heading/index.d.ts +3 -0
- package/dist/components/heading/index.mjs +0 -0
- package/dist/components/input/Input.vue +215 -0
- package/dist/components/input/Input.vue.d.ts +111 -0
- package/dist/components/input/index.d.ts +6 -0
- package/dist/components/input/index.mjs +25 -0
- package/dist/components/input/utils/accept.d.ts +26 -0
- package/dist/components/input/utils/accept.mjs +81 -0
- package/dist/components/input-color/index.d.ts +1 -0
- package/dist/components/input-color/index.mjs +0 -0
- package/dist/components/input-color/inputColor.vue +245 -0
- package/dist/components/input-color/inputColor.vue.d.ts +88 -0
- package/dist/components/input-file/InputFile.vue +195 -0
- package/dist/components/input-file/InputFile.vue.d.ts +755 -0
- package/dist/components/input-group/InputGroup.vue +177 -0
- package/dist/components/input-group/InputGroup.vue.d.ts +58 -0
- package/dist/components/input-group/InputGroupAddon.vue +42 -0
- package/dist/components/input-group/InputGroupAddon.vue.d.ts +17 -0
- package/dist/components/input-group/index.d.ts +6 -0
- package/dist/components/input-group/index.mjs +1 -0
- package/dist/components/input-password/InputPassword.vue +100 -0
- package/dist/components/input-password/InputPassword.vue.d.ts +86 -0
- package/dist/components/input-password/index.d.ts +2 -0
- package/dist/components/input-password/index.mjs +17 -0
- package/dist/components/input-pin/InputPin.vue +142 -0
- package/dist/components/input-pin/InputPin.vue.d.ts +77 -0
- package/dist/components/input-pin/index.d.ts +6 -0
- package/dist/components/input-pin/index.mjs +3 -0
- package/dist/components/input-range/InputRange.vue +253 -0
- package/dist/components/input-range/InputRange.vue.d.ts +106 -0
- package/dist/components/input-range/utils/use-drag.d.ts +3 -0
- package/dist/components/input-range/utils/use-drag.mjs +26 -0
- package/dist/components/label/Label.vue +249 -0
- package/dist/components/label/Label.vue.d.ts +63 -0
- package/dist/components/label/index.d.ts +1 -0
- package/dist/components/label/index.mjs +0 -0
- package/dist/components/list-group/ListGroup.vue +73 -0
- package/dist/components/list-group/ListGroup.vue.d.ts +56 -0
- package/dist/components/list-group/ListGroupItem.vue +79 -0
- package/dist/components/list-group/ListGroupItem.vue.d.ts +49 -0
- package/dist/components/list-group/index.d.ts +1 -0
- package/dist/components/list-group/index.mjs +0 -0
- package/dist/components/main/Main.vue +66 -0
- package/dist/components/main/Main.vue.d.ts +17 -0
- package/dist/components/markdown/index.d.ts +29 -0
- package/dist/components/markdown/index.mjs +25 -0
- package/dist/components/meta.json +171 -0
- package/dist/components/modal/Modal.vue +514 -0
- package/dist/components/modal/Modal.vue.d.ts +196 -0
- package/dist/components/modal/index.d.ts +1 -0
- package/dist/components/modal/index.mjs +0 -0
- package/dist/components/nav/Nav.vue +403 -0
- package/dist/components/nav/Nav.vue.d.ts +104 -0
- package/dist/components/nav/NavCollapse.vue +60 -0
- package/dist/components/nav/NavCollapse.vue.d.ts +164 -0
- package/dist/components/nav/NavForm.vue +23 -0
- package/dist/components/nav/NavForm.vue.d.ts +17 -0
- package/dist/components/nav/NavItem.vue +165 -0
- package/dist/components/nav/NavItem.vue.d.ts +80 -0
- package/dist/components/nav/NavItemDropdown.vue +104 -0
- package/dist/components/nav/NavItemDropdown.vue.d.ts +122 -0
- package/dist/components/nav/NavSubItem.vue +178 -0
- package/dist/components/nav/NavSubItem.vue.d.ts +45 -0
- package/dist/components/nav/NavText.vue +19 -0
- package/dist/components/nav/NavText.vue.d.ts +17 -0
- package/dist/components/nav/index.d.ts +2 -0
- package/dist/components/nav/index.mjs +0 -0
- package/dist/components/navbar/Navbar.vue +270 -0
- package/dist/components/navbar/Navbar.vue.d.ts +70 -0
- package/dist/components/navbar/NavbarBrand.vue +30 -0
- package/dist/components/navbar/NavbarBrand.vue.d.ts +29 -0
- package/dist/components/navbar/NavbarNav.vue +110 -0
- package/dist/components/navbar/NavbarNav.vue.d.ts +31 -0
- package/dist/components/navbar/NavbarToggle.vue +67 -0
- package/dist/components/navbar/NavbarToggle.vue.d.ts +19 -0
- package/dist/components/navbar/index.d.ts +9 -0
- package/dist/components/navbar/index.mjs +1 -0
- package/dist/components/navbar-menu/NavbarNavMenu.vue +56 -0
- package/dist/components/navbar-menu/NavbarNavMenu.vue.d.ts +16 -0
- package/dist/components/notify/Notify.vue +36 -0
- package/dist/components/notify/Notify.vue.d.ts +6 -0
- package/dist/components/notify/NotifyGroup.vue +214 -0
- package/dist/components/notify/NotifyGroup.vue.d.ts +34 -0
- package/dist/components/notify/NotifyItem.vue +33 -0
- package/dist/components/notify/NotifyItem.vue.d.ts +22 -0
- package/dist/components/notify/index.d.ts +20 -0
- package/dist/components/notify/index.mjs +18 -0
- package/dist/components/overlay/Overlay.vue +63 -0
- package/dist/components/overlay/Overlay.vue.d.ts +19 -0
- package/dist/components/overlay/assets/icon-white.svg +1 -0
- package/dist/components/overlay/index.d.ts +2 -0
- package/dist/components/overlay/index.mjs +8 -0
- package/dist/components/overlay/utils/use-loading.d.ts +4 -0
- package/dist/components/overlay/utils/use-loading.mjs +28 -0
- package/dist/components/page/Page.vue +93 -0
- package/dist/components/page/Page.vue.d.ts +54 -0
- package/dist/components/pagination/Pagination.vue +373 -0
- package/dist/components/pagination/Pagination.vue.d.ts +261 -0
- package/dist/components/pagination/index.d.ts +14 -0
- package/dist/components/pagination/index.mjs +38 -0
- package/dist/components/pagination/utils/calculate-page.d.ts +11 -0
- package/dist/components/pagination/utils/calculate-page.mjs +48 -0
- package/dist/components/pdf-helipad/PdfHelipad.vue +129 -0
- package/dist/components/pdf-helipad/PdfHelipad.vue.d.ts +68 -0
- package/dist/components/pdf-helipad/index.d.ts +7 -0
- package/dist/components/pdf-helipad/index.mjs +0 -0
- package/dist/components/pdf-helipad/utils/use-drag.d.ts +3 -0
- package/dist/components/pdf-helipad/utils/use-drag.mjs +38 -0
- package/dist/components/pdf-object/PdfObject.vue +304 -0
- package/dist/components/pdf-object/PdfObject.vue.d.ts +151 -0
- package/dist/components/pdf-object/PdfObjectAddon.vue +49 -0
- package/dist/components/pdf-object/PdfObjectAddon.vue.d.ts +31 -0
- package/dist/components/pdf-object/PdfObjectDebugger.vue +66 -0
- package/dist/components/pdf-object/PdfObjectDebugger.vue.d.ts +2 -0
- package/dist/components/pdf-object/PdfObjects.vue +35 -0
- package/dist/components/pdf-object/PdfObjects.vue.d.ts +31 -0
- package/dist/components/pdf-object/index.d.ts +63 -0
- package/dist/components/pdf-object/index.mjs +110 -0
- package/dist/components/pdf-object/utils/overlap.d.ts +51 -0
- package/dist/components/pdf-object/utils/overlap.mjs +54 -0
- package/dist/components/pdf-object/utils/position.d.ts +64 -0
- package/dist/components/pdf-object/utils/position.mjs +48 -0
- package/dist/components/pdf-object/utils/use-drag.d.ts +9 -0
- package/dist/components/pdf-object/utils/use-drag.mjs +69 -0
- package/dist/components/pdf-object/utils/use-drop.d.ts +7 -0
- package/dist/components/pdf-object/utils/use-drop.mjs +57 -0
- package/dist/components/pdf-object/utils/use-resize.d.ts +17 -0
- package/dist/components/pdf-object/utils/use-resize.mjs +90 -0
- package/dist/components/pdf-object/utils/use-selector.d.ts +4 -0
- package/dist/components/pdf-object/utils/use-selector.mjs +26 -0
- package/dist/components/pdf-text/PdfText.vue +125 -0
- package/dist/components/pdf-text/PdfText.vue.d.ts +170 -0
- package/dist/components/pdf-text/utils/text-to-image.d.ts +68 -0
- package/dist/components/pdf-text/utils/text-to-image.mjs +120 -0
- package/dist/components/pdf-viewer/PdfError.vue +70 -0
- package/dist/components/pdf-viewer/PdfError.vue.d.ts +24 -0
- package/dist/components/pdf-viewer/PdfLoading.vue +24 -0
- package/dist/components/pdf-viewer/PdfLoading.vue.d.ts +2 -0
- package/dist/components/pdf-viewer/PdfNavigation.vue +165 -0
- package/dist/components/pdf-viewer/PdfNavigation.vue.d.ts +49 -0
- package/dist/components/pdf-viewer/PdfViewer.vue +319 -0
- package/dist/components/pdf-viewer/PdfViewer.vue.d.ts +187 -0
- package/dist/components/pdf-viewer/assets/pdf-loading.svg +1 -0
- package/dist/components/pdf-viewer/index.d.ts +25 -0
- package/dist/components/pdf-viewer/index.mjs +24 -0
- package/dist/components/pdf-viewer/utils/pdfjs.d.ts +69 -0
- package/dist/components/pdf-viewer/utils/pdfjs.mjs +57 -0
- package/dist/components/pdf-viewer/utils/use-idle.d.ts +2 -0
- package/dist/components/pdf-viewer/utils/use-idle.mjs +25 -0
- package/dist/components/pdf-viewer/utils/use-sticky.d.ts +6 -0
- package/dist/components/pdf-viewer/utils/use-sticky.mjs +49 -0
- package/dist/components/pdf-viewer/utils/use-viewer.d.ts +27 -0
- package/dist/components/pdf-viewer/utils/use-viewer.mjs +193 -0
- package/dist/components/popover/Popover.vue +109 -0
- package/dist/components/popover/Popover.vue.d.ts +209 -0
- package/dist/components/popover/index.d.ts +17 -0
- package/dist/components/popover/index.mjs +52 -0
- package/dist/components/popup/Popup.vue +412 -0
- package/dist/components/popup/Popup.vue.d.ts +112 -0
- package/dist/components/popup/index.d.ts +39 -0
- package/dist/components/popup/index.mjs +31 -0
- package/dist/components/progress/Progress.vue +198 -0
- package/dist/components/progress/Progress.vue.d.ts +53 -0
- package/dist/components/progress/ProgressItem.vue +46 -0
- package/dist/components/progress/ProgressItem.vue.d.ts +43 -0
- package/dist/components/progress/index.d.ts +2 -0
- package/dist/components/progress/index.mjs +0 -0
- package/dist/components/progress-indicator/ProgressIndicator.vue +114 -0
- package/dist/components/progress-indicator/ProgressIndicator.vue.d.ts +40 -0
- package/dist/components/progressbar/Progressbar.vue +105 -0
- package/dist/components/progressbar/Progressbar.vue.d.ts +59 -0
- package/dist/components/progressbar/index.d.ts +7 -0
- package/dist/components/progressbar/index.mjs +11 -0
- package/dist/components/pspdfkit/PspdfHelipad.vue +142 -0
- package/dist/components/pspdfkit/PspdfHelipad.vue.d.ts +68 -0
- package/dist/components/pspdfkit/PspdfObject.vue +291 -0
- package/dist/components/pspdfkit/PspdfObject.vue.d.ts +151 -0
- package/dist/components/pspdfkit/PspdfObjectAddon.vue +24 -0
- package/dist/components/pspdfkit/PspdfObjectAddon.vue.d.ts +31 -0
- package/dist/components/pspdfkit/PspdfObjects.vue +27 -0
- package/dist/components/pspdfkit/PspdfObjects.vue.d.ts +19 -0
- package/dist/components/pspdfkit/PspdfViewer.vue +223 -0
- package/dist/components/pspdfkit/PspdfViewer.vue.d.ts +142 -0
- package/dist/components/pspdfkit/css/custom.css +1 -0
- package/dist/components/pspdfkit/index.d.ts +8 -0
- package/dist/components/pspdfkit/index.mjs +7 -0
- package/dist/components/pspdfkit/utils/position.d.ts +1 -0
- package/dist/components/pspdfkit/utils/position.mjs +5 -0
- package/dist/components/pspdfkit/utils/pspdfkit.d.ts +17 -0
- package/dist/components/pspdfkit/utils/pspdfkit.mjs +53 -0
- package/dist/components/pspdfkit/utils/use-drop.d.ts +2 -0
- package/dist/components/pspdfkit/utils/use-drop.mjs +41 -0
- package/dist/components/pspdfkit/utils/use-viewer.d.ts +17 -0
- package/dist/components/pspdfkit/utils/use-viewer.mjs +167 -0
- package/dist/components/qrcode/Qrcode.vue +150 -0
- package/dist/components/qrcode/Qrcode.vue.d.ts +145 -0
- package/dist/components/qrcode/index.d.ts +1 -0
- package/dist/components/qrcode/index.mjs +0 -0
- package/dist/components/radio/Radio.vue +285 -0
- package/dist/components/radio/Radio.vue.d.ts +97 -0
- package/dist/components/radio/index.d.ts +7 -0
- package/dist/components/radio/index.mjs +16 -0
- package/dist/components/richtext/Richtext.vue +271 -0
- package/dist/components/richtext/Richtext.vue.d.ts +78 -0
- package/dist/components/richtext/RichtextToolbarAdvance.vue +37 -0
- package/dist/components/richtext/RichtextToolbarAdvance.vue.d.ts +2 -0
- package/dist/components/richtext/RichtextToolbarSimple.vue +146 -0
- package/dist/components/richtext/RichtextToolbarSimple.vue.d.ts +2 -0
- package/dist/components/richtext/control/RichtextControlFontFamily.vue +52 -0
- package/dist/components/richtext/control/RichtextControlFontFamily.vue.d.ts +2 -0
- package/dist/components/richtext/control/RichtextControlFontSize.vue +74 -0
- package/dist/components/richtext/control/RichtextControlFontSize.vue.d.ts +2 -0
- package/dist/components/richtext/control/RichtextControlHighlight.vue +127 -0
- package/dist/components/richtext/control/RichtextControlHighlight.vue.d.ts +2 -0
- package/dist/components/richtext/control/RichtextControlHistory.vue +26 -0
- package/dist/components/richtext/control/RichtextControlHistory.vue.d.ts +2 -0
- package/dist/components/richtext/control/RichtextControlImage.vue +32 -0
- package/dist/components/richtext/control/RichtextControlImage.vue.d.ts +2 -0
- package/dist/components/richtext/control/RichtextControlLink.vue +44 -0
- package/dist/components/richtext/control/RichtextControlLink.vue.d.ts +2 -0
- package/dist/components/richtext/control/RichtextControlList.vue +43 -0
- package/dist/components/richtext/control/RichtextControlList.vue.d.ts +2 -0
- package/dist/components/richtext/control/RichtextControlTable.vue +90 -0
- package/dist/components/richtext/control/RichtextControlTable.vue.d.ts +2 -0
- package/dist/components/richtext/control/RichtextControlTextAlign.vue +78 -0
- package/dist/components/richtext/control/RichtextControlTextAlign.vue.d.ts +2 -0
- package/dist/components/richtext/control/RichtextControlTextFormat.vue +48 -0
- package/dist/components/richtext/control/RichtextControlTextFormat.vue.d.ts +2 -0
- package/dist/components/richtext/control/RichtextControlTextHeading.vue +93 -0
- package/dist/components/richtext/control/RichtextControlTextHeading.vue.d.ts +2 -0
- package/dist/components/richtext/index.d.ts +7 -0
- package/dist/components/richtext/index.mjs +7 -0
- package/dist/components/richtext/popup/RichtextPopupImageEdit.vue +64 -0
- package/dist/components/richtext/popup/RichtextPopupImageEdit.vue.d.ts +2 -0
- package/dist/components/richtext/popup/RichtextPopupLinkDetail.vue +79 -0
- package/dist/components/richtext/popup/RichtextPopupLinkDetail.vue.d.ts +2 -0
- package/dist/components/richtext/popup/RichtextPopupLinkEdit.vue +64 -0
- package/dist/components/richtext/popup/RichtextPopupLinkEdit.vue.d.ts +22 -0
- package/dist/components/richtext/tiptap/image-align.d.ts +43 -0
- package/dist/components/richtext/tiptap/image-align.mjs +60 -0
- package/dist/components/ringbar/Ringbar.vue +148 -0
- package/dist/components/ringbar/Ringbar.vue.d.ts +62 -0
- package/dist/components/ringbar/index.d.ts +1 -0
- package/dist/components/ringbar/index.mjs +0 -0
- package/dist/components/select/Select.vue +499 -0
- package/dist/components/select/Select.vue.d.ts +753 -0
- package/dist/components/select/SelectInput.vue +101 -0
- package/dist/components/select/SelectInput.vue.d.ts +71 -0
- package/dist/components/select/SelectTags.vue +53 -0
- package/dist/components/select/SelectTags.vue.d.ts +34 -0
- package/dist/components/select/adapter/adapter.d.ts +17 -0
- package/dist/components/select/adapter/adapter.mjs +20 -0
- package/dist/components/select/adapter/async-adapter.d.ts +17 -0
- package/dist/components/select/adapter/async-adapter.mjs +61 -0
- package/dist/components/select/adapter/basic-adapter.d.ts +5 -0
- package/dist/components/select/adapter/basic-adapter.mjs +13 -0
- package/dist/components/select/adapter/fuzzy-adapter.d.ts +2 -0
- package/dist/components/select/adapter/fuzzy-adapter.mjs +24 -0
- package/dist/components/select/index.d.ts +15 -0
- package/dist/components/select/index.mjs +20 -0
- package/dist/components/select/utils/use-on-scroll.d.ts +2 -0
- package/dist/components/select/utils/use-on-scroll.mjs +9 -0
- package/dist/components/select/utils/use-on-typing.d.ts +3 -0
- package/dist/components/select/utils/use-on-typing.mjs +8 -0
- package/dist/components/sheet/Sheet.vue +210 -0
- package/dist/components/sheet/Sheet.vue.d.ts +79 -0
- package/dist/components/shimmer/Shimmer.vue +121 -0
- package/dist/components/shimmer/Shimmer.vue.d.ts +47 -0
- package/dist/components/shimmer/index.d.ts +2 -0
- package/dist/components/shimmer/index.mjs +10 -0
- package/dist/components/sidebar/Sidebar.vue +225 -0
- package/dist/components/sidebar/Sidebar.vue.d.ts +99 -0
- package/dist/components/sidebar/SidebarBrand.vue +101 -0
- package/dist/components/sidebar/SidebarBrand.vue.d.ts +52 -0
- package/dist/components/sidebar/SidebarContent.vue +21 -0
- package/dist/components/sidebar/SidebarContent.vue.d.ts +16 -0
- package/dist/components/sidebar/SidebarNav.vue +254 -0
- package/dist/components/sidebar/SidebarNav.vue.d.ts +77 -0
- package/dist/components/sidebar/index.d.ts +9 -0
- package/dist/components/sidebar/index.mjs +1 -0
- package/dist/components/sidebar-menu/SidebarMenu.vue +112 -0
- package/dist/components/sidebar-menu/SidebarMenu.vue.d.ts +112 -0
- package/dist/components/sidebar-menu/SidebarMenuItem.vue +67 -0
- package/dist/components/sidebar-menu/SidebarMenuItem.vue.d.ts +25 -0
- package/dist/components/sidebar-menu/index.d.ts +138 -0
- package/dist/components/sidebar-menu/index.mjs +44 -0
- package/dist/components/signature-draw/SignatureDraw.vue +91 -0
- package/dist/components/signature-draw/SignatureDraw.vue.d.ts +98 -0
- package/dist/components/signature-draw/SignatureDrawDesktop.vue +148 -0
- package/dist/components/signature-draw/SignatureDrawDesktop.vue.d.ts +76 -0
- package/dist/components/signature-draw/SignatureDrawMobile.vue +212 -0
- package/dist/components/signature-draw/SignatureDrawMobile.vue.d.ts +94 -0
- package/dist/components/signature-draw/utils/canvas.d.ts +41 -0
- package/dist/components/signature-draw/utils/canvas.mjs +55 -0
- package/dist/components/signature-draw/utils/image.d.ts +7 -0
- package/dist/components/signature-draw/utils/image.mjs +23 -0
- package/dist/components/signature-draw/utils/smooth-line.d.ts +36 -0
- package/dist/components/signature-draw/utils/smooth-line.mjs +56 -0
- package/dist/components/signature-draw/utils/straight-line.d.ts +8 -0
- package/dist/components/signature-draw/utils/straight-line.mjs +24 -0
- package/dist/components/signature-draw/utils/use-draw.d.ts +7 -0
- package/dist/components/signature-draw/utils/use-draw.mjs +29 -0
- package/dist/components/signature-text/SignatureText.vue +114 -0
- package/dist/components/signature-text/SignatureText.vue.d.ts +98 -0
- package/dist/components/signature-text/utils/formatter.d.ts +2 -0
- package/dist/components/signature-text/utils/formatter.mjs +8 -0
- package/dist/components/signature-text/utils/generate-text.d.ts +8 -0
- package/dist/components/signature-text/utils/generate-text.mjs +28 -0
- package/dist/components/signature-text/utils/load-font.d.ts +1 -0
- package/dist/components/signature-text/utils/load-font.mjs +22 -0
- package/dist/components/spinner/Spinner.vue +156 -0
- package/dist/components/spinner/Spinner.vue.d.ts +2 -0
- package/dist/components/spinner/SpinnerRing.vue +34 -0
- package/dist/components/spinner/SpinnerRing.vue.d.ts +2 -0
- package/dist/components/spinner/SpinnerRinggo.vue +61 -0
- package/dist/components/spinner/SpinnerRinggo.vue.d.ts +2 -0
- package/dist/components/spread/Spread.vue +52 -0
- package/dist/components/spread/Spread.vue.d.ts +29 -0
- package/dist/components/steps/Step.vue +42 -0
- package/dist/components/steps/Step.vue.d.ts +48 -0
- package/dist/components/steps/StepSlider.vue +37 -0
- package/dist/components/steps/StepSlider.vue.d.ts +34 -0
- package/dist/components/steps/Steps.vue +116 -0
- package/dist/components/steps/Steps.vue.d.ts +100 -0
- package/dist/components/steps/index.d.ts +30 -0
- package/dist/components/steps/index.mjs +53 -0
- package/dist/components/steps/utils/hook.d.ts +10 -0
- package/dist/components/steps/utils/hook.mjs +35 -0
- package/dist/components/strengthbar/Strengthbar.vue +90 -0
- package/dist/components/strengthbar/Strengthbar.vue.d.ts +41 -0
- package/dist/components/subheading/Subheading.vue +137 -0
- package/dist/components/subheading/Subheading.vue.d.ts +59 -0
- package/dist/components/subheading/index.d.ts +1 -0
- package/dist/components/subheading/index.mjs +0 -0
- package/dist/components/table/Table.vue +391 -0
- package/dist/components/table/Table.vue.d.ts +337 -0
- package/dist/components/table/index.d.ts +49 -0
- package/dist/components/table/index.mjs +37 -0
- package/dist/components/table-flex/TableFlex.vue +309 -0
- package/dist/components/table-flex/TableFlex.vue.d.ts +77 -0
- package/dist/components/table-static/TableStatic.vue +406 -0
- package/dist/components/table-static/TableStatic.vue.d.ts +90 -0
- package/dist/components/table-static/TableStaticRoot.vue +39 -0
- package/dist/components/table-static/TableStaticRoot.vue.d.ts +40 -0
- package/dist/components/table-static/TableStaticSort.vue +22 -0
- package/dist/components/table-static/TableStaticSort.vue.d.ts +14 -0
- package/dist/components/table-static/index.d.ts +64 -0
- package/dist/components/table-static/index.mjs +24 -0
- package/dist/components/tabs/Tab.vue +26 -0
- package/dist/components/tabs/Tab.vue.d.ts +45 -0
- package/dist/components/tabs/TabContent.vue +53 -0
- package/dist/components/tabs/TabContent.vue.d.ts +33 -0
- package/dist/components/tabs/Tabs.vue +209 -0
- package/dist/components/tabs/Tabs.vue.d.ts +96 -0
- package/dist/components/text/Text.vue +220 -0
- package/dist/components/text/Text.vue.d.ts +69 -0
- package/dist/components/text/index.d.ts +2 -0
- package/dist/components/text/index.mjs +0 -0
- package/dist/components/textarea/Textarea.vue +162 -0
- package/dist/components/textarea/Textarea.vue.d.ts +112 -0
- package/dist/components/time/Time.vue +222 -0
- package/dist/components/time/Time.vue.d.ts +104 -0
- package/dist/components/time/TimeItem.vue +96 -0
- package/dist/components/time/TimeItem.vue.d.ts +61 -0
- package/dist/components/time/index.d.ts +19 -0
- package/dist/components/time/index.mjs +53 -0
- package/dist/components/time/utils/index.d.ts +9 -0
- package/dist/components/time/utils/index.mjs +82 -0
- package/dist/components/timepicker/Timepicker.vue +204 -0
- package/dist/components/timepicker/Timepicker.vue.d.ts +182 -0
- package/dist/components/toast/Toast.vue +247 -0
- package/dist/components/toast/Toast.vue.d.ts +118 -0
- package/dist/components/toast/index.d.ts +50 -0
- package/dist/components/toast/index.mjs +44 -0
- package/dist/components/toggle/Toggle.vue +216 -0
- package/dist/components/toggle/Toggle.vue.d.ts +145 -0
- package/dist/components/tooltip/Tooltip.vue +154 -0
- package/dist/components/tooltip/Tooltip.vue.d.ts +68 -0
- package/dist/components/tooltip/TooltipContainer.vue +74 -0
- package/dist/components/tooltip/TooltipContainer.vue.d.ts +16 -0
- package/dist/components/tooltip/index.d.ts +17 -0
- package/dist/components/tooltip/index.mjs +113 -0
- package/dist/components/tooltip/utils/create-handler.d.ts +9 -0
- package/dist/components/tooltip/utils/create-handler.mjs +16 -0
- package/dist/components/tooltip/utils/on-hover.d.ts +23 -0
- package/dist/components/tooltip/utils/on-hover.mjs +42 -0
- package/dist/components/tooltip/utils/parse-bindings.d.ts +23 -0
- package/dist/components/tooltip/utils/parse-bindings.mjs +47 -0
- package/dist/components/tour/Tour.vue +99 -0
- package/dist/components/tour/Tour.vue.d.ts +9 -0
- package/dist/components/tour/TourDialog.vue +201 -0
- package/dist/components/tour/TourDialog.vue.d.ts +112 -0
- package/dist/components/tour/TourHighlight.vue +51 -0
- package/dist/components/tour/TourHighlight.vue.d.ts +15 -0
- package/dist/components/tour/core/base.d.ts +59 -0
- package/dist/components/tour/core/base.mjs +69 -0
- package/dist/components/tour/core/step/action.d.ts +15 -0
- package/dist/components/tour/core/step/action.mjs +14 -0
- package/dist/components/tour/core/step/conditional.d.ts +25 -0
- package/dist/components/tour/core/step/conditional.mjs +57 -0
- package/dist/components/tour/core/step/delay.d.ts +8 -0
- package/dist/components/tour/core/step/delay.mjs +9 -0
- package/dist/components/tour/core/step/dialog.d.ts +11 -0
- package/dist/components/tour/core/step/dialog.mjs +25 -0
- package/dist/components/tour/core/step/visit.d.ts +9 -0
- package/dist/components/tour/core/step/visit.mjs +15 -0
- package/dist/components/tour/core/step.d.ts +37 -0
- package/dist/components/tour/core/step.mjs +46 -0
- package/dist/components/tour/core/story.d.ts +130 -0
- package/dist/components/tour/core/story.mjs +166 -0
- package/dist/components/tour/core/tour.d.ts +126 -0
- package/dist/components/tour/core/tour.mjs +196 -0
- package/dist/components/tour/index.d.ts +3 -0
- package/dist/components/tour/index.mjs +4 -0
- package/dist/components/tour/utils/focus.d.ts +1 -0
- package/dist/components/tour/utils/focus.mjs +6 -0
- package/dist/components/tour/utils/is-visible.d.ts +1 -0
- package/dist/components/tour/utils/is-visible.mjs +29 -0
- package/dist/components/tour/utils/wait-element.d.ts +6 -0
- package/dist/components/tour/utils/wait-element.mjs +45 -0
- package/dist/components/truncate/Truncate.vue +69 -0
- package/dist/components/truncate/Truncate.vue.d.ts +68 -0
- package/dist/components/utils/array.d.ts +2 -0
- package/dist/components/utils/array.mjs +19 -0
- package/dist/components/utils/base64.d.ts +8 -0
- package/dist/components/utils/base64.mjs +35 -0
- package/dist/components/utils/color.d.ts +17 -0
- package/dist/components/utils/color.mjs +14 -0
- package/dist/components/utils/date.d.ts +22 -0
- package/dist/components/utils/date.mjs +14 -0
- package/dist/components/utils/value.d.ts +8 -0
- package/dist/components/utils/value.mjs +7 -0
- package/dist/components/utils/vnode.d.ts +15 -0
- package/dist/components/utils/vnode.mjs +18 -0
- package/dist/components/wizard/Wizard.vue +76 -0
- package/dist/components/wizard/Wizard.vue.d.ts +91 -0
- package/dist/components/wizard/WizardBody.vue +38 -0
- package/dist/components/wizard/WizardBody.vue.d.ts +36 -0
- package/dist/components/wizard/WizardHeader.vue +38 -0
- package/dist/components/wizard/WizardHeader.vue.d.ts +16 -0
- package/dist/components/wizard/WizardStep.vue +22 -0
- package/dist/components/wizard/WizardStep.vue.d.ts +55 -0
- package/dist/core/index.d.ts +43 -0
- package/dist/core/index.mjs +148 -0
- package/dist/directive/index.d.ts +3 -0
- package/dist/directive/index.mjs +12 -0
- package/dist/module.d.mts +28 -2
- package/dist/module.json +1 -1
- package/dist/module.mjs +92 -13
- package/dist/runtime/plugins/persona.d.ts +2 -0
- package/dist/runtime/plugins/persona.js +35 -0
- package/dist/types.d.mts +4 -8
- package/package.json +1 -4
- package/dist/module.d.cts +0 -2
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Placement } from '@floating-ui/dom';
|
|
2
|
+
import type { DirectiveBinding } from 'vue';
|
|
3
|
+
import type { ColorVariant } from '..';
|
|
4
|
+
/**
|
|
5
|
+
* Parse placement from modifier
|
|
6
|
+
*/
|
|
7
|
+
export declare function parsePlacement(_el: HTMLElement, { modifiers }: DirectiveBinding): Placement;
|
|
8
|
+
/**
|
|
9
|
+
* Parse action from modifier
|
|
10
|
+
*/
|
|
11
|
+
export declare function parseAction(_el: HTMLElement, { modifiers }: DirectiveBinding): string;
|
|
12
|
+
/**
|
|
13
|
+
* Parse value from element or bindings value
|
|
14
|
+
* @param el binding element
|
|
15
|
+
* @param bindings directive bindings options
|
|
16
|
+
*/
|
|
17
|
+
export declare function parseText(el: HTMLElement, bindings: DirectiveBinding<string | boolean>): string;
|
|
18
|
+
/**
|
|
19
|
+
* Parse color from modifiers
|
|
20
|
+
* @param _el (unused)
|
|
21
|
+
* @param bindings directive bindings options
|
|
22
|
+
*/
|
|
23
|
+
export declare function parseColor(_el: HTMLElement, { modifiers }: DirectiveBinding): ColorVariant;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export function parsePlacement(_el, { modifiers }) {
|
|
2
|
+
let result;
|
|
3
|
+
if (modifiers.top)
|
|
4
|
+
result = "top";
|
|
5
|
+
else if (modifiers.bottom)
|
|
6
|
+
result = "bottom";
|
|
7
|
+
if (result) {
|
|
8
|
+
if (modifiers.left)
|
|
9
|
+
result = `${result}-start`;
|
|
10
|
+
else if (modifiers.right)
|
|
11
|
+
result = `${result}-end`;
|
|
12
|
+
} else {
|
|
13
|
+
if (modifiers.right)
|
|
14
|
+
result = "right";
|
|
15
|
+
else if (modifiers.left)
|
|
16
|
+
result = "left";
|
|
17
|
+
}
|
|
18
|
+
if (!result)
|
|
19
|
+
result = "top";
|
|
20
|
+
if (modifiers.start && !result.endsWith("start"))
|
|
21
|
+
result = `${result}-start`;
|
|
22
|
+
else if (modifiers.end && !result.endsWith("end"))
|
|
23
|
+
result = `${result}-end`;
|
|
24
|
+
return result;
|
|
25
|
+
}
|
|
26
|
+
export function parseAction(_el, { modifiers }) {
|
|
27
|
+
const result = [];
|
|
28
|
+
if (modifiers.manual)
|
|
29
|
+
result.push("manual");
|
|
30
|
+
if (modifiers.focus)
|
|
31
|
+
result.push("focus");
|
|
32
|
+
if (modifiers.hover)
|
|
33
|
+
result.push("hover");
|
|
34
|
+
if (modifiers.click)
|
|
35
|
+
result.push("click");
|
|
36
|
+
return result.join("-") || "focus-hover";
|
|
37
|
+
}
|
|
38
|
+
export function parseText(el, bindings) {
|
|
39
|
+
if (typeof bindings.value === "string")
|
|
40
|
+
return bindings.value;
|
|
41
|
+
if (el.hasAttribute("title"))
|
|
42
|
+
return el.getAttribute("title");
|
|
43
|
+
return el.dataset.tooltipText ?? "";
|
|
44
|
+
}
|
|
45
|
+
export function parseColor(_el, { modifiers }) {
|
|
46
|
+
return modifiers.white ? "white" : "black";
|
|
47
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
class="tour">
|
|
4
|
+
<TransitionGroup name="fade">
|
|
5
|
+
<TourHighlight
|
|
6
|
+
v-if="isShow"
|
|
7
|
+
:target="target" />
|
|
8
|
+
<TourDialog
|
|
9
|
+
v-if="isShow"
|
|
10
|
+
ref="dialog"
|
|
11
|
+
v-bind="config" />
|
|
12
|
+
</transitiongroup>
|
|
13
|
+
</div>
|
|
14
|
+
</template>
|
|
15
|
+
|
|
16
|
+
<script setup>
|
|
17
|
+
import {
|
|
18
|
+
computed,
|
|
19
|
+
ref,
|
|
20
|
+
shallowRef,
|
|
21
|
+
watchEffect,
|
|
22
|
+
onBeforeUnmount
|
|
23
|
+
} from "vue";
|
|
24
|
+
import TourDialog from "./TourDialog.vue";
|
|
25
|
+
import TourHighlight from "./TourHighlight.vue";
|
|
26
|
+
import {
|
|
27
|
+
autoUpdate,
|
|
28
|
+
computePosition,
|
|
29
|
+
shift,
|
|
30
|
+
autoPlacement,
|
|
31
|
+
inline,
|
|
32
|
+
offset,
|
|
33
|
+
hide as hidden
|
|
34
|
+
} from "@floating-ui/dom";
|
|
35
|
+
const isShow = ref(false);
|
|
36
|
+
const dialog = shallowRef();
|
|
37
|
+
const target = shallowRef();
|
|
38
|
+
const config = shallowRef();
|
|
39
|
+
const tour = computed(() => dialog.value?.$el);
|
|
40
|
+
watchEffect((onCleanup) => {
|
|
41
|
+
if (target.value && tour.value) {
|
|
42
|
+
const cleanup = autoUpdate(target.value, tour.value, async () => {
|
|
43
|
+
computePosition(target.value, tour.value, {
|
|
44
|
+
strategy: "absolute",
|
|
45
|
+
middleware: [
|
|
46
|
+
autoPlacement({ altBoundary: true }),
|
|
47
|
+
shift({ padding: 16 }),
|
|
48
|
+
inline(),
|
|
49
|
+
hidden(),
|
|
50
|
+
offset(16)
|
|
51
|
+
]
|
|
52
|
+
}).then(({ x, y, middlewareData }) => {
|
|
53
|
+
if (tour.value) {
|
|
54
|
+
tour.value.style.transform = `translate3d(${x || 0}px, ${y || 0}px, 0)`;
|
|
55
|
+
tour.value.style.visibility = middlewareData.hide.referenceHidden ? "hidden" : "visible";
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
}, { animationFrame: true });
|
|
59
|
+
onCleanup(cleanup);
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
watchEffect((onCleanup) => {
|
|
63
|
+
if (isShow.value)
|
|
64
|
+
document.body.classList.add("tour--active");
|
|
65
|
+
onCleanup(() => {
|
|
66
|
+
document.body.classList.remove("tour--active");
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
function show(targetEl, options) {
|
|
70
|
+
target.value = targetEl;
|
|
71
|
+
config.value = options;
|
|
72
|
+
isShow.value = true;
|
|
73
|
+
}
|
|
74
|
+
function hide() {
|
|
75
|
+
isShow.value = false;
|
|
76
|
+
}
|
|
77
|
+
onBeforeUnmount(() => {
|
|
78
|
+
hide();
|
|
79
|
+
});
|
|
80
|
+
defineExpose({
|
|
81
|
+
show,
|
|
82
|
+
hide
|
|
83
|
+
});
|
|
84
|
+
</script>
|
|
85
|
+
|
|
86
|
+
<style lang="postcss">
|
|
87
|
+
.tour {
|
|
88
|
+
--p-tour-z-index: theme(zIndex.tour.DEFAULT);
|
|
89
|
+
--p-tour-backdrop-z-index: theme(zIndex.tour.backdrop);
|
|
90
|
+
|
|
91
|
+
& > &__dialog {
|
|
92
|
+
@apply absolute top-0 left-0;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
&--active {
|
|
96
|
+
@apply overflow-hidden;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
</style>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import TourDialog from './TourDialog.vue';
|
|
2
|
+
type TourDialogProps = Partial<InstanceType<typeof TourDialog>['$props']>;
|
|
3
|
+
declare function show(targetEl: HTMLElement, options: TourDialogProps): void;
|
|
4
|
+
declare function hide(): void;
|
|
5
|
+
declare const _default: import("vue").DefineComponent<{}, {
|
|
6
|
+
show: typeof show;
|
|
7
|
+
hide: typeof hide;
|
|
8
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
class="tour__dialog"
|
|
4
|
+
:class="{ 'tour--image': !!image }"
|
|
5
|
+
data-testid="tour-dialog">
|
|
6
|
+
<span
|
|
7
|
+
v-if="dismissable"
|
|
8
|
+
data-testid="tour-dismiss"
|
|
9
|
+
class="tour__dismiss"
|
|
10
|
+
@click="$emit('dismiss', $event)">
|
|
11
|
+
<IconClose />
|
|
12
|
+
</span>
|
|
13
|
+
<img
|
|
14
|
+
v-if="image"
|
|
15
|
+
class="tour__image"
|
|
16
|
+
data-testid="tour-image"
|
|
17
|
+
:src="image"
|
|
18
|
+
alt="tour-image"
|
|
19
|
+
width="320"
|
|
20
|
+
height="195">
|
|
21
|
+
<div class="tour__body">
|
|
22
|
+
<p-subheading
|
|
23
|
+
v-if="title"
|
|
24
|
+
class="tour__title"
|
|
25
|
+
size="sm">
|
|
26
|
+
<span
|
|
27
|
+
v-p-md.inline="title"
|
|
28
|
+
data-testid="tour-title" />
|
|
29
|
+
</p-subheading>
|
|
30
|
+
<p-caption>
|
|
31
|
+
<span
|
|
32
|
+
v-p-md.inline="text"
|
|
33
|
+
data-testid="tour-text" />
|
|
34
|
+
</p-caption>
|
|
35
|
+
</div>
|
|
36
|
+
<div class="tour__footer">
|
|
37
|
+
<div
|
|
38
|
+
v-if="totalStep > 2"
|
|
39
|
+
class="tour__meta"
|
|
40
|
+
data-testid="tour-meta">
|
|
41
|
+
{{ step }} / {{ totalStep }}
|
|
42
|
+
</div>
|
|
43
|
+
<div class="tour__controls">
|
|
44
|
+
<template v-if="dismissable && step < totalStep">
|
|
45
|
+
<p-button
|
|
46
|
+
data-testid="tour-control-dismiss"
|
|
47
|
+
size="xs"
|
|
48
|
+
variant="link"
|
|
49
|
+
@click="$emit('dismiss', $event)">
|
|
50
|
+
{{ dismissLabel }}
|
|
51
|
+
</p-button>
|
|
52
|
+
<span class="tour__divider">•</span>
|
|
53
|
+
</template>
|
|
54
|
+
|
|
55
|
+
<p-button
|
|
56
|
+
data-testid="tour-control-prev"
|
|
57
|
+
size="xs"
|
|
58
|
+
variant="link"
|
|
59
|
+
:disabled="step < 2"
|
|
60
|
+
@click="$emit('prev', $event)">
|
|
61
|
+
{{ prevLabel }}
|
|
62
|
+
</p-button>
|
|
63
|
+
|
|
64
|
+
<p-button
|
|
65
|
+
v-if="step === totalStep"
|
|
66
|
+
data-testid="tour-control-finish"
|
|
67
|
+
size="xs"
|
|
68
|
+
variant="solid"
|
|
69
|
+
color="info"
|
|
70
|
+
@click="$emit('next', $event)">
|
|
71
|
+
{{ finishLabel }}
|
|
72
|
+
</p-button>
|
|
73
|
+
<p-button
|
|
74
|
+
v-else
|
|
75
|
+
data-testid="tour-control-next"
|
|
76
|
+
size="xs"
|
|
77
|
+
variant="solid"
|
|
78
|
+
color="info"
|
|
79
|
+
@click="$emit('next', $event)">
|
|
80
|
+
{{ nextLabel }}
|
|
81
|
+
</p-button>
|
|
82
|
+
</div>
|
|
83
|
+
</div>
|
|
84
|
+
</div>
|
|
85
|
+
</template>
|
|
86
|
+
|
|
87
|
+
<script setup>
|
|
88
|
+
import pSubheading from "../subheading/Subheading.vue";
|
|
89
|
+
import pCaption from "../caption/Caption.vue";
|
|
90
|
+
import pButton from "../button/Button.vue";
|
|
91
|
+
import { vPMd } from "../markdown";
|
|
92
|
+
import IconClose from "@privyid/persona-icon/vue/close/16.vue";
|
|
93
|
+
defineProps({
|
|
94
|
+
title: {
|
|
95
|
+
type: String,
|
|
96
|
+
default: void 0
|
|
97
|
+
},
|
|
98
|
+
text: {
|
|
99
|
+
type: String,
|
|
100
|
+
default: ""
|
|
101
|
+
},
|
|
102
|
+
image: {
|
|
103
|
+
type: String,
|
|
104
|
+
default: void 0
|
|
105
|
+
},
|
|
106
|
+
highlight: {
|
|
107
|
+
type: Boolean,
|
|
108
|
+
default: true
|
|
109
|
+
},
|
|
110
|
+
step: {
|
|
111
|
+
type: Number,
|
|
112
|
+
default: 0
|
|
113
|
+
},
|
|
114
|
+
totalStep: {
|
|
115
|
+
type: Number,
|
|
116
|
+
default: 0
|
|
117
|
+
},
|
|
118
|
+
dismissable: {
|
|
119
|
+
type: Boolean,
|
|
120
|
+
default: true
|
|
121
|
+
},
|
|
122
|
+
prevLabel: {
|
|
123
|
+
type: String,
|
|
124
|
+
default: "Previous"
|
|
125
|
+
},
|
|
126
|
+
nextLabel: {
|
|
127
|
+
type: String,
|
|
128
|
+
default: "Next"
|
|
129
|
+
},
|
|
130
|
+
dismissLabel: {
|
|
131
|
+
type: String,
|
|
132
|
+
default: "Dismiss"
|
|
133
|
+
},
|
|
134
|
+
finishLabel: {
|
|
135
|
+
type: String,
|
|
136
|
+
default: "Finish"
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
defineEmits(["prev", "next", "dismiss"]);
|
|
140
|
+
</script>
|
|
141
|
+
|
|
142
|
+
<style lang="postcss">
|
|
143
|
+
.tour {
|
|
144
|
+
&__dialog {
|
|
145
|
+
@apply z-[var(--p-tour-z-index)] rounded bg-inverse w-full max-w-xs overflow-hidden relative shadow-sm;
|
|
146
|
+
@apply dark:bg-dark-inverse;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
&__image {
|
|
150
|
+
@apply max-w-full h-auto object-cover bg-default;
|
|
151
|
+
@apply dark:bg-dark-default;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
&__body {
|
|
155
|
+
@apply p-4 space-y-3;
|
|
156
|
+
|
|
157
|
+
.tour__title {
|
|
158
|
+
@apply text-on-emphasis;
|
|
159
|
+
@apply dark:text-dark-on-emphasis;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
> * {
|
|
163
|
+
@apply text-on-emphasis;
|
|
164
|
+
@apply dark:text-dark-on-emphasis;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
&__footer {
|
|
169
|
+
@apply p-4 pt-2 space-x-3 flex items-center;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
&__meta {
|
|
173
|
+
@apply text-xs text-muted shrink-0;
|
|
174
|
+
@apply dark:text-dark-muted;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
&__controls {
|
|
178
|
+
@apply grow flex space-x-2 justify-end items-center;
|
|
179
|
+
|
|
180
|
+
> .btn--variant-link.btn--default {
|
|
181
|
+
@apply text-on-emphasis hover:text-on-emphasis focus:text-on-emphasis;
|
|
182
|
+
@apply dark:text-dark-on-emphasis hover:dark:text-dark-on-emphasis focus:dark:text-dark-on-emphasis;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
> .tour__divider {
|
|
186
|
+
@apply text-on-emphasis;
|
|
187
|
+
@apply dark:text-dark-on-emphasis;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
&__dismiss {
|
|
192
|
+
@apply absolute top-3 right-3 hover:cursor-pointer text-on-emphasis/30 hover:text-on-emphasis/50;
|
|
193
|
+
@apply dark:text-dark-on-emphasis/30 hover:dark:text-dark-on-emphasis/50;
|
|
194
|
+
|
|
195
|
+
.tour--image & {
|
|
196
|
+
@apply text-default/30 hover:text-default/50;
|
|
197
|
+
@apply dark:text-dark-default/30 hover:dark:text-dark-default/50;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
</style>
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
2
|
+
title: {
|
|
3
|
+
type: StringConstructor;
|
|
4
|
+
default: undefined;
|
|
5
|
+
};
|
|
6
|
+
text: {
|
|
7
|
+
type: StringConstructor;
|
|
8
|
+
default: string;
|
|
9
|
+
};
|
|
10
|
+
image: {
|
|
11
|
+
type: StringConstructor;
|
|
12
|
+
default: undefined;
|
|
13
|
+
};
|
|
14
|
+
highlight: {
|
|
15
|
+
type: BooleanConstructor;
|
|
16
|
+
default: boolean;
|
|
17
|
+
};
|
|
18
|
+
step: {
|
|
19
|
+
type: NumberConstructor;
|
|
20
|
+
default: number;
|
|
21
|
+
};
|
|
22
|
+
totalStep: {
|
|
23
|
+
type: NumberConstructor;
|
|
24
|
+
default: number;
|
|
25
|
+
};
|
|
26
|
+
dismissable: {
|
|
27
|
+
type: BooleanConstructor;
|
|
28
|
+
default: boolean;
|
|
29
|
+
};
|
|
30
|
+
prevLabel: {
|
|
31
|
+
type: StringConstructor;
|
|
32
|
+
default: string;
|
|
33
|
+
};
|
|
34
|
+
nextLabel: {
|
|
35
|
+
type: StringConstructor;
|
|
36
|
+
default: string;
|
|
37
|
+
};
|
|
38
|
+
dismissLabel: {
|
|
39
|
+
type: StringConstructor;
|
|
40
|
+
default: string;
|
|
41
|
+
};
|
|
42
|
+
finishLabel: {
|
|
43
|
+
type: StringConstructor;
|
|
44
|
+
default: string;
|
|
45
|
+
};
|
|
46
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
47
|
+
next: (args_0: MouseEvent) => void;
|
|
48
|
+
prev: (args_0: MouseEvent) => void;
|
|
49
|
+
dismiss: (args_0: MouseEvent) => void;
|
|
50
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
51
|
+
title: {
|
|
52
|
+
type: StringConstructor;
|
|
53
|
+
default: undefined;
|
|
54
|
+
};
|
|
55
|
+
text: {
|
|
56
|
+
type: StringConstructor;
|
|
57
|
+
default: string;
|
|
58
|
+
};
|
|
59
|
+
image: {
|
|
60
|
+
type: StringConstructor;
|
|
61
|
+
default: undefined;
|
|
62
|
+
};
|
|
63
|
+
highlight: {
|
|
64
|
+
type: BooleanConstructor;
|
|
65
|
+
default: boolean;
|
|
66
|
+
};
|
|
67
|
+
step: {
|
|
68
|
+
type: NumberConstructor;
|
|
69
|
+
default: number;
|
|
70
|
+
};
|
|
71
|
+
totalStep: {
|
|
72
|
+
type: NumberConstructor;
|
|
73
|
+
default: number;
|
|
74
|
+
};
|
|
75
|
+
dismissable: {
|
|
76
|
+
type: BooleanConstructor;
|
|
77
|
+
default: boolean;
|
|
78
|
+
};
|
|
79
|
+
prevLabel: {
|
|
80
|
+
type: StringConstructor;
|
|
81
|
+
default: string;
|
|
82
|
+
};
|
|
83
|
+
nextLabel: {
|
|
84
|
+
type: StringConstructor;
|
|
85
|
+
default: string;
|
|
86
|
+
};
|
|
87
|
+
dismissLabel: {
|
|
88
|
+
type: StringConstructor;
|
|
89
|
+
default: string;
|
|
90
|
+
};
|
|
91
|
+
finishLabel: {
|
|
92
|
+
type: StringConstructor;
|
|
93
|
+
default: string;
|
|
94
|
+
};
|
|
95
|
+
}>> & Readonly<{
|
|
96
|
+
onNext?: ((args_0: MouseEvent) => any) | undefined;
|
|
97
|
+
onPrev?: ((args_0: MouseEvent) => any) | undefined;
|
|
98
|
+
onDismiss?: ((args_0: MouseEvent) => any) | undefined;
|
|
99
|
+
}>, {
|
|
100
|
+
text: string;
|
|
101
|
+
title: string;
|
|
102
|
+
image: string;
|
|
103
|
+
dismissable: boolean;
|
|
104
|
+
step: number;
|
|
105
|
+
prevLabel: string;
|
|
106
|
+
nextLabel: string;
|
|
107
|
+
dismissLabel: string;
|
|
108
|
+
finishLabel: string;
|
|
109
|
+
highlight: boolean;
|
|
110
|
+
totalStep: number;
|
|
111
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
112
|
+
export default _default;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="tour__backdrop">
|
|
3
|
+
<div
|
|
4
|
+
ref="highlight"
|
|
5
|
+
class="tour__highlight"
|
|
6
|
+
v-bind="$attrs" />
|
|
7
|
+
</div>
|
|
8
|
+
</template>
|
|
9
|
+
|
|
10
|
+
<script setup>
|
|
11
|
+
import {
|
|
12
|
+
ref,
|
|
13
|
+
toRef,
|
|
14
|
+
watchEffect
|
|
15
|
+
} from "vue";
|
|
16
|
+
import { autoUpdate } from "@floating-ui/dom";
|
|
17
|
+
defineOptions({ inheritAttrs: false });
|
|
18
|
+
const props = defineProps({
|
|
19
|
+
target: {
|
|
20
|
+
type: Object,
|
|
21
|
+
default: void 0
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
const target = toRef(props, "target");
|
|
25
|
+
const highlight = ref();
|
|
26
|
+
watchEffect((onCleanup) => {
|
|
27
|
+
if (highlight.value && target.value) {
|
|
28
|
+
const cleanup = autoUpdate(target.value, highlight.value, () => {
|
|
29
|
+
const bounding = target.value.getBoundingClientRect();
|
|
30
|
+
const padding = 16;
|
|
31
|
+
highlight.value.style.width = `${bounding.width + padding}px`;
|
|
32
|
+
highlight.value.style.height = `${bounding.height + padding}px`;
|
|
33
|
+
highlight.value.style.left = `${bounding.left - padding / 2}px`;
|
|
34
|
+
highlight.value.style.top = `${bounding.top - padding / 2}px`;
|
|
35
|
+
}, { animationFrame: true });
|
|
36
|
+
onCleanup(cleanup);
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
</script>
|
|
40
|
+
|
|
41
|
+
<style lang="postcss">
|
|
42
|
+
.tour {
|
|
43
|
+
&__backdrop {
|
|
44
|
+
@apply fixed inset-0 overflow-hidden w-full h-full z-[var(--p-tour-backdrop-z-index)];
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
&__highlight {
|
|
48
|
+
@apply z-[var(--p-tour-z-index)] absolute shadow-mask cursor-pointer rounded-tn;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
</style>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { PropType } from 'vue';
|
|
2
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
3
|
+
target: {
|
|
4
|
+
type: PropType<HTMLElement>;
|
|
5
|
+
default: undefined;
|
|
6
|
+
};
|
|
7
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
8
|
+
target: {
|
|
9
|
+
type: PropType<HTMLElement>;
|
|
10
|
+
default: undefined;
|
|
11
|
+
};
|
|
12
|
+
}>> & Readonly<{}>, {
|
|
13
|
+
target: HTMLElement;
|
|
14
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
15
|
+
export default _default;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { Hook } from '../../steps/utils/hook';
|
|
2
|
+
export type TourActionHook = (to: AbstractTour, from: AbstractTour) => boolean | Promise<boolean>;
|
|
3
|
+
export declare enum TourDirection {
|
|
4
|
+
FORWARD = 1,
|
|
5
|
+
BACKWARD = -1
|
|
6
|
+
}
|
|
7
|
+
export interface BaseTourOptions {
|
|
8
|
+
/**
|
|
9
|
+
* Uniq identifier, can be string or symbol
|
|
10
|
+
* use for edit and remove
|
|
11
|
+
*/
|
|
12
|
+
name?: string | symbol;
|
|
13
|
+
/**
|
|
14
|
+
* on-before-prev hook
|
|
15
|
+
*/
|
|
16
|
+
onBeforePrev?: TourActionHook;
|
|
17
|
+
/**
|
|
18
|
+
* on-before-next hook
|
|
19
|
+
*/
|
|
20
|
+
onBeforeNext?: TourActionHook;
|
|
21
|
+
}
|
|
22
|
+
export declare abstract class AbstractTour<Options extends BaseTourOptions = BaseTourOptions> {
|
|
23
|
+
name?: string | symbol;
|
|
24
|
+
/**
|
|
25
|
+
* Step direction, 1 for forward (next), -1 for backward (prev)
|
|
26
|
+
*/
|
|
27
|
+
protected direction: TourDirection;
|
|
28
|
+
protected parent?: AbstractTour;
|
|
29
|
+
protected options: Options;
|
|
30
|
+
protected onNextHooks: Hook<TourActionHook>;
|
|
31
|
+
protected onPrevHooks: Hook<TourActionHook>;
|
|
32
|
+
protected runOnPrevHooks: TourActionHook;
|
|
33
|
+
protected runOnNextHooks: TourActionHook;
|
|
34
|
+
constructor(options?: Options);
|
|
35
|
+
setParent(parent: AbstractTour): this;
|
|
36
|
+
/**
|
|
37
|
+
* Get options with parent options as fallback
|
|
38
|
+
*/
|
|
39
|
+
getOptions(): Options;
|
|
40
|
+
/**
|
|
41
|
+
* Set tour direction
|
|
42
|
+
* @param direction 1 for forward (next) and -1 for backward (prev)
|
|
43
|
+
*/
|
|
44
|
+
setDirection(direction: TourDirection): this;
|
|
45
|
+
/**
|
|
46
|
+
* Attach to parent
|
|
47
|
+
* @param parent Parent Instance
|
|
48
|
+
*/
|
|
49
|
+
attach(parent: AbstractTour): this;
|
|
50
|
+
/**
|
|
51
|
+
* Deattach from parent
|
|
52
|
+
* @param parent Parent Instance
|
|
53
|
+
*/
|
|
54
|
+
detach(parent: AbstractTour): this;
|
|
55
|
+
abstract start(): void | Promise<void>;
|
|
56
|
+
abstract stop(): void | Promise<void>;
|
|
57
|
+
abstract next(): void | Promise<void>;
|
|
58
|
+
abstract prev(): void | Promise<void>;
|
|
59
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import defu from "defu";
|
|
2
|
+
import { Hook } from "../../steps/utils/hook.mjs";
|
|
3
|
+
export var TourDirection = /* @__PURE__ */ ((TourDirection2) => {
|
|
4
|
+
TourDirection2[TourDirection2["FORWARD"] = 1] = "FORWARD";
|
|
5
|
+
TourDirection2[TourDirection2["BACKWARD"] = -1] = "BACKWARD";
|
|
6
|
+
return TourDirection2;
|
|
7
|
+
})(TourDirection || {});
|
|
8
|
+
export class AbstractTour {
|
|
9
|
+
name;
|
|
10
|
+
/**
|
|
11
|
+
* Step direction, 1 for forward (next), -1 for backward (prev)
|
|
12
|
+
*/
|
|
13
|
+
direction;
|
|
14
|
+
parent;
|
|
15
|
+
options;
|
|
16
|
+
onNextHooks;
|
|
17
|
+
onPrevHooks;
|
|
18
|
+
runOnPrevHooks;
|
|
19
|
+
runOnNextHooks;
|
|
20
|
+
constructor(options) {
|
|
21
|
+
this.direction = 1 /* FORWARD */;
|
|
22
|
+
this.name = options?.name ?? Symbol("TourID");
|
|
23
|
+
this.options = options;
|
|
24
|
+
this.onPrevHooks = new Hook();
|
|
25
|
+
this.onNextHooks = new Hook();
|
|
26
|
+
if (typeof options?.onBeforePrev === "function")
|
|
27
|
+
this.onPrevHooks.add(options.onBeforePrev);
|
|
28
|
+
if (typeof options?.onBeforeNext === "function")
|
|
29
|
+
this.onNextHooks.add(options.onBeforeNext);
|
|
30
|
+
this.runOnPrevHooks = async (...args) => await this.onPrevHooks.run(...args);
|
|
31
|
+
this.runOnNextHooks = async (...args) => await this.onNextHooks.run(...args);
|
|
32
|
+
}
|
|
33
|
+
setParent(parent) {
|
|
34
|
+
this.parent = parent;
|
|
35
|
+
return this;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Get options with parent options as fallback
|
|
39
|
+
*/
|
|
40
|
+
getOptions() {
|
|
41
|
+
return defu(this.options, this.parent?.getOptions());
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Set tour direction
|
|
45
|
+
* @param direction 1 for forward (next) and -1 for backward (prev)
|
|
46
|
+
*/
|
|
47
|
+
setDirection(direction) {
|
|
48
|
+
this.direction = direction;
|
|
49
|
+
return this;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Attach to parent
|
|
53
|
+
* @param parent Parent Instance
|
|
54
|
+
*/
|
|
55
|
+
attach(parent) {
|
|
56
|
+
parent.onPrevHooks.add(this.runOnPrevHooks);
|
|
57
|
+
parent.onNextHooks.add(this.runOnNextHooks);
|
|
58
|
+
return this;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Deattach from parent
|
|
62
|
+
* @param parent Parent Instance
|
|
63
|
+
*/
|
|
64
|
+
detach(parent) {
|
|
65
|
+
parent.onPrevHooks.remove(this.runOnPrevHooks);
|
|
66
|
+
parent.onNextHooks.remove(this.runOnNextHooks);
|
|
67
|
+
return this;
|
|
68
|
+
}
|
|
69
|
+
}
|