yuyeon 0.3.1-rc.6 → 0.3.2-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/yuyeon.js +459 -458
- package/dist/yuyeon.umd.cjs +2 -2
- package/lib/abstract/items.js +20 -0
- package/lib/abstract/items.js.map +1 -0
- package/lib/components/alert/YAlert.js +83 -0
- package/lib/components/alert/YAlert.js.map +1 -0
- package/lib/components/alert/index.js +2 -0
- package/lib/components/alert/index.js.map +1 -0
- package/lib/components/app/YApp.js +21 -0
- package/lib/components/app/YApp.js.map +1 -0
- package/lib/components/app/index.js +2 -0
- package/lib/components/app/index.js.map +1 -0
- package/lib/components/badge/YBadge.js +83 -0
- package/lib/components/badge/YBadge.js.map +1 -0
- package/lib/components/badge/index.js +2 -0
- package/lib/components/badge/index.js.map +1 -0
- package/lib/components/bench/YBench.js +43 -0
- package/lib/components/bench/YBench.js.map +1 -0
- package/lib/components/bench/index.js +2 -0
- package/lib/components/bench/index.js.map +1 -0
- package/lib/components/button/YButton.js +169 -0
- package/lib/components/button/YButton.js.map +1 -0
- package/lib/components/button/index.js +2 -0
- package/lib/components/button/index.js.map +1 -0
- package/lib/components/card/YCard.js +28 -0
- package/lib/components/card/YCard.js.map +1 -0
- package/lib/components/card/YCardBody.js +11 -0
- package/lib/components/card/YCardBody.js.map +1 -0
- package/lib/components/card/YCardFooter.js +11 -0
- package/lib/components/card/YCardFooter.js.map +1 -0
- package/lib/components/card/YCardHeader.js +11 -0
- package/lib/components/card/YCardHeader.js.map +1 -0
- package/lib/components/card/index.js +5 -0
- package/lib/components/card/index.js.map +1 -0
- package/lib/components/checkbox/YCheckbox.js +160 -0
- package/lib/components/checkbox/YCheckbox.js.map +1 -0
- package/lib/components/checkbox/YInputCheckbox.js +114 -0
- package/lib/components/checkbox/YInputCheckbox.js.map +1 -0
- package/lib/components/checkbox/index.js +4 -0
- package/lib/components/checkbox/index.js.map +1 -0
- package/lib/components/chip/YChip.js +39 -0
- package/lib/components/chip/YChip.js.map +1 -0
- package/lib/components/chip/index.js +2 -0
- package/lib/components/chip/index.js.map +1 -0
- package/lib/components/date-picker/YDateCalendar.js +243 -0
- package/lib/components/date-picker/YDateCalendar.js.map +1 -0
- package/lib/components/date-picker/YDatePicker.js +132 -0
- package/lib/components/date-picker/YDatePicker.js.map +1 -0
- package/lib/components/date-picker/YDatePickerControl.js +107 -0
- package/lib/components/date-picker/YDatePickerControl.js.map +1 -0
- package/lib/components/date-picker/YMonthPicker.js +64 -0
- package/lib/components/date-picker/YMonthPicker.js.map +1 -0
- package/lib/components/date-picker/YYearPicker.js +87 -0
- package/lib/components/date-picker/YYearPicker.js.map +1 -0
- package/lib/components/date-picker/index.js +4 -0
- package/lib/components/date-picker/index.js.map +1 -0
- package/lib/components/default-provider/YDefaultProvider.js +2 -0
- package/lib/components/default-provider/YDefaultProvider.js.map +1 -0
- package/lib/components/default-provider/index.js +2 -0
- package/lib/components/default-provider/index.js.map +1 -0
- package/lib/components/dialog/YDialog.js +213 -0
- package/lib/components/dialog/YDialog.js.map +1 -0
- package/lib/components/dialog/index.js +2 -0
- package/lib/components/dialog/index.js.map +1 -0
- package/lib/components/divider/YDivider.js +20 -0
- package/lib/components/divider/YDivider.js.map +1 -0
- package/lib/components/divider/index.js +2 -0
- package/lib/components/divider/index.js.map +1 -0
- package/lib/components/draggable/YDraggable.js +95 -0
- package/lib/components/draggable/YDraggable.js.map +1 -0
- package/lib/components/dropdown/YDropdown.js +109 -0
- package/lib/components/dropdown/YDropdown.js.map +1 -0
- package/lib/components/dropdown/index.js +2 -0
- package/lib/components/dropdown/index.js.map +1 -0
- package/lib/components/field-input/YFieldInput.js +229 -0
- package/lib/components/field-input/YFieldInput.js.map +1 -0
- package/lib/components/field-input/index.js +2 -0
- package/lib/components/field-input/index.js.map +1 -0
- package/lib/components/form/YForm.js +65 -0
- package/lib/components/form/YForm.js.map +1 -0
- package/lib/components/form/index.js +2 -0
- package/lib/components/form/index.js.map +1 -0
- package/lib/components/hover/YHover.js +54 -0
- package/lib/components/hover/YHover.js.map +1 -0
- package/lib/components/hover/index.js +2 -0
- package/lib/components/hover/index.js.map +1 -0
- package/lib/components/icon/YIcon.js +63 -0
- package/lib/components/icon/YIcon.js.map +1 -0
- package/lib/components/icon/index.js +2 -0
- package/lib/components/icon/index.js.map +1 -0
- package/lib/components/icons/YIconCheckbox.js +32 -0
- package/lib/components/icons/YIconCheckbox.js.map +1 -0
- package/lib/components/icons/YIconClear.js +16 -0
- package/lib/components/icons/YIconClear.js.map +1 -0
- package/lib/components/icons/YIconDropdown.js +16 -0
- package/lib/components/icons/YIconDropdown.js.map +1 -0
- package/lib/components/icons/YIconExpand.js +20 -0
- package/lib/components/icons/YIconExpand.js.map +1 -0
- package/lib/components/icons/YIconPageControl.js +32 -0
- package/lib/components/icons/YIconPageControl.js.map +1 -0
- package/lib/components/icons/YIconSort.js +45 -0
- package/lib/components/icons/YIconSort.js.map +1 -0
- package/lib/components/icons/index.js +32 -0
- package/lib/components/icons/index.js.map +1 -0
- package/lib/components/img/YImg.js +173 -0
- package/lib/components/img/YImg.js.map +1 -0
- package/lib/components/img/index.js +2 -0
- package/lib/components/img/index.js.map +1 -0
- package/lib/components/index.js +39 -0
- package/lib/components/index.js.map +1 -0
- package/lib/components/input/YInput.js +258 -0
- package/lib/components/input/YInput.js.map +1 -0
- package/lib/components/input/index.js +2 -0
- package/lib/components/input/index.js.map +1 -0
- package/lib/components/ip-field/YIpv4Field.js +297 -0
- package/lib/components/ip-field/YIpv4Field.js.map +1 -0
- package/lib/components/ip-field/index.js +2 -0
- package/lib/components/ip-field/index.js.map +1 -0
- package/lib/components/layer/YLayer.js +326 -0
- package/lib/components/layer/YLayer.js.map +1 -0
- package/lib/components/layer/active-delay.js +28 -0
- package/lib/components/layer/active-delay.js.map +1 -0
- package/lib/components/layer/active-stack.js +52 -0
- package/lib/components/layer/active-stack.js.map +1 -0
- package/lib/components/layer/base.js +87 -0
- package/lib/components/layer/base.js.map +1 -0
- package/lib/components/layer/content.js +22 -0
- package/lib/components/layer/content.js.map +1 -0
- package/lib/components/layer/index.js +2 -0
- package/lib/components/layer/index.js.map +1 -0
- package/lib/components/layer/scroll-strategies.js +132 -0
- package/lib/components/layer/scroll-strategies.js.map +1 -0
- package/lib/components/list/YList.js +55 -0
- package/lib/components/list/YList.js.map +1 -0
- package/lib/components/list/YListItem.js +59 -0
- package/lib/components/list/YListItem.js.map +1 -0
- package/lib/components/list/index.js +3 -0
- package/lib/components/list/index.js.map +1 -0
- package/lib/components/loading/YSpinnerRing.js +25 -0
- package/lib/components/loading/YSpinnerRing.js.map +1 -0
- package/lib/components/loading/index.js +2 -0
- package/lib/components/loading/index.js.map +1 -0
- package/lib/components/menu/YMenu.js +211 -0
- package/lib/components/menu/YMenu.js.map +1 -0
- package/lib/components/menu/index.js +2 -0
- package/lib/components/menu/index.js.map +1 -0
- package/lib/components/navigation/YNavigation.js +18 -0
- package/lib/components/navigation/YNavigation.js.map +1 -0
- package/lib/components/navigation/index.js +2 -0
- package/lib/components/navigation/index.js.map +1 -0
- package/lib/components/pagination/YPagination.js +288 -0
- package/lib/components/pagination/YPagination.js.map +1 -0
- package/lib/components/pagination/index.js +2 -0
- package/lib/components/pagination/index.js.map +1 -0
- package/lib/components/panel/YDividePanel.js +90 -0
- package/lib/components/panel/YDividePanel.js.map +1 -0
- package/lib/components/panel/index.js +2 -0
- package/lib/components/panel/index.js.map +1 -0
- package/lib/components/plate/YPlate.js +28 -0
- package/lib/components/plate/YPlate.js.map +1 -0
- package/lib/components/plate/index.js +2 -0
- package/lib/components/plate/index.js.map +1 -0
- package/lib/components/progress-bar/YProgressBar.js +117 -0
- package/lib/components/progress-bar/YProgressBar.js.map +1 -0
- package/lib/components/progress-bar/index.js +2 -0
- package/lib/components/progress-bar/index.js.map +1 -0
- package/lib/components/progress-ring/YProgressRing.js +128 -0
- package/lib/components/progress-ring/YProgressRing.js.map +1 -0
- package/lib/components/progress-ring/index.js +2 -0
- package/lib/components/progress-ring/index.js.map +1 -0
- package/lib/components/select/YSelect.js +344 -0
- package/lib/components/select/YSelect.js.map +1 -0
- package/lib/components/select/index.js +2 -0
- package/lib/components/select/index.js.map +1 -0
- package/lib/components/slider/YSlider.js +26 -0
- package/lib/components/slider/YSlider.js.map +1 -0
- package/lib/components/slider/index.js +2 -0
- package/lib/components/slider/index.js.map +1 -0
- package/lib/components/snackbar/YSnackbar.js +209 -0
- package/lib/components/snackbar/YSnackbar.js.map +1 -0
- package/lib/components/snackbar/index.js +2 -0
- package/lib/components/snackbar/index.js.map +1 -0
- package/lib/components/switch/YSwitch.js +184 -0
- package/lib/components/switch/YSwitch.js.map +1 -0
- package/lib/components/switch/index.js +2 -0
- package/lib/components/switch/index.js.map +1 -0
- package/lib/components/tab/YTab.js +64 -0
- package/lib/components/tab/YTab.js.map +1 -0
- package/lib/components/tab/YTabs.js +86 -0
- package/lib/components/tab/YTabs.js.map +1 -0
- package/lib/components/tab/index.js +4 -0
- package/lib/components/tab/index.js.map +1 -0
- package/lib/components/tab/shared.js +2 -0
- package/lib/components/tab/shared.js.map +1 -0
- package/lib/components/tab/types.js +2 -0
- package/lib/components/tab/types.js.map +1 -0
- package/lib/components/table/YDataTable.js +182 -0
- package/lib/components/table/YDataTable.js.map +1 -0
- package/lib/components/table/YDataTableBody.js +131 -0
- package/lib/components/table/YDataTableBody.js.map +1 -0
- package/lib/components/table/YDataTableCell.js +78 -0
- package/lib/components/table/YDataTableCell.js.map +1 -0
- package/lib/components/table/YDataTableControl.js +46 -0
- package/lib/components/table/YDataTableControl.js.map +1 -0
- package/lib/components/table/YDataTableHead.js +172 -0
- package/lib/components/table/YDataTableHead.js.map +1 -0
- package/lib/components/table/YDataTableLayer.js +29 -0
- package/lib/components/table/YDataTableLayer.js.map +1 -0
- package/lib/components/table/YDataTableRow.js +150 -0
- package/lib/components/table/YDataTableRow.js.map +1 -0
- package/lib/components/table/YDataTableServer.js +173 -0
- package/lib/components/table/YDataTableServer.js.map +1 -0
- package/lib/components/table/YTable.js +77 -0
- package/lib/components/table/YTable.js.map +1 -0
- package/lib/components/table/composibles/header.js +127 -0
- package/lib/components/table/composibles/header.js.map +1 -0
- package/lib/components/table/composibles/items.js +52 -0
- package/lib/components/table/composibles/items.js.map +1 -0
- package/lib/components/table/composibles/measure.js +39 -0
- package/lib/components/table/composibles/measure.js.map +1 -0
- package/lib/components/table/composibles/options.js +33 -0
- package/lib/components/table/composibles/options.js.map +1 -0
- package/lib/components/table/composibles/pagination.js +99 -0
- package/lib/components/table/composibles/pagination.js.map +1 -0
- package/lib/components/table/composibles/selection.js +196 -0
- package/lib/components/table/composibles/selection.js.map +1 -0
- package/lib/components/table/composibles/sorted-items.js +50 -0
- package/lib/components/table/composibles/sorted-items.js.map +1 -0
- package/lib/components/table/composibles/sorting.js +73 -0
- package/lib/components/table/composibles/sorting.js.map +1 -0
- package/lib/components/table/index.js +9 -0
- package/lib/components/table/index.js.map +1 -0
- package/lib/components/table/types/common.js +2 -0
- package/lib/components/table/types/common.js.map +1 -0
- package/lib/components/table/types/header.js +2 -0
- package/lib/components/table/types/header.js.map +1 -0
- package/lib/components/table/types/index.js +2 -0
- package/lib/components/table/types/index.js.map +1 -0
- package/lib/components/table/types/item.js +2 -0
- package/lib/components/table/types/item.js.map +1 -0
- package/lib/components/table/types/row.js +2 -0
- package/lib/components/table/types/row.js.map +1 -0
- package/lib/components/text-ellipsis/YTextEllipsis.js +66 -0
- package/lib/components/text-ellipsis/YTextEllipsis.js.map +1 -0
- package/lib/components/text-ellipsis/index.js +2 -0
- package/lib/components/text-ellipsis/index.js.map +1 -0
- package/lib/components/text-highlighter/YTextHighlighter.js +95 -0
- package/lib/components/text-highlighter/YTextHighlighter.js.map +1 -0
- package/lib/components/text-highlighter/index.js +2 -0
- package/lib/components/text-highlighter/index.js.map +1 -0
- package/lib/components/text-interpolation/YTi.js +47 -0
- package/lib/components/text-interpolation/YTi.js.map +1 -0
- package/lib/components/text-interpolation/index.js +2 -0
- package/lib/components/text-interpolation/index.js.map +1 -0
- package/lib/components/textarea/YTextarea.js +157 -0
- package/lib/components/textarea/YTextarea.js.map +1 -0
- package/lib/components/textarea/index.js +2 -0
- package/lib/components/textarea/index.js.map +1 -0
- package/lib/components/toggle-button/YToggleButton.js +2 -0
- package/lib/components/toggle-button/YToggleButton.js.map +1 -0
- package/lib/components/toggle-button/index.js +2 -0
- package/lib/components/toggle-button/index.js.map +1 -0
- package/lib/components/tooltip/YTooltip.js +157 -0
- package/lib/components/tooltip/YTooltip.js.map +1 -0
- package/lib/components/tooltip/index.js +2 -0
- package/lib/components/tooltip/index.js.map +1 -0
- package/lib/components/transitions/expand-transition.js +109 -0
- package/lib/components/transitions/expand-transition.js.map +1 -0
- package/lib/components/transitions/index.js +4 -0
- package/lib/components/transitions/index.js.map +1 -0
- package/lib/components/tree-view/YTreeView.js +290 -0
- package/lib/components/tree-view/YTreeView.js.map +1 -0
- package/lib/components/tree-view/YTreeViewNode.js +250 -0
- package/lib/components/tree-view/YTreeViewNode.js.map +1 -0
- package/lib/components/tree-view/index.js +3 -0
- package/lib/components/tree-view/index.js.map +1 -0
- package/lib/components/tree-view/tree-view.js +179 -0
- package/lib/components/tree-view/tree-view.js.map +1 -0
- package/lib/components/tree-view/types.js +2 -0
- package/lib/components/tree-view/types.js.map +1 -0
- package/lib/components/tree-view/util.js +40 -0
- package/lib/components/tree-view/util.js.map +1 -0
- package/lib/composables/choice-link.js +13 -0
- package/lib/composables/choice-link.js.map +1 -0
- package/lib/composables/choice.js +187 -0
- package/lib/composables/choice.js.map +1 -0
- package/lib/composables/communication.js +55 -0
- package/lib/composables/communication.js.map +1 -0
- package/lib/composables/component.js +8 -0
- package/lib/composables/component.js.map +1 -0
- package/lib/composables/coordinate/arrangement.js +14 -0
- package/lib/composables/coordinate/arrangement.js.map +1 -0
- package/lib/composables/coordinate/index.js +67 -0
- package/lib/composables/coordinate/index.js.map +1 -0
- package/lib/composables/coordinate/levitation.js +315 -0
- package/lib/composables/coordinate/levitation.js.map +1 -0
- package/lib/composables/coordinate/types.js +2 -0
- package/lib/composables/coordinate/types.js.map +1 -0
- package/lib/composables/coordinate/utils/point.js +55 -0
- package/lib/composables/coordinate/utils/point.js.map +1 -0
- package/lib/composables/date/factory.js +12 -0
- package/lib/composables/date/factory.js.map +1 -0
- package/lib/composables/date/index.js +20 -0
- package/lib/composables/date/index.js.map +1 -0
- package/lib/composables/date/setting.js +11 -0
- package/lib/composables/date/setting.js.map +1 -0
- package/lib/composables/date/types.js +2 -0
- package/lib/composables/date/types.js.map +1 -0
- package/lib/composables/defaults/index.js +99 -0
- package/lib/composables/defaults/index.js.map +1 -0
- package/lib/composables/defaults/share.js +2 -0
- package/lib/composables/defaults/share.js.map +1 -0
- package/lib/composables/defaults/types.js +2 -0
- package/lib/composables/defaults/types.js.map +1 -0
- package/lib/composables/dimension.js +26 -0
- package/lib/composables/dimension.js.map +1 -0
- package/lib/composables/focus.js +29 -0
- package/lib/composables/focus.js.map +1 -0
- package/lib/composables/form.js +100 -0
- package/lib/composables/form.js.map +1 -0
- package/lib/composables/i18n/index.js +30 -0
- package/lib/composables/i18n/index.js.map +1 -0
- package/lib/composables/i18n/locale.js +5 -0
- package/lib/composables/i18n/locale.js.map +1 -0
- package/lib/composables/i18n/rtl.js +34 -0
- package/lib/composables/i18n/rtl.js.map +1 -0
- package/lib/composables/i18n/share.js +2 -0
- package/lib/composables/i18n/share.js.map +1 -0
- package/lib/composables/icon.js +164 -0
- package/lib/composables/icon.js.map +1 -0
- package/lib/composables/index.js +11 -0
- package/lib/composables/index.js.map +1 -0
- package/lib/composables/layer-group.js +66 -0
- package/lib/composables/layer-group.js.map +1 -0
- package/lib/composables/layout.js +13 -0
- package/lib/composables/layout.js.map +1 -0
- package/lib/composables/list-items.js +66 -0
- package/lib/composables/list-items.js.map +1 -0
- package/lib/composables/progress.js +26 -0
- package/lib/composables/progress.js.map +1 -0
- package/lib/composables/ref.js +13 -0
- package/lib/composables/ref.js.map +1 -0
- package/lib/composables/resize-observer.js +33 -0
- package/lib/composables/resize-observer.js.map +1 -0
- package/lib/composables/scope.js +26 -0
- package/lib/composables/scope.js.map +1 -0
- package/lib/composables/style-color.js +37 -0
- package/lib/composables/style-color.js.map +1 -0
- package/lib/composables/theme/factory.js +47 -0
- package/lib/composables/theme/factory.js.map +1 -0
- package/lib/composables/theme/helper.js +14 -0
- package/lib/composables/theme/helper.js.map +1 -0
- package/lib/composables/theme/index.js +187 -0
- package/lib/composables/theme/index.js.map +1 -0
- package/lib/composables/theme/setting.js +113 -0
- package/lib/composables/theme/setting.js.map +1 -0
- package/lib/composables/theme/types.js +2 -0
- package/lib/composables/theme/types.js.map +1 -0
- package/lib/composables/timing.js +102 -0
- package/lib/composables/timing.js.map +1 -0
- package/lib/composables/transition.js +51 -0
- package/lib/composables/transition.js.map +1 -0
- package/lib/composables/validation.js +126 -0
- package/lib/composables/validation.js.map +1 -0
- package/lib/composables/vue-router.js +32 -0
- package/lib/composables/vue-router.js.map +1 -0
- package/lib/directives/complement-click/index.js +78 -0
- package/lib/directives/complement-click/index.js.map +1 -0
- package/lib/directives/plate-wave/index.js +100 -0
- package/lib/directives/plate-wave/index.js.map +1 -0
- package/lib/directives/theme-class.js +24 -0
- package/lib/directives/theme-class.js.map +1 -0
- package/lib/etc/index.js +6 -0
- package/lib/etc/index.js.map +1 -0
- package/lib/i18n/built-in.js +77 -0
- package/lib/i18n/built-in.js.map +1 -0
- package/lib/i18n/config.js +82 -0
- package/lib/i18n/config.js.map +1 -0
- package/lib/i18n/types.js +2 -0
- package/lib/i18n/types.js.map +1 -0
- package/lib/index.js +103 -0
- package/lib/index.js.map +1 -0
- package/lib/locales/en.js +6 -0
- package/lib/locales/en.js.map +1 -0
- package/lib/locales/index.js +3 -0
- package/lib/locales/index.js.map +1 -0
- package/lib/locales/ko.js +6 -0
- package/lib/locales/ko.js.map +1 -0
- package/lib/mixins/di.js +19 -0
- package/lib/mixins/di.js.map +1 -0
- package/lib/mixins/rebind-attrs.js +37 -0
- package/lib/mixins/rebind-attrs.js.map +1 -0
- package/lib/types/index.js +2 -0
- package/lib/types/index.js.map +1 -0
- package/lib/util/anchor.js +53 -0
- package/lib/util/anchor.js.map +1 -0
- package/lib/util/array.js +13 -0
- package/lib/util/array.js.map +1 -0
- package/lib/util/collection.js +10 -0
- package/lib/util/collection.js.map +1 -0
- package/lib/util/color/apca.js +201 -0
- package/lib/util/color/apca.js.map +1 -0
- package/lib/util/color/const.js +6 -0
- package/lib/util/color/const.js.map +1 -0
- package/lib/util/color/contrast/contrast.js +149 -0
- package/lib/util/color/contrast/contrast.js.map +1 -0
- package/lib/util/color/conversion.js +310 -0
- package/lib/util/color/conversion.js.map +1 -0
- package/lib/util/color/hct/cam16.js +349 -0
- package/lib/util/color/hct/cam16.js.map +1 -0
- package/lib/util/color/hct/hct-solver.js +389 -0
- package/lib/util/color/hct/hct-solver.js.map +1 -0
- package/lib/util/color/hct/hct.js +153 -0
- package/lib/util/color/hct/hct.js.map +1 -0
- package/lib/util/color/hct/viewing-conditions.js +110 -0
- package/lib/util/color/hct/viewing-conditions.js.map +1 -0
- package/lib/util/color/index.js +40 -0
- package/lib/util/color/index.js.map +1 -0
- package/lib/util/color/palettes/core-palette.js +99 -0
- package/lib/util/color/palettes/core-palette.js.map +1 -0
- package/lib/util/color/palettes/tonal-palette.js +112 -0
- package/lib/util/color/palettes/tonal-palette.js.map +1 -0
- package/lib/util/color/types.js +2 -0
- package/lib/util/color/types.js.map +1 -0
- package/lib/util/color/utils/math-utils.js +139 -0
- package/lib/util/color/utils/math-utils.js.map +1 -0
- package/lib/util/common.js +107 -0
- package/lib/util/common.js.map +1 -0
- package/lib/util/component/component.js +26 -0
- package/lib/util/component/component.js.map +1 -0
- package/lib/util/component/index.js +65 -0
- package/lib/util/component/index.js.map +1 -0
- package/lib/util/component/inject-self.js +10 -0
- package/lib/util/component/inject-self.js.map +1 -0
- package/lib/util/component/props.js +41 -0
- package/lib/util/component/props.js.map +1 -0
- package/lib/util/component/types.js +2 -0
- package/lib/util/component/types.js.map +1 -0
- package/lib/util/date/adapters/yuyeon-date-adapter.js +111 -0
- package/lib/util/date/adapters/yuyeon-date-adapter.js.map +1 -0
- package/lib/util/date/built-in.js +416 -0
- package/lib/util/date/built-in.js.map +1 -0
- package/lib/util/date/index.js +4 -0
- package/lib/util/date/index.js.map +1 -0
- package/lib/util/date/types.js +2 -0
- package/lib/util/date/types.js.map +1 -0
- package/lib/util/debounce.js +114 -0
- package/lib/util/debounce.js.map +1 -0
- package/lib/util/dom.js +23 -0
- package/lib/util/dom.js.map +1 -0
- package/lib/util/environments.js +8 -0
- package/lib/util/environments.js.map +1 -0
- package/lib/util/frame-scheduler.js +29 -0
- package/lib/util/frame-scheduler.js.map +1 -0
- package/lib/util/index.js +17 -0
- package/lib/util/index.js.map +1 -0
- package/lib/util/reactivity.js +19 -0
- package/lib/util/reactivity.js.map +1 -0
- package/lib/util/rect.js +39 -0
- package/lib/util/rect.js.map +1 -0
- package/lib/util/scroll.js +28 -0
- package/lib/util/scroll.js.map +1 -0
- package/lib/util/string.js +69 -0
- package/lib/util/string.js.map +1 -0
- package/lib/util/ui.js +60 -0
- package/lib/util/ui.js.map +1 -0
- package/lib/util/validation.js +5 -0
- package/lib/util/validation.js.map +1 -0
- package/package.json +12 -12
- package/types/components/tree-view/YTreeView.d.ts +1 -0
- package/types/composables/theme/setting.d.ts +1 -0
- package/lib/abstract/items.mjs +0 -20
- package/lib/abstract/items.mjs.map +0 -1
- package/lib/components/alert/YAlert.mjs +0 -83
- package/lib/components/alert/YAlert.mjs.map +0 -1
- package/lib/components/alert/index.mjs +0 -2
- package/lib/components/alert/index.mjs.map +0 -1
- package/lib/components/app/YApp.mjs +0 -21
- package/lib/components/app/YApp.mjs.map +0 -1
- package/lib/components/app/index.mjs +0 -2
- package/lib/components/app/index.mjs.map +0 -1
- package/lib/components/badge/YBadge.mjs +0 -83
- package/lib/components/badge/YBadge.mjs.map +0 -1
- package/lib/components/badge/index.mjs +0 -2
- package/lib/components/badge/index.mjs.map +0 -1
- package/lib/components/bench/YBench.mjs +0 -43
- package/lib/components/bench/YBench.mjs.map +0 -1
- package/lib/components/bench/index.mjs +0 -2
- package/lib/components/bench/index.mjs.map +0 -1
- package/lib/components/button/YButton.mjs +0 -169
- package/lib/components/button/YButton.mjs.map +0 -1
- package/lib/components/button/index.mjs +0 -2
- package/lib/components/button/index.mjs.map +0 -1
- package/lib/components/card/YCard.mjs +0 -28
- package/lib/components/card/YCard.mjs.map +0 -1
- package/lib/components/card/YCardBody.mjs +0 -11
- package/lib/components/card/YCardBody.mjs.map +0 -1
- package/lib/components/card/YCardFooter.mjs +0 -11
- package/lib/components/card/YCardFooter.mjs.map +0 -1
- package/lib/components/card/YCardHeader.mjs +0 -11
- package/lib/components/card/YCardHeader.mjs.map +0 -1
- package/lib/components/card/index.mjs +0 -5
- package/lib/components/card/index.mjs.map +0 -1
- package/lib/components/checkbox/YCheckbox.mjs +0 -160
- package/lib/components/checkbox/YCheckbox.mjs.map +0 -1
- package/lib/components/checkbox/YInputCheckbox.mjs +0 -114
- package/lib/components/checkbox/YInputCheckbox.mjs.map +0 -1
- package/lib/components/checkbox/index.mjs +0 -4
- package/lib/components/checkbox/index.mjs.map +0 -1
- package/lib/components/chip/YChip.mjs +0 -39
- package/lib/components/chip/YChip.mjs.map +0 -1
- package/lib/components/chip/index.mjs +0 -2
- package/lib/components/chip/index.mjs.map +0 -1
- package/lib/components/date-picker/YDateCalendar.mjs +0 -243
- package/lib/components/date-picker/YDateCalendar.mjs.map +0 -1
- package/lib/components/date-picker/YDatePicker.mjs +0 -132
- package/lib/components/date-picker/YDatePicker.mjs.map +0 -1
- package/lib/components/date-picker/YDatePickerControl.mjs +0 -107
- package/lib/components/date-picker/YDatePickerControl.mjs.map +0 -1
- package/lib/components/date-picker/YMonthPicker.mjs +0 -64
- package/lib/components/date-picker/YMonthPicker.mjs.map +0 -1
- package/lib/components/date-picker/YYearPicker.mjs +0 -87
- package/lib/components/date-picker/YYearPicker.mjs.map +0 -1
- package/lib/components/date-picker/index.mjs +0 -4
- package/lib/components/date-picker/index.mjs.map +0 -1
- package/lib/components/default-provider/YDefaultProvider.mjs +0 -2
- package/lib/components/default-provider/YDefaultProvider.mjs.map +0 -1
- package/lib/components/default-provider/index.mjs +0 -2
- package/lib/components/default-provider/index.mjs.map +0 -1
- package/lib/components/dialog/YDialog.mjs +0 -213
- package/lib/components/dialog/YDialog.mjs.map +0 -1
- package/lib/components/dialog/index.mjs +0 -2
- package/lib/components/dialog/index.mjs.map +0 -1
- package/lib/components/divider/YDivider.mjs +0 -20
- package/lib/components/divider/YDivider.mjs.map +0 -1
- package/lib/components/divider/index.mjs +0 -2
- package/lib/components/divider/index.mjs.map +0 -1
- package/lib/components/draggable/YDraggable.mjs +0 -95
- package/lib/components/draggable/YDraggable.mjs.map +0 -1
- package/lib/components/dropdown/YDropdown.mjs +0 -109
- package/lib/components/dropdown/YDropdown.mjs.map +0 -1
- package/lib/components/dropdown/index.mjs +0 -2
- package/lib/components/dropdown/index.mjs.map +0 -1
- package/lib/components/field-input/YFieldInput.mjs +0 -229
- package/lib/components/field-input/YFieldInput.mjs.map +0 -1
- package/lib/components/field-input/index.mjs +0 -2
- package/lib/components/field-input/index.mjs.map +0 -1
- package/lib/components/form/YForm.mjs +0 -65
- package/lib/components/form/YForm.mjs.map +0 -1
- package/lib/components/form/index.mjs +0 -2
- package/lib/components/form/index.mjs.map +0 -1
- package/lib/components/hover/YHover.mjs +0 -54
- package/lib/components/hover/YHover.mjs.map +0 -1
- package/lib/components/hover/index.mjs +0 -2
- package/lib/components/hover/index.mjs.map +0 -1
- package/lib/components/icon/YIcon.mjs +0 -63
- package/lib/components/icon/YIcon.mjs.map +0 -1
- package/lib/components/icon/index.mjs +0 -2
- package/lib/components/icon/index.mjs.map +0 -1
- package/lib/components/icon/poly.mjs +0 -57
- package/lib/components/icon/poly.mjs.map +0 -1
- package/lib/components/icons/YIconCheckbox.mjs +0 -32
- package/lib/components/icons/YIconCheckbox.mjs.map +0 -1
- package/lib/components/icons/YIconClear.mjs +0 -16
- package/lib/components/icons/YIconClear.mjs.map +0 -1
- package/lib/components/icons/YIconDropdown.mjs +0 -16
- package/lib/components/icons/YIconDropdown.mjs.map +0 -1
- package/lib/components/icons/YIconExpand.mjs +0 -20
- package/lib/components/icons/YIconExpand.mjs.map +0 -1
- package/lib/components/icons/YIconPageControl.mjs +0 -32
- package/lib/components/icons/YIconPageControl.mjs.map +0 -1
- package/lib/components/icons/YIconSort.mjs +0 -45
- package/lib/components/icons/YIconSort.mjs.map +0 -1
- package/lib/components/icons/index.mjs +0 -32
- package/lib/components/icons/index.mjs.map +0 -1
- package/lib/components/img/YImg.mjs +0 -173
- package/lib/components/img/YImg.mjs.map +0 -1
- package/lib/components/img/index.mjs +0 -2
- package/lib/components/img/index.mjs.map +0 -1
- package/lib/components/index.mjs +0 -39
- package/lib/components/index.mjs.map +0 -1
- package/lib/components/input/YInput.mjs +0 -258
- package/lib/components/input/YInput.mjs.map +0 -1
- package/lib/components/input/index.mjs +0 -2
- package/lib/components/input/index.mjs.map +0 -1
- package/lib/components/ip-field/YIpv4Field.mjs +0 -297
- package/lib/components/ip-field/YIpv4Field.mjs.map +0 -1
- package/lib/components/ip-field/index.mjs +0 -2
- package/lib/components/ip-field/index.mjs.map +0 -1
- package/lib/components/layer/YLayer.mjs +0 -326
- package/lib/components/layer/YLayer.mjs.map +0 -1
- package/lib/components/layer/active-delay.mjs +0 -28
- package/lib/components/layer/active-delay.mjs.map +0 -1
- package/lib/components/layer/active-stack.mjs +0 -52
- package/lib/components/layer/active-stack.mjs.map +0 -1
- package/lib/components/layer/base.mjs +0 -87
- package/lib/components/layer/base.mjs.map +0 -1
- package/lib/components/layer/content.mjs +0 -22
- package/lib/components/layer/content.mjs.map +0 -1
- package/lib/components/layer/index.mjs +0 -2
- package/lib/components/layer/index.mjs.map +0 -1
- package/lib/components/layer/scroll-strategies.mjs +0 -132
- package/lib/components/layer/scroll-strategies.mjs.map +0 -1
- package/lib/components/list/YList.mjs +0 -55
- package/lib/components/list/YList.mjs.map +0 -1
- package/lib/components/list/YListItem.mjs +0 -59
- package/lib/components/list/YListItem.mjs.map +0 -1
- package/lib/components/list/index.mjs +0 -3
- package/lib/components/list/index.mjs.map +0 -1
- package/lib/components/loading/YSpinnerRing.mjs +0 -25
- package/lib/components/loading/YSpinnerRing.mjs.map +0 -1
- package/lib/components/loading/index.mjs +0 -2
- package/lib/components/loading/index.mjs.map +0 -1
- package/lib/components/menu/YMenu.mjs +0 -211
- package/lib/components/menu/YMenu.mjs.map +0 -1
- package/lib/components/menu/index.mjs +0 -2
- package/lib/components/menu/index.mjs.map +0 -1
- package/lib/components/navigation/YNavigation.mjs +0 -18
- package/lib/components/navigation/YNavigation.mjs.map +0 -1
- package/lib/components/navigation/index.mjs +0 -2
- package/lib/components/navigation/index.mjs.map +0 -1
- package/lib/components/pagination/YPagination.mjs +0 -288
- package/lib/components/pagination/YPagination.mjs.map +0 -1
- package/lib/components/pagination/index.mjs +0 -2
- package/lib/components/pagination/index.mjs.map +0 -1
- package/lib/components/panel/YDividePanel.mjs +0 -90
- package/lib/components/panel/YDividePanel.mjs.map +0 -1
- package/lib/components/panel/index.mjs +0 -2
- package/lib/components/panel/index.mjs.map +0 -1
- package/lib/components/plate/YPlate.mjs +0 -28
- package/lib/components/plate/YPlate.mjs.map +0 -1
- package/lib/components/plate/index.mjs +0 -2
- package/lib/components/plate/index.mjs.map +0 -1
- package/lib/components/progress-bar/YProgressBar.mjs +0 -117
- package/lib/components/progress-bar/YProgressBar.mjs.map +0 -1
- package/lib/components/progress-bar/index.mjs +0 -2
- package/lib/components/progress-bar/index.mjs.map +0 -1
- package/lib/components/progress-ring/YProgressRing.mjs +0 -128
- package/lib/components/progress-ring/YProgressRing.mjs.map +0 -1
- package/lib/components/progress-ring/index.mjs +0 -2
- package/lib/components/progress-ring/index.mjs.map +0 -1
- package/lib/components/select/YSelect.mjs +0 -344
- package/lib/components/select/YSelect.mjs.map +0 -1
- package/lib/components/select/index.mjs +0 -2
- package/lib/components/select/index.mjs.map +0 -1
- package/lib/components/slider/YSlider.mjs +0 -26
- package/lib/components/slider/YSlider.mjs.map +0 -1
- package/lib/components/slider/index.mjs +0 -2
- package/lib/components/slider/index.mjs.map +0 -1
- package/lib/components/snackbar/YSnackbar.mjs +0 -209
- package/lib/components/snackbar/YSnackbar.mjs.map +0 -1
- package/lib/components/snackbar/index.mjs +0 -2
- package/lib/components/snackbar/index.mjs.map +0 -1
- package/lib/components/switch/YSwitch.mjs +0 -184
- package/lib/components/switch/YSwitch.mjs.map +0 -1
- package/lib/components/switch/index.mjs +0 -2
- package/lib/components/switch/index.mjs.map +0 -1
- package/lib/components/tab/YTab.mjs +0 -64
- package/lib/components/tab/YTab.mjs.map +0 -1
- package/lib/components/tab/YTabs.mjs +0 -86
- package/lib/components/tab/YTabs.mjs.map +0 -1
- package/lib/components/tab/index.mjs +0 -4
- package/lib/components/tab/index.mjs.map +0 -1
- package/lib/components/tab/shared.mjs +0 -2
- package/lib/components/tab/shared.mjs.map +0 -1
- package/lib/components/tab/types.mjs +0 -2
- package/lib/components/tab/types.mjs.map +0 -1
- package/lib/components/table/YDataTable.mjs +0 -182
- package/lib/components/table/YDataTable.mjs.map +0 -1
- package/lib/components/table/YDataTableBody.mjs +0 -131
- package/lib/components/table/YDataTableBody.mjs.map +0 -1
- package/lib/components/table/YDataTableCell.mjs +0 -78
- package/lib/components/table/YDataTableCell.mjs.map +0 -1
- package/lib/components/table/YDataTableControl.mjs +0 -46
- package/lib/components/table/YDataTableControl.mjs.map +0 -1
- package/lib/components/table/YDataTableHead.mjs +0 -172
- package/lib/components/table/YDataTableHead.mjs.map +0 -1
- package/lib/components/table/YDataTableLayer.mjs +0 -29
- package/lib/components/table/YDataTableLayer.mjs.map +0 -1
- package/lib/components/table/YDataTableRow.mjs +0 -150
- package/lib/components/table/YDataTableRow.mjs.map +0 -1
- package/lib/components/table/YDataTableServer.mjs +0 -173
- package/lib/components/table/YDataTableServer.mjs.map +0 -1
- package/lib/components/table/YTable.mjs +0 -77
- package/lib/components/table/YTable.mjs.map +0 -1
- package/lib/components/table/composibles/header.mjs +0 -127
- package/lib/components/table/composibles/header.mjs.map +0 -1
- package/lib/components/table/composibles/items.mjs +0 -52
- package/lib/components/table/composibles/items.mjs.map +0 -1
- package/lib/components/table/composibles/measure.mjs +0 -39
- package/lib/components/table/composibles/measure.mjs.map +0 -1
- package/lib/components/table/composibles/options.mjs +0 -33
- package/lib/components/table/composibles/options.mjs.map +0 -1
- package/lib/components/table/composibles/pagination.mjs +0 -99
- package/lib/components/table/composibles/pagination.mjs.map +0 -1
- package/lib/components/table/composibles/selection.mjs +0 -196
- package/lib/components/table/composibles/selection.mjs.map +0 -1
- package/lib/components/table/composibles/sorted-items.mjs +0 -50
- package/lib/components/table/composibles/sorted-items.mjs.map +0 -1
- package/lib/components/table/composibles/sorting.mjs +0 -73
- package/lib/components/table/composibles/sorting.mjs.map +0 -1
- package/lib/components/table/index.mjs +0 -9
- package/lib/components/table/index.mjs.map +0 -1
- package/lib/components/table/types/common.mjs +0 -2
- package/lib/components/table/types/common.mjs.map +0 -1
- package/lib/components/table/types/header.mjs +0 -2
- package/lib/components/table/types/header.mjs.map +0 -1
- package/lib/components/table/types/index.mjs +0 -2
- package/lib/components/table/types/index.mjs.map +0 -1
- package/lib/components/table/types/item.mjs +0 -2
- package/lib/components/table/types/item.mjs.map +0 -1
- package/lib/components/table/types/row.mjs +0 -2
- package/lib/components/table/types/row.mjs.map +0 -1
- package/lib/components/text-ellipsis/YTextEllipsis.mjs +0 -66
- package/lib/components/text-ellipsis/YTextEllipsis.mjs.map +0 -1
- package/lib/components/text-ellipsis/index.mjs +0 -2
- package/lib/components/text-ellipsis/index.mjs.map +0 -1
- package/lib/components/text-highlighter/YTextHighlighter.mjs +0 -95
- package/lib/components/text-highlighter/YTextHighlighter.mjs.map +0 -1
- package/lib/components/text-highlighter/index.mjs +0 -2
- package/lib/components/text-highlighter/index.mjs.map +0 -1
- package/lib/components/text-interpolation/YTi.mjs +0 -47
- package/lib/components/text-interpolation/YTi.mjs.map +0 -1
- package/lib/components/text-interpolation/index.mjs +0 -2
- package/lib/components/text-interpolation/index.mjs.map +0 -1
- package/lib/components/textarea/YTextarea.mjs +0 -157
- package/lib/components/textarea/YTextarea.mjs.map +0 -1
- package/lib/components/textarea/index.mjs +0 -2
- package/lib/components/textarea/index.mjs.map +0 -1
- package/lib/components/toggle-button/YToggleButton.mjs +0 -2
- package/lib/components/toggle-button/YToggleButton.mjs.map +0 -1
- package/lib/components/toggle-button/index.mjs +0 -2
- package/lib/components/toggle-button/index.mjs.map +0 -1
- package/lib/components/tooltip/YTooltip.mjs +0 -157
- package/lib/components/tooltip/YTooltip.mjs.map +0 -1
- package/lib/components/tooltip/index.mjs +0 -2
- package/lib/components/tooltip/index.mjs.map +0 -1
- package/lib/components/transitions/expand-transition.mjs +0 -109
- package/lib/components/transitions/expand-transition.mjs.map +0 -1
- package/lib/components/transitions/index.mjs +0 -4
- package/lib/components/transitions/index.mjs.map +0 -1
- package/lib/components/tree-view/YTreeView.mjs +0 -289
- package/lib/components/tree-view/YTreeView.mjs.map +0 -1
- package/lib/components/tree-view/YTreeViewNode.mjs +0 -250
- package/lib/components/tree-view/YTreeViewNode.mjs.map +0 -1
- package/lib/components/tree-view/index.mjs +0 -3
- package/lib/components/tree-view/index.mjs.map +0 -1
- package/lib/components/tree-view/tree-view.mjs +0 -179
- package/lib/components/tree-view/tree-view.mjs.map +0 -1
- package/lib/components/tree-view/types.mjs +0 -2
- package/lib/components/tree-view/types.mjs.map +0 -1
- package/lib/components/tree-view/util.mjs +0 -40
- package/lib/components/tree-view/util.mjs.map +0 -1
- package/lib/composables/choice-link.mjs +0 -13
- package/lib/composables/choice-link.mjs.map +0 -1
- package/lib/composables/choice.mjs +0 -187
- package/lib/composables/choice.mjs.map +0 -1
- package/lib/composables/communication.mjs +0 -55
- package/lib/composables/communication.mjs.map +0 -1
- package/lib/composables/component.mjs +0 -8
- package/lib/composables/component.mjs.map +0 -1
- package/lib/composables/coordinate/arrangement.mjs +0 -14
- package/lib/composables/coordinate/arrangement.mjs.map +0 -1
- package/lib/composables/coordinate/index.mjs +0 -67
- package/lib/composables/coordinate/index.mjs.map +0 -1
- package/lib/composables/coordinate/levitation.mjs +0 -315
- package/lib/composables/coordinate/levitation.mjs.map +0 -1
- package/lib/composables/coordinate/types.mjs +0 -2
- package/lib/composables/coordinate/types.mjs.map +0 -1
- package/lib/composables/coordinate/utils/point.mjs +0 -55
- package/lib/composables/coordinate/utils/point.mjs.map +0 -1
- package/lib/composables/date/factory.mjs +0 -12
- package/lib/composables/date/factory.mjs.map +0 -1
- package/lib/composables/date/index.mjs +0 -20
- package/lib/composables/date/index.mjs.map +0 -1
- package/lib/composables/date/setting.mjs +0 -11
- package/lib/composables/date/setting.mjs.map +0 -1
- package/lib/composables/date/types.mjs +0 -2
- package/lib/composables/date/types.mjs.map +0 -1
- package/lib/composables/defaults/index.mjs +0 -99
- package/lib/composables/defaults/index.mjs.map +0 -1
- package/lib/composables/defaults/share.mjs +0 -2
- package/lib/composables/defaults/share.mjs.map +0 -1
- package/lib/composables/defaults/types.mjs +0 -2
- package/lib/composables/defaults/types.mjs.map +0 -1
- package/lib/composables/dimension.mjs +0 -26
- package/lib/composables/dimension.mjs.map +0 -1
- package/lib/composables/focus.mjs +0 -29
- package/lib/composables/focus.mjs.map +0 -1
- package/lib/composables/form.mjs +0 -100
- package/lib/composables/form.mjs.map +0 -1
- package/lib/composables/group.mjs +0 -194
- package/lib/composables/group.mjs.map +0 -1
- package/lib/composables/i18n/index.mjs +0 -30
- package/lib/composables/i18n/index.mjs.map +0 -1
- package/lib/composables/i18n/locale.mjs +0 -5
- package/lib/composables/i18n/locale.mjs.map +0 -1
- package/lib/composables/i18n/rtl.mjs +0 -34
- package/lib/composables/i18n/rtl.mjs.map +0 -1
- package/lib/composables/i18n/share.mjs +0 -2
- package/lib/composables/i18n/share.mjs.map +0 -1
- package/lib/composables/icon.mjs +0 -164
- package/lib/composables/icon.mjs.map +0 -1
- package/lib/composables/index.mjs +0 -11
- package/lib/composables/index.mjs.map +0 -1
- package/lib/composables/layer-group.mjs +0 -66
- package/lib/composables/layer-group.mjs.map +0 -1
- package/lib/composables/layout.mjs +0 -13
- package/lib/composables/layout.mjs.map +0 -1
- package/lib/composables/list-items.mjs +0 -66
- package/lib/composables/list-items.mjs.map +0 -1
- package/lib/composables/progress.mjs +0 -26
- package/lib/composables/progress.mjs.map +0 -1
- package/lib/composables/ref.mjs +0 -13
- package/lib/composables/ref.mjs.map +0 -1
- package/lib/composables/resize-observer.mjs +0 -33
- package/lib/composables/resize-observer.mjs.map +0 -1
- package/lib/composables/scope.mjs +0 -26
- package/lib/composables/scope.mjs.map +0 -1
- package/lib/composables/style-color.mjs +0 -37
- package/lib/composables/style-color.mjs.map +0 -1
- package/lib/composables/theme/factory.mjs +0 -47
- package/lib/composables/theme/factory.mjs.map +0 -1
- package/lib/composables/theme/helper.mjs +0 -14
- package/lib/composables/theme/helper.mjs.map +0 -1
- package/lib/composables/theme/index.mjs +0 -187
- package/lib/composables/theme/index.mjs.map +0 -1
- package/lib/composables/theme/setting.mjs +0 -112
- package/lib/composables/theme/setting.mjs.map +0 -1
- package/lib/composables/theme/types.mjs +0 -2
- package/lib/composables/theme/types.mjs.map +0 -1
- package/lib/composables/timing.mjs +0 -102
- package/lib/composables/timing.mjs.map +0 -1
- package/lib/composables/transition.mjs +0 -51
- package/lib/composables/transition.mjs.map +0 -1
- package/lib/composables/validation.mjs +0 -126
- package/lib/composables/validation.mjs.map +0 -1
- package/lib/composables/vue-router.mjs +0 -32
- package/lib/composables/vue-router.mjs.map +0 -1
- package/lib/directives/complement-click/index.mjs +0 -78
- package/lib/directives/complement-click/index.mjs.map +0 -1
- package/lib/directives/plate-wave/index.mjs +0 -100
- package/lib/directives/plate-wave/index.mjs.map +0 -1
- package/lib/directives/theme-class.mjs +0 -24
- package/lib/directives/theme-class.mjs.map +0 -1
- package/lib/etc/index.mjs +0 -6
- package/lib/etc/index.mjs.map +0 -1
- package/lib/i18n/built-in.mjs +0 -77
- package/lib/i18n/built-in.mjs.map +0 -1
- package/lib/i18n/config.mjs +0 -82
- package/lib/i18n/config.mjs.map +0 -1
- package/lib/i18n/types.mjs +0 -2
- package/lib/i18n/types.mjs.map +0 -1
- package/lib/index.mjs +0 -103
- package/lib/index.mjs.map +0 -1
- package/lib/locales/en.mjs +0 -6
- package/lib/locales/en.mjs.map +0 -1
- package/lib/locales/index.mjs +0 -3
- package/lib/locales/index.mjs.map +0 -1
- package/lib/locales/ko.mjs +0 -6
- package/lib/locales/ko.mjs.map +0 -1
- package/lib/mixins/di.mjs +0 -19
- package/lib/mixins/di.mjs.map +0 -1
- package/lib/mixins/rebind-attrs.mjs +0 -37
- package/lib/mixins/rebind-attrs.mjs.map +0 -1
- package/lib/types/index.mjs +0 -2
- package/lib/types/index.mjs.map +0 -1
- package/lib/util/anchor.mjs +0 -53
- package/lib/util/anchor.mjs.map +0 -1
- package/lib/util/array.mjs +0 -13
- package/lib/util/array.mjs.map +0 -1
- package/lib/util/collection.mjs +0 -10
- package/lib/util/collection.mjs.map +0 -1
- package/lib/util/color/apca.mjs +0 -201
- package/lib/util/color/apca.mjs.map +0 -1
- package/lib/util/color/const.mjs +0 -6
- package/lib/util/color/const.mjs.map +0 -1
- package/lib/util/color/contrast/contrast.mjs +0 -149
- package/lib/util/color/contrast/contrast.mjs.map +0 -1
- package/lib/util/color/conversion.mjs +0 -310
- package/lib/util/color/conversion.mjs.map +0 -1
- package/lib/util/color/hct/cam16.mjs +0 -349
- package/lib/util/color/hct/cam16.mjs.map +0 -1
- package/lib/util/color/hct/hct-solver.mjs +0 -389
- package/lib/util/color/hct/hct-solver.mjs.map +0 -1
- package/lib/util/color/hct/hct.mjs +0 -153
- package/lib/util/color/hct/hct.mjs.map +0 -1
- package/lib/util/color/hct/viewing-conditions.mjs +0 -110
- package/lib/util/color/hct/viewing-conditions.mjs.map +0 -1
- package/lib/util/color/index.mjs +0 -40
- package/lib/util/color/index.mjs.map +0 -1
- package/lib/util/color/palettes/core-palette.mjs +0 -99
- package/lib/util/color/palettes/core-palette.mjs.map +0 -1
- package/lib/util/color/palettes/tonal-palette.mjs +0 -112
- package/lib/util/color/palettes/tonal-palette.mjs.map +0 -1
- package/lib/util/color/types.mjs +0 -2
- package/lib/util/color/types.mjs.map +0 -1
- package/lib/util/color/utils/math-utils.mjs +0 -139
- package/lib/util/color/utils/math-utils.mjs.map +0 -1
- package/lib/util/common.mjs +0 -107
- package/lib/util/common.mjs.map +0 -1
- package/lib/util/component/component.mjs +0 -26
- package/lib/util/component/component.mjs.map +0 -1
- package/lib/util/component/index.mjs +0 -65
- package/lib/util/component/index.mjs.map +0 -1
- package/lib/util/component/inject-self.mjs +0 -10
- package/lib/util/component/inject-self.mjs.map +0 -1
- package/lib/util/component/props.mjs +0 -41
- package/lib/util/component/props.mjs.map +0 -1
- package/lib/util/component/types.mjs +0 -2
- package/lib/util/component/types.mjs.map +0 -1
- package/lib/util/date/adapters/yuyeon-date-adapter.mjs +0 -111
- package/lib/util/date/adapters/yuyeon-date-adapter.mjs.map +0 -1
- package/lib/util/date/built-in.mjs +0 -416
- package/lib/util/date/built-in.mjs.map +0 -1
- package/lib/util/date/index.mjs +0 -4
- package/lib/util/date/index.mjs.map +0 -1
- package/lib/util/date/types.mjs +0 -2
- package/lib/util/date/types.mjs.map +0 -1
- package/lib/util/debounce.mjs +0 -114
- package/lib/util/debounce.mjs.map +0 -1
- package/lib/util/dom.mjs +0 -23
- package/lib/util/dom.mjs.map +0 -1
- package/lib/util/environments.mjs +0 -8
- package/lib/util/environments.mjs.map +0 -1
- package/lib/util/frame-scheduler.mjs +0 -29
- package/lib/util/frame-scheduler.mjs.map +0 -1
- package/lib/util/index.mjs +0 -17
- package/lib/util/index.mjs.map +0 -1
- package/lib/util/parser.mjs +0 -31
- package/lib/util/parser.mjs.map +0 -1
- package/lib/util/reactivity.mjs +0 -19
- package/lib/util/reactivity.mjs.map +0 -1
- package/lib/util/rect.mjs +0 -39
- package/lib/util/rect.mjs.map +0 -1
- package/lib/util/scroll.mjs +0 -28
- package/lib/util/scroll.mjs.map +0 -1
- package/lib/util/string.mjs +0 -69
- package/lib/util/string.mjs.map +0 -1
- package/lib/util/ui.mjs +0 -60
- package/lib/util/ui.mjs.map +0 -1
- package/lib/util/validation.mjs +0 -5
- package/lib/util/validation.mjs.map +0 -1
- package/lib/util/vue-component/index.mjs +0 -63
- package/lib/util/vue-component/index.mjs.map +0 -1
- package/lib/util/vue-component/props.mjs +0 -37
- package/lib/util/vue-component/props.mjs.map +0 -1
- package/lib/util/vue-component/types.mjs +0 -2
- package/lib/util/vue-component/types.mjs.map +0 -1
- package/lib/util/vue-component.mjs +0 -102
- package/lib/util/vue-component.mjs.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["computed","effectScope","getCurrentInstance","inject","provide","reactive","readonly","ref","unref","watch","bindThemeClass","propsFactory","createPalette","createThemes","cssClass","cssVariables","configureOptions","Y_THEME_PREFIX","YUYEON_THEME_KEY","Symbol","for","pressThemePropsOptions","theme","String","isDarkMode","window","matchMedia","matches","isSupportAutoScheme","media","createThemeModule","options","appMountedScope","config","scheme","themes","palette","supportedAutoMode","preferColorScheme","darkModeWatcher","mediaQueryList","value","currentColorScheme","currentThemeKey","computedThemes","Array","isArray","computedPalette","styles","separationId","separation","lines","push","themeKey","themeDefs","Object","entries","colors","variables","isDark","records","themeScheme","join","install","app","directive","styleEl","document","getElementById","updateStyleEl","immediate","el","createElement","type","id","cspNonce","setAttribute","head","appendChild","innerHTML","bindTheme","yuyeon","mql","addEventListener","neo","lightTheme","darkTheme","root","dataset","init","run","themeClasses","scope","instance","global","useLocalTheme","props","themeModule","Error","moduleTheme","newTheme","useTheme"],"sources":["../../../src/composables/theme/index.ts"],"sourcesContent":["import type { App, ComputedRef, PropType, Ref } from 'vue';\r\nimport {\r\n computed,\r\n effectScope,\r\n getCurrentInstance,\r\n inject,\r\n provide,\r\n reactive,\r\n readonly,\r\n ref,\r\n unref,\r\n watch,\r\n} from 'vue';\r\n\r\nimport bindThemeClass from '@/directives/theme-class';\r\nimport { propsFactory } from '@/util/component/props';\r\n\r\nimport { createPalette, createThemes } from './factory';\r\nimport { cssClass, cssVariables } from './helper';\r\nimport { ThemeScheme, configureOptions } from './setting';\r\nimport type { ThemeOptions } from './types';\r\n\r\nexport type { ThemeOptions };\r\n\r\nexport const Y_THEME_PREFIX = 'y-theme';\r\n\r\nexport interface ThemeModuleInstance {\r\n scheme: Ref<keyof typeof ThemeScheme | 'auto'>;\r\n theme: Ref<[string, string?]>;\r\n // theme values(schemes) for colors & variables\r\n readonly themes: any;\r\n readonly global: {\r\n // currentThemeKeys: [lightThemeKey, darkThemeKey]\r\n // If used manually, fix the scheme to 'light' and have a [lightThemeKey] value.\r\n // Use the appropriate default theme scheme if it does not match the themeKey\r\n scheme: Ref<keyof typeof ThemeScheme | 'auto'>;\r\n theme: Ref<[string, string?]>;\r\n };\r\n /* computed */\r\n readonly currentThemeKey: Readonly<ComputedRef<string>>;\r\n readonly themeClasses: Readonly<ComputedRef<string | undefined>>;\r\n readonly computedThemes: Readonly<ComputedRef<any>>;\r\n readonly computedPalette: Readonly<ComputedRef<any>>;\r\n /* */\r\n readonly supportedAutoMode: Readonly<Ref<boolean>>;\r\n readonly preferColorScheme: Readonly<Ref<'light' | 'dark'>>;\r\n}\r\n\r\nexport const YUYEON_THEME_KEY = Symbol.for('yuyeon.theme');\r\n\r\nexport const pressThemePropsOptions = propsFactory(\r\n {\r\n theme: String as PropType<string>,\r\n },\r\n 'theme',\r\n);\r\n\r\nexport function isDarkMode() {\r\n return window.matchMedia('(prefers-color-scheme: dark)').matches;\r\n}\r\n\r\nexport function isSupportAutoScheme() {\r\n return window.matchMedia('(prefers-color-scheme)').media !== 'not all';\r\n}\r\n\r\nexport function createThemeModule(options: ThemeOptions) {\r\n const appMountedScope = effectScope();\r\n const config = reactive(configureOptions(options));\r\n const scheme = ref<string>(config.scheme);\r\n const theme = ref<[string, string]>(config.theme);\r\n const themes = ref(config.themes);\r\n const palette = ref(config.palette);\r\n const supportedAutoMode = ref(true);\r\n const preferColorScheme = ref('');\r\n\r\n function darkModeWatcher(\r\n mediaQueryList: MediaQueryListEvent | MediaQueryList,\r\n ) {\r\n preferColorScheme.value = mediaQueryList.matches ? 'dark' : 'light';\r\n }\r\n\r\n const currentColorScheme = computed<'light' | 'dark'>(() => {\r\n if (scheme.value === 'auto') {\r\n return preferColorScheme.value as 'light' | 'dark';\r\n }\r\n if (scheme.value === 'dark') {\r\n return 'dark';\r\n }\r\n return 'light';\r\n });\r\n\r\n const currentThemeKey = computed(() => {\r\n if (typeof theme.value === 'string') {\r\n if (theme.value in computedThemes) {\r\n return theme.value;\r\n }\r\n }\r\n if (Array.isArray(theme.value)) {\r\n return currentColorScheme.value === 'dark'\r\n ? theme.value?.[1] ?? 'dark'\r\n : theme.value?.[0] ?? 'light';\r\n }\r\n return currentColorScheme.value;\r\n });\r\n\r\n const computedPalette = computed(() => {\r\n return createPalette(palette.value);\r\n });\r\n\r\n const computedThemes = computed(() => {\r\n return createThemes(themes.value);\r\n });\r\n\r\n const styles = computed(() => {\r\n const separationId = config.separation ? `#${config.separation}` : '';\r\n const lines = [];\r\n lines.push(\r\n ...cssClass(':root', cssVariables(computedPalette.value, 'palette')),\r\n );\r\n for (const [themeKey, themeDefs] of Object.entries(computedThemes.value)) {\r\n const { colors, variables, isDark } = themeDefs;\r\n const records: Record<string, string> = {\r\n ...colors,\r\n ...variables,\r\n };\r\n // if (currentThemeKey.value === themeKey) {\r\n // lines.push(...cssClass(':root', cssVariables(records, 'theme')));\r\n // }\r\n const themeScheme = isDark ? 'dark' : 'light';\r\n if (scheme.value === 'auto') {\r\n lines.push(\r\n ...cssClass(\r\n `@media (prefers-color-scheme: ${themeScheme})`,\r\n cssClass(\r\n `${separationId}[data-theme-scheme='auto'][data-${themeScheme}-theme='${themeKey}']`,\r\n cssVariables(records, 'theme'),\r\n ),\r\n ),\r\n );\r\n } else {\r\n lines.push(\r\n ...cssClass(\r\n `${separationId}[data-theme-scheme='${themeScheme}'][data-${themeScheme}-theme='${themeKey}']`,\r\n cssVariables(records, 'theme'),\r\n ),\r\n );\r\n }\r\n\r\n lines.push(\r\n ...cssClass(\r\n `${separationId} .y-theme--${themeKey}`,\r\n cssVariables(records, 'theme'),\r\n ),\r\n );\r\n }\r\n return lines.join('');\r\n });\r\n\r\n function install(app: App) {\r\n app.directive('theme', bindThemeClass);\r\n\r\n let styleEl = document.getElementById(\r\n 'yuyeon-theme-palette' +\r\n `${config.separation ? '__' + config.separation : ''}`,\r\n );\r\n\r\n watch(styles, updateStyleEl, { immediate: true });\r\n\r\n function updateStyleEl() {\r\n if (typeof document !== 'undefined' && !styleEl) {\r\n const el = document.createElement('style');\r\n el.type = 'text/css';\r\n el.id =\r\n 'yuyeon-theme-palette' +\r\n `${config.separation ? '__' + config.separation : ''}`;\r\n if (options?.cspNonce) el.setAttribute('nonce', options.cspNonce);\r\n styleEl = el;\r\n document.head.appendChild(styleEl);\r\n }\r\n if (styleEl) {\r\n styleEl.innerHTML = styles.value;\r\n }\r\n }\r\n }\r\n\r\n function bindTheme(yuyeon: any) {\r\n supportedAutoMode.value = isSupportAutoScheme();\r\n if (supportedAutoMode.value) {\r\n const mql = window.matchMedia('(prefers-color-scheme: dark)');\r\n darkModeWatcher(mql);\r\n mql.addEventListener('change' as 'change', darkModeWatcher);\r\n }\r\n watch(\r\n theme,\r\n (neo) => {\r\n const [lightTheme, darkTheme] = neo;\r\n yuyeon.root.dataset.lightTheme = lightTheme;\r\n yuyeon.root.dataset.darkTheme = darkTheme;\r\n },\r\n { immediate: true },\r\n );\r\n watch(\r\n scheme,\r\n (neo) => {\r\n yuyeon.root.setAttribute(\r\n 'data-theme-scheme',\r\n neo === 'auto' ? 'auto' : currentColorScheme.value,\r\n );\r\n },\r\n { immediate: true },\r\n );\r\n }\r\n\r\n function init(yuyeon: any) {\r\n appMountedScope.run(() => {\r\n bindTheme(yuyeon);\r\n });\r\n }\r\n\r\n const themeClasses = computed(() => `y-theme--${currentThemeKey.value}`);\r\n\r\n return {\r\n install,\r\n init,\r\n scope: appMountedScope,\r\n instance: {\r\n global: {\r\n scheme,\r\n theme,\r\n },\r\n themes,\r\n scheme,\r\n theme,\r\n currentThemeKey,\r\n themeClasses,\r\n computedThemes,\r\n computedPalette,\r\n supportedAutoMode: readonly(supportedAutoMode),\r\n preferColorScheme: readonly(preferColorScheme),\r\n },\r\n };\r\n}\r\n\r\nexport function useLocalTheme(props: { theme?: string }) {\r\n getCurrentInstance();\r\n\r\n const themeModule = inject<ThemeModuleInstance | null>(\r\n YUYEON_THEME_KEY,\r\n null,\r\n );\r\n\r\n if (!themeModule) throw new Error('Not found provided \"ThemeModule\"');\r\n\r\n const palette = themeModule.computedPalette;\r\n\r\n const currentThemeKey = computed<string>(() => {\r\n if (props.theme) {\r\n const moduleTheme = unref(themeModule.theme);\r\n switch (props.theme) {\r\n case 'light':\r\n return moduleTheme?.[0] ?? 'light';\r\n case 'dark':\r\n return moduleTheme?.[1] ?? 'dark';\r\n // TODO: props.theme(themeKey) validation in themes\r\n default:\r\n return props.theme;\r\n }\r\n }\r\n return unref(themeModule.currentThemeKey);\r\n });\r\n\r\n const themeClasses = computed(() => {\r\n return `y-theme--${currentThemeKey.value}`;\r\n });\r\n\r\n const newTheme: ThemeModuleInstance = {\r\n ...themeModule,\r\n currentThemeKey,\r\n themeClasses,\r\n };\r\n\r\n provide(YUYEON_THEME_KEY, newTheme);\r\n\r\n return newTheme;\r\n}\r\n\r\nexport function useTheme() {\r\n getCurrentInstance();\r\n\r\n const theme = inject<ThemeModuleInstance | null>(YUYEON_THEME_KEY, null);\r\n\r\n if (!theme) throw new Error('【yuyeon】 Not found provided \"ThemeModule\"');\r\n\r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
+
export const schemes = ['light', 'dark', 'auto'];
|
|
7
|
+
export const defaultTonalLuminance = [0, 10, 20, 25, 30, 35, 40, 50, 60, 70, 80, 90, 95, 98, 99, 100];
|
|
8
|
+
export const defaultPalette = {
|
|
9
|
+
scaleMethod: 'tonal',
|
|
10
|
+
colors: {
|
|
11
|
+
primary: '#0062a1',
|
|
12
|
+
secondary: '#6251a6',
|
|
13
|
+
tertiary: '#3c691b',
|
|
14
|
+
neutral: '#5d5e61',
|
|
15
|
+
positive: '#009d61',
|
|
16
|
+
negative: '#ba1a1a',
|
|
17
|
+
warning: '#f69400',
|
|
18
|
+
info: '#0d62e6'
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
export const defaultThemesValues = {
|
|
22
|
+
light: {
|
|
23
|
+
isDark: false,
|
|
24
|
+
colors: {
|
|
25
|
+
primary: '#0062a1',
|
|
26
|
+
secondary: '#6251a6',
|
|
27
|
+
tertiary: '#3c691b',
|
|
28
|
+
background: '#fdfbff',
|
|
29
|
+
'on-background': '#1a1c1e',
|
|
30
|
+
surface: '#fdfbff',
|
|
31
|
+
'on-surface': '#1a1c1e',
|
|
32
|
+
'surface-variant': '#dfe3eb',
|
|
33
|
+
'on-surface-variant': '#42474e',
|
|
34
|
+
outline: '#73777f',
|
|
35
|
+
'outline-variant': '#c2c7cf',
|
|
36
|
+
error: '#ba1a1a',
|
|
37
|
+
'on-error': '#ffffff',
|
|
38
|
+
warning: '#8a5100',
|
|
39
|
+
'on-warning': '#ffffff',
|
|
40
|
+
info: '#0056d0',
|
|
41
|
+
'on-info': '#ffffff',
|
|
42
|
+
success: '#006d42',
|
|
43
|
+
'on-success': '#ffffff',
|
|
44
|
+
shadow: '#000000',
|
|
45
|
+
highlighter: '#ffff00'
|
|
46
|
+
},
|
|
47
|
+
variables: {
|
|
48
|
+
'outline-opacity': 0.14,
|
|
49
|
+
'base-shadow-opacity': 0.14,
|
|
50
|
+
'base-font': '#141414'
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
dark: {
|
|
54
|
+
isDark: true,
|
|
55
|
+
colors: {
|
|
56
|
+
primary: '#9ccaff',
|
|
57
|
+
'on-primary': '#003257',
|
|
58
|
+
secondary: '#cbbeff',
|
|
59
|
+
'on-secondary': '#332074',
|
|
60
|
+
tertiary: '#a1d57a',
|
|
61
|
+
'on-tertiary': '#173800',
|
|
62
|
+
background: '#1a1c1e',
|
|
63
|
+
'on-background': '#e2e2e6',
|
|
64
|
+
surface: '#1a1c1e',
|
|
65
|
+
'on-surface': '#e2e2e6',
|
|
66
|
+
'surface-variant': '#42474e',
|
|
67
|
+
'on-surface-variant': '#c2c7cf',
|
|
68
|
+
outline: '#8c9199',
|
|
69
|
+
'outline-variant': '#42474e',
|
|
70
|
+
error: '#ffb4ab',
|
|
71
|
+
'on-error': '#690005',
|
|
72
|
+
warning: '#ffb86e',
|
|
73
|
+
'on-warning': '#492900',
|
|
74
|
+
info: '#b1c5ff',
|
|
75
|
+
'on-info': '#002c72',
|
|
76
|
+
success: '#61dd9a',
|
|
77
|
+
'on-success': '#003920',
|
|
78
|
+
shadow: '#000000',
|
|
79
|
+
highlighter: '#51510d'
|
|
80
|
+
},
|
|
81
|
+
variables: {
|
|
82
|
+
'outline-opacity': 0.14,
|
|
83
|
+
'base-shadow-opacity': 0.14,
|
|
84
|
+
'base-font': '#f5f5f5'
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
export function configureOptions(options) {
|
|
89
|
+
if (!options) {
|
|
90
|
+
return {
|
|
91
|
+
scheme: ThemeScheme.light,
|
|
92
|
+
theme: ['light', 'dark'],
|
|
93
|
+
themes: {
|
|
94
|
+
...mergeDeep(defaultThemesValues)
|
|
95
|
+
},
|
|
96
|
+
palette: {
|
|
97
|
+
...mergeDeep(defaultPalette)
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
return {
|
|
102
|
+
scheme: schemes.includes(options.scheme) ? options.scheme : ThemeScheme.light,
|
|
103
|
+
theme: options.theme ?? ['light', 'dark'],
|
|
104
|
+
themes: {
|
|
105
|
+
...mergeDeep(defaultThemesValues, options.themes)
|
|
106
|
+
},
|
|
107
|
+
palette: {
|
|
108
|
+
...mergeDeep(defaultPalette, options.palette)
|
|
109
|
+
},
|
|
110
|
+
separation: options?.separation
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
//# sourceMappingURL=setting.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setting.js","names":["mergeDeep","ThemeScheme","light","dark","schemes","defaultTonalLuminance","defaultPalette","scaleMethod","colors","primary","secondary","tertiary","neutral","positive","negative","warning","info","defaultThemesValues","isDark","background","surface","outline","error","success","shadow","highlighter","variables","configureOptions","options","scheme","theme","themes","palette","includes","separation"],"sources":["../../../src/composables/theme/setting.ts"],"sourcesContent":["import { mergeDeep } from '@/util/common';\n\nimport type { PaletteOption, ThemeOptions } from './types';\n\nexport const ThemeScheme = {\n light: 'light',\n dark: 'dark',\n} as const;\n\nexport const schemes = ['light', 'dark', 'auto'] as const;\n\nexport const defaultTonalLuminance = [\n 0, 10, 20, 25, 30, 35, 40, 50, 60, 70, 80, 90, 95, 98, 99, 100,\n];\n\nexport const defaultPalette: PaletteOption = {\n scaleMethod: 'tonal',\n colors: {\n primary: '#0062a1',\n secondary: '#6251a6',\n tertiary: '#3c691b',\n neutral: '#5d5e61',\n positive: '#009d61',\n negative: '#ba1a1a',\n warning: '#f69400',\n info: '#0d62e6',\n },\n};\n\nexport const defaultThemesValues: any = {\n light: {\n isDark: false,\n colors: {\n primary: '#0062a1',\n secondary: '#6251a6',\n tertiary: '#3c691b',\n background: '#fdfbff',\n 'on-background': '#1a1c1e',\n surface: '#fdfbff',\n 'on-surface': '#1a1c1e',\n 'surface-variant': '#dfe3eb',\n 'on-surface-variant': '#42474e',\n outline: '#73777f',\n 'outline-variant': '#c2c7cf',\n error: '#ba1a1a',\n 'on-error': '#ffffff',\n warning: '#8a5100',\n 'on-warning': '#ffffff',\n info: '#0056d0',\n 'on-info': '#ffffff',\n success: '#006d42',\n 'on-success': '#ffffff',\n shadow: '#000000',\n highlighter: '#ffff00',\n },\n variables: {\n 'outline-opacity': 0.14,\n 'base-shadow-opacity': 0.14,\n 'base-font': '#141414',\n },\n },\n dark: {\n isDark: true,\n colors: {\n primary: '#9ccaff',\n 'on-primary': '#003257',\n secondary: '#cbbeff',\n 'on-secondary': '#332074',\n tertiary: '#a1d57a',\n 'on-tertiary': '#173800',\n background: '#1a1c1e',\n 'on-background': '#e2e2e6',\n surface: '#1a1c1e',\n 'on-surface': '#e2e2e6',\n 'surface-variant': '#42474e',\n 'on-surface-variant': '#c2c7cf',\n outline: '#8c9199',\n 'outline-variant': '#42474e',\n error: '#ffb4ab',\n 'on-error': '#690005',\n warning: '#ffb86e',\n 'on-warning': '#492900',\n info: '#b1c5ff',\n 'on-info': '#002c72',\n success: '#61dd9a',\n 'on-success': '#003920',\n shadow: '#000000',\n highlighter: '#51510d',\n },\n variables: {\n 'outline-opacity': 0.14,\n 'base-shadow-opacity': 0.14,\n 'base-font': '#f5f5f5',\n },\n },\n};\n\nexport function configureOptions(options?: ThemeOptions): any {\n if (!options) {\n return {\n scheme: ThemeScheme.light,\n theme: ['light', 'dark'],\n themes: { ...mergeDeep(defaultThemesValues) },\n palette: { ...mergeDeep(defaultPalette) },\n };\n }\n return {\n scheme: schemes.includes(options.scheme)\n ? options.scheme\n : ThemeScheme.light,\n theme: options.theme ?? ['light', 'dark'],\n themes: { ...mergeDeep(defaultThemesValues, options.themes) },\n palette: { ...mergeDeep(defaultPalette, options.palette) },\n separation: options?.separation,\n };\n}\n"],"mappings":"SAASA,SAAS;AAIlB,OAAO,MAAMC,WAAW,GAAG;EACzBC,KAAK,EAAE,OAAO;EACdC,IAAI,EAAE;AACR,CAAU;AAEV,OAAO,MAAMC,OAAO,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAU;AAEzD,OAAO,MAAMC,q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W,CAACC,KAAK;IACrB4B,KAAK,EAAEF,OAAO,CAACE,KAAK,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC;IACzCC,MAAM,EAAE;MAAE,GAAG/B,SAAS,CAACiB,mBAAmB,EAAEW,OAAO,CAACG,MAAM;IAAE,CAAC;IAC7DC,OAAO,EAAE;MAAE,GAAGhC,SAAS,CAACM,cAAc,EAAEsB,OAAO,CAACI,OAAO;IAAE,CAAC;IAC1DE,UAAU,EAAEN,OAAO,EAAEM;EACvB,CAAC;AACH"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../../src/composables/theme/types.ts"],"sourcesContent":["export interface ThemeOptions {\r\n scheme: 'light' | 'dark' | 'auto';\r\n theme: [string, string?];\r\n themes: Record<string, ThemeDefinition>;\r\n palette?: PaletteOption;\r\n cspNonce?: string;\r\n separation?: string;\r\n}\r\n\r\nexport interface PaletteOption {\r\n scaleMethod: 'manual' | 'luma' | 'tonal';\r\n colors: Record<string, string | PaletteLevelColorOption | PaletteLumaColorOption>;\r\n defaultLamaScale?: {\r\n darken?: 0 | 1 | 2 | 3 | 4;\r\n lighten?: 0 | 1 | 2 | 3 | 4 | 5;\r\n }\r\n}\r\n\r\ntype ScaleLevel = number;\r\nexport type PaletteLevelColorOption = Record<ScaleLevel, string>\r\n\r\nexport type PaletteLumaColorOption = {\r\n value: string,\r\n darken?: 0 | 1 | 2 | 3 | 4;\r\n lighten?: 0 | 1 | 2 | 3 | 4 | 5;\r\n}\r\n\r\nexport interface ThemeDefinition {\r\n isDark: boolean;\r\n colors: Record<string, string>;\r\n variables: Record<string, string>;\r\n}\r\n"],"mappings":""}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { computed, ref, unref, watch } from 'vue';
|
|
2
|
+
export function useLazy(eager, updated) {
|
|
3
|
+
const tick = ref(false);
|
|
4
|
+
const tack = ref();
|
|
5
|
+
tack.value = updated.value;
|
|
6
|
+
const lazyValue = computed(() => {
|
|
7
|
+
if (eager.value) return updated.value;
|
|
8
|
+
return tack.value;
|
|
9
|
+
});
|
|
10
|
+
watch(updated, () => {
|
|
11
|
+
if (!tick.value) {
|
|
12
|
+
tack.value = updated.value;
|
|
13
|
+
}
|
|
14
|
+
if (!eager.value) {
|
|
15
|
+
tick.value = true;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
function onAfterUpdate() {
|
|
19
|
+
tack.value = updated.value;
|
|
20
|
+
if (!eager.value) {
|
|
21
|
+
tick.value = false;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return {
|
|
25
|
+
entered: tick,
|
|
26
|
+
lazyValue,
|
|
27
|
+
onAfterUpdate
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
export function useTimer(cb, duration, options) {
|
|
31
|
+
const {
|
|
32
|
+
tickDuration
|
|
33
|
+
} = options ?? {};
|
|
34
|
+
let tickInterval = tickDuration ?? 100;
|
|
35
|
+
let timer = -1;
|
|
36
|
+
const tickStart = ref(0);
|
|
37
|
+
const drift = ref(unref(duration));
|
|
38
|
+
const isWork = ref(false);
|
|
39
|
+
function tick() {
|
|
40
|
+
const now = Date.now();
|
|
41
|
+
const realTick = now - tickStart.value;
|
|
42
|
+
drift.value = drift.value - realTick;
|
|
43
|
+
if (drift.value < 1) {
|
|
44
|
+
cb();
|
|
45
|
+
} else {
|
|
46
|
+
const tickDrift = now - tickStart.value + tickInterval;
|
|
47
|
+
const nextInterval = tickDrift >= 1 ? tickDrift : tickInterval;
|
|
48
|
+
tickStart.value = now;
|
|
49
|
+
timer = window.setTimeout(tick, nextInterval);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
function start() {
|
|
53
|
+
if (isWork.value) return;
|
|
54
|
+
isWork.value = true;
|
|
55
|
+
tickStart.value = Date.now();
|
|
56
|
+
timer = window.setTimeout(tick, tickInterval);
|
|
57
|
+
}
|
|
58
|
+
function stop() {
|
|
59
|
+
window.clearTimeout(timer);
|
|
60
|
+
timer = -1;
|
|
61
|
+
isWork.value = false;
|
|
62
|
+
}
|
|
63
|
+
function reset() {
|
|
64
|
+
stop();
|
|
65
|
+
drift.value = unref(duration);
|
|
66
|
+
}
|
|
67
|
+
return {
|
|
68
|
+
start,
|
|
69
|
+
stop,
|
|
70
|
+
reset,
|
|
71
|
+
drift,
|
|
72
|
+
isWork
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
export function useDelay(props, callback) {
|
|
76
|
+
const state = {};
|
|
77
|
+
function clearDelay(propKey) {
|
|
78
|
+
state[propKey] && window.clearTimeout(state[propKey]);
|
|
79
|
+
delete state[propKey];
|
|
80
|
+
}
|
|
81
|
+
function setDelay(propKey, timeout, resolve) {
|
|
82
|
+
state[propKey] = window.setTimeout(() => {
|
|
83
|
+
const active = propKey === 'openDelay';
|
|
84
|
+
callback?.(active);
|
|
85
|
+
resolve(active);
|
|
86
|
+
}, timeout);
|
|
87
|
+
}
|
|
88
|
+
const generateDelay = propKey => () => {
|
|
89
|
+
clearDelay('openDelay');
|
|
90
|
+
clearDelay('closeDelay');
|
|
91
|
+
const delayTime = props[propKey] ?? 0;
|
|
92
|
+
return new Promise(resolve => {
|
|
93
|
+
const delay = parseInt(String(delayTime), 10);
|
|
94
|
+
setDelay(propKey, delay, resolve);
|
|
95
|
+
});
|
|
96
|
+
};
|
|
97
|
+
return {
|
|
98
|
+
startOpenDelay: generateDelay('openDelay'),
|
|
99
|
+
startCloseDelay: generateDelay('closeDelay')
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
//# sourceMappingURL=timing.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timing.js","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';\r\n\r\nexport function useLazy(eager: Ref<boolean | undefined>, updated: Ref<any>) {\r\n const tick = ref(false);\r\n const tack = ref();\r\n tack.value = updated.value;\r\n const lazyValue = computed(() => {\r\n if (eager.value) return updated.value;\r\n return tack.value;\r\n });\r\n watch(updated, () => {\r\n if (!tick.value) {\r\n tack.value = updated.value;\r\n }\r\n if (!eager.value) {\r\n tick.value = true;\r\n }\r\n });\r\n function onAfterUpdate() {\r\n tack.value = updated.value;\r\n if (!eager.value) {\r\n tick.value = false;\r\n }\r\n }\r\n return {\r\n entered: tick,\r\n lazyValue,\r\n onAfterUpdate,\r\n };\r\n}\r\n\r\nexport function useTimer(\r\n cb: () => void,\r\n duration: MaybeRef<number>,\r\n options?: { tickDuration: number },\r\n) {\r\n const { tickDuration } = options ?? {};\r\n let tickInterval = tickDuration ?? 100;\r\n let timer = -1;\r\n\r\n const tickStart = ref(0);\r\n const drift = ref(unref(duration));\r\n const isWork = ref(false);\r\n\r\n function tick() {\r\n const now = Date.now();\r\n const realTick = now - tickStart.value;\r\n drift.value = drift.value - realTick;\r\n if (drift.value < 1) {\r\n cb();\r\n } else {\r\n const tickDrift = now - tickStart.value + tickInterval;\r\n const nextInterval = tickDrift >= 1 ? tickDrift : tickInterval;\r\n tickStart.value = now;\r\n timer = window.setTimeout(tick, nextInterval);\r\n }\r\n }\r\n\r\n function start() {\r\n if (isWork.value) return;\r\n isWork.value = true;\r\n tickStart.value = Date.now();\r\n timer = window.setTimeout(tick, tickInterval);\r\n }\r\n\r\n function stop() {\r\n window.clearTimeout(timer);\r\n timer = -1;\r\n isWork.value = false;\r\n }\r\n\r\n function reset() {\r\n stop();\r\n drift.value = unref(duration);\r\n }\r\n\r\n return {\r\n start,\r\n stop,\r\n reset,\r\n drift,\r\n isWork,\r\n };\r\n}\r\n\r\ntype DelayType = 'closeDelay' | 'openDelay';\r\n\r\nexport function useDelay(props: any, callback?: (active: boolean) => void) {\r\n const state: Partial<Record<DelayType, number>> = {};\r\n\r\n function clearDelay(propKey: DelayType) {\r\n state[propKey] && window.clearTimeout(state[propKey]);\r\n delete state[propKey];\r\n }\r\n\r\n function setDelay(propKey: DelayType, timeout: number, resolve: any) {\r\n state[propKey] = window.setTimeout(() => {\r\n const active = propKey === 'openDelay';\r\n callback?.(active);\r\n resolve(active);\r\n }, timeout);\r\n }\r\n\r\n const generateDelay = (propKey: DelayType) => () => {\r\n clearDelay('openDelay');\r\n clearDelay('closeDelay');\r\n const delayTime = props[propKey] ?? 0;\r\n return new Promise<boolean>((resolve) => {\r\n const delay = parseInt(String(delayTime), 10);\r\n setDelay(propKey, delay, resolve);\r\n });\r\n };\r\n\r\n return {\r\n startOpenDelay: generateDelay('openDelay'),\r\n startCloseDelay: generateDelay('closeDelay'),\r\n };\r\n}\r\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,CAAC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OAAkB,IAAK,MAAM;IAClDD,UAAU,CAAC,WAAW,CAAC;IACvBA,UAAU,CAAC,YAAY,CAAC;IACxB,MAAMO,SAAS,GAAGV,KAAK,CAACI,OAAO,CAAC,IAAI,CAAC;IACrC,OAAO,IAAIO,OAAO,CAAWJ,OAAO,IAAK;MACvC,MAAMK,KAAK,GAAGC,QAAQ,CAACC,MAAM,CAACJ,SAAS,CAAC,EAAE,EAAE,CAAC;MAC7CL,QAAQ,CAACD,OAAO,EAAEQ,KAAK,EAAEL,OAAO,CAAC;IACnC,CAAC,CAAC;EACJ,CAAC;EAED,OAAO;IACLQ,cAAc,EAAEN,aAAa,CAAC,WAAW,CAAC;IAC1CO,eAAe,EAAEP,aAAa,CAAC,YAAY;EAC7C,CAAC;AACH"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { Transition, computed, h } from 'vue';
|
|
2
|
+
import { propsFactory } from "../util/component/props.js";
|
|
3
|
+
export const pressPolyTransitionPropsOptions = propsFactory({
|
|
4
|
+
transition: {
|
|
5
|
+
type: [String, Object],
|
|
6
|
+
default: 'slide-fade'
|
|
7
|
+
}
|
|
8
|
+
}, 'PolyTransition');
|
|
9
|
+
export function usePolyTransition(props) {
|
|
10
|
+
const polyTransitionBindProps = computed(() => {
|
|
11
|
+
const {
|
|
12
|
+
is,
|
|
13
|
+
...transitionProps
|
|
14
|
+
} = typeof props.transition === 'object' ? props.transition : {
|
|
15
|
+
is: props.transition,
|
|
16
|
+
name: props.transition
|
|
17
|
+
};
|
|
18
|
+
return {
|
|
19
|
+
is,
|
|
20
|
+
transitionProps
|
|
21
|
+
};
|
|
22
|
+
});
|
|
23
|
+
return {
|
|
24
|
+
polyTransitionBindProps
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
export const PolyTransition = (props, _ref) => {
|
|
28
|
+
let {
|
|
29
|
+
slots
|
|
30
|
+
} = _ref;
|
|
31
|
+
const {
|
|
32
|
+
is,
|
|
33
|
+
transitionProps,
|
|
34
|
+
...forcedProps
|
|
35
|
+
} = props;
|
|
36
|
+
const {
|
|
37
|
+
component = Transition,
|
|
38
|
+
...rest
|
|
39
|
+
} = typeof is === 'object' ? {
|
|
40
|
+
component: is,
|
|
41
|
+
...transitionProps
|
|
42
|
+
} : {
|
|
43
|
+
name: is
|
|
44
|
+
};
|
|
45
|
+
return h(component, {
|
|
46
|
+
...rest,
|
|
47
|
+
...transitionProps,
|
|
48
|
+
...forcedProps
|
|
49
|
+
}, slots);
|
|
50
|
+
};
|
|
51
|
+
//# sourceMappingURL=transition.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transition.js","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 {\r\n type Component,\r\n type FunctionalComponent,\r\n type PropType,\r\n Transition,\r\n type TransitionProps,\r\n computed,\r\n h,\r\n} from 'vue';\r\n\r\nimport { propsFactory } from '@/util/component/props';\r\n\r\nexport const pressPolyTransitionPropsOptions = propsFactory(\r\n {\r\n transition: {\r\n type: [String, Object] as PropType<\r\n string | (TransitionProps & { is?: Component })\r\n >,\r\n default: 'slide-fade',\r\n },\r\n },\r\n 'PolyTransition',\r\n);\r\n\r\nexport function usePolyTransition(props: { transition: any }) {\r\n const polyTransitionBindProps = computed(() => {\r\n const { is, ...transitionProps } =\r\n typeof props.transition === 'object'\r\n ? props.transition\r\n : { is: props.transition, name: props.transition };\r\n return {\r\n is,\r\n transitionProps,\r\n };\r\n });\r\n\r\n return {\r\n polyTransitionBindProps,\r\n };\r\n}\r\n\r\nexport const PolyTransition: FunctionalComponent<\r\n TransitionProps & { is: string | Component; transitionProps: TransitionProps }\r\n> = (props, { slots }) => {\r\n const { is, transitionProps, ...forcedProps } = props;\r\n const { component = Transition, ...rest } =\r\n typeof is === 'object'\r\n ? { component: is, ...transitionProps }\r\n : { name: is };\r\n return h(component, { ...rest, ...transitionProps, ...forcedProps }, slots);\r\n};\r\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"}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { computed, getCurrentInstance, onBeforeMount, ref, watch } from 'vue';
|
|
2
|
+
import { getUid, propsFactory } from "../util/component/index.js";
|
|
3
|
+
import { useModelDuplex } from "./communication.js";
|
|
4
|
+
import { useForm } from "./form.js";
|
|
5
|
+
import { useToggleScope } from "./scope.js";
|
|
6
|
+
export const pressValidationPropsOptions = propsFactory({
|
|
7
|
+
readonly: Boolean,
|
|
8
|
+
disabled: Boolean,
|
|
9
|
+
status: {
|
|
10
|
+
type: String,
|
|
11
|
+
validator(value) {
|
|
12
|
+
return ['success', 'warning', 'error'].includes(value);
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
helperText: String,
|
|
16
|
+
validators: Array,
|
|
17
|
+
validateOn: {
|
|
18
|
+
type: String
|
|
19
|
+
},
|
|
20
|
+
validationValue: null,
|
|
21
|
+
maxErrors: {
|
|
22
|
+
type: [Number, String],
|
|
23
|
+
default: 1
|
|
24
|
+
}
|
|
25
|
+
}, 'validation');
|
|
26
|
+
export function useValidation(props, name) {
|
|
27
|
+
let uid = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : getUid();
|
|
28
|
+
const cid = computed(() => props.name ?? uid);
|
|
29
|
+
const model = useModelDuplex(props, 'modelValue');
|
|
30
|
+
const validationModel = computed(() => props.validationValue === undefined ? model.value : props.validationValue);
|
|
31
|
+
const vm = getCurrentInstance();
|
|
32
|
+
const form = useForm();
|
|
33
|
+
const validating = ref(false);
|
|
34
|
+
const validateOn = computed(() => {
|
|
35
|
+
let value = props.validateOn || 'input';
|
|
36
|
+
if (value === 'lazy') value = 'input,lazy';
|
|
37
|
+
const onSet = new Set(value?.split(',') ?? []);
|
|
38
|
+
return {
|
|
39
|
+
blur: onSet.has('blur') || onSet.has('input'),
|
|
40
|
+
input: onSet.has('input'),
|
|
41
|
+
lazy: onSet.has('lazy'),
|
|
42
|
+
submit: onSet.has('submit')
|
|
43
|
+
};
|
|
44
|
+
});
|
|
45
|
+
const errorResult = ref();
|
|
46
|
+
const errors = ref([]);
|
|
47
|
+
const isReadonly = computed(() => props.readonly ?? form?.isReadonly.value);
|
|
48
|
+
const isDisabled = computed(() => props.disabled ?? form?.isDisabled.value);
|
|
49
|
+
const isLoading = computed(() => props.loading ?? form?.isLoading.value);
|
|
50
|
+
const isError = computed(() => {
|
|
51
|
+
return props.status === 'error' || errors.value.length > 0;
|
|
52
|
+
});
|
|
53
|
+
const isSuccess = computed(() => {
|
|
54
|
+
return !isError.value && props.status === 'success';
|
|
55
|
+
});
|
|
56
|
+
useToggleScope(() => validateOn.value.input, () => {
|
|
57
|
+
watch(validationModel, () => {
|
|
58
|
+
if (validationModel.value != null) {
|
|
59
|
+
invokeValidators();
|
|
60
|
+
} else if (props.focused) {
|
|
61
|
+
const unwatch = watch(() => props.focused, val => {
|
|
62
|
+
if (!val) invokeValidators();
|
|
63
|
+
unwatch();
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
async function invokeValidators() {
|
|
69
|
+
const results = [];
|
|
70
|
+
validating.value = true;
|
|
71
|
+
if (Array.isArray(props.validators)) {
|
|
72
|
+
for (const validator of props.validators) {
|
|
73
|
+
if (results.length >= +(props.maxErrors ?? 1)) {
|
|
74
|
+
break;
|
|
75
|
+
}
|
|
76
|
+
const handler = typeof validator === 'function' ? validator : () => validator;
|
|
77
|
+
const result = await handler(validationModel.value);
|
|
78
|
+
if (result === true) {
|
|
79
|
+
continue;
|
|
80
|
+
}
|
|
81
|
+
if (result !== false && typeof result !== 'string') {
|
|
82
|
+
console.warn('Wrong validator return type');
|
|
83
|
+
continue;
|
|
84
|
+
}
|
|
85
|
+
results.push(result || '');
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
validating.value = false;
|
|
89
|
+
errors.value = results;
|
|
90
|
+
errorResult.value = results?.[0];
|
|
91
|
+
return results;
|
|
92
|
+
}
|
|
93
|
+
function resetError() {
|
|
94
|
+
errors.value = [];
|
|
95
|
+
errorResult.value = undefined;
|
|
96
|
+
}
|
|
97
|
+
async function resetValidation() {
|
|
98
|
+
if (!validateOn.value.lazy) {
|
|
99
|
+
await invokeValidators();
|
|
100
|
+
} else {
|
|
101
|
+
resetError();
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
onBeforeMount(() => {
|
|
105
|
+
form?.register({
|
|
106
|
+
id: cid.value,
|
|
107
|
+
vnode: vm.vnode,
|
|
108
|
+
resetValidation,
|
|
109
|
+
validate: invokeValidators
|
|
110
|
+
});
|
|
111
|
+
});
|
|
112
|
+
return {
|
|
113
|
+
invokeValidators,
|
|
114
|
+
resetError,
|
|
115
|
+
validating,
|
|
116
|
+
validateOn,
|
|
117
|
+
errorResult,
|
|
118
|
+
errors,
|
|
119
|
+
isReadonly,
|
|
120
|
+
isDisabled,
|
|
121
|
+
isLoading,
|
|
122
|
+
isError,
|
|
123
|
+
isSuccess
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
//# sourceMappingURL=validation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation.js","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 {\r\n type PropType,\r\n computed,\r\n getCurrentInstance,\r\n onBeforeMount,\r\n ref,\r\n watch,\r\n} from 'vue';\r\n\r\nimport { getUid, propsFactory } from '@/util/component';\r\n\r\nimport { useModelDuplex } from './communication';\r\nimport { useForm } from './form';\r\nimport { useToggleScope } from './scope';\r\n\r\nexport interface ValidationProps {\r\n validateOn: 'input' | 'blur' | 'lazy' | 'submit' | string;\r\n}\r\n\r\nexport const pressValidationPropsOptions = propsFactory(\r\n {\r\n readonly: Boolean as PropType<boolean>,\r\n disabled: Boolean as PropType<boolean>,\r\n status: {\r\n type: String as PropType<'success' | 'warning' | 'error' | undefined>,\r\n validator(value: string) {\r\n return ['success', 'warning', 'error'].includes(value);\r\n },\r\n },\r\n helperText: String,\r\n validators: Array as PropType<((v: any) => boolean | string)[] | string[]>,\r\n validateOn: {\r\n type: String as PropType<ValidationProps['validateOn']>,\r\n },\r\n validationValue: null,\r\n maxErrors: {\r\n type: [Number, String] as PropType<number | string>,\r\n default: 1,\r\n },\r\n },\r\n 'validation',\r\n);\r\n\r\nexport function useValidation(props: any, name: string, uid = getUid()) {\r\n const cid = computed(() => props.name ?? uid);\r\n const model = useModelDuplex(props, 'modelValue');\r\n const validationModel = computed(() =>\r\n props.validationValue === undefined ? model.value : props.validationValue,\r\n );\r\n const vm = getCurrentInstance()!;\r\n const form = useForm();\r\n const validating = ref(false);\r\n const validateOn = computed(() => {\r\n let value = props.validateOn || 'input';\r\n if (value === 'lazy') value = 'input,lazy';\r\n const onSet = new Set(value?.split(',') ?? []);\r\n\r\n return {\r\n blur: onSet.has('blur') || onSet.has('input'),\r\n input: onSet.has('input'),\r\n lazy: onSet.has('lazy'),\r\n submit: onSet.has('submit'),\r\n };\r\n });\r\n\r\n const errorResult = ref();\r\n const errors = ref<any[]>([]);\r\n\r\n const isReadonly = computed(() => props.readonly ?? form?.isReadonly.value);\r\n\r\n const isDisabled = computed(() => props.disabled ?? form?.isDisabled.value);\r\n\r\n const isLoading = computed(() => props.loading ?? form?.isLoading.value);\r\n\r\n const isError = computed(() => {\r\n return props.status === 'error' || errors.value.length > 0;\r\n });\r\n\r\n const isSuccess = computed(() => {\r\n return !isError.value && props.status === 'success';\r\n });\r\n\r\n useToggleScope(\r\n () => validateOn.value.input,\r\n () => {\r\n watch(validationModel, () => {\r\n if (validationModel.value != null) {\r\n invokeValidators();\r\n } else if (props.focused) {\r\n const unwatch = watch(\r\n () => props.focused,\r\n (val) => {\r\n if (!val) invokeValidators();\r\n\r\n unwatch();\r\n },\r\n );\r\n }\r\n });\r\n },\r\n );\r\n\r\n async function invokeValidators() {\r\n const results: any[] = [];\r\n validating.value = true;\r\n\r\n if (Array.isArray(props.validators)) {\r\n for (const validator of props.validators) {\r\n if (results.length >= +(props.maxErrors ?? 1)) {\r\n break;\r\n }\r\n\r\n const handler =\r\n typeof validator === 'function' ? validator : () => validator;\r\n const result = await handler(validationModel.value);\r\n\r\n if (result === true) {\r\n continue;\r\n }\r\n\r\n if (result !== false && typeof result !== 'string') {\r\n console.warn('Wrong validator return type');\r\n continue;\r\n }\r\n results.push(result || '');\r\n }\r\n }\r\n validating.value = false;\r\n errors.value = results;\r\n errorResult.value = results?.[0];\r\n\r\n return results;\r\n }\r\n\r\n function resetError() {\r\n errors.value = [];\r\n errorResult.value = undefined;\r\n }\r\n\r\n async function resetValidation() {\r\n if (!validateOn.value.lazy) {\r\n await invokeValidators();\r\n } else {\r\n resetError();\r\n }\r\n }\r\n\r\n onBeforeMount(() => {\r\n form?.register({\r\n id: cid.value,\r\n vnode: vm.vnode,\r\n resetValidation,\r\n validate: invokeValidators,\r\n });\r\n });\r\n\r\n return {\r\n invokeValidators,\r\n resetError,\r\n validating,\r\n validateOn,\r\n errorResult,\r\n errors,\r\n isReadonly,\r\n isDisabled,\r\n isLoading,\r\n isError,\r\n isSuccess,\r\n };\r\n}\r\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,YA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C,MAAM,CAAChC,KAAK,GAAG2C,OAAO;IACtBZ,WAAW,CAAC/B,KAAK,GAAG2C,OAAO,GAAG,CAAC,CAAC;IAEhC,OAAOA,OAAO;EAChB;EAEA,SAASO,UAAUA,CAAA,EAAG;IACpBlB,MAAM,CAAChC,KAAK,GAAG,EAAE;IACjB+B,WAAW,CAAC/B,KAAK,GAAGgB,SAAS;EAC/B;EAEA,eAAemC,eAAeA,CAAA,EAAG;IAC/B,IAAI,CAAC9C,UAAU,CAACL,KAAK,CAAC6B,IAAI,EAAE;MAC1B,MAAMU,gBAAgB,CAAC,CAAC;IAC1B,CAAC,MAAM;MACLW,UAAU,CAAC,CAAC;IACd;EACF;EAEAlE,aAAa,CAAC,MAAM;IAClBqC,IAAI,EAAE+B,QAAQ,CAAC;MACbC,EAAE,EAAEpC,GAAG,CAACjB,KAAK;MACbsD,KAAK,EAAElC,EAAE,CAACkC,KAAK;MACfH,eAAe;MACfI,QAAQ,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"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { computed, resolveDynamicComponent, toRef } from 'vue';
|
|
2
|
+
import { hasEventProp, propsFactory } from "../util/component/index.js";
|
|
3
|
+
export const pressVueRouterPropsOptions = propsFactory({
|
|
4
|
+
href: String,
|
|
5
|
+
replace: Boolean,
|
|
6
|
+
to: [String, Object],
|
|
7
|
+
exact: Boolean
|
|
8
|
+
}, 'VueRouter');
|
|
9
|
+
export function useLink(props, attrs) {
|
|
10
|
+
const RouterLink = resolveDynamicComponent('RouterLink');
|
|
11
|
+
const isLink = computed(() => !!(props.href || props.to));
|
|
12
|
+
const isClickable = computed(() => {
|
|
13
|
+
return isLink?.value || hasEventProp(attrs, 'click') || hasEventProp(props, 'click');
|
|
14
|
+
});
|
|
15
|
+
if (typeof RouterLink === 'string') {
|
|
16
|
+
return {
|
|
17
|
+
isLink,
|
|
18
|
+
isClickable,
|
|
19
|
+
href: toRef(props, 'href')
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
const link = props.to ? RouterLink.useLink(props) : undefined;
|
|
23
|
+
return {
|
|
24
|
+
isLink,
|
|
25
|
+
isClickable,
|
|
26
|
+
route: link?.route,
|
|
27
|
+
navigate: link?.navigate,
|
|
28
|
+
isActive: link && computed(() => props.exact ? link.isExactActive?.value : link.isActive?.value),
|
|
29
|
+
href: computed(() => props.to ? link?.route.value.href : props.href)
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=vue-router.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vue-router.js","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';\r\nimport { computed, resolveDynamicComponent, toRef } from 'vue';\r\nimport type {\r\n RouteLocationRaw,\r\n UseLinkOptions,\r\n RouterLink as VueRouterLink,\r\n} from 'vue-router';\r\nimport { useLink as _useLink } from 'vue-router';\r\n\r\nimport { type EventProp, hasEventProp, propsFactory } from '@/util/component';\r\n\r\nexport interface LinkProps {\r\n href: string | undefined;\r\n replace: boolean | undefined;\r\n to: RouteLocationRaw | undefined;\r\n exact: boolean | undefined;\r\n}\r\n\r\nexport interface LinkListeners {\r\n onClick?: EventProp | undefined;\r\n onClickOnce?: EventProp | undefined;\r\n}\r\n\r\nexport const pressVueRouterPropsOptions = propsFactory(\r\n {\r\n href: String,\r\n replace: Boolean,\r\n to: [String, Object] as PropType<RouteLocationRaw>,\r\n exact: Boolean,\r\n },\r\n 'VueRouter',\r\n);\r\n\r\nexport interface UseLink\r\n extends Omit<Partial<ReturnType<typeof _useLink>>, 'href'> {\r\n isLink: ComputedRef<boolean>;\r\n isClickable: ComputedRef<boolean>;\r\n href: Ref<string | undefined>;\r\n}\r\n\r\nexport function useLink(\r\n props: LinkProps & LinkListeners,\r\n attrs: SetupContext['attrs'],\r\n): UseLink {\r\n const RouterLink = resolveDynamicComponent('RouterLink') as\r\n | typeof VueRouterLink\r\n | string;\r\n\r\n const isLink = computed(() => !!(props.href || props.to));\r\n const isClickable = computed(() => {\r\n return (\r\n isLink?.value ||\r\n hasEventProp(attrs, 'click') ||\r\n hasEventProp(props, 'click')\r\n );\r\n });\r\n if (typeof RouterLink === 'string') {\r\n return {\r\n isLink,\r\n isClickable,\r\n href: toRef(props, 'href'),\r\n };\r\n }\r\n const link = props.to\r\n ? RouterLink.useLink(props as UseLinkOptions)\r\n : undefined;\r\n return {\r\n isLink,\r\n isClickable,\r\n route: link?.route,\r\n navigate: link?.navigate,\r\n isActive:\r\n link &&\r\n computed(() =>\r\n props.exact ? link.isExactActive?.value : link.isActive?.value,\r\n ),\r\n href: computed(() => (props.to ? link?.route.value.href : props.href)),\r\n };\r\n}\r\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,EAAEH;AACT,CAAC,EACD,WACF,CAAC;AASD,OAAO,SAASI,OAAOA,CACrBC,KAAgC,EAChCC,KAA4B,EACnB;EACT,MAAMC,UAAU,GAAGf,uBAAuB,CAAC,YAAY,CAE7C;EAEV,MAAMgB,MAAM,GAAGjB,QAAQ,CAAC,MAAM,CAAC,EAAEc,KAAK,CAACR,IAAI,IAAIQ,KAAK,CAACJ,EAAE,CAAC,CAAC;EACzD,MAAMQ,WAAW,GAAGlB,QAAQ,CAAC,MAAM;IACjC,OACEiB,MAAM,EAAEE,KAAK,IACbhB,YAAY,CAACY,KAAK,EAAE,OAAO,CAAC,IAC5BZ,YAAY,CAACW,KAAK,EAAE,OAAO,CAAC;EAEhC,CAAC,CAAC;EACF,IAAI,OAAOE,UAAU,KAAK,QAAQ,EAAE;IAClC,OAAO;MACLC,MAAM;MACNC,WAAW;MACXZ,IAAI,EAAEJ,KAAK,CAACY,KAAK,EAAE,MAAM;IAC3B,CAAC;EACH;EACA,MAAMM,IAAI,GAAGN,KAAK,CAACJ,EAAE,GACjBM,UAAU,CAACH,OAAO,CAACC,KAAuB,CAAC,GAC3CO,SAAS;EACb,OAAO;IACLJ,MAAM;IACNC,WAAW;IACXI,KAAK,EAAEF,IAAI,EAAEE,KAAK;IAClBC,QAAQ,EAAEH,IAAI,EAAEG,QAAQ;IACxBC,QAAQ,EACNJ,IAAI,IACJpB,QAAQ,CAAC,MACPc,KAAK,CAACF,KAAK,GAAGQ,IAAI,CAACK,aAAa,EAAEN,KAAK,GAAGC,IAAI,CAACI,QAAQ,EAAEL,KAC3D,CAAC;IACHb,IAAI,EAAEN,QAAQ,CAAC,MAAOc,KAAK,CAACJ,EAAE,GAAGU,IAAI,EAAEE,KAAK,CAACH,KAAK,CAACb,IAAI,GAAGQ,KAAK,CAACR,IAAK;EACvE,CAAC;AACH"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { documentRoot } from "../../util/dom.js";
|
|
2
|
+
function defaultDetermine() {
|
|
3
|
+
return true;
|
|
4
|
+
}
|
|
5
|
+
function directive(mouseEvent, element, binding) {
|
|
6
|
+
const {
|
|
7
|
+
value
|
|
8
|
+
} = binding;
|
|
9
|
+
const handler = typeof value === 'function' ? value : value.handler;
|
|
10
|
+
element._complementClick.lastMousedownWasOutside && checkEvent(mouseEvent, element, binding) && setTimeout(() => {
|
|
11
|
+
determine(mouseEvent, binding) && handler && handler(mouseEvent);
|
|
12
|
+
}, 0);
|
|
13
|
+
}
|
|
14
|
+
function checkEvent(mouseEvent, element, binding) {
|
|
15
|
+
if (!mouseEvent || determine(mouseEvent, binding) === false) {
|
|
16
|
+
return false;
|
|
17
|
+
}
|
|
18
|
+
const root = documentRoot(element);
|
|
19
|
+
if (typeof ShadowRoot !== 'undefined' && root instanceof ShadowRoot && root.host === mouseEvent.target) {
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
const elements = (typeof binding.value === 'object' && binding.value.include || (() => []))();
|
|
23
|
+
elements.push(element);
|
|
24
|
+
return !elements.some(el => el?.contains(mouseEvent.target));
|
|
25
|
+
}
|
|
26
|
+
function determine(event, binding) {
|
|
27
|
+
const {
|
|
28
|
+
value
|
|
29
|
+
} = binding;
|
|
30
|
+
const determineFn = typeof value === 'object' && value.determine || defaultDetermine;
|
|
31
|
+
return determineFn && determineFn?.(event);
|
|
32
|
+
}
|
|
33
|
+
function implant(element, callback) {
|
|
34
|
+
const root = documentRoot(element);
|
|
35
|
+
callback(document);
|
|
36
|
+
if (typeof ShadowRoot !== 'undefined' && root instanceof ShadowRoot) {
|
|
37
|
+
callback(root);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
export const ComplementClick = {
|
|
41
|
+
mounted(element, binding) {
|
|
42
|
+
const onClick = event => directive(event, element, binding);
|
|
43
|
+
const onMousedown = event => {
|
|
44
|
+
element._complementClick.lastMousedownWasOutside = checkEvent(event, element, binding);
|
|
45
|
+
};
|
|
46
|
+
implant(element, app => {
|
|
47
|
+
app?.addEventListener('click', onClick, true);
|
|
48
|
+
app?.addEventListener('mousedown', onMousedown, true);
|
|
49
|
+
});
|
|
50
|
+
if (!element._complementClick) {
|
|
51
|
+
element._complementClick = {
|
|
52
|
+
lastMousedownWasOutside: true
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
const _uid = binding.instance.$.uid;
|
|
56
|
+
element._complementClick[_uid] = {
|
|
57
|
+
onClick,
|
|
58
|
+
onMousedown
|
|
59
|
+
};
|
|
60
|
+
},
|
|
61
|
+
unmounted(element, binding) {
|
|
62
|
+
if (!element._complementClick) return;
|
|
63
|
+
const _uid = binding.instance.$.uid;
|
|
64
|
+
implant(element, app => {
|
|
65
|
+
const old = element._complementClick?.[_uid];
|
|
66
|
+
if (old) {
|
|
67
|
+
const {
|
|
68
|
+
onClick,
|
|
69
|
+
onMousedown
|
|
70
|
+
} = old;
|
|
71
|
+
app?.removeEventListener('click', onClick, true);
|
|
72
|
+
app?.removeEventListener('mousedown', onMousedown, true);
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
delete element._complementClick[_uid];
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
//# sourceMappingURL=index.js.map
|