@tdesign/uniapp 0.0.1-alpha.1 → 0.7.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/CHANGELOG.md +204 -0
- package/LICENSE +9 -0
- package/README.md +144 -0
- package/dist/.eslintrc.js +30 -0
- package/dist/action-sheet/README.en-US.md +60 -0
- package/dist/action-sheet/README.md +131 -0
- package/dist/action-sheet/action-sheet.css +162 -0
- package/dist/action-sheet/action-sheet.vue +350 -0
- package/dist/action-sheet/computed.js +15 -0
- package/dist/action-sheet/index.d.ts +11 -0
- package/dist/action-sheet/index.js +13 -0
- package/dist/action-sheet/props.ts +86 -0
- package/dist/action-sheet/show.d.ts +28 -0
- package/dist/action-sheet/show.js +33 -0
- package/dist/action-sheet/type.ts +93 -0
- package/dist/avatar/README.en-US.md +102 -0
- package/dist/avatar/README.md +152 -0
- package/dist/avatar/avatar.css +77 -0
- package/dist/avatar/avatar.vue +200 -0
- package/dist/avatar/computed.js +30 -0
- package/dist/avatar/props.ts +54 -0
- package/dist/avatar/type.ts +58 -0
- package/dist/avatar-group/avatar-group.css +187 -0
- package/dist/avatar-group/avatar-group.vue +121 -0
- package/dist/avatar-group/props.ts +44 -0
- package/dist/avatar-group/type.ts +38 -0
- package/dist/back-top/README.en-US.md +49 -0
- package/dist/back-top/README.md +67 -0
- package/dist/back-top/back-top.css +65 -0
- package/dist/back-top/back-top.vue +122 -0
- package/dist/back-top/props.ts +48 -0
- package/dist/back-top/type.ts +42 -0
- package/dist/badge/README.en-US.md +54 -0
- package/dist/badge/README.md +85 -0
- package/dist/badge/badge.css +140 -0
- package/dist/badge/badge.vue +134 -0
- package/dist/badge/computed.js +63 -0
- package/dist/badge/props.ts +55 -0
- package/dist/badge/type.ts +60 -0
- package/dist/button/README.en-US.md +238 -0
- package/dist/button/README.md +229 -0
- package/dist/button/button.css +514 -0
- package/dist/button/button.vue +244 -0
- package/dist/button/props.ts +207 -0
- package/dist/button/type.ts +192 -0
- package/dist/calendar/README.en-US.md +63 -0
- package/dist/calendar/README.md +113 -0
- package/dist/calendar/calendar-header.props.js +42 -0
- package/dist/calendar/calendar-header.vue +98 -0
- package/dist/calendar/calendar.css +205 -0
- package/dist/calendar/calendar.vue +454 -0
- package/dist/calendar/computed.js +42 -0
- package/dist/calendar/props.ts +113 -0
- package/dist/calendar/template.props.js +57 -0
- package/dist/calendar/template.vue +261 -0
- package/dist/calendar/type.ts +141 -0
- package/dist/calendar/utils.js +16 -0
- package/dist/cascader/README.en-US.md +56 -0
- package/dist/cascader/README.md +96 -0
- package/dist/cascader/cascader.css +102 -0
- package/dist/cascader/cascader.vue +519 -0
- package/dist/cascader/props.ts +73 -0
- package/dist/cascader/type.ts +77 -0
- package/dist/cell/README.en-US.md +116 -0
- package/dist/cell/README.md +147 -0
- package/dist/cell/cell.css +94 -0
- package/dist/cell/cell.vue +260 -0
- package/dist/cell/props.ts +87 -0
- package/dist/cell/type.ts +82 -0
- package/dist/cell-group/cell-group.css +44 -0
- package/dist/cell-group/cell-group.vue +69 -0
- package/dist/cell-group/props.ts +25 -0
- package/dist/cell-group/type.ts +23 -0
- package/dist/check-tag/check-tag.css +197 -0
- package/dist/check-tag/check-tag.vue +149 -0
- package/dist/check-tag/props.ts +67 -0
- package/dist/check-tag/type.ts +63 -0
- package/dist/checkbox/README.en-US.md +103 -0
- package/dist/checkbox/README.md +158 -0
- package/dist/checkbox/checkbox.css +174 -0
- package/dist/checkbox/checkbox.vue +238 -0
- package/dist/checkbox/props.ts +90 -0
- package/dist/checkbox/type.ts +96 -0
- package/dist/checkbox-group/checkbox-group.css +0 -0
- package/dist/checkbox-group/checkbox-group.vue +261 -0
- package/dist/checkbox-group/props.ts +58 -0
- package/dist/checkbox-group/type.ts +72 -0
- package/dist/col/README.en-US.md +31 -0
- package/dist/col/README.md +60 -0
- package/dist/col/col.css +149 -0
- package/dist/col/col.vue +58 -0
- package/dist/col/computed.js +14 -0
- package/dist/col/props.ts +16 -0
- package/dist/col/type.ts +16 -0
- package/dist/collapse/README.en-US.md +82 -0
- package/dist/collapse/README.md +119 -0
- package/dist/collapse/collapse.css +5 -0
- package/dist/collapse/collapse.vue +119 -0
- package/dist/collapse/props.ts +42 -0
- package/dist/collapse/type.ts +46 -0
- package/dist/collapse-panel/collapse-panel.css +154 -0
- package/dist/collapse-panel/collapse-panel.vue +238 -0
- package/dist/collapse-panel/props.ts +48 -0
- package/dist/collapse-panel/type.ts +41 -0
- package/dist/color-picker/README.en-US.md +62 -0
- package/dist/color-picker/README.md +110 -0
- package/dist/color-picker/color-picker.css +271 -0
- package/dist/color-picker/color-picker.vue +501 -0
- package/dist/color-picker/constants.ts +26 -0
- package/dist/color-picker/props.ts +75 -0
- package/dist/color-picker/template.props.js +58 -0
- package/dist/color-picker/template.vue +198 -0
- package/dist/color-picker/type.ts +96 -0
- package/dist/color-picker/utils.js +1 -0
- package/dist/common/bus.js +84 -0
- package/dist/common/canvas/index.js +53 -0
- package/dist/common/common.ts +173 -0
- package/dist/common/config.js +9 -0
- package/dist/common/dom/index.js +1 -0
- package/dist/common/dom/select-component.js +26 -0
- package/dist/common/event/dynamic.js +10 -0
- package/dist/common/functional/mixin.js +51 -0
- package/dist/common/relation/index.js +6 -0
- package/dist/common/relation/parent-map.js +26 -0
- package/dist/common/relation/relation.js +213 -0
- package/dist/common/route.js +13 -0
- package/dist/common/runtime/index.js +5 -0
- package/dist/common/runtime/relation.js +0 -0
- package/dist/common/runtime/wxs-polyfill.js +16 -0
- package/dist/common/shared/calendar/index.js +128 -0
- package/dist/common/shared/calendar/type.ts +14 -0
- package/dist/common/shared/color-picker/cmyk.js +78 -0
- package/dist/common/shared/color-picker/color.js +428 -0
- package/dist/common/shared/color-picker/gradient.js +180 -0
- package/dist/common/shared/color-picker/index.js +3 -0
- package/dist/common/shared/date.js +46 -0
- package/dist/common/shared/qrcode/qrcodegen.js +884 -0
- package/dist/common/shared/qrcode/utils.js +124 -0
- package/dist/common/src/control.js +66 -0
- package/dist/common/src/flatTool.js +99 -0
- package/dist/common/src/index.js +4 -0
- package/dist/common/src/instantiationDecorator.js +251 -0
- package/dist/common/src/superComponent.js +5 -0
- package/dist/common/style/_variables.less +232 -0
- package/dist/common/style/base.less +4 -0
- package/dist/common/style/icons.css +0 -0
- package/dist/common/style/index.css +13 -0
- package/dist/common/style/mixins/_border.less +34 -0
- package/dist/common/style/mixins/_clearfix.less +7 -0
- package/dist/common/style/mixins/_cursor.less +6 -0
- package/dist/common/style/mixins/_ellipsis.less +15 -0
- package/dist/common/style/mixins/_hairline.less +55 -0
- package/dist/common/style/mixins/_index.less +6 -0
- package/dist/common/style/mixins/_other.less +14 -0
- package/dist/common/style/theme/index.css +519 -0
- package/dist/common/style/theme/index.less +11 -0
- package/dist/common/style/theme/raw/_components.less +30 -0
- package/dist/common/style/theme/raw/_dark.less +178 -0
- package/dist/common/style/theme/raw/_font.less +90 -0
- package/dist/common/style/theme/raw/_light.less +182 -0
- package/dist/common/style/theme/raw/_radius.less +10 -0
- package/dist/common/style/theme/raw/_spacer.less +11 -0
- package/dist/common/style/utilities/index.css +13 -0
- package/dist/common/utils.js +358 -0
- package/dist/common/utils.wxs.js +139 -0
- package/dist/common/validator.js +38 -0
- package/dist/common/version.js +66 -0
- package/dist/common/wechat.js +22 -0
- package/dist/count-down/README.en-US.md +50 -0
- package/dist/count-down/README.md +76 -0
- package/dist/count-down/computed.js +3 -0
- package/dist/count-down/count-down.css +110 -0
- package/dist/count-down/count-down.vue +166 -0
- package/dist/count-down/props.ts +62 -0
- package/dist/count-down/type.ts +64 -0
- package/dist/count-down/utils.js +72 -0
- package/dist/date-time-picker/README.en-US.md +61 -0
- package/dist/date-time-picker/README.md +105 -0
- package/dist/date-time-picker/date-time-picker.css +4 -0
- package/dist/date-time-picker/date-time-picker.vue +570 -0
- package/dist/date-time-picker/locale/dayjs.js +81 -0
- package/dist/date-time-picker/locale/en.js +12 -0
- package/dist/date-time-picker/locale/ja.js +12 -0
- package/dist/date-time-picker/locale/ko.js +12 -0
- package/dist/date-time-picker/locale/ru.js +12 -0
- package/dist/date-time-picker/locale/tc.js +12 -0
- package/dist/date-time-picker/locale/zh.js +12 -0
- package/dist/date-time-picker/props.ts +114 -0
- package/dist/date-time-picker/type.ts +134 -0
- package/dist/demo/demo.vue +97 -0
- package/dist/demo/index.css +46 -0
- package/dist/demo-header/demo-header.vue +60 -0
- package/dist/demo-header/index.css +0 -0
- package/dist/demo-navbar/demo-navbar.vue +42 -0
- package/dist/dialog/README.en-US.md +69 -0
- package/dist/dialog/README.md +120 -0
- package/dist/dialog/computed.js +15 -0
- package/dist/dialog/dialog.css +102 -0
- package/dist/dialog/dialog.vue +422 -0
- package/dist/dialog/index.d.ts +42 -0
- package/dist/dialog/index.js +90 -0
- package/dist/dialog/props.ts +94 -0
- package/dist/dialog/type.ts +97 -0
- package/dist/divider/README.en-US.md +40 -0
- package/dist/divider/README.md +64 -0
- package/dist/divider/divider.css +56 -0
- package/dist/divider/divider.vue +79 -0
- package/dist/divider/props.ts +33 -0
- package/dist/divider/type.ts +27 -0
- package/dist/draggable/draggable.css +16 -0
- package/dist/draggable/draggable.vue +92 -0
- package/dist/draggable/props.js +19 -0
- package/dist/drawer/README.en-US.md +54 -0
- package/dist/drawer/README.md +80 -0
- package/dist/drawer/drawer.css +62 -0
- package/dist/drawer/drawer.vue +144 -0
- package/dist/drawer/props.ts +72 -0
- package/dist/drawer/type.ts +81 -0
- package/dist/dropdown-item/computed.js +6 -0
- package/dist/dropdown-item/dropdown-item.css +97 -0
- package/dist/dropdown-item/dropdown-item.vue +403 -0
- package/dist/dropdown-item/props.ts +71 -0
- package/dist/dropdown-item/type.ts +76 -0
- package/dist/dropdown-menu/README.en-US.md +95 -0
- package/dist/dropdown-menu/README.md +125 -0
- package/dist/dropdown-menu/dropdown-menu.css +59 -0
- package/dist/dropdown-menu/dropdown-menu.vue +188 -0
- package/dist/dropdown-menu/props.ts +44 -0
- package/dist/dropdown-menu/type.ts +41 -0
- package/dist/empty/README.en-US.md +39 -0
- package/dist/empty/README.md +69 -0
- package/dist/empty/empty.css +21 -0
- package/dist/empty/empty.vue +140 -0
- package/dist/empty/props.ts +20 -0
- package/dist/empty/type.ts +20 -0
- package/dist/fab/README.en-US.md +37 -0
- package/dist/fab/README.md +81 -0
- package/dist/fab/fab.css +9 -0
- package/dist/fab/fab.vue +238 -0
- package/dist/fab/props.ts +54 -0
- package/dist/fab/type.ts +57 -0
- package/dist/footer/README.en-US.md +33 -0
- package/dist/footer/README.md +61 -0
- package/dist/footer/footer.css +47 -0
- package/dist/footer/footer.vue +117 -0
- package/dist/footer/props.ts +23 -0
- package/dist/footer/type.ts +34 -0
- package/dist/form/README.en-US.md +137 -0
- package/dist/form/README.md +146 -0
- package/dist/form/form-item-props.ts +56 -0
- package/dist/form/form.css +169 -0
- package/dist/form/form.vue +287 -0
- package/dist/form/props.ts +109 -0
- package/dist/form/type.ts +387 -0
- package/dist/form-item/README.en-US.md +37 -0
- package/dist/form-item/README.md +37 -0
- package/dist/form-item/form-item.css +120 -0
- package/dist/form-item/form-item.vue +396 -0
- package/dist/form-item/form-model.ts +198 -0
- package/dist/form-item/props.ts +64 -0
- package/dist/form-item/type.ts +7 -0
- package/dist/grid/README.en-US.md +92 -0
- package/dist/grid/README.md +143 -0
- package/dist/grid/grid.css +13 -0
- package/dist/grid/grid.vue +94 -0
- package/dist/grid/props.ts +43 -0
- package/dist/grid/type.ts +43 -0
- package/dist/grid-item/README.en-US.md +65 -0
- package/dist/grid-item/README.md +65 -0
- package/dist/grid-item/grid-item.css +103 -0
- package/dist/grid-item/grid-item.vue +292 -0
- package/dist/grid-item/props.ts +63 -0
- package/dist/grid-item/type.ts +56 -0
- package/dist/guide/README.en-US.md +103 -0
- package/dist/guide/README.md +140 -0
- package/dist/guide/content.vue +325 -0
- package/dist/guide/guide.css +64 -0
- package/dist/guide/guide.vue +544 -0
- package/dist/guide/props.ts +98 -0
- package/dist/guide/type.ts +174 -0
- package/dist/icon/README.en-US.md +32 -0
- package/dist/icon/README.md +109 -0
- package/dist/icon/icon.css +7073 -0
- package/dist/icon/icon.vue +121 -0
- package/dist/icon/props.ts +35 -0
- package/dist/icon/type.ts +32 -0
- package/dist/image/README.en-US.md +51 -0
- package/dist/image/README.md +86 -0
- package/dist/image/image.css +44 -0
- package/dist/image/image.vue +207 -0
- package/dist/image/props.ts +71 -0
- package/dist/image/type.ts +85 -0
- package/dist/image-viewer/README.en-US.md +49 -0
- package/dist/image-viewer/README.md +78 -0
- package/dist/image-viewer/computed.js +4 -0
- package/dist/image-viewer/image-viewer.css +75 -0
- package/dist/image-viewer/image-viewer.vue +317 -0
- package/dist/image-viewer/props.ts +69 -0
- package/dist/image-viewer/type.ts +76 -0
- package/dist/indexes/README.en-US.md +76 -0
- package/dist/indexes/README.md +105 -0
- package/dist/indexes/computed.js +4 -0
- package/dist/indexes/indexes-anchor-props.ts +12 -0
- package/dist/indexes/indexes.css +50 -0
- package/dist/indexes/indexes.vue +371 -0
- package/dist/indexes/props.ts +40 -0
- package/dist/indexes/type.ts +38 -0
- package/dist/indexes-anchor/README.en-US.md +24 -0
- package/dist/indexes-anchor/README.md +28 -0
- package/dist/indexes-anchor/indexes-anchor.css +49 -0
- package/dist/indexes-anchor/indexes-anchor.vue +73 -0
- package/dist/indexes-anchor/props.ts +12 -0
- package/dist/indexes-anchor/type.ts +12 -0
- package/dist/input/README.en-US.md +121 -0
- package/dist/input/README.md +190 -0
- package/dist/input/computed.js +13 -0
- package/dist/input/input.css +161 -0
- package/dist/input/input.vue +407 -0
- package/dist/input/props.ts +247 -0
- package/dist/input/type.ts +237 -0
- package/dist/input/utils.js +38 -0
- package/dist/link/README.en-US.md +67 -0
- package/dist/link/README.md +115 -0
- package/dist/link/link.css +118 -0
- package/dist/link/link.vue +175 -0
- package/dist/link/props.ts +65 -0
- package/dist/link/type.ts +62 -0
- package/dist/loading/README.en-US.md +49 -0
- package/dist/loading/README.md +96 -0
- package/dist/loading/loading.css +203 -0
- package/dist/loading/loading.vue +157 -0
- package/dist/loading/props.ts +68 -0
- package/dist/loading/type.ts +70 -0
- package/dist/message/README.en-US.md +69 -0
- package/dist/message/README.md +105 -0
- package/dist/message/config.js +10 -0
- package/dist/message/index.d.ts +17 -0
- package/dist/message/index.js +39 -0
- package/dist/message/message.css +0 -0
- package/dist/message/message.interface.ts +30 -0
- package/dist/message/message.vue +275 -0
- package/dist/message/props.ts +101 -0
- package/dist/message/type.ts +101 -0
- package/dist/message-item/computed.js +23 -0
- package/dist/message-item/index.js +40 -0
- package/dist/message-item/message-item.css +63 -0
- package/dist/message-item/message-item.vue +353 -0
- package/dist/mixins/page-scroll.js +115 -0
- package/dist/mixins/skyline.js +12 -0
- package/dist/mixins/theme-change.js +16 -0
- package/dist/mixins/touch.js +29 -0
- package/dist/mixins/transition.js +133 -0
- package/dist/mixins/using-custom-navbar.js +38 -0
- package/dist/navbar/README.en-US.md +76 -0
- package/dist/navbar/README.md +121 -0
- package/dist/navbar/navbar.css +106 -0
- package/dist/navbar/navbar.vue +293 -0
- package/dist/navbar/props.ts +75 -0
- package/dist/navbar/type.ts +76 -0
- package/dist/notice-bar/README.en-US.md +62 -0
- package/dist/notice-bar/README.md +116 -0
- package/dist/notice-bar/notice-bar.css +75 -0
- package/dist/notice-bar/notice-bar.vue +326 -0
- package/dist/notice-bar/props.ts +71 -0
- package/dist/notice-bar/type.ts +71 -0
- package/dist/npm/dayjs/esm/constant.js +25 -0
- package/dist/npm/dayjs/esm/index.js +541 -0
- package/dist/npm/dayjs/esm/locale/en.js +12 -0
- package/dist/npm/dayjs/esm/locale/ja.js +45 -0
- package/dist/npm/dayjs/esm/locale/ko.js +45 -0
- package/dist/npm/dayjs/esm/locale/ru.js +99 -0
- package/dist/npm/dayjs/esm/locale/zh-cn.js +67 -0
- package/dist/npm/dayjs/esm/locale/zh-tw.js +65 -0
- package/dist/npm/dayjs/esm/plugin/localeData/index.js +114 -0
- package/dist/npm/dayjs/esm/plugin/localizedFormat/index.js +20 -0
- package/dist/npm/dayjs/esm/plugin/localizedFormat/utils.js +20 -0
- package/dist/npm/dayjs/esm/utils.js +58 -0
- package/dist/npm/tinycolor2/esm/tinycolor.js +1180 -0
- package/dist/overlay/README.en-US.md +34 -0
- package/dist/overlay/README.md +54 -0
- package/dist/overlay/overlay.css +17 -0
- package/dist/overlay/overlay.vue +105 -0
- package/dist/overlay/props.ts +37 -0
- package/dist/overlay/type.ts +42 -0
- package/dist/picker/README.en-US.md +77 -0
- package/dist/picker/README.md +112 -0
- package/dist/picker/picker.css +71 -0
- package/dist/picker/picker.vue +315 -0
- package/dist/picker/props.ts +95 -0
- package/dist/picker/type.ts +114 -0
- package/dist/picker-item/README.en-US.md +25 -0
- package/dist/picker-item/README.md +25 -0
- package/dist/picker-item/picker-item.css +32 -0
- package/dist/picker-item/picker-item.vue +446 -0
- package/dist/picker-item/props.ts +18 -0
- package/dist/picker-item/type.ts +23 -0
- package/dist/popover/README.en-US.md +55 -0
- package/dist/popover/README.md +85 -0
- package/dist/popover/popover.css +271 -0
- package/dist/popover/popover.vue +352 -0
- package/dist/popover/props.ts +58 -0
- package/dist/popover/type.ts +61 -0
- package/dist/popup/README.en-US.md +53 -0
- package/dist/popup/README.md +82 -0
- package/dist/popup/computed.js +14 -0
- package/dist/popup/popup.css +80 -0
- package/dist/popup/popup.vue +141 -0
- package/dist/popup/props.ts +67 -0
- package/dist/popup/type.ts +72 -0
- package/dist/progress/README.en-US.md +52 -0
- package/dist/progress/README.md +87 -0
- package/dist/progress/computed.js +81 -0
- package/dist/progress/progress.css +136 -0
- package/dist/progress/progress.vue +259 -0
- package/dist/progress/props.ts +55 -0
- package/dist/progress/type.ts +50 -0
- package/dist/progress/utils.js +19 -0
- package/dist/pull-down-refresh/README.en-US.md +60 -0
- package/dist/pull-down-refresh/README.md +83 -0
- package/dist/pull-down-refresh/props.ts +112 -0
- package/dist/pull-down-refresh/pull-down-refresh.css +29 -0
- package/dist/pull-down-refresh/pull-down-refresh.vue +366 -0
- package/dist/pull-down-refresh/type.ts +118 -0
- package/dist/qrcode/README.en-US.md +40 -0
- package/dist/qrcode/README.md +97 -0
- package/dist/qrcode/components/qrcode-canvas/props.ts +48 -0
- package/dist/qrcode/components/qrcode-canvas/qrcode-canvas.css +7 -0
- package/dist/qrcode/components/qrcode-canvas/qrcode-canvas.vue +413 -0
- package/dist/qrcode/components/qrcode-status/props.ts +22 -0
- package/dist/qrcode/components/qrcode-status/qrcode-status.css +25 -0
- package/dist/qrcode/components/qrcode-status/qrcode-status.vue +94 -0
- package/dist/qrcode/components/qrcode-status/type.ts +25 -0
- package/dist/qrcode/hooks/useQRCode.js +25 -0
- package/dist/qrcode/props.ts +66 -0
- package/dist/qrcode/qrcode.css +31 -0
- package/dist/qrcode/qrcode.vue +144 -0
- package/dist/qrcode/type.ts +66 -0
- package/dist/radio/README.en-US.md +104 -0
- package/dist/radio/README.md +148 -0
- package/dist/radio/props.ts +86 -0
- package/dist/radio/radio.css +177 -0
- package/dist/radio/radio.vue +227 -0
- package/dist/radio/type.ts +89 -0
- package/dist/radio-group/props.ts +68 -0
- package/dist/radio-group/radio-group.css +0 -0
- package/dist/radio-group/radio-group.vue +205 -0
- package/dist/radio-group/type.ts +79 -0
- package/dist/rate/README.en-US.md +50 -0
- package/dist/rate/README.md +107 -0
- package/dist/rate/computed.js +66 -0
- package/dist/rate/props.ts +85 -0
- package/dist/rate/rate.css +81 -0
- package/dist/rate/rate.vue +276 -0
- package/dist/rate/type.ts +79 -0
- package/dist/result/README.en-US.md +47 -0
- package/dist/result/README.md +88 -0
- package/dist/result/props.ts +36 -0
- package/dist/result/result.css +35 -0
- package/dist/result/result.vue +128 -0
- package/dist/result/type.ts +31 -0
- package/dist/row/computed.js +13 -0
- package/dist/row/props.ts +12 -0
- package/dist/row/row.css +6 -0
- package/dist/row/row.vue +63 -0
- package/dist/row/type.ts +12 -0
- package/dist/script/postinstall.js +46 -0
- package/dist/scroll-view/scroll-view.css +0 -0
- package/dist/scroll-view/scroll-view.vue +52 -0
- package/dist/search/README.en-US.md +88 -0
- package/dist/search/README.md +126 -0
- package/dist/search/computed.js +3 -0
- package/dist/search/props.ts +171 -0
- package/dist/search/search.css +75 -0
- package/dist/search/search.vue +285 -0
- package/dist/search/type.ts +165 -0
- package/dist/side-bar/README.en-US.md +58 -0
- package/dist/side-bar/README.md +89 -0
- package/dist/side-bar/props.ts +26 -0
- package/dist/side-bar/side-bar-item-props.ts +27 -0
- package/dist/side-bar/side-bar.css +14 -0
- package/dist/side-bar/side-bar.vue +84 -0
- package/dist/side-bar/type.ts +24 -0
- package/dist/side-bar-item/props.ts +27 -0
- package/dist/side-bar-item/side-bar-item.css +66 -0
- package/dist/side-bar-item/side-bar-item.vue +168 -0
- package/dist/side-bar-item/type.ts +32 -0
- package/dist/skeleton/README.en-US.md +44 -0
- package/dist/skeleton/README.md +82 -0
- package/dist/skeleton/props.ts +41 -0
- package/dist/skeleton/skeleton.css +77 -0
- package/dist/skeleton/skeleton.vue +211 -0
- package/dist/skeleton/type.ts +44 -0
- package/dist/slider/README.en-US.md +63 -0
- package/dist/slider/README.md +127 -0
- package/dist/slider/computed.js +9 -0
- package/dist/slider/props.ts +79 -0
- package/dist/slider/slider.css +239 -0
- package/dist/slider/slider.vue +719 -0
- package/dist/slider/tool.js +43 -0
- package/dist/slider/type.ts +81 -0
- package/dist/step-item/computed.js +4 -0
- package/dist/step-item/props.ts +36 -0
- package/dist/step-item/step-item.css +182 -0
- package/dist/step-item/step-item.vue +175 -0
- package/dist/step-item/type.ts +33 -0
- package/dist/stepper/README.en-US.md +49 -0
- package/dist/stepper/README.md +90 -0
- package/dist/stepper/props.ts +88 -0
- package/dist/stepper/stepper.css +105 -0
- package/dist/stepper/stepper.vue +223 -0
- package/dist/stepper/type.ts +79 -0
- package/dist/steps/README.en-US.md +99 -0
- package/dist/steps/README.md +157 -0
- package/dist/steps/props.ts +63 -0
- package/dist/steps/steps.css +19 -0
- package/dist/steps/steps.vue +122 -0
- package/dist/steps/type.ts +44 -0
- package/dist/sticky/README.en-US.md +32 -0
- package/dist/sticky/README.md +66 -0
- package/dist/sticky/props.ts +30 -0
- package/dist/sticky/sticky.css +3 -0
- package/dist/sticky/sticky.vue +144 -0
- package/dist/sticky/type.ts +31 -0
- package/dist/swipe-cell/README.en-US.md +29 -0
- package/dist/swipe-cell/README.md +66 -0
- package/dist/swipe-cell/computed.js +166 -0
- package/dist/swipe-cell/props.ts +39 -0
- package/dist/swipe-cell/swipe-cell.css +31 -0
- package/dist/swipe-cell/swipe-cell.vue +245 -0
- package/dist/swipe-cell/type.ts +48 -0
- package/dist/swiper/README.en-US.md +89 -0
- package/dist/swiper/README.md +139 -0
- package/dist/swiper/computed.js +29 -0
- package/dist/swiper/props.ts +117 -0
- package/dist/swiper/swiper.css +21 -0
- package/dist/swiper/swiper.vue +193 -0
- package/dist/swiper/type.ts +112 -0
- package/dist/swiper-nav/props.ts +49 -0
- package/dist/swiper-nav/swiper-nav.css +130 -0
- package/dist/swiper-nav/swiper-nav.vue +93 -0
- package/dist/swiper-nav/type.ts +45 -0
- package/dist/switch/README.en-US.md +70 -0
- package/dist/switch/README.md +104 -0
- package/dist/switch/props.ts +53 -0
- package/dist/switch/switch.css +123 -0
- package/dist/switch/switch.vue +122 -0
- package/dist/switch/type.ts +51 -0
- package/dist/tab-bar/README.en-US.md +58 -0
- package/dist/tab-bar/README.md +104 -0
- package/dist/tab-bar/props.ts +62 -0
- package/dist/tab-bar/tab-bar.css +42 -0
- package/dist/tab-bar/tab-bar.vue +141 -0
- package/dist/tab-bar/type.ts +56 -0
- package/dist/tab-bar-item/props.ts +25 -0
- package/dist/tab-bar-item/tab-bar-item.css +117 -0
- package/dist/tab-bar-item/tab-bar-item.vue +222 -0
- package/dist/tab-bar-item/type.ts +32 -0
- package/dist/tab-panel/props.ts +34 -0
- package/dist/tab-panel/tab-panel.css +15 -0
- package/dist/tab-panel/tab-panel.vue +100 -0
- package/dist/tab-panel/type.ts +42 -0
- package/dist/tabs/README.en-US.md +89 -0
- package/dist/tabs/README.md +198 -0
- package/dist/tabs/computed.js +26 -0
- package/dist/tabs/props.ts +80 -0
- package/dist/tabs/tabs.css +183 -0
- package/dist/tabs/tabs.vue +494 -0
- package/dist/tabs/type.ts +77 -0
- package/dist/tag/README.en-US.md +113 -0
- package/dist/tag/README.md +151 -0
- package/dist/tag/props.ts +70 -0
- package/dist/tag/tag.css +208 -0
- package/dist/tag/tag.vue +161 -0
- package/dist/tag/type.ts +54 -0
- package/dist/tdesign-uniapp/tdesign-uniapp.vue +11 -0
- package/dist/textarea/README.en-US.md +78 -0
- package/dist/textarea/README.md +132 -0
- package/dist/textarea/computed.js +14 -0
- package/dist/textarea/props.ts +152 -0
- package/dist/textarea/textarea.css +67 -0
- package/dist/textarea/textarea.vue +227 -0
- package/dist/textarea/type.ts +167 -0
- package/dist/toast/README.en-US.md +51 -0
- package/dist/toast/README.md +78 -0
- package/dist/toast/index.d.ts +20 -0
- package/dist/toast/index.js +27 -0
- package/dist/toast/props.ts +68 -0
- package/dist/toast/toast.css +73 -0
- package/dist/toast/toast.vue +213 -0
- package/dist/toast/type.ts +64 -0
- package/dist/transition/README.en-US.md +13 -0
- package/dist/transition/README.md +45 -0
- package/dist/transition/props.js +22 -0
- package/dist/transition/transition.css +14 -0
- package/dist/transition/transition.vue +51 -0
- package/dist/tree-select/README.en-US.md +48 -0
- package/dist/tree-select/README.md +78 -0
- package/dist/tree-select/computed.js +6 -0
- package/dist/tree-select/props.ts +42 -0
- package/dist/tree-select/tree-select.css +44 -0
- package/dist/tree-select/tree-select.vue +319 -0
- package/dist/tree-select/type.ts +49 -0
- package/dist/tsconfig.eslint.json +13 -0
- package/dist/types/action-sheet.d.ts +7 -0
- package/dist/types/avatar-group.d.ts +7 -0
- package/dist/types/avatar.d.ts +7 -0
- package/dist/types/back-top.d.ts +7 -0
- package/dist/types/badge.d.ts +7 -0
- package/dist/types/button.d.ts +7 -0
- package/dist/types/calendar.d.ts +7 -0
- package/dist/types/cascader.d.ts +7 -0
- package/dist/types/cell-group.d.ts +7 -0
- package/dist/types/cell.d.ts +7 -0
- package/dist/types/check-tag.d.ts +7 -0
- package/dist/types/checkbox-group.d.ts +7 -0
- package/dist/types/checkbox.d.ts +7 -0
- package/dist/types/col.d.ts +7 -0
- package/dist/types/collapse-panel.d.ts +7 -0
- package/dist/types/collapse.d.ts +7 -0
- package/dist/types/color-picker.d.ts +7 -0
- package/dist/types/count-down.d.ts +7 -0
- package/dist/types/date-time-picker.d.ts +7 -0
- package/dist/types/dialog.d.ts +7 -0
- package/dist/types/divider.d.ts +7 -0
- package/dist/types/drawer.d.ts +7 -0
- package/dist/types/dropdown-item.d.ts +7 -0
- package/dist/types/dropdown-menu.d.ts +7 -0
- package/dist/types/empty.d.ts +7 -0
- package/dist/types/fab.d.ts +7 -0
- package/dist/types/footer.d.ts +7 -0
- package/dist/types/form-item.d.ts +7 -0
- package/dist/types/form.d.ts +7 -0
- package/dist/types/grid-item.d.ts +7 -0
- package/dist/types/grid.d.ts +7 -0
- package/dist/types/guide.d.ts +7 -0
- package/dist/types/icon.d.ts +7 -0
- package/dist/types/image-viewer.d.ts +7 -0
- package/dist/types/image.d.ts +7 -0
- package/dist/types/index.d.ts +77 -0
- package/dist/types/indexes-anchor.d.ts +7 -0
- package/dist/types/indexes.d.ts +7 -0
- package/dist/types/input.d.ts +7 -0
- package/dist/types/link.d.ts +7 -0
- package/dist/types/loading.d.ts +7 -0
- package/dist/types/message.d.ts +7 -0
- package/dist/types/navbar.d.ts +7 -0
- package/dist/types/notice-bar.d.ts +7 -0
- package/dist/types/overlay.d.ts +7 -0
- package/dist/types/picker-item.d.ts +7 -0
- package/dist/types/picker.d.ts +7 -0
- package/dist/types/popup.d.ts +7 -0
- package/dist/types/progress.d.ts +7 -0
- package/dist/types/pull-down-refresh.d.ts +7 -0
- package/dist/types/qrcode.d.ts +7 -0
- package/dist/types/radio-group.d.ts +7 -0
- package/dist/types/radio.d.ts +7 -0
- package/dist/types/rate.d.ts +7 -0
- package/dist/types/result.d.ts +7 -0
- package/dist/types/row.d.ts +7 -0
- package/dist/types/search.d.ts +7 -0
- package/dist/types/side-bar-item.d.ts +7 -0
- package/dist/types/side-bar.d.ts +7 -0
- package/dist/types/skeleton.d.ts +7 -0
- package/dist/types/slider.d.ts +7 -0
- package/dist/types/step-item.d.ts +7 -0
- package/dist/types/stepper.d.ts +7 -0
- package/dist/types/steps.d.ts +7 -0
- package/dist/types/sticky.d.ts +7 -0
- package/dist/types/swipe-cell.d.ts +7 -0
- package/dist/types/swiper-nav.d.ts +7 -0
- package/dist/types/swiper.d.ts +7 -0
- package/dist/types/switch.d.ts +7 -0
- package/dist/types/tab-bar-item.d.ts +7 -0
- package/dist/types/tab-bar.d.ts +7 -0
- package/dist/types/tab-panel.d.ts +7 -0
- package/dist/types/tabs.d.ts +7 -0
- package/dist/types/tag.d.ts +7 -0
- package/dist/types/textarea.d.ts +7 -0
- package/dist/types/toast.d.ts +7 -0
- package/dist/types/tree-select.d.ts +7 -0
- package/dist/types/upload.d.ts +7 -0
- package/dist/types/watermark.d.ts +7 -0
- package/dist/upload/README.en-US.md +63 -0
- package/dist/upload/README.md +116 -0
- package/dist/upload/drag.computed.js +227 -0
- package/dist/upload/props.ts +136 -0
- package/dist/upload/type.ts +197 -0
- package/dist/upload/upload.computed.js +13 -0
- package/dist/upload/upload.css +116 -0
- package/dist/upload/upload.vue +887 -0
- package/dist/watermark/README.en-US.md +63 -0
- package/dist/watermark/README.md +115 -0
- package/dist/watermark/props.ts +82 -0
- package/dist/watermark/type.ts +121 -0
- package/dist/watermark/utils/generateBase64Url.js +360 -0
- package/dist/watermark/utils/randomMovingStyle.js +27 -0
- package/dist/watermark/watermark.css +28 -0
- package/dist/watermark/watermark.vue +200 -0
- package/global.d.ts +84 -0
- package/package.json +504 -8
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC
|
|
5
|
+
* */
|
|
6
|
+
|
|
7
|
+
import type { TdImageProps as ImageProps } from '../image/type';
|
|
8
|
+
|
|
9
|
+
export interface TdImageViewerProps {
|
|
10
|
+
/**
|
|
11
|
+
* 遮罩的背景颜色
|
|
12
|
+
* @default ''
|
|
13
|
+
*/
|
|
14
|
+
backgroundColor?: string;
|
|
15
|
+
/**
|
|
16
|
+
* 是否显示关闭操作,前提需要开启页码。值为字符串表示图标名称,值为 `true` 表示使用默认图标 `close`,值为 `Object` 类型,表示透传至 `icon` ,不传表示不显示图标
|
|
17
|
+
* @default false
|
|
18
|
+
*/
|
|
19
|
+
closeBtn?: string | boolean | object;
|
|
20
|
+
/**
|
|
21
|
+
* 是否显示删除操作,前提需要开启页码。值为字符串表示图标名称,值为 `true` 表示使用默认图标 `delete`,值为 `Object` 类型,表示透传至 `icon`,不传表示不显示图标
|
|
22
|
+
* @default false
|
|
23
|
+
*/
|
|
24
|
+
deleteBtn?: string | boolean | object;
|
|
25
|
+
/**
|
|
26
|
+
* 透传至 Image 组件
|
|
27
|
+
*/
|
|
28
|
+
imageProps?: ImageProps;
|
|
29
|
+
/**
|
|
30
|
+
* 图片数组
|
|
31
|
+
* @default []
|
|
32
|
+
*/
|
|
33
|
+
images?: Array<string>;
|
|
34
|
+
/**
|
|
35
|
+
* 初始化页码
|
|
36
|
+
* @default 0
|
|
37
|
+
*/
|
|
38
|
+
initialIndex?: Number;
|
|
39
|
+
/**
|
|
40
|
+
* 是否开启图片懒加载。开启后会预加载当前图片、相邻图片
|
|
41
|
+
* @default true
|
|
42
|
+
*/
|
|
43
|
+
lazy?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* 是否显示页码
|
|
46
|
+
* @default false
|
|
47
|
+
*/
|
|
48
|
+
showIndex?: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* 是否使用了自定义导航栏
|
|
51
|
+
* @default false
|
|
52
|
+
*/
|
|
53
|
+
usingCustomNavbar?: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* 隐藏/显示预览
|
|
56
|
+
* @default false
|
|
57
|
+
*/
|
|
58
|
+
visible?: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* 隐藏/显示预览,非受控属性
|
|
61
|
+
* @default false
|
|
62
|
+
*/
|
|
63
|
+
defaultVisible?: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* 翻页时回调
|
|
66
|
+
*/
|
|
67
|
+
onChange?: (context: { index: number }) => void;
|
|
68
|
+
/**
|
|
69
|
+
* 点击操作按钮button或者overlay时触发
|
|
70
|
+
*/
|
|
71
|
+
onClose?: (context: { trigger: 'overlay' | 'button'; visible: Boolean; index: Number }) => void;
|
|
72
|
+
/**
|
|
73
|
+
* 点击删除操作按钮时触发
|
|
74
|
+
*/
|
|
75
|
+
onDelete?: (context: { index: number }) => void;
|
|
76
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
:: BASE_DOC ::
|
|
2
|
+
|
|
3
|
+
## API
|
|
4
|
+
|
|
5
|
+
### Indexes Props
|
|
6
|
+
|
|
7
|
+
name | type | default | description | required
|
|
8
|
+
-- | -- | -- | -- | --
|
|
9
|
+
custom-style | Object | - | CSS(Cascading Style Sheets) | N
|
|
10
|
+
current | String / Number | - | `v-model:current` is supported | N
|
|
11
|
+
default-current | String / Number | - | uncontrolled property | N
|
|
12
|
+
index-list | Array | - | Typescript:`Array<string \| number>` | N
|
|
13
|
+
list | Array | [] | `deprecated`。Typescript:`ListItem[] ` `interface ListItem { title: string; index: string; children: { title: string; [key: string]: any} [] }`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/packages/uniapp-components/indexes/type.ts) | N
|
|
14
|
+
sticky | Boolean | true | Typescript:`Boolean` | N
|
|
15
|
+
sticky-offset | Number | 0 | \- | N
|
|
16
|
+
|
|
17
|
+
### Indexes Events
|
|
18
|
+
|
|
19
|
+
name | params | description
|
|
20
|
+
-- | -- | --
|
|
21
|
+
change | `(context: { index: string \| number })` | \-
|
|
22
|
+
select | `(context: { index: string \| number })` | \-
|
|
23
|
+
|
|
24
|
+
### Indexes Slots
|
|
25
|
+
|
|
26
|
+
name | Description
|
|
27
|
+
-- | --
|
|
28
|
+
\- | \-
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
### IndexesAnchor Props
|
|
32
|
+
|
|
33
|
+
name | type | default | description | required
|
|
34
|
+
-- | -- | -- | -- | --
|
|
35
|
+
custom-style | Object | - | CSS(Cascading Style Sheets) | N
|
|
36
|
+
index | String / Number | - | \- | N
|
|
37
|
+
|
|
38
|
+
### IndexesAnchor Slots
|
|
39
|
+
|
|
40
|
+
name | Description
|
|
41
|
+
-- | --
|
|
42
|
+
\- | \-
|
|
43
|
+
|
|
44
|
+
### IndexesAnchor External Classes
|
|
45
|
+
|
|
46
|
+
className | Description
|
|
47
|
+
-- | --
|
|
48
|
+
t-class | class name of root node
|
|
49
|
+
t-class-sidebar | \-
|
|
50
|
+
t-class-sidebar-item | \-
|
|
51
|
+
|
|
52
|
+
### CSS Variables
|
|
53
|
+
|
|
54
|
+
The component provides the following CSS variables, which can be used to customize styles.
|
|
55
|
+
Name | Default Value | Description
|
|
56
|
+
-- | -- | --
|
|
57
|
+
--td-indexes-sidebar-active-bg-color | @brand-color | -
|
|
58
|
+
--td-indexes-sidebar-active-color | @text-color-anti | -
|
|
59
|
+
--td-indexes-sidebar-color | @text-color-primary | -
|
|
60
|
+
--td-indexes-sidebar-font | @font-body-small | -
|
|
61
|
+
--td-indexes-sidebar-item-size | 40rpx | -
|
|
62
|
+
--td-indexes-sidebar-right | 16rpx | -
|
|
63
|
+
--td-indexes-sidebar-tips-bg-color | @brand-color-light | -
|
|
64
|
+
--td-indexes-sidebar-tips-color | @brand-color | -
|
|
65
|
+
--td-indexes-sidebar-tips-font | @font-title-extraLarge | -
|
|
66
|
+
--td-indexes-sidebar-tips-right | calc(100% + 32rpx) | -
|
|
67
|
+
--td-indexes-sidebar-tips-size | 96rpx | -
|
|
68
|
+
--td-indexes-anchor-active-bg-color | @bg-color-container | -
|
|
69
|
+
--td-indexes-anchor-active-color | @brand-color | -
|
|
70
|
+
--td-indexes-anchor-active-font-weight | 600 | -
|
|
71
|
+
--td-indexes-anchor-bg-color | @bg-color-secondarycontainer | -
|
|
72
|
+
--td-indexes-anchor-border-color | @component-border | -
|
|
73
|
+
--td-indexes-anchor-color | @text-color-primary | -
|
|
74
|
+
--td-indexes-anchor-font | @font-body-medium | -
|
|
75
|
+
--td-indexes-anchor-padding | 8rpx 32rpx | -
|
|
76
|
+
--td-indexes-anchor-top | 0 | -
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Indexes 索引
|
|
3
|
+
description: 用于页面中信息快速检索,可以根据目录中的页码快速找到所需的内容。
|
|
4
|
+
spline: navigation
|
|
5
|
+
isComponent: true
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## 引入
|
|
9
|
+
|
|
10
|
+
可在 `main.ts` 或在需要使用的页面或组件中引入。
|
|
11
|
+
|
|
12
|
+
```js
|
|
13
|
+
import TIndexes from '@tdesign/uniapp/indexes/indexes.vue';
|
|
14
|
+
import TIndexesAnchor from '@tdesign/uniapp/indexes-anchor/indexes-anchor.vue';
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
### 基础索引
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
{{ base }}
|
|
21
|
+
|
|
22
|
+
### 自定义索引
|
|
23
|
+
|
|
24
|
+
{{ custom }}
|
|
25
|
+
|
|
26
|
+
## FAQ
|
|
27
|
+
|
|
28
|
+
### 在滚动元素中, Indexes 索引组件失效([#3746](https://github.com/Tencent/tdesign-miniprogram/issues/3746))?
|
|
29
|
+
|
|
30
|
+
`Indexes` 组件自 `0.32.0` 版本开始移除了对 `scroll-view` 的依赖,组件内部使用 [wx.pageScrollTo](https://developers.weixin.qq.com/miniprogram/dev/api/ui/scroll/wx.pageScrollTo.html) 滚动到指定位置,因此只支持页面级滚动,不支持在滚动元素中嵌套使用,包括 overflow: scroll、 scroll-view 等。
|
|
31
|
+
|
|
32
|
+
### API
|
|
33
|
+
|
|
34
|
+
### Indexes Props
|
|
35
|
+
|
|
36
|
+
名称 | 类型 | 默认值 | 描述 | 必传
|
|
37
|
+
-- | -- | -- | -- | --
|
|
38
|
+
custom-style | Object | - | 自定义样式 | N
|
|
39
|
+
current | String / Number | - | 索引列表的激活项,默认首项。支持语法糖 `v-model:current` | N
|
|
40
|
+
default-current | String / Number | - | 索引列表的激活项,默认首项。非受控属性 | N
|
|
41
|
+
index-list | Array | - | 索引字符列表。不传默认 `A-Z`。TS 类型:`Array<string \| number>` | N
|
|
42
|
+
list | Array | [] | 已废弃。索引列表的列表数据。每个元素包含三个子元素,index(string):索引值,例如1,2,3,...或A,B,C等;title(string): 索引标题,可不填将默认设为索引值;children(Array<{title: string}>): 子元素列表,title为子元素的展示文案。TS 类型:`ListItem[] ` `interface ListItem { title: string; index: string; children: { title: string; [key: string]: any} [] }`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/packages/uniapp-components/indexes/type.ts) | N
|
|
43
|
+
sticky | Boolean | true | 索引是否吸顶,默认为true。TS 类型:`Boolean` | N
|
|
44
|
+
sticky-offset | Number | 0 | 锚点吸顶时与顶部的距离 | N
|
|
45
|
+
|
|
46
|
+
### Indexes Events
|
|
47
|
+
|
|
48
|
+
名称 | 参数 | 描述
|
|
49
|
+
-- | -- | --
|
|
50
|
+
change | `(context: { index: string \| number })` | 索引发生变更时触发事件
|
|
51
|
+
select | `(context: { index: string \| number })` | 点击侧边栏时触发事件
|
|
52
|
+
|
|
53
|
+
### Indexes Slots
|
|
54
|
+
|
|
55
|
+
名称 | 描述
|
|
56
|
+
-- | --
|
|
57
|
+
\- | 默认插槽,自定义内容区域内容
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
### IndexesAnchor Props
|
|
61
|
+
|
|
62
|
+
名称 | 类型 | 默认值 | 描述 | 必传
|
|
63
|
+
-- | -- | -- | -- | --
|
|
64
|
+
custom-style | Object | - | 自定义样式 | N
|
|
65
|
+
index | String / Number | - | 索引字符 | N
|
|
66
|
+
|
|
67
|
+
### IndexesAnchor Slots
|
|
68
|
+
|
|
69
|
+
名称 | 描述
|
|
70
|
+
-- | --
|
|
71
|
+
\- | 默认插槽,自定义内容区域内容
|
|
72
|
+
|
|
73
|
+
### IndexesAnchor External Classes
|
|
74
|
+
|
|
75
|
+
类名 | 描述
|
|
76
|
+
-- | --
|
|
77
|
+
t-class | 根节点样式类
|
|
78
|
+
t-class-sidebar | 侧边栏样式类
|
|
79
|
+
t-class-sidebar-item | 侧边栏选项样式类
|
|
80
|
+
|
|
81
|
+
### CSS Variables
|
|
82
|
+
|
|
83
|
+
组件提供了下列 CSS 变量,可用于自定义样式。
|
|
84
|
+
名称 | 默认值 | 描述
|
|
85
|
+
-- | -- | --
|
|
86
|
+
--td-indexes-sidebar-active-bg-color | @brand-color | -
|
|
87
|
+
--td-indexes-sidebar-active-color | @text-color-anti | -
|
|
88
|
+
--td-indexes-sidebar-color | @text-color-primary | -
|
|
89
|
+
--td-indexes-sidebar-font | @font-body-small | -
|
|
90
|
+
--td-indexes-sidebar-item-size | 40rpx | -
|
|
91
|
+
--td-indexes-sidebar-right | 16rpx | -
|
|
92
|
+
--td-indexes-sidebar-tips-bg-color | @brand-color-light | -
|
|
93
|
+
--td-indexes-sidebar-tips-color | @brand-color | -
|
|
94
|
+
--td-indexes-sidebar-tips-font | @font-title-extraLarge | -
|
|
95
|
+
--td-indexes-sidebar-tips-right | calc(100% + 32rpx) | -
|
|
96
|
+
--td-indexes-sidebar-tips-size | 96rpx | -
|
|
97
|
+
--td-indexes-anchor-active-bg-color | @bg-color-container | -
|
|
98
|
+
--td-indexes-anchor-active-color | @brand-color | -
|
|
99
|
+
--td-indexes-anchor-active-font-weight | 600 | -
|
|
100
|
+
--td-indexes-anchor-bg-color | @bg-color-secondarycontainer | -
|
|
101
|
+
--td-indexes-anchor-border-color | @component-border | -
|
|
102
|
+
--td-indexes-anchor-color | @text-color-primary | -
|
|
103
|
+
--td-indexes-anchor-font | @font-body-medium | -
|
|
104
|
+
--td-indexes-anchor-padding | 8rpx 32rpx | -
|
|
105
|
+
--td-indexes-anchor-top | 0 | -
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
.t-indexes {
|
|
2
|
+
position: relative;
|
|
3
|
+
height: 100vh;
|
|
4
|
+
}
|
|
5
|
+
.t-indexes__sidebar {
|
|
6
|
+
position: fixed;
|
|
7
|
+
right: var(--td-indexes-sidebar-right, 16rpx);
|
|
8
|
+
width: var(--td-indexes-sidebar-item-size, 40rpx);
|
|
9
|
+
color: var(--td-indexes-sidebar-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
|
|
10
|
+
font: var(--td-indexes-sidebar-font, var(--td-font-body-small, 24rpx / 40rpx var(--td-font-family, PingFang SC, Microsoft YaHei, Arial Regular)));
|
|
11
|
+
display: flex;
|
|
12
|
+
flex-flow: column nowrap;
|
|
13
|
+
top: 50%;
|
|
14
|
+
transform: translateY(-50%);
|
|
15
|
+
z-index: 1;
|
|
16
|
+
}
|
|
17
|
+
.t-indexes__sidebar-item {
|
|
18
|
+
border-radius: 50%;
|
|
19
|
+
position: relative;
|
|
20
|
+
text-align: center;
|
|
21
|
+
}
|
|
22
|
+
.t-indexes__sidebar-item--active {
|
|
23
|
+
background-color: var(--td-indexes-sidebar-active-bg-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
|
|
24
|
+
color: var(--td-indexes-sidebar-active-color, var(--td-text-color-anti, var(--td-font-white-1, #ffffff)));
|
|
25
|
+
}
|
|
26
|
+
.t-indexes__sidebar-item + .t-indexes__sidebar-item {
|
|
27
|
+
margin-top: 4rpx;
|
|
28
|
+
}
|
|
29
|
+
.t-indexes__sidebar-tips {
|
|
30
|
+
display: flex;
|
|
31
|
+
align-items: center;
|
|
32
|
+
justify-content: center;
|
|
33
|
+
min-width: var(--td-indexes-sidebar-tips-size, 96rpx);
|
|
34
|
+
max-width: 198rpx;
|
|
35
|
+
padding: 0 32rpx;
|
|
36
|
+
box-sizing: border-box;
|
|
37
|
+
white-space: nowrap;
|
|
38
|
+
overflow: hidden;
|
|
39
|
+
text-overflow: ellipsis;
|
|
40
|
+
height: var(--td-indexes-sidebar-tips-size, 96rpx);
|
|
41
|
+
font: var(--td-indexes-sidebar-tips-font, var(--td-font-title-extraLarge, 600 40rpx / 56rpx var(--td-font-family, PingFang SC, Microsoft YaHei, Arial Regular)));
|
|
42
|
+
color: var(--td-indexes-sidebar-tips-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
|
|
43
|
+
background-color: var(--td-indexes-sidebar-tips-bg-color, var(--td-brand-color-light, var(--td-primary-color-1, #f2f3ff)));
|
|
44
|
+
border-radius: var(--td-indexes-sidebar-tips-size, 96rpx);
|
|
45
|
+
position: absolute;
|
|
46
|
+
top: 50%;
|
|
47
|
+
bottom: 0;
|
|
48
|
+
transform: translateY(-50%);
|
|
49
|
+
right: var(--td-indexes-sidebar-tips-right, calc(100% + 32rpx));
|
|
50
|
+
}
|
|
@@ -0,0 +1,371 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view
|
|
3
|
+
:style="tools._style([customStyle])"
|
|
4
|
+
:class="classPrefix + ' ' + tClass"
|
|
5
|
+
disable-scroll
|
|
6
|
+
>
|
|
7
|
+
<view
|
|
8
|
+
:id="'id-' + classPrefix + '__bar'"
|
|
9
|
+
:class="classPrefix + '__sidebar ' + tClassSidebar"
|
|
10
|
+
@touchmove.stop.prevent="onTouchMove"
|
|
11
|
+
@touchcancel.stop.prevent="onTouchCancel"
|
|
12
|
+
@touchend.stop.prevent="onTouchEnd"
|
|
13
|
+
>
|
|
14
|
+
<view
|
|
15
|
+
v-for="(item, index) in _indexList"
|
|
16
|
+
:key="index"
|
|
17
|
+
:class="tools.cls(classPrefix + '__sidebar-item', [['active', dataCurrent === item]]) + ' ' + tClassSidebarItem"
|
|
18
|
+
:data-index="index"
|
|
19
|
+
@click.stop="onClick(item, index)"
|
|
20
|
+
>
|
|
21
|
+
<view
|
|
22
|
+
aria-role="button"
|
|
23
|
+
:aria-label="dataCurrent === item ? '已选中' + item : ''"
|
|
24
|
+
>
|
|
25
|
+
{{ getFirstCharacter(item) }}
|
|
26
|
+
</view>
|
|
27
|
+
|
|
28
|
+
<view
|
|
29
|
+
v-if="showTips && dataCurrent === item"
|
|
30
|
+
:class="classPrefix + '__sidebar-tips'"
|
|
31
|
+
>
|
|
32
|
+
{{ dataCurrent }}
|
|
33
|
+
</view>
|
|
34
|
+
</view>
|
|
35
|
+
</view>
|
|
36
|
+
<slot />
|
|
37
|
+
</view>
|
|
38
|
+
</template>
|
|
39
|
+
<script>
|
|
40
|
+
import TIcon from '../icon/icon';
|
|
41
|
+
import TCell from '../cell/cell';
|
|
42
|
+
import TCellGroup from '../cell-group/cell-group';
|
|
43
|
+
import { uniComponent } from '../common/src/index';
|
|
44
|
+
import { prefix } from '../common/config';
|
|
45
|
+
import props from './props';
|
|
46
|
+
import { getRect, throttle, systemInfo } from '../common/utils';
|
|
47
|
+
import pageScrollMixin from '../mixins/page-scroll';
|
|
48
|
+
import tools from '../common/utils.wxs';
|
|
49
|
+
import { getFirstCharacter } from './computed.js';
|
|
50
|
+
import { ParentMixin, RELATION_MAP } from '../common/relation';
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
const name = `${prefix}-indexes`;
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
export default uniComponent({
|
|
57
|
+
name,
|
|
58
|
+
options: {
|
|
59
|
+
styleIsolation: 'shared',
|
|
60
|
+
},
|
|
61
|
+
controlledProps: [
|
|
62
|
+
{
|
|
63
|
+
key: 'current',
|
|
64
|
+
event: 'change',
|
|
65
|
+
},
|
|
66
|
+
],
|
|
67
|
+
externalClasses: [
|
|
68
|
+
`${prefix}-class`,
|
|
69
|
+
`${prefix}-class-sidebar`,
|
|
70
|
+
`${prefix}-class-sidebar-item`,
|
|
71
|
+
],
|
|
72
|
+
mixins: [
|
|
73
|
+
pageScrollMixin(),
|
|
74
|
+
ParentMixin(RELATION_MAP.IndexesAnchor),
|
|
75
|
+
],
|
|
76
|
+
components: {
|
|
77
|
+
TIcon,
|
|
78
|
+
TCell,
|
|
79
|
+
TCellGroup,
|
|
80
|
+
},
|
|
81
|
+
props: {
|
|
82
|
+
...props,
|
|
83
|
+
},
|
|
84
|
+
emits: [
|
|
85
|
+
'change',
|
|
86
|
+
'select',
|
|
87
|
+
],
|
|
88
|
+
data() {
|
|
89
|
+
return {
|
|
90
|
+
prefix,
|
|
91
|
+
classPrefix: name,
|
|
92
|
+
_height: 0,
|
|
93
|
+
_indexList: [],
|
|
94
|
+
scrollTop: 0,
|
|
95
|
+
activeAnchor: this.current,
|
|
96
|
+
showTips: false,
|
|
97
|
+
|
|
98
|
+
tools,
|
|
99
|
+
|
|
100
|
+
timer: null,
|
|
101
|
+
groupTop: [],
|
|
102
|
+
sidebar: null,
|
|
103
|
+
currentTouchAnchor: null,
|
|
104
|
+
|
|
105
|
+
dataCurrent: this.current,
|
|
106
|
+
};
|
|
107
|
+
},
|
|
108
|
+
watch: {
|
|
109
|
+
indexList: {
|
|
110
|
+
handler(v, pre) {
|
|
111
|
+
const cb = () => {
|
|
112
|
+
this.setIndexList(v);
|
|
113
|
+
this.setHeight(this._height);
|
|
114
|
+
};
|
|
115
|
+
if (!pre?.length) {
|
|
116
|
+
// 防止抖音小程序报错
|
|
117
|
+
setTimeout(() => {
|
|
118
|
+
cb();
|
|
119
|
+
}, 33);
|
|
120
|
+
} else {
|
|
121
|
+
cb();
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
immediate: true,
|
|
125
|
+
},
|
|
126
|
+
height(v) {
|
|
127
|
+
this.setHeight(v);
|
|
128
|
+
},
|
|
129
|
+
stickyOffset() {
|
|
130
|
+
this.setAnchorByCurrent(this.dataCurrent, 'update', true);
|
|
131
|
+
},
|
|
132
|
+
|
|
133
|
+
current: {
|
|
134
|
+
handler(val) {
|
|
135
|
+
this.dataCurrent = val;
|
|
136
|
+
},
|
|
137
|
+
immediate: true,
|
|
138
|
+
},
|
|
139
|
+
dataCurrent: {
|
|
140
|
+
handler(e) {
|
|
141
|
+
if (e && this.activeAnchor && e !== this.activeAnchor) {
|
|
142
|
+
this.setAnchorByCurrent(e, 'update');
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
immediate: true,
|
|
146
|
+
},
|
|
147
|
+
},
|
|
148
|
+
mounted() {
|
|
149
|
+
this.timer = null;
|
|
150
|
+
this.groupTop = [];
|
|
151
|
+
this.sidebar = null;
|
|
152
|
+
|
|
153
|
+
if (this._height === 0) {
|
|
154
|
+
this.setHeight();
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
if (this.indexList === null) {
|
|
158
|
+
this.setIndexList();
|
|
159
|
+
}
|
|
160
|
+
},
|
|
161
|
+
methods: {
|
|
162
|
+
getFirstCharacter,
|
|
163
|
+
setHeight(height) {
|
|
164
|
+
if (!height) {
|
|
165
|
+
const { windowHeight } = systemInfo;
|
|
166
|
+
height = windowHeight;
|
|
167
|
+
}
|
|
168
|
+
this._height = height;
|
|
169
|
+
|
|
170
|
+
setTimeout(() => {
|
|
171
|
+
this.getAllRect();
|
|
172
|
+
});
|
|
173
|
+
},
|
|
174
|
+
|
|
175
|
+
setIndexList(list) {
|
|
176
|
+
if (!list) {
|
|
177
|
+
const start = 'A'.charCodeAt(0);
|
|
178
|
+
const alphabet = [];
|
|
179
|
+
|
|
180
|
+
for (let i = start, end = start + 26; i < end; i += 1) {
|
|
181
|
+
alphabet.push(String.fromCharCode(i));
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
this._indexList = alphabet;
|
|
185
|
+
} else {
|
|
186
|
+
this._indexList = list;
|
|
187
|
+
}
|
|
188
|
+
},
|
|
189
|
+
|
|
190
|
+
getAllRect() {
|
|
191
|
+
this.getAnchorsRect().then(() => {
|
|
192
|
+
this.groupTop.forEach((item, index) => {
|
|
193
|
+
const next = this.groupTop[index + 1];
|
|
194
|
+
item.totalHeight = (next?.top || Infinity) - item.top;
|
|
195
|
+
});
|
|
196
|
+
|
|
197
|
+
const current = this.dataCurrent || this._indexList[0];
|
|
198
|
+
this.setAnchorByCurrent(current, 'init');
|
|
199
|
+
})
|
|
200
|
+
.catch((err) => {
|
|
201
|
+
console.log('err', err);
|
|
202
|
+
});
|
|
203
|
+
this.getSidebarRect();
|
|
204
|
+
},
|
|
205
|
+
|
|
206
|
+
getAnchorsRect() {
|
|
207
|
+
return Promise.all((this.children || [])
|
|
208
|
+
.map(child => getRect(child, `.${name}-anchor`)
|
|
209
|
+
.then((rect) => {
|
|
210
|
+
this.groupTop.push({
|
|
211
|
+
height: rect.height,
|
|
212
|
+
top: rect.top,
|
|
213
|
+
anchor: child.index,
|
|
214
|
+
});
|
|
215
|
+
})
|
|
216
|
+
.catch((err) => {
|
|
217
|
+
console.log('err', err);
|
|
218
|
+
})));
|
|
219
|
+
},
|
|
220
|
+
|
|
221
|
+
getSidebarRect() {
|
|
222
|
+
getRect(this, `#id-${name}__bar`).then((rect) => {
|
|
223
|
+
const { top, height } = rect;
|
|
224
|
+
const { length } = this._indexList;
|
|
225
|
+
|
|
226
|
+
this.sidebar = {
|
|
227
|
+
top,
|
|
228
|
+
height,
|
|
229
|
+
itemHeight: (height - (length - 1) * 2) / length, // margin = 2px
|
|
230
|
+
};
|
|
231
|
+
})
|
|
232
|
+
.catch((err) => {
|
|
233
|
+
console.log('err', err);
|
|
234
|
+
});
|
|
235
|
+
},
|
|
236
|
+
|
|
237
|
+
toggleTips(flag) {
|
|
238
|
+
if (!flag) {
|
|
239
|
+
clearInterval(this.timer);
|
|
240
|
+
this.timer = setTimeout(() => {
|
|
241
|
+
this.showTips = false;
|
|
242
|
+
}, 300);
|
|
243
|
+
} else {
|
|
244
|
+
this.showTips = true;
|
|
245
|
+
}
|
|
246
|
+
},
|
|
247
|
+
|
|
248
|
+
setAnchorByCurrent(current, source, force) {
|
|
249
|
+
const { stickyOffset } = this;
|
|
250
|
+
|
|
251
|
+
if (this.activeAnchor !== null && this.activeAnchor === current && !force) return;
|
|
252
|
+
|
|
253
|
+
const target = this.groupTop.find(item => item.anchor === current);
|
|
254
|
+
|
|
255
|
+
if (target) {
|
|
256
|
+
const scrollTop = target.top - stickyOffset;
|
|
257
|
+
|
|
258
|
+
this.setAnchorOnScroll(scrollTop);
|
|
259
|
+
uni.pageScrollTo({
|
|
260
|
+
scrollTop,
|
|
261
|
+
duration: 0,
|
|
262
|
+
});
|
|
263
|
+
|
|
264
|
+
if (['click', 'touch'].includes(source)) {
|
|
265
|
+
this.toggleTips(true);
|
|
266
|
+
this.$emit('select', { index: current });
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
},
|
|
270
|
+
|
|
271
|
+
onClick(current) {
|
|
272
|
+
this.setAnchorByCurrent(current, 'click');
|
|
273
|
+
},
|
|
274
|
+
|
|
275
|
+
onTouchMove(e) {
|
|
276
|
+
this.onAnchorTouch(e);
|
|
277
|
+
},
|
|
278
|
+
|
|
279
|
+
onTouchCancel() {
|
|
280
|
+
this.toggleTips(false);
|
|
281
|
+
},
|
|
282
|
+
|
|
283
|
+
onTouchEnd(e) {
|
|
284
|
+
this.toggleTips(false);
|
|
285
|
+
this.onAnchorTouch(e);
|
|
286
|
+
},
|
|
287
|
+
|
|
288
|
+
onAnchorTouch: throttle(function (e) {
|
|
289
|
+
const getAnchorIndex = (clientY) => {
|
|
290
|
+
const offsetY = clientY - this.sidebar.top;
|
|
291
|
+
const max = this._indexList.length - 1;
|
|
292
|
+
|
|
293
|
+
if (offsetY <= 0) {
|
|
294
|
+
return 0;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
if (offsetY > this.sidebar.height) {
|
|
298
|
+
return max;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
return Math.min(max, Math.floor(offsetY / this.sidebar.itemHeight));
|
|
302
|
+
};
|
|
303
|
+
const index = getAnchorIndex(e.changedTouches[0].clientY);
|
|
304
|
+
|
|
305
|
+
this.setAnchorByCurrent(this._indexList[index], 'touch');
|
|
306
|
+
}, 1000 / 30), // 30 frame
|
|
307
|
+
|
|
308
|
+
setAnchorOnScroll(scrollTop) {
|
|
309
|
+
if (!this.groupTop) {
|
|
310
|
+
return;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
const { sticky, stickyOffset } = this;
|
|
314
|
+
|
|
315
|
+
scrollTop += stickyOffset;
|
|
316
|
+
|
|
317
|
+
const curIndex = this.groupTop.findIndex(group => scrollTop >= group.top - group.height && scrollTop <= group.top + group.totalHeight - group.height);
|
|
318
|
+
|
|
319
|
+
if (curIndex === -1) return;
|
|
320
|
+
|
|
321
|
+
const curGroup = this.groupTop[curIndex];
|
|
322
|
+
|
|
323
|
+
this.activeAnchor = curGroup.anchor;
|
|
324
|
+
setTimeout(() => {
|
|
325
|
+
this._trigger('change', { index: curGroup.anchor, current: curGroup.anchor });
|
|
326
|
+
});
|
|
327
|
+
|
|
328
|
+
if (sticky) {
|
|
329
|
+
const offset = curGroup.top - scrollTop;
|
|
330
|
+
const betwixt = offset < curGroup.height && offset > 0 && scrollTop > stickyOffset;
|
|
331
|
+
|
|
332
|
+
this.children.forEach((child, index) => {
|
|
333
|
+
if (index === curIndex) {
|
|
334
|
+
const sticky = scrollTop > stickyOffset;
|
|
335
|
+
const anchorStyle = `transform: translate3d(0, ${betwixt ? offset : 0}px, 0); top: ${stickyOffset}px`;
|
|
336
|
+
if (anchorStyle !== child.anchorStyle || sticky !== child.sticky) {
|
|
337
|
+
child.sticky = sticky;
|
|
338
|
+
child.active = true;
|
|
339
|
+
child.dataStyle = `height: ${curGroup.height}px`;
|
|
340
|
+
child.anchorStyle = anchorStyle;
|
|
341
|
+
}
|
|
342
|
+
} else if (index + 1 === curIndex) {
|
|
343
|
+
// 两个 anchor 同时出现时的上一个
|
|
344
|
+
const anchorStyle = `transform: translate3d(0, ${
|
|
345
|
+
betwixt ? offset - curGroup.height : 0
|
|
346
|
+
}px, 0); top: ${stickyOffset}px`;
|
|
347
|
+
if (anchorStyle !== child.anchorStyle) {
|
|
348
|
+
child.sticky = true;
|
|
349
|
+
child.active = true;
|
|
350
|
+
child.dataStyle = `height: ${curGroup.height}px`;
|
|
351
|
+
child.anchorStyle = anchorStyle;
|
|
352
|
+
}
|
|
353
|
+
} else {
|
|
354
|
+
child.active = false;
|
|
355
|
+
child.sticky = false;
|
|
356
|
+
child.dataStyle = '';
|
|
357
|
+
child.anchorStyle = '';
|
|
358
|
+
}
|
|
359
|
+
});
|
|
360
|
+
}
|
|
361
|
+
},
|
|
362
|
+
|
|
363
|
+
onScroll({ scrollTop }) {
|
|
364
|
+
this.setAnchorOnScroll(scrollTop);
|
|
365
|
+
},
|
|
366
|
+
},
|
|
367
|
+
});
|
|
368
|
+
</script>
|
|
369
|
+
<style scoped>
|
|
370
|
+
@import './indexes.css';
|
|
371
|
+
</style>
|