@privyid/persona 1.1.2 → 1.2.1-rc.0
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/module.d.cts +2 -0
- package/dist/module.d.mts +2 -27
- package/dist/module.json +12 -0
- package/dist/module.mjs +13 -92
- package/dist/types.d.mts +13 -0
- package/package.json +25 -27
- package/dist/components/accordion/Accordion.vue +0 -121
- package/dist/components/accordion/AccordionItem.vue +0 -250
- package/dist/components/accordion/AccordionItems.vue +0 -50
- package/dist/components/accordion/AccordionItems.vue.d.ts +0 -41
- package/dist/components/accordion/index.d.ts +0 -7
- package/dist/components/accordion/index.mjs +0 -3
- package/dist/components/aspect-ratio/index.d.ts +0 -3
- package/dist/components/aspect-ratio/index.mjs +0 -21
- package/dist/components/aspect-ratio/utils/calculate-ratio.d.ts +0 -7
- package/dist/components/aspect-ratio/utils/calculate-ratio.mjs +0 -10
- package/dist/components/aspect-ratio/utils/resize-observer.d.ts +0 -1
- package/dist/components/aspect-ratio/utils/resize-observer.mjs +0 -22
- package/dist/components/avatar/Avatar.vue +0 -193
- package/dist/components/avatar/AvatarGroup.vue +0 -42
- package/dist/components/avatar/AvatarTruncate.vue +0 -33
- package/dist/components/avatar/AvatarTruncate.vue.d.ts +0 -31
- 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 +0 -2
- package/dist/components/avatar/index.mjs +0 -0
- package/dist/components/avatar/utils/color-hash.d.ts +0 -2
- package/dist/components/avatar/utils/color-hash.mjs +0 -22
- package/dist/components/avatar/utils/create-image.d.ts +0 -5
- package/dist/components/avatar/utils/create-image.mjs +0 -19
- package/dist/components/avatar/utils/load-image.d.ts +0 -1
- package/dist/components/avatar/utils/load-image.mjs +0 -22
- package/dist/components/badge/Badge.vue +0 -218
- package/dist/components/badge/index.d.ts +0 -1
- package/dist/components/badge/index.mjs +0 -0
- package/dist/components/banner/Banner.vue +0 -213
- package/dist/components/banner/index.d.ts +0 -1
- package/dist/components/banner/index.mjs +0 -0
- package/dist/components/breadcrumbs/Breadcrumb.vue +0 -62
- package/dist/components/breadcrumbs/BreadcrumbItem.vue +0 -95
- package/dist/components/breadcrumbs/BreadcrumbItemDropdown.vue +0 -78
- package/dist/components/breadcrumbs/index.d.ts +0 -11
- package/dist/components/breadcrumbs/index.mjs +0 -3
- package/dist/components/button/Button.vue +0 -422
- package/dist/components/button/index.d.ts +0 -5
- package/dist/components/button/index.mjs +0 -0
- package/dist/components/button-group/ButtonGroup.vue +0 -220
- package/dist/components/button-group/index.d.ts +0 -6
- package/dist/components/button-group/index.mjs +0 -1
- package/dist/components/calendar/Calendar.vue +0 -465
- package/dist/components/calendar/adapter/adapter.d.ts +0 -32
- package/dist/components/calendar/adapter/adapter.mjs +0 -43
- package/dist/components/calendar/adapter/date.d.ts +0 -2
- package/dist/components/calendar/adapter/date.mjs +0 -86
- package/dist/components/calendar/adapter/month.d.ts +0 -2
- package/dist/components/calendar/adapter/month.mjs +0 -66
- package/dist/components/calendar/adapter/year.d.ts +0 -2
- package/dist/components/calendar/adapter/year.mjs +0 -63
- package/dist/components/camera/Camera.vue +0 -416
- package/dist/components/camera/adapter/adapter.d.ts +0 -41
- package/dist/components/camera/adapter/adapter.mjs +0 -3
- package/dist/components/camera/adapter/capture.d.ts +0 -5
- package/dist/components/camera/adapter/capture.mjs +0 -12
- package/dist/components/camera/adapter/liveness.d.ts +0 -5
- package/dist/components/camera/adapter/liveness.mjs +0 -46
- package/dist/components/camera/adapter/qr-code.d.ts +0 -2
- package/dist/components/camera/adapter/qr-code.mjs +0 -19
- package/dist/components/camera/assets/shutter.wav +0 -0
- package/dist/components/camera/utils/motion.d.ts +0 -29
- package/dist/components/camera/utils/motion.mjs +0 -88
- package/dist/components/camera/utils/take-picture.d.ts +0 -1
- package/dist/components/camera/utils/take-picture.mjs +0 -14
- package/dist/components/caption/Caption.vue +0 -122
- package/dist/components/caption/index.d.ts +0 -1
- package/dist/components/caption/index.mjs +0 -0
- package/dist/components/card/Card.vue +0 -354
- package/dist/components/card/CardSection.vue +0 -81
- package/dist/components/card/index.d.ts +0 -2
- package/dist/components/card/index.mjs +0 -0
- package/dist/components/carousel/Carousel.vue +0 -202
- package/dist/components/carousel/CarouselBody.vue +0 -18
- package/dist/components/carousel/CarouselItem.vue +0 -10
- package/dist/components/carousel/index.d.ts +0 -4
- package/dist/components/carousel/index.mjs +0 -1
- package/dist/components/chart/Chart.vue +0 -155
- package/dist/components/chart/ChartSet.vue +0 -32
- package/dist/components/chart/ChartVal.vue +0 -36
- package/dist/components/chart/adapter/adapter.d.ts +0 -7
- package/dist/components/chart/adapter/adapter.mjs +0 -3
- package/dist/components/chart/adapter/bubble.d.ts +0 -2
- package/dist/components/chart/adapter/bubble.mjs +0 -26
- package/dist/components/chart/adapter/index.d.ts +0 -3
- package/dist/components/chart/adapter/index.mjs +0 -16
- package/dist/components/chart/adapter/line.d.ts +0 -2
- package/dist/components/chart/adapter/line.mjs +0 -66
- package/dist/components/chart/adapter/pie.d.ts +0 -2
- package/dist/components/chart/adapter/pie.mjs +0 -34
- package/dist/components/chart/index.d.ts +0 -2
- package/dist/components/chart/index.mjs +0 -0
- package/dist/components/chart/utils/use-chart.d.ts +0 -2
- package/dist/components/chart/utils/use-chart.mjs +0 -9
- package/dist/components/checkbox/Checkbox.vue +0 -232
- package/dist/components/checkbox/icon/IconCheckbox.vue +0 -13
- package/dist/components/checkbox/icon/IconInderteminate.vue +0 -12
- package/dist/components/checkbox/index.d.ts +0 -7
- package/dist/components/checkbox/index.mjs +0 -34
- package/dist/components/collapse/Collapse.vue +0 -71
- package/dist/components/contextual-bar/ContextualBar.vue +0 -461
- package/dist/components/contextual-bar/index.d.ts +0 -1
- package/dist/components/contextual-bar/index.mjs +0 -0
- package/dist/components/cropper/Cropper.vue +0 -446
- package/dist/components/cropper/index.d.ts +0 -1
- package/dist/components/cropper/index.mjs +0 -3
- package/dist/components/cropper/utils/crop-image.d.ts +0 -44
- package/dist/components/cropper/utils/crop-image.mjs +0 -43
- package/dist/components/cropper/utils/use-pinch.d.ts +0 -8
- package/dist/components/cropper/utils/use-pinch.mjs +0 -50
- package/dist/components/cropper/utils/use-preview.d.ts +0 -3
- package/dist/components/cropper/utils/use-preview.mjs +0 -21
- package/dist/components/cropper/utils/use-ratio.d.ts +0 -9
- package/dist/components/cropper/utils/use-ratio.mjs +0 -24
- package/dist/components/datepicker/Datepicker.vue +0 -235
- package/dist/components/dialog/Dialog.vue +0 -149
- package/dist/components/dialog/DialogFooter.vue +0 -138
- package/dist/components/dialog/index.d.ts +0 -52
- package/dist/components/dialog/index.mjs +0 -86
- package/dist/components/divider/Divider.vue +0 -65
- package/dist/components/dot/Dot.vue +0 -103
- package/dist/components/dot/index.d.ts +0 -1
- package/dist/components/dot/index.mjs +0 -0
- package/dist/components/dropdown/Dropdown.vue +0 -441
- package/dist/components/dropdown/DropdownHeader.vue +0 -33
- package/dist/components/dropdown/DropdownItem.vue +0 -103
- package/dist/components/dropdown/DropdownText.vue +0 -34
- package/dist/components/dropdown/index.d.ts +0 -10
- package/dist/components/dropdown/index.mjs +0 -1
- package/dist/components/dropdown/utils/use-focus.d.ts +0 -5
- package/dist/components/dropdown/utils/use-focus.mjs +0 -22
- package/dist/components/dropdown-subitem/DropdownSubitem.vue +0 -182
- package/dist/components/dropdown-subitem/index.d.ts +0 -12
- package/dist/components/dropdown-subitem/index.mjs +0 -1
- package/dist/components/dropzone/Dropzone.vue +0 -261
- package/dist/components/dropzone/index.d.ts +0 -4
- package/dist/components/dropzone/index.mjs +0 -0
- package/dist/components/dropzone/utils/accept.d.ts +0 -1
- package/dist/components/dropzone/utils/accept.mjs +0 -17
- package/dist/components/filterbar/Filterbar.vue +0 -103
- package/dist/components/filterbar/Filterbar.vue.d.ts +0 -40
- package/dist/components/filterbar/index.d.ts +0 -45
- package/dist/components/filterbar/index.mjs +0 -7
- package/dist/components/filterbar/pinned/PinnedDate.vue +0 -100
- package/dist/components/filterbar/pinned/PinnedDate.vue.d.ts +0 -72
- package/dist/components/filterbar/pinned/PinnedMultiselect.vue +0 -113
- package/dist/components/filterbar/pinned/PinnedMultiselect.vue.d.ts +0 -48
- package/dist/components/filterbar/pinned/PinnedSelect.vue +0 -100
- package/dist/components/filterbar/pinned/PinnedSelect.vue.d.ts +0 -47
- package/dist/components/filterbar/pinned/PinnedToggle.vue +0 -77
- package/dist/components/filterbar/pinned/PinnedToggle.vue.d.ts +0 -59
- package/dist/components/form-group/FormGroup.vue +0 -169
- package/dist/components/global/router.d.ts +0 -24
- package/dist/components/global/router.mjs +0 -7
- package/dist/components/global/store.d.ts +0 -49
- package/dist/components/global/store.mjs +0 -52
- package/dist/components/global/types.d.ts +0 -4
- package/dist/components/global/types.mjs +0 -0
- package/dist/components/global/use-singleton.d.ts +0 -21
- package/dist/components/global/use-singleton.mjs +0 -60
- package/dist/components/global/utils/queue.d.ts +0 -16
- package/dist/components/global/utils/queue.mjs +0 -35
- package/dist/components/heading/Heading.vue +0 -140
- package/dist/components/heading/index.d.ts +0 -3
- package/dist/components/heading/index.mjs +0 -0
- package/dist/components/input/Input.vue +0 -243
- package/dist/components/input/index.d.ts +0 -6
- package/dist/components/input/index.mjs +0 -25
- package/dist/components/input/utils/accept.d.ts +0 -26
- package/dist/components/input/utils/accept.mjs +0 -81
- package/dist/components/input-color/index.d.ts +0 -1
- package/dist/components/input-color/index.mjs +0 -0
- package/dist/components/input-color/inputColor.vue +0 -264
- package/dist/components/input-file/InputFile.vue +0 -221
- package/dist/components/input-group/InputGroup.vue +0 -188
- package/dist/components/input-group/InputGroupAddon.vue +0 -42
- package/dist/components/input-group/index.d.ts +0 -6
- package/dist/components/input-group/index.mjs +0 -1
- package/dist/components/input-password/InputPassword.vue +0 -110
- package/dist/components/input-password/index.d.ts +0 -2
- package/dist/components/input-password/index.mjs +0 -17
- package/dist/components/input-pin/InputPin.vue +0 -170
- package/dist/components/input-pin/index.d.ts +0 -6
- package/dist/components/input-pin/index.mjs +0 -3
- package/dist/components/input-range/InputRange.vue +0 -303
- package/dist/components/input-range/utils/use-drag.d.ts +0 -3
- package/dist/components/input-range/utils/use-drag.mjs +0 -26
- package/dist/components/label/Label.vue +0 -265
- package/dist/components/label/index.d.ts +0 -1
- package/dist/components/label/index.mjs +0 -0
- package/dist/components/list-group/ListGroup.vue +0 -75
- package/dist/components/list-group/ListGroupItem.vue +0 -88
- package/dist/components/list-group/index.d.ts +0 -1
- package/dist/components/list-group/index.mjs +0 -0
- package/dist/components/main/Main.vue +0 -66
- package/dist/components/markdown/index.d.ts +0 -29
- package/dist/components/markdown/index.mjs +0 -25
- package/dist/components/meta.json +0 -171
- package/dist/components/modal/Modal.vue +0 -546
- package/dist/components/modal/index.d.ts +0 -1
- package/dist/components/modal/index.mjs +0 -0
- package/dist/components/nav/Nav.vue +0 -416
- package/dist/components/nav/NavCollapse.vue +0 -66
- package/dist/components/nav/NavForm.vue +0 -23
- package/dist/components/nav/NavItem.vue +0 -187
- package/dist/components/nav/NavItemDropdown.vue +0 -120
- package/dist/components/nav/NavSubItem.vue +0 -194
- package/dist/components/nav/NavText.vue +0 -19
- package/dist/components/nav/index.d.ts +0 -2
- package/dist/components/nav/index.mjs +0 -0
- package/dist/components/navbar/Navbar.vue +0 -284
- package/dist/components/navbar/NavbarBrand.vue +0 -31
- package/dist/components/navbar/NavbarNav.vue +0 -114
- package/dist/components/navbar/NavbarToggle.vue +0 -72
- package/dist/components/navbar/index.d.ts +0 -9
- package/dist/components/navbar/index.mjs +0 -1
- package/dist/components/navbar-menu/NavbarNavMenu.vue +0 -59
- package/dist/components/notify/Notify.vue +0 -51
- package/dist/components/notify/NotifyGroup.vue +0 -244
- package/dist/components/notify/NotifyItem.vue +0 -45
- package/dist/components/notify/index.d.ts +0 -20
- package/dist/components/notify/index.mjs +0 -18
- package/dist/components/overlay/Overlay.vue +0 -68
- package/dist/components/overlay/assets/icon-white.svg +0 -1
- package/dist/components/overlay/index.d.ts +0 -2
- package/dist/components/overlay/index.mjs +0 -8
- package/dist/components/overlay/utils/use-loading.d.ts +0 -4
- package/dist/components/overlay/utils/use-loading.mjs +0 -28
- package/dist/components/page/Page.vue +0 -106
- package/dist/components/pagination/Pagination.vue +0 -415
- package/dist/components/pagination/index.d.ts +0 -14
- package/dist/components/pagination/index.mjs +0 -38
- package/dist/components/pagination/utils/calculate-page.d.ts +0 -11
- package/dist/components/pagination/utils/calculate-page.mjs +0 -48
- package/dist/components/pdf-helipad/PdfHelipad.vue +0 -147
- package/dist/components/pdf-helipad/index.d.ts +0 -7
- package/dist/components/pdf-helipad/index.mjs +0 -0
- package/dist/components/pdf-helipad/utils/use-drag.d.ts +0 -3
- package/dist/components/pdf-helipad/utils/use-drag.mjs +0 -38
- package/dist/components/pdf-object/PdfObject.vue +0 -348
- package/dist/components/pdf-object/PdfObjectAddon.vue +0 -55
- package/dist/components/pdf-object/PdfObjectDebugger.vue +0 -70
- package/dist/components/pdf-object/PdfObjects.vue +0 -39
- package/dist/components/pdf-object/index.d.ts +0 -63
- package/dist/components/pdf-object/index.mjs +0 -110
- package/dist/components/pdf-object/utils/overlap.d.ts +0 -51
- package/dist/components/pdf-object/utils/overlap.mjs +0 -54
- package/dist/components/pdf-object/utils/position.d.ts +0 -64
- package/dist/components/pdf-object/utils/position.mjs +0 -48
- package/dist/components/pdf-object/utils/use-drag.d.ts +0 -9
- package/dist/components/pdf-object/utils/use-drag.mjs +0 -69
- package/dist/components/pdf-object/utils/use-drop.d.ts +0 -7
- package/dist/components/pdf-object/utils/use-drop.mjs +0 -57
- package/dist/components/pdf-object/utils/use-resize.d.ts +0 -17
- package/dist/components/pdf-object/utils/use-resize.mjs +0 -90
- package/dist/components/pdf-object/utils/use-selector.d.ts +0 -4
- package/dist/components/pdf-object/utils/use-selector.mjs +0 -26
- package/dist/components/pdf-text/PdfText.vue +0 -138
- package/dist/components/pdf-text/utils/text-to-image.d.ts +0 -68
- package/dist/components/pdf-text/utils/text-to-image.mjs +0 -120
- package/dist/components/pdf-viewer/PdfError.vue +0 -74
- package/dist/components/pdf-viewer/PdfLoading.vue +0 -24
- package/dist/components/pdf-viewer/PdfNavigation.vue +0 -169
- package/dist/components/pdf-viewer/PdfViewer.vue +0 -377
- package/dist/components/pdf-viewer/assets/pdf-loading.svg +0 -1
- package/dist/components/pdf-viewer/index.d.ts +0 -25
- package/dist/components/pdf-viewer/index.mjs +0 -24
- package/dist/components/pdf-viewer/utils/pdfjs.d.ts +0 -68
- package/dist/components/pdf-viewer/utils/pdfjs.mjs +0 -54
- package/dist/components/pdf-viewer/utils/use-idle.d.ts +0 -2
- package/dist/components/pdf-viewer/utils/use-idle.mjs +0 -25
- package/dist/components/pdf-viewer/utils/use-sticky.d.ts +0 -6
- package/dist/components/pdf-viewer/utils/use-sticky.mjs +0 -49
- package/dist/components/pdf-viewer/utils/use-viewer.d.ts +0 -27
- package/dist/components/pdf-viewer/utils/use-viewer.mjs +0 -191
- package/dist/components/popover/Popover.vue +0 -131
- package/dist/components/popover/index.d.ts +0 -17
- package/dist/components/popover/index.mjs +0 -52
- package/dist/components/popup/Popup.vue +0 -428
- package/dist/components/popup/index.d.ts +0 -38
- package/dist/components/popup/index.mjs +0 -31
- package/dist/components/progress/Progress.vue +0 -221
- package/dist/components/progress/ProgressItem.vue +0 -56
- package/dist/components/progress/index.d.ts +0 -2
- package/dist/components/progress/index.mjs +0 -0
- package/dist/components/progress-indicator/ProgressIndicator.vue +0 -132
- package/dist/components/progressbar/Progressbar.vue +0 -113
- package/dist/components/progressbar/index.d.ts +0 -7
- package/dist/components/progressbar/index.mjs +0 -11
- package/dist/components/pspdfkit/PspdfHelipad.vue +0 -165
- package/dist/components/pspdfkit/PspdfObject.vue +0 -341
- package/dist/components/pspdfkit/PspdfObjectAddon.vue +0 -30
- package/dist/components/pspdfkit/PspdfObjects.vue +0 -30
- package/dist/components/pspdfkit/PspdfViewer.vue +0 -257
- package/dist/components/pspdfkit/css/custom.css +0 -345
- package/dist/components/pspdfkit/index.d.ts +0 -8
- package/dist/components/pspdfkit/index.mjs +0 -7
- package/dist/components/pspdfkit/utils/position.d.ts +0 -1
- package/dist/components/pspdfkit/utils/position.mjs +0 -5
- package/dist/components/pspdfkit/utils/pspdfkit.d.ts +0 -17
- package/dist/components/pspdfkit/utils/pspdfkit.mjs +0 -53
- package/dist/components/pspdfkit/utils/use-drop.d.ts +0 -2
- package/dist/components/pspdfkit/utils/use-drop.mjs +0 -41
- package/dist/components/pspdfkit/utils/use-viewer.d.ts +0 -17
- package/dist/components/pspdfkit/utils/use-viewer.mjs +0 -167
- package/dist/components/qrcode/Qrcode.vue +0 -174
- package/dist/components/qrcode/index.d.ts +0 -1
- package/dist/components/qrcode/index.mjs +0 -0
- package/dist/components/radio/Radio.vue +0 -304
- package/dist/components/radio/index.d.ts +0 -7
- package/dist/components/radio/index.mjs +0 -16
- package/dist/components/richtext/Richtext.vue +0 -295
- package/dist/components/richtext/RichtextToolbarAdvance.vue +0 -37
- package/dist/components/richtext/RichtextToolbarSimple.vue +0 -158
- package/dist/components/richtext/control/RichtextControlFontFamily.vue +0 -56
- package/dist/components/richtext/control/RichtextControlFontSize.vue +0 -81
- package/dist/components/richtext/control/RichtextControlHighlight.vue +0 -135
- package/dist/components/richtext/control/RichtextControlHistory.vue +0 -27
- package/dist/components/richtext/control/RichtextControlImage.vue +0 -34
- package/dist/components/richtext/control/RichtextControlLink.vue +0 -53
- package/dist/components/richtext/control/RichtextControlList.vue +0 -45
- package/dist/components/richtext/control/RichtextControlTable.vue +0 -106
- package/dist/components/richtext/control/RichtextControlTextAlign.vue +0 -90
- package/dist/components/richtext/control/RichtextControlTextFormat.vue +0 -49
- package/dist/components/richtext/control/RichtextControlTextHeading.vue +0 -101
- package/dist/components/richtext/index.d.ts +0 -7
- package/dist/components/richtext/index.mjs +0 -7
- package/dist/components/richtext/popup/RichtextPopupImageEdit.vue +0 -65
- package/dist/components/richtext/popup/RichtextPopupLinkDetail.vue +0 -95
- package/dist/components/richtext/popup/RichtextPopupLinkEdit.vue +0 -74
- package/dist/components/richtext/tiptap/image-align.d.ts +0 -43
- package/dist/components/richtext/tiptap/image-align.mjs +0 -60
- package/dist/components/ringbar/Ringbar.vue +0 -158
- package/dist/components/ringbar/index.d.ts +0 -1
- package/dist/components/ringbar/index.mjs +0 -0
- package/dist/components/select/Select.vue +0 -576
- package/dist/components/select/SelectInput.vue +0 -123
- package/dist/components/select/SelectTags.vue +0 -58
- package/dist/components/select/adapter/adapter.d.ts +0 -17
- package/dist/components/select/adapter/adapter.mjs +0 -20
- package/dist/components/select/adapter/async-adapter.d.ts +0 -17
- package/dist/components/select/adapter/async-adapter.mjs +0 -61
- package/dist/components/select/adapter/basic-adapter.d.ts +0 -5
- package/dist/components/select/adapter/basic-adapter.mjs +0 -13
- package/dist/components/select/adapter/fuzzy-adapter.d.ts +0 -2
- package/dist/components/select/adapter/fuzzy-adapter.mjs +0 -24
- package/dist/components/select/index.d.ts +0 -15
- package/dist/components/select/index.mjs +0 -20
- package/dist/components/select/utils/use-on-scroll.d.ts +0 -2
- package/dist/components/select/utils/use-on-scroll.mjs +0 -9
- package/dist/components/select/utils/use-on-typing.d.ts +0 -3
- package/dist/components/select/utils/use-on-typing.mjs +0 -8
- package/dist/components/sheet/Sheet.vue +0 -230
- package/dist/components/shimmer/Shimmer.vue +0 -123
- package/dist/components/shimmer/index.d.ts +0 -2
- package/dist/components/shimmer/index.mjs +0 -10
- package/dist/components/sidebar/Sidebar.vue +0 -249
- package/dist/components/sidebar/SidebarBrand.vue +0 -108
- package/dist/components/sidebar/SidebarContent.vue +0 -21
- package/dist/components/sidebar/SidebarContent.vue.d.ts +0 -16
- package/dist/components/sidebar/SidebarNav.vue +0 -260
- package/dist/components/sidebar/index.d.ts +0 -9
- package/dist/components/sidebar/index.mjs +0 -1
- package/dist/components/sidebar-menu/SidebarMenu.vue +0 -123
- package/dist/components/sidebar-menu/SidebarMenuItem.vue +0 -70
- package/dist/components/sidebar-menu/index.d.ts +0 -138
- package/dist/components/sidebar-menu/index.mjs +0 -44
- package/dist/components/signature-draw/SignatureDraw.vue +0 -101
- package/dist/components/signature-draw/SignatureDrawDesktop.vue +0 -165
- package/dist/components/signature-draw/SignatureDrawMobile.vue +0 -244
- package/dist/components/signature-draw/utils/canvas.d.ts +0 -41
- package/dist/components/signature-draw/utils/canvas.mjs +0 -55
- package/dist/components/signature-draw/utils/image.d.ts +0 -7
- package/dist/components/signature-draw/utils/image.mjs +0 -23
- package/dist/components/signature-draw/utils/smooth-line.d.ts +0 -36
- package/dist/components/signature-draw/utils/smooth-line.mjs +0 -56
- package/dist/components/signature-draw/utils/straight-line.d.ts +0 -8
- package/dist/components/signature-draw/utils/straight-line.mjs +0 -24
- package/dist/components/signature-draw/utils/use-draw.d.ts +0 -7
- package/dist/components/signature-draw/utils/use-draw.mjs +0 -29
- package/dist/components/signature-text/SignatureText.vue +0 -138
- package/dist/components/signature-text/utils/formatter.d.ts +0 -2
- package/dist/components/signature-text/utils/formatter.mjs +0 -8
- package/dist/components/signature-text/utils/generate-text.d.ts +0 -8
- package/dist/components/signature-text/utils/generate-text.mjs +0 -28
- package/dist/components/signature-text/utils/load-font.d.ts +0 -1
- package/dist/components/signature-text/utils/load-font.mjs +0 -22
- package/dist/components/spinner/Spinner.vue +0 -156
- package/dist/components/spinner/SpinnerRing.vue +0 -34
- package/dist/components/spinner/SpinnerRinggo.vue +0 -64
- package/dist/components/spread/Spread.vue +0 -52
- package/dist/components/steps/Step.vue +0 -49
- package/dist/components/steps/StepSlider.vue +0 -37
- package/dist/components/steps/StepSlider.vue.d.ts +0 -34
- package/dist/components/steps/Steps.vue +0 -150
- package/dist/components/steps/index.d.ts +0 -30
- package/dist/components/steps/index.mjs +0 -53
- package/dist/components/steps/utils/hook.d.ts +0 -10
- package/dist/components/steps/utils/hook.mjs +0 -35
- package/dist/components/strengthbar/Strengthbar.vue +0 -97
- package/dist/components/subheading/Subheading.vue +0 -148
- package/dist/components/subheading/index.d.ts +0 -1
- package/dist/components/subheading/index.mjs +0 -0
- package/dist/components/table/Table.vue +0 -391
- package/dist/components/table/Table.vue.d.ts +0 -174
- package/dist/components/table/index.d.ts +0 -49
- package/dist/components/table/index.mjs +0 -37
- package/dist/components/table-flex/TableFlex.vue +0 -341
- package/dist/components/table-static/TableStatic.vue +0 -458
- package/dist/components/table-static/TableStaticRoot.vue +0 -42
- package/dist/components/table-static/TableStaticSort.vue +0 -23
- package/dist/components/table-static/index.d.ts +0 -64
- package/dist/components/table-static/index.mjs +0 -24
- package/dist/components/tabs/Tab.vue +0 -34
- package/dist/components/tabs/TabContent.vue +0 -53
- package/dist/components/tabs/TabContent.vue.d.ts +0 -33
- package/dist/components/tabs/Tabs.vue +0 -234
- package/dist/components/text/Text.vue +0 -235
- package/dist/components/text/index.d.ts +0 -2
- package/dist/components/text/index.mjs +0 -0
- package/dist/components/textarea/Textarea.vue +0 -188
- package/dist/components/time/Time.vue +0 -257
- package/dist/components/time/TimeItem.vue +0 -117
- package/dist/components/time/index.d.ts +0 -19
- package/dist/components/time/index.mjs +0 -53
- package/dist/components/time/utils/index.d.ts +0 -9
- package/dist/components/time/utils/index.mjs +0 -82
- package/dist/components/timepicker/Timepicker.vue +0 -230
- package/dist/components/toast/Toast.vue +0 -269
- package/dist/components/toast/index.d.ts +0 -50
- package/dist/components/toast/index.mjs +0 -44
- package/dist/components/toggle/Toggle.vue +0 -239
- package/dist/components/tooltip/Tooltip.vue +0 -172
- package/dist/components/tooltip/TooltipContainer.vue +0 -89
- package/dist/components/tooltip/index.d.ts +0 -17
- package/dist/components/tooltip/index.mjs +0 -113
- package/dist/components/tooltip/utils/create-handler.d.ts +0 -9
- package/dist/components/tooltip/utils/create-handler.mjs +0 -16
- package/dist/components/tooltip/utils/on-hover.d.ts +0 -23
- package/dist/components/tooltip/utils/on-hover.mjs +0 -42
- package/dist/components/tooltip/utils/parse-bindings.d.ts +0 -23
- package/dist/components/tooltip/utils/parse-bindings.mjs +0 -47
- package/dist/components/tour/Tour.vue +0 -112
- package/dist/components/tour/TourDialog.vue +0 -207
- package/dist/components/tour/TourHighlight.vue +0 -58
- package/dist/components/tour/core/base.d.ts +0 -59
- package/dist/components/tour/core/base.mjs +0 -69
- package/dist/components/tour/core/step/action.d.ts +0 -15
- package/dist/components/tour/core/step/action.mjs +0 -14
- package/dist/components/tour/core/step/conditional.d.ts +0 -25
- package/dist/components/tour/core/step/conditional.mjs +0 -57
- package/dist/components/tour/core/step/delay.d.ts +0 -8
- package/dist/components/tour/core/step/delay.mjs +0 -9
- package/dist/components/tour/core/step/dialog.d.ts +0 -11
- package/dist/components/tour/core/step/dialog.mjs +0 -25
- package/dist/components/tour/core/step/visit.d.ts +0 -9
- package/dist/components/tour/core/step/visit.mjs +0 -15
- package/dist/components/tour/core/step.d.ts +0 -37
- package/dist/components/tour/core/step.mjs +0 -46
- package/dist/components/tour/core/story.d.ts +0 -130
- package/dist/components/tour/core/story.mjs +0 -166
- package/dist/components/tour/core/tour.d.ts +0 -126
- package/dist/components/tour/core/tour.mjs +0 -196
- package/dist/components/tour/index.d.ts +0 -3
- package/dist/components/tour/index.mjs +0 -4
- package/dist/components/tour/utils/focus.d.ts +0 -1
- package/dist/components/tour/utils/focus.mjs +0 -6
- package/dist/components/tour/utils/is-visible.d.ts +0 -1
- package/dist/components/tour/utils/is-visible.mjs +0 -29
- package/dist/components/tour/utils/wait-element.d.ts +0 -6
- package/dist/components/tour/utils/wait-element.mjs +0 -45
- package/dist/components/truncate/Truncate.vue +0 -75
- package/dist/components/utils/array.d.ts +0 -2
- package/dist/components/utils/array.mjs +0 -19
- package/dist/components/utils/base64.d.ts +0 -8
- package/dist/components/utils/base64.mjs +0 -35
- package/dist/components/utils/color.d.ts +0 -17
- package/dist/components/utils/color.mjs +0 -14
- package/dist/components/utils/date.d.ts +0 -22
- package/dist/components/utils/date.mjs +0 -14
- package/dist/components/utils/value.d.ts +0 -8
- package/dist/components/utils/value.mjs +0 -7
- package/dist/components/utils/vnode.d.ts +0 -15
- package/dist/components/utils/vnode.mjs +0 -18
- package/dist/components/wizard/Wizard.vue +0 -84
- package/dist/components/wizard/WizardBody.vue +0 -50
- package/dist/components/wizard/WizardHeader.vue +0 -38
- package/dist/components/wizard/WizardHeader.vue.d.ts +0 -16
- package/dist/components/wizard/WizardStep.vue +0 -31
- package/dist/core/index.d.ts +0 -43
- package/dist/core/index.mjs +0 -148
- package/dist/directive/index.d.ts +0 -3
- package/dist/directive/index.mjs +0 -12
- package/dist/module.cjs +0 -5
- package/dist/module.d.ts +0 -27
- package/dist/runtime/plugins/persona.d.ts +0 -2
- package/dist/runtime/plugins/persona.js +0 -35
|
@@ -1,341 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div
|
|
3
|
-
ref="content"
|
|
4
|
-
data-testid="pdf-object"
|
|
5
|
-
class="pdf-object pspdf-object"
|
|
6
|
-
tabindex="0"
|
|
7
|
-
:data-x="objectX"
|
|
8
|
-
:data-y="objectY"
|
|
9
|
-
:data-page="objectPage"
|
|
10
|
-
:data-width="objectWidth"
|
|
11
|
-
:data-height="objectHeight">
|
|
12
|
-
<div class="pdf-object__container">
|
|
13
|
-
<slot />
|
|
14
|
-
<PdfObjectDebugger v-if="debug && isSelected" />
|
|
15
|
-
</div>
|
|
16
|
-
</div>
|
|
17
|
-
</template>
|
|
18
|
-
|
|
19
|
-
<script lang="ts" setup>
|
|
20
|
-
import {
|
|
21
|
-
ref,
|
|
22
|
-
provide,
|
|
23
|
-
watch,
|
|
24
|
-
onMounted,
|
|
25
|
-
onBeforeUnmount,
|
|
26
|
-
inject,
|
|
27
|
-
} from 'vue-demi'
|
|
28
|
-
import PdfObjectDebugger from '../pdf-object/PdfObjectDebugger.vue'
|
|
29
|
-
import {
|
|
30
|
-
syncRef,
|
|
31
|
-
useVModel,
|
|
32
|
-
watchIgnorable,
|
|
33
|
-
} from '@vueuse/core'
|
|
34
|
-
import {
|
|
35
|
-
PDF_OBJECTS_CONTEXT,
|
|
36
|
-
PDF_OBJECT_CONTEXT,
|
|
37
|
-
useObjectModel,
|
|
38
|
-
} from '../pdf-object'
|
|
39
|
-
import type { List, AnnotationsUnion } from 'pspdfkit'
|
|
40
|
-
import { usePspdf } from '.'
|
|
41
|
-
import type { ObjectPosition } from '../pdf-object/utils/overlap'
|
|
42
|
-
import { getEmptyPosition } from '../pdf-object/utils/overlap'
|
|
43
|
-
import {
|
|
44
|
-
createRect,
|
|
45
|
-
generateInstantId,
|
|
46
|
-
createRectangleAnnotation,
|
|
47
|
-
createColor,
|
|
48
|
-
importList,
|
|
49
|
-
} from './utils/pspdfkit'
|
|
50
|
-
|
|
51
|
-
const props = defineProps({
|
|
52
|
-
x: {
|
|
53
|
-
type : Number,
|
|
54
|
-
default: undefined,
|
|
55
|
-
},
|
|
56
|
-
y: {
|
|
57
|
-
type : Number,
|
|
58
|
-
default: undefined,
|
|
59
|
-
},
|
|
60
|
-
page: {
|
|
61
|
-
type : Number,
|
|
62
|
-
default: undefined,
|
|
63
|
-
},
|
|
64
|
-
width: {
|
|
65
|
-
type : Number,
|
|
66
|
-
default: 198,
|
|
67
|
-
},
|
|
68
|
-
height: {
|
|
69
|
-
type : Number,
|
|
70
|
-
default: 106,
|
|
71
|
-
},
|
|
72
|
-
minWidth: {
|
|
73
|
-
type : Number,
|
|
74
|
-
default: undefined,
|
|
75
|
-
},
|
|
76
|
-
minHeight: {
|
|
77
|
-
type : Number,
|
|
78
|
-
default: undefined,
|
|
79
|
-
},
|
|
80
|
-
maxWidth: {
|
|
81
|
-
type : Number,
|
|
82
|
-
default: undefined,
|
|
83
|
-
},
|
|
84
|
-
maxHeight: {
|
|
85
|
-
type : Number,
|
|
86
|
-
default: undefined,
|
|
87
|
-
},
|
|
88
|
-
moveable: {
|
|
89
|
-
type : Boolean,
|
|
90
|
-
default: true,
|
|
91
|
-
},
|
|
92
|
-
resizable: {
|
|
93
|
-
type : Boolean,
|
|
94
|
-
default: true,
|
|
95
|
-
},
|
|
96
|
-
autofocus: {
|
|
97
|
-
type : Boolean,
|
|
98
|
-
default: false,
|
|
99
|
-
},
|
|
100
|
-
debug: {
|
|
101
|
-
type : Boolean,
|
|
102
|
-
default: false,
|
|
103
|
-
},
|
|
104
|
-
})
|
|
105
|
-
|
|
106
|
-
defineEmits<{
|
|
107
|
-
'update:x': [number],
|
|
108
|
-
'update:y': [number],
|
|
109
|
-
'update:page': [number],
|
|
110
|
-
'update:width': [number],
|
|
111
|
-
'update:height': [number],
|
|
112
|
-
}>()
|
|
113
|
-
|
|
114
|
-
const content = ref<HTMLDivElement>()
|
|
115
|
-
const vX = useVModel(props, 'x')
|
|
116
|
-
const vY = useVModel(props, 'y')
|
|
117
|
-
const vPage = useVModel(props, 'page')
|
|
118
|
-
const vWidth = useVModel(props, 'width')
|
|
119
|
-
const vHeight = useVModel(props, 'height')
|
|
120
|
-
|
|
121
|
-
const { instance, contents } = usePspdf()
|
|
122
|
-
const { objects } = inject(PDF_OBJECTS_CONTEXT)
|
|
123
|
-
const objectId = ref<string>()
|
|
124
|
-
const isSelected = ref(false)
|
|
125
|
-
|
|
126
|
-
const {
|
|
127
|
-
id,
|
|
128
|
-
x: objectX,
|
|
129
|
-
y: objectY,
|
|
130
|
-
page: objectPage,
|
|
131
|
-
width: objectWidth,
|
|
132
|
-
height: objectHeight,
|
|
133
|
-
minHeight,
|
|
134
|
-
minWidth,
|
|
135
|
-
maxHeight,
|
|
136
|
-
maxWidth,
|
|
137
|
-
ratio,
|
|
138
|
-
} = useObjectModel(props)
|
|
139
|
-
|
|
140
|
-
const { ignoreUpdates } = watchIgnorable([
|
|
141
|
-
objectX,
|
|
142
|
-
objectY,
|
|
143
|
-
objectWidth,
|
|
144
|
-
objectHeight,
|
|
145
|
-
], async () => {
|
|
146
|
-
await updateAnnotation()
|
|
147
|
-
})
|
|
148
|
-
|
|
149
|
-
watch(objectPage, async (value, oldValue) => {
|
|
150
|
-
if (value !== oldValue) {
|
|
151
|
-
await removeAnnotation()
|
|
152
|
-
await createAnnotation()
|
|
153
|
-
}
|
|
154
|
-
})
|
|
155
|
-
|
|
156
|
-
watch(() => props.moveable, async (moveable) => {
|
|
157
|
-
if (objectId.value) {
|
|
158
|
-
const objects = await instance.value.getAnnotations(objectPage.value - 1)
|
|
159
|
-
const object = objects.find((o) => o.id === objectId.value)
|
|
160
|
-
|
|
161
|
-
if (object)
|
|
162
|
-
await instance.value.update(object.set('readOnly', !moveable))
|
|
163
|
-
}
|
|
164
|
-
})
|
|
165
|
-
|
|
166
|
-
async function createAnnotation () {
|
|
167
|
-
if (objectPage.value > 0 && objectPage.value <= instance.value.totalPageCount) {
|
|
168
|
-
objectId.value = await generateInstantId()
|
|
169
|
-
|
|
170
|
-
contents.set(objectId.value, content.value)
|
|
171
|
-
|
|
172
|
-
await instance.value.create(
|
|
173
|
-
await createRectangleAnnotation({
|
|
174
|
-
id : objectId.value,
|
|
175
|
-
pageIndex : objectPage.value - 1,
|
|
176
|
-
boundingBox: await createRect({
|
|
177
|
-
left : objectX.value * 0.75,
|
|
178
|
-
top : objectY.value * 0.75,
|
|
179
|
-
width : objectWidth.value * 0.75,
|
|
180
|
-
height: objectHeight.value * 0.75,
|
|
181
|
-
}),
|
|
182
|
-
strokeColor: await createColor({ transparent: true }),
|
|
183
|
-
fillColor : await createColor({ transparent: true }),
|
|
184
|
-
customData : {
|
|
185
|
-
minWidth : minWidth.value * 0.75,
|
|
186
|
-
minHeight: minHeight.value * 0.75,
|
|
187
|
-
maxWidth : maxWidth.value * 0.75,
|
|
188
|
-
maxHeight: maxHeight.value * 0.75,
|
|
189
|
-
},
|
|
190
|
-
readOnly: !props.moveable,
|
|
191
|
-
}),
|
|
192
|
-
)
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
async function updateAnnotation () {
|
|
197
|
-
const objects = await instance.value.getAnnotations(objectPage.value - 1)
|
|
198
|
-
const object = objects.find((o) => o.id === objectId.value)
|
|
199
|
-
|
|
200
|
-
if (object) {
|
|
201
|
-
await instance.value.update(
|
|
202
|
-
object.set('boundingBox', object.boundingBox.merge({
|
|
203
|
-
left : objectX.value * 0.75,
|
|
204
|
-
top : objectY.value * 0.75,
|
|
205
|
-
width : objectWidth.value * 0.75,
|
|
206
|
-
height: objectHeight.value * 0.75,
|
|
207
|
-
})),
|
|
208
|
-
)
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
async function removeAnnotation () {
|
|
213
|
-
if (objectId.value) {
|
|
214
|
-
await instance.value.delete(objectId.value)
|
|
215
|
-
|
|
216
|
-
contents.delete(objectId.value)
|
|
217
|
-
|
|
218
|
-
objectId.value = undefined
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
function autoPosition () {
|
|
223
|
-
const otherObjects = [...objects.values()].filter((obj) => {
|
|
224
|
-
return obj.id !== id
|
|
225
|
-
&& Number.isFinite(obj.x)
|
|
226
|
-
&& Number.isFinite(obj.y)
|
|
227
|
-
&& obj.page === objectPage.value
|
|
228
|
-
})
|
|
229
|
-
|
|
230
|
-
const size = {
|
|
231
|
-
width : objectWidth.value,
|
|
232
|
-
height: objectHeight.value,
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
const pageInfo = instance.value.pageInfoForIndex(objectPage.value - 1)
|
|
236
|
-
const offside = {
|
|
237
|
-
width : pageInfo.width / 0.75,
|
|
238
|
-
height: pageInfo.height / 0.75,
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
const center = getEmptyPosition({
|
|
242
|
-
size : size,
|
|
243
|
-
offside: offside,
|
|
244
|
-
objects: otherObjects as ObjectPosition[],
|
|
245
|
-
})
|
|
246
|
-
|
|
247
|
-
objectX.value = center.x
|
|
248
|
-
objectY.value = center.y
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
function onAnnotationChange (annotations: List<AnnotationsUnion>) {
|
|
252
|
-
const object = annotations.find((i) => i.id === objectId.value)
|
|
253
|
-
|
|
254
|
-
if (object) {
|
|
255
|
-
ignoreUpdates(() => {
|
|
256
|
-
objectX.value = object.boundingBox.left / 0.75
|
|
257
|
-
objectY.value = object.boundingBox.top / 0.75
|
|
258
|
-
objectWidth.value = object.boundingBox.width / 0.75
|
|
259
|
-
objectHeight.value = object.boundingBox.height / 0.75
|
|
260
|
-
})
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
async function onAnnotationMounted (annotations: List<AnnotationsUnion>) {
|
|
265
|
-
if (props.autofocus && objectId.value) {
|
|
266
|
-
const object = annotations.find((i) => i.id === objectId.value)
|
|
267
|
-
|
|
268
|
-
if (object) {
|
|
269
|
-
const List = await importList()
|
|
270
|
-
|
|
271
|
-
instance.value.setSelectedAnnotations(List([objectId.value]))
|
|
272
|
-
instance.value.jumpToRect(objectPage.value - 1, object.boundingBox)
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
async function onAnnotationSelected (annotations: List<AnnotationsUnion>) {
|
|
278
|
-
const object = annotations.find((i) => i.id === objectId.value)
|
|
279
|
-
|
|
280
|
-
if (object) {
|
|
281
|
-
const root = instance.value.contentDocument.querySelector('.PSPDFKit-Root')
|
|
282
|
-
|
|
283
|
-
if (root) {
|
|
284
|
-
root.setAttribute('resizable', `${props.resizable}`)
|
|
285
|
-
root.setAttribute('moveable', `${props.moveable}`)
|
|
286
|
-
}
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
isSelected.value = !!object
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
onMounted(async () => {
|
|
293
|
-
if (instance.value && content.value) {
|
|
294
|
-
if (!Number.isFinite(objectX.value) || !Number.isFinite(objectY.value))
|
|
295
|
-
autoPosition()
|
|
296
|
-
|
|
297
|
-
instance.value.addEventListener('annotations.update', onAnnotationChange)
|
|
298
|
-
instance.value.addEventListener('annotations.create', onAnnotationMounted)
|
|
299
|
-
instance.value.addEventListener('annotationSelection.change', onAnnotationSelected as any)
|
|
300
|
-
|
|
301
|
-
await createAnnotation()
|
|
302
|
-
}
|
|
303
|
-
})
|
|
304
|
-
|
|
305
|
-
onBeforeUnmount(async () => {
|
|
306
|
-
if (instance.value) {
|
|
307
|
-
await removeAnnotation()
|
|
308
|
-
|
|
309
|
-
instance.value.removeEventListener('annotations.update', onAnnotationChange)
|
|
310
|
-
instance.value.removeEventListener('annotations.create', onAnnotationMounted)
|
|
311
|
-
instance.value.removeEventListener('annotationSelection.change', onAnnotationSelected as any)
|
|
312
|
-
}
|
|
313
|
-
})
|
|
314
|
-
|
|
315
|
-
syncRef(objectX, vX)
|
|
316
|
-
syncRef(objectY, vY)
|
|
317
|
-
syncRef(objectPage, vPage)
|
|
318
|
-
syncRef(objectWidth, vWidth)
|
|
319
|
-
syncRef(objectHeight, vHeight)
|
|
320
|
-
|
|
321
|
-
// Provide some data for debug
|
|
322
|
-
provide(PDF_OBJECT_CONTEXT, {
|
|
323
|
-
id,
|
|
324
|
-
x : objectX,
|
|
325
|
-
y : objectY,
|
|
326
|
-
page : objectPage,
|
|
327
|
-
width : objectWidth,
|
|
328
|
-
height: objectHeight,
|
|
329
|
-
minHeight,
|
|
330
|
-
minWidth,
|
|
331
|
-
maxHeight,
|
|
332
|
-
maxWidth,
|
|
333
|
-
ratio,
|
|
334
|
-
})
|
|
335
|
-
</script>
|
|
336
|
-
|
|
337
|
-
<style lang="postcss">
|
|
338
|
-
.pspdf-object {
|
|
339
|
-
@apply hidden;
|
|
340
|
-
}
|
|
341
|
-
</style>
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div
|
|
3
|
-
data-testid="pdf-object-addon"
|
|
4
|
-
class="pdf-object__addon"
|
|
5
|
-
:class="classNames">
|
|
6
|
-
<slot />
|
|
7
|
-
</div>
|
|
8
|
-
</template>
|
|
9
|
-
|
|
10
|
-
<script lang="ts" setup>
|
|
11
|
-
import type { PropType } from 'vue-demi'
|
|
12
|
-
import { computed } from 'vue-demi'
|
|
13
|
-
import type { AddonPositionVariant } from '../pdf-object'
|
|
14
|
-
|
|
15
|
-
const props = defineProps({
|
|
16
|
-
position: {
|
|
17
|
-
type : String as PropType<AddonPositionVariant>,
|
|
18
|
-
default: 'right',
|
|
19
|
-
},
|
|
20
|
-
})
|
|
21
|
-
|
|
22
|
-
const classNames = computed(() => {
|
|
23
|
-
const result: string[] = []
|
|
24
|
-
|
|
25
|
-
if (props.position)
|
|
26
|
-
result.push(`pdf-object__addon--${props.position}`)
|
|
27
|
-
|
|
28
|
-
return result
|
|
29
|
-
})
|
|
30
|
-
</script>
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div
|
|
3
|
-
ref="root"
|
|
4
|
-
class="pdf-objects"
|
|
5
|
-
data-testid="pdf-objects">
|
|
6
|
-
<slot />
|
|
7
|
-
</div>
|
|
8
|
-
</template>
|
|
9
|
-
|
|
10
|
-
<script lang="ts" setup>
|
|
11
|
-
import {
|
|
12
|
-
ref,
|
|
13
|
-
provide,
|
|
14
|
-
} from 'vue-demi'
|
|
15
|
-
import { PDF_OBJECTS_CONTEXT } from '../pdf-object/'
|
|
16
|
-
import { usePdfContext } from '../pdf-viewer'
|
|
17
|
-
import useDrop from './utils/use-drop'
|
|
18
|
-
|
|
19
|
-
const objects = new Map()
|
|
20
|
-
const root = ref<HTMLDivElement>()
|
|
21
|
-
const pdfContext = usePdfContext()
|
|
22
|
-
|
|
23
|
-
useDrop(root)
|
|
24
|
-
|
|
25
|
-
provide(PDF_OBJECTS_CONTEXT, {
|
|
26
|
-
...pdfContext,
|
|
27
|
-
objects,
|
|
28
|
-
root,
|
|
29
|
-
})
|
|
30
|
-
</script>
|
|
@@ -1,257 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div
|
|
3
|
-
ref="root"
|
|
4
|
-
v-p-aspect-ratio="layout === 'fixed' ? Number(ratio) : 0"
|
|
5
|
-
data-testid="pdf-viewer"
|
|
6
|
-
class="pdf"
|
|
7
|
-
:class="classNames">
|
|
8
|
-
<div
|
|
9
|
-
class="pdf__header">
|
|
10
|
-
<slot
|
|
11
|
-
name="header"
|
|
12
|
-
:page="pdfPage"
|
|
13
|
-
:scale="pdfScale"
|
|
14
|
-
:total-page="totalPage"
|
|
15
|
-
:zoom-in="zoomIn"
|
|
16
|
-
:zoom-out="zoomOut"
|
|
17
|
-
:next="next"
|
|
18
|
-
:prev="prev"
|
|
19
|
-
:instance="instance" />
|
|
20
|
-
</div>
|
|
21
|
-
|
|
22
|
-
<PdfObjects
|
|
23
|
-
class="pdf__wrapper">
|
|
24
|
-
<!-- Minimum PDFJS Viewer -->
|
|
25
|
-
<div
|
|
26
|
-
ref="container"
|
|
27
|
-
class="pdf__container pdfContainer" />
|
|
28
|
-
|
|
29
|
-
<div v-if="instance">
|
|
30
|
-
<slot />
|
|
31
|
-
</div>
|
|
32
|
-
|
|
33
|
-
<!-- Minimum PDFJS Viewer end -->
|
|
34
|
-
<transition name="slide-up">
|
|
35
|
-
<PdfNavigation
|
|
36
|
-
v-show="!idle && !loading && !error" />
|
|
37
|
-
</transition>
|
|
38
|
-
</PdfObjects>
|
|
39
|
-
</div>
|
|
40
|
-
</template>
|
|
41
|
-
|
|
42
|
-
<script lang="ts" setup>
|
|
43
|
-
import type { Instance } from 'pspdfkit'
|
|
44
|
-
import { vPAspectRatio } from '../aspect-ratio'
|
|
45
|
-
import {
|
|
46
|
-
type PropType,
|
|
47
|
-
onMounted,
|
|
48
|
-
ref,
|
|
49
|
-
toRef,
|
|
50
|
-
watch,
|
|
51
|
-
provide,
|
|
52
|
-
computed,
|
|
53
|
-
} from 'vue-demi'
|
|
54
|
-
import PdfObjects from './PspdfObjects.vue'
|
|
55
|
-
import PdfNavigation from '../pdf-viewer/PdfNavigation.vue'
|
|
56
|
-
import { PDF_VIEWER_CONTEXT, type LayoutVariant } from '../pdf-viewer'
|
|
57
|
-
import { useSticky } from '../pdf-viewer/utils/use-sticky'
|
|
58
|
-
import {
|
|
59
|
-
syncRef,
|
|
60
|
-
useToNumber,
|
|
61
|
-
useVModel,
|
|
62
|
-
watchDebounced,
|
|
63
|
-
} from '@vueuse/core'
|
|
64
|
-
import { useViewer, type OpenDocConfig } from './utils/use-viewer'
|
|
65
|
-
import { useIdle } from '../pdf-viewer/utils/use-idle'
|
|
66
|
-
|
|
67
|
-
const props = defineProps({
|
|
68
|
-
src: {
|
|
69
|
-
type : String,
|
|
70
|
-
default: '',
|
|
71
|
-
},
|
|
72
|
-
page: {
|
|
73
|
-
type : Number,
|
|
74
|
-
default: 1,
|
|
75
|
-
},
|
|
76
|
-
scale: {
|
|
77
|
-
type : Number,
|
|
78
|
-
default: 1,
|
|
79
|
-
},
|
|
80
|
-
password: {
|
|
81
|
-
type : String,
|
|
82
|
-
default: undefined,
|
|
83
|
-
},
|
|
84
|
-
layout: {
|
|
85
|
-
type : String as PropType<LayoutVariant>,
|
|
86
|
-
default: 'fixed',
|
|
87
|
-
},
|
|
88
|
-
ratio: {
|
|
89
|
-
type : [Number, String],
|
|
90
|
-
default: 210 / 297,
|
|
91
|
-
},
|
|
92
|
-
offsetTop: {
|
|
93
|
-
type : [Number, String],
|
|
94
|
-
default: 0,
|
|
95
|
-
},
|
|
96
|
-
config: {
|
|
97
|
-
type : [Object] as PropType<OpenDocConfig>,
|
|
98
|
-
default: () => ({}),
|
|
99
|
-
},
|
|
100
|
-
})
|
|
101
|
-
|
|
102
|
-
const emit = defineEmits<{
|
|
103
|
-
'ready': [Instance],
|
|
104
|
-
'loaded': [Instance],
|
|
105
|
-
'error': [Error],
|
|
106
|
-
'error-password': [Error],
|
|
107
|
-
'update:page': [number],
|
|
108
|
-
'update:scale': [number],
|
|
109
|
-
}>()
|
|
110
|
-
|
|
111
|
-
const root = ref<HTMLDivElement>()
|
|
112
|
-
const container = ref<HTMLDivElement>()
|
|
113
|
-
const viewer = ref<HTMLDivElement>()
|
|
114
|
-
const idle = useIdle(container)
|
|
115
|
-
|
|
116
|
-
const vPage = useVModel(props, 'page')
|
|
117
|
-
const vScale = useVModel(props, 'scale')
|
|
118
|
-
|
|
119
|
-
const offsetTop = useToNumber(toRef(props, 'offsetTop'), { nanToZero: true })
|
|
120
|
-
const enableSticky = useSticky(root, { offsetTop: offsetTop })
|
|
121
|
-
|
|
122
|
-
const classNames = computed(() => {
|
|
123
|
-
const result: string[] = []
|
|
124
|
-
|
|
125
|
-
if (props.layout)
|
|
126
|
-
result.push(`pdf-viewer--layout-${props.layout}`)
|
|
127
|
-
|
|
128
|
-
return result
|
|
129
|
-
})
|
|
130
|
-
|
|
131
|
-
const {
|
|
132
|
-
instance,
|
|
133
|
-
page: pdfPage,
|
|
134
|
-
scale: pdfScale,
|
|
135
|
-
totalPage,
|
|
136
|
-
openDoc,
|
|
137
|
-
closeDoc,
|
|
138
|
-
loading,
|
|
139
|
-
error,
|
|
140
|
-
onLoaded,
|
|
141
|
-
onError,
|
|
142
|
-
onReady,
|
|
143
|
-
} = useViewer(container)
|
|
144
|
-
|
|
145
|
-
watchDebounced(() => [props.src, props.password], ([src, password]) => {
|
|
146
|
-
openDoc(src, password, props.config)
|
|
147
|
-
}, { debounce: 500 })
|
|
148
|
-
|
|
149
|
-
watch(() => props.layout, (layout) => {
|
|
150
|
-
enableSticky.value = layout === 'fit'
|
|
151
|
-
}, { immediate: true })
|
|
152
|
-
|
|
153
|
-
onMounted(async () => {
|
|
154
|
-
if (props.src)
|
|
155
|
-
openDoc(props.src, props.password, props.config)
|
|
156
|
-
})
|
|
157
|
-
|
|
158
|
-
onLoaded((doc) => {
|
|
159
|
-
emit('loaded', doc)
|
|
160
|
-
})
|
|
161
|
-
|
|
162
|
-
onError((error_) => {
|
|
163
|
-
if (error_.message === 'INVALID_PASSWORD')
|
|
164
|
-
emit('error-password', error_)
|
|
165
|
-
|
|
166
|
-
emit('error', error_)
|
|
167
|
-
})
|
|
168
|
-
|
|
169
|
-
onReady((pdfViewer) => {
|
|
170
|
-
emit('ready', pdfViewer)
|
|
171
|
-
})
|
|
172
|
-
|
|
173
|
-
function zoomIn () {
|
|
174
|
-
pdfScale.value = (Math.round(pdfScale.value / 0.1) * 0.1) + 0.1
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
function zoomOut () {
|
|
178
|
-
pdfScale.value = (Math.round(pdfScale.value / 0.1) * 0.1) - 0.1
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
function next () {
|
|
182
|
-
pdfPage.value++
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
function prev () {
|
|
186
|
-
pdfPage.value--
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
function first () {
|
|
190
|
-
pdfPage.value = 1
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
function last () {
|
|
194
|
-
pdfPage.value = totalPage.value
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
provide(PDF_VIEWER_CONTEXT, {
|
|
198
|
-
page : pdfPage,
|
|
199
|
-
scale: pdfScale,
|
|
200
|
-
totalPage,
|
|
201
|
-
zoomIn,
|
|
202
|
-
zoomOut,
|
|
203
|
-
next,
|
|
204
|
-
prev,
|
|
205
|
-
first,
|
|
206
|
-
last,
|
|
207
|
-
})
|
|
208
|
-
|
|
209
|
-
syncRef(pdfPage, vPage)
|
|
210
|
-
syncRef(pdfScale, vScale)
|
|
211
|
-
|
|
212
|
-
defineExpose({
|
|
213
|
-
page : pdfPage,
|
|
214
|
-
scale: pdfScale,
|
|
215
|
-
root,
|
|
216
|
-
container,
|
|
217
|
-
viewer,
|
|
218
|
-
loading,
|
|
219
|
-
totalPage,
|
|
220
|
-
zoomIn,
|
|
221
|
-
zoomOut,
|
|
222
|
-
next,
|
|
223
|
-
prev,
|
|
224
|
-
openDoc,
|
|
225
|
-
closeDoc,
|
|
226
|
-
instance,
|
|
227
|
-
})
|
|
228
|
-
</script>
|
|
229
|
-
|
|
230
|
-
<style lang="postcss">
|
|
231
|
-
.pdf {
|
|
232
|
-
--p-pdf-container-width: 793px;
|
|
233
|
-
|
|
234
|
-
@apply relative overflow-hidden w-full flex flex-col bg-base z-1;
|
|
235
|
-
@apply dark:bg-dark-base;
|
|
236
|
-
|
|
237
|
-
&__wrapper {
|
|
238
|
-
@apply relative h-full w-full grow;
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
&__container {
|
|
242
|
-
-webkit-overflow-scrolling: touch;
|
|
243
|
-
|
|
244
|
-
@apply absolute inset-0 h-full w-full overflow-auto shadow-inner;
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
&__header {
|
|
248
|
-
@apply z-1 bg-default shadow-lg;
|
|
249
|
-
@apply dark:bg-dark-default;
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
&__footer {
|
|
253
|
-
@apply z-1 bg-default shadow-lg-top;
|
|
254
|
-
@apply dark:bg-dark-default;
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
</style>
|