yuyeon 0.1.2-rc.2 → 0.2.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 +5052 -6665
- package/dist/yuyeon.umd.cjs +4 -26
- package/lib/abstract/items.mjs +1 -1
- package/lib/abstract/items.mjs.map +1 -1
- package/lib/components/alert/YAlert.mjs +2 -1
- package/lib/components/alert/YAlert.mjs.map +1 -1
- package/lib/components/alert/YAlert.scss +75 -76
- package/lib/components/alert/index.mjs.map +1 -1
- package/lib/components/app/YApp.mjs +3 -2
- package/lib/components/app/YApp.mjs.map +1 -1
- package/lib/components/app/YApp.scss +14 -14
- package/lib/components/app/index.mjs.map +1 -1
- package/lib/components/badge/YBadge.mjs +2 -2
- package/lib/components/badge/YBadge.mjs.map +1 -1
- package/lib/components/badge/YBadge.scss +76 -76
- package/lib/components/badge/index.mjs.map +1 -1
- package/lib/components/bench/YBench.mjs +2 -3
- package/lib/components/bench/YBench.mjs.map +1 -1
- package/lib/components/bench/index.mjs.map +1 -1
- package/lib/components/button/YButton.mjs +2 -2
- package/lib/components/button/YButton.mjs.map +1 -1
- package/lib/components/button/YButton.scss +128 -129
- package/lib/components/button/index.mjs.map +1 -1
- package/lib/components/card/YCard.mjs +3 -2
- package/lib/components/card/YCard.mjs.map +1 -1
- package/lib/components/card/YCard.scss +45 -43
- package/lib/components/card/YCardBody.mjs +2 -1
- package/lib/components/card/YCardBody.mjs.map +1 -1
- package/lib/components/card/YCardFooter.mjs +2 -1
- package/lib/components/card/YCardFooter.mjs.map +1 -1
- package/lib/components/card/YCardHeader.mjs +2 -1
- package/lib/components/card/YCardHeader.mjs.map +1 -1
- package/lib/components/checkbox/YCheckbox.mjs +2 -2
- package/lib/components/checkbox/YCheckbox.mjs.map +1 -1
- package/lib/components/checkbox/YCheckbox.scss +48 -48
- package/lib/components/checkbox/YInputCheckbox.mjs +2 -1
- package/lib/components/checkbox/YInputCheckbox.mjs.map +1 -1
- package/lib/components/checkbox/YInputCheckbox.scss +84 -86
- package/lib/components/checkbox/index.mjs +1 -1
- package/lib/components/checkbox/index.mjs.map +1 -1
- package/lib/components/chip/YChip.mjs +2 -2
- package/lib/components/chip/YChip.mjs.map +1 -1
- package/lib/components/date-picker/YDateCalendar.mjs +3 -3
- package/lib/components/date-picker/YDateCalendar.mjs.map +1 -1
- package/lib/components/date-picker/YDateCalendar.scss +84 -82
- package/lib/components/date-picker/YDatePicker.mjs +2 -2
- package/lib/components/date-picker/YDatePicker.mjs.map +1 -1
- package/lib/components/date-picker/YDatePicker.scss +3 -3
- package/lib/components/date-picker/YDatePickerControl.mjs +2 -2
- package/lib/components/date-picker/YDatePickerControl.mjs.map +1 -1
- package/lib/components/date-picker/YDatePickerControl.scss +35 -35
- package/lib/components/date-picker/YMonthPicker.mjs +3 -3
- package/lib/components/date-picker/YMonthPicker.mjs.map +1 -1
- package/lib/components/date-picker/YMonthPicker.scss +25 -25
- package/lib/components/date-picker/YYearPicker.mjs +4 -3
- package/lib/components/date-picker/YYearPicker.mjs.map +1 -1
- package/lib/components/date-picker/YYearPicker.scss +23 -23
- package/lib/components/date-picker/index.mjs.map +1 -1
- package/lib/components/dialog/YDialog.mjs +3 -3
- package/lib/components/dialog/YDialog.mjs.map +1 -1
- package/lib/components/dialog/YDialog.scss +50 -50
- package/lib/components/dialog/index.mjs.map +1 -1
- package/lib/components/divider/YDivider.mjs +1 -2
- package/lib/components/divider/YDivider.mjs.map +1 -1
- package/lib/components/divider/YDivider.scss +2 -3
- package/lib/components/divider/index.mjs.map +1 -1
- package/lib/components/dropdown/YDropdown.mjs +2 -2
- package/lib/components/dropdown/YDropdown.mjs.map +1 -1
- package/lib/components/dropdown/YDropdown.scss +27 -28
- package/lib/components/dropdown/index.mjs.map +1 -1
- package/lib/components/field-input/YFieldInput.mjs +2 -2
- package/lib/components/field-input/YFieldInput.mjs.map +1 -1
- package/lib/components/field-input/YFieldInput.scss +66 -66
- package/lib/components/field-input/index.mjs.map +1 -1
- package/lib/components/form/YForm.mjs +3 -2
- package/lib/components/form/YForm.mjs.map +1 -1
- package/lib/components/hover/YHover.mjs +2 -2
- package/lib/components/hover/YHover.mjs.map +1 -1
- package/lib/components/hover/index.mjs.map +1 -1
- package/lib/components/icon/YIcon.mjs +4 -3
- package/lib/components/icon/YIcon.mjs.map +1 -1
- package/lib/components/icon/YIcon.scss +18 -18
- package/lib/components/icon/index.mjs.map +1 -1
- package/lib/components/icons/YIconCheckbox.mjs +1 -1
- package/lib/components/icons/YIconCheckbox.mjs.map +1 -1
- package/lib/components/icons/YIconCheckbox.scss +60 -60
- package/lib/components/icons/YIconClear.mjs +1 -1
- package/lib/components/icons/YIconClear.mjs.map +1 -1
- package/lib/components/icons/YIconDropdown.mjs +1 -1
- package/lib/components/icons/YIconDropdown.mjs.map +1 -1
- package/lib/components/icons/YIconExpand.mjs +1 -1
- package/lib/components/icons/YIconExpand.mjs.map +1 -1
- package/lib/components/icons/YIconPageControl.mjs +1 -1
- package/lib/components/icons/YIconPageControl.mjs.map +1 -1
- package/lib/components/icons/YIconSort.mjs +1 -1
- package/lib/components/icons/YIconSort.mjs.map +1 -1
- package/lib/components/icons/YIconSort.scss +24 -23
- package/lib/components/icons/index.mjs +1 -1
- package/lib/components/icons/index.mjs.map +1 -1
- package/lib/components/img/YImg.mjs +2 -3
- package/lib/components/img/YImg.mjs.map +1 -1
- package/lib/components/input/YInput.mjs +3 -4
- package/lib/components/input/YInput.mjs.map +1 -1
- package/lib/components/input/YInput.scss +258 -254
- package/lib/components/input/index.mjs.map +1 -1
- package/lib/components/ip-field/YIpField.scss +74 -74
- package/lib/components/ip-field/YIpv4Field.mjs +2 -2
- package/lib/components/ip-field/YIpv4Field.mjs.map +1 -1
- package/lib/components/ip-field/index.mjs.map +1 -1
- package/lib/components/layer/YLayer.mjs +2 -2
- package/lib/components/layer/YLayer.mjs.map +1 -1
- package/lib/components/layer/YLayer.scss +38 -38
- package/lib/components/layer/active-delay.mjs.map +1 -1
- package/lib/components/layer/active-stack.mjs.map +1 -1
- package/lib/components/layer/base.mjs +1 -1
- package/lib/components/layer/base.mjs.map +1 -1
- package/lib/components/layer/content.mjs +1 -1
- package/lib/components/layer/content.mjs.map +1 -1
- package/lib/components/layer/scroll-strategies.mjs +1 -1
- package/lib/components/layer/scroll-strategies.mjs.map +1 -1
- package/lib/components/list/YList.mjs +2 -2
- package/lib/components/list/YList.mjs.map +1 -1
- package/lib/components/list/YList.scss +3 -3
- package/lib/components/list/YListItem.mjs +2 -2
- package/lib/components/list/YListItem.mjs.map +1 -1
- package/lib/components/list/YListItem.scss +62 -62
- package/lib/components/list/index.mjs.map +1 -1
- package/lib/components/loading/YSpinnerRing.mjs +1 -1
- package/lib/components/loading/YSpinnerRing.mjs.map +1 -1
- package/lib/components/menu/YMenu.mjs +5 -4
- package/lib/components/menu/YMenu.mjs.map +1 -1
- package/lib/components/menu/YMenu.scss +25 -22
- package/lib/components/menu/index.mjs.map +1 -1
- package/lib/components/navigation/YNavigation.mjs +2 -1
- package/lib/components/navigation/YNavigation.mjs.map +1 -1
- package/lib/components/pagination/YPagination.mjs +2 -2
- package/lib/components/pagination/YPagination.mjs.map +1 -1
- package/lib/components/pagination/YPagination.scss +52 -51
- package/lib/components/pagination/index.mjs.map +1 -1
- package/lib/components/panel/YDividePanel.mjs.map +1 -1
- package/lib/components/panel/YDividePanel.scss +43 -43
- package/lib/components/panel/index.mjs.map +1 -1
- package/lib/components/plate/YPlate.mjs +2 -1
- package/lib/components/plate/YPlate.mjs.map +1 -1
- package/lib/components/plate/YPlate.scss +9 -9
- package/lib/components/progress-bar/YProgressBar.mjs +40 -52
- package/lib/components/progress-bar/YProgressBar.mjs.map +1 -1
- package/lib/components/progress-bar/YProgressBar.scss +10 -4
- package/lib/components/select/YSelect.mjs +3 -5
- package/lib/components/select/YSelect.mjs.map +1 -1
- package/lib/components/select/YSelect.scss +43 -43
- package/lib/components/select/index.mjs.map +1 -1
- package/lib/components/snackbar/YSnackbar.mjs +3 -4
- package/lib/components/snackbar/YSnackbar.mjs.map +1 -1
- package/lib/components/snackbar/YSnackbar.scss +38 -38
- package/lib/components/switch/YSwitch.mjs +2 -1
- package/lib/components/switch/YSwitch.mjs.map +1 -1
- package/lib/components/switch/YSwitch.scss +204 -198
- package/lib/components/tab/YTab.mjs +2 -3
- package/lib/components/tab/YTab.mjs.map +1 -1
- package/lib/components/tab/YTab.scss +6 -3
- package/lib/components/tab/YTabs.mjs +2 -2
- package/lib/components/tab/YTabs.mjs.map +1 -1
- package/lib/components/tab/YTabs.scss +8 -10
- package/lib/components/tab/index.mjs.map +1 -1
- package/lib/components/tab/types.mjs.map +1 -1
- package/lib/components/table/YDataTable.mjs +5 -5
- package/lib/components/table/YDataTable.mjs.map +1 -1
- package/lib/components/table/YDataTableBody.mjs +2 -2
- package/lib/components/table/YDataTableBody.mjs.map +1 -1
- package/lib/components/table/YDataTableCell.mjs +2 -1
- package/lib/components/table/YDataTableCell.mjs.map +1 -1
- package/lib/components/table/YDataTableControl.mjs +1 -1
- package/lib/components/table/YDataTableControl.mjs.map +1 -1
- package/lib/components/table/YDataTableControl.scss +7 -7
- package/lib/components/table/YDataTableHead.mjs +2 -3
- package/lib/components/table/YDataTableHead.mjs.map +1 -1
- package/lib/components/table/YDataTableLayer.mjs +2 -1
- package/lib/components/table/YDataTableLayer.mjs.map +1 -1
- package/lib/components/table/YDataTableRow.mjs +3 -2
- package/lib/components/table/YDataTableRow.mjs.map +1 -1
- package/lib/components/table/YDataTableServer.mjs +3 -4
- package/lib/components/table/YDataTableServer.mjs.map +1 -1
- package/lib/components/table/YTable.mjs +2 -2
- package/lib/components/table/YTable.mjs.map +1 -1
- package/lib/components/table/YTable.scss +157 -152
- package/lib/components/table/composibles/header.mjs +1 -1
- package/lib/components/table/composibles/header.mjs.map +1 -1
- package/lib/components/table/composibles/items.mjs +1 -1
- package/lib/components/table/composibles/items.mjs.map +1 -1
- package/lib/components/table/composibles/options.mjs.map +1 -1
- package/lib/components/table/composibles/pagination.mjs +1 -1
- package/lib/components/table/composibles/pagination.mjs.map +1 -1
- package/lib/components/table/composibles/selection.mjs +2 -2
- package/lib/components/table/composibles/selection.mjs.map +1 -1
- package/lib/components/table/composibles/sorted-items.mjs +1 -1
- package/lib/components/table/composibles/sorted-items.mjs.map +1 -1
- package/lib/components/table/composibles/sorting.mjs +2 -3
- package/lib/components/table/composibles/sorting.mjs.map +1 -1
- package/lib/components/table/index.mjs.map +1 -1
- package/lib/components/table/types/common.mjs.map +1 -1
- package/lib/components/table/types/header.mjs.map +1 -1
- package/lib/components/table/types/index.mjs.map +1 -1
- package/lib/components/table/types/row.mjs.map +1 -1
- package/lib/components/text-ellipsis/YTextEllipsis.mjs +4 -2
- package/lib/components/text-ellipsis/YTextEllipsis.mjs.map +1 -1
- package/lib/components/text-ellipsis/YTextEllipsis.scss +43 -43
- package/lib/components/text-ellipsis/index.mjs.map +1 -1
- package/lib/components/text-highlighter/YTextHighlighter.mjs +2 -1
- package/lib/components/text-highlighter/YTextHighlighter.mjs.map +1 -1
- package/lib/components/text-interpolation/YTi.mjs +2 -1
- package/lib/components/text-interpolation/YTi.mjs.map +1 -1
- package/lib/components/text-interpolation/index.mjs.map +1 -1
- package/lib/components/textarea/YTextarea.mjs +2 -2
- package/lib/components/textarea/YTextarea.mjs.map +1 -1
- package/lib/components/textarea/YTextarea.scss +25 -25
- package/lib/components/textarea/index.mjs.map +1 -1
- package/lib/components/toggle-button/YToggleButton.mjs.map +1 -1
- package/lib/components/toggle-button/index.mjs.map +1 -1
- package/lib/components/tooltip/YTooltip.mjs +4 -4
- package/lib/components/tooltip/YTooltip.mjs.map +1 -1
- package/lib/components/tooltip/YTooltip.scss +19 -19
- package/lib/components/tooltip/index.mjs.map +1 -1
- package/lib/components/transitions/expand-transition.mjs.map +1 -1
- package/lib/components/tree-view/YTreeView.mjs +1 -1
- package/lib/components/tree-view/YTreeView.mjs.map +1 -1
- package/lib/components/tree-view/YTreeView.scss +81 -79
- package/lib/components/tree-view/YTreeViewNode.mjs +3 -2
- package/lib/components/tree-view/YTreeViewNode.mjs.map +1 -1
- package/lib/components/tree-view/index.mjs.map +1 -1
- package/lib/components/tree-view/types.mjs.map +1 -1
- package/lib/components/tree-view/util.mjs.map +1 -1
- package/lib/composables/choice.mjs +1 -1
- package/lib/composables/choice.mjs.map +1 -1
- package/lib/composables/communication.mjs.map +1 -1
- package/lib/composables/component.mjs.map +1 -1
- package/lib/composables/coordinate/arrangement.mjs.map +1 -1
- package/lib/composables/coordinate/index.mjs +1 -1
- package/lib/composables/coordinate/index.mjs.map +1 -1
- package/lib/composables/coordinate/levitation.mjs.map +1 -1
- package/lib/composables/coordinate/utils/point.mjs.map +1 -1
- package/lib/composables/date/factory.mjs.map +1 -1
- package/lib/composables/date/index.mjs +2 -2
- package/lib/composables/date/index.mjs.map +1 -1
- package/lib/composables/date/setting.mjs.map +1 -1
- package/lib/composables/date/types.mjs.map +1 -1
- package/lib/composables/defaults/index.mjs +99 -0
- package/lib/composables/defaults/index.mjs.map +1 -0
- package/lib/composables/defaults/share.mjs +2 -0
- package/lib/composables/defaults/share.mjs.map +1 -0
- package/lib/composables/defaults/types.mjs +2 -0
- package/lib/composables/defaults/types.mjs.map +1 -0
- package/lib/composables/dimension.mjs +1 -1
- package/lib/composables/dimension.mjs.map +1 -1
- package/lib/composables/focus.mjs +2 -2
- package/lib/composables/focus.mjs.map +1 -1
- package/lib/composables/form.mjs +1 -1
- package/lib/composables/form.mjs.map +1 -1
- package/lib/composables/i18n/index.mjs +2 -2
- package/lib/composables/i18n/index.mjs.map +1 -1
- package/lib/composables/icon.mjs +5 -4
- package/lib/composables/icon.mjs.map +1 -1
- package/lib/composables/layer-group.mjs +1 -1
- package/lib/composables/layer-group.mjs.map +1 -1
- package/lib/composables/layout.mjs +1 -1
- package/lib/composables/layout.mjs.map +1 -1
- package/lib/composables/list-items.mjs +1 -1
- package/lib/composables/list-items.mjs.map +1 -1
- package/lib/composables/progress.mjs +7 -2
- package/lib/composables/progress.mjs.map +1 -1
- package/lib/composables/ref.mjs +1 -1
- package/lib/composables/ref.mjs.map +1 -1
- package/lib/composables/resize-observer.mjs +2 -4
- package/lib/composables/resize-observer.mjs.map +1 -1
- package/lib/composables/scope.mjs +1 -2
- package/lib/composables/scope.mjs.map +1 -1
- package/lib/composables/theme/factory.mjs.map +1 -1
- package/lib/composables/theme/index.mjs +2 -2
- package/lib/composables/theme/index.mjs.map +1 -1
- package/lib/composables/theme/setting.mjs.map +1 -1
- package/lib/composables/theme/types.mjs.map +1 -1
- package/lib/composables/timing.mjs +1 -1
- package/lib/composables/timing.mjs.map +1 -1
- package/lib/composables/transition.mjs +1 -1
- package/lib/composables/transition.mjs.map +1 -1
- package/lib/composables/validation.mjs +1 -1
- package/lib/composables/validation.mjs.map +1 -1
- package/lib/composables/vue-router.mjs +1 -1
- package/lib/composables/vue-router.mjs.map +1 -1
- package/lib/index.mjs +7 -2
- package/lib/index.mjs.map +1 -1
- package/lib/util/anchor.mjs.map +1 -1
- package/lib/util/array.mjs.map +1 -1
- package/lib/util/component/component.mjs +22 -0
- package/lib/util/component/component.mjs.map +1 -0
- package/lib/util/component/index.mjs +65 -0
- package/lib/util/component/index.mjs.map +1 -0
- package/lib/util/component/inject-self.mjs +10 -0
- package/lib/util/component/inject-self.mjs.map +1 -0
- package/lib/util/component/props.mjs +41 -0
- package/lib/util/component/props.mjs.map +1 -0
- package/lib/util/component/types.mjs +2 -0
- package/lib/util/component/types.mjs.map +1 -0
- package/lib/util/date/index.mjs.map +1 -1
- package/lib/util/dom.mjs.map +1 -1
- package/lib/util/index.mjs +1 -1
- package/lib/util/index.mjs.map +1 -1
- package/lib/util/reactivity.mjs +3 -3
- package/lib/util/reactivity.mjs.map +1 -1
- package/lib/util/rect.mjs.map +1 -1
- package/lib/util/ui.mjs.map +1 -1
- package/lib/util/validation.mjs.map +1 -1
- package/lib/util/vue-component/index.mjs +63 -0
- package/lib/util/vue-component/index.mjs.map +1 -0
- package/lib/util/vue-component/props.mjs +37 -0
- package/lib/util/vue-component/props.mjs.map +1 -0
- package/lib/util/vue-component/types.mjs +2 -0
- package/lib/util/vue-component/types.mjs.map +1 -0
- package/package.json +1 -1
- package/types/abstract/items.d.ts +4 -4
- package/types/components/alert/YAlert.d.ts +2 -13
- package/types/components/app/YApp.d.ts +1 -1
- package/types/components/badge/YBadge.d.ts +7 -41
- package/types/components/bench/YBench.d.ts +1 -1
- package/types/components/button/YButton.d.ts +10 -69
- package/types/components/card/YCard.d.ts +1 -6
- package/types/components/card/YCardBody.d.ts +1 -1
- package/types/components/card/YCardFooter.d.ts +1 -1
- package/types/components/card/YCardHeader.d.ts +1 -1
- package/types/components/checkbox/YCheckbox.d.ts +1 -26
- package/types/components/checkbox/YInputCheckbox.d.ts +2 -26
- package/types/components/checkbox/index.d.ts +1 -0
- package/types/components/chip/YChip.d.ts +2 -13
- package/types/components/date-picker/YDateCalendar.d.ts +7 -35
- package/types/components/date-picker/YDatePicker.d.ts +19 -48
- package/types/components/date-picker/YDatePickerControl.d.ts +12 -44
- package/types/components/date-picker/YMonthPicker.d.ts +3 -7
- package/types/components/date-picker/YYearPicker.d.ts +3 -9
- package/types/components/dialog/YDialog.d.ts +66 -309
- package/types/components/divider/YDivider.d.ts +1 -3
- package/types/components/dropdown/YDropdown.d.ts +68 -241
- package/types/components/field-input/YFieldInput.d.ts +16 -122
- package/types/components/form/YForm.d.ts +2 -24
- package/types/components/hover/YHover.d.ts +4 -26
- package/types/components/icon/YIcon.d.ts +6 -21
- package/types/components/icons/YIconCheckbox.d.ts +1 -9
- package/types/components/icons/YIconClear.d.ts +1 -1
- package/types/components/icons/YIconDropdown.d.ts +1 -1
- package/types/components/icons/YIconExpand.d.ts +1 -1
- package/types/components/icons/YIconPageControl.d.ts +1 -8
- package/types/components/icons/YIconSort.d.ts +1 -10
- package/types/components/icons/index.d.ts +8 -46
- package/types/components/img/YImg.d.ts +7 -47
- package/types/components/input/YInput.d.ts +13 -101
- package/types/components/ip-field/YIpv4Field.d.ts +3 -71
- package/types/components/layer/YLayer.d.ts +38 -155
- package/types/components/layer/content.d.ts +1 -1
- package/types/components/layer/scroll-strategies.d.ts +1 -1
- package/types/components/list/YList.d.ts +1 -6
- package/types/components/list/YListItem.d.ts +3 -21
- package/types/components/loading/YSpinnerRing.d.ts +1 -1
- package/types/components/menu/YMenu.d.ts +20 -285
- package/types/components/navigation/YNavigation.d.ts +1 -1
- package/types/components/pagination/YPagination.d.ts +20 -60
- package/types/components/plate/YPlate.d.ts +1 -3
- package/types/components/progress-bar/YProgressBar.d.ts +3 -43
- package/types/components/select/YSelect.d.ts +220 -844
- package/types/components/snackbar/YSnackbar.d.ts +43 -168
- package/types/components/switch/YSwitch.d.ts +1 -43
- package/types/components/tab/YTab.d.ts +14 -80
- package/types/components/tab/YTabs.d.ts +6 -39
- package/types/components/table/YDataTable.d.ts +17 -166
- package/types/components/table/YDataTableBody.d.ts +3 -26
- package/types/components/table/YDataTableCell.d.ts +1 -30
- package/types/components/table/YDataTableControl.d.ts +3 -18
- package/types/components/table/YDataTableHead.d.ts +3 -21
- package/types/components/table/YDataTableLayer.d.ts +1 -3
- package/types/components/table/YDataTableRow.d.ts +1 -9
- package/types/components/table/YDataTableServer.d.ts +20 -172
- package/types/components/table/YTable.d.ts +5 -24
- package/types/components/table/composibles/header.d.ts +1 -1
- package/types/components/table/composibles/items.d.ts +3 -3
- package/types/components/table/composibles/pagination.d.ts +3 -3
- package/types/components/table/composibles/selection.d.ts +4 -4
- package/types/components/table/composibles/sorting.d.ts +1 -1
- package/types/components/table/types/index.d.ts +1 -1
- package/types/components/text-ellipsis/YTextEllipsis.d.ts +1 -8
- package/types/components/text-highlighter/YTextHighlighter.d.ts +2 -17
- package/types/components/text-interpolation/YTi.d.ts +1 -10
- package/types/components/textarea/YTextarea.d.ts +20 -116
- package/types/components/tooltip/YTooltip.d.ts +30 -264
- package/types/components/tree-view/YTreeView.d.ts +4 -4
- package/types/components/tree-view/YTreeViewNode.d.ts +10 -67
- package/types/composables/choice.d.ts +1 -1
- package/types/composables/coordinate/index.d.ts +8 -8
- package/types/composables/coordinate/utils/point.d.ts +1 -1
- package/types/composables/defaults/index.d.ts +11 -0
- package/types/composables/defaults/share.d.ts +4 -0
- package/types/composables/defaults/types.d.ts +12 -0
- package/types/composables/form.d.ts +3 -3
- package/types/composables/icon.d.ts +5 -22
- package/types/composables/layer-group.d.ts +1 -1
- package/types/composables/list-items.d.ts +10 -10
- package/types/composables/progress.d.ts +1 -0
- package/types/composables/timing.d.ts +1 -1
- package/types/composables/transition.d.ts +1 -1
- package/types/composables/validation.d.ts +3 -3
- package/types/composables/vue-router.d.ts +1 -1
- package/types/globals.d.ts +1 -0
- package/types/util/Rect.d.ts +1 -1
- package/types/util/component/component.d.ts +5 -0
- package/types/util/component/index.d.ts +11 -0
- package/types/util/component/inject-self.d.ts +3 -0
- package/types/util/component/props.d.ts +32 -0
- package/types/util/component/types.d.ts +21 -0
- package/types/util/index.d.ts +1 -1
- package/types/util/vue-component/index.d.ts +10 -0
- package/types/util/vue-component/props.d.ts +31 -0
- package/types/util/vue-component/types.d.ts +4 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timing.mjs","names":["computed","ref","
|
|
1
|
+
{"version":3,"file":"timing.mjs","names":["computed","ref","unref","watch","useLazy","eager","updated","tick","tack","value","lazyValue","onAfterUpdate","entered","useTimer","cb","duration","options","tickDuration","tickInterval","timer","tickStart","drift","isWork","now","Date","realTick","tickDrift","nextInterval","window","setTimeout","start","stop","clearTimeout","reset","useDelay","props","callback","state","clearDelay","propKey","setDelay","timeout","resolve","active","generateDelay","delayTime","Promise","delay","parseInt","String","startOpenDelay","startCloseDelay"],"sources":["../../src/composables/timing.ts"],"sourcesContent":["import { type MaybeRef, type Ref, computed, ref, unref, watch } from 'vue';\n\nexport function useLazy(eager: Ref<boolean | undefined>, updated: Ref<any>) {\n const tick = ref(false);\n const tack = ref();\n tack.value = updated.value;\n const lazyValue = computed(() => {\n if (eager.value) return updated.value;\n return tack.value;\n });\n watch(updated, () => {\n if (!tick.value) {\n tack.value = updated.value;\n }\n if (!eager.value) {\n tick.value = true;\n }\n });\n function onAfterUpdate() {\n tack.value = updated.value;\n if (!eager.value) {\n tick.value = false;\n }\n }\n return {\n entered: tick,\n lazyValue,\n onAfterUpdate,\n };\n}\n\nexport function useTimer(\n cb: () => void,\n duration: MaybeRef<number>,\n options?: { tickDuration: number },\n) {\n const { tickDuration } = options ?? {};\n let tickInterval = tickDuration ?? 100;\n let timer = -1;\n\n const tickStart = ref(0);\n const drift = ref(unref(duration));\n const isWork = ref(false);\n\n function tick() {\n const now = Date.now();\n const realTick = now - tickStart.value;\n drift.value = drift.value - realTick;\n if (drift.value < 1) {\n cb();\n } else {\n const tickDrift = now - tickStart.value + tickInterval;\n const nextInterval = tickDrift >= 1 ? tickDrift : tickInterval;\n tickStart.value = now;\n timer = window.setTimeout(tick, nextInterval);\n }\n }\n\n function start() {\n if (isWork.value) return;\n isWork.value = true;\n tickStart.value = Date.now();\n timer = window.setTimeout(tick, tickInterval);\n }\n\n function stop() {\n window.clearTimeout(timer);\n timer = -1;\n isWork.value = false;\n }\n\n function reset() {\n stop();\n drift.value = unref(duration);\n }\n\n return {\n start,\n stop,\n reset,\n drift,\n isWork,\n };\n}\n\ntype DelayType = 'closeDelay' | 'openDelay';\n\nexport function useDelay(props: any, callback?: (active: boolean) => void) {\n const state: Partial<Record<DelayType, number>> = {};\n\n function clearDelay(propKey: DelayType) {\n state[propKey] && window.clearTimeout(state[propKey]);\n delete state[propKey];\n }\n\n function setDelay(propKey: DelayType, timeout: number, resolve: any) {\n state[propKey] = window.setTimeout(() => {\n const active = propKey === 'openDelay';\n callback?.(active);\n resolve(active);\n }, timeout);\n }\n\n const generateDelay = (propKey: DelayType) => () => {\n clearDelay('openDelay');\n clearDelay('closeDelay');\n const delayTime = props[propKey] ?? 0;\n return new Promise<boolean>((resolve) => {\n const delay = parseInt(String(delayTime), 10);\n setDelay(propKey, delay, resolve);\n });\n };\n\n return {\n startOpenDelay: generateDelay('openDelay'),\n startCloseDelay: generateDelay('closeDelay'),\n };\n}\n"],"mappings":"AAAA,SAAkCA,QAAQ,EAAEC,GAAG,EAAEC,KAAK,EAAEC,KAAK,QAAQ,KAAK;AAE1E,OAAO,SAASC,OAAOA,CAACC,KAA+B,EAAEC,OAAiB,EAAE;EAC1E,MAAMC,IAAI,GAAGN,GAAG,CAAC,KAAK,CAAC;EACvB,MAAMO,IAAI,GAAGP,GAAG,CAAC,CAAC;EAClBO,IAAI,CAACC,KAAK,GAAGH,OAAO,CAACG,KAAK;EAC1B,MAAMC,SAAS,GAAGV,QAAQ,CAAC,MAAM;IAC/B,IAAIK,KAAK,CAACI,KAAK,EAAE,OAAOH,OAAO,CAACG,KAAK;IACrC,OAAOD,IAAI,CAACC,KAAK;EACnB,CAAC,CAAC;EACFN,KAAK,CAACG,OAAO,EAAE,MAAM;IACnB,IAAI,CAACC,IAAI,CAACE,KAAK,EAAE;MACfD,IAAI,CAACC,KAAK,GAAGH,OAAO,CAACG,KAAK;IAC5B;IACA,IAAI,CAACJ,KAAK,CAACI,KAAK,EAAE;MAChBF,IAAI,CAACE,KAAK,GAAG,IAAI;IACnB;EACF,CAAC,CAAC;EACF,SAASE,aAAaA,CAAA,EAAG;IACvBH,IAAI,CAACC,KAAK,GAAGH,OAAO,CAACG,KAAK;IAC1B,IAAI,CAACJ,KAAK,CAACI,KAAK,EAAE;MAChBF,IAAI,CAACE,KAAK,GAAG,KAAK;IACpB;EACF;EACA,OAAO;IACLG,OAAO,EAAEL,IAAI;IACbG,SAAS;IACTC;EACF,CAAC;AACH;AAEA,OAAO,SAASE,QAAQA,CACtBC,EAAc,EACdC,QAA0B,EAC1BC,OAAkC,EAClC;EACA,MAAM;IAAEC;EAAa,CAAC,GAAGD,OAAO,IAAI,CAAC,CAAC;EACtC,IAAIE,YAAY,GAAGD,YAAY,IAAI,GAAG;EACtC,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
|
1
|
-
{"version":3,"file":"transition.mjs","names":["Transition","computed","h","propsFactory","pressPolyTransitionPropsOptions","transition","type","String","Object","default","usePolyTransition","props","polyTransitionBindProps","is","transitionProps","name","PolyTransition","_ref","slots","forcedProps","component","rest"],"sources":["../../src/composables/transition.ts"],"sourcesContent":["import {\
|
|
1
|
+
{"version":3,"file":"transition.mjs","names":["Transition","computed","h","propsFactory","pressPolyTransitionPropsOptions","transition","type","String","Object","default","usePolyTransition","props","polyTransitionBindProps","is","transitionProps","name","PolyTransition","_ref","slots","forcedProps","component","rest"],"sources":["../../src/composables/transition.ts"],"sourcesContent":["import {\n type Component,\n type FunctionalComponent,\n type PropType,\n Transition,\n type TransitionProps,\n computed,\n h,\n} from 'vue';\n\nimport { propsFactory } from '@/util/component/props';\n\nexport const pressPolyTransitionPropsOptions = propsFactory(\n {\n transition: {\n type: [String, Object] as PropType<\n string | (TransitionProps & { is?: Component })\n >,\n default: 'slide-fade',\n },\n },\n 'PolyTransition',\n);\n\nexport function usePolyTransition(props: { transition: any }) {\n const polyTransitionBindProps = computed(() => {\n const { is, ...transitionProps } =\n typeof props.transition === 'object'\n ? props.transition\n : { is: props.transition, name: props.transition };\n return {\n is,\n transitionProps,\n };\n });\n\n return {\n polyTransitionBindProps,\n };\n}\n\nexport const PolyTransition: FunctionalComponent<\n TransitionProps & { is: string | Component; transitionProps: TransitionProps }\n> = (props, { slots }) => {\n const { is, transitionProps, ...forcedProps } = props;\n const { component = Transition, ...rest } =\n typeof is === 'object'\n ? { component: is, ...transitionProps }\n : { name: is };\n return h(component, { ...rest, ...transitionProps, ...forcedProps }, slots);\n};\n"],"mappings":"AAAA,SAIEA,UAAU,EAEVC,QAAQ,EACRC,CAAC,QACI,KAAK;AAAC,SAEJC,YAAY;AAErB,OAAO,MAAMC,+BAA+B,GAAGD,YAAY,CACzD;EACEE,UAAU,EAAE;IACVC,IAAI,EAAE,CAACC,MAAM,EAAEC,MAAM,CAEpB;IACDC,OAAO,EAAE;EACX;AACF,CAAC,EACD,gBACF,CAAC;AAED,OAAO,SAASC,iBAAiBA,CAACC,KAA0B,EAAE;EAC5D,MAAMC,uBAAuB,GAAGX,QAAQ,CAAC,MAAM;IAC7C,MAAM;MAAEY,EAAE;MAAE,GAAGC;IAAgB,CAAC,GAC9B,OAAOH,KAAK,CAACN,UAAU,KAAK,QAAQ,GAChCM,KAAK,CAACN,UAAU,GAChB;MAAEQ,EAAE,EAAEF,KAAK,CAACN,UAAU;MAAEU,IAAI,EAAEJ,KAAK,CAACN;IAAW,CAAC;IACtD,OAAO;MACLQ,EAAE;MACFC;IACF,CAAC;EACH,CAAC,CAAC;EAEF,OAAO;IACLF;EACF,CAAC;AACH;AAEA,OAAO,MAAMI,cAEZ,GAAGA,CAACL,KAAK,EAAAM,IAAA,KAAgB;EAAA,IAAd;IAAEC;EAAM,CAAC,GAAAD,IAAA;EACnB,MAAM;IAAEJ,EAAE;IAAEC,eAAe;IAAE,GAAGK;EAAY,CAAC,GAAGR,KAAK;EACrD,MAAM;IAAES,SAAS,GAAGpB,UAAU;IAAE,GAAGqB;EAAK,CAAC,GACvC,OAAOR,EAAE,KAAK,QAAQ,GAClB;IAAEO,SAAS,EAAEP,EAAE;IAAE,GAAGC;EAAgB,CAAC,GACrC;IAAEC,IAAI,EAAEF;EAAG,CAAC;EAClB,OAAOX,CAAC,CAACkB,SAAS,EAAE;IAAE,GAAGC,IAAI;IAAE,GAAGP,eAAe;IAAE,GAAGK;EAAY,CAAC,EAAED,KAAK,CAAC;AAC7E,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { computed, getCurrentInstance, onBeforeMount, ref, watch } from 'vue';
|
|
2
|
-
import { getUid, propsFactory } from "../util/index.mjs";
|
|
2
|
+
import { getUid, propsFactory } from "../util/component/index.mjs";
|
|
3
3
|
import { useModelDuplex } from "./communication.mjs";
|
|
4
4
|
import { useForm } from "./form.mjs";
|
|
5
5
|
import { useToggleScope } from "./scope.mjs";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validation.mjs","names":["computed","getCurrentInstance","onBeforeMount","ref","watch","getUid","propsFactory","useModelDuplex","useForm","useToggleScope","pressValidationPropsOptions","readonly","Boolean","disabled","status","type","String","validator","value","includes","helperText","validators","Array","validateOn","validationValue","maxErrors","Number","default","useValidation","props","name","uid","arguments","length","undefined","cid","model","validationModel","vm","form","validating","onSet","Set","split","blur","has","input","lazy","submit","errorResult","errors","isReadonly","isDisabled","isLoading","loading","isError","isSuccess","invokeValidators","focused","unwatch","val","results","isArray","handler","result","console","warn","push","resetError","resetValidation","register","id","vnode","validate"],"sources":["../../src/composables/validation.ts"],"sourcesContent":["import {\n PropType,\n computed,\n getCurrentInstance,\n onBeforeMount,\n ref,\n watch,\n} from 'vue';\n\nimport { getUid, propsFactory } from '
|
|
1
|
+
{"version":3,"file":"validation.mjs","names":["computed","getCurrentInstance","onBeforeMount","ref","watch","getUid","propsFactory","useModelDuplex","useForm","useToggleScope","pressValidationPropsOptions","readonly","Boolean","disabled","status","type","String","validator","value","includes","helperText","validators","Array","validateOn","validationValue","maxErrors","Number","default","useValidation","props","name","uid","arguments","length","undefined","cid","model","validationModel","vm","form","validating","onSet","Set","split","blur","has","input","lazy","submit","errorResult","errors","isReadonly","isDisabled","isLoading","loading","isError","isSuccess","invokeValidators","focused","unwatch","val","results","isArray","handler","result","console","warn","push","resetError","resetValidation","register","id","vnode","validate"],"sources":["../../src/composables/validation.ts"],"sourcesContent":["import {\n type PropType,\n computed,\n getCurrentInstance,\n onBeforeMount,\n ref,\n watch,\n} from 'vue';\n\nimport { getUid, propsFactory } from '@/util/component';\n\nimport { useModelDuplex } from './communication';\nimport { useForm } from './form';\nimport { useToggleScope } from './scope';\n\nexport interface ValidationProps {\n validateOn: 'input' | 'blur' | 'lazy' | 'submit' | string;\n}\n\nexport const pressValidationPropsOptions = propsFactory(\n {\n readonly: Boolean as PropType<boolean>,\n disabled: Boolean as PropType<boolean>,\n status: {\n type: String as PropType<'success' | 'warning' | 'error' | undefined>,\n validator(value: string) {\n return ['success', 'warning', 'error'].includes(value);\n },\n },\n helperText: String,\n validators: Array as PropType<((v: any) => boolean | string)[] | string[]>,\n validateOn: {\n type: String as PropType<ValidationProps['validateOn']>,\n },\n validationValue: null,\n maxErrors: {\n type: [Number, String] as PropType<number | string>,\n default: 1,\n },\n },\n 'validation',\n);\n\nexport function useValidation(props: any, name: string, uid = getUid()) {\n const cid = computed(() => props.name ?? uid);\n const model = useModelDuplex(props, 'modelValue');\n const validationModel = computed(() =>\n props.validationValue === undefined ? model.value : props.validationValue,\n );\n const vm = getCurrentInstance()!;\n const form = useForm();\n const validating = ref(false);\n const validateOn = computed(() => {\n let value = props.validateOn || 'input';\n if (value === 'lazy') value = 'input,lazy';\n const onSet = new Set(value?.split(',') ?? []);\n\n return {\n blur: onSet.has('blur') || onSet.has('input'),\n input: onSet.has('input'),\n lazy: onSet.has('lazy'),\n submit: onSet.has('submit'),\n };\n });\n\n const errorResult = ref();\n const errors = ref<any[]>([]);\n\n const isReadonly = computed(() => props.readonly ?? form?.isReadonly.value);\n\n const isDisabled = computed(() => props.disabled ?? form?.isDisabled.value);\n\n const isLoading = computed(() => props.loading ?? form?.isLoading.value);\n\n const isError = computed(() => {\n return props.status === 'error' || errors.value.length > 0;\n });\n\n const isSuccess = computed(() => {\n return !isError.value && props.status === 'success';\n });\n\n useToggleScope(\n () => validateOn.value.input,\n () => {\n watch(validationModel, () => {\n if (validationModel.value != null) {\n invokeValidators();\n } else if (props.focused) {\n const unwatch = watch(\n () => props.focused,\n (val) => {\n if (!val) invokeValidators();\n\n unwatch();\n },\n );\n }\n });\n },\n );\n\n async function invokeValidators() {\n const results: any[] = [];\n validating.value = true;\n\n if (Array.isArray(props.validators)) {\n for (const validator of props.validators) {\n if (results.length >= +(props.maxErrors ?? 1)) {\n break;\n }\n\n const handler =\n typeof validator === 'function' ? validator : () => validator;\n const result = await handler(validationModel.value);\n\n if (result === true) {\n continue;\n }\n\n if (result !== false && typeof result !== 'string') {\n console.warn('Wrong validator return type');\n continue;\n }\n results.push(result || '');\n }\n }\n validating.value = false;\n errors.value = results;\n errorResult.value = results?.[0];\n\n return results;\n }\n\n function resetError() {\n errors.value = [];\n errorResult.value = undefined;\n }\n\n async function resetValidation() {\n if (!validateOn.value.lazy) {\n await invokeValidators();\n } else {\n resetError();\n }\n }\n\n onBeforeMount(() => {\n form?.register({\n id: cid.value,\n vnode: vm.vnode,\n resetValidation,\n validate: invokeValidators,\n });\n });\n\n return {\n invokeValidators,\n resetError,\n validating,\n validateOn,\n errorResult,\n errors,\n isReadonly,\n isDisabled,\n isLoading,\n isError,\n isSuccess,\n };\n}\n"],"mappings":"AAAA,SAEEA,QAAQ,EACRC,kBAAkB,EAClBC,aAAa,EACbC,GAAG,EACHC,KAAK,QACA,KAAK;AAAC,SAEJC,MAAM,EAAEC,YAAY;AAAA,SAEpBC,cAAc;AAAA,SACdC,OAAO;AAAA,SACPC,cAAc;AAMvB,OAAO,MAAMC,2BAA2B,GAAGJ,YAAY,CACrD;EACEK,QAAQ,EAAEC,OAA4B;EACtCC,QAAQ,EAAED,OAA4B;EACtCE,MAAM,EAAE;IACNC,IAAI,EAAEC,MAA+D;IACrEC,SAASA,CAACC,KAAa,EAAE;MACvB,OAAO,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,CAAC,CAACC,QAAQ,CAACD,KAAK,CAAC;IACxD;EACF,CAAC;EACDE,UAAU,EAAEJ,MAAM;EAClBK,UAAU,EAAEC,KAA8D;EAC1EC,UAAU,EAAE;IACVR,IAAI,EAAEC;EACR,CAAC;EACDQ,eAAe,EAAE,IAAI;EACrBC,SAAS,EAAE;IACTV,IAAI,EAAE,CAACW,MAAM,EAAEV,MAAM,CAA8B;IACnDW,OAAO,EAAE;EACX;AACF,CAAC,EACD,YACF,CAAC;AAED,OAAO,SAASC,aAAaA,CAACC,KAAU,EAAEC,IAAY,EAAkB;EAAA,IAAhBC,GAAG,GAAAC,SAAA,CAAA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Q,EAAEhB;IACZ,CAAC,CAAC;EACJ,CAAC,CAAC;EAEF,OAAO;IACLA,gBAAgB;IAChBW,UAAU;IACV5B,UAAU;IACVjB,UAAU;IACV0B,WAAW;IACXC,MAAM;IACNC,UAAU;IACVC,UAAU;IACVC,SAAS;IACTE,OAAO;IACPC;EACF,CAAC;AACH"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { computed, resolveDynamicComponent, toRef } from 'vue';
|
|
2
|
-
import { hasEventProp, propsFactory } from "../util/index.mjs";
|
|
2
|
+
import { hasEventProp, propsFactory } from "../util/component/index.mjs";
|
|
3
3
|
export const pressVueRouterPropsOptions = propsFactory({
|
|
4
4
|
href: String,
|
|
5
5
|
replace: Boolean,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vue-router.mjs","names":["computed","resolveDynamicComponent","toRef","hasEventProp","propsFactory","pressVueRouterPropsOptions","href","String","replace","Boolean","to","Object","exact","useLink","props","attrs","RouterLink","isLink","isClickable","value","link","undefined","route","navigate","isActive","isExactActive"],"sources":["../../src/composables/vue-router.ts"],"sourcesContent":["import type { ComputedRef, PropType, Ref, SetupContext } from 'vue';\nimport { computed, resolveDynamicComponent, toRef } from 'vue';\nimport type {\n RouteLocationRaw,\n UseLinkOptions,\n RouterLink as VueRouterLink,\n} from 'vue-router';\nimport { useLink as _useLink } from 'vue-router';\n\nimport { EventProp, hasEventProp, propsFactory } from '
|
|
1
|
+
{"version":3,"file":"vue-router.mjs","names":["computed","resolveDynamicComponent","toRef","hasEventProp","propsFactory","pressVueRouterPropsOptions","href","String","replace","Boolean","to","Object","exact","useLink","props","attrs","RouterLink","isLink","isClickable","value","link","undefined","route","navigate","isActive","isExactActive"],"sources":["../../src/composables/vue-router.ts"],"sourcesContent":["import type { ComputedRef, PropType, Ref, SetupContext } from 'vue';\nimport { computed, resolveDynamicComponent, toRef } from 'vue';\nimport type {\n RouteLocationRaw,\n UseLinkOptions,\n RouterLink as VueRouterLink,\n} from 'vue-router';\nimport { useLink as _useLink } from 'vue-router';\n\nimport { type EventProp, hasEventProp, propsFactory } from '@/util/component';\n\nexport interface LinkProps {\n href: string | undefined;\n replace: boolean | undefined;\n to: RouteLocationRaw | undefined;\n exact: boolean | undefined;\n}\n\nexport interface LinkListeners {\n onClick?: EventProp | undefined;\n onClickOnce?: EventProp | undefined;\n}\n\nexport const pressVueRouterPropsOptions = propsFactory(\n {\n href: String,\n replace: Boolean,\n to: [String, Object] as PropType<RouteLocationRaw>,\n exact: Boolean,\n },\n 'VueRouter',\n);\n\nexport interface UseLink\n extends Omit<Partial<ReturnType<typeof _useLink>>, 'href'> {\n isLink: ComputedRef<boolean>;\n isClickable: ComputedRef<boolean>;\n href: Ref<string | undefined>;\n}\n\nexport function useLink(\n props: LinkProps & LinkListeners,\n attrs: SetupContext['attrs'],\n): UseLink {\n const RouterLink = resolveDynamicComponent('RouterLink') as\n | typeof VueRouterLink\n | string;\n\n const isLink = computed(() => !!(props.href || props.to));\n const isClickable = computed(() => {\n return (\n isLink?.value ||\n hasEventProp(attrs, 'click') ||\n hasEventProp(props, 'click')\n );\n });\n if (typeof RouterLink === 'string') {\n return {\n isLink,\n isClickable,\n href: toRef(props, 'href'),\n };\n }\n const link = props.to\n ? RouterLink.useLink(props as UseLinkOptions)\n : undefined;\n return {\n isLink,\n isClickable,\n route: link?.route,\n navigate: link?.navigate,\n isActive:\n link &&\n computed(() =>\n props.exact ? link.isExactActive?.value : link.isActive?.value,\n ),\n href: computed(() => (props.to ? link?.route.value.href : props.href)),\n };\n}\n"],"mappings":"AACA,SAASA,QAAQ,EAAEC,uBAAuB,EAAEC,KAAK,QAAQ,KAAK;AAAC,SAQtCC,YAAY,EAAEC,YAAY;AAcnD,OAAO,MAAMC,0BAA0B,GAAGD,YAAY,CACpD;EACEE,IAAI,EAAEC,MAAM;EACZC,OAAO,EAAEC,OAAO;EAChBC,EAAE,EAAE,CAACH,MAAM,EAAEI,MAAM,CAA+B;EAClDC,KAAK,EAA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2
|
import * as components from "./components/index.mjs";
|
|
3
3
|
import { YUYEON_DATE_KEY, YUYEON_DATE_OPTIONS_KEY, createDateModule } from "./composables/date/index.mjs";
|
|
4
|
+
import { createDefaultsModule } from "./composables/defaults/index.mjs";
|
|
5
|
+
import { YUYEON_DEFAULTS_KEY } from "./composables/defaults/share.mjs";
|
|
4
6
|
import { createI18nModule } from "./composables/i18n/index.mjs";
|
|
5
7
|
import { YUYEON_I18N_KEY } from "./composables/i18n/share.mjs";
|
|
6
8
|
import { YUYEON_ICON_KEY, createIconModule } from "./composables/icon.mjs";
|
|
7
9
|
import { YUYEON_THEME_KEY, createThemeModule, useTheme } from "./composables/theme/index.mjs";
|
|
8
10
|
import PlateWave from "./directives/plate-wave/index.mjs";
|
|
9
|
-
import { YUYEON_LOGO } from "./etc/index.mjs";
|
|
11
|
+
import { YUYEON_LOGO } from "./etc/index.mjs";
|
|
10
12
|
import "./styles/base.scss";
|
|
11
13
|
const defaultOptions = {
|
|
12
14
|
credit: true
|
|
13
15
|
};
|
|
14
16
|
export function init() {
|
|
15
17
|
let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultOptions;
|
|
18
|
+
const defaultsModule = createDefaultsModule(options?.defaults);
|
|
16
19
|
const themeModule = createThemeModule(options?.theme);
|
|
17
20
|
const i18nModule = createI18nModule(options?.i18n);
|
|
18
21
|
const dateModule = createDateModule(options?.date, i18nModule.localeModule);
|
|
@@ -27,13 +30,15 @@ export function init() {
|
|
|
27
30
|
...i18nModule.localeModule,
|
|
28
31
|
...i18nModule.rtlModule
|
|
29
32
|
},
|
|
30
|
-
date: dateModule
|
|
33
|
+
date: dateModule,
|
|
34
|
+
defaults: defaultsModule
|
|
31
35
|
});
|
|
32
36
|
Object.keys(components).forEach(componentName => {
|
|
33
37
|
const comp = components[componentName];
|
|
34
38
|
if (typeof comp === 'object' && 'name' in comp) app.component(componentName, comp);
|
|
35
39
|
});
|
|
36
40
|
app.directive('plate-wave', PlateWave);
|
|
41
|
+
app.provide(YUYEON_DEFAULTS_KEY, defaultsModule);
|
|
37
42
|
app.provide(YUYEON_THEME_KEY, themeModule.instance);
|
|
38
43
|
app.provide(YUYEON_ICON_KEY, iconModule);
|
|
39
44
|
app.provide(YUYEON_I18N_KEY, {
|
package/lib/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["getCurrentInstance","nextTick","reactive","components","YUYEON_DATE_KEY","YUYEON_DATE_OPTIONS_KEY","createDateModule","createI18nModule","YUYEON_I18N_KEY","YUYEON_ICON_KEY","createIconModule","YUYEON_THEME_KEY","createThemeModule","useTheme","PlateWave","YUYEON_LOGO","defaultOptions","credit","init","options","arguments","length","undefined","themeModule","theme","i18nModule","i18n","dateModule","date","localeModule","iconModule","icon","install","app","yuyeon","root","instance","rtlModule","Object","keys","forEach","componentName","comp","component","directive","provide","config","globalProperties","$yuyeon","_container","_instance","classList","add","setAttribute","console","log","unmount","mount","vm","scope","stop","useYuyeon","Error","appContext"],"sources":["../src/index.ts"],"sourcesContent":["import { Component, ComponentInternalInstance } from '
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["getCurrentInstance","nextTick","reactive","components","YUYEON_DATE_KEY","YUYEON_DATE_OPTIONS_KEY","createDateModule","createDefaultsModule","YUYEON_DEFAULTS_KEY","createI18nModule","YUYEON_I18N_KEY","YUYEON_ICON_KEY","createIconModule","YUYEON_THEME_KEY","createThemeModule","useTheme","PlateWave","YUYEON_LOGO","defaultOptions","credit","init","options","arguments","length","undefined","defaultsModule","defaults","themeModule","theme","i18nModule","i18n","dateModule","date","localeModule","iconModule","icon","install","app","yuyeon","root","instance","rtlModule","Object","keys","forEach","componentName","comp","component","directive","provide","config","globalProperties","$yuyeon","_container","_instance","classList","add","setAttribute","console","log","unmount","mount","vm","scope","stop","useYuyeon","Error","appContext"],"sources":["../src/index.ts"],"sourcesContent":["import type { App, Component, ComponentInternalInstance } from 'vue';\nimport { getCurrentInstance, nextTick, reactive } from 'vue';\n\nimport * as components from '@/components';\nimport {\n YUYEON_DATE_KEY,\n YUYEON_DATE_OPTIONS_KEY,\n createDateModule,\n} from '@/composables/date';\nimport { createDefaultsModule } from '@/composables/defaults';\nimport { YUYEON_DEFAULTS_KEY } from '@/composables/defaults/share';\nimport { createI18nModule } from '@/composables/i18n';\nimport { YUYEON_I18N_KEY } from '@/composables/i18n/share';\nimport { YUYEON_ICON_KEY, createIconModule } from '@/composables/icon';\nimport {\n YUYEON_THEME_KEY,\n createThemeModule,\n useTheme,\n} from '@/composables/theme';\nimport PlateWave from '@/directives/plate-wave';\nimport { YUYEON_LOGO } from '@/etc';\n\nimport './styles/base.scss';\n\nconst defaultOptions = {\n credit: true,\n};\n\ndeclare module 'vue' {\n interface ComponentCustomProperties {\n $yuyeon: any;\n }\n}\n\nexport function init(options: any = defaultOptions) {\n const defaultsModule = createDefaultsModule(options?.defaults);\n const themeModule = createThemeModule(options?.theme);\n const i18nModule = createI18nModule(options?.i18n);\n const dateModule = createDateModule(options?.date, i18nModule.localeModule);\n const iconModule = createIconModule(options?.icon);\n const install = (app: App): any => {\n themeModule.install(app);\n\n const yuyeon = reactive({\n app: null as ComponentInternalInstance | null,\n root: null as HTMLElement | null,\n theme: themeModule.instance,\n i18n: {\n ...i18nModule.localeModule,\n ...i18nModule.rtlModule,\n },\n date: dateModule,\n defaults: defaultsModule,\n });\n\n Object.keys(components).forEach((componentName) => {\n const comp = components[componentName as keyof typeof components];\n if (typeof comp === 'object' && 'name' in comp)\n app.component(componentName, comp as Component);\n });\n\n app.directive('plate-wave', PlateWave);\n\n app.provide(YUYEON_DEFAULTS_KEY, defaultsModule);\n app.provide(YUYEON_THEME_KEY, themeModule.instance);\n app.provide(YUYEON_ICON_KEY, iconModule);\n app.provide(YUYEON_I18N_KEY, {\n ...i18nModule.localeModule,\n ...i18nModule.rtlModule,\n });\n app.provide(YUYEON_DATE_OPTIONS_KEY, dateModule.options);\n app.provide(YUYEON_DATE_KEY, dateModule.instance);\n\n app.config.globalProperties.$yuyeon = yuyeon;\n\n nextTick(() => {\n yuyeon.root = app._container;\n yuyeon.app = app._instance as any;\n if (yuyeon.root) {\n yuyeon.root.classList.add('y-root');\n yuyeon.root.setAttribute('data-y-root', '');\n themeModule.init(yuyeon);\n }\n });\n\n if (options?.credit) {\n console.log(YUYEON_LOGO);\n }\n const { unmount, mount } = app;\n app.mount = (...args) => {\n const vm = mount(...args);\n if (!yuyeon.app) {\n yuyeon.app = app._instance as any;\n }\n if (!yuyeon.root) {\n nextTick(() => {\n yuyeon.root = app._container;\n if (yuyeon.root) {\n yuyeon.root.classList.add('y-root');\n yuyeon.root.setAttribute('data-y-root', '');\n themeModule.init(yuyeon);\n }\n });\n }\n app.mount = mount;\n return vm;\n };\n app.unmount = () => {\n unmount();\n themeModule.scope.stop();\n app.unmount = unmount;\n };\n };\n\n return {\n install,\n };\n}\n\nexport function useYuyeon() {\n const vm = getCurrentInstance();\n if (!vm) throw new Error('[yuyeon] Called outside of setup context');\n\n return vm.appContext.config.globalProperties.$yuyeon;\n}\n\nexport { useTheme };\n"],"mappings":"AACA,SAASA,kBAAkB,EAAEC,QAAQ,EAAEC,QAAQ,QAAQ,KAAK;AAAC,OAEtD,KAAKC,UAAU;AAAA,SAEpBC,eAAe,EACfC,uBAAuB,EACvBC,gBAAgB;AAAA,SAETC,oBAAoB;AAAA,SACpBC,mBAAmB;AAAA,SACnBC,gBAAgB;AAAA,SAChBC,eAAe;AAAA,SACfC,eAAe,EAAEC,gBAAgB;AAAA,SAExCC,gBAAgB,EAChBC,iBAAiB,EACjBC,QAAQ;AAAA,OAEHC,SAAS;AAAA,SACPC,WAAW;AAEpB;AAEA,MAAMC,cAAc,GAAG;EACrBC,MAAM,EAAE;AACV,CAAC;AAQD,OAAO,SAASC,IAAIA,CAAA,EAAgC;EAAA,IAA/BC,OAAY,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAGJ,cAAc;EA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IAAIf,MAAM,CAACC,IAAI,EAAE;YACfD,MAAM,CAACC,IAAI,CAACgB,SAAS,CAACC,GAAG,CAAC,QAAQ,CAAC;YACnClB,MAAM,CAACC,IAAI,CAACkB,YAAY,CAAC,aAAa,EAAE,EAAE,CAAC;YAC3C9B,WAAW,CAACP,IAAI,CAACkB,MAAM,CAAC;UAC1B;QACF,CAAC,CAAC;MACJ;MACAD,GAAG,CAACwB,KAAK,GAAGA,KAAK;MACjB,OAAOC,EAAE;IACX,CAAC;IACDzB,GAAG,CAACuB,OAAO,GAAG,MAAM;MAClBA,OAAO,CAAC,CAAC;MACTjC,WAAW,CAACoC,KAAK,CAACC,IAAI,CAAC,CAAC;MACxB3B,GAAG,CAACuB,OAAO,GAAGA,OAAO;IACvB,CAAC;EACH,CAAC;EAED,OAAO;IACLxB;EACF,CAAC;AACH;AAEA,OAAO,SAAS6B,SAASA,CAAA,EAAG;EAC1B,MAAMH,EAAE,GAAG9D,kBAAkB,CAAC,CAAC;EAC/B,IAAI,CAAC8D,EAAE,EAAE,MAAM,IAAII,KAAK,CAAC,0CAA0C,CAAC;EAEpE,OAAOJ,EAAE,CAACK,UAAU,CAACjB,MAAM,CAACC,gBAAgB,CAACC,OAAO;AACtD;AAEA,SAASrC,QAAQ"}
|
package/lib/util/anchor.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"anchor.mjs","names":["includes","array","item","block","inline","parseAnchor","anchor","isRtl","side","align","split","toPhysical","str","flipSide","center","top","bottom","left","right","flipAlign","flipCorner","getAxis"],"sources":["../../src/util/anchor.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"anchor.mjs","names":["includes","array","item","block","inline","parseAnchor","anchor","isRtl","side","align","split","toPhysical","str","flipSide","center","top","bottom","left","right","flipAlign","flipCorner","getAxis"],"sources":["../../src/util/anchor.ts"],"sourcesContent":["const includes = <T, A extends T>(\n array: ReadonlyArray<A>,\n item: T,\n): item is A => array.includes(item as A);\n\nconst block = ['top', 'bottom'] as const;\nconst inline = ['start', 'end', 'left', 'right'] as const;\ntype Tblock = (typeof block)[number];\ntype Tinline = (typeof inline)[number];\nexport type Anchor =\n | Tblock\n | Tinline\n | 'center'\n | 'center center'\n | `${Tblock} ${Tinline | 'center'}`\n | `${Tinline} ${Tblock | 'center'}`;\nexport type ParsedAnchor =\n | { side: 'center'; align: 'center' }\n | { side: Tblock; align: 'left' | 'right' | 'center' }\n | { side: 'left' | 'right'; align: Tblock | 'center' };\n\n/** Parse a raw anchor string into an object */\nexport function parseAnchor(anchor: Anchor, isRtl: boolean) {\n let [side, align] = anchor.split(' ') as [\n Tblock | Tinline | 'center',\n Tblock | Tinline | 'center' | undefined,\n ];\n if (!align) {\n align = includes(block, side)\n ? 'start'\n : includes(inline, side)\n ? 'top'\n : 'center';\n }\n\n return {\n side: toPhysical(side, isRtl),\n align: toPhysical(align, isRtl),\n } as ParsedAnchor;\n}\n\nexport function toPhysical(str: 'center' | Tblock | Tinline, isRtl: boolean) {\n if (str === 'start') return isRtl ? 'right' : 'left';\n if (str === 'end') return isRtl ? 'left' : 'right';\n return str;\n}\n\nexport function flipSide(anchor: ParsedAnchor) {\n return {\n side: {\n center: 'center',\n top: 'bottom',\n bottom: 'top',\n left: 'right',\n right: 'left',\n }[anchor.side],\n align: anchor.align,\n } as ParsedAnchor;\n}\n\nexport function flipAlign(anchor: ParsedAnchor) {\n return {\n side: anchor.side,\n align: {\n center: 'center',\n top: 'bottom',\n bottom: 'top',\n left: 'right',\n right: 'left',\n }[anchor.align],\n } as ParsedAnchor;\n}\n\nexport function flipCorner(anchor: ParsedAnchor) {\n return {\n side: anchor.align,\n align: anchor.side,\n } as ParsedAnchor;\n}\n\nexport function getAxis(anchor: ParsedAnchor) {\n return includes(block, anchor.side) ? 'y' : 'x';\n}\n"],"mappings":"AAAA,MAAMA,QAAQ,GAAGA,CACfC,KAAuB,EACvBC,IAAO,KACOD,KAAK,CAACD,QAAQ,CAACE,IAAS,CAAC;A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,MAAM,EAAE,QAAQ;MAChBC,GAAG,EAAE,QAAQ;MACbC,MAAM,EAAE,KAAK;MACbC,IAAI,EAAE,OAAO;MACbC,KAAK,EAAE;IACT,CAAC,CAACZ,MAAM,CAACG,KAAK;EAChB,CAAC;AACH;AAEA,OAAO,SAASW,UAAUA,CAACd,MAAoB,EAAE;EAC/C,OAAO;IACLE,IAAI,EAAEF,MAAM,CAACG,KAAK;IAClBA,KAAK,EAAEH,MAAM,CAACE;EAChB,CAAC;AACH;AAEA,OAAO,SAASa,OAAOA,CAACf,MAAoB,EAAE;EAC5C,OAAON,QAAQ,CAACG,KAAK,EAAEG,MAAM,CAACE,IAAI,CAAC,GAAG,GAAG,GAAG,GAAG;AACjD"}
|
package/lib/util/array.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"array.mjs","names":["differenceBetween","inspect","exclude","ret","target","includes","push","wrapInArray","arrOrNot","Array","isArray"],"sources":["../../src/util/array.ts"],"sourcesContent":["export function differenceBetween(inspect: any[], exclude: any[]) {\
|
|
1
|
+
{"version":3,"file":"array.mjs","names":["differenceBetween","inspect","exclude","ret","target","includes","push","wrapInArray","arrOrNot","Array","isArray"],"sources":["../../src/util/array.ts"],"sourcesContent":["export function differenceBetween(inspect: any[], exclude: any[]) {\n const ret = [];\n for (const target of exclude) {\n if (!inspect.includes(target)) {\n ret.push(target);\n }\n }\n return ret;\n}\n\nexport function wrapInArray(arrOrNot: any | any[]) {\n return Array.isArray(arrOrNot) ? arrOrNot : [arrOrNot];\n}\n"],"mappings":"AAAA,OAAO,SAASA,iBAAiBA,CAACC,OAAc,EAAEC,OAAc,EAAE;EAChE,MAAMC,GAAG,GAAG,EAAE;EACd,KAAK,MAAMC,MAAM,IAAIF,OAAO,EAAE;IAC5B,IAAI,CAACD,OAAO,CAACI,QAAQ,CAACD,MAAM,CAAC,EAAE;MAC7BD,GAAG,CAACG,IAAI,CAACF,MAAM,CAAC;IAClB;EACF;EACA,OAAOD,GAAG;AACZ;AAEA,OAAO,SAASI,WAAWA,CAACC,QAAqB,EAAE;EACjD,OAAOC,KAAK,CAACC,OAAO,CAACF,QAAQ,CAAC,GAAGA,QAAQ,GAAG,CAACA,QAAQ,CAAC;AACxD"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { useDefaultsModule, useSuperDefaults } from "../../composables/defaults/index.mjs"; // overload 1: no props from options
|
|
2
|
+
// overload 2: defineComponent with options object, infer props from options
|
|
3
|
+
function redefineComponent(options) {
|
|
4
|
+
options._setup = options._setup ?? options.setup;
|
|
5
|
+
if (options._setup) {
|
|
6
|
+
options.setup = function (props, ctx) {
|
|
7
|
+
const defaults = useDefaultsModule();
|
|
8
|
+
// Skip props proxy if defaults are not provided
|
|
9
|
+
if (!defaults.value) return options._setup(props, ctx);
|
|
10
|
+
const {
|
|
11
|
+
props: _props,
|
|
12
|
+
provideSubDefaults
|
|
13
|
+
} = useSuperDefaults(props, options.name, defaults);
|
|
14
|
+
const setupBindings = options._setup(_props, ctx);
|
|
15
|
+
provideSubDefaults();
|
|
16
|
+
return setupBindings;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
return options;
|
|
20
|
+
}
|
|
21
|
+
export { redefineComponent as defineComponent };
|
|
22
|
+
//# sourceMappingURL=component.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component.mjs","names":["useDefaultsModule","useSuperDefaults","redefineComponent","options","_setup","setup","props","ctx","defaults","value","_props","provideSubDefaults","name","setupBindings","defineComponent"],"sources":["../../../src/util/component/component.ts"],"sourcesContent":["import { ComponentOptionsWithObjectProps, ComponentOptionsWithoutProps, defineComponent } from 'vue';\nimport type {\n Component,\n ComponentInjectOptions,\n ComponentOptions,\n ComponentOptionsMixin,\n ComponentPropsOptions,\n ComponentProvideOptions,\n ComputedOptions,\n DefineComponent,\n Directive,\n EmitsOptions,\n MethodOptions,\n SlotsType,\n} from 'vue';\n\nimport {\n useDefaultsModule,\n useSuperDefaults,\n} from '../../composables/defaults';\nimport { EmitsToProps } from './types';\n\ntype ToResolvedProps<Props, Emits extends EmitsOptions> = Readonly<Props> &\n Readonly<EmitsToProps<Emits>>;\n\n// overload 1: no props from options\nfunction redefineComponent<\n // props\n PropsOptions = {},\n //\n RawBindings = {},\n // emits\n E extends EmitsOptions = {},\n EE extends string = string,\n // other options\n Data = {},\n SetupBindings = {},\n Computed extends ComputedOptions = {},\n Methods extends MethodOptions = {},\n Mixin extends ComponentOptionsMixin = ComponentOptionsMixin,\n Extends extends ComponentOptionsMixin = ComponentOptionsMixin,\n InjectOptions extends ComponentInjectOptions = {},\n InjectKeys extends string = string,\n Slots extends SlotsType = {},\n LocalComponents extends Record<string, Component> = {},\n Directives extends Record<string, Directive> = {},\n Exposed extends string = string,\n Provide extends ComponentProvideOptions = ComponentProvideOptions,\n>(\n options: ComponentOptionsWithoutProps<\n PropsOptions,\n RawBindings,\n Data,\n Computed,\n Methods,\n Mixin,\n Extends,\n E,\n EE,\n InjectOptions,\n InjectKeys,\n Slots\n >,\n): DefineComponent<\n PropsOptions,\n RawBindings,\n Data,\n Computed,\n Methods,\n Mixin,\n Extends,\n E,\n EE\n>;\n\n\n// overload 2: defineComponent with options object, infer props from options\nfunction redefineComponent<\n // props\n PropsOptions extends Readonly<ComponentPropsOptions>,\n //\n RawBindings,\n // emits\n E extends EmitsOptions = {},\n EE extends string = string,\n // other options\n Data = {},\n SetupBindings = {},\n Computed extends ComputedOptions = {},\n Methods extends MethodOptions = {},\n Mixin extends ComponentOptionsMixin = ComponentOptionsMixin,\n Extends extends ComponentOptionsMixin = ComponentOptionsMixin,\n InjectOptions extends ComponentInjectOptions = {},\n InjectKeys extends string = string,\n Slots extends SlotsType = {},\n LocalComponents extends Record<string, Component> = {},\n Directives extends Record<string, Directive> = {},\n Exposed extends string = string,\n Provide extends ComponentProvideOptions = ComponentProvideOptions,\n>(\n options: ComponentOptionsWithObjectProps<\n PropsOptions,\n RawBindings,\n Data,\n Computed,\n Methods,\n Mixin,\n Extends,\n E,\n EE,\n InjectOptions,\n InjectKeys,\n Slots\n >,\n): DefineComponent<\n PropsOptions,\n RawBindings,\n Data,\n Computed,\n Methods,\n Mixin,\n Extends,\n E,\n EE\n>;\n\nfunction redefineComponent(options: ComponentOptions) {\n options._setup = options._setup ?? options.setup;\n\n if (options._setup) {\n options.setup = function (props, ctx) {\n const defaults = useDefaultsModule();\n // Skip props proxy if defaults are not provided\n if (!defaults.value) return options._setup(props, ctx);\n\n const { props: _props, provideSubDefaults } = useSuperDefaults(\n props,\n options.name,\n defaults,\n );\n\n const setupBindings = options._setup(_props, ctx);\n\n provideSubDefaults();\n\n return setupBindings;\n };\n }\n\n return options;\n}\n\nexport { redefineComponent as defineComponent };\n"],"mappings":"SAiBEA,iBAAiB,EACjBC,gBAAgB,gDAOlB;AAmDA;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,SAASD,iBAAiB,IAAIY,eAAe"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { getCurrentInstance } from 'vue';
|
|
2
|
+
import { defineComponent } from "./component.mjs";
|
|
3
|
+
export * from "./props.mjs";
|
|
4
|
+
export { defineComponent };
|
|
5
|
+
export function getSlot(vm) {
|
|
6
|
+
let name = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'default';
|
|
7
|
+
let data = arguments.length > 2 ? arguments[2] : undefined;
|
|
8
|
+
let optional = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
9
|
+
if (vm.$slots?.[name]) {
|
|
10
|
+
const slot = vm.$slots[name](data instanceof Function ? data() : data);
|
|
11
|
+
return slot.filter(node => {
|
|
12
|
+
return node.el?.nodeType !== 8;
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
return undefined;
|
|
16
|
+
}
|
|
17
|
+
export function getUid() {
|
|
18
|
+
const vm = getCurrentInstance();
|
|
19
|
+
return vm?.uid;
|
|
20
|
+
}
|
|
21
|
+
export function bindClasses(classes) {
|
|
22
|
+
const boundClasses = {};
|
|
23
|
+
if (typeof classes === 'string') {
|
|
24
|
+
boundClasses[classes] = true;
|
|
25
|
+
} else if (Array.isArray(classes)) {
|
|
26
|
+
classes.reduce((acc, clas) => {
|
|
27
|
+
acc[clas] = true;
|
|
28
|
+
return acc;
|
|
29
|
+
}, boundClasses);
|
|
30
|
+
} else if (typeof classes === 'object') {
|
|
31
|
+
Object.keys(classes).reduce((acc, clas) => {
|
|
32
|
+
acc[clas] = !!classes[clas];
|
|
33
|
+
return acc;
|
|
34
|
+
}, boundClasses);
|
|
35
|
+
}
|
|
36
|
+
return boundClasses;
|
|
37
|
+
}
|
|
38
|
+
export function getHtmlElement(node) {
|
|
39
|
+
if (node && '$el' in node) {
|
|
40
|
+
const el = node.$el;
|
|
41
|
+
if (el.nodeType === Node.TEXT_NODE) {
|
|
42
|
+
return el.nextElementSibling;
|
|
43
|
+
}
|
|
44
|
+
return el;
|
|
45
|
+
}
|
|
46
|
+
return node;
|
|
47
|
+
}
|
|
48
|
+
export function findChildrenWithProvide(key, vnode) {
|
|
49
|
+
if (!vnode || typeof vnode !== 'object') {
|
|
50
|
+
return [];
|
|
51
|
+
}
|
|
52
|
+
if (Array.isArray(vnode)) {
|
|
53
|
+
return vnode.map(child => findChildrenWithProvide(key, child)).flat(1);
|
|
54
|
+
} else if (Array.isArray(vnode.children)) {
|
|
55
|
+
return vnode.children.map(child => findChildrenWithProvide(key, child)).flat(1);
|
|
56
|
+
} else if (vnode.component) {
|
|
57
|
+
if (Object.getOwnPropertySymbols(vnode.component.provides).includes(key)) {
|
|
58
|
+
return [vnode.component];
|
|
59
|
+
} else if (vnode.component.subTree) {
|
|
60
|
+
return findChildrenWithProvide(key, vnode.component.subTree).flat(1);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return [];
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","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,QAAA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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"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { getCurrentInstance } from 'vue';
|
|
2
|
+
export function injectSelf(key) {
|
|
3
|
+
let vm = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : getCurrentInstance();
|
|
4
|
+
const provides = vm?.provides;
|
|
5
|
+
if (provides && key in provides) {
|
|
6
|
+
return provides[key];
|
|
7
|
+
}
|
|
8
|
+
return undefined;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=inject-self.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inject-self.mjs","names":["getCurrentInstance","injectSelf","key","vm","arguments","length","undefined","provides"],"sources":["../../../src/util/component/inject-self.ts"],"sourcesContent":["import {\n type ComponentInternalInstance,\n type InjectionKey,\n getCurrentInstance,\n} from 'vue';\n\nexport function injectSelf<T>(\n key: InjectionKey<T> | string,\n vm?: ComponentInternalInstance,\n): T | undefined;\nexport function injectSelf(\n key: InjectionKey<any> | string,\n vm = getCurrentInstance(),\n) {\n const provides = vm?.provides;\n\n if (provides && (key as string | symbol) in provides) {\n return provides[key as string];\n }\n\n return undefined;\n}\n"],"mappings":"AAAA,SAGEA,kBAAkB,QACb,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"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { capitalize } from 'vue';
|
|
2
|
+
import { toKebabCase } from "../string.mjs";
|
|
3
|
+
export function propsFactory(props, source) {
|
|
4
|
+
return defaults => {
|
|
5
|
+
return Object.keys(props).reduce((options, prop) => {
|
|
6
|
+
const option = props[prop];
|
|
7
|
+
const isObjectOption = typeof option === 'object' && option != null && !Array.isArray(option);
|
|
8
|
+
const objectOption = isObjectOption ? option : {
|
|
9
|
+
type: option
|
|
10
|
+
};
|
|
11
|
+
if (defaults && prop in defaults) {
|
|
12
|
+
options[prop] = {
|
|
13
|
+
...objectOption,
|
|
14
|
+
default: defaults[prop]
|
|
15
|
+
};
|
|
16
|
+
} else {
|
|
17
|
+
options[prop] = objectOption;
|
|
18
|
+
}
|
|
19
|
+
if (source && !options[prop].source) {
|
|
20
|
+
options[prop].source = source;
|
|
21
|
+
}
|
|
22
|
+
return options;
|
|
23
|
+
}, {});
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
export function chooseProps(props, target) {
|
|
27
|
+
return Object.keys(target).reduce((acc, prop) => {
|
|
28
|
+
if (props && prop in props) {
|
|
29
|
+
acc[prop] = props[prop];
|
|
30
|
+
}
|
|
31
|
+
return acc;
|
|
32
|
+
}, {});
|
|
33
|
+
}
|
|
34
|
+
export function hasEventProp(props, type) {
|
|
35
|
+
const onType = `on${capitalize(type)}`;
|
|
36
|
+
return !!(props[onType] || props[`${onType}Once`] || props[`${onType}Capture`] || props[`${onType}OnceCapture`] || props[`${onType}CaptureOnce`]);
|
|
37
|
+
}
|
|
38
|
+
export function propIsDefined(vnode, prop) {
|
|
39
|
+
return typeof vnode.props?.[prop] !== 'undefined' || typeof vnode.props?.[toKebabCase(prop)] !== 'undefined';
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=props.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"props.mjs","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 { capitalize } from 'vue';\nimport type { IfAny } from '@vue/shared';\nimport type {\n ComponentObjectPropsOptions,\n ExtractPropTypes,\n Prop,\n PropType,\n VNode,\n} from 'vue';\n\nimport { toKebabCase } from '../string';\n\nexport function propsFactory<PropsOptions extends ComponentObjectPropsOptions>(\n props: PropsOptions,\n source: string,\n) {\n return <Defaults extends PartialKeys<PropsOptions> = {}>(\n defaults?: Defaults,\n ): OverwrittenPropOptions<PropsOptions, Defaults> => {\n return Object.keys(props).reduce<any>((options, prop) => {\n const option = props[prop];\n const isObjectOption =\n typeof option === 'object' && option != null && !Array.isArray(option);\n const objectOption = isObjectOption ? option : { type: option };\n if (defaults && prop in defaults) {\n options[prop] = {\n ...objectOption,\n default: defaults[prop],\n };\n } else {\n options[prop] = objectOption;\n }\n\n if (source && !options[prop].source) {\n options[prop].source = source;\n }\n return options;\n }, {} as PropsOptions);\n };\n}\n\nexport function chooseProps<PropsOptions extends ComponentObjectPropsOptions>(\n props: any,\n target: PropsOptions,\n): ExtractPropTypes<PropsOptions> {\n return Object.keys(target).reduce((acc, prop) => {\n if (props && prop in props) {\n acc[prop as keyof ExtractPropTypes<PropsOptions>] = props[prop];\n }\n return acc;\n }, {} as ExtractPropTypes<PropsOptions>);\n}\n\nexport function hasEventProp(props: Record<string, any>, type: string) {\n const onType = `on${capitalize(type)}`;\n return !!(\n props[onType] ||\n props[`${onType}Once`] ||\n props[`${onType}Capture`] ||\n props[`${onType}OnceCapture`] ||\n props[`${onType}CaptureOnce`]\n );\n}\n\nexport function propIsDefined(vnode: VNode, prop: string) {\n return (\n typeof vnode.props?.[prop] !== 'undefined' ||\n typeof vnode.props?.[toKebabCase(prop)] !== 'undefined'\n );\n}\n\ntype OverwrittenPropOptions<\n T extends ComponentObjectPropsOptions,\n D extends PartialKeys<T>,\n> = {\n [P in keyof T]-?: unknown extends D[P]\n ? T[P]\n : T[P] extends Record<string, unknown>\n ? Omit<T[P], 'type' | 'default'> & {\n type: PropType<MergeDefault<T[P], D[P]>>;\n default: MergeDefault<T[P], D[P]>;\n }\n : {\n type: PropType<MergeDefault<T[P], D[P]>>;\n default: MergeDefault<T[P], D[P]>;\n };\n};\n\ntype MergeDefault<T, D> = unknown extends D\n ? InferPropType<T>\n : NonNullable<InferPropType<T>> | D;\n\ntype FollowPropType<T, P, D> = [T] extends [PropType<unknown>]\n ? T\n : PropType<MergeDefault<P, D>>;\n\ntype PartialKeys<T> = { [P in keyof T]?: unknown };\n\ntype InferPropType<T> = [T] extends [null]\n ? any // null & true would fail to infer\n : [T] extends [{ type: null | true }]\n ? // As TS issue https://github.com/Microsoft/TypeScript/issues/14829\n // somehow `ObjectConstructor` when inferred from { (): T } becomes `any`\n // `BooleanConstructor` when inferred from PropConstructor(with PropMethod) becomes `Boolean`\n any\n : [T] extends [ObjectConstructor | { type: ObjectConstructor }]\n ? Record<string, any>\n : [T] extends [BooleanConstructor | { type: BooleanConstructor }]\n ? boolean\n : [T] extends [DateConstructor | { type: DateConstructor }]\n ? Date\n : [T] extends [(infer U)[] | { type: (infer U)[] }]\n ? U extends DateConstructor\n ? Date | InferPropType<U>\n : InferPropType<U>\n : [T] extends [Prop<infer V, infer D>]\n ? unknown extends V\n ? IfAny<V, V, D>\n : V\n : T;\n"],"mappings":"AAAA,SAASA,UAAU,QAAQ,KAAK;AAAC,SAUxBC,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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CAAE,GAAEmB,MAAO,SAAQ,CAAC,IACzBnB,KAAK,CAAE,GAAEmB,MAAO,aAAY,CAAC,IAC7BnB,KAAK,CAAE,GAAEmB,MAAO,aAAY,CAAC,CAC9B;AACH;AAEA,OAAO,SAASC,aAAaA,CAACC,KAAY,EAAEd,IAAY,EAAE;EACxD,OACE,OAAOc,KAAK,CAACrB,KAAK,GAAGO,IAAI,CAAC,KAAK,WAAW,IAC1C,OAAOc,KAAK,CAACrB,KAAK,GAAGF,WAAW,CAACS,IAAI,CAAC,CAAC,KAAK,WAAW;AAE3D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.mjs","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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["YuyeonDateAdapter","createDateAdapter"],"sources":["../../../src/util/date/index.ts"],"sourcesContent":["export * from './built-in';\
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["YuyeonDateAdapter","createDateAdapter"],"sources":["../../../src/util/date/index.ts"],"sourcesContent":["export * from './built-in';\nexport { YuyeonDateAdapter } from './adapters/yuyeon-date-adapter';\n\nexport function createDateAdapter() {}\n"],"mappings":";SACSA,iBAAiB;AAE1B,OAAO,SAASC,iBAAiBA,CAAA,EAAG,CAAC"}
|
package/lib/util/dom.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dom.mjs","names":["documentRoot","domNode","root","getRootNode","document","composed","hasElementMouseEvent","mouseEvent","element","include","ShadowRoot","host","target","elements","push","some","el","contains","isOverflow","offsetWidth","scrollWidth"],"sources":["../../src/util/dom.ts"],"sourcesContent":["export function documentRoot(domNode: Node): null | HTMLDocument | ShadowRoot {\
|
|
1
|
+
{"version":3,"file":"dom.mjs","names":["documentRoot","domNode","root","getRootNode","document","composed","hasElementMouseEvent","mouseEvent","element","include","ShadowRoot","host","target","elements","push","some","el","contains","isOverflow","offsetWidth","scrollWidth"],"sources":["../../src/util/dom.ts"],"sourcesContent":["export function documentRoot(domNode: Node): null | HTMLDocument | ShadowRoot {\n const root = domNode.getRootNode();\n if (root !== document && root.getRootNode({ composed: true }) !== document)\n return null;\n return root as HTMLDocument | ShadowRoot;\n}\n\nexport function hasElementMouseEvent(\n mouseEvent: Event,\n element: HTMLElement,\n include?: HTMLElement[],\n): boolean {\n if (!mouseEvent) {\n return false;\n }\n const root = documentRoot(element);\n if (\n typeof ShadowRoot !== 'undefined' &&\n root instanceof ShadowRoot &&\n root.host === mouseEvent.target\n ) {\n return false;\n }\n const elements = include ?? [];\n elements.push(element);\n return !elements.some((el) => el?.contains(mouseEvent.target as Node));\n}\n\nexport function isOverflow(el: HTMLElement) {\n return el.offsetWidth < el.scrollWidth;\n}\n"],"mappings":"AAAA,OAAO,SAASA,YAAYA,CAACC,OAAa,EAAoC;EAC5E,MAAMC,IAAI,GAAGD,OAAO,CAACE,WAAW,CAAC,CAAC;EAClC,IAAID,IAAI,KAAKE,QAAQ,IAAIF,IAAI,CAACC,WAAW,CAAC;IAAEE,QAAQ,EAAE;EAAK,CAAC,CAAC,KAAKD,QAAQ,EACxE,OAAO,IAAI;EACb,OAAOF,IAAI;AACb;AAEA,OAAO,SAASI,oBAAoBA,CAClCC,UAAiB,EACjBC,OAAoB,EACpBC,OAAuB,EACd;EACT,IAAI,CAACF,UAAU,EAAE;IACf,OAAO,KAAK;EACd;EACA,MAAML,IAAI,GAAGF,YAAY,CAACQ,OAAO,CAAC;EAClC,IACE,OAAOE,UAAU,KAAK,WAAW,IACjCR,IAAI,YAAYQ,UAAU,IAC1BR,IAAI,CAACS,IAAI,KAAKJ,UAAU,CAACK,MAAM,EAC/B;IACA,OAAO,KAAK;EACd;EACA,MAAMC,QAAQ,GAAGJ,OAAO,IAAI,EAAE;EAC9BI,QAAQ,CAACC,IAAI,CAACN,OAAO,CAAC;EACtB,OAAO,CAACK,QAAQ,CAACE,IAAI,CAAEC,EAAE,IAAKA,EAAE,EAAEC,QAAQ,CAACV,UAAU,CAACK,MAAc,CAAC,CAAC;AACxE;AAEA,OAAO,SAASM,UAAUA,CAACF,EAAe,EAAE;EAC1C,OAAOA,EAAE,CAACG,WAAW,GAAGH,EAAE,CAACI,WAAW;AACxC"}
|
package/lib/util/index.mjs
CHANGED
|
@@ -10,7 +10,7 @@ export * from "./rect.mjs";
|
|
|
10
10
|
export * from "./anchor.mjs";
|
|
11
11
|
export * from "./scroll.mjs";
|
|
12
12
|
export * from "./frame-scheduler.mjs";
|
|
13
|
-
export * from "./
|
|
13
|
+
export * from "./component/index.mjs";
|
|
14
14
|
export * from "./reactivity.mjs";
|
|
15
15
|
export * from "./color/index.mjs";
|
|
16
16
|
export * from "./date/index.mjs";
|
package/lib/util/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../../src/util/index.ts"],"sourcesContent":["export * from './common';\r\nexport * from './collection';\r\nexport * from './array';\r\nexport * from './string';\r\nexport * from './validation';\r\nexport * from './debounce';\r\nexport * from './dom';\r\nexport * from './ui';\r\nexport * from './rect';\r\nexport * from './anchor';\r\nexport * from './scroll';\r\nexport * from './frame-scheduler';\r\nexport * from './
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../src/util/index.ts"],"sourcesContent":["export * from './common';\r\nexport * from './collection';\r\nexport * from './array';\r\nexport * from './string';\r\nexport * from './validation';\r\nexport * from './debounce';\r\nexport * from './dom';\r\nexport * from './ui';\r\nexport * from './rect';\r\nexport * from './anchor';\r\nexport * from './scroll';\r\nexport * from './frame-scheduler';\r\nexport * from './component';\r\nexport * from './reactivity';\r\nexport * from './color';\r\nexport * from './date';\r\n"],"mappings":""}
|
package/lib/util/reactivity.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reactivity.mjs","names":["computed","reactive","toRefs","watchEffect","$computed","getter","refs","base","key","value","flush"],"sources":["../../src/util/reactivity.ts"],"sourcesContent":["import type
|
|
1
|
+
{"version":3,"file":"reactivity.mjs","names":["computed","reactive","toRefs","watchEffect","$computed","getter","refs","base","key","value","flush"],"sources":["../../src/util/reactivity.ts"],"sourcesContent":["import {\n type ComputedGetter,\n computed,\n reactive,\n toRefs,\n watchEffect,\n} from 'vue';\n\n/**\n * For Destructuring assignment\n * @param getter\n */\nexport function $computed<T extends object>(getter: ComputedGetter<T>) {\n const refs = reactive({}) as T;\n const base = computed(getter);\n watchEffect(\n () => {\n for (const key in base.value) {\n refs[key] = base.value[key];\n }\n },\n { flush: 'sync' },\n );\n return toRefs(refs);\n}\n"],"mappings":"AAAA,SAEEA,QAAQ,EACRC,QAAQ,EACRC,MAAM,EACNC,WAAW,QACN,KAAK;;AAEZ;AACA;AACA;AACA;AACA,OAAO,SAASC,SAASA,CAAmBC,MAAyB,EAAE;EACrE,MAAMC,IAAI,GAAGL,QAAQ,CAAC,CAAC,CAAC,CAAM;EAC9B,MAAMM,IAAI,GAAGP,QAAQ,CAACK,MAAM,CAAC;EAC7BF,WAAW,CACT,MAAM;IACJ,KAAK,MAAMK,GAAG,IAAID,IAAI,CAACE,KAAK,EAAE;MAC5BH,IAAI,CAACE,GAAG,CAAC,GAAGD,IAAI,CAACE,KAAK,CAACD,GAAG,CAAC;IAC7B;EACF,CAAC,EACD;IAAEE,KAAK,EAAE;EAAO,CAClB,CAAC;EACD,OAAOR,MAAM,CAACI,IAAI,CAAC;AACrB"}
|
package/lib/util/rect.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rect.mjs","names":["MutableRect","constructor","_ref","x","y","width","height","top","bottom","left","right","getOverflow","a","b","before","Math","max","after"],"sources":["../../src/util/rect.ts"],"sourcesContent":["export interface Rect {\
|
|
1
|
+
{"version":3,"file":"rect.mjs","names":["MutableRect","constructor","_ref","x","y","width","height","top","bottom","left","right","getOverflow","a","b","before","Math","max","after"],"sources":["../../src/util/rect.ts"],"sourcesContent":["export interface Rect {\n x: number;\n y: number;\n width: number;\n height: number;\n\n get top(): number;\n get bottom(): number;\n get left(): number;\n get right(): number;\n}\n\nexport class MutableRect implements Rect {\n public x: number;\n\n public y: number;\n\n public width: number;\n\n public height: number;\n\n constructor({\n x,\n y,\n width,\n height,\n }: {\n x: number;\n y: number;\n width: number;\n height: number;\n }) {\n this.x = x ?? 0;\n this.y = y ?? 0;\n this.width = width ?? 0;\n this.height = height ?? 0;\n }\n\n public get top(): number {\n return this.y;\n }\n\n public get bottom(): number {\n return this.y + this.height;\n }\n\n public get left(): number {\n return this.x;\n }\n\n public get right(): number {\n return this.x + this.width;\n }\n}\n\nexport function getOverflow(a: MutableRect, b: MutableRect) {\n return {\n x: {\n before: Math.max(0, b.left - a.left),\n after: Math.max(0, a.right - b.right),\n },\n y: {\n before: Math.max(0, b.top - a.top),\n after: Math.max(0, a.bottom - b.bottom),\n },\n };\n}\n"],"mappings":"AAYA,OAAO,MAAMA,WAAW,CAAiB;EASvCC,WAAWA,CAAAC,IAAA,EAUR;IAAA,IAVS;MACVC,CAAC;MACDC,CAAC;MACDC,KAAK;MACLC;IAMF,CAAC,GAAAJ,IAAA;IACC,IAAI,CAACC,CAAC,GAAGA,CAAC,IAAI,CAAC;IACf,IAAI,CAACC,CAAC,GAAGA,CAAC,IAAI,CAAC;IACf,IAAI,CAACC,KAAK,GAAGA,KAAK,IAAI,CAAC;IACvB,IAAI,CAACC,MAAM,GAAGA,MAAM,IAAI,CAAC;EAC3B;EAEA,IAAWC,GAAGA,CAAA,EAAW;IACvB,OAAO,IAAI,CAACH,CAAC;EACf;EAEA,IAAWI,MAAMA,CAAA,EAAW;IAC1B,OAAO,IAAI,CAACJ,CAAC,GAAG,IA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