@privyid/persona 1.1.2 → 1.2.1-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/module.d.cts +2 -0
- package/dist/module.d.mts +2 -27
- package/dist/module.json +12 -0
- package/dist/module.mjs +13 -92
- package/dist/types.d.mts +13 -0
- package/package.json +25 -27
- package/dist/components/accordion/Accordion.vue +0 -121
- package/dist/components/accordion/AccordionItem.vue +0 -250
- package/dist/components/accordion/AccordionItems.vue +0 -50
- package/dist/components/accordion/AccordionItems.vue.d.ts +0 -41
- package/dist/components/accordion/index.d.ts +0 -7
- package/dist/components/accordion/index.mjs +0 -3
- package/dist/components/aspect-ratio/index.d.ts +0 -3
- package/dist/components/aspect-ratio/index.mjs +0 -21
- package/dist/components/aspect-ratio/utils/calculate-ratio.d.ts +0 -7
- package/dist/components/aspect-ratio/utils/calculate-ratio.mjs +0 -10
- package/dist/components/aspect-ratio/utils/resize-observer.d.ts +0 -1
- package/dist/components/aspect-ratio/utils/resize-observer.mjs +0 -22
- package/dist/components/avatar/Avatar.vue +0 -193
- package/dist/components/avatar/AvatarGroup.vue +0 -42
- package/dist/components/avatar/AvatarTruncate.vue +0 -33
- package/dist/components/avatar/AvatarTruncate.vue.d.ts +0 -31
- package/dist/components/avatar/assets/avatar-old.png +0 -0
- package/dist/components/avatar/assets/avatar.png +0 -0
- package/dist/components/avatar/index.d.ts +0 -2
- package/dist/components/avatar/index.mjs +0 -0
- package/dist/components/avatar/utils/color-hash.d.ts +0 -2
- package/dist/components/avatar/utils/color-hash.mjs +0 -22
- package/dist/components/avatar/utils/create-image.d.ts +0 -5
- package/dist/components/avatar/utils/create-image.mjs +0 -19
- package/dist/components/avatar/utils/load-image.d.ts +0 -1
- package/dist/components/avatar/utils/load-image.mjs +0 -22
- package/dist/components/badge/Badge.vue +0 -218
- package/dist/components/badge/index.d.ts +0 -1
- package/dist/components/badge/index.mjs +0 -0
- package/dist/components/banner/Banner.vue +0 -213
- package/dist/components/banner/index.d.ts +0 -1
- package/dist/components/banner/index.mjs +0 -0
- package/dist/components/breadcrumbs/Breadcrumb.vue +0 -62
- package/dist/components/breadcrumbs/BreadcrumbItem.vue +0 -95
- package/dist/components/breadcrumbs/BreadcrumbItemDropdown.vue +0 -78
- package/dist/components/breadcrumbs/index.d.ts +0 -11
- package/dist/components/breadcrumbs/index.mjs +0 -3
- package/dist/components/button/Button.vue +0 -422
- package/dist/components/button/index.d.ts +0 -5
- package/dist/components/button/index.mjs +0 -0
- package/dist/components/button-group/ButtonGroup.vue +0 -220
- package/dist/components/button-group/index.d.ts +0 -6
- package/dist/components/button-group/index.mjs +0 -1
- package/dist/components/calendar/Calendar.vue +0 -465
- package/dist/components/calendar/adapter/adapter.d.ts +0 -32
- package/dist/components/calendar/adapter/adapter.mjs +0 -43
- package/dist/components/calendar/adapter/date.d.ts +0 -2
- package/dist/components/calendar/adapter/date.mjs +0 -86
- package/dist/components/calendar/adapter/month.d.ts +0 -2
- package/dist/components/calendar/adapter/month.mjs +0 -66
- package/dist/components/calendar/adapter/year.d.ts +0 -2
- package/dist/components/calendar/adapter/year.mjs +0 -63
- package/dist/components/camera/Camera.vue +0 -416
- package/dist/components/camera/adapter/adapter.d.ts +0 -41
- package/dist/components/camera/adapter/adapter.mjs +0 -3
- package/dist/components/camera/adapter/capture.d.ts +0 -5
- package/dist/components/camera/adapter/capture.mjs +0 -12
- package/dist/components/camera/adapter/liveness.d.ts +0 -5
- package/dist/components/camera/adapter/liveness.mjs +0 -46
- package/dist/components/camera/adapter/qr-code.d.ts +0 -2
- package/dist/components/camera/adapter/qr-code.mjs +0 -19
- package/dist/components/camera/assets/shutter.wav +0 -0
- package/dist/components/camera/utils/motion.d.ts +0 -29
- package/dist/components/camera/utils/motion.mjs +0 -88
- package/dist/components/camera/utils/take-picture.d.ts +0 -1
- package/dist/components/camera/utils/take-picture.mjs +0 -14
- package/dist/components/caption/Caption.vue +0 -122
- package/dist/components/caption/index.d.ts +0 -1
- package/dist/components/caption/index.mjs +0 -0
- package/dist/components/card/Card.vue +0 -354
- package/dist/components/card/CardSection.vue +0 -81
- package/dist/components/card/index.d.ts +0 -2
- package/dist/components/card/index.mjs +0 -0
- package/dist/components/carousel/Carousel.vue +0 -202
- package/dist/components/carousel/CarouselBody.vue +0 -18
- package/dist/components/carousel/CarouselItem.vue +0 -10
- package/dist/components/carousel/index.d.ts +0 -4
- package/dist/components/carousel/index.mjs +0 -1
- package/dist/components/chart/Chart.vue +0 -155
- package/dist/components/chart/ChartSet.vue +0 -32
- package/dist/components/chart/ChartVal.vue +0 -36
- package/dist/components/chart/adapter/adapter.d.ts +0 -7
- package/dist/components/chart/adapter/adapter.mjs +0 -3
- package/dist/components/chart/adapter/bubble.d.ts +0 -2
- package/dist/components/chart/adapter/bubble.mjs +0 -26
- package/dist/components/chart/adapter/index.d.ts +0 -3
- package/dist/components/chart/adapter/index.mjs +0 -16
- package/dist/components/chart/adapter/line.d.ts +0 -2
- package/dist/components/chart/adapter/line.mjs +0 -66
- package/dist/components/chart/adapter/pie.d.ts +0 -2
- package/dist/components/chart/adapter/pie.mjs +0 -34
- package/dist/components/chart/index.d.ts +0 -2
- package/dist/components/chart/index.mjs +0 -0
- package/dist/components/chart/utils/use-chart.d.ts +0 -2
- package/dist/components/chart/utils/use-chart.mjs +0 -9
- package/dist/components/checkbox/Checkbox.vue +0 -232
- package/dist/components/checkbox/icon/IconCheckbox.vue +0 -13
- package/dist/components/checkbox/icon/IconInderteminate.vue +0 -12
- package/dist/components/checkbox/index.d.ts +0 -7
- package/dist/components/checkbox/index.mjs +0 -34
- package/dist/components/collapse/Collapse.vue +0 -71
- package/dist/components/contextual-bar/ContextualBar.vue +0 -461
- package/dist/components/contextual-bar/index.d.ts +0 -1
- package/dist/components/contextual-bar/index.mjs +0 -0
- package/dist/components/cropper/Cropper.vue +0 -446
- package/dist/components/cropper/index.d.ts +0 -1
- package/dist/components/cropper/index.mjs +0 -3
- package/dist/components/cropper/utils/crop-image.d.ts +0 -44
- package/dist/components/cropper/utils/crop-image.mjs +0 -43
- package/dist/components/cropper/utils/use-pinch.d.ts +0 -8
- package/dist/components/cropper/utils/use-pinch.mjs +0 -50
- package/dist/components/cropper/utils/use-preview.d.ts +0 -3
- package/dist/components/cropper/utils/use-preview.mjs +0 -21
- package/dist/components/cropper/utils/use-ratio.d.ts +0 -9
- package/dist/components/cropper/utils/use-ratio.mjs +0 -24
- package/dist/components/datepicker/Datepicker.vue +0 -235
- package/dist/components/dialog/Dialog.vue +0 -149
- package/dist/components/dialog/DialogFooter.vue +0 -138
- package/dist/components/dialog/index.d.ts +0 -52
- package/dist/components/dialog/index.mjs +0 -86
- package/dist/components/divider/Divider.vue +0 -65
- package/dist/components/dot/Dot.vue +0 -103
- package/dist/components/dot/index.d.ts +0 -1
- package/dist/components/dot/index.mjs +0 -0
- package/dist/components/dropdown/Dropdown.vue +0 -441
- package/dist/components/dropdown/DropdownHeader.vue +0 -33
- package/dist/components/dropdown/DropdownItem.vue +0 -103
- package/dist/components/dropdown/DropdownText.vue +0 -34
- package/dist/components/dropdown/index.d.ts +0 -10
- package/dist/components/dropdown/index.mjs +0 -1
- package/dist/components/dropdown/utils/use-focus.d.ts +0 -5
- package/dist/components/dropdown/utils/use-focus.mjs +0 -22
- package/dist/components/dropdown-subitem/DropdownSubitem.vue +0 -182
- package/dist/components/dropdown-subitem/index.d.ts +0 -12
- package/dist/components/dropdown-subitem/index.mjs +0 -1
- package/dist/components/dropzone/Dropzone.vue +0 -261
- package/dist/components/dropzone/index.d.ts +0 -4
- package/dist/components/dropzone/index.mjs +0 -0
- package/dist/components/dropzone/utils/accept.d.ts +0 -1
- package/dist/components/dropzone/utils/accept.mjs +0 -17
- package/dist/components/filterbar/Filterbar.vue +0 -103
- package/dist/components/filterbar/Filterbar.vue.d.ts +0 -40
- package/dist/components/filterbar/index.d.ts +0 -45
- package/dist/components/filterbar/index.mjs +0 -7
- package/dist/components/filterbar/pinned/PinnedDate.vue +0 -100
- package/dist/components/filterbar/pinned/PinnedDate.vue.d.ts +0 -72
- package/dist/components/filterbar/pinned/PinnedMultiselect.vue +0 -113
- package/dist/components/filterbar/pinned/PinnedMultiselect.vue.d.ts +0 -48
- package/dist/components/filterbar/pinned/PinnedSelect.vue +0 -100
- package/dist/components/filterbar/pinned/PinnedSelect.vue.d.ts +0 -47
- package/dist/components/filterbar/pinned/PinnedToggle.vue +0 -77
- package/dist/components/filterbar/pinned/PinnedToggle.vue.d.ts +0 -59
- package/dist/components/form-group/FormGroup.vue +0 -169
- package/dist/components/global/router.d.ts +0 -24
- package/dist/components/global/router.mjs +0 -7
- package/dist/components/global/store.d.ts +0 -49
- package/dist/components/global/store.mjs +0 -52
- package/dist/components/global/types.d.ts +0 -4
- package/dist/components/global/types.mjs +0 -0
- package/dist/components/global/use-singleton.d.ts +0 -21
- package/dist/components/global/use-singleton.mjs +0 -60
- package/dist/components/global/utils/queue.d.ts +0 -16
- package/dist/components/global/utils/queue.mjs +0 -35
- package/dist/components/heading/Heading.vue +0 -140
- package/dist/components/heading/index.d.ts +0 -3
- package/dist/components/heading/index.mjs +0 -0
- package/dist/components/input/Input.vue +0 -243
- package/dist/components/input/index.d.ts +0 -6
- package/dist/components/input/index.mjs +0 -25
- package/dist/components/input/utils/accept.d.ts +0 -26
- package/dist/components/input/utils/accept.mjs +0 -81
- package/dist/components/input-color/index.d.ts +0 -1
- package/dist/components/input-color/index.mjs +0 -0
- package/dist/components/input-color/inputColor.vue +0 -264
- package/dist/components/input-file/InputFile.vue +0 -221
- package/dist/components/input-group/InputGroup.vue +0 -188
- package/dist/components/input-group/InputGroupAddon.vue +0 -42
- package/dist/components/input-group/index.d.ts +0 -6
- package/dist/components/input-group/index.mjs +0 -1
- package/dist/components/input-password/InputPassword.vue +0 -110
- package/dist/components/input-password/index.d.ts +0 -2
- package/dist/components/input-password/index.mjs +0 -17
- package/dist/components/input-pin/InputPin.vue +0 -170
- package/dist/components/input-pin/index.d.ts +0 -6
- package/dist/components/input-pin/index.mjs +0 -3
- package/dist/components/input-range/InputRange.vue +0 -303
- package/dist/components/input-range/utils/use-drag.d.ts +0 -3
- package/dist/components/input-range/utils/use-drag.mjs +0 -26
- package/dist/components/label/Label.vue +0 -265
- package/dist/components/label/index.d.ts +0 -1
- package/dist/components/label/index.mjs +0 -0
- package/dist/components/list-group/ListGroup.vue +0 -75
- package/dist/components/list-group/ListGroupItem.vue +0 -88
- package/dist/components/list-group/index.d.ts +0 -1
- package/dist/components/list-group/index.mjs +0 -0
- package/dist/components/main/Main.vue +0 -66
- package/dist/components/markdown/index.d.ts +0 -29
- package/dist/components/markdown/index.mjs +0 -25
- package/dist/components/meta.json +0 -171
- package/dist/components/modal/Modal.vue +0 -546
- package/dist/components/modal/index.d.ts +0 -1
- package/dist/components/modal/index.mjs +0 -0
- package/dist/components/nav/Nav.vue +0 -416
- package/dist/components/nav/NavCollapse.vue +0 -66
- package/dist/components/nav/NavForm.vue +0 -23
- package/dist/components/nav/NavItem.vue +0 -187
- package/dist/components/nav/NavItemDropdown.vue +0 -120
- package/dist/components/nav/NavSubItem.vue +0 -194
- package/dist/components/nav/NavText.vue +0 -19
- package/dist/components/nav/index.d.ts +0 -2
- package/dist/components/nav/index.mjs +0 -0
- package/dist/components/navbar/Navbar.vue +0 -284
- package/dist/components/navbar/NavbarBrand.vue +0 -31
- package/dist/components/navbar/NavbarNav.vue +0 -114
- package/dist/components/navbar/NavbarToggle.vue +0 -72
- package/dist/components/navbar/index.d.ts +0 -9
- package/dist/components/navbar/index.mjs +0 -1
- package/dist/components/navbar-menu/NavbarNavMenu.vue +0 -59
- package/dist/components/notify/Notify.vue +0 -51
- package/dist/components/notify/NotifyGroup.vue +0 -244
- package/dist/components/notify/NotifyItem.vue +0 -45
- package/dist/components/notify/index.d.ts +0 -20
- package/dist/components/notify/index.mjs +0 -18
- package/dist/components/overlay/Overlay.vue +0 -68
- package/dist/components/overlay/assets/icon-white.svg +0 -1
- package/dist/components/overlay/index.d.ts +0 -2
- package/dist/components/overlay/index.mjs +0 -8
- package/dist/components/overlay/utils/use-loading.d.ts +0 -4
- package/dist/components/overlay/utils/use-loading.mjs +0 -28
- package/dist/components/page/Page.vue +0 -106
- package/dist/components/pagination/Pagination.vue +0 -415
- package/dist/components/pagination/index.d.ts +0 -14
- package/dist/components/pagination/index.mjs +0 -38
- package/dist/components/pagination/utils/calculate-page.d.ts +0 -11
- package/dist/components/pagination/utils/calculate-page.mjs +0 -48
- package/dist/components/pdf-helipad/PdfHelipad.vue +0 -147
- package/dist/components/pdf-helipad/index.d.ts +0 -7
- package/dist/components/pdf-helipad/index.mjs +0 -0
- package/dist/components/pdf-helipad/utils/use-drag.d.ts +0 -3
- package/dist/components/pdf-helipad/utils/use-drag.mjs +0 -38
- package/dist/components/pdf-object/PdfObject.vue +0 -348
- package/dist/components/pdf-object/PdfObjectAddon.vue +0 -55
- package/dist/components/pdf-object/PdfObjectDebugger.vue +0 -70
- package/dist/components/pdf-object/PdfObjects.vue +0 -39
- package/dist/components/pdf-object/index.d.ts +0 -63
- package/dist/components/pdf-object/index.mjs +0 -110
- package/dist/components/pdf-object/utils/overlap.d.ts +0 -51
- package/dist/components/pdf-object/utils/overlap.mjs +0 -54
- package/dist/components/pdf-object/utils/position.d.ts +0 -64
- package/dist/components/pdf-object/utils/position.mjs +0 -48
- package/dist/components/pdf-object/utils/use-drag.d.ts +0 -9
- package/dist/components/pdf-object/utils/use-drag.mjs +0 -69
- package/dist/components/pdf-object/utils/use-drop.d.ts +0 -7
- package/dist/components/pdf-object/utils/use-drop.mjs +0 -57
- package/dist/components/pdf-object/utils/use-resize.d.ts +0 -17
- package/dist/components/pdf-object/utils/use-resize.mjs +0 -90
- package/dist/components/pdf-object/utils/use-selector.d.ts +0 -4
- package/dist/components/pdf-object/utils/use-selector.mjs +0 -26
- package/dist/components/pdf-text/PdfText.vue +0 -138
- package/dist/components/pdf-text/utils/text-to-image.d.ts +0 -68
- package/dist/components/pdf-text/utils/text-to-image.mjs +0 -120
- package/dist/components/pdf-viewer/PdfError.vue +0 -74
- package/dist/components/pdf-viewer/PdfLoading.vue +0 -24
- package/dist/components/pdf-viewer/PdfNavigation.vue +0 -169
- package/dist/components/pdf-viewer/PdfViewer.vue +0 -377
- package/dist/components/pdf-viewer/assets/pdf-loading.svg +0 -1
- package/dist/components/pdf-viewer/index.d.ts +0 -25
- package/dist/components/pdf-viewer/index.mjs +0 -24
- package/dist/components/pdf-viewer/utils/pdfjs.d.ts +0 -68
- package/dist/components/pdf-viewer/utils/pdfjs.mjs +0 -54
- package/dist/components/pdf-viewer/utils/use-idle.d.ts +0 -2
- package/dist/components/pdf-viewer/utils/use-idle.mjs +0 -25
- package/dist/components/pdf-viewer/utils/use-sticky.d.ts +0 -6
- package/dist/components/pdf-viewer/utils/use-sticky.mjs +0 -49
- package/dist/components/pdf-viewer/utils/use-viewer.d.ts +0 -27
- package/dist/components/pdf-viewer/utils/use-viewer.mjs +0 -191
- package/dist/components/popover/Popover.vue +0 -131
- package/dist/components/popover/index.d.ts +0 -17
- package/dist/components/popover/index.mjs +0 -52
- package/dist/components/popup/Popup.vue +0 -428
- package/dist/components/popup/index.d.ts +0 -38
- package/dist/components/popup/index.mjs +0 -31
- package/dist/components/progress/Progress.vue +0 -221
- package/dist/components/progress/ProgressItem.vue +0 -56
- package/dist/components/progress/index.d.ts +0 -2
- package/dist/components/progress/index.mjs +0 -0
- package/dist/components/progress-indicator/ProgressIndicator.vue +0 -132
- package/dist/components/progressbar/Progressbar.vue +0 -113
- package/dist/components/progressbar/index.d.ts +0 -7
- package/dist/components/progressbar/index.mjs +0 -11
- package/dist/components/pspdfkit/PspdfHelipad.vue +0 -165
- package/dist/components/pspdfkit/PspdfObject.vue +0 -341
- package/dist/components/pspdfkit/PspdfObjectAddon.vue +0 -30
- package/dist/components/pspdfkit/PspdfObjects.vue +0 -30
- package/dist/components/pspdfkit/PspdfViewer.vue +0 -257
- package/dist/components/pspdfkit/css/custom.css +0 -345
- package/dist/components/pspdfkit/index.d.ts +0 -8
- package/dist/components/pspdfkit/index.mjs +0 -7
- package/dist/components/pspdfkit/utils/position.d.ts +0 -1
- package/dist/components/pspdfkit/utils/position.mjs +0 -5
- package/dist/components/pspdfkit/utils/pspdfkit.d.ts +0 -17
- package/dist/components/pspdfkit/utils/pspdfkit.mjs +0 -53
- package/dist/components/pspdfkit/utils/use-drop.d.ts +0 -2
- package/dist/components/pspdfkit/utils/use-drop.mjs +0 -41
- package/dist/components/pspdfkit/utils/use-viewer.d.ts +0 -17
- package/dist/components/pspdfkit/utils/use-viewer.mjs +0 -167
- package/dist/components/qrcode/Qrcode.vue +0 -174
- package/dist/components/qrcode/index.d.ts +0 -1
- package/dist/components/qrcode/index.mjs +0 -0
- package/dist/components/radio/Radio.vue +0 -304
- package/dist/components/radio/index.d.ts +0 -7
- package/dist/components/radio/index.mjs +0 -16
- package/dist/components/richtext/Richtext.vue +0 -295
- package/dist/components/richtext/RichtextToolbarAdvance.vue +0 -37
- package/dist/components/richtext/RichtextToolbarSimple.vue +0 -158
- package/dist/components/richtext/control/RichtextControlFontFamily.vue +0 -56
- package/dist/components/richtext/control/RichtextControlFontSize.vue +0 -81
- package/dist/components/richtext/control/RichtextControlHighlight.vue +0 -135
- package/dist/components/richtext/control/RichtextControlHistory.vue +0 -27
- package/dist/components/richtext/control/RichtextControlImage.vue +0 -34
- package/dist/components/richtext/control/RichtextControlLink.vue +0 -53
- package/dist/components/richtext/control/RichtextControlList.vue +0 -45
- package/dist/components/richtext/control/RichtextControlTable.vue +0 -106
- package/dist/components/richtext/control/RichtextControlTextAlign.vue +0 -90
- package/dist/components/richtext/control/RichtextControlTextFormat.vue +0 -49
- package/dist/components/richtext/control/RichtextControlTextHeading.vue +0 -101
- package/dist/components/richtext/index.d.ts +0 -7
- package/dist/components/richtext/index.mjs +0 -7
- package/dist/components/richtext/popup/RichtextPopupImageEdit.vue +0 -65
- package/dist/components/richtext/popup/RichtextPopupLinkDetail.vue +0 -95
- package/dist/components/richtext/popup/RichtextPopupLinkEdit.vue +0 -74
- package/dist/components/richtext/tiptap/image-align.d.ts +0 -43
- package/dist/components/richtext/tiptap/image-align.mjs +0 -60
- package/dist/components/ringbar/Ringbar.vue +0 -158
- package/dist/components/ringbar/index.d.ts +0 -1
- package/dist/components/ringbar/index.mjs +0 -0
- package/dist/components/select/Select.vue +0 -576
- package/dist/components/select/SelectInput.vue +0 -123
- package/dist/components/select/SelectTags.vue +0 -58
- package/dist/components/select/adapter/adapter.d.ts +0 -17
- package/dist/components/select/adapter/adapter.mjs +0 -20
- package/dist/components/select/adapter/async-adapter.d.ts +0 -17
- package/dist/components/select/adapter/async-adapter.mjs +0 -61
- package/dist/components/select/adapter/basic-adapter.d.ts +0 -5
- package/dist/components/select/adapter/basic-adapter.mjs +0 -13
- package/dist/components/select/adapter/fuzzy-adapter.d.ts +0 -2
- package/dist/components/select/adapter/fuzzy-adapter.mjs +0 -24
- package/dist/components/select/index.d.ts +0 -15
- package/dist/components/select/index.mjs +0 -20
- package/dist/components/select/utils/use-on-scroll.d.ts +0 -2
- package/dist/components/select/utils/use-on-scroll.mjs +0 -9
- package/dist/components/select/utils/use-on-typing.d.ts +0 -3
- package/dist/components/select/utils/use-on-typing.mjs +0 -8
- package/dist/components/sheet/Sheet.vue +0 -230
- package/dist/components/shimmer/Shimmer.vue +0 -123
- package/dist/components/shimmer/index.d.ts +0 -2
- package/dist/components/shimmer/index.mjs +0 -10
- package/dist/components/sidebar/Sidebar.vue +0 -249
- package/dist/components/sidebar/SidebarBrand.vue +0 -108
- package/dist/components/sidebar/SidebarContent.vue +0 -21
- package/dist/components/sidebar/SidebarContent.vue.d.ts +0 -16
- package/dist/components/sidebar/SidebarNav.vue +0 -260
- package/dist/components/sidebar/index.d.ts +0 -9
- package/dist/components/sidebar/index.mjs +0 -1
- package/dist/components/sidebar-menu/SidebarMenu.vue +0 -123
- package/dist/components/sidebar-menu/SidebarMenuItem.vue +0 -70
- package/dist/components/sidebar-menu/index.d.ts +0 -138
- package/dist/components/sidebar-menu/index.mjs +0 -44
- package/dist/components/signature-draw/SignatureDraw.vue +0 -101
- package/dist/components/signature-draw/SignatureDrawDesktop.vue +0 -165
- package/dist/components/signature-draw/SignatureDrawMobile.vue +0 -244
- package/dist/components/signature-draw/utils/canvas.d.ts +0 -41
- package/dist/components/signature-draw/utils/canvas.mjs +0 -55
- package/dist/components/signature-draw/utils/image.d.ts +0 -7
- package/dist/components/signature-draw/utils/image.mjs +0 -23
- package/dist/components/signature-draw/utils/smooth-line.d.ts +0 -36
- package/dist/components/signature-draw/utils/smooth-line.mjs +0 -56
- package/dist/components/signature-draw/utils/straight-line.d.ts +0 -8
- package/dist/components/signature-draw/utils/straight-line.mjs +0 -24
- package/dist/components/signature-draw/utils/use-draw.d.ts +0 -7
- package/dist/components/signature-draw/utils/use-draw.mjs +0 -29
- package/dist/components/signature-text/SignatureText.vue +0 -138
- package/dist/components/signature-text/utils/formatter.d.ts +0 -2
- package/dist/components/signature-text/utils/formatter.mjs +0 -8
- package/dist/components/signature-text/utils/generate-text.d.ts +0 -8
- package/dist/components/signature-text/utils/generate-text.mjs +0 -28
- package/dist/components/signature-text/utils/load-font.d.ts +0 -1
- package/dist/components/signature-text/utils/load-font.mjs +0 -22
- package/dist/components/spinner/Spinner.vue +0 -156
- package/dist/components/spinner/SpinnerRing.vue +0 -34
- package/dist/components/spinner/SpinnerRinggo.vue +0 -64
- package/dist/components/spread/Spread.vue +0 -52
- package/dist/components/steps/Step.vue +0 -49
- package/dist/components/steps/StepSlider.vue +0 -37
- package/dist/components/steps/StepSlider.vue.d.ts +0 -34
- package/dist/components/steps/Steps.vue +0 -150
- package/dist/components/steps/index.d.ts +0 -30
- package/dist/components/steps/index.mjs +0 -53
- package/dist/components/steps/utils/hook.d.ts +0 -10
- package/dist/components/steps/utils/hook.mjs +0 -35
- package/dist/components/strengthbar/Strengthbar.vue +0 -97
- package/dist/components/subheading/Subheading.vue +0 -148
- package/dist/components/subheading/index.d.ts +0 -1
- package/dist/components/subheading/index.mjs +0 -0
- package/dist/components/table/Table.vue +0 -391
- package/dist/components/table/Table.vue.d.ts +0 -174
- package/dist/components/table/index.d.ts +0 -49
- package/dist/components/table/index.mjs +0 -37
- package/dist/components/table-flex/TableFlex.vue +0 -341
- package/dist/components/table-static/TableStatic.vue +0 -458
- package/dist/components/table-static/TableStaticRoot.vue +0 -42
- package/dist/components/table-static/TableStaticSort.vue +0 -23
- package/dist/components/table-static/index.d.ts +0 -64
- package/dist/components/table-static/index.mjs +0 -24
- package/dist/components/tabs/Tab.vue +0 -34
- package/dist/components/tabs/TabContent.vue +0 -53
- package/dist/components/tabs/TabContent.vue.d.ts +0 -33
- package/dist/components/tabs/Tabs.vue +0 -234
- package/dist/components/text/Text.vue +0 -235
- package/dist/components/text/index.d.ts +0 -2
- package/dist/components/text/index.mjs +0 -0
- package/dist/components/textarea/Textarea.vue +0 -188
- package/dist/components/time/Time.vue +0 -257
- package/dist/components/time/TimeItem.vue +0 -117
- package/dist/components/time/index.d.ts +0 -19
- package/dist/components/time/index.mjs +0 -53
- package/dist/components/time/utils/index.d.ts +0 -9
- package/dist/components/time/utils/index.mjs +0 -82
- package/dist/components/timepicker/Timepicker.vue +0 -230
- package/dist/components/toast/Toast.vue +0 -269
- package/dist/components/toast/index.d.ts +0 -50
- package/dist/components/toast/index.mjs +0 -44
- package/dist/components/toggle/Toggle.vue +0 -239
- package/dist/components/tooltip/Tooltip.vue +0 -172
- package/dist/components/tooltip/TooltipContainer.vue +0 -89
- package/dist/components/tooltip/index.d.ts +0 -17
- package/dist/components/tooltip/index.mjs +0 -113
- package/dist/components/tooltip/utils/create-handler.d.ts +0 -9
- package/dist/components/tooltip/utils/create-handler.mjs +0 -16
- package/dist/components/tooltip/utils/on-hover.d.ts +0 -23
- package/dist/components/tooltip/utils/on-hover.mjs +0 -42
- package/dist/components/tooltip/utils/parse-bindings.d.ts +0 -23
- package/dist/components/tooltip/utils/parse-bindings.mjs +0 -47
- package/dist/components/tour/Tour.vue +0 -112
- package/dist/components/tour/TourDialog.vue +0 -207
- package/dist/components/tour/TourHighlight.vue +0 -58
- package/dist/components/tour/core/base.d.ts +0 -59
- package/dist/components/tour/core/base.mjs +0 -69
- package/dist/components/tour/core/step/action.d.ts +0 -15
- package/dist/components/tour/core/step/action.mjs +0 -14
- package/dist/components/tour/core/step/conditional.d.ts +0 -25
- package/dist/components/tour/core/step/conditional.mjs +0 -57
- package/dist/components/tour/core/step/delay.d.ts +0 -8
- package/dist/components/tour/core/step/delay.mjs +0 -9
- package/dist/components/tour/core/step/dialog.d.ts +0 -11
- package/dist/components/tour/core/step/dialog.mjs +0 -25
- package/dist/components/tour/core/step/visit.d.ts +0 -9
- package/dist/components/tour/core/step/visit.mjs +0 -15
- package/dist/components/tour/core/step.d.ts +0 -37
- package/dist/components/tour/core/step.mjs +0 -46
- package/dist/components/tour/core/story.d.ts +0 -130
- package/dist/components/tour/core/story.mjs +0 -166
- package/dist/components/tour/core/tour.d.ts +0 -126
- package/dist/components/tour/core/tour.mjs +0 -196
- package/dist/components/tour/index.d.ts +0 -3
- package/dist/components/tour/index.mjs +0 -4
- package/dist/components/tour/utils/focus.d.ts +0 -1
- package/dist/components/tour/utils/focus.mjs +0 -6
- package/dist/components/tour/utils/is-visible.d.ts +0 -1
- package/dist/components/tour/utils/is-visible.mjs +0 -29
- package/dist/components/tour/utils/wait-element.d.ts +0 -6
- package/dist/components/tour/utils/wait-element.mjs +0 -45
- package/dist/components/truncate/Truncate.vue +0 -75
- package/dist/components/utils/array.d.ts +0 -2
- package/dist/components/utils/array.mjs +0 -19
- package/dist/components/utils/base64.d.ts +0 -8
- package/dist/components/utils/base64.mjs +0 -35
- package/dist/components/utils/color.d.ts +0 -17
- package/dist/components/utils/color.mjs +0 -14
- package/dist/components/utils/date.d.ts +0 -22
- package/dist/components/utils/date.mjs +0 -14
- package/dist/components/utils/value.d.ts +0 -8
- package/dist/components/utils/value.mjs +0 -7
- package/dist/components/utils/vnode.d.ts +0 -15
- package/dist/components/utils/vnode.mjs +0 -18
- package/dist/components/wizard/Wizard.vue +0 -84
- package/dist/components/wizard/WizardBody.vue +0 -50
- package/dist/components/wizard/WizardHeader.vue +0 -38
- package/dist/components/wizard/WizardHeader.vue.d.ts +0 -16
- package/dist/components/wizard/WizardStep.vue +0 -31
- package/dist/core/index.d.ts +0 -43
- package/dist/core/index.mjs +0 -148
- package/dist/directive/index.d.ts +0 -3
- package/dist/directive/index.mjs +0 -12
- package/dist/module.cjs +0 -5
- package/dist/module.d.ts +0 -27
- package/dist/runtime/plugins/persona.d.ts +0 -2
- package/dist/runtime/plugins/persona.js +0 -35
|
@@ -1,257 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<p-card
|
|
3
|
-
data-testid="time"
|
|
4
|
-
class="time"
|
|
5
|
-
element="div">
|
|
6
|
-
<div class="time__container">
|
|
7
|
-
<TimeItem
|
|
8
|
-
v-model="hour"
|
|
9
|
-
:options="hourOptions"
|
|
10
|
-
time-type="hour"
|
|
11
|
-
class="time__items--hour" />
|
|
12
|
-
|
|
13
|
-
<div class="time__separator">
|
|
14
|
-
{{ timeSeparator }}
|
|
15
|
-
</div>
|
|
16
|
-
|
|
17
|
-
<TimeItem
|
|
18
|
-
v-model="minute"
|
|
19
|
-
:options="minuteOptions"
|
|
20
|
-
time-type="minute"
|
|
21
|
-
class="time__items--minute" />
|
|
22
|
-
|
|
23
|
-
<TimeItem
|
|
24
|
-
v-if="is12Hour"
|
|
25
|
-
v-model="ampm"
|
|
26
|
-
:options="periodOptions"
|
|
27
|
-
time-type="ampm"
|
|
28
|
-
class="time__items--ampm" />
|
|
29
|
-
</div>
|
|
30
|
-
<template
|
|
31
|
-
v-if="$slots.default"
|
|
32
|
-
#footer>
|
|
33
|
-
<div class="time__action">
|
|
34
|
-
<slot :confirm="confirm" />
|
|
35
|
-
</div>
|
|
36
|
-
</template>
|
|
37
|
-
</p-card>
|
|
38
|
-
</template>
|
|
39
|
-
|
|
40
|
-
<script setup lang="ts">
|
|
41
|
-
import pCard from '../card/Card.vue'
|
|
42
|
-
import TimeItem from './TimeItem.vue'
|
|
43
|
-
import type { PropType } from 'vue-demi'
|
|
44
|
-
import {
|
|
45
|
-
watch,
|
|
46
|
-
computed,
|
|
47
|
-
nextTick,
|
|
48
|
-
onBeforeMount,
|
|
49
|
-
ref,
|
|
50
|
-
} from 'vue-demi'
|
|
51
|
-
import { watchDebounced } from '@vueuse/core'
|
|
52
|
-
import { useVModel } from '../input'
|
|
53
|
-
import {
|
|
54
|
-
format,
|
|
55
|
-
formatISO,
|
|
56
|
-
isDate,
|
|
57
|
-
parse,
|
|
58
|
-
startOfDay,
|
|
59
|
-
} from 'date-fns'
|
|
60
|
-
import type { TimeModel, TimeContext } from './index'
|
|
61
|
-
import {
|
|
62
|
-
getHourUnits,
|
|
63
|
-
getMinuteUnits,
|
|
64
|
-
parseTime,
|
|
65
|
-
validateInterval,
|
|
66
|
-
} from './utils'
|
|
67
|
-
|
|
68
|
-
const props = defineProps({
|
|
69
|
-
modelValue: {
|
|
70
|
-
type : [Date, Object] as PropType<Date | TimeModel>,
|
|
71
|
-
default: undefined,
|
|
72
|
-
},
|
|
73
|
-
timeSeparator: {
|
|
74
|
-
type : String,
|
|
75
|
-
default: ':',
|
|
76
|
-
},
|
|
77
|
-
is12Hour: {
|
|
78
|
-
type : Boolean,
|
|
79
|
-
default: false,
|
|
80
|
-
},
|
|
81
|
-
hourInterval: {
|
|
82
|
-
type : Number,
|
|
83
|
-
default : 1,
|
|
84
|
-
validator: (value: number, prop) => {
|
|
85
|
-
return validateInterval('hour', value, prop.is12Hour as boolean)
|
|
86
|
-
},
|
|
87
|
-
},
|
|
88
|
-
minuteInterval: {
|
|
89
|
-
type : Number,
|
|
90
|
-
default : 1,
|
|
91
|
-
validator: (value: number) => {
|
|
92
|
-
return validateInterval('minute', value)
|
|
93
|
-
},
|
|
94
|
-
},
|
|
95
|
-
min: {
|
|
96
|
-
type : Date,
|
|
97
|
-
default: undefined,
|
|
98
|
-
},
|
|
99
|
-
max: {
|
|
100
|
-
type : Date,
|
|
101
|
-
default: undefined,
|
|
102
|
-
},
|
|
103
|
-
})
|
|
104
|
-
|
|
105
|
-
const emit = defineEmits<{
|
|
106
|
-
'update:modelValue': [unknown],
|
|
107
|
-
'context': [TimeContext],
|
|
108
|
-
'change': [TimeContext],
|
|
109
|
-
}>()
|
|
110
|
-
|
|
111
|
-
const model = useVModel(props)
|
|
112
|
-
const localModel = ref<Date>(startOfDay(new Date()))
|
|
113
|
-
|
|
114
|
-
const hour = ref('00')
|
|
115
|
-
const minute = ref('00')
|
|
116
|
-
const ampm = ref<'AM' | 'PM' | '-'>('AM')
|
|
117
|
-
|
|
118
|
-
const timeLabel = computed(() => {
|
|
119
|
-
const time = `${hour.value}:${minute.value}`
|
|
120
|
-
|
|
121
|
-
return props.is12Hour ? `${time} ${ampm.value}` : time
|
|
122
|
-
})
|
|
123
|
-
|
|
124
|
-
const timeFormat = computed(() => props.is12Hour ? 'hh:mm a' : 'HH:mm')
|
|
125
|
-
|
|
126
|
-
const hourOptions = computed(() => {
|
|
127
|
-
return getHourUnits(localModel.value, props.is12Hour, props.hourInterval, props.min, props.max)
|
|
128
|
-
})
|
|
129
|
-
|
|
130
|
-
const minuteOptions = computed(() => {
|
|
131
|
-
return getMinuteUnits(localModel.value, Number(hour.value), props.minuteInterval, props.min, props.max)
|
|
132
|
-
})
|
|
133
|
-
|
|
134
|
-
const periodOptions = computed(() => {
|
|
135
|
-
return ['AM', 'PM'] // TODO: should handle for period within time range
|
|
136
|
-
})
|
|
137
|
-
|
|
138
|
-
watchDebounced([
|
|
139
|
-
hour,
|
|
140
|
-
minute,
|
|
141
|
-
ampm,
|
|
142
|
-
], () => {
|
|
143
|
-
const date = parse(timeLabel.value, timeFormat.value, localModel.value)
|
|
144
|
-
|
|
145
|
-
emit('change', getContext(date))
|
|
146
|
-
}, { flush: 'post', debounce: 300 })
|
|
147
|
-
|
|
148
|
-
watch(model, init)
|
|
149
|
-
|
|
150
|
-
onBeforeMount(init)
|
|
151
|
-
|
|
152
|
-
function init () {
|
|
153
|
-
try {
|
|
154
|
-
if (!model.value)
|
|
155
|
-
return
|
|
156
|
-
|
|
157
|
-
if (isDate(model.value)) {
|
|
158
|
-
localModel.value = new Date(model.value as Date)
|
|
159
|
-
|
|
160
|
-
const { hh, mm, a } = parseTime(localModel.value, timeFormat.value)
|
|
161
|
-
|
|
162
|
-
assignTime(hh, mm, a)
|
|
163
|
-
} else {
|
|
164
|
-
const { hh, mm, a } = (model.value as TimeModel)
|
|
165
|
-
|
|
166
|
-
assignTime(hh, mm, a)
|
|
167
|
-
|
|
168
|
-
localModel.value = parse(timeLabel.value, timeFormat.value, new Date())
|
|
169
|
-
|
|
170
|
-
!props.is12Hour && a && console.warn('Please provide is12Hour props to parse time to 12 Hour Format')
|
|
171
|
-
}
|
|
172
|
-
} catch (error) {
|
|
173
|
-
console.warn(error)
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
function confirm (): void {
|
|
178
|
-
try {
|
|
179
|
-
localModel.value = parse(timeLabel.value, timeFormat.value, localModel.value)
|
|
180
|
-
|
|
181
|
-
model.value = isDate(model.value)
|
|
182
|
-
? new Date(localModel.value)
|
|
183
|
-
: {
|
|
184
|
-
hh: hour.value,
|
|
185
|
-
mm: minute.value,
|
|
186
|
-
a : props.is12Hour ? ampm.value : undefined,
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
emit('context', getContext(localModel.value))
|
|
190
|
-
} catch (error) {
|
|
191
|
-
console.warn(error)
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
async function assignTime (hh: string, mm: string, a?: 'AM' | 'PM' | '-') {
|
|
196
|
-
hour.value = hh ?? '00'
|
|
197
|
-
minute.value = mm ?? '00'
|
|
198
|
-
ampm.value = a ?? 'AM'
|
|
199
|
-
|
|
200
|
-
await nextTick()
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
function getContext (date: Date): TimeContext {
|
|
204
|
-
return {
|
|
205
|
-
time : format(date, timeFormat.value),
|
|
206
|
-
date : date,
|
|
207
|
-
dateISO: formatISO(date),
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
</script>
|
|
211
|
-
|
|
212
|
-
<style lang="postcss">
|
|
213
|
-
.time {
|
|
214
|
-
--p-card-padding-x: 2rem;
|
|
215
|
-
--p-card-padding-y: 2rem;
|
|
216
|
-
|
|
217
|
-
@apply flex flex-col shadow-xl;
|
|
218
|
-
@apply max-w-[320px] overflow-hidden;
|
|
219
|
-
|
|
220
|
-
&.card {
|
|
221
|
-
@apply border-transparent dark:border-transparent;
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
&__container {
|
|
225
|
-
@apply flex items-center justify-center w-full min-h-[144px] space-x-2;
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
&__separator {
|
|
229
|
-
@apply px-2.5 py-3;
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
&__action {
|
|
233
|
-
@apply grid grid-flow-col auto-cols-fr;
|
|
234
|
-
|
|
235
|
-
&--cancel,
|
|
236
|
-
&--confirm {
|
|
237
|
-
@apply mx-2;
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
.card__body {
|
|
242
|
-
@apply pb-6;
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
.card__footer {
|
|
246
|
-
@apply pt-0;
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
.splide__track {
|
|
250
|
-
@apply px-2;
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
.dropdown__subitem & {
|
|
254
|
-
@apply shadow-none;
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
</style>
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div
|
|
3
|
-
ref="container"
|
|
4
|
-
class="time__items splide"
|
|
5
|
-
:class="`time__times--${timeType}`">
|
|
6
|
-
<div class="splide__track">
|
|
7
|
-
<div class="splide__list">
|
|
8
|
-
<div
|
|
9
|
-
v-for="option in options"
|
|
10
|
-
:key="option"
|
|
11
|
-
class="time__item splide__slide">
|
|
12
|
-
{{ option }}
|
|
13
|
-
</div>
|
|
14
|
-
</div>
|
|
15
|
-
</div>
|
|
16
|
-
</div>
|
|
17
|
-
</template>
|
|
18
|
-
|
|
19
|
-
<script setup lang="ts">
|
|
20
|
-
import {
|
|
21
|
-
ref,
|
|
22
|
-
onMounted,
|
|
23
|
-
watch,
|
|
24
|
-
computed,
|
|
25
|
-
} from 'vue-demi'
|
|
26
|
-
import { watchDebounced } from '@vueuse/core'
|
|
27
|
-
import type {
|
|
28
|
-
PropType,
|
|
29
|
-
Ref,
|
|
30
|
-
} from 'vue-demi'
|
|
31
|
-
import { useTime } from './index'
|
|
32
|
-
import { useVModel } from '../input'
|
|
33
|
-
import type { Options } from '@splidejs/splide'
|
|
34
|
-
import '@splidejs/splide/css/core'
|
|
35
|
-
|
|
36
|
-
type TimeType = 'hour' | 'minute' | 'ampm'
|
|
37
|
-
|
|
38
|
-
const props = defineProps({
|
|
39
|
-
modelValue: {
|
|
40
|
-
type : String,
|
|
41
|
-
default: '00',
|
|
42
|
-
},
|
|
43
|
-
timeType: {
|
|
44
|
-
type : String as PropType<TimeType>,
|
|
45
|
-
default: 'hour',
|
|
46
|
-
},
|
|
47
|
-
options: {
|
|
48
|
-
type : Array<string>,
|
|
49
|
-
default: () => [],
|
|
50
|
-
},
|
|
51
|
-
})
|
|
52
|
-
|
|
53
|
-
const { splide, activeSplide, initSplide } = useTime()
|
|
54
|
-
|
|
55
|
-
const model = useVModel(props)
|
|
56
|
-
const container = ref<HTMLDivElement>()
|
|
57
|
-
|
|
58
|
-
const timeOptions = computed(() => props.options)
|
|
59
|
-
|
|
60
|
-
watch(activeSplide, (value) => {
|
|
61
|
-
model.value = props.options[value]
|
|
62
|
-
})
|
|
63
|
-
|
|
64
|
-
watchDebounced(timeOptions, (value) => {
|
|
65
|
-
if (!splide.value)
|
|
66
|
-
return
|
|
67
|
-
|
|
68
|
-
const splideOptions: Options = {
|
|
69
|
-
...splide.value.options,
|
|
70
|
-
clones: value.length === 1 ? 0 : undefined,
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
splide.value.options = splideOptions
|
|
74
|
-
splide.value.refresh()
|
|
75
|
-
|
|
76
|
-
if (!value.includes(model.value))
|
|
77
|
-
model.value = value[0]
|
|
78
|
-
}, { flush: 'post', debounce: 50 })
|
|
79
|
-
|
|
80
|
-
onMounted(async () => {
|
|
81
|
-
if (container.value) {
|
|
82
|
-
const splideOptions: Options = {
|
|
83
|
-
start: timeOptions.value.indexOf(model.value),
|
|
84
|
-
type : props.timeType === 'ampm' ? 'slide' : 'loop',
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
await initSplide(container as Ref<HTMLDivElement>, splideOptions)
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
splide.value?.on('refresh', () => {
|
|
91
|
-
const index = timeOptions.value.indexOf(model.value)
|
|
92
|
-
|
|
93
|
-
splide.value?.go(index === -1 ? 0 : index)
|
|
94
|
-
})
|
|
95
|
-
})
|
|
96
|
-
|
|
97
|
-
</script>
|
|
98
|
-
|
|
99
|
-
<style lang="postcss">
|
|
100
|
-
.time {
|
|
101
|
-
&__items {
|
|
102
|
-
&:before {
|
|
103
|
-
@apply absolute content-[''] w-[42px] h-12 border-default dark:border-dark-default border-y;
|
|
104
|
-
@apply top-[50%] left-[50%] translate-x-[-50%] translate-y-[-50%];
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
&__item {
|
|
109
|
-
@apply text-center px-2.5 py-3 text-subtle dark:text-dark-subtle cursor-pointer;
|
|
110
|
-
@apply transition-[color] duration-[50ms];
|
|
111
|
-
|
|
112
|
-
&.is-active {
|
|
113
|
-
@apply text-default dark:text-dark-default font-medium cursor-default;
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
</style>
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { MaybeRef } from '@vueuse/core';
|
|
2
|
-
import type { Options, Splide } from '@splidejs/splide';
|
|
3
|
-
export type TimeLimitation = Date | TimeModel | undefined;
|
|
4
|
-
export interface TimeModel {
|
|
5
|
-
hh: string;
|
|
6
|
-
mm: string;
|
|
7
|
-
a?: 'AM' | 'PM' | '-';
|
|
8
|
-
}
|
|
9
|
-
export interface TimeContext {
|
|
10
|
-
time: string;
|
|
11
|
-
date: Date;
|
|
12
|
-
dateISO: string;
|
|
13
|
-
}
|
|
14
|
-
export declare function useTime(): {
|
|
15
|
-
splide: import("vue-demi").Ref<Splide | undefined, Splide | undefined>;
|
|
16
|
-
activeSplide: import("vue-demi").Ref<number, number>;
|
|
17
|
-
initSplide: (element: MaybeRef<HTMLDivElement>, options?: Options) => Promise<void>;
|
|
18
|
-
initSplideEvent: () => void;
|
|
19
|
-
};
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
onBeforeUnmount,
|
|
3
|
-
ref,
|
|
4
|
-
unref
|
|
5
|
-
} from "vue-demi";
|
|
6
|
-
import defu from "defu";
|
|
7
|
-
export function useTime() {
|
|
8
|
-
const splide = ref();
|
|
9
|
-
const activeSplide = ref(1);
|
|
10
|
-
async function initSplide(element, options) {
|
|
11
|
-
const { Splide } = await import("@splidejs/splide");
|
|
12
|
-
const container = unref(element);
|
|
13
|
-
const splideOptions = defu(options, {
|
|
14
|
-
direction: "ttb",
|
|
15
|
-
height: "9rem",
|
|
16
|
-
width: "100%",
|
|
17
|
-
focus: "center",
|
|
18
|
-
perPage: 3,
|
|
19
|
-
perMove: 1,
|
|
20
|
-
arrows: false,
|
|
21
|
-
wheel: true,
|
|
22
|
-
wheelSleep: 150,
|
|
23
|
-
isNavigation: true,
|
|
24
|
-
pagination: false
|
|
25
|
-
});
|
|
26
|
-
splide.value = new Splide(container, splideOptions);
|
|
27
|
-
initSplideEvent();
|
|
28
|
-
}
|
|
29
|
-
function initSplideEvent() {
|
|
30
|
-
if (!splide.value)
|
|
31
|
-
return;
|
|
32
|
-
splide.value.on("mounted", onTimeLoad);
|
|
33
|
-
splide.value.on("move", onTimeChange);
|
|
34
|
-
splide.value.mount();
|
|
35
|
-
}
|
|
36
|
-
function onTimeLoad() {
|
|
37
|
-
if (!splide.value)
|
|
38
|
-
return;
|
|
39
|
-
activeSplide.value = splide.value.index;
|
|
40
|
-
}
|
|
41
|
-
function onTimeChange(index) {
|
|
42
|
-
activeSplide.value = index;
|
|
43
|
-
}
|
|
44
|
-
onBeforeUnmount(() => {
|
|
45
|
-
splide.value?.destroy();
|
|
46
|
-
});
|
|
47
|
-
return {
|
|
48
|
-
splide,
|
|
49
|
-
activeSplide,
|
|
50
|
-
initSplide,
|
|
51
|
-
initSplideEvent
|
|
52
|
-
};
|
|
53
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export declare function getHourUnits(model: Date, is12Hour: boolean, step?: number, min?: Date, max?: Date): string[];
|
|
2
|
-
export declare function getMinuteUnits(model: Date, currentHour: number, step?: number, min?: Date, max?: Date): string[];
|
|
3
|
-
export declare function getFormat(is12Hour: boolean): "hh:mm a" | "HH:mm";
|
|
4
|
-
export declare function parseTime(date: Date, timeFormat: string): {
|
|
5
|
-
hh: string;
|
|
6
|
-
mm: string;
|
|
7
|
-
a: "AM" | "PM";
|
|
8
|
-
};
|
|
9
|
-
export declare function validateInterval(type: 'hour' | 'minute', value: number, is12Hour?: boolean): boolean;
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
set,
|
|
3
|
-
eachHourOfInterval,
|
|
4
|
-
eachMinuteOfInterval,
|
|
5
|
-
endOfDay,
|
|
6
|
-
format,
|
|
7
|
-
isBefore,
|
|
8
|
-
min as minDate,
|
|
9
|
-
max as maxDate,
|
|
10
|
-
startOfDay,
|
|
11
|
-
isSameHour,
|
|
12
|
-
endOfHour,
|
|
13
|
-
startOfHour
|
|
14
|
-
} from "date-fns";
|
|
15
|
-
import { uniq } from "lodash-es";
|
|
16
|
-
export function getHourUnits(model, is12Hour, step = 1, min, max) {
|
|
17
|
-
if (isBefore(max, min)) {
|
|
18
|
-
console.warn("`max` value should greater than `min` value and vice versa");
|
|
19
|
-
return [];
|
|
20
|
-
}
|
|
21
|
-
let start = startOfDay(/* @__PURE__ */ new Date());
|
|
22
|
-
let end = endOfDay(/* @__PURE__ */ new Date());
|
|
23
|
-
if (min)
|
|
24
|
-
start = maxDate([model, min]);
|
|
25
|
-
if (max)
|
|
26
|
-
end = minDate([endOfDay(start), max]);
|
|
27
|
-
const hourUnits = eachHourOfInterval({
|
|
28
|
-
start,
|
|
29
|
-
end
|
|
30
|
-
}, { step });
|
|
31
|
-
const units = hourUnits.map((date) => {
|
|
32
|
-
if (is12Hour)
|
|
33
|
-
return format(date, "hh");
|
|
34
|
-
return format(date, "HH");
|
|
35
|
-
});
|
|
36
|
-
return uniq(units);
|
|
37
|
-
}
|
|
38
|
-
export function getMinuteUnits(model, currentHour, step = 1, min, max) {
|
|
39
|
-
if (isBefore(max, min)) {
|
|
40
|
-
console.warn("`max` value should greater than `min` value and vice versa");
|
|
41
|
-
return [];
|
|
42
|
-
}
|
|
43
|
-
let start = startOfDay(/* @__PURE__ */ new Date());
|
|
44
|
-
let end = endOfDay(/* @__PURE__ */ new Date());
|
|
45
|
-
if (min)
|
|
46
|
-
start = maxDate([model, min]);
|
|
47
|
-
if (max)
|
|
48
|
-
end = minDate([endOfDay(start), max]);
|
|
49
|
-
const currentTime = set(start, { hours: currentHour });
|
|
50
|
-
const minuteUnits = eachMinuteOfInterval({
|
|
51
|
-
start: isSameHour(currentTime, start) ? currentTime : startOfHour(currentTime),
|
|
52
|
-
end: isSameHour(currentTime, end) ? end : endOfHour(currentTime)
|
|
53
|
-
}, { step });
|
|
54
|
-
const units = minuteUnits.map((date) => {
|
|
55
|
-
return format(date, "mm");
|
|
56
|
-
});
|
|
57
|
-
return uniq(units);
|
|
58
|
-
}
|
|
59
|
-
export function getFormat(is12Hour) {
|
|
60
|
-
return is12Hour ? "hh:mm a" : "HH:mm";
|
|
61
|
-
}
|
|
62
|
-
export function parseTime(date, timeFormat) {
|
|
63
|
-
const [hh, mm] = format(date, timeFormat).split(":");
|
|
64
|
-
const a = format(date, "a");
|
|
65
|
-
return {
|
|
66
|
-
hh,
|
|
67
|
-
mm: mm.slice(0, 2),
|
|
68
|
-
a
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
export function validateInterval(type, value, is12Hour = false) {
|
|
72
|
-
let min = 0;
|
|
73
|
-
let max = 0;
|
|
74
|
-
if (type === "hour") {
|
|
75
|
-
min = 1;
|
|
76
|
-
max = is12Hour ? 12 : 24;
|
|
77
|
-
} else if (type === "minute") {
|
|
78
|
-
min = 1;
|
|
79
|
-
max = 60;
|
|
80
|
-
}
|
|
81
|
-
return value >= min && value < max;
|
|
82
|
-
}
|