zartui 0.1.112 → 3.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -2
- package/es/badge/Badge.d.ts +66 -0
- package/es/badge/Badge.mjs +95 -0
- package/es/badge/index.css +1 -0
- package/es/badge/index.d.ts +49 -0
- package/es/badge/index.mjs +8 -0
- package/es/badge/style/index.d.ts +1 -0
- package/es/badge/style/index.mjs +2 -0
- package/es/button/Button.d.ts +154 -0
- package/es/button/Button.mjs +166 -0
- package/es/button/index.css +1 -0
- package/es/button/index.d.ts +113 -0
- package/es/button/index.mjs +8 -0
- package/es/button/style/index.d.ts +1 -0
- package/es/button/style/index.mjs +5 -0
- package/es/button/types.d.ts +5 -0
- package/es/button/types.mjs +0 -0
- package/es/cell/Cell.d.ts +128 -0
- package/es/cell/Cell.mjs +132 -0
- package/es/cell/index.css +1 -0
- package/es/cell/index.d.ts +74 -0
- package/es/cell/index.mjs +8 -0
- package/es/cell/style/index.d.ts +1 -0
- package/es/cell/style/index.mjs +4 -0
- package/es/col/Col.d.ts +38 -0
- package/es/col/Col.mjs +63 -0
- package/es/col/index.css +1 -0
- package/es/col/index.d.ts +31 -0
- package/es/col/index.mjs +8 -0
- package/es/col/style/index.d.ts +1 -0
- package/es/col/style/index.mjs +3 -0
- package/es/composables/on-popup-reopen.d.ts +3 -0
- package/es/composables/on-popup-reopen.mjs +16 -0
- package/es/composables/use-expose.d.ts +1 -0
- package/es/composables/use-expose.mjs +11 -0
- package/es/composables/use-height.d.ts +2 -0
- package/es/composables/use-height.mjs +20 -0
- package/es/composables/use-id.d.ts +1 -0
- package/es/composables/use-id.mjs +13 -0
- package/es/composables/use-lazy-render.d.ts +2 -0
- package/es/composables/use-lazy-render.mjs +17 -0
- package/es/composables/use-lock-scroll.d.ts +2 -0
- package/es/composables/use-lock-scroll.mjs +56 -0
- package/es/composables/use-placeholder.d.ts +3 -0
- package/es/composables/use-placeholder.mjs +14 -0
- package/es/composables/use-refs.d.ts +2 -0
- package/es/composables/use-refs.mjs +20 -0
- package/es/composables/use-route.d.ts +13 -0
- package/es/composables/use-route.mjs +29 -0
- package/es/composables/use-tab-status.d.ts +3 -0
- package/es/composables/use-tab-status.mjs +7 -0
- package/es/composables/use-touch.d.ts +16 -0
- package/es/composables/use-touch.mjs +61 -0
- package/es/composables/use-visibility-change.d.ts +2 -0
- package/es/composables/use-visibility-change.mjs +30 -0
- package/es/config-provider/ConfigProvider.d.ts +47 -0
- package/es/config-provider/ConfigProvider.mjs +64 -0
- package/es/config-provider/index.d.ts +33 -0
- package/es/config-provider/index.mjs +8 -0
- package/es/config-provider/style/index.d.ts +1 -0
- package/es/config-provider/style/index.mjs +1 -0
- package/es/divider/Divider.d.ts +40 -0
- package/es/divider/Divider.mjs +31 -0
- package/es/divider/index.css +1 -0
- package/es/divider/index.d.ts +32 -0
- package/es/divider/index.mjs +8 -0
- package/es/divider/style/index.d.ts +1 -0
- package/es/divider/style/index.mjs +2 -0
- package/es/empty/Empty.d.ts +29 -0
- package/es/empty/Empty.mjs +58 -0
- package/es/empty/Images.d.ts +4 -0
- package/es/empty/Images.mjs +2104 -0
- package/es/empty/index.css +1 -0
- package/es/empty/index.d.ts +24 -0
- package/es/empty/index.mjs +8 -0
- package/es/empty/style/index.d.ts +1 -0
- package/es/empty/style/index.mjs +2 -0
- package/es/icon/Icon.d.ts +45 -0
- package/es/icon/Icon.mjs +59 -0
- package/es/icon/config.d.ts +41 -0
- package/es/icon/config.mjs +139 -0
- package/es/icon/index.css +1 -0
- package/es/icon/index.d.ts +35 -0
- package/es/icon/index.mjs +8 -0
- package/es/icon/style/index.d.ts +1 -0
- package/es/icon/style/index.mjs +3 -0
- package/es/index.d.ts +35 -0
- package/es/index.mjs +105 -0
- package/es/list/List.d.ts +74 -0
- package/es/list/List.mjs +147 -0
- package/es/list/index.css +1 -0
- package/es/list/index.d.ts +59 -0
- package/es/list/index.mjs +8 -0
- package/es/list/style/index.d.ts +1 -0
- package/es/list/style/index.mjs +4 -0
- package/es/list/types.d.ts +7 -0
- package/es/list/types.mjs +0 -0
- package/es/loading/Loading.d.ts +39 -0
- package/es/loading/Loading.mjs +114 -0
- package/es/loading/index.css +1 -0
- package/es/loading/index.d.ts +31 -0
- package/es/loading/index.mjs +8 -0
- package/es/loading/style/index.d.ts +1 -0
- package/es/loading/style/index.mjs +2 -0
- package/es/locale/index.d.ts +7 -0
- package/es/locale/index.mjs +24 -0
- package/es/locale/lang/en-US.d.ts +62 -0
- package/es/locale/lang/en-US.mjs +64 -0
- package/es/locale/lang/zh-CN.d.ts +62 -0
- package/es/locale/lang/zh-CN.mjs +64 -0
- package/es/locale/style/index.d.ts +1 -0
- package/es/locale/style/index.mjs +1 -0
- package/es/notice-bar/NoticeBar.d.ts +71 -0
- package/es/notice-bar/NoticeBar.mjs +165 -0
- package/es/notice-bar/index.css +1 -0
- package/es/notice-bar/index.d.ts +56 -0
- package/es/notice-bar/index.mjs +8 -0
- package/es/notice-bar/style/index.d.ts +1 -0
- package/es/notice-bar/style/index.mjs +4 -0
- package/es/notice-bar/types.d.ts +7 -0
- package/es/notice-bar/types.mjs +0 -0
- package/es/notify/Notify.d.ts +134 -0
- package/es/notify/Notify.mjs +44 -0
- package/es/notify/function-call.d.ts +6 -0
- package/es/notify/function-call.mjs +68 -0
- package/es/notify/index.css +1 -0
- package/es/notify/index.d.ts +99 -0
- package/es/notify/index.mjs +18 -0
- package/es/notify/style/index.d.ts +1 -0
- package/es/notify/style/index.mjs +6 -0
- package/es/notify/types.d.ts +17 -0
- package/es/notify/types.mjs +0 -0
- package/es/number-keyboard/NumberKeyboard.d.ts +162 -0
- package/es/number-keyboard/NumberKeyboard.mjs +243 -0
- package/es/number-keyboard/NumberKeyboardKey.d.ts +24 -0
- package/es/number-keyboard/NumberKeyboardKey.mjs +89 -0
- package/es/number-keyboard/index.css +1 -0
- package/es/number-keyboard/index.d.ts +119 -0
- package/es/number-keyboard/index.mjs +8 -0
- package/es/number-keyboard/style/index.d.ts +1 -0
- package/es/number-keyboard/style/index.mjs +9 -0
- package/es/overlay/Overlay.d.ts +51 -0
- package/es/overlay/Overlay.mjs +47 -0
- package/es/overlay/index.css +1 -0
- package/es/overlay/index.d.ts +40 -0
- package/es/overlay/index.mjs +8 -0
- package/es/overlay/style/index.d.ts +1 -0
- package/es/overlay/style/index.mjs +2 -0
- package/es/password-input/PasswordInput.d.ts +63 -0
- package/es/password-input/PasswordInput.mjs +78 -0
- package/es/password-input/index.css +1 -0
- package/es/password-input/index.d.ts +49 -0
- package/es/password-input/index.mjs +8 -0
- package/es/password-input/style/index.d.ts +1 -0
- package/es/password-input/style/index.mjs +2 -0
- package/es/popup/Popup.d.ts +165 -0
- package/es/popup/Popup.mjs +205 -0
- package/es/popup/index.css +1 -0
- package/es/popup/index.d.ts +123 -0
- package/es/popup/index.mjs +8 -0
- package/es/popup/shared.d.ts +30 -0
- package/es/popup/shared.mjs +22 -0
- package/es/popup/style/index.d.ts +1 -0
- package/es/popup/style/index.mjs +5 -0
- package/es/popup/types.d.ts +8 -0
- package/es/popup/types.mjs +0 -0
- package/es/pull-refresh/PullRefresh.d.ts +75 -0
- package/es/pull-refresh/PullRefresh.mjs +191 -0
- package/es/pull-refresh/index.css +1 -0
- package/es/pull-refresh/index.d.ts +58 -0
- package/es/pull-refresh/index.mjs +8 -0
- package/es/pull-refresh/style/index.d.ts +1 -0
- package/es/pull-refresh/style/index.mjs +3 -0
- package/es/rate/Rate.d.ts +107 -0
- package/es/rate/Rate.mjs +217 -0
- package/es/rate/index.css +1 -0
- package/es/rate/index.d.ts +80 -0
- package/es/rate/index.mjs +8 -0
- package/es/rate/style/index.d.ts +1 -0
- package/es/rate/style/index.mjs +4 -0
- package/es/row/Row.d.ts +64 -0
- package/es/row/Row.mjs +91 -0
- package/es/row/index.css +1 -0
- package/es/row/index.d.ts +42 -0
- package/es/row/index.mjs +8 -0
- package/es/row/style/index.d.ts +1 -0
- package/es/row/style/index.mjs +2 -0
- package/es/stepper/Stepper.d.ts +181 -0
- package/es/stepper/Stepper.mjs +258 -0
- package/es/stepper/index.css +1 -0
- package/es/stepper/index.d.ts +132 -0
- package/es/stepper/index.mjs +8 -0
- package/es/stepper/style/index.d.ts +1 -0
- package/es/stepper/style/index.mjs +4 -0
- package/es/sticky/Sticky.d.ts +58 -0
- package/es/sticky/Sticky.mjs +119 -0
- package/es/sticky/index.css +1 -0
- package/es/sticky/index.d.ts +45 -0
- package/es/sticky/index.mjs +8 -0
- package/es/sticky/style/index.d.ts +1 -0
- package/es/sticky/style/index.mjs +2 -0
- package/es/style/animation.css +1 -0
- package/es/style/base.css +1 -0
- package/es/style/css-variables.css +1 -0
- package/es/style/mixins/clearfix.css +0 -0
- package/es/style/mixins/ellipsis.css +0 -0
- package/es/style/mixins/hairline.css +0 -0
- package/es/style/normalize.css +1 -0
- package/es/swipe/Swipe.d.ts +121 -0
- package/es/swipe/Swipe.mjs +353 -0
- package/es/swipe/index.css +1 -0
- package/es/swipe/index.d.ts +90 -0
- package/es/swipe/index.mjs +8 -0
- package/es/swipe/style/index.d.ts +1 -0
- package/es/swipe/style/index.mjs +2 -0
- package/es/swipe/types.d.ts +31 -0
- package/es/swipe/types.mjs +0 -0
- package/es/swipe-item/SwipeItem.d.ts +2 -0
- package/es/swipe-item/SwipeItem.mjs +82 -0
- package/es/swipe-item/index.css +1 -0
- package/es/swipe-item/index.d.ts +7 -0
- package/es/swipe-item/index.mjs +8 -0
- package/es/swipe-item/style/index.d.ts +1 -0
- package/es/swipe-item/style/index.mjs +3 -0
- package/es/switch/Switch.d.ts +58 -0
- package/es/switch/Switch.mjs +85 -0
- package/es/switch/index.css +1 -0
- package/es/switch/index.d.ts +46 -0
- package/es/switch/index.mjs +8 -0
- package/es/switch/style/index.d.ts +1 -0
- package/es/switch/style/index.mjs +3 -0
- package/es/tab/Tab.d.ts +58 -0
- package/es/tab/Tab.mjs +113 -0
- package/es/tab/index.css +1 -0
- package/es/tab/index.d.ts +45 -0
- package/es/tab/index.mjs +8 -0
- package/es/tab/style/index.d.ts +1 -0
- package/es/tab/style/index.mjs +7 -0
- package/es/tabs/Tabs.d.ts +154 -0
- package/es/tabs/Tabs.mjs +352 -0
- package/es/tabs/TabsContent.d.ts +43 -0
- package/es/tabs/TabsContent.mjs +64 -0
- package/es/tabs/TabsTitle.d.ts +45 -0
- package/es/tabs/TabsTitle.mjs +90 -0
- package/es/tabs/index.css +1 -0
- package/es/tabs/index.d.ts +114 -0
- package/es/tabs/index.mjs +8 -0
- package/es/tabs/style/index.d.ts +1 -0
- package/es/tabs/style/index.mjs +5 -0
- package/es/tabs/types.d.ts +23 -0
- package/es/tabs/types.mjs +0 -0
- package/es/tabs/utils.d.ts +3 -0
- package/es/tabs/utils.mjs +37 -0
- package/es/toast/Toast.d.ts +112 -0
- package/es/toast/Toast.mjs +119 -0
- package/es/toast/function-call.d.ts +10 -0
- package/es/toast/function-call.mjs +142 -0
- package/es/toast/index.css +1 -0
- package/es/toast/index.d.ts +79 -0
- package/es/toast/index.mjs +26 -0
- package/es/toast/lock-click.d.ts +1 -0
- package/es/toast/lock-click.mjs +17 -0
- package/es/toast/style/index.d.ts +1 -0
- package/es/toast/style/index.mjs +7 -0
- package/es/toast/types.d.ts +36 -0
- package/es/toast/types.mjs +0 -0
- package/es/utils/basic.d.ts +18 -0
- package/es/utils/basic.mjs +32 -0
- package/es/utils/constant.d.ts +8 -0
- package/es/utils/constant.mjs +18 -0
- package/es/utils/create.d.ts +17 -0
- package/es/utils/create.mjs +50 -0
- package/es/utils/deep-assign.d.ts +3 -0
- package/es/utils/deep-assign.mjs +22 -0
- package/es/utils/deep-clone.d.ts +1 -0
- package/es/utils/deep-clone.mjs +20 -0
- package/es/utils/dom.d.ts +12 -0
- package/es/utils/dom.mjs +67 -0
- package/es/utils/format.d.ts +13 -0
- package/es/utils/format.mjs +120 -0
- package/es/utils/index.d.ts +9 -0
- package/es/utils/index.mjs +9 -0
- package/es/utils/interceptor.d.ts +6 -0
- package/es/utils/interceptor.mjs +29 -0
- package/es/utils/mount-component.d.ts +14 -0
- package/es/utils/mount-component.mjs +39 -0
- package/es/utils/props.d.ts +31 -0
- package/es/utils/props.mjs +36 -0
- package/es/utils/validate.d.ts +9 -0
- package/es/utils/validate.mjs +22 -0
- package/es/utils/with-install.d.ts +13 -0
- package/es/utils/with-install.mjs +12 -0
- package/es/vue-sfc-shim.d.ts +6 -0
- package/es/vue-tsx-shim.d.ts +16 -0
- package/lib/badge/Badge.d.ts +66 -0
- package/lib/badge/Badge.js +114 -0
- package/lib/badge/index.css +1 -0
- package/lib/badge/index.d.ts +49 -0
- package/lib/badge/index.js +33 -0
- package/lib/badge/style/index.d.ts +1 -0
- package/lib/badge/style/index.js +2 -0
- package/lib/button/Button.d.ts +154 -0
- package/lib/button/Button.js +185 -0
- package/lib/button/index.css +1 -0
- package/lib/button/index.d.ts +113 -0
- package/lib/button/index.js +33 -0
- package/lib/button/style/index.d.ts +1 -0
- package/lib/button/style/index.js +5 -0
- package/lib/button/types.d.ts +5 -0
- package/lib/button/types.js +15 -0
- package/lib/cell/Cell.d.ts +128 -0
- package/lib/cell/Cell.js +151 -0
- package/lib/cell/index.css +1 -0
- package/lib/cell/index.d.ts +74 -0
- package/lib/cell/index.js +33 -0
- package/lib/cell/style/index.d.ts +1 -0
- package/lib/cell/style/index.js +4 -0
- package/lib/col/Col.d.ts +38 -0
- package/lib/col/Col.js +82 -0
- package/lib/col/index.css +1 -0
- package/lib/col/index.d.ts +31 -0
- package/lib/col/index.js +33 -0
- package/lib/col/style/index.d.ts +1 -0
- package/lib/col/style/index.js +3 -0
- package/lib/composables/on-popup-reopen.d.ts +3 -0
- package/lib/composables/on-popup-reopen.js +35 -0
- package/lib/composables/use-expose.d.ts +1 -0
- package/lib/composables/use-expose.js +30 -0
- package/lib/composables/use-height.d.ts +2 -0
- package/lib/composables/use-height.js +39 -0
- package/lib/composables/use-id.d.ts +1 -0
- package/lib/composables/use-id.js +32 -0
- package/lib/composables/use-lazy-render.d.ts +2 -0
- package/lib/composables/use-lazy-render.js +36 -0
- package/lib/composables/use-lock-scroll.d.ts +2 -0
- package/lib/composables/use-lock-scroll.js +75 -0
- package/lib/composables/use-placeholder.d.ts +3 -0
- package/lib/composables/use-placeholder.js +33 -0
- package/lib/composables/use-refs.d.ts +2 -0
- package/lib/composables/use-refs.js +39 -0
- package/lib/composables/use-route.d.ts +13 -0
- package/lib/composables/use-route.js +46 -0
- package/lib/composables/use-tab-status.d.ts +3 -0
- package/lib/composables/use-tab-status.js +26 -0
- package/lib/composables/use-touch.d.ts +16 -0
- package/lib/composables/use-touch.js +80 -0
- package/lib/composables/use-visibility-change.d.ts +2 -0
- package/lib/composables/use-visibility-change.js +49 -0
- package/lib/config-provider/ConfigProvider.d.ts +47 -0
- package/lib/config-provider/ConfigProvider.js +83 -0
- package/lib/config-provider/index.d.ts +33 -0
- package/lib/config-provider/index.js +33 -0
- package/lib/config-provider/style/index.d.ts +1 -0
- package/lib/config-provider/style/index.js +1 -0
- package/lib/divider/Divider.d.ts +40 -0
- package/lib/divider/Divider.js +50 -0
- package/lib/divider/index.css +1 -0
- package/lib/divider/index.d.ts +32 -0
- package/lib/divider/index.js +33 -0
- package/lib/divider/style/index.d.ts +1 -0
- package/lib/divider/style/index.js +2 -0
- package/lib/empty/Empty.d.ts +29 -0
- package/lib/empty/Empty.js +77 -0
- package/lib/empty/Images.d.ts +4 -0
- package/lib/empty/Images.js +2123 -0
- package/lib/empty/index.css +1 -0
- package/lib/empty/index.d.ts +24 -0
- package/lib/empty/index.js +33 -0
- package/lib/empty/style/index.d.ts +1 -0
- package/lib/empty/style/index.js +2 -0
- package/lib/icon/Icon.d.ts +45 -0
- package/lib/icon/Icon.js +78 -0
- package/lib/icon/config.d.ts +41 -0
- package/lib/icon/config.js +158 -0
- package/lib/icon/index.css +1 -0
- package/lib/icon/index.d.ts +35 -0
- package/lib/icon/index.js +33 -0
- package/lib/icon/style/index.d.ts +1 -0
- package/lib/icon/style/index.js +3 -0
- package/lib/index.css +1 -0
- package/lib/index.d.ts +35 -0
- package/lib/index.js +125 -0
- package/lib/list/List.d.ts +74 -0
- package/lib/list/List.js +166 -0
- package/lib/list/index.css +1 -0
- package/lib/list/index.d.ts +59 -0
- package/lib/list/index.js +33 -0
- package/lib/list/style/index.d.ts +1 -0
- package/lib/list/style/index.js +4 -0
- package/lib/list/types.d.ts +7 -0
- package/lib/list/types.js +15 -0
- package/lib/loading/Loading.d.ts +39 -0
- package/lib/loading/Loading.js +133 -0
- package/lib/loading/index.css +1 -0
- package/lib/loading/index.d.ts +31 -0
- package/lib/loading/index.js +33 -0
- package/lib/loading/style/index.d.ts +1 -0
- package/lib/loading/style/index.js +2 -0
- package/lib/locale/index.d.ts +7 -0
- package/lib/locale/index.js +49 -0
- package/lib/locale/lang/en-US.d.ts +62 -0
- package/lib/locale/lang/en-US.js +83 -0
- package/lib/locale/lang/zh-CN.d.ts +62 -0
- package/lib/locale/lang/zh-CN.js +83 -0
- package/lib/locale/style/index.d.ts +1 -0
- package/lib/locale/style/index.js +1 -0
- package/lib/notice-bar/NoticeBar.d.ts +71 -0
- package/lib/notice-bar/NoticeBar.js +190 -0
- package/lib/notice-bar/index.css +1 -0
- package/lib/notice-bar/index.d.ts +56 -0
- package/lib/notice-bar/index.js +33 -0
- package/lib/notice-bar/style/index.d.ts +1 -0
- package/lib/notice-bar/style/index.js +4 -0
- package/lib/notice-bar/types.d.ts +7 -0
- package/lib/notice-bar/types.js +15 -0
- package/lib/notify/Notify.d.ts +134 -0
- package/lib/notify/Notify.js +63 -0
- package/lib/notify/function-call.d.ts +6 -0
- package/lib/notify/function-call.js +93 -0
- package/lib/notify/index.css +1 -0
- package/lib/notify/index.d.ts +99 -0
- package/lib/notify/index.js +38 -0
- package/lib/notify/style/index.d.ts +1 -0
- package/lib/notify/style/index.js +6 -0
- package/lib/notify/types.d.ts +17 -0
- package/lib/notify/types.js +15 -0
- package/lib/number-keyboard/NumberKeyboard.d.ts +162 -0
- package/lib/number-keyboard/NumberKeyboard.js +268 -0
- package/lib/number-keyboard/NumberKeyboardKey.d.ts +24 -0
- package/lib/number-keyboard/NumberKeyboardKey.js +114 -0
- package/lib/number-keyboard/index.css +1 -0
- package/lib/number-keyboard/index.d.ts +119 -0
- package/lib/number-keyboard/index.js +33 -0
- package/lib/number-keyboard/style/index.d.ts +1 -0
- package/lib/number-keyboard/style/index.js +9 -0
- package/lib/overlay/Overlay.d.ts +51 -0
- package/lib/overlay/Overlay.js +66 -0
- package/lib/overlay/index.css +1 -0
- package/lib/overlay/index.d.ts +40 -0
- package/lib/overlay/index.js +33 -0
- package/lib/overlay/style/index.d.ts +1 -0
- package/lib/overlay/style/index.js +2 -0
- package/lib/password-input/PasswordInput.d.ts +63 -0
- package/lib/password-input/PasswordInput.js +97 -0
- package/lib/password-input/index.css +1 -0
- package/lib/password-input/index.d.ts +49 -0
- package/lib/password-input/index.js +33 -0
- package/lib/password-input/style/index.d.ts +1 -0
- package/lib/password-input/style/index.js +2 -0
- package/lib/popup/Popup.d.ts +165 -0
- package/lib/popup/Popup.js +224 -0
- package/lib/popup/index.css +1 -0
- package/lib/popup/index.d.ts +123 -0
- package/lib/popup/index.js +33 -0
- package/lib/popup/shared.d.ts +30 -0
- package/lib/popup/shared.js +41 -0
- package/lib/popup/style/index.d.ts +1 -0
- package/lib/popup/style/index.js +5 -0
- package/lib/popup/types.d.ts +8 -0
- package/lib/popup/types.js +15 -0
- package/lib/pull-refresh/PullRefresh.d.ts +75 -0
- package/lib/pull-refresh/PullRefresh.js +210 -0
- package/lib/pull-refresh/index.css +1 -0
- package/lib/pull-refresh/index.d.ts +58 -0
- package/lib/pull-refresh/index.js +33 -0
- package/lib/pull-refresh/style/index.d.ts +1 -0
- package/lib/pull-refresh/style/index.js +3 -0
- package/lib/rate/Rate.d.ts +107 -0
- package/lib/rate/Rate.js +236 -0
- package/lib/rate/index.css +1 -0
- package/lib/rate/index.d.ts +80 -0
- package/lib/rate/index.js +33 -0
- package/lib/rate/style/index.d.ts +1 -0
- package/lib/rate/style/index.js +4 -0
- package/lib/row/Row.d.ts +64 -0
- package/lib/row/Row.js +110 -0
- package/lib/row/index.css +1 -0
- package/lib/row/index.d.ts +42 -0
- package/lib/row/index.js +33 -0
- package/lib/row/style/index.d.ts +1 -0
- package/lib/row/style/index.js +2 -0
- package/lib/stepper/Stepper.d.ts +181 -0
- package/lib/stepper/Stepper.js +283 -0
- package/lib/stepper/index.css +1 -0
- package/lib/stepper/index.d.ts +132 -0
- package/lib/stepper/index.js +33 -0
- package/lib/stepper/style/index.d.ts +1 -0
- package/lib/stepper/style/index.js +4 -0
- package/lib/sticky/Sticky.d.ts +58 -0
- package/lib/sticky/Sticky.js +138 -0
- package/lib/sticky/index.css +1 -0
- package/lib/sticky/index.d.ts +45 -0
- package/lib/sticky/index.js +33 -0
- package/lib/sticky/style/index.d.ts +1 -0
- package/lib/sticky/style/index.js +2 -0
- package/lib/style/animation.css +1 -0
- package/lib/style/base.css +1 -0
- package/lib/style/css-variables.css +1 -0
- package/lib/style/mixins/clearfix.css +0 -0
- package/lib/style/mixins/ellipsis.css +0 -0
- package/lib/style/mixins/hairline.css +0 -0
- package/lib/style/normalize.css +1 -0
- package/lib/swipe/Swipe.d.ts +121 -0
- package/lib/swipe/Swipe.js +372 -0
- package/lib/swipe/index.css +1 -0
- package/lib/swipe/index.d.ts +90 -0
- package/lib/swipe/index.js +33 -0
- package/lib/swipe/style/index.d.ts +1 -0
- package/lib/swipe/style/index.js +2 -0
- package/lib/swipe/types.d.ts +31 -0
- package/lib/swipe/types.js +15 -0
- package/lib/swipe-item/SwipeItem.d.ts +2 -0
- package/lib/swipe-item/SwipeItem.js +101 -0
- package/lib/swipe-item/index.css +1 -0
- package/lib/swipe-item/index.d.ts +7 -0
- package/lib/swipe-item/index.js +33 -0
- package/lib/swipe-item/style/index.d.ts +1 -0
- package/lib/swipe-item/style/index.js +3 -0
- package/lib/switch/Switch.d.ts +58 -0
- package/lib/switch/Switch.js +104 -0
- package/lib/switch/index.css +1 -0
- package/lib/switch/index.d.ts +46 -0
- package/lib/switch/index.js +33 -0
- package/lib/switch/style/index.d.ts +1 -0
- package/lib/switch/style/index.js +3 -0
- package/lib/tab/Tab.d.ts +58 -0
- package/lib/tab/Tab.js +132 -0
- package/lib/tab/index.css +1 -0
- package/lib/tab/index.d.ts +45 -0
- package/lib/tab/index.js +33 -0
- package/lib/tab/style/index.d.ts +1 -0
- package/lib/tab/style/index.js +7 -0
- package/lib/tabs/Tabs.d.ts +154 -0
- package/lib/tabs/Tabs.js +377 -0
- package/lib/tabs/TabsContent.d.ts +43 -0
- package/lib/tabs/TabsContent.js +83 -0
- package/lib/tabs/TabsTitle.d.ts +45 -0
- package/lib/tabs/TabsTitle.js +109 -0
- package/lib/tabs/index.css +1 -0
- package/lib/tabs/index.d.ts +114 -0
- package/lib/tabs/index.js +33 -0
- package/lib/tabs/style/index.d.ts +1 -0
- package/lib/tabs/style/index.js +5 -0
- package/lib/tabs/types.d.ts +23 -0
- package/lib/tabs/types.js +15 -0
- package/lib/tabs/utils.d.ts +3 -0
- package/lib/tabs/utils.js +56 -0
- package/lib/toast/Toast.d.ts +112 -0
- package/lib/toast/Toast.js +138 -0
- package/lib/toast/function-call.d.ts +10 -0
- package/lib/toast/function-call.js +167 -0
- package/lib/toast/index.css +1 -0
- package/lib/toast/index.d.ts +79 -0
- package/lib/toast/index.js +42 -0
- package/lib/toast/lock-click.d.ts +1 -0
- package/lib/toast/lock-click.js +36 -0
- package/lib/toast/style/index.d.ts +1 -0
- package/lib/toast/style/index.js +7 -0
- package/lib/toast/types.d.ts +36 -0
- package/lib/toast/types.js +15 -0
- package/lib/utils/basic.d.ts +18 -0
- package/lib/utils/basic.js +51 -0
- package/lib/utils/constant.d.ts +8 -0
- package/lib/utils/constant.js +37 -0
- package/lib/utils/create.d.ts +17 -0
- package/lib/utils/create.js +75 -0
- package/lib/utils/deep-assign.d.ts +3 -0
- package/lib/utils/deep-assign.js +41 -0
- package/lib/utils/deep-clone.d.ts +1 -0
- package/lib/utils/deep-clone.js +39 -0
- package/lib/utils/dom.d.ts +12 -0
- package/lib/utils/dom.js +86 -0
- package/lib/utils/format.d.ts +13 -0
- package/lib/utils/format.js +139 -0
- package/lib/utils/index.d.ts +9 -0
- package/lib/utils/index.js +25 -0
- package/lib/utils/interceptor.d.ts +6 -0
- package/lib/utils/interceptor.js +48 -0
- package/lib/utils/mount-component.d.ts +14 -0
- package/lib/utils/mount-component.js +58 -0
- package/lib/utils/props.d.ts +31 -0
- package/lib/utils/props.js +55 -0
- package/lib/utils/validate.d.ts +9 -0
- package/lib/utils/validate.js +41 -0
- package/lib/utils/with-install.d.ts +13 -0
- package/lib/utils/with-install.js +31 -0
- package/lib/vue-sfc-shim.d.ts +6 -0
- package/lib/vue-tsx-shim.d.ts +16 -0
- package/lib/web-types.json +3197 -0
- package/lib/zartui.cjs.js +6740 -0
- package/lib/zartui.es.js +6740 -0
- package/lib/zartui.js +6974 -0
- package/lib/zartui.min.js +1 -0
- package/package.json +50 -61
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { withInstall } from "../utils/index.mjs";
|
|
2
|
+
import _Toast from "./Toast.mjs";
|
|
3
|
+
const Toast = withInstall(_Toast);
|
|
4
|
+
var stdin_default = Toast;
|
|
5
|
+
import {
|
|
6
|
+
showToast,
|
|
7
|
+
closeToast,
|
|
8
|
+
showFailToast,
|
|
9
|
+
showLoadingToast,
|
|
10
|
+
showSuccessToast,
|
|
11
|
+
allowMultipleToast,
|
|
12
|
+
setToastDefaultOptions,
|
|
13
|
+
resetToastDefaultOptions
|
|
14
|
+
} from "./function-call.mjs";
|
|
15
|
+
export {
|
|
16
|
+
Toast,
|
|
17
|
+
allowMultipleToast,
|
|
18
|
+
closeToast,
|
|
19
|
+
stdin_default as default,
|
|
20
|
+
resetToastDefaultOptions,
|
|
21
|
+
setToastDefaultOptions,
|
|
22
|
+
showFailToast,
|
|
23
|
+
showLoadingToast,
|
|
24
|
+
showSuccessToast,
|
|
25
|
+
showToast
|
|
26
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function lockClick(lock: boolean): void;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
let lockCount = 0;
|
|
2
|
+
function lockClick(lock) {
|
|
3
|
+
if (lock) {
|
|
4
|
+
if (!lockCount) {
|
|
5
|
+
document.body.classList.add("zt-toast--unclickable");
|
|
6
|
+
}
|
|
7
|
+
lockCount++;
|
|
8
|
+
} else if (lockCount) {
|
|
9
|
+
lockCount--;
|
|
10
|
+
if (!lockCount) {
|
|
11
|
+
document.body.classList.remove("zt-toast--unclickable");
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
export {
|
|
16
|
+
lockClick
|
|
17
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { ComponentPublicInstance, TeleportProps } from 'vue';
|
|
2
|
+
import type { LoadingType } from '../loading';
|
|
3
|
+
import type { Numeric } from '../utils';
|
|
4
|
+
export declare type ToastType = 'text' | 'loading' | 'success' | 'warning' | 'html';
|
|
5
|
+
export declare type ToastPosition = 'top' | 'middle' | 'bottom';
|
|
6
|
+
export declare type ToastOptions = {
|
|
7
|
+
icon?: string;
|
|
8
|
+
type?: ToastType;
|
|
9
|
+
mask?: boolean;
|
|
10
|
+
message?: Numeric;
|
|
11
|
+
onClose?: () => void;
|
|
12
|
+
onOpened?: () => void;
|
|
13
|
+
overlay?: boolean;
|
|
14
|
+
duration?: number;
|
|
15
|
+
teleport?: TeleportProps['to'];
|
|
16
|
+
iconSize?: Numeric;
|
|
17
|
+
position?: ToastPosition;
|
|
18
|
+
className?: unknown;
|
|
19
|
+
transition?: string;
|
|
20
|
+
iconPrefix?: string;
|
|
21
|
+
loadingType?: LoadingType;
|
|
22
|
+
forbidClick?: boolean;
|
|
23
|
+
closeOnClick?: boolean;
|
|
24
|
+
overlayClass?: unknown;
|
|
25
|
+
overlayStyle?: Record<string, any>;
|
|
26
|
+
closeOnClickOverlay?: boolean;
|
|
27
|
+
};
|
|
28
|
+
export declare type ToastWrapperInstance = ComponentPublicInstance<{
|
|
29
|
+
message: Numeric;
|
|
30
|
+
}, {
|
|
31
|
+
close: () => void;
|
|
32
|
+
/**
|
|
33
|
+
* @private
|
|
34
|
+
*/
|
|
35
|
+
open: (props: Record<string, any>) => void;
|
|
36
|
+
}>;
|
|
File without changes
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ComponentPublicInstance } from 'vue';
|
|
2
|
+
export declare function noop(): void;
|
|
3
|
+
export declare const extend: {
|
|
4
|
+
<T extends {}, U>(target: T, source: U): T & U;
|
|
5
|
+
<T_1 extends {}, U_1, V>(target: T_1, source1: U_1, source2: V): T_1 & U_1 & V;
|
|
6
|
+
<T_2 extends {}, U_2, V_1, W>(target: T_2, source1: U_2, source2: V_1, source3: W): T_2 & U_2 & V_1 & W;
|
|
7
|
+
(target: object, ...sources: any[]): any;
|
|
8
|
+
};
|
|
9
|
+
export declare const inBrowser: boolean;
|
|
10
|
+
export declare type Numeric = number | string;
|
|
11
|
+
export declare type ComponentInstance = ComponentPublicInstance<{}, any>;
|
|
12
|
+
export declare function get(object: any, path: string): any;
|
|
13
|
+
export declare type Writeable<T> = {
|
|
14
|
+
-readonly [P in keyof T]: T[P];
|
|
15
|
+
};
|
|
16
|
+
export declare function pick<T, U extends keyof T>(obj: T, keys: ReadonlyArray<U>, ignoreUndefined?: boolean): Writeable<Pick<T, U>>;
|
|
17
|
+
export declare const isSameValue: (newValue: unknown, oldValue: unknown) => boolean;
|
|
18
|
+
export declare const toArray: <T>(item: T | T[]) => T[];
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
function noop() {
|
|
2
|
+
}
|
|
3
|
+
const extend = Object.assign;
|
|
4
|
+
const inBrowser = typeof window !== "undefined";
|
|
5
|
+
function get(object, path) {
|
|
6
|
+
const keys = path.split(".");
|
|
7
|
+
let result = object;
|
|
8
|
+
keys.forEach((key) => {
|
|
9
|
+
var _a;
|
|
10
|
+
result = (_a = result[key]) != null ? _a : "";
|
|
11
|
+
});
|
|
12
|
+
return result;
|
|
13
|
+
}
|
|
14
|
+
function pick(obj, keys, ignoreUndefined) {
|
|
15
|
+
return keys.reduce((ret, key) => {
|
|
16
|
+
if (!ignoreUndefined || obj[key] !== void 0) {
|
|
17
|
+
ret[key] = obj[key];
|
|
18
|
+
}
|
|
19
|
+
return ret;
|
|
20
|
+
}, {});
|
|
21
|
+
}
|
|
22
|
+
const isSameValue = (newValue, oldValue) => JSON.stringify(newValue) === JSON.stringify(oldValue);
|
|
23
|
+
const toArray = (item) => Array.isArray(item) ? item : [item];
|
|
24
|
+
export {
|
|
25
|
+
extend,
|
|
26
|
+
get,
|
|
27
|
+
inBrowser,
|
|
28
|
+
isSameValue,
|
|
29
|
+
noop,
|
|
30
|
+
pick,
|
|
31
|
+
toArray
|
|
32
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const BORDER = "zt-hairline";
|
|
2
|
+
export declare const BORDER_TOP: string;
|
|
3
|
+
export declare const BORDER_LEFT: string;
|
|
4
|
+
export declare const BORDER_BOTTOM: string;
|
|
5
|
+
export declare const BORDER_SURROUND: string;
|
|
6
|
+
export declare const BORDER_TOP_BOTTOM: string;
|
|
7
|
+
export declare const BORDER_UNSET_TOP_BOTTOM: string;
|
|
8
|
+
export declare const HAPTICS_FEEDBACK = "zt-haptics-feedback";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
const BORDER = "zt-hairline";
|
|
2
|
+
const BORDER_TOP = `${BORDER}--top`;
|
|
3
|
+
const BORDER_LEFT = `${BORDER}--left`;
|
|
4
|
+
const BORDER_BOTTOM = `${BORDER}--bottom`;
|
|
5
|
+
const BORDER_SURROUND = `${BORDER}--surround`;
|
|
6
|
+
const BORDER_TOP_BOTTOM = `${BORDER}--top-bottom`;
|
|
7
|
+
const BORDER_UNSET_TOP_BOTTOM = `${BORDER}-unset--top-bottom`;
|
|
8
|
+
const HAPTICS_FEEDBACK = "zt-haptics-feedback";
|
|
9
|
+
export {
|
|
10
|
+
BORDER,
|
|
11
|
+
BORDER_BOTTOM,
|
|
12
|
+
BORDER_LEFT,
|
|
13
|
+
BORDER_SURROUND,
|
|
14
|
+
BORDER_TOP,
|
|
15
|
+
BORDER_TOP_BOTTOM,
|
|
16
|
+
BORDER_UNSET_TOP_BOTTOM,
|
|
17
|
+
HAPTICS_FEEDBACK
|
|
18
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare function createTranslate(name: string): (path: string, ...args: unknown[]) => any;
|
|
2
|
+
export declare type Translate = ReturnType<typeof createTranslate>;
|
|
3
|
+
export declare type Mod = string | {
|
|
4
|
+
[key: string]: any;
|
|
5
|
+
};
|
|
6
|
+
export declare type Mods = Mod | Mod[];
|
|
7
|
+
/**
|
|
8
|
+
* bem helper
|
|
9
|
+
* b() // 'button'
|
|
10
|
+
* b('text') // 'button__text'
|
|
11
|
+
* b({ disabled }) // 'button button--disabled'
|
|
12
|
+
* b('text', { disabled }) // 'button__text button__text--disabled'
|
|
13
|
+
* b(['disabled', 'primary']) // 'button button--disabled button--primary'
|
|
14
|
+
*/
|
|
15
|
+
export declare function createBEM(name: string): (el?: Mods, mods?: Mods) => Mods;
|
|
16
|
+
export declare type BEM = ReturnType<typeof createBEM>;
|
|
17
|
+
export declare function createNamespace(name: string): readonly [string, (el?: Mods | undefined, mods?: Mods | undefined) => Mods, (path: string, ...args: unknown[]) => any];
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { get } from "./basic.mjs";
|
|
2
|
+
import { camelize } from "./format.mjs";
|
|
3
|
+
import { isFunction } from "./validate.mjs";
|
|
4
|
+
import locale from "../locale/index.mjs";
|
|
5
|
+
function createTranslate(name) {
|
|
6
|
+
const prefix = camelize(name) + ".";
|
|
7
|
+
return (path, ...args) => {
|
|
8
|
+
const messages = locale.messages();
|
|
9
|
+
const message = get(messages, prefix + path) || get(messages, path);
|
|
10
|
+
return isFunction(message) ? message(...args) : message;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
function genBem(name, mods) {
|
|
14
|
+
if (!mods) {
|
|
15
|
+
return "";
|
|
16
|
+
}
|
|
17
|
+
if (typeof mods === "string") {
|
|
18
|
+
return ` ${name}--${mods}`;
|
|
19
|
+
}
|
|
20
|
+
if (Array.isArray(mods)) {
|
|
21
|
+
return mods.reduce((ret, item) => ret + genBem(name, item), "");
|
|
22
|
+
}
|
|
23
|
+
return Object.keys(mods).reduce(
|
|
24
|
+
(ret, key) => ret + (mods[key] ? genBem(name, key) : ""),
|
|
25
|
+
""
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
function createBEM(name) {
|
|
29
|
+
return (el, mods) => {
|
|
30
|
+
if (el && typeof el !== "string") {
|
|
31
|
+
mods = el;
|
|
32
|
+
el = "";
|
|
33
|
+
}
|
|
34
|
+
el = el ? `${name}__${el}` : name;
|
|
35
|
+
return `${el}${genBem(el, mods)}`;
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
function createNamespace(name) {
|
|
39
|
+
const prefixedName = `zt-${name}`;
|
|
40
|
+
return [
|
|
41
|
+
prefixedName,
|
|
42
|
+
createBEM(prefixedName),
|
|
43
|
+
createTranslate(prefixedName)
|
|
44
|
+
];
|
|
45
|
+
}
|
|
46
|
+
export {
|
|
47
|
+
createBEM,
|
|
48
|
+
createNamespace,
|
|
49
|
+
createTranslate
|
|
50
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { isDef, isObject } from "./validate.mjs";
|
|
2
|
+
const { hasOwnProperty } = Object.prototype;
|
|
3
|
+
function assignKey(to, from, key) {
|
|
4
|
+
const val = from[key];
|
|
5
|
+
if (!isDef(val)) {
|
|
6
|
+
return;
|
|
7
|
+
}
|
|
8
|
+
if (!hasOwnProperty.call(to, key) || !isObject(val)) {
|
|
9
|
+
to[key] = val;
|
|
10
|
+
} else {
|
|
11
|
+
to[key] = deepAssign(Object(to[key]), val);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
function deepAssign(to, from) {
|
|
15
|
+
Object.keys(from).forEach((key) => {
|
|
16
|
+
assignKey(to, from, key);
|
|
17
|
+
});
|
|
18
|
+
return to;
|
|
19
|
+
}
|
|
20
|
+
export {
|
|
21
|
+
deepAssign
|
|
22
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function deepClone<T extends Record<string, any> | null | undefined>(obj: T): T;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { isDef, isObject } from "./validate.mjs";
|
|
2
|
+
function deepClone(obj) {
|
|
3
|
+
if (!isDef(obj)) {
|
|
4
|
+
return obj;
|
|
5
|
+
}
|
|
6
|
+
if (Array.isArray(obj)) {
|
|
7
|
+
return obj.map((item) => deepClone(item));
|
|
8
|
+
}
|
|
9
|
+
if (isObject(obj)) {
|
|
10
|
+
const to = {};
|
|
11
|
+
Object.keys(obj).forEach((key) => {
|
|
12
|
+
to[key] = deepClone(obj[key]);
|
|
13
|
+
});
|
|
14
|
+
return to;
|
|
15
|
+
}
|
|
16
|
+
return obj;
|
|
17
|
+
}
|
|
18
|
+
export {
|
|
19
|
+
deepClone
|
|
20
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
export declare type ScrollElement = Element | Window;
|
|
3
|
+
export declare function getScrollTop(el: ScrollElement): number;
|
|
4
|
+
export declare function setScrollTop(el: ScrollElement, value: number): void;
|
|
5
|
+
export declare function getRootScrollTop(): number;
|
|
6
|
+
export declare function setRootScrollTop(value: number): void;
|
|
7
|
+
export declare function getElementTop(el: ScrollElement, scroller?: ScrollElement): number;
|
|
8
|
+
export declare function resetScroll(): void;
|
|
9
|
+
export declare const stopPropagation: (event: Event) => void;
|
|
10
|
+
export declare function preventDefault(event: Event, isStopPropagation?: boolean): void;
|
|
11
|
+
export declare function isHidden(elementRef: HTMLElement | Ref<HTMLElement | undefined>): boolean;
|
|
12
|
+
export declare const windowWidth: Ref<number>, windowHeight: Ref<number>;
|
package/es/utils/dom.mjs
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { useRect, useWindowSize } from "@zartui/use";
|
|
2
|
+
import { unref } from "vue";
|
|
3
|
+
import { isIOS as checkIsIOS } from "./validate.mjs";
|
|
4
|
+
function getScrollTop(el) {
|
|
5
|
+
const top = "scrollTop" in el ? el.scrollTop : el.pageYOffset;
|
|
6
|
+
return Math.max(top, 0);
|
|
7
|
+
}
|
|
8
|
+
function setScrollTop(el, value) {
|
|
9
|
+
if ("scrollTop" in el) {
|
|
10
|
+
el.scrollTop = value;
|
|
11
|
+
} else {
|
|
12
|
+
el.scrollTo(el.scrollX, value);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
function getRootScrollTop() {
|
|
16
|
+
return window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0;
|
|
17
|
+
}
|
|
18
|
+
function setRootScrollTop(value) {
|
|
19
|
+
setScrollTop(window, value);
|
|
20
|
+
setScrollTop(document.body, value);
|
|
21
|
+
}
|
|
22
|
+
function getElementTop(el, scroller) {
|
|
23
|
+
if (el === window) {
|
|
24
|
+
return 0;
|
|
25
|
+
}
|
|
26
|
+
const scrollTop = scroller ? getScrollTop(scroller) : getRootScrollTop();
|
|
27
|
+
return useRect(el).top + scrollTop;
|
|
28
|
+
}
|
|
29
|
+
const isIOS = checkIsIOS();
|
|
30
|
+
function resetScroll() {
|
|
31
|
+
if (isIOS) {
|
|
32
|
+
setRootScrollTop(getRootScrollTop());
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
const stopPropagation = (event) => event.stopPropagation();
|
|
36
|
+
function preventDefault(event, isStopPropagation) {
|
|
37
|
+
if (typeof event.cancelable !== "boolean" || event.cancelable) {
|
|
38
|
+
event.preventDefault();
|
|
39
|
+
}
|
|
40
|
+
if (isStopPropagation) {
|
|
41
|
+
stopPropagation(event);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
function isHidden(elementRef) {
|
|
45
|
+
const el = unref(elementRef);
|
|
46
|
+
if (!el) {
|
|
47
|
+
return false;
|
|
48
|
+
}
|
|
49
|
+
const style = window.getComputedStyle(el);
|
|
50
|
+
const hidden = style.display === "none";
|
|
51
|
+
const parentHidden = el.offsetParent === null && style.position !== "fixed";
|
|
52
|
+
return hidden || parentHidden;
|
|
53
|
+
}
|
|
54
|
+
const { width: windowWidth, height: windowHeight } = useWindowSize();
|
|
55
|
+
export {
|
|
56
|
+
getElementTop,
|
|
57
|
+
getRootScrollTop,
|
|
58
|
+
getScrollTop,
|
|
59
|
+
isHidden,
|
|
60
|
+
preventDefault,
|
|
61
|
+
resetScroll,
|
|
62
|
+
setRootScrollTop,
|
|
63
|
+
setScrollTop,
|
|
64
|
+
stopPropagation,
|
|
65
|
+
windowHeight,
|
|
66
|
+
windowWidth
|
|
67
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { CSSProperties } from 'vue';
|
|
2
|
+
import { type Numeric } from './basic';
|
|
3
|
+
export declare function addUnit(value?: Numeric): string | undefined;
|
|
4
|
+
export declare function getSizeStyle(originSize?: Numeric | Numeric[]): CSSProperties | undefined;
|
|
5
|
+
export declare function getZIndexStyle(zIndex?: Numeric): CSSProperties;
|
|
6
|
+
export declare function unitToPx(value: Numeric): number;
|
|
7
|
+
export declare const camelize: (str: string) => string;
|
|
8
|
+
export declare const kebabCase: (str: string) => string;
|
|
9
|
+
export declare function padZero(num: Numeric, targetLength?: number): string;
|
|
10
|
+
/** clamps number within the inclusive lower and upper bounds */
|
|
11
|
+
export declare const clamp: (num: number, min: number, max: number) => number;
|
|
12
|
+
export declare function formatNumber(value: string, allowDot?: boolean, allowMinus?: boolean): string;
|
|
13
|
+
export declare function addNumber(num1: number, num2: number): number;
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { inBrowser } from "./basic.mjs";
|
|
2
|
+
import { windowWidth, windowHeight } from "./dom.mjs";
|
|
3
|
+
import { isDef, isNumeric } from "./validate.mjs";
|
|
4
|
+
function addUnit(value) {
|
|
5
|
+
if (isDef(value)) {
|
|
6
|
+
return isNumeric(value) ? `${value}px` : String(value);
|
|
7
|
+
}
|
|
8
|
+
return void 0;
|
|
9
|
+
}
|
|
10
|
+
function getSizeStyle(originSize) {
|
|
11
|
+
if (isDef(originSize)) {
|
|
12
|
+
if (Array.isArray(originSize)) {
|
|
13
|
+
return {
|
|
14
|
+
width: addUnit(originSize[0]),
|
|
15
|
+
height: addUnit(originSize[1])
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
const size = addUnit(originSize);
|
|
19
|
+
return {
|
|
20
|
+
width: size,
|
|
21
|
+
height: size
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
function getZIndexStyle(zIndex) {
|
|
26
|
+
const style = {};
|
|
27
|
+
if (zIndex !== void 0) {
|
|
28
|
+
style.zIndex = +zIndex;
|
|
29
|
+
}
|
|
30
|
+
return style;
|
|
31
|
+
}
|
|
32
|
+
let rootFontSize;
|
|
33
|
+
function getRootFontSize() {
|
|
34
|
+
if (!rootFontSize) {
|
|
35
|
+
const doc = document.documentElement;
|
|
36
|
+
const fontSize = doc.style.fontSize || window.getComputedStyle(doc).fontSize;
|
|
37
|
+
rootFontSize = parseFloat(fontSize);
|
|
38
|
+
}
|
|
39
|
+
return rootFontSize;
|
|
40
|
+
}
|
|
41
|
+
function convertRem(value) {
|
|
42
|
+
value = value.replace(/rem/g, "");
|
|
43
|
+
return +value * getRootFontSize();
|
|
44
|
+
}
|
|
45
|
+
function convertVw(value) {
|
|
46
|
+
value = value.replace(/vw/g, "");
|
|
47
|
+
return +value * windowWidth.value / 100;
|
|
48
|
+
}
|
|
49
|
+
function convertVh(value) {
|
|
50
|
+
value = value.replace(/vh/g, "");
|
|
51
|
+
return +value * windowHeight.value / 100;
|
|
52
|
+
}
|
|
53
|
+
function unitToPx(value) {
|
|
54
|
+
if (typeof value === "number") {
|
|
55
|
+
return value;
|
|
56
|
+
}
|
|
57
|
+
if (inBrowser) {
|
|
58
|
+
if (value.includes("rem")) {
|
|
59
|
+
return convertRem(value);
|
|
60
|
+
}
|
|
61
|
+
if (value.includes("vw")) {
|
|
62
|
+
return convertVw(value);
|
|
63
|
+
}
|
|
64
|
+
if (value.includes("vh")) {
|
|
65
|
+
return convertVh(value);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
return parseFloat(value);
|
|
69
|
+
}
|
|
70
|
+
const camelizeRE = /-(\w)/g;
|
|
71
|
+
const camelize = (str) => str.replace(camelizeRE, (_, c) => c.toUpperCase());
|
|
72
|
+
const kebabCase = (str) => str.replace(/([A-Z])/g, "-$1").toLowerCase().replace(/^-/, "");
|
|
73
|
+
function padZero(num, targetLength = 2) {
|
|
74
|
+
let str = num + "";
|
|
75
|
+
while (str.length < targetLength) {
|
|
76
|
+
str = "0" + str;
|
|
77
|
+
}
|
|
78
|
+
return str;
|
|
79
|
+
}
|
|
80
|
+
const clamp = (num, min, max) => Math.min(Math.max(num, min), max);
|
|
81
|
+
function trimExtraChar(value, char, regExp) {
|
|
82
|
+
const index = value.indexOf(char);
|
|
83
|
+
if (index === -1) {
|
|
84
|
+
return value;
|
|
85
|
+
}
|
|
86
|
+
if (char === "-" && index !== 0) {
|
|
87
|
+
return value.slice(0, index);
|
|
88
|
+
}
|
|
89
|
+
return value.slice(0, index + 1) + value.slice(index).replace(regExp, "");
|
|
90
|
+
}
|
|
91
|
+
function formatNumber(value, allowDot = true, allowMinus = true) {
|
|
92
|
+
if (allowDot) {
|
|
93
|
+
value = trimExtraChar(value, ".", /\./g);
|
|
94
|
+
} else {
|
|
95
|
+
value = value.split(".")[0];
|
|
96
|
+
}
|
|
97
|
+
if (allowMinus) {
|
|
98
|
+
value = trimExtraChar(value, "-", /-/g);
|
|
99
|
+
} else {
|
|
100
|
+
value = value.replace(/-/, "");
|
|
101
|
+
}
|
|
102
|
+
const regExp = allowDot ? /[^-0-9.]/g : /[^-0-9]/g;
|
|
103
|
+
return value.replace(regExp, "");
|
|
104
|
+
}
|
|
105
|
+
function addNumber(num1, num2) {
|
|
106
|
+
const cardinal = 10 ** 10;
|
|
107
|
+
return Math.round((num1 + num2) * cardinal) / cardinal;
|
|
108
|
+
}
|
|
109
|
+
export {
|
|
110
|
+
addNumber,
|
|
111
|
+
addUnit,
|
|
112
|
+
camelize,
|
|
113
|
+
clamp,
|
|
114
|
+
formatNumber,
|
|
115
|
+
getSizeStyle,
|
|
116
|
+
getZIndexStyle,
|
|
117
|
+
kebabCase,
|
|
118
|
+
padZero,
|
|
119
|
+
unitToPx
|
|
120
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from "./basic.mjs";
|
|
2
|
+
export * from "./props.mjs";
|
|
3
|
+
export * from "./dom.mjs";
|
|
4
|
+
export * from "./create.mjs";
|
|
5
|
+
export * from "./format.mjs";
|
|
6
|
+
export * from "./constant.mjs";
|
|
7
|
+
export * from "./validate.mjs";
|
|
8
|
+
export * from "./interceptor.mjs";
|
|
9
|
+
export * from "./with-install.mjs";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare type Interceptor = (...args: any[]) => Promise<boolean> | boolean | undefined | void;
|
|
2
|
+
export declare function callInterceptor(interceptor: Interceptor | undefined, { args, done, canceled, }: {
|
|
3
|
+
args?: unknown[];
|
|
4
|
+
done: () => void;
|
|
5
|
+
canceled?: () => void;
|
|
6
|
+
}): void;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { noop } from "./basic.mjs";
|
|
2
|
+
import { isPromise } from "./validate.mjs";
|
|
3
|
+
function callInterceptor(interceptor, {
|
|
4
|
+
args = [],
|
|
5
|
+
done,
|
|
6
|
+
canceled
|
|
7
|
+
}) {
|
|
8
|
+
if (interceptor) {
|
|
9
|
+
const returnVal = interceptor.apply(null, args);
|
|
10
|
+
if (isPromise(returnVal)) {
|
|
11
|
+
returnVal.then((value) => {
|
|
12
|
+
if (value) {
|
|
13
|
+
done();
|
|
14
|
+
} else if (canceled) {
|
|
15
|
+
canceled();
|
|
16
|
+
}
|
|
17
|
+
}).catch(noop);
|
|
18
|
+
} else if (returnVal) {
|
|
19
|
+
done();
|
|
20
|
+
} else if (canceled) {
|
|
21
|
+
canceled();
|
|
22
|
+
}
|
|
23
|
+
} else {
|
|
24
|
+
done();
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
export {
|
|
28
|
+
callInterceptor
|
|
29
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Component } from 'vue';
|
|
2
|
+
export declare function usePopupState(): {
|
|
3
|
+
open: (props: Record<string, any>) => void;
|
|
4
|
+
close: () => void;
|
|
5
|
+
state: {
|
|
6
|
+
[x: string]: any;
|
|
7
|
+
show: boolean;
|
|
8
|
+
};
|
|
9
|
+
toggle: (show: boolean) => void;
|
|
10
|
+
};
|
|
11
|
+
export declare function mountComponent(RootComponent: Component): {
|
|
12
|
+
instance: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>>;
|
|
13
|
+
unmount(): void;
|
|
14
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { createApp, reactive } from "vue";
|
|
2
|
+
import { extend } from "../utils/index.mjs";
|
|
3
|
+
import { useExpose } from "../composables/use-expose.mjs";
|
|
4
|
+
function usePopupState() {
|
|
5
|
+
const state = reactive({
|
|
6
|
+
show: false
|
|
7
|
+
});
|
|
8
|
+
const toggle = (show) => {
|
|
9
|
+
state.show = show;
|
|
10
|
+
};
|
|
11
|
+
const open = (props) => {
|
|
12
|
+
extend(state, props, { transitionAppear: true });
|
|
13
|
+
toggle(true);
|
|
14
|
+
};
|
|
15
|
+
const close = () => toggle(false);
|
|
16
|
+
useExpose({ open, close, toggle });
|
|
17
|
+
return {
|
|
18
|
+
open,
|
|
19
|
+
close,
|
|
20
|
+
state,
|
|
21
|
+
toggle
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
function mountComponent(RootComponent) {
|
|
25
|
+
const app = createApp(RootComponent);
|
|
26
|
+
const root = document.createElement("div");
|
|
27
|
+
document.body.appendChild(root);
|
|
28
|
+
return {
|
|
29
|
+
instance: app.mount(root),
|
|
30
|
+
unmount() {
|
|
31
|
+
app.unmount();
|
|
32
|
+
document.body.removeChild(root);
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
export {
|
|
37
|
+
mountComponent,
|
|
38
|
+
usePopupState
|
|
39
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* prop type helpers
|
|
3
|
+
* help us to write less code and reduce bundle size
|
|
4
|
+
*/
|
|
5
|
+
import type { PropType } from 'vue';
|
|
6
|
+
export declare const unknownProp: PropType<unknown>;
|
|
7
|
+
export declare const numericProp: (NumberConstructor | StringConstructor)[];
|
|
8
|
+
export declare const truthProp: {
|
|
9
|
+
type: BooleanConstructor;
|
|
10
|
+
default: true;
|
|
11
|
+
};
|
|
12
|
+
export declare const makeRequiredProp: <T>(type: T) => {
|
|
13
|
+
type: T;
|
|
14
|
+
required: true;
|
|
15
|
+
};
|
|
16
|
+
export declare const makeArrayProp: <T>() => {
|
|
17
|
+
type: PropType<T[]>;
|
|
18
|
+
default: () => never[];
|
|
19
|
+
};
|
|
20
|
+
export declare const makeNumberProp: <T>(defaultVal: T) => {
|
|
21
|
+
type: NumberConstructor;
|
|
22
|
+
default: T;
|
|
23
|
+
};
|
|
24
|
+
export declare const makeNumericProp: <T>(defaultVal: T) => {
|
|
25
|
+
type: (NumberConstructor | StringConstructor)[];
|
|
26
|
+
default: T;
|
|
27
|
+
};
|
|
28
|
+
export declare const makeStringProp: <T>(defaultVal: T) => {
|
|
29
|
+
type: PropType<T>;
|
|
30
|
+
default: T;
|
|
31
|
+
};
|