@rupe/v-datepicker 1.0.0-alpha.0 → 1.0.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Calendar/CalendarCell.vue.d.ts +18 -0
- package/dist/components/Calendar/{CalendarCellTrigger.d.ts → CalendarCellTrigger.vue.d.ts} +15 -14
- package/dist/components/Calendar/CalendarGrid.vue.d.ts +14 -0
- package/dist/components/Calendar/CalendarGridBody.vue.d.ts +14 -0
- package/dist/components/Calendar/CalendarGridHead.vue.d.ts +14 -0
- package/dist/components/Calendar/CalendarGridRow.vue.d.ts +14 -0
- package/dist/components/Calendar/CalendarHeadCell.vue.d.ts +14 -0
- package/dist/components/Calendar/CalendarHeader.vue.d.ts +14 -0
- package/dist/components/Calendar/CalendarHeading.vue.d.ts +22 -0
- package/dist/components/Calendar/CalendarMonthHeading.vue.d.ts +23 -0
- package/dist/components/Calendar/{CalendarMonthYearOverlay.d.ts → CalendarMonthYearOverlay.vue.d.ts} +5 -3
- package/dist/components/Calendar/{CalendarNext.d.ts → CalendarNext.vue.d.ts} +5 -4
- package/dist/components/Calendar/{CalendarOverlayItem.d.ts → CalendarOverlayItem.vue.d.ts} +5 -4
- package/dist/components/Calendar/{CalendarPrev.d.ts → CalendarPrev.vue.d.ts} +5 -4
- package/dist/components/Calendar/{CalendarRoot.d.ts → CalendarRoot.vue.d.ts} +16 -16
- package/dist/components/Calendar/CalendarYearHeading.vue.d.ts +23 -0
- package/dist/components/Calendar/index.d.ts +15 -15
- package/dist/components/Calendar/useCalendar.d.ts +12 -11
- package/dist/components/ConfigProvider/{ConfigProvider.d.ts → ConfigProvider.vue.d.ts} +3 -3
- package/dist/components/ConfigProvider/index.d.ts +1 -1
- package/dist/components/DateField/DateFieldInput.vue.d.ts +16 -0
- package/dist/components/DateField/{DateFieldRoot.d.ts → DateFieldRoot.vue.d.ts} +16 -16
- package/dist/components/DateField/index.d.ts +2 -2
- package/dist/components/DatePicker/DatePickerAnchor.vue.d.ts +13 -0
- package/dist/components/DatePicker/DatePickerArrow.vue.d.ts +13 -0
- package/dist/components/DatePicker/DatePickerCalendar.vue.d.ts +19 -0
- package/dist/components/DatePicker/DatePickerCell.vue.d.ts +12 -0
- package/dist/components/DatePicker/DatePickerCellTrigger.vue.d.ts +11 -0
- package/dist/components/DatePicker/DatePickerClose.vue.d.ts +13 -0
- package/dist/components/DatePicker/DatePickerContent.vue.d.ts +33 -0
- package/dist/components/DatePicker/DatePickerField.vue.d.ts +18 -0
- package/dist/components/DatePicker/DatePickerGrid.vue.d.ts +13 -0
- package/dist/components/DatePicker/DatePickerGridBody.vue.d.ts +13 -0
- package/dist/components/DatePicker/DatePickerGridHead.vue.d.ts +13 -0
- package/dist/components/DatePicker/DatePickerGridRow.vue.d.ts +13 -0
- package/dist/components/DatePicker/DatePickerHeadCell.vue.d.ts +13 -0
- package/dist/components/DatePicker/DatePickerHeader.vue.d.ts +13 -0
- package/dist/components/DatePicker/{DatePickerHeading.d.ts → DatePickerHeading.vue.d.ts} +3 -1
- package/dist/components/DatePicker/DatePickerInput.vue.d.ts +12 -0
- package/dist/components/DatePicker/DatePickerMonthHeading.vue.d.ts +14 -0
- package/dist/components/DatePicker/{DatePickerMonthYearOverlay.d.ts → DatePickerMonthYearOverlay.vue.d.ts} +4 -2
- package/dist/components/DatePicker/DatePickerNext.vue.d.ts +11 -0
- package/dist/components/DatePicker/{DatePickerOverlayItem.d.ts → DatePickerOverlayItem.vue.d.ts} +3 -2
- package/dist/components/DatePicker/DatePickerPrev.vue.d.ts +11 -0
- package/dist/components/DatePicker/{DatePickerRoot.d.ts → DatePickerRoot.vue.d.ts} +4 -4
- package/dist/components/DatePicker/DatePickerTrigger.vue.d.ts +13 -0
- package/dist/components/DatePicker/DatePickerYearHeading.vue.d.ts +14 -0
- package/dist/components/DatePicker/index.d.ts +24 -24
- package/dist/components/DismissableLayer/{DismissableLayer.d.ts → DismissableLayer.vue.d.ts} +4 -3
- package/dist/components/DismissableLayer/DismissableLayerBranch.vue.d.ts +12 -0
- package/dist/components/DismissableLayer/index.d.ts +2 -2
- package/dist/components/FocusScope/{FocusScope.d.ts → FocusScope.vue.d.ts} +15 -14
- package/dist/components/FocusScope/index.d.ts +1 -1
- package/dist/components/Popover/PopoverAnchor.vue.d.ts +12 -0
- package/dist/components/Popover/PopoverArrow.vue.d.ts +17 -0
- package/dist/components/Popover/PopoverClose.vue.d.ts +14 -0
- package/dist/components/Popover/PopoverContent.vue.d.ts +34 -0
- package/dist/components/Popover/{PopoverContentImpl.d.ts → PopoverContentImpl.vue.d.ts} +11 -10
- package/dist/components/Popover/PopoverContentNonModal.vue.d.ts +34 -0
- package/dist/components/Popover/PopoverPortal.vue.d.ts +12 -0
- package/dist/components/Popover/{PopoverRoot.d.ts → PopoverRoot.vue.d.ts} +4 -4
- package/dist/components/Popover/PopoverTrigger.vue.d.ts +14 -0
- package/dist/components/Popover/index.d.ts +7 -7
- package/dist/components/Popper/{PopperAnchor.d.ts → PopperAnchor.vue.d.ts} +2 -1
- package/dist/components/Popper/PopperArrow.vue.d.ts +16 -0
- package/dist/components/Popper/{PopperContent.d.ts → PopperContent.vue.d.ts} +4 -4
- package/dist/components/Popper/{PopperRoot.d.ts → PopperRoot.vue.d.ts} +2 -2
- package/dist/components/Popper/index.d.ts +4 -4
- package/dist/components/Presence/Presence.d.ts +5 -5
- package/dist/components/Presence/usePresence.d.ts +2 -2
- package/dist/components/Primitive/Primitive.d.ts +5 -5
- package/dist/components/Primitive/Slot.d.ts +4 -3
- package/dist/components/Primitive/usePrimitiveElement.d.ts +3 -3
- package/dist/components/Teleport/{Teleport.d.ts → Teleport.vue.d.ts} +3 -2
- package/dist/components/Teleport/index.d.ts +1 -1
- package/dist/components/VisuallyHidden/VisuallyHidden.vue.d.ts +17 -0
- package/dist/components/VisuallyHidden/{VisuallyHiddenInput.d.ts → VisuallyHiddenInput.vue.d.ts} +5 -4
- package/dist/components/VisuallyHidden/{VisuallyHiddenInputBubble.d.ts → VisuallyHiddenInputBubble.vue.d.ts} +5 -4
- package/dist/components/VisuallyHidden/index.d.ts +2 -2
- package/dist/index.cjs +1662 -5525
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +553 -25
- package/dist/index.mjs +5218 -0
- package/dist/index.mjs.map +1 -0
- package/dist/shared/component/{Arrow.d.ts → Arrow.vue.d.ts} +5 -4
- package/dist/shared/component/{BaseSeparator.d.ts → BaseSeparator.vue.d.ts} +3 -2
- package/dist/shared/component/index.d.ts +2 -2
- package/dist/shared/date/useDateField.d.ts +2 -2
- package/dist/shared/useDirection.d.ts +2 -2
- package/dist/shared/useForwardExpose.d.ts +3 -3
- package/dist/shared/useForwardProps.d.ts +2 -2
- package/dist/shared/useForwardPropsEmits.d.ts +2 -2
- package/dist/shared/useIsUsingKeyboard.d.ts +2 -1
- package/dist/shared/useLocale.d.ts +2 -2
- package/dist/shared/useNonce.d.ts +2 -2
- package/dist/shared/useSize.d.ts +3 -2
- package/package.json +10 -5
- package/src/index.ts +3 -26
- package/dist/components/Calendar/CalendarCell.d.ts +0 -17
- package/dist/components/Calendar/CalendarCell.vue.js +0 -34
- package/dist/components/Calendar/CalendarCell.vue.js.map +0 -1
- package/dist/components/Calendar/CalendarCell.vue2.js +0 -5
- package/dist/components/Calendar/CalendarCell.vue2.js.map +0 -1
- package/dist/components/Calendar/CalendarCellTrigger.vue.js +0 -159
- package/dist/components/Calendar/CalendarCellTrigger.vue.js.map +0 -1
- package/dist/components/Calendar/CalendarCellTrigger.vue2.js +0 -5
- package/dist/components/Calendar/CalendarCellTrigger.vue2.js.map +0 -1
- package/dist/components/Calendar/CalendarGrid.d.ts +0 -13
- package/dist/components/Calendar/CalendarGrid.vue.js +0 -40
- package/dist/components/Calendar/CalendarGrid.vue.js.map +0 -1
- package/dist/components/Calendar/CalendarGrid.vue2.js +0 -5
- package/dist/components/Calendar/CalendarGrid.vue2.js.map +0 -1
- package/dist/components/Calendar/CalendarGridBody.d.ts +0 -13
- package/dist/components/Calendar/CalendarGridBody.vue.js +0 -25
- package/dist/components/Calendar/CalendarGridBody.vue.js.map +0 -1
- package/dist/components/Calendar/CalendarGridBody.vue2.js +0 -5
- package/dist/components/Calendar/CalendarGridBody.vue2.js.map +0 -1
- package/dist/components/Calendar/CalendarGridHead.d.ts +0 -13
- package/dist/components/Calendar/CalendarGridHead.vue.js +0 -25
- package/dist/components/Calendar/CalendarGridHead.vue.js.map +0 -1
- package/dist/components/Calendar/CalendarGridHead.vue2.js +0 -5
- package/dist/components/Calendar/CalendarGridHead.vue2.js.map +0 -1
- package/dist/components/Calendar/CalendarGridRow.d.ts +0 -13
- package/dist/components/Calendar/CalendarGridRow.vue.js +0 -25
- package/dist/components/Calendar/CalendarGridRow.vue.js.map +0 -1
- package/dist/components/Calendar/CalendarGridRow.vue2.js +0 -5
- package/dist/components/Calendar/CalendarGridRow.vue2.js.map +0 -1
- package/dist/components/Calendar/CalendarHeadCell.d.ts +0 -13
- package/dist/components/Calendar/CalendarHeadCell.vue.js +0 -25
- package/dist/components/Calendar/CalendarHeadCell.vue.js.map +0 -1
- package/dist/components/Calendar/CalendarHeadCell.vue2.js +0 -5
- package/dist/components/Calendar/CalendarHeadCell.vue2.js.map +0 -1
- package/dist/components/Calendar/CalendarHeader.d.ts +0 -13
- package/dist/components/Calendar/CalendarHeader.vue.js +0 -25
- package/dist/components/Calendar/CalendarHeader.vue.js.map +0 -1
- package/dist/components/Calendar/CalendarHeader.vue2.js +0 -5
- package/dist/components/Calendar/CalendarHeader.vue2.js.map +0 -1
- package/dist/components/Calendar/CalendarHeading.d.ts +0 -21
- package/dist/components/Calendar/CalendarHeading.vue.js +0 -33
- package/dist/components/Calendar/CalendarHeading.vue.js.map +0 -1
- package/dist/components/Calendar/CalendarHeading.vue2.js +0 -5
- package/dist/components/Calendar/CalendarHeading.vue2.js.map +0 -1
- package/dist/components/Calendar/CalendarMonthHeading.d.ts +0 -22
- package/dist/components/Calendar/CalendarMonthHeading.vue.js +0 -49
- package/dist/components/Calendar/CalendarMonthHeading.vue.js.map +0 -1
- package/dist/components/Calendar/CalendarMonthHeading.vue2.js +0 -5
- package/dist/components/Calendar/CalendarMonthHeading.vue2.js.map +0 -1
- package/dist/components/Calendar/CalendarMonthYearOverlay.vue.js +0 -61
- package/dist/components/Calendar/CalendarMonthYearOverlay.vue.js.map +0 -1
- package/dist/components/Calendar/CalendarMonthYearOverlay.vue2.js +0 -5
- package/dist/components/Calendar/CalendarMonthYearOverlay.vue2.js.map +0 -1
- package/dist/components/Calendar/CalendarNext.vue.js +0 -42
- package/dist/components/Calendar/CalendarNext.vue.js.map +0 -1
- package/dist/components/Calendar/CalendarNext.vue2.js +0 -5
- package/dist/components/Calendar/CalendarNext.vue2.js.map +0 -1
- package/dist/components/Calendar/CalendarOverlayItem.vue.js +0 -34
- package/dist/components/Calendar/CalendarOverlayItem.vue.js.map +0 -1
- package/dist/components/Calendar/CalendarOverlayItem.vue2.js +0 -5
- package/dist/components/Calendar/CalendarOverlayItem.vue2.js.map +0 -1
- package/dist/components/Calendar/CalendarPrev.vue.js +0 -42
- package/dist/components/Calendar/CalendarPrev.vue.js.map +0 -1
- package/dist/components/Calendar/CalendarPrev.vue2.js +0 -5
- package/dist/components/Calendar/CalendarPrev.vue2.js.map +0 -1
- package/dist/components/Calendar/CalendarRoot.vue.js +0 -253
- package/dist/components/Calendar/CalendarRoot.vue.js.map +0 -1
- package/dist/components/Calendar/CalendarRoot.vue2.js +0 -8
- package/dist/components/Calendar/CalendarRoot.vue2.js.map +0 -1
- package/dist/components/Calendar/CalendarYearHeading.d.ts +0 -22
- package/dist/components/Calendar/CalendarYearHeading.vue.js +0 -49
- package/dist/components/Calendar/CalendarYearHeading.vue.js.map +0 -1
- package/dist/components/Calendar/CalendarYearHeading.vue2.js +0 -5
- package/dist/components/Calendar/CalendarYearHeading.vue2.js.map +0 -1
- package/dist/components/Calendar/useCalendar.js +0 -317
- package/dist/components/Calendar/useCalendar.js.map +0 -1
- package/dist/components/ConfigProvider/ConfigProvider.vue.js +0 -7
- package/dist/components/ConfigProvider/ConfigProvider.vue.js.map +0 -1
- package/dist/components/DateField/DateFieldInput.d.ts +0 -15
- package/dist/components/DateField/DateFieldInput.vue.js +0 -70
- package/dist/components/DateField/DateFieldInput.vue.js.map +0 -1
- package/dist/components/DateField/DateFieldInput.vue2.js +0 -5
- package/dist/components/DateField/DateFieldInput.vue2.js.map +0 -1
- package/dist/components/DateField/DateFieldRoot.vue.js +0 -237
- package/dist/components/DateField/DateFieldRoot.vue.js.map +0 -1
- package/dist/components/DateField/DateFieldRoot.vue2.js +0 -8
- package/dist/components/DateField/DateFieldRoot.vue2.js.map +0 -1
- package/dist/components/DatePicker/DatePickerAnchor.d.ts +0 -11
- package/dist/components/DatePicker/DatePickerAnchor.vue.js +0 -29
- package/dist/components/DatePicker/DatePickerAnchor.vue.js.map +0 -1
- package/dist/components/DatePicker/DatePickerAnchor.vue2.js +0 -5
- package/dist/components/DatePicker/DatePickerAnchor.vue2.js.map +0 -1
- package/dist/components/DatePicker/DatePickerArrow.d.ts +0 -11
- package/dist/components/DatePicker/DatePickerArrow.vue.js +0 -31
- package/dist/components/DatePicker/DatePickerArrow.vue.js.map +0 -1
- package/dist/components/DatePicker/DatePickerArrow.vue2.js +0 -5
- package/dist/components/DatePicker/DatePickerArrow.vue2.js.map +0 -1
- package/dist/components/DatePicker/DatePickerCalendar.d.ts +0 -17
- package/dist/components/DatePicker/DatePickerCalendar.vue.js +0 -60
- package/dist/components/DatePicker/DatePickerCalendar.vue.js.map +0 -1
- package/dist/components/DatePicker/DatePickerCalendar.vue2.js +0 -5
- package/dist/components/DatePicker/DatePickerCalendar.vue2.js.map +0 -1
- package/dist/components/DatePicker/DatePickerCell.d.ts +0 -11
- package/dist/components/DatePicker/DatePickerCell.vue.js +0 -28
- package/dist/components/DatePicker/DatePickerCell.vue.js.map +0 -1
- package/dist/components/DatePicker/DatePickerCell.vue2.js +0 -5
- package/dist/components/DatePicker/DatePickerCell.vue2.js.map +0 -1
- package/dist/components/DatePicker/DatePickerCellTrigger.d.ts +0 -10
- package/dist/components/DatePicker/DatePickerCellTrigger.vue.js +0 -29
- package/dist/components/DatePicker/DatePickerCellTrigger.vue.js.map +0 -1
- package/dist/components/DatePicker/DatePickerCellTrigger.vue2.js +0 -5
- package/dist/components/DatePicker/DatePickerCellTrigger.vue2.js.map +0 -1
- package/dist/components/DatePicker/DatePickerClose.d.ts +0 -11
- package/dist/components/DatePicker/DatePickerClose.vue.js +0 -28
- package/dist/components/DatePicker/DatePickerClose.vue.js.map +0 -1
- package/dist/components/DatePicker/DatePickerClose.vue2.js +0 -5
- package/dist/components/DatePicker/DatePickerClose.vue2.js.map +0 -1
- package/dist/components/DatePicker/DatePickerContent.d.ts +0 -31
- package/dist/components/DatePicker/DatePickerContent.vue.js +0 -69
- package/dist/components/DatePicker/DatePickerContent.vue.js.map +0 -1
- package/dist/components/DatePicker/DatePickerContent.vue2.js +0 -5
- package/dist/components/DatePicker/DatePickerContent.vue2.js.map +0 -1
- package/dist/components/DatePicker/DatePickerField.d.ts +0 -16
- package/dist/components/DatePicker/DatePickerField.vue.js +0 -55
- package/dist/components/DatePicker/DatePickerField.vue.js.map +0 -1
- package/dist/components/DatePicker/DatePickerField.vue2.js +0 -5
- package/dist/components/DatePicker/DatePickerField.vue2.js.map +0 -1
- package/dist/components/DatePicker/DatePickerGrid.d.ts +0 -11
- package/dist/components/DatePicker/DatePickerGrid.vue.js +0 -27
- package/dist/components/DatePicker/DatePickerGrid.vue.js.map +0 -1
- package/dist/components/DatePicker/DatePickerGrid.vue2.js +0 -5
- package/dist/components/DatePicker/DatePickerGrid.vue2.js.map +0 -1
- package/dist/components/DatePicker/DatePickerGridBody.d.ts +0 -11
- package/dist/components/DatePicker/DatePickerGridBody.vue.js +0 -27
- package/dist/components/DatePicker/DatePickerGridBody.vue.js.map +0 -1
- package/dist/components/DatePicker/DatePickerGridBody.vue2.js +0 -5
- package/dist/components/DatePicker/DatePickerGridBody.vue2.js.map +0 -1
- package/dist/components/DatePicker/DatePickerGridHead.d.ts +0 -11
- package/dist/components/DatePicker/DatePickerGridHead.vue.js +0 -27
- package/dist/components/DatePicker/DatePickerGridHead.vue.js.map +0 -1
- package/dist/components/DatePicker/DatePickerGridHead.vue2.js +0 -5
- package/dist/components/DatePicker/DatePickerGridHead.vue2.js.map +0 -1
- package/dist/components/DatePicker/DatePickerGridRow.d.ts +0 -11
- package/dist/components/DatePicker/DatePickerGridRow.vue.js +0 -27
- package/dist/components/DatePicker/DatePickerGridRow.vue.js.map +0 -1
- package/dist/components/DatePicker/DatePickerGridRow.vue2.js +0 -5
- package/dist/components/DatePicker/DatePickerGridRow.vue2.js.map +0 -1
- package/dist/components/DatePicker/DatePickerHeadCell.d.ts +0 -11
- package/dist/components/DatePicker/DatePickerHeadCell.vue.js +0 -27
- package/dist/components/DatePicker/DatePickerHeadCell.vue.js.map +0 -1
- package/dist/components/DatePicker/DatePickerHeadCell.vue2.js +0 -5
- package/dist/components/DatePicker/DatePickerHeadCell.vue2.js.map +0 -1
- package/dist/components/DatePicker/DatePickerHeader.d.ts +0 -11
- package/dist/components/DatePicker/DatePickerHeader.vue.js +0 -27
- package/dist/components/DatePicker/DatePickerHeader.vue.js.map +0 -1
- package/dist/components/DatePicker/DatePickerHeader.vue2.js +0 -5
- package/dist/components/DatePicker/DatePickerHeader.vue2.js.map +0 -1
- package/dist/components/DatePicker/DatePickerHeading.vue.js +0 -29
- package/dist/components/DatePicker/DatePickerHeading.vue.js.map +0 -1
- package/dist/components/DatePicker/DatePickerHeading.vue2.js +0 -5
- package/dist/components/DatePicker/DatePickerHeading.vue2.js.map +0 -1
- package/dist/components/DatePicker/DatePickerInput.d.ts +0 -11
- package/dist/components/DatePicker/DatePickerInput.vue.js +0 -27
- package/dist/components/DatePicker/DatePickerInput.vue.js.map +0 -1
- package/dist/components/DatePicker/DatePickerInput.vue2.js +0 -5
- package/dist/components/DatePicker/DatePickerInput.vue2.js.map +0 -1
- package/dist/components/DatePicker/DatePickerMonthHeading.d.ts +0 -13
- package/dist/components/DatePicker/DatePickerMonthHeading.vue.js +0 -27
- package/dist/components/DatePicker/DatePickerMonthHeading.vue.js.map +0 -1
- package/dist/components/DatePicker/DatePickerMonthHeading.vue2.js +0 -5
- package/dist/components/DatePicker/DatePickerMonthHeading.vue2.js.map +0 -1
- package/dist/components/DatePicker/DatePickerMonthYearOverlay.vue.js +0 -30
- package/dist/components/DatePicker/DatePickerMonthYearOverlay.vue.js.map +0 -1
- package/dist/components/DatePicker/DatePickerMonthYearOverlay.vue2.js +0 -5
- package/dist/components/DatePicker/DatePickerMonthYearOverlay.vue2.js.map +0 -1
- package/dist/components/DatePicker/DatePickerNext.d.ts +0 -10
- package/dist/components/DatePicker/DatePickerNext.vue.js +0 -28
- package/dist/components/DatePicker/DatePickerNext.vue.js.map +0 -1
- package/dist/components/DatePicker/DatePickerNext.vue2.js +0 -5
- package/dist/components/DatePicker/DatePickerNext.vue2.js.map +0 -1
- package/dist/components/DatePicker/DatePickerOverlayItem.vue.js +0 -25
- package/dist/components/DatePicker/DatePickerOverlayItem.vue.js.map +0 -1
- package/dist/components/DatePicker/DatePickerOverlayItem.vue2.js +0 -5
- package/dist/components/DatePicker/DatePickerOverlayItem.vue2.js.map +0 -1
- package/dist/components/DatePicker/DatePickerPrev.d.ts +0 -10
- package/dist/components/DatePicker/DatePickerPrev.vue.js +0 -28
- package/dist/components/DatePicker/DatePickerPrev.vue.js.map +0 -1
- package/dist/components/DatePicker/DatePickerPrev.vue2.js +0 -5
- package/dist/components/DatePicker/DatePickerPrev.vue2.js.map +0 -1
- package/dist/components/DatePicker/DatePickerRoot.vue.js +0 -169
- package/dist/components/DatePicker/DatePickerRoot.vue.js.map +0 -1
- package/dist/components/DatePicker/DatePickerRoot.vue2.js +0 -8
- package/dist/components/DatePicker/DatePickerRoot.vue2.js.map +0 -1
- package/dist/components/DatePicker/DatePickerTrigger.d.ts +0 -11
- package/dist/components/DatePicker/DatePickerTrigger.vue.js +0 -37
- package/dist/components/DatePicker/DatePickerTrigger.vue.js.map +0 -1
- package/dist/components/DatePicker/DatePickerTrigger.vue2.js +0 -5
- package/dist/components/DatePicker/DatePickerTrigger.vue2.js.map +0 -1
- package/dist/components/DatePicker/DatePickerYearHeading.d.ts +0 -13
- package/dist/components/DatePicker/DatePickerYearHeading.vue.js +0 -27
- package/dist/components/DatePicker/DatePickerYearHeading.vue.js.map +0 -1
- package/dist/components/DatePicker/DatePickerYearHeading.vue2.js +0 -5
- package/dist/components/DatePicker/DatePickerYearHeading.vue2.js.map +0 -1
- package/dist/components/DismissableLayer/DismissableLayer.vue.js +0 -118
- package/dist/components/DismissableLayer/DismissableLayer.vue.js.map +0 -1
- package/dist/components/DismissableLayer/DismissableLayer.vue2.js +0 -7
- package/dist/components/DismissableLayer/DismissableLayer.vue2.js.map +0 -1
- package/dist/components/DismissableLayer/DismissableLayerBranch.d.ts +0 -11
- package/dist/components/DismissableLayer/utils.js +0 -112
- package/dist/components/DismissableLayer/utils.js.map +0 -1
- package/dist/components/FocusScope/FocusScope.vue.js +0 -149
- package/dist/components/FocusScope/FocusScope.vue.js.map +0 -1
- package/dist/components/FocusScope/FocusScope.vue2.js +0 -5
- package/dist/components/FocusScope/FocusScope.vue2.js.map +0 -1
- package/dist/components/FocusScope/stack.js +0 -38
- package/dist/components/FocusScope/stack.js.map +0 -1
- package/dist/components/FocusScope/utils.js +0 -70
- package/dist/components/FocusScope/utils.js.map +0 -1
- package/dist/components/Popover/PopoverAnchor.d.ts +0 -11
- package/dist/components/Popover/PopoverAnchor.vue.js +0 -37
- package/dist/components/Popover/PopoverAnchor.vue.js.map +0 -1
- package/dist/components/Popover/PopoverAnchor.vue2.js +0 -5
- package/dist/components/Popover/PopoverAnchor.vue2.js.map +0 -1
- package/dist/components/Popover/PopoverArrow.d.ts +0 -15
- package/dist/components/Popover/PopoverArrow.vue.js +0 -31
- package/dist/components/Popover/PopoverArrow.vue.js.map +0 -1
- package/dist/components/Popover/PopoverArrow.vue2.js +0 -5
- package/dist/components/Popover/PopoverArrow.vue2.js.map +0 -1
- package/dist/components/Popover/PopoverClose.d.ts +0 -13
- package/dist/components/Popover/PopoverClose.vue.js +0 -34
- package/dist/components/Popover/PopoverClose.vue.js.map +0 -1
- package/dist/components/Popover/PopoverClose.vue2.js +0 -5
- package/dist/components/Popover/PopoverClose.vue2.js.map +0 -1
- package/dist/components/Popover/PopoverContent.d.ts +0 -32
- package/dist/components/Popover/PopoverContent.vue.js +0 -61
- package/dist/components/Popover/PopoverContent.vue.js.map +0 -1
- package/dist/components/Popover/PopoverContent.vue2.js +0 -5
- package/dist/components/Popover/PopoverContent.vue2.js.map +0 -1
- package/dist/components/Popover/PopoverContentImpl.vue.js +0 -97
- package/dist/components/Popover/PopoverContentImpl.vue.js.map +0 -1
- package/dist/components/Popover/PopoverContentImpl.vue2.js +0 -5
- package/dist/components/Popover/PopoverContentImpl.vue2.js.map +0 -1
- package/dist/components/Popover/PopoverContentNonModal.d.ts +0 -32
- package/dist/components/Popover/PopoverContentNonModal.vue.js +0 -78
- package/dist/components/Popover/PopoverContentNonModal.vue.js.map +0 -1
- package/dist/components/Popover/PopoverContentNonModal.vue2.js +0 -5
- package/dist/components/Popover/PopoverContentNonModal.vue2.js.map +0 -1
- package/dist/components/Popover/PopoverPortal.d.ts +0 -11
- package/dist/components/Popover/PopoverPortal.vue.js +0 -26
- package/dist/components/Popover/PopoverPortal.vue.js.map +0 -1
- package/dist/components/Popover/PopoverPortal.vue2.js +0 -5
- package/dist/components/Popover/PopoverPortal.vue2.js.map +0 -1
- package/dist/components/Popover/PopoverRoot.vue.js +0 -55
- package/dist/components/Popover/PopoverRoot.vue.js.map +0 -1
- package/dist/components/Popover/PopoverRoot.vue2.js +0 -8
- package/dist/components/Popover/PopoverRoot.vue2.js.map +0 -1
- package/dist/components/Popover/PopoverTrigger.d.ts +0 -13
- package/dist/components/Popover/PopoverTrigger.vue.js +0 -51
- package/dist/components/Popover/PopoverTrigger.vue.js.map +0 -1
- package/dist/components/Popover/PopoverTrigger.vue2.js +0 -5
- package/dist/components/Popover/PopoverTrigger.vue2.js.map +0 -1
- package/dist/components/Popper/PopperAnchor.vue.js +0 -37
- package/dist/components/Popper/PopperAnchor.vue.js.map +0 -1
- package/dist/components/Popper/PopperAnchor.vue2.js +0 -5
- package/dist/components/Popper/PopperAnchor.vue2.js.map +0 -1
- package/dist/components/Popper/PopperArrow.d.ts +0 -15
- package/dist/components/Popper/PopperArrow.vue.js +0 -76
- package/dist/components/Popper/PopperArrow.vue.js.map +0 -1
- package/dist/components/Popper/PopperArrow.vue2.js +0 -5
- package/dist/components/Popper/PopperArrow.vue2.js.map +0 -1
- package/dist/components/Popper/PopperContent.vue.js +0 -9
- package/dist/components/Popper/PopperContent.vue.js.map +0 -1
- package/dist/components/Popper/PopperContent.vue2.js +0 -230
- package/dist/components/Popper/PopperContent.vue2.js.map +0 -1
- package/dist/components/Popper/PopperRoot.vue.js +0 -25
- package/dist/components/Popper/PopperRoot.vue.js.map +0 -1
- package/dist/components/Popper/PopperRoot.vue2.js +0 -8
- package/dist/components/Popper/PopperRoot.vue2.js.map +0 -1
- package/dist/components/Popper/utils.js +0 -46
- package/dist/components/Popper/utils.js.map +0 -1
- package/dist/components/Presence/Presence.js +0 -61
- package/dist/components/Presence/Presence.js.map +0 -1
- package/dist/components/Presence/usePresence.js +0 -131
- package/dist/components/Presence/usePresence.js.map +0 -1
- package/dist/components/Primitive/Primitive.js +0 -29
- package/dist/components/Primitive/Primitive.js.map +0 -1
- package/dist/components/Primitive/Slot.js +0 -30
- package/dist/components/Primitive/Slot.js.map +0 -1
- package/dist/components/Primitive/usePrimitiveElement.js +0 -14
- package/dist/components/Primitive/usePrimitiveElement.js.map +0 -1
- package/dist/components/Teleport/Teleport.vue.js +0 -28
- package/dist/components/Teleport/Teleport.vue.js.map +0 -1
- package/dist/components/Teleport/Teleport.vue2.js +0 -5
- package/dist/components/Teleport/Teleport.vue2.js.map +0 -1
- package/dist/components/VisuallyHidden/VisuallyHidden.d.ts +0 -16
- package/dist/components/VisuallyHidden/VisuallyHidden.vue.js +0 -49
- package/dist/components/VisuallyHidden/VisuallyHidden.vue.js.map +0 -1
- package/dist/components/VisuallyHidden/VisuallyHidden.vue2.js +0 -5
- package/dist/components/VisuallyHidden/VisuallyHidden.vue2.js.map +0 -1
- package/dist/date/calendar.js +0 -90
- package/dist/date/calendar.js.map +0 -1
- package/dist/date/comparators.js +0 -61
- package/dist/date/comparators.js.map +0 -1
- package/dist/date/utils.js +0 -10
- package/dist/date/utils.js.map +0 -1
- package/dist/index.js +0 -54
- package/dist/index.js.map +0 -1
- package/dist/node_modules/.pnpm/@floating-ui_core@1.7.3/node_modules/@floating-ui/core/dist/floating-ui.core.js +0 -722
- package/dist/node_modules/.pnpm/@floating-ui_core@1.7.3/node_modules/@floating-ui/core/dist/floating-ui.core.js.map +0 -1
- package/dist/node_modules/.pnpm/@floating-ui_dom@1.7.4/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +0 -626
- package/dist/node_modules/.pnpm/@floating-ui_dom@1.7.4/node_modules/@floating-ui/dom/dist/floating-ui.dom.js.map +0 -1
- package/dist/node_modules/.pnpm/@floating-ui_utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +0 -174
- package/dist/node_modules/.pnpm/@floating-ui_utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js.map +0 -1
- package/dist/node_modules/.pnpm/@floating-ui_utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +0 -155
- package/dist/node_modules/.pnpm/@floating-ui_utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.js.map +0 -1
- 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 +0 -180
- 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 +0 -1
- package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/BuddhistCalendar.js +0 -34
- package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/BuddhistCalendar.js.map +0 -1
- package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/CalendarDate.js +0 -213
- package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/CalendarDate.js.map +0 -1
- package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/DateFormatter.js +0 -116
- package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/DateFormatter.js.map +0 -1
- package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/EthiopicCalendar.js +0 -129
- package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/EthiopicCalendar.js.map +0 -1
- package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/GregorianCalendar.js +0 -123
- package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/GregorianCalendar.js.map +0 -1
- package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/HebrewCalendar.js +0 -114
- package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/HebrewCalendar.js.map +0 -1
- package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/IndianCalendar.js +0 -77
- package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/IndianCalendar.js.map +0 -1
- package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/IslamicCalendar.js +0 -141
- package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/IslamicCalendar.js.map +0 -1
- package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/JapaneseCalendar.js +0 -155
- package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/JapaneseCalendar.js.map +0 -1
- package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/PersianCalendar.js +0 -59
- package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/PersianCalendar.js.map +0 -1
- package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/TaiwanCalendar.js +0 -59
- package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/TaiwanCalendar.js.map +0 -1
- package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/conversion.js +0 -170
- package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/conversion.js.map +0 -1
- package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/createCalendar.js +0 -44
- package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/createCalendar.js.map +0 -1
- package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/manipulation.js +0 -301
- package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/manipulation.js.map +0 -1
- package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/queries.js +0 -141
- package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/queries.js.map +0 -1
- package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/string.js +0 -35
- package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/string.js.map +0 -1
- package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/utils.js +0 -7
- package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/utils.js.map +0 -1
- package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/weekStartData.js +0 -101
- package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/weekStartData.js.map +0 -1
- package/dist/node_modules/.pnpm/@swc_helpers@0.5.18/node_modules/@swc/helpers/esm/_check_private_redeclaration.js +0 -9
- package/dist/node_modules/.pnpm/@swc_helpers@0.5.18/node_modules/@swc/helpers/esm/_check_private_redeclaration.js.map +0 -1
- package/dist/node_modules/.pnpm/@swc_helpers@0.5.18/node_modules/@swc/helpers/esm/_class_private_field_init.js +0 -9
- package/dist/node_modules/.pnpm/@swc_helpers@0.5.18/node_modules/@swc/helpers/esm/_class_private_field_init.js.map +0 -1
- 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 +0 -140
- 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 +0 -1
- 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 +0 -88
- 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 +0 -1
- package/dist/node_modules/.pnpm/defu@6.1.4/node_modules/defu/dist/defu.js +0 -60
- package/dist/node_modules/.pnpm/defu@6.1.4/node_modules/defu/dist/defu.js.map +0 -1
- package/dist/shared/component/Arrow.vue.js +0 -45
- package/dist/shared/component/Arrow.vue.js.map +0 -1
- package/dist/shared/component/Arrow.vue2.js +0 -5
- package/dist/shared/component/Arrow.vue2.js.map +0 -1
- package/dist/shared/createContext.js +0 -26
- package/dist/shared/createContext.js.map +0 -1
- package/dist/shared/date/comparators.js +0 -27
- package/dist/shared/date/comparators.js.map +0 -1
- package/dist/shared/date/parser.js +0 -161
- package/dist/shared/date/parser.js.map +0 -1
- package/dist/shared/date/parts.js +0 -17
- package/dist/shared/date/parts.js.map +0 -1
- package/dist/shared/date/placeholders.js +0 -196
- package/dist/shared/date/placeholders.js.map +0 -1
- package/dist/shared/date/segment.js +0 -44
- package/dist/shared/date/segment.js.map +0 -1
- package/dist/shared/date/useDateField.js +0 -618
- package/dist/shared/date/useDateField.js.map +0 -1
- package/dist/shared/date/utils.js +0 -76
- package/dist/shared/date/utils.js.map +0 -1
- package/dist/shared/getActiveElement.js +0 -14
- package/dist/shared/getActiveElement.js.map +0 -1
- package/dist/shared/handleAndDispatchCustomEvent.js +0 -15
- package/dist/shared/handleAndDispatchCustomEvent.js.map +0 -1
- package/dist/shared/nullish.js +0 -7
- package/dist/shared/nullish.js.map +0 -1
- package/dist/shared/renderSlotFragments.js +0 -14
- package/dist/shared/renderSlotFragments.js.map +0 -1
- package/dist/shared/useDateFormatter.js +0 -121
- package/dist/shared/useDateFormatter.js.map +0 -1
- package/dist/shared/useDirection.js +0 -12
- package/dist/shared/useDirection.js.map +0 -1
- package/dist/shared/useEmitAsProps.js +0 -19
- package/dist/shared/useEmitAsProps.js.map +0 -1
- package/dist/shared/useFocusGuards.js +0 -39
- package/dist/shared/useFocusGuards.js.map +0 -1
- package/dist/shared/useForwardExpose.js +0 -49
- package/dist/shared/useForwardExpose.js.map +0 -1
- package/dist/shared/useForwardProps.js +0 -27
- package/dist/shared/useForwardProps.js.map +0 -1
- package/dist/shared/useForwardPropsEmits.js +0 -15
- package/dist/shared/useForwardPropsEmits.js.map +0 -1
- package/dist/shared/useId.js +0 -19
- package/dist/shared/useId.js.map +0 -1
- package/dist/shared/useKbd.js +0 -42
- package/dist/shared/useKbd.js.map +0 -1
- package/dist/shared/useLocale.js +0 -12
- package/dist/shared/useLocale.js.map +0 -1
- package/dist/shared/useSize.js +0 -44
- package/dist/shared/useSize.js.map +0 -1
- package/dist/shared/useStateMachine.js +0 -19
- package/dist/shared/useStateMachine.js.map +0 -1
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { defineComponent, createBlock, openBlock, unref, normalizeProps, guardReactiveProps, withCtx, renderSlot } from "vue";
|
|
2
|
-
import "../Primitive/Primitive.js";
|
|
3
|
-
import "../Primitive/Slot.js";
|
|
4
|
-
import _sfc_main$1 from "../Calendar/CalendarYearHeading.vue.js";
|
|
5
|
-
import "../DismissableLayer/DismissableLayer.vue.js";
|
|
6
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
7
|
-
__name: "DatePickerYearHeading",
|
|
8
|
-
props: {
|
|
9
|
-
asChild: { type: Boolean },
|
|
10
|
-
as: {}
|
|
11
|
-
},
|
|
12
|
-
setup(__props) {
|
|
13
|
-
const props = __props;
|
|
14
|
-
return (_ctx, _cache) => {
|
|
15
|
-
return openBlock(), createBlock(unref(_sfc_main$1), normalizeProps(guardReactiveProps(props)), {
|
|
16
|
-
default: withCtx((slotProps) => [
|
|
17
|
-
renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(slotProps)))
|
|
18
|
-
]),
|
|
19
|
-
_: 3
|
|
20
|
-
}, 16);
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
export {
|
|
25
|
-
_sfc_main as default
|
|
26
|
-
};
|
|
27
|
-
//# sourceMappingURL=DatePickerYearHeading.vue.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DatePickerYearHeading.vue.js","sources":["../../../src/components/DatePicker/DatePickerYearHeading.vue"],"sourcesContent":["<script lang=\"ts\">\nimport type { CalendarYearHeadingProps } from \"../Calendar\";\nimport { CalendarYearHeading } from \"../Calendar\";\n\nexport type DatePickerYearHeadingProps = CalendarYearHeadingProps;\n</script>\n\n<script setup lang=\"ts\">\nconst props = defineProps<CalendarYearHeadingProps>();\n\n// TODO\n// defineSlots<CalendarNextSlot>();\n</script>\n\n<template>\n <CalendarYearHeading v-slot=\"slotProps\" v-bind=\"props\">\n <slot v-bind=\"slotProps\" />\n </CalendarYearHeading>\n</template>\n"],"names":["_openBlock","_createBlock","_unref","_withCtx","_renderSlot"],"mappings":";;;;;;;;;;;;AAQA,UAAM,QAAQ;;AAOZ,aAAAA,UAAA,GAAAC,YAEsBC,sDAF0B,KAAK,CAAA,GAAA;AAAA,QACnD,SAAAC,QAAA,CAD2B,cAAS;AAAA,UACpCC,WAA2B,0DAAb,SAAS,CAAA,CAAA;AAAA,QAAA;;;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DatePickerYearHeading.vue2.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
import { reactive, defineComponent, computed, watchEffect, createBlock, openBlock, unref, normalizeStyle, withCtx, renderSlot, nextTick } from "vue";
|
|
2
|
-
import { onKeyStroke } from "../../node_modules/.pnpm/@vueuse_core@14.1.0_vue@3.5.26_typescript@5.9.3_/node_modules/@vueuse/core/dist/index.js";
|
|
3
|
-
import { Primitive } from "../Primitive/Primitive.js";
|
|
4
|
-
import "../Primitive/Slot.js";
|
|
5
|
-
import { usePointerDownOutside, useFocusOutside } from "./utils.js";
|
|
6
|
-
import { useForwardExpose } from "../../shared/useForwardExpose.js";
|
|
7
|
-
const context = reactive({
|
|
8
|
-
layersRoot: /* @__PURE__ */ new Set(),
|
|
9
|
-
layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
|
|
10
|
-
branches: /* @__PURE__ */ new Set()
|
|
11
|
-
});
|
|
12
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
13
|
-
__name: "DismissableLayer",
|
|
14
|
-
props: {
|
|
15
|
-
disableOutsidePointerEvents: { type: Boolean, default: false },
|
|
16
|
-
asChild: { type: Boolean },
|
|
17
|
-
as: {}
|
|
18
|
-
},
|
|
19
|
-
emits: ["escapeKeyDown", "pointerDownOutside", "focusOutside", "interactOutside", "dismiss"],
|
|
20
|
-
setup(__props, { emit: __emit }) {
|
|
21
|
-
const props = __props;
|
|
22
|
-
const emits = __emit;
|
|
23
|
-
const { forwardRef, currentElement: layerElement } = useForwardExpose();
|
|
24
|
-
const ownerDocument = computed(
|
|
25
|
-
() => layerElement.value?.ownerDocument ?? globalThis.document
|
|
26
|
-
);
|
|
27
|
-
const layers = computed(() => context.layersRoot);
|
|
28
|
-
const index = computed(() => {
|
|
29
|
-
return layerElement.value ? Array.from(layers.value).indexOf(layerElement.value) : -1;
|
|
30
|
-
});
|
|
31
|
-
const isBodyPointerEventsDisabled = computed(() => {
|
|
32
|
-
return context.layersWithOutsidePointerEventsDisabled.size > 0;
|
|
33
|
-
});
|
|
34
|
-
const isPointerEventsEnabled = computed(() => {
|
|
35
|
-
const localLayers = Array.from(layers.value);
|
|
36
|
-
const [highestLayerWithOutsidePointerEventsDisabled] = [
|
|
37
|
-
...context.layersWithOutsidePointerEventsDisabled
|
|
38
|
-
].slice(-1);
|
|
39
|
-
const highestLayerWithOutsidePointerEventsDisabledIndex = localLayers.indexOf(
|
|
40
|
-
highestLayerWithOutsidePointerEventsDisabled
|
|
41
|
-
);
|
|
42
|
-
return index.value >= highestLayerWithOutsidePointerEventsDisabledIndex;
|
|
43
|
-
});
|
|
44
|
-
const pointerDownOutside = usePointerDownOutside(async (event) => {
|
|
45
|
-
const isPointerDownOnBranch = [...context.branches].some(
|
|
46
|
-
(branch) => branch?.contains(event.target)
|
|
47
|
-
);
|
|
48
|
-
if (!isPointerEventsEnabled.value || isPointerDownOnBranch) return;
|
|
49
|
-
emits("pointerDownOutside", event);
|
|
50
|
-
emits("interactOutside", event);
|
|
51
|
-
await nextTick();
|
|
52
|
-
if (!event.defaultPrevented) emits("dismiss");
|
|
53
|
-
}, layerElement);
|
|
54
|
-
const focusOutside = useFocusOutside((event) => {
|
|
55
|
-
const isFocusInBranch = [...context.branches].some(
|
|
56
|
-
(branch) => branch?.contains(event.target)
|
|
57
|
-
);
|
|
58
|
-
if (isFocusInBranch) return;
|
|
59
|
-
emits("focusOutside", event);
|
|
60
|
-
emits("interactOutside", event);
|
|
61
|
-
if (!event.defaultPrevented) emits("dismiss");
|
|
62
|
-
}, layerElement);
|
|
63
|
-
onKeyStroke("Escape", (event) => {
|
|
64
|
-
const isHighestLayer = index.value === layers.value.size - 1;
|
|
65
|
-
if (!isHighestLayer) return;
|
|
66
|
-
emits("escapeKeyDown", event);
|
|
67
|
-
if (!event.defaultPrevented) emits("dismiss");
|
|
68
|
-
});
|
|
69
|
-
let originalBodyPointerEvents;
|
|
70
|
-
watchEffect((cleanupFn) => {
|
|
71
|
-
if (!layerElement.value) return;
|
|
72
|
-
if (props.disableOutsidePointerEvents) {
|
|
73
|
-
if (context.layersWithOutsidePointerEventsDisabled.size === 0) {
|
|
74
|
-
originalBodyPointerEvents = ownerDocument.value.body.style.pointerEvents;
|
|
75
|
-
ownerDocument.value.body.style.pointerEvents = "none";
|
|
76
|
-
}
|
|
77
|
-
context.layersWithOutsidePointerEventsDisabled.add(layerElement.value);
|
|
78
|
-
}
|
|
79
|
-
layers.value.add(layerElement.value);
|
|
80
|
-
cleanupFn(() => {
|
|
81
|
-
if (props.disableOutsidePointerEvents && context.layersWithOutsidePointerEventsDisabled.size === 1) {
|
|
82
|
-
ownerDocument.value.body.style.pointerEvents = originalBodyPointerEvents;
|
|
83
|
-
}
|
|
84
|
-
});
|
|
85
|
-
});
|
|
86
|
-
watchEffect((cleanupFn) => {
|
|
87
|
-
cleanupFn(() => {
|
|
88
|
-
if (!layerElement.value) return;
|
|
89
|
-
layers.value.delete(layerElement.value);
|
|
90
|
-
context.layersWithOutsidePointerEventsDisabled.delete(layerElement.value);
|
|
91
|
-
});
|
|
92
|
-
});
|
|
93
|
-
return (_ctx, _cache) => {
|
|
94
|
-
return openBlock(), createBlock(unref(Primitive), {
|
|
95
|
-
ref: unref(forwardRef),
|
|
96
|
-
"as-child": __props.asChild,
|
|
97
|
-
as: __props.as,
|
|
98
|
-
"data-dismissable-layer": "",
|
|
99
|
-
style: normalizeStyle({
|
|
100
|
-
pointerEvents: isBodyPointerEventsDisabled.value ? isPointerEventsEnabled.value ? "auto" : "none" : void 0
|
|
101
|
-
}),
|
|
102
|
-
onFocusCapture: unref(focusOutside).onFocusCapture,
|
|
103
|
-
onBlurCapture: unref(focusOutside).onBlurCapture,
|
|
104
|
-
onPointerdownCapture: unref(pointerDownOutside).onPointerDownCapture
|
|
105
|
-
}, {
|
|
106
|
-
default: withCtx(() => [
|
|
107
|
-
renderSlot(_ctx.$slots, "default")
|
|
108
|
-
]),
|
|
109
|
-
_: 3
|
|
110
|
-
}, 8, ["as-child", "as", "style", "onFocusCapture", "onBlurCapture", "onPointerdownCapture"]);
|
|
111
|
-
};
|
|
112
|
-
}
|
|
113
|
-
});
|
|
114
|
-
export {
|
|
115
|
-
context,
|
|
116
|
-
_sfc_main as default
|
|
117
|
-
};
|
|
118
|
-
//# sourceMappingURL=DismissableLayer.vue.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DismissableLayer.vue.js","sources":["../../../src/components/DismissableLayer/DismissableLayer.vue"],"sourcesContent":["<script lang=\"ts\">\nimport type { FocusOutsideEvent, PointerDownOutsideEvent } from \"./utils\";\n\nimport type { PrimitiveProps } from \"../Primitive\";\nimport { computed, nextTick, reactive, watchEffect } from \"vue\";\nimport { useForwardExpose } from \"../../shared\";\n\nexport interface DismissableLayerProps extends PrimitiveProps {\n /**\n * When `true`, hover/focus/click interactions will be disabled on elements outside\n * the `DismissableLayer`. Users will need to click twice on outside elements to\n * interact with them: once to close the `DismissableLayer`, and again to trigger the element.\n */\n disableOutsidePointerEvents?: boolean;\n}\n\nexport type DismissableLayerEmits = {\n /**\n * Event handler called when the escape key is down.\n * Can be prevented.\n */\n escapeKeyDown: [event: KeyboardEvent];\n /**\n * Event handler called when a `pointerdown` event happens outside of the `DismissableLayer`.\n * Can be prevented.\n */\n pointerDownOutside: [event: PointerDownOutsideEvent];\n /**\n * Event handler called when the focus moves outside of the `DismissableLayer`.\n * Can be prevented.\n */\n focusOutside: [event: FocusOutsideEvent];\n /**\n * Event handler called when an interaction happens outside the `DismissableLayer`.\n * Specifically, when a `pointerdown` event happens outside or focus moves outside of it.\n * Can be prevented.\n */\n interactOutside: [event: PointerDownOutsideEvent | FocusOutsideEvent];\n};\n\nexport type DismissableLayerPrivateEmits = DismissableLayerEmits & {\n /**\n * Handler called when the `DismissableLayer` should be dismissed\n */\n dismiss: [];\n};\n\nexport const context = reactive({\n layersRoot: new Set<HTMLElement>(),\n layersWithOutsidePointerEventsDisabled: new Set<HTMLElement>(),\n branches: new Set<HTMLElement>(),\n});\n</script>\n\n<script setup lang=\"ts\">\nimport { onKeyStroke } from \"@vueuse/core\";\nimport { Primitive } from \"../Primitive\";\nimport { useFocusOutside, usePointerDownOutside } from \"./utils\";\n\nconst props = withDefaults(defineProps<DismissableLayerProps>(), {\n disableOutsidePointerEvents: false,\n});\n\nconst emits = defineEmits<DismissableLayerPrivateEmits>();\n\nconst { forwardRef, currentElement: layerElement } = useForwardExpose();\nconst ownerDocument = computed(\n () => layerElement.value?.ownerDocument ?? globalThis.document,\n);\n\nconst layers = computed(() => context.layersRoot);\n\nconst index = computed(() => {\n return layerElement.value\n ? Array.from(layers.value).indexOf(layerElement.value)\n : -1;\n});\n\nconst isBodyPointerEventsDisabled = computed(() => {\n return context.layersWithOutsidePointerEventsDisabled.size > 0;\n});\n\nconst isPointerEventsEnabled = computed(() => {\n const localLayers = Array.from(layers.value);\n const [highestLayerWithOutsidePointerEventsDisabled] = [\n ...context.layersWithOutsidePointerEventsDisabled,\n ].slice(-1);\n const highestLayerWithOutsidePointerEventsDisabledIndex = localLayers.indexOf(\n highestLayerWithOutsidePointerEventsDisabled,\n );\n\n return index.value >= highestLayerWithOutsidePointerEventsDisabledIndex;\n});\n\nconst pointerDownOutside = usePointerDownOutside(async (event) => {\n const isPointerDownOnBranch = [...context.branches].some((branch) =>\n branch?.contains(event.target as HTMLElement),\n );\n\n if (!isPointerEventsEnabled.value || isPointerDownOnBranch) return;\n emits(\"pointerDownOutside\", event);\n emits(\"interactOutside\", event);\n await nextTick();\n if (!event.defaultPrevented) emits(\"dismiss\");\n}, layerElement);\n\nconst focusOutside = useFocusOutside((event) => {\n const isFocusInBranch = [...context.branches].some((branch) =>\n branch?.contains(event.target as HTMLElement),\n );\n\n if (isFocusInBranch) return;\n emits(\"focusOutside\", event);\n emits(\"interactOutside\", event);\n if (!event.defaultPrevented) emits(\"dismiss\");\n}, layerElement);\n\nonKeyStroke(\"Escape\", (event) => {\n const isHighestLayer = index.value === layers.value.size - 1;\n if (!isHighestLayer) return;\n emits(\"escapeKeyDown\", event);\n if (!event.defaultPrevented) emits(\"dismiss\");\n});\n\nlet originalBodyPointerEvents: string;\nwatchEffect((cleanupFn) => {\n if (!layerElement.value) return;\n if (props.disableOutsidePointerEvents) {\n if (context.layersWithOutsidePointerEventsDisabled.size === 0) {\n originalBodyPointerEvents = ownerDocument.value.body.style.pointerEvents;\n ownerDocument.value.body.style.pointerEvents = \"none\";\n }\n context.layersWithOutsidePointerEventsDisabled.add(layerElement.value);\n }\n layers.value.add(layerElement.value);\n\n cleanupFn(() => {\n if (\n props.disableOutsidePointerEvents &&\n context.layersWithOutsidePointerEventsDisabled.size === 1\n ) {\n ownerDocument.value.body.style.pointerEvents = originalBodyPointerEvents;\n }\n });\n});\n\nwatchEffect((cleanupFn) => {\n cleanupFn(() => {\n if (!layerElement.value) return;\n layers.value.delete(layerElement.value);\n context.layersWithOutsidePointerEventsDisabled.delete(layerElement.value);\n });\n});\n</script>\n\n<template>\n <Primitive\n :ref=\"forwardRef\"\n :as-child=\"asChild\"\n :as=\"as\"\n data-dismissable-layer\n :style=\"{\n pointerEvents: isBodyPointerEventsDisabled\n ? isPointerEventsEnabled\n ? 'auto'\n : 'none'\n : undefined,\n }\"\n @focus.capture=\"focusOutside.onFocusCapture\"\n @blur.capture=\"focusOutside.onBlurCapture\"\n @pointerdown.capture=\"pointerDownOutside.onPointerDownCapture\"\n >\n <slot />\n </Primitive>\n</template>\n"],"names":["_createBlock","_unref","_normalizeStyle","_renderSlot"],"mappings":"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"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DismissableLayer.vue2.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { PrimitiveProps } from '../Primitive';
|
|
2
|
-
export type DismissableLayerBranchProps = PrimitiveProps;
|
|
3
|
-
declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<PrimitiveProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<PrimitiveProps> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>, {
|
|
4
|
-
default?(_: {}): any;
|
|
5
|
-
}>;
|
|
6
|
-
export default _default;
|
|
7
|
-
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
8
|
-
new (): {
|
|
9
|
-
$slots: S;
|
|
10
|
-
};
|
|
11
|
-
};
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
import { isClient } from "../../node_modules/.pnpm/@vueuse_shared@14.1.0_vue@3.5.26_typescript@5.9.3_/node_modules/@vueuse/shared/dist/index.js";
|
|
2
|
-
import { ref, watchEffect, toValue, nextTick } from "vue";
|
|
3
|
-
import { handleAndDispatchCustomEvent } from "../../shared/handleAndDispatchCustomEvent.js";
|
|
4
|
-
const POINTER_DOWN_OUTSIDE = "dismissableLayer.pointerDownOutside";
|
|
5
|
-
const FOCUS_OUTSIDE = "dismissableLayer.focusOutside";
|
|
6
|
-
function isLayerExist(layerElement, targetElement) {
|
|
7
|
-
const targetLayer = targetElement.closest("[data-dismissable-layer]");
|
|
8
|
-
const mainLayer = layerElement.dataset.dismissableLayer === "" ? layerElement : layerElement.querySelector("[data-dismissable-layer]");
|
|
9
|
-
const nodeList = Array.from(
|
|
10
|
-
layerElement.ownerDocument.querySelectorAll("[data-dismissable-layer]")
|
|
11
|
-
);
|
|
12
|
-
if (targetLayer && (mainLayer === targetLayer || nodeList.indexOf(mainLayer) < nodeList.indexOf(targetLayer))) {
|
|
13
|
-
return true;
|
|
14
|
-
} else {
|
|
15
|
-
return false;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
function usePointerDownOutside(onPointerDownOutside, element, enabled = true) {
|
|
19
|
-
const ownerDocument = element?.value?.ownerDocument ?? globalThis?.document;
|
|
20
|
-
const isPointerInsideDOMTree = ref(false);
|
|
21
|
-
const handleClickRef = ref(() => {
|
|
22
|
-
});
|
|
23
|
-
watchEffect((cleanupFn) => {
|
|
24
|
-
if (!isClient || !toValue(enabled)) return;
|
|
25
|
-
const handlePointerDown = async (event) => {
|
|
26
|
-
const target = event.target;
|
|
27
|
-
if (!element?.value || !target) return;
|
|
28
|
-
if (isLayerExist(element.value, target)) {
|
|
29
|
-
isPointerInsideDOMTree.value = false;
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
|
-
if (event.target && !isPointerInsideDOMTree.value) {
|
|
33
|
-
let handleAndDispatchPointerDownOutsideEvent = function() {
|
|
34
|
-
handleAndDispatchCustomEvent(
|
|
35
|
-
POINTER_DOWN_OUTSIDE,
|
|
36
|
-
onPointerDownOutside,
|
|
37
|
-
eventDetail
|
|
38
|
-
);
|
|
39
|
-
};
|
|
40
|
-
const eventDetail = { originalEvent: event };
|
|
41
|
-
if (event.pointerType === "touch") {
|
|
42
|
-
ownerDocument.removeEventListener("click", handleClickRef.value);
|
|
43
|
-
handleClickRef.value = handleAndDispatchPointerDownOutsideEvent;
|
|
44
|
-
ownerDocument.addEventListener("click", handleClickRef.value, {
|
|
45
|
-
once: true
|
|
46
|
-
});
|
|
47
|
-
} else {
|
|
48
|
-
handleAndDispatchPointerDownOutsideEvent();
|
|
49
|
-
}
|
|
50
|
-
} else {
|
|
51
|
-
ownerDocument.removeEventListener("click", handleClickRef.value);
|
|
52
|
-
}
|
|
53
|
-
isPointerInsideDOMTree.value = false;
|
|
54
|
-
};
|
|
55
|
-
const timerId = window.setTimeout(() => {
|
|
56
|
-
ownerDocument.addEventListener("pointerdown", handlePointerDown);
|
|
57
|
-
}, 0);
|
|
58
|
-
cleanupFn(() => {
|
|
59
|
-
window.clearTimeout(timerId);
|
|
60
|
-
ownerDocument.removeEventListener("pointerdown", handlePointerDown);
|
|
61
|
-
ownerDocument.removeEventListener("click", handleClickRef.value);
|
|
62
|
-
});
|
|
63
|
-
});
|
|
64
|
-
return {
|
|
65
|
-
onPointerDownCapture: () => {
|
|
66
|
-
if (!toValue(enabled)) return;
|
|
67
|
-
isPointerInsideDOMTree.value = true;
|
|
68
|
-
}
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
function useFocusOutside(onFocusOutside, element, enabled = true) {
|
|
72
|
-
const ownerDocument = element?.value?.ownerDocument ?? globalThis?.document;
|
|
73
|
-
const isFocusInsideDOMTree = ref(false);
|
|
74
|
-
watchEffect((cleanupFn) => {
|
|
75
|
-
if (!isClient || !toValue(enabled)) return;
|
|
76
|
-
const handleFocus = async (event) => {
|
|
77
|
-
if (!element?.value) return;
|
|
78
|
-
await nextTick();
|
|
79
|
-
await nextTick();
|
|
80
|
-
const target = event.target;
|
|
81
|
-
if (!element.value || !target || isLayerExist(element.value, target))
|
|
82
|
-
return;
|
|
83
|
-
if (event.target && !isFocusInsideDOMTree.value) {
|
|
84
|
-
const eventDetail = { originalEvent: event };
|
|
85
|
-
handleAndDispatchCustomEvent(
|
|
86
|
-
FOCUS_OUTSIDE,
|
|
87
|
-
onFocusOutside,
|
|
88
|
-
eventDetail
|
|
89
|
-
);
|
|
90
|
-
}
|
|
91
|
-
};
|
|
92
|
-
ownerDocument.addEventListener("focusin", handleFocus);
|
|
93
|
-
cleanupFn(() => ownerDocument.removeEventListener("focusin", handleFocus));
|
|
94
|
-
});
|
|
95
|
-
return {
|
|
96
|
-
onFocusCapture: () => {
|
|
97
|
-
if (!toValue(enabled)) return;
|
|
98
|
-
isFocusInsideDOMTree.value = true;
|
|
99
|
-
},
|
|
100
|
-
onBlurCapture: () => {
|
|
101
|
-
if (!toValue(enabled)) return;
|
|
102
|
-
isFocusInsideDOMTree.value = false;
|
|
103
|
-
}
|
|
104
|
-
};
|
|
105
|
-
}
|
|
106
|
-
export {
|
|
107
|
-
FOCUS_OUTSIDE,
|
|
108
|
-
POINTER_DOWN_OUTSIDE,
|
|
109
|
-
useFocusOutside,
|
|
110
|
-
usePointerDownOutside
|
|
111
|
-
};
|
|
112
|
-
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sources":["../../../src/components/DismissableLayer/utils.ts"],"sourcesContent":["import type { MaybeRefOrGetter, Ref } from \"vue\";\nimport { isClient } from \"@vueuse/shared\";\nimport { nextTick, ref, toValue, watchEffect } from \"vue\";\nimport { handleAndDispatchCustomEvent } from \"../../shared\";\n\nexport type PointerDownOutsideEvent = CustomEvent<{\n originalEvent: PointerEvent;\n}>;\nexport type FocusOutsideEvent = CustomEvent<{ originalEvent: FocusEvent }>;\n\nexport const DISMISSABLE_LAYER_NAME = \"DismissableLayer\";\nexport const CONTEXT_UPDATE = \"dismissableLayer.update\";\nexport const POINTER_DOWN_OUTSIDE = \"dismissableLayer.pointerDownOutside\";\nexport const FOCUS_OUTSIDE = \"dismissableLayer.focusOutside\";\n\nfunction isLayerExist(layerElement: HTMLElement, targetElement: HTMLElement) {\n const targetLayer = targetElement.closest(\"[data-dismissable-layer]\");\n\n const mainLayer =\n layerElement.dataset.dismissableLayer === \"\"\n ? layerElement\n : (layerElement.querySelector(\"[data-dismissable-layer]\") as HTMLElement);\n\n const nodeList = Array.from(\n layerElement.ownerDocument.querySelectorAll(\"[data-dismissable-layer]\"),\n );\n\n if (\n targetLayer &&\n (mainLayer === targetLayer ||\n nodeList.indexOf(mainLayer) < nodeList.indexOf(targetLayer))\n ) {\n return true;\n } else {\n return false;\n }\n}\n\n/**\n * Listens for `pointerdown` outside a DOM subtree. We use `pointerdown` rather than `pointerup`\n * to mimic layer dismissing behaviour present in OS.\n * Returns props to pass to the node we want to check for outside events.\n */\nexport function usePointerDownOutside(\n onPointerDownOutside?: (event: PointerDownOutsideEvent) => void,\n element?: Ref<HTMLElement | undefined>,\n enabled: MaybeRefOrGetter<boolean> = true,\n) {\n const ownerDocument: Document =\n element?.value?.ownerDocument ?? globalThis?.document;\n\n const isPointerInsideDOMTree = ref(false);\n const handleClickRef = ref(() => {});\n\n watchEffect((cleanupFn) => {\n if (!isClient || !toValue(enabled)) return;\n const handlePointerDown = async (event: PointerEvent) => {\n const target = event.target as HTMLElement | undefined;\n\n if (!element?.value || !target) return;\n\n if (isLayerExist(element.value, target)) {\n isPointerInsideDOMTree.value = false;\n return;\n }\n\n if (event.target && !isPointerInsideDOMTree.value) {\n const eventDetail = { originalEvent: event };\n\n function handleAndDispatchPointerDownOutsideEvent() {\n handleAndDispatchCustomEvent(\n POINTER_DOWN_OUTSIDE,\n onPointerDownOutside,\n eventDetail,\n );\n }\n\n /**\n * On touch devices, we need to wait for a click event because browsers implement\n * a ~350ms delay between the time the user stops touching the display and when the\n * browser executes events. We need to ensure we don't reactivate pointer-events within\n * this timeframe otherwise the browser may execute events that should have been prevented.\n *\n * Additionally, this also lets us deal automatically with cancellations when a click event\n * isn't raised because the page was considered scrolled/drag-scrolled, long-pressed, etc.\n *\n * This is why we also continuously remove the previous listener, because we cannot be\n * certain that it was raised, and therefore cleaned-up.\n */\n if (event.pointerType === \"touch\") {\n ownerDocument.removeEventListener(\"click\", handleClickRef.value);\n handleClickRef.value = handleAndDispatchPointerDownOutsideEvent;\n ownerDocument.addEventListener(\"click\", handleClickRef.value, {\n once: true,\n });\n } else {\n handleAndDispatchPointerDownOutsideEvent();\n }\n } else {\n // We need to remove the event listener in case the outside click has been canceled.\n // See: https://github.com/radix-ui/primitives/issues/2171\n ownerDocument.removeEventListener(\"click\", handleClickRef.value);\n }\n isPointerInsideDOMTree.value = false;\n };\n /**\n * if this hook executes in a component that mounts via a `pointerdown` event, the event\n * would bubble up to the document and trigger a `pointerDownOutside` event. We avoid\n * this by delaying the event listener registration on the document.\n * This is how the DOM works, ie:\n * ```\n * button.addEventListener('pointerdown', () => {\n * console.log('I will log');\n * document.addEventListener('pointerdown', () => {\n * console.log('I will also log');\n * })\n * });\n */\n const timerId = window.setTimeout(() => {\n ownerDocument.addEventListener(\"pointerdown\", handlePointerDown);\n }, 0);\n\n cleanupFn(() => {\n window.clearTimeout(timerId);\n ownerDocument.removeEventListener(\"pointerdown\", handlePointerDown);\n ownerDocument.removeEventListener(\"click\", handleClickRef.value);\n });\n });\n\n return {\n onPointerDownCapture: () => {\n if (!toValue(enabled)) return;\n isPointerInsideDOMTree.value = true;\n },\n };\n}\n\n/**\n * Listens for when focus happens outside a DOM subtree.\n * Returns props to pass to the root (node) of the subtree we want to check.\n */\nexport function useFocusOutside(\n onFocusOutside?: (event: FocusOutsideEvent) => void,\n element?: Ref<HTMLElement | undefined>,\n enabled: MaybeRefOrGetter<boolean> = true,\n) {\n const ownerDocument: Document =\n element?.value?.ownerDocument ?? globalThis?.document;\n\n const isFocusInsideDOMTree = ref(false);\n watchEffect((cleanupFn) => {\n if (!isClient || !toValue(enabled)) return;\n const handleFocus = async (event: FocusEvent) => {\n if (!element?.value) return;\n\n await nextTick();\n await nextTick();\n const target = event.target as HTMLElement | undefined;\n if (!element.value || !target || isLayerExist(element.value, target))\n return;\n\n if (event.target && !isFocusInsideDOMTree.value) {\n const eventDetail = { originalEvent: event };\n handleAndDispatchCustomEvent(\n FOCUS_OUTSIDE,\n onFocusOutside,\n eventDetail,\n );\n }\n };\n\n ownerDocument.addEventListener(\"focusin\", handleFocus);\n\n cleanupFn(() => ownerDocument.removeEventListener(\"focusin\", handleFocus));\n });\n\n return {\n onFocusCapture: () => {\n if (!toValue(enabled)) return;\n\n isFocusInsideDOMTree.value = true;\n },\n onBlurCapture: () => {\n if (!toValue(enabled)) return;\n\n isFocusInsideDOMTree.value = false;\n },\n };\n}\n\nexport function dispatchUpdate() {\n const event = new CustomEvent(CONTEXT_UPDATE);\n document.dispatchEvent(event);\n}\n"],"names":[],"mappings":";;;AAYO,MAAM,uBAAuB;AAC7B,MAAM,gBAAgB;AAE7B,SAAS,aAAa,cAA2B,eAA4B;AAC3E,QAAM,cAAc,cAAc,QAAQ,0BAA0B;AAEpE,QAAM,YACJ,aAAa,QAAQ,qBAAqB,KACtC,eACC,aAAa,cAAc,0BAA0B;AAE5D,QAAM,WAAW,MAAM;AAAA,IACrB,aAAa,cAAc,iBAAiB,0BAA0B;AAAA,EAAA;AAGxE,MACE,gBACC,cAAc,eACb,SAAS,QAAQ,SAAS,IAAI,SAAS,QAAQ,WAAW,IAC5D;AACA,WAAO;AAAA,EACT,OAAO;AACL,WAAO;AAAA,EACT;AACF;AAOO,SAAS,sBACd,sBACA,SACA,UAAqC,MACrC;AACA,QAAM,gBACJ,SAAS,OAAO,iBAAiB,YAAY;AAE/C,QAAM,yBAAyB,IAAI,KAAK;AACxC,QAAM,iBAAiB,IAAI,MAAM;AAAA,EAAC,CAAC;AAEnC,cAAY,CAAC,cAAc;AACzB,QAAI,CAAC,YAAY,CAAC,QAAQ,OAAO,EAAG;AACpC,UAAM,oBAAoB,OAAO,UAAwB;AACvD,YAAM,SAAS,MAAM;AAErB,UAAI,CAAC,SAAS,SAAS,CAAC,OAAQ;AAEhC,UAAI,aAAa,QAAQ,OAAO,MAAM,GAAG;AACvC,+BAAuB,QAAQ;AAC/B;AAAA,MACF;AAEA,UAAI,MAAM,UAAU,CAAC,uBAAuB,OAAO;AAGjD,YAAS,2CAAT,WAAoD;AAClD;AAAA,YACE;AAAA,YACA;AAAA,YACA;AAAA,UAAA;AAAA,QAEJ;AARA,cAAM,cAAc,EAAE,eAAe,MAAA;AAsBrC,YAAI,MAAM,gBAAgB,SAAS;AACjC,wBAAc,oBAAoB,SAAS,eAAe,KAAK;AAC/D,yBAAe,QAAQ;AACvB,wBAAc,iBAAiB,SAAS,eAAe,OAAO;AAAA,YAC5D,MAAM;AAAA,UAAA,CACP;AAAA,QACH,OAAO;AACL,mDAAA;AAAA,QACF;AAAA,MACF,OAAO;AAGL,sBAAc,oBAAoB,SAAS,eAAe,KAAK;AAAA,MACjE;AACA,6BAAuB,QAAQ;AAAA,IACjC;AAcA,UAAM,UAAU,OAAO,WAAW,MAAM;AACtC,oBAAc,iBAAiB,eAAe,iBAAiB;AAAA,IACjE,GAAG,CAAC;AAEJ,cAAU,MAAM;AACd,aAAO,aAAa,OAAO;AAC3B,oBAAc,oBAAoB,eAAe,iBAAiB;AAClE,oBAAc,oBAAoB,SAAS,eAAe,KAAK;AAAA,IACjE,CAAC;AAAA,EACH,CAAC;AAED,SAAO;AAAA,IACL,sBAAsB,MAAM;AAC1B,UAAI,CAAC,QAAQ,OAAO,EAAG;AACvB,6BAAuB,QAAQ;AAAA,IACjC;AAAA,EAAA;AAEJ;AAMO,SAAS,gBACd,gBACA,SACA,UAAqC,MACrC;AACA,QAAM,gBACJ,SAAS,OAAO,iBAAiB,YAAY;AAE/C,QAAM,uBAAuB,IAAI,KAAK;AACtC,cAAY,CAAC,cAAc;AACzB,QAAI,CAAC,YAAY,CAAC,QAAQ,OAAO,EAAG;AACpC,UAAM,cAAc,OAAO,UAAsB;AAC/C,UAAI,CAAC,SAAS,MAAO;AAErB,YAAM,SAAA;AACN,YAAM,SAAA;AACN,YAAM,SAAS,MAAM;AACrB,UAAI,CAAC,QAAQ,SAAS,CAAC,UAAU,aAAa,QAAQ,OAAO,MAAM;AACjE;AAEF,UAAI,MAAM,UAAU,CAAC,qBAAqB,OAAO;AAC/C,cAAM,cAAc,EAAE,eAAe,MAAA;AACrC;AAAA,UACE;AAAA,UACA;AAAA,UACA;AAAA,QAAA;AAAA,MAEJ;AAAA,IACF;AAEA,kBAAc,iBAAiB,WAAW,WAAW;AAErD,cAAU,MAAM,cAAc,oBAAoB,WAAW,WAAW,CAAC;AAAA,EAC3E,CAAC;AAED,SAAO;AAAA,IACL,gBAAgB,MAAM;AACpB,UAAI,CAAC,QAAQ,OAAO,EAAG;AAEvB,2BAAqB,QAAQ;AAAA,IAC/B;AAAA,IACA,eAAe,MAAM;AACnB,UAAI,CAAC,QAAQ,OAAO,EAAG;AAEvB,2BAAqB,QAAQ;AAAA,IAC/B;AAAA,EAAA;AAEJ;"}
|
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
import { defineComponent, ref, reactive, watchEffect, nextTick, createBlock, openBlock, unref, withCtx, renderSlot } from "vue";
|
|
2
|
-
import { isClient } from "../../node_modules/.pnpm/@vueuse_shared@14.1.0_vue@3.5.26_typescript@5.9.3_/node_modules/@vueuse/shared/dist/index.js";
|
|
3
|
-
import { Primitive } from "../Primitive/Primitive.js";
|
|
4
|
-
import "../Primitive/Slot.js";
|
|
5
|
-
import { createFocusScopesStack, removeLinks } from "./stack.js";
|
|
6
|
-
import { AUTOFOCUS_ON_MOUNT, focusFirst, getTabbableCandidates, focus, AUTOFOCUS_ON_UNMOUNT, EVENT_OPTIONS, getTabbableEdges } from "./utils.js";
|
|
7
|
-
import { getActiveElement } from "../../shared/getActiveElement.js";
|
|
8
|
-
import { useForwardExpose } from "../../shared/useForwardExpose.js";
|
|
9
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
10
|
-
__name: "FocusScope",
|
|
11
|
-
props: {
|
|
12
|
-
loop: { type: Boolean, default: false },
|
|
13
|
-
trapped: { type: Boolean, default: false },
|
|
14
|
-
asChild: { type: Boolean },
|
|
15
|
-
as: {}
|
|
16
|
-
},
|
|
17
|
-
emits: ["mountAutoFocus", "unmountAutoFocus"],
|
|
18
|
-
setup(__props, { emit: __emit }) {
|
|
19
|
-
const props = __props;
|
|
20
|
-
const emits = __emit;
|
|
21
|
-
const { currentRef, currentElement } = useForwardExpose();
|
|
22
|
-
const lastFocusedElementRef = ref(null);
|
|
23
|
-
const focusScopesStack = createFocusScopesStack();
|
|
24
|
-
const focusScope = reactive({
|
|
25
|
-
paused: false,
|
|
26
|
-
pause() {
|
|
27
|
-
this.paused = true;
|
|
28
|
-
},
|
|
29
|
-
resume() {
|
|
30
|
-
this.paused = false;
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
watchEffect((cleanupFn) => {
|
|
34
|
-
if (!isClient) return;
|
|
35
|
-
const container = currentElement.value;
|
|
36
|
-
if (!props.trapped) return;
|
|
37
|
-
function handleFocusIn(event) {
|
|
38
|
-
if (focusScope.paused || !container) return;
|
|
39
|
-
const target = event.target;
|
|
40
|
-
if (container.contains(target)) lastFocusedElementRef.value = target;
|
|
41
|
-
else focus(lastFocusedElementRef.value, { select: true });
|
|
42
|
-
}
|
|
43
|
-
function handleFocusOut(event) {
|
|
44
|
-
if (focusScope.paused || !container) return;
|
|
45
|
-
const relatedTarget = event.relatedTarget;
|
|
46
|
-
if (relatedTarget === null) return;
|
|
47
|
-
if (!container.contains(relatedTarget))
|
|
48
|
-
focus(lastFocusedElementRef.value, { select: true });
|
|
49
|
-
}
|
|
50
|
-
function handleMutations(mutations) {
|
|
51
|
-
const isLastFocusedElementExist = container.contains(
|
|
52
|
-
lastFocusedElementRef.value
|
|
53
|
-
);
|
|
54
|
-
if (!isLastFocusedElementExist) focus(container);
|
|
55
|
-
}
|
|
56
|
-
document.addEventListener("focusin", handleFocusIn);
|
|
57
|
-
document.addEventListener("focusout", handleFocusOut);
|
|
58
|
-
const mutationObserver = new MutationObserver(handleMutations);
|
|
59
|
-
if (container)
|
|
60
|
-
mutationObserver.observe(container, { childList: true, subtree: true });
|
|
61
|
-
cleanupFn(() => {
|
|
62
|
-
document.removeEventListener("focusin", handleFocusIn);
|
|
63
|
-
document.removeEventListener("focusout", handleFocusOut);
|
|
64
|
-
mutationObserver.disconnect();
|
|
65
|
-
});
|
|
66
|
-
});
|
|
67
|
-
watchEffect(async (cleanupFn) => {
|
|
68
|
-
const container = currentElement.value;
|
|
69
|
-
await nextTick();
|
|
70
|
-
if (!container) return;
|
|
71
|
-
focusScopesStack.add(focusScope);
|
|
72
|
-
const previouslyFocusedElement = getActiveElement();
|
|
73
|
-
const hasFocusedCandidate = container.contains(previouslyFocusedElement);
|
|
74
|
-
if (!hasFocusedCandidate) {
|
|
75
|
-
const mountEvent = new CustomEvent(AUTOFOCUS_ON_MOUNT, EVENT_OPTIONS);
|
|
76
|
-
container.addEventListener(
|
|
77
|
-
AUTOFOCUS_ON_MOUNT,
|
|
78
|
-
(ev) => emits("mountAutoFocus", ev)
|
|
79
|
-
);
|
|
80
|
-
container.dispatchEvent(mountEvent);
|
|
81
|
-
if (!mountEvent.defaultPrevented) {
|
|
82
|
-
focusFirst(removeLinks(getTabbableCandidates(container)), {
|
|
83
|
-
select: true
|
|
84
|
-
});
|
|
85
|
-
if (getActiveElement() === previouslyFocusedElement) focus(container);
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
cleanupFn(() => {
|
|
89
|
-
container.removeEventListener(
|
|
90
|
-
AUTOFOCUS_ON_MOUNT,
|
|
91
|
-
(ev) => emits("mountAutoFocus", ev)
|
|
92
|
-
);
|
|
93
|
-
const unmountEvent = new CustomEvent(AUTOFOCUS_ON_UNMOUNT, EVENT_OPTIONS);
|
|
94
|
-
const unmountEventHandler = (ev) => {
|
|
95
|
-
emits("unmountAutoFocus", ev);
|
|
96
|
-
};
|
|
97
|
-
container.addEventListener(AUTOFOCUS_ON_UNMOUNT, unmountEventHandler);
|
|
98
|
-
container.dispatchEvent(unmountEvent);
|
|
99
|
-
setTimeout(() => {
|
|
100
|
-
if (!unmountEvent.defaultPrevented)
|
|
101
|
-
focus(previouslyFocusedElement ?? document.body, { select: true });
|
|
102
|
-
container.removeEventListener(AUTOFOCUS_ON_UNMOUNT, unmountEventHandler);
|
|
103
|
-
focusScopesStack.remove(focusScope);
|
|
104
|
-
}, 0);
|
|
105
|
-
});
|
|
106
|
-
});
|
|
107
|
-
function handleKeyDown(event) {
|
|
108
|
-
if (!props.loop && !props.trapped) return;
|
|
109
|
-
if (focusScope.paused) return;
|
|
110
|
-
const isTabKey = event.key === "Tab" && !event.altKey && !event.ctrlKey && !event.metaKey;
|
|
111
|
-
const focusedElement = getActiveElement();
|
|
112
|
-
if (isTabKey && focusedElement) {
|
|
113
|
-
const container = event.currentTarget;
|
|
114
|
-
const [first, last] = getTabbableEdges(container);
|
|
115
|
-
const hasTabbableElementsInside = first && last;
|
|
116
|
-
if (!hasTabbableElementsInside) {
|
|
117
|
-
if (focusedElement === container) event.preventDefault();
|
|
118
|
-
} else {
|
|
119
|
-
if (!event.shiftKey && focusedElement === last) {
|
|
120
|
-
event.preventDefault();
|
|
121
|
-
if (props.loop) focus(first, { select: true });
|
|
122
|
-
} else if (event.shiftKey && focusedElement === first) {
|
|
123
|
-
event.preventDefault();
|
|
124
|
-
if (props.loop) focus(last, { select: true });
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
return (_ctx, _cache) => {
|
|
130
|
-
return openBlock(), createBlock(unref(Primitive), {
|
|
131
|
-
ref_key: "currentRef",
|
|
132
|
-
ref: currentRef,
|
|
133
|
-
tabindex: "-1",
|
|
134
|
-
"as-child": __props.asChild,
|
|
135
|
-
as: __props.as,
|
|
136
|
-
onKeydown: handleKeyDown
|
|
137
|
-
}, {
|
|
138
|
-
default: withCtx(() => [
|
|
139
|
-
renderSlot(_ctx.$slots, "default")
|
|
140
|
-
]),
|
|
141
|
-
_: 3
|
|
142
|
-
}, 8, ["as-child", "as"]);
|
|
143
|
-
};
|
|
144
|
-
}
|
|
145
|
-
});
|
|
146
|
-
export {
|
|
147
|
-
_sfc_main as default
|
|
148
|
-
};
|
|
149
|
-
//# sourceMappingURL=FocusScope.vue.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FocusScope.vue.js","sources":["../../../src/components/FocusScope/FocusScope.vue"],"sourcesContent":["<script lang=\"ts\">\nimport type { PrimitiveProps } from \"../Primitive\";\nimport { getActiveElement, useForwardExpose } from \"../../shared\";\n\nexport type FocusScopeEmits = {\n /**\n * Event handler called when auto-focusing on mount.\n * Can be prevented.\n */\n mountAutoFocus: [event: Event];\n\n /**\n * Event handler called when auto-focusing on unmount.\n * Can be prevented.\n */\n unmountAutoFocus: [event: Event];\n};\n\nexport interface FocusScopeProps extends PrimitiveProps {\n /**\n * When `true`, tabbing from last item will focus first tabbable\n * and shift+tab from first item will focus last tababble.\n * @defaultValue false\n */\n loop?: boolean;\n\n /**\n * When `true`, focus cannot escape the focus scope via keyboard,\n * pointer, or a programmatic focus.\n * @defaultValue false\n */\n trapped?: boolean;\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { isClient } from \"@vueuse/shared\";\nimport { nextTick, reactive, ref, watchEffect } from \"vue\";\nimport { Primitive } from \"../Primitive\";\nimport { createFocusScopesStack, removeLinks } from \"./stack\";\nimport {\n AUTOFOCUS_ON_MOUNT,\n AUTOFOCUS_ON_UNMOUNT,\n EVENT_OPTIONS,\n focus,\n focusFirst,\n getTabbableCandidates,\n getTabbableEdges,\n} from \"./utils\";\n\nconst props = withDefaults(defineProps<FocusScopeProps>(), {\n loop: false,\n trapped: false,\n});\nconst emits = defineEmits<FocusScopeEmits>();\n\nconst { currentRef, currentElement } = useForwardExpose();\nconst lastFocusedElementRef = ref<HTMLElement | null>(null);\nconst focusScopesStack = createFocusScopesStack();\n\nconst focusScope = reactive({\n paused: false,\n pause() {\n this.paused = true;\n },\n resume() {\n this.paused = false;\n },\n});\n\nwatchEffect((cleanupFn) => {\n if (!isClient) return;\n const container = currentElement.value;\n if (!props.trapped) return;\n\n function handleFocusIn(event: FocusEvent) {\n if (focusScope.paused || !container) return;\n const target = event.target as HTMLElement | null;\n if (container.contains(target)) lastFocusedElementRef.value = target;\n else focus(lastFocusedElementRef.value, { select: true });\n }\n\n function handleFocusOut(event: FocusEvent) {\n if (focusScope.paused || !container) return;\n const relatedTarget = event.relatedTarget as HTMLElement | null;\n\n // A `focusout` event with a `null` `relatedTarget` will happen in at least two cases:\n //\n // 1. When the user switches app/tabs/windows/the browser itself loses focus.\n // 2. In Google Chrome, when the focused element is removed from the DOM.\n //\n // We let the browser do its thing here because:\n //\n // 1. The browser already keeps a memory of what's focused for when the page gets refocused.\n // 2. In Google Chrome, if we try to focus the deleted focused element (as per below), it\n // throws the CPU to 100%, so we avoid doing anything for this reason here too.\n if (relatedTarget === null) return;\n\n // If the focus has moved to an actual legitimate element (`relatedTarget !== null`)\n // that is outside the container, we move focus to the last valid focused element inside.\n if (!container.contains(relatedTarget))\n focus(lastFocusedElementRef.value, { select: true });\n }\n\n // When the focused element gets removed from the DOM, browsers move focus\n // back to the document.body. In this case, we move focus to the container\n // to keep focus trapped correctly.\n // -- related: https://github.com/unovue/reka-ui/issues/518\n // Reka UI tentative solution:\n // instead of leaning on document.activeElement, we use lastFocusedElementRef.value to check\n // if the element still exist inside the container,\n // if not then we focus to the container\n function handleMutations(mutations: MutationRecord[]) {\n const isLastFocusedElementExist = container.contains(\n lastFocusedElementRef.value,\n );\n if (!isLastFocusedElementExist) focus(container);\n }\n\n document.addEventListener(\"focusin\", handleFocusIn);\n document.addEventListener(\"focusout\", handleFocusOut);\n const mutationObserver = new MutationObserver(handleMutations);\n if (container)\n mutationObserver.observe(container, { childList: true, subtree: true });\n\n cleanupFn(() => {\n document.removeEventListener(\"focusin\", handleFocusIn);\n document.removeEventListener(\"focusout\", handleFocusOut);\n mutationObserver.disconnect();\n });\n});\n\nwatchEffect(async (cleanupFn) => {\n const container = currentElement.value;\n\n await nextTick();\n if (!container) return;\n focusScopesStack.add(focusScope);\n const previouslyFocusedElement = getActiveElement() as HTMLElement | null;\n const hasFocusedCandidate = container.contains(previouslyFocusedElement);\n\n if (!hasFocusedCandidate) {\n const mountEvent = new CustomEvent(AUTOFOCUS_ON_MOUNT, EVENT_OPTIONS);\n container.addEventListener(AUTOFOCUS_ON_MOUNT, (ev: Event) =>\n emits(\"mountAutoFocus\", ev),\n );\n container.dispatchEvent(mountEvent);\n\n if (!mountEvent.defaultPrevented) {\n focusFirst(removeLinks(getTabbableCandidates(container)), {\n select: true,\n });\n if (getActiveElement() === previouslyFocusedElement) focus(container);\n }\n }\n\n cleanupFn(() => {\n container.removeEventListener(AUTOFOCUS_ON_MOUNT, (ev: Event) =>\n emits(\"mountAutoFocus\", ev),\n );\n\n const unmountEvent = new CustomEvent(AUTOFOCUS_ON_UNMOUNT, EVENT_OPTIONS);\n const unmountEventHandler = (ev: Event) => {\n emits(\"unmountAutoFocus\", ev);\n };\n container.addEventListener(AUTOFOCUS_ON_UNMOUNT, unmountEventHandler);\n container.dispatchEvent(unmountEvent);\n\n setTimeout(() => {\n if (!unmountEvent.defaultPrevented)\n focus(previouslyFocusedElement ?? document.body, { select: true });\n\n // we need to remove the listener after we `dispatchEvent`\n container.removeEventListener(AUTOFOCUS_ON_UNMOUNT, unmountEventHandler);\n\n focusScopesStack.remove(focusScope);\n }, 0);\n });\n});\n\nfunction handleKeyDown(event: KeyboardEvent) {\n if (!props.loop && !props.trapped) return;\n if (focusScope.paused) return;\n\n const isTabKey =\n event.key === \"Tab\" && !event.altKey && !event.ctrlKey && !event.metaKey;\n const focusedElement = getActiveElement() as HTMLElement | null;\n\n if (isTabKey && focusedElement) {\n const container = event.currentTarget as HTMLElement;\n const [first, last] = getTabbableEdges(container);\n const hasTabbableElementsInside = first && last;\n\n // we can only wrap focus if we have tabbable edges\n if (!hasTabbableElementsInside) {\n if (focusedElement === container) event.preventDefault();\n } else {\n if (!event.shiftKey && focusedElement === last) {\n event.preventDefault();\n if (props.loop) focus(first, { select: true });\n } else if (event.shiftKey && focusedElement === first) {\n event.preventDefault();\n if (props.loop) focus(last, { select: true });\n }\n }\n }\n}\n</script>\n\n<template>\n <Primitive\n ref=\"currentRef\"\n tabindex=\"-1\"\n :as-child=\"asChild\"\n :as=\"as\"\n @keydown=\"handleKeyDown\"\n >\n <slot />\n </Primitive>\n</template>\n"],"names":["_createBlock","_unref","_renderSlot"],"mappings":"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"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FocusScope.vue2.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { ref } from "vue";
|
|
2
|
-
import { createGlobalState } from "../../node_modules/.pnpm/@vueuse_shared@14.1.0_vue@3.5.26_typescript@5.9.3_/node_modules/@vueuse/shared/dist/index.js";
|
|
3
|
-
const useFocusStackState = createGlobalState(() => {
|
|
4
|
-
const stack = ref([]);
|
|
5
|
-
return stack;
|
|
6
|
-
});
|
|
7
|
-
function createFocusScopesStack() {
|
|
8
|
-
const stack = useFocusStackState();
|
|
9
|
-
return {
|
|
10
|
-
add(focusScope) {
|
|
11
|
-
const activeFocusScope = stack.value[0];
|
|
12
|
-
if (focusScope !== activeFocusScope)
|
|
13
|
-
activeFocusScope?.pause();
|
|
14
|
-
stack.value = arrayRemove(stack.value, focusScope);
|
|
15
|
-
stack.value.unshift(focusScope);
|
|
16
|
-
},
|
|
17
|
-
remove(focusScope) {
|
|
18
|
-
stack.value = arrayRemove(stack.value, focusScope);
|
|
19
|
-
stack.value[0]?.resume();
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
function arrayRemove(array, item) {
|
|
24
|
-
const updatedArray = [...array];
|
|
25
|
-
const index = updatedArray.indexOf(item);
|
|
26
|
-
if (index !== -1)
|
|
27
|
-
updatedArray.splice(index, 1);
|
|
28
|
-
return updatedArray;
|
|
29
|
-
}
|
|
30
|
-
function removeLinks(items) {
|
|
31
|
-
return items.filter((item) => item.tagName !== "A");
|
|
32
|
-
}
|
|
33
|
-
export {
|
|
34
|
-
arrayRemove,
|
|
35
|
-
createFocusScopesStack,
|
|
36
|
-
removeLinks
|
|
37
|
-
};
|
|
38
|
-
//# sourceMappingURL=stack.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"stack.js","sources":["../../../src/components/FocusScope/stack.ts"],"sourcesContent":["import { createGlobalState } from '@vueuse/core'\nimport { ref } from 'vue'\n\ninterface FocusScopeAPI {\n paused: boolean\n pause: () => void\n resume: () => void\n}\n\nconst useFocusStackState = createGlobalState(() => {\n const stack = ref<FocusScopeAPI[]>([])\n return stack\n})\n\nexport function createFocusScopesStack() {\n /** A stack of focus scopes, with the active one at the top */\n const stack = useFocusStackState()\n\n return {\n add(focusScope: FocusScopeAPI) {\n // pause the currently active focus scope (at the top of the stack)\n const activeFocusScope = stack.value[0]\n if (focusScope !== activeFocusScope)\n activeFocusScope?.pause()\n\n // remove in case it already exists (because we'll re-add it at the top of the stack)\n stack.value = arrayRemove(stack.value, focusScope)\n stack.value.unshift(focusScope)\n },\n\n remove(focusScope: FocusScopeAPI) {\n stack.value = arrayRemove(stack.value, focusScope)\n stack.value[0]?.resume()\n },\n }\n}\n\nexport function arrayRemove<T>(array: T[], item: T) {\n const updatedArray = [...array]\n const index = updatedArray.indexOf(item)\n if (index !== -1)\n updatedArray.splice(index, 1)\n\n return updatedArray\n}\n\nexport function removeLinks(items: HTMLElement[]) {\n return items.filter(item => item.tagName !== 'A')\n}\n"],"names":[],"mappings":";;AASA,MAAM,qBAAqB,kBAAkB,MAAM;AACjD,QAAM,QAAQ,IAAqB,EAAE;AACrC,SAAO;AACT,CAAC;AAEM,SAAS,yBAAyB;AAEvC,QAAM,QAAQ,mBAAA;AAEd,SAAO;AAAA,IACL,IAAI,YAA2B;AAE7B,YAAM,mBAAmB,MAAM,MAAM,CAAC;AACtC,UAAI,eAAe;AACjB,0BAAkB,MAAA;AAGpB,YAAM,QAAQ,YAAY,MAAM,OAAO,UAAU;AACjD,YAAM,MAAM,QAAQ,UAAU;AAAA,IAChC;AAAA,IAEA,OAAO,YAA2B;AAChC,YAAM,QAAQ,YAAY,MAAM,OAAO,UAAU;AACjD,YAAM,MAAM,CAAC,GAAG,OAAA;AAAA,IAClB;AAAA,EAAA;AAEJ;AAEO,SAAS,YAAe,OAAY,MAAS;AAClD,QAAM,eAAe,CAAC,GAAG,KAAK;AAC9B,QAAM,QAAQ,aAAa,QAAQ,IAAI;AACvC,MAAI,UAAU;AACZ,iBAAa,OAAO,OAAO,CAAC;AAE9B,SAAO;AACT;AAEO,SAAS,YAAY,OAAsB;AAChD,SAAO,MAAM,OAAO,CAAA,SAAQ,KAAK,YAAY,GAAG;AAClD;"}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import "vue";
|
|
2
|
-
import { getActiveElement } from "../../shared/getActiveElement.js";
|
|
3
|
-
const AUTOFOCUS_ON_MOUNT = "focusScope.autoFocusOnMount";
|
|
4
|
-
const AUTOFOCUS_ON_UNMOUNT = "focusScope.autoFocusOnUnmount";
|
|
5
|
-
const EVENT_OPTIONS = { bubbles: false, cancelable: true };
|
|
6
|
-
function focusFirst(candidates, { select = false } = {}) {
|
|
7
|
-
const previouslyFocusedElement = getActiveElement();
|
|
8
|
-
for (const candidate of candidates) {
|
|
9
|
-
focus(candidate, { select });
|
|
10
|
-
if (getActiveElement() !== previouslyFocusedElement) return true;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
function getTabbableEdges(container) {
|
|
14
|
-
const candidates = getTabbableCandidates(container);
|
|
15
|
-
const first = findVisible(candidates, container);
|
|
16
|
-
const last = findVisible(candidates.reverse(), container);
|
|
17
|
-
return [first, last];
|
|
18
|
-
}
|
|
19
|
-
function getTabbableCandidates(container) {
|
|
20
|
-
const nodes = [];
|
|
21
|
-
const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, {
|
|
22
|
-
acceptNode: (node) => {
|
|
23
|
-
const isHiddenInput = node.tagName === "INPUT" && node.type === "hidden";
|
|
24
|
-
if (node.disabled || node.hidden || isHiddenInput)
|
|
25
|
-
return NodeFilter.FILTER_SKIP;
|
|
26
|
-
return node.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
while (walker.nextNode()) nodes.push(walker.currentNode);
|
|
30
|
-
return nodes;
|
|
31
|
-
}
|
|
32
|
-
function findVisible(elements, container) {
|
|
33
|
-
for (const element of elements) {
|
|
34
|
-
if (!isHidden(element, { upTo: container })) return element;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
function isHidden(node, { upTo }) {
|
|
38
|
-
if (getComputedStyle(node).visibility === "hidden") return true;
|
|
39
|
-
while (node) {
|
|
40
|
-
if (upTo !== void 0 && node === upTo) return false;
|
|
41
|
-
if (getComputedStyle(node).display === "none") return true;
|
|
42
|
-
node = node.parentElement;
|
|
43
|
-
}
|
|
44
|
-
return false;
|
|
45
|
-
}
|
|
46
|
-
function isSelectableInput(element) {
|
|
47
|
-
return element instanceof HTMLInputElement && "select" in element;
|
|
48
|
-
}
|
|
49
|
-
function focus(element, { select = false } = {}) {
|
|
50
|
-
if (element && element.focus) {
|
|
51
|
-
const previouslyFocusedElement = getActiveElement();
|
|
52
|
-
element.focus({ preventScroll: true });
|
|
53
|
-
if (element !== previouslyFocusedElement && isSelectableInput(element) && select) {
|
|
54
|
-
element.select();
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
export {
|
|
59
|
-
AUTOFOCUS_ON_MOUNT,
|
|
60
|
-
AUTOFOCUS_ON_UNMOUNT,
|
|
61
|
-
EVENT_OPTIONS,
|
|
62
|
-
findVisible,
|
|
63
|
-
focus,
|
|
64
|
-
focusFirst,
|
|
65
|
-
getTabbableCandidates,
|
|
66
|
-
getTabbableEdges,
|
|
67
|
-
isHidden,
|
|
68
|
-
isSelectableInput
|
|
69
|
-
};
|
|
70
|
-
//# sourceMappingURL=utils.js.map
|