@privyid/persona 1.1.2 → 1.2.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/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,465 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<p-card
|
|
3
|
-
data-testid="calendar"
|
|
4
|
-
class="calendar"
|
|
5
|
-
element="div"
|
|
6
|
-
:viewmode="viewmode"
|
|
7
|
-
:class="classNames">
|
|
8
|
-
<div class="calendar__nav">
|
|
9
|
-
<p-button
|
|
10
|
-
data-testid="calendar-prev"
|
|
11
|
-
variant="solid"
|
|
12
|
-
icon
|
|
13
|
-
type="button"
|
|
14
|
-
:disabled="!canPrev"
|
|
15
|
-
:readonly="disabled || readonly"
|
|
16
|
-
@click="prev">
|
|
17
|
-
<IconBack />
|
|
18
|
-
</p-button>
|
|
19
|
-
|
|
20
|
-
<p-button
|
|
21
|
-
data-testid="calendar-title"
|
|
22
|
-
class="calendar__nav-title"
|
|
23
|
-
variant="solid"
|
|
24
|
-
type="button"
|
|
25
|
-
:readonly="disabled || readonly"
|
|
26
|
-
@click="changeMode(1)">
|
|
27
|
-
{{ title }}
|
|
28
|
-
</p-button>
|
|
29
|
-
|
|
30
|
-
<p-button
|
|
31
|
-
data-testid="calendar-next"
|
|
32
|
-
variant="solid"
|
|
33
|
-
icon
|
|
34
|
-
type="button"
|
|
35
|
-
:readonly="disabled || readonly"
|
|
36
|
-
:disabled="!canNext"
|
|
37
|
-
@click="next">
|
|
38
|
-
<IconNext />
|
|
39
|
-
</p-button>
|
|
40
|
-
</div>
|
|
41
|
-
|
|
42
|
-
<Transition
|
|
43
|
-
:name="transition"
|
|
44
|
-
mode="out-in">
|
|
45
|
-
<div
|
|
46
|
-
:key="`${cursor.toISOString()}+${viewmode}`"
|
|
47
|
-
data-testid="calendar-items"
|
|
48
|
-
class="calendar__items"
|
|
49
|
-
:viewmode="viewmode">
|
|
50
|
-
<template
|
|
51
|
-
v-for="(item, i) in items"
|
|
52
|
-
:key="i">
|
|
53
|
-
<p-button
|
|
54
|
-
variant="solid"
|
|
55
|
-
type="button"
|
|
56
|
-
data-testid="calendar-item"
|
|
57
|
-
class="calendar__item-btn"
|
|
58
|
-
:readonly="item.readonly || disabled || readonly"
|
|
59
|
-
:active="item.active"
|
|
60
|
-
:disabled="item.disabled"
|
|
61
|
-
:class="{
|
|
62
|
-
'calendar__item--in-range': isInRange(item),
|
|
63
|
-
'calendar__item--head': item.head,
|
|
64
|
-
'calendar__item--tail': item.tail,
|
|
65
|
-
}"
|
|
66
|
-
@click="selectItem(item)"
|
|
67
|
-
@mouseover="setHover(item)">
|
|
68
|
-
{{ item.text }}
|
|
69
|
-
</p-button>
|
|
70
|
-
</template>
|
|
71
|
-
</div>
|
|
72
|
-
</Transition>
|
|
73
|
-
</p-card>
|
|
74
|
-
</template>
|
|
75
|
-
|
|
76
|
-
<script lang="ts" setup>
|
|
77
|
-
import pButton from '../button/Button.vue'
|
|
78
|
-
import pCard from '../card/Card.vue'
|
|
79
|
-
import IconNext from '@privyid/persona-icon/vue/chevron-right/20.vue'
|
|
80
|
-
import IconBack from '@privyid/persona-icon/vue/chevron-left/20.vue'
|
|
81
|
-
import type { PropType } from 'vue-demi'
|
|
82
|
-
import {
|
|
83
|
-
ref,
|
|
84
|
-
computed,
|
|
85
|
-
watch,
|
|
86
|
-
} from 'vue-demi'
|
|
87
|
-
import type {
|
|
88
|
-
CalendarAdapter,
|
|
89
|
-
CalendarContext,
|
|
90
|
-
CalendarItem,
|
|
91
|
-
CalendarMode,
|
|
92
|
-
} from './adapter/adapter'
|
|
93
|
-
import {
|
|
94
|
-
CalendarFormat,
|
|
95
|
-
validateDuration,
|
|
96
|
-
parseDuration,
|
|
97
|
-
} from './adapter/adapter'
|
|
98
|
-
import DateAdapter from './adapter/date'
|
|
99
|
-
import MonthAdapter from './adapter/month'
|
|
100
|
-
import YearAdapter from './adapter/year'
|
|
101
|
-
import {
|
|
102
|
-
isWithinInterval,
|
|
103
|
-
startOfMonth,
|
|
104
|
-
min as minDate,
|
|
105
|
-
max as maxDate,
|
|
106
|
-
add,
|
|
107
|
-
sub,
|
|
108
|
-
} from 'date-fns'
|
|
109
|
-
import {
|
|
110
|
-
minTime as MIN_TIME,
|
|
111
|
-
maxTime as MAX_TIME,
|
|
112
|
-
} from 'date-fns/constants'
|
|
113
|
-
import { syncRef } from '@vueuse/core'
|
|
114
|
-
|
|
115
|
-
const Adapters: Record<CalendarMode, CalendarAdapter> = {
|
|
116
|
-
date : DateAdapter,
|
|
117
|
-
month: MonthAdapter,
|
|
118
|
-
year : YearAdapter,
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
type TransitionMode = 'slide-left' | 'slide-right' | 'zoom-in' | 'zoom-out'
|
|
122
|
-
|
|
123
|
-
const props = defineProps({
|
|
124
|
-
modelValue: {
|
|
125
|
-
type : [Date, Array] as PropType<Date | [Date, Date]>,
|
|
126
|
-
default: undefined,
|
|
127
|
-
},
|
|
128
|
-
start: {
|
|
129
|
-
type : Date,
|
|
130
|
-
default: undefined,
|
|
131
|
-
},
|
|
132
|
-
end: {
|
|
133
|
-
type : Date,
|
|
134
|
-
default: undefined,
|
|
135
|
-
},
|
|
136
|
-
disabled: {
|
|
137
|
-
type : Boolean,
|
|
138
|
-
default: undefined,
|
|
139
|
-
},
|
|
140
|
-
readonly: {
|
|
141
|
-
type : Boolean,
|
|
142
|
-
default: undefined,
|
|
143
|
-
},
|
|
144
|
-
min: {
|
|
145
|
-
type : Date,
|
|
146
|
-
default: () => new Date(MIN_TIME),
|
|
147
|
-
},
|
|
148
|
-
max: {
|
|
149
|
-
type : Date,
|
|
150
|
-
default: () => new Date(MAX_TIME),
|
|
151
|
-
},
|
|
152
|
-
mode: {
|
|
153
|
-
type : String as PropType<CalendarMode>,
|
|
154
|
-
default: 'date',
|
|
155
|
-
},
|
|
156
|
-
range: {
|
|
157
|
-
type : Boolean,
|
|
158
|
-
default: false,
|
|
159
|
-
},
|
|
160
|
-
minRange: {
|
|
161
|
-
type : String,
|
|
162
|
-
default: undefined,
|
|
163
|
-
validator (value: string) {
|
|
164
|
-
return validateDuration(value)
|
|
165
|
-
},
|
|
166
|
-
},
|
|
167
|
-
maxRange: {
|
|
168
|
-
type : String,
|
|
169
|
-
default: undefined,
|
|
170
|
-
validator (value: string) {
|
|
171
|
-
return validateDuration(value)
|
|
172
|
-
},
|
|
173
|
-
},
|
|
174
|
-
})
|
|
175
|
-
|
|
176
|
-
const emit = defineEmits<{
|
|
177
|
-
'update:modelValue': [unknown],
|
|
178
|
-
'update:start': [Date],
|
|
179
|
-
'update:end': [Date],
|
|
180
|
-
'change': [unknown],
|
|
181
|
-
}>()
|
|
182
|
-
|
|
183
|
-
const viewmode = ref<CalendarMode>(props.mode)
|
|
184
|
-
const transition = ref<TransitionMode>('slide-left')
|
|
185
|
-
|
|
186
|
-
const localStart = ref(Array.isArray(props.modelValue) ? props.modelValue[0] : (props.start ?? props.modelValue))
|
|
187
|
-
const localEnd = ref(Array.isArray(props.modelValue) ? props.modelValue[1] : (props.end ?? props.modelValue))
|
|
188
|
-
|
|
189
|
-
/**
|
|
190
|
-
* v-model:start
|
|
191
|
-
*/
|
|
192
|
-
const vStart = computed({
|
|
193
|
-
get () {
|
|
194
|
-
return Array.isArray(props.modelValue)
|
|
195
|
-
? props.modelValue?.[0]
|
|
196
|
-
: (props.start ?? props.modelValue)
|
|
197
|
-
},
|
|
198
|
-
set (value: Date) {
|
|
199
|
-
emit('update:start', value)
|
|
200
|
-
},
|
|
201
|
-
})
|
|
202
|
-
|
|
203
|
-
/**
|
|
204
|
-
* v-model:end
|
|
205
|
-
*/
|
|
206
|
-
const vEnd = computed({
|
|
207
|
-
get () {
|
|
208
|
-
return Array.isArray(props.modelValue)
|
|
209
|
-
? props.modelValue?.[1]
|
|
210
|
-
: (props.end ?? props.modelValue)
|
|
211
|
-
},
|
|
212
|
-
set (value: Date) {
|
|
213
|
-
emit('update:end', value)
|
|
214
|
-
},
|
|
215
|
-
})
|
|
216
|
-
|
|
217
|
-
const cursor = ref(startOfMonth(localStart.value ?? new Date()))
|
|
218
|
-
const hover = ref<Date>()
|
|
219
|
-
|
|
220
|
-
const minRange = computed(() => parseDuration(props.minRange))
|
|
221
|
-
const maxRange = computed(() => parseDuration(props.maxRange))
|
|
222
|
-
const isTempLock = computed(() => props.range && localStart.value && !localEnd.value)
|
|
223
|
-
|
|
224
|
-
const min = computed(() => {
|
|
225
|
-
return isTempLock.value
|
|
226
|
-
? maxDate([add(localStart.value, minRange.value ?? {}), props.min])
|
|
227
|
-
: props.min
|
|
228
|
-
})
|
|
229
|
-
|
|
230
|
-
const max = computed(() => {
|
|
231
|
-
return isTempLock.value && maxRange.value
|
|
232
|
-
? minDate([add(localStart.value, maxRange.value), props.max])
|
|
233
|
-
: sub(props.max, minRange.value ?? {})
|
|
234
|
-
})
|
|
235
|
-
|
|
236
|
-
const context: CalendarContext = {
|
|
237
|
-
cursor: cursor,
|
|
238
|
-
start : localStart,
|
|
239
|
-
end : localEnd,
|
|
240
|
-
min : min,
|
|
241
|
-
max : max,
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
const adapter = computed(() => {
|
|
245
|
-
return Adapters[viewmode.value]
|
|
246
|
-
})
|
|
247
|
-
|
|
248
|
-
const title = computed(() => {
|
|
249
|
-
return adapter.value.getTitle(context)
|
|
250
|
-
})
|
|
251
|
-
|
|
252
|
-
const items = computed(() => {
|
|
253
|
-
return adapter.value.getItems(context)
|
|
254
|
-
})
|
|
255
|
-
|
|
256
|
-
const canNext = computed(() => {
|
|
257
|
-
return adapter.value.canNext(context)
|
|
258
|
-
})
|
|
259
|
-
|
|
260
|
-
const canPrev = computed(() => {
|
|
261
|
-
return adapter.value.canPrev(context)
|
|
262
|
-
})
|
|
263
|
-
|
|
264
|
-
const classNames = computed(() => {
|
|
265
|
-
const result = []
|
|
266
|
-
|
|
267
|
-
if (props.disabled)
|
|
268
|
-
result.push('calendar--disabled')
|
|
269
|
-
|
|
270
|
-
if (props.readonly)
|
|
271
|
-
result.push('calendar--readonly')
|
|
272
|
-
|
|
273
|
-
if (props.range)
|
|
274
|
-
result.push('calendar--range')
|
|
275
|
-
|
|
276
|
-
return result
|
|
277
|
-
})
|
|
278
|
-
|
|
279
|
-
function next () {
|
|
280
|
-
if (!props.disabled && !props.readonly)
|
|
281
|
-
cursor.value = adapter.value.getNextCursor(context)
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
function prev () {
|
|
285
|
-
if (!props.disabled && !props.readonly)
|
|
286
|
-
cursor.value = adapter.value.getPrevCursor(context)
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
function changeMode (step = 1) {
|
|
290
|
-
if (!props.disabled && !props.readonly) {
|
|
291
|
-
const index = CalendarFormat.indexOf(viewmode.value)
|
|
292
|
-
const newMode = CalendarFormat[index + step]
|
|
293
|
-
|
|
294
|
-
if (newMode)
|
|
295
|
-
viewmode.value = newMode
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
function selectItem (item: CalendarItem) {
|
|
300
|
-
if (viewmode.value === props.mode) {
|
|
301
|
-
if (props.range && (localStart.value && !localEnd.value)) {
|
|
302
|
-
const startValue = minDate([localStart.value, item.value])
|
|
303
|
-
const endValue = maxDate([localStart.value, item.value])
|
|
304
|
-
|
|
305
|
-
localStart.value = adapter.value.setValue(startValue, localStart.value)
|
|
306
|
-
localEnd.value = adapter.value.setValue(endValue, localEnd.value)
|
|
307
|
-
} else {
|
|
308
|
-
localStart.value = adapter.value.setValue(item.value, localStart.value)
|
|
309
|
-
localEnd.value = undefined
|
|
310
|
-
}
|
|
311
|
-
} else {
|
|
312
|
-
cursor.value = item.value
|
|
313
|
-
|
|
314
|
-
changeMode(-1)
|
|
315
|
-
}
|
|
316
|
-
}
|
|
317
|
-
|
|
318
|
-
function setHover (item: CalendarItem) {
|
|
319
|
-
if (props.range && !item.readonly && !item.disabled)
|
|
320
|
-
hover.value = item.value
|
|
321
|
-
}
|
|
322
|
-
|
|
323
|
-
function isInRange (item: CalendarItem) {
|
|
324
|
-
if (props.range && localStart.value && (localEnd.value || hover.value) && !item.readonly && !item.active) {
|
|
325
|
-
return isWithinInterval(item.value, {
|
|
326
|
-
start: minDate([localStart.value, localEnd.value ?? hover.value]),
|
|
327
|
-
end : maxDate([localStart.value, localEnd.value ?? hover.value]),
|
|
328
|
-
})
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
return false
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
syncRef(localStart, vStart, { immediate: false })
|
|
335
|
-
syncRef(localEnd, vEnd, { immediate: false })
|
|
336
|
-
|
|
337
|
-
/**
|
|
338
|
-
* syncRef between v-model:start + v-model:end to v-model
|
|
339
|
-
*/
|
|
340
|
-
watch([localStart, localEnd], ([startVal, endVal]) => {
|
|
341
|
-
if (props.range) {
|
|
342
|
-
if (startVal && endVal) {
|
|
343
|
-
emit('update:modelValue', [startVal, endVal])
|
|
344
|
-
emit('change', [startVal, endVal])
|
|
345
|
-
}
|
|
346
|
-
} else {
|
|
347
|
-
emit('update:modelValue', startVal)
|
|
348
|
-
emit('change', startVal)
|
|
349
|
-
}
|
|
350
|
-
})
|
|
351
|
-
|
|
352
|
-
watch(() => props.mode, (value) => {
|
|
353
|
-
const newIndex = CalendarFormat.indexOf(value)
|
|
354
|
-
const currentIndex = CalendarFormat.indexOf(viewmode.value)
|
|
355
|
-
|
|
356
|
-
if (newIndex > currentIndex)
|
|
357
|
-
viewmode.value = value
|
|
358
|
-
})
|
|
359
|
-
|
|
360
|
-
watch([viewmode, cursor], ([vm, cursor], [vmOld, cursorOld]) => {
|
|
361
|
-
const mode = CalendarFormat.indexOf(vm) - CalendarFormat.indexOf(vmOld)
|
|
362
|
-
|
|
363
|
-
if (mode === 0)
|
|
364
|
-
transition.value = cursor > cursorOld ? 'slide-left' : 'slide-right'
|
|
365
|
-
else
|
|
366
|
-
transition.value = mode > 0 ? 'zoom-out' : 'zoom-in'
|
|
367
|
-
})
|
|
368
|
-
</script>
|
|
369
|
-
|
|
370
|
-
<style lang="postcss">
|
|
371
|
-
.calendar {
|
|
372
|
-
@apply flex flex-col space-y-2 text-sm shadow-xl;
|
|
373
|
-
|
|
374
|
-
&.card {
|
|
375
|
-
@apply border-transparent;
|
|
376
|
-
@apply dark:border-transparent;
|
|
377
|
-
}
|
|
378
|
-
|
|
379
|
-
&__nav {
|
|
380
|
-
@apply flex justify-between space-x-2 mb-2;
|
|
381
|
-
|
|
382
|
-
&-title {
|
|
383
|
-
@apply grow;
|
|
384
|
-
}
|
|
385
|
-
}
|
|
386
|
-
|
|
387
|
-
.btn.btn--variant-solid {
|
|
388
|
-
@apply justify-center;
|
|
389
|
-
|
|
390
|
-
&.btn--default {
|
|
391
|
-
@apply border-transparent bg-transparent text-default font-normal;
|
|
392
|
-
@apply dark:border-transparent dark:bg-transparent dark:text-dark-subtle hover:dark:text-dark-default;
|
|
393
|
-
|
|
394
|
-
&.calendar__nav-title {
|
|
395
|
-
@apply font-medium;
|
|
396
|
-
}
|
|
397
|
-
|
|
398
|
-
&[active="true"] {
|
|
399
|
-
@apply bg-brand-accent border-brand-accent text-state-emphasis cursor-default;
|
|
400
|
-
@apply dark:bg-dark-brand-accent dark:border-dark-brand-accent dark:text-dark-state-emphasis;
|
|
401
|
-
}
|
|
402
|
-
|
|
403
|
-
&[disabled][active="false"] {
|
|
404
|
-
@apply text-muted;
|
|
405
|
-
@apply dark:text-dark-muted;
|
|
406
|
-
}
|
|
407
|
-
|
|
408
|
-
&.calendar__item--in-range {
|
|
409
|
-
@apply bg-info rounded-none;
|
|
410
|
-
@apply dark:bg-dark-info;
|
|
411
|
-
}
|
|
412
|
-
}
|
|
413
|
-
|
|
414
|
-
&[readonly] {
|
|
415
|
-
@apply pointer-events-none font-medium;
|
|
416
|
-
}
|
|
417
|
-
}
|
|
418
|
-
|
|
419
|
-
.calendar__items {
|
|
420
|
-
&[viewmode="date"] {
|
|
421
|
-
@apply grid grid-cols-7 gap-y-1;
|
|
422
|
-
|
|
423
|
-
.calendar__item-btn.btn--md {
|
|
424
|
-
@apply p-1 md:p-2;
|
|
425
|
-
}
|
|
426
|
-
|
|
427
|
-
.calendar__item-btn:nth-child(-n+7) {
|
|
428
|
-
@apply font-medium;
|
|
429
|
-
}
|
|
430
|
-
|
|
431
|
-
.calendar__item-btn:nth-child(7n-6) {
|
|
432
|
-
&:not([active="true"]) {
|
|
433
|
-
@apply text-danger dark:text-dark-danger;
|
|
434
|
-
}
|
|
435
|
-
}
|
|
436
|
-
}
|
|
437
|
-
|
|
438
|
-
&[viewmode="month"],
|
|
439
|
-
&[viewmode="year"] {
|
|
440
|
-
@apply grid grid-cols-4 gap-y-1;
|
|
441
|
-
.btn--md {
|
|
442
|
-
@apply px-3;
|
|
443
|
-
}
|
|
444
|
-
}
|
|
445
|
-
}
|
|
446
|
-
|
|
447
|
-
&--range {
|
|
448
|
-
.calendar__item--head:not(.calendar__item--tail) {
|
|
449
|
-
@apply rounded-r-none;
|
|
450
|
-
}
|
|
451
|
-
|
|
452
|
-
.calendar__item--tail:not(.calendar__item--head) {
|
|
453
|
-
@apply rounded-l-none;
|
|
454
|
-
}
|
|
455
|
-
}
|
|
456
|
-
|
|
457
|
-
&--disabled {
|
|
458
|
-
@apply opacity-50;
|
|
459
|
-
}
|
|
460
|
-
|
|
461
|
-
.dropdown__subitem & {
|
|
462
|
-
@apply shadow-none;
|
|
463
|
-
}
|
|
464
|
-
}
|
|
465
|
-
</style>
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import type { Ref } from 'vue-demi';
|
|
2
|
-
import { type Duration } from 'date-fns';
|
|
3
|
-
export interface CalendarItem {
|
|
4
|
-
value: Date;
|
|
5
|
-
text: string;
|
|
6
|
-
disabled: boolean;
|
|
7
|
-
readonly: boolean;
|
|
8
|
-
active: boolean;
|
|
9
|
-
head: boolean;
|
|
10
|
-
tail: boolean;
|
|
11
|
-
}
|
|
12
|
-
export interface CalendarContext {
|
|
13
|
-
cursor: Ref<Date>;
|
|
14
|
-
start: Ref<Date>;
|
|
15
|
-
end: Ref<Date>;
|
|
16
|
-
min: Ref<Date | undefined>;
|
|
17
|
-
max: Ref<Date | undefined>;
|
|
18
|
-
}
|
|
19
|
-
export interface CalendarAdapter {
|
|
20
|
-
getItems: (this: this, context: CalendarContext) => CalendarItem[];
|
|
21
|
-
getTitle: (this: this, context: CalendarContext) => string;
|
|
22
|
-
getNextCursor: (this: this, context: CalendarContext) => Date;
|
|
23
|
-
getPrevCursor: (this: this, context: CalendarContext) => Date;
|
|
24
|
-
canNext: (this: this, context: CalendarContext) => boolean;
|
|
25
|
-
canPrev: (this: this, context: CalendarContext) => boolean;
|
|
26
|
-
setValue: (this: this, value: Date, lastValue?: Date) => Date;
|
|
27
|
-
}
|
|
28
|
-
export declare const CalendarFormat: readonly ["date", "month", "year"];
|
|
29
|
-
export type CalendarMode = typeof CalendarFormat[number];
|
|
30
|
-
export declare function defineAdapter(adapter: CalendarAdapter): CalendarAdapter;
|
|
31
|
-
export declare function validateDuration(duration?: string): boolean;
|
|
32
|
-
export declare function parseDuration(duration?: string): Duration | undefined;
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { chunk } from "lodash-es";
|
|
2
|
-
export const CalendarFormat = [
|
|
3
|
-
"date",
|
|
4
|
-
"month",
|
|
5
|
-
"year"
|
|
6
|
-
];
|
|
7
|
-
export function defineAdapter(adapter) {
|
|
8
|
-
return adapter;
|
|
9
|
-
}
|
|
10
|
-
const DURATION_SUFFIX = {
|
|
11
|
-
Y: "years",
|
|
12
|
-
y: "years",
|
|
13
|
-
M: "months",
|
|
14
|
-
W: "weeks",
|
|
15
|
-
w: "weeks",
|
|
16
|
-
D: "days",
|
|
17
|
-
d: "days",
|
|
18
|
-
H: "hours",
|
|
19
|
-
h: "hours",
|
|
20
|
-
m: "minutes",
|
|
21
|
-
s: "seconds"
|
|
22
|
-
};
|
|
23
|
-
const DURATION_REGEX = /((-?\d+)([DHMWYdhmswy]))/;
|
|
24
|
-
export function validateDuration(duration) {
|
|
25
|
-
if (!duration)
|
|
26
|
-
return false;
|
|
27
|
-
const match = duration.split(DURATION_REGEX).filter(Boolean);
|
|
28
|
-
const segment = chunk(match, 3);
|
|
29
|
-
return segment.every(([text]) => text.match(DURATION_REGEX));
|
|
30
|
-
}
|
|
31
|
-
export function parseDuration(duration) {
|
|
32
|
-
if (!duration)
|
|
33
|
-
return;
|
|
34
|
-
const match = duration.split(DURATION_REGEX).filter(Boolean);
|
|
35
|
-
const segment = chunk(match, 3);
|
|
36
|
-
const result = {};
|
|
37
|
-
for (const item of segment) {
|
|
38
|
-
const key = DURATION_SUFFIX[item[2]];
|
|
39
|
-
const value = Number.parseInt(item[1]);
|
|
40
|
-
result[key] = value + (result[key] ?? 0);
|
|
41
|
-
}
|
|
42
|
-
return result;
|
|
43
|
-
}
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
eachDayOfInterval,
|
|
3
|
-
endOfMonth,
|
|
4
|
-
endOfWeek,
|
|
5
|
-
isSameDay,
|
|
6
|
-
isSameMonth,
|
|
7
|
-
startOfMonth,
|
|
8
|
-
startOfWeek,
|
|
9
|
-
addMonths,
|
|
10
|
-
subMonths,
|
|
11
|
-
isAfter,
|
|
12
|
-
isBefore,
|
|
13
|
-
isWithinInterval,
|
|
14
|
-
set,
|
|
15
|
-
isDate
|
|
16
|
-
} from "date-fns";
|
|
17
|
-
import { defineAdapter } from "./adapter.mjs";
|
|
18
|
-
import { formatDate } from "../../utils/date.mjs";
|
|
19
|
-
function getInterval(date) {
|
|
20
|
-
const start = startOfWeek(startOfMonth(date), { weekStartsOn: 0 });
|
|
21
|
-
const end = endOfWeek(endOfMonth(date), { weekStartsOn: 0 });
|
|
22
|
-
return {
|
|
23
|
-
start,
|
|
24
|
-
end
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
export default defineAdapter({
|
|
28
|
-
getItems({ cursor, start, end, min, max }) {
|
|
29
|
-
const dates = eachDayOfInterval(getInterval(cursor.value)).map((date) => {
|
|
30
|
-
const isDisabled = !isSameMonth(cursor.value, date) || !isWithinInterval(date, { start: min.value, end: max.value });
|
|
31
|
-
const isHead = isSameDay(start.value, date);
|
|
32
|
-
const isTail = isSameDay(end.value, date);
|
|
33
|
-
return {
|
|
34
|
-
value: date,
|
|
35
|
-
text: date.getDate().toString(),
|
|
36
|
-
disabled: isDisabled,
|
|
37
|
-
head: isHead,
|
|
38
|
-
tail: isTail,
|
|
39
|
-
active: isHead || isTail,
|
|
40
|
-
readonly: false
|
|
41
|
-
};
|
|
42
|
-
});
|
|
43
|
-
const days = dates.slice(0, 7).map((item) => {
|
|
44
|
-
return {
|
|
45
|
-
value: item.value,
|
|
46
|
-
text: formatDate(item.value, "EEEEEE"),
|
|
47
|
-
disabled: false,
|
|
48
|
-
readonly: true,
|
|
49
|
-
head: false,
|
|
50
|
-
tail: false,
|
|
51
|
-
active: false
|
|
52
|
-
};
|
|
53
|
-
});
|
|
54
|
-
return [...days, ...dates];
|
|
55
|
-
},
|
|
56
|
-
getTitle({ cursor }) {
|
|
57
|
-
return formatDate(cursor.value, "MMMM yyyy");
|
|
58
|
-
},
|
|
59
|
-
getNextCursor({ cursor }) {
|
|
60
|
-
return addMonths(cursor.value, 1);
|
|
61
|
-
},
|
|
62
|
-
getPrevCursor({ cursor }) {
|
|
63
|
-
return subMonths(cursor.value, 1);
|
|
64
|
-
},
|
|
65
|
-
canNext(context) {
|
|
66
|
-
const max = context.max.value;
|
|
67
|
-
const date = this.getNextCursor(context);
|
|
68
|
-
const start = startOfMonth(date);
|
|
69
|
-
const end = endOfMonth(date);
|
|
70
|
-
return !max || isBefore(date, max) || isWithinInterval(max, { start, end });
|
|
71
|
-
},
|
|
72
|
-
canPrev(context) {
|
|
73
|
-
const min = context.min.value;
|
|
74
|
-
const date = this.getPrevCursor(context);
|
|
75
|
-
const start = startOfMonth(date);
|
|
76
|
-
const end = endOfMonth(date);
|
|
77
|
-
return !min || isAfter(date, min) || isWithinInterval(min, { start, end });
|
|
78
|
-
},
|
|
79
|
-
setValue(value, lastValue) {
|
|
80
|
-
return isDate(lastValue) ? set(lastValue, {
|
|
81
|
-
year: value.getFullYear(),
|
|
82
|
-
month: value.getMonth(),
|
|
83
|
-
date: value.getDate()
|
|
84
|
-
}) : value;
|
|
85
|
-
}
|
|
86
|
-
});
|
|
@@ -1,66 +0,0 @@
|
|
|
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
|
-
});
|