yuyeon 0.0.0 → 0.0.3
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 -0
- package/dist/yuyeon.mjs +3607 -0
- package/dist/yuyeon.umd.js +1 -0
- package/lib/components/app/YApp.mjs +30 -0
- package/lib/components/app/YApp.mjs.map +1 -0
- package/lib/components/app/YApp.scss +14 -0
- package/lib/components/app/index.mjs +2 -0
- package/lib/components/app/index.mjs.map +1 -0
- package/lib/components/bench/YBench.mjs +44 -0
- package/lib/components/bench/YBench.mjs.map +1 -0
- package/lib/components/bench/index.mjs +2 -0
- package/lib/components/bench/index.mjs.map +1 -0
- package/lib/components/button/YButton.mjs +138 -0
- package/lib/components/button/YButton.mjs.map +1 -0
- package/{src/components/button/y-btn.scss → lib/components/button/YButton.scss} +67 -29
- package/lib/components/button/index.mjs +2 -0
- package/lib/components/button/index.mjs.map +1 -0
- package/lib/components/card/YCard.mjs +18 -0
- package/lib/components/card/YCard.mjs.map +1 -0
- package/lib/components/card/YCardBody.mjs +10 -0
- package/lib/components/card/YCardBody.mjs.map +1 -0
- package/lib/components/card/YCardFooter.mjs +10 -0
- package/lib/components/card/YCardFooter.mjs.map +1 -0
- package/lib/components/card/YCardHeader.mjs +10 -0
- package/lib/components/card/YCardHeader.mjs.map +1 -0
- package/lib/components/card/index.mjs +6 -0
- package/lib/components/card/index.mjs.map +1 -0
- package/lib/components/checkbox/YCheckbox.mjs +154 -0
- package/lib/components/checkbox/YCheckbox.mjs.map +1 -0
- package/lib/components/checkbox/YInputCheckbox.mjs +113 -0
- package/lib/components/checkbox/YInputCheckbox.mjs.map +1 -0
- package/{src/components/checkbox/y-input-checkbox.scss → lib/components/checkbox/YInputCheckbox.scss} +19 -19
- package/lib/components/checkbox/index.mjs +5 -0
- package/lib/components/checkbox/index.mjs.map +1 -0
- package/{src/components/chip/y-chip.vue → lib/components/chip/YChip.mjs} +26 -27
- package/lib/components/chip/YChip.mjs.map +1 -0
- package/{src/components/chip/y-chip.scss → lib/components/chip/YChip.scss} +0 -4
- package/lib/components/chip/index.mjs +3 -0
- package/lib/components/chip/index.mjs.map +1 -0
- package/lib/components/dialog/YDialog.mjs +97 -0
- package/lib/components/dialog/YDialog.mjs.map +1 -0
- package/lib/components/dialog/index.mjs +2 -0
- package/lib/components/dialog/index.mjs.map +1 -0
- package/lib/components/field-input/YFieldInput.mjs +218 -0
- package/lib/components/field-input/YFieldInput.mjs.map +1 -0
- package/{src/components/field-input/y-field-input.scss → lib/components/field-input/YFieldInput.scss} +2 -4
- package/lib/components/field-input/index.mjs +2 -0
- package/lib/components/field-input/index.mjs.map +1 -0
- package/lib/components/form/YForm.mjs +79 -0
- package/lib/components/form/YForm.mjs.map +1 -0
- package/lib/components/form/index.mjs +4 -0
- package/lib/components/form/index.mjs.map +1 -0
- package/lib/components/icons/YIconCheckbox.mjs +21 -0
- package/lib/components/icons/YIconCheckbox.mjs.map +1 -0
- package/lib/components/icons/YIconClear.mjs +16 -0
- package/lib/components/icons/YIconClear.mjs.map +1 -0
- package/lib/components/icons/YIconExpand.mjs +20 -0
- package/lib/components/icons/YIconExpand.mjs.map +1 -0
- package/lib/components/icons/index.mjs +4 -0
- package/lib/components/icons/index.mjs.map +1 -0
- package/lib/components/index.mjs +24 -0
- package/lib/components/index.mjs.map +1 -0
- package/lib/components/input/YInput.mjs +346 -0
- package/lib/components/input/YInput.mjs.map +1 -0
- package/{src/components/input/y-input.scss → lib/components/input/YInput.scss} +12 -4
- package/lib/components/input/index.mjs +2 -0
- package/lib/components/input/index.mjs.map +1 -0
- package/lib/components/input/index.scss +2 -0
- package/lib/components/layer/YLayer.mjs +193 -0
- package/lib/components/layer/YLayer.mjs.map +1 -0
- package/lib/components/layer/index.mjs +2 -0
- package/lib/components/layer/index.mjs.map +1 -0
- package/lib/components/layer/scroll-strategies.mjs +132 -0
- package/lib/components/layer/scroll-strategies.mjs.map +1 -0
- package/lib/components/list/YList.mjs +16 -0
- package/lib/components/list/YList.mjs.map +1 -0
- package/lib/components/list/YList.scss +3 -0
- package/lib/components/list/YListItem.mjs +37 -0
- package/lib/components/list/YListItem.mjs.map +1 -0
- package/lib/components/list/YListItem.scss +59 -0
- package/lib/components/list/index.mjs +3 -0
- package/lib/components/list/index.mjs.map +1 -0
- package/lib/components/loading/YSpinnerRing.mjs +25 -0
- package/lib/components/loading/YSpinnerRing.mjs.map +1 -0
- package/{src/components/ring-spinner/y-ring-spinner.scss → lib/components/loading/YSpinnerRing.scss} +3 -3
- package/lib/components/loading/index.mjs +2 -0
- package/lib/components/loading/index.mjs.map +1 -0
- package/lib/components/menu/YMenu.mjs +239 -0
- package/lib/components/menu/YMenu.mjs.map +1 -0
- package/lib/components/menu/YMenu.scss +7 -0
- package/lib/components/menu/index.mjs +2 -0
- package/lib/components/menu/index.mjs.map +1 -0
- package/lib/components/navigation/YNavigation.mjs +17 -0
- package/lib/components/navigation/YNavigation.mjs.map +1 -0
- package/lib/components/navigation/index.mjs +2 -0
- package/lib/components/navigation/index.mjs.map +1 -0
- package/lib/components/pagination/YPagination.mjs +61 -0
- package/lib/components/pagination/YPagination.mjs.map +1 -0
- package/lib/components/pagination/YPagination.scss +5 -0
- package/lib/components/pagination/index.mjs +2 -0
- package/lib/components/pagination/index.mjs.map +1 -0
- package/lib/components/panel/YDividePanel.mjs +89 -0
- package/lib/components/panel/YDividePanel.mjs.map +1 -0
- package/lib/components/panel/YDividePanel.scss +43 -0
- package/lib/components/panel/index.mjs +2 -0
- package/lib/components/panel/index.mjs.map +1 -0
- package/lib/components/plate/YPlate.mjs +27 -0
- package/lib/components/plate/YPlate.mjs.map +1 -0
- package/lib/components/plate/YPlate.scss +9 -0
- package/lib/components/plate/index.mjs +2 -0
- package/lib/components/plate/index.mjs.map +1 -0
- package/lib/components/progress-bar/YProgressBar.mjs +110 -0
- package/lib/components/progress-bar/YProgressBar.mjs.map +1 -0
- package/lib/components/progress-bar/YProgressBar.scss +40 -0
- package/lib/components/progress-bar/index.mjs +2 -0
- package/lib/components/progress-bar/index.mjs.map +1 -0
- package/lib/components/snackbar/YSnackbar.mjs +187 -0
- package/lib/components/snackbar/YSnackbar.mjs.map +1 -0
- package/lib/components/snackbar/YSnackbar.scss +38 -0
- package/lib/components/snackbar/index.mjs +2 -0
- package/lib/components/snackbar/index.mjs.map +1 -0
- package/lib/components/switch/YSwitch.mjs +228 -0
- package/lib/components/switch/YSwitch.mjs.map +1 -0
- package/{src/components/switch/y-switch.scss → lib/components/switch/YSwitch.scss} +18 -26
- package/lib/components/switch/index.mjs +2 -0
- package/lib/components/switch/index.mjs.map +1 -0
- package/lib/components/table/YDataTable.mjs +46 -0
- package/lib/components/table/YDataTable.mjs.map +1 -0
- package/lib/components/table/YDataTableBody.mjs +12 -0
- package/lib/components/table/YDataTableBody.mjs.map +1 -0
- package/lib/components/table/YDataTableCell.mjs +55 -0
- package/lib/components/table/YDataTableCell.mjs.map +1 -0
- package/lib/components/table/YDataTableControl.mjs +37 -0
- package/lib/components/table/YDataTableControl.mjs.map +1 -0
- package/lib/components/table/YDataTableControl.scss +6 -0
- package/lib/components/table/YDataTableHead.mjs +12 -0
- package/lib/components/table/YDataTableHead.mjs.map +1 -0
- package/lib/components/table/YDataTableLayer.mjs +14 -0
- package/lib/components/table/YDataTableLayer.mjs.map +1 -0
- package/lib/components/table/YDataTableRow.mjs +12 -0
- package/lib/components/table/YDataTableRow.mjs.map +1 -0
- package/lib/components/table/YDataTableServer.mjs +54 -0
- package/lib/components/table/YDataTableServer.mjs.map +1 -0
- package/lib/components/table/YTable.mjs +53 -0
- package/lib/components/table/YTable.mjs.map +1 -0
- package/lib/components/table/YTable.scss +61 -0
- package/lib/components/table/index.mjs +4 -0
- package/lib/components/table/index.mjs.map +1 -0
- package/lib/components/table/pagination.mjs +21 -0
- package/lib/components/table/pagination.mjs.map +1 -0
- package/lib/components/text-highlighter/YTextHighlighter.mjs +94 -0
- package/lib/components/text-highlighter/YTextHighlighter.mjs.map +1 -0
- package/lib/components/text-highlighter/index.mjs +3 -0
- package/lib/components/text-highlighter/index.mjs.map +1 -0
- package/lib/components/tooltip/YTooltip.mjs +209 -0
- package/lib/components/tooltip/YTooltip.mjs.map +1 -0
- package/lib/components/tooltip/YTooltip.scss +19 -0
- package/lib/components/tooltip/index.mjs +2 -0
- package/lib/components/tooltip/index.mjs.map +1 -0
- package/lib/components/transitions/expand-transition.mjs +88 -0
- package/lib/components/transitions/expand-transition.mjs.map +1 -0
- package/lib/components/transitions/index.mjs +4 -0
- package/lib/components/transitions/index.mjs.map +1 -0
- package/lib/components/tree-view/YTreeView.mjs +92 -0
- package/lib/components/tree-view/YTreeView.mjs.map +1 -0
- package/lib/components/tree-view/YTreeView.scss +46 -0
- package/lib/components/tree-view/YTreeViewNode.mjs +122 -0
- package/lib/components/tree-view/YTreeViewNode.mjs.map +1 -0
- package/lib/components/tree-view/index.mjs +3 -0
- package/lib/components/tree-view/index.mjs.map +1 -0
- package/lib/composables/collections.mjs +2 -0
- package/lib/composables/collections.mjs.map +1 -0
- package/lib/composables/communication.mjs +46 -0
- package/lib/composables/communication.mjs.map +1 -0
- package/lib/composables/component.mjs +8 -0
- package/lib/composables/component.mjs.map +1 -0
- package/{src/composables/layer-group.ts → lib/composables/layer-group.mjs} +8 -10
- package/lib/composables/layer-group.mjs.map +1 -0
- package/lib/composables/layout.mjs +13 -0
- package/lib/composables/layout.mjs.map +1 -0
- package/lib/composables/levitation.mjs +135 -0
- package/lib/composables/levitation.mjs.map +1 -0
- package/{src/composables/progress.ts → lib/composables/progress.mjs} +6 -5
- package/lib/composables/progress.mjs.map +1 -0
- package/lib/composables/resize-observer.mjs +34 -0
- package/lib/composables/resize-observer.mjs.map +1 -0
- package/lib/composables/scope.mjs +27 -0
- package/lib/composables/scope.mjs.map +1 -0
- package/lib/composables/theme/index.mjs +49 -0
- package/lib/composables/theme/index.mjs.map +1 -0
- package/lib/composables/theme/setting.mjs +46 -0
- package/lib/composables/theme/setting.mjs.map +1 -0
- package/lib/composables/timing.mjs +77 -0
- package/lib/composables/timing.mjs.map +1 -0
- package/lib/composables/transition.mjs +50 -0
- package/lib/composables/transition.mjs.map +1 -0
- package/lib/directives/complement-click/index.mjs +78 -0
- package/lib/directives/complement-click/index.mjs.map +1 -0
- package/{src/directives/plate-wave/index.ts → lib/directives/plate-wave/index.mjs} +25 -42
- package/lib/directives/plate-wave/index.mjs.map +1 -0
- package/{src → lib}/directives/plate-wave/plate-wave.scss +1 -1
- package/lib/directives/theme-class.mjs +24 -0
- package/lib/directives/theme-class.mjs.map +1 -0
- package/lib/etc/index.mjs +6 -0
- package/lib/etc/index.mjs.map +1 -0
- package/lib/index.mjs +55 -0
- package/lib/index.mjs.map +1 -0
- package/{src/mixins/di.ts → lib/mixins/di.mjs} +7 -8
- package/lib/mixins/di.mjs.map +1 -0
- package/{src/mixins/rebind-attrs.ts → lib/mixins/rebind-attrs.mjs} +9 -8
- package/lib/mixins/rebind-attrs.mjs.map +1 -0
- package/{src/styles/palette.scss → lib/styles/_palette.scss} +0 -4
- package/lib/styles/base.scss +95 -0
- package/lib/styles/settings/_variables.scss +14 -0
- package/lib/styles/settings/provided.scss +35 -0
- package/lib/styles/theme/dark.scss +21 -0
- package/{src → lib}/styles/theme/index.scss +0 -3
- package/lib/styles/theme/light.scss +21 -0
- package/lib/util/FrameScheduler.mjs +29 -0
- package/lib/util/FrameScheduler.mjs.map +1 -0
- package/lib/util/Rect.mjs +27 -0
- package/lib/util/Rect.mjs.map +1 -0
- package/lib/util/common.mjs +66 -0
- package/lib/util/common.mjs.map +1 -0
- package/lib/util/dom.mjs +8 -0
- package/lib/util/dom.mjs.map +1 -0
- package/lib/util/scroll.mjs +28 -0
- package/lib/util/scroll.mjs.map +1 -0
- package/lib/util/string.mjs +33 -0
- package/lib/util/string.mjs.map +1 -0
- package/lib/util/ui.mjs +83 -0
- package/lib/util/ui.mjs.map +1 -0
- package/lib/util/validation.mjs +5 -0
- package/lib/util/validation.mjs.map +1 -0
- package/lib/util/vue-component.mjs +64 -0
- package/lib/util/vue-component.mjs.map +1 -0
- package/package.json +62 -22
- package/types/components/app/YApp.d.ts +7 -0
- package/types/components/app/index.d.ts +1 -0
- package/types/components/button/YButton.d.ts +122 -0
- package/types/components/button/index.d.ts +1 -0
- package/types/components/card/YCard.d.ts +11 -0
- package/types/components/card/YCardBody.d.ts +2 -0
- package/types/components/card/YCardFooter.d.ts +2 -0
- package/types/components/card/YCardHeader.d.ts +2 -0
- package/types/components/card/index.d.ts +5 -0
- package/types/components/checkbox/YCheckbox.d.ts +46 -0
- package/types/components/checkbox/YInputCheckbox.d.ts +42 -0
- package/types/components/checkbox/index.d.ts +4 -0
- package/types/components/chip/YChip.d.ts +34 -0
- package/types/components/chip/index.d.ts +2 -0
- package/types/components/dialog/YDialog.d.ts +120 -0
- package/types/components/dialog/index.d.ts +1 -0
- package/types/components/field-input/YFieldInput.d.ts +118 -0
- package/types/components/field-input/index.d.ts +1 -0
- package/types/components/form/YForm.d.ts +32 -0
- package/types/components/form/index.d.ts +3 -0
- package/types/components/icons/YIconCheckbox.d.ts +1 -0
- package/types/components/icons/YIconClear.d.ts +1 -0
- package/types/components/icons/YIconExpand.d.ts +1 -0
- package/types/components/icons/index.d.ts +3 -0
- package/types/components/index.d.ts +23 -0
- package/types/components/input/YInput.d.ts +166 -0
- package/types/components/input/index.d.ts +1 -0
- package/types/components/layer/YLayer.d.ts +99 -0
- package/types/components/layer/index.d.ts +1 -0
- package/types/components/list/YList.d.ts +2 -0
- package/types/components/list/YListItem.d.ts +28 -0
- package/types/components/list/index.d.ts +2 -0
- package/types/components/loading/YSpinnerRing.d.ts +1 -0
- package/types/components/loading/index.d.ts +1 -0
- package/types/components/menu/YMenu.d.ts +236 -0
- package/types/components/menu/index.d.ts +1 -0
- package/types/components/pagination/YPagination.d.ts +106 -0
- package/types/components/pagination/index.d.ts +1 -0
- package/types/components/panel/YDividePanel.d.ts +3 -0
- package/types/components/panel/index.d.ts +1 -0
- package/types/components/plate/YPlate.d.ts +10 -0
- package/types/components/plate/index.d.ts +1 -0
- package/types/components/progress-bar/YProgressBar.d.ts +59 -0
- package/types/components/progress-bar/index.d.ts +1 -0
- package/types/components/snackbar/YSnackbar.d.ts +77 -0
- package/types/components/snackbar/index.d.ts +1 -0
- package/types/components/switch/YSwitch.d.ts +106 -0
- package/types/components/switch/index.d.ts +1 -0
- package/types/components/table/YDataTable.d.ts +63 -0
- package/types/components/table/YDataTableBody.d.ts +2 -0
- package/types/components/table/YDataTableControl.d.ts +2 -0
- package/types/components/table/YDataTableHead.d.ts +2 -0
- package/types/components/table/YDataTableLayer.d.ts +2 -0
- package/types/components/table/YDataTableServer.d.ts +82 -0
- package/types/components/table/YTable.d.ts +32 -0
- package/types/components/table/index.d.ts +3 -0
- package/types/components/table/pagination.d.ts +38 -0
- package/types/components/tooltip/YTooltip.d.ts +188 -0
- package/types/components/tooltip/index.d.ts +1 -0
- package/types/components/transitions/expand-transition.d.ts +16 -0
- package/types/components/transitions/index.d.ts +32 -0
- package/types/components/tree-view/YTreeView.d.ts +37 -0
- package/types/components/tree-view/YTreeViewNode.d.ts +51 -0
- package/types/components/tree-view/index.d.ts +2 -0
- package/types/composables/communication.d.ts +1 -0
- package/types/composables/component.d.ts +2 -0
- package/types/composables/layer-group.d.ts +5 -0
- package/types/composables/progress.d.ts +3 -0
- package/types/composables/resize-observer.d.ts +14 -0
- package/types/composables/scope.d.ts +2 -0
- package/types/composables/theme/index.d.ts +15 -0
- package/types/composables/theme/setting.d.ts +12 -0
- package/types/composables/timing.d.ts +15 -0
- package/types/composables/transition.d.ts +21 -0
- package/types/directives/complement-click/index.d.ts +25 -0
- package/types/directives/plate-wave/index.d.ts +13 -0
- package/types/directives/theme-class.d.ts +3 -0
- package/types/etc/index.d.ts +1 -0
- package/types/globals.d.ts +11 -0
- package/types/index.d.ts +9 -0
- package/types/mixins/di.d.ts +2 -0
- package/types/mixins/rebind-attrs.d.ts +5 -0
- package/types/shims.d.ts +71 -0
- package/types/util/common.d.ts +8 -0
- package/types/util/dom.d.ts +1 -0
- package/types/util/string.d.ts +3 -0
- package/types/util/ui.d.ts +9 -0
- package/types/util/vue-component.d.ts +33 -0
- package/types/vite-env.d.ts +1 -0
- package/src/components/button/index.ts +0 -3
- package/src/components/button/y-btn.ts +0 -104
- package/src/components/card/index.ts +0 -6
- package/src/components/card/y-card-body.ts +0 -8
- package/src/components/card/y-card-footer.ts +0 -8
- package/src/components/card/y-card-header.ts +0 -8
- package/src/components/card/y-card.ts +0 -16
- package/src/components/checkbox/IconCheckbox.vue +0 -24
- package/src/components/checkbox/YCheckbox.vue +0 -113
- package/src/components/checkbox/YInputCheckbox.vue +0 -108
- package/src/components/checkbox/index.ts +0 -8
- package/src/components/chip/index.ts +0 -3
- package/src/components/dialog/index.ts +0 -3
- package/src/components/dialog/y-dialog.vue +0 -46
- package/src/components/field-input/index.scss +0 -5
- package/src/components/field-input/index.ts +0 -11
- package/src/components/field-input/y-field-input.ts +0 -214
- package/src/components/form/index.ts +0 -9
- package/src/components/form/y-form.ts +0 -93
- package/src/components/icons/icon-clearable.ts +0 -6
- package/src/components/index.ts +0 -17
- package/src/components/input/index.scss +0 -5
- package/src/components/input/index.ts +0 -9
- package/src/components/input/y-input.ts +0 -368
- package/src/components/layer/index.ts +0 -3
- package/src/components/layer/y-layer.vue +0 -146
- package/src/components/lottie-player.ts +0 -41
- package/src/components/progress-bar/index.ts +0 -3
- package/src/components/progress-bar/y-progress-bar.vue +0 -144
- package/src/components/ring-spinner/y-ring-spinner.vue +0 -31
- package/src/components/switch/YSwitch.vue +0 -217
- package/src/components/switch/index.scss +0 -5
- package/src/components/switch/index.ts +0 -11
- package/src/components/text-highlighter/index.scss +0 -5
- package/src/components/text-highlighter/index.ts +0 -3
- package/src/components/text-highlighter/y-text-highlighter.ts +0 -89
- package/src/composables/lazy.ts +0 -30
- package/src/composables/theme.ts +0 -25
- package/src/directives/complement-click/index.ts +0 -123
- package/src/directives/theme-class.ts +0 -14
- package/src/file-extension.d.ts +0 -14
- package/src/index.ts +0 -21
- package/src/styles/base.scss +0 -28
- package/src/styles/theme/dark.scss +0 -35
- package/src/styles/theme/light.scss +0 -32
- package/src/util/common.ts +0 -59
- package/src/util/date-time.ts +0 -41
- package/src/util/dom.ts +0 -6
- package/src/util/string.ts +0 -9
- package/src/util/ui.ts +0 -39
- package/src/util/validation.ts +0 -9
- package/src/util/vue-component.ts +0 -18
- /package/{src/components/card/y-card.scss → lib/components/card/YCard.scss} +0 -0
- /package/{src/components/checkbox/y-checkbox.scss → lib/components/checkbox/YCheckbox.scss} +0 -0
- /package/{src/components/dialog/y-dialog.scss → lib/components/dialog/YDialog.scss} +0 -0
- /package/{src/components/layer/y-layer.scss → lib/components/layer/YLayer.scss} +0 -0
- /package/{src/components/text-highlighter/y-text-highlighter.scss → lib/components/text-highlighter/YTextHighlighter.scss} +0 -0
- /package/{src/styles/variables.scss → lib/styles/_variables.scss} +0 -0
- /package/{src → lib}/styles/util/helper.scss +0 -0
- /package/{src → lib}/styles/util/theme.scss +0 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
$box-side-direction: ('top', 'right', 'bottom', 'left');
|
|
2
|
+
$box-side-combinations: (
|
|
3
|
+
'a': (),
|
|
4
|
+
'v': (
|
|
5
|
+
'top',
|
|
6
|
+
'bottom',
|
|
7
|
+
),
|
|
8
|
+
'h': (
|
|
9
|
+
'right',
|
|
10
|
+
'left',
|
|
11
|
+
),
|
|
12
|
+
't': (
|
|
13
|
+
'top',
|
|
14
|
+
),
|
|
15
|
+
'r': (
|
|
16
|
+
'right',
|
|
17
|
+
),
|
|
18
|
+
'b': (
|
|
19
|
+
'bottom',
|
|
20
|
+
),
|
|
21
|
+
'l': (
|
|
22
|
+
'left',
|
|
23
|
+
),
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
$space-types: (
|
|
27
|
+
'm': 'margin',
|
|
28
|
+
'p': 'padding',
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
$text-aligns: (
|
|
32
|
+
'center',
|
|
33
|
+
'left',
|
|
34
|
+
'right',
|
|
35
|
+
)
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@use '../../styles/palette';
|
|
3
|
+
@use '../util/helper';
|
|
4
|
+
|
|
5
|
+
// yui/app theme
|
|
6
|
+
$theme--dark: () !default;
|
|
7
|
+
$theme--dark: map.deep-merge(
|
|
8
|
+
(
|
|
9
|
+
'input': (
|
|
10
|
+
'fill': palette.$basic-gray-200,
|
|
11
|
+
),
|
|
12
|
+
'fieldInput': (
|
|
13
|
+
'clear': palette.$basic-gray-400,
|
|
14
|
+
),
|
|
15
|
+
'select': (
|
|
16
|
+
'selected': palette.$basic-black,
|
|
17
|
+
'selected-background': palette.$basic-gray-700,
|
|
18
|
+
),
|
|
19
|
+
),
|
|
20
|
+
$theme--dark
|
|
21
|
+
);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@use '../../styles/palette';
|
|
3
|
+
@use '../util/helper';
|
|
4
|
+
|
|
5
|
+
// yui theme
|
|
6
|
+
$theme--light: () !default;
|
|
7
|
+
$theme--light: map.deep-merge(
|
|
8
|
+
(
|
|
9
|
+
'input': (
|
|
10
|
+
'fill': palette.$basic-gray-200,
|
|
11
|
+
),
|
|
12
|
+
'fieldInput': (
|
|
13
|
+
'clear': palette.$basic-gray-400,
|
|
14
|
+
),
|
|
15
|
+
'select': (
|
|
16
|
+
'selected': palette.$basic-black,
|
|
17
|
+
'selected-background': palette.$basic-gray-700,
|
|
18
|
+
),
|
|
19
|
+
),
|
|
20
|
+
$theme--light
|
|
21
|
+
);
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
3
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
4
|
+
export class FrameScheduler {
|
|
5
|
+
constructor() {
|
|
6
|
+
_defineProperty(this, "clean", true);
|
|
7
|
+
_defineProperty(this, "frames", []);
|
|
8
|
+
_defineProperty(this, "raf", -1);
|
|
9
|
+
}
|
|
10
|
+
run() {
|
|
11
|
+
cancelAnimationFrame(this.raf);
|
|
12
|
+
this.raf = requestAnimationFrame(() => {
|
|
13
|
+
const frame = this.frames.shift();
|
|
14
|
+
if (frame) frame();
|
|
15
|
+
if (frames.length) this.run();else this.clean = true;
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
requestNewFrame(callback) {
|
|
19
|
+
if (!this.clean || this.frames.length) {
|
|
20
|
+
this.frames.push(callback);
|
|
21
|
+
this.run();
|
|
22
|
+
} else {
|
|
23
|
+
this.clean = false;
|
|
24
|
+
callback();
|
|
25
|
+
this.run();
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=FrameScheduler.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FrameScheduler.mjs","names":["FrameScheduler","constructor","_defineProperty","run","cancelAnimationFrame","raf","requestAnimationFrame","frame","frames","shift","length","clean","requestNewFrame","callback","push"],"sources":["../../src/util/FrameScheduler.ts"],"sourcesContent":["export class FrameScheduler {\n private clean = true;\n\n private frames = [] as any[];\n\n private raf = -1;\n\n private run() {\n cancelAnimationFrame(this.raf);\n this.raf = requestAnimationFrame(() => {\n const frame = this.frames.shift();\n if (frame) frame();\n\n if (frames.length) this.run();\n else this.clean = true;\n });\n }\n\n public requestNewFrame(callback: () => void) {\n if (!this.clean || this.frames.length) {\n this.frames.push(callback);\n this.run();\n } else {\n this.clean = false;\n callback();\n this.run();\n }\n }\n}\n"],"mappings":";;;AAAA,OAAO,MAAMA,cAAc,CAAC;EAAAC,YAAA;IAAAC,eAAA,gBACV,IAAI;IAAAA,eAAA,iBAEH,EAAE;IAAAA,eAAA,cAEL,CAAC,CAAC;EAAA;EAERC,GAAGA,CAAA,EAAG;IACZC,oBAAoB,CAAC,IAAI,CAACC,GAAG,CAAC;IAC9B,IAAI,CAACA,GAAG,GAAGC,qBAAqB,CAAC,MAAM;MACrC,MAAMC,KAAK,GAAG,IAAI,CAACC,MAAM,CAACC,KAAK,CAAC,CAAC;MACjC,IAAIF,KAAK,EAAEA,KAAK,CAAC,CAAC;MAElB,IAAIC,MAAM,CAACE,MAAM,EAAE,IAAI,CAACP,GAAG,CAAC,CAAC,CAAC,KACzB,IAAI,CAACQ,KAAK,GAAG,IAAI;IACxB,CAAC,CAAC;EACJ;EAEOC,eAAeA,CAACC,QAAoB,EAAE;IAC3C,IAAI,CAAC,IAAI,CAACF,KAAK,IAAI,IAAI,CAACH,MAAM,CAACE,MAAM,EAAE;MACrC,IAAI,CAACF,MAAM,CAACM,IAAI,CAACD,QAAQ,CAAC;MAC1B,IAAI,CAACV,GAAG,CAAC,CAAC;IACZ,CAAC,MAAM;MACL,IAAI,CAACQ,KAAK,GAAG,KAAK;MAClBE,QAAQ,CAAC,CAAC;MACV,IAAI,CAACV,GAAG,CAAC,CAAC;IACZ;EACF;AACF"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export class MutableRect {
|
|
2
|
+
constructor(_ref) {
|
|
3
|
+
let {
|
|
4
|
+
x,
|
|
5
|
+
y,
|
|
6
|
+
width,
|
|
7
|
+
height
|
|
8
|
+
} = _ref;
|
|
9
|
+
this.x = x ?? 0;
|
|
10
|
+
this.y = y ?? 0;
|
|
11
|
+
this.width = width ?? 0;
|
|
12
|
+
this.height = height ?? 0;
|
|
13
|
+
}
|
|
14
|
+
get top() {
|
|
15
|
+
return this.y;
|
|
16
|
+
}
|
|
17
|
+
get bottom() {
|
|
18
|
+
return this.y + this.height;
|
|
19
|
+
}
|
|
20
|
+
get left() {
|
|
21
|
+
return this.x;
|
|
22
|
+
}
|
|
23
|
+
get right() {
|
|
24
|
+
return this.x + this.width;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=Rect.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Rect.mjs","names":["MutableRect","constructor","_ref","x","y","width","height","top","bottom","left","right"],"sources":["../../src/util/Rect.ts"],"sourcesContent":["export interface Rect {\r\n x: number;\r\n y: number;\r\n width: number;\r\n height: number;\r\n\r\n get top(): number;\r\n get bottom(): number;\r\n get left(): number;\r\n get right(): number;\r\n}\r\n\r\nexport class MutableRect implements Rect {\r\n public x: number;\r\n\r\n public y: number;\r\n\r\n public width: number;\r\n\r\n public height: number\r\n\r\n constructor({ x, y, width, height }: { x: number, y: number, width: number, height: number }) {\r\n this.x = x ?? 0;\r\n this.y = y ?? 0;\r\n this.width = width ?? 0;\r\n this.height = height ?? 0;\r\n }\r\n\r\n public get top(): number {\r\n return this.y;\r\n }\r\n\r\n public get bottom(): number {\r\n return this.y + this.height;\r\n }\r\n\r\n public get left(): number {\r\n return this.x;\r\n }\r\n\r\n public get right(): number {\r\n return this.x + this.width;\r\n }\r\n}\r\n"],"mappings":"AAYA,OAAO,MAAMA,WAAW,CAAiB;EASvCC,WAAWA,CAAAC,IAAA,EAAmF;IAAA,IAAlF;MAAEC,CAAC;MAAEC,CAAC;MAAEC,KAAK;MAAEC;IAAgE,CAAC,GAAAJ,IAAA;IAC1F,IAAI,CAACC,CAAC,GAAGA,CAAC,IAAI,CAAC;IACf,IAAI,CAACC,CAAC,GAAGA,CAAC,IAAI,CAAC;IACf,IAAI,CAACC,KAAK,GAAGA,KAAK,IAAI,CAAC;IACvB,IAAI,CAACC,MAAM,GAAGA,MAAM,IAAI,CAAC;EAC3B;EAEA,IAAWC,GAAGA,CAAA,EAAW;IACvB,OAAO,IAAI,CAACH,CAAC;EACf;EAEA,IAAWI,MAAMA,CAAA,EAAW;IAC1B,OAAO,IAAI,CAACJ,CAAC,GAAG,IAAI,CAACE,MAAM;EAC7B;EAEA,IAAWG,IAAIA,CAAA,EAAW;IACxB,OAAO,IAAI,CAACN,CAAC;EACf;EAEA,IAAWO,KAAKA,CAAA,EAAW;IACzB,OAAO,IAAI,CAACP,CAAC,GAAG,IAAI,CAACE,KAAK;EAC5B;AACF"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
export function hasOwnProperty(object, property) {
|
|
2
|
+
if (object) {
|
|
3
|
+
return Object.prototype.hasOwnProperty.call(object, property);
|
|
4
|
+
}
|
|
5
|
+
return false;
|
|
6
|
+
}
|
|
7
|
+
export function getNestedValue(obj, path, fallback) {
|
|
8
|
+
const last = path.length - 1;
|
|
9
|
+
let traversObj = obj;
|
|
10
|
+
if (last < 0) return traversObj === undefined ? fallback : traversObj;
|
|
11
|
+
for (let i = 0; i < last; i += 1) {
|
|
12
|
+
if (traversObj == null) {
|
|
13
|
+
return fallback;
|
|
14
|
+
}
|
|
15
|
+
traversObj = traversObj[path[i]];
|
|
16
|
+
}
|
|
17
|
+
if (traversObj == null) return fallback;
|
|
18
|
+
return traversObj[path[last]] === undefined ? fallback : traversObj[path[last]];
|
|
19
|
+
}
|
|
20
|
+
export function mergeDeep() {
|
|
21
|
+
let source = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
22
|
+
let overwrite = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
23
|
+
let arrayFn = arguments.length > 2 ? arguments[2] : undefined;
|
|
24
|
+
const ret = {
|
|
25
|
+
...source
|
|
26
|
+
};
|
|
27
|
+
for (const key in overwrite) {
|
|
28
|
+
const sourceValue = ret[key];
|
|
29
|
+
const overwriteValue = overwrite[key];
|
|
30
|
+
if (Array.isArray(sourceValue) && Array.isArray(overwriteValue)) {
|
|
31
|
+
if (arrayFn) {
|
|
32
|
+
ret[key] = arrayFn(sourceValue, overwriteValue);
|
|
33
|
+
continue;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
if (typeof sourceValue === 'object' && typeof overwriteValue === 'object') {
|
|
37
|
+
ret[key] = mergeDeep(sourceValue, overwriteValue, arrayFn);
|
|
38
|
+
continue;
|
|
39
|
+
}
|
|
40
|
+
ret[key] = overwriteValue;
|
|
41
|
+
}
|
|
42
|
+
return ret;
|
|
43
|
+
}
|
|
44
|
+
export function getObjectValueByPath(obj, path, fallback) {
|
|
45
|
+
// credit: http://stackoverflow.com/questions/6491463/accessing-nested-javascript-objects-with-string-key#comment55278413_6491621
|
|
46
|
+
let traversPath = path;
|
|
47
|
+
if (obj == null || !traversPath || typeof traversPath !== 'string') {
|
|
48
|
+
return fallback;
|
|
49
|
+
}
|
|
50
|
+
if (obj[traversPath] !== undefined) return obj[traversPath];
|
|
51
|
+
traversPath = traversPath.replace(/\[(\w+)\]/g, '.$1'); // convert indexes to properties
|
|
52
|
+
traversPath = traversPath.replace(/^\./, ''); // strip a leading dot
|
|
53
|
+
return getNestedValue(obj, traversPath.split('.'), fallback);
|
|
54
|
+
}
|
|
55
|
+
export function randomCharOne(str) {
|
|
56
|
+
if (str) {
|
|
57
|
+
return str.charAt(Math.floor(Math.random() * str.length));
|
|
58
|
+
}
|
|
59
|
+
return '';
|
|
60
|
+
}
|
|
61
|
+
export function clamp(value) {
|
|
62
|
+
let min = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
63
|
+
let max = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
|
|
64
|
+
return Math.max(min, Math.min(max, value));
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=common.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.mjs","names":["hasOwnProperty","object","property","Object","prototype","call","getNestedValue","obj","path","fallback","last","length","traversObj","undefined","i","mergeDeep","source","arguments","overwrite","arrayFn","ret","key","sourceValue","overwriteValue","Array","isArray","getObjectValueByPath","traversPath","replace","split","randomCharOne","str","charAt","Math","floor","random","clamp","value","min","max"],"sources":["../../src/util/common.ts"],"sourcesContent":["export function hasOwnProperty(object: any, property: string) {\r\n if (object) {\r\n return Object.prototype.hasOwnProperty.call(object, property);\r\n }\r\n return false;\r\n}\r\n\r\nexport function getNestedValue(\r\n obj: any,\r\n path: (string | number)[],\r\n fallback?: any,\r\n): any {\r\n const last = path.length - 1;\r\n let traversObj = obj;\r\n\r\n if (last < 0) return traversObj === undefined ? fallback : traversObj;\r\n\r\n for (let i = 0; i < last; i += 1) {\r\n if (traversObj == null) {\r\n return fallback;\r\n }\r\n traversObj = traversObj[path[i]];\r\n }\r\n\r\n if (traversObj == null) return fallback;\r\n\r\n return traversObj[path[last]] === undefined\r\n ? fallback\r\n : traversObj[path[last]];\r\n}\r\n\r\nexport function mergeDeep(source: Record<string, any> = {}, overwrite: Record<string, any> = {}, arrayFn?: (source: unknown[], overwrite: unknown[]) => unknown[]) {\r\n const ret = {...source};\r\n for (const key in overwrite) {\r\n const sourceValue = ret[key];\r\n const overwriteValue = overwrite[key];\r\n\r\n if (Array.isArray(sourceValue) && Array.isArray(overwriteValue)) {\r\n if (arrayFn) {\r\n ret[key] = arrayFn(sourceValue, overwriteValue);\r\n continue;\r\n }\r\n }\r\n\r\n if (typeof sourceValue === 'object' && typeof overwriteValue === 'object') {\r\n ret[key] = mergeDeep(sourceValue, overwriteValue, arrayFn);\r\n continue;\r\n }\r\n\r\n ret[key] = overwriteValue;\r\n }\r\n return ret;\r\n}\r\n\r\nexport function getObjectValueByPath(\r\n obj: any,\r\n path: string,\r\n fallback?: any,\r\n): any {\r\n // credit: http://stackoverflow.com/questions/6491463/accessing-nested-javascript-objects-with-string-key#comment55278413_6491621\r\n let traversPath = path;\r\n if (obj == null || !traversPath || typeof traversPath !== 'string') {\r\n return fallback;\r\n }\r\n if (obj[traversPath] !== undefined) return obj[traversPath];\r\n traversPath = traversPath.replace(/\\[(\\w+)\\]/g, '.$1'); // convert indexes to properties\r\n traversPath = traversPath.replace(/^\\./, ''); // strip a leading dot\r\n return getNestedValue(obj, traversPath.split('.'), fallback);\r\n}\r\n\r\nexport function randomCharOne(str: string) {\r\n if (str) {\r\n return str.charAt(Math.floor(Math.random() * str.length));\r\n }\r\n return '';\r\n}\r\n\r\nexport function clamp (value: number, min = 0, max = 1) {\r\n return Math.max(min, Math.min(max, value))\r\n}\r\n"],"mappings":"AAAA,OAAO,SAASA,cAAcA,CAACC,MAAW,EAAEC,QAAgB,EAAE;EAC5D,IAAID,MAAM,EAAE;IACV,OAAOE,MAAM,CAACC,SAAS,CAACJ,cAAc,CAACK,IAAI,CAACJ,MAAM,EAAEC,QAAQ,CAAC;EAC/D;EACA,OAAO,KAAK;AACd;AAEA,OAAO,SAASI,cAAcA,CAC5BC,GAAQ,EACRC,IAAyB,EACzBC,QAAc,EACT;EACL,MAAMC,IAAI,GAAGF,IAAI,CAACG,MAAM,GAAG,CAAC;EAC5B,IAAIC,UAAU,GAAGL,GAAG;EAEpB,IAAIG,IAAI,GAAG,CAAC,EAAE,OAAOE,UAAU,KAAKC,SAAS,GAAGJ,QAAQ,GAAGG,UAAU;EAErE,KAAK,IAAIE,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGJ,IAAI,EAAEI,CAAC,IAAI,CAAC,EAAE;IAChC,IAAIF,UAAU,IAAI,IAAI,EAAE;MACtB,OAAOH,QAAQ;IACjB;IACAG,UAAU,GAAGA,UAAU,CAACJ,IAAI,CAACM,CAAC,CAAC,CAAC;EAClC;EAEA,IAAIF,UAAU,IAAI,IAAI,EAAE,OAAOH,QAAQ;EAEvC,OAAOG,UAAU,CAACJ,IAAI,CAACE,IAAI,CAAC,CAAC,KAAKG,SAAS,GACvCJ,QAAQ,GACRG,UAAU,CAACJ,IAAI,CAACE,IAAI,CAAC,CAAC;AAC5B;AAEA,O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G,CAACoB,WAAW,CAAC,KAAKd,SAAS,EAAE,OAAON,GAAG,CAACoB,WAAW,CAAC;EAC3DA,WAAW,GAAGA,WAAW,CAACC,OAAO,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC,CAAC;EACxDD,WAAW,GAAGA,WAAW,CAACC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC;EAC9C,OAAOtB,cAAc,CAACC,GAAG,EAAEoB,WAAW,CAACE,KAAK,CAAC,GAAG,CAAC,EAAEpB,QAAQ,CAAC;AAC9D;AAEA,OAAO,SAASqB,aAAaA,CAACC,GAAW,EAAE;EACzC,IAAIA,GAAG,EAAE;IACP,OAAOA,GAAG,CAACC,MAAM,CAACC,IAAI,CAACC,KAAK,CAACD,IAAI,CAACE,MAAM,CAAC,CAAC,GAAGJ,GAAG,CAACpB,MAAM,CAAC,CAAC;EAC3D;EACA,OAAO,EAAE;AACX;AAEA,OAAO,SAASyB,KAAKA,CAAEC,KAAa,EAAoB;EAAA,IAAlBC,GAAG,GAAArB,SAAA,CAAAN,MAAA,QAAAM,SAAA,QAAAJ,SAAA,GAAAI,SAAA,MAAG,CAAC;EAAA,IAAEsB,GAAG,GAAAtB,SAAA,CAAAN,MAAA,QAAAM,SAAA,QAAAJ,SAAA,GAAAI,SAAA,MAAG,CAAC;EACpD,OAAOgB,IAAI,CAACM,GAAG,CAACD,GAAG,EAAEL,IAAI,CAACK,GAAG,CAACC,GAAG,EAAEF,KAAK,CAAC,CAAC;AAC5C"}
|
package/lib/util/dom.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dom.mjs","names":["documentRoot","domNode","root","getRootNode","document","composed"],"sources":["../../src/util/dom.ts"],"sourcesContent":["export function documentRoot(domNode: Node): null | HTMLDocument | ShadowRoot {\n const root = domNode.getRootNode();\n if (root !== document && root.getRootNode({ composed: true }) !== document)\n return null;\n return root as HTMLDocument | ShadowRoot;\n}\n"],"mappings":"AAAA,OAAO,SAASA,YAAYA,CAACC,OAAa,EAAoC;EAC5E,MAAMC,IAAI,GAAGD,OAAO,CAACE,WAAW,CAAC,CAAC;EAClC,IAAID,IAAI,KAAKE,QAAQ,IAAIF,IAAI,CAACC,WAAW,CAAC;IAAEE,QAAQ,EAAE;EAAK,CAAC,CAAC,KAAKD,QAAQ,EACxE,OAAO,IAAI;EACb,OAAOF,IAAI;AACb"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export function getScrollParent(el, horizontal) {
|
|
2
|
+
while (el) {
|
|
3
|
+
if (hasScrollbar(el, horizontal)) return el;
|
|
4
|
+
el = el.parentElement;
|
|
5
|
+
}
|
|
6
|
+
return document.scrollingElement;
|
|
7
|
+
}
|
|
8
|
+
export function getScrollParents(el, stopAt, horizontal) {
|
|
9
|
+
const elements = [];
|
|
10
|
+
if (stopAt && el && !stopAt.contains(el)) return elements;
|
|
11
|
+
while (el) {
|
|
12
|
+
if (hasScrollbar(el, horizontal)) elements.push(el);
|
|
13
|
+
if (el === stopAt) break;
|
|
14
|
+
el = el.parentElement;
|
|
15
|
+
}
|
|
16
|
+
return elements;
|
|
17
|
+
}
|
|
18
|
+
export function hasScrollbar(el, horizontal) {
|
|
19
|
+
if (!el || el.nodeType !== Node.ELEMENT_NODE) {
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
const style = window.getComputedStyle(el);
|
|
23
|
+
if (horizontal) {
|
|
24
|
+
return style.overflowX === 'scroll' || style.overflowX === 'auto' && el.clientWidth < el.scrollWidth;
|
|
25
|
+
}
|
|
26
|
+
return style.overflowY === 'scroll' || style.overflowY === 'auto' && el.clientHeight < el.scrollHeight;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=scroll.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scroll.mjs","names":["getScrollParent","el","horizontal","hasScrollbar","parentElement","document","scrollingElement","getScrollParents","stopAt","elements","contains","push","nodeType","Node","ELEMENT_NODE","style","window","getComputedStyle","overflowX","clientWidth","scrollWidth","overflowY","clientHeight","scrollHeight"],"sources":["../../src/util/scroll.ts"],"sourcesContent":["export function getScrollParent(el?: HTMLElement, horizontal?: boolean) {\n while (el) {\n if (hasScrollbar(el, horizontal)) return el;\n el = el.parentElement!;\n }\n return document.scrollingElement as HTMLElement;\n}\n\nexport function getScrollParents(\n el?: Element | null,\n stopAt?: Element | null,\n horizontal?: boolean,\n) {\n const elements: HTMLElement[] = [];\n\n if (stopAt && el && !stopAt.contains(el)) return elements;\n\n while (el) {\n if (hasScrollbar(el, horizontal)) elements.push(el as HTMLElement);\n if (el === stopAt) break;\n el = el.parentElement!;\n }\n\n return elements;\n}\n\nexport function hasScrollbar(el?: Element | null, horizontal?: boolean) {\n if (!el || el.nodeType !== Node.ELEMENT_NODE) {\n return false;\n }\n const style = window.getComputedStyle(el);\n if (horizontal) {\n return (\n style.overflowX === 'scroll' ||\n (style.overflowX === 'auto' && el.clientWidth < el.scrollWidth)\n );\n }\n return (\n style.overflowY === 'scroll' ||\n (style.overflowY === 'auto' && el.clientHeight < el.scrollHeight)\n );\n}\n"],"mappings":"AAAA,OAAO,SAASA,eAAeA,CAACC,EAAgB,EAAEC,UAAoB,EAAE;EACtE,OAAOD,EAAE,EAAE;IACT,IAAIE,YAAY,CAACF,EAAE,EAAEC,UAAU,CAAC,EAAE,OAAOD,EAAE;IAC3CA,EAAE,GAAGA,EAAE,CAACG,aAAc;EACxB;EACA,OAAOC,QAAQ,CAACC,gBAAgB;AAClC;AAEA,OAAO,SAASC,gBAAgBA,CAC9BN,EAAmB,EACnBO,MAAuB,EACvBN,UAAoB,EACpB;EACA,MAAMO,QAAuB,GAAG,EAAE;EAElC,IAAID,MAAM,IAAIP,EAAE,IAAI,CAACO,MAAM,CAACE,QAAQ,CAACT,EAAE,CAAC,EAAE,OAAOQ,QAAQ;EAEzD,OAAOR,EAAE,EAAE;IACT,IAAIE,YAAY,CAACF,EAAE,EAAEC,UAAU,CAAC,EAAEO,QAAQ,CAACE,IAAI,CAACV,EAAiB,CAAC;IAClE,IAAIA,EAAE,KAAKO,MAAM,EAAE;IACnBP,EAAE,GAAGA,EAAE,CAACG,aAAc;EACxB;EAEA,OAAOK,QAAQ;AACjB;AAEA,OAAO,SAASN,YAAYA,CAACF,EAAmB,EAAEC,UAAoB,EAAE;EACtE,IAAI,CAACD,EAAE,IAAIA,EAAE,CAACW,QAAQ,KAAKC,IAAI,CAACC,YAAY,EAAE;IAC5C,OAAO,KAAK;EACd;EACA,MAAMC,KAAK,GAAGC,MAAM,CAACC,gBAAgB,CAAChB,EAAE,CAAC;EACzC,IAAIC,UAAU,EAAE;IACd,OACEa,KAAK,CAACG,SAAS,KAAK,QAAQ,IAC3BH,KAAK,CAACG,SAAS,KAAK,MAAM,IAAIjB,EAAE,CAACkB,WAAW,GAAGlB,EAAE,CAACmB,WAAY;EAEnE;EACA,OACEL,KAAK,CAACM,SAAS,KAAK,QAAQ,IAC3BN,KAAK,CAACM,SAAS,KAAK,MAAM,IAAIpB,EAAE,CAACqB,YAAY,GAAGrB,EAAE,CAACsB,YAAa;AAErE"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export function camelToPascal(str) {
|
|
2
|
+
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
3
|
+
}
|
|
4
|
+
export function toKebabCase(str) {
|
|
5
|
+
let from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'camel';
|
|
6
|
+
let res = '';
|
|
7
|
+
for (let index = 0; index < str.length; index += 1) {
|
|
8
|
+
const char = str[index];
|
|
9
|
+
const charCode = char.charCodeAt(0);
|
|
10
|
+
if (charCode >= 65 && charCode <= 90) {
|
|
11
|
+
res += `${index === 0 && from === 'camel' ? '' : '-'}${char.toLowerCase()}`;
|
|
12
|
+
} else {
|
|
13
|
+
res += char;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
return res;
|
|
17
|
+
}
|
|
18
|
+
export function kebabToCamel(str) {
|
|
19
|
+
let res = '';
|
|
20
|
+
let index = 0;
|
|
21
|
+
while (index < str.length) {
|
|
22
|
+
const char = str[index];
|
|
23
|
+
if (char === '-') {
|
|
24
|
+
index += 1;
|
|
25
|
+
res += str[index].toUpperCase();
|
|
26
|
+
} else {
|
|
27
|
+
res += char;
|
|
28
|
+
}
|
|
29
|
+
index += 1;
|
|
30
|
+
}
|
|
31
|
+
return res;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=string.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"string.mjs","names":["camelToPascal","str","charAt","toUpperCase","slice","toKebabCase","from","arguments","length","undefined","res","index","char","charCode","charCodeAt","toLowerCase","kebabToCamel"],"sources":["../../src/util/string.ts"],"sourcesContent":["\n\nexport function camelToPascal(str: string) {\n return str.charAt(0).toUpperCase() + str.slice(1);\n}\n\nexport function toKebabCase(str: string, from: 'camel' | 'pascal' = 'camel') {\n let res = '';\n for (let index = 0; index < str.length; index += 1) {\n const char = str[index];\n const charCode = char.charCodeAt(0);\n if (charCode >= 65 && charCode <= 90) {\n res += `${\n index === 0 && from === 'camel' ? '' : '-'\n }${char.toLowerCase()}`;\n } else {\n res += char;\n }\n }\n return res;\n}\n\nexport function kebabToCamel(str: string) {\n let res = '';\n let index = 0;\n while (index < str.length) {\n const char = str[index];\n if (char === '-') {\n index += 1;\n res += str[index].toUpperCase();\n } else {\n res += char;\n }\n index += 1;\n }\n return res;\n}\n"],"mappings":"AAEA,OAAO,SAASA,aAAaA,CAACC,GAAW,EAAE;EACzC,OAAOA,GAAG,CAACC,MAAM,CAAC,CAAC,CAAC,CAACC,WAAW,CAAC,CAAC,GAAGF,GAAG,CAACG,KAAK,CAAC,CAAC,CAAC;AACnD;AAEA,OAAO,SAASC,WAAWA,CAACJ,GAAW,EAAsC;EAAA,IAApCK,IAAwB,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,OAAO;EACzE,IAAIG,GAAG,GAAG,EAAE;EACZ,KAAK,IAAIC,KAAK,GAAG,CAAC,EAAEA,KAAK,GAAGV,GAAG,CAACO,MAAM,EAAEG,KAAK,IAAI,CAAC,EAAE;IAClD,MAAMC,IAAI,GAAGX,GAAG,CAACU,KAAK,CAAC;IACvB,MAAME,QAAQ,GAAGD,IAAI,CAACE,UAAU,CAAC,CAAC,CAAC;IACnC,IAAID,QAAQ,IAAI,EAAE,IAAIA,QAAQ,IAAI,EAAE,EAAE;MACpCH,GAAG,IAAK,GACNC,KAAK,KAAK,CAAC,IAAIL,IAAI,KAAK,OAAO,GAAG,EAAE,GAAG,GACxC,GAAEM,IAAI,CAACG,WAAW,CAAC,CAAE,EAAC;IACzB,CAAC,MAAM;MACLL,GAAG,IAAIE,IAAI;IACb;EACF;EACA,OAAOF,GAAG;AACZ;AAEA,OAAO,SAASM,YAAYA,CAACf,GAAW,EAAE;EACxC,IAAIS,GAAG,GAAG,EAAE;EACZ,IAAIC,KAAK,GAAG,CAAC;EACb,OAAOA,KAAK,GAAGV,GAAG,CAACO,MAAM,EAAE;IACzB,MAAMI,IAAI,GAAGX,GAAG,CAACU,KAAK,CAAC;IACvB,IAAIC,IAAI,KAAK,GAAG,EAAE;MAChBD,KAAK,IAAI,CAAC;MACVD,GAAG,IAAIT,GAAG,CAACU,KAAK,CAAC,CAACR,WAAW,CAAC,CAAC;IACjC,CAAC,MAAM;MACLO,GAAG,IAAIE,IAAI;IACb;IACAD,KAAK,IAAI,CAAC;EACZ;EACA,OAAOD,GAAG;AACZ"}
|
package/lib/util/ui.mjs
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
export function colorHexToRgb(color) {
|
|
2
|
+
if (color && color[0] === '#') {
|
|
3
|
+
const hexCodeStr = color.substring(1, color.length);
|
|
4
|
+
const hexCodeLength = hexCodeStr.length;
|
|
5
|
+
const rgbValues = [];
|
|
6
|
+
if (hexCodeLength === 3 || hexCodeLength === 6) {
|
|
7
|
+
const multiple = hexCodeLength === 6 ? 2 : 1;
|
|
8
|
+
for (let i = 0; i < 3; i += 1) {
|
|
9
|
+
const hexCode = hexCodeStr.substring(i * multiple, i * multiple + multiple);
|
|
10
|
+
rgbValues.push(Number.parseInt(hexCode, 16));
|
|
11
|
+
}
|
|
12
|
+
return rgbValues;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
return undefined;
|
|
16
|
+
}
|
|
17
|
+
export function textColorIsLight(r, g, b) {
|
|
18
|
+
const luminance = 1 - (0.299 * r + 0.587 * g + 0.114 * b) / 255;
|
|
19
|
+
return luminance < 0.5;
|
|
20
|
+
}
|
|
21
|
+
export const RGBA_REGEX = /rgb(a?)\((?<v>.*)\)/;
|
|
22
|
+
export const HEX_COLOR_REGEX = /#([0-9a-fA-F]{3,6,8})/;
|
|
23
|
+
export function isColorValue(value) {
|
|
24
|
+
return RGBA_REGEX.test(value) || HEX_COLOR_REGEX.test(value);
|
|
25
|
+
}
|
|
26
|
+
export function toStyleSizeValue(size) {
|
|
27
|
+
let unit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'px';
|
|
28
|
+
if (size === '' || size === null || size === undefined) {
|
|
29
|
+
return undefined;
|
|
30
|
+
}
|
|
31
|
+
let value = Number(size);
|
|
32
|
+
if (isNaN(value) || !isFinite(value)) {
|
|
33
|
+
return undefined;
|
|
34
|
+
}
|
|
35
|
+
return `${value}${unit}`;
|
|
36
|
+
}
|
|
37
|
+
export function getBoundingPureRect(el) {
|
|
38
|
+
const rect = el.getBoundingClientRect();
|
|
39
|
+
const style = getComputedStyle(el);
|
|
40
|
+
const tx = style.transform;
|
|
41
|
+
if (tx) {
|
|
42
|
+
let sx, sy, dx, dy;
|
|
43
|
+
if (tx.startsWith('matrix3d(')) {
|
|
44
|
+
const ta = tx.slice(9, -1).split(/, /);
|
|
45
|
+
sx = +ta[0];
|
|
46
|
+
sy = +ta[5];
|
|
47
|
+
dx = +ta[12];
|
|
48
|
+
dy = +ta[13];
|
|
49
|
+
} else if (tx.startsWith('matrix(')) {
|
|
50
|
+
const ta = tx.slice(7, -1).split(/, /);
|
|
51
|
+
sx = +ta[0];
|
|
52
|
+
sy = +ta[3];
|
|
53
|
+
dx = +ta[4];
|
|
54
|
+
dy = +ta[5];
|
|
55
|
+
} else {
|
|
56
|
+
return rect;
|
|
57
|
+
}
|
|
58
|
+
const to = style.transformOrigin;
|
|
59
|
+
const x = rect.x - dx - (1 - sx) * parseFloat(to);
|
|
60
|
+
const y = rect.y - dy - (1 - sy) * parseFloat(to.slice(to.indexOf(' ') + 1));
|
|
61
|
+
const w = sx ? rect.width / sx : el.offsetWidth;
|
|
62
|
+
const h = sy ? rect.height / sy : el.offsetHeight;
|
|
63
|
+
return {
|
|
64
|
+
x: x,
|
|
65
|
+
y: y,
|
|
66
|
+
width: w,
|
|
67
|
+
height: h,
|
|
68
|
+
top: y,
|
|
69
|
+
right: x + w,
|
|
70
|
+
bottom: y + h,
|
|
71
|
+
left: x
|
|
72
|
+
};
|
|
73
|
+
} else {
|
|
74
|
+
return rect;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
export function pixelRound(val) {
|
|
78
|
+
return Math.round(val * devicePixelRatio) / devicePixelRatio;
|
|
79
|
+
}
|
|
80
|
+
export function pixelCeil(val) {
|
|
81
|
+
return Math.ceil(val * devicePixelRatio) / devicePixelRatio;
|
|
82
|
+
}
|
|
83
|
+
//# sourceMappingURL=ui.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ui.mjs","names":["colorHexToRgb","color","hexCodeStr","substring","length","hexCodeLength","rgbValues","multiple","i","hexCode","push","Number","parseInt","undefined","textColorIsLight","r","g","b","luminance","RGBA_REGEX","HEX_COLOR_REGEX","isColorValue","value","test","toStyleSizeValue","size","unit","arguments","isNaN","isFinite","getBoundingPureRect","el","rect","getBoundingClientRect","style","getComputedStyle","tx","transform","sx","sy","dx","dy","startsWith","ta","slice","split","to","transformOrigin","x","parseFloat","y","indexOf","w","width","offsetWidth","h","height","offsetHeight","top","right","bottom","left","pixelRound","val","Math","round","devicePixelRatio","pixelCeil","ceil"],"sources":["../../src/util/ui.ts"],"sourcesContent":["\n\nexport function colorHexToRgb(color: string): number[] | undefined {\n if (color && color[0] === '#') {\n const hexCodeStr = color.substring(1, color.length);\n const hexCodeLength = hexCodeStr.length;\n const rgbValues = [];\n if (hexCodeLength === 3 || hexCodeLength === 6) {\n const multiple = hexCodeLength === 6 ? 2 : 1;\n for (let i = 0; i < 3; i += 1) {\n const hexCode = hexCodeStr.substring(\n i * multiple,\n i * multiple + multiple,\n );\n rgbValues.push(Number.parseInt(hexCode, 16));\n }\n return rgbValues;\n }\n }\n return undefined;\n}\n\nexport function textColorIsLight(r: number, g: number, b: number): boolean {\n const luminance = 1 - (0.299 * r + 0.587 * g + 0.114 * b) / 255;\n return luminance < 0.5;\n}\n\nexport const RGBA_REGEX = /rgb(a?)\\((?<v>.*)\\)/;\nexport const HEX_COLOR_REGEX = /#([0-9a-fA-F]{3,6,8})/;\n\nexport function isColorValue(value: string): boolean {\n return RGBA_REGEX.test(value) || HEX_COLOR_REGEX.test(value);\n}\n\nexport function toStyleSizeValue(\n size: number | string | null | undefined,\n unit = 'px',\n): string | undefined {\n if (size === '' || size === null || size === undefined) {\n return undefined;\n }\n let value = Number(size);\n if (isNaN(value) || !isFinite(value)) {\n return undefined;\n }\n return `${value}${unit}`;\n}\n\nexport function getBoundingPureRect(el: HTMLElement) {\n const rect = el.getBoundingClientRect();\n const style = getComputedStyle(el);\n const tx = style.transform;\n\n if (tx) {\n let sx, sy, dx, dy;\n if (tx.startsWith('matrix3d(')) {\n const ta = tx.slice(9, -1).split(/, /);\n sx = +ta[0];\n sy = +ta[5];\n dx = +ta[12];\n dy = +ta[13];\n } else if (tx.startsWith('matrix(')) {\n const ta = tx.slice(7, -1).split(/, /);\n sx = +ta[0];\n sy = +ta[3];\n dx = +ta[4];\n dy = +ta[5];\n } else {\n return rect;\n }\n\n const to = style.transformOrigin;\n const x = rect.x - dx - (1 - sx) * parseFloat(to);\n const y =\n rect.y - dy - (1 - sy) * parseFloat(to.slice(to.indexOf(' ') + 1));\n const w = sx ? rect.width / sx : el.offsetWidth;\n const h = sy ? rect.height / sy : el.offsetHeight;\n return {\n x: x,\n y: y,\n width: w,\n height: h,\n top: y,\n right: x + w,\n bottom: y + h,\n left: x,\n } as DOMRect;\n } else {\n return rect;\n }\n}\n\nexport function pixelRound (val: number) {\n return Math.round(val * devicePixelRatio) / devicePixelRatio\n}\n\nexport function pixelCeil (val: number) {\n return Math.ceil(val * devicePixelRatio) / devicePixelRatio\n}\n"],"mappings":"AAEA,OAAO,SAASA,aAAaA,CAACC,KAAa,EAAwB;EACjE,IAAIA,KAAK,IAAIA,KAAK,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE;IAC7B,MAAMC,UAAU,GAAGD,KAAK,CAACE,SAAS,CAAC,CAAC,EAAEF,KAAK,CAACG,MAAM,CAAC;IACnD,MAAMC,aAAa,GAAGH,UAAU,CAACE,MAAM;IACvC,MAAME,SAAS,GAAG,EAAE;IACpB,IAAID,aAAa,KAAK,CAAC,IAAIA,aAAa,KAAK,CAAC,EAAE;MAC9C,MAAME,QAAQ,GAAGF,aAAa,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC;MAC5C,KAAK,IAAIG,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAG,CAAC,EAAEA,CAAC,IAAI,CAAC,EAAE;QAC7B,MAAMC,OAAO,GAAGP,UAAU,CAACC,SAAS,CAClCK,CAAC,GAAGD,QAAQ,EACZC,CAAC,GAAGD,QAAQ,GAAGA,QACjB,CAAC;QACDD,SAAS,CAACI,IAAI,CAACC,MAAM,CAACC,QAAQ,CAACH,OAAO,EAAE,EAAE,CAAC,CAAC;MAC9C;MACA,OAAOH,SAAS;IAClB;EACF;EACA,OAAOO,SAAS;AAClB;AAEA,OAAO,SAASC,gBAAgBA,CAACC,CAAS,EAAEC,CAAS,EAAEC,CAAS,EAAW;E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,EAAE,CAAC0B,YAAY;IACjD,OAAO;MACLT,CAAC,EAAEA,CAAC;MACJE,CAAC,EAAEA,CAAC;MACJG,KAAK,EAAED,CAAC;MACRI,MAAM,EAAED,CAAC;MACTG,GAAG,EAAER,CAAC;MACNS,KAAK,EAAEX,CAAC,GAAGI,CAAC;MACZQ,MAAM,EAAEV,CAAC,GAAGK,CAAC;MACbM,IAAI,EAAEb;IACR,CAAC;EACH,CAAC,MAAM;IACL,OAAOhB,IAAI;EACb;AACF;AAEA,OAAO,SAAS8B,UAAUA,CAAEC,GAAW,EAAE;EACvC,OAAOC,IAAI,CAACC,KAAK,CAACF,GAAG,GAAGG,gBAAgB,CAAC,GAAGA,gBAAgB;AAC9D;AAEA,OAAO,SAASC,SAASA,CAAEJ,GAAW,EAAE;EACtC,OAAOC,IAAI,CAACI,IAAI,CAACL,GAAG,GAAGG,gBAAgB,CAAC,GAAGA,gBAAgB;AAC7D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation.mjs","names":["REQUIRE_RULE","value"],"sources":["../../src/util/validation.ts"],"sourcesContent":["\n\nexport function REQUIRE_RULE(value: any): boolean {\n return !!value;\n}\n\nexport default {};\n"],"mappings":"AAEA,OAAO,SAASA,YAAYA,CAACC,KAAU,EAAW;EAChD,OAAO,CAAC,CAACA,KAAK;AAChB;AAEA,eAAe,CAAC,CAAC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { hasOwnProperty } from "./common.mjs";
|
|
2
|
+
import { getCurrentInstance } from "vue";
|
|
3
|
+
export function getSlot(vm) {
|
|
4
|
+
let name = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'default';
|
|
5
|
+
let data = arguments.length > 2 ? arguments[2] : undefined;
|
|
6
|
+
let optional = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
7
|
+
if (vm.$slots?.[name]) {
|
|
8
|
+
const slot = vm.$slots[name](data instanceof Function ? data() : data);
|
|
9
|
+
return slot.filter(node => {
|
|
10
|
+
return node.el?.nodeType !== 8;
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
return undefined;
|
|
14
|
+
}
|
|
15
|
+
export function getUid() {
|
|
16
|
+
const vm = getCurrentInstance();
|
|
17
|
+
return vm?.uid;
|
|
18
|
+
}
|
|
19
|
+
export function bindClasses(classes) {
|
|
20
|
+
const boundClasses = {};
|
|
21
|
+
if (typeof classes === 'string') {
|
|
22
|
+
boundClasses[classes] = true;
|
|
23
|
+
} else if (Array.isArray(classes)) {
|
|
24
|
+
classes.reduce((acc, clas) => {
|
|
25
|
+
acc[clas] = true;
|
|
26
|
+
return acc;
|
|
27
|
+
}, boundClasses);
|
|
28
|
+
} else if (typeof classes === 'object') {
|
|
29
|
+
Object.keys(classes).reduce((acc, clas) => {
|
|
30
|
+
acc[clas] = !!classes[clas];
|
|
31
|
+
return acc;
|
|
32
|
+
}, boundClasses);
|
|
33
|
+
}
|
|
34
|
+
return boundClasses;
|
|
35
|
+
}
|
|
36
|
+
export function getHtmlElement(node) {
|
|
37
|
+
return node && hasOwnProperty(node, '$el') ? node.$el : node;
|
|
38
|
+
}
|
|
39
|
+
export function propsFactory(props, source) {
|
|
40
|
+
return defaults => {
|
|
41
|
+
return Object.keys(props).reduce((options, prop) => {
|
|
42
|
+
const option = props[prop];
|
|
43
|
+
const isObjectOption = typeof option === 'object' && option != null && !Array.isArray(option);
|
|
44
|
+
const objectOption = isObjectOption ? option : {
|
|
45
|
+
type: option
|
|
46
|
+
};
|
|
47
|
+
if (defaults && prop in defaults) {
|
|
48
|
+
options[prop] = {
|
|
49
|
+
...objectOption,
|
|
50
|
+
default: defaults[prop]
|
|
51
|
+
};
|
|
52
|
+
} else {
|
|
53
|
+
options[prop] = objectOption;
|
|
54
|
+
}
|
|
55
|
+
if (source && !options[prop].source) {
|
|
56
|
+
options[prop].source = source;
|
|
57
|
+
}
|
|
58
|
+
return options;
|
|
59
|
+
}, {});
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// Copied from Vue
|
|
64
|
+
//# sourceMappingURL=vue-component.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vue-component.mjs","names":["hasOwnProperty","getCurrentInstance","getSlot","vm","name","arguments","length","undefined","data","optional","$slots","slot","Function","filter","node","el","nodeType","getUid","uid","bindClasses","classes","boundClasses","Array","isArray","reduce","acc","clas","Object","keys","getHtmlElement","$el","propsFactory","props","source","defaults","options","prop","option","isObjectOption","objectOption","type","default"],"sources":["../../src/util/vue-component.ts"],"sourcesContent":["import type { IfAny } from '@vue/shared';\nimport type {\n ComponentObjectPropsOptions,\n ComponentPublicInstance,\n Prop,\n PropType,\n VNode,\n} from 'vue';\n\nimport { hasOwnProperty } from './common';\nimport { getCurrentInstance } from \"vue\";\n\nexport function getSlot(\n vm: ComponentPublicInstance | any,\n // eslint-disable-next-line default-param-last\n name = 'default',\n data?: any | (() => any),\n optional = false,\n): VNode[] | undefined {\n if (vm.$slots?.[name]) {\n const slot = vm.$slots[name]!(data instanceof Function ? data() : data);\n return slot.filter((node: VNode) => {\n return node.el?.nodeType !== 8;\n });\n }\n return undefined;\n}\n\nexport function getUid() {\n const vm = getCurrentInstance();\n return vm?.uid;\n}\n\nexport function bindClasses(\n classes: string | string[] | Record<string, any> | undefined,\n) {\n const boundClasses = {} as Record<string, boolean>;\n if (typeof classes === 'string') {\n boundClasses[classes] = true;\n } else if (Array.isArray(classes)) {\n (classes as string[]).reduce((acc, clas) => {\n acc[clas] = true;\n return acc;\n }, boundClasses);\n } else if (typeof classes === 'object') {\n Object.keys(classes).reduce((acc, clas) => {\n acc[clas] = !!classes[clas];\n return acc;\n }, boundClasses);\n }\n return boundClasses;\n}\n\nexport function getHtmlElement<N extends object | undefined>(\n node: N,\n): Exclude<N, ComponentPublicInstance> | HTMLElement {\n return node && hasOwnProperty(node, '$el')\n ? ((node as ComponentPublicInstance).$el as HTMLElement)\n : (node as HTMLElement);\n}\n\nexport function propsFactory<PropsOptions extends ComponentObjectPropsOptions>(\n props: PropsOptions,\n source: string,\n) {\n return <Defaults extends PartialKeys<PropsOptions> = {}>(\n defaults?: Defaults,\n ): OverwrittenPropOptions<PropsOptions, Defaults> => {\n return Object.keys(props).reduce<any>((options, prop) => {\n const option = props[prop];\n const isObjectOption =\n typeof option === 'object' && option != null && !Array.isArray(option);\n const objectOption = isObjectOption ? option : { type: option };\n if (defaults && prop in defaults) {\n options[prop] = {\n ...objectOption,\n default: defaults[prop],\n };\n } else {\n options[prop] = objectOption;\n }\n\n if (source && !options[prop].source) {\n options[prop].source = source;\n }\n return options;\n }, {} as PropsOptions);\n };\n}\n\ntype OverwrittenPropOptions<\n T extends ComponentObjectPropsOptions,\n D extends PartialKeys<T>,\n> = {\n [P in keyof T]-?: unknown extends D[P]\n ? T[P]\n : T[P] extends Record<string, unknown>\n ? Omit<T[P], 'type' | 'default'> & {\n type: FollowPropType<Pick<T[P], 'type'>, T[P], D[P]>;\n default: MergeDefault<T[P], D[P]>;\n }\n : {\n type: PropType<MergeDefault<P, D>>;\n default: MergeDefault<T[P], D[P]>;\n };\n};\n\ntype MergeDefault<T, D> = unknown extends D\n ? InferPropType<T>\n : NonNullable<InferPropType<T>> | D;\n\ntype FollowPropType<T, P, D> = [T] extends [PropType<unknown>]\n ? T\n : PropType<MergeDefault<P, D>>;\n\ntype PartialKeys<T> = { [P in keyof T]?: unknown };\n\n// Copied from Vue\ntype InferPropType<T> = [T] extends [null]\n ? any // null & true would fail to infer\n : [T] extends [{ type: null | true }]\n ? // As TS issue https://github.com/Microsoft/TypeScript/issues/14829\n // somehow `ObjectConstructor` when inferred from { (): T } becomes `any`\n // `BooleanConstructor` when inferred from PropConstructor(with PropMethod) becomes `Boolean`\n any\n : [T] extends [ObjectConstructor | { type: ObjectConstructor }]\n ? Record<string, any>\n : [T] extends [BooleanConstructor | { type: BooleanConstructor }]\n ? boolean\n : [T] extends [DateConstructor | { type: DateConstructor }]\n ? Date\n : [T] extends [(infer U)[] | { type: (infer U)[] }]\n ? U extends DateConstructor\n ? Date | InferPropType<U>\n : InferPropType<U>\n : [T] extends [Prop<infer V, infer D>]\n ? unknown extends V\n ? IfAny<V, V, D>\n : V\n : T;\n"],"mappings":"SASSA,cAAc;AACvB,SAASC,kBAAkB,QAAQ,KAAK;AAExC,OAAO,SAASC,OAAOA,CACrBC,EAAiC,EAKZ;EAAA,IAHrBC,IAAI,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,SAAS;EAAA,IAChBG,IAAwB,GAAAH,SAAA,CAAAC,MAAA,OAAAD,SAAA,MAAAE,SAAA;EAAA,IACxBE,QAAQ,GAAAJ,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,KAAK;EAEhB,IAAIF,EAAE,CAACO,MAAM,GAAGN,IAAI,CAAC,EAAE;IACrB,MAAMO,IAAI,GAAGR,EAAE,CAACO,MAAM,CAACN,IAAI,CAAC,CAAEI,IAAI,YAAYI,QAAQ,GAAGJ,IAAI,CAAC,CAAC,GAAGA,IAAI,CAAC;IACvE,OAAOG,IAAI,CAACE,MAAM,CAAEC,IAAW,IAAK;MAClC,OAAOA,IAAI,CAACC,EAAE,EAAEC,QAAQ,KAAK,CAAC;IAChC,CAAC,CAAC;EACJ;EACA,OAAOT,SAAS;AAClB;AAEA,OAAO,SAASU,MAAMA,CAAA,EAAG;EACvB,MAAMd,EAAE,GAAGF,kBAAkB,CAAC,CAAC;EAC/B,OAAOE,EAAE,EAAEe,GAAG;AAChB;AAEA,OAAO,SAASC,WAAWA,CACzBC,OAA4D,EAC5D;EACA,MAAMC,YAAY,GAAG,CAAC,CAA4B;EAClD,IAAI,OAAOD,OAAO,KAAK,QAAQ,EAAE;IAC/BC,YAAY,CAACD,OAAO,CAAC,GAAG,IAAI;EAC9B,CAAC,MAAM,IAAIE,KAAK,CAACC,OAAO,CAACH,OAAO,CAAC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AAC;MACH,CAAC,MAAM;QACLD,OAAO,CAACC,IAAI,CAAC,GAAGG,YAAY;MAC9B;MAEA,IAAIN,MAAM,IAAI,CAACE,OAAO,CAACC,IAAI,CAAC,CAACH,MAAM,EAAE;QACnCE,OAAO,CAACC,IAAI,CAAC,CAACH,MAAM,GAAGA,MAAM;MAC/B;MACA,OAAOE,OAAO;IAChB,CAAC,EAAE,CAAC,CAAiB,CAAC;EACxB,CAAC;AACH;;AA6BA"}
|
package/package.json
CHANGED
|
@@ -1,33 +1,73 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "yuyeon",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
"keywords": [
|
|
9
|
-
"components",
|
|
10
|
-
"component library",
|
|
11
|
-
"UI library",
|
|
12
|
-
"vue components"
|
|
3
|
+
"version": "0.0.3",
|
|
4
|
+
"files": [
|
|
5
|
+
"dist",
|
|
6
|
+
"lib",
|
|
7
|
+
"types"
|
|
13
8
|
],
|
|
14
|
-
"engines": {
|
|
15
|
-
"node": ">=14.13"
|
|
16
|
-
},
|
|
17
|
-
"main": "src/index.ts",
|
|
18
|
-
"module": "src/index.mjs",
|
|
19
|
-
"files": ["src/"],
|
|
20
9
|
"exports": {
|
|
21
|
-
"
|
|
10
|
+
".": {
|
|
11
|
+
"default": "./lib/index.mjs"
|
|
12
|
+
},
|
|
13
|
+
"./styles/*": "./lib/styles/*",
|
|
14
|
+
"./components": {
|
|
15
|
+
"types": "./types/components/index.d.ts",
|
|
16
|
+
"module": "./lib/components/index.mjs"
|
|
17
|
+
},
|
|
18
|
+
"./components/*": "./lib/components/*/index.mjs",
|
|
19
|
+
"./types/*": "./types/*",
|
|
20
|
+
"./*": "./*"
|
|
21
|
+
},
|
|
22
|
+
"main": "lib/index.mjs",
|
|
23
|
+
"module": "lib/index.mjs",
|
|
24
|
+
"scripts": {
|
|
25
|
+
"build": "vue-tsc && vite build",
|
|
26
|
+
"build:lib": "cross-env NODE_ENV=lib babel src --out-dir lib --source-maps --extensions \".ts\",\".tsx\" --copy-files --no-copy-ignored --out-file-extension .mjs"
|
|
27
|
+
},
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"motion": "^10.15.5"
|
|
22
30
|
},
|
|
23
31
|
"devDependencies": {
|
|
24
|
-
"@
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
32
|
+
"@babel/cli": "^7.21.0",
|
|
33
|
+
"@babel/core": "^7.21.3",
|
|
34
|
+
"@babel/preset-env": "^7.20.2",
|
|
35
|
+
"@babel/preset-typescript": "^7.21.0",
|
|
36
|
+
"@rollup/plugin-alias": "^4.0.3",
|
|
37
|
+
"@rollup/plugin-babel": "^6.0.3",
|
|
38
|
+
"@rollup/plugin-node-resolve": "^15.0.1",
|
|
39
|
+
"@rollup/plugin-typescript": "^11.0.0",
|
|
40
|
+
"@trivago/prettier-plugin-sort-imports": "^4.1.1",
|
|
41
|
+
"@types/jest": "^28.1.8",
|
|
42
|
+
"@types/node": "^18.15.11",
|
|
43
|
+
"@types/resize-observer-browser": "^0.1.7",
|
|
44
|
+
"@vitejs/plugin-vue": "^4.2.3",
|
|
45
|
+
"@vitejs/plugin-vue-jsx": "^3.0.1",
|
|
46
|
+
"@vue/babel-plugin-jsx": "^1.1.1",
|
|
47
|
+
"@vue/compiler-sfc": "^3.3.4",
|
|
48
|
+
"@vue/runtime-core": "^3.3.4",
|
|
49
|
+
"@vue/shared": "^3.3.4",
|
|
50
|
+
"@vue/test-utils": "2.3.2",
|
|
51
|
+
"autoprefixer": "^10.4.14",
|
|
52
|
+
"babel-plugin-add-import-extension": "1.5.1",
|
|
53
|
+
"babel-plugin-module-resolver": "^5.0.0",
|
|
54
|
+
"babel-plugin-transform-define": "^2.1.0",
|
|
55
|
+
"babel-polyfill": "^6.26.0",
|
|
56
|
+
"concurrently": "^4.1.1",
|
|
57
|
+
"cross-env": "^7.0.3",
|
|
58
|
+
"rollup": "^3.20.2",
|
|
59
|
+
"rollup-plugin-dts": "^5.3.0",
|
|
60
|
+
"rollup-plugin-sass": "^1.2.19",
|
|
61
|
+
"rollup-plugin-sourcemaps": "^0.6.3",
|
|
62
|
+
"rollup-plugin-terser": "^7.0.2",
|
|
63
|
+
"sass": "^1.63.3",
|
|
64
|
+
"vite": "^4.3.8",
|
|
65
|
+
"vite-plugin-dts": "^2.2.0",
|
|
66
|
+
"vue": "^3.3.4",
|
|
67
|
+
"vue-tsc": "^1.2.0"
|
|
28
68
|
},
|
|
29
69
|
"peerDependencies": {
|
|
30
|
-
"vue": "^3.
|
|
70
|
+
"vue": "^3.3.0",
|
|
31
71
|
"vue-i18n": "^9.0.0"
|
|
32
72
|
},
|
|
33
73
|
"peerDependenciesMeta": {
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* # App Component
|
|
3
|
+
*/
|
|
4
|
+
export declare const YApp: import("vue").DefineComponent<{}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
5
|
+
[key: string]: any;
|
|
6
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
|
|
7
|
+
export type YApp = InstanceType<typeof YApp>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './YApp';
|