yuyeon 0.3.4-rc.4 → 0.3.6-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/style.css +1 -1
- package/dist/yuyeon.js +3963 -3707
- package/dist/yuyeon.umd.cjs +3 -3
- package/lib/abstract/items.js.map +1 -1
- package/lib/components/alert/YAlert.js +1 -2
- package/lib/components/alert/YAlert.js.map +1 -1
- package/lib/components/alert/index.js.map +1 -1
- package/lib/components/app/YApp.js +2 -2
- package/lib/components/app/YApp.js.map +1 -1
- package/lib/components/app/index.js.map +1 -1
- package/lib/components/badge/YBadge.js +7 -5
- package/lib/components/badge/YBadge.js.map +1 -1
- package/lib/components/badge/YBadge.scss +87 -86
- package/lib/components/badge/index.js.map +1 -1
- package/lib/components/bench/YBench.js +3 -4
- package/lib/components/bench/YBench.js.map +1 -1
- package/lib/components/bench/index.js.map +1 -1
- package/lib/components/button/YButton.js +1 -2
- package/lib/components/button/YButton.js.map +1 -1
- package/lib/components/button/index.js.map +1 -1
- package/lib/components/card/YCard.js.map +1 -1
- package/lib/components/card/YCard.scss +2 -2
- package/lib/components/card/YCardBody.js.map +1 -1
- package/lib/components/card/YCardFooter.js.map +1 -1
- package/lib/components/card/YCardHeader.js.map +1 -1
- package/lib/components/card/index.js.map +1 -1
- package/lib/components/checkbox/YCheckbox.js +1 -2
- package/lib/components/checkbox/YCheckbox.js.map +1 -1
- package/lib/components/checkbox/YInputCheckbox.js +1 -2
- package/lib/components/checkbox/YInputCheckbox.js.map +1 -1
- package/lib/components/checkbox/index.js.map +1 -1
- package/lib/components/chip/YChip.js +1 -2
- package/lib/components/chip/YChip.js.map +1 -1
- package/lib/components/chip/index.js.map +1 -1
- package/lib/components/date-picker/YDateCalendar.js +59 -54
- package/lib/components/date-picker/YDateCalendar.js.map +1 -1
- package/lib/components/date-picker/YDatePicker.js +24 -25
- package/lib/components/date-picker/YDatePicker.js.map +1 -1
- package/lib/components/date-picker/YDatePickerControl.js +19 -20
- package/lib/components/date-picker/YDatePickerControl.js.map +1 -1
- package/lib/components/date-picker/YMonthPicker.js +10 -11
- package/lib/components/date-picker/YMonthPicker.js.map +1 -1
- package/lib/components/date-picker/YYearPicker.js +11 -13
- package/lib/components/date-picker/YYearPicker.js.map +1 -1
- package/lib/components/date-picker/index.js.map +1 -1
- package/lib/components/default-provider/YDefaultProvider.js.map +1 -1
- package/lib/components/default-provider/index.js.map +1 -1
- package/lib/components/dialog/YDialog.js +32 -32
- package/lib/components/dialog/YDialog.js.map +1 -1
- package/lib/components/dialog/index.js.map +1 -1
- package/lib/components/divider/YDivider.js +5 -5
- package/lib/components/divider/YDivider.js.map +1 -1
- package/lib/components/divider/index.js.map +1 -1
- package/lib/components/draggable/YDraggable.js +10 -11
- package/lib/components/draggable/YDraggable.js.map +1 -1
- package/lib/components/draggable/index.js.map +1 -1
- package/lib/components/dropdown/YDropdown.js +16 -17
- package/lib/components/dropdown/YDropdown.js.map +1 -1
- package/lib/components/dropdown/index.js.map +1 -1
- package/lib/components/field-input/YFieldInput.js +39 -39
- package/lib/components/field-input/YFieldInput.js.map +1 -1
- package/lib/components/field-input/index.js.map +1 -1
- package/lib/components/form/YForm.js +12 -14
- package/lib/components/form/YForm.js.map +1 -1
- package/lib/components/form/index.js.map +1 -1
- package/lib/components/hover/YHover.js +9 -8
- package/lib/components/hover/YHover.js.map +1 -1
- package/lib/components/hover/index.js.map +1 -1
- package/lib/components/icon/YIcon.js +2 -4
- package/lib/components/icon/YIcon.js.map +1 -1
- package/lib/components/icon/index.js.map +1 -1
- package/lib/components/icons/YIconCheckbox.js +7 -6
- package/lib/components/icons/YIconCheckbox.js.map +1 -1
- package/lib/components/icons/YIconCheckbox.scss +4 -5
- package/lib/components/icons/YIconClear.js +2 -1
- package/lib/components/icons/YIconClear.js.map +1 -1
- package/lib/components/icons/YIconDropdown.js +2 -1
- package/lib/components/icons/YIconDropdown.js.map +1 -1
- package/lib/components/icons/YIconExpand.js +1 -0
- package/lib/components/icons/YIconExpand.js.map +1 -1
- package/lib/components/icons/YIconPageControl.js +7 -6
- package/lib/components/icons/YIconPageControl.js.map +1 -1
- package/lib/components/icons/YIconSort.js +6 -5
- package/lib/components/icons/YIconSort.js.map +1 -1
- package/lib/components/icons/YIconSort.scss +2 -0
- package/lib/components/icons/index.js.map +1 -1
- package/lib/components/img/YImg.js +38 -33
- package/lib/components/img/YImg.js.map +1 -1
- package/lib/components/img/index.js +1 -1
- package/lib/components/img/index.js.map +1 -1
- package/lib/components/index.js +1 -0
- package/lib/components/index.js.map +1 -1
- package/lib/components/input/YInput.js +1 -2
- package/lib/components/input/YInput.js.map +1 -1
- package/lib/components/input/YInput.scss +9 -8
- package/lib/components/input/index.js.map +1 -1
- package/lib/components/ip-field/YIpv4Field.js +1 -2
- package/lib/components/ip-field/YIpv4Field.js.map +1 -1
- package/lib/components/ip-field/index.js.map +1 -1
- package/lib/components/layer/YLayer.js +38 -25
- package/lib/components/layer/YLayer.js.map +1 -1
- package/lib/components/layer/active-delay.js.map +1 -1
- package/lib/components/layer/active-stack.js.map +1 -1
- package/lib/components/layer/base.js +11 -1
- package/lib/components/layer/base.js.map +1 -1
- package/lib/components/layer/content.js.map +1 -1
- package/lib/components/layer/index.js.map +1 -1
- package/lib/components/layer/scroll-strategies.js.map +1 -1
- package/lib/components/list/YList.js +1 -2
- package/lib/components/list/YList.js.map +1 -1
- package/lib/components/list/YListItem.js +1 -2
- package/lib/components/list/YListItem.js.map +1 -1
- package/lib/components/list/index.js.map +1 -1
- package/lib/components/loading/YSpinnerRing.js.map +1 -1
- package/lib/components/loading/index.js.map +1 -1
- package/lib/components/menu/YMenu.js +22 -25
- package/lib/components/menu/YMenu.js.map +1 -1
- package/lib/components/menu/YMenu.scss +3 -4
- package/lib/components/menu/index.js.map +1 -1
- package/lib/components/navigation/YNavigation.js +1 -2
- package/lib/components/navigation/YNavigation.js.map +1 -1
- package/lib/components/navigation/index.js.map +1 -1
- package/lib/components/pagination/YPagination.js +1 -2
- package/lib/components/pagination/YPagination.js.map +1 -1
- package/lib/components/pagination/index.js.map +1 -1
- package/lib/components/panel/YDividePanel.js +1 -2
- package/lib/components/panel/YDividePanel.js.map +1 -1
- package/lib/components/panel/YDividePanel.scss +44 -43
- package/lib/components/panel/index.js.map +1 -1
- package/lib/components/plate/YPlate.js +1 -2
- package/lib/components/plate/YPlate.js.map +1 -1
- package/lib/components/plate/index.js.map +1 -1
- package/lib/components/progress-bar/YProgressBar.js +1 -2
- package/lib/components/progress-bar/YProgressBar.js.map +1 -1
- package/lib/components/progress-bar/index.js.map +1 -1
- package/lib/components/progress-ring/YProgressRing.js +3 -4
- package/lib/components/progress-ring/YProgressRing.js.map +1 -1
- package/lib/components/progress-ring/index.js.map +1 -1
- package/lib/components/radio/YRadio.js +1 -1
- package/lib/components/radio/YRadio.js.map +1 -1
- package/lib/components/radio/YRadioIcon.js.map +1 -1
- package/lib/components/radio/YRadioIcon.scss +2 -3
- package/lib/components/radio/index.js.map +1 -1
- package/lib/components/select/YSelect.js +41 -42
- package/lib/components/select/YSelect.js.map +1 -1
- package/lib/components/select/index.js.map +1 -1
- package/lib/components/slider/YSlider.js.map +1 -1
- package/lib/components/slider/index.js.map +1 -1
- package/lib/components/slider/slider.js.map +1 -1
- package/lib/components/snackbar/YSnackbar.js +6 -6
- package/lib/components/snackbar/YSnackbar.js.map +1 -1
- package/lib/components/snackbar/index.js.map +1 -1
- package/lib/components/switch/YSwitch.js +1 -2
- package/lib/components/switch/YSwitch.js.map +1 -1
- package/lib/components/switch/index.js.map +1 -1
- package/lib/components/tab/YTab.js +2 -3
- package/lib/components/tab/YTab.js.map +1 -1
- package/lib/components/tab/YTab.scss +1 -1
- package/lib/components/tab/YTabs.js +1 -2
- package/lib/components/tab/YTabs.js.map +1 -1
- package/lib/components/tab/index.js.map +1 -1
- package/lib/components/tab/shared.js.map +1 -1
- package/lib/components/tab/types.js.map +1 -1
- package/lib/components/table/YDataTable.js +1 -2
- package/lib/components/table/YDataTable.js.map +1 -1
- package/lib/components/table/YDataTableBody.js +2 -3
- package/lib/components/table/YDataTableBody.js.map +1 -1
- package/lib/components/table/YDataTableCell.js +1 -2
- package/lib/components/table/YDataTableCell.js.map +1 -1
- package/lib/components/table/YDataTableControl.js +1 -1
- package/lib/components/table/YDataTableControl.js.map +1 -1
- package/lib/components/table/YDataTableControl.scss +17 -17
- package/lib/components/table/YDataTableHead.js +1 -1
- package/lib/components/table/YDataTableHead.js.map +1 -1
- package/lib/components/table/YDataTableLayer.js +1 -2
- package/lib/components/table/YDataTableLayer.js.map +1 -1
- package/lib/components/table/YDataTableLayerRow.js +1 -2
- package/lib/components/table/YDataTableLayerRow.js.map +1 -1
- package/lib/components/table/YDataTableLayerRows.js +3 -4
- package/lib/components/table/YDataTableLayerRows.js.map +1 -1
- package/lib/components/table/YDataTableRow.js +1 -2
- package/lib/components/table/YDataTableRow.js.map +1 -1
- package/lib/components/table/YDataTableServer.js +1 -2
- package/lib/components/table/YDataTableServer.js.map +1 -1
- package/lib/components/table/YTable.js +1 -2
- package/lib/components/table/YTable.js.map +1 -1
- package/lib/components/table/composables/expand.js.map +1 -1
- package/lib/components/table/composables/header.js.map +1 -1
- package/lib/components/table/composables/items.js.map +1 -1
- package/lib/components/table/composables/measure.js +1 -1
- package/lib/components/table/composables/measure.js.map +1 -1
- package/lib/components/table/composables/options.js.map +1 -1
- package/lib/components/table/composables/pagination.js.map +1 -1
- package/lib/components/table/composables/provides.js.map +1 -1
- package/lib/components/table/composables/selection.js.map +1 -1
- package/lib/components/table/composables/sorted-items.js.map +1 -1
- package/lib/components/table/composables/sorting.js.map +1 -1
- package/lib/components/table/index.js.map +1 -1
- package/lib/components/table/types/common.js.map +1 -1
- package/lib/components/table/types/header.js.map +1 -1
- package/lib/components/table/types/index.js.map +1 -1
- package/lib/components/table/types/item.js.map +1 -1
- package/lib/components/table/types/row.js.map +1 -1
- package/lib/components/text-ellipsis/YTextEllipsis.js +1 -2
- package/lib/components/text-ellipsis/YTextEllipsis.js.map +1 -1
- package/lib/components/text-ellipsis/index.js.map +1 -1
- package/lib/components/text-highlighter/YTextHighlighter.js.map +1 -1
- package/lib/components/text-highlighter/index.js.map +1 -1
- package/lib/components/text-interpolation/YTi.js +2 -2
- package/lib/components/text-interpolation/YTi.js.map +1 -1
- package/lib/components/text-interpolation/index.js.map +1 -1
- package/lib/components/textarea/YTextarea.js +1 -2
- package/lib/components/textarea/YTextarea.js.map +1 -1
- package/lib/components/textarea/index.js.map +1 -1
- package/lib/components/toggle-button/YToggleButton.js.map +1 -1
- package/lib/components/toggle-button/index.js.map +1 -1
- package/lib/components/tooltip/YTooltip.js +20 -21
- package/lib/components/tooltip/YTooltip.js.map +1 -1
- package/lib/components/tooltip/index.js.map +1 -1
- package/lib/components/transitions/expand-transition.js.map +1 -1
- package/lib/components/transitions/index.js.map +1 -1
- package/lib/components/tree-view/YTreeView.js +23 -29
- package/lib/components/tree-view/YTreeView.js.map +1 -1
- package/lib/components/tree-view/YTreeViewNode.js +58 -21
- package/lib/components/tree-view/YTreeViewNode.js.map +1 -1
- package/lib/components/tree-view/index.js.map +1 -1
- package/lib/components/tree-view/tree-view.js +61 -8
- package/lib/components/tree-view/tree-view.js.map +1 -1
- package/lib/components/tree-view/types.js.map +1 -1
- package/lib/components/tree-view/util.js.map +1 -1
- package/lib/composables/choice-link.js.map +1 -1
- package/lib/composables/choice.js.map +1 -1
- package/lib/composables/communication.js.map +1 -1
- package/lib/composables/component.js.map +1 -1
- package/lib/composables/coordinate/arrangement.js.map +1 -1
- package/lib/composables/coordinate/index.js +23 -13
- package/lib/composables/coordinate/index.js.map +1 -1
- package/lib/composables/coordinate/levitation.js +79 -50
- package/lib/composables/coordinate/levitation.js.map +1 -1
- package/lib/composables/coordinate/types.js.map +1 -1
- package/lib/composables/coordinate/utils/point.js.map +1 -1
- package/lib/composables/date/factory.js.map +1 -1
- package/lib/composables/date/index.js.map +1 -1
- package/lib/composables/date/setting.js.map +1 -1
- package/lib/composables/date/types.js.map +1 -1
- package/lib/composables/defaults/index.js.map +1 -1
- package/lib/composables/defaults/share.js.map +1 -1
- package/lib/composables/defaults/types.js.map +1 -1
- package/lib/composables/dimension.js.map +1 -1
- package/lib/composables/focus.js.map +1 -1
- package/lib/composables/form.js +5 -5
- package/lib/composables/form.js.map +1 -1
- package/lib/composables/i18n/index.js.map +1 -1
- package/lib/composables/i18n/locale.js.map +1 -1
- package/lib/composables/i18n/rtl.js.map +1 -1
- package/lib/composables/i18n/share.js.map +1 -1
- package/lib/composables/icon.js +1 -2
- package/lib/composables/icon.js.map +1 -1
- package/lib/composables/index.js.map +1 -1
- package/lib/composables/layer-group.js.map +1 -1
- package/lib/composables/layout.js.map +1 -1
- package/lib/composables/list-items.js.map +1 -1
- package/lib/composables/progress.js.map +1 -1
- package/lib/composables/ref.js.map +1 -1
- package/lib/composables/resize-observer.js.map +1 -1
- package/lib/composables/scope.js.map +1 -1
- package/lib/composables/style-color.js +6 -5
- package/lib/composables/style-color.js.map +1 -1
- package/lib/composables/theme/factory.js.map +1 -1
- package/lib/composables/theme/helper.js.map +1 -1
- package/lib/composables/theme/index.js +8 -1
- package/lib/composables/theme/index.js.map +1 -1
- package/lib/composables/theme/setting.js.map +1 -1
- package/lib/composables/theme/types.js.map +1 -1
- package/lib/composables/timing.js +13 -5
- package/lib/composables/timing.js.map +1 -1
- package/lib/composables/transition.js.map +1 -1
- package/lib/composables/validation.js.map +1 -1
- package/lib/composables/vue-router.js.map +1 -1
- package/lib/directives/complement-click/index.js.map +1 -1
- package/lib/directives/index.js +3 -0
- package/lib/directives/index.js.map +1 -0
- package/lib/directives/plate-wave/index.js.map +1 -1
- package/lib/directives/plate-wave/plate-wave.scss +44 -33
- package/lib/directives/theme-class/index.js +24 -0
- package/lib/directives/theme-class/index.js.map +1 -0
- package/lib/etc/index.js.map +1 -1
- package/lib/i18n/built-in.js.map +1 -1
- package/lib/i18n/config.js.map +1 -1
- package/lib/i18n/types.js.map +1 -1
- package/lib/index.js +3 -3
- package/lib/index.js.map +1 -1
- package/lib/locales/en.js.map +1 -1
- package/lib/locales/index.js.map +1 -1
- package/lib/locales/ko.js.map +1 -1
- package/lib/mixins/di.js.map +1 -1
- package/lib/mixins/rebind-attrs.js +0 -2
- package/lib/mixins/rebind-attrs.js.map +1 -1
- package/lib/styles/_elevation.scss +0 -1
- package/lib/styles/base.scss +3 -1
- package/lib/styles/settings/_elevation.scss +12 -12
- package/lib/styles/settings/_provided.scss +33 -33
- package/lib/styles/theme/dark.scss +3 -3
- package/lib/styles/theme/index.scss +4 -5
- package/lib/styles/theme/light.scss +3 -3
- package/lib/styles/util/_mixin.scss +16 -16
- package/lib/types/index.js.map +1 -1
- package/lib/util/anchor.js.map +1 -1
- package/lib/util/array.js.map +1 -1
- package/lib/util/collection.js.map +1 -1
- package/lib/util/color/apca.js +31 -30
- package/lib/util/color/apca.js.map +1 -1
- package/lib/util/color/const.js.map +1 -1
- package/lib/util/color/contrast/contrast.js.map +1 -1
- package/lib/util/color/conversion.js.map +1 -1
- package/lib/util/color/hct/cam16.js +95 -95
- package/lib/util/color/hct/cam16.js.map +1 -1
- package/lib/util/color/hct/hct-solver.js +113 -113
- package/lib/util/color/hct/hct-solver.js.map +1 -1
- package/lib/util/color/hct/hct.js +71 -71
- package/lib/util/color/hct/hct.js.map +1 -1
- package/lib/util/color/hct/viewing-conditions.js +6 -4
- package/lib/util/color/hct/viewing-conditions.js.map +1 -1
- package/lib/util/color/index.js +12 -12
- package/lib/util/color/index.js.map +1 -1
- package/lib/util/color/palettes/core-palette.js.map +1 -1
- package/lib/util/color/palettes/tonal-palette.js +3 -3
- package/lib/util/color/palettes/tonal-palette.js.map +1 -1
- package/lib/util/color/types.js.map +1 -1
- package/lib/util/color/utils/math-utils.js +62 -62
- package/lib/util/color/utils/math-utils.js.map +1 -1
- package/lib/util/common.js +28 -13
- package/lib/util/common.js.map +1 -1
- package/lib/util/component/component.js.map +1 -1
- package/lib/util/component/index.js.map +1 -1
- package/lib/util/component/inject-self.js.map +1 -1
- package/lib/util/component/props.js.map +1 -1
- package/lib/util/component/types.js.map +1 -1
- package/lib/util/date/adapters/yuyeon-date-adapter.js +3 -3
- package/lib/util/date/adapters/yuyeon-date-adapter.js.map +1 -1
- package/lib/util/date/built-in.js +2 -0
- package/lib/util/date/built-in.js.map +1 -1
- package/lib/util/date/index.js +1 -1
- package/lib/util/date/index.js.map +1 -1
- package/lib/util/date/types.js.map +1 -1
- package/lib/util/debounce.js +1 -1
- package/lib/util/debounce.js.map +1 -1
- package/lib/util/dom.js +10 -1
- package/lib/util/dom.js.map +1 -1
- package/lib/util/environments.js.map +1 -1
- package/lib/util/frame-scheduler.js +3 -3
- package/lib/util/frame-scheduler.js.map +1 -1
- package/lib/util/index.js +11 -11
- package/lib/util/index.js.map +1 -1
- package/lib/util/reactivity.js +3 -3
- package/lib/util/reactivity.js.map +1 -1
- package/lib/util/rect.js.map +1 -1
- package/lib/util/scroll.js.map +1 -1
- package/lib/util/string.js +3 -1
- package/lib/util/string.js.map +1 -1
- package/lib/util/ui.js +8 -7
- package/lib/util/ui.js.map +1 -1
- package/lib/util/validation.js.map +1 -1
- package/package.json +11 -2
- package/types/abstract/items.d.ts +4 -4
- package/types/components/alert/YAlert.d.ts +2 -2
- package/types/components/badge/YBadge.d.ts +9 -3
- package/types/components/button/YButton.d.ts +3 -3
- package/types/components/checkbox/YCheckbox.d.ts +4 -4
- package/types/components/chip/YChip.d.ts +0 -3
- package/types/components/date-picker/YDateCalendar.d.ts +4 -3
- package/types/components/date-picker/YDatePickerControl.d.ts +7 -7
- package/types/components/dialog/YDialog.d.ts +116 -6484
- package/types/components/draggable/YDraggable.d.ts +6 -6
- package/types/components/dropdown/YDropdown.d.ts +87 -87
- package/types/components/field-input/YFieldInput.d.ts +14 -14
- package/types/components/form/YForm.d.ts +3 -3
- package/types/components/icon/YIcon.d.ts +4 -4
- package/types/components/icons/YIconPageControl.d.ts +1 -1
- package/types/components/icons/YIconSort.d.ts +1 -1
- package/types/components/icons/index.d.ts +4 -4
- package/types/components/img/YImg.d.ts +30 -27
- package/types/components/img/index.d.ts +1 -0
- package/types/components/index.d.ts +1 -0
- package/types/components/input/YInput.d.ts +13 -13
- package/types/components/ip-field/YIpv4Field.d.ts +5 -5
- package/types/components/layer/YLayer.d.ts +59 -3242
- package/types/components/layer/base.d.ts +4 -0
- package/types/components/layer/scroll-strategies.d.ts +4 -4
- package/types/components/menu/YMenu.d.ts +83 -6451
- package/types/components/pagination/YPagination.d.ts +3 -3
- package/types/components/select/YSelect.d.ts +172 -496
- package/types/components/slider/YSlider.d.ts +1 -1
- package/types/components/snackbar/YSnackbar.d.ts +55 -55
- package/types/components/tab/YTab.d.ts +3 -3
- package/types/components/tab/YTabs.d.ts +1 -1
- package/types/components/table/YDataTable.d.ts +30 -87
- package/types/components/table/YDataTableBody.d.ts +3 -3
- package/types/components/table/YDataTableCell.d.ts +2 -2
- package/types/components/table/YDataTableControl.d.ts +6 -6
- package/types/components/table/YDataTableLayer.d.ts +2 -2
- package/types/components/table/YDataTableRow.d.ts +1 -1
- package/types/components/table/YDataTableServer.d.ts +37 -94
- package/types/components/table/YTable.d.ts +3 -3
- package/types/components/table/composables/expand.d.ts +4 -4
- package/types/components/table/composables/header.d.ts +16 -48
- package/types/components/table/composables/items.d.ts +2 -2
- package/types/components/table/composables/pagination.d.ts +10 -10
- package/types/components/table/composables/selection.d.ts +6 -6
- package/types/components/table/composables/sorting.d.ts +8 -14
- package/types/components/table/types/item.d.ts +1 -1
- package/types/components/textarea/YTextarea.d.ts +30 -30
- package/types/components/tooltip/YTooltip.d.ts +67 -67
- package/types/components/tree-view/YTreeView.d.ts +21 -29
- package/types/components/tree-view/YTreeViewNode.d.ts +76 -6
- package/types/components/tree-view/tree-view.d.ts +19 -3
- package/types/composables/choice.d.ts +2 -2
- package/types/composables/coordinate/index.d.ts +28 -3207
- package/types/composables/coordinate/levitation.d.ts +4 -2
- package/types/composables/coordinate/types.d.ts +1 -0
- package/types/composables/dimension.d.ts +6 -6
- package/types/composables/form.d.ts +17 -27
- package/types/composables/list-items.d.ts +3 -3
- package/types/composables/style-color.d.ts +22 -1
- package/types/composables/theme/index.d.ts +1 -0
- package/types/composables/transition.d.ts +10 -10
- package/types/composables/validation.d.ts +6 -6
- package/types/composables/vue-router.d.ts +3 -3
- package/types/declares.d.ts +1 -0
- package/types/directives/index.d.ts +2 -0
- package/types/directives/plate-wave/index.d.ts +7 -1
- package/types/globals.d.ts +4 -5
- package/types/shims.d.ts +65 -59
- package/types/types/index.d.ts +3 -0
- package/types/util/anchor.d.ts +1 -1
- package/types/util/common.d.ts +3 -0
- package/types/util/component/component.d.ts +1 -2
- package/types/util/component/props.d.ts +1 -1
- package/types/util/component/types.d.ts +1 -1
- package/types/util/date/index.d.ts +1 -1
- package/types/util/dom.d.ts +2 -0
- package/types/util/index.d.ts +11 -11
- package/types/components/table/composibles/header.d.ts +0 -207
- package/types/components/table/composibles/items.d.ts +0 -55
- package/types/components/table/composibles/measure.d.ts +0 -8
- package/types/components/table/composibles/options.d.ts +0 -11
- package/types/components/table/composibles/pagination.d.ts +0 -81
- package/types/components/table/composibles/selection.d.ts +0 -82
- package/types/components/table/composibles/sorted-items.d.ts +0 -7
- package/types/components/table/composibles/sorting.d.ts +0 -62
- /package/types/directives/{theme-class.d.ts → theme-class/index.d.ts} +0 -0
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2021 Google LLC
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
* you may not use this file except in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
* See the License for the specific language governing permissions and
|
|
15
|
-
* limitations under the License.
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2021 Google LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
-
/**
|
|
19
|
-
* Utility methods for mathematical operations.
|
|
18
|
+
/**
|
|
19
|
+
* Utility methods for mathematical operations.
|
|
20
20
|
*/
|
|
21
21
|
|
|
22
|
-
/**
|
|
23
|
-
* The signum function.
|
|
24
|
-
*
|
|
25
|
-
* @return 1 if num > 0, -1 if num < 0, and 0 if num = 0
|
|
22
|
+
/**
|
|
23
|
+
* The signum function.
|
|
24
|
+
*
|
|
25
|
+
* @return 1 if num > 0, -1 if num < 0, and 0 if num = 0
|
|
26
26
|
*/
|
|
27
27
|
export function signum(num) {
|
|
28
28
|
if (num < 0) {
|
|
@@ -34,20 +34,20 @@ export function signum(num) {
|
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
/**
|
|
38
|
-
* The linear interpolation function.
|
|
39
|
-
*
|
|
40
|
-
* @return start if amount = 0 and stop if amount = 1
|
|
37
|
+
/**
|
|
38
|
+
* The linear interpolation function.
|
|
39
|
+
*
|
|
40
|
+
* @return start if amount = 0 and stop if amount = 1
|
|
41
41
|
*/
|
|
42
42
|
export function lerp(start, stop, amount) {
|
|
43
43
|
return (1.0 - amount) * start + amount * stop;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
/**
|
|
47
|
-
* Clamps an integer between two integers.
|
|
48
|
-
*
|
|
49
|
-
* @return input when min <= input <= max, and either min or max
|
|
50
|
-
* otherwise.
|
|
46
|
+
/**
|
|
47
|
+
* Clamps an integer between two integers.
|
|
48
|
+
*
|
|
49
|
+
* @return input when min <= input <= max, and either min or max
|
|
50
|
+
* otherwise.
|
|
51
51
|
*/
|
|
52
52
|
export function clampInt(min, max, input) {
|
|
53
53
|
if (input < min) {
|
|
@@ -58,11 +58,11 @@ export function clampInt(min, max, input) {
|
|
|
58
58
|
return input;
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
/**
|
|
62
|
-
* Clamps an integer between two floating-point numbers.
|
|
63
|
-
*
|
|
64
|
-
* @return input when min <= input <= max, and either min or max
|
|
65
|
-
* otherwise.
|
|
61
|
+
/**
|
|
62
|
+
* Clamps an integer between two floating-point numbers.
|
|
63
|
+
*
|
|
64
|
+
* @return input when min <= input <= max, and either min or max
|
|
65
|
+
* otherwise.
|
|
66
66
|
*/
|
|
67
67
|
export function clampDouble(min, max, input) {
|
|
68
68
|
if (input < min) {
|
|
@@ -73,11 +73,11 @@ export function clampDouble(min, max, input) {
|
|
|
73
73
|
return input;
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
/**
|
|
77
|
-
* Sanitizes a degree measure as an integer.
|
|
78
|
-
*
|
|
79
|
-
* @return a degree measure between 0 (inclusive) and 360
|
|
80
|
-
* (exclusive).
|
|
76
|
+
/**
|
|
77
|
+
* Sanitizes a degree measure as an integer.
|
|
78
|
+
*
|
|
79
|
+
* @return a degree measure between 0 (inclusive) and 360
|
|
80
|
+
* (exclusive).
|
|
81
81
|
*/
|
|
82
82
|
export function sanitizeDegreesInt(degrees) {
|
|
83
83
|
degrees = degrees % 360;
|
|
@@ -87,11 +87,11 @@ export function sanitizeDegreesInt(degrees) {
|
|
|
87
87
|
return degrees;
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
-
/**
|
|
91
|
-
* Sanitizes a degree measure as a floating-point number.
|
|
92
|
-
*
|
|
93
|
-
* @return a degree measure between 0.0 (inclusive) and 360.0
|
|
94
|
-
* (exclusive).
|
|
90
|
+
/**
|
|
91
|
+
* Sanitizes a degree measure as a floating-point number.
|
|
92
|
+
*
|
|
93
|
+
* @return a degree measure between 0.0 (inclusive) and 360.0
|
|
94
|
+
* (exclusive).
|
|
95
95
|
*/
|
|
96
96
|
export function sanitizeDegreesDouble(degrees) {
|
|
97
97
|
degrees = degrees % 360.0;
|
|
@@ -101,34 +101,34 @@ export function sanitizeDegreesDouble(degrees) {
|
|
|
101
101
|
return degrees;
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
-
/**
|
|
105
|
-
* Sign of direction change needed to travel from one angle to
|
|
106
|
-
* another.
|
|
107
|
-
*
|
|
108
|
-
* For angles that are 180 degrees apart from each other, both
|
|
109
|
-
* directions have the same travel distance, so either direction is
|
|
110
|
-
* shortest. The value 1.0 is returned in this case.
|
|
111
|
-
*
|
|
112
|
-
* @param from The angle travel starts from, in degrees.
|
|
113
|
-
* @param to The angle travel ends at, in degrees.
|
|
114
|
-
* @return -1 if decreasing from leads to the shortest travel
|
|
115
|
-
* distance, 1 if increasing from leads to the shortest travel
|
|
116
|
-
* distance.
|
|
104
|
+
/**
|
|
105
|
+
* Sign of direction change needed to travel from one angle to
|
|
106
|
+
* another.
|
|
107
|
+
*
|
|
108
|
+
* For angles that are 180 degrees apart from each other, both
|
|
109
|
+
* directions have the same travel distance, so either direction is
|
|
110
|
+
* shortest. The value 1.0 is returned in this case.
|
|
111
|
+
*
|
|
112
|
+
* @param from The angle travel starts from, in degrees.
|
|
113
|
+
* @param to The angle travel ends at, in degrees.
|
|
114
|
+
* @return -1 if decreasing from leads to the shortest travel
|
|
115
|
+
* distance, 1 if increasing from leads to the shortest travel
|
|
116
|
+
* distance.
|
|
117
117
|
*/
|
|
118
118
|
export function rotationDirection(from, to) {
|
|
119
119
|
const increasingDifference = sanitizeDegreesDouble(to - from);
|
|
120
120
|
return increasingDifference <= 180.0 ? 1.0 : -1.0;
|
|
121
121
|
}
|
|
122
122
|
|
|
123
|
-
/**
|
|
124
|
-
* Distance of two points on a circle, represented using degrees.
|
|
123
|
+
/**
|
|
124
|
+
* Distance of two points on a circle, represented using degrees.
|
|
125
125
|
*/
|
|
126
126
|
export function differenceDegrees(a, b) {
|
|
127
127
|
return 180.0 - Math.abs(Math.abs(a - b) - 180.0);
|
|
128
128
|
}
|
|
129
129
|
|
|
130
|
-
/**
|
|
131
|
-
* Multiplies a 1x3 row vector with a 3x3 matrix.
|
|
130
|
+
/**
|
|
131
|
+
* Multiplies a 1x3 row vector with a 3x3 matrix.
|
|
132
132
|
*/
|
|
133
133
|
export function matrixMultiply(row, matrix) {
|
|
134
134
|
const a = row[0] * matrix[0][0] + row[1] * matrix[0][1] + row[2] * matrix[0][2];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"math-utils.js","names":["signum","num","lerp","start","stop","amount","clampInt","min","max","input","clampDouble","sanitizeDegreesInt","degrees","sanitizeDegreesDouble","rotationDirection","from","to","increasingDifference","differenceDegrees","a","b","Math","abs","matrixMultiply","row","matrix","c"],"sources":["../../../../src/util/color/utils/math-utils.ts"],"sourcesContent":["/**\
|
|
1
|
+
{"version":3,"file":"math-utils.js","names":["signum","num","lerp","start","stop","amount","clampInt","min","max","input","clampDouble","sanitizeDegreesInt","degrees","sanitizeDegreesDouble","rotationDirection","from","to","increasingDifference","differenceDegrees","a","b","Math","abs","matrixMultiply","row","matrix","c"],"sources":["../../../../src/util/color/utils/math-utils.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Utility methods for mathematical operations.\n */\n\n/**\n * The signum function.\n *\n * @return 1 if num > 0, -1 if num < 0, and 0 if num = 0\n */\nexport function signum(num: number): number {\n if (num < 0) {\n return -1;\n } else if (num === 0) {\n return 0;\n } else {\n return 1;\n }\n}\n\n/**\n * The linear interpolation function.\n *\n * @return start if amount = 0 and stop if amount = 1\n */\nexport function lerp(start: number, stop: number, amount: number): number {\n return (1.0 - amount) * start + amount * stop;\n}\n\n/**\n * Clamps an integer between two integers.\n *\n * @return input when min <= input <= max, and either min or max\n * otherwise.\n */\nexport function clampInt(min: number, max: number, input: number): number {\n if (input < min) {\n return min;\n } else if (input > max) {\n return max;\n }\n\n return input;\n}\n\n/**\n * Clamps an integer between two floating-point numbers.\n *\n * @return input when min <= input <= max, and either min or max\n * otherwise.\n */\nexport function clampDouble(min: number, max: number, input: number): number {\n if (input < min) {\n return min;\n } else if (input > max) {\n return max;\n }\n\n return input;\n}\n\n/**\n * Sanitizes a degree measure as an integer.\n *\n * @return a degree measure between 0 (inclusive) and 360\n * (exclusive).\n */\nexport function sanitizeDegreesInt(degrees: number): number {\n degrees = degrees % 360;\n if (degrees < 0) {\n degrees = degrees + 360;\n }\n return degrees;\n}\n\n/**\n * Sanitizes a degree measure as a floating-point number.\n *\n * @return a degree measure between 0.0 (inclusive) and 360.0\n * (exclusive).\n */\nexport function sanitizeDegreesDouble(degrees: number): number {\n degrees = degrees % 360.0;\n if (degrees < 0) {\n degrees = degrees + 360.0;\n }\n return degrees;\n}\n\n/**\n * Sign of direction change needed to travel from one angle to\n * another.\n *\n * For angles that are 180 degrees apart from each other, both\n * directions have the same travel distance, so either direction is\n * shortest. The value 1.0 is returned in this case.\n *\n * @param from The angle travel starts from, in degrees.\n * @param to The angle travel ends at, in degrees.\n * @return -1 if decreasing from leads to the shortest travel\n * distance, 1 if increasing from leads to the shortest travel\n * distance.\n */\nexport function rotationDirection(from: number, to: number): number {\n const increasingDifference = sanitizeDegreesDouble(to - from);\n return increasingDifference <= 180.0 ? 1.0 : -1.0;\n}\n\n/**\n * Distance of two points on a circle, represented using degrees.\n */\nexport function differenceDegrees(a: number, b: number): number {\n return 180.0 - Math.abs(Math.abs(a - b) - 180.0);\n}\n\n/**\n * Multiplies a 1x3 row vector with a 3x3 matrix.\n */\nexport function matrixMultiply(row: number[], matrix: number[][]): number[] {\n const a =\n row[0] * matrix[0][0] + row[1] * matrix[0][1] + row[2] * matrix[0][2];\n const b =\n row[0] * matrix[1][0] + row[1] * matrix[1][1] + row[2] * matrix[1][2];\n const c =\n row[0] * matrix[2][0] + row[1] * matrix[2][1] + row[2] * matrix[2][2];\n return [a, b, c];\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,MAAMA,CAACC,GAAW,EAAU;EAC1C,IAAIA,GAAG,GAAG,CAAC,EAAE;IACX,OAAO,CAAC,CAAC;EACX,CAAC,MAAM,IAAIA,GAAG,KAAK,CAAC,EAAE;IACpB,OAAO,CAAC;EACV,CAAC,MAAM;IACL,OAAO,CAAC;EACV;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,IAAIA,CAACC,KAAa,EAAEC,IAAY,EAAEC,MAAc,EAAU;EACxE,OAAO,CAAC,GAAG,GAAGA,MAAM,IAAIF,KAAK,GAAGE,MAAM,GAAGD,IAAI;AAC/C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASE,QAAQA,CAACC,GAAW,EAAEC,GAAW,EAAEC,KAAa,EAAU;EACxE,IAAIA,KAAK,GAAGF,GAAG,EAAE;IACf,OAAOA,GAAG;EACZ,CAAC,MAAM,IA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,CAAC;AAClD;;AAEA;AACA;AACA;AACA,OAAO,SAASG,cAAcA,CAACC,GAAa,EAAEC,MAAkB,EAAY;EAC1E,MAAMN,CAAC,GACLK,GAAG,CAAC,CAAC,CAAC,GAAGC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAGD,GAAG,CAAC,CAAC,CAAC,GAAGC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAGD,GAAG,CAAC,CAAC,CAAC,GAAGC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;EACvE,MAAML,CAAC,GACLI,GAAG,CAAC,CAAC,CAAC,GAAGC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAGD,GAAG,CAAC,CAAC,CAAC,GAAGC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAGD,GAAG,CAAC,CAAC,CAAC,GAAGC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;EACvE,MAAMC,CAAC,GACLF,GAAG,CAAC,CAAC,CAAC,GAAGC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAGD,GAAG,CAAC,CAAC,CAAC,GAAGC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAGD,GAAG,CAAC,CAAC,CAAC,GAAGC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;EACvE,OAAO,CAACN,CAAC,EAAEC,CAAC,EAAEM,CAAC,CAAC;AAClB","ignoreList":[]}
|
package/lib/util/common.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
/** biome-ignore-all lint/suspicious/useIterableCallbackReturn: <explanation> */
|
|
2
|
+
|
|
3
|
+
// biome-ignore lint/suspicious/noShadowRestrictedNames: <explanation>
|
|
1
4
|
export function hasOwnProperty(object, property) {
|
|
2
5
|
if (object) {
|
|
3
|
-
return Object.
|
|
6
|
+
return Object.hasOwn(object, property);
|
|
4
7
|
}
|
|
5
8
|
return false;
|
|
6
9
|
}
|
|
@@ -33,7 +36,7 @@ export function mergeDeep() {
|
|
|
33
36
|
continue;
|
|
34
37
|
}
|
|
35
38
|
}
|
|
36
|
-
if (typeof sourceValue ===
|
|
39
|
+
if (typeof sourceValue === "object" && typeof overwriteValue === "object") {
|
|
37
40
|
ret[key] = mergeDeep(sourceValue, overwriteValue, arrayFn);
|
|
38
41
|
continue;
|
|
39
42
|
}
|
|
@@ -44,26 +47,26 @@ export function mergeDeep() {
|
|
|
44
47
|
export function getObjectValueByPath(obj, path, fallback) {
|
|
45
48
|
// credit: http://stackoverflow.com/questions/6491463/accessing-nested-javascript-objects-with-string-key#comment55278413_6491621
|
|
46
49
|
let traversPath = path;
|
|
47
|
-
if (obj == null || !traversPath || typeof traversPath !==
|
|
50
|
+
if (obj == null || !traversPath || typeof traversPath !== "string") {
|
|
48
51
|
return fallback;
|
|
49
52
|
}
|
|
50
53
|
if (obj[traversPath] !== undefined) return obj[traversPath];
|
|
51
|
-
traversPath = traversPath.replace(/\[(\w+)\]/g,
|
|
52
|
-
traversPath = traversPath.replace(/^\./,
|
|
53
|
-
return getNestedValue(obj, traversPath.split(
|
|
54
|
+
traversPath = traversPath.replace(/\[(\w+)\]/g, ".$1"); // convert indexes to properties
|
|
55
|
+
traversPath = traversPath.replace(/^\./, ""); // strip a leading dot
|
|
56
|
+
return getNestedValue(obj, traversPath.split("."), fallback);
|
|
54
57
|
}
|
|
55
58
|
export function getPropertyFromItem(item, property, fallback) {
|
|
56
59
|
if (property == null) return item === undefined ? fallback : item;
|
|
57
60
|
if (item !== Object(item)) {
|
|
58
|
-
if (typeof property !==
|
|
61
|
+
if (typeof property !== "function") return fallback;
|
|
59
62
|
const value = property(item, fallback);
|
|
60
|
-
return typeof value ===
|
|
63
|
+
return typeof value === "undefined" ? fallback : value;
|
|
61
64
|
}
|
|
62
|
-
if (typeof property ===
|
|
65
|
+
if (typeof property === "string") return getObjectValueByPath(item, property, fallback);
|
|
63
66
|
if (Array.isArray(property)) return getNestedValue(item, property, fallback);
|
|
64
|
-
if (typeof property !==
|
|
67
|
+
if (typeof property !== "function") return fallback;
|
|
65
68
|
const value = property(item, fallback);
|
|
66
|
-
return typeof value ===
|
|
69
|
+
return typeof value === "undefined" ? fallback : value;
|
|
67
70
|
}
|
|
68
71
|
export function clamp(value) {
|
|
69
72
|
let min = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
@@ -92,10 +95,10 @@ export function deepEqual(a, b) {
|
|
|
92
95
|
}
|
|
93
96
|
export function isObject(obj) {
|
|
94
97
|
const type = typeof obj;
|
|
95
|
-
return obj !== null && (type ===
|
|
98
|
+
return obj !== null && (type === "object" || type === "function");
|
|
96
99
|
}
|
|
97
100
|
export function isEmpty(target) {
|
|
98
|
-
return target == null || target?.trim() ===
|
|
101
|
+
return target == null || target?.trim() === "";
|
|
99
102
|
}
|
|
100
103
|
export function omit(obj, excludes) {
|
|
101
104
|
const ret = {
|
|
@@ -104,4 +107,16 @@ export function omit(obj, excludes) {
|
|
|
104
107
|
excludes.forEach(prop => delete ret[prop]);
|
|
105
108
|
return ret;
|
|
106
109
|
}
|
|
110
|
+
export const noop = () => void 0;
|
|
111
|
+
export function makeEventPromiseLike(event, promise) {
|
|
112
|
+
const promiseMethods = ["then", "catch", "finally"];
|
|
113
|
+
promiseMethods.forEach(method => {
|
|
114
|
+
Object.defineProperty(event, method, {
|
|
115
|
+
value: promise[method].bind(promise),
|
|
116
|
+
writable: false,
|
|
117
|
+
enumerable: false
|
|
118
|
+
});
|
|
119
|
+
});
|
|
120
|
+
return event;
|
|
121
|
+
}
|
|
107
122
|
//# sourceMappingURL=common.js.map
|
package/lib/util/common.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.js","names":["hasOwnProperty","object","property","Object","prototype","call","getNestedValue","obj","path","fallback","last","length","traversObj","undefined","i","mergeDeep","source","arguments","overwrite","arrayFn","ret","key","sourceValue","overwriteValue","Array","isArray","getObjectValueByPath","traversPath","replace","split","getPropertyFromItem","item","value","clamp","min","max","Math","getRangeArr","start","from","v","k","deepEqual","a","b","Date","getTime","props","keys","every","p","isObject","type","isEmpty","target","trim","omit","excludes","forEach","prop"],"sources":["../../src/util/common.ts"],"sourcesContent":["export function hasOwnProperty(object: any, property: string) {\n if (object) {\n return Object.prototype.hasOwnProperty.call(object, property);\n }\n return false;\n}\n\nexport function getNestedValue(\n obj: any,\n path: (string | number)[],\n fallback?: any,\n): any {\n const last = path.length - 1;\n let traversObj = obj;\n\n if (last < 0) return traversObj === undefined ? fallback : traversObj;\n\n for (let i = 0; i < last; i += 1) {\n if (traversObj == null) {\n return fallback;\n }\n traversObj = traversObj[path[i]];\n }\n\n if (traversObj == null) return fallback;\n\n return traversObj[path[last]] === undefined\n ? fallback\n : traversObj[path[last]];\n}\n\nexport function mergeDeep(\n source: Record<string, any> = {},\n overwrite: Record<string, any> = {},\n arrayFn?: (source: unknown[], overwrite: unknown[]) => unknown[],\n) {\n const ret = { ...source };\n for (const key in overwrite) {\n const sourceValue = ret[key];\n const overwriteValue = overwrite[key];\n\n if (Array.isArray(sourceValue) && Array.isArray(overwriteValue)) {\n if (arrayFn) {\n ret[key] = arrayFn(sourceValue, overwriteValue);\n continue;\n }\n }\n\n if (typeof sourceValue === 'object' && typeof overwriteValue === 'object') {\n ret[key] = mergeDeep(sourceValue, overwriteValue, arrayFn);\n continue;\n }\n\n ret[key] = overwriteValue;\n }\n return ret;\n}\n\nexport function getObjectValueByPath(\n obj: any,\n path: string,\n fallback?: any,\n): any {\n // credit: http://stackoverflow.com/questions/6491463/accessing-nested-javascript-objects-with-string-key#comment55278413_6491621\n let traversPath = path;\n if (obj == null || !traversPath || typeof traversPath !== 'string') {\n return fallback;\n }\n if (obj[traversPath] !== undefined) return obj[traversPath];\n traversPath = traversPath.replace(/\\[(\\w+)\\]/g, '.$1'); // convert indexes to properties\n traversPath = traversPath.replace(/^\\./, ''); // strip a leading dot\n return getNestedValue(obj, traversPath.split('.'), fallback);\n}\n\nexport type SelectItemKey =\n | boolean // Ignored\n | string // Lookup by key, can use dot notation for nested objects\n | (string | number)[] // Nested lookup by key, each array item is a key in the next level\n | ((item: Record<string, any>, fallback?: any) => any);\n\nexport function getPropertyFromItem(\n item: any,\n property: SelectItemKey,\n fallback?: any,\n): any {\n if (property == null) return item === undefined ? fallback : item;\n\n if (item !== Object(item)) {\n if (typeof property !== 'function') return fallback;\n\n const value = property(item, fallback);\n\n return typeof value === 'undefined' ? fallback : value;\n }\n\n if (typeof property === 'string')\n return getObjectValueByPath(item, property, fallback);\n\n if (Array.isArray(property)) return getNestedValue(item, property, fallback);\n\n if (typeof property !== 'function') return fallback;\n\n const value = property(item, fallback);\n\n return typeof value === 'undefined' ? fallback : value;\n}\n\nexport function clamp(value: number, min = 0, max = 1) {\n return Math.max(min, Math.min(max, value));\n}\n\nexport function getRangeArr(length: number, start = 0) {\n return Array.from({ length }, (v, k) => start + k);\n}\n\nexport function deepEqual(a: any, b: any): boolean {\n if (a === b) return true;\n\n if (a instanceof Date && b instanceof Date && a.getTime() !== b.getTime()) {\n return false;\n }\n\n if (a !== Object(a) || b !== Object(b)) {\n return false;\n }\n const props = Object.keys(a);\n if (props.length !== Object.keys(b).length) {\n return false;\n }\n return props.every((p) => deepEqual(a[p], b[p]));\n}\n\nexport function isObject(obj: unknown) {\n const type = typeof obj;\n return obj !== null && (type === 'object' || type === 'function');\n}\n\nexport function isEmpty(target: any) {\n return target == null || target?.trim() === '';\n}\n\nexport function omit<T extends object, U extends Extract<keyof T, string>>(\n obj: T,\n excludes: U[],\n): Omit<T, U> {\n const ret = { ...obj };\n excludes.forEach((prop) => delete ret[prop]);\n return ret;\n}\n"],"mappings":"AAAA,OAAO,SAASA,cAAcA,CAACC,MAAW,EAAEC,QAAgB,EAAE;EAC5D,IAAID,MAAM,EAAE;IACV,OAAOE,MAAM,CAACC,SAAS,CAACJ,cAAc,CAACK,IAAI,CAACJ,MAAM,EAAEC,QAAQ,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AG;IAAE,GAAGb;EAAI,CAAC;EACtBkD,QAAQ,CAACC,OAAO,CAAEC,IAAI,IAAK,OAAOvC,GAAG,CAACuC,IAAI,CAAC,CAAC;EAC5C,OAAOvC,GAAG;AACZ"}
|
|
1
|
+
{"version":3,"file":"common.js","names":["hasOwnProperty","object","property","Object","hasOwn","getNestedValue","obj","path","fallback","last","length","traversObj","undefined","i","mergeDeep","source","arguments","overwrite","arrayFn","ret","key","sourceValue","overwriteValue","Array","isArray","getObjectValueByPath","traversPath","replace","split","getPropertyFromItem","item","value","clamp","min","max","Math","getRangeArr","start","from","v","k","deepEqual","a","b","Date","getTime","props","keys","every","p","isObject","type","isEmpty","target","trim","omit","excludes","forEach","prop","noop","makeEventPromiseLike","event","promise","promiseMethods","method","defineProperty","bind","writable","enumerable"],"sources":["../../src/util/common.ts"],"sourcesContent":["/** biome-ignore-all lint/suspicious/useIterableCallbackReturn: <explanation> */\r\n\r\n// biome-ignore lint/suspicious/noShadowRestrictedNames: <explanation>\r\nexport function hasOwnProperty(object: any, property: string) {\r\n if (object) {\r\n return Object.hasOwn(object, property);\r\n }\r\n return false;\r\n}\r\n\r\nexport function getNestedValue(\r\n obj: any,\r\n path: (string | number)[],\r\n fallback?: any\r\n): any {\r\n const last = path.length - 1;\r\n let traversObj = obj;\r\n\r\n if (last < 0) return traversObj === undefined ? fallback : traversObj;\r\n\r\n for (let i = 0; i < last; i += 1) {\r\n if (traversObj == null) {\r\n return fallback;\r\n }\r\n traversObj = traversObj[path[i]];\r\n }\r\n\r\n if (traversObj == null) return fallback;\r\n\r\n return traversObj[path[last]] === undefined\r\n ? fallback\r\n : traversObj[path[last]];\r\n}\r\n\r\nexport function mergeDeep(\r\n source: Record<string, any> = {},\r\n overwrite: Record<string, any> = {},\r\n arrayFn?: (source: unknown[], overwrite: unknown[]) => unknown[]\r\n) {\r\n const ret = { ...source };\r\n for (const key in overwrite) {\r\n const sourceValue = ret[key];\r\n const overwriteValue = overwrite[key];\r\n\r\n if (Array.isArray(sourceValue) && Array.isArray(overwriteValue)) {\r\n if (arrayFn) {\r\n ret[key] = arrayFn(sourceValue, overwriteValue);\r\n continue;\r\n }\r\n }\r\n\r\n if (typeof sourceValue === \"object\" && typeof overwriteValue === \"object\") {\r\n ret[key] = mergeDeep(sourceValue, overwriteValue, arrayFn);\r\n continue;\r\n }\r\n\r\n ret[key] = overwriteValue;\r\n }\r\n return ret;\r\n}\r\n\r\nexport function getObjectValueByPath(\r\n obj: any,\r\n path: string,\r\n fallback?: any\r\n): any {\r\n // credit: http://stackoverflow.com/questions/6491463/accessing-nested-javascript-objects-with-string-key#comment55278413_6491621\r\n let traversPath = path;\r\n if (obj == null || !traversPath || typeof traversPath !== \"string\") {\r\n return fallback;\r\n }\r\n if (obj[traversPath] !== undefined) return obj[traversPath];\r\n traversPath = traversPath.replace(/\\[(\\w+)\\]/g, \".$1\"); // convert indexes to properties\r\n traversPath = traversPath.replace(/^\\./, \"\"); // strip a leading dot\r\n return getNestedValue(obj, traversPath.split(\".\"), fallback);\r\n}\r\n\r\nexport type SelectItemKey =\r\n | boolean // Ignored\r\n | string // Lookup by key, can use dot notation for nested objects\r\n | (string | number)[] // Nested lookup by key, each array item is a key in the next level\r\n | ((item: Record<string, any>, fallback?: any) => any);\r\n\r\nexport function getPropertyFromItem(\r\n item: any,\r\n property: SelectItemKey,\r\n fallback?: any\r\n): any {\r\n if (property == null) return item === undefined ? fallback : item;\r\n\r\n if (item !== Object(item)) {\r\n if (typeof property !== \"function\") return fallback;\r\n\r\n const value = property(item, fallback);\r\n\r\n return typeof value === \"undefined\" ? fallback : value;\r\n }\r\n\r\n if (typeof property === \"string\")\r\n return getObjectValueByPath(item, property, fallback);\r\n\r\n if (Array.isArray(property)) return getNestedValue(item, property, fallback);\r\n\r\n if (typeof property !== \"function\") return fallback;\r\n\r\n const value = property(item, fallback);\r\n\r\n return typeof value === \"undefined\" ? fallback : value;\r\n}\r\n\r\nexport function clamp(value: number, min = 0, max = 1) {\r\n return Math.max(min, Math.min(max, value));\r\n}\r\n\r\nexport function getRangeArr(length: number, start = 0) {\r\n return Array.from({ length }, (v, k) => start + k);\r\n}\r\n\r\nexport function deepEqual(a: any, b: any): boolean {\r\n if (a === b) return true;\r\n\r\n if (a instanceof Date && b instanceof Date && a.getTime() !== b.getTime()) {\r\n return false;\r\n }\r\n\r\n if (a !== Object(a) || b !== Object(b)) {\r\n return false;\r\n }\r\n const props = Object.keys(a);\r\n if (props.length !== Object.keys(b).length) {\r\n return false;\r\n }\r\n return props.every((p) => deepEqual(a[p], b[p]));\r\n}\r\n\r\nexport function isObject(obj: unknown) {\r\n const type = typeof obj;\r\n return obj !== null && (type === \"object\" || type === \"function\");\r\n}\r\n\r\nexport function isEmpty(target: any) {\r\n return target == null || target?.trim() === \"\";\r\n}\r\n\r\nexport function omit<T extends object, U extends Extract<keyof T, string>>(\r\n obj: T,\r\n excludes: U[]\r\n): Omit<T, U> {\r\n const ret = { ...obj };\r\n excludes.forEach((prop) => delete ret[prop]);\r\n return ret;\r\n}\r\n\r\nexport const noop = () => void 0;\r\n\r\nexport function makeEventPromiseLike<T extends Event, P = any>(\r\n event: T,\r\n promise: Promise<P>\r\n): T & Promise<P> {\r\n const promiseMethods = [\"then\", \"catch\", \"finally\"] as const;\r\n\r\n promiseMethods.forEach((method) => {\r\n Object.defineProperty(event, method, {\r\n value: promise[method].bind(promise),\r\n writable: false,\r\n enumerable: false,\r\n });\r\n });\r\n\r\n return event as T & Promise<P>;\r\n}\r\n"],"mappings":"AAAA;;AAEA;AACA,OAAO,SAASA,cAAcA,CAACC,MAAW,EAAEC,QAAgB,EAAE;EAC5D,IAAID,MAAM,EAAE;IACV,OAAOE,MAAM,CAACC,MAAM,CAACH,MAAM,EAAEC,QAAQ,CAAC;EACxC;EACA,OAAO,KAAK;AACd;AAEA,OAAO,SAASG,cAAcA,CAC5BC,GAAQ,EACRC,IAAyB,EACzBC,QAAc,EACT;EACL,MAAMC,IAAI,GAAGF,IAAI,CAACG,MA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,OAAO,MAAMwC,IAAI,GAAGA,CAAA,KAAM,KAAK,CAAC;AAEhC,OAAO,SAASC,oBAAoBA,CAClCC,KAAQ,EACRC,OAAmB,EACH;EAChB,MAAMC,cAAc,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,SAAS,CAAU;EAE5DA,cAAc,CAACN,OAAO,CAAEO,MAAM,IAAK;IACjC7D,MAAM,CAAC8D,cAAc,CAACJ,KAAK,EAAEG,MAAM,EAAE;MACnCjC,KAAK,EAAE+B,OAAO,CAACE,MAAM,CAAC,CAACE,IAAI,CAACJ,OAAO,CAAC;MACpCK,QAAQ,EAAE,KAAK;MACfC,UAAU,EAAE;IACd,CAAC,CAAC;EACJ,CAAC,CAAC;EAEF,OAAOP,KAAK;AACd","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.js","names":["useDefaultsModule","useSuperDefaults","redefineComponent","options","_setup","setup","props","ctx","defaults","value","_props","provideSubDefaults","name","setupBindings","defineFunctionalComponent","context","defineComponent"],"sources":["../../../src/util/component/component.ts"],"sourcesContent":["import {\r\n
|
|
1
|
+
{"version":3,"file":"component.js","names":["useDefaultsModule","useSuperDefaults","redefineComponent","options","_setup","setup","props","ctx","defaults","value","_props","provideSubDefaults","name","setupBindings","defineFunctionalComponent","context","defineComponent"],"sources":["../../../src/util/component/component.ts"],"sourcesContent":["import type {\r\n Component,\r\n ComponentInjectOptions,\r\n ComponentOptions,\r\n ComponentOptionsMixin,\r\n ComponentProvideOptions,\r\n ComputedOptions,\r\n DefineComponent,\r\n Directive,\r\n EmitsOptions,\r\n MethodOptions,\r\n SlotsType,\r\n} from 'vue';\r\nimport {\r\n ComponentObjectPropsOptions,\r\n ComponentOptionsWithObjectProps,\r\n ComponentOptionsWithoutProps,\r\n ExtractDefaultPropTypes,\r\n ExtractPropTypes,\r\n FunctionalComponent,\r\n} from 'vue';\r\n\r\nimport {\r\n useDefaultsModule,\r\n useSuperDefaults,\r\n} from '../../composables/defaults';\r\nimport { EmitsToProps } from './types';\r\n\r\ntype ToResolvedProps<Props, Emits extends EmitsOptions> = Readonly<Props> &\r\n Readonly<EmitsToProps<Emits>>;\r\n\r\n// overload 1: no props from options\r\nfunction redefineComponent<\r\n // props\r\n PropsOptions = {},\r\n //\r\n RawBindings = {},\r\n // emits\r\n E extends EmitsOptions = {},\r\n EE extends string = string,\r\n // other options\r\n Data = {},\r\n SetupBindings = {},\r\n Computed extends ComputedOptions = {},\r\n Methods extends MethodOptions = {},\r\n Mixin extends ComponentOptionsMixin = ComponentOptionsMixin,\r\n Extends extends ComponentOptionsMixin = ComponentOptionsMixin,\r\n InjectOptions extends ComponentInjectOptions = {},\r\n InjectKeys extends string = string,\r\n Slots extends SlotsType = {},\r\n LocalComponents extends Record<string, Component> = {},\r\n Directives extends Record<string, Directive> = {},\r\n Exposed extends string = string,\r\n Provide extends ComponentProvideOptions = ComponentProvideOptions,\r\n>(\r\n options: ComponentOptionsWithoutProps<\r\n PropsOptions,\r\n RawBindings,\r\n Data,\r\n Computed,\r\n Methods,\r\n Mixin,\r\n Extends,\r\n E,\r\n EE,\r\n InjectOptions,\r\n InjectKeys,\r\n Slots\r\n >,\r\n): DefineComponent<\r\n PropsOptions,\r\n RawBindings,\r\n Data,\r\n Computed,\r\n Methods,\r\n Mixin,\r\n Extends,\r\n E,\r\n EE\r\n>;\r\n\r\n// overload 2: defineComponent with options object, infer props from options\r\nfunction redefineComponent<\r\n // props\r\n PropsOptions = ComponentObjectPropsOptions,\r\n RawBindings = {},\r\n // emits\r\n E extends EmitsOptions = {},\r\n EE extends string = string,\r\n // other options\r\n Data = {},\r\n SetupBindings = {},\r\n Computed extends ComputedOptions = {},\r\n Methods extends MethodOptions = {},\r\n Mixin extends ComponentOptionsMixin = ComponentOptionsMixin,\r\n Extends extends ComponentOptionsMixin = ComponentOptionsMixin,\r\n Defaults = ExtractDefaultPropTypes<PropsOptions>,\r\n InjectOptions extends {} = {},\r\n InjectKeys extends string = string,\r\n Slots extends SlotsType = {},\r\n LocalComponents extends Record<string, Component> = {},\r\n Directives extends Record<string, Directive> = {},\r\n Exposed extends string = string,\r\n Provide extends ComponentProvideOptions = ComponentProvideOptions,\r\n>(\r\n options: ComponentOptionsWithObjectProps<\r\n PropsOptions,\r\n RawBindings,\r\n Data,\r\n Computed,\r\n Methods,\r\n Mixin,\r\n Extends,\r\n E,\r\n EE,\r\n InjectOptions,\r\n InjectKeys,\r\n Slots\r\n >,\r\n): DefineComponent<\r\n PropsOptions,\r\n RawBindings,\r\n Data,\r\n Computed,\r\n Methods,\r\n Mixin,\r\n Extends,\r\n E,\r\n EE\r\n>;\r\n\r\nfunction redefineComponent(options: ComponentOptions) {\r\n options._setup = options._setup ?? options.setup;\r\n\r\n if (options._setup) {\r\n options.setup = function (props, ctx) {\r\n const defaults = useDefaultsModule();\r\n // Skip props proxy if defaults are not provided\r\n if (!defaults.value) return options._setup(props, ctx);\r\n\r\n const { props: _props, provideSubDefaults } = useSuperDefaults(\r\n props,\r\n options.name,\r\n defaults,\r\n );\r\n\r\n const setupBindings = options._setup(_props, ctx);\r\n\r\n provideSubDefaults();\r\n\r\n return setupBindings;\r\n };\r\n }\r\n\r\n return options;\r\n}\r\n\r\nfunction defineFunctionalComponent<\r\n T extends FunctionalComponent<Props>,\r\n PropsOptions = ComponentObjectPropsOptions,\r\n Defaults = ExtractDefaultPropTypes<PropsOptions>,\r\n Props = Readonly<ExtractPropTypes<PropsOptions>>,\r\n>(\r\n props: PropsOptions,\r\n context: T,\r\n): FunctionalComponent<Partial<Defaults> & Omit<Props, keyof Defaults>> {\r\n context.props = props as any;\r\n return context as any;\r\n}\r\n\r\nexport { redefineComponent as defineComponent };\r\n"],"mappings":"SAuBEA,iBAAiB,EACjBC,gBAAgB,+CAOlB;AAkDA;AAkDA,SAASC,iBAAiBA,CAACC,OAAyB,EAAE;EACpDA,OAAO,CAACC,MAAM,GAAGD,OAAO,CAACC,MAAM,IAAID,OAAO,CAACE,KAAK;EAEhD,IAAIF,OAAO,CAACC,MAAM,EAAE;IAClBD,OAAO,CAACE,KAAK,GAAG,UAAUC,KAAK,EAAEC,GAAG,EAAE;MACpC,MAAMC,QAAQ,GAAGR,iBAAiB,CAAC,CAAC;MACpC;MACA,IAAI,CAACQ,QAAQ,CAACC,KAAK,EAAE,OAAON,OAAO,CAACC,MAAM,CAACE,KAAK,EAAEC,GAAG,CAAC;MAEtD,MAAM;QAAED,KAAK,EAAEI,MAAM;QAAEC;MAAmB,CAAC,GAAGV,gBAAgB,CAC5DK,KAAK,EACLH,OAAO,CAACS,IAAI,EACZJ,QACF,CAAC;MAED,MAAMK,aAAa,GAAGV,OAAO,CAACC,MAAM,CAACM,MAAM,EAAEH,GAAG,CAAC;MAEjDI,kBAAkB,CAAC,CAAC;MAEpB,OAAOE,aAAa;IACtB,CAAC;EACH;EAEA,OAAOV,OAAO;AAChB;AAEA,SAASW,yBAAyBA,CAMhCR,KAAmB,EACnBS,OAAU,EAC4D;EACtEA,OAAO,CAACT,KAAK,GAAGA,KAAY;EAC5B,OAAOS,OAAO;AAChB;AAEA,SAASb,iBAAiB,IAAIc,eAAe","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["getCurrentInstance","defineComponent","getSlot","vm","name","arguments","length","undefined","data","optional","$slots","slot","Function","filter","node","el","nodeType","getUid","uid","bindClasses","classes","boundClasses","Array","isArray","reduce","acc","clas","Object","keys","getHtmlElement","$el","Node","TEXT_NODE","nextElementSibling","findChildrenWithProvide","key","vnode","map","child","flat","children","component","getOwnPropertySymbols","provides","includes","subTree"],"sources":["../../../src/util/component/index.ts"],"sourcesContent":["import type {\
|
|
1
|
+
{"version":3,"file":"index.js","names":["getCurrentInstance","defineComponent","getSlot","vm","name","arguments","length","undefined","data","optional","$slots","slot","Function","filter","node","el","nodeType","getUid","uid","bindClasses","classes","boundClasses","Array","isArray","reduce","acc","clas","Object","keys","getHtmlElement","$el","Node","TEXT_NODE","nextElementSibling","findChildrenWithProvide","key","vnode","map","child","flat","children","component","getOwnPropertySymbols","provides","includes","subTree"],"sources":["../../../src/util/component/index.ts"],"sourcesContent":["import type {\n ComponentInternalInstance,\n ComponentPublicInstance,\n InjectionKey,\n VNode,\n VNodeChild,\n} from 'vue';\nimport { getCurrentInstance } from 'vue';\n\nimport { defineComponent } from './component';\n\nexport type { EventProp } from './types';\nexport * from './props';\n\nexport { defineComponent };\n\nexport function getSlot(\n vm: ComponentPublicInstance | any,\n // eslint-disable-next-line default-param-last\n name = 'default',\n data?: any | (() => any),\n optional = false,\n): VNode[] | undefined {\n if (vm.$slots?.[name]) {\n const slot = vm.$slots[name]!(data instanceof Function ? data() : data);\n return slot.filter((node: VNode) => {\n return node.el?.nodeType !== 8;\n });\n }\n return undefined;\n}\n\nexport function getUid() {\n const vm = getCurrentInstance();\n return vm?.uid;\n}\n\nexport function bindClasses(\n classes: string | string[] | Record<string, any> | undefined,\n) {\n const boundClasses = {} as Record<string, boolean>;\n if (typeof classes === 'string') {\n boundClasses[classes] = true;\n } else if (Array.isArray(classes)) {\n (classes as string[]).reduce((acc, clas) => {\n acc[clas] = true;\n return acc;\n }, boundClasses);\n } else if (typeof classes === 'object') {\n Object.keys(classes).reduce((acc, clas) => {\n acc[clas] = !!classes[clas];\n return acc;\n }, boundClasses);\n }\n return boundClasses;\n}\n\nexport function getHtmlElement<N extends object | undefined>(\n node: N,\n): Exclude<N, ComponentPublicInstance> | HTMLElement {\n if (node && '$el' in node) {\n const el = (node as ComponentPublicInstance).$el as HTMLElement;\n if (el.nodeType === Node.TEXT_NODE) {\n return el.nextElementSibling as HTMLElement;\n }\n return el;\n }\n return node as HTMLElement;\n}\n\nexport function findChildrenWithProvide(\n key: InjectionKey<any> | symbol,\n vnode?: VNodeChild,\n): ComponentInternalInstance[] {\n if (!vnode || typeof vnode !== 'object') {\n return [];\n }\n\n if (Array.isArray(vnode)) {\n return vnode.map((child) => findChildrenWithProvide(key, child)).flat(1);\n } else if (Array.isArray(vnode.children)) {\n return vnode.children\n .map((child) => findChildrenWithProvide(key, child))\n .flat(1);\n } else if (vnode.component) {\n if (\n Object.getOwnPropertySymbols((vnode.component as any).provides).includes(\n key as symbol,\n )\n ) {\n return [vnode.component];\n } else if (vnode.component.subTree) {\n return findChildrenWithProvide(key, vnode.component.subTree).flat(1);\n }\n }\n\n return [];\n}\n"],"mappings":"AAOA,SAASA,kBAAkB,QAAQ,KAAK;AAAC,SAEhCC,eAAe;AAAA;AAKxB,SAASA,eAAe;AAExB,OAAO,SAASC,OAAOA,CACrBC,EAAiC,EAKZ;EAAA,IAHrBC,IAAI,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,SAAS;EAAA,IAChBG,IAAwB,GAAAH,SAAA,CAAAC,MAAA,OAAAD,SAAA,MAAAE,SAAA;EAAA,IACxBE,QAAQ,GAAAJ,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,KAAK;EAEhB,IAAIF,EAAE,CAACO,MAAM,GAAGN,IAAI,CAAC,EAAE;IACrB,MAAMO,IAAI,GAAGR,EAAE,CAACO,MAAM,CAACN,IAAI,CAAC,CAAEI,IAAI,YAAYI,QAAQ,GAAGJ,IAAI,CAAC,CAAC,GAAGA,IAAI,CAAC;IACvE,OAAOG,IAAI,CAACE,MAAM,CAAEC,IAAW,IAAK;MAClC,OAAOA,IAAI,CAACC,EAAE,EAAEC,QAAQ,KAAK,CAAC;IAChC,CAAC,CAAC;EACJ;EACA,OAAOT,SAAS;AAClB;AAEA,OAAO,SAASU,MAAMA,CAAA,EAAG;EACvB,MAAMd,EAAE,GAAGH,kBAAkB,CAAC,CAAC;EAC/B,OAAOG,EAAE,EAAEe,GAAG;AAChB;AAEA,OAAO,SAASC,WAAWA,CACzBC,OAA4D,EAC5D;EACA,MAAMC,YAAY,GAAG,CAAC,CAA4B;EAClD,IAAI,OAAOD,OAAO,KAAK,QAAQ,E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,MAAM,IAAIjB,KAAK,CAACC,OAAO,CAACa,KAAK,CAACI,QAAQ,CAAC,EAAE;IACxC,OAAOJ,KAAK,CAACI,QAAQ,CAClBH,GAAG,CAAEC,KAAK,IAAKJ,uBAAuB,CAACC,GAAG,EAAEG,KAAK,CAAC,CAAC,CACnDC,IAAI,CAAC,CAAC,CAAC;EACZ,CAAC,MAAM,IAAIH,KAAK,CAACK,SAAS,EAAE;IAC1B,IACEd,MAAM,CAACe,qBAAqB,CAAEN,KAAK,CAACK,SAAS,CAASE,QAAQ,CAAC,CAACC,QAAQ,CACtET,GACF,CAAC,EACD;MACA,OAAO,CAACC,KAAK,CAACK,SAAS,CAAC;IAC1B,CAAC,MAAM,IAAIL,KAAK,CAACK,SAAS,CAACI,OAAO,EAAE;MAClC,OAAOX,uBAAuB,CAACC,GAAG,EAAEC,KAAK,CAACK,SAAS,CAACI,OAAO,CAAC,CAACN,IAAI,CAAC,CAAC,CAAC;IACtE;EACF;EAEA,OAAO,EAAE;AACX","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inject-self.js","names":["getCurrentInstance","injectSelf","key","vm","arguments","length","undefined","provides"],"sources":["../../../src/util/component/inject-self.ts"],"sourcesContent":["import {\r\n type ComponentInternalInstance,\r\n
|
|
1
|
+
{"version":3,"file":"inject-self.js","names":["getCurrentInstance","injectSelf","key","vm","arguments","length","undefined","provides"],"sources":["../../../src/util/component/inject-self.ts"],"sourcesContent":["import {\r\n type ComponentInternalInstance,\r\n getCurrentInstance,\r\n type InjectionKey,\r\n} from 'vue';\r\n\r\nexport function injectSelf<T>(\r\n key: InjectionKey<T> | string,\r\n vm?: ComponentInternalInstance,\r\n): T | undefined;\r\nexport function injectSelf(\r\n key: InjectionKey<any> | string,\r\n vm = getCurrentInstance(),\r\n) {\r\n const provides = vm?.provides;\r\n\r\n if (provides && (key as string | symbol) in provides) {\r\n return provides[key as string];\r\n }\r\n\r\n return undefined;\r\n}\r\n"],"mappings":"AAAA,SAEEA,kBAAkB,QAEb,KAAK;AAMZ,OAAO,SAASC,UAAUA,CACxBC,GAA+B,EAE/B;EAAA,IADAC,EAAE,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAGJ,kBAAkB,CAAC,CAAC;EAEzB,MAAMO,QAAQ,GAAGJ,EAAE,EAAEI,QAAQ;EAE7B,IAAIA,QAAQ,IAAKL,GAAG,IAAwBK,QAAQ,EAAE;IACpD,OAAOA,QAAQ,CAACL,GAAG,CAAW;EAChC;EAEA,OAAOI,SAAS;AAClB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"props.js","names":["capitalize","toKebabCase","propsFactory","props","source","defaults","Object","keys","reduce","options","prop","option","isObjectOption","Array","isArray","objectOption","type","default","chooseProps","target","acc","hasEventProp","onType","propIsDefined","vnode"],"sources":["../../../src/util/component/props.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"props.js","names":["capitalize","toKebabCase","propsFactory","props","source","defaults","Object","keys","reduce","options","prop","option","isObjectOption","Array","isArray","objectOption","type","default","chooseProps","target","acc","hasEventProp","onType","propIsDefined","vnode"],"sources":["../../../src/util/component/props.ts"],"sourcesContent":["import type {\r\n ComponentObjectPropsOptions,\r\n ExtractPropTypes,\r\n Prop,\r\n PropType,\r\n VNode,\r\n} from 'vue';\r\nimport { capitalize } from 'vue';\r\nimport type { IfAny } from '@vue/shared';\r\n\r\nimport { toKebabCase } from '../string';\r\n\r\nexport function propsFactory<PropsOptions extends ComponentObjectPropsOptions>(\r\n props: PropsOptions,\r\n source: string,\r\n) {\r\n return <Defaults extends PartialKeys<PropsOptions> = {}>(\r\n defaults?: Defaults,\r\n ): OverwrittenPropOptions<PropsOptions, Defaults> => {\r\n return Object.keys(props).reduce<any>((options, prop) => {\r\n const option = props[prop];\r\n const isObjectOption =\r\n typeof option === 'object' && option != null && !Array.isArray(option);\r\n const objectOption = isObjectOption ? option : { type: option };\r\n if (defaults && prop in defaults) {\r\n options[prop] = {\r\n ...objectOption,\r\n default: defaults[prop],\r\n };\r\n } else {\r\n options[prop] = objectOption;\r\n }\r\n\r\n if (source && !options[prop].source) {\r\n options[prop].source = source;\r\n }\r\n return options;\r\n }, {} as PropsOptions);\r\n };\r\n}\r\n\r\nexport function chooseProps<PropsOptions extends ComponentObjectPropsOptions>(\r\n props: any,\r\n target: PropsOptions,\r\n): ExtractPropTypes<PropsOptions> {\r\n return Object.keys(target).reduce(\r\n (acc, prop) => {\r\n if (props && prop in props) {\r\n acc[prop as keyof ExtractPropTypes<PropsOptions>] = props[prop];\r\n }\r\n return acc;\r\n },\r\n {} as ExtractPropTypes<PropsOptions>,\r\n );\r\n}\r\n\r\nexport function hasEventProp(props: Record<string, any>, type: string) {\r\n const onType = `on${capitalize(type)}`;\r\n return !!(\r\n props[onType] ||\r\n props[`${onType}Once`] ||\r\n props[`${onType}Capture`] ||\r\n props[`${onType}OnceCapture`] ||\r\n props[`${onType}CaptureOnce`]\r\n );\r\n}\r\n\r\nexport function propIsDefined(vnode: VNode, prop: string) {\r\n return (\r\n typeof vnode.props?.[prop] !== 'undefined' ||\r\n typeof vnode.props?.[toKebabCase(prop)] !== 'undefined'\r\n );\r\n}\r\n\r\ntype OverwrittenPropOptions<\r\n T extends ComponentObjectPropsOptions,\r\n D extends PartialKeys<T>,\r\n> = {\r\n [P in keyof T]-?: unknown extends D[P]\r\n ? T[P]\r\n : T[P] extends Record<string, unknown>\r\n ? Omit<T[P], 'type' | 'default'> & {\r\n type: PropType<MergeDefault<T[P], D[P]>>;\r\n default: MergeDefault<T[P], D[P]>;\r\n }\r\n : {\r\n type: PropType<MergeDefault<T[P], D[P]>>;\r\n default: MergeDefault<T[P], D[P]>;\r\n };\r\n};\r\n\r\ntype MergeDefault<T, D> = unknown extends D\r\n ? InferPropType<T>\r\n : NonNullable<InferPropType<T>> | D;\r\n\r\ntype FollowPropType<T, P, D> = [T] extends [PropType<unknown>]\r\n ? T\r\n : PropType<MergeDefault<P, D>>;\r\n\r\ntype PartialKeys<T> = { [P in keyof T]?: unknown };\r\n\r\ntype InferPropType<T> = [T] extends [null]\r\n ? any // null & true would fail to infer\r\n : [T] extends [{ type: null | true }]\r\n ? // As TS issue https://github.com/Microsoft/TypeScript/issues/14829\r\n // somehow `ObjectConstructor` when inferred from { (): T } becomes `any`\r\n // `BooleanConstructor` when inferred from PropConstructor(with PropMethod) becomes `Boolean`\r\n any\r\n : [T] extends [ObjectConstructor | { type: ObjectConstructor }]\r\n ? Record<string, any>\r\n : [T] extends [BooleanConstructor | { type: BooleanConstructor }]\r\n ? boolean\r\n : [T] extends [DateConstructor | { type: DateConstructor }]\r\n ? Date\r\n : [T] extends [(infer U)[] | { type: (infer U)[] }]\r\n ? U extends DateConstructor\r\n ? Date | InferPropType<U>\r\n : InferPropType<U>\r\n : [T] extends [Prop<infer V, infer D>]\r\n ? unknown extends V\r\n ? IfAny<V, V, D>\r\n : V\r\n : T;\r\n"],"mappings":"AAOA,SAASA,UAAU,QAAQ,KAAK;AAAC,SAGxBC,WAAW;AAEpB,OAAO,SAASC,YAAYA,CAC1BC,KAAmB,EACnBC,MAAc,EACd;EACA,OACEC,QAAmB,IACgC;IACnD,OAAOC,MAAM,CAACC,IAAI,CAACJ,KAAK,CAAC,CAACK,MAAM,CAAM,CAACC,OAAO,EAAEC,IAAI,KAAK;MACvD,MAAMC,MAAM,GAAGR,KAAK,CAACO,IAAI,CAAC;MAC1B,MAAME,cAAc,GAClB,OAAOD,MAAM,KAAK,QAAQ,IAAIA,MAAM,IAAI,IAAI,IAAI,CAACE,KAAK,CAACC,OAAO,CAACH,MAAM,CAAC;MACxE,MAAMI,YAAY,GAAGH,cAAc,GAAGD,MAAM,GAAG;QAAEK,IAAI,EAAEL;MAAO,CAAC;MAC/D,IAAIN,QAAQ,IAAIK,IAAI,IAAIL,QAAQ,EAAE;QAChCI,OAAO,CAACC,IAAI,CAAC,GAAG;UACd,GAAGK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AC,CAAC,KAAK,WAAW;AAE3D","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":["EventPropOption","Function","Array"],"sources":["../../../src/util/component/types.ts"],"sourcesContent":["import type { EmitsOptions, ObjectEmitsOptions, PropType } from 'vue';\r\n\r\nexport type EventProp<T extends any[] = any[], F = (...args: T) => any> =\r\n | F\r\n | F[];\r\n\r\nexport const EventPropOption = <T extends any[] = any[]>() =>\r\n [Function, Array] as PropType<EventProp<T>>;\r\n\r\nexport type ComponentTypeEmits =\r\n | ((...args: any[]) => any)\r\n | Record<string, any[]
|
|
1
|
+
{"version":3,"file":"types.js","names":["EventPropOption","Function","Array"],"sources":["../../../src/util/component/types.ts"],"sourcesContent":["import type { EmitsOptions, ObjectEmitsOptions, PropType } from 'vue';\r\n\r\nexport type EventProp<T extends any[] = any[], F = (...args: T) => any> =\r\n | F\r\n | F[];\r\n\r\nexport const EventPropOption = <T extends any[] = any[]>() =>\r\n [Function, Array] as PropType<EventProp<T>>;\r\n\r\nexport type ComponentTypeEmits =\r\n | ((...args: any[]) => any)\r\n | Record<string, any[]>;\r\n\r\nexport type EmitsToProps<T extends EmitsOptions | ComponentTypeEmits> =\r\n T extends string[]\r\n ? {\r\n [K in `on${Capitalize<T[number]>}`]?: (...args: any[]) => any;\r\n }\r\n : T extends ObjectEmitsOptions\r\n ? {\r\n [K in string & keyof T as `on${Capitalize<K>}`]?: (\r\n ...args: T[K] extends (...args: infer P) => any\r\n ? P\r\n : T[K] extends null\r\n ? any[]\r\n : never\r\n ) => any;\r\n }\r\n : {};\r\n\r\nexport type TypeEmitsToOptions<T extends ComponentTypeEmits> = {\r\n [K in keyof T & string]: T[K] extends [...args: infer Args]\r\n ? (...args: Args) => any\r\n : () => any;\r\n} & (T extends (...args: any[]) => any\r\n ? ParametersToFns<OverloadParameters<T>>\r\n : {});\r\n\r\ntype ParametersToFns<T extends any[]> = {\r\n [K in T[0]]: K extends `${infer C}`\r\n ? (...args: T extends [C, ...infer Args] ? Args : never) => any\r\n : never;\r\n};\r\n\r\nexport type OverloadParameters<T extends (...args: any[]) => any> = Parameters<\r\n OverloadUnion<T>\r\n>;\r\n\r\ntype OverloadProps<TOverload> = Pick<TOverload, keyof TOverload>;\r\n\r\ntype OverloadUnionRecursive<\r\n TOverload,\r\n TPartialOverload = unknown,\r\n> = TOverload extends (...args: infer TArgs) => infer TReturn\r\n ? TPartialOverload extends TOverload\r\n ? never\r\n :\r\n | OverloadUnionRecursive<\r\n TPartialOverload & TOverload,\r\n TPartialOverload &\r\n ((...args: TArgs) => TReturn) &\r\n OverloadProps<TOverload>\r\n >\r\n | ((...args: TArgs) => TReturn)\r\n : never;\r\n\r\ntype OverloadUnion<TOverload extends (...args: any[]) => any> = Exclude<\r\n OverloadUnionRecursive<(() => never) & TOverload>,\r\n TOverload extends () => never ? never : () => never\r\n>;\r\n"],"mappings":"AAMA,OAAO,MAAMA,eAAe,GAAGA,CAAA,KAC7B,CAACC,QAAQ,EAAEC,KAAK,CAA2B","ignoreList":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
function _defineProperty(
|
|
2
|
-
function _toPropertyKey(
|
|
3
|
-
function _toPrimitive(
|
|
1
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
2
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
3
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
4
4
|
import { DateUtil } from "../built-in.js";
|
|
5
5
|
export class YuyeonDateAdapter {
|
|
6
6
|
constructor(options) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"yuyeon-date-adapter.js","names":["DateUtil","YuyeonDateAdapter","constructor","options","_defineProperty","locale","formats","getWeekArray","date","startOfMonth","endOfMonth","addDays","amount","addMonths","value","endOfDay","endOfYear","format","formatString","getDiff","comparing","unit","getYear","getMonth","getDay","getNextMonth","getWeekdays","isAfter","isBefore","isEqual","isSameDay","isSameMonth","isValid","isWithinRange","range","parseISO","setMonth","month","setYear","year","startOfDay","startOfYear","toISO","toJsDate","getHour","getMinute","setHour","hour","setMinute","minute"],"sources":["../../../../src/util/date/adapters/yuyeon-date-adapter.ts"],"sourcesContent":["import { DateUtil } from '../built-in';\nimport { DateAdapter, DateFormatOptions } from '../types';\n\nexport class YuyeonDateAdapter implements DateAdapter<Date> {\n public locale = 'ko-kr';\n\n public formats?: Record<string, DateFormatOptions>;\n\n constructor(options: {\n locale: string;\n formats?: Record<string, DateFormatOptions>;\n }) {\n this.locale = options.locale;\n this.formats = options.formats;\n }\n\n public getWeekArray(date: Date) {\n return DateUtil.getWeekArray(date, this.locale);\n }\n\n public startOfMonth(date: Date) {\n return DateUtil.startOfMonth(date);\n }\n\n public endOfMonth(date: Date) {\n return DateUtil.endOfMonth(date);\n }\n\n public addDays(date: Date, amount: number): Date {\n return DateUtil.addDays(date, amount);\n }\n\n public addMonths(date: Date, amount: number): Date {\n return DateUtil.addMonths(date, amount);\n }\n\n public date(value?: any): Date | null {\n return DateUtil.date(value);\n }\n\n public endOfDay(date: Date): Date {\n return DateUtil.endOfDay(date);\n }\n\n public endOfYear(date: Date): Date {\n return DateUtil.endOfYear(date);\n }\n\n public format(date: Date, formatString: string): string {\n return DateUtil.format(date, formatString, this.locale, this.formats);\n }\n\n public getDiff(date: Date, comparing: string | Date, unit?: string): number {\n return DateUtil.getDiff(date, comparing, unit);\n }\n\n public getYear(date: Date): number {\n return DateUtil.getYear(date);\n }\n\n public getMonth(date: Date): number {\n return DateUtil.getMonth(date);\n }\n\n public getDay(date: Date): number {\n return DateUtil.getDay(date);\n }\n\n public getNextMonth(date: Date): Date {\n return DateUtil.getNextMonth(date);\n }\n\n public getWeekdays(): string[] {\n return DateUtil.getWeekdays(this.locale);\n }\n\n public isAfter(date: Date, comparing: Date): boolean {\n return DateUtil.isAfter(date, comparing);\n }\n\n public isBefore(date: Date, comparing: Date): boolean {\n return DateUtil.isBefore(date, comparing);\n }\n\n public isEqual(date: Date, comparing: Date): boolean {\n return DateUtil.isEqual(date, comparing);\n }\n\n public isSameDay(date: Date, comparing: Date): boolean {\n return DateUtil.isSameDay(date, comparing);\n }\n\n public isSameMonth(date: Date, comparing: Date): boolean {\n return DateUtil.isSameMonth(date, comparing);\n }\n\n public isValid(date: any): boolean {\n return DateUtil.isValid(date);\n }\n\n public isWithinRange(date: Date, range: [Date, Date]): boolean {\n return DateUtil.isWithinRange(date, range);\n }\n\n public parseISO(date: string): Date {\n return DateUtil.parseISO(date);\n }\n\n public setMonth(date: Date, month: number): Date {\n return DateUtil.setMonth(date, month);\n }\n\n public setYear(date: Date, year: number): Date {\n return DateUtil.setYear(date, year);\n }\n\n public startOfDay(date: Date): Date {\n return DateUtil.startOfDay(date);\n }\n\n public startOfYear(date: Date): Date {\n return DateUtil.startOfYear(date);\n }\n\n public toISO(date: Date): string {\n return DateUtil.toISO(this, date);\n }\n\n public toJsDate(date: Date): Date {\n return date;\n }\n\n getHour(date: Date): number {\n return DateUtil.getHour(date);\n }\n\n getMinute(date: Date): number {\n return DateUtil.getMinute(date);\n }\n\n setHour(date: Date, hour: number): Date {\n return DateUtil.setHour(date, hour);\n }\n\n setMinute(date: Date, minute: number): Date {\n return DateUtil.setMinute(date, minute);\n }\n}\n"],"mappings":";;;SAASA,QAAQ;AAGjB,OAAO,MAAMC,iBAAiB,CAA8B;EAK1DC,WAAWA,CAACC,OAGX,EAAE;IAAAC,eAAA,iBAPa,OAAO;IAQrB,IAAI,CAACC,MAAM,GAAGF,OAAO,CAACE,MAAM;IAC5B,IAAI,CAACC,OAAO,GAAGH,OAAO,CAACG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ats","getWeekArray","date","startOfMonth","endOfMonth","addDays","amount","addMonths","value","endOfDay","endOfYear","format","formatString","getDiff","comparing","unit","getYear","getMonth","getDay","getNextMonth","getWeekdays","isAfter","isBefore","isEqual","isSameDay","isSameMonth","isValid","isWithinRange","range","parseISO","setMonth","month","setYear","year","startOfDay","startOfYear","toISO","toJsDate","getHour","getMinute","setHour","hour","setMinute","minute"],"sources":["../../../../src/util/date/adapters/yuyeon-date-adapter.ts"],"sourcesContent":["import { DateUtil } from '../built-in';\nimport { DateAdapter, DateFormatOptions } from '../types';\n\nexport class YuyeonDateAdapter implements DateAdapter<Date> {\n public locale = 'ko-kr';\n\n public formats?: Record<string, DateFormatOptions>;\n\n constructor(options: {\n locale: string;\n formats?: Record<string, DateFormatOptions>;\n }) {\n this.locale = options.locale;\n this.formats = options.formats;\n }\n\n public getWeekArray(date: Date) {\n return DateUtil.getWeekArray(date, this.locale);\n }\n\n public startOfMonth(date: Date) {\n return DateUtil.startOfMonth(date);\n }\n\n public endOfMonth(date: Date) {\n return DateUtil.endOfMonth(date);\n }\n\n public addDays(date: Date, amount: number): Date {\n return DateUtil.addDays(date, amount);\n }\n\n public addMonths(date: Date, amount: number): Date {\n return DateUtil.addMonths(date, amount);\n }\n\n public date(value?: any): Date | null {\n return DateUtil.date(value);\n }\n\n public endOfDay(date: Date): Date {\n return DateUtil.endOfDay(date);\n }\n\n public endOfYear(date: Date): Date {\n return DateUtil.endOfYear(date);\n }\n\n public format(date: Date, formatString: string): string {\n return DateUtil.format(date, formatString, this.locale, this.formats);\n }\n\n public getDiff(date: Date, comparing: string | Date, unit?: string): number {\n return DateUtil.getDiff(date, comparing, unit);\n }\n\n public getYear(date: Date): number {\n return DateUtil.getYear(date);\n }\n\n public getMonth(date: Date): number {\n return DateUtil.getMonth(date);\n }\n\n public getDay(date: Date): number {\n return DateUtil.getDay(date);\n }\n\n public getNextMonth(date: Date): Date {\n return DateUtil.getNextMonth(date);\n }\n\n public getWeekdays(): string[] {\n return DateUtil.getWeekdays(this.locale);\n }\n\n public isAfter(date: Date, comparing: Date): boolean {\n return DateUtil.isAfter(date, comparing);\n }\n\n public isBefore(date: Date, comparing: Date): boolean {\n return DateUtil.isBefore(date, comparing);\n }\n\n public isEqual(date: Date, comparing: Date): boolean {\n return DateUtil.isEqual(date, comparing);\n }\n\n public isSameDay(date: Date, comparing: Date): boolean {\n return DateUtil.isSameDay(date, comparing);\n }\n\n public isSameMonth(date: Date, comparing: Date): boolean {\n return DateUtil.isSameMonth(date, comparing);\n }\n\n public isValid(date: any): boolean {\n return DateUtil.isValid(date);\n }\n\n public isWithinRange(date: Date, range: [Date, Date]): boolean {\n return DateUtil.isWithinRange(date, range);\n }\n\n public parseISO(date: string): Date {\n return DateUtil.parseISO(date);\n }\n\n public setMonth(date: Date, month: number): Date {\n return DateUtil.setMonth(date, month);\n }\n\n public setYear(date: Date, year: number): Date {\n return DateUtil.setYear(date, year);\n }\n\n public startOfDay(date: Date): Date {\n return DateUtil.startOfDay(date);\n }\n\n public startOfYear(date: Date): Date {\n return DateUtil.startOfYear(date);\n }\n\n public toISO(date: Date): string {\n return DateUtil.toISO(this, date);\n }\n\n public toJsDate(date: Date): Date {\n return date;\n }\n\n getHour(date: Date): number {\n return DateUtil.getHour(date);\n }\n\n getMinute(date: Date): number {\n return DateUtil.getMinute(date);\n }\n\n setHour(date: Date, hour: number): Date {\n return DateUtil.setHour(date, hour);\n }\n\n setMinute(date: Date, minute: number): Date {\n return DateUtil.setMinute(date, minute);\n }\n}\n"],"mappings":";;;SAASA,QAAQ;AAGjB,OAAO,MAAMC,iBAAiB,CAA8B;EAK1DC,WAAWA,CAACC,OAGX,EAAE;IAAAC,eAAA,iBAPa,OAAO;IAQrB,IAAI,CAACC,MAAM,GAAGF,OAAO,CAACE,MAAM;IAC5B,IAAI,CAACC,OAAO,GAAGH,OAAO,CAACG,OAAO;EAChC;EAEOC,YAAYA,CAACC,IAAU,EAAE;IAC9B,OAAOR,QAAQ,CAACO,YAAY,C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-2])-([1-9]|0[1-9]|[12]\d|3[01]))$/;
|
|
154
154
|
export const FIRST_SUNDAY = new Date(1970, 0, 4);
|
|
155
|
+
|
|
156
|
+
// biome-ignore lint/complexity/noStaticOnlyClass: <explanation>
|
|
155
157
|
export class DateUtil {
|
|
156
158
|
static date(value) {
|
|
157
159
|
if (value == null) return new Date();
|