dpzvc3-ui 3.0.7 → 3.1.0
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 +7761 -10544
- 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 +6067 -7681
- 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 +157 -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 +175 -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 +157 -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,115 @@
|
|
|
1
|
+
// src/components/RadioBox/RadioBox.tsx
|
|
2
|
+
import {
|
|
3
|
+
defineComponent,
|
|
4
|
+
inject,
|
|
5
|
+
computed,
|
|
6
|
+
ref,
|
|
7
|
+
onMounted
|
|
8
|
+
} from 'vue'
|
|
9
|
+
import type { PropType } from 'vue'
|
|
10
|
+
import type {
|
|
11
|
+
RadioBoxProps,
|
|
12
|
+
RadioGroupProvide,
|
|
13
|
+
} from './types'
|
|
14
|
+
export type { RadioBoxProps }
|
|
15
|
+
const prefixCls = 'dpzvc3-radiobox'
|
|
16
|
+
const radioGroupKey = 'radioBoxGroup'
|
|
17
|
+
|
|
18
|
+
export default defineComponent({
|
|
19
|
+
name: 'RadioBox',
|
|
20
|
+
|
|
21
|
+
props: {
|
|
22
|
+
label: {
|
|
23
|
+
type: [String, Number] as PropType<RadioBoxProps['label']>,
|
|
24
|
+
required: true
|
|
25
|
+
},
|
|
26
|
+
modelValue: {
|
|
27
|
+
type: Boolean,
|
|
28
|
+
default: false
|
|
29
|
+
},
|
|
30
|
+
disable: {
|
|
31
|
+
type: Boolean,
|
|
32
|
+
default: false
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
|
|
36
|
+
emits: ['update:modelValue', 'on-change'],
|
|
37
|
+
|
|
38
|
+
setup (props, { emit, slots }) {
|
|
39
|
+
const slotEl = ref<HTMLElement | null>(null)
|
|
40
|
+
const show = ref(true)
|
|
41
|
+
|
|
42
|
+
/** 注入 RadioGroup(可选) */
|
|
43
|
+
const group = inject<RadioGroupProvide | null>(
|
|
44
|
+
radioGroupKey,
|
|
45
|
+
null
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
/** 是否选中 */
|
|
49
|
+
const isChecked = computed<boolean>(() => {
|
|
50
|
+
if (group) {
|
|
51
|
+
return group.currentValue.value === props.label
|
|
52
|
+
}
|
|
53
|
+
return !!props.modelValue
|
|
54
|
+
})
|
|
55
|
+
|
|
56
|
+
/** classes */
|
|
57
|
+
const classes = computed(() => [prefixCls])
|
|
58
|
+
|
|
59
|
+
const wrapperClasses = computed(() => [
|
|
60
|
+
`${prefixCls}-wrapper`,
|
|
61
|
+
{
|
|
62
|
+
[`${prefixCls}-checked`]: isChecked.value,
|
|
63
|
+
[`${prefixCls}-disable`]: props.disable
|
|
64
|
+
}
|
|
65
|
+
])
|
|
66
|
+
|
|
67
|
+
const innerClasses = computed(() => [`${prefixCls}-inner`])
|
|
68
|
+
const inputClass = computed(() => [`${prefixCls}-input`])
|
|
69
|
+
|
|
70
|
+
/** change */
|
|
71
|
+
const handleChange = (e: Event) => {
|
|
72
|
+
if (props.disable) return
|
|
73
|
+
|
|
74
|
+
const checked = (e.target as HTMLInputElement).checked
|
|
75
|
+
|
|
76
|
+
if (group) {
|
|
77
|
+
group.change(props.label)
|
|
78
|
+
} else {
|
|
79
|
+
emit('update:modelValue', checked)
|
|
80
|
+
emit('on-change', checked)
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/** 判断 slot 是否为空 */
|
|
85
|
+
onMounted(() => {
|
|
86
|
+
if (!group) {
|
|
87
|
+
if (slotEl.value && !slotEl.value.innerHTML) {
|
|
88
|
+
show.value = false
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
})
|
|
92
|
+
|
|
93
|
+
return () => (
|
|
94
|
+
<label class={classes.value}>
|
|
95
|
+
<span class={wrapperClasses.value}>
|
|
96
|
+
<span class={innerClasses.value}>
|
|
97
|
+
<input
|
|
98
|
+
type="radio"
|
|
99
|
+
disabled={props.disable}
|
|
100
|
+
checked={isChecked.value}
|
|
101
|
+
class={inputClass.value}
|
|
102
|
+
onChange={handleChange}
|
|
103
|
+
/>
|
|
104
|
+
</span>
|
|
105
|
+
</span>
|
|
106
|
+
|
|
107
|
+
{show.value && (
|
|
108
|
+
slots.default
|
|
109
|
+
? slots.default()
|
|
110
|
+
: <span ref={slotEl}>{props.label}</span>
|
|
111
|
+
)}
|
|
112
|
+
</label>
|
|
113
|
+
)
|
|
114
|
+
}
|
|
115
|
+
})
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// src/components/radio-group/types.ts
|
|
2
|
+
import type { Ref } from 'vue'
|
|
3
|
+
|
|
4
|
+
type RadioValue = string | number | boolean
|
|
5
|
+
|
|
6
|
+
export interface RadioGroupProps {
|
|
7
|
+
modelValue?: RadioValue
|
|
8
|
+
vertical?: boolean
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface RadioGroupProvide {
|
|
12
|
+
currentValue: Ref<RadioValue>
|
|
13
|
+
change: (val: RadioValue) => void
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
type RadioBoxValue = string | number
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
export interface RadioBoxProps {
|
|
21
|
+
label: RadioBoxValue
|
|
22
|
+
modelValue?: boolean
|
|
23
|
+
disable?: boolean
|
|
24
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Created by admin on 2025/10/31.
|
|
3
|
+
*/
|
|
4
|
+
import type { App } from 'vue'
|
|
5
|
+
import Rater from './raters'
|
|
6
|
+
Rater.install = (app: App): void => {
|
|
7
|
+
app.component('Rater', Rater); // 注册全局组件
|
|
8
|
+
}
|
|
9
|
+
type IWithInstall<T> = T & { install(app: App): void };
|
|
10
|
+
const _Rater=Rater as IWithInstall<typeof Rater>;
|
|
11
|
+
export default _Rater
|
|
12
|
+
export type { RaterProps } from './types'
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// src/components/badge/badge.d.ts
|
|
2
|
+
|
|
3
|
+
import type { App } from 'vue'
|
|
4
|
+
import type { RaterProps } from './types' // 引入同级 types.ts 中的 BadgeProps
|
|
5
|
+
|
|
6
|
+
/** Badge 组件实例类型,带 install 方法 */
|
|
7
|
+
declare const Rater: {
|
|
8
|
+
/** Vue 组件本身 */
|
|
9
|
+
new (): any
|
|
10
|
+
/** props 类型引用 */
|
|
11
|
+
__props?: RaterProps
|
|
12
|
+
/** install 方法,用于全量注册 */
|
|
13
|
+
install(app: App): void
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export default ActionSheet
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
// src/components/rater/rater.tsx
|
|
2
|
+
// src/components/rater/rater.tsx
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
import { defineComponent, ref, watch, computed, PropType } from 'vue'
|
|
6
|
+
import type { RaterProps } from './types'
|
|
7
|
+
export type { RaterProps }
|
|
8
|
+
const prefixCls = 'dpzvc3-rater'
|
|
9
|
+
|
|
10
|
+
export default defineComponent({
|
|
11
|
+
name: 'Dpzvc3Rater',
|
|
12
|
+
|
|
13
|
+
props: {
|
|
14
|
+
modelValue: { type: Number as PropType<number>, default: -1 },
|
|
15
|
+
distance: { type: Number as PropType<number>, default: 10 },
|
|
16
|
+
max: { type: Number as PropType<number>, default: 5 },
|
|
17
|
+
size: { type: Number as PropType<number>, default: 18 },
|
|
18
|
+
star: { type: String as PropType<string>, default: '★' },
|
|
19
|
+
defaultColor: { type: String as PropType<string>, default: '#ccc' },
|
|
20
|
+
activeColor: { type: String as PropType<string>, default: '#f5a623' },
|
|
21
|
+
disabled: { type: Boolean as PropType<boolean>, default: false }
|
|
22
|
+
},
|
|
23
|
+
|
|
24
|
+
emits: ['update:modelValue'],
|
|
25
|
+
|
|
26
|
+
setup(props, { emit }) {
|
|
27
|
+
const currentValue = ref(props.modelValue)
|
|
28
|
+
|
|
29
|
+
watch(() => props.modelValue, v => {
|
|
30
|
+
currentValue.value = v
|
|
31
|
+
})
|
|
32
|
+
|
|
33
|
+
const classes = computed(() => [prefixCls])
|
|
34
|
+
const starClass = `${prefixCls}-star`
|
|
35
|
+
|
|
36
|
+
/** ⭐️ 关键:提前算好 stars 数组 */
|
|
37
|
+
const stars = computed(() => {
|
|
38
|
+
return Array.from({ length: props.max }).map((_, index) => {
|
|
39
|
+
const baseStyle: Record<string, string> = {
|
|
40
|
+
fontSize: `${props.size}px`,
|
|
41
|
+
marginRight: index + 1 < props.max ? `${props.distance}px` : '0px',
|
|
42
|
+
color: props.defaultColor
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const activeStyle: Record<string, string> = {
|
|
46
|
+
fontSize: `${props.size}px`,
|
|
47
|
+
marginRight: baseStyle.marginRight
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const [int, decimal] = String(currentValue.value).split('.')
|
|
51
|
+
|
|
52
|
+
if (index + 1 <= Number(int)) {
|
|
53
|
+
activeStyle.color = props.activeColor
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
if (
|
|
57
|
+
decimal &&
|
|
58
|
+
Number(decimal) >= 5 &&
|
|
59
|
+
index + 1 === Number(int) + 1
|
|
60
|
+
) {
|
|
61
|
+
activeStyle.width = '50%'
|
|
62
|
+
activeStyle.color = props.activeColor
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
return {
|
|
66
|
+
index,
|
|
67
|
+
baseStyle,
|
|
68
|
+
activeStyle
|
|
69
|
+
}
|
|
70
|
+
})
|
|
71
|
+
})
|
|
72
|
+
|
|
73
|
+
const onClickStar = (index: number) => {
|
|
74
|
+
if (props.disabled) return
|
|
75
|
+
const value = index + 1
|
|
76
|
+
currentValue.value = value
|
|
77
|
+
emit('update:modelValue', value)
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/** ✅ render 里只“消费数据”,不计算 */
|
|
81
|
+
return () => (
|
|
82
|
+
<div class={classes.value}>
|
|
83
|
+
{stars.value.map(item => (
|
|
84
|
+
<span
|
|
85
|
+
key={item.index}
|
|
86
|
+
class={starClass}
|
|
87
|
+
style={item.baseStyle}
|
|
88
|
+
>
|
|
89
|
+
{props.star}
|
|
90
|
+
<span
|
|
91
|
+
style={item.activeStyle}
|
|
92
|
+
onClick={() => onClickStar(item.index)}
|
|
93
|
+
>
|
|
94
|
+
{props.star}
|
|
95
|
+
</span>
|
|
96
|
+
</span>
|
|
97
|
+
))}
|
|
98
|
+
</div>
|
|
99
|
+
)
|
|
100
|
+
}
|
|
101
|
+
})
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Created by admin on 2017/4/21.
|
|
3
|
+
*/
|
|
4
|
+
import type { App } from 'vue'
|
|
5
|
+
import SlideBar from './slideBar'
|
|
6
|
+
SlideBar.install = (app: App): void => {
|
|
7
|
+
app.component('SlideBar', SlideBar); // 注册全局组件
|
|
8
|
+
}
|
|
9
|
+
type IWithInstall<T> = T & { install(app: App): void };
|
|
10
|
+
const _SlideBar=SlideBar as IWithInstall<typeof SlideBar>;
|
|
11
|
+
export default _SlideBar
|
|
12
|
+
// export default SlideBar
|
|
13
|
+
export type { SlideBarProps } from './types'
|
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
// src/components/slideBar/slideBar.tsx
|
|
2
|
+
import {
|
|
3
|
+
defineComponent,
|
|
4
|
+
ref,
|
|
5
|
+
computed,
|
|
6
|
+
onMounted,
|
|
7
|
+
onBeforeUnmount,
|
|
8
|
+
PropType
|
|
9
|
+
} from 'vue'
|
|
10
|
+
import type { SlideBarProps, SlideBarItem } from './types'
|
|
11
|
+
|
|
12
|
+
export type { SlideBarProps }
|
|
13
|
+
|
|
14
|
+
const prefixCls = 'dpzvc3-slideBar'
|
|
15
|
+
|
|
16
|
+
export default defineComponent({
|
|
17
|
+
name: 'SlideBar',
|
|
18
|
+
|
|
19
|
+
props: {
|
|
20
|
+
scrollHeight: {
|
|
21
|
+
type: [String, Number] as PropType<string | number>,
|
|
22
|
+
default: '30px'
|
|
23
|
+
},
|
|
24
|
+
height: {
|
|
25
|
+
type: [String, Number] as PropType<string | number>,
|
|
26
|
+
default: '100%'
|
|
27
|
+
},
|
|
28
|
+
styles: {
|
|
29
|
+
type: Object as PropType<Record<string, any>>,
|
|
30
|
+
default: () => ({})
|
|
31
|
+
},
|
|
32
|
+
childWidth: {
|
|
33
|
+
type: Number,
|
|
34
|
+
default: 70
|
|
35
|
+
},
|
|
36
|
+
scrollColor: {
|
|
37
|
+
type: String,
|
|
38
|
+
default: '#036eb8'
|
|
39
|
+
},
|
|
40
|
+
textAlign: {
|
|
41
|
+
type: String,
|
|
42
|
+
default: 'center'
|
|
43
|
+
},
|
|
44
|
+
flex: {
|
|
45
|
+
type: Boolean,
|
|
46
|
+
default: true
|
|
47
|
+
},
|
|
48
|
+
type: {
|
|
49
|
+
type: String as PropType<SlideBarProps['type']>,
|
|
50
|
+
default: 'normal'
|
|
51
|
+
},
|
|
52
|
+
list: {
|
|
53
|
+
type: Array as PropType<SlideBarItem[]>,
|
|
54
|
+
default: () => [{ name: '1' }, { name: '2' }, { name: '3' }, { name: '4' }]
|
|
55
|
+
},
|
|
56
|
+
index: {
|
|
57
|
+
type: Number,
|
|
58
|
+
default: 0
|
|
59
|
+
},
|
|
60
|
+
distanceIndex: {
|
|
61
|
+
type: Number,
|
|
62
|
+
default: 1.5
|
|
63
|
+
},
|
|
64
|
+
canDrag: {
|
|
65
|
+
type: Boolean,
|
|
66
|
+
default: true
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
|
|
70
|
+
emits: ['on-change'],
|
|
71
|
+
|
|
72
|
+
setup(props: SlideBarProps, { emit, slots }) {
|
|
73
|
+
const headerRef = ref<HTMLDivElement | null>(null)
|
|
74
|
+
const contentRef = ref<HTMLDivElement | null>(null)
|
|
75
|
+
|
|
76
|
+
const startIndex = ref(props.index ?? 0)
|
|
77
|
+
const clientWidth = ref(0)
|
|
78
|
+
const dragging = ref(false)
|
|
79
|
+
const distance = ref(0)
|
|
80
|
+
const startTranslateX = ref(0)
|
|
81
|
+
const startX = ref(0)
|
|
82
|
+
|
|
83
|
+
const items = ref(props.list ?? [])
|
|
84
|
+
const isFlex = ref(!!props.flex)
|
|
85
|
+
const fixed = ref(false)
|
|
86
|
+
|
|
87
|
+
const translateX = ref(0)
|
|
88
|
+
|
|
89
|
+
const getItemWidth = computed(() =>
|
|
90
|
+
isFlex.value
|
|
91
|
+
? clientWidth.value / items.value.length
|
|
92
|
+
: props.childWidth!
|
|
93
|
+
)
|
|
94
|
+
|
|
95
|
+
const classes = computed(() => [prefixCls])
|
|
96
|
+
|
|
97
|
+
const headerClasses = computed(() => [
|
|
98
|
+
`${prefixCls}-header`,
|
|
99
|
+
{ fixed: fixed.value }
|
|
100
|
+
])
|
|
101
|
+
|
|
102
|
+
const wrapperClasses = computed(() => [
|
|
103
|
+
`${prefixCls}-wrapper`,
|
|
104
|
+
isFlex.value ? `${prefixCls}-flex` : `${prefixCls}-slide`,
|
|
105
|
+
{
|
|
106
|
+
normal: props.type === 'normal' && isFlex.value,
|
|
107
|
+
vertical: props.type === 'vertical' && isFlex.value
|
|
108
|
+
}
|
|
109
|
+
])
|
|
110
|
+
|
|
111
|
+
const contentClasses = computed(() => [
|
|
112
|
+
`${prefixCls}-content`,
|
|
113
|
+
{ [`${prefixCls}-dragging`]: dragging.value }
|
|
114
|
+
])
|
|
115
|
+
|
|
116
|
+
const absoluteClass = computed(() => [`${prefixCls}-wrapper-absolute`])
|
|
117
|
+
const containerClass = computed(() => [`${prefixCls}-container`])
|
|
118
|
+
|
|
119
|
+
const getStyles = computed(() => ({ ...props.styles }))
|
|
120
|
+
|
|
121
|
+
const getContainerStyle = computed(() => ({
|
|
122
|
+
width: clientWidth.value * items.value.length + 'px',
|
|
123
|
+
transform: `translate3d(${translateX.value}px,0,0)`
|
|
124
|
+
}))
|
|
125
|
+
|
|
126
|
+
const getScrollStyle = computed(() => ({
|
|
127
|
+
width: getItemWidth.value + 'px',
|
|
128
|
+
transform: `translate3d(${startIndex.value * getItemWidth.value}px,0,0)`,
|
|
129
|
+
backgroundColor: props.scrollColor
|
|
130
|
+
}))
|
|
131
|
+
|
|
132
|
+
const maxIndex = computed(() => items.value.length - 1)
|
|
133
|
+
|
|
134
|
+
/* tab 切换 */
|
|
135
|
+
const changeBar = (index: number) => {
|
|
136
|
+
if (startIndex.value === index) return
|
|
137
|
+
startIndex.value = index
|
|
138
|
+
translateX.value = -index * clientWidth.value
|
|
139
|
+
emit('on-change', index)
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/* 拖拽逻辑 */
|
|
143
|
+
const onTouchStart = (e: TouchEvent) => {
|
|
144
|
+
startTranslateX.value = translateX.value
|
|
145
|
+
distance.value = 0
|
|
146
|
+
startX.value = e.touches[0].clientX
|
|
147
|
+
dragging.value = true
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
const onTouchMove = (e: TouchEvent) => {
|
|
151
|
+
const currentX = e.touches[0].clientX
|
|
152
|
+
distance.value = props.distanceIndex
|
|
153
|
+
? (currentX - startX.value) / props.distanceIndex
|
|
154
|
+
: currentX - startX.value
|
|
155
|
+
translateX.value = startTranslateX.value + distance.value
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
const onTouchEnd = () => {
|
|
159
|
+
if (distance.value < 0 && Math.abs(distance.value) > clientWidth.value / 2) {
|
|
160
|
+
slideLeft()
|
|
161
|
+
} else if (distance.value > 0 && Math.abs(distance.value) > clientWidth.value / 2) {
|
|
162
|
+
slideRight()
|
|
163
|
+
} else {
|
|
164
|
+
translateX.value = startTranslateX.value
|
|
165
|
+
}
|
|
166
|
+
dragging.value = false
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
const slideLeft = () => {
|
|
170
|
+
if (startIndex.value >= maxIndex.value) {
|
|
171
|
+
translateX.value = startTranslateX.value
|
|
172
|
+
} else {
|
|
173
|
+
startIndex.value++
|
|
174
|
+
translateX.value = startTranslateX.value - clientWidth.value
|
|
175
|
+
}
|
|
176
|
+
emit('on-change', startIndex.value)
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
const slideRight = () => {
|
|
180
|
+
if (startIndex.value <= 0) {
|
|
181
|
+
translateX.value = startTranslateX.value
|
|
182
|
+
} else {
|
|
183
|
+
startIndex.value--
|
|
184
|
+
translateX.value = startTranslateX.value + clientWidth.value
|
|
185
|
+
}
|
|
186
|
+
emit('on-change', startIndex.value)
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
/* 固定 header */
|
|
190
|
+
const onScroll = () => {
|
|
191
|
+
if (!headerRef.value) return
|
|
192
|
+
fixed.value = headerRef.value.getBoundingClientRect().top <= 0
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
const onResize = () => {
|
|
196
|
+
if (!headerRef.value) return
|
|
197
|
+
clientWidth.value = headerRef.value.clientWidth
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
onMounted(() => {
|
|
201
|
+
if (!headerRef.value) return
|
|
202
|
+
clientWidth.value = headerRef.value.clientWidth
|
|
203
|
+
translateX.value = -startIndex.value * clientWidth.value
|
|
204
|
+
|
|
205
|
+
window.addEventListener('resize', onResize)
|
|
206
|
+
window.addEventListener('scroll', onScroll)
|
|
207
|
+
|
|
208
|
+
if (props.canDrag && contentRef.value) {
|
|
209
|
+
contentRef.value.addEventListener('touchstart', onTouchStart)
|
|
210
|
+
contentRef.value.addEventListener('touchmove', onTouchMove)
|
|
211
|
+
contentRef.value.addEventListener('touchend', onTouchEnd)
|
|
212
|
+
}
|
|
213
|
+
})
|
|
214
|
+
|
|
215
|
+
onBeforeUnmount(() => {
|
|
216
|
+
window.removeEventListener('resize', onResize)
|
|
217
|
+
window.removeEventListener('scroll', onScroll)
|
|
218
|
+
|
|
219
|
+
if (props.canDrag && contentRef.value) {
|
|
220
|
+
contentRef.value.removeEventListener('touchstart', onTouchStart)
|
|
221
|
+
contentRef.value.removeEventListener('touchmove', onTouchMove)
|
|
222
|
+
contentRef.value.removeEventListener('touchend', onTouchEnd)
|
|
223
|
+
}
|
|
224
|
+
})
|
|
225
|
+
|
|
226
|
+
return () => (
|
|
227
|
+
<div class={classes.value} style={getStyles.value}>
|
|
228
|
+
{/* header */}
|
|
229
|
+
<div ref={headerRef} class={headerClasses.value}>
|
|
230
|
+
<div
|
|
231
|
+
class={wrapperClasses.value}
|
|
232
|
+
style={{
|
|
233
|
+
width: isFlex.value
|
|
234
|
+
? 'auto'
|
|
235
|
+
: items.value.length * getItemWidth.value + 'px'
|
|
236
|
+
}}
|
|
237
|
+
>
|
|
238
|
+
{items.value.map((item, key) => (
|
|
239
|
+
<div
|
|
240
|
+
key={key}
|
|
241
|
+
class={[
|
|
242
|
+
'dpzvc3-slideBar-child',
|
|
243
|
+
startIndex.value === key && 'active',
|
|
244
|
+
!isFlex.value && 'normalChild'
|
|
245
|
+
]}
|
|
246
|
+
style={{
|
|
247
|
+
textAlign: props.textAlign,
|
|
248
|
+
width: getItemWidth.value + 'px',
|
|
249
|
+
height: props.scrollHeight,
|
|
250
|
+
lineHeight: String(props.scrollHeight)
|
|
251
|
+
}}
|
|
252
|
+
onClick={() => changeBar(key)}
|
|
253
|
+
>
|
|
254
|
+
{slots[`slide-bar-header-${key}`]
|
|
255
|
+
? slots[`slide-bar-header-${key}`]!()
|
|
256
|
+
: <a class="content ellipse-fir">{item.name}</a>}
|
|
257
|
+
</div>
|
|
258
|
+
))}
|
|
259
|
+
</div>
|
|
260
|
+
|
|
261
|
+
<div class={absoluteClass.value} style={getScrollStyle.value} />
|
|
262
|
+
</div>
|
|
263
|
+
|
|
264
|
+
{/* content */}
|
|
265
|
+
<div class={containerClass.value} style={{ height: props.height }}>
|
|
266
|
+
<div
|
|
267
|
+
ref={contentRef}
|
|
268
|
+
class={contentClasses.value}
|
|
269
|
+
style={getContainerStyle.value}
|
|
270
|
+
>
|
|
271
|
+
{items.value.map((_, index) => (
|
|
272
|
+
<div
|
|
273
|
+
key={index}
|
|
274
|
+
class={[
|
|
275
|
+
'dpzvc3-slideBar-content-item',
|
|
276
|
+
startIndex.value === index && 'active'
|
|
277
|
+
]}
|
|
278
|
+
style={{ width: clientWidth.value + 'px' }}
|
|
279
|
+
>
|
|
280
|
+
{slots[`slot-item-${index}`]?.()}
|
|
281
|
+
</div>
|
|
282
|
+
))}
|
|
283
|
+
</div>
|
|
284
|
+
</div>
|
|
285
|
+
</div>
|
|
286
|
+
)
|
|
287
|
+
}
|
|
288
|
+
})
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// src/components/slideBar/types.ts
|
|
2
|
+
export interface SlideBarItem {
|
|
3
|
+
name: string
|
|
4
|
+
[key: string]: any
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export interface SlideBarProps {
|
|
8
|
+
scrollHeight?: string | number
|
|
9
|
+
height?: string | number
|
|
10
|
+
styles?: Record<string, any>
|
|
11
|
+
childWidth?: number
|
|
12
|
+
scrollColor?: string
|
|
13
|
+
textAlign?: string
|
|
14
|
+
flex?: boolean
|
|
15
|
+
type?: 'normal' | 'vertical'
|
|
16
|
+
list?: SlideBarItem[]
|
|
17
|
+
index?: number
|
|
18
|
+
distanceIndex?: number
|
|
19
|
+
canDrag?: boolean
|
|
20
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Created by admin on 2025/10/16.
|
|
3
|
+
*/
|
|
4
|
+
import type { App } from 'vue'
|
|
5
|
+
import Spinner from './spinner'
|
|
6
|
+
Spinner.install = (app: App): void => {
|
|
7
|
+
app.component('Spinner', Spinner); // 注册全局组件
|
|
8
|
+
}
|
|
9
|
+
type IWithInstall<T> = T & { install(app: App): void };
|
|
10
|
+
const _Spinner=Spinner as IWithInstall<typeof Spinner>;
|
|
11
|
+
export default _Spinner
|
|
12
|
+
// export default Spinner
|
|
13
|
+
export type { SpinnerProps } from './types'
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
// src/components/spinner/spinner.tsx
|
|
2
|
+
import { defineComponent, computed, PropType } from 'vue'
|
|
3
|
+
// import type { DefineComponent } from 'vue'
|
|
4
|
+
import SpinnerBlade from './behavior/blade.vue'
|
|
5
|
+
import SpinnerSnake from './behavior/snake.vue'
|
|
6
|
+
import SpinnerDoubleBounce from './behavior/double-bounce.vue'
|
|
7
|
+
import SpinnerTripleBounce from './behavior/triple-bounce.vue'
|
|
8
|
+
import SpinnerFadingCircle from './behavior/fading-circle.vue'
|
|
9
|
+
|
|
10
|
+
import type { SpinnerProps, SpinnerType } from './types'
|
|
11
|
+
export type { SpinnerProps }
|
|
12
|
+
|
|
13
|
+
const SPINNERS = [
|
|
14
|
+
'blade',
|
|
15
|
+
'snake',
|
|
16
|
+
'double-bounce',
|
|
17
|
+
'triple-bounce',
|
|
18
|
+
'fading-circle'
|
|
19
|
+
] as const
|
|
20
|
+
|
|
21
|
+
const SPINNER_MAP = {
|
|
22
|
+
blade: SpinnerBlade,
|
|
23
|
+
snake: SpinnerSnake,
|
|
24
|
+
'double-bounce': SpinnerDoubleBounce,
|
|
25
|
+
'triple-bounce': SpinnerTripleBounce,
|
|
26
|
+
'fading-circle': SpinnerFadingCircle
|
|
27
|
+
} as const
|
|
28
|
+
|
|
29
|
+
function parseSpinner(type: SpinnerType | number): keyof typeof SPINNER_MAP {
|
|
30
|
+
let value: string | number = type ?? 0
|
|
31
|
+
|
|
32
|
+
// 数字类型(索引)
|
|
33
|
+
if (typeof value === 'number' || /^\d+$/.test(String(value))) {
|
|
34
|
+
const index = Number(value)
|
|
35
|
+
if (index >= SPINNERS.length) {
|
|
36
|
+
console.warn(`'${value}' spinner not found, use the default spinner.`)
|
|
37
|
+
return SPINNERS[0]
|
|
38
|
+
}
|
|
39
|
+
return SPINNERS[index]
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// 字符串类型
|
|
43
|
+
if (!SPINNERS.includes(value as any)) {
|
|
44
|
+
console.warn(`'${value}' spinner not found, use the default spinner.`)
|
|
45
|
+
return SPINNERS[0]
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
return value as keyof typeof SPINNER_MAP
|
|
49
|
+
}
|
|
50
|
+
// type Compute<T> = { [K in keyof T]: Compute<T[K]> }; // 将类型展开方便提示
|
|
51
|
+
export default defineComponent({
|
|
52
|
+
name: 'Dpzvc3Spinner',
|
|
53
|
+
|
|
54
|
+
props: {
|
|
55
|
+
size: {
|
|
56
|
+
type: [Number, String] as PropType<number | string>,
|
|
57
|
+
default: 30
|
|
58
|
+
},
|
|
59
|
+
type: {
|
|
60
|
+
type: [String, Number] as PropType<SpinnerType | number>,
|
|
61
|
+
default: 'snake'
|
|
62
|
+
},
|
|
63
|
+
color: {
|
|
64
|
+
type: String as PropType<string>,
|
|
65
|
+
default: '#39f'
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
|
|
69
|
+
setup(props) {
|
|
70
|
+
const SpinnerComponent = computed(() => {
|
|
71
|
+
const key = parseSpinner(props.type)
|
|
72
|
+
return SPINNER_MAP[key]
|
|
73
|
+
})
|
|
74
|
+
return () => {
|
|
75
|
+
const Comp = SpinnerComponent.value as any
|
|
76
|
+
return (
|
|
77
|
+
<Comp
|
|
78
|
+
size={props.size}
|
|
79
|
+
type={props.type}
|
|
80
|
+
color={props.color}
|
|
81
|
+
/>
|
|
82
|
+
)
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
})
|