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 @@
|
|
|
1
|
+
{"version":3,"file":"timing.mjs","names":["computed","ref","watch","useLazy","eager","updated","tick","tack","value","lazyValue","onAfterUpdate","entered","useTimer","cb","duration","arguments","length","undefined","options","tickDuration","tickInterval","timer","tickStart","drift","isWork","now","Date","realTick","tickDrift","nextInterval","window","setTimeout","start","stop","clearTimeout","reset"],"sources":["../../src/composables/timing.ts"],"sourcesContent":["import { Ref, computed, ref, watch } from 'vue';\n\nexport function useLazy(eager: boolean, updated: Ref<any>) {\n const tick = ref(false);\n const tack = ref();\n tack.value = updated.value;\n const lazyValue = computed(() => {\n if (eager) return updated.value;\n return tack.value;\n });\n watch(updated, () => {\n if (!tick.value) {\n tack.value = updated.value;\n }\n if (!eager) {\n tick.value = true;\n }\n });\n function onAfterUpdate() {\n tack.value = updated.value;\n if (!eager) {\n tick.value = false;\n }\n }\n return {\n entered: tick,\n lazyValue,\n onAfterUpdate,\n };\n}\n\nexport function useTimer(\n cb: () => void,\n duration = 1000,\n options?: { tickDuration: number },\n) {\n const { tickDuration } = options ?? {};\n let tickInterval = tickDuration ?? 100;\n let timer = -1;\n\n const tickStart = ref(0);\n const drift = ref(duration);\n const isWork = ref(false);\n\n function tick() {\n const now = Date.now();\n const realTick = now - tickStart.value;\n drift.value = drift.value - realTick;\n if (drift.value < 1) {\n cb();\n } else {\n const tickDrift = now - tickStart.value + tickInterval;\n const nextInterval = tickDrift >= 1 ? tickDrift : tickInterval;\n tickStart.value = now;\n timer = window.setTimeout(tick, nextInterval);\n }\n }\n\n function start() {\n if (isWork.value) return;\n isWork.value = true;\n tickStart.value = Date.now();\n timer = window.setTimeout(tick, tickInterval);\n }\n\n function stop() {\n window.clearTimeout(timer);\n timer = -1;\n isWork.value = false;\n }\n\n function reset() {\n stop();\n drift.value = duration;\n }\n\n return {\n start,\n stop,\n reset,\n drift,\n isWork,\n }\n}\n"],"mappings":"AAAA,SAAcA,QAAQ,EAAEC,GAAG,EAAEC,KAAK,QAAQ,KAAK;AAE/C,OAAO,SAASC,OAAOA,CAACC,KAAc,EAAEC,OAAiB,EAAE;EACzD,MAAMC,IAAI,GAAGL,GAAG,CAAC,KAAK,CAAC;EACvB,MAAMM,IAAI,GAAGN,GAAG,CAAC,CAAC;EAClBM,IAAI,CAACC,KAAK,GAAGH,OAAO,CAACG,KAAK;EAC1B,MAAMC,SAAS,GAAGT,QAAQ,CAAC,MAAM;IAC/B,IAAII,KAAK,EAAE,OAAOC,OAAO,CAACG,KAAK;IAC/B,OAAOD,IAAI,CAACC,KAAK;EACnB,CAAC,CAAC;EACFN,KAAK,CAACG,OAAO,EAAE,MAAM;IACnB,IAAI,CAACC,IAAI,CAACE,KAAK,EAAE;MACfD,IAAI,CAACC,KAAK,GAAGH,OAAO,CAACG,KAAK;IAC5B;IACA,IAAI,CAACJ,KAAK,EAAE;MACVE,IAAI,CAACE,KAAK,GAAG,IAAI;IACnB;EACF,CAAC,CAAC;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AG;MACrBJ,KAAK,GAAGS,MAAM,CAACC,UAAU,CAACzB,IAAI,EAAEuB,YAAY,CAAC;IAC/C;EACF;EAEA,SAASG,KAAKA,CAAA,EAAG;IACf,IAAIR,MAAM,CAAChB,KAAK,EAAE;IAClBgB,MAAM,CAAChB,KAAK,GAAG,IAAI;IACnBc,SAAS,CAACd,KAAK,GAAGkB,IAAI,CAACD,GAAG,CAAC,CAAC;IAC5BJ,KAAK,GAAGS,MAAM,CAACC,UAAU,CAACzB,IAAI,EAAEc,YAAY,CAAC;EAC/C;EAEA,SAASa,IAAIA,CAAA,EAAG;IACdH,MAAM,CAACI,YAAY,CAACb,KAAK,CAAC;IAC1BA,KAAK,GAAG,CAAC,CAAC;IACVG,MAAM,CAAChB,KAAK,GAAG,KAAK;EACtB;EAEA,SAAS2B,KAAKA,CAAA,EAAG;IACfF,IAAI,CAAC,CAAC;IACNV,KAAK,CAACf,KAAK,GAAGM,QAAQ;EACxB;EAEA,OAAO;IACLkB,KAAK;IACLC,IAAI;IACJE,KAAK;IACLZ,KAAK;IACLC;EACF,CAAC;AACH"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { Transition, computed, h } from 'vue';
|
|
2
|
+
export const polyTransitionPropOptions = {
|
|
3
|
+
transition: {
|
|
4
|
+
type: [String, Object],
|
|
5
|
+
default: 'slide-fade'
|
|
6
|
+
}
|
|
7
|
+
};
|
|
8
|
+
export function usePolyTransition(props) {
|
|
9
|
+
const polyTransitionBindProps = computed(() => {
|
|
10
|
+
const {
|
|
11
|
+
is,
|
|
12
|
+
...transitionProps
|
|
13
|
+
} = typeof props.transition === 'object' ? props.transition : {
|
|
14
|
+
is: props.transition,
|
|
15
|
+
name: props.transition
|
|
16
|
+
};
|
|
17
|
+
return {
|
|
18
|
+
is,
|
|
19
|
+
transitionProps
|
|
20
|
+
};
|
|
21
|
+
});
|
|
22
|
+
return {
|
|
23
|
+
polyTransitionBindProps
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
export const PolyTransition = (props, _ref) => {
|
|
27
|
+
let {
|
|
28
|
+
slots
|
|
29
|
+
} = _ref;
|
|
30
|
+
const {
|
|
31
|
+
is,
|
|
32
|
+
transitionProps,
|
|
33
|
+
...forcedProps
|
|
34
|
+
} = props;
|
|
35
|
+
const {
|
|
36
|
+
component = Transition,
|
|
37
|
+
...rest
|
|
38
|
+
} = typeof is === 'object' ? {
|
|
39
|
+
component: is,
|
|
40
|
+
...transitionProps
|
|
41
|
+
} : {
|
|
42
|
+
name: is
|
|
43
|
+
};
|
|
44
|
+
return h(component, {
|
|
45
|
+
...rest,
|
|
46
|
+
...transitionProps,
|
|
47
|
+
...forcedProps
|
|
48
|
+
}, slots);
|
|
49
|
+
};
|
|
50
|
+
//# sourceMappingURL=transition.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transition.mjs","names":["Transition","computed","h","polyTransitionPropOptions","transition","type","String","Object","default","usePolyTransition","props","polyTransitionBindProps","is","transitionProps","name","PolyTransition","_ref","slots","forcedProps","component","rest"],"sources":["../../src/composables/transition.ts"],"sourcesContent":["import {\n Component,\n FunctionalComponent,\n PropType,\n Transition,\n TransitionProps,\n computed,\n h,\n} from 'vue';\n\nexport const polyTransitionPropOptions = {\n transition: {\n type: [String, Object] as PropType<\n string | (TransitionProps & { is?: Component })\n >,\n default: 'slide-fade',\n },\n};\n\nexport function usePolyTransition(props: { transition: any }) {\n const polyTransitionBindProps = computed(() => {\n const { is, ...transitionProps } =\n typeof props.transition === 'object'\n ? props.transition\n : { is: props.transition, name: props.transition };\n return {\n is,\n transitionProps,\n };\n });\n\n return {\n polyTransitionBindProps,\n };\n}\n\nexport const PolyTransition: FunctionalComponent<\n TransitionProps & { is: string | Component; transitionProps: TransitionProps }\n> = (props, { slots }) => {\n const { is, transitionProps, ...forcedProps } = props;\n const { component = Transition, ...rest } =\n typeof is === 'object'\n ? { component: is, ...transitionProps }\n : { name: is };\n return h(component, { ...rest, ...transitionPro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Determine() {
|
|
3
|
+
return true;
|
|
4
|
+
}
|
|
5
|
+
function directive(mouseEvent, element, binding) {
|
|
6
|
+
const {
|
|
7
|
+
value
|
|
8
|
+
} = binding;
|
|
9
|
+
const handler = typeof value === 'function' ? value : value.handler;
|
|
10
|
+
element._complementClick.lastMousedownWasOutside && checkEvent(mouseEvent, element, binding) && setTimeout(() => {
|
|
11
|
+
determine(mouseEvent, binding) && handler && handler(mouseEvent);
|
|
12
|
+
}, 0);
|
|
13
|
+
}
|
|
14
|
+
function checkEvent(mouseEvent, element, binding) {
|
|
15
|
+
if (!mouseEvent || determine(mouseEvent, binding) === false) {
|
|
16
|
+
return false;
|
|
17
|
+
}
|
|
18
|
+
const root = documentRoot(element);
|
|
19
|
+
if (typeof ShadowRoot !== 'undefined' && root instanceof ShadowRoot && root.host === mouseEvent.target) {
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
const elements = (typeof binding.value === 'object' && binding.value.include || (() => []))();
|
|
23
|
+
elements.push(element);
|
|
24
|
+
return !elements.some(el => el?.contains(mouseEvent.target));
|
|
25
|
+
}
|
|
26
|
+
function determine(event, binding) {
|
|
27
|
+
const {
|
|
28
|
+
value
|
|
29
|
+
} = binding;
|
|
30
|
+
const determineFn = typeof value === 'object' && value.determine || defaultDetermine;
|
|
31
|
+
return determineFn && determineFn?.(event);
|
|
32
|
+
}
|
|
33
|
+
function implant(element, callback) {
|
|
34
|
+
const root = documentRoot(element);
|
|
35
|
+
callback(document);
|
|
36
|
+
if (typeof ShadowRoot !== 'undefined' && root instanceof ShadowRoot) {
|
|
37
|
+
callback(root);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
export const ComplementClick = {
|
|
41
|
+
mounted(element, binding) {
|
|
42
|
+
const onClick = event => directive(event, element, binding);
|
|
43
|
+
const onMousedown = event => {
|
|
44
|
+
element._complementClick.lastMousedownWasOutside = checkEvent(event, element, binding);
|
|
45
|
+
};
|
|
46
|
+
implant(element, app => {
|
|
47
|
+
app?.addEventListener('click', onClick, true);
|
|
48
|
+
app?.addEventListener('mousedown', onMousedown, true);
|
|
49
|
+
});
|
|
50
|
+
if (!element._complementClick) {
|
|
51
|
+
element._complementClick = {
|
|
52
|
+
lastMousedownWasOutside: true
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
const _uid = binding.instance.$.uid;
|
|
56
|
+
element._complementClick[_uid] = {
|
|
57
|
+
onClick,
|
|
58
|
+
onMousedown
|
|
59
|
+
};
|
|
60
|
+
},
|
|
61
|
+
unmounted(element, binding) {
|
|
62
|
+
if (!element._complementClick) return;
|
|
63
|
+
const _uid = binding.instance.$.uid;
|
|
64
|
+
implant(element, app => {
|
|
65
|
+
const old = element._complementClick?.[_uid];
|
|
66
|
+
if (old) {
|
|
67
|
+
const {
|
|
68
|
+
onClick,
|
|
69
|
+
onMousedown
|
|
70
|
+
} = old;
|
|
71
|
+
app?.removeEventListener('click', onClick, true);
|
|
72
|
+
app?.removeEventListener('mousedown', onMousedown, true);
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
delete element._complementClick[_uid];
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["documentRoot","defaultDetermine","directive","mouseEvent","element","binding","value","handler","_complementClick","lastMousedownWasOutside","checkEvent","setTimeout","determine","root","ShadowRoot","host","target","elements","include","push","some","el","contains","event","determineFn","implant","callback","document","ComplementClick","mounted","onClick","onMousedown","app","addEventListener","_uid","instance","$","uid","unmounted","old","removeEventListener"],"sources":["../../../src/directives/complement-click/index.ts"],"sourcesContent":["import { DirectiveBinding } from 'vue';\n\nimport { documentRoot } from '../../util/dom';\n\ninterface ComplementClickDirectiveElementImplanted {\n onClick: EventListener;\n onMousedown: EventListener;\n}\n\ndeclare global {\n interface Element {\n _complementClick?: Record<\n number,\n ComplementClickDirectiveElementImplanted | undefined\n > & { lastMousedownWasOutside: boolean };\n }\n}\n\nexport interface ComplementClickBindingOptions {\n handler: (mouseEvent: MouseEvent) => void;\n determine?: (event: Event) => boolean;\n include?: () => HTMLElement[];\n}\n\nexport interface ComplementClickBinding extends DirectiveBinding {\n value: ((mouseEvent: MouseEvent) => void) | ComplementClickBindingOptions;\n}\n\nfunction defaultDetermine() {\n return true;\n}\n\nfunction directive(\n mouseEvent: MouseEvent,\n element: HTMLElement,\n binding: ComplementClickBinding,\n) {\n const { value } = binding;\n const handler = typeof value === 'function' ? value : value.handler;\n element._complementClick!.lastMousedownWasOutside &&\n checkEvent(mouseEvent, element, binding) &&\n setTimeout(() => {\n determine(mouseEvent, binding) && handler && handler(mouseEvent);\n }, 0);\n}\n\nfunction checkEvent(\n mouseEvent: MouseEvent,\n element: HTMLElement,\n binding: ComplementClickBinding,\n): boolean {\n if (!mouseEvent || determine(mouseEvent, binding) === false) {\n return false;\n }\n const root = documentRoot(element);\n if (\n typeof ShadowRoot !== 'undefined' &&\n root instanceof ShadowRoot &&\n root.host === mouseEvent.target\n ) {\n return false;\n }\n const elements = (\n (typeof binding.value === 'object' && binding.value.include) ||\n (() => [])\n )();\n elements.push(element);\n return !elements.some((el) => el?.contains(mouseEvent.target as Node));\n}\n\nfunction determine(\n event: MouseEvent,\n binding: ComplementClickBinding,\n): boolean {\n const { value } = binding;\n const determineFn =\n (typeof value === 'object' && value.determine) || defaultDetermine;\n return determineFn && determineFn?.(event);\n}\n\nfunction implant(\n element: HTMLElement,\n callback: (app: HTMLDocument | ShadowRoot | null) => void,\n) {\n const root = documentRoot(element);\n callback(document);\n if (typeof ShadowRoot !== 'undefined' && root instanceof ShadowRoot) {\n callback(root);\n }\n}\n\nexport const ComplementClick = {\n mounted(element: HTMLElement, binding: ComplementClickBinding) {\n const onClick = (event: Event) =>\n directive(event as MouseEvent, element, binding);\n const onMousedown = (event: Event) => {\n element._complementClick!.lastMousedownWasOutside = checkEvent(\n event as MouseEvent,\n element,\n binding,\n );\n };\n implant(element, (app) => {\n app?.addEventListener('click', onClick, true);\n app?.addEventListener('mousedown', onMousedown, true);\n });\n if (!element._complementClick) {\n element._complementClick = {\n lastMousedownWasOutside: true,\n };\n }\n const _uid = binding.instance!.$.uid;\n element._complementClick[_uid] = {\n onClick,\n onMousedown,\n };\n },\n unmounted(element: HTMLElement, binding: ComplementClickBinding) {\n if (!element._complementClick) return;\n const _uid = binding.instance!.$.uid;\n implant(element, (app) => {\n const old = element._complementClick?.[_uid];\n if (old) {\n const { onClick, onMousedown } = old;\n app?.removeEventListener('click', onClick, true);\n app?.removeEventListener('mousedown', onMousedown, true);\n }\n });\n delete element._complementClick[_uid];\n },\n};\n"],"mappings":"SAESA,YAAY;AA0BrB,SAASC,gBAAgBA,CAAA,EAAG;EAC1B,OAAO,IAAI;AACb;AAEA,SAASC,SAASA,CAChBC,UAAsB,EACtBC,OAAoB,EACpBC,OAA+B,EAC/B;EACA,MAAM;IAAEC;EAAM,CAAC,GAAGD,OAAO;EACzB,MAAME,OAAO,GAAG,OAAOD,KAAK,KAAK,UAAU,GAAGA,KAAK,GAAGA,KAAK,CAACC,OAAO;EACnEH,OAAO,CAACI,gBAAgB,CAAEC,uBAAuB,IAC/CC,UAAU,CAACP,UAAU,EAAEC,OAAO,EAAEC,OAAO,CAAC,IACxCM,UAAU,CAAC,MAAM;IACfC,SAAS,CAACT,UAAU,EAAEE,OAAO,CAAC,IAAIE,OAAO,IAAIA,OAAO,CAACJ,UAAU,CAAC;EAClE,CAAC,EAAE,CAAC,CAAC;AACT;AAEA,SAASO,UAAUA,CACjBP,UAAsB,EACtBC,OAAoB,EACpBC,OAA+B,EACtB;EACT,IAAI,CAACF,UAAU,IAAIS,SAAS,CAACT,UAAU,EAAEE,OAAO,CAAC,KAAK,KAAK,EAAE;IAC3D,OAAO,KAAK;EACd;EACA,MAAMQ,IAAI,GAAGb,YAAY,CAACI,OAAO,CAAC;EAClC,IACE,OAAOU,UAAU,KAAK,WAAW,IACjCD,IAAI,YAAYC,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face PlateWaveBinding
|
|
6
|
-
extends Omit<DirectiveBinding, 'modifiers' | 'value'> {
|
|
7
|
-
value?: boolean;
|
|
8
|
-
modifiers: { stop?: boolean };
|
|
9
|
-
}
|
|
10
|
-
|
|
1
|
+
import "./plate-wave.scss";
|
|
11
2
|
const CLASS_NAME = 'y-plate-wave__animation';
|
|
12
|
-
|
|
13
|
-
function showAnimation(el: HTMLElement | null) {
|
|
3
|
+
function showAnimation(el) {
|
|
14
4
|
if (!el) return;
|
|
15
5
|
const animation = document.createElement('span');
|
|
16
6
|
animation.className = CLASS_NAME;
|
|
17
7
|
el.appendChild(animation);
|
|
18
8
|
animation.dataset.activated = String(performance.now());
|
|
19
9
|
}
|
|
20
|
-
|
|
21
|
-
function hideAnimation(el: HTMLElement | null) {
|
|
10
|
+
function hideAnimation(el) {
|
|
22
11
|
if (!el) {
|
|
23
12
|
return;
|
|
24
13
|
}
|
|
25
14
|
const animations = el.getElementsByClassName(CLASS_NAME);
|
|
26
15
|
if (animations.length === 0) return;
|
|
27
|
-
const animation = animations[animations.length - 1]
|
|
16
|
+
const animation = animations[animations.length - 1];
|
|
28
17
|
if (animation.dataset.isHiding) return;
|
|
29
18
|
animation.dataset.isHiding = 'true';
|
|
30
19
|
const diff = performance.now() - Number(animation.dataset.activated);
|
|
@@ -41,50 +30,45 @@ function hideAnimation(el: HTMLElement | null) {
|
|
|
41
30
|
* */
|
|
42
31
|
|
|
43
32
|
let keyboardEventFlag = false;
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
showAnimation(event.currentTarget as HTMLElement);
|
|
33
|
+
function spawn(event) {
|
|
34
|
+
showAnimation(event.currentTarget);
|
|
47
35
|
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
hideAnimation(event.currentTarget as HTMLElement);
|
|
36
|
+
function clean(event) {
|
|
37
|
+
hideAnimation(event.currentTarget);
|
|
51
38
|
}
|
|
52
|
-
|
|
53
|
-
function stop(event: Event) {
|
|
39
|
+
function stop(event) {
|
|
54
40
|
//
|
|
55
41
|
}
|
|
56
|
-
|
|
57
|
-
function keyboardSpawn(event: KeyboardEvent) {
|
|
42
|
+
function keyboardSpawn(event) {
|
|
58
43
|
if (!keyboardEventFlag && (event.key === 'Enter' || event.key === 'Space')) {
|
|
59
44
|
keyboardEventFlag = true;
|
|
60
|
-
showAnimation(event.currentTarget
|
|
45
|
+
showAnimation(event.currentTarget);
|
|
61
46
|
}
|
|
62
47
|
}
|
|
63
|
-
|
|
64
|
-
function keyboardClean(event: KeyboardEvent) {
|
|
48
|
+
function keyboardClean(event) {
|
|
65
49
|
keyboardEventFlag = false;
|
|
66
|
-
hideAnimation(event.currentTarget
|
|
50
|
+
hideAnimation(event.currentTarget);
|
|
67
51
|
}
|
|
68
|
-
|
|
69
|
-
function destroyListeners(el: HTMLElement) {
|
|
52
|
+
function destroyListeners(el) {
|
|
70
53
|
el.removeEventListener('mousedown', spawn);
|
|
71
54
|
el.removeEventListener('mouseup', clean);
|
|
72
55
|
el.removeEventListener('mouseleave', clean);
|
|
73
56
|
el.removeEventListener('keydown', keyboardSpawn);
|
|
74
57
|
el.removeEventListener('keyup', keyboardClean);
|
|
75
58
|
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
const {
|
|
59
|
+
function attachWave(el, binding) {
|
|
60
|
+
let init = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
61
|
+
const {
|
|
62
|
+
value,
|
|
63
|
+
modifiers
|
|
64
|
+
} = binding;
|
|
79
65
|
const enabled = !!value;
|
|
80
66
|
if (!enabled) hideAnimation(el);
|
|
81
|
-
|
|
82
67
|
if (enabled && init) {
|
|
83
68
|
if (modifiers.stop) {
|
|
84
69
|
el.addEventListener('mousedown', stop);
|
|
85
70
|
return;
|
|
86
71
|
}
|
|
87
|
-
|
|
88
72
|
el.addEventListener('mousedown', spawn);
|
|
89
73
|
el.addEventListener('mouseup', clean);
|
|
90
74
|
el.addEventListener('mouseleave', clean);
|
|
@@ -95,20 +79,19 @@ function attachWave(el: HTMLElement, binding: PlateWaveBinding, init = false) {
|
|
|
95
79
|
destroyListeners(el);
|
|
96
80
|
}
|
|
97
81
|
}
|
|
98
|
-
|
|
99
82
|
export const PlateWave = {
|
|
100
|
-
mounted(el
|
|
83
|
+
mounted(el, binding) {
|
|
101
84
|
attachWave(el, binding, true);
|
|
102
85
|
},
|
|
103
|
-
updated(el
|
|
86
|
+
updated(el, binding) {
|
|
104
87
|
if (binding.value === binding.oldValue) {
|
|
105
88
|
return;
|
|
106
89
|
}
|
|
107
90
|
attachWave(el, binding);
|
|
108
91
|
},
|
|
109
|
-
unmount(el
|
|
92
|
+
unmount(el) {
|
|
110
93
|
destroyListeners(el);
|
|
111
|
-
}
|
|
94
|
+
}
|
|
112
95
|
};
|
|
113
|
-
|
|
114
96
|
export default PlateWave;
|
|
97
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["CLASS_NAME","showAnimation","el","animation","document","createElement","className","appendChild","dataset","activated","String","performance","now","hideAnimation","animations","getElementsByClassName","length","isHiding","diff","Number","delay","Math","max","setTimeout","removeChild","keyboardEventFlag","spawn","event","currentTarget","clean","stop","keyboardSpawn","key","keyboardClean","destroyListeners","removeEventListener","attachWave","binding","init","arguments","undefined","value","modifiers","enabled","addEventListener","PlateWave","mounted","updated","oldValue","unmount"],"sources":["../../../src/directives/plate-wave/index.ts"],"sourcesContent":["import type { DirectiveBinding } from 'vue';\n\nimport './plate-wave.scss';\n\nexport interface PlateWaveBinding\n extends Omit<DirectiveBinding, 'modifiers' | 'value'> {\n value?: boolean;\n modifiers: { stop?: boolean };\n}\n\nconst CLASS_NAME = 'y-plate-wave__animation';\n\nfunction showAnimation(el: HTMLElement | null) {\n if (!el) return;\n const animation = document.createElement('span');\n animation.className = CLASS_NAME;\n el.appendChild(animation);\n animation.dataset.activated = String(performance.now());\n}\n\nfunction hideAnimation(el: HTMLElement | null) {\n if (!el) {\n return;\n }\n const animations = el.getElementsByClassName(CLASS_NAME);\n if (animations.length === 0) return;\n const animation = animations[animations.length - 1] as HTMLElement;\n if (animation.dataset.isHiding) return;\n animation.dataset.isHiding = 'true';\n const diff = performance.now() - Number(animation.dataset.activated);\n const delay = Math.max(250 - diff, 0);\n setTimeout(() => {\n if (animation) {\n el.removeChild(animation);\n }\n }, delay + 300);\n}\n\n/*\n * Event\n * */\n\nlet keyboardEventFlag = false;\n\nfunction spawn(event: Event) {\n showAnimation(event.currentTarget as HTMLElement);\n}\n\nfunction clean(event: Event) {\n hideAnimation(event.currentTarget as HTMLElement);\n}\n\nfunction stop(event: Event) {\n //\n}\n\nfunction keyboardSpawn(event: KeyboardEvent) {\n if (!keyboardEventFlag && (event.key === 'Enter' || event.key === 'Space')) {\n keyboardEventFlag = true;\n showAnimation(event.currentTarget as HTMLElement);\n }\n}\n\nfunction keyboardClean(event: KeyboardEvent) {\n keyboardEventFlag = false;\n hideAnimation(event.currentTarget as HTMLElement);\n}\n\nfunction destroyListeners(el: HTMLElement) {\n el.removeEventListener('mousedown', spawn);\n el.removeEventListener('mouseup', clean);\n el.removeEventListener('mouseleave', clean);\n el.removeEventListener('keydown', keyboardSpawn);\n el.removeEventListener('keyup', keyboardClean);\n}\n\nfunction attachWave(el: HTMLElement, binding: PlateWaveBinding, init = false) {\n const { value, modifiers } = binding;\n const enabled = !!value;\n if (!enabled) hideAnimation(el);\n\n if (enabled && init) {\n if (modifiers.stop) {\n el.addEventListener('mousedown', stop);\n return;\n }\n\n el.addEventListener('mousedown', spawn);\n el.addEventListener('mouseup', clean);\n el.addEventListener('mouseleave', clean);\n el.addEventListener('keydown', keyboardSpawn);\n el.addEventListener('keyup', keyboardClean);\n el.addEventListener('blur', clean);\n } else if (!enabled && !init) {\n destroyListeners(el);\n }\n}\n\nexport const PlateWave = {\n mounted(el: HTMLElement, binding: PlateWaveBinding) {\n attachWave(el, binding, true);\n },\n updated(el: HTMLElement, binding: PlateWaveBinding) {\n if (binding.value === binding.oldValue) {\n return;\n }\n attachWave(el, binding);\n },\n unmount(el: HTMLElement) {\n destroyListeners(el);\n },\n};\n\nexport default PlateWave;\n"],"mappings":"AAEA;AAQA,MAAMA,UAAU,GAAG,yBAAyB;AAE5C,SAASC,aAAaA,CAACC,EAAsB,EAAE;EAC7C,IAAI,CAACA,EAAE,EAAE;EACT,MAAMC,SAAS,GAAGC,QAAQ,CAACC,aAAa,CAAC,MAAM,CAAC;EAChDF,SAAS,CAACG,SAAS,GAAGN,UAAU;EAChCE,EAAE,CAACK,WAAW,CAACJ,SAAS,CAAC;EACzBA,SAAS,CAACK,OAAO,CAACC,SAAS,GAAGC,MAAM,CAACC,WAAW,CAACC,GAAG,CAAC,CAAC,CAAC;AACzD;AAEA,SAASC,aAAaA,CAACX,EAAsB,EAAE;EAC7C,IAAI,CAACA,EAAE,EAAE;IACP;EACF;EACA,MAAMY,UAAU,GAAGZ,EAAE,CAACa,sBAAsB,CAACf,UAAU,CAAC;EACxD,IAAIc,UAAU,CAACE,MAAM,KAAK,CAAC,EAAE;EAC7B,MAAMb,SAAS,GAAGW,UAAU,CAACA,UAAU,CAACE,MAAM,GAAG,CAAC,CAAgB;EAClE,IAAIb,SAAS,CAACK,OAAO,CAACS,QAAQ,EAAE;EAChCd,SAAS,CAACK,OAAO,CAACS,QAAQ,GAAG,MAAM;EACnC,MAAMC,IAAI,GAAGP,WAAW,CAACC,GAAG,CAAC,CAAC,GAAGO,MAAM,CAAChB,SAAS,CAACK,OAAO,CAACC,SAAS,CAAC;EACpE,MAAMW,KAAK,GAAGC,IAAI,CAACC,GAAG,CAAC,GAAG,GAAGJ,IAAI,EAAE,CAAC,CAAC;EACrCK,UAAU,CAAC,MAAM;IACf,IAAIpB,SAAS,EAAE;MACbD,EAAE,CAACsB,WAAW,CAACrB,SAAS,CAAC;IAC3B;EACF,CAAC,EAAEiB,KAAK,GAAG,GAAG,CAAC;AACjB;;AAEA;AACA;AACA;;AAEA,IAAIK,iBAAiB,GAAG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bindingClass(themeClass) {
|
|
4
|
+
el.classList.forEach(classToken => {
|
|
5
|
+
if (classToken.startsWith('theme--') && classToken !== themeClass) {
|
|
6
|
+
el.classList.remove(classToken);
|
|
7
|
+
}
|
|
8
|
+
});
|
|
9
|
+
el.classList.add(themeClass);
|
|
10
|
+
}
|
|
11
|
+
watchEffect(() => {
|
|
12
|
+
const theme = binding.instance?.$yuyeon?.theme ?? vnode?.ctx?.root.appContext.config.globalProperties?.$yuyeon?.theme;
|
|
13
|
+
const themeName = binding.value ?? theme.name ?? '';
|
|
14
|
+
if (!themeName) {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
const themeClass = `theme--${themeName}`;
|
|
18
|
+
bindingClass(themeClass);
|
|
19
|
+
}, {
|
|
20
|
+
flush: 'post'
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
export default bindThemeClass;
|
|
24
|
+
//# sourceMappingURL=theme-class.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme-class.mjs","names":["watchEffect","bindThemeClass","el","binding","vnode","bindingClass","themeClass","classList","forEach","classToken","startsWith","remove","add","theme","instance","$yuyeon","ctx","root","appContext","config","globalProperties","themeName","value","name","flush"],"sources":["../../src/directives/theme-class.ts"],"sourcesContent":["import { FunctionDirective, watchEffect } from \"vue\";\r\n\r\nconst bindThemeClass: FunctionDirective = (el, binding, vnode) => {\r\n function bindingClass(themeClass: string) {\r\n el.classList.forEach((classToken: string) => {\r\n if (classToken.startsWith('theme--') && classToken !== themeClass) {\r\n el.classList.remove(classToken);\r\n }\r\n });\r\n el.classList.add(themeClass);\r\n }\r\n\r\n watchEffect(() => {\r\n const theme = (binding.instance as any)?.$yuyeon?.theme ?? (vnode as any)?.ctx?.root.appContext.config.globalProperties?.$yuyeon?.theme;\r\n const themeName = binding.value ?? theme.name ?? '';\r\n if (!themeName) { return; }\r\n const themeClass = `theme--${themeName}`;\r\n bindingClass(themeClass);\r\n }, { flush: 'post' });\r\n};\r\n\r\nexport default bindThemeClass;\r\n"],"mappings":"AAAA,SAA4BA,WAAW,QAAQ,KAAK;AAEpD,MAAMC,cAAiC,GAAGA,CAACC,EAAE,EAAEC,OAAO,EAAEC,KAAK,KAAK;EAChE,SAASC,YAAYA,CAACC,UAAkB,EAAE;IACxCJ,EAAE,CAACK,SAAS,CAACC,OAAO,CAAEC,UAAkB,IAAK;MAC3C,IAAIA,UAAU,CAACC,UAAU,CAAC,SAAS,CAAC,IAAID,UAAU,KAAKH,UAAU,EAAE;QACjEJ,EAAE,CAACK,SAAS,CAACI,MAAM,CAACF,UAAU,CAAC;MACjC;IACF,CAAC,CAAC;IACFP,EAAE,CAACK,SAAS,CAACK,GAAG,CAACN,UAAU,CAAC;EAC9B;EAEAN,WAAW,CAAC,MAAM;IAChB,MAAMa,KAAK,GAAIV,OAAO,CAACW,QAAQ,EAAUC,OAAO,EAAEF,KAAK,IAAKT,KAAK,EAAUY,GAAG,EAAEC,IAAI,CAACC,UAAU,CAACC,MAAM,CAACC,gBAAgB,EAAEL,OAAO,EAAEF,KAAK;IACvI,MAAMQ,SAAS,GAAGlB,OAAO,CAACmB,KAAK,IAAIT,KAAK,CAACU,IAAI,IAAI,EAAE;IACnD,IAAI,CAACF,SAAS,EAAE;MAAE;IAAQ;IAC1B,MAAMf,UAAU,GAAI,UAASe,SAAU,EAAC;IACxChB,YAAY,CAACC,UAAU,CAAC;EAC1B,CAAC,EAAE;IAAEkB,KAAK,EAAE;EAAO,CAAC,CAAC;AACvB,CAAC;AAED,eAAevB,cAAc"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["YUYEON_LOGO"],"sources":["../../src/etc/index.ts"],"sourcesContent":["export const YUYEON_LOGO =`,--. ,--.,--.,--.,--. ,--.,---. ,---. ,--,--, \r\n \\\\ ' / | || | \\\\ ' /| .-. :| .-. || \\\\ \r\n \\\\ ' ' '' ' \\\\ ' \\\\ --.' '-' '| || | \r\n.-' / \\`----' .-' / \\`----' \\`---' \\`--''--' \r\n\\`---' \\`---' `;\r\n"],"mappings":"AAAA,OAAO,MAAMA,WAAW,GAAG;AAC3B;AACA;AACA;AACA,mDAAmD"}
|
package/lib/index.mjs
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { nextTick, reactive } from "vue";
|
|
2
|
+
import * as components from "./components/index.mjs";
|
|
3
|
+
import { createThemeModule } from "./composables/theme/index.mjs";
|
|
4
|
+
import PlateWave from "./directives/plate-wave/index.mjs";
|
|
5
|
+
import { YUYEON_LOGO } from "./etc/index.mjs"; //
|
|
6
|
+
import "./styles/base.scss";
|
|
7
|
+
const defaultOptions = {
|
|
8
|
+
credit: true
|
|
9
|
+
};
|
|
10
|
+
export function init() {
|
|
11
|
+
let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultOptions;
|
|
12
|
+
const themeModule = createThemeModule(options?.theme);
|
|
13
|
+
const install = app => {
|
|
14
|
+
themeModule.install(app);
|
|
15
|
+
const yuyeon = reactive({
|
|
16
|
+
app: null,
|
|
17
|
+
root: null,
|
|
18
|
+
theme: themeModule.instance
|
|
19
|
+
});
|
|
20
|
+
Object.keys(components).forEach(componentName => {
|
|
21
|
+
const comp = components[componentName];
|
|
22
|
+
app.component(componentName, comp);
|
|
23
|
+
});
|
|
24
|
+
app.directive('plate-wave', PlateWave);
|
|
25
|
+
app.provide('theme', yuyeon.theme);
|
|
26
|
+
app.config.globalProperties.$yuyeon = yuyeon;
|
|
27
|
+
nextTick(() => {
|
|
28
|
+
yuyeon.app = app._instance;
|
|
29
|
+
yuyeon.root = app._container;
|
|
30
|
+
if (!yuyeon.root) {
|
|
31
|
+
throw new Error(`yuyeon: Can't found instance`);
|
|
32
|
+
}
|
|
33
|
+
const $el = yuyeon.root;
|
|
34
|
+
$el.classList.add('y-root');
|
|
35
|
+
$el.setAttribute('data-y-root', '');
|
|
36
|
+
themeModule.init(yuyeon);
|
|
37
|
+
});
|
|
38
|
+
if (options?.credit) {
|
|
39
|
+
console.log(YUYEON_LOGO);
|
|
40
|
+
}
|
|
41
|
+
const {
|
|
42
|
+
unmount
|
|
43
|
+
} = app;
|
|
44
|
+
app.unmount = () => {
|
|
45
|
+
unmount();
|
|
46
|
+
themeModule.scope.stop();
|
|
47
|
+
app.unmount = unmount;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
return {
|
|
51
|
+
install
|
|
52
|
+
// theme: themeModule,
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["nextTick","reactive","components","createThemeModule","PlateWave","YUYEON_LOGO","defaultOptions","credit","init","options","arguments","length","undefined","themeModule","theme","install","app","yuyeon","root","instance","Object","keys","forEach","componentName","comp","component","directive","provide","config","globalProperties","$yuyeon","_instance","_container","Error","$el","classList","add","setAttribute","console","log","unmount","scope","stop"],"sources":["../src/index.ts"],"sourcesContent":["import { Component, ComponentInternalInstance } from \"@vue/runtime-core\";\r\nimport type { App } from 'vue';\r\nimport { nextTick, reactive } from \"vue\";\r\n\r\nimport * as components from './components';\r\nimport { createThemeModule } from './composables/theme';\r\nimport PlateWave from './directives/plate-wave';\r\nimport { YUYEON_LOGO } from './etc';\r\n//\r\nimport './styles/base.scss';\r\n\r\n\r\nconst defaultOptions = {\r\n credit: true,\r\n};\r\n\r\ndeclare module 'vue' {\r\n interface ComponentCustomProperties {\r\n $yuyeon: any;\r\n }\r\n}\r\n\r\nexport function init(options: any = defaultOptions) {\r\n const themeModule = createThemeModule(options?.theme);\r\n\r\n const install = (app: App): any => {\r\n themeModule.install(app);\r\n\r\n const yuyeon = reactive({\r\n app: null as ComponentInternalInstance | null,\r\n root: null as HTMLElement | null,\r\n theme: themeModule.instance,\r\n });\r\n\r\n Object.keys(components).forEach((componentName) => {\r\n const comp = components[componentName as keyof typeof components];\r\n app.component(componentName, comp as Component);\r\n });\r\n\r\n app.directive('plate-wave', PlateWave);\r\n\r\n app.provide('theme', yuyeon.theme);\r\n\r\n app.config.globalProperties.$yuyeon = yuyeon;\r\n\r\n nextTick(() => {\r\n yuyeon.app = app._instance as any;\r\n yuyeon.root = app._container;\r\n if (!yuyeon.root) {\r\n throw new Error(`yuyeon: Can't found instance`);\r\n }\r\n const $el = yuyeon.root;\r\n $el.classList.add('y-root');\r\n $el.setAttribute('data-y-root', '');\r\n themeModule.init(yuyeon);\r\n });\r\n if (options?.credit) {\r\n console.log(YUYEON_LOGO);\r\n }\r\n const { unmount } = app;\r\n app.unmount = () => {\r\n unmount();\r\n themeModule.scope.stop();\r\n app.unmount = unmount;\r\n }\r\n };\r\n\r\n return {\r\n install,\r\n // theme: themeModule,\r\n };\r\n}\r\n"],"mappings":"AAEA,SAASA,QAAQ,EAAEC,QAAQ,QAAQ,KAAK;AAAC,OAElC,KAAKC,UAAU;AAAA,SACbC,iBAAiB;AAAA,OACnBC,SAAS;AAAA,SACPC,WAAW,2BACpB;AACA;AAGA,MAAMC,cAAc,GAAG;EACrBC,MAAM,EAAE;AACV,CAAC;AAQD,OAAO,SAASC,IAAIA,CAAA,EAAgC;EAAA,IAA/BC,OAAY,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAGJ,cAAc;EAChD,MAAMO,WAAW,GAAGV,iBAAiB,CAACM,OAAO,EAAEK,KAAK,CAAC;EAErD,MAAMC,OAAO,GAAIC,GAAQ,IAAU;IACjCH,WAAW,CAACE,OAAO,CAACC,GAAG,CAAC;IAExB,MAAMC,MAAM,GAAGhB,QAAQ,CAAC;MACtBe,GAAG,EAAE,IAAwC;MAC7CE,IAAI,EAAE,IAA0B;MAChCJ,KAAK,EAAED,WAAW,CAACM;IACrB,CAAC,CAAC;IAEFC,MAAM,CAACC,IAAI,CAACnB,UAAU,CAAC,CAACoB,OAAO,CAAEC,aAAa,IAAK;MACjD,MAAMC,IAAI,GAAGtB,UAAU,CAAC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|
-
|
|
7
5
|
export default defineComponent({
|
|
8
6
|
name: 'DiMixin',
|
|
9
7
|
inject: {
|
|
10
8
|
theme: {
|
|
11
|
-
from: 'theme'
|
|
9
|
+
from: 'theme'
|
|
12
10
|
},
|
|
13
11
|
form$: {
|
|
14
|
-
default: null
|
|
15
|
-
}
|
|
12
|
+
default: null
|
|
13
|
+
}
|
|
16
14
|
},
|
|
17
15
|
mounted() {
|
|
18
|
-
|
|
16
|
+
this.form$?.register(this);
|
|
19
17
|
},
|
|
20
18
|
beforeUnmount() {
|
|
21
|
-
|
|
22
|
-
}
|
|
19
|
+
this.form$?.unregister(this);
|
|
20
|
+
}
|
|
23
21
|
});
|
|
22
|
+
//# sourceMappingURL=di.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"di.mjs","names":["defineComponent","name","inject","theme","from","form$","default","mounted","register","beforeUnmount","unregister"],"sources":["../../src/mixins/di.ts"],"sourcesContent":["/*\n * Created by yuyeon-ui 2022.\n */\nimport { defineComponent } from 'vue';\n\nexport default defineComponent({\n name: 'DiMixin',\n inject: {\n theme: {\n from: 'theme',\n },\n form$: {\n default: null,\n },\n },\n mounted() {\n ((this as any).form$ as any)?.register(this);\n },\n beforeUnmount() {\n ((this as any).form$ as any)?.unregister(this);\n },\n});\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,eAAe,QAAQ,KAAK;AAErC,eAAeA,eAAe,CAAC;EAC7BC,IAAI,EAAE,SAAS;EACfC,MAAM,EAAE;IACNC,KAAK,EAAE;MACLC,IAAI,EAAE;IACR,CAAC;IACDC,KAAK,EAAE;MACLC,OAAO,EAAE;IACX;EACF,CAAC;EACDC,OAAOA,CAAA,EAAG;IACN,IAAI,CAASF,KAAK,EAAUG,QAAQ,CAAC,IAAI,CAAC;EAC9C,CAAC;EACDC,aAAaA,CAAA,EAAG;IACZ,IAAI,CAASJ,KAAK,EAAUK,UAAU,CAAC,IAAI,CAAC;EAChD;AACF,CAAC,CAAC"}
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* Created by yuyeon-ui 2022.
|
|
3
3
|
*/
|
|
4
|
-
|
|
5
4
|
import { defineComponent } from 'vue';
|
|
6
|
-
|
|
7
5
|
export default defineComponent({
|
|
8
6
|
data: () => ({
|
|
9
|
-
attrs_$: {}
|
|
10
|
-
listeners_$: {}
|
|
7
|
+
attrs_$: {},
|
|
8
|
+
listeners_$: {}
|
|
11
9
|
}),
|
|
12
10
|
watch: {
|
|
13
11
|
// Work around unwanted re-renders: https://github.com/vuejs/vue/issues/10115
|
|
@@ -20,7 +18,8 @@ export default defineComponent({
|
|
|
20
18
|
// this.$set(this.$data.$_attrs, attr, val[attr]);
|
|
21
19
|
}
|
|
22
20
|
},
|
|
23
|
-
|
|
21
|
+
|
|
22
|
+
immediate: true
|
|
24
23
|
},
|
|
25
24
|
$listeners: {
|
|
26
25
|
handler(val) {
|
|
@@ -30,7 +29,9 @@ export default defineComponent({
|
|
|
30
29
|
// this.$set(this.$data.$_listeners, listener, val[listener]);
|
|
31
30
|
}
|
|
32
31
|
},
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
|
|
33
|
+
immediate: true
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
36
|
});
|
|
37
|
+
//# sourceMappingURL=rebind-attrs.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rebind-attrs.mjs","names":["defineComponent","data","attrs_$","listeners_$","watch","$attrs","handler","val","attr","$data","immediate","$listeners","listener"],"sources":["../../src/mixins/rebind-attrs.ts"],"sourcesContent":["/*\n * Created by yuyeon-ui 2022.\n */\nimport { defineComponent } from 'vue';\n\nexport default defineComponent({\n data: () => ({\n attrs_$: {} as any,\n listeners_$: {} as any,\n }),\n watch: {\n // Work around unwanted re-renders: https://github.com/vuejs/vue/issues/10115\n // Make sure to use `v-bind=\"$data.$_attrs\"` instead of `v-bind=\"$attrs\"`\n $attrs: {\n handler(val) {\n // eslint-disable-next-line guard-for-in,no-restricted-syntax\n for (const attr in val) {\n this.$data.attrs_$[attr] = val[attr];\n // this.$set(this.$data.$_attrs, attr, val[attr]);\n }\n },\n immediate: true,\n },\n $listeners: {\n handler(val) {\n // eslint-disable-next-line guard-for-in,no-restricted-syntax\n for (const listener in val) {\n this.$data.listeners_$[listener] = val[listener];\n // this.$set(this.$data.$_listeners, listener, val[listener]);\n }\n },\n immediate: true,\n },\n },\n});\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,eAAe,QAAQ,KAAK;AAErC,eAAeA,eAAe,CAAC;EAC7BC,IAAI,EAAEA,CAAA,MAAO;IACXC,OAAO,EAAE,CAAC,CAAQ;IAClBC,WAAW,EAAE,CAAC;EAChB,CAAC,CAAC;EACFC,KAAK,EAAE;IACL;IACA;IACAC,MAAM,EAAE;MACNC,OAAOA,CAACC,GAAG,EAAE;QACX;QACA,KAAK,MAAMC,IAAI,IAAID,GAAG,EAAE;UACtB,IAAI,CAACE,KAAK,CAACP,OAAO,CAACM,IAAI,CAAC,GAAGD,GAAG,CAACC,IAAI,CAAC;UACpC;QACF;MACF,CAAC;;MACDE,SAAS,EAAE;IACb,CAAC;IACDC,UAAU,EAAE;MACVL,OAAOA,CAACC,GAAG,EAAE;QACX;QACA,KAAK,MAAMK,QAAQ,IAAIL,GAAG,EAAE;UAC1B,IAAI,CAACE,KAAK,CAACN,WAAW,CAACS,QAAQ,CAAC,GAAGL,GAAG,CAACK,QAAQ,CAAC;UAChD;QACF;MACF,CAAC;;MACDF,SAAS,EAAE;IACb;EACF;AACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
@use 'sass:list';
|
|
2
|
+
@use 'settings/provided';
|
|
3
|
+
@use 'settings/variables';
|
|
4
|
+
@use 'palette';
|
|
5
|
+
|
|
6
|
+
:root {
|
|
7
|
+
box-sizing: border-box;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
:root {
|
|
11
|
+
--y-palette--primary: #{palette.$primary};
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.fade-enter-active,
|
|
15
|
+
.fade-leave-cative {
|
|
16
|
+
transition: opacity 240ms cubic-bezier(0.2, 0.28, 0.21, 1);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.fade-enter-from,
|
|
20
|
+
.fade-leave-to {
|
|
21
|
+
opacity: 0;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.slide-fade-enter-active,
|
|
25
|
+
.slide-fade-leave-active {
|
|
26
|
+
transition: transform 240ms variables.$basic-transition-timing-function,
|
|
27
|
+
opacity 240ms linear;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.slide-fade-enter-from,
|
|
31
|
+
.slide-fade-leave-to {
|
|
32
|
+
transform: translateY(-20px) rotate3d(1, 0, 0, 10deg);
|
|
33
|
+
opacity: 0;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.expand-v-transition {
|
|
37
|
+
&-enter-active {
|
|
38
|
+
transition-duration: 240ms;
|
|
39
|
+
transition-timing-function: variables.$basic-transition-timing-function;
|
|
40
|
+
transition-property: height;
|
|
41
|
+
}
|
|
42
|
+
&-leave-active {
|
|
43
|
+
transition-duration: 240ms;
|
|
44
|
+
transition-timing-function: variables.$basic-transition-timing-function;
|
|
45
|
+
transition-property: height;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.expand-h-transition {
|
|
50
|
+
&-enter-active {
|
|
51
|
+
transition-duration: 240ms;
|
|
52
|
+
transition-timing-function: variables.$basic-transition-timing-function;
|
|
53
|
+
transition-property: width;
|
|
54
|
+
}
|
|
55
|
+
&-leave-active {
|
|
56
|
+
transition-duration: 240ms;
|
|
57
|
+
transition-timing-function: variables.$basic-transition-timing-function;
|
|
58
|
+
transition-property: width;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.title {
|
|
63
|
+
font-size: 20px;
|
|
64
|
+
font-weight: bold;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
@each $space-type-prefix, $space-type in provided.$space-types {
|
|
68
|
+
@each $side-prefix, $sides-properties in provided.$box-side-combinations {
|
|
69
|
+
@each $space-index, $space-size in variables.$space-list {
|
|
70
|
+
.#{$space-type-prefix}#{$side-prefix}-#{$space-index} {
|
|
71
|
+
@if (list.length($sides-properties) == 0) {
|
|
72
|
+
#{$space-type}: #{$space-size};
|
|
73
|
+
} @else {
|
|
74
|
+
@each $prop in $sides-properties {
|
|
75
|
+
#{$space-type}: {
|
|
76
|
+
#{$prop}: #{$space-size};
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
@each $align in provided.$text-aligns {
|
|
86
|
+
.text-#{$align} {
|
|
87
|
+
text-align: #{$align};
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
@keyframes rotate {
|
|
92
|
+
to {
|
|
93
|
+
transform: rotate(360deg);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
@use "sass:meta";
|
|
2
|
+
@use "sass:map";
|
|
3
|
+
|
|
4
|
+
$space-unit: 4px !default;
|
|
5
|
+
$space-max-times: 20 !default;
|
|
6
|
+
|
|
7
|
+
$space-list: () !default;
|
|
8
|
+
@if (meta.type-of($space-list) == list) {
|
|
9
|
+
@for $index from 0 through $space-max-times {
|
|
10
|
+
$space-list: map.merge($space-list, ($index: $space-unit * $index));
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
$basic-transition-timing-function: cubic-bezier(0.23, 0.3, 0.07, 0.97);
|