yuyeon 0.1.2-rc.2 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/style.css +1 -1
- package/dist/yuyeon.js +5052 -6665
- package/dist/yuyeon.umd.cjs +4 -26
- package/lib/abstract/items.mjs +1 -1
- package/lib/abstract/items.mjs.map +1 -1
- package/lib/components/alert/YAlert.mjs +2 -1
- package/lib/components/alert/YAlert.mjs.map +1 -1
- package/lib/components/alert/YAlert.scss +75 -76
- package/lib/components/alert/index.mjs.map +1 -1
- package/lib/components/app/YApp.mjs +3 -2
- package/lib/components/app/YApp.mjs.map +1 -1
- package/lib/components/app/YApp.scss +14 -14
- package/lib/components/app/index.mjs.map +1 -1
- package/lib/components/badge/YBadge.mjs +2 -2
- package/lib/components/badge/YBadge.mjs.map +1 -1
- package/lib/components/badge/YBadge.scss +76 -76
- package/lib/components/badge/index.mjs.map +1 -1
- package/lib/components/bench/YBench.mjs +2 -3
- package/lib/components/bench/YBench.mjs.map +1 -1
- package/lib/components/bench/index.mjs.map +1 -1
- package/lib/components/button/YButton.mjs +2 -2
- package/lib/components/button/YButton.mjs.map +1 -1
- package/lib/components/button/YButton.scss +128 -129
- package/lib/components/button/index.mjs.map +1 -1
- package/lib/components/card/YCard.mjs +3 -2
- package/lib/components/card/YCard.mjs.map +1 -1
- package/lib/components/card/YCard.scss +45 -43
- package/lib/components/card/YCardBody.mjs +2 -1
- package/lib/components/card/YCardBody.mjs.map +1 -1
- package/lib/components/card/YCardFooter.mjs +2 -1
- package/lib/components/card/YCardFooter.mjs.map +1 -1
- package/lib/components/card/YCardHeader.mjs +2 -1
- package/lib/components/card/YCardHeader.mjs.map +1 -1
- package/lib/components/checkbox/YCheckbox.mjs +2 -2
- package/lib/components/checkbox/YCheckbox.mjs.map +1 -1
- package/lib/components/checkbox/YCheckbox.scss +48 -48
- package/lib/components/checkbox/YInputCheckbox.mjs +2 -1
- package/lib/components/checkbox/YInputCheckbox.mjs.map +1 -1
- package/lib/components/checkbox/YInputCheckbox.scss +84 -86
- package/lib/components/checkbox/index.mjs +1 -1
- package/lib/components/checkbox/index.mjs.map +1 -1
- package/lib/components/chip/YChip.mjs +2 -2
- package/lib/components/chip/YChip.mjs.map +1 -1
- package/lib/components/date-picker/YDateCalendar.mjs +3 -3
- package/lib/components/date-picker/YDateCalendar.mjs.map +1 -1
- package/lib/components/date-picker/YDateCalendar.scss +84 -82
- package/lib/components/date-picker/YDatePicker.mjs +2 -2
- package/lib/components/date-picker/YDatePicker.mjs.map +1 -1
- package/lib/components/date-picker/YDatePicker.scss +3 -3
- package/lib/components/date-picker/YDatePickerControl.mjs +2 -2
- package/lib/components/date-picker/YDatePickerControl.mjs.map +1 -1
- package/lib/components/date-picker/YDatePickerControl.scss +35 -35
- package/lib/components/date-picker/YMonthPicker.mjs +3 -3
- package/lib/components/date-picker/YMonthPicker.mjs.map +1 -1
- package/lib/components/date-picker/YMonthPicker.scss +25 -25
- package/lib/components/date-picker/YYearPicker.mjs +4 -3
- package/lib/components/date-picker/YYearPicker.mjs.map +1 -1
- package/lib/components/date-picker/YYearPicker.scss +23 -23
- package/lib/components/date-picker/index.mjs.map +1 -1
- package/lib/components/dialog/YDialog.mjs +3 -3
- package/lib/components/dialog/YDialog.mjs.map +1 -1
- package/lib/components/dialog/YDialog.scss +50 -50
- package/lib/components/dialog/index.mjs.map +1 -1
- package/lib/components/divider/YDivider.mjs +1 -2
- package/lib/components/divider/YDivider.mjs.map +1 -1
- package/lib/components/divider/YDivider.scss +2 -3
- package/lib/components/divider/index.mjs.map +1 -1
- package/lib/components/dropdown/YDropdown.mjs +2 -2
- package/lib/components/dropdown/YDropdown.mjs.map +1 -1
- package/lib/components/dropdown/YDropdown.scss +27 -28
- package/lib/components/dropdown/index.mjs.map +1 -1
- package/lib/components/field-input/YFieldInput.mjs +2 -2
- package/lib/components/field-input/YFieldInput.mjs.map +1 -1
- package/lib/components/field-input/YFieldInput.scss +66 -66
- package/lib/components/field-input/index.mjs.map +1 -1
- package/lib/components/form/YForm.mjs +3 -2
- package/lib/components/form/YForm.mjs.map +1 -1
- package/lib/components/hover/YHover.mjs +2 -2
- package/lib/components/hover/YHover.mjs.map +1 -1
- package/lib/components/hover/index.mjs.map +1 -1
- package/lib/components/icon/YIcon.mjs +4 -3
- package/lib/components/icon/YIcon.mjs.map +1 -1
- package/lib/components/icon/YIcon.scss +18 -18
- package/lib/components/icon/index.mjs.map +1 -1
- package/lib/components/icons/YIconCheckbox.mjs +1 -1
- package/lib/components/icons/YIconCheckbox.mjs.map +1 -1
- package/lib/components/icons/YIconCheckbox.scss +60 -60
- package/lib/components/icons/YIconClear.mjs +1 -1
- package/lib/components/icons/YIconClear.mjs.map +1 -1
- package/lib/components/icons/YIconDropdown.mjs +1 -1
- package/lib/components/icons/YIconDropdown.mjs.map +1 -1
- package/lib/components/icons/YIconExpand.mjs +1 -1
- package/lib/components/icons/YIconExpand.mjs.map +1 -1
- package/lib/components/icons/YIconPageControl.mjs +1 -1
- package/lib/components/icons/YIconPageControl.mjs.map +1 -1
- package/lib/components/icons/YIconSort.mjs +1 -1
- package/lib/components/icons/YIconSort.mjs.map +1 -1
- package/lib/components/icons/YIconSort.scss +24 -23
- package/lib/components/icons/index.mjs +1 -1
- package/lib/components/icons/index.mjs.map +1 -1
- package/lib/components/img/YImg.mjs +2 -3
- package/lib/components/img/YImg.mjs.map +1 -1
- package/lib/components/input/YInput.mjs +3 -4
- package/lib/components/input/YInput.mjs.map +1 -1
- package/lib/components/input/YInput.scss +258 -254
- package/lib/components/input/index.mjs.map +1 -1
- package/lib/components/ip-field/YIpField.scss +74 -74
- package/lib/components/ip-field/YIpv4Field.mjs +2 -2
- package/lib/components/ip-field/YIpv4Field.mjs.map +1 -1
- package/lib/components/ip-field/index.mjs.map +1 -1
- package/lib/components/layer/YLayer.mjs +2 -2
- package/lib/components/layer/YLayer.mjs.map +1 -1
- package/lib/components/layer/YLayer.scss +38 -38
- package/lib/components/layer/active-delay.mjs.map +1 -1
- package/lib/components/layer/active-stack.mjs.map +1 -1
- package/lib/components/layer/base.mjs +1 -1
- package/lib/components/layer/base.mjs.map +1 -1
- package/lib/components/layer/content.mjs +1 -1
- package/lib/components/layer/content.mjs.map +1 -1
- package/lib/components/layer/scroll-strategies.mjs +1 -1
- package/lib/components/layer/scroll-strategies.mjs.map +1 -1
- package/lib/components/list/YList.mjs +2 -2
- package/lib/components/list/YList.mjs.map +1 -1
- package/lib/components/list/YList.scss +3 -3
- package/lib/components/list/YListItem.mjs +2 -2
- package/lib/components/list/YListItem.mjs.map +1 -1
- package/lib/components/list/YListItem.scss +62 -62
- package/lib/components/list/index.mjs.map +1 -1
- package/lib/components/loading/YSpinnerRing.mjs +1 -1
- package/lib/components/loading/YSpinnerRing.mjs.map +1 -1
- package/lib/components/menu/YMenu.mjs +5 -4
- package/lib/components/menu/YMenu.mjs.map +1 -1
- package/lib/components/menu/YMenu.scss +25 -22
- package/lib/components/menu/index.mjs.map +1 -1
- package/lib/components/navigation/YNavigation.mjs +2 -1
- package/lib/components/navigation/YNavigation.mjs.map +1 -1
- package/lib/components/pagination/YPagination.mjs +2 -2
- package/lib/components/pagination/YPagination.mjs.map +1 -1
- package/lib/components/pagination/YPagination.scss +52 -51
- package/lib/components/pagination/index.mjs.map +1 -1
- package/lib/components/panel/YDividePanel.mjs.map +1 -1
- package/lib/components/panel/YDividePanel.scss +43 -43
- package/lib/components/panel/index.mjs.map +1 -1
- package/lib/components/plate/YPlate.mjs +2 -1
- package/lib/components/plate/YPlate.mjs.map +1 -1
- package/lib/components/plate/YPlate.scss +9 -9
- package/lib/components/progress-bar/YProgressBar.mjs +40 -52
- package/lib/components/progress-bar/YProgressBar.mjs.map +1 -1
- package/lib/components/progress-bar/YProgressBar.scss +10 -4
- package/lib/components/select/YSelect.mjs +3 -5
- package/lib/components/select/YSelect.mjs.map +1 -1
- package/lib/components/select/YSelect.scss +43 -43
- package/lib/components/select/index.mjs.map +1 -1
- package/lib/components/snackbar/YSnackbar.mjs +3 -4
- package/lib/components/snackbar/YSnackbar.mjs.map +1 -1
- package/lib/components/snackbar/YSnackbar.scss +38 -38
- package/lib/components/switch/YSwitch.mjs +2 -1
- package/lib/components/switch/YSwitch.mjs.map +1 -1
- package/lib/components/switch/YSwitch.scss +204 -198
- package/lib/components/tab/YTab.mjs +2 -3
- package/lib/components/tab/YTab.mjs.map +1 -1
- package/lib/components/tab/YTab.scss +6 -3
- package/lib/components/tab/YTabs.mjs +2 -2
- package/lib/components/tab/YTabs.mjs.map +1 -1
- package/lib/components/tab/YTabs.scss +8 -10
- package/lib/components/tab/index.mjs.map +1 -1
- package/lib/components/tab/types.mjs.map +1 -1
- package/lib/components/table/YDataTable.mjs +5 -5
- package/lib/components/table/YDataTable.mjs.map +1 -1
- package/lib/components/table/YDataTableBody.mjs +2 -2
- package/lib/components/table/YDataTableBody.mjs.map +1 -1
- package/lib/components/table/YDataTableCell.mjs +2 -1
- package/lib/components/table/YDataTableCell.mjs.map +1 -1
- package/lib/components/table/YDataTableControl.mjs +1 -1
- package/lib/components/table/YDataTableControl.mjs.map +1 -1
- package/lib/components/table/YDataTableControl.scss +7 -7
- package/lib/components/table/YDataTableHead.mjs +2 -3
- package/lib/components/table/YDataTableHead.mjs.map +1 -1
- package/lib/components/table/YDataTableLayer.mjs +2 -1
- package/lib/components/table/YDataTableLayer.mjs.map +1 -1
- package/lib/components/table/YDataTableRow.mjs +3 -2
- package/lib/components/table/YDataTableRow.mjs.map +1 -1
- package/lib/components/table/YDataTableServer.mjs +3 -4
- package/lib/components/table/YDataTableServer.mjs.map +1 -1
- package/lib/components/table/YTable.mjs +2 -2
- package/lib/components/table/YTable.mjs.map +1 -1
- package/lib/components/table/YTable.scss +157 -152
- package/lib/components/table/composibles/header.mjs +1 -1
- package/lib/components/table/composibles/header.mjs.map +1 -1
- package/lib/components/table/composibles/items.mjs +1 -1
- package/lib/components/table/composibles/items.mjs.map +1 -1
- package/lib/components/table/composibles/options.mjs.map +1 -1
- package/lib/components/table/composibles/pagination.mjs +1 -1
- package/lib/components/table/composibles/pagination.mjs.map +1 -1
- package/lib/components/table/composibles/selection.mjs +2 -2
- package/lib/components/table/composibles/selection.mjs.map +1 -1
- package/lib/components/table/composibles/sorted-items.mjs +1 -1
- package/lib/components/table/composibles/sorted-items.mjs.map +1 -1
- package/lib/components/table/composibles/sorting.mjs +2 -3
- package/lib/components/table/composibles/sorting.mjs.map +1 -1
- package/lib/components/table/index.mjs.map +1 -1
- package/lib/components/table/types/common.mjs.map +1 -1
- package/lib/components/table/types/header.mjs.map +1 -1
- package/lib/components/table/types/index.mjs.map +1 -1
- package/lib/components/table/types/row.mjs.map +1 -1
- package/lib/components/text-ellipsis/YTextEllipsis.mjs +4 -2
- package/lib/components/text-ellipsis/YTextEllipsis.mjs.map +1 -1
- package/lib/components/text-ellipsis/YTextEllipsis.scss +43 -43
- package/lib/components/text-ellipsis/index.mjs.map +1 -1
- package/lib/components/text-highlighter/YTextHighlighter.mjs +2 -1
- package/lib/components/text-highlighter/YTextHighlighter.mjs.map +1 -1
- package/lib/components/text-interpolation/YTi.mjs +2 -1
- package/lib/components/text-interpolation/YTi.mjs.map +1 -1
- package/lib/components/text-interpolation/index.mjs.map +1 -1
- package/lib/components/textarea/YTextarea.mjs +2 -2
- package/lib/components/textarea/YTextarea.mjs.map +1 -1
- package/lib/components/textarea/YTextarea.scss +25 -25
- package/lib/components/textarea/index.mjs.map +1 -1
- package/lib/components/toggle-button/YToggleButton.mjs.map +1 -1
- package/lib/components/toggle-button/index.mjs.map +1 -1
- package/lib/components/tooltip/YTooltip.mjs +4 -4
- package/lib/components/tooltip/YTooltip.mjs.map +1 -1
- package/lib/components/tooltip/YTooltip.scss +19 -19
- package/lib/components/tooltip/index.mjs.map +1 -1
- package/lib/components/transitions/expand-transition.mjs.map +1 -1
- package/lib/components/tree-view/YTreeView.mjs +1 -1
- package/lib/components/tree-view/YTreeView.mjs.map +1 -1
- package/lib/components/tree-view/YTreeView.scss +81 -79
- package/lib/components/tree-view/YTreeViewNode.mjs +3 -2
- package/lib/components/tree-view/YTreeViewNode.mjs.map +1 -1
- package/lib/components/tree-view/index.mjs.map +1 -1
- package/lib/components/tree-view/types.mjs.map +1 -1
- package/lib/components/tree-view/util.mjs.map +1 -1
- package/lib/composables/choice.mjs +1 -1
- package/lib/composables/choice.mjs.map +1 -1
- package/lib/composables/communication.mjs.map +1 -1
- package/lib/composables/component.mjs.map +1 -1
- package/lib/composables/coordinate/arrangement.mjs.map +1 -1
- package/lib/composables/coordinate/index.mjs +1 -1
- package/lib/composables/coordinate/index.mjs.map +1 -1
- package/lib/composables/coordinate/levitation.mjs.map +1 -1
- package/lib/composables/coordinate/utils/point.mjs.map +1 -1
- package/lib/composables/date/factory.mjs.map +1 -1
- package/lib/composables/date/index.mjs +2 -2
- package/lib/composables/date/index.mjs.map +1 -1
- package/lib/composables/date/setting.mjs.map +1 -1
- package/lib/composables/date/types.mjs.map +1 -1
- package/lib/composables/defaults/index.mjs +99 -0
- package/lib/composables/defaults/index.mjs.map +1 -0
- package/lib/composables/defaults/share.mjs +2 -0
- package/lib/composables/defaults/share.mjs.map +1 -0
- package/lib/composables/defaults/types.mjs +2 -0
- package/lib/composables/defaults/types.mjs.map +1 -0
- package/lib/composables/dimension.mjs +1 -1
- package/lib/composables/dimension.mjs.map +1 -1
- package/lib/composables/focus.mjs +2 -2
- package/lib/composables/focus.mjs.map +1 -1
- package/lib/composables/form.mjs +1 -1
- package/lib/composables/form.mjs.map +1 -1
- package/lib/composables/i18n/index.mjs +2 -2
- package/lib/composables/i18n/index.mjs.map +1 -1
- package/lib/composables/icon.mjs +5 -4
- package/lib/composables/icon.mjs.map +1 -1
- package/lib/composables/layer-group.mjs +1 -1
- package/lib/composables/layer-group.mjs.map +1 -1
- package/lib/composables/layout.mjs +1 -1
- package/lib/composables/layout.mjs.map +1 -1
- package/lib/composables/list-items.mjs +1 -1
- package/lib/composables/list-items.mjs.map +1 -1
- package/lib/composables/progress.mjs +7 -2
- package/lib/composables/progress.mjs.map +1 -1
- package/lib/composables/ref.mjs +1 -1
- package/lib/composables/ref.mjs.map +1 -1
- package/lib/composables/resize-observer.mjs +2 -4
- package/lib/composables/resize-observer.mjs.map +1 -1
- package/lib/composables/scope.mjs +1 -2
- package/lib/composables/scope.mjs.map +1 -1
- package/lib/composables/theme/factory.mjs.map +1 -1
- package/lib/composables/theme/index.mjs +2 -2
- package/lib/composables/theme/index.mjs.map +1 -1
- package/lib/composables/theme/setting.mjs.map +1 -1
- package/lib/composables/theme/types.mjs.map +1 -1
- package/lib/composables/timing.mjs +1 -1
- package/lib/composables/timing.mjs.map +1 -1
- package/lib/composables/transition.mjs +1 -1
- package/lib/composables/transition.mjs.map +1 -1
- package/lib/composables/validation.mjs +1 -1
- package/lib/composables/validation.mjs.map +1 -1
- package/lib/composables/vue-router.mjs +1 -1
- package/lib/composables/vue-router.mjs.map +1 -1
- package/lib/index.mjs +7 -2
- package/lib/index.mjs.map +1 -1
- package/lib/util/anchor.mjs.map +1 -1
- package/lib/util/array.mjs.map +1 -1
- package/lib/util/component/component.mjs +22 -0
- package/lib/util/component/component.mjs.map +1 -0
- package/lib/util/component/index.mjs +65 -0
- package/lib/util/component/index.mjs.map +1 -0
- package/lib/util/component/inject-self.mjs +10 -0
- package/lib/util/component/inject-self.mjs.map +1 -0
- package/lib/util/component/props.mjs +41 -0
- package/lib/util/component/props.mjs.map +1 -0
- package/lib/util/component/types.mjs +2 -0
- package/lib/util/component/types.mjs.map +1 -0
- package/lib/util/date/index.mjs.map +1 -1
- package/lib/util/dom.mjs.map +1 -1
- package/lib/util/index.mjs +1 -1
- package/lib/util/index.mjs.map +1 -1
- package/lib/util/reactivity.mjs +3 -3
- package/lib/util/reactivity.mjs.map +1 -1
- package/lib/util/rect.mjs.map +1 -1
- package/lib/util/ui.mjs.map +1 -1
- package/lib/util/validation.mjs.map +1 -1
- package/lib/util/vue-component/index.mjs +63 -0
- package/lib/util/vue-component/index.mjs.map +1 -0
- package/lib/util/vue-component/props.mjs +37 -0
- package/lib/util/vue-component/props.mjs.map +1 -0
- package/lib/util/vue-component/types.mjs +2 -0
- package/lib/util/vue-component/types.mjs.map +1 -0
- package/package.json +1 -1
- package/types/abstract/items.d.ts +4 -4
- package/types/components/alert/YAlert.d.ts +2 -13
- package/types/components/app/YApp.d.ts +1 -1
- package/types/components/badge/YBadge.d.ts +7 -41
- package/types/components/bench/YBench.d.ts +1 -1
- package/types/components/button/YButton.d.ts +10 -69
- package/types/components/card/YCard.d.ts +1 -6
- package/types/components/card/YCardBody.d.ts +1 -1
- package/types/components/card/YCardFooter.d.ts +1 -1
- package/types/components/card/YCardHeader.d.ts +1 -1
- package/types/components/checkbox/YCheckbox.d.ts +1 -26
- package/types/components/checkbox/YInputCheckbox.d.ts +2 -26
- package/types/components/checkbox/index.d.ts +1 -0
- package/types/components/chip/YChip.d.ts +2 -13
- package/types/components/date-picker/YDateCalendar.d.ts +7 -35
- package/types/components/date-picker/YDatePicker.d.ts +19 -48
- package/types/components/date-picker/YDatePickerControl.d.ts +12 -44
- package/types/components/date-picker/YMonthPicker.d.ts +3 -7
- package/types/components/date-picker/YYearPicker.d.ts +3 -9
- package/types/components/dialog/YDialog.d.ts +66 -309
- package/types/components/divider/YDivider.d.ts +1 -3
- package/types/components/dropdown/YDropdown.d.ts +68 -241
- package/types/components/field-input/YFieldInput.d.ts +16 -122
- package/types/components/form/YForm.d.ts +2 -24
- package/types/components/hover/YHover.d.ts +4 -26
- package/types/components/icon/YIcon.d.ts +6 -21
- package/types/components/icons/YIconCheckbox.d.ts +1 -9
- package/types/components/icons/YIconClear.d.ts +1 -1
- package/types/components/icons/YIconDropdown.d.ts +1 -1
- package/types/components/icons/YIconExpand.d.ts +1 -1
- package/types/components/icons/YIconPageControl.d.ts +1 -8
- package/types/components/icons/YIconSort.d.ts +1 -10
- package/types/components/icons/index.d.ts +8 -46
- package/types/components/img/YImg.d.ts +7 -47
- package/types/components/input/YInput.d.ts +13 -101
- package/types/components/ip-field/YIpv4Field.d.ts +3 -71
- package/types/components/layer/YLayer.d.ts +38 -155
- package/types/components/layer/content.d.ts +1 -1
- package/types/components/layer/scroll-strategies.d.ts +1 -1
- package/types/components/list/YList.d.ts +1 -6
- package/types/components/list/YListItem.d.ts +3 -21
- package/types/components/loading/YSpinnerRing.d.ts +1 -1
- package/types/components/menu/YMenu.d.ts +20 -285
- package/types/components/navigation/YNavigation.d.ts +1 -1
- package/types/components/pagination/YPagination.d.ts +20 -60
- package/types/components/plate/YPlate.d.ts +1 -3
- package/types/components/progress-bar/YProgressBar.d.ts +3 -43
- package/types/components/select/YSelect.d.ts +220 -844
- package/types/components/snackbar/YSnackbar.d.ts +43 -168
- package/types/components/switch/YSwitch.d.ts +1 -43
- package/types/components/tab/YTab.d.ts +14 -80
- package/types/components/tab/YTabs.d.ts +6 -39
- package/types/components/table/YDataTable.d.ts +17 -166
- package/types/components/table/YDataTableBody.d.ts +3 -26
- package/types/components/table/YDataTableCell.d.ts +1 -30
- package/types/components/table/YDataTableControl.d.ts +3 -18
- package/types/components/table/YDataTableHead.d.ts +3 -21
- package/types/components/table/YDataTableLayer.d.ts +1 -3
- package/types/components/table/YDataTableRow.d.ts +1 -9
- package/types/components/table/YDataTableServer.d.ts +20 -172
- package/types/components/table/YTable.d.ts +5 -24
- package/types/components/table/composibles/header.d.ts +1 -1
- package/types/components/table/composibles/items.d.ts +3 -3
- package/types/components/table/composibles/pagination.d.ts +3 -3
- package/types/components/table/composibles/selection.d.ts +4 -4
- package/types/components/table/composibles/sorting.d.ts +1 -1
- package/types/components/table/types/index.d.ts +1 -1
- package/types/components/text-ellipsis/YTextEllipsis.d.ts +1 -8
- package/types/components/text-highlighter/YTextHighlighter.d.ts +2 -17
- package/types/components/text-interpolation/YTi.d.ts +1 -10
- package/types/components/textarea/YTextarea.d.ts +20 -116
- package/types/components/tooltip/YTooltip.d.ts +30 -264
- package/types/components/tree-view/YTreeView.d.ts +4 -4
- package/types/components/tree-view/YTreeViewNode.d.ts +10 -67
- package/types/composables/choice.d.ts +1 -1
- package/types/composables/coordinate/index.d.ts +8 -8
- package/types/composables/coordinate/utils/point.d.ts +1 -1
- package/types/composables/defaults/index.d.ts +11 -0
- package/types/composables/defaults/share.d.ts +4 -0
- package/types/composables/defaults/types.d.ts +12 -0
- package/types/composables/form.d.ts +3 -3
- package/types/composables/icon.d.ts +5 -22
- package/types/composables/layer-group.d.ts +1 -1
- package/types/composables/list-items.d.ts +10 -10
- package/types/composables/progress.d.ts +1 -0
- package/types/composables/timing.d.ts +1 -1
- package/types/composables/transition.d.ts +1 -1
- package/types/composables/validation.d.ts +3 -3
- package/types/composables/vue-router.d.ts +1 -1
- package/types/globals.d.ts +1 -0
- package/types/util/Rect.d.ts +1 -1
- package/types/util/component/component.d.ts +5 -0
- package/types/util/component/index.d.ts +11 -0
- package/types/util/component/inject-self.d.ts +3 -0
- package/types/util/component/props.d.ts +32 -0
- package/types/util/component/types.d.ts +21 -0
- package/types/util/index.d.ts +1 -1
- package/types/util/vue-component/index.d.ts +10 -0
- package/types/util/vue-component/props.d.ts +31 -0
- package/types/util/vue-component/types.d.ts +4 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"YDataTableServer.mjs","names":["toRef","computed","defineComponent","provide","useRender","useResizeObserver","toStyleSizeValue","chooseProps","propsFactory","pressDataTableProps","YDataTableBody","YDataTableControl","YDataTableHead","YDataTableLayer","YTable","createHeader","useItems","useOptions","createPagination","pressDataTablePaginationProps","providePagination","provideSelection","createSorting","provideSorting","pressDataTableServerProps","total","type","Number","String","required","YDataTableServer","name","components","props","emits","value","page","pageSize","sortBy","options","click:row","e","setup","_ref","slots","emit","multiSort","parseInt","columns","headers","enableSelect","items","toggleSort","pageLength","setPageSize","setPage","isSelected","select","selectAll","toggleSelect","someSelected","allSelected","allItems","pageItems","resizeObservedRef","headObserveRef","contentRect","headRect","search","slotProps","yDataTableHeadProps","yDataTableBodyProps","yTableProps","_createVNode","_mergeProps","loading","length","hideNoData","height","top","leading","_Fragment","default","thead","tbody","tfoot","trailing","bottom","prepend"],"sources":["../../../src/components/table/YDataTableServer.tsx"],"sourcesContent":["import { toRef } from '@vue/runtime-core';\nimport { PropType, computed, defineComponent, provide } from 'vue';\n\nimport { useRender } from '../../composables/component';\nimport { useResizeObserver } from '../../composables/resize-observer';\nimport { toStyleSizeValue } from '../../util';\nimport { chooseProps, propsFactory } from '../../util/vue-component';\nimport { pressDataTableProps } from './YDataTable';\nimport { YDataTableBody } from './YDataTableBody';\nimport { YDataTableControl } from './YDataTableControl';\nimport { YDataTableHead } from './YDataTableHead';\nimport { YDataTableLayer } from './YDataTableLayer';\nimport { YTable } from './YTable';\nimport { createHeader } from './composibles/header';\nimport { useItems } from './composibles/items';\nimport { useOptions } from './composibles/options';\nimport {\n createPagination,\n pressDataTablePaginationProps,\n providePagination,\n} from './composibles/pagination';\nimport { provideSelection } from './composibles/selection';\nimport { createSorting, provideSorting } from './composibles/sorting';\nimport { YDataTableSlotProps } from './types';\n\nexport const pressDataTableServerProps = propsFactory(\n {\n total: {\n type: [Number, String] as PropType<number | string>,\n required: true,\n },\n ...pressDataTablePaginationProps(),\n ...pressDataTableProps(),\n },\n 'YDataTableServer',\n);\n\nexport const YDataTableServer = defineComponent({\n name: 'YDataTableServer',\n components: {\n YTable,\n YDataTableLayer,\n YDataTableHead,\n YDataTableBody,\n YDataTableControl,\n },\n props: {\n ...pressDataTableServerProps(),\n },\n emits: {\n 'update:modelValue': (value: any[]) => true,\n 'update:page': (page: number) => true,\n 'update:pageSize': (pageSize: number) => true,\n 'update:sortBy': (sortBy: any) => true,\n 'update:options': (options: any) => true,\n 'click:row': (e: Event, value: { row: any }) => true,\n },\n setup(props, { slots, emit }) {\n const { page, pageSize } = createPagination(props);\n const { sortBy, multiSort } = createSorting(props);\n const total = computed(() => parseInt(props.total as string));\n const { columns, headers } = createHeader(props, {\n enableSelect: toRef(props, 'enableSelect'),\n });\n const { items } = useItems(props, columns);\n\n const { toggleSort } = provideSorting({ sortBy, multiSort, page });\n const { pageLength, setPageSize, setPage } = providePagination({\n page,\n pageSize,\n total,\n });\n const {\n isSelected,\n select,\n selectAll,\n toggleSelect,\n someSelected,\n allSelected,\n } = provideSelection(props, { allItems: items, pageItems: items });\n\n const { resizeObservedRef: headObserveRef, contentRect: headRect } =\n useResizeObserver();\n\n useOptions(\n {\n page,\n pageSize,\n search: toRef(props, 'search'),\n sortBy,\n },\n emit,\n );\n\n provide('y-data-table', {\n toggleSort,\n sortBy,\n headRect,\n });\n\n const slotProps = computed<YDataTableSlotProps>(() => {\n return {\n // pagination\n page: page.value,\n pageSize: pageSize.value,\n pageLength: pageLength.value,\n setPageSize,\n setPage,\n // sorting\n sortBy: sortBy.value,\n toggleSort,\n // selection\n someSelected: someSelected.value,\n allSelected: allSelected.value,\n isSelected,\n select,\n selectAll,\n toggleSelect,\n //\n items: items.value,\n columns: columns.value,\n headers: headers.value,\n };\n });\n\n useRender(() => {\n const yDataTableHeadProps = chooseProps(props, YDataTableHead.props);\n const yDataTableBodyProps = chooseProps(props, YDataTableBody.props);\n const yTableProps = chooseProps(props, YTable.props);\n return (\n <YTable\n class={[\n 'y-data-table',\n {\n 'y-data-table--no-data':\n !props.loading && props.items.length < 1 && !props.hideNoData,\n },\n ]}\n {...yTableProps}\n style={{\n '--y-table-head-height': toStyleSizeValue(headRect.value?.height),\n }}\n >\n {{\n top: () => slots.top?.(slotProps.value),\n leading: () =>\n slots.leading ? (\n slots.leading(slotProps.value)\n ) : (\n <>\n <YDataTableLayer v-slots={slots}></YDataTableLayer>\n </>\n ),\n default: () =>\n slots.default ? (\n slots.default(slotProps.value)\n ) : (\n <>\n <thead ref={headObserveRef}>\n <YDataTableHead\n v-slots={slots}\n {...yDataTableHeadProps}\n ></YDataTableHead>\n </thead>\n {slots.thead?.(slotProps.value)}\n <tbody>\n <YDataTableBody\n v-slots={slots}\n {...yDataTableBodyProps}\n items={items.value}\n ></YDataTableBody>\n </tbody>\n {slots.tbody?.(slotProps.value)}\n {slots.tfoot?.(slotProps.value)}\n </>\n ),\n trailing: () => slots.trailing?.(slotProps.value),\n bottom: () =>\n slots.bottom ? (\n slots.bottom(slotProps.value)\n ) : (\n <YDataTableControl\n v-slots={{\n prepend: slots['control.prepend'],\n }}\n ></YDataTableControl>\n ),\n }}\n </YTable>\n );\n });\n },\n});\n\nexport type YDataTableServer = InstanceType<typeof YDataTableServer>;\n"],"mappings":";AAAA,SAASA,KAAK,QAAQ,mBAAmB;AACzC,SAAmBC,QAAQ,EAAEC,eAAe,EAAEC,OAAO,QAAQ,KAAK;AAAC,SAE1DC,SAAS;AAAA,SACTC,iBAAiB;AAAA,SACjBC,gBAAgB;AAAA,SAChBC,WAAW,EAAEC,YAAY;AAAA,SACzBC,mBAAmB;AAAA,SACnBC,cAAc;AAAA,SACdC,iBAAiB;AAAA,SACjBC,cAAc;AAAA,SACdC,eAAe;AAAA,SACfC,MAAM;AAAA,SACNC,YAAY;AAAA,SACZC,QAAQ;AAAA,SACRC,UAAU;AAAA,SAEjBC,gBAAgB,EAChBC,6BAA6B,EAC7BC,iBAAiB;AAAA,SAEVC,gBAAgB;AAAA,SAChBC,aAAa,EAAEC,cAAc;AAGtC,OAAO,MAAMC,yBAAyB,GAAGhB,YAAY,CACnD;EACEiB,KAAK,EAAE;IACLC,IAAI,EAAE,CAACC,MAAM,EAAEC,MAAM,CAA8B;IACnDC,QAAQ,EAAE;EACZ,CAAC;EACD,GAAGV,6BAA6B,CAAC,CAAC;EAClC,GAAGV,mBAAmB,CAAC;AACzB,CAAC,EACD,kBACF,CAAC;AAED,OAAO,MAAMqB,gBAAgB,GAAG5B,eAAe,CAAC;EAC9C6B,IAAI,EAAE,kBAAkB;EACxBC,UAAU,EAAE;IACVlB,MAAM;IACND,eAAe;IACfD,cAAc;IACdF,cAAc;IACdC;EACF,CAAC;EACDsB,KAAK,EAAE;IACL,GAAGT,yBAAyB,CAAC;EAC/B,CAAC;EACDU,KAAK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,MAAM,EAAEA,CAAA,KACN3C,KAAK,CAAC2C,MAAM,GACV3C,KAAK,CAAC2C,MAAM,CAAClB,SAAS,CAAClC,KAAK,CAAC,GAAAsC,YAAA,CAAA9D,iBAAA,QAGlB;UACP6E,OAAO,EAAE5C,KAAK,CAAC,iBAAiB;QAClC,CAAC;MAEJ;IAIX,CAAC,CAAC;EACJ;AACF,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"YDataTableServer.mjs","names":["computed","provide","toRef","useRender","useResizeObserver","chooseProps","defineComponent","propsFactory","toStyleSizeValue","pressDataTableProps","YDataTableBody","YDataTableControl","YDataTableHead","YDataTableLayer","YTable","createHeader","useItems","useOptions","createPagination","pressDataTablePaginationProps","providePagination","provideSelection","createSorting","provideSorting","pressDataTableServerProps","total","type","Number","String","required","YDataTableServer","name","components","props","emits","value","page","pageSize","sortBy","options","click:row","e","setup","_ref","slots","emit","multiSort","parseInt","columns","headers","enableSelect","items","toggleSort","pageLength","setPageSize","setPage","isSelected","select","selectAll","toggleSelect","someSelected","allSelected","allItems","pageItems","resizeObservedRef","headObserveRef","contentRect","headRect","search","slotProps","yDataTableHeadProps","yDataTableBodyProps","yTableProps","_createVNode","_mergeProps","loading","length","hideNoData","height","top","leading","_Fragment","default","thead","tbody","tfoot","trailing","bottom","prepend"],"sources":["../../../src/components/table/YDataTableServer.tsx"],"sourcesContent":["import { type PropType, computed, provide, toRef } from 'vue';\n\nimport { useRender } from '@/composables/component';\nimport { useResizeObserver } from '@/composables/resize-observer';\nimport { chooseProps, defineComponent, propsFactory } from '@/util/component';\nimport { toStyleSizeValue } from '@/util/ui';\n\nimport { pressDataTableProps } from './YDataTable';\nimport { YDataTableBody } from './YDataTableBody';\nimport { YDataTableControl } from './YDataTableControl';\nimport { YDataTableHead } from './YDataTableHead';\nimport { YDataTableLayer } from './YDataTableLayer';\nimport { YTable } from './YTable';\nimport { createHeader } from './composibles/header';\nimport { useItems } from './composibles/items';\nimport { useOptions } from './composibles/options';\nimport {\n createPagination,\n pressDataTablePaginationProps,\n providePagination,\n} from './composibles/pagination';\nimport { provideSelection } from './composibles/selection';\nimport { createSorting, provideSorting } from './composibles/sorting';\nimport { YDataTableSlotProps } from './types';\n\nexport const pressDataTableServerProps = propsFactory(\n {\n total: {\n type: [Number, String] as PropType<number | string>,\n required: true,\n },\n ...pressDataTablePaginationProps(),\n ...pressDataTableProps(),\n },\n 'YDataTableServer',\n);\n\nexport const YDataTableServer = defineComponent({\n name: 'YDataTableServer',\n components: {\n YTable,\n YDataTableLayer,\n YDataTableHead,\n YDataTableBody,\n YDataTableControl,\n },\n props: {\n ...pressDataTableServerProps(),\n },\n emits: {\n 'update:modelValue': (value: any[]) => true,\n 'update:page': (page: number) => true,\n 'update:pageSize': (pageSize: number) => true,\n 'update:sortBy': (sortBy: any) => true,\n 'update:options': (options: any) => true,\n 'click:row': (e: Event, value: { row: any }) => true,\n },\n setup(props, { slots, emit }) {\n const { page, pageSize } = createPagination(props);\n const { sortBy, multiSort } = createSorting(props);\n const total = computed(() => parseInt(props.total as string));\n const { columns, headers } = createHeader(props, {\n enableSelect: toRef(props, 'enableSelect'),\n });\n const { items } = useItems(props, columns);\n\n const { toggleSort } = provideSorting({ sortBy, multiSort, page });\n const { pageLength, setPageSize, setPage } = providePagination({\n page,\n pageSize,\n total,\n });\n const {\n isSelected,\n select,\n selectAll,\n toggleSelect,\n someSelected,\n allSelected,\n } = provideSelection(props, { allItems: items, pageItems: items });\n\n const { resizeObservedRef: headObserveRef, contentRect: headRect } =\n useResizeObserver();\n\n useOptions(\n {\n page,\n pageSize,\n search: toRef(props, 'search'),\n sortBy,\n },\n emit,\n );\n\n provide('y-data-table', {\n toggleSort,\n sortBy,\n headRect,\n });\n\n const slotProps = computed<YDataTableSlotProps>(() => {\n return {\n // pagination\n page: page.value,\n pageSize: pageSize.value,\n pageLength: pageLength.value,\n setPageSize,\n setPage,\n // sorting\n sortBy: sortBy.value,\n toggleSort,\n // selection\n someSelected: someSelected.value,\n allSelected: allSelected.value,\n isSelected,\n select,\n selectAll,\n toggleSelect,\n //\n items: items.value,\n columns: columns.value,\n headers: headers.value,\n };\n });\n\n useRender(() => {\n const yDataTableHeadProps = chooseProps(props, YDataTableHead.props);\n const yDataTableBodyProps = chooseProps(props, YDataTableBody.props);\n const yTableProps = chooseProps(props, YTable.props);\n return (\n <YTable\n class={[\n 'y-data-table',\n {\n 'y-data-table--no-data':\n !props.loading && props.items.length < 1 && !props.hideNoData,\n },\n ]}\n {...yTableProps}\n style={{\n '--y-table-head-height': toStyleSizeValue(headRect.value?.height),\n }}\n >\n {{\n top: () => slots.top?.(slotProps.value),\n leading: () =>\n slots.leading ? (\n slots.leading(slotProps.value)\n ) : (\n <>\n <YDataTableLayer v-slots={slots}></YDataTableLayer>\n </>\n ),\n default: () =>\n slots.default ? (\n slots.default(slotProps.value)\n ) : (\n <>\n <thead ref={headObserveRef}>\n <YDataTableHead\n v-slots={slots}\n {...yDataTableHeadProps}\n ></YDataTableHead>\n </thead>\n {slots.thead?.(slotProps.value)}\n <tbody>\n <YDataTableBody\n v-slots={slots}\n {...yDataTableBodyProps}\n items={items.value}\n ></YDataTableBody>\n </tbody>\n {slots.tbody?.(slotProps.value)}\n {slots.tfoot?.(slotProps.value)}\n </>\n ),\n trailing: () => slots.trailing?.(slotProps.value),\n bottom: () =>\n slots.bottom ? (\n slots.bottom(slotProps.value)\n ) : (\n <YDataTableControl\n v-slots={{\n prepend: slots['control.prepend'],\n }}\n ></YDataTableControl>\n ),\n }}\n </YTable>\n );\n });\n },\n});\n\nexport type YDataTableServer = InstanceType<typeof YDataTableServer>;\n"],"mappings":";AAAA,SAAwBA,QAAQ,EAAEC,OAAO,EAAEC,KAAK,QAAQ,KAAK;AAAC,SAErDC,SAAS;AAAA,SACTC,iBAAiB;AAAA,SACjBC,WAAW,EAAEC,eAAe,EAAEC,YAAY;AAAA,SAC1CC,gBAAgB;AAAA,SAEhBC,mBAAmB;AAAA,SACnBC,cAAc;AAAA,SACdC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A,CAAAQ,SAAA,SAAAR,YAAA,CAAA5D,eAAA,QAGF+B,KAAK,GAElC;QACHsC,OAAO,EAAEA,CAAA,KACPtC,KAAK,CAACsC,OAAO,GACXtC,KAAK,CAACsC,OAAO,CAACb,SAAS,CAAClC,KAAK,CAAC,GAAAsC,YAAA,CAAAQ,SAAA,SAAAR,YAAA;UAAA,OAGhBR;QAAc,IAAAQ,YAAA,CAAA7D,cAAA,EAGlB0D,mBAAmB,EADd1B,KAAK,KAIjBA,KAAK,CAACuC,KAAK,GAAGd,SAAS,CAAClC,KAAK,CAAC,EAAAsC,YAAA,iBAAAA,YAAA,CAAA/D,cAAA,EAAAgE,WAAA,CAIvBH,mBAAmB;UAAA,SAChBpB,KAAK,CAAChB;QAAK,IAFTS,KAAK,KAKjBA,KAAK,CAACwC,KAAK,GAAGf,SAAS,CAAClC,KAAK,CAAC,EAC9BS,KAAK,CAACyC,KAAK,GAAGhB,SAAS,CAAClC,KAAK,CAAC,EAElC;QACHmD,QAAQ,EAAEA,CAAA,KAAM1C,KAAK,CAAC0C,QAAQ,GAAGjB,SAAS,CAAClC,KAAK,CAAC;QACjDoD,MAAM,EAAEA,CAAA,KACN3C,KAAK,CAAC2C,MAAM,GACV3C,KAAK,CAAC2C,MAAM,CAAClB,SAAS,CAAClC,KAAK,CAAC,GAAAsC,YAAA,CAAA9D,iBAAA,QAGlB;UACP6E,OAAO,EAAE5C,KAAK,CAAC,iBAAiB;QAClC,CAAC;MAEJ;IAIX,CAAC,CAAC;EACJ;AACF,CAAC,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { createVNode as _createVNode } from "vue";
|
|
2
|
-
import {
|
|
2
|
+
import { provide } from 'vue';
|
|
3
3
|
import { useRender } from "../../composables/component.mjs";
|
|
4
4
|
import { useResizeObserver } from "../../composables/resize-observer.mjs";
|
|
5
|
+
import { defineComponent, propsFactory } from "../../util/component/index.mjs";
|
|
5
6
|
import { toStyleSizeValue } from "../../util/ui.mjs";
|
|
6
|
-
import { propsFactory } from "../../util/vue-component.mjs";
|
|
7
7
|
import "./YTable.scss";
|
|
8
8
|
export const pressYTableProps = propsFactory({
|
|
9
9
|
tag: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"YTable.mjs","names":["
|
|
1
|
+
{"version":3,"file":"YTable.mjs","names":["provide","useRender","useResizeObserver","defineComponent","propsFactory","toStyleSizeValue","pressYTableProps","tag","type","String","default","fixedHead","Boolean","height","Number","flexHeight","onScroll","Function","YTable","name","props","emits","setup","_ref","slots","emit","resizeObservedRef","contentRect","wrapperRef","wrapperRect","tableRef","tableRect","containerRect","e","ElTag","containerHeight","value","_createVNode","width","top","leading","trailing","container","bottom"],"sources":["../../../src/components/table/YTable.tsx"],"sourcesContent":["import { type PropType, provide } from 'vue';\n\nimport { useRender } from '@/composables/component';\nimport { useResizeObserver } from '@/composables/resize-observer';\nimport { defineComponent, propsFactory } from '@/util/component';\nimport { toStyleSizeValue } from '@/util/ui';\n\nimport './YTable.scss';\n\nexport const pressYTableProps = propsFactory(\n {\n tag: {\n type: String as PropType<string>,\n default: 'div',\n },\n fixedHead: {\n type: Boolean as PropType<boolean>,\n },\n height: {\n type: [Number, String] as PropType<number | string>,\n },\n flexHeight: {\n type: Boolean as PropType<boolean>,\n },\n onScroll: Function as PropType<(e: Event) => void>,\n },\n 'YTable',\n);\n\nexport const YTable = defineComponent({\n name: 'YTable',\n props: {\n ...pressYTableProps(),\n },\n emits: ['scroll'],\n setup(props, { slots, emit }) {\n const { resizeObservedRef, contentRect } = useResizeObserver();\n const { resizeObservedRef: wrapperRef, contentRect: wrapperRect } =\n useResizeObserver();\n const { resizeObservedRef: tableRef, contentRect: tableRect } =\n useResizeObserver();\n provide('YTable', { containerRect: contentRect });\n\n function onScroll(e: Event) {\n emit('scroll', e);\n }\n\n useRender(() => {\n const ElTag = (props.tag as keyof HTMLElementTagNameMap) ?? 'div';\n const containerHeight = props.flexHeight\n ? contentRect.value?.height ?? props.height\n : props.height;\n return (\n <ElTag\n class={[\n 'y-table',\n {\n 'y-table--fixed-head': props.fixedHead,\n 'y-table--fixed-height': props.flexHeight || props.height,\n 'y-table--flex-height': props.flexHeight,\n },\n ]}\n style={{\n '--y-table-container-width': toStyleSizeValue(\n contentRect.value?.width,\n ),\n '--y-table-wrapper-width': toStyleSizeValue(\n wrapperRect.value?.width,\n ),\n }}\n >\n {slots.top?.()}\n {slots.default ? (\n <div ref={resizeObservedRef} class={['y-table__container']}>\n {slots.leading?.()}\n <div\n ref={wrapperRef}\n class={['y-table__wrapper']}\n style={{\n height: toStyleSizeValue(containerHeight),\n }}\n onScroll={onScroll}\n >\n <table ref={tableRef}>{slots.default()}</table>\n </div>\n {slots.trailing?.()}\n </div>\n ) : (\n slots.container?.(resizeObservedRef, contentRect)\n )}\n {slots.bottom?.()}\n </ElTag>\n );\n });\n },\n});\n\nexport type YTable = InstanceType<typeof YTable>;\n"],"mappings":";AAAA,SAAwBA,OAAO,QAAQ,KAAK;AAAC,SAEpCC,SAAS;AAAA,SACTC,iBAAiB;AAAA,SACjBC,eAAe,EAAEC,YAAY;AAAA,SAC7BC,gBAAgB;AAEzB;AAEA,OAAO,MAAMC,gBAAgB,GAAGF,YAAY,CAC1C;EACEG,GAAG,EAAE;IACHC,IAAI,EAAEC,MAA0B;IAChCC,OAAO,EAAE;EACX,CAAC;EACDC,SAAS,EAAE;IACTH,IAAI,EAAEI;EACR,CAAC;EACDC,MAAM,EAAE;IACNL,IAAI,EAAE,CAACM,MAAM,EAAEL,MAAM;EACvB,CAAC;EACDM,UAAU,EAAE;IACVP,IAAI,EAAEI;EACR,CAAC;EACDI,QAAQ,EAAEC;AACZ,CAAC,EACD,QACF,CAAC;AAED,OAAO,MAAMC,MAAM,GAAGf,eAAe,CAAC;EACpCgB,IAAI,EAAE,QAAQ;EACdC,KAAK,EAAE;IACL,GAAGd,gBAAgB,CAAC;EACtB,CAAC;EACDe,KAAK,EAAE,CAAC,QAAQ,CAAC;EACjBC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CAACd,OAAO,GAAA2B,YAAA;UAAA,OACFX,iBAAiB;UAAA,SAAS,CAAC,oBAAoB;QAAC,IACvDF,KAAK,CAACgB,OAAO,GAAG,CAAC,EAAAH,YAAA;UAAA,OAEXT,UAAU;UAAA,SACR,CAAC,kBAAkB,CAAC;UAAA,SACpB;YACLf,MAAM,EAAER,gBAAgB,CAAC8B,eAAe;UAC1C,CAAC;UAAA,YACSnB;QAAQ,IAAAqB,YAAA;UAAA,OAENP;QAAQ,IAAGN,KAAK,CAACd,OAAO,CAAC,CAAC,MAEvCc,KAAK,CAACiB,QAAQ,GAAG,CAAC,KAGrBjB,KAAK,CAACkB,SAAS,GAAGhB,iBAAiB,EAAEC,WAAW,CACjD,EACAH,KAAK,CAACmB,MAAM,GAAG,CAAC;MAAA;IAGvB,CAAC,CAAC;EACJ;AACF,CAAC,CAAC"}
|
|
@@ -1,152 +1,157 @@
|
|
|
1
|
-
$table-cell-padding: 0 16px !default;
|
|
2
|
-
$table-head-background: var(--y-theme-surface-variant, #dfe3eb) !default;
|
|
3
|
-
$table-cell-border-bottom-color: rgba(
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
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
|
-
|
|
1
|
+
$table-cell-padding: 0 16px !default;
|
|
2
|
+
$table-head-background: var(--y-theme-surface-variant, #dfe3eb) !default;
|
|
3
|
+
$table-cell-border-bottom-color: rgba(
|
|
4
|
+
var(--y-theme-outline-rgb),
|
|
5
|
+
var(--y-theme-outline-opacity)
|
|
6
|
+
) !default;
|
|
7
|
+
|
|
8
|
+
.y-table {
|
|
9
|
+
--y-table-border-bottom-color: #{$table-cell-border-bottom-color};
|
|
10
|
+
|
|
11
|
+
display: flex;
|
|
12
|
+
flex-direction: column;
|
|
13
|
+
|
|
14
|
+
&--fixed-height &__container > &__wrapper {
|
|
15
|
+
overflow-y: auto;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
&--flex-height {
|
|
19
|
+
//flex-grow: 1;
|
|
20
|
+
min-height: 0;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
&--flex-height > &__container {
|
|
24
|
+
flex: 1 1;
|
|
25
|
+
min-height: 0;
|
|
26
|
+
position: relative;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
&__wrapper > table {
|
|
30
|
+
width: 100%;
|
|
31
|
+
border-spacing: 0;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
&--fixed-head &__container > &__wrapper > table > thead > tr > th {
|
|
35
|
+
position: sticky;
|
|
36
|
+
top: 0;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
&--fixed-head.y-table &__container &__wrapper > table > thead {
|
|
40
|
+
background: $table-head-background;
|
|
41
|
+
|
|
42
|
+
> tr > th {
|
|
43
|
+
z-index: 1;
|
|
44
|
+
background: $table-head-background;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.y-table__wrapper {
|
|
49
|
+
> table {
|
|
50
|
+
font-size: 0.875rem;
|
|
51
|
+
|
|
52
|
+
> thead,
|
|
53
|
+
> tbody,
|
|
54
|
+
> tfoot {
|
|
55
|
+
> tr {
|
|
56
|
+
> th,
|
|
57
|
+
> td {
|
|
58
|
+
padding: $table-cell-padding;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
> thead > tr {
|
|
64
|
+
> th {
|
|
65
|
+
height: 56px;
|
|
66
|
+
text-align: left;
|
|
67
|
+
border-bottom: thin solid var(--y-table-border-bottom-color);
|
|
68
|
+
user-select: none;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
> tbody > tr {
|
|
73
|
+
&:not(:last-child) {
|
|
74
|
+
> td {
|
|
75
|
+
border-bottom: thin solid var(--y-table-border-bottom-color);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
> td {
|
|
79
|
+
height: 54px;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.y-data-table-cell {
|
|
87
|
+
&--align-end {
|
|
88
|
+
text-align: end;
|
|
89
|
+
|
|
90
|
+
.y-data-table-header__content {
|
|
91
|
+
justify-content: flex-end;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.y-data-table-header {
|
|
97
|
+
&__content {
|
|
98
|
+
display: flex;
|
|
99
|
+
align-items: center;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
&__sorting-icon {
|
|
103
|
+
display: inline-flex;
|
|
104
|
+
width: 1em;
|
|
105
|
+
height: 1em;
|
|
106
|
+
margin-left: 4px;
|
|
107
|
+
cursor: pointer;
|
|
108
|
+
|
|
109
|
+
svg {
|
|
110
|
+
width: 1em;
|
|
111
|
+
height: 1em;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
&--disabled {
|
|
115
|
+
opacity: 0.08;
|
|
116
|
+
cursor: default;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.y-data-table-header--select,
|
|
122
|
+
.y-data-table-data--select {
|
|
123
|
+
> .y-icon-checkbox {
|
|
124
|
+
&:not(&--disabled) {
|
|
125
|
+
cursor: pointer;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.y-data-table-layer {
|
|
131
|
+
position: absolute;
|
|
132
|
+
top: 0;
|
|
133
|
+
right: 0;
|
|
134
|
+
bottom: 0;
|
|
135
|
+
left: 0;
|
|
136
|
+
pointer-events: none;
|
|
137
|
+
overflow-y: clip;
|
|
138
|
+
overflow-x: visible;
|
|
139
|
+
z-index: 50;
|
|
140
|
+
margin-right: calc(100% - var(--y-table-wrapper-width, 100%));
|
|
141
|
+
|
|
142
|
+
&__head {
|
|
143
|
+
position: absolute;
|
|
144
|
+
top: 0;
|
|
145
|
+
right: 0;
|
|
146
|
+
left: 0;
|
|
147
|
+
height: var(--y-table-head-height, 48px);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
&__body {
|
|
151
|
+
position: absolute;
|
|
152
|
+
top: var(--y-table-head-height, 48px);
|
|
153
|
+
right: 0;
|
|
154
|
+
left: 0;
|
|
155
|
+
bottom: 0;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { inject, provide, ref, watchEffect } from 'vue';
|
|
2
2
|
import { getRangeArr } from "../../../util/common.mjs";
|
|
3
|
-
import { propsFactory } from "../../../util/
|
|
3
|
+
import { propsFactory } from "../../../util/component/index.mjs";
|
|
4
4
|
export const pressDataTableHeader = propsFactory({
|
|
5
5
|
headers: {
|
|
6
6
|
type: Array,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"header.mjs","names":["inject","provide","ref","watchEffect","getRangeArr","propsFactory","pressDataTableHeader","headers","type","Array","default","Y_DATA_TABLE_HEADER_KEY","Symbol","for","createHeader","props","options","columns","rows","length","flat","flatMap","row","index","map","column","rowIndex","rowCount","defaultHeader","text","sortable","defaultActionHeader","width","enableSelect","value","foundIndex","findIndex","_ref","key","unshift","rowspan","splice","fixedRows","fixedOffsets","fill","forEach","_ref2","i","push","fixedOffset","Number","fixed","lastFixed","seen","Set","filtered","has","add","at","data","useHeader","Error","description"],"sources":["../../../../src/components/table/composibles/header.ts"],"sourcesContent":["import {\n type DeepReadonly,\n type InjectionKey,\n type PropType,\n type Ref,\n inject,\n provide,\n ref,\n watchEffect,\n} from 'vue';\n\nimport { getRangeArr } from '
|
|
1
|
+
{"version":3,"file":"header.mjs","names":["inject","provide","ref","watchEffect","getRangeArr","propsFactory","pressDataTableHeader","headers","type","Array","default","Y_DATA_TABLE_HEADER_KEY","Symbol","for","createHeader","props","options","columns","rows","length","flat","flatMap","row","index","map","column","rowIndex","rowCount","defaultHeader","text","sortable","defaultActionHeader","width","enableSelect","value","foundIndex","findIndex","_ref","key","unshift","rowspan","splice","fixedRows","fixedOffsets","fill","forEach","_ref2","i","push","fixedOffset","Number","fixed","lastFixed","seen","Set","filtered","has","add","at","data","useHeader","Error","description"],"sources":["../../../../src/components/table/composibles/header.ts"],"sourcesContent":["import {\n type DeepReadonly,\n type InjectionKey,\n type PropType,\n type Ref,\n inject,\n provide,\n ref,\n watchEffect,\n} from 'vue';\n\nimport { getRangeArr } from '@/util/common';\nimport { propsFactory } from '@/util/component';\n\nimport { type DataTableHeader, type InternalDataTableHeader } from '../types';\n\nexport const pressDataTableHeader = propsFactory(\n {\n headers: {\n type: Array as PropType<DeepReadonly<DataTableHeader[]>>,\n default: () => [],\n },\n },\n 'YDataTable--header',\n);\n\nexport const Y_DATA_TABLE_HEADER_KEY: InjectionKey<{\n headers: Ref<InternalDataTableHeader[][]>;\n columns: Ref<InternalDataTableHeader[]>;\n}> = Symbol.for('yuyeon.data-table.header');\n\ntype HeaderProps = {\n headers: DeepReadonly<DataTableHeader[]> | undefined;\n};\n\nexport function createHeader(\n props: HeaderProps,\n options?: {\n enableSelect?: Ref<boolean>;\n },\n) {\n const headers = ref<InternalDataTableHeader[][]>([]);\n const columns = ref<InternalDataTableHeader[]>([]);\n\n watchEffect(() => {\n const rows = props.headers?.length\n ? [props.headers as DataTableHeader[]]\n : [];\n const flat = rows.flatMap((row, index) =>\n row.map((column) => ({ column, rowIndex: index })),\n );\n const rowCount = rows.length;\n const defaultHeader = { text: '', sortable: false };\n const defaultActionHeader = { ...defaultHeader, width: 48 };\n\n if (options?.enableSelect?.value) {\n const foundIndex = flat.findIndex(\n ({ column }) => column.key === 'data-table-select',\n );\n if (foundIndex < 0) {\n flat.unshift({\n column: {\n ...defaultActionHeader,\n key: 'data-table-select',\n rowspan: rowCount,\n },\n rowIndex: 0,\n });\n } else {\n flat.splice(foundIndex, 1, {\n column: {\n ...defaultActionHeader,\n ...flat[foundIndex].column,\n },\n rowIndex: flat[foundIndex].rowIndex,\n });\n }\n }\n\n const fixedRows: InternalDataTableHeader[][] = getRangeArr(rowCount).map(\n () => [],\n );\n const fixedOffsets = getRangeArr(rowCount).fill(0);\n\n flat.forEach(({ column, rowIndex }) => {\n const { key } = column;\n for (\n let i = rowIndex;\n i <= rowIndex + (column.rowspan ?? 1) - 1;\n i += 1\n ) {\n fixedRows[i].push({\n ...column,\n key,\n fixedOffset: fixedOffsets[i],\n sortable: column.sortable ?? !!key,\n });\n fixedOffsets[i] += Number(column.width ?? 0);\n }\n });\n\n fixedRows.forEach((row) => {\n for (let i = row.length; (i -= 1); i >= 0) {\n if (row[i].fixed) {\n row[i].lastFixed = true;\n return;\n }\n }\n });\n\n const seen = new Set();\n headers.value = fixedRows.map((row) => {\n const filtered = [];\n for (const column of row) {\n if (!seen.has(column.key)) {\n seen.add(column.key);\n filtered.push(column);\n }\n }\n return filtered;\n });\n\n columns.value = fixedRows.at(-1) ?? [];\n });\n\n const data = { headers, columns };\n\n provide(Y_DATA_TABLE_HEADER_KEY, data);\n\n return data;\n}\n\nexport function useHeader() {\n const data = inject(Y_DATA_TABLE_HEADER_KEY);\n if (!data) {\n throw new Error(`Not provided: ${Y_DATA_TABLE_HEADER_KEY.description}`);\n }\n return data;\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EACzE;EACA,OAAOH,IAAI;AACb"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { computed } from 'vue';
|
|
2
2
|
import { getPropertyFromItem } from "../../../util/common.mjs";
|
|
3
|
-
import { propsFactory } from "../../../util/
|
|
3
|
+
import { propsFactory } from "../../../util/component/index.mjs";
|
|
4
4
|
export const pressDataTableItemsProps = propsFactory({
|
|
5
5
|
items: {
|
|
6
6
|
type: Array,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"items.mjs","names":["computed","getPropertyFromItem","propsFactory","pressDataTableItemsProps","items","type","Array","default","itemKey","String","Function","itemSelectable","returnItem","Boolean","updateItem","props","item","index","columns","key","value","selectable","itemColumns","reduce","acc","column","raw","updateItems","map","useItems"],"sources":["../../../../src/components/table/composibles/items.ts"],"sourcesContent":["import { PropType, Ref, computed } from 'vue';\n\nimport { getPropertyFromItem } from '
|
|
1
|
+
{"version":3,"file":"items.mjs","names":["computed","getPropertyFromItem","propsFactory","pressDataTableItemsProps","items","type","Array","default","itemKey","String","Function","itemSelectable","returnItem","Boolean","updateItem","props","item","index","columns","key","value","selectable","itemColumns","reduce","acc","column","raw","updateItems","map","useItems"],"sources":["../../../../src/components/table/composibles/items.ts"],"sourcesContent":["import { type PropType, type Ref, computed } from 'vue';\n\nimport { getPropertyFromItem } from '@/util/common';\nimport { propsFactory } from '@/util/component';\n\nimport { DataTableItem, InternalDataTableHeader } from '../types';\n\nexport type DataTableItemsProps = {\n items: any[];\n itemKey: any;\n itemSelectable: any;\n returnItem: boolean;\n};\n\nexport const pressDataTableItemsProps = propsFactory(\n {\n items: {\n type: Array as PropType<DataTableItemsProps['items']>,\n default: () => [],\n },\n itemKey: {\n type: [String, Array, Function] as PropType<any>,\n default: 'id',\n },\n itemSelectable: {\n type: [String, Array, Function] as PropType<any>,\n default: null,\n },\n returnItem: Boolean,\n },\n 'YDataTable--items',\n);\n\nexport function updateItem(\n props: Omit<DataTableItemsProps, 'items'>,\n item: any,\n index: number,\n columns: InternalDataTableHeader[],\n): DataTableItem {\n const key = getPropertyFromItem(item, props.itemKey);\n const value = props.returnItem ? item : key;\n const selectable = getPropertyFromItem(item, props.itemSelectable, true);\n const itemColumns = columns.reduce(\n (acc, column) => {\n acc[column.key] = getPropertyFromItem(item, column.value ?? column.key);\n return acc;\n },\n {} as Record<string, unknown>,\n );\n\n return {\n index,\n key,\n value,\n selectable,\n columns: itemColumns,\n raw: item,\n };\n}\n\nexport function updateItems(\n props: Omit<DataTableItemsProps, 'items'>,\n items: DataTableItemsProps['items'],\n columns: InternalDataTableHeader[],\n): DataTableItem[] {\n return items.map((item, index) => updateItem(props, item, index, columns));\n}\n\nexport function useItems(\n props: DataTableItemsProps,\n columns: Ref<InternalDataTableHeader[]>,\n) {\n const items = computed(() => {\n return updateItems(props, props.items, columns.value);\n });\n return { items };\n}\n"],"mappings":"AAAA,SAAkCA,QAAQ,QAAQ,KAAK;AAAC,SAE/CC,mBAAmB;AAAA,SACnBC,YAAY;AAWrB,OAAO,MAAMC,wBAAwB,GAAGD,YAAY,CAClD;EACEE,KAAK,EAAE;IACLC,IAAI,EAAEC,KAA+C;IACrDC,OAAO,EAAEA,CAAA,KAAM;EACjB,CAAC;EACDC,OAAO,EAAE;IACPH,IAAI,EAAE,CAACI,MAAM,EAAEH,KAAK,EAAEI,QAAQ,CAAkB;IAChDH,OAAO,EAAE;EACX,CAAC;EACDI,cAAc,EAAE;IACdN,IAAI,EAAE,CAACI,MAAM,EAAEH,KAAK,EAAEI,QAAQ,CAAkB;IAChDH,OAAO,EAAE;EACX,CAAC;EACDK,UAAU,EAAEC;AACd,CAAC,EACD,mBACF,CAAC;AAED,OAAO,SAASC,UAAUA,CACxBC,KAAyC,EACzCC,IAAS,EACTC,KAAa,EACbC,OAAkC,EACnB;EACf,MAAMC,GAAG,GAAGlB,mBAAmB,CAACe,IAAI,EAAED,KAAK,CAACP,OAAO,CAAC;EACpD,MAAMY,KAAK,GAAGL,KAAK,CAACH,UAAU,GAAGI,IAAI,GAAGG,GAAG;EAC3C,MAAME,UAAU,GAAGpB,mBAAmB,CAACe,IAAI,EAAED,KAAK,CAACJ,cAAc,EAAE,IAAI,CAAC;EACxE,MAAMW,WAAW,GAAGJ,OAAO,CAACK,MAAM,CAChC,CAACC,GAAG,EAAEC,MAAM,KAAK;IACfD,GAAG,CAACC,MAAM,CAACN,GAAG,CAAC,GAAGlB,mBAAmB,CAACe,IAAI,EAAES,MAAM,CAACL,KAAK,IAAIK,MAAM,CAACN,GAAG,CAAC;IACvE,OAAOK,GAAG;EACZ,CAAC,EACD,CAAC,CACH,CAAC;EAED,OAAO;IACLP,KAAK;IACLE,GAAG;IACHC,KAAK;IACLC,UAAU;IACVH,OAAO,EAAEI,WAAW;IACpBI,GAAG,EAAEV;EACP,CAAC;AACH;AAEA,OAAO,SAASW,WAAWA,CACzBZ,KAAyC,EACzCX,KAAmC,EACnCc,OAAkC,EACjB;EACjB,OAAOd,KAAK,CAACwB,GAAG,CAAC,CAACZ,IAAI,EAAEC,KAAK,KAAKH,UAAU,CAACC,KAAK,EAAEC,IAAI,EAAEC,KAAK,EAAEC,OAAO,CAAC,CAAC;AAC5E;AAEA,OAAO,SAASW,QAAQA,CACtBd,KAA0B,EAC1BG,OAAuC,EACvC;EACA,MAAMd,KAAK,GAAGJ,QAAQ,CAAC,MAAM;IAC3B,OAAO2B,WAAW,CAACZ,KAAK,EAAEA,KAAK,CAACX,KAAK,EAAEc,OAAO,CAACE,KAAK,CAAC;EACvD,CAAC,CAAC;EACF,OAAO;IAAEhB;EAAM,CAAC;AAClB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options.mjs","names":["computed","watch","deepEqual","useOptions","_ref","emit","page","pageSize","sortBy","search","options","value","optionsCache","deep","immediate"],"sources":["../../../../src/components/table/composibles/options.ts"],"sourcesContent":["import { Ref, computed, watch } from 'vue';\n\nimport { deepEqual } from '
|
|
1
|
+
{"version":3,"file":"options.mjs","names":["computed","watch","deepEqual","useOptions","_ref","emit","page","pageSize","sortBy","search","options","value","optionsCache","deep","immediate"],"sources":["../../../../src/components/table/composibles/options.ts"],"sourcesContent":["import { type Ref, computed, watch } from 'vue';\n\nimport { deepEqual } from '@/util/common';\n\nimport { SortOption } from '../types';\n\ntype DataTableOptionsState = {\n page: Ref<number>;\n pageSize: Ref<number>;\n sortBy: Ref<readonly SortOption[]>;\n search: Ref<string | undefined>;\n};\n\nexport function useOptions(\n { page, pageSize, sortBy, search }: DataTableOptionsState,\n emit: Function,\n) {\n const options = computed(() => {\n return {\n page: page.value,\n pageSize: pageSize.value,\n sortBy: sortBy.value,\n search: search.value,\n };\n });\n\n watch(\n () => search?.value,\n () => {\n page.value = 1;\n },\n );\n\n let optionsCache = null as unknown;\n\n watch(\n options,\n () => {\n if (deepEqual(optionsCache, options.value)) {\n return;\n }\n emit('update:options', options.value);\n optionsCache = options.value;\n },\n { deep: true, immediate: true },\n );\n}\n"],"mappings":"AAAA,SAAmBA,QAAQ,EAAEC,KAAK,QAAQ,KAAK;AAAC,SAEvCC,SAAS;AAWlB,OAAO,SAASC,UAAUA,CAAAC,IAAA,EAExBC,IAAc,EACd;EAAA,IAFA;IAAEC,IAAI;IAAEC,QAAQ;IAAEC,MAAM;IAAEC;EAA8B,CAAC,GAAAL,IAAA;EAGzD,MAAMM,OAAO,GAAGV,QAAQ,CAAC,MAAM;IAC7B,OAAO;MACLM,IAAI,EAAEA,IAAI,CAACK,KAAK;MAChBJ,QAAQ,EAAEA,QAAQ,CAACI,KAAK;MACxBH,MAAM,EAAEA,MAAM,CAACG,KAAK;MACpBF,MAAM,EAAEA,MAAM,CAACE;IACjB,CAAC;EACH,CAAC,CAAC;EAEFV,KAAK,CACH,MAAMQ,MAAM,EAAEE,KAAK,EACnB,MAAM;IACJL,IAAI,CAACK,KAAK,GAAG,CAAC;EAChB,CACF,CAAC;EAED,IAAIC,YAAY,GAAG,IAAe;EAElCX,KAAK,CACHS,OAAO,EACP,MAAM;IACJ,IAAIR,SAAS,CAACU,YAAY,EAAEF,OAAO,CAACC,KAAK,CAAC,EAAE;MAC1C;IACF;IACAN,IAAI,CAAC,gBAAgB,EAAEK,OAAO,CAACC,KAAK,CAAC;IACrCC,YAAY,GAAGF,OAAO,CAACC,KAAK;EAC9B,CAAC,EACD;IAAEE,IAAI,EAAE,IAAI;IAAEC,SAAS,EAAE;EAAK,CAChC,CAAC;AACH"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { computed, inject, provide, watchEffect } from 'vue';
|
|
2
2
|
import { useModelDuplex } from "../../../composables/communication.mjs";
|
|
3
3
|
import { clamp } from "../../../util/common.mjs";
|
|
4
|
-
import { propsFactory } from "../../../util/
|
|
4
|
+
import { propsFactory } from "../../../util/component/index.mjs";
|
|
5
5
|
export const Y_DATA_TABLE_PAGINATION_KEY = Symbol.for('yuyeon.data-table.pagination');
|
|
6
6
|
export const pressDataTablePaginationProps = propsFactory({
|
|
7
7
|
page: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pagination.mjs","names":["computed","inject","provide","watchEffect","useModelDuplex","clamp","propsFactory","Y_DATA_TABLE_PAGINATION_KEY","Symbol","for","pressDataTablePaginationProps","page","type","Number","String","default","pageSize","createPagination","props","undefined","value","providePagination","options","total","startIndex","endIndex","Math","min","pageLength","ceil","setPageSize","nextPage","prevPage","setPage","data","usePagination","Error","description","usePaginatedItems","items","paginatedItems","slice"],"sources":["../../../../src/components/table/composibles/pagination.ts"],"sourcesContent":["import type { InjectionKey, PropType, Ref } from 'vue';\
|
|
1
|
+
{"version":3,"file":"pagination.mjs","names":["computed","inject","provide","watchEffect","useModelDuplex","clamp","propsFactory","Y_DATA_TABLE_PAGINATION_KEY","Symbol","for","pressDataTablePaginationProps","page","type","Number","String","default","pageSize","createPagination","props","undefined","value","providePagination","options","total","startIndex","endIndex","Math","min","pageLength","ceil","setPageSize","nextPage","prevPage","setPage","data","usePagination","Error","description","usePaginatedItems","items","paginatedItems","slice"],"sources":["../../../../src/components/table/composibles/pagination.ts"],"sourcesContent":["import type { InjectionKey, PropType, Ref } from 'vue';\nimport { computed, inject, provide, watchEffect } from 'vue';\n\nimport { useModelDuplex } from '@/composables/communication';\nimport { clamp } from '@/util/common';\nimport { propsFactory } from '@/util/component';\n\nimport { DataTableProvidePaginationData } from '../types';\n\nexport const Y_DATA_TABLE_PAGINATION_KEY: InjectionKey<{\n page: Ref<number>;\n pageSize: Ref<number>;\n startIndex: Ref<number>;\n endIndex: Ref<number>;\n pageLength: Ref<number>;\n total: Ref<number>;\n prevPage: () => void;\n nextPage: () => void;\n setPage: (page: number) => void;\n setPageSize: (size: number) => void;\n}> = Symbol.for('yuyeon.data-table.pagination');\n\nexport const pressDataTablePaginationProps = propsFactory(\n {\n page: {\n type: [Number, String] as PropType<number | string>,\n default: 1,\n },\n pageSize: {\n type: [Number, String] as PropType<number | string>,\n default: 10,\n },\n },\n 'YDataTable--pagination',\n);\n\ntype PaginationProps = {\n page: number | string;\n 'onUpdate:page': ((v: any) => void) | undefined;\n pageSize: number | string;\n 'onUpdate:pageSize': ((v: any) => void) | undefined;\n total?: number | string;\n};\n\nexport function createPagination(props: PaginationProps) {\n const page = useModelDuplex(\n props,\n 'page',\n undefined,\n (value) => +(value ?? 1),\n );\n const pageSize = useModelDuplex(\n props,\n 'pageSize',\n undefined,\n (value) => +(value ?? 10),\n );\n return { page, pageSize };\n}\n\nexport function providePagination(options: {\n page: Ref<number>;\n pageSize: Ref<number>;\n total: Ref<number>;\n}) {\n const { page, pageSize, total } = options;\n const startIndex = computed(() => {\n if (pageSize.value === -1) return 0;\n\n return pageSize.value * (page.value - 1);\n });\n const endIndex = computed(() => {\n if (pageSize.value === -1) return total.value;\n\n return Math.min(total.value, startIndex.value + pageSize.value);\n });\n\n const pageLength = computed(() => {\n if (pageSize.value === -1 || total.value === 0) return 1;\n\n return Math.ceil(total.value / pageSize.value);\n });\n\n watchEffect(() => {\n if (page.value > pageLength.value) {\n page.value = pageLength.value;\n }\n });\n\n function setPageSize(value: number) {\n pageSize.value = value;\n page.value = 1;\n }\n\n function nextPage() {\n page.value = clamp(page.value + 1, 1, pageLength.value);\n }\n\n function prevPage() {\n page.value = clamp(page.value - 1, 1, pageLength.value);\n }\n\n function setPage(value: number) {\n page.value = clamp(value, 1, pageLength.value);\n }\n\n const data: DataTableProvidePaginationData = {\n page,\n pageSize,\n startIndex,\n endIndex,\n pageLength,\n total,\n nextPage,\n prevPage,\n setPage,\n setPageSize,\n };\n\n provide(Y_DATA_TABLE_PAGINATION_KEY, data);\n\n return data;\n}\n\nexport function usePagination() {\n const data = inject(Y_DATA_TABLE_PAGINATION_KEY);\n if (!data) {\n throw new Error(`Not provided: ${Y_DATA_TABLE_PAGINATION_KEY.description}`);\n }\n return data;\n}\n\nexport function usePaginatedItems<T>(options: {\n items: Ref<readonly T[]>;\n startIndex: Ref<number>;\n endIndex: Ref<number>;\n pageSize: Ref<number>;\n}) {\n const { items, startIndex, endIndex, pageSize } = options;\n const paginatedItems = computed(() => {\n if (pageSize.value <= 0) return items.value;\n\n return items.value.slice(startIndex.value, endIndex.value);\n });\n\n return { paginatedItems };\n}\n"],"mappings":"AACA,SAASA,QAAQ,EAAEC,MAAM,EAAEC,OAAO,EAAEC,WAAW,QAAQ,KAAK;AAAC,SAEpDC,cAAc;AAAA,SACdC,KAAK;AAAA,SACLC,YAAY;AAIrB,OAAO,MAAMC,2BAWX,GAAGC,MAAM,CAACC,GAAG,CAAC,8BAA8B,CAAC;AAE/C,OAAO,MAAMC,6BAA6B,GAAGJ,YAAY,CACvD;EACEK,IAAI,EAAE;IACJC,IAAI,EAAE,CAACC,MAAM,EAAEC,MAAM,CAA8B;IACnDC,OAAO,EAAE;EACX,CAAC;EACDC,QAAQ,EAAE;IACRJ,IAAI,EAAE,CAACC,MAAM,EAAEC,MAAM,CAA8B;IACnDC,OAAO,EAAE;EACX;AACF,CAAC,EACD,wBACF,CAAC;AAUD,OAAO,SAASE,gBAAgBA,CAACC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AAEf,UAAU;IAAEC,QAAQ;IAAET;EAAS,CAAC,GAAGM,OAAO;EACzD,MAAMkB,cAAc,GAAGxC,QAAQ,CAAC,MAAM;IACpC,IAAIgB,QAAQ,CAACI,KAAK,IAAI,CAAC,EAAE,OAAOmB,KAAK,CAACnB,KAAK;IAE3C,OAAOmB,KAAK,CAACnB,KAAK,CAACqB,KAAK,CAACjB,UAAU,CAACJ,KAAK,EAAEK,QAAQ,CAACL,KAAK,CAAC;EAC5D,CAAC,CAAC;EAEF,OAAO;IAAEoB;EAAe,CAAC;AAC3B"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { computed, inject, provide } from 'vue';
|
|
2
2
|
import { useModelDuplex } from "../../../composables/communication.mjs";
|
|
3
|
-
import { deepEqual } from "../../../util/index.mjs";
|
|
4
3
|
import { wrapInArray } from "../../../util/array.mjs";
|
|
5
|
-
import {
|
|
4
|
+
import { deepEqual } from "../../../util/common.mjs";
|
|
5
|
+
import { propsFactory } from "../../../util/component/index.mjs";
|
|
6
6
|
export const pressDataTableSelectionProps = propsFactory({
|
|
7
7
|
enableSelect: Boolean,
|
|
8
8
|
selectStrategy: {
|