@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,140 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view
|
|
3
|
+
:style="tools._style([customStyle])"
|
|
4
|
+
:class="[
|
|
5
|
+
tClass,
|
|
6
|
+
classPrefix
|
|
7
|
+
]"
|
|
8
|
+
>
|
|
9
|
+
<view
|
|
10
|
+
:aria-hidden="true"
|
|
11
|
+
:class="classPrefix + '__thumb'"
|
|
12
|
+
>
|
|
13
|
+
<t-image
|
|
14
|
+
v-if="image"
|
|
15
|
+
:t-class="tClassImage"
|
|
16
|
+
:src="image"
|
|
17
|
+
mode="aspectFit"
|
|
18
|
+
/>
|
|
19
|
+
<block
|
|
20
|
+
v-else-if="iconName || tools.isNoEmptyObj(iconData)"
|
|
21
|
+
name="icon"
|
|
22
|
+
>
|
|
23
|
+
<t-icon
|
|
24
|
+
:custom-style="iconData.style || ''"
|
|
25
|
+
:t-class="iconTClass"
|
|
26
|
+
:class="iconClass"
|
|
27
|
+
:prefix="iconData.prefix"
|
|
28
|
+
:name="iconName || iconData.name"
|
|
29
|
+
:size="iconData.size"
|
|
30
|
+
:color="iconData.color"
|
|
31
|
+
:aria-hidden="!!iconData.ariaHidden"
|
|
32
|
+
:aria-label="iconData.ariaLabel"
|
|
33
|
+
:aria-role="iconData.ariaRole"
|
|
34
|
+
/>
|
|
35
|
+
</block>
|
|
36
|
+
<slot
|
|
37
|
+
v-else
|
|
38
|
+
name="image"
|
|
39
|
+
/>
|
|
40
|
+
</view>
|
|
41
|
+
<view
|
|
42
|
+
:class="[
|
|
43
|
+
classPrefix + '__description ',
|
|
44
|
+
tClassDescription
|
|
45
|
+
]"
|
|
46
|
+
>
|
|
47
|
+
<block v-if="description">
|
|
48
|
+
{{ description }}
|
|
49
|
+
</block>
|
|
50
|
+
<slot name="description" />
|
|
51
|
+
</view>
|
|
52
|
+
<view
|
|
53
|
+
:class="[
|
|
54
|
+
classPrefix + '__actions ',
|
|
55
|
+
tClassActions
|
|
56
|
+
]"
|
|
57
|
+
>
|
|
58
|
+
<slot name="action" />
|
|
59
|
+
</view>
|
|
60
|
+
</view>
|
|
61
|
+
</template>
|
|
62
|
+
<script>
|
|
63
|
+
import TIcon from '../icon/icon';
|
|
64
|
+
import TImage from '../image/image';
|
|
65
|
+
import { uniComponent } from '../common/src/index';
|
|
66
|
+
import props from './props';
|
|
67
|
+
import { prefix } from '../common/config';
|
|
68
|
+
import { setIcon } from '../common/utils';
|
|
69
|
+
import tools from '../common/utils.wxs';
|
|
70
|
+
import { canUseVirtualHost } from '../common/version';
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
const name = `${prefix}-empty`;
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
export default uniComponent({
|
|
77
|
+
name,
|
|
78
|
+
options: {
|
|
79
|
+
styleIsolation: 'shared',
|
|
80
|
+
},
|
|
81
|
+
externalClasses: [
|
|
82
|
+
`${prefix}-class`,
|
|
83
|
+
`${prefix}-class-description`,
|
|
84
|
+
`${prefix}-class-image`,
|
|
85
|
+
`${prefix}-class-actions`,
|
|
86
|
+
],
|
|
87
|
+
components: {
|
|
88
|
+
TIcon,
|
|
89
|
+
TImage,
|
|
90
|
+
},
|
|
91
|
+
props: {
|
|
92
|
+
...props,
|
|
93
|
+
},
|
|
94
|
+
data() {
|
|
95
|
+
return {
|
|
96
|
+
prefix,
|
|
97
|
+
classPrefix: name,
|
|
98
|
+
|
|
99
|
+
iconName: '',
|
|
100
|
+
iconData: {},
|
|
101
|
+
|
|
102
|
+
tools,
|
|
103
|
+
};
|
|
104
|
+
},
|
|
105
|
+
computed: {
|
|
106
|
+
iconTClass() {
|
|
107
|
+
return canUseVirtualHost() ? this.iconRealClass : '';
|
|
108
|
+
},
|
|
109
|
+
iconClass() {
|
|
110
|
+
return !canUseVirtualHost() ? this.iconRealClass : '';
|
|
111
|
+
},
|
|
112
|
+
iconRealClass() {
|
|
113
|
+
const { classPrefix, iconData } = this;
|
|
114
|
+
return `${classPrefix}__icon ${classPrefix}__icon--${iconData.activeIdx == iconData.index ? 'active ' : ' '}`;
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
watch: {
|
|
118
|
+
icon: {
|
|
119
|
+
handler(t) {
|
|
120
|
+
const obj = setIcon('icon', t, '');
|
|
121
|
+
|
|
122
|
+
Object.keys(obj).forEach((key) => {
|
|
123
|
+
this[key] = obj[key];
|
|
124
|
+
});
|
|
125
|
+
},
|
|
126
|
+
immediate: true,
|
|
127
|
+
},
|
|
128
|
+
|
|
129
|
+
},
|
|
130
|
+
mounted() {
|
|
131
|
+
|
|
132
|
+
},
|
|
133
|
+
methods: {
|
|
134
|
+
|
|
135
|
+
},
|
|
136
|
+
});
|
|
137
|
+
</script>
|
|
138
|
+
<style scoped>
|
|
139
|
+
@import './empty.css';
|
|
140
|
+
</style>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC
|
|
5
|
+
* */
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
/** 描述文字 */
|
|
9
|
+
description: {
|
|
10
|
+
type: String,
|
|
11
|
+
},
|
|
12
|
+
/** 图标名称。值为字符串表示图标名称,值为 `Object` 类型,表示透传至 `icon` */
|
|
13
|
+
icon: {
|
|
14
|
+
type: [String, Object],
|
|
15
|
+
},
|
|
16
|
+
/** 图片地址 */
|
|
17
|
+
image: {
|
|
18
|
+
type: String,
|
|
19
|
+
},
|
|
20
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC
|
|
5
|
+
* */
|
|
6
|
+
|
|
7
|
+
export interface TdEmptyProps {
|
|
8
|
+
/**
|
|
9
|
+
* 描述文字
|
|
10
|
+
*/
|
|
11
|
+
description?: string;
|
|
12
|
+
/**
|
|
13
|
+
* 图标名称。值为字符串表示图标名称,值为 `Object` 类型,表示透传至 `icon`
|
|
14
|
+
*/
|
|
15
|
+
icon?: string | object;
|
|
16
|
+
/**
|
|
17
|
+
* 图片地址
|
|
18
|
+
*/
|
|
19
|
+
image?: string;
|
|
20
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
:: BASE_DOC ::
|
|
2
|
+
|
|
3
|
+
## API
|
|
4
|
+
|
|
5
|
+
### Fab Props
|
|
6
|
+
|
|
7
|
+
name | type | default | description | required
|
|
8
|
+
-- | -- | -- | -- | --
|
|
9
|
+
custom-style | Object | - | CSS(Cascading Style Sheets) | N
|
|
10
|
+
button-props | Object | - | Typescript:`ButtonProps`,[Button API Documents](./button?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/packages/uniapp-components/fab/type.ts) | N
|
|
11
|
+
draggable | String / Boolean | false | Typescript:`boolean \| FabDirectionEnum ` `type FabDirectionEnum = 'all' \| 'vertical' \| 'horizontal'`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/packages/uniapp-components/fab/type.ts) | N
|
|
12
|
+
icon | String | - | \- | N
|
|
13
|
+
style | String | right: 16px; bottom: 32px; | \- | N
|
|
14
|
+
text | String | - | \- | N
|
|
15
|
+
using-custom-navbar | Boolean | false | \- | N
|
|
16
|
+
y-bounds | Array | - | Typescript:`Array<string \| number>` | N
|
|
17
|
+
|
|
18
|
+
### Fab Events
|
|
19
|
+
|
|
20
|
+
name | params | description
|
|
21
|
+
-- | -- | --
|
|
22
|
+
click | `(context: {e: Event})` | \-
|
|
23
|
+
drag-end | `(context: { e: TouchEvent })` | \-
|
|
24
|
+
drag-start | `(context: { e: TouchEvent })` | \-
|
|
25
|
+
|
|
26
|
+
### Fab Slots
|
|
27
|
+
|
|
28
|
+
name | Description
|
|
29
|
+
-- | --
|
|
30
|
+
\- | \-
|
|
31
|
+
|
|
32
|
+
### CSS Variables
|
|
33
|
+
|
|
34
|
+
The component provides the following CSS variables, which can be used to customize styles.
|
|
35
|
+
Name | Default Value | Description
|
|
36
|
+
-- | -- | --
|
|
37
|
+
--td-fab-shadow | @shadow-2 | -
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Fab 悬浮按钮
|
|
3
|
+
description: 当功能使用图标即可表意清楚时,可使用纯图标悬浮按钮,例如:添加、发布。
|
|
4
|
+
spline: form
|
|
5
|
+
isComponent: true
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
## 引入
|
|
11
|
+
|
|
12
|
+
可在 `main.ts` 或在需要使用的页面或组件中引入。
|
|
13
|
+
|
|
14
|
+
```js
|
|
15
|
+
import TFab from '@tdesign/uniapp/fab/fab.vue';
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
### 基础使用
|
|
19
|
+
|
|
20
|
+
{{ base }}
|
|
21
|
+
|
|
22
|
+
### 进阶使用
|
|
23
|
+
|
|
24
|
+
{{ advance }}
|
|
25
|
+
|
|
26
|
+
### 可移动悬浮按钮
|
|
27
|
+
|
|
28
|
+
{{ draggable }}
|
|
29
|
+
|
|
30
|
+
### 带自动收缩功能
|
|
31
|
+
|
|
32
|
+
{{ collapsible }}
|
|
33
|
+
|
|
34
|
+
## FAQ
|
|
35
|
+
|
|
36
|
+
### 为什么通过 style/customStyle 设置 top/left 调整初试定位后,会使页面内容无法点击以及拖拽异常?
|
|
37
|
+
|
|
38
|
+
由于 `position: fixed;` 会使得元素脱离文档流,它将悬浮于页面上方。同时,元素没有设置宽高,当同时使用 `top`、`right`、`bottom` 和 `left` 属性时,浏览器会根据给定的 `top`、`right`、`bottom` 和 `left` 创建一个矩形框来容纳元素及其内容,所以会出现元素覆盖页面内容及拖拽异常等问题。
|
|
39
|
+
|
|
40
|
+
Fab 组件默认定位 `right: 16px; bottom: 32px;`,且拖拽功能也是通过调整 `right` 与 `bottom` 属性值实现,因此在使用 `Fab` 组件时,仅支持通过 `style/customStyle` 属性设置 `right/bottom` 来调整初试位置, 避免使用 `top/left`。
|
|
41
|
+
|
|
42
|
+
### 开启 Skyline 渲染引擎后,组件所在页面崩溃?
|
|
43
|
+
|
|
44
|
+
因为 Skyline 还不支持多层阴影,要等微信官方处理。当下可参考 [#2865](https://github.com/Tencent/tdesign-miniprogram/issues/2865) 进行规避处理
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
## API
|
|
48
|
+
|
|
49
|
+
### Fab Props
|
|
50
|
+
|
|
51
|
+
名称 | 类型 | 默认值 | 描述 | 必传
|
|
52
|
+
-- | -- | -- | -- | --
|
|
53
|
+
custom-style | Object | - | 自定义样式 | N
|
|
54
|
+
button-props | Object | - | 透传至 Button 组件。TS 类型:`ButtonProps`,[Button API Documents](./button?tab=api)。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/packages/uniapp-components/fab/type.ts) | N
|
|
55
|
+
draggable | String / Boolean | false | 是否可拖拽。`true` / `'all'`可拖动<br>`'vertical'`可垂直拖动<br>`'horizontal'`可水平拖动<br>`false`禁止拖动。TS 类型:`boolean \| FabDirectionEnum ` `type FabDirectionEnum = 'all' \| 'vertical' \| 'horizontal'`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/packages/uniapp-components/fab/type.ts) | N
|
|
56
|
+
icon | String | - | 图标 | N
|
|
57
|
+
style | String | right: 16px; bottom: 32px; | 悬浮按钮的样式,常用于调整位置(即将废弃,建议使用 `style`) | N
|
|
58
|
+
text | String | - | 文本内容 | N
|
|
59
|
+
using-custom-navbar | Boolean | false | 是否使用了自定义导航栏 | N
|
|
60
|
+
y-bounds | Array | - | 设置垂直方向边界限制,示例:[48, 48] 或 ['96px', 80]。TS 类型:`Array<string \| number>` | N
|
|
61
|
+
|
|
62
|
+
### Fab Events
|
|
63
|
+
|
|
64
|
+
名称 | 参数 | 描述
|
|
65
|
+
-- | -- | --
|
|
66
|
+
click | `(context: {e: Event})` | 悬浮按钮点击事件
|
|
67
|
+
drag-end | `(context: { e: TouchEvent })` | 结束拖拽时触发
|
|
68
|
+
drag-start | `(context: { e: TouchEvent })` | 开始拖拽时触发
|
|
69
|
+
|
|
70
|
+
### Fab Slots
|
|
71
|
+
|
|
72
|
+
名称 | 描述
|
|
73
|
+
-- | --
|
|
74
|
+
\- | 默认插槽,按钮内容
|
|
75
|
+
|
|
76
|
+
### CSS Variables
|
|
77
|
+
|
|
78
|
+
组件提供了下列 CSS 变量,可用于自定义样式。
|
|
79
|
+
名称 | 默认值 | 描述
|
|
80
|
+
-- | -- | --
|
|
81
|
+
--td-fab-shadow | @shadow-2 | -
|
package/dist/fab/fab.css
ADDED
package/dist/fab/fab.vue
ADDED
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<t-draggable
|
|
3
|
+
v-if="draggable"
|
|
4
|
+
ref="draggable"
|
|
5
|
+
:custom-style="tools._style(['right: 16px; bottom: 32px;', customStyle, moveStyle])"
|
|
6
|
+
:direction="draggable === true ? 'all' : draggable"
|
|
7
|
+
:t-class="tClass"
|
|
8
|
+
@start="onStart"
|
|
9
|
+
@move="onMove"
|
|
10
|
+
@end="onEnd"
|
|
11
|
+
>
|
|
12
|
+
<slot v-if="!buttonData.content && !buttonData.icon" />
|
|
13
|
+
<block
|
|
14
|
+
v-else
|
|
15
|
+
name="button"
|
|
16
|
+
>
|
|
17
|
+
<t-button
|
|
18
|
+
:t-id="buttonData.tId"
|
|
19
|
+
:custom-style="buttonData.style || ''"
|
|
20
|
+
:block="buttonData.block"
|
|
21
|
+
:class="getActionClass(classPrefix, buttonData.buttonLayout) || ''"
|
|
22
|
+
:t-class="buttonData.tClass"
|
|
23
|
+
:disabled="buttonData.disabled"
|
|
24
|
+
:data-type="'action'"
|
|
25
|
+
:data-extra="buttonData.index"
|
|
26
|
+
:custom-dataset="buttonData.customDataset"
|
|
27
|
+
:content="buttonData.content"
|
|
28
|
+
:icon="buttonData.icon"
|
|
29
|
+
:loading="buttonData.loading"
|
|
30
|
+
:loading-props="buttonData.loadingProps"
|
|
31
|
+
:theme="buttonData.theme"
|
|
32
|
+
:ghost="buttonData.ghost"
|
|
33
|
+
:shape="buttonData.shape"
|
|
34
|
+
:size="buttonData.size"
|
|
35
|
+
:variant="buttonData.variant"
|
|
36
|
+
:open-type="buttonData.openType"
|
|
37
|
+
:hover-class="buttonData.hoverClass"
|
|
38
|
+
:hover-stop-propagation="buttonData.hoverStopPropagation"
|
|
39
|
+
:hover-start-time="buttonData.hoverStartTime"
|
|
40
|
+
:hover-stay-time="buttonData.hoverStayTime"
|
|
41
|
+
:lang="buttonData.lang"
|
|
42
|
+
:session-from="buttonData.sessionFrom"
|
|
43
|
+
:send-message-title="buttonData.sendMessageTitle"
|
|
44
|
+
:send-message-path="buttonData.sendMessagePath"
|
|
45
|
+
:send-message-img="buttonData.sendMessageImg"
|
|
46
|
+
:app-parameter="buttonData.appParameter"
|
|
47
|
+
:show-message-card="buttonData.showMessageCard"
|
|
48
|
+
:aria-label="buttonData.ariaLabel"
|
|
49
|
+
@click="onTplButtonTap"
|
|
50
|
+
@getuserinfo="onTplButtonTap"
|
|
51
|
+
@contact="onTplButtonTap"
|
|
52
|
+
@getphonenumber="onTplButtonTap"
|
|
53
|
+
@error="onTplButtonTap"
|
|
54
|
+
@opensetting="onTplButtonTap"
|
|
55
|
+
@launchapp="onTplButtonTap"
|
|
56
|
+
@agreeprivacyauthorization="onTplButtonTap"
|
|
57
|
+
>
|
|
58
|
+
<slot v-if="true || false" />
|
|
59
|
+
</t-button>
|
|
60
|
+
</block>
|
|
61
|
+
</t-draggable>
|
|
62
|
+
|
|
63
|
+
<view
|
|
64
|
+
v-else
|
|
65
|
+
:class="[classPrefix, tClass]"
|
|
66
|
+
:style="tools._style(['right: 16px; bottom: 32px;', customStyle])"
|
|
67
|
+
>
|
|
68
|
+
<slot v-if="!buttonData || !buttonData.content && !buttonData.icon" />
|
|
69
|
+
<t-button
|
|
70
|
+
v-else
|
|
71
|
+
:t-id="buttonData.tId"
|
|
72
|
+
:custom-style="buttonData.style || ''"
|
|
73
|
+
:block="buttonData.block"
|
|
74
|
+
:class="getActionClass(classPrefix, buttonData.buttonLayout) || ''"
|
|
75
|
+
:t-class="buttonData.tClass"
|
|
76
|
+
:disabled="buttonData.disabled"
|
|
77
|
+
:data-type="'action'"
|
|
78
|
+
:data-extra="buttonData.index"
|
|
79
|
+
:custom-dataset="buttonData.customDataset"
|
|
80
|
+
:content="buttonData.content"
|
|
81
|
+
:icon="buttonData.icon"
|
|
82
|
+
:loading="buttonData.loading"
|
|
83
|
+
:loading-props="buttonData.loadingProps"
|
|
84
|
+
:theme="buttonData.theme"
|
|
85
|
+
:ghost="buttonData.ghost"
|
|
86
|
+
:shape="buttonData.shape"
|
|
87
|
+
:size="buttonData.size"
|
|
88
|
+
:variant="buttonData.variant"
|
|
89
|
+
:open-type="buttonData.openType"
|
|
90
|
+
:hover-class="buttonData.hoverClass"
|
|
91
|
+
:hover-stop-propagation="buttonData.hoverStopPropagation"
|
|
92
|
+
:hover-start-time="buttonData.hoverStartTime"
|
|
93
|
+
:hover-stay-time="buttonData.hoverStayTime"
|
|
94
|
+
:lang="buttonData.lang"
|
|
95
|
+
:session-from="buttonData.sessionFrom"
|
|
96
|
+
:send-message-title="buttonData.sendMessageTitle"
|
|
97
|
+
:send-message-path="buttonData.sendMessagePath"
|
|
98
|
+
:send-message-img="buttonData.sendMessageImg"
|
|
99
|
+
:app-parameter="buttonData.appParameter"
|
|
100
|
+
:show-message-card="buttonData.showMessageCard"
|
|
101
|
+
:aria-label="buttonData.ariaLabel"
|
|
102
|
+
@click="onTplButtonTap"
|
|
103
|
+
@getuserinfo="onTplButtonTap"
|
|
104
|
+
@contact="onTplButtonTap"
|
|
105
|
+
@getphonenumber="onTplButtonTap"
|
|
106
|
+
@error="onTplButtonTap"
|
|
107
|
+
@opensetting="onTplButtonTap"
|
|
108
|
+
@launchapp="onTplButtonTap"
|
|
109
|
+
@agreeprivacyauthorization="onTplButtonTap"
|
|
110
|
+
>
|
|
111
|
+
<slot />
|
|
112
|
+
</t-button>
|
|
113
|
+
</view>
|
|
114
|
+
</template>
|
|
115
|
+
|
|
116
|
+
<script>
|
|
117
|
+
import TButton from '../button/button';
|
|
118
|
+
import TDraggable from '../draggable/draggable.vue';
|
|
119
|
+
import { uniComponent } from '../common/src/index';
|
|
120
|
+
import { prefix } from '../common/config';
|
|
121
|
+
import props from './props';
|
|
122
|
+
import useCustomNavbar from '../mixins/using-custom-navbar';
|
|
123
|
+
import { unitConvert, getWindowInfo } from '../common/utils';
|
|
124
|
+
import tools from '../common/utils.wxs';
|
|
125
|
+
|
|
126
|
+
const name = `${prefix}-fab`;
|
|
127
|
+
|
|
128
|
+
const baseButtonProps = {
|
|
129
|
+
size: 'large',
|
|
130
|
+
shape: 'circle',
|
|
131
|
+
theme: 'primary',
|
|
132
|
+
tClass: `${prefix}-fab__button`,
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
export default uniComponent({
|
|
136
|
+
name,
|
|
137
|
+
options: {
|
|
138
|
+
styleIsolation: 'shared',
|
|
139
|
+
},
|
|
140
|
+
externalClasses: [`${prefix}-class`, `${prefix}-class-button`],
|
|
141
|
+
mixins: [useCustomNavbar],
|
|
142
|
+
components: {
|
|
143
|
+
TButton,
|
|
144
|
+
TDraggable,
|
|
145
|
+
},
|
|
146
|
+
props: {
|
|
147
|
+
...props,
|
|
148
|
+
},
|
|
149
|
+
emits: [
|
|
150
|
+
'move',
|
|
151
|
+
'start',
|
|
152
|
+
'end',
|
|
153
|
+
],
|
|
154
|
+
data() {
|
|
155
|
+
return {
|
|
156
|
+
prefix,
|
|
157
|
+
classPrefix: name,
|
|
158
|
+
moveStyle: null,
|
|
159
|
+
tools,
|
|
160
|
+
systemInfo: getWindowInfo(),
|
|
161
|
+
};
|
|
162
|
+
},
|
|
163
|
+
computed: {
|
|
164
|
+
buttonData() {
|
|
165
|
+
return {
|
|
166
|
+
...baseButtonProps,
|
|
167
|
+
shape: this.text ? 'round' : 'circle',
|
|
168
|
+
...this.buttonProps,
|
|
169
|
+
icon: this.icon,
|
|
170
|
+
content: this.text,
|
|
171
|
+
ariaLabel: this.ariaLabel,
|
|
172
|
+
};
|
|
173
|
+
},
|
|
174
|
+
},
|
|
175
|
+
watch: {
|
|
176
|
+
icon: 'computedSize',
|
|
177
|
+
ariaLabel: 'computedSize',
|
|
178
|
+
yBounds: 'computedSize',
|
|
179
|
+
buttonProps: 'computedSize',
|
|
180
|
+
text: {
|
|
181
|
+
handler(val) {
|
|
182
|
+
this.content = val;
|
|
183
|
+
this.computedSize();
|
|
184
|
+
},
|
|
185
|
+
immediate: true,
|
|
186
|
+
},
|
|
187
|
+
},
|
|
188
|
+
methods: {
|
|
189
|
+
onTplButtonTap(e) {
|
|
190
|
+
this.$emit('click', { e });
|
|
191
|
+
},
|
|
192
|
+
onStart(t) {
|
|
193
|
+
this.$emit('drag-start', t);
|
|
194
|
+
},
|
|
195
|
+
onMove(e) {
|
|
196
|
+
const {
|
|
197
|
+
yBounds = [],
|
|
198
|
+
distanceTop,
|
|
199
|
+
systemInfo,
|
|
200
|
+
} = this;
|
|
201
|
+
|
|
202
|
+
const { x, y, rect } = e;
|
|
203
|
+
const maxX = systemInfo.windowWidth - rect.width; // 父容器宽度 - 拖动元素宽度
|
|
204
|
+
const maxY = systemInfo.windowHeight - Math.max(distanceTop, unitConvert(yBounds[0])) - rect.height; // 父容器高度 - 拖动元素高度
|
|
205
|
+
const right = Math.max(0, Math.min(x, maxX));
|
|
206
|
+
const bottom = Math.max(0, unitConvert(yBounds[1]), Math.min(y, maxY));
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
this.moveStyle = `right: ${right}px; bottom: ${bottom}px;`;
|
|
210
|
+
},
|
|
211
|
+
onEnd(t) {
|
|
212
|
+
this.$emit('drag-end', t);
|
|
213
|
+
},
|
|
214
|
+
computedSize() {
|
|
215
|
+
if (!this.draggable) return;
|
|
216
|
+
|
|
217
|
+
setTimeout(() => {
|
|
218
|
+
const insChild = this.$refs.draggableTemplate?.$refs?.draggable;
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
// button 更新时,重新获取其尺寸
|
|
222
|
+
if (this?.yBounds?.[1]) {
|
|
223
|
+
this.moveStyle = `bottom: ${unitConvert(this.yBounds[1])}px`;
|
|
224
|
+
insChild?.computedRect();
|
|
225
|
+
} else {
|
|
226
|
+
insChild?.computedRect();
|
|
227
|
+
}
|
|
228
|
+
});
|
|
229
|
+
},
|
|
230
|
+
getActionClass(a, b) {
|
|
231
|
+
return `${a}-${b}`;
|
|
232
|
+
},
|
|
233
|
+
},
|
|
234
|
+
});
|
|
235
|
+
</script>
|
|
236
|
+
<style scoped>
|
|
237
|
+
@import './fab.css';
|
|
238
|
+
</style>
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC
|
|
5
|
+
* */
|
|
6
|
+
|
|
7
|
+
import type { TdFabProps } from './type';
|
|
8
|
+
export default {
|
|
9
|
+
/** 透传至 Button 组件 */
|
|
10
|
+
buttonProps: {
|
|
11
|
+
type: Object,
|
|
12
|
+
},
|
|
13
|
+
/** 是否可拖拽。`true` / `'all'`可拖动<br>`'vertical'`可垂直拖动<br>`'horizontal'`可水平拖动<br>`false`禁止拖动 */
|
|
14
|
+
draggable: {
|
|
15
|
+
type: [String, Boolean],
|
|
16
|
+
default: false as TdFabProps['draggable'],
|
|
17
|
+
},
|
|
18
|
+
/** 图标 */
|
|
19
|
+
icon: {
|
|
20
|
+
type: String,
|
|
21
|
+
default: '',
|
|
22
|
+
},
|
|
23
|
+
/** 悬浮按钮的样式,常用于调整位置(即将废弃,建议使用 `style`) */
|
|
24
|
+
style: {
|
|
25
|
+
type: String,
|
|
26
|
+
default: 'right: 16px; bottom: 32px;',
|
|
27
|
+
},
|
|
28
|
+
/** 文本内容 */
|
|
29
|
+
text: {
|
|
30
|
+
type: String,
|
|
31
|
+
default: '',
|
|
32
|
+
},
|
|
33
|
+
/** 是否使用了自定义导航栏 */
|
|
34
|
+
usingCustomNavbar: Boolean,
|
|
35
|
+
/** 设置垂直方向边界限制,示例:[48, 48] 或 ['96px', 80] */
|
|
36
|
+
yBounds: {
|
|
37
|
+
type: Array,
|
|
38
|
+
},
|
|
39
|
+
/** 悬浮按钮点击事件 */
|
|
40
|
+
onClick: {
|
|
41
|
+
type: Function,
|
|
42
|
+
default: () => ({}),
|
|
43
|
+
},
|
|
44
|
+
/** 结束拖拽时触发 */
|
|
45
|
+
onDragEnd: {
|
|
46
|
+
type: Function,
|
|
47
|
+
default: () => ({}),
|
|
48
|
+
},
|
|
49
|
+
/** 开始拖拽时触发 */
|
|
50
|
+
onDragStart: {
|
|
51
|
+
type: Function,
|
|
52
|
+
default: () => ({}),
|
|
53
|
+
},
|
|
54
|
+
};
|
package/dist/fab/type.ts
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC
|
|
5
|
+
* */
|
|
6
|
+
|
|
7
|
+
import type { TdButtonProps as ButtonProps } from '../button/type';
|
|
8
|
+
|
|
9
|
+
export interface TdFabProps {
|
|
10
|
+
/**
|
|
11
|
+
* 透传至 Button 组件
|
|
12
|
+
*/
|
|
13
|
+
buttonProps?: ButtonProps;
|
|
14
|
+
/**
|
|
15
|
+
* 是否可拖拽。`true` / `'all'`可拖动<br>`'vertical'`可垂直拖动<br>`'horizontal'`可水平拖动<br>`false`禁止拖动
|
|
16
|
+
* @default false
|
|
17
|
+
*/
|
|
18
|
+
draggable?: boolean | FabDirectionEnum;
|
|
19
|
+
/**
|
|
20
|
+
* 图标
|
|
21
|
+
* @default ''
|
|
22
|
+
*/
|
|
23
|
+
icon?: string;
|
|
24
|
+
/**
|
|
25
|
+
* 悬浮按钮的样式,常用于调整位置(即将废弃,建议使用 `style`)
|
|
26
|
+
* @default right: 16px; bottom: 32px;
|
|
27
|
+
*/
|
|
28
|
+
style?: string;
|
|
29
|
+
/**
|
|
30
|
+
* 文本内容
|
|
31
|
+
* @default ''
|
|
32
|
+
*/
|
|
33
|
+
text?: string;
|
|
34
|
+
/**
|
|
35
|
+
* 是否使用了自定义导航栏
|
|
36
|
+
* @default false
|
|
37
|
+
*/
|
|
38
|
+
usingCustomNavbar?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* 设置垂直方向边界限制,示例:[48, 48] 或 ['96px', 80]
|
|
41
|
+
*/
|
|
42
|
+
yBounds?: Array<string | number>;
|
|
43
|
+
/**
|
|
44
|
+
* 悬浮按钮点击事件
|
|
45
|
+
*/
|
|
46
|
+
onClick?: (context: { e: Event }) => void;
|
|
47
|
+
/**
|
|
48
|
+
* 结束拖拽时触发
|
|
49
|
+
*/
|
|
50
|
+
onDragEnd?: (context: { e: TouchEvent }) => void;
|
|
51
|
+
/**
|
|
52
|
+
* 开始拖拽时触发
|
|
53
|
+
*/
|
|
54
|
+
onDragStart?: (context: { e: TouchEvent }) => void;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export type FabDirectionEnum = 'all' | 'vertical' | 'horizontal';
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
:: BASE_DOC ::
|
|
2
|
+
|
|
3
|
+
## API
|
|
4
|
+
|
|
5
|
+
### Footer Props
|
|
6
|
+
|
|
7
|
+
name | type | default | description | required
|
|
8
|
+
-- | -- | -- | -- | --
|
|
9
|
+
custom-style | Object | - | CSS(Cascading Style Sheets) | N
|
|
10
|
+
copyright | String | '' | `deprecated` | N
|
|
11
|
+
links | Array | [] | Typescript:`Array<LinkObj>` `interface LinkObj { name: string; url?: string; openType?: 'navigate' \| 'redirect' \| 'relaunch' \| 'switchTab' \| 'navigateBack' }`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/packages/uniapp-components/footer/type.ts) | N
|
|
12
|
+
logo | Object | - | Typescript:`FooterLogo` `interface FooterLogo { icon: string; title?: string; url?: string }`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/packages/uniapp-components/footer/type.ts) | N
|
|
13
|
+
text | String | '' | \- | N
|
|
14
|
+
text-link-list | Array | [] | `deprecated`。Typescript:`Array<LinkObj>` `interface LinkObj { name: string; url?: string; openType?: 'navigate' \| 'redirect' \| 'relaunch' \| 'switchTab' \| 'navigateBack' }`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/packages/uniapp-components/footer/type.ts) | N
|
|
15
|
+
theme | String | 'text' | `deprecated`。options: text/logo | N
|
|
16
|
+
|
|
17
|
+
### CSS Variables
|
|
18
|
+
|
|
19
|
+
The component provides the following CSS variables, which can be used to customize styles.
|
|
20
|
+
Name | Default Value | Description
|
|
21
|
+
-- | -- | --
|
|
22
|
+
--td-footer-link-color | @brand-color | -
|
|
23
|
+
--td-footer-link-dividing-line-color | @text-color-placeholder | -
|
|
24
|
+
--td-footer-link-dividing-line-padding | @spacer-1 | -
|
|
25
|
+
--td-footer-link-font | @font-body-medium | -
|
|
26
|
+
--td-footer-logo-icon-height | 48rpx | -
|
|
27
|
+
--td-footer-logo-icon-margin-right | @spacer | -
|
|
28
|
+
--td-footer-logo-icon-width | 48rpx | -
|
|
29
|
+
--td-footer-logo-title-font | @font-title-medium | -
|
|
30
|
+
--td-footer-logo-title-url-width | 256rpx | -
|
|
31
|
+
--td-footer-text-color | @text-color-placeholder | -
|
|
32
|
+
--td-footer-text-font | @font-body-small | -
|
|
33
|
+
--td-footer-text-margin-top | 8rpx | -
|