yuyeon 0.1.2-rc.2 → 0.2.1-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/style.css +1 -1
- package/dist/yuyeon.js +5152 -6751
- package/dist/yuyeon.umd.cjs +4 -26
- package/lib/abstract/items.mjs +1 -1
- package/lib/abstract/items.mjs.map +1 -1
- package/lib/components/alert/YAlert.mjs +2 -1
- package/lib/components/alert/YAlert.mjs.map +1 -1
- package/lib/components/alert/YAlert.scss +75 -76
- package/lib/components/alert/index.mjs.map +1 -1
- package/lib/components/app/YApp.mjs +3 -2
- package/lib/components/app/YApp.mjs.map +1 -1
- package/lib/components/app/YApp.scss +14 -14
- package/lib/components/app/index.mjs.map +1 -1
- package/lib/components/badge/YBadge.mjs +2 -2
- package/lib/components/badge/YBadge.mjs.map +1 -1
- package/lib/components/badge/YBadge.scss +76 -76
- package/lib/components/badge/index.mjs.map +1 -1
- package/lib/components/bench/YBench.mjs +2 -3
- package/lib/components/bench/YBench.mjs.map +1 -1
- package/lib/components/bench/index.mjs.map +1 -1
- package/lib/components/button/YButton.mjs +2 -2
- package/lib/components/button/YButton.mjs.map +1 -1
- package/lib/components/button/YButton.scss +128 -129
- package/lib/components/button/index.mjs.map +1 -1
- package/lib/components/card/YCard.mjs +3 -2
- package/lib/components/card/YCard.mjs.map +1 -1
- package/lib/components/card/YCard.scss +45 -43
- package/lib/components/card/YCardBody.mjs +2 -1
- package/lib/components/card/YCardBody.mjs.map +1 -1
- package/lib/components/card/YCardFooter.mjs +2 -1
- package/lib/components/card/YCardFooter.mjs.map +1 -1
- package/lib/components/card/YCardHeader.mjs +2 -1
- package/lib/components/card/YCardHeader.mjs.map +1 -1
- package/lib/components/checkbox/YCheckbox.mjs +2 -2
- package/lib/components/checkbox/YCheckbox.mjs.map +1 -1
- package/lib/components/checkbox/YCheckbox.scss +48 -48
- package/lib/components/checkbox/YInputCheckbox.mjs +2 -1
- package/lib/components/checkbox/YInputCheckbox.mjs.map +1 -1
- package/lib/components/checkbox/YInputCheckbox.scss +84 -86
- package/lib/components/checkbox/index.mjs +1 -1
- package/lib/components/checkbox/index.mjs.map +1 -1
- package/lib/components/chip/YChip.mjs +2 -2
- package/lib/components/chip/YChip.mjs.map +1 -1
- package/lib/components/date-picker/YDateCalendar.mjs +3 -3
- package/lib/components/date-picker/YDateCalendar.mjs.map +1 -1
- package/lib/components/date-picker/YDateCalendar.scss +84 -82
- package/lib/components/date-picker/YDatePicker.mjs +2 -2
- package/lib/components/date-picker/YDatePicker.mjs.map +1 -1
- package/lib/components/date-picker/YDatePicker.scss +3 -3
- package/lib/components/date-picker/YDatePickerControl.mjs +2 -2
- package/lib/components/date-picker/YDatePickerControl.mjs.map +1 -1
- package/lib/components/date-picker/YDatePickerControl.scss +35 -35
- package/lib/components/date-picker/YMonthPicker.mjs +3 -3
- package/lib/components/date-picker/YMonthPicker.mjs.map +1 -1
- package/lib/components/date-picker/YMonthPicker.scss +25 -25
- package/lib/components/date-picker/YYearPicker.mjs +4 -3
- package/lib/components/date-picker/YYearPicker.mjs.map +1 -1
- package/lib/components/date-picker/YYearPicker.scss +23 -23
- package/lib/components/date-picker/index.mjs.map +1 -1
- package/lib/components/dialog/YDialog.mjs +3 -3
- package/lib/components/dialog/YDialog.mjs.map +1 -1
- package/lib/components/dialog/YDialog.scss +50 -50
- package/lib/components/dialog/index.mjs.map +1 -1
- package/lib/components/divider/YDivider.mjs +1 -2
- package/lib/components/divider/YDivider.mjs.map +1 -1
- package/lib/components/divider/YDivider.scss +2 -3
- package/lib/components/divider/index.mjs.map +1 -1
- package/lib/components/dropdown/YDropdown.mjs +2 -2
- package/lib/components/dropdown/YDropdown.mjs.map +1 -1
- package/lib/components/dropdown/YDropdown.scss +27 -28
- package/lib/components/dropdown/index.mjs.map +1 -1
- package/lib/components/field-input/YFieldInput.mjs +2 -2
- package/lib/components/field-input/YFieldInput.mjs.map +1 -1
- package/lib/components/field-input/YFieldInput.scss +66 -66
- package/lib/components/field-input/index.mjs.map +1 -1
- package/lib/components/form/YForm.mjs +3 -2
- package/lib/components/form/YForm.mjs.map +1 -1
- package/lib/components/hover/YHover.mjs +2 -2
- package/lib/components/hover/YHover.mjs.map +1 -1
- package/lib/components/hover/index.mjs.map +1 -1
- package/lib/components/icon/YIcon.mjs +4 -3
- package/lib/components/icon/YIcon.mjs.map +1 -1
- package/lib/components/icon/YIcon.scss +18 -18
- package/lib/components/icon/index.mjs.map +1 -1
- package/lib/components/icons/YIconCheckbox.mjs +1 -1
- package/lib/components/icons/YIconCheckbox.mjs.map +1 -1
- package/lib/components/icons/YIconCheckbox.scss +60 -60
- package/lib/components/icons/YIconClear.mjs +1 -1
- package/lib/components/icons/YIconClear.mjs.map +1 -1
- package/lib/components/icons/YIconDropdown.mjs +1 -1
- package/lib/components/icons/YIconDropdown.mjs.map +1 -1
- package/lib/components/icons/YIconExpand.mjs +1 -1
- package/lib/components/icons/YIconExpand.mjs.map +1 -1
- package/lib/components/icons/YIconPageControl.mjs +1 -1
- package/lib/components/icons/YIconPageControl.mjs.map +1 -1
- package/lib/components/icons/YIconSort.mjs +1 -1
- package/lib/components/icons/YIconSort.mjs.map +1 -1
- package/lib/components/icons/YIconSort.scss +24 -23
- package/lib/components/icons/index.mjs +1 -1
- package/lib/components/icons/index.mjs.map +1 -1
- package/lib/components/img/YImg.mjs +2 -3
- package/lib/components/img/YImg.mjs.map +1 -1
- package/lib/components/input/YInput.mjs +3 -4
- package/lib/components/input/YInput.mjs.map +1 -1
- package/lib/components/input/YInput.scss +258 -254
- package/lib/components/input/index.mjs.map +1 -1
- package/lib/components/ip-field/YIpField.scss +74 -74
- package/lib/components/ip-field/YIpv4Field.mjs +2 -2
- package/lib/components/ip-field/YIpv4Field.mjs.map +1 -1
- package/lib/components/ip-field/index.mjs.map +1 -1
- package/lib/components/layer/YLayer.mjs +2 -2
- package/lib/components/layer/YLayer.mjs.map +1 -1
- package/lib/components/layer/YLayer.scss +38 -38
- package/lib/components/layer/active-delay.mjs.map +1 -1
- package/lib/components/layer/active-stack.mjs.map +1 -1
- package/lib/components/layer/base.mjs +1 -1
- package/lib/components/layer/base.mjs.map +1 -1
- package/lib/components/layer/content.mjs +1 -1
- package/lib/components/layer/content.mjs.map +1 -1
- package/lib/components/layer/scroll-strategies.mjs +1 -1
- package/lib/components/layer/scroll-strategies.mjs.map +1 -1
- package/lib/components/list/YList.mjs +2 -2
- package/lib/components/list/YList.mjs.map +1 -1
- package/lib/components/list/YList.scss +3 -3
- package/lib/components/list/YListItem.mjs +2 -2
- package/lib/components/list/YListItem.mjs.map +1 -1
- package/lib/components/list/YListItem.scss +62 -62
- package/lib/components/list/index.mjs.map +1 -1
- package/lib/components/loading/YSpinnerRing.mjs +1 -1
- package/lib/components/loading/YSpinnerRing.mjs.map +1 -1
- package/lib/components/menu/YMenu.mjs +5 -4
- package/lib/components/menu/YMenu.mjs.map +1 -1
- package/lib/components/menu/YMenu.scss +25 -22
- package/lib/components/menu/index.mjs.map +1 -1
- package/lib/components/navigation/YNavigation.mjs +2 -1
- package/lib/components/navigation/YNavigation.mjs.map +1 -1
- package/lib/components/pagination/YPagination.mjs +2 -2
- package/lib/components/pagination/YPagination.mjs.map +1 -1
- package/lib/components/pagination/YPagination.scss +52 -51
- package/lib/components/pagination/index.mjs.map +1 -1
- package/lib/components/panel/YDividePanel.mjs.map +1 -1
- package/lib/components/panel/YDividePanel.scss +43 -43
- package/lib/components/panel/index.mjs.map +1 -1
- package/lib/components/plate/YPlate.mjs +2 -1
- package/lib/components/plate/YPlate.mjs.map +1 -1
- package/lib/components/plate/YPlate.scss +9 -9
- package/lib/components/progress-bar/YProgressBar.mjs +2 -2
- package/lib/components/progress-bar/YProgressBar.mjs.map +1 -1
- package/lib/components/progress-bar/YProgressBar.scss +6 -4
- package/lib/components/select/YSelect.mjs +3 -5
- package/lib/components/select/YSelect.mjs.map +1 -1
- package/lib/components/select/YSelect.scss +43 -43
- package/lib/components/select/index.mjs.map +1 -1
- package/lib/components/snackbar/YSnackbar.mjs +3 -4
- package/lib/components/snackbar/YSnackbar.mjs.map +1 -1
- package/lib/components/snackbar/YSnackbar.scss +38 -38
- package/lib/components/switch/YSwitch.mjs +2 -1
- package/lib/components/switch/YSwitch.mjs.map +1 -1
- package/lib/components/switch/YSwitch.scss +204 -198
- package/lib/components/tab/YTab.mjs +2 -3
- package/lib/components/tab/YTab.mjs.map +1 -1
- package/lib/components/tab/YTab.scss +6 -3
- package/lib/components/tab/YTabs.mjs +2 -2
- package/lib/components/tab/YTabs.mjs.map +1 -1
- package/lib/components/tab/YTabs.scss +8 -10
- package/lib/components/tab/index.mjs.map +1 -1
- package/lib/components/tab/types.mjs.map +1 -1
- package/lib/components/table/YDataTable.mjs +5 -5
- package/lib/components/table/YDataTable.mjs.map +1 -1
- package/lib/components/table/YDataTableBody.mjs +2 -2
- package/lib/components/table/YDataTableBody.mjs.map +1 -1
- package/lib/components/table/YDataTableCell.mjs +2 -1
- package/lib/components/table/YDataTableCell.mjs.map +1 -1
- package/lib/components/table/YDataTableControl.mjs +1 -1
- package/lib/components/table/YDataTableControl.mjs.map +1 -1
- package/lib/components/table/YDataTableControl.scss +7 -7
- package/lib/components/table/YDataTableHead.mjs +2 -3
- package/lib/components/table/YDataTableHead.mjs.map +1 -1
- package/lib/components/table/YDataTableLayer.mjs +2 -1
- package/lib/components/table/YDataTableLayer.mjs.map +1 -1
- package/lib/components/table/YDataTableRow.mjs +3 -2
- package/lib/components/table/YDataTableRow.mjs.map +1 -1
- package/lib/components/table/YDataTableServer.mjs +3 -4
- package/lib/components/table/YDataTableServer.mjs.map +1 -1
- package/lib/components/table/YTable.mjs +2 -2
- package/lib/components/table/YTable.mjs.map +1 -1
- package/lib/components/table/YTable.scss +157 -152
- package/lib/components/table/composibles/header.mjs +1 -1
- package/lib/components/table/composibles/header.mjs.map +1 -1
- package/lib/components/table/composibles/items.mjs +1 -1
- package/lib/components/table/composibles/items.mjs.map +1 -1
- package/lib/components/table/composibles/options.mjs.map +1 -1
- package/lib/components/table/composibles/pagination.mjs +1 -1
- package/lib/components/table/composibles/pagination.mjs.map +1 -1
- package/lib/components/table/composibles/selection.mjs +2 -2
- package/lib/components/table/composibles/selection.mjs.map +1 -1
- package/lib/components/table/composibles/sorted-items.mjs +1 -1
- package/lib/components/table/composibles/sorted-items.mjs.map +1 -1
- package/lib/components/table/composibles/sorting.mjs +2 -3
- package/lib/components/table/composibles/sorting.mjs.map +1 -1
- package/lib/components/table/index.mjs.map +1 -1
- package/lib/components/table/types/common.mjs.map +1 -1
- package/lib/components/table/types/header.mjs.map +1 -1
- package/lib/components/table/types/index.mjs.map +1 -1
- package/lib/components/table/types/row.mjs.map +1 -1
- package/lib/components/text-ellipsis/YTextEllipsis.mjs +4 -2
- package/lib/components/text-ellipsis/YTextEllipsis.mjs.map +1 -1
- package/lib/components/text-ellipsis/YTextEllipsis.scss +43 -43
- package/lib/components/text-ellipsis/index.mjs.map +1 -1
- package/lib/components/text-highlighter/YTextHighlighter.mjs +2 -1
- package/lib/components/text-highlighter/YTextHighlighter.mjs.map +1 -1
- package/lib/components/text-interpolation/YTi.mjs +2 -1
- package/lib/components/text-interpolation/YTi.mjs.map +1 -1
- package/lib/components/text-interpolation/index.mjs.map +1 -1
- package/lib/components/textarea/YTextarea.mjs +2 -2
- package/lib/components/textarea/YTextarea.mjs.map +1 -1
- package/lib/components/textarea/YTextarea.scss +25 -25
- package/lib/components/textarea/index.mjs.map +1 -1
- package/lib/components/toggle-button/YToggleButton.mjs.map +1 -1
- package/lib/components/toggle-button/index.mjs.map +1 -1
- package/lib/components/tooltip/YTooltip.mjs +4 -4
- package/lib/components/tooltip/YTooltip.mjs.map +1 -1
- package/lib/components/tooltip/YTooltip.scss +19 -19
- package/lib/components/tooltip/index.mjs.map +1 -1
- package/lib/components/transitions/expand-transition.mjs.map +1 -1
- package/lib/components/tree-view/YTreeView.mjs +1 -1
- package/lib/components/tree-view/YTreeView.mjs.map +1 -1
- package/lib/components/tree-view/YTreeView.scss +81 -79
- package/lib/components/tree-view/YTreeViewNode.mjs +3 -2
- package/lib/components/tree-view/YTreeViewNode.mjs.map +1 -1
- package/lib/components/tree-view/index.mjs.map +1 -1
- package/lib/components/tree-view/types.mjs.map +1 -1
- package/lib/components/tree-view/util.mjs.map +1 -1
- package/lib/composables/choice.mjs +1 -1
- package/lib/composables/choice.mjs.map +1 -1
- package/lib/composables/communication.mjs.map +1 -1
- package/lib/composables/component.mjs.map +1 -1
- package/lib/composables/coordinate/arrangement.mjs.map +1 -1
- package/lib/composables/coordinate/index.mjs +1 -1
- package/lib/composables/coordinate/index.mjs.map +1 -1
- package/lib/composables/coordinate/levitation.mjs.map +1 -1
- package/lib/composables/coordinate/utils/point.mjs.map +1 -1
- package/lib/composables/date/factory.mjs.map +1 -1
- package/lib/composables/date/index.mjs +2 -2
- package/lib/composables/date/index.mjs.map +1 -1
- package/lib/composables/date/setting.mjs.map +1 -1
- package/lib/composables/date/types.mjs.map +1 -1
- package/lib/composables/defaults/index.mjs +99 -0
- package/lib/composables/defaults/index.mjs.map +1 -0
- package/lib/composables/defaults/share.mjs +2 -0
- package/lib/composables/defaults/share.mjs.map +1 -0
- package/lib/composables/defaults/types.mjs +2 -0
- package/lib/composables/defaults/types.mjs.map +1 -0
- package/lib/composables/dimension.mjs +1 -1
- package/lib/composables/dimension.mjs.map +1 -1
- package/lib/composables/focus.mjs +2 -2
- package/lib/composables/focus.mjs.map +1 -1
- package/lib/composables/form.mjs +1 -1
- package/lib/composables/form.mjs.map +1 -1
- package/lib/composables/i18n/index.mjs +2 -2
- package/lib/composables/i18n/index.mjs.map +1 -1
- package/lib/composables/icon.mjs +5 -4
- package/lib/composables/icon.mjs.map +1 -1
- package/lib/composables/layer-group.mjs +1 -1
- package/lib/composables/layer-group.mjs.map +1 -1
- package/lib/composables/layout.mjs +1 -1
- package/lib/composables/layout.mjs.map +1 -1
- package/lib/composables/list-items.mjs +1 -1
- package/lib/composables/list-items.mjs.map +1 -1
- package/lib/composables/ref.mjs +1 -1
- package/lib/composables/ref.mjs.map +1 -1
- package/lib/composables/resize-observer.mjs +2 -4
- package/lib/composables/resize-observer.mjs.map +1 -1
- package/lib/composables/scope.mjs +1 -2
- package/lib/composables/scope.mjs.map +1 -1
- package/lib/composables/theme/factory.mjs.map +1 -1
- package/lib/composables/theme/index.mjs +2 -2
- package/lib/composables/theme/index.mjs.map +1 -1
- package/lib/composables/theme/setting.mjs.map +1 -1
- package/lib/composables/theme/types.mjs.map +1 -1
- package/lib/composables/timing.mjs +1 -1
- package/lib/composables/timing.mjs.map +1 -1
- package/lib/composables/transition.mjs +1 -1
- package/lib/composables/transition.mjs.map +1 -1
- package/lib/composables/validation.mjs +1 -1
- package/lib/composables/validation.mjs.map +1 -1
- package/lib/composables/vue-router.mjs +1 -1
- package/lib/composables/vue-router.mjs.map +1 -1
- package/lib/index.mjs +7 -2
- package/lib/index.mjs.map +1 -1
- package/lib/util/anchor.mjs.map +1 -1
- package/lib/util/array.mjs.map +1 -1
- package/lib/util/component/component.mjs +22 -0
- package/lib/util/component/component.mjs.map +1 -0
- package/lib/util/component/index.mjs +65 -0
- package/lib/util/component/index.mjs.map +1 -0
- package/lib/util/component/inject-self.mjs +10 -0
- package/lib/util/component/inject-self.mjs.map +1 -0
- package/lib/util/component/props.mjs +41 -0
- package/lib/util/component/props.mjs.map +1 -0
- package/lib/util/component/types.mjs +2 -0
- package/lib/util/component/types.mjs.map +1 -0
- package/lib/util/date/index.mjs.map +1 -1
- package/lib/util/dom.mjs.map +1 -1
- package/lib/util/index.mjs +1 -1
- package/lib/util/index.mjs.map +1 -1
- package/lib/util/reactivity.mjs +3 -3
- package/lib/util/reactivity.mjs.map +1 -1
- package/lib/util/rect.mjs.map +1 -1
- package/lib/util/ui.mjs.map +1 -1
- package/lib/util/validation.mjs.map +1 -1
- package/lib/util/vue-component/index.mjs +63 -0
- package/lib/util/vue-component/index.mjs.map +1 -0
- package/lib/util/vue-component/props.mjs +37 -0
- package/lib/util/vue-component/props.mjs.map +1 -0
- package/lib/util/vue-component/types.mjs +2 -0
- package/lib/util/vue-component/types.mjs.map +1 -0
- package/package.json +1 -1
- package/types/abstract/items.d.ts +4 -4
- package/types/components/alert/YAlert.d.ts +2 -13
- package/types/components/app/YApp.d.ts +1 -1
- package/types/components/badge/YBadge.d.ts +7 -41
- package/types/components/bench/YBench.d.ts +1 -1
- package/types/components/button/YButton.d.ts +10 -69
- package/types/components/card/YCard.d.ts +1 -6
- package/types/components/card/YCardBody.d.ts +1 -1
- package/types/components/card/YCardFooter.d.ts +1 -1
- package/types/components/card/YCardHeader.d.ts +1 -1
- package/types/components/checkbox/YCheckbox.d.ts +1 -26
- package/types/components/checkbox/YInputCheckbox.d.ts +2 -26
- package/types/components/checkbox/index.d.ts +1 -0
- package/types/components/chip/YChip.d.ts +2 -13
- package/types/components/date-picker/YDateCalendar.d.ts +7 -35
- package/types/components/date-picker/YDatePicker.d.ts +19 -48
- package/types/components/date-picker/YDatePickerControl.d.ts +12 -44
- package/types/components/date-picker/YMonthPicker.d.ts +3 -7
- package/types/components/date-picker/YYearPicker.d.ts +3 -9
- package/types/components/dialog/YDialog.d.ts +135 -378
- package/types/components/divider/YDivider.d.ts +1 -3
- package/types/components/dropdown/YDropdown.d.ts +100 -273
- package/types/components/field-input/YFieldInput.d.ts +16 -122
- package/types/components/form/YForm.d.ts +2 -24
- package/types/components/hover/YHover.d.ts +4 -26
- package/types/components/icon/YIcon.d.ts +6 -21
- package/types/components/icons/YIconCheckbox.d.ts +1 -9
- package/types/components/icons/YIconClear.d.ts +1 -1
- package/types/components/icons/YIconDropdown.d.ts +1 -1
- package/types/components/icons/YIconExpand.d.ts +1 -1
- package/types/components/icons/YIconPageControl.d.ts +1 -8
- package/types/components/icons/YIconSort.d.ts +1 -10
- package/types/components/icons/index.d.ts +8 -46
- package/types/components/img/YImg.d.ts +7 -47
- package/types/components/input/YInput.d.ts +13 -101
- package/types/components/ip-field/YIpv4Field.d.ts +3 -71
- package/types/components/layer/YLayer.d.ts +48 -165
- package/types/components/layer/content.d.ts +1 -1
- package/types/components/layer/scroll-strategies.d.ts +1 -1
- package/types/components/list/YList.d.ts +1 -6
- package/types/components/list/YListItem.d.ts +3 -21
- package/types/components/loading/YSpinnerRing.d.ts +1 -1
- package/types/components/menu/YMenu.d.ts +26 -291
- package/types/components/navigation/YNavigation.d.ts +1 -1
- package/types/components/pagination/YPagination.d.ts +25 -65
- package/types/components/plate/YPlate.d.ts +1 -3
- package/types/components/progress-bar/YProgressBar.d.ts +1 -36
- package/types/components/select/YSelect.d.ts +482 -1106
- package/types/components/snackbar/YSnackbar.d.ts +51 -176
- package/types/components/switch/YSwitch.d.ts +1 -43
- package/types/components/tab/YTab.d.ts +14 -80
- package/types/components/tab/YTabs.d.ts +6 -39
- package/types/components/table/YDataTable.d.ts +24 -173
- package/types/components/table/YDataTableBody.d.ts +3 -26
- package/types/components/table/YDataTableCell.d.ts +2 -31
- package/types/components/table/YDataTableControl.d.ts +3 -18
- package/types/components/table/YDataTableHead.d.ts +3 -21
- package/types/components/table/YDataTableLayer.d.ts +1 -3
- package/types/components/table/YDataTableRow.d.ts +1 -9
- package/types/components/table/YDataTableServer.d.ts +27 -179
- package/types/components/table/YTable.d.ts +5 -24
- package/types/components/table/composibles/header.d.ts +9 -9
- package/types/components/table/composibles/items.d.ts +3 -3
- package/types/components/table/composibles/pagination.d.ts +3 -3
- package/types/components/table/composibles/selection.d.ts +4 -4
- package/types/components/table/composibles/sorting.d.ts +1 -1
- package/types/components/table/types/index.d.ts +1 -1
- package/types/components/text-ellipsis/YTextEllipsis.d.ts +1 -8
- package/types/components/text-highlighter/YTextHighlighter.d.ts +2 -17
- package/types/components/text-interpolation/YTi.d.ts +1 -10
- package/types/components/textarea/YTextarea.d.ts +20 -116
- package/types/components/tooltip/YTooltip.d.ts +44 -278
- package/types/components/tree-view/YTreeView.d.ts +4 -4
- package/types/components/tree-view/YTreeViewNode.d.ts +10 -67
- package/types/composables/choice.d.ts +1 -1
- package/types/composables/coordinate/index.d.ts +16 -16
- package/types/composables/coordinate/utils/point.d.ts +1 -1
- package/types/composables/defaults/index.d.ts +11 -0
- package/types/composables/defaults/share.d.ts +4 -0
- package/types/composables/defaults/types.d.ts +12 -0
- package/types/composables/form.d.ts +3 -3
- package/types/composables/icon.d.ts +5 -22
- package/types/composables/layer-group.d.ts +1 -1
- package/types/composables/list-items.d.ts +10 -10
- package/types/composables/timing.d.ts +1 -1
- package/types/composables/transition.d.ts +1 -1
- package/types/composables/validation.d.ts +3 -3
- package/types/composables/vue-router.d.ts +1 -1
- package/types/globals.d.ts +1 -0
- package/types/util/Rect.d.ts +1 -1
- package/types/util/anchor.d.ts +1 -1
- package/types/util/component/component.d.ts +5 -0
- package/types/util/component/index.d.ts +11 -0
- package/types/util/component/inject-self.d.ts +3 -0
- package/types/util/component/props.d.ts +32 -0
- package/types/util/component/types.d.ts +21 -0
- package/types/util/index.d.ts +1 -1
- package/types/util/vue-component/index.d.ts +10 -0
- package/types/util/vue-component/props.d.ts +31 -0
- package/types/util/vue-component/types.d.ts +4 -0
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
.y-snackbar {
|
|
2
|
-
font-size: 1rem;
|
|
3
|
-
margin: 8px;
|
|
4
|
-
|
|
5
|
-
&__display {
|
|
6
|
-
display: flex;
|
|
7
|
-
align-items: center;
|
|
8
|
-
min-height: 48px;
|
|
9
|
-
min-width: 240px;
|
|
10
|
-
z-index: inherit;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
&__content {
|
|
14
|
-
position: relative;
|
|
15
|
-
flex-grow: 1;
|
|
16
|
-
font-size: 0.875em;
|
|
17
|
-
font-weight: 400;
|
|
18
|
-
line-height: 0.625em;
|
|
19
|
-
padding: 0.875em;
|
|
20
|
-
z-index: inherit;
|
|
21
|
-
color: #fff;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.y-plate {
|
|
25
|
-
background-color: rgba(0, 0, 0, 0.74);
|
|
26
|
-
backdrop-filter: blur(4px);
|
|
27
|
-
box-shadow: 0 0 4px -1px rgba(0, 0, 0, 0.4);
|
|
28
|
-
z-index: inherit;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
&-leave-active {
|
|
32
|
-
transition: all 300ms ease-in-out;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
&-leave-to {
|
|
36
|
-
opacity: 0;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
1
|
+
.y-snackbar {
|
|
2
|
+
font-size: 1rem;
|
|
3
|
+
margin: 8px;
|
|
4
|
+
|
|
5
|
+
&__display {
|
|
6
|
+
display: flex;
|
|
7
|
+
align-items: center;
|
|
8
|
+
min-height: 48px;
|
|
9
|
+
min-width: 240px;
|
|
10
|
+
z-index: inherit;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
&__content {
|
|
14
|
+
position: relative;
|
|
15
|
+
flex-grow: 1;
|
|
16
|
+
font-size: 0.875em;
|
|
17
|
+
font-weight: 400;
|
|
18
|
+
line-height: 0.625em;
|
|
19
|
+
padding: 0.875em;
|
|
20
|
+
z-index: inherit;
|
|
21
|
+
color: #fff;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.y-plate {
|
|
25
|
+
background-color: rgba(0, 0, 0, 0.74);
|
|
26
|
+
backdrop-filter: blur(4px);
|
|
27
|
+
box-shadow: 0 0 4px -1px rgba(0, 0, 0, 0.4);
|
|
28
|
+
z-index: inherit;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
&-leave-active {
|
|
32
|
+
transition: all 300ms ease-in-out;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
&-leave-to {
|
|
36
|
+
opacity: 0;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { createVNode as _createVNode } from "vue";
|
|
2
|
-
import {
|
|
2
|
+
import { withModifiers } from 'vue';
|
|
3
|
+
import { defineComponent } from "../../util/component/index.mjs";
|
|
3
4
|
import "./YSwitch.scss";
|
|
4
5
|
let uidCounter = 0;
|
|
5
6
|
export const YSwitch = defineComponent({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"YSwitch.mjs","names":["defineComponent","withModifiers","uidCounter","YSwitch","name","model","prop","event","props","input","type","Boolean","Array","default","value","String","Number","Object","max","loading","disabled","stickOut","stateLabel","color","labelOn","labelOff","data","innerValue","counterId","focused","created","iid","toString","isArray","inputByValue","computed","isMultipleInput","multipleInputIndex","findIndex","inp","inputId","id","trackStyles","backgroundColor","classes","methods","found","find","undefined","changeMultipleInput","checked","multipleInput","slice","length","$emit","nextChange","push","splice","$nextTick","onClick","$event","changeInput","onFocus","onBlur","onKeydown","onChange","$checkbox","target","stopImmediatePropagation","watch","render","$slots","_createVNode","label"],"sources":["../../../src/components/switch/YSwitch.tsx"],"sourcesContent":["import { PropType, defineComponent, withModifiers } from 'vue';\n\nimport './YSwitch.scss';\n\nlet uidCounter = 0;\n\nexport const YSwitch = defineComponent({\n name: 'YSwitch',\n model: {\n prop: 'input',\n event: 'change',\n },\n props: {\n input: {\n type: [Boolean, Array] as PropType<boolean | any[]>,\n default: false,\n },\n value: {\n type: [String, Number, Object] as PropType<any>,\n },\n max: {\n type: Number,\n },\n loading: {\n type: Boolean,\n },\n disabled: {\n type: Boolean,\n },\n stickOut: {\n type: Boolean,\n },\n stateLabel: {\n type: Boolean,\n },\n color: {\n type: String,\n },\n labelOn: {\n type: String,\n default: 'ON',\n },\n labelOff: {\n type: String,\n default: 'OFF',\n },\n },\n data() {\n return {\n innerValue: false,\n counterId: '',\n focused: false,\n };\n },\n created() {\n const iid = uidCounter.toString();\n uidCounter += 1;\n this.counterId = iid;\n if (Array.isArray(this.input)) {\n this.inputByValue();\n } else {\n this.innerValue = this.input;\n }\n },\n computed: {\n isMultipleInput() {\n return Array.isArray(this.input);\n },\n multipleInputIndex() {\n if (!Array.isArray(this.input)) {\n return -1;\n }\n return this.input.findIndex((inp) => {\n return inp === this.value;\n });\n },\n inputId() {\n const id = this.counterId;\n return `y-switch--${id}`;\n },\n trackStyles() {\n return {\n backgroundColor: this.color,\n };\n },\n classes() {\n return {\n 'y-switch--disabled': this.disabled,\n 'y-switch--loading': this.loading,\n 'y-switch--active': this.innerValue,\n 'y-switch--stick-out': this.stickOut,\n 'y-switch--focused': this.focused,\n };\n },\n },\n methods: {\n inputByValue() {\n if (Array.isArray(this.input)) {\n const found = this.input.find((inp: any) => {\n return inp === this.value;\n });\n\n if (found !== undefined) {\n this.innerValue = true;\n } else {\n this.innerValue = false;\n }\n } else if (typeof this.input === 'boolean') {\n this.innerValue = this.input;\n }\n },\n changeMultipleInput(checked: boolean) {\n if (Array.isArray(this.input)) {\n const multipleInput = this.input.slice();\n if (\n checked &&\n this.max !== undefined &&\n multipleInput.length >= this.max\n ) {\n this.$emit('overmax');\n this.nextChange(false, multipleInput);\n return;\n }\n if (checked && this.multipleInputIndex < 0) {\n multipleInput.push(this.value);\n } else if (this.multipleInputIndex > -1) {\n multipleInput.splice(this.multipleInputIndex, 1);\n }\n this.$emit('change', multipleInput);\n }\n },\n nextChange(checked: boolean, value: any) {\n this.$nextTick(() => {\n this.innerValue = checked;\n });\n },\n onClick($event: Event) {\n if (this.disabled || this.loading) return;\n this.changeInput(!this.innerValue, $event);\n },\n onFocus() {\n this.focused = true;\n },\n onBlur() {\n this.focused = false;\n },\n onKeydown($event: KeyboardEvent) {\n // nothing\n },\n onChange($event: Event) {\n const $checkbox = $event.target as HTMLInputElement;\n const { checked } = $checkbox;\n $event.stopImmediatePropagation();\n this.changeInput(checked, $event);\n },\n changeInput(checked: boolean, event?: Event) {\n this.innerValue = checked;\n if (this.isMultipleInput) {\n this.changeMultipleInput(checked);\n } else {\n this.$emit('change', checked);\n }\n },\n },\n watch: {\n input() {\n this.inputByValue();\n },\n },\n render() {\n const {\n $slots,\n classes,\n onClick,\n onKeydown,\n onFocus,\n onBlur,\n onChange,\n inputId,\n innerValue,\n disabled,\n trackStyles,\n stateLabel,\n labelOn,\n labelOff,\n loading,\n } = this;\n return (\n <div class={{ 'y-switch': true, ...classes }}>\n <div class=\"y-switch__slot\">\n <div\n class=\"y-switch__input\"\n onClick={withModifiers(onClick, ['exact'])}\n onKeydown={onKeydown}\n >\n <input\n id={inputId}\n aria-checked={innerValue}\n type=\"checkbox\"\n role=\"switch\"\n onFocus={onFocus}\n onBlur={onBlur}\n onChange={onChange}\n disabled={disabled}\n checked={innerValue}\n ref=\"checkbox\"\n />\n <div class=\"y-switch__track\" style={trackStyles}>\n {stateLabel && (\n <div class=\"y-switch__state\">\n <span class=\"y-switch__state-label y-switch__state-label--on\">\n {{ labelOn }}\n </span>\n <span class=\"y-switch__state-label y-switch__state-label--off\">\n {{ labelOff }}\n </span>\n </div>\n )}\n </div>\n <div class=\"y-switch__thumb\">\n {loading && <div class=\"y-switch__spinner\"></div>}\n </div>\n </div>\n {$slots.label && (\n <label for={inputId} class=\"y-switch__label\">\n {$slots.label?.()}\n <input hidden />\n </label>\n )}\n </div>\n </div>\n );\n },\n});\n\nexport type YSwitch = InstanceType<typeof YSwitch>;\n"],"mappings":";AAAA,SAAmBA,eAAe,EAAEC,aAAa,QAAQ,KAAK;AAE9D;AAEA,IAAIC,UAAU,GAAG,CAAC;AAElB,OAAO,MAAMC,OAAO,GAAGH,eAAe,CAAC;EACrCI,IAAI,EAAE,SAAS;EACfC,KAAK,EAAE;IACLC,IAAI,EAAE,OAAO;IACbC,KAAK,EAAE;EACT,CAAC;EACDC,KAAK,EAAE;IACLC,KAAK,EAAE;MACLC,IAAI,EAAE,CAACC,OAAO,EAAEC,KAAK,CAA8B;MACnDC,OAAO,EAAE;IACX,CAAC;IACDC,KAAK,EAAE;MACLJ,IAAI,EAAE,CAACK,MAAM,EAAEC,MAAM,EAAEC,MAAM;IAC/B,CAAC;IACDC,GAAG,EAAE;MACHR,IAAI,EAAEM;IACR,CAAC;IACDG,OAAO,EAAE;MACPT,IAAI,EAAEC;IACR,CAAC;IACDS,QA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AqD,YAAA;MAAA;IAAA,QAAyC,MAGpDD,MAAM,CAACE,KAAK,IAAAD,YAAA;MAAA,OACChC,OAAO;MAAA;IAAA,IAChB+B,MAAM,CAACE,KAAK,GAAG,CAAC,EAAAD,YAAA;MAAA;IAAA,UAGpB;EAIT;AACF,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"YSwitch.mjs","names":["withModifiers","defineComponent","uidCounter","YSwitch","name","model","prop","event","props","input","type","Boolean","Array","default","value","String","Number","Object","max","loading","disabled","stickOut","stateLabel","color","labelOn","labelOff","data","innerValue","counterId","focused","created","iid","toString","isArray","inputByValue","computed","isMultipleInput","multipleInputIndex","findIndex","inp","inputId","id","trackStyles","backgroundColor","classes","methods","found","find","undefined","changeMultipleInput","checked","multipleInput","slice","length","$emit","nextChange","push","splice","$nextTick","onClick","$event","changeInput","onFocus","onBlur","onKeydown","onChange","$checkbox","target","stopImmediatePropagation","watch","render","$slots","_createVNode","label"],"sources":["../../../src/components/switch/YSwitch.tsx"],"sourcesContent":["import { type PropType, withModifiers } from 'vue';\n\nimport { defineComponent } from '@/util/component';\n\nimport './YSwitch.scss';\n\nlet uidCounter = 0;\n\nexport const YSwitch = defineComponent({\n name: 'YSwitch',\n model: {\n prop: 'input',\n event: 'change',\n },\n props: {\n input: {\n type: [Boolean, Array] as PropType<boolean | any[]>,\n default: false,\n },\n value: {\n type: [String, Number, Object] as PropType<any>,\n },\n max: {\n type: Number,\n },\n loading: {\n type: Boolean,\n },\n disabled: {\n type: Boolean,\n },\n stickOut: {\n type: Boolean,\n },\n stateLabel: {\n type: Boolean,\n },\n color: {\n type: String,\n },\n labelOn: {\n type: String,\n default: 'ON',\n },\n labelOff: {\n type: String,\n default: 'OFF',\n },\n },\n data() {\n return {\n innerValue: false,\n counterId: '',\n focused: false,\n };\n },\n created() {\n const iid = uidCounter.toString();\n uidCounter += 1;\n this.counterId = iid;\n if (Array.isArray(this.input)) {\n this.inputByValue();\n } else {\n this.innerValue = this.input;\n }\n },\n computed: {\n isMultipleInput() {\n return Array.isArray(this.input);\n },\n multipleInputIndex() {\n if (!Array.isArray(this.input)) {\n return -1;\n }\n return this.input.findIndex((inp) => {\n return inp === this.value;\n });\n },\n inputId() {\n const id = this.counterId;\n return `y-switch--${id}`;\n },\n trackStyles() {\n return {\n backgroundColor: this.color,\n };\n },\n classes() {\n return {\n 'y-switch--disabled': this.disabled,\n 'y-switch--loading': this.loading,\n 'y-switch--active': this.innerValue,\n 'y-switch--stick-out': this.stickOut,\n 'y-switch--focused': this.focused,\n };\n },\n },\n methods: {\n inputByValue() {\n if (Array.isArray(this.input)) {\n const found = this.input.find((inp: any) => {\n return inp === this.value;\n });\n\n if (found !== undefined) {\n this.innerValue = true;\n } else {\n this.innerValue = false;\n }\n } else if (typeof this.input === 'boolean') {\n this.innerValue = this.input;\n }\n },\n changeMultipleInput(checked: boolean) {\n if (Array.isArray(this.input)) {\n const multipleInput = this.input.slice();\n if (\n checked &&\n this.max !== undefined &&\n multipleInput.length >= this.max\n ) {\n this.$emit('overmax');\n this.nextChange(false, multipleInput);\n return;\n }\n if (checked && this.multipleInputIndex < 0) {\n multipleInput.push(this.value);\n } else if (this.multipleInputIndex > -1) {\n multipleInput.splice(this.multipleInputIndex, 1);\n }\n this.$emit('change', multipleInput);\n }\n },\n nextChange(checked: boolean, value: any) {\n this.$nextTick(() => {\n this.innerValue = checked;\n });\n },\n onClick($event: Event) {\n if (this.disabled || this.loading) return;\n this.changeInput(!this.innerValue, $event);\n },\n onFocus() {\n this.focused = true;\n },\n onBlur() {\n this.focused = false;\n },\n onKeydown($event: KeyboardEvent) {\n // nothing\n },\n onChange($event: Event) {\n const $checkbox = $event.target as HTMLInputElement;\n const { checked } = $checkbox;\n $event.stopImmediatePropagation();\n this.changeInput(checked, $event);\n },\n changeInput(checked: boolean, event?: Event) {\n this.innerValue = checked;\n if (this.isMultipleInput) {\n this.changeMultipleInput(checked);\n } else {\n this.$emit('change', checked);\n }\n },\n },\n watch: {\n input() {\n this.inputByValue();\n },\n },\n render() {\n const {\n $slots,\n classes,\n onClick,\n onKeydown,\n onFocus,\n onBlur,\n onChange,\n inputId,\n innerValue,\n disabled,\n trackStyles,\n stateLabel,\n labelOn,\n labelOff,\n loading,\n } = this;\n return (\n <div class={{ 'y-switch': true, ...classes }}>\n <div class=\"y-switch__slot\">\n <div\n class=\"y-switch__input\"\n onClick={withModifiers(onClick, ['exact'])}\n onKeydown={onKeydown}\n >\n <input\n id={inputId}\n aria-checked={innerValue}\n type=\"checkbox\"\n role=\"switch\"\n onFocus={onFocus}\n onBlur={onBlur}\n onChange={onChange}\n disabled={disabled}\n checked={innerValue}\n ref=\"checkbox\"\n />\n <div class=\"y-switch__track\" style={trackStyles}>\n {stateLabel && (\n <div class=\"y-switch__state\">\n <span class=\"y-switch__state-label y-switch__state-label--on\">\n {{ labelOn }}\n </span>\n <span class=\"y-switch__state-label y-switch__state-label--off\">\n {{ labelOff }}\n </span>\n </div>\n )}\n </div>\n <div class=\"y-switch__thumb\">\n {loading && <div class=\"y-switch__spinner\"></div>}\n </div>\n </div>\n {$slots.label && (\n <label for={inputId} class=\"y-switch__label\">\n {$slots.label?.()}\n <input hidden />\n </label>\n )}\n </div>\n </div>\n );\n },\n});\n\nexport type YSwitch = InstanceType<typeof YSwitch>;\n"],"mappings":";AAAA,SAAwBA,aAAa,QAAQ,KAAK;AAAC,SAE1CC,eAAe;AAExB;AAEA,IAAIC,UAAU,GAAG,CAAC;AAElB,OAAO,MAAMC,OAAO,GAAGF,eAAe,CAAC;EACrCG,IAAI,EAAE,SAAS;EACfC,KAAK,EAAE;IACLC,IAAI,EAAE,OAAO;IACbC,KAAK,EAAE;EACT,CAAC;EACDC,KAAK,EAAE;IACLC,KAAK,EAAE;MACLC,IAAI,EAAE,CAACC,OAAO,EAAEC,KAAK,CAA8B;MACnDC,OAAO,EAAE;IACX,CAAC;IACDC,KAAK,EAAE;MACLJ,IAAI,EAAE,CAACK,MAAM,EAAEC,MAAM,EAAEC,MA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-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
border-
|
|
94
|
-
border-
|
|
95
|
-
border-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
1
|
+
@use '../../styles/variables';
|
|
2
|
+
|
|
3
|
+
.y-switch {
|
|
4
|
+
--y-switch__color: var(--y-theme-primary);
|
|
5
|
+
font-size: 1rem;
|
|
6
|
+
|
|
7
|
+
&__slot {
|
|
8
|
+
display: flex;
|
|
9
|
+
cursor: pointer;
|
|
10
|
+
align-items: center;
|
|
11
|
+
color: inherit;
|
|
12
|
+
min-height: inherit;
|
|
13
|
+
position: relative;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
&__input {
|
|
17
|
+
width: 3em;
|
|
18
|
+
height: 1.5em;
|
|
19
|
+
position: relative;
|
|
20
|
+
display: inline-flex;
|
|
21
|
+
user-select: none;
|
|
22
|
+
color: inherit;
|
|
23
|
+
flex: 0 0 auto;
|
|
24
|
+
|
|
25
|
+
input[role='switch'] {
|
|
26
|
+
position: absolute;
|
|
27
|
+
opacity: 0;
|
|
28
|
+
width: 100%;
|
|
29
|
+
height: 100%;
|
|
30
|
+
cursor: pointer;
|
|
31
|
+
user-select: none;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
&:not(&--loading) &__input:active &__thumb {
|
|
35
|
+
width: 1em;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
&__track {
|
|
39
|
+
width: 100%;
|
|
40
|
+
height: 100%;
|
|
41
|
+
border-radius: 2em;
|
|
42
|
+
background-color: #e0e0e0;
|
|
43
|
+
position: absolute;
|
|
44
|
+
left: 0;
|
|
45
|
+
top: 0;
|
|
46
|
+
transition: 300ms;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
&__thumb {
|
|
50
|
+
width: 1.1em;
|
|
51
|
+
height: 1.1em;
|
|
52
|
+
align-self: center;
|
|
53
|
+
left: 0.185em;
|
|
54
|
+
border-radius: 50%;
|
|
55
|
+
display: flex;
|
|
56
|
+
justify-content: center;
|
|
57
|
+
align-items: center;
|
|
58
|
+
background-color: #fff;
|
|
59
|
+
pointer-events: none;
|
|
60
|
+
position: relative;
|
|
61
|
+
transition: 180ms cubic-bezier(0.78, 0.04, 0.9, 0.18);
|
|
62
|
+
will-change: left, transform;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
&__spinner {
|
|
66
|
+
position: relative;
|
|
67
|
+
width: 100%;
|
|
68
|
+
height: 100%;
|
|
69
|
+
border-radius: 50%;
|
|
70
|
+
animation: rotate 2s linear infinite;
|
|
71
|
+
contain: paint;
|
|
72
|
+
|
|
73
|
+
@keyframes spinner-blur {
|
|
74
|
+
0% {
|
|
75
|
+
filter: blur(4px);
|
|
76
|
+
}
|
|
77
|
+
50% {
|
|
78
|
+
filter: blur(1px);
|
|
79
|
+
}
|
|
80
|
+
100% {
|
|
81
|
+
filter: blur(4px);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
&:before {
|
|
86
|
+
content: '';
|
|
87
|
+
position: absolute;
|
|
88
|
+
top: 2px;
|
|
89
|
+
left: 2px;
|
|
90
|
+
right: 2px;
|
|
91
|
+
bottom: 2px;
|
|
92
|
+
border-radius: 50%;
|
|
93
|
+
border-width: 2px 2px 0 0;
|
|
94
|
+
border-style: solid;
|
|
95
|
+
border-color: var(--y-switch__color) transparent;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
&:after {
|
|
99
|
+
content: '';
|
|
100
|
+
position: absolute;
|
|
101
|
+
left: 0;
|
|
102
|
+
top: 0;
|
|
103
|
+
right: 0;
|
|
104
|
+
bottom: 0;
|
|
105
|
+
background: linear-gradient(
|
|
106
|
+
0deg,
|
|
107
|
+
transparent 60%,
|
|
108
|
+
rgba(var(--y-switch__color), 0.4)
|
|
109
|
+
);
|
|
110
|
+
filter: blur(4px);
|
|
111
|
+
animation: spinner-blur 3s infinite;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
&--active {
|
|
116
|
+
.y-switch__track {
|
|
117
|
+
background-color: var(--y-switch__color);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.y-switch__thumb {
|
|
121
|
+
left: calc(100% - 1.1em - 0.24em);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
&--active:not(&--loading):active &__thumb {
|
|
126
|
+
left: 1.8em;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
&--focused {
|
|
130
|
+
.y-switch__thumb:before {
|
|
131
|
+
content: '';
|
|
132
|
+
position: absolute;
|
|
133
|
+
top: 2px;
|
|
134
|
+
bottom: 2px;
|
|
135
|
+
left: 2px;
|
|
136
|
+
right: 2px;
|
|
137
|
+
border-radius: 50%;
|
|
138
|
+
background-color: rgba(var(--y-switch__color), 0.4);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
&--stick-out {
|
|
143
|
+
.y-switch__thumb {
|
|
144
|
+
box-shadow:
|
|
145
|
+
2px 2px 5px -2px rgba(0, 0, 0, 0.54),
|
|
146
|
+
1px 1px 4px rgba(0, 0, 0, 0.12),
|
|
147
|
+
0 0 0 1px rgba(0, 0, 0, 0.08);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.y-switch__track {
|
|
151
|
+
width: 80%;
|
|
152
|
+
height: 74%;
|
|
153
|
+
top: 50%;
|
|
154
|
+
left: 50%;
|
|
155
|
+
transform: translate(-50%, -50%);
|
|
156
|
+
box-shadow: inset 0 0 4px -1px rgba(0, 0, 0, 0.34);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
&--disabled {
|
|
161
|
+
opacity: 0.8;
|
|
162
|
+
filter: brightness(0.88);
|
|
163
|
+
|
|
164
|
+
.y-switch__thumb {
|
|
165
|
+
opacity: 0.4;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
&--disabled &__slot,
|
|
169
|
+
&--disabled &__input input {
|
|
170
|
+
cursor: default;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
&__state {
|
|
174
|
+
position: relative;
|
|
175
|
+
width: 100%;
|
|
176
|
+
height: 100%;
|
|
177
|
+
contain: content;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
&__state-label {
|
|
181
|
+
font-size: 12px;
|
|
182
|
+
color: #ffffff;
|
|
183
|
+
position: absolute;
|
|
184
|
+
height: 100%;
|
|
185
|
+
display: flex;
|
|
186
|
+
align-items: center;
|
|
187
|
+
transition: transform 180ms cubic-bezier(0.16, 0.85, 0.36, 0.96);
|
|
188
|
+
|
|
189
|
+
&--on {
|
|
190
|
+
left: -40px;
|
|
191
|
+
}
|
|
192
|
+
&--off {
|
|
193
|
+
right: 10px;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
&--active &__state-label {
|
|
198
|
+
transform: translateX(50px);
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
&--stick-out &__state-label--off {
|
|
202
|
+
right: 7px;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { mergeProps as _mergeProps, createVNode as _createVNode } from "vue";
|
|
2
|
-
import { shallowRef } from '
|
|
3
|
-
import { computed, defineComponent, ref } from 'vue';
|
|
2
|
+
import { computed, ref, shallowRef } from 'vue';
|
|
4
3
|
import { useRender } from "../../composables/component.mjs";
|
|
5
|
-
import { chooseProps, propsFactory } from "../../util/index.mjs";
|
|
4
|
+
import { chooseProps, defineComponent, propsFactory } from "../../util/component/index.mjs";
|
|
6
5
|
import { YButton, pressYButtonProps } from "../button/index.mjs";
|
|
7
6
|
import { Y_TABS_KEY } from "./shared.mjs";
|
|
8
7
|
import "./YTab.scss";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"YTab.mjs","names":["
|
|
1
|
+
{"version":3,"file":"YTab.mjs","names":["computed","ref","shallowRef","useRender","chooseProps","defineComponent","propsFactory","YButton","pressYButtonProps","Y_TABS_KEY","pressYTabPropsOptions","text","String","hideIndicator","Boolean","indicatorColor","selectedClass","noWave","YTab","name","props","slots","Object","setup","_ref","attrs","selected","indicator$","indicatorStyles","attrsProps","role","value","tabindex","onChoice","_ref2","yButtonProps","_createVNode","_mergeProps","default","append"],"sources":["../../../src/components/tab/YTab.tsx"],"sourcesContent":["import { type PropType, type SlotsType, computed, ref, shallowRef } from 'vue';\n\nimport { useRender } from '@/composables/component';\nimport { chooseProps, defineComponent, propsFactory } from '@/util/component';\n\nimport { YButton, pressYButtonProps } from '../button';\nimport { Y_TABS_KEY } from './shared';\n\nimport './YTab.scss';\n\nexport const pressYTabPropsOptions = propsFactory(\n {\n text: String as PropType<string>,\n hideIndicator: Boolean as PropType<boolean>,\n indicatorColor: String as PropType<string>,\n ...pressYButtonProps({\n selectedClass: 'y-tab--selected',\n noWave: true,\n }),\n },\n 'YTab',\n);\n\nexport const YTab = defineComponent({\n name: 'YTab',\n props: pressYTabPropsOptions(),\n slots: Object as SlotsType<{\n default?: any;\n }>,\n setup(props, { slots, attrs }) {\n const selected = shallowRef(false);\n\n const indicator$ = ref();\n const indicatorStyles = computed(() => {\n return {};\n });\n const attrsProps = computed(() => {\n return {\n role: 'tab',\n 'aria-selected': `${String(selected.value)}`,\n tabindex: selected.value ? 0 : -1,\n };\n });\n\n function onChoice({ value }: { value: boolean }) {\n selected.value = value;\n }\n\n useRender(() => {\n const yButtonProps = chooseProps(props, YButton.props);\n return (\n <YButton\n class={['y-tab']}\n active={false}\n {...attrsProps.value}\n {...attrs}\n {...yButtonProps}\n injectSymbol={Y_TABS_KEY}\n onChoice:selected={onChoice}\n >\n {{\n default: () => slots.default?.() ?? props.text,\n append: () =>\n !props.hideIndicator && (\n <div\n ref={indicator$}\n class={['y-tab__indicator']}\n style={indicatorStyles.value}\n ></div>\n ),\n }}\n </YButton>\n );\n });\n\n return {};\n },\n});\n\nexport type YTab = InstanceType<typeof YTab>;\n"],"mappings":";AAAA,SAAwCA,QAAQ,EAAEC,GAAG,EAAEC,UAAU,QAAQ,KAAK;AAAC,SAEtEC,SAAS;AAAA,SACTC,WAAW,EAAEC,eAAe,EAAEC,YAAY;AAAA,SAE1CC,OAAO,EAAEC,iBAAiB;AAAA,SAC1BC,UAAU;AAEnB;AAEA,OAAO,MAAMC,qBAAqB,GAAGJ,YAAY,CAC/C;EACEK,IAAI,EAAEC,MAA0B;EAChCC,aAAa,EAAEC,OAA4B;EAC3CC,cAAc,EAAEH,MAA0B;EAC1C,GAAGJ,iBAAiB,CAAC;IACnBQ,aAAa,EAAE,iBAAiB;IAChCC,MAAM,EAAE;EACV,CAAC;AACH,CAAC,EACD,MACF,CAAC;AAED,OAAO,MAAMC,IAAI,GAAGb,eAAe,CAAC;EAClCc,IAAI,EAAE,MAAM;EACZC,KAAK,EAAEV,qBAAqB,CAAC,CAAC;EAC9BW,KAAK,EAAEC,MAEL;EACFC,KAAKA,CAACH,KAAK,EAAAI,IAAA,EAAoB;IAAA,IAAlB;MAAEH,KAAK;MAAEI;IAAM,CAAC,GAAAD,IAAA;IAC3B,MAAME,QAAQ,GAAGxB,UAAU,CAAC,KAAK,CAAC;IAElC,MAAMyB,UAAU,GAAG1B,GAAG,CAAC,CAAC;IACxB,MAAM2B,eAAe,GAAG5B,QAAQ,CAAC,MAAM;MACrC,OAAO,CAAC,CAAC;IACX,CAAC,CAAC;IACF,MAAM6B,UAAU,GAAG7B,QAAQ,CAAC,MAAM;MAChC,OAAO;QACL8B,IAAI,EAAE,KAAK;QACX,eAAe,EAAG,GAAElB,MAAM,CAACc,QAAQ,CAACK,KAAK,CAAE,EAAC;QAC5CC,QAAQ,EAAEN,QAAQ,CAACK,KAAK,GAAG,CAAC,GAAG,CAAC;MAClC,CAAC;IACH,CAAC,CAAC;IAEF,SAASE,QAAQA,CAAAC,KAAA,EAAgC;MAAA,IAA/B;QAAEH;MAA0B,CAAC,GAAAG,KAAA;MAC7CR,QAAQ,CAACK,KAAK,GAAGA,KAAK;IACxB;IAEA5B,SAAS,CAAC,MAAM;MACd,MAAMgC,YAAY,GAAG/B,WAAW,CAACgB,KAAK,EAAEb,OAAO,CAACa,KAAK,CAAC;MACtD,OAAAgB,YAAA,CAAA7B,OAAA,EAAA8B,WAAA;QAAA,SAEW,CAAC,OAAO,CAAC;QAAA,UACR;MAAK,GACTR,UAAU,CAACE,KAAK,EAChBN,KAAK,EACLU,YAAY;QAAA,gBACF1B,UAAU;QAAA,qBACLwB;MAAQ;QAGzBK,OAAO,EAAEA,CAAA,KAAMjB,KAAK,CAACiB,OAAO,GAAG,CAAC,IAAIlB,KAAK,CAACT,IAAI;QAC9C4B,MAAM,EAAEA,CAAA,KACN,CAACnB,KAAK,CAACP,aAAa,IAAAuB,YAAA;UAAA,OAEXT,UAAU;UAAA,SACR,CAAC,kBAAkB,CAAC;UAAA,SACpBC,eAAe,CAACG;QAAK;MAE/B;IAIX,CAAC,CAAC;IAEF,OAAO,CAAC,CAAC;EACX;AACF,CAAC,CAAC"}
|
|
@@ -49,7 +49,8 @@
|
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
&--active,
|
|
52
|
+
&--active,
|
|
53
|
+
.y-button--active {
|
|
53
54
|
font-weight: 700;
|
|
54
55
|
color: var(--y-tab-active-color);
|
|
55
56
|
|
|
@@ -58,12 +59,14 @@
|
|
|
58
59
|
}
|
|
59
60
|
}
|
|
60
61
|
|
|
61
|
-
&:hover:not(&--active) &__indicator,
|
|
62
|
+
&:hover:not(&--active) &__indicator,
|
|
63
|
+
&:hover:not(.y-button--active) &__indicator {
|
|
62
64
|
transform: scaleY(1);
|
|
63
65
|
color: var(--y-tab-hover-indicator-color);
|
|
64
66
|
}
|
|
65
67
|
|
|
66
|
-
&--active &__indicator,
|
|
68
|
+
&--active &__indicator,
|
|
69
|
+
.y-button--active &__indicator {
|
|
67
70
|
color: var(--y-tab-active-indicator-color);
|
|
68
71
|
transform: scaleY(1);
|
|
69
72
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { createVNode as _createVNode, mergeProps as _mergeProps } from "vue";
|
|
2
|
-
import { computed
|
|
2
|
+
import { computed } from 'vue';
|
|
3
3
|
import { pressChoicePropsOptions, useChoice } from "../../composables/choice.mjs";
|
|
4
4
|
import { useRender } from "../../composables/component.mjs";
|
|
5
5
|
import { useResizeObserver } from "../../composables/resize-observer.mjs";
|
|
6
|
-
import { propsFactory } from "../../util/
|
|
6
|
+
import { defineComponent, propsFactory } from "../../util/component/index.mjs";
|
|
7
7
|
import { YTab } from "./YTab.mjs";
|
|
8
8
|
import { Y_TABS_KEY } from "./shared.mjs";
|
|
9
9
|
import "./YTabs.scss";
|