@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,422 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<t-popup
|
|
3
|
+
name="dialog"
|
|
4
|
+
:custom-style="tools._style([customStyle])"
|
|
5
|
+
:t-class="classPrefix + '__wrapper'"
|
|
6
|
+
:visible="dataVisible"
|
|
7
|
+
:show-overlay="dataShowOverlay"
|
|
8
|
+
:close-on-overlay-click="dataCloseOnOverlayClick"
|
|
9
|
+
:prevent-scroll-through="dataPreventScrollThrough"
|
|
10
|
+
:overlay-props="dataOverlayProps"
|
|
11
|
+
:z-index="dataZIndex"
|
|
12
|
+
placement="center"
|
|
13
|
+
:using-custom-navbar="dataUsingCustomNavbar"
|
|
14
|
+
@visible-change="overlayClick"
|
|
15
|
+
>
|
|
16
|
+
<template #content>
|
|
17
|
+
<view
|
|
18
|
+
:class="classPrefix + ' ' + tClass"
|
|
19
|
+
>
|
|
20
|
+
<slot name="top" />
|
|
21
|
+
<view
|
|
22
|
+
v-if="dataCloseBtn"
|
|
23
|
+
:class="classPrefix + '__close-btn'"
|
|
24
|
+
@click="onClose"
|
|
25
|
+
>
|
|
26
|
+
<template
|
|
27
|
+
v-if="tools.isObject(dataCloseBtn)"
|
|
28
|
+
>
|
|
29
|
+
<t-icon
|
|
30
|
+
:custom-style="dataCloseBtn.style || ''"
|
|
31
|
+
:prefix="dataCloseBtn.prefix"
|
|
32
|
+
:name="dataCloseBtn.name || 'close'"
|
|
33
|
+
:size="dataCloseBtn.size || 22"
|
|
34
|
+
:color="dataCloseBtn.color"
|
|
35
|
+
:aria-hidden="true"
|
|
36
|
+
:aria-label="dataCloseBtn.ariaLabel"
|
|
37
|
+
:aria-role="dataCloseBtn.ariaRole"
|
|
38
|
+
/>
|
|
39
|
+
</template>
|
|
40
|
+
<t-icon
|
|
41
|
+
v-else
|
|
42
|
+
name="close"
|
|
43
|
+
size="44rpx"
|
|
44
|
+
/>
|
|
45
|
+
</view>
|
|
46
|
+
<view :class="classPrefix + '__content ' + tClassContent">
|
|
47
|
+
<view
|
|
48
|
+
v-if="dataTitle"
|
|
49
|
+
:class="classPrefix + '__header'"
|
|
50
|
+
>
|
|
51
|
+
{{ dataTitle }}
|
|
52
|
+
</view>
|
|
53
|
+
<slot name="title" />
|
|
54
|
+
<view
|
|
55
|
+
v-if="dataContent"
|
|
56
|
+
:class="classPrefix + '__body'"
|
|
57
|
+
>
|
|
58
|
+
<text :class="classPrefix + '__body-text'">
|
|
59
|
+
{{ dataContent }}
|
|
60
|
+
</text>
|
|
61
|
+
</view>
|
|
62
|
+
<slot name="content" />
|
|
63
|
+
</view>
|
|
64
|
+
<slot name="middle" />
|
|
65
|
+
<view
|
|
66
|
+
:class="
|
|
67
|
+
tools.cls(classPrefix + '__footer', [
|
|
68
|
+
['column', dataButtonLayout === 'vertical'],
|
|
69
|
+
['full', buttonVariant == 'text' && (!dataActions || dataActions.length == 0)]
|
|
70
|
+
])
|
|
71
|
+
"
|
|
72
|
+
>
|
|
73
|
+
<template v-if="dataActions">
|
|
74
|
+
<t-button
|
|
75
|
+
v-for="(actionItem, index) in dataActions"
|
|
76
|
+
:key="index"
|
|
77
|
+
:t-id="actionItem.tId"
|
|
78
|
+
:custom-style="actionItem.style"
|
|
79
|
+
:block="coalesce(actionItem.block, true)"
|
|
80
|
+
:t-class="useVirtualHost ? getActionClass(classPrefix, dataButtonLayout, actionItem, tClassAction) : ''"
|
|
81
|
+
:class="!useVirtualHost ? getActionClass(classPrefix, dataButtonLayout, actionItem, tClassAction) : ''"
|
|
82
|
+
:disabled="actionItem.disabled"
|
|
83
|
+
:data-type="'action'"
|
|
84
|
+
:data-extra="coalesce(actionItem.index, index)"
|
|
85
|
+
:custom-dataset="actionItem.customDataset"
|
|
86
|
+
:content="actionItem.content"
|
|
87
|
+
:icon="actionItem.icon"
|
|
88
|
+
:loading="actionItem.loading"
|
|
89
|
+
:loading-props="actionItem.loadingProps"
|
|
90
|
+
:theme="actionItem.theme"
|
|
91
|
+
:ghost="actionItem.ghost"
|
|
92
|
+
:shape="actionItem.shape"
|
|
93
|
+
:size="actionItem.size"
|
|
94
|
+
:variant="actionItem.variant"
|
|
95
|
+
:open-type="actionItem.openType"
|
|
96
|
+
:hover-class="actionItem.hoverClass"
|
|
97
|
+
:hover-stop-propagation="actionItem.hoverStopPropagation"
|
|
98
|
+
:hover-start-time="actionItem.hoverStartTime"
|
|
99
|
+
:hover-stay-time="actionItem.hoverStayTime"
|
|
100
|
+
:lang="actionItem.lang"
|
|
101
|
+
:session-from="actionItem.sessionFrom"
|
|
102
|
+
:send-message-title="actionItem.sendMessageTitle"
|
|
103
|
+
:send-message-path="actionItem.sendMessagePath"
|
|
104
|
+
:send-message-img="actionItem.sendMessageImg"
|
|
105
|
+
:app-parameter="actionItem.appParameter"
|
|
106
|
+
:show-message-card="actionItem.showMessageCard"
|
|
107
|
+
:aria-label="actionItem.ariaLabel"
|
|
108
|
+
@click="onTplButtonTap($event, { type: 'action', extra: index })"
|
|
109
|
+
@getuserinfo="onTplButtonTap($event, { type: 'action', extra: index })"
|
|
110
|
+
@contact="onTplButtonTap($event, { type: 'action', extra: index })"
|
|
111
|
+
@getphonenumber="onTplButtonTap($event, { type: 'action', extra: index })"
|
|
112
|
+
@error="onTplButtonTap($event, { type: 'action', extra: index })"
|
|
113
|
+
@opensetting="onTplButtonTap($event, { type: 'action', extra: index })"
|
|
114
|
+
@launchapp="onTplButtonTap($event, { type: 'action', extra: index })"
|
|
115
|
+
@agreeprivacyauthorization="onTplButtonTap($event, { type: 'action', extra: index })"
|
|
116
|
+
>
|
|
117
|
+
<slot v-if="actionItem.useDefaultSlot || false" />
|
|
118
|
+
</t-button>
|
|
119
|
+
</template>
|
|
120
|
+
<slot name="actions" />
|
|
121
|
+
<template v-if="_cancel">
|
|
122
|
+
<t-button
|
|
123
|
+
:t-id="_cancel.tId"
|
|
124
|
+
:custom-style="_cancel.style"
|
|
125
|
+
:block="_cancel.block"
|
|
126
|
+
:t-class="_cancel.tClass"
|
|
127
|
+
:class="_cancel.class"
|
|
128
|
+
:disabled="_cancel.disabled"
|
|
129
|
+
:data-type="'cancel'"
|
|
130
|
+
:data-extra="_cancel.index"
|
|
131
|
+
:custom-dataset="_cancel.customDataset"
|
|
132
|
+
:content="_cancel.content"
|
|
133
|
+
:icon="_cancel.icon"
|
|
134
|
+
:loading="_cancel.loading"
|
|
135
|
+
:loading-props="_cancel.loadingProps"
|
|
136
|
+
:theme="_cancel.theme"
|
|
137
|
+
:ghost="_cancel.ghost"
|
|
138
|
+
:shape="_cancel.shape"
|
|
139
|
+
:size="_cancel.size"
|
|
140
|
+
:variant="_cancel.variant"
|
|
141
|
+
:open-type="_cancel.openType"
|
|
142
|
+
:hover-class="_cancel.hoverClass"
|
|
143
|
+
:hover-stop-propagation="_cancel.hoverStopPropagation"
|
|
144
|
+
:hover-start-time="_cancel.hoverStartTime"
|
|
145
|
+
:hover-stay-time="_cancel.hoverStayTime"
|
|
146
|
+
:lang="_cancel.lang"
|
|
147
|
+
:session-from="_cancel.sessionFrom"
|
|
148
|
+
:send-message-title="_cancel.sendMessageTitle"
|
|
149
|
+
:send-message-path="_cancel.sendMessagePath"
|
|
150
|
+
:send-message-img="_cancel.sendMessageImg"
|
|
151
|
+
:app-parameter="_cancel.appParameter"
|
|
152
|
+
:show-message-card="_cancel.showMessageCard"
|
|
153
|
+
:aria-label="_cancel.ariaLabel"
|
|
154
|
+
@click="onCancel($event, { type: 'action', extra: 0 })"
|
|
155
|
+
@getuserinfo="onCancel($event, { type: 'action', extra: 0 })"
|
|
156
|
+
@contact="onCancel($event, { type: 'action', extra: 0 })"
|
|
157
|
+
@getphonenumber="onCancel($event, { type: 'action', extra: 0 })"
|
|
158
|
+
@error="onCancel($event, { type: 'action', extra: 0 })"
|
|
159
|
+
@opensetting="onCancel($event, { type: 'action', extra: 0 })"
|
|
160
|
+
@launchapp="onCancel($event, { type: 'action', extra: 0 })"
|
|
161
|
+
@agreeprivacyauthorization="onCancel($event, { type: 'action', extra: 0 })"
|
|
162
|
+
>
|
|
163
|
+
<slot v-if="_cancel.useDefaultSlot || false" />
|
|
164
|
+
</t-button>
|
|
165
|
+
</template>
|
|
166
|
+
<slot name="cancel-btn" />
|
|
167
|
+
<template v-if="_confirm">
|
|
168
|
+
<t-button
|
|
169
|
+
:t-id="_confirm.tId"
|
|
170
|
+
:custom-style="_confirm.style"
|
|
171
|
+
:block="_confirm.block"
|
|
172
|
+
:t-class="_confirm.tClass"
|
|
173
|
+
:class="_confirm.class"
|
|
174
|
+
:disabled="_confirm.disabled"
|
|
175
|
+
:data-type="'confirm'"
|
|
176
|
+
:data-extra="_confirm.index"
|
|
177
|
+
:custom-dataset="_confirm.customDataset"
|
|
178
|
+
:content="_confirm.content"
|
|
179
|
+
:icon="_confirm.icon"
|
|
180
|
+
:loading="_confirm.loading"
|
|
181
|
+
:loading-props="_confirm.loadingProps"
|
|
182
|
+
:theme="_confirm.theme || 'primary'"
|
|
183
|
+
:ghost="_confirm.ghost"
|
|
184
|
+
:shape="_confirm.shape"
|
|
185
|
+
:size="_confirm.size"
|
|
186
|
+
:variant="_confirm.variant"
|
|
187
|
+
:open-type="_confirm.openType"
|
|
188
|
+
:hover-class="_confirm.hoverClass"
|
|
189
|
+
:hover-stop-propagation="_confirm.hoverStopPropagation"
|
|
190
|
+
:hover-start-time="_confirm.hoverStartTime"
|
|
191
|
+
:hover-stay-time="_confirm.hoverStayTime"
|
|
192
|
+
:lang="_confirm.lang"
|
|
193
|
+
:session-from="_confirm.sessionFrom"
|
|
194
|
+
:send-message-title="_confirm.sendMessageTitle"
|
|
195
|
+
:send-message-path="_confirm.sendMessagePath"
|
|
196
|
+
:send-message-img="_confirm.sendMessageImg"
|
|
197
|
+
:app-parameter="_confirm.appParameter"
|
|
198
|
+
:show-message-card="_confirm.showMessageCard"
|
|
199
|
+
:aria-label="_confirm.ariaLabel"
|
|
200
|
+
@click="onConfirm($event, { type: 'action', extra: 0 })"
|
|
201
|
+
@getuserinfo="onConfirm($event, { type: 'action', extra: 0 })"
|
|
202
|
+
@contact="onConfirm($event, { type: 'action', extra: 0 })"
|
|
203
|
+
@getphonenumber="onConfirm($event, { type: 'action', extra: 0 })"
|
|
204
|
+
@error="onTplButtonConfirmonTap($event, { type: 'action', extra: 0 })"
|
|
205
|
+
@opensetting="onConfirm($event, { type: 'action', extra: 0 })"
|
|
206
|
+
@launchapp="onConfirm($event, { type: 'action', extra: 0 })"
|
|
207
|
+
@agreeprivacyauthorization="onConfirm($event, { type: 'action', extra: 0 })"
|
|
208
|
+
>
|
|
209
|
+
<slot v-if="_confirm.useDefaultSlot || false" />
|
|
210
|
+
</t-button>
|
|
211
|
+
</template>
|
|
212
|
+
<slot name="confirm-btn" />
|
|
213
|
+
</view>
|
|
214
|
+
</view>
|
|
215
|
+
</template>
|
|
216
|
+
</t-popup>
|
|
217
|
+
</template>
|
|
218
|
+
<script>
|
|
219
|
+
import TPopup from '../popup/popup';
|
|
220
|
+
import TIcon from '../icon/icon';
|
|
221
|
+
import TButton from '../button/button';
|
|
222
|
+
import { uniComponent } from '../common/src/index';
|
|
223
|
+
import { prefix } from '../common/config';
|
|
224
|
+
import props from './props';
|
|
225
|
+
import { toCamel, coalesce } from '../common/utils';
|
|
226
|
+
import { isObject } from '../common/validator';
|
|
227
|
+
import useCustomNavbar from '../mixins/using-custom-navbar';
|
|
228
|
+
import tools from '../common/utils.wxs';
|
|
229
|
+
import { getActionClass } from './computed.js';
|
|
230
|
+
import { getFunctionalMixin } from '../common/functional/mixin';
|
|
231
|
+
import { canUseVirtualHost } from '../common/version';
|
|
232
|
+
|
|
233
|
+
const name = `${prefix}-dialog`;
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
export default uniComponent({
|
|
237
|
+
name,
|
|
238
|
+
options: {
|
|
239
|
+
styleIsolation: 'shared',
|
|
240
|
+
},
|
|
241
|
+
externalClasses: [
|
|
242
|
+
`${prefix}-class`,
|
|
243
|
+
`${prefix}-class-content`,
|
|
244
|
+
`${prefix}-class-confirm`,
|
|
245
|
+
`${prefix}-class-cancel`,
|
|
246
|
+
`${prefix}-class-action`,
|
|
247
|
+
],
|
|
248
|
+
mixins: [getFunctionalMixin(props), useCustomNavbar],
|
|
249
|
+
components: {
|
|
250
|
+
TPopup,
|
|
251
|
+
TIcon,
|
|
252
|
+
TButton,
|
|
253
|
+
},
|
|
254
|
+
props: {
|
|
255
|
+
...props,
|
|
256
|
+
},
|
|
257
|
+
data() {
|
|
258
|
+
return {
|
|
259
|
+
prefix,
|
|
260
|
+
classPrefix: name,
|
|
261
|
+
buttonVariant: 'text',
|
|
262
|
+
tools,
|
|
263
|
+
|
|
264
|
+
_confirm: null,
|
|
265
|
+
_cancel: null,
|
|
266
|
+
useVirtualHost: canUseVirtualHost(),
|
|
267
|
+
};
|
|
268
|
+
},
|
|
269
|
+
watch: {
|
|
270
|
+
dataConfirmBtn: {
|
|
271
|
+
handler() {
|
|
272
|
+
this.onWatchBtn(this.dataConfirmBtn, this.dataCancelBtn);
|
|
273
|
+
},
|
|
274
|
+
immediate: true,
|
|
275
|
+
},
|
|
276
|
+
dataCancelBtn: {
|
|
277
|
+
handler() {
|
|
278
|
+
this.onWatchBtn(this.dataConfirmBtn, this.dataCancelBtn);
|
|
279
|
+
},
|
|
280
|
+
immediate: true,
|
|
281
|
+
},
|
|
282
|
+
},
|
|
283
|
+
methods: {
|
|
284
|
+
coalesce,
|
|
285
|
+
getActionClass,
|
|
286
|
+
onWatchBtn(confirm, cancel) {
|
|
287
|
+
const { prefix, classPrefix, dataButtonLayout } = this;
|
|
288
|
+
const rect = { buttonVariant: 'text' };
|
|
289
|
+
const useBaseVariant = [confirm, cancel].some(item => isObject(item) && item.variant && item.variant !== 'text');
|
|
290
|
+
const buttonMap = { confirm, cancel };
|
|
291
|
+
const cls = [`${classPrefix}__button`];
|
|
292
|
+
const externalCls = [];
|
|
293
|
+
|
|
294
|
+
if (useBaseVariant) {
|
|
295
|
+
rect.buttonVariant = 'base';
|
|
296
|
+
cls.push(`${classPrefix}__button--${dataButtonLayout}`);
|
|
297
|
+
} else {
|
|
298
|
+
cls.push(`${classPrefix}__button--text`);
|
|
299
|
+
externalCls.push(`${classPrefix}-button`);
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
const useVirtualHost = canUseVirtualHost();
|
|
303
|
+
|
|
304
|
+
Object.keys(buttonMap).forEach((key) => {
|
|
305
|
+
const btn = buttonMap[key];
|
|
306
|
+
const rootClass = [...cls, `${classPrefix}__button--${key}`];
|
|
307
|
+
const tClass = [...externalCls, this[toCamel(`${prefix}-class-${key}`)], ...rootClass].join(' ');
|
|
308
|
+
|
|
309
|
+
const base = {
|
|
310
|
+
block: true,
|
|
311
|
+
rootClass,
|
|
312
|
+
|
|
313
|
+
tClass: useVirtualHost ? tClass : '',
|
|
314
|
+
class: !useVirtualHost ? tClass : '',
|
|
315
|
+
|
|
316
|
+
variant: rect.buttonVariant,
|
|
317
|
+
openType: '',
|
|
318
|
+
};
|
|
319
|
+
|
|
320
|
+
if (key === 'cancel' && rect.buttonVariant === 'base') {
|
|
321
|
+
base.theme = 'light';
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
if (typeof btn === 'string') {
|
|
325
|
+
rect[`_${key}`] = { ...base, content: btn };
|
|
326
|
+
} else if (btn && typeof btn === 'object') {
|
|
327
|
+
rect[`_${key}`] = { ...base, ...btn };
|
|
328
|
+
} else {
|
|
329
|
+
rect[`_${key}`] = null;
|
|
330
|
+
}
|
|
331
|
+
});
|
|
332
|
+
|
|
333
|
+
Object.keys(rect).forEach((key) => {
|
|
334
|
+
this[key] = rect[key];
|
|
335
|
+
});
|
|
336
|
+
},
|
|
337
|
+
onTplButtonTap(e, { type, extra }) {
|
|
338
|
+
const evtType = e.type;
|
|
339
|
+
const button = this[`_${type}`];
|
|
340
|
+
const cbName = `bind${evtType}`;
|
|
341
|
+
|
|
342
|
+
if (type === 'action') {
|
|
343
|
+
this.onActionTap(extra);
|
|
344
|
+
return;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
if (typeof button?.[cbName] === 'function') {
|
|
348
|
+
const closeFlag = button[cbName](e);
|
|
349
|
+
if (closeFlag) {
|
|
350
|
+
this.close();
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
const hasOpenType = !!button?.openType;
|
|
355
|
+
if (!hasOpenType && ['confirm', 'cancel'].includes(type)) {
|
|
356
|
+
this[toCamel(`on-${type}`)]?.(type);
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
if (evtType !== 'click') {
|
|
360
|
+
const success = e.detail?.errMsg?.indexOf('ok') > -1;
|
|
361
|
+
this.$emit(success ? 'open-type-event' : 'open-type-error-event', e.detail);
|
|
362
|
+
}
|
|
363
|
+
},
|
|
364
|
+
|
|
365
|
+
onConfirm(e) {
|
|
366
|
+
this.$emit('confirm', { e });
|
|
367
|
+
|
|
368
|
+
if (this._onConfirm) {
|
|
369
|
+
this._onConfirm({ trigger: 'confirm' });
|
|
370
|
+
this.close();
|
|
371
|
+
}
|
|
372
|
+
},
|
|
373
|
+
|
|
374
|
+
onCancel(e) {
|
|
375
|
+
const trigger = { trigger: 'cancel' };
|
|
376
|
+
|
|
377
|
+
this.$emit('cancel', { e });
|
|
378
|
+
this.$emit('close', trigger);
|
|
379
|
+
|
|
380
|
+
if (this._onCancel) {
|
|
381
|
+
this._onCancel(trigger);
|
|
382
|
+
this.close();
|
|
383
|
+
}
|
|
384
|
+
},
|
|
385
|
+
|
|
386
|
+
onClose() {
|
|
387
|
+
const trigger = { trigger: 'close-btn' };
|
|
388
|
+
|
|
389
|
+
this.$emit('close', trigger);
|
|
390
|
+
this._onCancel?.(trigger);
|
|
391
|
+
this.close();
|
|
392
|
+
},
|
|
393
|
+
|
|
394
|
+
close() {
|
|
395
|
+
this.dataVisible = false;
|
|
396
|
+
},
|
|
397
|
+
|
|
398
|
+
overlayClick(e) {
|
|
399
|
+
this.$emit('overlay-click', { e });
|
|
400
|
+
|
|
401
|
+
if (this.dataCloseOnOverlayClick) {
|
|
402
|
+
const trigger = { trigger: 'overlay' };
|
|
403
|
+
|
|
404
|
+
this.$emit('close', trigger);
|
|
405
|
+
this._onCancel?.(trigger);
|
|
406
|
+
this.close();
|
|
407
|
+
}
|
|
408
|
+
},
|
|
409
|
+
|
|
410
|
+
onActionTap(index) {
|
|
411
|
+
this.$emit('action', { index });
|
|
412
|
+
if (this._onAction) {
|
|
413
|
+
this._onAction({ index });
|
|
414
|
+
this.close();
|
|
415
|
+
}
|
|
416
|
+
},
|
|
417
|
+
},
|
|
418
|
+
});
|
|
419
|
+
</script>
|
|
420
|
+
<style scoped>
|
|
421
|
+
@import './dialog.css';
|
|
422
|
+
</style>
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
declare type Context = any;
|
|
2
|
+
interface DialogAlertOptionsType {
|
|
3
|
+
context?: Context;
|
|
4
|
+
selector?: string;
|
|
5
|
+
title?: string;
|
|
6
|
+
content?: string;
|
|
7
|
+
zIndex?: number;
|
|
8
|
+
asyncClose?: boolean;
|
|
9
|
+
confirmButtonText?: string;
|
|
10
|
+
textAlign?: string;
|
|
11
|
+
cancelBtn?: string | object;
|
|
12
|
+
confirmBtn?: string | object;
|
|
13
|
+
showOverlay?: boolean;
|
|
14
|
+
closeOnOverlayClick?: boolean;
|
|
15
|
+
preventScrollThrough?: boolean;
|
|
16
|
+
}
|
|
17
|
+
interface DialogConfirmOptionsType extends DialogAlertOptionsType {
|
|
18
|
+
cancelButtonText?: string;
|
|
19
|
+
}
|
|
20
|
+
interface Action {
|
|
21
|
+
content: string;
|
|
22
|
+
theme?: 'default' | 'primary' | 'danger' | 'light';
|
|
23
|
+
}
|
|
24
|
+
interface DialogActionOptionsType {
|
|
25
|
+
context?: Context;
|
|
26
|
+
selector?: string;
|
|
27
|
+
title?: string;
|
|
28
|
+
content: string;
|
|
29
|
+
zIndex?: number;
|
|
30
|
+
asyncClose?: boolean;
|
|
31
|
+
actions?: Action[];
|
|
32
|
+
buttonLayout?: 'vertical' | 'horizontal';
|
|
33
|
+
}
|
|
34
|
+
declare const Handler: {
|
|
35
|
+
alert(options: DialogAlertOptionsType): Promise<unknown>;
|
|
36
|
+
confirm(options: DialogConfirmOptionsType): Promise<unknown>;
|
|
37
|
+
close(options?: DialogConfirmOptionsType): Promise<void>;
|
|
38
|
+
action(options: DialogActionOptionsType): Promise<{
|
|
39
|
+
index: number;
|
|
40
|
+
}>;
|
|
41
|
+
};
|
|
42
|
+
export default Handler;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import props from './props';
|
|
2
|
+
import { getInstance } from '../common/utils';
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
const defaultOptions = {
|
|
6
|
+
actions: [],
|
|
7
|
+
buttonLayout: props.buttonLayout.default,
|
|
8
|
+
cancelBtn: props.cancelBtn.default,
|
|
9
|
+
closeOnOverlayClick: props.closeOnOverlayClick.default,
|
|
10
|
+
confirmBtn: props.confirmBtn.value,
|
|
11
|
+
content: '',
|
|
12
|
+
preventScrollThrough: props.preventScrollThrough.default,
|
|
13
|
+
showOverlay: props.showOverlay.default,
|
|
14
|
+
title: '',
|
|
15
|
+
visible: props.visible.default,
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export default {
|
|
19
|
+
alert(options) {
|
|
20
|
+
const { context, selector = '#t-dialog', ...otherOptions } = { ...options };
|
|
21
|
+
const instance = getInstance(context, selector);
|
|
22
|
+
if (!instance) return Promise.reject();
|
|
23
|
+
|
|
24
|
+
return new Promise((resolve) => {
|
|
25
|
+
const mergedOptions = {
|
|
26
|
+
...defaultOptions,
|
|
27
|
+
...instance.properties,
|
|
28
|
+
...otherOptions,
|
|
29
|
+
};
|
|
30
|
+
instance.setData({
|
|
31
|
+
cancelBtn: '',
|
|
32
|
+
...mergedOptions,
|
|
33
|
+
visible: true,
|
|
34
|
+
});
|
|
35
|
+
instance._onConfirm = resolve;
|
|
36
|
+
});
|
|
37
|
+
},
|
|
38
|
+
confirm(options) {
|
|
39
|
+
const { context, selector = '#t-dialog', ...otherOptions } = { ...options };
|
|
40
|
+
const instance = getInstance(context, selector);
|
|
41
|
+
if (!instance) return Promise.reject();
|
|
42
|
+
|
|
43
|
+
return new Promise((resolve, reject) => {
|
|
44
|
+
const mergedOptions = {
|
|
45
|
+
...defaultOptions,
|
|
46
|
+
...instance.properties,
|
|
47
|
+
...otherOptions,
|
|
48
|
+
};
|
|
49
|
+
instance.setData({
|
|
50
|
+
...mergedOptions,
|
|
51
|
+
visible: true,
|
|
52
|
+
});
|
|
53
|
+
instance._onConfirm = resolve;
|
|
54
|
+
instance._onCancel = reject;
|
|
55
|
+
});
|
|
56
|
+
},
|
|
57
|
+
close(options) {
|
|
58
|
+
const { context, selector = '#t-dialog' } = { ...options };
|
|
59
|
+
const instance = getInstance(context, selector);
|
|
60
|
+
if (instance) {
|
|
61
|
+
instance.close();
|
|
62
|
+
return Promise.resolve();
|
|
63
|
+
}
|
|
64
|
+
return Promise.reject();
|
|
65
|
+
},
|
|
66
|
+
action(options) {
|
|
67
|
+
const { context, selector = '#t-dialog', ...otherOptions } = { ...options };
|
|
68
|
+
const instance = getInstance(context, selector);
|
|
69
|
+
if (!instance) return Promise.reject();
|
|
70
|
+
const { buttonLayout = 'vertical', actions = instance.properties.actions } = options;
|
|
71
|
+
const maxLengthSuggestion = buttonLayout === 'vertical' ? 7 : 3;
|
|
72
|
+
if (!actions || (typeof actions === 'object' && (actions.length === 0 || actions.length > maxLengthSuggestion))) {
|
|
73
|
+
console.warn(`action 数量建议控制在1至${maxLengthSuggestion}个`);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
return new Promise((resolve) => {
|
|
77
|
+
const mergedOptions = {
|
|
78
|
+
...defaultOptions,
|
|
79
|
+
...instance.properties,
|
|
80
|
+
...otherOptions,
|
|
81
|
+
};
|
|
82
|
+
instance.setData({
|
|
83
|
+
...mergedOptions,
|
|
84
|
+
buttonLayout,
|
|
85
|
+
visible: true,
|
|
86
|
+
});
|
|
87
|
+
instance._onAction = resolve;
|
|
88
|
+
});
|
|
89
|
+
},
|
|
90
|
+
};
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC
|
|
5
|
+
* */
|
|
6
|
+
|
|
7
|
+
import type { TdDialogProps } from './type';
|
|
8
|
+
export default {
|
|
9
|
+
/** 操作栏 */
|
|
10
|
+
actions: {
|
|
11
|
+
type: Array,
|
|
12
|
+
},
|
|
13
|
+
/** 多按钮排列方式 */
|
|
14
|
+
buttonLayout: {
|
|
15
|
+
type: String,
|
|
16
|
+
default: 'horizontal' as TdDialogProps['buttonLayout'],
|
|
17
|
+
validator(val: TdDialogProps['buttonLayout']): boolean {
|
|
18
|
+
if (!val) return true;
|
|
19
|
+
return ['horizontal', 'vertical'].includes(val);
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
/** 取消按钮,可自定义。值为 null 则不显示取消按钮。值类型为字符串,则表示自定义按钮文本,值类型为 Object 则表示透传 Button 组件属性。使用 Slot 自定义按钮时,需自行控制取消事件 */
|
|
23
|
+
cancelBtn: {
|
|
24
|
+
type: [String, Object],
|
|
25
|
+
},
|
|
26
|
+
/** 是否展示关闭按钮,值为 `true` 显示默认关闭按钮;值为 `false` 则不显示关闭按钮;使用 Object 时透传至图标组件 */
|
|
27
|
+
closeBtn: {
|
|
28
|
+
type: [Boolean, Object],
|
|
29
|
+
default: false as TdDialogProps['closeBtn'],
|
|
30
|
+
},
|
|
31
|
+
/** 点击蒙层时是否触发关闭事件 */
|
|
32
|
+
closeOnOverlayClick: Boolean,
|
|
33
|
+
/** 确认按钮。值为 null 则不显示确认按钮。值类型为字符串,则表示自定义按钮文本,值类型为 Object 则表示透传 Button 组件属性。使用 Slot 自定义按钮时,需自行控制确认事件 */
|
|
34
|
+
confirmBtn: {
|
|
35
|
+
type: [String, Object],
|
|
36
|
+
},
|
|
37
|
+
/** 内容 */
|
|
38
|
+
content: {
|
|
39
|
+
type: String,
|
|
40
|
+
},
|
|
41
|
+
/** 透传至 Overlay 组件 */
|
|
42
|
+
overlayProps: {
|
|
43
|
+
type: Object,
|
|
44
|
+
default: () => ({}),
|
|
45
|
+
},
|
|
46
|
+
/** 防止滚动穿透 */
|
|
47
|
+
preventScrollThrough: {
|
|
48
|
+
type: Boolean,
|
|
49
|
+
default: true,
|
|
50
|
+
},
|
|
51
|
+
/** 是否显示遮罩层 */
|
|
52
|
+
showOverlay: {
|
|
53
|
+
type: Boolean,
|
|
54
|
+
default: true,
|
|
55
|
+
},
|
|
56
|
+
/** 标题 */
|
|
57
|
+
title: {
|
|
58
|
+
type: String,
|
|
59
|
+
},
|
|
60
|
+
/** 是否使用了自定义导航栏 */
|
|
61
|
+
usingCustomNavbar: Boolean,
|
|
62
|
+
/** 控制对话框是否显示 */
|
|
63
|
+
visible: Boolean,
|
|
64
|
+
/** 对话框层级,Web 侧样式默认为 2500,移动端样式默认 2500,小程序样式默认为 11500 */
|
|
65
|
+
zIndex: {
|
|
66
|
+
type: Number,
|
|
67
|
+
default: 11500,
|
|
68
|
+
},
|
|
69
|
+
/** 点击多按钮中的其中一个时触发 */
|
|
70
|
+
onAction: {
|
|
71
|
+
type: Function,
|
|
72
|
+
default: () => ({}),
|
|
73
|
+
},
|
|
74
|
+
/** 如果“取消”按钮存在,则点击“取消”按钮时触发,同时触发关闭事件 */
|
|
75
|
+
onCancel: {
|
|
76
|
+
type: Function,
|
|
77
|
+
default: () => ({}),
|
|
78
|
+
},
|
|
79
|
+
/** 关闭事件,点击 取消按钮 或 点击蒙层 时触发 */
|
|
80
|
+
onClose: {
|
|
81
|
+
type: Function,
|
|
82
|
+
default: () => ({}),
|
|
83
|
+
},
|
|
84
|
+
/** 如果“确认”按钮存在,则点击“确认”按钮时触发 */
|
|
85
|
+
onConfirm: {
|
|
86
|
+
type: Function,
|
|
87
|
+
default: () => ({}),
|
|
88
|
+
},
|
|
89
|
+
/** 如果蒙层存在,点击蒙层时触发 */
|
|
90
|
+
onOverlayClick: {
|
|
91
|
+
type: Function,
|
|
92
|
+
default: () => ({}),
|
|
93
|
+
},
|
|
94
|
+
};
|