@privyid/persona 1.2.1 → 1.2.2-dev.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/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 +76 -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 +97 -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,63 @@
|
|
|
1
|
+
import type { MaybeRef } from '@vueuse/core';
|
|
2
|
+
import type { InjectionKey, Ref } from 'vue';
|
|
3
|
+
import type { PdfViewerContext } from '../pdf-viewer';
|
|
4
|
+
import { focus as focus_ } from '../tour/utils/focus';
|
|
5
|
+
export interface PdfObject {
|
|
6
|
+
id: symbol;
|
|
7
|
+
x?: number;
|
|
8
|
+
y?: number;
|
|
9
|
+
page?: number;
|
|
10
|
+
width: number;
|
|
11
|
+
height: number;
|
|
12
|
+
}
|
|
13
|
+
export interface PdfObjects extends PdfViewerContext {
|
|
14
|
+
root: Ref<HTMLDivElement>;
|
|
15
|
+
objects: Map<symbol, PdfObject>;
|
|
16
|
+
}
|
|
17
|
+
export interface PdfObjectSize {
|
|
18
|
+
width: number;
|
|
19
|
+
height: number;
|
|
20
|
+
minWidth?: number;
|
|
21
|
+
minHeight?: number;
|
|
22
|
+
maxWidth?: number;
|
|
23
|
+
maxHeight?: number;
|
|
24
|
+
}
|
|
25
|
+
export type PdfObjectProp = PdfObjectSize & Omit<PdfObject, 'id'>;
|
|
26
|
+
export declare const PDF_OBJECTS_CONTEXT: InjectionKey<PdfObjects>;
|
|
27
|
+
export declare const PDF_OBJECT_CONTEXT: InjectionKey<ReturnType<typeof useObjectModel>>;
|
|
28
|
+
export declare function useSizeModel(props: PdfObjectSize): {
|
|
29
|
+
ratio: import("vue").ComputedRef<number>;
|
|
30
|
+
width: Ref<number, number>;
|
|
31
|
+
height: Ref<number, number>;
|
|
32
|
+
minWidth: Ref<number, number>;
|
|
33
|
+
maxWidth: Ref<number, number>;
|
|
34
|
+
minHeight: Ref<number, number>;
|
|
35
|
+
maxHeight: Ref<number, number>;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* V-model for PDF Object
|
|
39
|
+
* @param props PDF Object props
|
|
40
|
+
*/
|
|
41
|
+
export declare function useObjectModel(props: PdfObjectProp): {
|
|
42
|
+
id: symbol;
|
|
43
|
+
x: Ref<number | undefined, number | undefined>;
|
|
44
|
+
y: Ref<number | undefined, number | undefined>;
|
|
45
|
+
page: any;
|
|
46
|
+
width: Ref<number, number>;
|
|
47
|
+
height: Ref<number, number>;
|
|
48
|
+
minWidth: Ref<number, number>;
|
|
49
|
+
minHeight: Ref<number, number>;
|
|
50
|
+
maxWidth: Ref<number, number>;
|
|
51
|
+
maxHeight: Ref<number, number>;
|
|
52
|
+
ratio: import("vue").ComputedRef<number>;
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* Reactive page element
|
|
56
|
+
* @param page page number
|
|
57
|
+
*/
|
|
58
|
+
export declare function usePage(page: MaybeRef<number>): Readonly<Ref<HTMLElement, HTMLElement>>;
|
|
59
|
+
/**
|
|
60
|
+
* focus with debounce
|
|
61
|
+
*/
|
|
62
|
+
export declare const focus: import("lodash").DebouncedFunc<typeof focus_>;
|
|
63
|
+
export type AddonPositionVariant = 'top' | 'left' | 'right' | 'bottom';
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import {
|
|
2
|
+
tryOnBeforeMount,
|
|
3
|
+
tryOnBeforeUnmount,
|
|
4
|
+
until
|
|
5
|
+
} from "@vueuse/core";
|
|
6
|
+
import {
|
|
7
|
+
computed,
|
|
8
|
+
inject,
|
|
9
|
+
reactive,
|
|
10
|
+
unref,
|
|
11
|
+
ref,
|
|
12
|
+
watch
|
|
13
|
+
} from "vue";
|
|
14
|
+
import { useSelector } from "./utils/use-selector.mjs";
|
|
15
|
+
import { focus as focus_ } from "../tour/utils/focus.mjs";
|
|
16
|
+
import { useClamp } from "@vueuse/math";
|
|
17
|
+
import { debounce, round } from "lodash-es";
|
|
18
|
+
export const PDF_OBJECTS_CONTEXT = Symbol("PDFObjects");
|
|
19
|
+
export const PDF_OBJECT_CONTEXT = Symbol("PDFObjects");
|
|
20
|
+
export function useSizeModel(props) {
|
|
21
|
+
const ratio = computed(() => round(props.width / props.height, 2));
|
|
22
|
+
const minWidth = ref(props.minWidth ?? props.width * 0.5);
|
|
23
|
+
const maxWidth = ref(props.maxWidth ?? props.width * 2);
|
|
24
|
+
const minHeight = ref(props.minHeight ?? props.height * 0.5);
|
|
25
|
+
const maxHeight = ref(props.maxHeight ?? props.height * 2);
|
|
26
|
+
const width = useClamp(props.width, minWidth, maxWidth);
|
|
27
|
+
const height = useClamp(props.height, minHeight, maxHeight);
|
|
28
|
+
watch(() => props.minWidth, (value) => {
|
|
29
|
+
if (Number.isFinite(value))
|
|
30
|
+
minWidth.value = value;
|
|
31
|
+
});
|
|
32
|
+
watch(() => props.minHeight, (value) => {
|
|
33
|
+
if (Number.isFinite(value))
|
|
34
|
+
minHeight.value = value;
|
|
35
|
+
});
|
|
36
|
+
watch(() => props.maxWidth, (value) => {
|
|
37
|
+
if (Number.isFinite(value))
|
|
38
|
+
maxWidth.value = value;
|
|
39
|
+
});
|
|
40
|
+
watch(() => props.maxHeight, (value) => {
|
|
41
|
+
if (Number.isFinite(value))
|
|
42
|
+
maxHeight.value = value;
|
|
43
|
+
});
|
|
44
|
+
return {
|
|
45
|
+
ratio,
|
|
46
|
+
width,
|
|
47
|
+
height,
|
|
48
|
+
minWidth,
|
|
49
|
+
maxWidth,
|
|
50
|
+
minHeight,
|
|
51
|
+
maxHeight
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
export function useObjectModel(props) {
|
|
55
|
+
const {
|
|
56
|
+
objects,
|
|
57
|
+
page: currentPage
|
|
58
|
+
} = inject(PDF_OBJECTS_CONTEXT);
|
|
59
|
+
const page = ref(props.page ?? currentPage.value);
|
|
60
|
+
const x = ref(props.x);
|
|
61
|
+
const y = ref(props.y);
|
|
62
|
+
const id = Symbol("PDFObject");
|
|
63
|
+
const {
|
|
64
|
+
width,
|
|
65
|
+
height,
|
|
66
|
+
minWidth,
|
|
67
|
+
maxWidth,
|
|
68
|
+
minHeight,
|
|
69
|
+
maxHeight,
|
|
70
|
+
ratio
|
|
71
|
+
} = useSizeModel(props);
|
|
72
|
+
objects.set(id, reactive({
|
|
73
|
+
id,
|
|
74
|
+
page,
|
|
75
|
+
x,
|
|
76
|
+
y,
|
|
77
|
+
width,
|
|
78
|
+
height
|
|
79
|
+
}));
|
|
80
|
+
tryOnBeforeMount(() => {
|
|
81
|
+
if (!Number.isFinite(page.value)) {
|
|
82
|
+
until(currentPage).toBeTruthy().then(() => {
|
|
83
|
+
page.value = currentPage.value;
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
tryOnBeforeUnmount(() => {
|
|
88
|
+
objects.delete(id);
|
|
89
|
+
});
|
|
90
|
+
return {
|
|
91
|
+
id,
|
|
92
|
+
x,
|
|
93
|
+
y,
|
|
94
|
+
page,
|
|
95
|
+
width,
|
|
96
|
+
height,
|
|
97
|
+
minWidth,
|
|
98
|
+
minHeight,
|
|
99
|
+
maxWidth,
|
|
100
|
+
maxHeight,
|
|
101
|
+
ratio
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
export function usePage(page) {
|
|
105
|
+
const { root } = inject(PDF_OBJECTS_CONTEXT);
|
|
106
|
+
const pageSelector = computed(() => `.page[data-page-number="${unref(page)}"]`);
|
|
107
|
+
const pageEl = useSelector(pageSelector, root);
|
|
108
|
+
return pageEl;
|
|
109
|
+
}
|
|
110
|
+
export const focus = debounce(focus_, 100);
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export interface ObjectSize {
|
|
2
|
+
width: number;
|
|
3
|
+
height: number;
|
|
4
|
+
}
|
|
5
|
+
export interface ObjectPosition {
|
|
6
|
+
x: number;
|
|
7
|
+
y: number;
|
|
8
|
+
}
|
|
9
|
+
export type CheckOverlapFn = (object: ObjectPosition, objects: Iterable<ObjectPosition>) => boolean;
|
|
10
|
+
export interface GetEmptyPositionOptions {
|
|
11
|
+
/**
|
|
12
|
+
* Other objects position
|
|
13
|
+
*/
|
|
14
|
+
objects: Iterable<ObjectPosition>;
|
|
15
|
+
/**
|
|
16
|
+
* Object size
|
|
17
|
+
*/
|
|
18
|
+
size: ObjectSize;
|
|
19
|
+
/**
|
|
20
|
+
* Offside size
|
|
21
|
+
*/
|
|
22
|
+
offside: ObjectSize;
|
|
23
|
+
/**
|
|
24
|
+
* Function to check overlap
|
|
25
|
+
*/
|
|
26
|
+
checkOverlap?: CheckOverlapFn;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Check center position of reference
|
|
30
|
+
* @param object Object which want to place
|
|
31
|
+
* @param reference Reference place
|
|
32
|
+
*/
|
|
33
|
+
export declare function getCenter(object: ObjectSize, reference: ObjectSize): {
|
|
34
|
+
x: number;
|
|
35
|
+
y: number;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Check object is outside from reference
|
|
39
|
+
* @param object
|
|
40
|
+
* @param reference
|
|
41
|
+
*/
|
|
42
|
+
export declare function isOffside(object: ObjectSize & ObjectPosition, reference: ObjectSize): boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Check Overlap Fn using Map as Cache Keys
|
|
45
|
+
* @param objects
|
|
46
|
+
*/
|
|
47
|
+
export declare function useMapSnapshot(objects: Iterable<ObjectPosition>): CheckOverlapFn;
|
|
48
|
+
/**
|
|
49
|
+
* Get empty position which not colide with other objects and not outside the reference place
|
|
50
|
+
*/
|
|
51
|
+
export declare function getEmptyPosition(options: GetEmptyPositionOptions): ObjectPosition;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { memoize } from "lodash-es";
|
|
2
|
+
export function getCenter(object, reference) {
|
|
3
|
+
return {
|
|
4
|
+
x: (reference.width - object.width) / 2,
|
|
5
|
+
y: (reference.height - object.height) / 2
|
|
6
|
+
};
|
|
7
|
+
}
|
|
8
|
+
export function isOffside(object, reference) {
|
|
9
|
+
return object.x + object.width > reference.width || object.y + object.height > reference.height;
|
|
10
|
+
}
|
|
11
|
+
export function useMapSnapshot(objects) {
|
|
12
|
+
const xMap = /* @__PURE__ */ new Map();
|
|
13
|
+
const round = memoize((value) => Math.round(value / 15) * 15);
|
|
14
|
+
for (const object of objects) {
|
|
15
|
+
const x = round(object.x);
|
|
16
|
+
const y = round(object.y);
|
|
17
|
+
const yMap = xMap.get(x) ?? /* @__PURE__ */ new Map();
|
|
18
|
+
yMap.set(y, object);
|
|
19
|
+
xMap.set(x, yMap);
|
|
20
|
+
}
|
|
21
|
+
return (object) => {
|
|
22
|
+
const x = round(object.x);
|
|
23
|
+
const y = round(object.y);
|
|
24
|
+
return xMap.get(x)?.get(y) !== void 0;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
export function getEmptyPosition(options) {
|
|
28
|
+
const checkOverlap = options.checkOverlap ?? useMapSnapshot(options.objects);
|
|
29
|
+
const center = getCenter(options.size, options.offside);
|
|
30
|
+
const position = {
|
|
31
|
+
...options.size,
|
|
32
|
+
...center
|
|
33
|
+
};
|
|
34
|
+
let found = true;
|
|
35
|
+
let loop = 0;
|
|
36
|
+
let deltaY = 0;
|
|
37
|
+
do {
|
|
38
|
+
found = true;
|
|
39
|
+
if (isOffside(position, options.offside)) {
|
|
40
|
+
position.y = center.y + deltaY;
|
|
41
|
+
position.x = center.x;
|
|
42
|
+
deltaY += 15;
|
|
43
|
+
found = false;
|
|
44
|
+
}
|
|
45
|
+
if (checkOverlap(position, options.objects)) {
|
|
46
|
+
position.x += 15;
|
|
47
|
+
position.y += 15;
|
|
48
|
+
found = false;
|
|
49
|
+
}
|
|
50
|
+
} while (!found && ++loop <= 500);
|
|
51
|
+
if (!found)
|
|
52
|
+
console.warn("Cannot find empty position, max iteration reach");
|
|
53
|
+
return position;
|
|
54
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
interface ComputePosition {
|
|
2
|
+
/**
|
|
3
|
+
* Root container element
|
|
4
|
+
*/
|
|
5
|
+
container: HTMLElement;
|
|
6
|
+
/**
|
|
7
|
+
* Reference element where the object should be placed
|
|
8
|
+
*/
|
|
9
|
+
reference: HTMLElement;
|
|
10
|
+
/**
|
|
11
|
+
* Zoom scale
|
|
12
|
+
*/
|
|
13
|
+
scale: number;
|
|
14
|
+
/**
|
|
15
|
+
* X Position
|
|
16
|
+
*/
|
|
17
|
+
x: number;
|
|
18
|
+
/**
|
|
19
|
+
* Y Position
|
|
20
|
+
*/
|
|
21
|
+
y: number;
|
|
22
|
+
}
|
|
23
|
+
interface GetPosition {
|
|
24
|
+
/**
|
|
25
|
+
* Root container element
|
|
26
|
+
*/
|
|
27
|
+
container?: HTMLElement;
|
|
28
|
+
/**
|
|
29
|
+
* Reference element where the object should be placed
|
|
30
|
+
*/
|
|
31
|
+
reference: HTMLElement;
|
|
32
|
+
/**
|
|
33
|
+
* Object element
|
|
34
|
+
*/
|
|
35
|
+
object: HTMLElement;
|
|
36
|
+
/**
|
|
37
|
+
* Zoom scale
|
|
38
|
+
*/
|
|
39
|
+
scale: number;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Find nearest relative parent element
|
|
43
|
+
* @param element Element to search
|
|
44
|
+
* @param container Maximum search element
|
|
45
|
+
*/
|
|
46
|
+
export declare function findRelativeParent(element: HTMLElement, container?: HTMLElement): HTMLElement | null;
|
|
47
|
+
/**
|
|
48
|
+
* Computed X, Y position to Top, Left position
|
|
49
|
+
* @param context
|
|
50
|
+
*/
|
|
51
|
+
export declare function computePosition(context: ComputePosition): {
|
|
52
|
+
top: number;
|
|
53
|
+
left: number;
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* Get X, Y position from object
|
|
57
|
+
* @param context
|
|
58
|
+
*/
|
|
59
|
+
export declare function getPosition(context: GetPosition): {
|
|
60
|
+
x: number;
|
|
61
|
+
y: number;
|
|
62
|
+
page: number;
|
|
63
|
+
};
|
|
64
|
+
export {};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { clamp } from "lodash-es";
|
|
2
|
+
export function findRelativeParent(element, container = document.body) {
|
|
3
|
+
let parent = element.parentElement;
|
|
4
|
+
do {
|
|
5
|
+
const { position } = window.getComputedStyle(parent);
|
|
6
|
+
if (position === "relative" || position === "absolute")
|
|
7
|
+
return parent;
|
|
8
|
+
parent = parent.parentElement;
|
|
9
|
+
} while (parent && parent !== container);
|
|
10
|
+
return container;
|
|
11
|
+
}
|
|
12
|
+
export function computePosition(context) {
|
|
13
|
+
const {
|
|
14
|
+
container,
|
|
15
|
+
reference,
|
|
16
|
+
x,
|
|
17
|
+
y,
|
|
18
|
+
scale
|
|
19
|
+
} = context;
|
|
20
|
+
const refBounding = reference.getBoundingClientRect();
|
|
21
|
+
const parent = findRelativeParent(reference, container);
|
|
22
|
+
const parentBounding = parent.getBoundingClientRect();
|
|
23
|
+
const zeroTop = refBounding.top - parentBounding.top + parent.scrollTop;
|
|
24
|
+
const zeroLeft = refBounding.left - parentBounding.left + parent.scrollLeft;
|
|
25
|
+
return {
|
|
26
|
+
top: zeroTop + y * scale,
|
|
27
|
+
left: zeroLeft + x * scale
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
export function getPosition(context) {
|
|
31
|
+
const {
|
|
32
|
+
reference,
|
|
33
|
+
object,
|
|
34
|
+
scale
|
|
35
|
+
} = context;
|
|
36
|
+
const objectBounding = object.getBoundingClientRect();
|
|
37
|
+
const refBounding = reference.getBoundingClientRect();
|
|
38
|
+
const maxX = Math.floor((refBounding.width - objectBounding.width) / scale);
|
|
39
|
+
const maxY = Math.floor((refBounding.height - objectBounding.height) / scale);
|
|
40
|
+
const x = (objectBounding.left - refBounding.left) / scale;
|
|
41
|
+
const y = (objectBounding.top - refBounding.top) / scale;
|
|
42
|
+
const page = Number.parseInt(reference.dataset.pageNumber);
|
|
43
|
+
return {
|
|
44
|
+
x: clamp(x, 1, maxX - 1),
|
|
45
|
+
y: clamp(y, 1, maxY - 1),
|
|
46
|
+
page
|
|
47
|
+
};
|
|
48
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { InteractEvent } from '@interactjs/types';
|
|
2
|
+
import type { Ref } from 'vue';
|
|
3
|
+
export interface DragHooks {
|
|
4
|
+
onstart?: (event: InteractEvent) => void;
|
|
5
|
+
onmove?: (event: InteractEvent) => void;
|
|
6
|
+
onend?: (event: InteractEvent) => void;
|
|
7
|
+
ontap?: (event: InteractEvent) => void;
|
|
8
|
+
}
|
|
9
|
+
export default function useDrag(target: Ref<HTMLElement>, hooks?: DragHooks): import("vue").ShallowRef<boolean, boolean>;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import {
|
|
2
|
+
inject,
|
|
3
|
+
onScopeDispose,
|
|
4
|
+
shallowRef,
|
|
5
|
+
watch
|
|
6
|
+
} from "vue";
|
|
7
|
+
import { DROPZONE_CONTEXT_SYMBOL } from "./use-drop.mjs";
|
|
8
|
+
export default function useDrag(target, hooks) {
|
|
9
|
+
const enable = shallowRef(true);
|
|
10
|
+
const instance = shallowRef();
|
|
11
|
+
const { hoverzone } = inject(DROPZONE_CONTEXT_SYMBOL);
|
|
12
|
+
async function init() {
|
|
13
|
+
destroy();
|
|
14
|
+
if (target.value) {
|
|
15
|
+
const { default: Interact } = await import("interactjs");
|
|
16
|
+
instance.value = Interact(target.value).draggable({
|
|
17
|
+
inertia: true,
|
|
18
|
+
enabled: enable.value,
|
|
19
|
+
autoScroll: {
|
|
20
|
+
container: target.value.parentElement,
|
|
21
|
+
margin: 100,
|
|
22
|
+
speed: 300
|
|
23
|
+
},
|
|
24
|
+
onstart: hooks.onstart,
|
|
25
|
+
onmove: hooks.onmove,
|
|
26
|
+
onend: hooks.onend,
|
|
27
|
+
modifiers: [
|
|
28
|
+
Interact.modifiers.restrict({
|
|
29
|
+
restriction: "parent",
|
|
30
|
+
elementRect: {
|
|
31
|
+
top: 0,
|
|
32
|
+
left: 0,
|
|
33
|
+
bottom: 1,
|
|
34
|
+
right: 1
|
|
35
|
+
}
|
|
36
|
+
}),
|
|
37
|
+
Interact.modifiers.restrictRect({
|
|
38
|
+
endOnly: true,
|
|
39
|
+
restriction: () => {
|
|
40
|
+
if (hoverzone.value)
|
|
41
|
+
return Interact.getElementRect(hoverzone.value);
|
|
42
|
+
return {
|
|
43
|
+
top: 0,
|
|
44
|
+
left: 0,
|
|
45
|
+
bottom: Number.POSITIVE_INFINITY,
|
|
46
|
+
right: Number.POSITIVE_INFINITY
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
})
|
|
50
|
+
]
|
|
51
|
+
}).on("tap", hooks.ontap);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
function destroy() {
|
|
55
|
+
if (instance.value)
|
|
56
|
+
instance.value.unset();
|
|
57
|
+
}
|
|
58
|
+
watch(target, async () => {
|
|
59
|
+
await init();
|
|
60
|
+
});
|
|
61
|
+
watch(enable, (value) => {
|
|
62
|
+
if (instance.value)
|
|
63
|
+
instance.value.draggable(value);
|
|
64
|
+
});
|
|
65
|
+
onScopeDispose(() => {
|
|
66
|
+
destroy();
|
|
67
|
+
});
|
|
68
|
+
return enable;
|
|
69
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { InjectionKey, Ref } from 'vue';
|
|
2
|
+
export interface DropzoneContext {
|
|
3
|
+
dropzone: Ref<HTMLElement>;
|
|
4
|
+
hoverzone: Ref<HTMLElement>;
|
|
5
|
+
}
|
|
6
|
+
export declare const DROPZONE_CONTEXT_SYMBOL: InjectionKey<DropzoneContext>;
|
|
7
|
+
export default function useDrop(target: Ref<HTMLElement>, dropTarget: Ref<string>): import("vue").ShallowRef<boolean, boolean>;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { useMutationObserver } from "@vueuse/core";
|
|
2
|
+
import {
|
|
3
|
+
onScopeDispose,
|
|
4
|
+
provide,
|
|
5
|
+
ref,
|
|
6
|
+
shallowRef
|
|
7
|
+
} from "vue";
|
|
8
|
+
export const DROPZONE_CONTEXT_SYMBOL = Symbol("DropzoneContext");
|
|
9
|
+
export default function useDrop(target, dropTarget) {
|
|
10
|
+
const enable = shallowRef(true);
|
|
11
|
+
const instance = shallowRef();
|
|
12
|
+
const dropzone = ref();
|
|
13
|
+
const hoverzone = ref();
|
|
14
|
+
async function init() {
|
|
15
|
+
destroy();
|
|
16
|
+
if (target.value) {
|
|
17
|
+
const { default: Interact } = await import("interactjs");
|
|
18
|
+
Interact.dynamicDrop(true);
|
|
19
|
+
instance.value = Interact(dropTarget.value, { context: target.value }).dropzone({
|
|
20
|
+
accept: ".pdf-object",
|
|
21
|
+
overlap: 0.95,
|
|
22
|
+
enabled: enable.value,
|
|
23
|
+
checker(dragEvent, event, dropped, dropzone2, dropzoneElement, draggable, draggableElement) {
|
|
24
|
+
return dropped && (target.value?.contains(draggableElement) || draggableElement.classList.contains("pdf-object--external"));
|
|
25
|
+
},
|
|
26
|
+
ondragenter(event) {
|
|
27
|
+
hoverzone.value = event.target;
|
|
28
|
+
event.target.classList.add("hover");
|
|
29
|
+
},
|
|
30
|
+
ondragleave(event) {
|
|
31
|
+
event.target.classList.remove("hover");
|
|
32
|
+
},
|
|
33
|
+
ondrop(event) {
|
|
34
|
+
hoverzone.value = event.target;
|
|
35
|
+
dropzone.value = event.target;
|
|
36
|
+
event.target.classList.remove("hover");
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
function destroy() {
|
|
42
|
+
if (instance.value)
|
|
43
|
+
instance.value.unset();
|
|
44
|
+
}
|
|
45
|
+
useMutationObserver(target, (mutations) => {
|
|
46
|
+
const isChildChanged = mutations.some((mutation) => {
|
|
47
|
+
return mutation.type === "childList" && mutation.target.matches(dropTarget.value);
|
|
48
|
+
});
|
|
49
|
+
if (isChildChanged)
|
|
50
|
+
void init();
|
|
51
|
+
}, { subtree: true, childList: true });
|
|
52
|
+
onScopeDispose(() => {
|
|
53
|
+
destroy();
|
|
54
|
+
});
|
|
55
|
+
provide(DROPZONE_CONTEXT_SYMBOL, { dropzone, hoverzone });
|
|
56
|
+
return enable;
|
|
57
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { InteractEvent } from '@interactjs/types';
|
|
2
|
+
import type { MaybeRef } from '@vueuse/core';
|
|
3
|
+
import type { Ref } from 'vue';
|
|
4
|
+
export interface ResizeOptions {
|
|
5
|
+
onstart?: (event: InteractEvent) => void;
|
|
6
|
+
onmove?: (event: InteractEvent) => void;
|
|
7
|
+
onend?: (event: InteractEvent) => void;
|
|
8
|
+
handleSelector?: string;
|
|
9
|
+
reference?: MaybeRef<HTMLElement>;
|
|
10
|
+
minWidth?: MaybeRef<number>;
|
|
11
|
+
maxWidth?: MaybeRef<number>;
|
|
12
|
+
minHeight?: MaybeRef<number>;
|
|
13
|
+
maxHeight?: MaybeRef<number>;
|
|
14
|
+
scale?: MaybeRef<number>;
|
|
15
|
+
ratio?: MaybeRef<number>;
|
|
16
|
+
}
|
|
17
|
+
export default function useResize(target: Ref<HTMLElement>, options?: ResizeOptions): import("vue").ShallowRef<boolean, boolean>;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import {
|
|
2
|
+
onScopeDispose,
|
|
3
|
+
shallowRef,
|
|
4
|
+
unref,
|
|
5
|
+
watch
|
|
6
|
+
} from "vue";
|
|
7
|
+
export default function useResize(target, options = {}) {
|
|
8
|
+
const enable = shallowRef(true);
|
|
9
|
+
const instance = shallowRef();
|
|
10
|
+
async function init() {
|
|
11
|
+
destroy();
|
|
12
|
+
if (target.value) {
|
|
13
|
+
const { default: Interact } = await import("interactjs");
|
|
14
|
+
instance.value = Interact(target.value).resizable({
|
|
15
|
+
enabled: enable.value,
|
|
16
|
+
edges: {
|
|
17
|
+
left: false,
|
|
18
|
+
top: false,
|
|
19
|
+
bottom: options.handleSelector ?? ".resize-handle",
|
|
20
|
+
right: options.handleSelector ?? ".resize-handle"
|
|
21
|
+
},
|
|
22
|
+
onstart: options.onstart,
|
|
23
|
+
onmove: options.onmove,
|
|
24
|
+
onend: options.onend,
|
|
25
|
+
modifiers: [
|
|
26
|
+
Interact.modifiers.aspectRatio({
|
|
27
|
+
ratio: unref(options.ratio) ?? "preserve",
|
|
28
|
+
modifiers: [
|
|
29
|
+
Interact.modifiers.restrictSize({
|
|
30
|
+
min: (x, y, element) => {
|
|
31
|
+
const scale = unref(options.scale) ?? 1;
|
|
32
|
+
return {
|
|
33
|
+
...element.rect,
|
|
34
|
+
width: unref(options.minWidth) * scale,
|
|
35
|
+
height: unref(options.minHeight) * scale
|
|
36
|
+
};
|
|
37
|
+
},
|
|
38
|
+
max: (x, y, element) => {
|
|
39
|
+
const scale = unref(options.scale) ?? 1;
|
|
40
|
+
return {
|
|
41
|
+
...element.rect,
|
|
42
|
+
width: unref(options.maxWidth) * scale,
|
|
43
|
+
height: unref(options.maxHeight) * scale
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
}),
|
|
47
|
+
Interact.modifiers.restrictSize({
|
|
48
|
+
max: (x, y, element) => {
|
|
49
|
+
const reference = unref(options.reference);
|
|
50
|
+
if (reference) {
|
|
51
|
+
const bounding = Interact.getElementRect(reference);
|
|
52
|
+
if (bounding) {
|
|
53
|
+
const width = bounding.right - element.rect.left;
|
|
54
|
+
const height = bounding.bottom - element.rect.top;
|
|
55
|
+
return {
|
|
56
|
+
...bounding,
|
|
57
|
+
width,
|
|
58
|
+
height
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return {
|
|
63
|
+
...element.rect,
|
|
64
|
+
width: Number.POSITIVE_INFINITY,
|
|
65
|
+
height: Number.POSITIVE_INFINITY
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
})
|
|
69
|
+
]
|
|
70
|
+
})
|
|
71
|
+
]
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
function destroy() {
|
|
76
|
+
if (instance.value)
|
|
77
|
+
instance.value.unset();
|
|
78
|
+
}
|
|
79
|
+
watch(target, async () => {
|
|
80
|
+
await init();
|
|
81
|
+
});
|
|
82
|
+
watch(enable, (value) => {
|
|
83
|
+
if (instance.value)
|
|
84
|
+
instance.value.draggable(value);
|
|
85
|
+
}, { immediate: true });
|
|
86
|
+
onScopeDispose(() => {
|
|
87
|
+
destroy();
|
|
88
|
+
});
|
|
89
|
+
return enable;
|
|
90
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { MaybeRef } from '@vueuse/core';
|
|
2
|
+
import type { Ref } from 'vue';
|
|
3
|
+
export declare function useSelector<E extends HTMLElement>(selector: MaybeRef<string>, container?: MaybeRef<HTMLElement>, all?: false): Readonly<Ref<E>>;
|
|
4
|
+
export declare function useSelector<E extends HTMLElement>(selector: MaybeRef<string>, container?: MaybeRef<HTMLElement>, all?: true): Readonly<Ref<NodeListOf<E>>>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import {
|
|
2
|
+
tryOnMounted,
|
|
3
|
+
useMutationObserver
|
|
4
|
+
} from "@vueuse/core";
|
|
5
|
+
import {
|
|
6
|
+
watch,
|
|
7
|
+
unref,
|
|
8
|
+
shallowRef
|
|
9
|
+
} from "vue";
|
|
10
|
+
export function useSelector(selector, container = document.body, all = false) {
|
|
11
|
+
const element = shallowRef();
|
|
12
|
+
function getElement() {
|
|
13
|
+
element.value = all ? unref(container)?.querySelectorAll(unref(selector)) : unref(container)?.querySelector(unref(selector));
|
|
14
|
+
}
|
|
15
|
+
watch(() => unref(selector), () => {
|
|
16
|
+
getElement();
|
|
17
|
+
});
|
|
18
|
+
useMutationObserver(container, (mutations) => {
|
|
19
|
+
if (mutations.some((mutation) => mutation.type === "childList"))
|
|
20
|
+
getElement();
|
|
21
|
+
}, { childList: true, subtree: true });
|
|
22
|
+
tryOnMounted(() => {
|
|
23
|
+
getElement();
|
|
24
|
+
});
|
|
25
|
+
return element;
|
|
26
|
+
}
|