@rupe/v-datepicker 1.0.0-alpha.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/LICENSE +21 -0
- package/dist/components/Calendar/CalendarCell.d.ts +17 -0
- package/dist/components/Calendar/CalendarCell.vue.js +34 -0
- package/dist/components/Calendar/CalendarCell.vue.js.map +1 -0
- package/dist/components/Calendar/CalendarCell.vue2.js +5 -0
- package/dist/components/Calendar/CalendarCell.vue2.js.map +1 -0
- package/dist/components/Calendar/CalendarCellTrigger.d.ts +72 -0
- package/dist/components/Calendar/CalendarCellTrigger.vue.js +159 -0
- package/dist/components/Calendar/CalendarCellTrigger.vue.js.map +1 -0
- package/dist/components/Calendar/CalendarCellTrigger.vue2.js +5 -0
- package/dist/components/Calendar/CalendarCellTrigger.vue2.js.map +1 -0
- package/dist/components/Calendar/CalendarGrid.d.ts +13 -0
- package/dist/components/Calendar/CalendarGrid.vue.js +40 -0
- package/dist/components/Calendar/CalendarGrid.vue.js.map +1 -0
- package/dist/components/Calendar/CalendarGrid.vue2.js +5 -0
- package/dist/components/Calendar/CalendarGrid.vue2.js.map +1 -0
- package/dist/components/Calendar/CalendarGridBody.d.ts +13 -0
- package/dist/components/Calendar/CalendarGridBody.vue.js +25 -0
- package/dist/components/Calendar/CalendarGridBody.vue.js.map +1 -0
- package/dist/components/Calendar/CalendarGridBody.vue2.js +5 -0
- package/dist/components/Calendar/CalendarGridBody.vue2.js.map +1 -0
- package/dist/components/Calendar/CalendarGridHead.d.ts +13 -0
- package/dist/components/Calendar/CalendarGridHead.vue.js +25 -0
- package/dist/components/Calendar/CalendarGridHead.vue.js.map +1 -0
- package/dist/components/Calendar/CalendarGridHead.vue2.js +5 -0
- package/dist/components/Calendar/CalendarGridHead.vue2.js.map +1 -0
- package/dist/components/Calendar/CalendarGridRow.d.ts +13 -0
- package/dist/components/Calendar/CalendarGridRow.vue.js +25 -0
- package/dist/components/Calendar/CalendarGridRow.vue.js.map +1 -0
- package/dist/components/Calendar/CalendarGridRow.vue2.js +5 -0
- package/dist/components/Calendar/CalendarGridRow.vue2.js.map +1 -0
- package/dist/components/Calendar/CalendarHeadCell.d.ts +13 -0
- package/dist/components/Calendar/CalendarHeadCell.vue.js +25 -0
- package/dist/components/Calendar/CalendarHeadCell.vue.js.map +1 -0
- package/dist/components/Calendar/CalendarHeadCell.vue2.js +5 -0
- package/dist/components/Calendar/CalendarHeadCell.vue2.js.map +1 -0
- package/dist/components/Calendar/CalendarHeader.d.ts +13 -0
- package/dist/components/Calendar/CalendarHeader.vue.js +25 -0
- package/dist/components/Calendar/CalendarHeader.vue.js.map +1 -0
- package/dist/components/Calendar/CalendarHeader.vue2.js +5 -0
- package/dist/components/Calendar/CalendarHeader.vue2.js.map +1 -0
- package/dist/components/Calendar/CalendarHeading.d.ts +21 -0
- package/dist/components/Calendar/CalendarHeading.vue.js +33 -0
- package/dist/components/Calendar/CalendarHeading.vue.js.map +1 -0
- package/dist/components/Calendar/CalendarHeading.vue2.js +5 -0
- package/dist/components/Calendar/CalendarHeading.vue2.js.map +1 -0
- package/dist/components/Calendar/CalendarMonthHeading.d.ts +22 -0
- package/dist/components/Calendar/CalendarMonthHeading.vue.js +49 -0
- package/dist/components/Calendar/CalendarMonthHeading.vue.js.map +1 -0
- package/dist/components/Calendar/CalendarMonthHeading.vue2.js +5 -0
- package/dist/components/Calendar/CalendarMonthHeading.vue2.js.map +1 -0
- package/dist/components/Calendar/CalendarMonthYearOverlay.d.ts +27 -0
- package/dist/components/Calendar/CalendarMonthYearOverlay.vue.js +61 -0
- package/dist/components/Calendar/CalendarMonthYearOverlay.vue.js.map +1 -0
- package/dist/components/Calendar/CalendarMonthYearOverlay.vue2.js +5 -0
- package/dist/components/Calendar/CalendarMonthYearOverlay.vue2.js.map +1 -0
- package/dist/components/Calendar/CalendarNext.d.ts +21 -0
- package/dist/components/Calendar/CalendarNext.vue.js +42 -0
- package/dist/components/Calendar/CalendarNext.vue.js.map +1 -0
- package/dist/components/Calendar/CalendarNext.vue2.js +5 -0
- package/dist/components/Calendar/CalendarNext.vue2.js.map +1 -0
- package/dist/components/Calendar/CalendarOverlayItem.d.ts +24 -0
- package/dist/components/Calendar/CalendarOverlayItem.vue.js +34 -0
- package/dist/components/Calendar/CalendarOverlayItem.vue.js.map +1 -0
- package/dist/components/Calendar/CalendarOverlayItem.vue2.js +5 -0
- package/dist/components/Calendar/CalendarOverlayItem.vue2.js.map +1 -0
- package/dist/components/Calendar/CalendarPrev.d.ts +21 -0
- package/dist/components/Calendar/CalendarPrev.vue.js +42 -0
- package/dist/components/Calendar/CalendarPrev.vue.js.map +1 -0
- package/dist/components/Calendar/CalendarPrev.vue2.js +5 -0
- package/dist/components/Calendar/CalendarPrev.vue2.js.map +1 -0
- package/dist/components/Calendar/CalendarRoot.d.ts +210 -0
- package/dist/components/Calendar/CalendarRoot.vue.js +253 -0
- package/dist/components/Calendar/CalendarRoot.vue.js.map +1 -0
- package/dist/components/Calendar/CalendarRoot.vue2.js +8 -0
- package/dist/components/Calendar/CalendarRoot.vue2.js.map +1 -0
- package/dist/components/Calendar/CalendarYearHeading.d.ts +22 -0
- package/dist/components/Calendar/CalendarYearHeading.vue.js +49 -0
- package/dist/components/Calendar/CalendarYearHeading.vue.js.map +1 -0
- package/dist/components/Calendar/CalendarYearHeading.vue2.js +5 -0
- package/dist/components/Calendar/CalendarYearHeading.vue2.js.map +1 -0
- package/dist/components/Calendar/index.d.ts +15 -0
- package/dist/components/Calendar/useCalendar.d.ts +50 -0
- package/dist/components/Calendar/useCalendar.js +317 -0
- package/dist/components/Calendar/useCalendar.js.map +1 -0
- package/dist/components/ConfigProvider/ConfigProvider.d.ts +51 -0
- package/dist/components/ConfigProvider/ConfigProvider.vue.js +7 -0
- package/dist/components/ConfigProvider/ConfigProvider.vue.js.map +1 -0
- package/dist/components/ConfigProvider/index.d.ts +1 -0
- package/dist/components/DateField/DateFieldInput.d.ts +15 -0
- package/dist/components/DateField/DateFieldInput.vue.js +70 -0
- package/dist/components/DateField/DateFieldInput.vue.js.map +1 -0
- package/dist/components/DateField/DateFieldInput.vue2.js +5 -0
- package/dist/components/DateField/DateFieldInput.vue2.js.map +1 -0
- package/dist/components/DateField/DateFieldRoot.d.ts +151 -0
- package/dist/components/DateField/DateFieldRoot.vue.js +237 -0
- package/dist/components/DateField/DateFieldRoot.vue.js.map +1 -0
- package/dist/components/DateField/DateFieldRoot.vue2.js +8 -0
- package/dist/components/DateField/DateFieldRoot.vue2.js.map +1 -0
- package/dist/components/DateField/index.d.ts +2 -0
- package/dist/components/DatePicker/DatePickerAnchor.d.ts +11 -0
- package/dist/components/DatePicker/DatePickerAnchor.vue.js +29 -0
- package/dist/components/DatePicker/DatePickerAnchor.vue.js.map +1 -0
- package/dist/components/DatePicker/DatePickerAnchor.vue2.js +5 -0
- package/dist/components/DatePicker/DatePickerAnchor.vue2.js.map +1 -0
- package/dist/components/DatePicker/DatePickerArrow.d.ts +11 -0
- package/dist/components/DatePicker/DatePickerArrow.vue.js +31 -0
- package/dist/components/DatePicker/DatePickerArrow.vue.js.map +1 -0
- package/dist/components/DatePicker/DatePickerArrow.vue2.js +5 -0
- package/dist/components/DatePicker/DatePickerArrow.vue2.js.map +1 -0
- package/dist/components/DatePicker/DatePickerCalendar.d.ts +17 -0
- package/dist/components/DatePicker/DatePickerCalendar.vue.js +60 -0
- package/dist/components/DatePicker/DatePickerCalendar.vue.js.map +1 -0
- package/dist/components/DatePicker/DatePickerCalendar.vue2.js +5 -0
- package/dist/components/DatePicker/DatePickerCalendar.vue2.js.map +1 -0
- package/dist/components/DatePicker/DatePickerCell.d.ts +11 -0
- package/dist/components/DatePicker/DatePickerCell.vue.js +28 -0
- package/dist/components/DatePicker/DatePickerCell.vue.js.map +1 -0
- package/dist/components/DatePicker/DatePickerCell.vue2.js +5 -0
- package/dist/components/DatePicker/DatePickerCell.vue2.js.map +1 -0
- package/dist/components/DatePicker/DatePickerCellTrigger.d.ts +10 -0
- package/dist/components/DatePicker/DatePickerCellTrigger.vue.js +29 -0
- package/dist/components/DatePicker/DatePickerCellTrigger.vue.js.map +1 -0
- package/dist/components/DatePicker/DatePickerCellTrigger.vue2.js +5 -0
- package/dist/components/DatePicker/DatePickerCellTrigger.vue2.js.map +1 -0
- package/dist/components/DatePicker/DatePickerClose.d.ts +11 -0
- package/dist/components/DatePicker/DatePickerClose.vue.js +28 -0
- package/dist/components/DatePicker/DatePickerClose.vue.js.map +1 -0
- package/dist/components/DatePicker/DatePickerClose.vue2.js +5 -0
- package/dist/components/DatePicker/DatePickerClose.vue2.js.map +1 -0
- package/dist/components/DatePicker/DatePickerContent.d.ts +31 -0
- package/dist/components/DatePicker/DatePickerContent.vue.js +69 -0
- package/dist/components/DatePicker/DatePickerContent.vue.js.map +1 -0
- package/dist/components/DatePicker/DatePickerContent.vue2.js +5 -0
- package/dist/components/DatePicker/DatePickerContent.vue2.js.map +1 -0
- package/dist/components/DatePicker/DatePickerField.d.ts +16 -0
- package/dist/components/DatePicker/DatePickerField.vue.js +55 -0
- package/dist/components/DatePicker/DatePickerField.vue.js.map +1 -0
- package/dist/components/DatePicker/DatePickerField.vue2.js +5 -0
- package/dist/components/DatePicker/DatePickerField.vue2.js.map +1 -0
- package/dist/components/DatePicker/DatePickerGrid.d.ts +11 -0
- package/dist/components/DatePicker/DatePickerGrid.vue.js +27 -0
- package/dist/components/DatePicker/DatePickerGrid.vue.js.map +1 -0
- package/dist/components/DatePicker/DatePickerGrid.vue2.js +5 -0
- package/dist/components/DatePicker/DatePickerGrid.vue2.js.map +1 -0
- package/dist/components/DatePicker/DatePickerGridBody.d.ts +11 -0
- package/dist/components/DatePicker/DatePickerGridBody.vue.js +27 -0
- package/dist/components/DatePicker/DatePickerGridBody.vue.js.map +1 -0
- package/dist/components/DatePicker/DatePickerGridBody.vue2.js +5 -0
- package/dist/components/DatePicker/DatePickerGridBody.vue2.js.map +1 -0
- package/dist/components/DatePicker/DatePickerGridHead.d.ts +11 -0
- package/dist/components/DatePicker/DatePickerGridHead.vue.js +27 -0
- package/dist/components/DatePicker/DatePickerGridHead.vue.js.map +1 -0
- package/dist/components/DatePicker/DatePickerGridHead.vue2.js +5 -0
- package/dist/components/DatePicker/DatePickerGridHead.vue2.js.map +1 -0
- package/dist/components/DatePicker/DatePickerGridRow.d.ts +11 -0
- package/dist/components/DatePicker/DatePickerGridRow.vue.js +27 -0
- package/dist/components/DatePicker/DatePickerGridRow.vue.js.map +1 -0
- package/dist/components/DatePicker/DatePickerGridRow.vue2.js +5 -0
- package/dist/components/DatePicker/DatePickerGridRow.vue2.js.map +1 -0
- package/dist/components/DatePicker/DatePickerHeadCell.d.ts +11 -0
- package/dist/components/DatePicker/DatePickerHeadCell.vue.js +27 -0
- package/dist/components/DatePicker/DatePickerHeadCell.vue.js.map +1 -0
- package/dist/components/DatePicker/DatePickerHeadCell.vue2.js +5 -0
- package/dist/components/DatePicker/DatePickerHeadCell.vue2.js.map +1 -0
- package/dist/components/DatePicker/DatePickerHeader.d.ts +11 -0
- package/dist/components/DatePicker/DatePickerHeader.vue.js +27 -0
- package/dist/components/DatePicker/DatePickerHeader.vue.js.map +1 -0
- package/dist/components/DatePicker/DatePickerHeader.vue2.js +5 -0
- package/dist/components/DatePicker/DatePickerHeader.vue2.js.map +1 -0
- package/dist/components/DatePicker/DatePickerHeading.d.ts +19 -0
- package/dist/components/DatePicker/DatePickerHeading.vue.js +29 -0
- package/dist/components/DatePicker/DatePickerHeading.vue.js.map +1 -0
- package/dist/components/DatePicker/DatePickerHeading.vue2.js +5 -0
- package/dist/components/DatePicker/DatePickerHeading.vue2.js.map +1 -0
- package/dist/components/DatePicker/DatePickerInput.d.ts +11 -0
- package/dist/components/DatePicker/DatePickerInput.vue.js +27 -0
- package/dist/components/DatePicker/DatePickerInput.vue.js.map +1 -0
- package/dist/components/DatePicker/DatePickerInput.vue2.js +5 -0
- package/dist/components/DatePicker/DatePickerInput.vue2.js.map +1 -0
- package/dist/components/DatePicker/DatePickerMonthHeading.d.ts +13 -0
- package/dist/components/DatePicker/DatePickerMonthHeading.vue.js +27 -0
- package/dist/components/DatePicker/DatePickerMonthHeading.vue.js.map +1 -0
- package/dist/components/DatePicker/DatePickerMonthHeading.vue2.js +5 -0
- package/dist/components/DatePicker/DatePickerMonthHeading.vue2.js.map +1 -0
- package/dist/components/DatePicker/DatePickerMonthYearOverlay.d.ts +24 -0
- package/dist/components/DatePicker/DatePickerMonthYearOverlay.vue.js +30 -0
- package/dist/components/DatePicker/DatePickerMonthYearOverlay.vue.js.map +1 -0
- package/dist/components/DatePicker/DatePickerMonthYearOverlay.vue2.js +5 -0
- package/dist/components/DatePicker/DatePickerMonthYearOverlay.vue2.js.map +1 -0
- package/dist/components/DatePicker/DatePickerNext.d.ts +10 -0
- package/dist/components/DatePicker/DatePickerNext.vue.js +28 -0
- package/dist/components/DatePicker/DatePickerNext.vue.js.map +1 -0
- package/dist/components/DatePicker/DatePickerNext.vue2.js +5 -0
- package/dist/components/DatePicker/DatePickerNext.vue2.js.map +1 -0
- package/dist/components/DatePicker/DatePickerOverlayItem.d.ts +19 -0
- package/dist/components/DatePicker/DatePickerOverlayItem.vue.js +25 -0
- package/dist/components/DatePicker/DatePickerOverlayItem.vue.js.map +1 -0
- package/dist/components/DatePicker/DatePickerOverlayItem.vue2.js +5 -0
- package/dist/components/DatePicker/DatePickerOverlayItem.vue2.js.map +1 -0
- package/dist/components/DatePicker/DatePickerPrev.d.ts +10 -0
- package/dist/components/DatePicker/DatePickerPrev.vue.js +28 -0
- package/dist/components/DatePicker/DatePickerPrev.vue.js.map +1 -0
- package/dist/components/DatePicker/DatePickerPrev.vue2.js +5 -0
- package/dist/components/DatePicker/DatePickerPrev.vue2.js.map +1 -0
- package/dist/components/DatePicker/DatePickerRoot.d.ts +84 -0
- package/dist/components/DatePicker/DatePickerRoot.vue.js +169 -0
- package/dist/components/DatePicker/DatePickerRoot.vue.js.map +1 -0
- package/dist/components/DatePicker/DatePickerRoot.vue2.js +8 -0
- package/dist/components/DatePicker/DatePickerRoot.vue2.js.map +1 -0
- package/dist/components/DatePicker/DatePickerTrigger.d.ts +11 -0
- package/dist/components/DatePicker/DatePickerTrigger.vue.js +37 -0
- package/dist/components/DatePicker/DatePickerTrigger.vue.js.map +1 -0
- package/dist/components/DatePicker/DatePickerTrigger.vue2.js +5 -0
- package/dist/components/DatePicker/DatePickerTrigger.vue2.js.map +1 -0
- package/dist/components/DatePicker/DatePickerYearHeading.d.ts +13 -0
- package/dist/components/DatePicker/DatePickerYearHeading.vue.js +27 -0
- package/dist/components/DatePicker/DatePickerYearHeading.vue.js.map +1 -0
- package/dist/components/DatePicker/DatePickerYearHeading.vue2.js +5 -0
- package/dist/components/DatePicker/DatePickerYearHeading.vue2.js.map +1 -0
- package/dist/components/DatePicker/index.d.ts +24 -0
- package/dist/components/DismissableLayer/DismissableLayer.d.ts +67 -0
- package/dist/components/DismissableLayer/DismissableLayer.vue.js +118 -0
- package/dist/components/DismissableLayer/DismissableLayer.vue.js.map +1 -0
- package/dist/components/DismissableLayer/DismissableLayer.vue2.js +7 -0
- package/dist/components/DismissableLayer/DismissableLayer.vue2.js.map +1 -0
- package/dist/components/DismissableLayer/DismissableLayerBranch.d.ts +11 -0
- package/dist/components/DismissableLayer/index.d.ts +3 -0
- package/dist/components/DismissableLayer/utils.d.ts +28 -0
- package/dist/components/DismissableLayer/utils.js +112 -0
- package/dist/components/DismissableLayer/utils.js.map +1 -0
- package/dist/components/FocusScope/FocusScope.d.ts +82 -0
- package/dist/components/FocusScope/FocusScope.test.d.ts +1 -0
- package/dist/components/FocusScope/FocusScope.vue.js +149 -0
- package/dist/components/FocusScope/FocusScope.vue.js.map +1 -0
- package/dist/components/FocusScope/FocusScope.vue2.js +5 -0
- package/dist/components/FocusScope/FocusScope.vue2.js.map +1 -0
- package/dist/components/FocusScope/index.d.ts +1 -0
- package/dist/components/FocusScope/stack.d.ts +12 -0
- package/dist/components/FocusScope/stack.js +38 -0
- package/dist/components/FocusScope/stack.js.map +1 -0
- package/dist/components/FocusScope/utils.d.ts +46 -0
- package/dist/components/FocusScope/utils.js +70 -0
- package/dist/components/FocusScope/utils.js.map +1 -0
- package/dist/components/Popover/PopoverAnchor.d.ts +11 -0
- package/dist/components/Popover/PopoverAnchor.vue.js +37 -0
- package/dist/components/Popover/PopoverAnchor.vue.js.map +1 -0
- package/dist/components/Popover/PopoverAnchor.vue2.js +5 -0
- package/dist/components/Popover/PopoverAnchor.vue2.js.map +1 -0
- package/dist/components/Popover/PopoverArrow.d.ts +15 -0
- package/dist/components/Popover/PopoverArrow.vue.js +31 -0
- package/dist/components/Popover/PopoverArrow.vue.js.map +1 -0
- package/dist/components/Popover/PopoverArrow.vue2.js +5 -0
- package/dist/components/Popover/PopoverArrow.vue2.js.map +1 -0
- package/dist/components/Popover/PopoverClose.d.ts +13 -0
- package/dist/components/Popover/PopoverClose.vue.js +34 -0
- package/dist/components/Popover/PopoverClose.vue.js.map +1 -0
- package/dist/components/Popover/PopoverClose.vue2.js +5 -0
- package/dist/components/Popover/PopoverClose.vue2.js.map +1 -0
- package/dist/components/Popover/PopoverContent.d.ts +32 -0
- package/dist/components/Popover/PopoverContent.vue.js +61 -0
- package/dist/components/Popover/PopoverContent.vue.js.map +1 -0
- package/dist/components/Popover/PopoverContent.vue2.js +5 -0
- package/dist/components/Popover/PopoverContent.vue2.js.map +1 -0
- package/dist/components/Popover/PopoverContentImpl.d.ts +47 -0
- package/dist/components/Popover/PopoverContentImpl.vue.js +97 -0
- package/dist/components/Popover/PopoverContentImpl.vue.js.map +1 -0
- package/dist/components/Popover/PopoverContentImpl.vue2.js +5 -0
- package/dist/components/Popover/PopoverContentImpl.vue2.js.map +1 -0
- package/dist/components/Popover/PopoverContentNonModal.d.ts +32 -0
- package/dist/components/Popover/PopoverContentNonModal.vue.js +78 -0
- package/dist/components/Popover/PopoverContentNonModal.vue.js.map +1 -0
- package/dist/components/Popover/PopoverContentNonModal.vue2.js +5 -0
- package/dist/components/Popover/PopoverContentNonModal.vue2.js.map +1 -0
- package/dist/components/Popover/PopoverPortal.d.ts +11 -0
- package/dist/components/Popover/PopoverPortal.vue.js +26 -0
- package/dist/components/Popover/PopoverPortal.vue.js.map +1 -0
- package/dist/components/Popover/PopoverPortal.vue2.js +5 -0
- package/dist/components/Popover/PopoverPortal.vue2.js.map +1 -0
- package/dist/components/Popover/PopoverRoot.d.ts +55 -0
- package/dist/components/Popover/PopoverRoot.vue.js +55 -0
- package/dist/components/Popover/PopoverRoot.vue.js.map +1 -0
- package/dist/components/Popover/PopoverRoot.vue2.js +8 -0
- package/dist/components/Popover/PopoverRoot.vue2.js.map +1 -0
- package/dist/components/Popover/PopoverTrigger.d.ts +13 -0
- package/dist/components/Popover/PopoverTrigger.vue.js +51 -0
- package/dist/components/Popover/PopoverTrigger.vue.js.map +1 -0
- package/dist/components/Popover/PopoverTrigger.vue2.js +5 -0
- package/dist/components/Popover/PopoverTrigger.vue2.js.map +1 -0
- package/dist/components/Popover/index.d.ts +7 -0
- package/dist/components/Popper/PopperAnchor.d.ts +19 -0
- package/dist/components/Popper/PopperAnchor.vue.js +37 -0
- package/dist/components/Popper/PopperAnchor.vue.js.map +1 -0
- package/dist/components/Popper/PopperAnchor.vue2.js +5 -0
- package/dist/components/Popper/PopperAnchor.vue2.js.map +1 -0
- package/dist/components/Popper/PopperArrow.d.ts +15 -0
- package/dist/components/Popper/PopperArrow.vue.js +76 -0
- package/dist/components/Popper/PopperArrow.vue.js.map +1 -0
- package/dist/components/Popper/PopperArrow.vue2.js +5 -0
- package/dist/components/Popper/PopperArrow.vue2.js.map +1 -0
- package/dist/components/Popper/PopperContent.d.ts +179 -0
- package/dist/components/Popper/PopperContent.vue.js +9 -0
- package/dist/components/Popper/PopperContent.vue.js.map +1 -0
- package/dist/components/Popper/PopperContent.vue2.js +230 -0
- package/dist/components/Popper/PopperContent.vue2.js.map +1 -0
- package/dist/components/Popper/PopperRoot.d.ts +19 -0
- package/dist/components/Popper/PopperRoot.vue.js +25 -0
- package/dist/components/Popper/PopperRoot.vue.js.map +1 -0
- package/dist/components/Popper/PopperRoot.vue2.js +8 -0
- package/dist/components/Popper/PopperRoot.vue2.js.map +1 -0
- package/dist/components/Popper/index.d.ts +5 -0
- package/dist/components/Popper/utils.d.ts +12 -0
- package/dist/components/Popper/utils.js +46 -0
- package/dist/components/Popper/utils.js.map +1 -0
- package/dist/components/Presence/Presence.d.ts +43 -0
- package/dist/components/Presence/Presence.js +61 -0
- package/dist/components/Presence/Presence.js.map +1 -0
- package/dist/components/Presence/index.d.ts +1 -0
- package/dist/components/Presence/usePresence.d.ts +4 -0
- package/dist/components/Presence/usePresence.js +131 -0
- package/dist/components/Presence/usePresence.js.map +1 -0
- package/dist/components/Primitive/Primitive.d.ts +39 -0
- package/dist/components/Primitive/Primitive.js +29 -0
- package/dist/components/Primitive/Primitive.js.map +1 -0
- package/dist/components/Primitive/Slot.d.ts +5 -0
- package/dist/components/Primitive/Slot.js +30 -0
- package/dist/components/Primitive/Slot.js.map +1 -0
- package/dist/components/Primitive/index.d.ts +3 -0
- package/dist/components/Primitive/usePrimitiveElement.d.ts +5 -0
- package/dist/components/Primitive/usePrimitiveElement.js +14 -0
- package/dist/components/Primitive/usePrimitiveElement.js.map +1 -0
- package/dist/components/Teleport/Teleport.d.ts +37 -0
- package/dist/components/Teleport/Teleport.vue.js +28 -0
- package/dist/components/Teleport/Teleport.vue.js.map +1 -0
- package/dist/components/Teleport/Teleport.vue2.js +5 -0
- package/dist/components/Teleport/Teleport.vue2.js.map +1 -0
- package/dist/components/Teleport/index.d.ts +1 -0
- package/dist/components/VisuallyHidden/VisuallyHidden.d.ts +16 -0
- package/dist/components/VisuallyHidden/VisuallyHidden.vue.js +49 -0
- package/dist/components/VisuallyHidden/VisuallyHidden.vue.js.map +1 -0
- package/dist/components/VisuallyHidden/VisuallyHidden.vue2.js +5 -0
- package/dist/components/VisuallyHidden/VisuallyHidden.vue2.js.map +1 -0
- package/dist/components/VisuallyHidden/VisuallyHiddenInput.d.ts +14 -0
- package/dist/components/VisuallyHidden/VisuallyHiddenInputBubble.d.ts +22 -0
- package/dist/components/VisuallyHidden/index.d.ts +2 -0
- package/dist/date/calendar.d.ts +59 -0
- package/dist/date/calendar.js +90 -0
- package/dist/date/calendar.js.map +1 -0
- package/dist/date/comparators.d.ts +80 -0
- package/dist/date/comparators.js +61 -0
- package/dist/date/comparators.js.map +1 -0
- package/dist/date/index.d.ts +3 -0
- package/dist/date/types.d.ts +28 -0
- package/dist/date/utils.d.ts +12 -0
- package/dist/date/utils.js +10 -0
- package/dist/date/utils.js.map +1 -0
- package/dist/index.cjs +9097 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +27 -0
- package/dist/index.js +54 -0
- package/dist/index.js.map +1 -0
- package/dist/node_modules/.pnpm/@floating-ui_core@1.7.3/node_modules/@floating-ui/core/dist/floating-ui.core.js +722 -0
- package/dist/node_modules/.pnpm/@floating-ui_core@1.7.3/node_modules/@floating-ui/core/dist/floating-ui.core.js.map +1 -0
- package/dist/node_modules/.pnpm/@floating-ui_dom@1.7.4/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +626 -0
- package/dist/node_modules/.pnpm/@floating-ui_dom@1.7.4/node_modules/@floating-ui/dom/dist/floating-ui.dom.js.map +1 -0
- package/dist/node_modules/.pnpm/@floating-ui_utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +174 -0
- package/dist/node_modules/.pnpm/@floating-ui_utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js.map +1 -0
- package/dist/node_modules/.pnpm/@floating-ui_utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +155 -0
- package/dist/node_modules/.pnpm/@floating-ui_utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.js.map +1 -0
- package/dist/node_modules/.pnpm/@floating-ui_vue@1.1.9_vue@3.5.26_typescript@5.9.3_/node_modules/@floating-ui/vue/dist/floating-ui.vue.js +180 -0
- package/dist/node_modules/.pnpm/@floating-ui_vue@1.1.9_vue@3.5.26_typescript@5.9.3_/node_modules/@floating-ui/vue/dist/floating-ui.vue.js.map +1 -0
- package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/BuddhistCalendar.js +34 -0
- package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/BuddhistCalendar.js.map +1 -0
- package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/CalendarDate.js +213 -0
- package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/CalendarDate.js.map +1 -0
- package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/DateFormatter.js +116 -0
- package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/DateFormatter.js.map +1 -0
- package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/EthiopicCalendar.js +129 -0
- package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/EthiopicCalendar.js.map +1 -0
- package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/GregorianCalendar.js +123 -0
- package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/GregorianCalendar.js.map +1 -0
- package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/HebrewCalendar.js +114 -0
- package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/HebrewCalendar.js.map +1 -0
- package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/IndianCalendar.js +77 -0
- package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/IndianCalendar.js.map +1 -0
- package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/IslamicCalendar.js +141 -0
- package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/IslamicCalendar.js.map +1 -0
- package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/JapaneseCalendar.js +155 -0
- package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/JapaneseCalendar.js.map +1 -0
- package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/PersianCalendar.js +59 -0
- package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/PersianCalendar.js.map +1 -0
- package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/TaiwanCalendar.js +59 -0
- package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/TaiwanCalendar.js.map +1 -0
- package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/conversion.js +170 -0
- package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/conversion.js.map +1 -0
- package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/createCalendar.js +44 -0
- package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/createCalendar.js.map +1 -0
- package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/manipulation.js +301 -0
- package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/manipulation.js.map +1 -0
- package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/queries.js +141 -0
- package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/queries.js.map +1 -0
- package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/string.js +35 -0
- package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/string.js.map +1 -0
- package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/utils.js +7 -0
- package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/utils.js.map +1 -0
- package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/weekStartData.js +101 -0
- package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/weekStartData.js.map +1 -0
- package/dist/node_modules/.pnpm/@swc_helpers@0.5.18/node_modules/@swc/helpers/esm/_check_private_redeclaration.js +9 -0
- package/dist/node_modules/.pnpm/@swc_helpers@0.5.18/node_modules/@swc/helpers/esm/_check_private_redeclaration.js.map +1 -0
- package/dist/node_modules/.pnpm/@swc_helpers@0.5.18/node_modules/@swc/helpers/esm/_class_private_field_init.js +9 -0
- package/dist/node_modules/.pnpm/@swc_helpers@0.5.18/node_modules/@swc/helpers/esm/_class_private_field_init.js.map +1 -0
- package/dist/node_modules/.pnpm/@vueuse_core@14.1.0_vue@3.5.26_typescript@5.9.3_/node_modules/@vueuse/core/dist/index.js +140 -0
- package/dist/node_modules/.pnpm/@vueuse_core@14.1.0_vue@3.5.26_typescript@5.9.3_/node_modules/@vueuse/core/dist/index.js.map +1 -0
- package/dist/node_modules/.pnpm/@vueuse_shared@14.1.0_vue@3.5.26_typescript@5.9.3_/node_modules/@vueuse/shared/dist/index.js +88 -0
- package/dist/node_modules/.pnpm/@vueuse_shared@14.1.0_vue@3.5.26_typescript@5.9.3_/node_modules/@vueuse/shared/dist/index.js.map +1 -0
- package/dist/node_modules/.pnpm/defu@6.1.4/node_modules/defu/dist/defu.js +60 -0
- package/dist/node_modules/.pnpm/defu@6.1.4/node_modules/defu/dist/defu.js.map +1 -0
- package/dist/shared/arrays.d.ts +37 -0
- package/dist/shared/component/Arrow.d.ts +34 -0
- package/dist/shared/component/Arrow.vue.js +45 -0
- package/dist/shared/component/Arrow.vue.js.map +1 -0
- package/dist/shared/component/Arrow.vue2.js +5 -0
- package/dist/shared/component/Arrow.vue2.js.map +1 -0
- package/dist/shared/component/BaseSeparator.d.ts +26 -0
- package/dist/shared/component/index.d.ts +2 -0
- package/dist/shared/constant/countryList.d.ts +1 -0
- package/dist/shared/constant/index.d.ts +1 -0
- package/dist/shared/createContext.d.ts +8 -0
- package/dist/shared/createContext.js +26 -0
- package/dist/shared/createContext.js.map +1 -0
- package/dist/shared/date/comparators.d.ts +27 -0
- package/dist/shared/date/comparators.js +27 -0
- package/dist/shared/date/comparators.js.map +1 -0
- package/dist/shared/date/index.d.ts +8 -0
- package/dist/shared/date/parser.d.ts +37 -0
- package/dist/shared/date/parser.js +161 -0
- package/dist/shared/date/parser.js.map +1 -0
- package/dist/shared/date/parts.d.ts +12 -0
- package/dist/shared/date/parts.js +17 -0
- package/dist/shared/date/parts.js.map +1 -0
- package/dist/shared/date/placeholders.d.ts +8 -0
- package/dist/shared/date/placeholders.js +196 -0
- package/dist/shared/date/placeholders.js.map +1 -0
- package/dist/shared/date/segment.d.ts +5 -0
- package/dist/shared/date/segment.js +44 -0
- package/dist/shared/date/segment.js.map +1 -0
- package/dist/shared/date/types.d.ts +37 -0
- package/dist/shared/date/useDateField.d.ts +142 -0
- package/dist/shared/date/useDateField.js +618 -0
- package/dist/shared/date/useDateField.js.map +1 -0
- package/dist/shared/date/utils.d.ts +11 -0
- package/dist/shared/date/utils.js +76 -0
- package/dist/shared/date/utils.js.map +1 -0
- package/dist/shared/getActiveElement.d.ts +1 -0
- package/dist/shared/getActiveElement.js +14 -0
- package/dist/shared/getActiveElement.js.map +1 -0
- package/dist/shared/handleAndDispatchCustomEvent.d.ts +3 -0
- package/dist/shared/handleAndDispatchCustomEvent.js +15 -0
- package/dist/shared/handleAndDispatchCustomEvent.js.map +1 -0
- package/dist/shared/index.d.ts +22 -0
- package/dist/shared/nullish.d.ts +1 -0
- package/dist/shared/nullish.js +7 -0
- package/dist/shared/nullish.js.map +1 -0
- package/dist/shared/onFocusOutside.d.ts +2 -0
- package/dist/shared/renderSlotFragments.d.ts +2 -0
- package/dist/shared/renderSlotFragments.js +14 -0
- package/dist/shared/renderSlotFragments.js.map +1 -0
- package/dist/shared/trap-focus.d.ts +1 -0
- package/dist/shared/types.d.ts +48 -0
- package/dist/shared/useDateFormatter.d.ts +30 -0
- package/dist/shared/useDateFormatter.js +121 -0
- package/dist/shared/useDateFormatter.js.map +1 -0
- package/dist/shared/useDirection.d.ts +8 -0
- package/dist/shared/useDirection.js +12 -0
- package/dist/shared/useDirection.js.map +1 -0
- package/dist/shared/useEmitAsProps.d.ts +10 -0
- package/dist/shared/useEmitAsProps.js +19 -0
- package/dist/shared/useEmitAsProps.js.map +1 -0
- package/dist/shared/useFocusGuards.d.ts +5 -0
- package/dist/shared/useFocusGuards.js +39 -0
- package/dist/shared/useFocusGuards.js.map +1 -0
- package/dist/shared/useForwardExpose.d.ts +6 -0
- package/dist/shared/useForwardExpose.js +49 -0
- package/dist/shared/useForwardExpose.js.map +1 -0
- package/dist/shared/useForwardProps.d.ts +9 -0
- package/dist/shared/useForwardProps.js +27 -0
- package/dist/shared/useForwardProps.js.map +1 -0
- package/dist/shared/useForwardPropsEmits.d.ts +14 -0
- package/dist/shared/useForwardPropsEmits.js +15 -0
- package/dist/shared/useForwardPropsEmits.js.map +1 -0
- package/dist/shared/useId.d.ts +9 -0
- package/dist/shared/useId.js +19 -0
- package/dist/shared/useId.js.map +1 -0
- package/dist/shared/useIsUsingKeyboard.d.ts +3 -0
- package/dist/shared/useKbd.d.ts +78 -0
- package/dist/shared/useKbd.js +42 -0
- package/dist/shared/useKbd.js.map +1 -0
- package/dist/shared/useLocale.d.ts +7 -0
- package/dist/shared/useLocale.js +12 -0
- package/dist/shared/useLocale.js.map +1 -0
- package/dist/shared/useNonce.d.ts +2 -0
- package/dist/shared/useSize.d.ts +5 -0
- package/dist/shared/useSize.js +44 -0
- package/dist/shared/useSize.js.map +1 -0
- package/dist/shared/useStateMachine.d.ts +25 -0
- package/dist/shared/useStateMachine.js +19 -0
- package/dist/shared/useStateMachine.js.map +1 -0
- package/dist/shared/withDefault.d.ts +22 -0
- package/package.json +72 -0
- package/src/components/Calendar/CalendarCell.vue +39 -0
- package/src/components/Calendar/CalendarCellTrigger.vue +206 -0
- package/src/components/Calendar/CalendarGrid.vue +35 -0
- package/src/components/Calendar/CalendarGridBody.vue +19 -0
- package/src/components/Calendar/CalendarGridHead.vue +19 -0
- package/src/components/Calendar/CalendarGridRow.vue +17 -0
- package/src/components/Calendar/CalendarHeadCell.vue +17 -0
- package/src/components/Calendar/CalendarHeader.vue +17 -0
- package/src/components/Calendar/CalendarHeading.vue +32 -0
- package/src/components/Calendar/CalendarMonthHeading.vue +65 -0
- package/src/components/Calendar/CalendarMonthYearOverlay.vue +48 -0
- package/src/components/Calendar/CalendarNext.vue +51 -0
- package/src/components/Calendar/CalendarOverlayItem.vue +30 -0
- package/src/components/Calendar/CalendarPrev.vue +51 -0
- package/src/components/Calendar/CalendarRoot.vue +394 -0
- package/src/components/Calendar/CalendarYearHeading.vue +63 -0
- package/src/components/Calendar/index.ts +63 -0
- package/src/components/Calendar/useCalendar.ts +453 -0
- package/src/components/ConfigProvider/ConfigProvider.vue +73 -0
- package/src/components/ConfigProvider/index.ts +5 -0
- package/src/components/DateField/DateFieldInput.vue +72 -0
- package/src/components/DateField/DateFieldRoot.vue +359 -0
- package/src/components/DateField/index.ts +10 -0
- package/src/components/DatePicker/DatePickerAnchor.vue +16 -0
- package/src/components/DatePicker/DatePickerArrow.vue +16 -0
- package/src/components/DatePicker/DatePickerCalendar.vue +62 -0
- package/src/components/DatePicker/DatePickerCell.vue +16 -0
- package/src/components/DatePicker/DatePickerCellTrigger.vue +18 -0
- package/src/components/DatePicker/DatePickerClose.vue +16 -0
- package/src/components/DatePicker/DatePickerContent.vue +50 -0
- package/src/components/DatePicker/DatePickerField.vue +53 -0
- package/src/components/DatePicker/DatePickerGrid.vue +16 -0
- package/src/components/DatePicker/DatePickerGridBody.vue +16 -0
- package/src/components/DatePicker/DatePickerGridHead.vue +16 -0
- package/src/components/DatePicker/DatePickerGridRow.vue +16 -0
- package/src/components/DatePicker/DatePickerHeadCell.vue +16 -0
- package/src/components/DatePicker/DatePickerHeader.vue +16 -0
- package/src/components/DatePicker/DatePickerHeading.vue +24 -0
- package/src/components/DatePicker/DatePickerInput.vue +16 -0
- package/src/components/DatePicker/DatePickerMonthHeading.vue +19 -0
- package/src/components/DatePicker/DatePickerMonthYearOverlay.vue +13 -0
- package/src/components/DatePicker/DatePickerNext.vue +19 -0
- package/src/components/DatePicker/DatePickerOverlayItem.vue +16 -0
- package/src/components/DatePicker/DatePickerPrev.vue +18 -0
- package/src/components/DatePicker/DatePickerRoot.vue +216 -0
- package/src/components/DatePicker/DatePickerTrigger.vue +29 -0
- package/src/components/DatePicker/DatePickerYearHeading.vue +19 -0
- package/src/components/DatePicker/index.ts +92 -0
- package/src/components/DismissableLayer/DismissableLayer.vue +175 -0
- package/src/components/DismissableLayer/DismissableLayerBranch.vue +28 -0
- package/src/components/DismissableLayer/index.ts +7 -0
- package/src/components/DismissableLayer/utils.ts +194 -0
- package/src/components/FocusScope/FocusScope.vue +220 -0
- package/src/components/FocusScope/index.ts +5 -0
- package/src/components/FocusScope/stack.ts +49 -0
- package/src/components/FocusScope/utils.ts +108 -0
- package/src/components/Popover/PopoverAnchor.vue +30 -0
- package/src/components/Popover/PopoverArrow.vue +23 -0
- package/src/components/Popover/PopoverClose.vue +29 -0
- package/src/components/Popover/PopoverContent.vue +41 -0
- package/src/components/Popover/PopoverContentImpl.vue +97 -0
- package/src/components/Popover/PopoverContentNonModal.vue +74 -0
- package/src/components/Popover/PopoverPortal.vue +17 -0
- package/src/components/Popover/PopoverRoot.vue +83 -0
- package/src/components/Popover/PopoverTrigger.vue +48 -0
- package/src/components/Popover/index.ts +31 -0
- package/src/components/Popper/PopperAnchor.vue +36 -0
- package/src/components/Popper/PopperArrow.vue +81 -0
- package/src/components/Popper/PopperContent.vue +399 -0
- package/src/components/Popper/PopperRoot.vue +36 -0
- package/src/components/Popper/index.ts +15 -0
- package/src/components/Popper/utils.ts +63 -0
- package/src/components/Presence/Presence.ts +91 -0
- package/src/components/Presence/index.ts +1 -0
- package/src/components/Presence/usePresence.ts +175 -0
- package/src/components/Primitive/Primitive.ts +66 -0
- package/src/components/Primitive/Slot.ts +40 -0
- package/src/components/Primitive/index.ts +3 -0
- package/src/components/Primitive/usePrimitiveElement.ts +13 -0
- package/src/components/Teleport/Teleport.vue +49 -0
- package/src/components/Teleport/index.ts +1 -0
- package/src/components/VisuallyHidden/VisuallyHidden.vue +47 -0
- package/src/components/VisuallyHidden/VisuallyHiddenInput.vue +67 -0
- package/src/components/VisuallyHidden/VisuallyHiddenInputBubble.vue +56 -0
- package/src/components/VisuallyHidden/index.ts +2 -0
- package/src/date/calendar.ts +242 -0
- package/src/date/comparators.ts +199 -0
- package/src/date/index.ts +3 -0
- package/src/date/types.ts +37 -0
- package/src/date/utils.ts +18 -0
- package/src/index.ts +78 -0
- package/src/shared/arrays.ts +66 -0
- package/src/shared/component/Arrow.vue +55 -0
- package/src/shared/component/BaseSeparator.vue +57 -0
- package/src/shared/component/index.ts +2 -0
- package/src/shared/constant/countryList.ts +251 -0
- package/src/shared/constant/index.ts +1 -0
- package/src/shared/createContext.ts +57 -0
- package/src/shared/date/comparators.ts +74 -0
- package/src/shared/date/index.ts +42 -0
- package/src/shared/date/parser.ts +252 -0
- package/src/shared/date/parts.ts +32 -0
- package/src/shared/date/placeholders.ts +221 -0
- package/src/shared/date/segment.ts +50 -0
- package/src/shared/date/types.ts +50 -0
- package/src/shared/date/useDateField.ts +998 -0
- package/src/shared/date/utils.ts +84 -0
- package/src/shared/getActiveElement.ts +12 -0
- package/src/shared/handleAndDispatchCustomEvent.ts +21 -0
- package/src/shared/index.ts +27 -0
- package/src/shared/nullish.ts +3 -0
- package/src/shared/onFocusOutside.ts +29 -0
- package/src/shared/renderSlotFragments.ts +13 -0
- package/src/shared/trap-focus.ts +45 -0
- package/src/shared/types.ts +64 -0
- package/src/shared/useDateFormatter.ts +186 -0
- package/src/shared/useDirection.ts +16 -0
- package/src/shared/useEmitAsProps.ts +32 -0
- package/src/shared/useFocusGuards.ts +46 -0
- package/src/shared/useForwardExpose.ts +66 -0
- package/src/shared/useForwardProps.ts +43 -0
- package/src/shared/useForwardPropsEmits.ts +26 -0
- package/src/shared/useId.ts +34 -0
- package/src/shared/useIsUsingKeyboard.ts +22 -0
- package/src/shared/useKbd.ts +58 -0
- package/src/shared/useLocale.ts +15 -0
- package/src/shared/useNonce.ts +10 -0
- package/src/shared/useSize.ts +64 -0
- package/src/shared/useStateMachine.ts +48 -0
- package/src/shared/withDefault.ts +61 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDateField.js","sources":["../../../src/shared/date/useDateField.ts"],"sourcesContent":["import type {\n CalendarDateTime,\n CycleTimeOptions,\n DateFields,\n DateValue,\n TimeFields,\n} from \"@internationalized/date\";\nimport type { Ref } from \"vue\";\nimport type {\n AnyExceptLiteral,\n DateStep,\n HourCycle,\n SegmentPart,\n SegmentValueObj,\n} from \"./types\";\nimport type { Formatter } from \"..\";\nimport { computed } from \"vue\";\nimport { getDaysInMonth, toDate } from \"../../date\";\nimport { useKbd } from \"../useKbd\";\nimport {\n isAcceptableSegmentKey,\n isNumberString,\n isSegmentNavigationKey,\n} from \"./segment\";\n\ntype MinuteSecondIncrementProps = {\n e: KeyboardEvent;\n part: keyof TimeFields;\n dateRef: DateValue;\n prevValue: number | null;\n};\n\ntype DateTimeValueIncrementation = {\n e: KeyboardEvent;\n part: keyof Omit<DateFields, \"era\"> | keyof TimeFields;\n dateRef: DateValue;\n prevValue: number | null;\n hourCycle?: HourCycle;\n};\n\ntype SegmentAttrProps = {\n disabled: boolean;\n segmentValues: SegmentValueObj;\n hourCycle: HourCycle;\n placeholder: DateValue;\n formatter: Formatter;\n};\n\nfunction commonSegmentAttrs(props: SegmentAttrProps) {\n return {\n role: \"spinbutton\",\n contenteditable: true,\n tabindex: props.disabled ? undefined : 0,\n spellcheck: false,\n inputmode: \"numeric\",\n autocorrect: \"off\",\n enterkeyhint: \"next\",\n style: \"caret-color: transparent;\",\n };\n}\n\nfunction daySegmentAttrs(props: SegmentAttrProps) {\n const { segmentValues, placeholder } = props;\n const isEmpty = segmentValues.day === null;\n const date = segmentValues.day\n ? placeholder.set({ day: segmentValues.day })\n : placeholder;\n\n const valueNow = date.day;\n const valueMin = 1;\n const valueMax = getDaysInMonth(date);\n const valueText = isEmpty ? \"Empty\" : `${valueNow}`;\n\n return {\n ...commonSegmentAttrs(props),\n \"aria-label\": \"day,\",\n \"aria-valuemin\": valueMin,\n \"aria-valuemax\": valueMax,\n \"aria-valuenow\": valueNow,\n \"aria-valuetext\": valueText,\n \"data-placeholder\": isEmpty ? \"\" : undefined,\n };\n}\n\nfunction monthSegmentAttrs(props: SegmentAttrProps) {\n const { segmentValues, placeholder, formatter } = props;\n const isEmpty = segmentValues.month === null;\n const date = segmentValues.month\n ? placeholder.set({ month: segmentValues.month })\n : placeholder;\n const valueNow = date.month;\n const valueMin = 1;\n const valueMax = 12;\n const valueText = isEmpty\n ? \"Empty\"\n : `${valueNow} - ${formatter.fullMonth(toDate(date))}`;\n\n return {\n ...commonSegmentAttrs(props),\n \"aria-label\": \"month, \",\n contenteditable: true,\n \"aria-valuemin\": valueMin,\n \"aria-valuemax\": valueMax,\n \"aria-valuenow\": valueNow,\n \"aria-valuetext\": valueText,\n \"data-placeholder\": isEmpty ? \"\" : undefined,\n };\n}\n\nfunction yearSegmentAttrs(props: SegmentAttrProps) {\n const { segmentValues, placeholder } = props;\n const isEmpty = segmentValues.year === null;\n const date = segmentValues.year\n ? placeholder.set({ year: segmentValues.year })\n : placeholder;\n const valueMin = 1;\n const valueMax = 9999;\n const valueNow = date.year;\n const valueText = isEmpty ? \"Empty\" : `${valueNow}`;\n\n return {\n ...commonSegmentAttrs(props),\n \"aria-label\": \"year, \",\n \"aria-valuemin\": valueMin,\n \"aria-valuemax\": valueMax,\n \"aria-valuenow\": valueNow,\n \"aria-valuetext\": valueText,\n \"data-placeholder\": isEmpty ? \"\" : undefined,\n };\n}\n\nfunction hourSegmentAttrs(props: SegmentAttrProps) {\n const { segmentValues, hourCycle, placeholder } = props;\n\n if (!(\"hour\" in segmentValues) || !(\"hour\" in placeholder)) return {};\n const isEmpty = segmentValues.hour === null;\n const date = segmentValues.hour\n ? placeholder.set({ hour: segmentValues.hour })\n : placeholder;\n const valueMin = hourCycle === 12 ? 1 : 0;\n const valueMax = hourCycle === 12 ? 12 : 23;\n const valueNow = date.hour;\n const valueText = isEmpty\n ? \"Empty\"\n : `${valueNow} ${segmentValues.dayPeriod ?? \"\"}`;\n\n return {\n ...commonSegmentAttrs(props),\n \"aria-label\": \"hour, \",\n \"aria-valuemin\": valueMin,\n \"aria-valuemax\": valueMax,\n \"aria-valuenow\": valueNow,\n \"aria-valuetext\": valueText,\n \"data-placeholder\": isEmpty ? \"\" : undefined,\n };\n}\n\nfunction minuteSegmentAttrs(props: SegmentAttrProps) {\n const { segmentValues, placeholder } = props;\n if (!(\"minute\" in segmentValues) || !(\"minute\" in placeholder)) return {};\n const isEmpty = segmentValues.minute === null;\n const date = segmentValues.minute\n ? placeholder.set({ minute: segmentValues.minute })\n : placeholder;\n const valueNow = date.minute;\n const valueMin = 0;\n const valueMax = 59;\n const valueText = isEmpty ? \"Empty\" : `${valueNow}`;\n\n return {\n ...commonSegmentAttrs(props),\n \"aria-label\": \"minute, \",\n \"aria-valuemin\": valueMin,\n \"aria-valuemax\": valueMax,\n \"aria-valuenow\": valueNow,\n \"aria-valuetext\": valueText,\n \"data-placeholder\": isEmpty ? \"\" : undefined,\n };\n}\n\nfunction secondSegmentAttrs(props: SegmentAttrProps) {\n const { segmentValues, placeholder } = props;\n if (!(\"second\" in segmentValues) || !(\"second\" in placeholder)) return {};\n const isEmpty = segmentValues.second === null;\n const date = segmentValues.second\n ? placeholder.set({ second: segmentValues.second })\n : placeholder;\n const valueNow = date.second;\n const valueMin = 0;\n const valueMax = 59;\n const valueText = isEmpty ? \"Empty\" : `${valueNow}`;\n\n return {\n ...commonSegmentAttrs(props),\n \"aria-label\": \"second, \",\n \"aria-valuemin\": valueMin,\n \"aria-valuemax\": valueMax,\n \"aria-valuenow\": valueNow,\n \"aria-valuetext\": valueText,\n \"data-placeholder\": isEmpty ? \"\" : undefined,\n };\n}\n\nfunction dayPeriodSegmentAttrs(props: SegmentAttrProps) {\n const { segmentValues } = props;\n if (!(\"dayPeriod\" in segmentValues)) return {};\n\n const valueMin = 0;\n const valueMax = 12;\n const valueNow = segmentValues.hour\n ? segmentValues.hour > 12\n ? segmentValues.hour - 12\n : segmentValues.hour\n : 0;\n const valueText = segmentValues.dayPeriod ?? \"AM\";\n\n return {\n ...commonSegmentAttrs(props),\n inputmode: \"text\",\n \"aria-label\": \"AM/PM\",\n \"aria-valuemin\": valueMin,\n \"aria-valuemax\": valueMax,\n \"aria-valuenow\": valueNow,\n \"aria-valuetext\": valueText,\n };\n}\n\nfunction literalSegmentAttrs(_props: SegmentAttrProps) {\n return {\n \"aria-hidden\": true,\n \"data-segment\": \"literal\",\n };\n}\n\nfunction timeZoneSegmentAttrs(props: SegmentAttrProps) {\n return {\n role: \"textbox\",\n \"aria-label\": \"timezone, \",\n \"data-readonly\": true,\n \"data-segment\": \"timeZoneName\",\n tabindex: props.disabled ? undefined : 0,\n style: \"caret-color: transparent;\",\n };\n}\n\nfunction eraSegmentAttrs(props: SegmentAttrProps) {\n const { segmentValues, placeholder } = props;\n\n const valueMin = 0;\n const valueMax = 0;\n const valueNow = 0;\n const valueText =\n \"era\" in segmentValues ? segmentValues.era : placeholder.era;\n\n return {\n ...commonSegmentAttrs(props),\n \"aria-label\": \"era\",\n \"aria-valuemin\": valueMin,\n \"aria-valuemax\": valueMax,\n \"aria-valuenow\": valueNow,\n \"aria-valuetext\": valueText,\n };\n}\n\nexport const segmentBuilders = {\n day: {\n attrs: daySegmentAttrs,\n },\n month: {\n attrs: monthSegmentAttrs,\n },\n year: {\n attrs: yearSegmentAttrs,\n },\n hour: {\n attrs: hourSegmentAttrs,\n },\n minute: {\n attrs: minuteSegmentAttrs,\n },\n second: {\n attrs: secondSegmentAttrs,\n },\n dayPeriod: {\n attrs: dayPeriodSegmentAttrs,\n },\n literal: {\n attrs: literalSegmentAttrs,\n },\n timeZoneName: {\n attrs: timeZoneSegmentAttrs,\n },\n era: {\n attrs: eraSegmentAttrs,\n },\n};\n\nexport type UseDateFieldProps = {\n hasLeftFocus: Ref<boolean>;\n lastKeyZero: Ref<boolean>;\n placeholder: Ref<DateValue>;\n hourCycle: HourCycle;\n step: Ref<DateStep>;\n formatter: Formatter;\n segmentValues: Ref<SegmentValueObj>;\n disabled: Ref<boolean>;\n readonly: Ref<boolean>;\n part: SegmentPart;\n modelValue: Ref<DateValue | undefined>;\n focusNext: () => void;\n};\n\nexport function useDateField(props: UseDateFieldProps) {\n const kbd = useKbd();\n\n function minuteSecondIncrementation({\n e,\n part,\n dateRef,\n prevValue,\n }: MinuteSecondIncrementProps): number {\n const step = props.step.value[part] ?? 1;\n const sign = e.key === kbd.ARROW_UP ? step : -step;\n const min = 0;\n const max = 59;\n\n if (prevValue === null) return sign > 0 ? min : max;\n\n const cycleArgs: [keyof TimeFields, number] = [part, sign];\n return (dateRef as CalendarDateTime)\n .set({ [part]: prevValue })\n .cycle(...cycleArgs)[part];\n }\n\n function deleteValue(prevValue: number | null) {\n props.hasLeftFocus.value = false;\n if (prevValue === null) return prevValue;\n\n const str = prevValue.toString();\n if (str.length === 1) {\n props.modelValue.value = undefined;\n return null;\n }\n\n return Number.parseInt(str.slice(0, -1));\n }\n function dateTimeValueIncrementation({\n e,\n part,\n dateRef,\n prevValue,\n hourCycle,\n }: DateTimeValueIncrementation): number {\n const step = props.step.value[part] ?? 1;\n const sign = e.key === kbd.ARROW_UP ? step : -step;\n\n if (prevValue === null)\n return dateRef[part as keyof Omit<DateFields, \"era\">];\n\n if (part === \"hour\" && \"hour\" in dateRef) {\n const cycleArgs: [\n keyof DateFields | keyof TimeFields,\n number,\n CycleTimeOptions?,\n ] = [part, sign, { hourCycle }];\n return dateRef\n .set({ [part as keyof DateValue]: prevValue })\n .cycle(...cycleArgs)[part];\n }\n\n const cycleArgs: [keyof DateFields, number] = [\n part as keyof DateFields,\n sign,\n ];\n if (part === \"day\") {\n return dateRef\n .set({\n [part as keyof DateValue]: prevValue,\n /**\n * Edge case for the day field:\n *\n * 1. If the month is filled,\n * we need to ensure that the day snaps to the maximum value of that month.\n * 2. If the month is not filled,\n * we default to the month with the maximum number of days (here just using January, 31 days),\n * so that user can input any possible day.\n */\n month: props.segmentValues.value.month ?? 1,\n })\n .cycle(...cycleArgs)[part as keyof Omit<DateFields, \"era\">];\n }\n\n return dateRef\n .set({ [part as keyof DateValue]: prevValue })\n .cycle(...cycleArgs)[part as keyof Omit<DateFields, \"era\">];\n }\n function updateDayOrMonth(max: number, num: number, prev: number | null) {\n let moveToNext = false;\n const maxStart = Math.floor(max / 10);\n\n /**\n * If the user has left the segment, we want to reset the\n * `prev` value so that we can start the segment over again\n * when the user types a number.\n */\n if (props.hasLeftFocus.value) {\n props.hasLeftFocus.value = false;\n prev = null;\n }\n\n if (prev === null) {\n /**\n * If the user types a 0 as the first number, we want\n * to keep track of that so that when they type the next\n * number, we can move to the next segment.\n */\n\n if (num === 0) {\n props.lastKeyZero.value = true;\n return { value: null, moveToNext };\n }\n /**\n * If the last key was a 0, or if the first number is\n * greater than the max start digit (0-3 in most cases), then\n * we want to move to the next segment, since it's not possible\n * to continue typing a valid number in this segment.\n */\n\n if (props.lastKeyZero.value || num > maxStart) {\n // move to next\n moveToNext = true;\n }\n props.lastKeyZero.value = false;\n /**\n * If none of the above conditions are met, then we can just\n * return the number as the segment value and continue typing\n * in this segment.\n */\n return { value: num, moveToNext };\n }\n\n /**\n * If the number of digits is 2, or if the total with the existing digit\n * and the pressed digit is greater than the maximum value for this\n * month, then we will reset the segment as if the user had pressed the\n * backspace key and then typed the number.\n */\n const digits = prev.toString().length;\n const total = Number.parseInt(prev.toString() + num.toString());\n /**\n * If the number of digits is 2, or if the total with the existing digit\n * and the pressed digit is greater than the maximum value for this\n * month, then we will reset the segment as if the user had pressed the\n * backspace key and then typed the number.\n */\n\n if (digits === 2 || total > max) {\n /**\n * As we're doing elsewhere, we're checking if the number is greater\n * than the max start digit (0-3 in most months), and if so, we're\n * going to move to the next segment.\n */\n if (num > maxStart || total > max) {\n // move to next\n moveToNext = true;\n }\n return { value: num, moveToNext };\n }\n // move to next\n moveToNext = true;\n return { value: total, moveToNext };\n }\n\n function updateMinuteOrSecond(num: number, prev: number | null) {\n const max = 59;\n let moveToNext = false;\n const maxStart = Math.floor(max / 10);\n\n /**\n * If the user has left the segment, we want to reset the\n * `prev` value so that we can start the segment over again\n * when the user types a number.\n */\n if (props.hasLeftFocus.value) {\n props.hasLeftFocus.value = false;\n prev = null;\n }\n\n if (prev === null) {\n /**\n * If the user types a 0 as the first number, we want\n * to keep track of that so that when they type the next\n * number, we can move to the next segment.\n */\n\n if (num === 0) {\n props.lastKeyZero.value = true;\n return { value: 0, moveToNext };\n }\n /**\n * If the last key was a 0, or if the first number is\n * greater than the max start digit (0-3 in most cases), then\n * we want to move to the next segment, since it's not possible\n * to continue typing a valid number in this segment.\n */\n\n if (props.lastKeyZero.value || num > maxStart) {\n // move to next\n moveToNext = true;\n }\n props.lastKeyZero.value = false;\n /**\n * If none of the above conditions are met, then we can just\n * return the number as the segment value and continue typing\n * in this segment.\n */\n return { value: num, moveToNext };\n }\n\n /**\n * If the number of digits is 2, or if the total with the existing digit\n * and the pressed digit is greater than the maximum value for this\n * month, then we will reset the segment as if the user had pressed the\n * backspace key and then typed the number.\n */\n const digits = prev.toString().length;\n const total = Number.parseInt(prev.toString() + num.toString());\n\n /**\n * If the number of digits is 2, or if the total with the existing digit\n * and the pressed digit is greater than the maximum value for this\n * month, then we will reset the segment as if the user had pressed the\n * backspace key and then typed the number.\n */\n\n if (digits === 2 || total > max) {\n /**\n * As we're doing elsewhere, we're checking if the number is greater\n * than the max start digit (0-3 in most months), and if so, we're\n * going to move to the next segment.\n */\n if (num > maxStart) {\n // move to next\n moveToNext = true;\n }\n return { value: num, moveToNext };\n }\n // move to next\n moveToNext = true;\n return { value: total, moveToNext };\n }\n\n function updateHour(num: number, prev: number | null) {\n const max = 24;\n let moveToNext = false;\n const maxStart = Math.floor(max / 10);\n\n /**\n * If the user has left the segment, we want to reset the\n * `prev` value so that we can start the segment over again\n * when the user types a number.\n */\n // probably not implement, kind of weird\n if (props.hasLeftFocus.value) {\n props.hasLeftFocus.value = false;\n prev = null;\n }\n\n if (prev === null) {\n /**\n * If the user types a 0 as the first number, we want\n * to keep track of that so that when they type the next\n * number, we can move to the next segment.\n */\n\n if (num === 0) {\n props.lastKeyZero.value = true;\n return { value: 0, moveToNext };\n }\n /**\n * If the last key was a 0, or if the first number is\n * greater than the max start digit (0-3 in most cases), then\n * we want to move to the next segment, since it's not possible\n * to continue typing a valid number in this segment.\n */\n\n if (props.lastKeyZero.value || num > maxStart) {\n // move to next\n moveToNext = true;\n }\n props.lastKeyZero.value = false;\n /**\n * If none of the above conditions are met, then we can just\n * return the number as the segment value and continue typing\n * in this segment.\n */\n return { value: num, moveToNext };\n }\n\n /**\n * If the number of digits is 2, or if the total with the existing digit\n * and the pressed digit is greater than the maximum value for this\n * month, then we will reset the segment as if the user had pressed the\n * backspace key and then typed the number.\n */\n const digits = prev.toString().length;\n const total = Number.parseInt(prev.toString() + num.toString());\n\n /**\n * If the number of digits is 2, or if the total with the existing digit\n * and the pressed digit is greater than the maximum value for this\n * month, then we will reset the segment as if the user had pressed the\n * backspace key and then typed the number.\n */\n\n if (digits === 2 || total > max) {\n /**\n * As we're doing elsewhere, we're checking if the number is greater\n * than the max start digit (0-3 in most months), and if so, we're\n * going to move to the next segment.\n */\n if (num > maxStart) {\n // move to next\n moveToNext = true;\n }\n return { value: num, moveToNext };\n }\n // move to next\n moveToNext = true;\n return { value: total, moveToNext };\n }\n\n function updateYear(num: number, prev: number | null) {\n let moveToNext = false;\n\n /**\n * If the user has left the segment, we want to reset the\n * `prev` value so that we can start the segment over again\n * when the user types a number.\n */\n // probably not implement, kind of weird\n if (props.hasLeftFocus.value) {\n props.hasLeftFocus.value = false;\n prev = null;\n }\n\n if (prev === null) return { value: num === 0 ? 1 : num, moveToNext };\n\n const str = prev.toString() + num.toString();\n\n if (str.length > 4) return { value: num === 0 ? 1 : num, moveToNext };\n\n if (str.length === 4) moveToNext = true;\n\n const int = Number.parseInt(str);\n return { value: int, moveToNext };\n }\n\n const attributes = computed(\n () =>\n segmentBuilders[props.part]?.attrs({\n disabled: props.disabled.value,\n placeholder: props.placeholder.value,\n hourCycle: props.hourCycle,\n segmentValues: props.segmentValues.value,\n formatter: props.formatter,\n }) ?? {},\n );\n\n // TODO: look into abstracting segment keydown functions since they have the same structure (checks -> arrow_up, arrow_down update -> number string update -> move to next -> backspace update)\n function handleDaySegmentKeydown(e: KeyboardEvent) {\n if (!isAcceptableSegmentKey(e.key) || isSegmentNavigationKey(e.key)) return;\n\n const prevValue = props.segmentValues.value.day;\n\n if (e.key === kbd.ARROW_DOWN || e.key === kbd.ARROW_UP) {\n props.segmentValues.value.day = dateTimeValueIncrementation({\n e,\n part: \"day\",\n dateRef: props.placeholder.value,\n prevValue,\n });\n return;\n }\n\n if (isNumberString(e.key)) {\n const num = Number.parseInt(e.key);\n const segmentMonthValue = props.segmentValues.value.month;\n\n const daysInMonth = segmentMonthValue\n ? getDaysInMonth(\n props.placeholder.value.set({ month: segmentMonthValue }),\n )\n : // if the month is not set, we default to the maximum number of days in a month\n // so that user can input any possible day\n 31;\n\n const { value, moveToNext } = updateDayOrMonth(\n daysInMonth,\n num,\n prevValue,\n );\n\n props.segmentValues.value.day = value;\n\n if (moveToNext) props.focusNext();\n }\n\n if (e.key === kbd.BACKSPACE) {\n props.hasLeftFocus.value = false;\n props.segmentValues.value.day = deleteValue(prevValue);\n }\n }\n\n function handleMonthSegmentKeydown(e: KeyboardEvent) {\n if (!isAcceptableSegmentKey(e.key) || isSegmentNavigationKey(e.key)) return;\n\n const prevValue = props.segmentValues.value.month;\n\n if (e.key === kbd.ARROW_DOWN || e.key === kbd.ARROW_UP) {\n props.segmentValues.value.month = dateTimeValueIncrementation({\n e,\n part: \"month\",\n dateRef: props.placeholder.value,\n prevValue,\n });\n return;\n }\n\n if (isNumberString(e.key)) {\n const num = Number.parseInt(e.key);\n const { value, moveToNext } = updateDayOrMonth(12, num, prevValue);\n\n props.segmentValues.value.month = value;\n\n if (moveToNext) props.focusNext();\n }\n\n if (e.key === kbd.BACKSPACE) {\n props.hasLeftFocus.value = false;\n props.segmentValues.value.month = deleteValue(prevValue);\n }\n }\n\n function handleYearSegmentKeydown(e: KeyboardEvent) {\n if (!isAcceptableSegmentKey(e.key) || isSegmentNavigationKey(e.key)) return;\n\n const prevValue = props.segmentValues.value.year;\n\n if (e.key === kbd.ARROW_DOWN || e.key === kbd.ARROW_UP) {\n props.segmentValues.value.year = dateTimeValueIncrementation({\n e,\n part: \"year\",\n dateRef: props.placeholder.value,\n prevValue,\n });\n return;\n }\n\n if (isNumberString(e.key)) {\n const num = Number.parseInt(e.key);\n const { value, moveToNext } = updateYear(num, prevValue);\n\n props.segmentValues.value.year = value;\n\n if (moveToNext) props.focusNext();\n }\n\n if (e.key === kbd.BACKSPACE) {\n props.hasLeftFocus.value = false;\n props.segmentValues.value.year = deleteValue(prevValue);\n }\n }\n\n function handleHourSegmentKeydown(e: KeyboardEvent) {\n const dateRef = props.placeholder.value;\n if (\n !isAcceptableSegmentKey(e.key) ||\n isSegmentNavigationKey(e.key) ||\n !(\"hour\" in dateRef) ||\n !(\"hour\" in props.segmentValues.value)\n )\n return;\n\n const prevValue = props.segmentValues.value.hour;\n\n const hourCycle = props.hourCycle;\n\n if (e.key === kbd.ARROW_UP || e.key === kbd.ARROW_DOWN) {\n props.segmentValues.value.hour = dateTimeValueIncrementation({\n e,\n part: \"hour\",\n dateRef: props.placeholder.value,\n prevValue,\n hourCycle,\n });\n\n if (\"dayPeriod\" in props.segmentValues.value) {\n if (props.segmentValues.value.hour < 12)\n props.segmentValues.value.dayPeriod = \"AM\";\n else if (props.segmentValues.value.hour)\n props.segmentValues.value.dayPeriod = \"PM\";\n }\n\n return;\n }\n\n if (isNumberString(e.key)) {\n const num = Number.parseInt(e.key);\n const { value, moveToNext } = updateHour(num, prevValue);\n\n if (\"dayPeriod\" in props.segmentValues.value && value && value > 12)\n props.segmentValues.value.dayPeriod = \"PM\";\n else if (\"dayPeriod\" in props.segmentValues.value && value)\n props.segmentValues.value.dayPeriod = \"AM\";\n\n props.segmentValues.value.hour = value;\n\n if (moveToNext) props.focusNext();\n }\n\n if (e.key === kbd.BACKSPACE) {\n props.hasLeftFocus.value = false;\n props.segmentValues.value.hour = deleteValue(prevValue);\n }\n }\n\n function handleMinuteSegmentKeydown(e: KeyboardEvent) {\n const dateRef = props.placeholder.value;\n\n if (\n !isAcceptableSegmentKey(e.key) ||\n isSegmentNavigationKey(e.key) ||\n !(\"minute\" in dateRef) ||\n !(\"minute\" in props.segmentValues.value)\n )\n return;\n\n const prevValue = props.segmentValues.value.minute;\n\n if (e.key === kbd.ARROW_UP || e.key === kbd.ARROW_DOWN) {\n props.segmentValues.value.minute = minuteSecondIncrementation({\n e,\n part: \"minute\",\n dateRef: props.placeholder.value,\n prevValue,\n });\n }\n\n if (isNumberString(e.key)) {\n const num = Number.parseInt(e.key);\n\n const { value, moveToNext } = updateMinuteOrSecond(num, prevValue);\n\n props.segmentValues.value.minute = value;\n\n if (moveToNext) props.focusNext();\n }\n\n if (e.key === kbd.BACKSPACE) {\n props.hasLeftFocus.value = false;\n props.segmentValues.value.minute = deleteValue(prevValue);\n }\n }\n\n function handleSecondSegmentKeydown(e: KeyboardEvent) {\n const dateRef = props.placeholder.value;\n\n if (\n !isAcceptableSegmentKey(e.key) ||\n isSegmentNavigationKey(e.key) ||\n !(\"second\" in dateRef) ||\n !(\"second\" in props.segmentValues.value)\n )\n return;\n\n const prevValue = props.segmentValues.value.second;\n\n if (e.key === kbd.ARROW_UP || e.key === kbd.ARROW_DOWN) {\n props.segmentValues.value.second = minuteSecondIncrementation({\n e,\n part: \"second\",\n dateRef: props.placeholder.value,\n prevValue,\n });\n }\n\n if (isNumberString(e.key)) {\n const num = Number.parseInt(e.key);\n const { value, moveToNext } = updateMinuteOrSecond(num, prevValue);\n\n props.segmentValues.value.second = value;\n\n if (moveToNext) props.focusNext();\n }\n\n if (e.key === kbd.BACKSPACE) {\n props.hasLeftFocus.value = false;\n props.segmentValues.value.second = deleteValue(prevValue);\n }\n }\n\n function handleDayPeriodSegmentKeydown(e: KeyboardEvent) {\n if (\n ((!isAcceptableSegmentKey(e.key) || isSegmentNavigationKey(e.key)) &&\n e.key !== \"a\" &&\n e.key !== \"p\") ||\n !(\"hour\" in props.placeholder.value) ||\n !(\"dayPeriod\" in props.segmentValues.value)\n )\n return;\n\n if (e.key === kbd.ARROW_UP || e.key === kbd.ARROW_DOWN) {\n if (props.segmentValues.value.dayPeriod === \"AM\") {\n props.segmentValues.value.dayPeriod = \"PM\";\n props.segmentValues.value.hour = props.segmentValues.value.hour! + 12;\n return;\n }\n props.segmentValues.value.dayPeriod = \"AM\";\n props.segmentValues.value.hour = props.segmentValues.value.hour! - 12;\n return;\n }\n\n if (\n [\"a\", \"A\"].includes(e.key) &&\n props.segmentValues.value.dayPeriod !== \"AM\"\n ) {\n props.segmentValues.value.dayPeriod = \"AM\";\n props.segmentValues.value.hour = props.segmentValues.value.hour! - 12;\n return;\n }\n\n if (\n [\"p\", \"P\"].includes(e.key) &&\n props.segmentValues.value.dayPeriod !== \"PM\"\n ) {\n props.segmentValues.value.dayPeriod = \"PM\";\n props.segmentValues.value.hour = props.segmentValues.value.hour! + 12;\n }\n }\n\n function handleSegmentClick(e: MouseEvent) {\n const disabled = props.disabled.value;\n if (disabled) e.preventDefault();\n }\n\n function handleSegmentKeydown(e: KeyboardEvent) {\n const disabled = props.disabled.value;\n const readonly = props.readonly.value;\n if (e.key !== kbd.TAB) e.preventDefault();\n\n if (disabled || readonly) return;\n const segmentKeydownHandlers = {\n day: handleDaySegmentKeydown,\n month: handleMonthSegmentKeydown,\n year: handleYearSegmentKeydown,\n hour: handleHourSegmentKeydown,\n minute: handleMinuteSegmentKeydown,\n second: handleSecondSegmentKeydown,\n dayPeriod: handleDayPeriodSegmentKeydown,\n timeZoneName: () => {},\n } as const;\n\n segmentKeydownHandlers[props.part as keyof typeof segmentKeydownHandlers](\n e,\n );\n\n if (\n ![kbd.ARROW_LEFT, kbd.ARROW_RIGHT].includes(e.key) &&\n e.key !== kbd.TAB &&\n e.key !== kbd.SHIFT &&\n isAcceptableSegmentKey(e.key)\n ) {\n if (\n Object.values(props.segmentValues.value).every((item) => item !== null)\n ) {\n const updateObject = {\n ...(props.segmentValues.value as Record<AnyExceptLiteral, number>),\n };\n\n let dateRef = props.placeholder.value.copy();\n\n Object.keys(updateObject).forEach((part) => {\n const value = updateObject[part as AnyExceptLiteral];\n dateRef = dateRef.set({ [part]: value });\n });\n\n props.modelValue.value = dateRef.copy();\n }\n }\n }\n\n return {\n handleSegmentClick,\n handleSegmentKeydown,\n attributes,\n };\n}\n"],"names":["cycleArgs"],"mappings":";;;;AAgDA,SAAS,mBAAmB,OAAyB;AACnD,SAAO;AAAA,IACL,MAAM;AAAA,IACN,iBAAiB;AAAA,IACjB,UAAU,MAAM,WAAW,SAAY;AAAA,IACvC,YAAY;AAAA,IACZ,WAAW;AAAA,IACX,aAAa;AAAA,IACb,cAAc;AAAA,IACd,OAAO;AAAA,EAAA;AAEX;AAEA,SAAS,gBAAgB,OAAyB;AAChD,QAAM,EAAE,eAAe,YAAA,IAAgB;AACvC,QAAM,UAAU,cAAc,QAAQ;AACtC,QAAM,OAAO,cAAc,MACvB,YAAY,IAAI,EAAE,KAAK,cAAc,IAAA,CAAK,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
+
export declare function getOptsByGranularity(granularity: Granularity, hourCycle: HourCycle, isTimeValue?: boolean): Intl.DateTimeFormatOptions;
|
|
4
|
+
type GetDefaultDateStepProps = {
|
|
5
|
+
step?: DateStep;
|
|
6
|
+
};
|
|
7
|
+
export declare function normalizeDateStep(props?: GetDefaultDateStepProps): DateStep;
|
|
8
|
+
export declare function handleCalendarInitialFocus(calendar: HTMLElement): void;
|
|
9
|
+
export declare function normalizeHourCycle(hourCycle: HourCycle): "h23" | "h11" | undefined;
|
|
10
|
+
export declare function normalizeHour12(hourCycle: HourCycle): boolean | undefined;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import defu from "../../node_modules/.pnpm/defu@6.1.4/node_modules/defu/dist/defu.js";
|
|
2
|
+
function getOptsByGranularity(granularity, hourCycle, isTimeValue = false) {
|
|
3
|
+
const opts = {
|
|
4
|
+
year: "numeric",
|
|
5
|
+
month: "2-digit",
|
|
6
|
+
day: "2-digit",
|
|
7
|
+
hour: "2-digit",
|
|
8
|
+
minute: "2-digit",
|
|
9
|
+
second: "2-digit",
|
|
10
|
+
timeZoneName: "short",
|
|
11
|
+
hourCycle: normalizeHourCycle(hourCycle),
|
|
12
|
+
hour12: normalizeHour12(hourCycle)
|
|
13
|
+
};
|
|
14
|
+
if (isTimeValue) {
|
|
15
|
+
delete opts.year;
|
|
16
|
+
delete opts.month;
|
|
17
|
+
delete opts.day;
|
|
18
|
+
}
|
|
19
|
+
if (granularity === "day") {
|
|
20
|
+
delete opts.second;
|
|
21
|
+
delete opts.hour;
|
|
22
|
+
delete opts.minute;
|
|
23
|
+
delete opts.timeZoneName;
|
|
24
|
+
}
|
|
25
|
+
if (granularity === "hour") {
|
|
26
|
+
delete opts.minute;
|
|
27
|
+
delete opts.second;
|
|
28
|
+
}
|
|
29
|
+
if (granularity === "minute")
|
|
30
|
+
delete opts.second;
|
|
31
|
+
return opts;
|
|
32
|
+
}
|
|
33
|
+
function normalizeDateStep(props) {
|
|
34
|
+
return defu(props?.step, {
|
|
35
|
+
year: 1,
|
|
36
|
+
month: 1,
|
|
37
|
+
day: 1,
|
|
38
|
+
hour: 1,
|
|
39
|
+
minute: 1,
|
|
40
|
+
second: 1,
|
|
41
|
+
millisecond: 1
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
function handleCalendarInitialFocus(calendar) {
|
|
45
|
+
const selectedDay = calendar.querySelector("[data-selected]");
|
|
46
|
+
if (selectedDay)
|
|
47
|
+
return selectedDay.focus();
|
|
48
|
+
const today = calendar.querySelector("[data-today]");
|
|
49
|
+
if (today)
|
|
50
|
+
return today.focus();
|
|
51
|
+
const firstDay = calendar.querySelector("[data-reka-calendar-day]");
|
|
52
|
+
if (firstDay)
|
|
53
|
+
return firstDay.focus();
|
|
54
|
+
}
|
|
55
|
+
function normalizeHourCycle(hourCycle) {
|
|
56
|
+
if (hourCycle === 24)
|
|
57
|
+
return "h23";
|
|
58
|
+
if (hourCycle === 12)
|
|
59
|
+
return "h11";
|
|
60
|
+
return void 0;
|
|
61
|
+
}
|
|
62
|
+
function normalizeHour12(hourCycle) {
|
|
63
|
+
if (hourCycle === 24)
|
|
64
|
+
return false;
|
|
65
|
+
if (hourCycle === 12)
|
|
66
|
+
return true;
|
|
67
|
+
return void 0;
|
|
68
|
+
}
|
|
69
|
+
export {
|
|
70
|
+
getOptsByGranularity,
|
|
71
|
+
handleCalendarInitialFocus,
|
|
72
|
+
normalizeDateStep,
|
|
73
|
+
normalizeHour12,
|
|
74
|
+
normalizeHourCycle
|
|
75
|
+
};
|
|
76
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sources":["../../../src/shared/date/utils.ts"],"sourcesContent":["import type { Granularity } from './comparators'\nimport type { DateStep, HourCycle } from './types'\nimport { defu } from 'defu'\n\nexport function getOptsByGranularity(granularity: Granularity, hourCycle: HourCycle, isTimeValue: boolean = false) {\n const opts: Intl.DateTimeFormatOptions = {\n year: 'numeric',\n month: '2-digit',\n day: '2-digit',\n hour: '2-digit',\n minute: '2-digit',\n second: '2-digit',\n timeZoneName: 'short',\n hourCycle: normalizeHourCycle(hourCycle),\n hour12: normalizeHour12(hourCycle),\n }\n if (isTimeValue) {\n delete opts.year\n delete opts.month\n delete opts.day\n }\n\n if (granularity === 'day') {\n delete opts.second\n delete opts.hour\n delete opts.minute\n delete opts.timeZoneName\n }\n if (granularity === 'hour') {\n delete opts.minute\n delete opts.second\n }\n\n if (granularity === 'minute')\n delete opts.second\n\n return opts\n}\n\ntype GetDefaultDateStepProps = {\n step?: DateStep\n}\n\nexport function normalizeDateStep(props?: GetDefaultDateStepProps): DateStep {\n return defu(props?.step, {\n year: 1,\n month: 1,\n day: 1,\n hour: 1,\n minute: 1,\n second: 1,\n millisecond: 1,\n } satisfies DateStep)\n}\n\nexport function handleCalendarInitialFocus(calendar: HTMLElement) {\n const selectedDay = calendar.querySelector<HTMLElement>('[data-selected]')\n if (selectedDay)\n return selectedDay.focus()\n\n const today = calendar.querySelector<HTMLElement>('[data-today]')\n if (today)\n return today.focus()\n\n const firstDay = calendar.querySelector<HTMLElement>('[data-reka-calendar-day]')\n if (firstDay)\n return firstDay.focus()\n}\n\nexport function normalizeHourCycle(hourCycle: HourCycle) {\n if (hourCycle === 24)\n return 'h23'\n if (hourCycle === 12)\n return 'h11'\n return undefined\n}\n\nexport function normalizeHour12(hourCycle: HourCycle) {\n if (hourCycle === 24)\n return false\n if (hourCycle === 12)\n return true\n return undefined\n}\n"],"names":[],"mappings":";AAIO,SAAS,qBAAqB,aAA0B,WAAsB,cAAuB,OAAO;AACjH,QAAM,OAAmC;AAAA,IACvC,MAAM;AAAA,IACN,OAAO;AAAA,IACP,KAAK;AAAA,IACL,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,cAAc;AAAA,IACd,WAAW,mBAAmB,SAAS;AAAA,IACvC,QAAQ,gBAAgB,SAAS;AAAA,EAAA;AAEnC,MAAI,aAAa;AACf,WAAO,KAAK;AACZ,WAAO,KAAK;AACZ,WAAO,KAAK;AAAA,EACd;AAEA,MAAI,gBAAgB,OAAO;AACzB,WAAO,KAAK;AACZ,WAAO,KAAK;AACZ,WAAO,KAAK;AACZ,WAAO,KAAK;AAAA,EACd;AACA,MAAI,gBAAgB,QAAQ;AAC1B,WAAO,KAAK;AACZ,WAAO,KAAK;AAAA,EACd;AAEA,MAAI,gBAAgB;AAClB,WAAO,KAAK;AAEd,SAAO;AACT;AAMO,SAAS,kBAAkB,OAA2C;AAC3E,SAAO,KAAK,OAAO,MAAM;AAAA,IACvB,MAAM;AAAA,IACN,OAAO;AAAA,IACP,KAAK;AAAA,IACL,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,aAAa;AAAA,EAAA,CACK;AACtB;AAEO,SAAS,2BAA2B,UAAuB;AAChE,QAAM,cAAc,SAAS,cAA2B,iBAAiB;AACzE,MAAI;AACF,WAAO,YAAY,MAAA;AAErB,QAAM,QAAQ,SAAS,cAA2B,cAAc;AAChE,MAAI;AACF,WAAO,MAAM,MAAA;AAEf,QAAM,WAAW,SAAS,cAA2B,0BAA0B;AAC/E,MAAI;AACF,WAAO,SAAS,MAAA;AACpB;AAEO,SAAS,mBAAmB,WAAsB;AACvD,MAAI,cAAc;AAChB,WAAO;AACT,MAAI,cAAc;AAChB,WAAO;AACT,SAAO;AACT;AAEO,SAAS,gBAAgB,WAAsB;AACpD,MAAI,cAAc;AAChB,WAAO;AACT,MAAI,cAAc;AAChB,WAAO;AACT,SAAO;AACT;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getActiveElement(): Element | null;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
function getActiveElement() {
|
|
2
|
+
let activeElement = document.activeElement;
|
|
3
|
+
if (activeElement == null) {
|
|
4
|
+
return null;
|
|
5
|
+
}
|
|
6
|
+
while (activeElement != null && activeElement.shadowRoot != null && activeElement.shadowRoot.activeElement != null) {
|
|
7
|
+
activeElement = activeElement.shadowRoot.activeElement;
|
|
8
|
+
}
|
|
9
|
+
return activeElement;
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
getActiveElement
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=getActiveElement.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getActiveElement.js","sources":["../../src/shared/getActiveElement.ts"],"sourcesContent":["export function getActiveElement(): Element | null {\r\n let activeElement = document.activeElement\r\n if (activeElement == null) {\r\n return null\r\n }\r\n\r\n while (activeElement != null && activeElement.shadowRoot != null && activeElement.shadowRoot.activeElement != null) {\r\n activeElement = activeElement.shadowRoot.activeElement\r\n }\r\n\r\n return activeElement\r\n}\r\n"],"names":[],"mappings":"AAAO,SAAS,mBAAmC;AACjD,MAAI,gBAAgB,SAAS;AAC7B,MAAI,iBAAiB,MAAM;AACzB,WAAO;AAAA,EACT;AAEA,SAAO,iBAAiB,QAAQ,cAAc,cAAc,QAAQ,cAAc,WAAW,iBAAiB,MAAM;AAClH,oBAAgB,cAAc,WAAW;AAAA,EAC3C;AAEA,SAAO;AACT;"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
function handleAndDispatchCustomEvent(name, handler, detail) {
|
|
2
|
+
const target = detail.originalEvent.target;
|
|
3
|
+
const event = new CustomEvent(name, {
|
|
4
|
+
bubbles: false,
|
|
5
|
+
cancelable: true,
|
|
6
|
+
detail
|
|
7
|
+
});
|
|
8
|
+
if (handler)
|
|
9
|
+
target.addEventListener(name, handler, { once: true });
|
|
10
|
+
target.dispatchEvent(event);
|
|
11
|
+
}
|
|
12
|
+
export {
|
|
13
|
+
handleAndDispatchCustomEvent
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=handleAndDispatchCustomEvent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handleAndDispatchCustomEvent.js","sources":["../../src/shared/handleAndDispatchCustomEvent.ts"],"sourcesContent":["export function handleAndDispatchCustomEvent<\n E extends CustomEvent,\n OriginalEvent extends Event,\n>(\n name: string,\n handler: ((event: E) => void) | undefined,\n detail: { originalEvent: OriginalEvent } & (E extends CustomEvent<infer D>\n ? D\n : never),\n) {\n const target = detail.originalEvent.target\n const event = new CustomEvent(name, {\n bubbles: false,\n cancelable: true,\n detail,\n })\n if (handler)\n target.addEventListener(name, handler as EventListener, { once: true })\n\n target.dispatchEvent(event)\n}\n"],"names":[],"mappings":"AAAO,SAAS,6BAId,MACA,SACA,QAGA;AACA,QAAM,SAAS,OAAO,cAAc;AACpC,QAAM,QAAQ,IAAI,YAAY,MAAM;AAAA,IAClC,SAAS;AAAA,IACT,YAAY;AAAA,IACZ;AAAA,EAAA,CACD;AACD,MAAI;AACF,WAAO,iBAAiB,MAAM,SAA0B,EAAE,MAAM,MAAM;AAExE,SAAO,cAAc,KAAK;AAC5B;"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export * from './arrays';
|
|
2
|
+
export { createContext } from './createContext';
|
|
3
|
+
export { type DateRange, type DateStep, type DateValue, type SegmentPart, } from './date';
|
|
4
|
+
export { getActiveElement } from './getActiveElement';
|
|
5
|
+
export { handleAndDispatchCustomEvent } from './handleAndDispatchCustomEvent';
|
|
6
|
+
export * from './nullish';
|
|
7
|
+
export { onFocusOutside } from './onFocusOutside';
|
|
8
|
+
export { renderSlotFragments } from './renderSlotFragments';
|
|
9
|
+
export { trapFocus } from './trap-focus';
|
|
10
|
+
export { type Formatter, useDateFormatter } from './useDateFormatter';
|
|
11
|
+
export { useDirection } from './useDirection';
|
|
12
|
+
export { useEmitAsProps } from './useEmitAsProps';
|
|
13
|
+
export { useFocusGuards } from './useFocusGuards';
|
|
14
|
+
export { useForwardExpose } from './useForwardExpose';
|
|
15
|
+
export { useForwardProps } from './useForwardProps';
|
|
16
|
+
export { useForwardPropsEmits } from './useForwardPropsEmits';
|
|
17
|
+
export { useId } from './useId';
|
|
18
|
+
export { useKbd, useTestKbd } from './useKbd';
|
|
19
|
+
export { useLocale } from './useLocale';
|
|
20
|
+
export { useSize } from './useSize';
|
|
21
|
+
export { useStateMachine } from './useStateMachine';
|
|
22
|
+
export { withDefault } from './withDefault';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function isNullish(value: any): value is null | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nullish.js","sources":["../../src/shared/nullish.ts"],"sourcesContent":["export function isNullish(value: any): value is null | undefined {\n return value === null || value === undefined\n}\n"],"names":[],"mappings":"AAAO,SAAS,UAAU,OAAuC;AAC/D,SAAO,UAAU,QAAQ,UAAU;AACrC;"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Fragment } from "vue";
|
|
2
|
+
function renderSlotFragments(children) {
|
|
3
|
+
if (!children)
|
|
4
|
+
return [];
|
|
5
|
+
return children.flatMap((child) => {
|
|
6
|
+
if (child.type === Fragment)
|
|
7
|
+
return renderSlotFragments(child.children);
|
|
8
|
+
return [child];
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
renderSlotFragments
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=renderSlotFragments.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderSlotFragments.js","sources":["../../src/shared/renderSlotFragments.ts"],"sourcesContent":["import type { VNode } from 'vue'\nimport { Fragment } from 'vue'\n\nexport function renderSlotFragments(children?: VNode[]): VNode[] {\n if (!children)\n return []\n return children.flatMap((child) => {\n if (child.type === Fragment)\n return renderSlotFragments(child.children as VNode[])\n\n return [child]\n })\n}\n"],"names":[],"mappings":";AAGO,SAAS,oBAAoB,UAA6B;AAC/D,MAAI,CAAC;AACH,WAAO,CAAA;AACT,SAAO,SAAS,QAAQ,CAAC,UAAU;AACjC,QAAI,MAAM,SAAS;AACjB,aAAO,oBAAoB,MAAM,QAAmB;AAEtD,WAAO,CAAC,KAAK;AAAA,EACf,CAAC;AACH;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function trapFocus(element: HTMLElement): HTMLElement | undefined;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { DefineComponent } from 'vue';
|
|
2
|
+
type DataOrientation = 'vertical' | 'horizontal';
|
|
3
|
+
type Direction = 'ltr' | 'rtl';
|
|
4
|
+
type SingleOrMultipleType = 'single' | 'multiple';
|
|
5
|
+
interface SingleOrMultipleProps<T = AcceptableValue | AcceptableValue[]> {
|
|
6
|
+
/**
|
|
7
|
+
* Determines whether a "single" or "multiple" items can be selected at a time.
|
|
8
|
+
*
|
|
9
|
+
* This prop will overwrite the inferred type from `modelValue` and `defaultValue`.
|
|
10
|
+
*/
|
|
11
|
+
type?: SingleOrMultipleType;
|
|
12
|
+
/**
|
|
13
|
+
* The controlled value of the active item(s).
|
|
14
|
+
*
|
|
15
|
+
* Use this when you need to control the state of the items. Can be binded with `v-model`
|
|
16
|
+
*/
|
|
17
|
+
modelValue?: T;
|
|
18
|
+
/**
|
|
19
|
+
* The default active value of the item(s).
|
|
20
|
+
*
|
|
21
|
+
* Use when you do not need to control the state of the item(s).
|
|
22
|
+
*/
|
|
23
|
+
defaultValue?: T;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* if padding or margin is number, it will be in px
|
|
27
|
+
* if padding or margin is true, it will be var(--scrollbar-width)
|
|
28
|
+
* otherwise, it will be passed string
|
|
29
|
+
*/
|
|
30
|
+
type ScrollBodyOption = {
|
|
31
|
+
padding?: boolean | number | string;
|
|
32
|
+
margin?: boolean | number | string;
|
|
33
|
+
};
|
|
34
|
+
type AcceptableValue = string | number | bigint | Record<string, any> | null;
|
|
35
|
+
type ArrayOrWrapped<T> = T extends any[] ? T : Array<T>;
|
|
36
|
+
type StringOrNumber = string | number;
|
|
37
|
+
type GenericComponentInstance<T> = T extends new (...args: any[]) => infer R ? R : T extends (...args: any[]) => infer R ? R extends {
|
|
38
|
+
__ctx?: infer K;
|
|
39
|
+
} ? Exclude<K, void> extends {
|
|
40
|
+
expose: (...args: infer Y) => void;
|
|
41
|
+
} ? Y[0] & InstanceType<DefineComponent> : any : any : any;
|
|
42
|
+
interface FormFieldProps {
|
|
43
|
+
/** The name of the field. Submitted with its owning form as part of a name/value pair. */
|
|
44
|
+
name?: string;
|
|
45
|
+
/** When `true`, indicates that the user must set the value before the owning form can be submitted. */
|
|
46
|
+
required?: boolean;
|
|
47
|
+
}
|
|
48
|
+
export type { AcceptableValue, ArrayOrWrapped, DataOrientation, Direction, FormFieldProps, GenericComponentInstance, ScrollBodyOption, SingleOrMultipleProps, SingleOrMultipleType, StringOrNumber };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { DateValue } from '@internationalized/date';
|
|
2
|
+
export interface DateFormatterOptions extends Intl.DateTimeFormatOptions {
|
|
3
|
+
calendar?: string;
|
|
4
|
+
}
|
|
5
|
+
export type Formatter = {
|
|
6
|
+
getLocale: () => string;
|
|
7
|
+
setLocale: (newLocale: string) => void;
|
|
8
|
+
custom: (date: Date, options: DateFormatterOptions) => string;
|
|
9
|
+
selectedDate: (date: DateValue, includeTime?: boolean) => string;
|
|
10
|
+
dayOfWeek: (date: Date, length?: DateFormatterOptions["weekday"]) => string;
|
|
11
|
+
fullMonthAndYear: (date: Date, options?: DateFormatterOptions) => string;
|
|
12
|
+
fullMonth: (date: Date, options?: DateFormatterOptions) => string;
|
|
13
|
+
fullYear: (date: Date, options?: DateFormatterOptions) => string;
|
|
14
|
+
dayPeriod: (date: Date) => string;
|
|
15
|
+
part: (dateObj: DateValue, type: Intl.DateTimeFormatPartTypes, options?: DateFormatterOptions) => string;
|
|
16
|
+
toParts: (date: DateValue, options?: DateFormatterOptions) => Intl.DateTimeFormatPart[];
|
|
17
|
+
getMonths: () => {
|
|
18
|
+
label: string;
|
|
19
|
+
value: number;
|
|
20
|
+
}[];
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Creates a wrapper around the `DateFormatter`, which is
|
|
24
|
+
* an improved version of the {@link Intl.DateTimeFormat} API,
|
|
25
|
+
* that is used internally by the various date builders to
|
|
26
|
+
* easily format dates in a consistent way.
|
|
27
|
+
*
|
|
28
|
+
* @see [DateFormatter](https://react-spectrum.adobe.com/internationalized/date/DateFormatter.html)
|
|
29
|
+
*/
|
|
30
|
+
export declare function useDateFormatter(initialLocale: string, opts?: DateFormatterOptions): Formatter;
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { today as $14e0f24ef4ac5c92$export$d0bdf45af03a6ea3, getLocalTimeZone as $14e0f24ef4ac5c92$export$aa8b41735afcabd2 } from "../node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/queries.js";
|
|
2
|
+
import { DateFormatter as $fb18d541ea1ad717$export$ad991b66133851cf } from "../node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/DateFormatter.js";
|
|
3
|
+
import { ref } from "vue";
|
|
4
|
+
import { toDate, hasTime, isZonedDateTime } from "../date/comparators.js";
|
|
5
|
+
function useDateFormatter(initialLocale, opts = {}) {
|
|
6
|
+
const locale = ref(initialLocale);
|
|
7
|
+
function getLocale() {
|
|
8
|
+
return locale.value;
|
|
9
|
+
}
|
|
10
|
+
function setLocale(newLocale) {
|
|
11
|
+
locale.value = newLocale;
|
|
12
|
+
}
|
|
13
|
+
function custom(date, options) {
|
|
14
|
+
return new $fb18d541ea1ad717$export$ad991b66133851cf(locale.value, { ...opts, ...options }).format(
|
|
15
|
+
date
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
function selectedDate(date, includeTime = true) {
|
|
19
|
+
if (hasTime(date) && includeTime) {
|
|
20
|
+
return custom(toDate(date), {
|
|
21
|
+
dateStyle: "long",
|
|
22
|
+
timeStyle: "long"
|
|
23
|
+
});
|
|
24
|
+
} else {
|
|
25
|
+
return custom(toDate(date), {
|
|
26
|
+
dateStyle: "long"
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
function fullMonthAndYear(date, options = {}) {
|
|
31
|
+
return new $fb18d541ea1ad717$export$ad991b66133851cf(locale.value, {
|
|
32
|
+
...opts,
|
|
33
|
+
month: "long",
|
|
34
|
+
year: "numeric",
|
|
35
|
+
...options
|
|
36
|
+
}).format(date);
|
|
37
|
+
}
|
|
38
|
+
function fullMonth(date, options = {}) {
|
|
39
|
+
return new $fb18d541ea1ad717$export$ad991b66133851cf(locale.value, {
|
|
40
|
+
...opts,
|
|
41
|
+
month: "long",
|
|
42
|
+
...options
|
|
43
|
+
}).format(date);
|
|
44
|
+
}
|
|
45
|
+
function getMonths() {
|
|
46
|
+
const defaultDate = $14e0f24ef4ac5c92$export$d0bdf45af03a6ea3($14e0f24ef4ac5c92$export$aa8b41735afcabd2());
|
|
47
|
+
const months = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
|
|
48
|
+
return months.map((item) => ({
|
|
49
|
+
label: fullMonth(toDate(defaultDate.set({ month: item }))),
|
|
50
|
+
value: item
|
|
51
|
+
}));
|
|
52
|
+
}
|
|
53
|
+
function fullYear(date, options = {}) {
|
|
54
|
+
return new $fb18d541ea1ad717$export$ad991b66133851cf(locale.value, {
|
|
55
|
+
...opts,
|
|
56
|
+
year: "numeric",
|
|
57
|
+
...options
|
|
58
|
+
}).format(date);
|
|
59
|
+
}
|
|
60
|
+
function toParts(date, options) {
|
|
61
|
+
if (isZonedDateTime(date)) {
|
|
62
|
+
return new $fb18d541ea1ad717$export$ad991b66133851cf(locale.value, {
|
|
63
|
+
...opts,
|
|
64
|
+
...options,
|
|
65
|
+
timeZone: date.timeZone
|
|
66
|
+
}).formatToParts(toDate(date));
|
|
67
|
+
} else {
|
|
68
|
+
return new $fb18d541ea1ad717$export$ad991b66133851cf(locale.value, {
|
|
69
|
+
...opts,
|
|
70
|
+
...options
|
|
71
|
+
}).formatToParts(toDate(date));
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
function dayOfWeek(date, length = "narrow") {
|
|
75
|
+
return new $fb18d541ea1ad717$export$ad991b66133851cf(locale.value, { ...opts, weekday: length }).format(
|
|
76
|
+
date
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
function dayPeriod(date) {
|
|
80
|
+
const parts = new $fb18d541ea1ad717$export$ad991b66133851cf(locale.value, {
|
|
81
|
+
...opts,
|
|
82
|
+
hour: "numeric",
|
|
83
|
+
minute: "numeric"
|
|
84
|
+
}).formatToParts(date);
|
|
85
|
+
const value = parts.find((p) => p.type === "dayPeriod")?.value;
|
|
86
|
+
if (value === "PM" || value === "p.m.") return "PM";
|
|
87
|
+
return "AM";
|
|
88
|
+
}
|
|
89
|
+
const defaultPartOptions = {
|
|
90
|
+
year: "numeric",
|
|
91
|
+
month: "numeric",
|
|
92
|
+
day: "numeric",
|
|
93
|
+
hour: "numeric",
|
|
94
|
+
minute: "numeric",
|
|
95
|
+
second: "numeric"
|
|
96
|
+
};
|
|
97
|
+
function part(dateObj, type, options = {}) {
|
|
98
|
+
const opts2 = { ...defaultPartOptions, ...options };
|
|
99
|
+
const parts = toParts(dateObj, opts2);
|
|
100
|
+
const part2 = parts.find((p) => p.type === type);
|
|
101
|
+
return part2 ? part2.value : "";
|
|
102
|
+
}
|
|
103
|
+
return {
|
|
104
|
+
setLocale,
|
|
105
|
+
getLocale,
|
|
106
|
+
fullMonth,
|
|
107
|
+
fullYear,
|
|
108
|
+
fullMonthAndYear,
|
|
109
|
+
toParts,
|
|
110
|
+
custom,
|
|
111
|
+
part,
|
|
112
|
+
dayPeriod,
|
|
113
|
+
selectedDate,
|
|
114
|
+
dayOfWeek,
|
|
115
|
+
getMonths
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
export {
|
|
119
|
+
useDateFormatter
|
|
120
|
+
};
|
|
121
|
+
//# sourceMappingURL=useDateFormatter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDateFormatter.js","sources":["../../src/shared/useDateFormatter.ts"],"sourcesContent":["/*\n * Implementation ported from https://github.com/melt-ui/melt-ui/blob/develop/src/lib/internal/helpers/date/formatter.ts\n */\n\nimport type { DateValue, ZonedDateTime } from \"@internationalized/date\";\nimport {\n DateFormatter,\n getLocalTimeZone,\n today,\n} from \"@internationalized/date\";\nimport { ref } from \"vue\";\nimport { hasTime, isZonedDateTime, toDate } from \"../date\";\n\nexport interface DateFormatterOptions extends Intl.DateTimeFormatOptions {\n calendar?: string;\n}\n\nexport type Formatter = {\n getLocale: () => string;\n setLocale: (newLocale: string) => void;\n custom: (date: Date, options: DateFormatterOptions) => string;\n selectedDate: (date: DateValue, includeTime?: boolean) => string;\n dayOfWeek: (date: Date, length?: DateFormatterOptions[\"weekday\"]) => string;\n fullMonthAndYear: (date: Date, options?: DateFormatterOptions) => string;\n fullMonth: (date: Date, options?: DateFormatterOptions) => string;\n fullYear: (date: Date, options?: DateFormatterOptions) => string;\n dayPeriod: (date: Date) => string;\n part: (\n dateObj: DateValue,\n type: Intl.DateTimeFormatPartTypes,\n options?: DateFormatterOptions,\n ) => string;\n toParts: (\n date: DateValue,\n options?: DateFormatterOptions,\n ) => Intl.DateTimeFormatPart[];\n getMonths: () => { label: string; value: number }[];\n};\n\n/**\n * Creates a wrapper around the `DateFormatter`, which is\n * an improved version of the {@link Intl.DateTimeFormat} API,\n * that is used internally by the various date builders to\n * easily format dates in a consistent way.\n *\n * @see [DateFormatter](https://react-spectrum.adobe.com/internationalized/date/DateFormatter.html)\n */\nexport function useDateFormatter(\n initialLocale: string,\n opts: DateFormatterOptions = {},\n): Formatter {\n const locale = ref(initialLocale);\n\n function getLocale() {\n return locale.value;\n }\n\n function setLocale(newLocale: string) {\n locale.value = newLocale;\n }\n\n function custom(date: Date, options: DateFormatterOptions) {\n return new DateFormatter(locale.value, { ...opts, ...options }).format(\n date,\n );\n }\n\n function selectedDate(date: DateValue, includeTime = true) {\n if (hasTime(date) && includeTime) {\n return custom(toDate(date), {\n dateStyle: \"long\",\n timeStyle: \"long\",\n });\n } else {\n return custom(toDate(date), {\n dateStyle: \"long\",\n });\n }\n }\n\n function fullMonthAndYear(date: Date, options: DateFormatterOptions = {}) {\n return new DateFormatter(locale.value, {\n ...opts,\n month: \"long\",\n year: \"numeric\",\n ...options,\n }).format(date);\n }\n\n function fullMonth(date: Date, options: DateFormatterOptions = {}) {\n return new DateFormatter(locale.value, {\n ...opts,\n month: \"long\",\n ...options,\n }).format(date);\n }\n\n function getMonths() {\n const defaultDate = today(getLocalTimeZone());\n const months = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];\n return months.map((item) => ({\n label: fullMonth(toDate(defaultDate.set({ month: item }))),\n value: item,\n }));\n }\n\n function fullYear(date: Date, options: DateFormatterOptions = {}) {\n return new DateFormatter(locale.value, {\n ...opts,\n year: \"numeric\",\n ...options,\n }).format(date);\n }\n\n function toParts(date: DateValue, options?: DateFormatterOptions) {\n if (isZonedDateTime(date)) {\n return new DateFormatter(locale.value, {\n ...opts,\n ...options,\n timeZone: (date as ZonedDateTime).timeZone,\n }).formatToParts(toDate(date));\n } else {\n return new DateFormatter(locale.value, {\n ...opts,\n ...options,\n }).formatToParts(toDate(date));\n }\n }\n\n function dayOfWeek(\n date: Date,\n length: DateFormatterOptions[\"weekday\"] = \"narrow\",\n ) {\n return new DateFormatter(locale.value, { ...opts, weekday: length }).format(\n date,\n );\n }\n\n function dayPeriod(date: Date) {\n const parts = new DateFormatter(locale.value, {\n ...opts,\n hour: \"numeric\",\n minute: \"numeric\",\n }).formatToParts(date);\n const value = parts.find((p) => p.type === \"dayPeriod\")?.value;\n // Day period can be \"AM\"/\"PM\" or \"a.m.\"/\"p.m.\" in some locales\n if (value === \"PM\" || value === \"p.m.\") return \"PM\";\n\n return \"AM\";\n }\n\n const defaultPartOptions: DateFormatterOptions = {\n year: \"numeric\",\n month: \"numeric\",\n day: \"numeric\",\n hour: \"numeric\",\n minute: \"numeric\",\n second: \"numeric\",\n };\n\n function part(\n dateObj: DateValue,\n type: Intl.DateTimeFormatPartTypes,\n options: DateFormatterOptions = {},\n ) {\n const opts = { ...defaultPartOptions, ...options };\n const parts = toParts(dateObj, opts);\n const part = parts.find((p) => p.type === type);\n return part ? part.value : \"\";\n }\n\n return {\n setLocale,\n getLocale,\n fullMonth,\n fullYear,\n fullMonthAndYear,\n toParts,\n custom,\n part,\n dayPeriod,\n selectedDate,\n dayOfWeek,\n getMonths,\n };\n}\n"],"names":["DateFormatter","today","getLocalTimeZone","opts","part"],"mappings":";;;;AA+CO,SAAS,iBACd,eACA,OAA6B,IAClB;AACX,QAAM,SAAS,IAAI,aAAa;AAEhC,WAAS,YAAY;AACnB,WAAO,OAAO;AAAA,EAChB;AAEA,WAAS,UAAU,WAAmB;AACpC,WAAO,QAAQ;AAAA,EACjB;AAEA,WAAS,OAAO,MAAY,SAA+B;AACzD,WAAO,IAAIA,0CAAc,OAAO,OAAO,EAAE,GAAG,MAAM,GAAG,QAAA,CAAS,EAAE;AAAA,MAC9D;AAAA,IAAA;AAAA,EAEJ;AAEA,WAAS,aAAa,MAAiB,cAAc,MAAM;AACzD,QAAI,QAAQ,IAAI,KAAK,aAAa;AAChC,aAAO,OAAO,OAAO,IAAI,GAAG;AAAA,QAC1B,WAAW;AAAA,QACX,WAAW;AAAA,MAAA,CACZ;AAAA,IACH,OAAO;AACL,aAAO,OAAO,OAAO,IAAI,GAAG;AAAA,QAC1B,WAAW;AAAA,MAAA,CACZ;AAAA,IACH;AAAA,EACF;AAEA,WAAS,iBAAiB,MAAY,UAAgC,IAAI;AACxE,WAAO,IAAIA,0CAAc,OAAO,OAAO;AAAA,MACrC,GAAG;AAAA,MACH,OAAO;AAAA,MACP,MAAM;AAAA,MACN,GAAG;AAAA,IAAA,CACJ,EAAE,OAAO,IAAI;AAAA,EAChB;AAEA,WAAS,UAAU,MAAY,UAAgC,IAAI;AACjE,WAAO,IAAIA,0CAAc,OAAO,OAAO;AAAA,MACrC,GAAG;AAAA,MACH,OAAO;AAAA,M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AAI;AACrB,UAAM,QAAQ,MAAM,KAAK,CAAC,MAAM,EAAE,SAAS,WAAW,GAAG;AAEzD,QAAI,UAAU,QAAQ,UAAU,OAAQ,QAAO;AAE/C,WAAO;AAAA,EACT;AAEA,QAAM,qBAA2C;AAAA,IAC/C,MAAM;AAAA,IACN,OAAO;AAAA,IACP,KAAK;AAAA,IACL,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,QAAQ;AAAA,EAAA;AAGV,WAAS,KACP,SACA,MACA,UAAgC,CAAA,GAChC;AACA,UAAMG,QAAO,EAAE,GAAG,oBAAoB,GAAG,QAAA;AACzC,UAAM,QAAQ,QAAQ,SAASA,KAAI;AACnC,UAAMC,QAAO,MAAM,KAAK,CAAC,MAAM,EAAE,SAAS,IAAI;AAC9C,WAAOA,QAAOA,MAAK,QAAQ;AAAA,EAC7B;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA;AAEJ;"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
import { Direction } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* The `useDirection` function provides a way to access the current direction in your application.
|
|
5
|
+
* @param {Ref<Direction | undefined>} [dir] - An optional ref containing the direction (ltr or rtl).
|
|
6
|
+
* @returns computed value that combines with the resolved direction.
|
|
7
|
+
*/
|
|
8
|
+
export declare function useDirection(dir?: Ref<Direction | undefined>): import('vue').ComputedRef<Direction>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ref, computed } from "vue";
|
|
2
|
+
import { injectConfigProviderContext } from "../components/ConfigProvider/ConfigProvider.vue.js";
|
|
3
|
+
function useDirection(dir) {
|
|
4
|
+
const context = injectConfigProviderContext({
|
|
5
|
+
dir: ref("ltr")
|
|
6
|
+
});
|
|
7
|
+
return computed(() => dir?.value || context.dir?.value || "ltr");
|
|
8
|
+
}
|
|
9
|
+
export {
|
|
10
|
+
useDirection
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=useDirection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDirection.js","sources":["../../src/shared/useDirection.ts"],"sourcesContent":["import type { Ref } from \"vue\";\nimport type { Direction } from \"./types\";\nimport { computed, ref } from \"vue\";\nimport { injectConfigProviderContext } from \"../components/ConfigProvider/ConfigProvider.vue\";\n\n/**\n * The `useDirection` function provides a way to access the current direction in your application.\n * @param {Ref<Direction | undefined>} [dir] - An optional ref containing the direction (ltr or rtl).\n * @returns computed value that combines with the resolved direction.\n */\nexport function useDirection(dir?: Ref<Direction | undefined>) {\n const context = injectConfigProviderContext({\n dir: ref(\"ltr\"),\n });\n return computed(() => dir?.value || context.dir?.value || \"ltr\");\n}\n"],"names":[],"mappings":";;AAUO,SAAS,aAAa,KAAkC;AAC7D,QAAM,UAAU,4BAA4B;AAAA,IAC1C,KAAK,IAAI,KAAK;AAAA,EAAA,CACf;AACD,SAAO,SAAS,MAAM,KAAK,SAAS,QAAQ,KAAK,SAAS,KAAK;AACjE;"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `useEmitAsProps` function is a TypeScript utility that converts emitted events into props for a
|
|
3
|
+
* Vue component.
|
|
4
|
+
* @param emit - The `emit` parameter is a function that is used to emit events from a component. It
|
|
5
|
+
* takes two parameters: `name` which is the name of the event to be emitted, and `...args` which are
|
|
6
|
+
* the arguments to be passed along with the event.
|
|
7
|
+
* @returns The function `useEmitAsProps` returns an object that maps event names to functions that
|
|
8
|
+
* call the `emit` function with the corresponding event name and arguments.
|
|
9
|
+
*/
|
|
10
|
+
export declare function useEmitAsProps<Name extends string>(emit: (name: Name, ...args: any[]) => void): Record<string, any>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { getCurrentInstance, toHandlerKey, camelize } from "vue";
|
|
2
|
+
function useEmitAsProps(emit) {
|
|
3
|
+
const vm = getCurrentInstance();
|
|
4
|
+
const events = vm?.type.emits;
|
|
5
|
+
const result = {};
|
|
6
|
+
if (!events?.length) {
|
|
7
|
+
console.warn(
|
|
8
|
+
`No emitted event found. Please check component: ${vm?.type.__name}`
|
|
9
|
+
);
|
|
10
|
+
}
|
|
11
|
+
events?.forEach((ev) => {
|
|
12
|
+
result[toHandlerKey(camelize(ev))] = (...arg) => emit(ev, ...arg);
|
|
13
|
+
});
|
|
14
|
+
return result;
|
|
15
|
+
}
|
|
16
|
+
export {
|
|
17
|
+
useEmitAsProps
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=useEmitAsProps.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useEmitAsProps.js","sources":["../../src/shared/useEmitAsProps.ts"],"sourcesContent":["import { camelize, getCurrentInstance, toHandlerKey } from 'vue'\n\n// Vue doesn't have emits forwarding, in order to bind the emits we have to convert events into `onXXX` handlers\n// issue: https://github.com/vuejs/core/issues/5917\n/**\n * The `useEmitAsProps` function is a TypeScript utility that converts emitted events into props for a\n * Vue component.\n * @param emit - The `emit` parameter is a function that is used to emit events from a component. It\n * takes two parameters: `name` which is the name of the event to be emitted, and `...args` which are\n * the arguments to be passed along with the event.\n * @returns The function `useEmitAsProps` returns an object that maps event names to functions that\n * call the `emit` function with the corresponding event name and arguments.\n */\nexport function useEmitAsProps<Name extends string>(\n emit: (name: Name, ...args: any[]) => void,\n) {\n const vm = getCurrentInstance()\n\n const events = vm?.type.emits as Name[]\n const result: Record<string, any> = {}\n\n if (!events?.length) {\n console.warn(\n `No emitted event found. Please check component: ${vm?.type.__name}`,\n )\n }\n\n events?.forEach((ev) => {\n result[toHandlerKey(camelize(ev))] = (...arg: any) => emit(ev, ...arg)\n })\n return result\n}\n"],"names":[],"mappings":";AAaO,SAAS,eACd,MACA;AACA,QAAM,KAAK,mBAAA;AAEX,QAAM,SAAS,IAAI,KAAK;AACxB,QAAM,SAA8B,CAAA;AAEpC,MAAI,CAAC,QAAQ,QAAQ;AACnB,YAAQ;AAAA,MACN,mDAAmD,IAAI,KAAK,MAAM;AAAA,IAAA;AAAA,EAEtE;AAEA,UAAQ,QAAQ,CAAC,OAAO;AACtB,WAAO,aAAa,SAAS,EAAE,CAAC,CAAC,IAAI,IAAI,QAAa,KAAK,IAAI,GAAG,GAAG;AAAA,EACvE,CAAC;AACD,SAAO;AACT;"}
|