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,372 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name2 in all)
|
|
7
|
+
__defProp(target, name2, { get: all[name2], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var stdin_exports = {};
|
|
19
|
+
__export(stdin_exports, {
|
|
20
|
+
SWIPE_KEY: () => SWIPE_KEY,
|
|
21
|
+
default: () => stdin_default
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(stdin_exports);
|
|
24
|
+
var import_vue = require("vue");
|
|
25
|
+
var import_vue2 = require("vue");
|
|
26
|
+
var import_utils = require("../utils");
|
|
27
|
+
var import_use = require("@zartui/use");
|
|
28
|
+
var import_use_touch = require("../composables/use-touch");
|
|
29
|
+
var import_use_expose = require("../composables/use-expose");
|
|
30
|
+
var import_on_popup_reopen = require("../composables/on-popup-reopen");
|
|
31
|
+
const [name, bem] = (0, import_utils.createNamespace)("swipe");
|
|
32
|
+
const swipeProps = {
|
|
33
|
+
loop: import_utils.truthProp,
|
|
34
|
+
width: import_utils.numericProp,
|
|
35
|
+
height: import_utils.numericProp,
|
|
36
|
+
vertical: Boolean,
|
|
37
|
+
autoplay: (0, import_utils.makeNumericProp)(0),
|
|
38
|
+
duration: (0, import_utils.makeNumericProp)(500),
|
|
39
|
+
touchable: import_utils.truthProp,
|
|
40
|
+
lazyRender: Boolean,
|
|
41
|
+
initialSwipe: (0, import_utils.makeNumericProp)(0),
|
|
42
|
+
indicatorColor: String,
|
|
43
|
+
showIndicators: import_utils.truthProp,
|
|
44
|
+
stopPropagation: import_utils.truthProp
|
|
45
|
+
};
|
|
46
|
+
const SWIPE_KEY = Symbol(name);
|
|
47
|
+
var stdin_default = (0, import_vue2.defineComponent)({
|
|
48
|
+
name,
|
|
49
|
+
props: swipeProps,
|
|
50
|
+
emits: ["change"],
|
|
51
|
+
setup(props, {
|
|
52
|
+
emit,
|
|
53
|
+
slots
|
|
54
|
+
}) {
|
|
55
|
+
const root = (0, import_vue2.ref)();
|
|
56
|
+
const state = (0, import_vue2.reactive)({
|
|
57
|
+
rect: null,
|
|
58
|
+
width: 0,
|
|
59
|
+
height: 0,
|
|
60
|
+
offset: 0,
|
|
61
|
+
active: 0,
|
|
62
|
+
swiping: false
|
|
63
|
+
});
|
|
64
|
+
const touch = (0, import_use_touch.useTouch)();
|
|
65
|
+
const {
|
|
66
|
+
children,
|
|
67
|
+
linkChildren
|
|
68
|
+
} = (0, import_use.useChildren)(SWIPE_KEY);
|
|
69
|
+
const count = (0, import_vue2.computed)(() => children.length);
|
|
70
|
+
const size = (0, import_vue2.computed)(() => state[props.vertical ? "height" : "width"]);
|
|
71
|
+
const delta = (0, import_vue2.computed)(() => props.vertical ? touch.deltaY.value : touch.deltaX.value);
|
|
72
|
+
const minOffset = (0, import_vue2.computed)(() => {
|
|
73
|
+
if (state.rect) {
|
|
74
|
+
const base = props.vertical ? state.rect.height : state.rect.width;
|
|
75
|
+
return base - size.value * count.value;
|
|
76
|
+
}
|
|
77
|
+
return 0;
|
|
78
|
+
});
|
|
79
|
+
const maxCount = (0, import_vue2.computed)(() => Math.ceil(Math.abs(minOffset.value) / size.value));
|
|
80
|
+
const trackSize = (0, import_vue2.computed)(() => count.value * size.value);
|
|
81
|
+
const activeIndicator = (0, import_vue2.computed)(() => (state.active + count.value) % count.value);
|
|
82
|
+
const isCorrectDirection = (0, import_vue2.computed)(() => {
|
|
83
|
+
const expect = props.vertical ? "vertical" : "horizontal";
|
|
84
|
+
return touch.direction.value === expect;
|
|
85
|
+
});
|
|
86
|
+
const trackStyle = (0, import_vue2.computed)(() => {
|
|
87
|
+
const style = {
|
|
88
|
+
transitionDuration: `${state.swiping ? 0 : props.duration}ms`,
|
|
89
|
+
transform: `translate${props.vertical ? "Y" : "X"}(${state.offset}px)`
|
|
90
|
+
};
|
|
91
|
+
if (size.value) {
|
|
92
|
+
const mainAxis = props.vertical ? "height" : "width";
|
|
93
|
+
const crossAxis = props.vertical ? "width" : "height";
|
|
94
|
+
style[mainAxis] = `${trackSize.value}px`;
|
|
95
|
+
style[crossAxis] = props[crossAxis] ? `${props[crossAxis]}px` : "";
|
|
96
|
+
}
|
|
97
|
+
return style;
|
|
98
|
+
});
|
|
99
|
+
const getTargetActive = (pace) => {
|
|
100
|
+
const {
|
|
101
|
+
active
|
|
102
|
+
} = state;
|
|
103
|
+
if (pace) {
|
|
104
|
+
if (props.loop) {
|
|
105
|
+
return (0, import_utils.clamp)(active + pace, -1, count.value);
|
|
106
|
+
}
|
|
107
|
+
return (0, import_utils.clamp)(active + pace, 0, maxCount.value);
|
|
108
|
+
}
|
|
109
|
+
return active;
|
|
110
|
+
};
|
|
111
|
+
const getTargetOffset = (targetActive, offset = 0) => {
|
|
112
|
+
let currentPosition = targetActive * size.value;
|
|
113
|
+
if (!props.loop) {
|
|
114
|
+
currentPosition = Math.min(currentPosition, -minOffset.value);
|
|
115
|
+
}
|
|
116
|
+
let targetOffset = offset - currentPosition;
|
|
117
|
+
if (!props.loop) {
|
|
118
|
+
targetOffset = (0, import_utils.clamp)(targetOffset, minOffset.value, 0);
|
|
119
|
+
}
|
|
120
|
+
return targetOffset;
|
|
121
|
+
};
|
|
122
|
+
const move = ({
|
|
123
|
+
pace = 0,
|
|
124
|
+
offset = 0,
|
|
125
|
+
emitChange
|
|
126
|
+
}) => {
|
|
127
|
+
if (count.value <= 1) {
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
const {
|
|
131
|
+
active
|
|
132
|
+
} = state;
|
|
133
|
+
const targetActive = getTargetActive(pace);
|
|
134
|
+
const targetOffset = getTargetOffset(targetActive, offset);
|
|
135
|
+
if (props.loop) {
|
|
136
|
+
if (children[0] && targetOffset !== minOffset.value) {
|
|
137
|
+
const outRightBound = targetOffset < minOffset.value;
|
|
138
|
+
children[0].setOffset(outRightBound ? trackSize.value : 0);
|
|
139
|
+
}
|
|
140
|
+
if (children[count.value - 1] && targetOffset !== 0) {
|
|
141
|
+
const outLeftBound = targetOffset > 0;
|
|
142
|
+
children[count.value - 1].setOffset(outLeftBound ? -trackSize.value : 0);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
state.active = targetActive;
|
|
146
|
+
state.offset = targetOffset;
|
|
147
|
+
if (emitChange && targetActive !== active) {
|
|
148
|
+
emit("change", activeIndicator.value);
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
const correctPosition = () => {
|
|
152
|
+
state.swiping = true;
|
|
153
|
+
if (state.active <= -1) {
|
|
154
|
+
move({
|
|
155
|
+
pace: count.value
|
|
156
|
+
});
|
|
157
|
+
} else if (state.active >= count.value) {
|
|
158
|
+
move({
|
|
159
|
+
pace: -count.value
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
};
|
|
163
|
+
const prev = () => {
|
|
164
|
+
correctPosition();
|
|
165
|
+
touch.reset();
|
|
166
|
+
(0, import_use.doubleRaf)(() => {
|
|
167
|
+
state.swiping = false;
|
|
168
|
+
move({
|
|
169
|
+
pace: -1,
|
|
170
|
+
emitChange: true
|
|
171
|
+
});
|
|
172
|
+
});
|
|
173
|
+
};
|
|
174
|
+
const next = () => {
|
|
175
|
+
correctPosition();
|
|
176
|
+
touch.reset();
|
|
177
|
+
(0, import_use.doubleRaf)(() => {
|
|
178
|
+
state.swiping = false;
|
|
179
|
+
move({
|
|
180
|
+
pace: 1,
|
|
181
|
+
emitChange: true
|
|
182
|
+
});
|
|
183
|
+
});
|
|
184
|
+
};
|
|
185
|
+
let autoplayTimer;
|
|
186
|
+
const stopAutoplay = () => clearTimeout(autoplayTimer);
|
|
187
|
+
const autoplay = () => {
|
|
188
|
+
stopAutoplay();
|
|
189
|
+
if (props.autoplay > 0 && count.value > 1) {
|
|
190
|
+
autoplayTimer = setTimeout(() => {
|
|
191
|
+
next();
|
|
192
|
+
autoplay();
|
|
193
|
+
}, +props.autoplay);
|
|
194
|
+
}
|
|
195
|
+
};
|
|
196
|
+
const initialize = (active = +props.initialSwipe) => {
|
|
197
|
+
if (!root.value) {
|
|
198
|
+
return;
|
|
199
|
+
}
|
|
200
|
+
const cb = () => {
|
|
201
|
+
var _a, _b;
|
|
202
|
+
if (!(0, import_utils.isHidden)(root)) {
|
|
203
|
+
const rect = {
|
|
204
|
+
width: root.value.offsetWidth,
|
|
205
|
+
height: root.value.offsetHeight
|
|
206
|
+
};
|
|
207
|
+
state.rect = rect;
|
|
208
|
+
state.width = +((_a = props.width) != null ? _a : rect.width);
|
|
209
|
+
state.height = +((_b = props.height) != null ? _b : rect.height);
|
|
210
|
+
}
|
|
211
|
+
if (count.value) {
|
|
212
|
+
active = Math.min(count.value - 1, active);
|
|
213
|
+
}
|
|
214
|
+
state.active = active;
|
|
215
|
+
state.swiping = true;
|
|
216
|
+
state.offset = getTargetOffset(active);
|
|
217
|
+
children.forEach((swipe) => {
|
|
218
|
+
swipe.setOffset(0);
|
|
219
|
+
});
|
|
220
|
+
autoplay();
|
|
221
|
+
};
|
|
222
|
+
if ((0, import_utils.isHidden)(root)) {
|
|
223
|
+
(0, import_vue2.nextTick)().then(cb);
|
|
224
|
+
} else {
|
|
225
|
+
cb();
|
|
226
|
+
}
|
|
227
|
+
};
|
|
228
|
+
const resize = () => initialize(state.active);
|
|
229
|
+
let touchStartTime;
|
|
230
|
+
const onTouchStart = (event) => {
|
|
231
|
+
if (!props.touchable)
|
|
232
|
+
return;
|
|
233
|
+
touch.start(event);
|
|
234
|
+
touchStartTime = Date.now();
|
|
235
|
+
stopAutoplay();
|
|
236
|
+
correctPosition();
|
|
237
|
+
};
|
|
238
|
+
const onTouchMove = (event) => {
|
|
239
|
+
if (props.touchable && state.swiping) {
|
|
240
|
+
touch.move(event);
|
|
241
|
+
if (isCorrectDirection.value) {
|
|
242
|
+
(0, import_utils.preventDefault)(event, props.stopPropagation);
|
|
243
|
+
move({
|
|
244
|
+
offset: delta.value
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
};
|
|
249
|
+
const onTouchEnd = () => {
|
|
250
|
+
if (!props.touchable || !state.swiping) {
|
|
251
|
+
return;
|
|
252
|
+
}
|
|
253
|
+
const duration = Date.now() - touchStartTime;
|
|
254
|
+
const speed = delta.value / duration;
|
|
255
|
+
const shouldSwipe = Math.abs(speed) > 0.25 || Math.abs(delta.value) > size.value / 2;
|
|
256
|
+
if (shouldSwipe && isCorrectDirection.value) {
|
|
257
|
+
const offset = props.vertical ? touch.offsetY.value : touch.offsetX.value;
|
|
258
|
+
let pace = 0;
|
|
259
|
+
if (props.loop) {
|
|
260
|
+
pace = offset > 0 ? delta.value > 0 ? -1 : 1 : 0;
|
|
261
|
+
} else {
|
|
262
|
+
pace = -Math[delta.value > 0 ? "ceil" : "floor"](delta.value / size.value);
|
|
263
|
+
}
|
|
264
|
+
move({
|
|
265
|
+
pace,
|
|
266
|
+
emitChange: true
|
|
267
|
+
});
|
|
268
|
+
} else if (delta.value) {
|
|
269
|
+
move({
|
|
270
|
+
pace: 0
|
|
271
|
+
});
|
|
272
|
+
}
|
|
273
|
+
state.swiping = false;
|
|
274
|
+
autoplay();
|
|
275
|
+
};
|
|
276
|
+
const swipeTo = (index, options = {}) => {
|
|
277
|
+
correctPosition();
|
|
278
|
+
touch.reset();
|
|
279
|
+
(0, import_use.doubleRaf)(() => {
|
|
280
|
+
let targetIndex;
|
|
281
|
+
if (props.loop && index === count.value) {
|
|
282
|
+
targetIndex = state.active === 0 ? 0 : index;
|
|
283
|
+
} else {
|
|
284
|
+
targetIndex = index % count.value;
|
|
285
|
+
}
|
|
286
|
+
if (options.immediate) {
|
|
287
|
+
(0, import_use.doubleRaf)(() => {
|
|
288
|
+
state.swiping = false;
|
|
289
|
+
});
|
|
290
|
+
} else {
|
|
291
|
+
state.swiping = false;
|
|
292
|
+
}
|
|
293
|
+
move({
|
|
294
|
+
pace: targetIndex - state.active,
|
|
295
|
+
emitChange: true
|
|
296
|
+
});
|
|
297
|
+
});
|
|
298
|
+
};
|
|
299
|
+
const renderDot = (_, index) => {
|
|
300
|
+
const active = index === activeIndicator.value;
|
|
301
|
+
const style = active ? {
|
|
302
|
+
backgroundColor: props.indicatorColor
|
|
303
|
+
} : void 0;
|
|
304
|
+
return (0, import_vue.createVNode)("i", {
|
|
305
|
+
"style": style,
|
|
306
|
+
"class": bem("indicator", {
|
|
307
|
+
active
|
|
308
|
+
})
|
|
309
|
+
}, null);
|
|
310
|
+
};
|
|
311
|
+
const renderIndicator = () => {
|
|
312
|
+
if (slots.indicator) {
|
|
313
|
+
return slots.indicator({
|
|
314
|
+
active: activeIndicator.value,
|
|
315
|
+
total: count.value
|
|
316
|
+
});
|
|
317
|
+
}
|
|
318
|
+
if (props.showIndicators && count.value > 1) {
|
|
319
|
+
return (0, import_vue.createVNode)("div", {
|
|
320
|
+
"class": bem("indicators", {
|
|
321
|
+
vertical: props.vertical
|
|
322
|
+
})
|
|
323
|
+
}, [Array(count.value).fill("").map(renderDot)]);
|
|
324
|
+
}
|
|
325
|
+
};
|
|
326
|
+
(0, import_use_expose.useExpose)({
|
|
327
|
+
prev,
|
|
328
|
+
next,
|
|
329
|
+
state,
|
|
330
|
+
resize,
|
|
331
|
+
swipeTo
|
|
332
|
+
});
|
|
333
|
+
linkChildren({
|
|
334
|
+
size,
|
|
335
|
+
props,
|
|
336
|
+
count,
|
|
337
|
+
activeIndicator
|
|
338
|
+
});
|
|
339
|
+
(0, import_vue2.watch)(() => props.initialSwipe, (value) => initialize(+value));
|
|
340
|
+
(0, import_vue2.watch)(count, () => initialize(state.active));
|
|
341
|
+
(0, import_vue2.watch)(() => props.autoplay, autoplay);
|
|
342
|
+
(0, import_vue2.watch)([import_utils.windowWidth, import_utils.windowHeight], resize);
|
|
343
|
+
(0, import_vue2.watch)((0, import_use.usePageVisibility)(), (visible) => {
|
|
344
|
+
if (visible === "visible") {
|
|
345
|
+
autoplay();
|
|
346
|
+
} else {
|
|
347
|
+
stopAutoplay();
|
|
348
|
+
}
|
|
349
|
+
});
|
|
350
|
+
(0, import_vue2.onMounted)(initialize);
|
|
351
|
+
(0, import_vue2.onActivated)(() => initialize(state.active));
|
|
352
|
+
(0, import_on_popup_reopen.onPopupReopen)(() => initialize(state.active));
|
|
353
|
+
(0, import_vue2.onDeactivated)(stopAutoplay);
|
|
354
|
+
(0, import_vue2.onBeforeUnmount)(stopAutoplay);
|
|
355
|
+
return () => {
|
|
356
|
+
var _a;
|
|
357
|
+
return (0, import_vue.createVNode)("div", {
|
|
358
|
+
"ref": root,
|
|
359
|
+
"class": bem()
|
|
360
|
+
}, [(0, import_vue.createVNode)("div", {
|
|
361
|
+
"style": trackStyle.value,
|
|
362
|
+
"class": bem("track", {
|
|
363
|
+
vertical: props.vertical
|
|
364
|
+
}),
|
|
365
|
+
"onTouchstart": onTouchStart,
|
|
366
|
+
"onTouchmove": onTouchMove,
|
|
367
|
+
"onTouchend": onTouchEnd,
|
|
368
|
+
"onTouchcancel": onTouchEnd
|
|
369
|
+
}, [(_a = slots.default) == null ? void 0 : _a.call(slots)]), renderIndicator()]);
|
|
370
|
+
};
|
|
371
|
+
}
|
|
372
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
body{--zt-swipe-indicator-size: 6px;--zt-swipe-indicator-margin: var(--zt-padding-sm);--zt-swipe-indicator-active-opacity: 1;--zt-swipe-indicator-inactive-opacity: .3;--zt-swipe-indicator-active-background: var(--zt-primary-color);--zt-swipe-indicator-inactive-background: var(--zt-border-color)}.zt-swipe{position:relative;overflow:hidden;transform:translateZ(0);cursor:-webkit-grab;cursor:grab;-webkit-user-select:none;user-select:none}.zt-swipe__track{display:flex;height:100%}.zt-swipe__track--vertical{flex-direction:column}.zt-swipe__indicators{position:absolute;bottom:var(--zt-swipe-indicator-margin);left:50%;display:flex;transform:translate(-50%)}.zt-swipe__indicators--vertical{top:50%;bottom:auto;left:var(--zt-swipe-indicator-margin);flex-direction:column;transform:translateY(-50%)}.zt-swipe__indicators--vertical .zt-swipe__indicator:not(:last-child){margin-bottom:var(--zt-swipe-indicator-size)}.zt-swipe__indicator{width:var(--zt-swipe-indicator-size);height:var(--zt-swipe-indicator-size);background-color:var(--zt-swipe-indicator-inactive-background);border-radius:100%;opacity:var(--zt-swipe-indicator-inactive-opacity);transition:opacity var(--zt-duration-fast),background-color var(--zt-duration-fast)}.zt-swipe__indicator:not(:last-child){margin-right:var(--zt-swipe-indicator-size)}.zt-swipe__indicator--active{background-color:var(--zt-swipe-indicator-active-background);opacity:var(--zt-swipe-indicator-active-opacity)}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { SwipeProps } from './Swipe';
|
|
2
|
+
export declare const Swipe: import("../utils").WithInstall<import("vue").DefineComponent<{
|
|
3
|
+
loop: {
|
|
4
|
+
type: BooleanConstructor;
|
|
5
|
+
default: true;
|
|
6
|
+
};
|
|
7
|
+
width: (NumberConstructor | StringConstructor)[];
|
|
8
|
+
height: (NumberConstructor | StringConstructor)[];
|
|
9
|
+
vertical: BooleanConstructor;
|
|
10
|
+
autoplay: {
|
|
11
|
+
type: (NumberConstructor | StringConstructor)[];
|
|
12
|
+
default: number;
|
|
13
|
+
};
|
|
14
|
+
duration: {
|
|
15
|
+
type: (NumberConstructor | StringConstructor)[];
|
|
16
|
+
default: number;
|
|
17
|
+
};
|
|
18
|
+
touchable: {
|
|
19
|
+
type: BooleanConstructor;
|
|
20
|
+
default: true;
|
|
21
|
+
};
|
|
22
|
+
lazyRender: BooleanConstructor;
|
|
23
|
+
initialSwipe: {
|
|
24
|
+
type: (NumberConstructor | StringConstructor)[];
|
|
25
|
+
default: number;
|
|
26
|
+
};
|
|
27
|
+
indicatorColor: StringConstructor;
|
|
28
|
+
showIndicators: {
|
|
29
|
+
type: BooleanConstructor;
|
|
30
|
+
default: true;
|
|
31
|
+
};
|
|
32
|
+
stopPropagation: {
|
|
33
|
+
type: BooleanConstructor;
|
|
34
|
+
default: true;
|
|
35
|
+
};
|
|
36
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "change"[], "change", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
37
|
+
loop: {
|
|
38
|
+
type: BooleanConstructor;
|
|
39
|
+
default: true;
|
|
40
|
+
};
|
|
41
|
+
width: (NumberConstructor | StringConstructor)[];
|
|
42
|
+
height: (NumberConstructor | StringConstructor)[];
|
|
43
|
+
vertical: BooleanConstructor;
|
|
44
|
+
autoplay: {
|
|
45
|
+
type: (NumberConstructor | StringConstructor)[];
|
|
46
|
+
default: number;
|
|
47
|
+
};
|
|
48
|
+
duration: {
|
|
49
|
+
type: (NumberConstructor | StringConstructor)[];
|
|
50
|
+
default: number;
|
|
51
|
+
};
|
|
52
|
+
touchable: {
|
|
53
|
+
type: BooleanConstructor;
|
|
54
|
+
default: true;
|
|
55
|
+
};
|
|
56
|
+
lazyRender: BooleanConstructor;
|
|
57
|
+
initialSwipe: {
|
|
58
|
+
type: (NumberConstructor | StringConstructor)[];
|
|
59
|
+
default: number;
|
|
60
|
+
};
|
|
61
|
+
indicatorColor: StringConstructor;
|
|
62
|
+
showIndicators: {
|
|
63
|
+
type: BooleanConstructor;
|
|
64
|
+
default: true;
|
|
65
|
+
};
|
|
66
|
+
stopPropagation: {
|
|
67
|
+
type: BooleanConstructor;
|
|
68
|
+
default: true;
|
|
69
|
+
};
|
|
70
|
+
}>> & {
|
|
71
|
+
onChange?: ((...args: any[]) => any) | undefined;
|
|
72
|
+
}, {
|
|
73
|
+
autoplay: string | number;
|
|
74
|
+
loop: boolean;
|
|
75
|
+
vertical: boolean;
|
|
76
|
+
duration: string | number;
|
|
77
|
+
lazyRender: boolean;
|
|
78
|
+
touchable: boolean;
|
|
79
|
+
initialSwipe: string | number;
|
|
80
|
+
showIndicators: boolean;
|
|
81
|
+
stopPropagation: boolean;
|
|
82
|
+
}>>;
|
|
83
|
+
export default Swipe;
|
|
84
|
+
export type { SwipeProps };
|
|
85
|
+
export type { SwipeInstance, SwipeToOptions } from './types';
|
|
86
|
+
declare module 'vue' {
|
|
87
|
+
interface GlobalComponents {
|
|
88
|
+
ZtSwipe: typeof Swipe;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
21
|
+
mod
|
|
22
|
+
));
|
|
23
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
24
|
+
var stdin_exports = {};
|
|
25
|
+
__export(stdin_exports, {
|
|
26
|
+
Swipe: () => Swipe,
|
|
27
|
+
default: () => stdin_default
|
|
28
|
+
});
|
|
29
|
+
module.exports = __toCommonJS(stdin_exports);
|
|
30
|
+
var import_utils = require("../utils");
|
|
31
|
+
var import_Swipe = __toESM(require("./Swipe"));
|
|
32
|
+
const Swipe = (0, import_utils.withInstall)(import_Swipe.default);
|
|
33
|
+
var stdin_default = Swipe;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { ComponentPublicInstance, ComputedRef } from 'vue';
|
|
2
|
+
import type { SwipeProps } from './Swipe';
|
|
3
|
+
export declare type SwipeState = {
|
|
4
|
+
rect: {
|
|
5
|
+
width: number;
|
|
6
|
+
height: number;
|
|
7
|
+
} | null;
|
|
8
|
+
width: number;
|
|
9
|
+
height: number;
|
|
10
|
+
offset: number;
|
|
11
|
+
active: number;
|
|
12
|
+
swiping: boolean;
|
|
13
|
+
};
|
|
14
|
+
export declare type SwipeToOptions = {
|
|
15
|
+
immediate?: boolean;
|
|
16
|
+
};
|
|
17
|
+
export declare type SwipeExpose = {
|
|
18
|
+
prev: () => void;
|
|
19
|
+
next: () => void;
|
|
20
|
+
resize: () => void;
|
|
21
|
+
swipeTo: (index: number, options?: SwipeToOptions) => void;
|
|
22
|
+
/** @private */
|
|
23
|
+
state: SwipeState;
|
|
24
|
+
};
|
|
25
|
+
export declare type SwipeProvide = {
|
|
26
|
+
props: SwipeProps;
|
|
27
|
+
size: ComputedRef<number>;
|
|
28
|
+
count: ComputedRef<number>;
|
|
29
|
+
activeIndicator: ComputedRef<number>;
|
|
30
|
+
};
|
|
31
|
+
export declare type SwipeInstance = ComponentPublicInstance<SwipeProps, SwipeExpose>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __copyProps = (to, from, except, desc) => {
|
|
6
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
+
for (let key of __getOwnPropNames(from))
|
|
8
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
9
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
|
+
}
|
|
11
|
+
return to;
|
|
12
|
+
};
|
|
13
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
14
|
+
var stdin_exports = {};
|
|
15
|
+
module.exports = __toCommonJS(stdin_exports);
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, (() => JSX.Element) | undefined, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name2 in all)
|
|
7
|
+
__defProp(target, name2, { get: all[name2], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var stdin_exports = {};
|
|
19
|
+
__export(stdin_exports, {
|
|
20
|
+
default: () => stdin_default
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(stdin_exports);
|
|
23
|
+
var import_vue = require("vue");
|
|
24
|
+
var import_vue2 = require("vue");
|
|
25
|
+
var import_utils = require("../utils");
|
|
26
|
+
var import_Swipe = require("../swipe/Swipe");
|
|
27
|
+
var import_use = require("@zartui/use");
|
|
28
|
+
var import_use_expose = require("../composables/use-expose");
|
|
29
|
+
const [name, bem] = (0, import_utils.createNamespace)("swipe-item");
|
|
30
|
+
var stdin_default = (0, import_vue2.defineComponent)({
|
|
31
|
+
name,
|
|
32
|
+
setup(props, {
|
|
33
|
+
slots
|
|
34
|
+
}) {
|
|
35
|
+
let rendered;
|
|
36
|
+
const state = (0, import_vue2.reactive)({
|
|
37
|
+
offset: 0,
|
|
38
|
+
inited: false,
|
|
39
|
+
mounted: false
|
|
40
|
+
});
|
|
41
|
+
const {
|
|
42
|
+
parent,
|
|
43
|
+
index
|
|
44
|
+
} = (0, import_use.useParent)(import_Swipe.SWIPE_KEY);
|
|
45
|
+
if (!parent) {
|
|
46
|
+
if (process.env.NODE_ENV !== "production") {
|
|
47
|
+
console.error("[Zart] <SwipeItem> must be a child component of <Swipe>.");
|
|
48
|
+
}
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
const style = (0, import_vue2.computed)(() => {
|
|
52
|
+
const style2 = {};
|
|
53
|
+
const {
|
|
54
|
+
vertical
|
|
55
|
+
} = parent.props;
|
|
56
|
+
if (parent.size.value) {
|
|
57
|
+
style2[vertical ? "height" : "width"] = `${parent.size.value}px`;
|
|
58
|
+
}
|
|
59
|
+
if (state.offset) {
|
|
60
|
+
style2.transform = `translate${vertical ? "Y" : "X"}(${state.offset}px)`;
|
|
61
|
+
}
|
|
62
|
+
return style2;
|
|
63
|
+
});
|
|
64
|
+
const shouldRender = (0, import_vue2.computed)(() => {
|
|
65
|
+
const {
|
|
66
|
+
loop,
|
|
67
|
+
lazyRender
|
|
68
|
+
} = parent.props;
|
|
69
|
+
if (!lazyRender || rendered) {
|
|
70
|
+
return true;
|
|
71
|
+
}
|
|
72
|
+
if (!state.mounted) {
|
|
73
|
+
return false;
|
|
74
|
+
}
|
|
75
|
+
const active = parent.activeIndicator.value;
|
|
76
|
+
const maxActive = parent.count.value - 1;
|
|
77
|
+
const prevActive = active === 0 && loop ? maxActive : active - 1;
|
|
78
|
+
const nextActive = active === maxActive && loop ? 0 : active + 1;
|
|
79
|
+
rendered = index.value === active || index.value === prevActive || index.value === nextActive;
|
|
80
|
+
return rendered;
|
|
81
|
+
});
|
|
82
|
+
const setOffset = (offset) => {
|
|
83
|
+
state.offset = offset;
|
|
84
|
+
};
|
|
85
|
+
(0, import_vue2.onMounted)(() => {
|
|
86
|
+
(0, import_vue2.nextTick)(() => {
|
|
87
|
+
state.mounted = true;
|
|
88
|
+
});
|
|
89
|
+
});
|
|
90
|
+
(0, import_use_expose.useExpose)({
|
|
91
|
+
setOffset
|
|
92
|
+
});
|
|
93
|
+
return () => {
|
|
94
|
+
var _a;
|
|
95
|
+
return (0, import_vue.createVNode)("div", {
|
|
96
|
+
"class": bem(),
|
|
97
|
+
"style": style.value
|
|
98
|
+
}, [shouldRender.value ? (_a = slots.default) == null ? void 0 : _a.call(slots) : null]);
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.zt-swipe-item{position:relative;flex-shrink:0;width:100%;height:100%}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const SwipeItem: import("../utils").WithInstall<import("vue").DefineComponent<{}, (() => JSX.Element) | undefined, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>>;
|
|
2
|
+
export default SwipeItem;
|
|
3
|
+
declare module 'vue' {
|
|
4
|
+
interface GlobalComponents {
|
|
5
|
+
ZtSwipeItem: typeof SwipeItem;
|
|
6
|
+
}
|
|
7
|
+
}
|