dpzvc3-ui 3.0.7 → 3.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dpzvc3.esm.js +6585 -9367
- package/dist/dpzvc3.esm.js.map +1 -1
- package/dist/dpzvc3.esm.min.js +1 -1
- package/dist/dpzvc3.esm.min.js.map +1 -1
- package/dist/dpzvc3.js +6071 -7684
- package/dist/dpzvc3.js.map +1 -1
- package/dist/dpzvc3.min.js +1 -1
- package/dist/dpzvc3.min.js.map +1 -1
- package/dist/styles/components/radioBox.css +1 -1
- package/dist/styles/components/rater.css +1 -0
- package/dist/styles/dpzvc3.css +1 -1
- package/dist/types/components/Indicator/types.d.ts +16 -0
- package/dist/types/components/Indicator/types.d.ts.map +1 -0
- package/dist/types/components/Prompt/types.d.ts +37 -0
- package/dist/types/components/Prompt/types.d.ts.map +1 -0
- package/dist/types/components/Text/index.d.ts +12 -0
- package/dist/types/components/Text/index.d.ts.map +1 -0
- package/dist/types/components/Text/textBar.d.ts +84 -0
- package/dist/types/components/Text/textBar.d.ts.map +1 -0
- package/dist/types/components/Text/types.d.ts +13 -0
- package/dist/types/components/Text/types.d.ts.map +1 -0
- package/dist/types/components/actionSheet/actionSheet.d.ts +42 -0
- package/dist/types/components/actionSheet/actionSheet.d.ts.map +1 -0
- package/dist/types/components/actionSheet/index.d.ts +7 -0
- package/dist/types/components/actionSheet/index.d.ts.map +1 -0
- package/dist/types/components/actionSheet/types.d.ts +11 -0
- package/dist/types/components/actionSheet/types.d.ts.map +1 -0
- package/dist/types/components/badge/badge.d.ts +51 -0
- package/dist/types/components/badge/badge.d.ts.map +1 -0
- package/dist/types/components/badge/index.d.ts +12 -0
- package/dist/types/components/badge/index.d.ts.map +1 -0
- package/dist/types/components/badge/types.d.ts +8 -0
- package/dist/types/components/badge/types.d.ts.map +1 -0
- package/dist/types/components/button/button.d.ts +103 -0
- package/dist/types/components/button/button.d.ts.map +1 -0
- package/dist/types/components/button/index.d.ts +12 -0
- package/dist/types/components/button/index.d.ts.map +1 -0
- package/dist/types/components/button/types.d.ts +13 -0
- package/dist/types/components/button/types.d.ts.map +1 -0
- package/dist/types/components/card/card.d.ts +18 -0
- package/dist/types/components/card/card.d.ts.map +1 -0
- package/dist/types/components/card/index.d.ts +12 -0
- package/dist/types/components/card/index.d.ts.map +1 -0
- package/dist/types/components/card/types.d.ts +4 -0
- package/dist/types/components/card/types.d.ts.map +1 -0
- package/dist/types/components/cell/cell.d.ts +24 -0
- package/dist/types/components/cell/cell.d.ts.map +1 -0
- package/dist/types/components/cell/index.d.ts +12 -0
- package/dist/types/components/cell/index.d.ts.map +1 -0
- package/dist/types/components/cell/types.d.ts +8 -0
- package/dist/types/components/cell/types.d.ts.map +1 -0
- package/dist/types/components/cellSwipe/cellSwipe.d.ts +37 -0
- package/dist/types/components/cellSwipe/cellSwipe.d.ts.map +1 -0
- package/dist/types/components/cellSwipe/index.d.ts +12 -0
- package/dist/types/components/cellSwipe/index.d.ts.map +1 -0
- package/dist/types/components/cellSwipe/types.d.ts +15 -0
- package/dist/types/components/cellSwipe/types.d.ts.map +1 -0
- package/dist/types/components/checkBox/checkbox-group.d.ts +38 -0
- package/dist/types/components/checkBox/checkbox-group.d.ts.map +1 -0
- package/dist/types/components/checkBox/checkbox.d.ts +36 -0
- package/dist/types/components/checkBox/checkbox.d.ts.map +1 -0
- package/dist/types/components/checkBox/index.d.ts +14 -0
- package/dist/types/components/checkBox/index.d.ts.map +1 -0
- package/dist/types/components/checkBox/types.d.ts +22 -0
- package/dist/types/components/checkBox/types.d.ts.map +1 -0
- package/dist/types/components/header/header.d.ts +47 -0
- package/dist/types/components/header/header.d.ts.map +1 -0
- package/dist/types/components/header/index.d.ts +12 -0
- package/dist/types/components/header/index.d.ts.map +1 -0
- package/dist/types/components/header/types.d.ts +7 -0
- package/dist/types/components/header/types.d.ts.map +1 -0
- package/dist/types/components/loadMore/index.d.ts +12 -0
- package/dist/types/components/loadMore/index.d.ts.map +1 -0
- package/dist/types/components/loadMore/loadMore.d.ts +150 -0
- package/dist/types/components/loadMore/loadMore.d.ts.map +1 -0
- package/dist/types/components/loadMore/types.d.ts +23 -0
- package/dist/types/components/loadMore/types.d.ts.map +1 -0
- package/dist/types/components/message/types.d.ts +32 -0
- package/dist/types/components/message/types.d.ts.map +1 -0
- package/dist/types/components/modal/types.d.ts +33 -0
- package/dist/types/components/modal/types.d.ts.map +1 -0
- package/dist/types/components/number/Number.d.ts +77 -0
- package/dist/types/components/number/Number.d.ts.map +1 -0
- package/dist/types/components/number/index.d.ts +9 -0
- package/dist/types/components/number/index.d.ts.map +1 -0
- package/dist/types/components/number/types.d.ts +12 -0
- package/dist/types/components/number/types.d.ts.map +1 -0
- package/dist/types/components/picker/index.d.ts +12 -0
- package/dist/types/components/picker/index.d.ts.map +1 -0
- package/dist/types/components/picker/picker.d.ts +237 -0
- package/dist/types/components/picker/picker.d.ts.map +1 -0
- package/dist/types/components/picker/types.d.ts +17 -0
- package/dist/types/components/picker/types.d.ts.map +1 -0
- package/dist/types/components/popup/index.d.ts +12 -0
- package/dist/types/components/popup/index.d.ts.map +1 -0
- package/dist/types/components/popup/popup.d.ts +71 -0
- package/dist/types/components/popup/popup.d.ts.map +1 -0
- package/dist/types/components/popup/types.d.ts +10 -0
- package/dist/types/components/popup/types.d.ts.map +1 -0
- package/dist/types/components/progress/index.d.ts +12 -0
- package/dist/types/components/progress/index.d.ts.map +1 -0
- package/dist/types/components/progress/progress.d.ts +36 -0
- package/dist/types/components/progress/progress.d.ts.map +1 -0
- package/dist/types/components/progress/types.d.ts +9 -0
- package/dist/types/components/progress/types.d.ts.map +1 -0
- package/dist/types/components/radioBox/index.d.ts +14 -0
- package/dist/types/components/radioBox/index.d.ts.map +1 -0
- package/dist/types/components/radioBox/radiobox-group.d.ts +31 -0
- package/dist/types/components/radioBox/radiobox-group.d.ts.map +1 -0
- package/dist/types/components/radioBox/radiobox.d.ts +38 -0
- package/dist/types/components/radioBox/radiobox.d.ts.map +1 -0
- package/dist/types/components/radioBox/types.d.ts +18 -0
- package/dist/types/components/radioBox/types.d.ts.map +1 -0
- package/dist/types/components/rater/index.d.ts +12 -0
- package/dist/types/components/rater/index.d.ts.map +1 -0
- package/dist/types/components/rater/raters.d.ts +83 -0
- package/dist/types/components/rater/raters.d.ts.map +1 -0
- package/dist/types/components/rater/types.d.ts +11 -0
- package/dist/types/components/rater/types.d.ts.map +1 -0
- package/dist/types/components/slideBar/index.d.ts +12 -0
- package/dist/types/components/slideBar/index.d.ts.map +1 -0
- package/dist/types/components/slideBar/slideBar.d.ts +46 -0
- package/dist/types/components/slideBar/slideBar.d.ts.map +1 -0
- package/dist/types/components/slideBar/types.d.ts +19 -0
- package/dist/types/components/slideBar/types.d.ts.map +1 -0
- package/dist/types/components/spinner/index.d.ts +12 -0
- package/dist/types/components/spinner/index.d.ts.map +1 -0
- package/dist/types/components/spinner/spinner.d.ts +36 -0
- package/dist/types/components/spinner/spinner.d.ts.map +1 -0
- package/dist/types/components/spinner/types.d.ts +7 -0
- package/dist/types/components/spinner/types.d.ts.map +1 -0
- package/dist/types/components/swipe/index.d.ts +12 -0
- package/dist/types/components/swipe/index.d.ts.map +1 -0
- package/dist/types/components/swipe/swipe.d.ts +99 -0
- package/dist/types/components/swipe/swipe.d.ts.map +1 -0
- package/dist/types/components/swipe/types.d.ts +20 -0
- package/dist/types/components/swipe/types.d.ts.map +1 -0
- package/dist/types/components/switchbar/index.d.ts +12 -0
- package/dist/types/components/switchbar/index.d.ts.map +1 -0
- package/dist/types/components/switchbar/switchbar.d.ts +38 -0
- package/dist/types/components/switchbar/switchbar.d.ts.map +1 -0
- package/dist/types/components/switchbar/types.d.ts +6 -0
- package/dist/types/components/switchbar/types.d.ts.map +1 -0
- package/dist/types/components/tab/index.d.ts +12 -0
- package/dist/types/components/tab/index.d.ts.map +1 -0
- package/dist/types/components/tab/tab.d.ts +54 -0
- package/dist/types/components/tab/tab.d.ts.map +1 -0
- package/dist/types/components/tab/types.d.ts +14 -0
- package/dist/types/components/tab/types.d.ts.map +1 -0
- package/dist/types/components/toTop/index.d.ts +12 -0
- package/dist/types/components/toTop/index.d.ts.map +1 -0
- package/dist/types/components/toTop/toTop.d.ts +18 -0
- package/dist/types/components/toTop/toTop.d.ts.map +1 -0
- package/dist/types/components/toTop/types.d.ts +7 -0
- package/dist/types/components/toTop/types.d.ts.map +1 -0
- package/dist/types/components/upload/index.d.ts +12 -0
- package/dist/types/components/upload/index.d.ts.map +1 -0
- package/dist/types/components/upload/types.d.ts +9 -0
- package/dist/types/components/upload/types.d.ts.map +1 -0
- package/dist/types/components/upload/upload.d.ts +19 -0
- package/dist/types/components/upload/upload.d.ts.map +1 -0
- package/dist/types/index.d.ts +164 -0
- package/dist/types/lib/MegaPixImage.d.ts +9 -0
- package/dist/types/lib/MegaPixImage.d.ts.map +1 -0
- package/dist/types/lib/lib.d.ts +3 -0
- package/dist/types/lib/lib.d.ts.map +1 -0
- package/dist/types/utils/util.d.ts +31 -0
- package/dist/types/utils/util.d.ts.map +1 -0
- package/dist-prod/91.05c8ec5277a15f939b0f.js +3 -0
- package/dist-prod/{91.e2fdec39667928bf57b9.js.map → 91.05c8ec5277a15f939b0f.js.map} +1 -1
- package/dist-prod/actionsheet.0d67b6b08a62cf9360be.chunk.js +2 -0
- package/dist-prod/actionsheet.0d67b6b08a62cf9360be.chunk.js.map +1 -0
- package/dist-prod/badge.16ab5c05734fe1530701.chunk.js +2 -0
- package/dist-prod/badge.16ab5c05734fe1530701.chunk.js.map +1 -0
- package/dist-prod/button.39ac33aa7aaccc24b6a1.chunk.js +2 -0
- package/dist-prod/button.39ac33aa7aaccc24b6a1.chunk.js.map +1 -0
- package/dist-prod/card.16ed7eafe471bcc60ec6.chunk.js +2 -0
- package/dist-prod/card.16ed7eafe471bcc60ec6.chunk.js.map +1 -0
- package/dist-prod/cell.70ff74fba57e27df7f5a.chunk.js +2 -0
- package/dist-prod/cell.70ff74fba57e27df7f5a.chunk.js.map +1 -0
- package/dist-prod/cellswipe.f3ec62abd60729d8bc5a.chunk.js +2 -0
- package/dist-prod/cellswipe.f3ec62abd60729d8bc5a.chunk.js.map +1 -0
- package/dist-prod/checkbox.05c63a947ac98293c9f2.chunk.js +2 -0
- package/dist-prod/checkbox.05c63a947ac98293c9f2.chunk.js.map +1 -0
- package/dist-prod/guide.24f1968a568f20fbc84b.chunk.js +2 -0
- package/dist-prod/guide.24f1968a568f20fbc84b.chunk.js.map +1 -0
- package/dist-prod/header.eb10433dd892738ee95a.chunk.js +2 -0
- package/dist-prod/header.eb10433dd892738ee95a.chunk.js.map +1 -0
- package/dist-prod/index.html +1 -1
- package/dist-prod/indicator.0c09e3f238791cb478e0.chunk.js +2 -0
- package/dist-prod/indicator.0c09e3f238791cb478e0.chunk.js.map +1 -0
- package/dist-prod/loadmore.9bad88767cc43603f473.chunk.js +2 -0
- package/dist-prod/loadmore.9bad88767cc43603f473.chunk.js.map +1 -0
- package/dist-prod/main.662ad15361e7f3d20234.js +2 -0
- package/dist-prod/main.662ad15361e7f3d20234.js.map +1 -0
- package/dist-prod/message.de17fea3de4daa70bab4.chunk.js +2 -0
- package/dist-prod/message.de17fea3de4daa70bab4.chunk.js.map +1 -0
- package/dist-prod/modal.f9ec857acd9fbdf53f3b.chunk.js +2 -0
- package/dist-prod/modal.f9ec857acd9fbdf53f3b.chunk.js.map +1 -0
- package/dist-prod/picker.bca059ef59e3c42a401f.chunk.js +2 -0
- package/dist-prod/picker.bca059ef59e3c42a401f.chunk.js.map +1 -0
- package/dist-prod/popup.538422c7e188363a468d.chunk.js +2 -0
- package/dist-prod/popup.538422c7e188363a468d.chunk.js.map +1 -0
- package/dist-prod/progress.240de4b633002f573030.chunk.js +2 -0
- package/dist-prod/progress.240de4b633002f573030.chunk.js.map +1 -0
- package/dist-prod/prompt.dcda0b05ea02d59106b7.chunk.js +2 -0
- package/dist-prod/prompt.dcda0b05ea02d59106b7.chunk.js.map +1 -0
- package/dist-prod/radiobox.7c10f77aba5ae04b2e5c.chunk.js +2 -0
- package/dist-prod/radiobox.7c10f77aba5ae04b2e5c.chunk.js.map +1 -0
- package/dist-prod/rater.d46ae462c598c458e5a8.chunk.js +2 -0
- package/dist-prod/rater.d46ae462c598c458e5a8.chunk.js.map +1 -0
- package/dist-prod/slidebar.833e75b9eb0abef92453.chunk.js +2 -0
- package/dist-prod/slidebar.833e75b9eb0abef92453.chunk.js.map +1 -0
- package/dist-prod/spinner.6afb4f84cc29f0e2f8eb.chunk.js +2 -0
- package/dist-prod/spinner.6afb4f84cc29f0e2f8eb.chunk.js.map +1 -0
- package/dist-prod/swipe.3fe6ee6638765ec52d94.chunk.js +2 -0
- package/dist-prod/swipe.3fe6ee6638765ec52d94.chunk.js.map +1 -0
- package/dist-prod/switchbar.f24c76a03120f1bd961a.chunk.js +2 -0
- package/dist-prod/switchbar.f24c76a03120f1bd961a.chunk.js.map +1 -0
- package/dist-prod/tab.29f19483f699b7811259.chunk.js +2 -0
- package/dist-prod/tab.29f19483f699b7811259.chunk.js.map +1 -0
- package/dist-prod/text.a6e4251f772d23843e2b.chunk.js +2 -0
- package/dist-prod/text.a6e4251f772d23843e2b.chunk.js.map +1 -0
- package/dist-prod/totop.713c5ab7f7dbcffbf2a3.chunk.js +2 -0
- package/dist-prod/totop.713c5ab7f7dbcffbf2a3.chunk.js.map +1 -0
- package/dist-prod/upload.0638581e551ed9afaba2.chunk.js +2 -0
- package/dist-prod/upload.0638581e551ed9afaba2.chunk.js.map +1 -0
- package/package.json +12 -3
- package/src/components/Indicator/Indicator.tsx +67 -0
- package/src/components/Indicator/index.ts +111 -0
- package/src/components/Indicator/types.ts +15 -0
- package/src/components/Text/index.ts +14 -0
- package/src/components/Text/textBar.tsx +104 -0
- package/src/components/Text/types.ts +13 -0
- package/src/components/actionSheet/actionSheet.d.ts +16 -0
- package/src/components/actionSheet/actionSheet.tsx +86 -0
- package/src/components/{action-sheet/index.js → actionSheet/index.ts} +1 -0
- package/src/components/actionSheet/types.ts +10 -0
- package/src/components/badge/{badge.vue → badge.tsx} +31 -31
- package/src/components/badge/index.ts +12 -0
- package/src/components/badge/types.ts +8 -0
- package/src/components/button/{button.vue → button.tsx} +46 -52
- package/src/components/button/index.ts +13 -0
- package/src/components/button/types.ts +13 -0
- package/src/components/card/card.d.ts +16 -0
- package/src/components/card/card.tsx +38 -0
- package/src/components/card/index.ts +12 -0
- package/src/components/card/types.ts +3 -0
- package/src/components/cell/cell.tsx +89 -0
- package/src/components/cell/index.ts +12 -0
- package/src/components/cell/types.ts +8 -0
- package/src/components/cellSwipe/cellSwipe.tsx +188 -0
- package/src/components/cellSwipe/index.ts +13 -0
- package/src/components/cellSwipe/types.ts +17 -0
- package/src/components/checkBox/checkbox-group.tsx +75 -0
- package/src/components/checkBox/checkbox.tsx +107 -0
- package/src/components/checkBox/index.ts +29 -0
- package/src/components/checkBox/types.ts +32 -0
- package/src/components/header/header.tsx +119 -0
- package/src/components/header/index.ts +13 -0
- package/src/components/header/types.ts +7 -0
- package/src/components/loadMore/index.ts +14 -0
- package/src/components/loadMore/loadMore.tsx +265 -0
- package/src/components/loadMore/types.ts +26 -0
- package/src/components/message/confirm.ts +104 -0
- package/src/components/message/{index.js → index.ts} +20 -18
- package/src/components/message/message.tsx +100 -0
- package/src/components/message/messageGroup.tsx +59 -0
- package/src/components/message/types.ts +48 -0
- package/src/components/modal/{confirm.js → confirm.ts} +8 -7
- package/src/components/modal/index.ts +68 -0
- package/src/components/modal/modal.tsx +248 -0
- package/src/components/modal/types.ts +51 -0
- package/src/components/number/Number.tsx +143 -0
- package/src/components/number/index.ts +10 -0
- package/src/components/number/types.ts +13 -0
- package/src/components/picker/index.ts +12 -0
- package/src/components/picker/picker.tsx +112 -0
- package/src/components/picker/types.ts +17 -0
- package/src/components/popup/index.ts +12 -0
- package/src/components/popup/popup.d.ts +16 -0
- package/src/components/popup/popup.tsx +68 -0
- package/src/components/popup/types.ts +9 -0
- package/src/components/progress/index.ts +12 -0
- package/src/components/progress/progress.tsx +81 -0
- package/src/components/progress/types.ts +9 -0
- package/src/components/prompt/{confirm.js → confirm.ts} +27 -14
- package/src/components/prompt/index.ts +50 -0
- package/src/components/prompt/prompt.tsx +161 -0
- package/src/components/prompt/types.ts +45 -0
- package/src/components/radioBox/index.ts +34 -0
- package/src/components/radioBox/radiobox-group.tsx +66 -0
- package/src/components/radioBox/radiobox.tsx +115 -0
- package/src/components/radioBox/types.ts +24 -0
- package/src/components/rater/index.ts +12 -0
- package/src/components/rater/rater.d.ts +16 -0
- package/src/components/rater/raters.tsx +101 -0
- package/src/components/rater/types.ts +10 -0
- package/src/components/slideBar/index.ts +13 -0
- package/src/components/slideBar/slideBar.tsx +288 -0
- package/src/components/slideBar/types.ts +20 -0
- package/src/components/spinner/index.ts +13 -0
- package/src/components/spinner/spinner.tsx +85 -0
- package/src/components/spinner/types.ts +20 -0
- package/src/components/swipe/index.ts +13 -0
- package/src/components/swipe/swipe.tsx +292 -0
- package/src/components/swipe/types.ts +21 -0
- package/src/components/switchbar/index.ts +13 -0
- package/src/components/switchbar/switchbar.tsx +58 -0
- package/src/components/switchbar/types.ts +6 -0
- package/src/components/tab/index.ts +12 -0
- package/src/components/tab/tab.tsx +71 -0
- package/src/components/tab/types.ts +15 -0
- package/src/components/toTop/index.ts +13 -0
- package/src/components/toTop/toTop.tsx +54 -0
- package/src/components/toTop/types.ts +7 -0
- package/src/components/upload/index.ts +13 -0
- package/src/components/upload/types.ts +9 -0
- package/src/components/upload/upload.tsx +180 -0
- package/src/index.ts +173 -0
- package/src/lib/MegaPixImage.js +1 -0
- package/src/{main.js → main.ts} +4 -2
- package/src/shims-vue.d.ts +37 -0
- package/src/styles/components/radioBox.less +5 -1
- package/src/styles/components/rater.less +16 -0
- package/src/styles/index.less +1 -0
- package/src/types/index.d.ts +164 -0
- package/src/types/js-shims.d.ts +36 -0
- package/src/utils/test.ts +2 -0
- package/src/utils/util.ts +168 -0
- package/src/utils/{util.js → util1.js} +2 -2
- package/src/views/ActionSheet.vue +7 -7
- package/src/views/Badge/Badge.less +12 -0
- package/src/views/Badge/Badge.tsx +23 -0
- package/src/views/Badge.vue +4 -2
- package/src/views/Button.vue +17 -17
- package/src/views/Card.vue +2 -1
- package/src/views/Cell.vue +6 -5
- package/src/views/CellSwipe.vue +51 -39
- package/src/views/CheckBox.vue +7 -6
- package/src/views/Header.vue +8 -7
- package/src/views/Indicator.vue +15 -15
- package/src/views/LoadMore.vue +13 -10
- package/src/views/Message.vue +14 -14
- package/src/views/Modal.vue +10 -10
- package/src/views/Picker.vue +19 -17
- package/src/views/Popup.vue +47 -41
- package/src/views/Progress.vue +8 -6
- package/src/views/Prompt.vue +5 -5
- package/src/views/RadioBox.vue +6 -4
- package/src/views/Rater.vue +7 -3
- package/src/views/SlideBar.vue +9 -5
- package/src/views/Spinner.vue +17 -5
- package/src/views/Swipe.vue +5 -3
- package/src/views/SwitchBar.vue +6 -4
- package/src/views/Tab.vue +8 -6
- package/src/views/Text.vue +14 -10
- package/src/views/ToTop.vue +19 -5
- package/src/views/Upload.vue +8 -4
- package/tsconfig.build.json +30 -0
- package/tsconfig.json +39 -0
- package/webpack.base.config.js +22 -2
- package/webpack.dev.config.js +2 -1
- package/webpack.dist.dev.config.js +3 -2
- package/webpack.dist.prod.config.js +3 -2
- package/webpack.prod.config.js +2 -1
- package/dist-prod/91.e2fdec39667928bf57b9.js +0 -3
- package/dist-prod/actionsheet.e2f7c32d0120f5147a4f.chunk.js +0 -2
- package/dist-prod/actionsheet.e2f7c32d0120f5147a4f.chunk.js.map +0 -1
- package/dist-prod/badge.6038c4ccc54ffb56a645.chunk.js +0 -2
- package/dist-prod/badge.6038c4ccc54ffb56a645.chunk.js.map +0 -1
- package/dist-prod/button.28b491339fbba29c3f16.chunk.js +0 -2
- package/dist-prod/button.28b491339fbba29c3f16.chunk.js.map +0 -1
- package/dist-prod/card.3ad847f07bebc1391125.chunk.js +0 -2
- package/dist-prod/card.3ad847f07bebc1391125.chunk.js.map +0 -1
- package/dist-prod/cell.8920796a9ebd2d84bbd3.chunk.js +0 -2
- package/dist-prod/cell.8920796a9ebd2d84bbd3.chunk.js.map +0 -1
- package/dist-prod/cellswipe.04240414bed39e28e7b9.chunk.js +0 -2
- package/dist-prod/cellswipe.04240414bed39e28e7b9.chunk.js.map +0 -1
- package/dist-prod/checkbox.87403976981ee0f64f4a.chunk.js +0 -2
- package/dist-prod/checkbox.87403976981ee0f64f4a.chunk.js.map +0 -1
- package/dist-prod/guide.5195c74796a7a0e37f7b.chunk.js +0 -2
- package/dist-prod/guide.5195c74796a7a0e37f7b.chunk.js.map +0 -1
- package/dist-prod/header.e3cecc6d60f801c1c105.chunk.js +0 -2
- package/dist-prod/header.e3cecc6d60f801c1c105.chunk.js.map +0 -1
- package/dist-prod/indicator.6b0c7a91ca254c3586e8.chunk.js +0 -2
- package/dist-prod/indicator.6b0c7a91ca254c3586e8.chunk.js.map +0 -1
- package/dist-prod/loadmore.ba86c35311fc68ee215b.chunk.js +0 -2
- package/dist-prod/loadmore.ba86c35311fc68ee215b.chunk.js.map +0 -1
- package/dist-prod/main.717f5c8b51911571fb82.js +0 -2
- package/dist-prod/main.717f5c8b51911571fb82.js.map +0 -1
- package/dist-prod/message.e57fa263a214006f7191.chunk.js +0 -2
- package/dist-prod/message.e57fa263a214006f7191.chunk.js.map +0 -1
- package/dist-prod/modal.1172c8ba7d90503fc8e8.chunk.js +0 -2
- package/dist-prod/modal.1172c8ba7d90503fc8e8.chunk.js.map +0 -1
- package/dist-prod/picker.4ff114161c5c3f8df57a.chunk.js +0 -2
- package/dist-prod/picker.4ff114161c5c3f8df57a.chunk.js.map +0 -1
- package/dist-prod/popup.8f92c027932e4d47fa59.chunk.js +0 -2
- package/dist-prod/popup.8f92c027932e4d47fa59.chunk.js.map +0 -1
- package/dist-prod/progress.1e0d785044aecadc5615.chunk.js +0 -2
- package/dist-prod/progress.1e0d785044aecadc5615.chunk.js.map +0 -1
- package/dist-prod/prompt.c2b442c3dd0e6d8319bc.chunk.js +0 -2
- package/dist-prod/prompt.c2b442c3dd0e6d8319bc.chunk.js.map +0 -1
- package/dist-prod/radiobox.479703c69b75d473e85d.chunk.js +0 -2
- package/dist-prod/radiobox.479703c69b75d473e85d.chunk.js.map +0 -1
- package/dist-prod/rater.939e0e7e770728f684c3.chunk.js +0 -2
- package/dist-prod/rater.939e0e7e770728f684c3.chunk.js.map +0 -1
- package/dist-prod/slidebar.d7ad5de495550613661f.chunk.js +0 -2
- package/dist-prod/slidebar.d7ad5de495550613661f.chunk.js.map +0 -1
- package/dist-prod/spinner.f20e3bd8cec27d26afe0.chunk.js +0 -2
- package/dist-prod/spinner.f20e3bd8cec27d26afe0.chunk.js.map +0 -1
- package/dist-prod/swipe.75b7d741be73c0064982.chunk.js +0 -2
- package/dist-prod/swipe.75b7d741be73c0064982.chunk.js.map +0 -1
- package/dist-prod/switchbar.56d03d96c275ff4c65a1.chunk.js +0 -2
- package/dist-prod/switchbar.56d03d96c275ff4c65a1.chunk.js.map +0 -1
- package/dist-prod/tab.4c391211c41b7d12b585.chunk.js +0 -2
- package/dist-prod/tab.4c391211c41b7d12b585.chunk.js.map +0 -1
- package/dist-prod/text.ee2804ba87e6a460aa7d.chunk.js +0 -2
- package/dist-prod/text.ee2804ba87e6a460aa7d.chunk.js.map +0 -1
- package/dist-prod/totop.c6f9dce152bb6abe5cb2.chunk.js +0 -2
- package/dist-prod/totop.c6f9dce152bb6abe5cb2.chunk.js.map +0 -1
- package/dist-prod/upload.a9b44c8a72fe70980a1e.chunk.js +0 -2
- package/dist-prod/upload.a9b44c8a72fe70980a1e.chunk.js.map +0 -1
- package/src/components/Indicator/index.js +0 -86
- package/src/components/Text/Number.vue +0 -167
- package/src/components/Text/index.js +0 -7
- package/src/components/Text/textBar.vue +0 -122
- package/src/components/action-sheet/actionSheet.vue +0 -98
- package/src/components/badge/index.js +0 -5
- package/src/components/button/index.js +0 -5
- package/src/components/card/card.vue +0 -49
- package/src/components/card/index.js +0 -5
- package/src/components/cell/cell.vue +0 -113
- package/src/components/cell/index.js +0 -5
- package/src/components/cell-swipe/cell-swipe.vue +0 -168
- package/src/components/cell-swipe/index.js +0 -5
- package/src/components/checkBox/checkbox-group.vue +0 -74
- package/src/components/checkBox/checkbox.vue +0 -117
- package/src/components/checkBox/index.js +0 -8
- package/src/components/header/header.vue +0 -131
- package/src/components/header/index.js +0 -5
- package/src/components/loadMore/index.js +0 -5
- package/src/components/loadMore/loadmore.vue +0 -258
- package/src/components/message/confirm.js +0 -60
- package/src/components/message/message.vue +0 -137
- package/src/components/message/messageGroup.vue +0 -82
- package/src/components/modal/index.js +0 -52
- package/src/components/modal/modal.vue +0 -138
- package/src/components/picker/index.js +0 -5
- package/src/components/picker/picker.vue +0 -111
- package/src/components/popup/index.js +0 -5
- package/src/components/popup/popup.vue +0 -91
- package/src/components/progress/index.js +0 -5
- package/src/components/progress/progress.vue +0 -86
- package/src/components/prompt/index.js +0 -53
- package/src/components/prompt/prompt.vue +0 -125
- package/src/components/radioBox/index.js +0 -8
- package/src/components/rater/index.js +0 -5
- package/src/components/rater/rater.vue +0 -118
- package/src/components/slideBar/index.js +0 -6
- package/src/components/slideBar/slideBar.vue +0 -225
- package/src/components/spinner/index.js +0 -5
- package/src/components/spinner/spinner.vue +0 -78
- package/src/components/swipe/index.js +0 -5
- package/src/components/swipe/swipe.vue +0 -289
- package/src/components/switchbar/index.js +0 -5
- package/src/components/switchbar/switchbar.vue +0 -79
- package/src/components/tab/index.js +0 -6
- package/src/components/tab/tab.vue +0 -89
- package/src/components/toTop/index.js +0 -5
- package/src/components/toTop/topTop.vue +0 -78
- package/src/components/upload/index.js +0 -5
- package/src/components/upload/upload.vue +0 -166
- package/src/index.js +0 -149
- /package/dist-prod/{91.e2fdec39667928bf57b9.js.LICENSE.txt → 91.05c8ec5277a15f939b0f.js.LICENSE.txt} +0 -0
- /package/src/components/radioBox/{radiobox-group.vue → radiobox-group1.vue} +0 -0
- /package/src/components/radioBox/{radiobox.vue → radiobox1.vue} +0 -0
- /package/src/{router.js → router.ts} +0 -0
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
// src/components/checkbox/Checkbox.tsx
|
|
2
|
+
import {
|
|
3
|
+
defineComponent,
|
|
4
|
+
ref,
|
|
5
|
+
computed,
|
|
6
|
+
inject,
|
|
7
|
+
watch,
|
|
8
|
+
onMounted,
|
|
9
|
+
PropType
|
|
10
|
+
} from 'vue'
|
|
11
|
+
import type { CheckBoxProps, CheckBoxGroupInject, CheckBoxLabel } from './types'
|
|
12
|
+
export type { CheckBoxProps }
|
|
13
|
+
|
|
14
|
+
const prefixCls = 'dpzvc3-checkbox'
|
|
15
|
+
|
|
16
|
+
export default defineComponent({
|
|
17
|
+
name: 'DpzVcCheckBox',
|
|
18
|
+
|
|
19
|
+
props: {
|
|
20
|
+
disable: { type: Boolean, default: false },
|
|
21
|
+
modelValue: { type: Boolean, default: false },
|
|
22
|
+
label: { type: [String, Number, Boolean] as PropType<CheckBoxLabel> }
|
|
23
|
+
},
|
|
24
|
+
|
|
25
|
+
emits: ['update:modelValue', 'on-change'],
|
|
26
|
+
|
|
27
|
+
setup(props, { emit, slots }) {
|
|
28
|
+
/** 注入 checkboxGroup(由 CheckBoxGroup provide) */
|
|
29
|
+
const checkboxGroup = inject<CheckBoxGroupInject | null>('CheckBoxGroup', null)
|
|
30
|
+
const isGroup = ref(!!checkboxGroup)
|
|
31
|
+
|
|
32
|
+
const currentValue = ref<boolean>(props.modelValue)
|
|
33
|
+
const show = ref(true)
|
|
34
|
+
const slotRef = ref<HTMLElement | null>(null)
|
|
35
|
+
|
|
36
|
+
/** classes */
|
|
37
|
+
const classes = computed(() => [prefixCls])
|
|
38
|
+
const wrapperClasses = computed(() => [
|
|
39
|
+
`${prefixCls}-wrapper`,
|
|
40
|
+
{
|
|
41
|
+
[`${prefixCls}-checked`]: currentValue.value,
|
|
42
|
+
[`${prefixCls}-disable`]: props.disable
|
|
43
|
+
}
|
|
44
|
+
])
|
|
45
|
+
const innerClasses = computed(() => [`${prefixCls}-inner`])
|
|
46
|
+
|
|
47
|
+
/** watch 外部 modelValue 同步 */
|
|
48
|
+
watch(
|
|
49
|
+
() => props.modelValue,
|
|
50
|
+
val => {
|
|
51
|
+
currentValue.value = val
|
|
52
|
+
}
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
/** change 处理 */
|
|
56
|
+
const change = (e: Event) => {
|
|
57
|
+
if (props.disable) return
|
|
58
|
+
|
|
59
|
+
const target = e.target as HTMLInputElement
|
|
60
|
+
const checked = target.checked
|
|
61
|
+
currentValue.value = checked
|
|
62
|
+
|
|
63
|
+
if (isGroup.value && checkboxGroup) {
|
|
64
|
+
const value = [...checkboxGroup.currentValue.value]
|
|
65
|
+
const index = value.indexOf(props.label as any)
|
|
66
|
+
if (checked && index === -1) value.push(props.label as any)
|
|
67
|
+
if (!checked && index > -1) value.splice(index, 1)
|
|
68
|
+
checkboxGroup.toggleOption(value)
|
|
69
|
+
} else {
|
|
70
|
+
emit('update:modelValue', checked)
|
|
71
|
+
emit('on-change', checked)
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
onMounted(() => {
|
|
76
|
+
if (isGroup.value && checkboxGroup) {
|
|
77
|
+
const value = [...checkboxGroup.currentValue.value]
|
|
78
|
+
const index = value.indexOf(props.label as any)
|
|
79
|
+
if (index !== -1) currentValue.value = true
|
|
80
|
+
}
|
|
81
|
+
if (slotRef.value && !slotRef.value.innerHTML) {
|
|
82
|
+
show.value = false
|
|
83
|
+
}
|
|
84
|
+
})
|
|
85
|
+
|
|
86
|
+
return () => (
|
|
87
|
+
<label class={classes.value}>
|
|
88
|
+
<span class={wrapperClasses.value}>
|
|
89
|
+
<span class={innerClasses.value} />
|
|
90
|
+
<input
|
|
91
|
+
type="checkbox"
|
|
92
|
+
class={`${prefixCls}-input noselect`}
|
|
93
|
+
disabled={props.disable}
|
|
94
|
+
checked={currentValue.value}
|
|
95
|
+
onChange={change}
|
|
96
|
+
/>
|
|
97
|
+
</span>
|
|
98
|
+
|
|
99
|
+
{show.value && (
|
|
100
|
+
<span ref={slotRef}>
|
|
101
|
+
{slots.default?.() ?? props.label}
|
|
102
|
+
</span>
|
|
103
|
+
)}
|
|
104
|
+
</label>
|
|
105
|
+
)
|
|
106
|
+
}
|
|
107
|
+
})
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
|
|
3
|
+
*/
|
|
4
|
+
// CheckBox.group = CheckGroup
|
|
5
|
+
// export default CheckBox
|
|
6
|
+
import type { App } from 'vue'
|
|
7
|
+
import CheckBox from './checkbox'
|
|
8
|
+
import CheckBoxGroup from './checkbox-group'
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
CheckBox.install = (app: App): void => {
|
|
13
|
+
app.component('CheckBox', CheckBox); // 注册全局组件
|
|
14
|
+
}
|
|
15
|
+
type IWithInstall<T> = T & { install(app: App): void };
|
|
16
|
+
const _CheckBox = CheckBox as IWithInstall<typeof CheckBox>;
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
CheckBoxGroup.install = (app: App): void => {
|
|
21
|
+
app.component('CheckBoxGroup', CheckBoxGroup); // 注册全局组件
|
|
22
|
+
}
|
|
23
|
+
const _CheckBoxGroup = CheckBoxGroup as IWithInstall<typeof CheckBoxGroup>;
|
|
24
|
+
|
|
25
|
+
export {
|
|
26
|
+
_CheckBox as CheckBox,
|
|
27
|
+
_CheckBoxGroup as CheckBoxGroup
|
|
28
|
+
}
|
|
29
|
+
export type { CheckBoxProps, CheckBoxGroupProps } from './types'
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// src/components/checkbox-group/types.ts
|
|
2
|
+
|
|
3
|
+
// import checkboxGroup from "./checkbox-group"
|
|
4
|
+
// checkbox.types.ts
|
|
5
|
+
import type { Ref } from 'vue'
|
|
6
|
+
|
|
7
|
+
export type CheckBoxLabel = string | number | boolean
|
|
8
|
+
|
|
9
|
+
export interface CheckBoxProps {
|
|
10
|
+
modelValue?: boolean
|
|
11
|
+
label?: CheckBoxLabel
|
|
12
|
+
disable?: boolean
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface CheckBoxGroupInject {
|
|
16
|
+
currentValue: Ref<Array<string | number>>
|
|
17
|
+
toggleOption: (value: Array<string | number>) => void
|
|
18
|
+
single?: boolean
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// checkboxGroup.types.ts
|
|
22
|
+
export type CheckBoxGroupValue = Array<string | number>
|
|
23
|
+
|
|
24
|
+
export interface CheckBoxGroupProps {
|
|
25
|
+
modelValue?: CheckBoxGroupValue
|
|
26
|
+
single?: boolean
|
|
27
|
+
vertical?: boolean
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface CheckBoxGroupExpose {
|
|
31
|
+
toggleOption: (value: CheckBoxGroupValue) => void
|
|
32
|
+
}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
// src/components/header/header.tsx
|
|
2
|
+
import {
|
|
3
|
+
defineComponent,
|
|
4
|
+
ref,
|
|
5
|
+
computed,
|
|
6
|
+
onMounted,
|
|
7
|
+
watch,
|
|
8
|
+
PropType
|
|
9
|
+
} from 'vue'
|
|
10
|
+
|
|
11
|
+
import type { HeaderProps } from './types'
|
|
12
|
+
export type { HeaderProps }
|
|
13
|
+
|
|
14
|
+
const prefixCls = 'dpzvc3-header'
|
|
15
|
+
|
|
16
|
+
export default defineComponent({
|
|
17
|
+
name: 'Dpzvc3Header',
|
|
18
|
+
|
|
19
|
+
props: {
|
|
20
|
+
modelValue: {
|
|
21
|
+
type: Boolean as PropType<boolean>,
|
|
22
|
+
default: true
|
|
23
|
+
},
|
|
24
|
+
fixed: {
|
|
25
|
+
type: Boolean as PropType<boolean>,
|
|
26
|
+
default: true
|
|
27
|
+
},
|
|
28
|
+
title: {
|
|
29
|
+
type: String as PropType<string>,
|
|
30
|
+
default: ''
|
|
31
|
+
},
|
|
32
|
+
wechat: {
|
|
33
|
+
type: Boolean as PropType<boolean>,
|
|
34
|
+
default: false
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
|
|
38
|
+
emits: ['update:modelValue'],
|
|
39
|
+
|
|
40
|
+
setup(props, { emit, slots }) {
|
|
41
|
+
const visible = ref<boolean>(props.modelValue)
|
|
42
|
+
const isWechat = ref<boolean>(props.wechat)
|
|
43
|
+
|
|
44
|
+
/** class 计算 */
|
|
45
|
+
const classes = computed(() => [
|
|
46
|
+
prefixCls,
|
|
47
|
+
props.fixed && `${prefixCls}-fixed`
|
|
48
|
+
])
|
|
49
|
+
|
|
50
|
+
/** UA 判断 */
|
|
51
|
+
const isWeixin = computed(() =>
|
|
52
|
+
/micromessenger/i.test(window.navigator.userAgent)
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
const isPcWeixin = computed(() =>
|
|
56
|
+
/windowswechat/i.test(window.navigator.userAgent)
|
|
57
|
+
)
|
|
58
|
+
|
|
59
|
+
/** v-model 同步 */
|
|
60
|
+
watch(
|
|
61
|
+
() => props.modelValue,
|
|
62
|
+
val => {
|
|
63
|
+
visible.value = val
|
|
64
|
+
}
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
watch(
|
|
68
|
+
() => props.wechat,
|
|
69
|
+
val => {
|
|
70
|
+
isWechat.value = val
|
|
71
|
+
}
|
|
72
|
+
)
|
|
73
|
+
|
|
74
|
+
/** mounted 逻辑 */
|
|
75
|
+
onMounted(() => {
|
|
76
|
+
if ((isWeixin.value || isPcWeixin.value) && !isWechat.value) {
|
|
77
|
+
emit('update:modelValue', false)
|
|
78
|
+
}
|
|
79
|
+
})
|
|
80
|
+
|
|
81
|
+
/** 返回 */
|
|
82
|
+
const back = () => {
|
|
83
|
+
window.history.back()
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/** JSX render */
|
|
87
|
+
return () =>
|
|
88
|
+
visible.value ? (
|
|
89
|
+
<div class={classes.value}>
|
|
90
|
+
<header>
|
|
91
|
+
{/* left */}
|
|
92
|
+
<div class="left" onClick={back}>
|
|
93
|
+
{slots.left ? (
|
|
94
|
+
slots.left()
|
|
95
|
+
) : (
|
|
96
|
+
<>
|
|
97
|
+
<span class="arrow" />
|
|
98
|
+
<span class="text">返回</span>
|
|
99
|
+
</>
|
|
100
|
+
)}
|
|
101
|
+
</div>
|
|
102
|
+
|
|
103
|
+
{/* title */}
|
|
104
|
+
<div class="title dpzvc3-nowrap">
|
|
105
|
+
{props.title}
|
|
106
|
+
</div>
|
|
107
|
+
|
|
108
|
+
{/* right */}
|
|
109
|
+
<div class="right">
|
|
110
|
+
{slots.right ? slots.right() : <div />}
|
|
111
|
+
</div>
|
|
112
|
+
</header>
|
|
113
|
+
|
|
114
|
+
{/* 占位 */}
|
|
115
|
+
{props.fixed && <div class="header-place" />}
|
|
116
|
+
</div>
|
|
117
|
+
) : null
|
|
118
|
+
}
|
|
119
|
+
})
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Created by admin on 2025/5/4.
|
|
3
|
+
*/
|
|
4
|
+
import type { App } from 'vue'
|
|
5
|
+
import DpHeader from './header'
|
|
6
|
+
DpHeader.install = (app: App): void => {
|
|
7
|
+
app.component('DpHeader', DpHeader); // 注册全局组件
|
|
8
|
+
}
|
|
9
|
+
type IWithInstall<T> = T & { install(app: App): void };
|
|
10
|
+
const _DpzHeader=DpHeader as IWithInstall<typeof DpHeader>;
|
|
11
|
+
export default _DpzHeader
|
|
12
|
+
export type { HeaderProps } from './types'
|
|
13
|
+
// export default DpHeader
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Created by admin on 2025/6/19.
|
|
3
|
+
*/
|
|
4
|
+
import type { App } from 'vue'
|
|
5
|
+
import DpLoadMore from './loadMore'
|
|
6
|
+
// export default LoadMore
|
|
7
|
+
DpLoadMore.install = (app: App): void => {
|
|
8
|
+
app.component('DpLoadMore', DpLoadMore); // 注册全局组件
|
|
9
|
+
}
|
|
10
|
+
type IWithInstall<T> = T & { install(app: App): void };
|
|
11
|
+
const _DpLoadMore=DpLoadMore as IWithInstall<typeof DpLoadMore>;
|
|
12
|
+
export default _DpLoadMore
|
|
13
|
+
// export default LoadMore
|
|
14
|
+
export type { LoadmoreProps } from './types'
|
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
// src/components/Loadmore/Loadmore.tsx
|
|
2
|
+
import {
|
|
3
|
+
defineComponent,
|
|
4
|
+
ref,
|
|
5
|
+
computed,
|
|
6
|
+
watch,
|
|
7
|
+
onMounted,
|
|
8
|
+
onBeforeUnmount
|
|
9
|
+
} from 'vue'
|
|
10
|
+
import type { PropType, CSSProperties } from 'vue'
|
|
11
|
+
import Spinner from '../spinner'
|
|
12
|
+
import type { LoadmoreProps } from './types'
|
|
13
|
+
|
|
14
|
+
const prefixCls = 'dpzvc3-loadmore'
|
|
15
|
+
|
|
16
|
+
export default defineComponent({
|
|
17
|
+
name: 'Dpzvc3Loadmore',
|
|
18
|
+
|
|
19
|
+
props: {
|
|
20
|
+
height: {
|
|
21
|
+
type: [Number, String] as PropType<number | string>,
|
|
22
|
+
default: '100%'
|
|
23
|
+
},
|
|
24
|
+
refresh: Function as PropType<LoadmoreProps['refresh']>,
|
|
25
|
+
upLoadingText: { type: String, default: '加载中...' },
|
|
26
|
+
upDistance: { type: Number, default: 70 },
|
|
27
|
+
upPullText: { type: String, default: '↓ 下拉刷新' },
|
|
28
|
+
upDropText: { type: String, default: '↑ 释放更新' },
|
|
29
|
+
maxDistance: { type: Number, default: 0 },
|
|
30
|
+
speed: { type: Number, default: 3 },
|
|
31
|
+
|
|
32
|
+
downEndText: { type: String, default: '没有更多了' },
|
|
33
|
+
downDropText: { type: String, default: '↑ 上拉加载数据' },
|
|
34
|
+
downLoadingText: { type: String, default: '加载中...' },
|
|
35
|
+
downDistance: { type: Number, default: 50 },
|
|
36
|
+
loadMore: Function as PropType<LoadmoreProps['loadMore']>,
|
|
37
|
+
hasMore: { type: Boolean, default: true },
|
|
38
|
+
|
|
39
|
+
styles: {
|
|
40
|
+
type: Object as PropType<CSSProperties>,
|
|
41
|
+
default: () => ({})
|
|
42
|
+
},
|
|
43
|
+
auto: { type: Boolean, default: true },
|
|
44
|
+
autoFill: { type: Boolean, default: true }
|
|
45
|
+
},
|
|
46
|
+
|
|
47
|
+
emits: ['on-change-up-status', 'on-change-down-status'],
|
|
48
|
+
|
|
49
|
+
setup(props, { slots, emit, expose }) {
|
|
50
|
+
const containerRef = ref<HTMLDivElement | null>(null)
|
|
51
|
+
|
|
52
|
+
/** 状态 */
|
|
53
|
+
const translateY = ref(0)
|
|
54
|
+
const startTranslateY = ref(0)
|
|
55
|
+
const currentY = ref(0)
|
|
56
|
+
const startY = ref(0)
|
|
57
|
+
const upStatus = ref('')
|
|
58
|
+
const downStatus = ref('')
|
|
59
|
+
const direction = ref('')
|
|
60
|
+
const upText = ref('')
|
|
61
|
+
const downText = ref('')
|
|
62
|
+
const down = ref(false)
|
|
63
|
+
const drag = ref(false)
|
|
64
|
+
const more = ref(props.hasMore)
|
|
65
|
+
|
|
66
|
+
/** classes */
|
|
67
|
+
const containerClasses = computed(() => [prefixCls])
|
|
68
|
+
const topClasses = computed(() => [
|
|
69
|
+
`${prefixCls}-top`,
|
|
70
|
+
{ [`${prefixCls}-drag`]: !drag.value }
|
|
71
|
+
])
|
|
72
|
+
const bottomClasses = computed(() => [`${prefixCls}-bottom`])
|
|
73
|
+
const contentClasses = computed(() => [`${prefixCls}-content`])
|
|
74
|
+
const statusClass = computed(() => [`${prefixCls}-status`])
|
|
75
|
+
|
|
76
|
+
/** watch */
|
|
77
|
+
watch(upStatus, val => {
|
|
78
|
+
switch (val) {
|
|
79
|
+
case 'pull': upText.value = props.upPullText; break
|
|
80
|
+
case 'drop': upText.value = props.upDropText; break
|
|
81
|
+
case 'loading': upText.value = props.upLoadingText; break
|
|
82
|
+
}
|
|
83
|
+
emit('on-change-up-status', val)
|
|
84
|
+
})
|
|
85
|
+
|
|
86
|
+
watch(downStatus, val => {
|
|
87
|
+
switch (val) {
|
|
88
|
+
case 'end': downText.value = props.downEndText; break
|
|
89
|
+
case 'drop': downText.value = props.downDropText; break
|
|
90
|
+
case 'loading': downText.value = props.downLoadingText; break
|
|
91
|
+
default: downText.value = ''; break
|
|
92
|
+
}
|
|
93
|
+
emit('on-change-down-status', val)
|
|
94
|
+
})
|
|
95
|
+
|
|
96
|
+
watch(() => props.hasMore, val => {
|
|
97
|
+
more.value = val
|
|
98
|
+
if (!val) downStatus.value = 'end'
|
|
99
|
+
})
|
|
100
|
+
|
|
101
|
+
/** utils */
|
|
102
|
+
const isBottom = () => {
|
|
103
|
+
const el = containerRef.value
|
|
104
|
+
return !!el && el.scrollHeight <= el.offsetHeight
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
const onLoadOff = () => {
|
|
108
|
+
translateY.value = 0
|
|
109
|
+
upStatus.value = ''
|
|
110
|
+
downStatus.value = ''
|
|
111
|
+
if (!more.value) downStatus.value = 'end'
|
|
112
|
+
|
|
113
|
+
setTimeout(() => {
|
|
114
|
+
if (more.value && isBottom()) {
|
|
115
|
+
direction.value = 'up'
|
|
116
|
+
downStatus.value = 'loading'
|
|
117
|
+
props.loadMore?.()
|
|
118
|
+
}
|
|
119
|
+
}, 1000)
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/** scroll */
|
|
123
|
+
const onScroll = (e: Event) => {
|
|
124
|
+
e.preventDefault()
|
|
125
|
+
if (downStatus.value === 'loading') return
|
|
126
|
+
|
|
127
|
+
const el = containerRef.value
|
|
128
|
+
if (!el || !props.loadMore) return
|
|
129
|
+
|
|
130
|
+
const scrollTop = el.scrollTop
|
|
131
|
+
const absY = el.scrollHeight - (el.offsetHeight + scrollTop)
|
|
132
|
+
|
|
133
|
+
if (absY > props.downDistance && downStatus.value === 'drop') {
|
|
134
|
+
downStatus.value = ''
|
|
135
|
+
} else if (absY <= props.downDistance) {
|
|
136
|
+
downStatus.value = 'loading'
|
|
137
|
+
// props.loadMore()
|
|
138
|
+
if (more.value) props.loadMore()
|
|
139
|
+
else setTimeout(onLoadOff, 1000)
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/** touch */
|
|
144
|
+
const onTouchStart = (e: TouchEvent) => {
|
|
145
|
+
if (upStatus.value === 'loading') return
|
|
146
|
+
startY.value = e.touches[0].clientY
|
|
147
|
+
startTranslateY.value = translateY.value
|
|
148
|
+
down.value = false
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
const onTouchMove = (e: TouchEvent) => {
|
|
152
|
+
const el = containerRef.value
|
|
153
|
+
if (!el || upStatus.value === 'loading') return
|
|
154
|
+
|
|
155
|
+
currentY.value = e.touches[0].clientY
|
|
156
|
+
const distance = (currentY.value - startY.value) / props.speed
|
|
157
|
+
const scrollTop = el.scrollTop
|
|
158
|
+
direction.value = distance > 0 ? 'down' : 'up'
|
|
159
|
+
|
|
160
|
+
if (
|
|
161
|
+
currentY.value >= startY.value &&
|
|
162
|
+
props.refresh &&
|
|
163
|
+
scrollTop === 0 &&
|
|
164
|
+
direction.value === 'down'
|
|
165
|
+
) {
|
|
166
|
+
e.preventDefault()
|
|
167
|
+
translateY.value = props.maxDistance > 0
|
|
168
|
+
? Math.min(distance - scrollTop, props.maxDistance)
|
|
169
|
+
: distance - scrollTop
|
|
170
|
+
|
|
171
|
+
if (translateY.value < 0) translateY.value = 0
|
|
172
|
+
upStatus.value = translateY.value >= props.upDistance ? 'drop' : 'pull'
|
|
173
|
+
drag.value = true
|
|
174
|
+
down.value = down.value || isBottom()
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
const onTouchEnd = () => {
|
|
179
|
+
const el = containerRef.value
|
|
180
|
+
if (!el || upStatus.value === 'loading') return
|
|
181
|
+
|
|
182
|
+
if (direction.value === 'down' && el.scrollTop <= 0) {
|
|
183
|
+
if (upStatus.value === 'drop') {
|
|
184
|
+
translateY.value = 40
|
|
185
|
+
upStatus.value = 'loading'
|
|
186
|
+
props.refresh?.()
|
|
187
|
+
} else {
|
|
188
|
+
translateY.value = 0
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
direction.value = ''
|
|
192
|
+
drag.value = false
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
onMounted(() => {
|
|
196
|
+
if (props.auto && props.refresh) {
|
|
197
|
+
translateY.value = 40
|
|
198
|
+
upStatus.value = 'loading'
|
|
199
|
+
props.refresh()
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
const el = containerRef.value
|
|
203
|
+
el?.addEventListener('touchstart', onTouchStart)
|
|
204
|
+
el?.addEventListener('touchmove', onTouchMove)
|
|
205
|
+
el?.addEventListener('touchend', onTouchEnd)
|
|
206
|
+
})
|
|
207
|
+
|
|
208
|
+
onBeforeUnmount(() => {
|
|
209
|
+
const el = containerRef.value
|
|
210
|
+
el?.removeEventListener('touchstart', onTouchStart)
|
|
211
|
+
el?.removeEventListener('touchmove', onTouchMove)
|
|
212
|
+
el?.removeEventListener('touchend', onTouchEnd)
|
|
213
|
+
})
|
|
214
|
+
expose({ onLoadOff })
|
|
215
|
+
return () => (
|
|
216
|
+
<div
|
|
217
|
+
ref={containerRef}
|
|
218
|
+
class={containerClasses.value}
|
|
219
|
+
style={{ height: props.height, ...props.styles }}
|
|
220
|
+
onScroll={onScroll}
|
|
221
|
+
>
|
|
222
|
+
{props.refresh && (
|
|
223
|
+
<div
|
|
224
|
+
class={topClasses.value}
|
|
225
|
+
style={{ height: `${translateY.value}px` }}
|
|
226
|
+
>
|
|
227
|
+
<div class={statusClass.value}>
|
|
228
|
+
{slots.top?.() ?? (
|
|
229
|
+
<>
|
|
230
|
+
<span class="spinner">
|
|
231
|
+
{upStatus.value === 'loading' && (
|
|
232
|
+
<Spinner size="15" type="snake" />
|
|
233
|
+
)}
|
|
234
|
+
</span>
|
|
235
|
+
<span class="dpzvc3-loadmore-text">{upText.value}</span>
|
|
236
|
+
</>
|
|
237
|
+
)}
|
|
238
|
+
</div>
|
|
239
|
+
</div>
|
|
240
|
+
)}
|
|
241
|
+
|
|
242
|
+
<div class={contentClasses.value}>
|
|
243
|
+
{slots.default?.()}
|
|
244
|
+
</div>
|
|
245
|
+
|
|
246
|
+
{props.loadMore && (
|
|
247
|
+
<div class={bottomClasses.value}>
|
|
248
|
+
<div class={statusClass.value}>
|
|
249
|
+
{slots.bottom?.() ?? (
|
|
250
|
+
<>
|
|
251
|
+
<span class="spinner">
|
|
252
|
+
{downStatus.value === 'loading' && (
|
|
253
|
+
<Spinner size="15" type="snake" />
|
|
254
|
+
)}
|
|
255
|
+
</span>
|
|
256
|
+
<span class="dpzvc3-loadmore-text">{downText.value}</span>
|
|
257
|
+
</>
|
|
258
|
+
)}
|
|
259
|
+
</div>
|
|
260
|
+
</div>
|
|
261
|
+
)}
|
|
262
|
+
</div>
|
|
263
|
+
)
|
|
264
|
+
}
|
|
265
|
+
})
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// src/components/Loadmore/types.ts
|
|
2
|
+
export interface LoadmoreProps {
|
|
3
|
+
height?: number | string
|
|
4
|
+
|
|
5
|
+
/** 下拉刷新 */
|
|
6
|
+
refresh?: () => void
|
|
7
|
+
upLoadingText?: string
|
|
8
|
+
upDistance?: number
|
|
9
|
+
upPullText?: string
|
|
10
|
+
upDropText?: string
|
|
11
|
+
maxDistance?: number
|
|
12
|
+
speed?: number
|
|
13
|
+
|
|
14
|
+
/** 上拉加载 */
|
|
15
|
+
loadMore?: () => void
|
|
16
|
+
downEndText?: string
|
|
17
|
+
downDropText?: string
|
|
18
|
+
downLoadingText?: string
|
|
19
|
+
downDistance?: number
|
|
20
|
+
hasMore?: boolean
|
|
21
|
+
|
|
22
|
+
/** 其他 */
|
|
23
|
+
styles?: Record<string, any>
|
|
24
|
+
auto?: boolean
|
|
25
|
+
autoFill?: boolean
|
|
26
|
+
}
|