@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,66 @@
|
|
|
1
|
+
import {
|
|
2
|
+
addYears,
|
|
3
|
+
eachMonthOfInterval,
|
|
4
|
+
endOfYear,
|
|
5
|
+
isAfter,
|
|
6
|
+
isBefore,
|
|
7
|
+
isDate,
|
|
8
|
+
isSameMonth,
|
|
9
|
+
isWithinInterval,
|
|
10
|
+
set,
|
|
11
|
+
startOfYear,
|
|
12
|
+
subYears
|
|
13
|
+
} from "date-fns";
|
|
14
|
+
import { defineAdapter } from "./adapter.mjs";
|
|
15
|
+
import { formatDate } from "../../utils/date.mjs";
|
|
16
|
+
function getInterval(date) {
|
|
17
|
+
const start = startOfYear(date);
|
|
18
|
+
const end = endOfYear(date);
|
|
19
|
+
return {
|
|
20
|
+
start,
|
|
21
|
+
end
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
export default defineAdapter({
|
|
25
|
+
getItems({ cursor, start, end, min, max }) {
|
|
26
|
+
return eachMonthOfInterval(getInterval(cursor.value)).map((date) => {
|
|
27
|
+
const isDisabled = !isSameMonth(min.value, date) && !isSameMonth(max.value, date) && !isWithinInterval(date, { start: min.value, end: max.value });
|
|
28
|
+
const isHead = isSameMonth(start.value, date);
|
|
29
|
+
const isTail = isSameMonth(end.value, date);
|
|
30
|
+
return {
|
|
31
|
+
value: date,
|
|
32
|
+
text: formatDate(date, "MMM"),
|
|
33
|
+
disabled: isDisabled,
|
|
34
|
+
readonly: false,
|
|
35
|
+
head: isHead,
|
|
36
|
+
tail: isTail,
|
|
37
|
+
active: isHead || isTail
|
|
38
|
+
};
|
|
39
|
+
});
|
|
40
|
+
},
|
|
41
|
+
getTitle({ cursor }) {
|
|
42
|
+
return cursor.value.getFullYear().toString();
|
|
43
|
+
},
|
|
44
|
+
getNextCursor({ cursor }) {
|
|
45
|
+
return addYears(cursor.value, 1);
|
|
46
|
+
},
|
|
47
|
+
getPrevCursor({ cursor }) {
|
|
48
|
+
return subYears(cursor.value, 1);
|
|
49
|
+
},
|
|
50
|
+
canNext(context) {
|
|
51
|
+
const max = context.max.value;
|
|
52
|
+
const date = this.getNextCursor(context);
|
|
53
|
+
return !max || isBefore(date, max) || isWithinInterval(max, getInterval(date));
|
|
54
|
+
},
|
|
55
|
+
canPrev(context) {
|
|
56
|
+
const min = context.min.value;
|
|
57
|
+
const date = this.getPrevCursor(context);
|
|
58
|
+
return !min || isAfter(date, min) || isWithinInterval(min, getInterval(date));
|
|
59
|
+
},
|
|
60
|
+
setValue(value, lastValue) {
|
|
61
|
+
return isDate(lastValue) ? set(lastValue, {
|
|
62
|
+
year: value.getFullYear(),
|
|
63
|
+
month: value.getMonth()
|
|
64
|
+
}) : value;
|
|
65
|
+
}
|
|
66
|
+
});
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { defineAdapter } from "./adapter.mjs";
|
|
2
|
+
import {
|
|
3
|
+
addYears,
|
|
4
|
+
eachYearOfInterval,
|
|
5
|
+
endOfDecade,
|
|
6
|
+
isDate,
|
|
7
|
+
isAfter,
|
|
8
|
+
isBefore,
|
|
9
|
+
isSameYear,
|
|
10
|
+
isWithinInterval,
|
|
11
|
+
set,
|
|
12
|
+
startOfDecade,
|
|
13
|
+
subYears
|
|
14
|
+
} from "date-fns";
|
|
15
|
+
function getInterval(date) {
|
|
16
|
+
const start = startOfDecade(date);
|
|
17
|
+
const end = endOfDecade(date);
|
|
18
|
+
return {
|
|
19
|
+
start,
|
|
20
|
+
end
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
export default defineAdapter({
|
|
24
|
+
getItems({ cursor, start, end, min, max }) {
|
|
25
|
+
return eachYearOfInterval(getInterval(cursor.value)).map((date) => {
|
|
26
|
+
const isDisabled = !isSameYear(min.value, date) && !isSameYear(max.value, date) && !isWithinInterval(date, { start: min.value, end: max.value });
|
|
27
|
+
const isHead = isSameYear(start.value, date);
|
|
28
|
+
const isTail = isSameYear(end.value, date);
|
|
29
|
+
return {
|
|
30
|
+
value: date,
|
|
31
|
+
text: date.getFullYear().toString(),
|
|
32
|
+
disabled: isDisabled,
|
|
33
|
+
readonly: false,
|
|
34
|
+
head: isHead,
|
|
35
|
+
tail: isTail,
|
|
36
|
+
active: isHead || isTail
|
|
37
|
+
};
|
|
38
|
+
});
|
|
39
|
+
},
|
|
40
|
+
getTitle({ cursor }) {
|
|
41
|
+
const { start, end } = getInterval(cursor.value);
|
|
42
|
+
return `${start.getFullYear()} - ${end.getFullYear()}`;
|
|
43
|
+
},
|
|
44
|
+
getNextCursor({ cursor }) {
|
|
45
|
+
return startOfDecade(addYears(cursor.value, 10));
|
|
46
|
+
},
|
|
47
|
+
getPrevCursor({ cursor }) {
|
|
48
|
+
return startOfDecade(subYears(cursor.value, 10));
|
|
49
|
+
},
|
|
50
|
+
canNext(context) {
|
|
51
|
+
const max = context.max.value;
|
|
52
|
+
const date = this.getNextCursor(context);
|
|
53
|
+
return !max || isBefore(date, max) || isWithinInterval(max, getInterval(date));
|
|
54
|
+
},
|
|
55
|
+
canPrev(context) {
|
|
56
|
+
const min = context.min.value;
|
|
57
|
+
const date = this.getPrevCursor(context);
|
|
58
|
+
return !min || isAfter(date, min) || isWithinInterval(min, getInterval(date));
|
|
59
|
+
},
|
|
60
|
+
setValue(value, lastValue) {
|
|
61
|
+
return isDate(lastValue) ? set(lastValue, { year: value.getFullYear() }) : value;
|
|
62
|
+
}
|
|
63
|
+
});
|
|
@@ -0,0 +1,356 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
v-p-aspect-ratio.fixed="4 / 3"
|
|
4
|
+
class="camera"
|
|
5
|
+
data-testid="camera"
|
|
6
|
+
:data-deviceid="deviceId"
|
|
7
|
+
:class="classNames">
|
|
8
|
+
<video
|
|
9
|
+
v-if="stream"
|
|
10
|
+
ref="video"
|
|
11
|
+
data-testid="camera-video"
|
|
12
|
+
:srcObject.prop="stream"
|
|
13
|
+
class="camera__video"
|
|
14
|
+
autoplay
|
|
15
|
+
muted
|
|
16
|
+
playsinline
|
|
17
|
+
@play="onStart" />
|
|
18
|
+
|
|
19
|
+
<!-- Result -->
|
|
20
|
+
<img
|
|
21
|
+
v-if="isTaken && !stream"
|
|
22
|
+
data-testid="camera-result"
|
|
23
|
+
class="camera__result"
|
|
24
|
+
:src="preview"
|
|
25
|
+
alt="camera-result">
|
|
26
|
+
|
|
27
|
+
<!-- Camera off -->
|
|
28
|
+
<span
|
|
29
|
+
v-if="!isActive && !isTaken"
|
|
30
|
+
data-testid="camera-off"
|
|
31
|
+
class="camera__off-info">
|
|
32
|
+
Camera is off
|
|
33
|
+
</span>
|
|
34
|
+
|
|
35
|
+
<!-- Mask -->
|
|
36
|
+
<div class="camera__mask-container">
|
|
37
|
+
<div
|
|
38
|
+
v-if="!isTaken"
|
|
39
|
+
data-testid="camera-mask"
|
|
40
|
+
class="camera__mask" />
|
|
41
|
+
</div>
|
|
42
|
+
|
|
43
|
+
<!-- Toast -->
|
|
44
|
+
<transition name="slide-up">
|
|
45
|
+
<div
|
|
46
|
+
v-if="message"
|
|
47
|
+
:key="message"
|
|
48
|
+
class="camera__toast">
|
|
49
|
+
<div
|
|
50
|
+
data-testid="camera-toast"
|
|
51
|
+
class="camera__toast-text">
|
|
52
|
+
{{ message }}
|
|
53
|
+
</div>
|
|
54
|
+
</div>
|
|
55
|
+
</transition>
|
|
56
|
+
|
|
57
|
+
<!-- Control Button -->
|
|
58
|
+
<div class="camera__controls">
|
|
59
|
+
<p-button
|
|
60
|
+
v-if="cameras.length > 1 && !isTaken"
|
|
61
|
+
data-testid="camera-toggle"
|
|
62
|
+
color="danger"
|
|
63
|
+
size="sm"
|
|
64
|
+
icon
|
|
65
|
+
pill
|
|
66
|
+
@click="toggle">
|
|
67
|
+
<icon-rotate />
|
|
68
|
+
</p-button>
|
|
69
|
+
|
|
70
|
+
<!-- Main Button -->
|
|
71
|
+
<p-button
|
|
72
|
+
v-if="!isActive && !isTaken"
|
|
73
|
+
data-testid="camera-turn-on"
|
|
74
|
+
class="camera__main-control"
|
|
75
|
+
color="danger"
|
|
76
|
+
icon
|
|
77
|
+
pill
|
|
78
|
+
@click="turnOn()">
|
|
79
|
+
<icon-camera />
|
|
80
|
+
</p-button>
|
|
81
|
+
<p-button
|
|
82
|
+
v-else-if="isActive && !isTaken"
|
|
83
|
+
data-testid="camera-take"
|
|
84
|
+
class="camera__main-control"
|
|
85
|
+
color="danger"
|
|
86
|
+
icon
|
|
87
|
+
pill
|
|
88
|
+
:disabled="isProcessing"
|
|
89
|
+
@click="take()">
|
|
90
|
+
<icon-camera />
|
|
91
|
+
</p-button>
|
|
92
|
+
<p-button
|
|
93
|
+
v-else
|
|
94
|
+
data-testid="camera-retake"
|
|
95
|
+
class="camera__main-control"
|
|
96
|
+
color="danger"
|
|
97
|
+
icon
|
|
98
|
+
pill
|
|
99
|
+
@click="retake()">
|
|
100
|
+
<icon-retake />
|
|
101
|
+
</p-button>
|
|
102
|
+
<!-- End Main Button -->
|
|
103
|
+
</div>
|
|
104
|
+
<audio
|
|
105
|
+
ref="shutter"
|
|
106
|
+
:src="ShutterWav"
|
|
107
|
+
:muted="silent" />
|
|
108
|
+
|
|
109
|
+
<slot
|
|
110
|
+
:cameras="cameras"
|
|
111
|
+
:preview="preview"
|
|
112
|
+
:stream="stream"
|
|
113
|
+
:video="video"
|
|
114
|
+
:shutter="shutter"
|
|
115
|
+
:toast="toast" />
|
|
116
|
+
</div>
|
|
117
|
+
</template>
|
|
118
|
+
|
|
119
|
+
<script setup>
|
|
120
|
+
import {
|
|
121
|
+
computed,
|
|
122
|
+
onBeforeUnmount,
|
|
123
|
+
onMounted,
|
|
124
|
+
ref,
|
|
125
|
+
toRef
|
|
126
|
+
} from "vue";
|
|
127
|
+
import pButton from "../button/Button.vue";
|
|
128
|
+
import IconRotate from "@privyid/persona-icon/vue/refresh/16.vue";
|
|
129
|
+
import IconCamera from "@privyid/persona-icon/vue/camera/24.vue";
|
|
130
|
+
import IconRetake from "@privyid/persona-icon/vue/reset/24.vue";
|
|
131
|
+
import ShutterWav from "./assets/shutter.wav";
|
|
132
|
+
import { useVModel } from "../input";
|
|
133
|
+
import CaptureAdapter from "./adapter/capture";
|
|
134
|
+
import {
|
|
135
|
+
usePermission,
|
|
136
|
+
useDevicesList,
|
|
137
|
+
useUserMedia,
|
|
138
|
+
until
|
|
139
|
+
} from "@vueuse/core";
|
|
140
|
+
import * as dialog from "../dialog";
|
|
141
|
+
import defu from "defu";
|
|
142
|
+
import { vPAspectRatio } from "../aspect-ratio";
|
|
143
|
+
const props = defineProps({
|
|
144
|
+
modelValue: {
|
|
145
|
+
type: [
|
|
146
|
+
globalThis.File,
|
|
147
|
+
String,
|
|
148
|
+
Array
|
|
149
|
+
],
|
|
150
|
+
default: ""
|
|
151
|
+
},
|
|
152
|
+
modelModifiers: {
|
|
153
|
+
type: Object,
|
|
154
|
+
default: () => ({})
|
|
155
|
+
},
|
|
156
|
+
mirror: {
|
|
157
|
+
type: [Boolean, String],
|
|
158
|
+
default: void 0
|
|
159
|
+
},
|
|
160
|
+
mask: {
|
|
161
|
+
type: String,
|
|
162
|
+
default: void 0
|
|
163
|
+
},
|
|
164
|
+
adapter: {
|
|
165
|
+
type: Object,
|
|
166
|
+
default: CaptureAdapter
|
|
167
|
+
},
|
|
168
|
+
facingMode: {
|
|
169
|
+
type: String,
|
|
170
|
+
default: void 0
|
|
171
|
+
},
|
|
172
|
+
silent: {
|
|
173
|
+
type: Boolean,
|
|
174
|
+
default: false
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
const emit = defineEmits(["update:modelValue", "result", "change", "start"]);
|
|
178
|
+
const model = useVModel(props);
|
|
179
|
+
const modifier = toRef(props, "modelModifiers");
|
|
180
|
+
const isProcessing = ref(false);
|
|
181
|
+
const isTaken = ref(false);
|
|
182
|
+
const preview = ref("");
|
|
183
|
+
const message = ref("");
|
|
184
|
+
const shutter = ref();
|
|
185
|
+
const video = ref();
|
|
186
|
+
const permission = usePermission("camera", { controls: true });
|
|
187
|
+
const camera = ref(0);
|
|
188
|
+
const meta = computed(() => {
|
|
189
|
+
return defu({
|
|
190
|
+
mirror: props.mirror,
|
|
191
|
+
mask: props.mask,
|
|
192
|
+
facingMode: props.facingMode
|
|
193
|
+
}, props.adapter.meta, { autoStart: false });
|
|
194
|
+
});
|
|
195
|
+
const { videoInputs: cameras } = useDevicesList({
|
|
196
|
+
requestPermissions: false,
|
|
197
|
+
constraints: { video: { facingMode: meta.value.facingMode } }
|
|
198
|
+
});
|
|
199
|
+
const deviceId = computed(() => {
|
|
200
|
+
return cameras.value?.at(camera.value)?.deviceId;
|
|
201
|
+
});
|
|
202
|
+
const constraints = computed(() => {
|
|
203
|
+
return {
|
|
204
|
+
video: { deviceId: deviceId.value },
|
|
205
|
+
audio: false
|
|
206
|
+
};
|
|
207
|
+
});
|
|
208
|
+
const { stream, start, stop, enabled: isActive } = useUserMedia({ constraints });
|
|
209
|
+
const classNames = computed(() => {
|
|
210
|
+
const result = [];
|
|
211
|
+
if (meta.value.mirror)
|
|
212
|
+
result.push("camera--mirror");
|
|
213
|
+
if (meta.value.mask)
|
|
214
|
+
result.push(`camera__mask--${meta.value.mask}`);
|
|
215
|
+
else
|
|
216
|
+
result.push("camera__mask--none");
|
|
217
|
+
return result;
|
|
218
|
+
});
|
|
219
|
+
async function turnOn() {
|
|
220
|
+
if (permission.state.value === "denied") {
|
|
221
|
+
await dialog.alert({
|
|
222
|
+
title: "Camera Access Blocked",
|
|
223
|
+
text: "Privy need to access your internal camera to process this journey",
|
|
224
|
+
confirm: { text: "Ok" },
|
|
225
|
+
footerAlign: "end"
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
if (permission.state.value === "prompt") {
|
|
229
|
+
await dialog.alert({
|
|
230
|
+
title: "Camera Access Required",
|
|
231
|
+
text: "Privy need to access your internal camera to process this journey",
|
|
232
|
+
confirm: { text: "Ok" },
|
|
233
|
+
footerAlign: "end"
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
await start();
|
|
237
|
+
if (typeof video.value?.play === "function")
|
|
238
|
+
await video.value.play();
|
|
239
|
+
}
|
|
240
|
+
function toggle() {
|
|
241
|
+
camera.value = (camera.value + 1) % cameras.value.length;
|
|
242
|
+
}
|
|
243
|
+
function toast(text) {
|
|
244
|
+
message.value = text;
|
|
245
|
+
}
|
|
246
|
+
async function take() {
|
|
247
|
+
isProcessing.value = true;
|
|
248
|
+
const output = await props.adapter.run({
|
|
249
|
+
video,
|
|
250
|
+
toast,
|
|
251
|
+
stream,
|
|
252
|
+
meta,
|
|
253
|
+
modifier
|
|
254
|
+
});
|
|
255
|
+
preview.value = output.preview;
|
|
256
|
+
model.value = output.result;
|
|
257
|
+
isTaken.value = true;
|
|
258
|
+
isProcessing.value = false;
|
|
259
|
+
isActive.value = false;
|
|
260
|
+
emit("result", output.result);
|
|
261
|
+
emit("change", output.result);
|
|
262
|
+
if (typeof shutter.value?.play === "function")
|
|
263
|
+
shutter.value.play();
|
|
264
|
+
}
|
|
265
|
+
async function retake() {
|
|
266
|
+
isActive.value = true;
|
|
267
|
+
isTaken.value = false;
|
|
268
|
+
preview.value = "";
|
|
269
|
+
message.value = "";
|
|
270
|
+
}
|
|
271
|
+
function onStart() {
|
|
272
|
+
emit("start", stream.value);
|
|
273
|
+
if (meta.value.autoStart)
|
|
274
|
+
take();
|
|
275
|
+
}
|
|
276
|
+
onMounted(async () => {
|
|
277
|
+
if (permission.isSupported) {
|
|
278
|
+
await until(permission.state).not.toBeUndefined();
|
|
279
|
+
await turnOn();
|
|
280
|
+
}
|
|
281
|
+
});
|
|
282
|
+
onBeforeUnmount(() => {
|
|
283
|
+
stop();
|
|
284
|
+
});
|
|
285
|
+
defineExpose({
|
|
286
|
+
take,
|
|
287
|
+
retake,
|
|
288
|
+
toast,
|
|
289
|
+
toggle
|
|
290
|
+
});
|
|
291
|
+
defineSlots();
|
|
292
|
+
</script>
|
|
293
|
+
|
|
294
|
+
<style lang="postcss">
|
|
295
|
+
.camera {
|
|
296
|
+
@apply bg-inverse w-full flex flex-col select-none relative overflow-hidden;
|
|
297
|
+
@apply dark:bg-dark-inverse;
|
|
298
|
+
|
|
299
|
+
&__video {
|
|
300
|
+
@apply grow min-h-full max-w-full h-auto object-cover;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
&--mirror {
|
|
304
|
+
.camera__video {
|
|
305
|
+
@apply -scale-x-100;
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
&__mask-container {
|
|
310
|
+
@apply absolute inset-0 w-full h-full overflow-hidden pointer-events-none;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
&__mask {
|
|
314
|
+
@apply absolute top-1/2 left-1/2 shadow-mask -translate-x-1/2 -translate-y-1/2;
|
|
315
|
+
|
|
316
|
+
&--none &-container {
|
|
317
|
+
@apply hidden;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
&--square & {
|
|
321
|
+
@apply aspect-compat-square w-[55%] md:w-1/2;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
&--round & {
|
|
325
|
+
@apply aspect-compat-square rounded-full w-[55%] md:w-1/2;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
&--card & {
|
|
329
|
+
@apply aspect-compat-[85.60/53.98] w-3/4 rounded;
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
&__result {
|
|
334
|
+
@apply w-full h-full object-cover absolute inset-0;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
&__off-info {
|
|
338
|
+
@apply absolute bottom-20 text-on-emphasis left-0 right-0 text-center text-sm;
|
|
339
|
+
@apply dark:text-dark-on-emphasis;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
&__controls {
|
|
343
|
+
@apply py-3 flex w-full shrink-0 justify-center items-center absolute bottom-0 space-x-3;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
&__toast {
|
|
347
|
+
@apply absolute bottom-20 left-0 right-0 text-center text-on-emphasis;
|
|
348
|
+
@apply dark:text-dark-on-emphasis px-4;
|
|
349
|
+
|
|
350
|
+
&-text {
|
|
351
|
+
@apply bg-inverse/80 px-4 py-1 text-sm rounded shadow-md inline-block max-w-full truncate;
|
|
352
|
+
@apply dark:bg-dark-inverse/80;
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
</style>
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import type { PropType, VNode } from 'vue';
|
|
2
|
+
import type { Adapter, MaskVariant, ModelModifier } from './adapter/adapter';
|
|
3
|
+
declare function toggle(): void;
|
|
4
|
+
declare function toast(text: string): void;
|
|
5
|
+
declare function take(): Promise<void>;
|
|
6
|
+
declare function retake(): Promise<void>;
|
|
7
|
+
declare function __VLS_template(): {
|
|
8
|
+
attrs: Partial<{}>;
|
|
9
|
+
slots: Readonly<{
|
|
10
|
+
default(props: {
|
|
11
|
+
cameras: MediaDeviceInfo[];
|
|
12
|
+
preview: string;
|
|
13
|
+
stream: MediaStream;
|
|
14
|
+
video: HTMLVideoElement;
|
|
15
|
+
shutter: HTMLAudioElement;
|
|
16
|
+
toast: (message: string) => void;
|
|
17
|
+
}): VNode[];
|
|
18
|
+
}> & {
|
|
19
|
+
default(props: {
|
|
20
|
+
cameras: MediaDeviceInfo[];
|
|
21
|
+
preview: string;
|
|
22
|
+
stream: MediaStream;
|
|
23
|
+
video: HTMLVideoElement;
|
|
24
|
+
shutter: HTMLAudioElement;
|
|
25
|
+
toast: (message: string) => void;
|
|
26
|
+
}): VNode[];
|
|
27
|
+
};
|
|
28
|
+
refs: {
|
|
29
|
+
video: HTMLVideoElement;
|
|
30
|
+
shutter: HTMLAudioElement;
|
|
31
|
+
};
|
|
32
|
+
rootEl: HTMLDivElement;
|
|
33
|
+
};
|
|
34
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
35
|
+
declare const __VLS_component: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
36
|
+
modelValue: {
|
|
37
|
+
type: PropType<string | globalThis.File | string[] | globalThis.File[]>;
|
|
38
|
+
default: string;
|
|
39
|
+
};
|
|
40
|
+
modelModifiers: {
|
|
41
|
+
type: PropType<ModelModifier>;
|
|
42
|
+
default: () => ModelModifier;
|
|
43
|
+
};
|
|
44
|
+
mirror: {
|
|
45
|
+
type: PropType<boolean | "preview" | "all">;
|
|
46
|
+
default: undefined;
|
|
47
|
+
};
|
|
48
|
+
mask: {
|
|
49
|
+
type: PropType<MaskVariant>;
|
|
50
|
+
default: undefined;
|
|
51
|
+
};
|
|
52
|
+
adapter: {
|
|
53
|
+
type: PropType<Adapter>;
|
|
54
|
+
default: Adapter;
|
|
55
|
+
};
|
|
56
|
+
facingMode: {
|
|
57
|
+
type: PropType<ConstrainDOMString>;
|
|
58
|
+
default: undefined;
|
|
59
|
+
};
|
|
60
|
+
silent: {
|
|
61
|
+
type: BooleanConstructor;
|
|
62
|
+
default: boolean;
|
|
63
|
+
};
|
|
64
|
+
}>, {
|
|
65
|
+
take: typeof take;
|
|
66
|
+
retake: typeof retake;
|
|
67
|
+
toast: typeof toast;
|
|
68
|
+
toggle: typeof toggle;
|
|
69
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
70
|
+
"update:modelValue": (args_0: unknown) => void;
|
|
71
|
+
change: (args_0: unknown) => void;
|
|
72
|
+
start: (args_0: unknown) => void;
|
|
73
|
+
result: (args_0: unknown) => void;
|
|
74
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
75
|
+
modelValue: {
|
|
76
|
+
type: PropType<string | globalThis.File | string[] | globalThis.File[]>;
|
|
77
|
+
default: string;
|
|
78
|
+
};
|
|
79
|
+
modelModifiers: {
|
|
80
|
+
type: PropType<ModelModifier>;
|
|
81
|
+
default: () => ModelModifier;
|
|
82
|
+
};
|
|
83
|
+
mirror: {
|
|
84
|
+
type: PropType<boolean | "preview" | "all">;
|
|
85
|
+
default: undefined;
|
|
86
|
+
};
|
|
87
|
+
mask: {
|
|
88
|
+
type: PropType<MaskVariant>;
|
|
89
|
+
default: undefined;
|
|
90
|
+
};
|
|
91
|
+
adapter: {
|
|
92
|
+
type: PropType<Adapter>;
|
|
93
|
+
default: Adapter;
|
|
94
|
+
};
|
|
95
|
+
facingMode: {
|
|
96
|
+
type: PropType<ConstrainDOMString>;
|
|
97
|
+
default: undefined;
|
|
98
|
+
};
|
|
99
|
+
silent: {
|
|
100
|
+
type: BooleanConstructor;
|
|
101
|
+
default: boolean;
|
|
102
|
+
};
|
|
103
|
+
}>> & Readonly<{
|
|
104
|
+
"onUpdate:modelValue"?: ((args_0: unknown) => any) | undefined;
|
|
105
|
+
onChange?: ((args_0: unknown) => any) | undefined;
|
|
106
|
+
onStart?: ((args_0: unknown) => any) | undefined;
|
|
107
|
+
onResult?: ((args_0: unknown) => any) | undefined;
|
|
108
|
+
}>, {
|
|
109
|
+
mask: MaskVariant;
|
|
110
|
+
modelValue: string | string[] | File | File[];
|
|
111
|
+
facingMode: ConstrainDOMString;
|
|
112
|
+
mirror: boolean | "all" | "preview";
|
|
113
|
+
silent: boolean;
|
|
114
|
+
modelModifiers: ModelModifier;
|
|
115
|
+
adapter: Adapter;
|
|
116
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
117
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
118
|
+
export default _default;
|
|
119
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
120
|
+
new (): {
|
|
121
|
+
$slots: S;
|
|
122
|
+
};
|
|
123
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { ComputedRef, Ref } from 'vue';
|
|
2
|
+
export type MaskVariant = 'square' | 'round' | 'card' | 'none';
|
|
3
|
+
export type MirrorMode = boolean | 'preview' | 'all';
|
|
4
|
+
export interface ModelModifier {
|
|
5
|
+
base64: boolean;
|
|
6
|
+
}
|
|
7
|
+
export interface AdapterMeta {
|
|
8
|
+
/**
|
|
9
|
+
* Auto take an image,
|
|
10
|
+
* It will start processing when camera started.
|
|
11
|
+
*/
|
|
12
|
+
autoStart: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Default value for props `facingMode`
|
|
15
|
+
*/
|
|
16
|
+
mask: MaskVariant;
|
|
17
|
+
/**
|
|
18
|
+
* Default value for props `mirror`
|
|
19
|
+
*/
|
|
20
|
+
mirror: MirrorMode;
|
|
21
|
+
/**
|
|
22
|
+
* Default value for props `facingMode`
|
|
23
|
+
*/
|
|
24
|
+
facingMode: ConstrainDOMString;
|
|
25
|
+
}
|
|
26
|
+
export interface CameraContext {
|
|
27
|
+
video: Ref<HTMLVideoElement>;
|
|
28
|
+
stream: Ref<MediaStream>;
|
|
29
|
+
modifier: Ref<ModelModifier>;
|
|
30
|
+
meta: ComputedRef<AdapterMeta>;
|
|
31
|
+
toast: (message: string) => void;
|
|
32
|
+
}
|
|
33
|
+
export interface CameraResult {
|
|
34
|
+
preview: string;
|
|
35
|
+
result: string | string[] | globalThis.File | globalThis.File[];
|
|
36
|
+
}
|
|
37
|
+
export interface Adapter {
|
|
38
|
+
meta?: Partial<AdapterMeta>;
|
|
39
|
+
run: (context: CameraContext) => CameraResult | Promise<CameraResult>;
|
|
40
|
+
}
|
|
41
|
+
export declare function defineAdapter(adapter: Adapter): Adapter;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { fromBase64 } from "../../utils/base64.mjs";
|
|
2
|
+
import { takePicture } from "../utils/take-picture.mjs";
|
|
3
|
+
import { defineAdapter } from "./adapter.mjs";
|
|
4
|
+
export default defineAdapter({
|
|
5
|
+
meta: { facingMode: "environment" },
|
|
6
|
+
run({ video, meta, modifier }) {
|
|
7
|
+
const isMirrored = !!(meta.value.mirror && meta.value.mirror !== "preview");
|
|
8
|
+
const preview = takePicture(video.value, isMirrored);
|
|
9
|
+
const result = modifier.value.base64 ? preview : fromBase64(preview);
|
|
10
|
+
return { preview, result };
|
|
11
|
+
}
|
|
12
|
+
});
|