@tdesign/uniapp 0.7.3 → 0.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (258) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/README.md +44 -35
  3. package/dist/action-sheet/README.md +9 -4
  4. package/dist/action-sheet/action-sheet.vue +158 -150
  5. package/dist/action-sheet/props.ts +2 -2
  6. package/dist/action-sheet/type.ts +1 -1
  7. package/dist/avatar/README.md +3 -1
  8. package/dist/avatar/avatar.vue +89 -87
  9. package/dist/avatar-group/avatar-group.vue +69 -67
  10. package/dist/back-top/README.md +3 -1
  11. package/dist/back-top/back-top.vue +60 -58
  12. package/dist/badge/README.md +3 -1
  13. package/dist/badge/badge.vue +69 -59
  14. package/dist/button/README.md +3 -1
  15. package/dist/button/button.vue +121 -116
  16. package/dist/button/props.ts +2 -2
  17. package/dist/button/type.ts +1 -1
  18. package/dist/calendar/README.md +3 -1
  19. package/dist/calendar/calendar-header.vue +4 -4
  20. package/dist/calendar/calendar.vue +308 -297
  21. package/dist/calendar/template.vue +1 -1
  22. package/dist/cascader/README.en-US.md +2 -1
  23. package/dist/cascader/README.md +5 -2
  24. package/dist/cascader/cascader.vue +340 -328
  25. package/dist/cascader/props.ts +6 -1
  26. package/dist/cascader/type.ts +6 -0
  27. package/dist/cell/README.md +3 -1
  28. package/dist/cell/cell.vue +127 -121
  29. package/dist/cell-group/cell-group.vue +32 -30
  30. package/dist/check-tag/check-tag.vue +73 -71
  31. package/dist/checkbox/README.md +3 -1
  32. package/dist/checkbox/checkbox.vue +127 -127
  33. package/dist/checkbox/props.ts +6 -6
  34. package/dist/checkbox/type.ts +3 -3
  35. package/dist/checkbox-group/checkbox-group.vue +175 -173
  36. package/dist/checkbox-group/props.ts +6 -6
  37. package/dist/checkbox-group/type.ts +4 -4
  38. package/dist/col/README.md +3 -1
  39. package/dist/col/col.vue +26 -24
  40. package/dist/collapse/README.md +3 -1
  41. package/dist/collapse/collapse.vue +83 -81
  42. package/dist/collapse-panel/collapse-panel.vue +121 -119
  43. package/dist/collapse-panel/props.ts +4 -4
  44. package/dist/collapse-panel/type.ts +2 -2
  45. package/dist/color-picker/README.md +4 -2
  46. package/dist/color-picker/color-picker.vue +324 -322
  47. package/dist/color-picker/props.ts +2 -2
  48. package/dist/color-picker/template.vue +14 -10
  49. package/dist/common/common.ts +122 -5
  50. package/dist/common/src/index.js +0 -1
  51. package/dist/common/style/theme/index.css +5 -5
  52. package/dist/common/utils.js +7 -2
  53. package/dist/common/validator.ts +496 -0
  54. package/dist/config-provider/README.en-US.md +184 -0
  55. package/dist/config-provider/README.md +236 -0
  56. package/dist/config-provider/config-provider.vue +105 -0
  57. package/dist/config-provider/config-store.js +70 -0
  58. package/dist/config-provider/props.ts +16 -0
  59. package/dist/config-provider/reactive-state.js +39 -0
  60. package/dist/config-provider/type.ts +401 -0
  61. package/dist/config-provider/use-config.js +29 -0
  62. package/dist/config-provider/utils.js +29 -0
  63. package/dist/count-down/README.md +3 -1
  64. package/dist/count-down/count-down.vue +98 -97
  65. package/dist/date-time-picker/README.md +3 -1
  66. package/dist/date-time-picker/date-time-picker.vue +410 -395
  67. package/dist/demo/demo.vue +1 -0
  68. package/dist/dialog/README.md +3 -1
  69. package/dist/dialog/dialog.vue +175 -173
  70. package/dist/divider/README.md +3 -1
  71. package/dist/divider/divider.vue +38 -36
  72. package/dist/draggable/draggable.vue +60 -58
  73. package/dist/drawer/README.md +4 -2
  74. package/dist/drawer/drawer.vue +48 -46
  75. package/dist/dropdown-item/dropdown-item.vue +209 -207
  76. package/dist/dropdown-item/props.ts +4 -4
  77. package/dist/dropdown-item/type.ts +3 -3
  78. package/dist/dropdown-menu/README.md +2 -2
  79. package/dist/dropdown-menu/dropdown-menu.vue +93 -99
  80. package/dist/empty/README.md +3 -1
  81. package/dist/empty/empty.vue +43 -42
  82. package/dist/fab/README.md +3 -1
  83. package/dist/fab/fab.vue +88 -86
  84. package/dist/footer/README.md +3 -1
  85. package/dist/footer/footer.vue +36 -34
  86. package/dist/form/README.en-US.md +17 -24
  87. package/dist/form/README.md +21 -26
  88. package/dist/form/form.css +1 -166
  89. package/dist/form/form.vue +251 -236
  90. package/dist/form/props.ts +2 -21
  91. package/dist/form/type.ts +6 -69
  92. package/dist/form-item/README.en-US.md +4 -5
  93. package/dist/form-item/README.md +4 -5
  94. package/dist/form-item/form-item.css +72 -95
  95. package/dist/form-item/form-item.vue +315 -337
  96. package/dist/form-item/form-model.ts +125 -173
  97. package/dist/form-item/props.ts +4 -17
  98. package/dist/form-item/type.ts +43 -1
  99. package/dist/grid/README.md +3 -1
  100. package/dist/grid/grid.vue +53 -51
  101. package/dist/grid-item/grid-item.vue +121 -119
  102. package/dist/guide/README.md +4 -2
  103. package/dist/guide/guide.vue +281 -277
  104. package/dist/icon/README.md +12 -11
  105. package/dist/icon/icon.css +1633 -1624
  106. package/dist/icon/icon.vue +78 -76
  107. package/dist/image/README.md +4 -2
  108. package/dist/image/image.vue +103 -101
  109. package/dist/image-viewer/README.md +3 -1
  110. package/dist/image-viewer/image-viewer.vue +160 -158
  111. package/dist/image-viewer/props.ts +2 -2
  112. package/dist/image-viewer/type.ts +1 -1
  113. package/dist/index.js +16 -0
  114. package/dist/indexes/README.md +3 -1
  115. package/dist/indexes/indexes.vue +264 -267
  116. package/dist/indexes-anchor/indexes-anchor.vue +41 -41
  117. package/dist/input/README.md +3 -1
  118. package/dist/input/input.vue +172 -198
  119. package/dist/input/props.ts +6 -6
  120. package/dist/input/type.ts +3 -3
  121. package/dist/link/README.md +3 -1
  122. package/dist/link/link.vue +73 -71
  123. package/dist/loading/README.md +3 -1
  124. package/dist/loading/loading.vue +59 -59
  125. package/dist/locale/ar_KW.ts +157 -0
  126. package/dist/locale/en_US.ts +146 -0
  127. package/dist/locale/it_IT.ts +145 -0
  128. package/dist/locale/ja_JP.ts +132 -0
  129. package/dist/locale/ko_KR.ts +132 -0
  130. package/dist/locale/ru_RU.ts +157 -0
  131. package/dist/locale/zh_CN.ts +133 -0
  132. package/dist/locale/zh_TW.ts +132 -0
  133. package/dist/message/README.md +8 -3
  134. package/dist/message/message.vue +181 -173
  135. package/dist/message/props.ts +2 -2
  136. package/dist/message/type.ts +1 -1
  137. package/dist/message-item/message-item.vue +192 -184
  138. package/dist/mixins/page-scroll.d.ts +19 -0
  139. package/dist/mixins/skyline.js +1 -1
  140. package/dist/mixins/using-config.js +39 -0
  141. package/dist/navbar/README.md +3 -1
  142. package/dist/navbar/navbar.vue +201 -199
  143. package/dist/notice-bar/README.md +3 -1
  144. package/dist/notice-bar/notice-bar.vue +175 -171
  145. package/dist/notice-bar/props.ts +2 -2
  146. package/dist/notice-bar/type.ts +1 -1
  147. package/dist/npm/dayjs/esm/locale/ar.js +81 -0
  148. package/dist/npm/dayjs/esm/locale/it.js +39 -0
  149. package/dist/overlay/README.md +3 -1
  150. package/dist/overlay/overlay.vue +50 -48
  151. package/dist/picker/README.md +3 -1
  152. package/dist/picker/picker.vue +168 -161
  153. package/dist/picker-item/picker-item.vue +269 -269
  154. package/dist/popover/README.md +4 -2
  155. package/dist/popover/popover.vue +262 -261
  156. package/dist/popover/props.ts +4 -4
  157. package/dist/popover/type.ts +2 -2
  158. package/dist/popup/README.md +3 -1
  159. package/dist/popup/popup.vue +46 -45
  160. package/dist/progress/README.md +3 -3
  161. package/dist/progress/progress.vue +76 -76
  162. package/dist/pull-down-refresh/README.md +3 -1
  163. package/dist/pull-down-refresh/props.ts +2 -2
  164. package/dist/pull-down-refresh/pull-down-refresh.vue +240 -234
  165. package/dist/pull-down-refresh/type.ts +1 -1
  166. package/dist/qrcode/README.md +4 -2
  167. package/dist/qrcode/components/qrcode-canvas/qrcode-canvas.vue +340 -338
  168. package/dist/qrcode/components/qrcode-status/qrcode-status.vue +6 -6
  169. package/dist/qrcode/qrcode.vue +93 -87
  170. package/dist/radio/README.md +3 -1
  171. package/dist/radio/props.ts +6 -6
  172. package/dist/radio/radio.vue +118 -120
  173. package/dist/radio/type.ts +3 -3
  174. package/dist/radio-group/props.ts +4 -4
  175. package/dist/radio-group/radio-group.vue +136 -134
  176. package/dist/radio-group/type.ts +4 -4
  177. package/dist/rate/README.md +3 -1
  178. package/dist/rate/computed.js +2 -2
  179. package/dist/rate/props.ts +4 -4
  180. package/dist/rate/rate.css +1 -0
  181. package/dist/rate/rate.vue +155 -154
  182. package/dist/rate/type.ts +2 -2
  183. package/dist/result/README.md +3 -1
  184. package/dist/result/result.vue +41 -39
  185. package/dist/row/row.vue +38 -36
  186. package/dist/script/postinstall.js +49 -24
  187. package/dist/scroll-view/scroll-view.vue +24 -22
  188. package/dist/search/README.md +3 -1
  189. package/dist/search/props.ts +2 -2
  190. package/dist/search/search.vue +127 -125
  191. package/dist/search/type.ts +1 -1
  192. package/dist/side-bar/README.md +3 -1
  193. package/dist/side-bar/side-bar.vue +57 -55
  194. package/dist/side-bar-item/side-bar-item.vue +86 -86
  195. package/dist/skeleton/README.md +3 -1
  196. package/dist/skeleton/skeleton.vue +126 -124
  197. package/dist/slider/README.md +4 -2
  198. package/dist/slider/props.ts +2 -2
  199. package/dist/slider/slider.vue +457 -457
  200. package/dist/slider/type.ts +1 -1
  201. package/dist/step-item/step-item.vue +77 -75
  202. package/dist/stepper/README.md +3 -1
  203. package/dist/stepper/props.ts +2 -2
  204. package/dist/stepper/stepper.vue +168 -149
  205. package/dist/stepper/type.ts +1 -1
  206. package/dist/steps/README.md +3 -1
  207. package/dist/steps/props.ts +2 -2
  208. package/dist/steps/steps.vue +83 -81
  209. package/dist/steps/type.ts +1 -1
  210. package/dist/sticky/README.md +3 -1
  211. package/dist/sticky/sticky.vue +104 -102
  212. package/dist/swipe-cell/README.md +3 -1
  213. package/dist/swipe-cell/swipe-cell.vue +91 -89
  214. package/dist/swiper/README.md +4 -2
  215. package/dist/swiper/swiper.vue +91 -89
  216. package/dist/swiper-nav/swiper-nav.vue +38 -36
  217. package/dist/switch/README.md +3 -1
  218. package/dist/switch/props.ts +2 -2
  219. package/dist/switch/switch.vue +62 -62
  220. package/dist/switch/type.ts +1 -1
  221. package/dist/tab-bar/README.md +3 -1
  222. package/dist/tab-bar/tab-bar.vue +88 -86
  223. package/dist/tab-bar-item/tab-bar-item.vue +85 -82
  224. package/dist/tab-panel/tab-panel.vue +66 -64
  225. package/dist/tabs/README.md +3 -1
  226. package/dist/tabs/tabs.vue +294 -287
  227. package/dist/tag/README.md +3 -1
  228. package/dist/tag/tag.vue +79 -77
  229. package/dist/textarea/README.md +3 -1
  230. package/dist/textarea/props.ts +6 -6
  231. package/dist/textarea/textarea.vue +128 -151
  232. package/dist/textarea/type.ts +3 -3
  233. package/dist/theme.css +467 -0
  234. package/dist/theme.css.d.ts +2 -0
  235. package/dist/theme.less +1 -0
  236. package/dist/theme.less.d.ts +2 -0
  237. package/dist/toast/README.md +3 -1
  238. package/dist/toast/toast.vue +107 -106
  239. package/dist/transition/README.md +4 -6
  240. package/dist/transition/transition.vue +30 -28
  241. package/dist/tree-select/README.md +3 -1
  242. package/dist/tree-select/tree-select.vue +151 -151
  243. package/dist/types/config-provider.d.ts +7 -0
  244. package/dist/types/index.d.ts +17 -0
  245. package/dist/types/popover.d.ts +7 -0
  246. package/dist/upload/README.en-US.md +13 -14
  247. package/dist/upload/README.md +14 -13
  248. package/dist/upload/props.ts +2 -4
  249. package/dist/upload/type.ts +12 -11
  250. package/dist/upload/upload.css +1 -1
  251. package/dist/upload/upload.vue +672 -512
  252. package/dist/watermark/README.md +3 -1
  253. package/dist/watermark/watermark.vue +151 -149
  254. package/global.d.ts +2 -0
  255. package/package.json +51 -5
  256. package/dist/common/src/superComponent.js +0 -5
  257. package/dist/common/validator.js +0 -38
  258. package/dist/form/form-item-props.ts +0 -56
@@ -1,13 +1,13 @@
1
1
  <template>
2
2
  <view
3
3
  :class="classPrefix"
4
- :style="tools._style(['height:' + tools.addUnit(height), customStyle])"
4
+ :style="'' + tools._style([`height:${tools.addUnit(height)}`, customStyle])"
5
5
  >
6
6
  <t-scroll-view
7
7
  v-for="(item, level) in treeOptions"
8
8
  :key="level"
9
9
  :t-class="getScrollViewTClass(level)"
10
- :class="getScrollViewClass(level)"
10
+ :class="'' + getScrollViewClass(level)"
11
11
  :scroll-into-view="scrollIntoView && scrollIntoView[level] ? 'scroll-to-' + scrollIntoView[level] : ''"
12
12
  >
13
13
  <t-side-bar
@@ -28,14 +28,14 @@
28
28
  />
29
29
  </t-side-bar>
30
30
 
31
- <block v-else-if="level != leafLevel">
31
+ <template v-else-if="level != leafLevel">
32
32
  <view
33
33
  v-for="(treeItem, index) in treeOptions[level]"
34
34
  :key="`view-${level}-${index}`"
35
35
  :data-level="level"
36
36
  :data-value="treeItem.value"
37
37
  :class="
38
- tools.cls(classPrefix + '__item', [
38
+ '' + tools.cls(classPrefix + '__item', [
39
39
  ['active', treeItem.value === innerValue[level]],
40
40
  ['disabled', treeItem.disabled]
41
41
  ]) +
@@ -49,7 +49,7 @@
49
49
  {{ treeItem.label }}
50
50
  </view>
51
51
  </view>
52
- </block>
52
+ </template>
53
53
 
54
54
  <t-radio-group
55
55
  v-else-if="!multiple"
@@ -124,26 +124,7 @@ import { canUseVirtualHost } from '../common/version';
124
124
 
125
125
  const name = `${prefix}-tree-select`;
126
126
 
127
- export default uniComponent({
128
- name,
129
- options: {
130
- styleIsolation: 'shared',
131
- },
132
- controlledProps: [
133
- {
134
- key: 'value',
135
- event: 'change',
136
- },
137
- ],
138
- externalClasses: [
139
- `${prefix}-class`,
140
- `${prefix}-class-left-column`,
141
- `${prefix}-class-left-item`,
142
- `${prefix}-class-middle-item`,
143
- `${prefix}-class-right-column`,
144
- `${prefix}-class-right-item`,
145
- `${prefix}-class-right-item-label`,
146
- ],
127
+ export default {
147
128
  components: {
148
129
  TRadio,
149
130
  TRadioGroup,
@@ -153,164 +134,183 @@ export default uniComponent({
153
134
  TSideBarItem,
154
135
  TScrollView,
155
136
  },
156
- props: {
157
- ...props,
158
- },
159
- data() {
160
- return {
161
- prefix,
162
- classPrefix: name,
163
- scrollIntoView: null,
164
- tools,
165
-
166
- innerValue: coalesce(this.value, this.defaultValue),
167
- treeOptions: [],
168
- };
169
- },
170
- computed: {
171
-
172
- },
173
- watch: {
174
- value: {
175
- handler() {
176
- this.buildTreeOptions();
177
- },
178
- deep: true,
179
- immediate: true,
180
- },
137
+ ...uniComponent({
138
+ name,
181
139
  options: {
182
- handler() {
183
- this.buildTreeOptions();
140
+ styleIsolation: 'shared',
141
+ },
142
+ controlledProps: [
143
+ {
144
+ key: 'value',
145
+ event: 'change',
184
146
  },
185
- deep: true,
186
- immediate: true,
147
+ ],
148
+ externalClasses: [
149
+ `${prefix}-class`,
150
+ `${prefix}-class-left-column`,
151
+ `${prefix}-class-left-item`,
152
+ `${prefix}-class-middle-item`,
153
+ `${prefix}-class-right-column`,
154
+ `${prefix}-class-right-item`,
155
+ `${prefix}-class-right-item-label`,
156
+ ],
157
+ props: {
158
+ ...props,
159
+ },
160
+ data() {
161
+ return {
162
+ prefix,
163
+ classPrefix: name,
164
+ scrollIntoView: null,
165
+ tools,
166
+
167
+ innerValue: coalesce(this.value, this.defaultValue),
168
+ treeOptions: [],
169
+ leafLevel: -1,
170
+ };
187
171
  },
188
- keys: {
189
- handler() {
190
- this.buildTreeOptions();
172
+ watch: {
173
+ value: {
174
+ handler() {
175
+ this.buildTreeOptions();
176
+ },
177
+ deep: true,
178
+ immediate: true,
179
+ },
180
+ options: {
181
+ handler() {
182
+ this.buildTreeOptions();
183
+ },
184
+ deep: true,
185
+ immediate: true,
186
+ },
187
+ keys: {
188
+ handler() {
189
+ this.buildTreeOptions();
190
+ },
191
+ deep: true,
192
+ immediate: true,
191
193
  },
192
- deep: true,
193
- immediate: true,
194
+ multiple: 'buildTreeOptions',
194
195
  },
195
- multiple: 'buildTreeOptions',
196
- },
197
- mounted() {
198
- nextTick().then(() => {
199
- this.getScrollIntoView('init');
200
- });
201
- },
202
- methods: {
203
- getTreeClass,
204
- buildTreeOptions() {
205
- const { options, innerValue: value, customValue, multiple, keys } = this;
196
+ mounted() {
197
+ nextTick().then(() => {
198
+ this.getScrollIntoView('init');
199
+ });
200
+ },
201
+ methods: {
202
+ getTreeClass,
203
+ buildTreeOptions() {
204
+ const { options, innerValue: value, customValue, multiple, keys } = this;
206
205
 
207
- if (!options.length) return;
206
+ if (!options.length) return;
208
207
 
209
- const treeOptions = [];
208
+ const treeOptions = [];
210
209
 
211
- let level = -1;
212
- let currentNode = { children: options };
210
+ let level = -1;
211
+ let currentNode = { children: options };
213
212
 
214
- while (currentNode?.children) {
215
- level += 1;
216
- const currentLevelOptions = currentNode.children.map(item => ({
217
- label: item[keys?.label || 'label'],
218
- value: item[keys?.value || 'value'],
219
- disabled: item[keys?.disabled || 'disabled'],
220
- children: item[keys?.children || 'children'],
221
- }));
213
+ while (currentNode?.children) {
214
+ level += 1;
215
+ const currentLevelOptions = currentNode.children.map(item => ({
216
+ label: item[keys?.label || 'label'],
217
+ value: item[keys?.value || 'value'],
218
+ disabled: item[keys?.disabled || 'disabled'],
219
+ children: item[keys?.children || 'children'],
220
+ }));
222
221
 
223
- treeOptions.push(currentLevelOptions);
222
+ treeOptions.push(currentLevelOptions);
224
223
 
225
- const currentValue = coalesce(customValue?.[level], value?.[level]);
226
- currentNode = currentValue
227
- ? coalesce(currentLevelOptions.find(child => child.value === currentValue), currentLevelOptions[0])
228
- : currentLevelOptions[0];
229
- }
224
+ const currentValue = coalesce(customValue?.[level], value?.[level]);
225
+ currentNode = currentValue
226
+ ? coalesce(currentLevelOptions.find(child => child.value === currentValue), currentLevelOptions[0])
227
+ : currentLevelOptions[0];
228
+ }
230
229
 
231
- const depth = getTreeDepth(options, keys?.children);
230
+ const depth = getTreeDepth(options, keys?.children);
232
231
 
233
- // 补齐 treeOptions 长度到 depth
234
- while (treeOptions.length < depth) {
235
- treeOptions.push([]);
236
- level += 1;
237
- }
232
+ // 补齐 treeOptions 长度到 depth
233
+ while (treeOptions.length < depth) {
234
+ treeOptions.push([]);
235
+ level += 1;
236
+ }
238
237
 
239
- const leafLevel = Math.max(0, level);
240
- const innerValue = customValue
238
+ const leafLevel = Math.max(0, level);
239
+ const innerValue = customValue
241
240
  || treeOptions.map((levelOptions, idx) => {
242
241
  const isLastLevel = idx === treeOptions.length - 1;
243
242
  const defaultValue = isLastLevel && multiple ? [levelOptions[0]?.value] : levelOptions[0]?.value;
244
243
  return coalesce(value?.[idx], defaultValue);
245
244
  });
246
245
 
247
- this.innerValue = innerValue;
248
- this.leafLevel = leafLevel;
249
- this.treeOptions = treeOptions;
250
- },
246
+ this.innerValue = innerValue;
247
+ this.leafLevel = leafLevel;
248
+ this.treeOptions = treeOptions;
249
+ },
251
250
 
252
- getScrollIntoView(status) {
253
- const { innerValue: value, customValue, scrollIntoView } = this;
254
- if (status === 'init') {
255
- const innerValue = customValue || value;
256
- const scrollIntoView = Array.isArray(innerValue)
257
- ? innerValue.map(item => (Array.isArray(item) ? item[0] : item))
258
- : [innerValue];
251
+ getScrollIntoView(status) {
252
+ const { innerValue: value, customValue, scrollIntoView } = this;
253
+ if (status === 'init') {
254
+ const innerValue = customValue || value;
255
+ const scrollIntoView = Array.isArray(innerValue)
256
+ ? innerValue.map(item => (Array.isArray(item) ? item[0] : item))
257
+ : [innerValue];
259
258
 
260
- this.scrollIntoView = scrollIntoView;
261
- } else {
262
- if (scrollIntoView === null) return;
263
- this.scrollIntoView = null;
264
- }
265
- },
259
+ this.scrollIntoView = scrollIntoView;
260
+ } else {
261
+ if (scrollIntoView === null) return;
262
+ this.scrollIntoView = null;
263
+ }
264
+ },
266
265
 
267
- onRootChange(e) {
268
- const { innerValue } = this;
269
- const { value: itemValue } = e;
266
+ onRootChange(e) {
267
+ const { innerValue } = this;
268
+ const { value: itemValue } = e;
270
269
 
271
- this.getScrollIntoView('none');
272
- innerValue[0] = itemValue;
270
+ this.getScrollIntoView('none');
271
+ innerValue[0] = itemValue;
273
272
 
274
- this._trigger('change', { value: innerValue, level: 0 });
275
- },
273
+ this._trigger('change', { value: innerValue, level: 0 });
274
+ },
276
275
 
277
- handleTreeClick(e) {
278
- const { level, value: itemValue } = e.currentTarget.dataset;
279
- const { innerValue } = this;
276
+ handleTreeClick(e) {
277
+ const { level, value: itemValue } = e.currentTarget.dataset;
278
+ const { innerValue } = this;
280
279
 
281
- innerValue[level] = itemValue;
282
- this.getScrollIntoView('none');
283
- this._trigger('change', { value: innerValue, level: 1 });
284
- },
280
+ innerValue[level] = itemValue;
281
+ this.getScrollIntoView('none');
282
+ this._trigger('change', { value: innerValue, level: 1 });
283
+ },
285
284
 
286
- handleChange({ level, type, value }) {
287
- const { innerValue } = this;
285
+ handleChange({ level, type, value }) {
286
+ const { innerValue } = this;
288
287
 
289
- if (type === 'multiple') {
290
- if (!isDef(innerValue[level])) {
291
- innerValue[level] = [];
288
+ if (type === 'multiple') {
289
+ if (!isDef(innerValue[level])) {
290
+ innerValue[level] = [];
291
+ }
292
+ const index = innerValue[level].indexOf(value);
293
+ index === -1 ? innerValue[level].push(value) : innerValue[level].splice(index, 1);
294
+ } else {
295
+ innerValue[level] = value;
292
296
  }
293
- const index = innerValue[level].indexOf(value);
294
- index === -1 ? innerValue[level].push(value) : innerValue[level].splice(index, 1);
295
- } else {
296
- innerValue[level] = value;
297
- }
298
297
 
299
- this.getScrollIntoView('none');
300
- this._trigger('change', { value: innerValue, level });
301
- },
298
+ this.getScrollIntoView('none');
299
+ this._trigger('change', { value: innerValue, level });
300
+ },
302
301
 
303
- getScrollViewTClass(level) {
304
- return canUseVirtualHost() ? this.getScrollViewRealClass(level) : '';
305
- },
306
- getScrollViewClass(level) {
307
- return !canUseVirtualHost() ? this.getScrollViewRealClass(level) : '';
308
- },
309
- getScrollViewRealClass(level) {
310
- const { classPrefix, leafLevel, treeOptions, tClass } = this;
311
- return `${tools.cls(`${classPrefix}__column`, [getTreeClass(leafLevel - level, treeOptions.length)])} ${tClass}`;
302
+ getScrollViewTClass(level) {
303
+ return canUseVirtualHost() ? this.getScrollViewRealClass(level) : '';
304
+ },
305
+ getScrollViewClass(level) {
306
+ return !canUseVirtualHost() ? this.getScrollViewRealClass(level) : '';
307
+ },
308
+ getScrollViewRealClass(level) {
309
+ const { classPrefix, leafLevel, treeOptions, tClass } = this;
310
+ return `${tools.cls(`${classPrefix}__column`, [getTreeClass(leafLevel - level, treeOptions.length)])} ${tClass}`;
311
+ },
312
312
  },
313
- },
314
- });
313
+ }),
314
+ };
315
315
  </script>
316
316
  <style scoped src="./tree-select.css"></style>
@@ -0,0 +1,7 @@
1
+ import type { TransformEventHandlers, ExtractNonOnProps } from '../common/common';
2
+ import type { TdConfigProviderProps } from '../config-provider/type';
3
+
4
+ export type ConfigProviderProps = ExtractNonOnProps<TdConfigProviderProps>;
5
+ export type ConfigProviderEmits = TransformEventHandlers<TdConfigProviderProps, true>;
6
+ declare const ConfigProviderComponent: import('vue').DefineComponent<ConfigProviderProps, {}, {}, {}, {}, {}, {}, ConfigProviderEmits, any>;
7
+ export default ConfigProviderComponent;
@@ -15,6 +15,7 @@ export * from '../col/type';
15
15
  export * from '../collapse/type';
16
16
  export * from '../collapse-panel/type';
17
17
  export * from '../color-picker/type';
18
+ export * from '../config-provider/type';
18
19
  export * from '../count-down/type';
19
20
  export * from '../date-time-picker/type';
20
21
  export * from '../dialog/type';
@@ -43,6 +44,7 @@ export * from '../notice-bar/type';
43
44
  export * from '../overlay/type';
44
45
  export * from '../picker/type';
45
46
  export * from '../picker-item/type';
47
+ export * from '../popover/type';
46
48
  export * from '../popup/type';
47
49
  export * from '../progress/type';
48
50
  export * from '../pull-down-refresh/type';
@@ -75,3 +77,18 @@ export * from '../toast/type';
75
77
  export * from '../tree-select/type';
76
78
  export * from '../upload/type';
77
79
  export * from '../watermark/type';
80
+
81
+ // mixins
82
+ export { handlePageScroll } from '../mixins/page-scroll';
83
+
84
+ // 函数式调用
85
+ export { default as DialogPlugin } from '../dialog/index';
86
+ export { default as Dialog } from '../dialog/index';
87
+ export { default as MessagePlugin } from '../message/index';
88
+ export { default as Message } from '../message/index';
89
+ export { default as Toast, showToast, hideToast } from '../toast/index';
90
+ export { default as ToastPlugin } from '../toast/index';
91
+ export type { ToastOptionsType } from '../toast/index';
92
+ export { default as ActionSheetPlugin, ActionSheetTheme } from '../action-sheet/index';
93
+ export { default as ActionSheet } from '../action-sheet/index';
94
+ export type { ActionSheetShowOption } from '../action-sheet/show';
@@ -0,0 +1,7 @@
1
+ import type { TransformEventHandlers, ExtractNonOnProps } from '../common/common';
2
+ import type { TdPopoverProps } from '../popover/type';
3
+
4
+ export type PopoverProps = ExtractNonOnProps<TdPopoverProps>;
5
+ export type PopoverEmits = TransformEventHandlers<TdPopoverProps, true>;
6
+ declare const PopoverComponent: import('vue').DefineComponent<PopoverProps, {}, {}, {}, {}, {}, {}, PopoverEmits, any>;
7
+ export default PopoverComponent;
@@ -9,36 +9,35 @@ name | type | default | description | required
9
9
  custom-style | Object | - | CSS(Cascading Style Sheets) | N
10
10
  add-btn | Boolean | true | \- | N
11
11
  add-content | String | - | \- | N
12
- allow-upload-duplicate-file | Boolean | false | allow to upload duplicate name files | N
13
- config | Object | - | Typescript:`UploadMpConfig` `type UploadMpConfig = ImageConfig \| VideoConfig` `interface ImageConfig { count?: number; sizeType?: Array<SizeTypeValues>; sourceType?: Array<SourceTypeValues> }` `type SizeTypeValues = 'original' \| 'compressed'` `type SourceTypeValues = 'album' \| 'camera'` `interface VideoConfig { sourceType?: Array<SourceTypeValues>; compressed?: boolean; maxDuration?: number; camera?: 'back' \| 'front' }`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/packages/uniapp-components/upload/type.ts) | N
12
+ config | Object | - | Typescript: `UploadMpConfig` `type UploadMpConfig = UploadImageConfig \| UploadVideoConfig` `interface UploadImageConfig { count?: number; sizeType?: Array<SizeTypeValues>; sourceType?: Array<SourceTypeValues> }` `type SizeTypeValues = 'original' \| 'compressed'` `type SourceTypeValues = 'album' \| 'camera'` `interface UploadVideoConfig { sourceType?: Array<SourceTypeValues>; compressed?: boolean; maxDuration?: number; camera?: 'back' \| 'front' }`。[see more ts definition](https://github.com/tencent/tdesign-miniprogram/blob/develop/packages/uniapp-components/upload/type.ts) | N
14
13
  disabled | Boolean | undefined | make upload to be disabled | N
15
- draggable | Boolean / Object | - | Typescript:`boolean \| {vibrate?: boolean; collisionVibrate?: boolean}` | N
16
- files | Array | - | `v-model:files` is supported。Typescript:`Array<UploadFile>` `interface UploadFile { url: string; name?: string; size?: number; type?: 'image' \| 'video'; percent?: number; status: 'loading' \| 'reload' \| 'failed' \| 'done' }`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/packages/uniapp-components/upload/type.ts) | N
17
- default-files | Array | - | uncontrolled property。Typescript:`Array<UploadFile>` `interface UploadFile { url: string; name?: string; size?: number; type?: 'image' \| 'video'; percent?: number; status: 'loading' \| 'reload' \| 'failed' \| 'done' }`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/packages/uniapp-components/upload/type.ts) | N
18
- grid-config | Object | - | Typescript:`{column?: number; width?: number; height?: number;}` | N
14
+ draggable | Boolean / Object | - | Typescript: `boolean \| {vibrate?: boolean; collisionVibrate?: boolean}` | N
15
+ files | Array | - | `v-model:files` is supported。Typescript: `Array<UploadFile>` `interface UploadFile { url: string; name?: string; size?: number; type?: 'image' \| 'video'; percent?: number; status: 'loading' \| 'reload' \| 'failed' \| 'done' }`。[see more ts definition](https://github.com/tencent/tdesign-miniprogram/blob/develop/packages/uniapp-components/upload/type.ts) | N
16
+ default-files | Array | - | uncontrolled property。Typescript: `Array<UploadFile>` `interface UploadFile { url: string; name?: string; size?: number; type?: 'image' \| 'video'; percent?: number; status: 'loading' \| 'reload' \| 'failed' \| 'done' }`。[see more ts definition](https://github.com/tencent/tdesign-miniprogram/blob/develop/packages/uniapp-components/upload/type.ts) | N
17
+ grid-config | Object | - | Typescript: `{column?: number; width?: number; height?: number;}` | N
19
18
  gutter | Number | 16 | \- | N
20
- image-props | Object | - | Typescript:`ImageProps`,[Image API Documents](./image?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/packages/uniapp-components/upload/type.ts) | N
19
+ image-props | Object | - | Typescript: `ImageProps`,[Image API Documents](./image?tab=api)。[see more ts definition](https://github.com/tencent/tdesign-miniprogram/blob/develop/packages/uniapp-components/upload/type.ts) | N
21
20
  max | Number | 0 | max count of files limit | N
22
- media-type | Array | ['image', 'video'] | Typescript:`Array<MediaType>` `type MediaType = 'image' \| 'video'`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/packages/uniapp-components/upload/type.ts) | N
21
+ media-type | Array | ['image', 'video'] | Typescript: `Array<MediaType>` `type MediaType = 'image' \| 'video'`。[see more ts definition](https://github.com/tencent/tdesign-miniprogram/blob/develop/packages/uniapp-components/upload/type.ts) | N
23
22
  preview | Boolean | true | \- | N
24
23
  remove-btn | Boolean | true | \- | N
25
- request-method | Function | - | Typescript:`any` | N
26
- size-limit | Number / Object | - | files size limit。Typescript:`number \| SizeLimitObj` `interface SizeLimitObj { size: number; unit: SizeUnit ; message?: string }` `type SizeUnitArray = ['B', 'KB', 'MB', 'GB']` `type SizeUnit = SizeUnitArray[number]`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/packages/uniapp-components/upload/type.ts) | N
24
+ request-method | Function | - | Typescript: `(files: UploadFile \| UploadFile[]) => Promise<RequestMethodResponse>` `interface RequestMethodResponse { status: 'success' \| 'fail'; error?: string; response: { url?: string; files?: UploadFile[]; [key: string]: any } }`。[see more ts definition](https://github.com/tencent/tdesign-miniprogram/blob/develop/packages/uniapp-components/upload/type.ts) | N
25
+ size-limit | Number / Object | - | files size limit。Typescript: `number \| SizeLimitObj` `interface SizeLimitObj { size: number; unit: SizeUnit ; message?: string }` `type SizeUnitArray = ['B', 'KB', 'MB', 'GB']` `type SizeUnit = SizeUnitArray[number]`。[see more ts definition](https://github.com/tencent/tdesign-miniprogram/blob/develop/packages/uniapp-components/upload/type.ts) | N
27
26
  source | String | media | options: media/messageFile | N
28
- transition | Object | `{backTransition: true, duration: 300, timingFunction: 'ease'}` | Typescript:`Transition` `interface Transition { backTransition?: boolean, duration?: number, timingFunction?: string }`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/packages/uniapp-components/upload/type.ts) | N
27
+ transition | Object | { backTransition: true, duration: 300, timingFunction: 'ease' } | Typescript: `Transition` `interface Transition { backTransition?: boolean, duration?: number, timingFunction?: string }`。[see more ts definition](https://github.com/tencent/tdesign-miniprogram/blob/develop/packages/uniapp-components/upload/type.ts) | N
29
28
 
30
29
  ### Upload Events
31
30
 
32
31
  name | params | description
33
32
  -- | -- | --
34
- add | `(context: { files: MediaContext })` | \-
33
+ add | `(context: { files: MediaContext })` | [see more ts definition](https://github.com/tencent/tdesign-miniprogram/blob/develop/packages/uniapp-components/upload/type.ts)。<br/>`type MediaContext = VideoContext[] \| ImageContext[]`<br/><br/>`interface VideoContext { name?: string; type?: string; url?: string; duration?: number; size?: number; width?: number; height?: number; thumb: string; progress: number }`<br/><br/>`interface ImageContext { name: string; type: string; url: string; size: number; width: number; height: number; progress: number }`<br/>
35
34
  click | `(context: { index: number; file: VideoContext \| ImageContext })` | \-
36
35
  complete | \- | \-
37
36
  drop | `(context: { files: MediaContext }) ` | \-
38
37
  fail | \- | \-
39
38
  remove | `(context: { index: number; file: UploadFile })` | \-
40
39
  select-change | `(context: { files: MediaContext[]; currentSelectedFiles: MediaContext[] })` | \-
41
- success | `(context: { files: MediaContext })` | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/packages/uniapp-components/upload/type.ts)。<br/>`type MediaContext = VideoContext[] \| ImageContext[]`<br/><br/>`interface VideoContext { name?: string; type?: string; url?: string; duration?: number; size?: number; width?: number; height?: number; thumb: string; progress: number }`<br/><br/>`interface ImageContext { name: string; type: string; url: string; size: number; width: number; height: number; progress: number }`<br/>
40
+ success | `(context: { files: MediaContext })` | \-
42
41
 
43
42
  ### Upload Slots
44
43
 
@@ -56,7 +55,7 @@ Name | Default Value | Description
56
55
  --td-upload-add-disabled-bg-color | @bg-color-component-disabled | -
57
56
  --td-upload-add-icon-disabled-color | @text-color-disabled | -
58
57
  --td-upload-add-icon-size | 56rpx | -
59
- --td-upload-disabled-mask | rgba(0, 0.6) | -
58
+ --td-upload-disabled-mask | rgba(0, 0, 0, 0.6) | -
60
59
  --td-upload-drag-transition-duration | --td-upload-drag-transition-duration | -
61
60
  --td-upload-drag-transition-timing-function | --td-upload-drag-transition-timing-function | -
62
61
  --td-upload-drag-z-index | 999 | -
@@ -8,7 +8,9 @@ isComponent: true
8
8
 
9
9
  ## 引入
10
10
 
11
- 可在 `main.ts` 或在需要使用的页面或组件中引入。
11
+ 推荐使用 easycom 模式引入组件,配置后无需手动 import 即可直接在模板中使用 `<t-upload />`。详细配置请参考 [快速开始](../getting-started)。
12
+
13
+ 如需手动引入:
12
14
 
13
15
  ```js
14
16
  import TUpload from '@tdesign/uniapp/upload/upload.vue';
@@ -62,36 +64,35 @@ import TUpload from '@tdesign/uniapp/upload/upload.vue';
62
64
  custom-style | Object | - | 自定义样式 | N
63
65
  add-btn | Boolean | true | 添加按钮 | N
64
66
  add-content | String | - | 添加按钮内容 | N
65
- allow-upload-duplicate-file | Boolean | false | 是否允许重复上传相同文件名的文件 | N
66
- config | Object | - | 图片上传配置,视频上传配置,文件上传配置等,包含图片尺寸、图片来源、视频来源、视频拍摄最长时间等。更多细节查看小程序官网。[图片上传](https://developers.weixin.qq.com/miniprogram/dev/api/media/image/wx.chooseImage.html)。[视频上传](https://developers.weixin.qq.com/miniprogram/dev/api/media/video/wx.chooseVideo.html)。TS 类型:`UploadMpConfig` `type UploadMpConfig = ImageConfig \| VideoConfig` `interface ImageConfig { count?: number; sizeType?: Array<SizeTypeValues>; sourceType?: Array<SourceTypeValues> }` `type SizeTypeValues = 'original' \| 'compressed'` `type SourceTypeValues = 'album' \| 'camera'` `interface VideoConfig { sourceType?: Array<SourceTypeValues>; compressed?: boolean; maxDuration?: number; camera?: 'back' \| 'front' }`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/packages/uniapp-components/upload/type.ts) | N
67
+ config | Object | - | 图片上传配置,视频上传配置,文件上传配置等,包含图片尺寸、图片来源、视频来源、视频拍摄最长时间等。更多细节查看小程序官网。[图片上传](https://developers.weixin.qq.com/miniprogram/dev/api/media/image/wx.chooseImage.html)。[视频上传](https://developers.weixin.qq.com/miniprogram/dev/api/media/video/wx.chooseVideo.html)。TS 类型:`UploadMpConfig` `type UploadMpConfig = UploadImageConfig \| UploadVideoConfig` `interface UploadImageConfig { count?: number; sizeType?: Array<SizeTypeValues>; sourceType?: Array<SourceTypeValues> }` `type SizeTypeValues = 'original' \| 'compressed'` `type SourceTypeValues = 'album' \| 'camera'` `interface UploadVideoConfig { sourceType?: Array<SourceTypeValues>; compressed?: boolean; maxDuration?: number; camera?: 'back' \| 'front' }`。[详细类型定义](https://github.com/tencent/tdesign-miniprogram/blob/develop/packages/uniapp-components/upload/type.ts) | N
67
68
  disabled | Boolean | undefined | 是否禁用组件 | N
68
69
  draggable | Boolean / Object | - | 是否支持拖拽排序。长按时是否振动,碰撞时是否振动。示例一:`true`。示例二:`{ vibrate: true, collisionVibrate: true }`。TS 类型:`boolean \| {vibrate?: boolean; collisionVibrate?: boolean}` | N
69
- files | Array | - | 已上传文件列表。支持语法糖 `v-model:files`。TS 类型:`Array<UploadFile>` `interface UploadFile { url: string; name?: string; size?: number; type?: 'image' \| 'video'; percent?: number; status: 'loading' \| 'reload' \| 'failed' \| 'done' }`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/packages/uniapp-components/upload/type.ts) | N
70
- default-files | Array | - | 已上传文件列表。非受控属性。TS 类型:`Array<UploadFile>` `interface UploadFile { url: string; name?: string; size?: number; type?: 'image' \| 'video'; percent?: number; status: 'loading' \| 'reload' \| 'failed' \| 'done' }`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/packages/uniapp-components/upload/type.ts) | N
70
+ files | Array | - | 已上传文件列表。支持语法糖 `v-model:files`。TS 类型:`Array<UploadFile>` `interface UploadFile { url: string; name?: string; size?: number; type?: 'image' \| 'video'; percent?: number; status: 'loading' \| 'reload' \| 'failed' \| 'done' }`。[详细类型定义](https://github.com/tencent/tdesign-miniprogram/blob/develop/packages/uniapp-components/upload/type.ts) | N
71
+ default-files | Array | - | 已上传文件列表。非受控属性。TS 类型:`Array<UploadFile>` `interface UploadFile { url: string; name?: string; size?: number; type?: 'image' \| 'video'; percent?: number; status: 'loading' \| 'reload' \| 'failed' \| 'done' }`。[详细类型定义](https://github.com/tencent/tdesign-miniprogram/blob/develop/packages/uniapp-components/upload/type.ts) | N
71
72
  grid-config | Object | - | upload组件每行上传图片列数以及图片的宽度和高度。TS 类型:`{column?: number; width?: number; height?: number;}` | N
72
73
  gutter | Number | 16 | 预览窗格的 `gutter` 大小,单位 rpx | N
73
- image-props | Object | - | 透传 Image 组件全部属性。TS 类型:`ImageProps`,[Image API Documents](./image?tab=api)。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/packages/uniapp-components/upload/type.ts) | N
74
+ image-props | Object | - | 透传 Image 组件全部属性。TS 类型:`ImageProps`,[Image API Documents](./image?tab=api)。[详细类型定义](https://github.com/tencent/tdesign-miniprogram/blob/develop/packages/uniapp-components/upload/type.ts) | N
74
75
  max | Number | 0 | 用于控制文件上传数量,值为 0 则不限制 | N
75
- media-type | Array | ['image', 'video'] | 支持上传的文件类型,图片或视频。TS 类型:`Array<MediaType>` `type MediaType = 'image' \| 'video'`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/packages/uniapp-components/upload/type.ts) | N
76
+ media-type | Array | ['image', 'video'] | 支持上传的文件类型,图片或视频。TS 类型:`Array<MediaType>` `type MediaType = 'image' \| 'video'`。[详细类型定义](https://github.com/tencent/tdesign-miniprogram/blob/develop/packages/uniapp-components/upload/type.ts) | N
76
77
  preview | Boolean | true | 是否支持图片预览,文件没有预览 | N
77
78
  remove-btn | Boolean | true | 移除按钮 | N
78
- request-method | Function | - | 自定义上传方法。TS 类型:`any` | N
79
- size-limit | Number / Object | - | 图片文件大小限制,默认单位 KB。可选单位有:`'B' \| 'KB' \| 'MB' \| 'GB'`。示例一:`1000`。示例二:`{ size: 2, unit: 'MB', message: '图片大小不超过 {sizeLimit} MB' }`。TS 类型:`number \| SizeLimitObj` `interface SizeLimitObj { size: number; unit: SizeUnit ; message?: string }` `type SizeUnitArray = ['B', 'KB', 'MB', 'GB']` `type SizeUnit = SizeUnitArray[number]`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/packages/uniapp-components/upload/type.ts) | N
79
+ request-method | Function | - | 自定义上传方法。TS 类型:`(files: UploadFile \| UploadFile[]) => Promise<RequestMethodResponse>` `interface RequestMethodResponse { status: 'success' \| 'fail'; error?: string; response: { url?: string; files?: UploadFile[]; [key: string]: any } }`。[详细类型定义](https://github.com/tencent/tdesign-miniprogram/blob/develop/packages/uniapp-components/upload/type.ts) | N
80
+ size-limit | Number / Object | - | 图片文件大小限制,默认单位 KB。可选单位有:`'B' \| 'KB' \| 'MB' \| 'GB'`。示例一:`1000`。示例二:`{ size: 2, unit: 'MB', message: '图片大小不超过 {sizeLimit} MB' }`。TS 类型:`number \| SizeLimitObj` `interface SizeLimitObj { size: number; unit: SizeUnit ; message?: string }` `type SizeUnitArray = ['B', 'KB', 'MB', 'GB']` `type SizeUnit = SizeUnitArray[number]`。[详细类型定义](https://github.com/tencent/tdesign-miniprogram/blob/develop/packages/uniapp-components/upload/type.ts) | N
80
81
  source | String | media | 来源。可选项:media/messageFile | N
81
- transition | Object | `{backTransition: true, duration: 300, timingFunction: 'ease'}` | 拖拽位置移动时的过渡参数,`duration`单位为ms。TS 类型:`Transition` `interface Transition { backTransition?: boolean, duration?: number, timingFunction?: string }`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/packages/uniapp-components/upload/type.ts) | N
82
+ transition | Object | { backTransition: true, duration: 300, timingFunction: 'ease' } | 拖拽位置移动时的过渡参数,`duration`单位为ms。TS 类型:`Transition` `interface Transition { backTransition?: boolean, duration?: number, timingFunction?: string }`。[详细类型定义](https://github.com/tencent/tdesign-miniprogram/blob/develop/packages/uniapp-components/upload/type.ts) | N
82
83
 
83
84
  ### Upload Events
84
85
 
85
86
  名称 | 参数 | 描述
86
87
  -- | -- | --
87
- add | `(context: { files: MediaContext })` | 选择后触发,仅包含本次选择的照片;`url` 表示选定视频的临时文件路径 (本地路径)。`duration` 表示选定视频的时间长度。`size`选定视频的数据量大小。更多描述参考 wx.chooseMedia 小程序官网描述
88
+ add | `(context: { files: MediaContext })` | 选择后触发,仅包含本次选择的照片;`url` 表示选定视频的临时文件路径 (本地路径)。`duration` 表示选定视频的时间长度。`size`选定视频的数据量大小。更多描述参考 wx.chooseMedia 小程序官网描述。[详细类型定义](https://github.com/tencent/tdesign-miniprogram/blob/develop/packages/uniapp-components/upload/type.ts)。<br/>`type MediaContext = VideoContext[] \| ImageContext[]`<br/><br/>`interface VideoContext { name?: string; type?: string; url?: string; duration?: number; size?: number; width?: number; height?: number; thumb: string; progress: number }`<br/><br/>`interface ImageContext { name: string; type: string; url: string; size: number; width: number; height: number; progress: number }`<br/>
88
89
  click | `(context: { index: number; file: VideoContext \| ImageContext })` | 点击已选文件时触发;常用于重新上传
89
90
  complete | \- | 上传成功或失败后触发
90
91
  drop | `(context: { files: MediaContext }) ` | 拖拽结束后触发,包含所有上传的文件(拖拽后的文件顺序);`url` 表示选定视频的临时文件路径 (本地路径)。`duration` 表示选定视频的时间长度。`size` 选定视频的数据量大小。更多描述参考 wx.chooseMedia 小程序官网描述
91
92
  fail | \- | 上传失败后触发
92
93
  remove | `(context: { index: number; file: UploadFile })` | 移除文件时触发
93
94
  select-change | `(context: { files: MediaContext[]; currentSelectedFiles: MediaContext[] })` | 选择文件或图片之后,上传之前,触发该事件。<br />`files` 表示之前已经上传完成的文件列表。<br />`currentSelectedFiles` 表示本次上传选中的文件列表
94
- success | `(context: { files: MediaContext })` | 上传成功后触发,包含所有上传的文件;`url` 表示选定视频的临时文件路径 (本地路径)。`duration` 表示选定视频的时间长度。`size`选定视频的数据量大小。更多描述参考 wx.chooseMedia 小程序官网描述。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/packages/uniapp-components/upload/type.ts)。<br/>`type MediaContext = VideoContext[] \| ImageContext[]`<br/><br/>`interface VideoContext { name?: string; type?: string; url?: string; duration?: number; size?: number; width?: number; height?: number; thumb: string; progress: number }`<br/><br/>`interface ImageContext { name: string; type: string; url: string; size: number; width: number; height: number; progress: number }`<br/>
95
+ success | `(context: { files: MediaContext })` | 上传成功后触发,包含所有上传的文件;`url` 表示选定视频的临时文件路径 (本地路径)。`duration` 表示选定视频的时间长度。`size`选定视频的数据量大小。更多描述参考 wx.chooseMedia 小程序官网描述
95
96
 
96
97
  ### Upload Slots
97
98
 
@@ -109,7 +110,7 @@ add-content | 自定义 `add-content` 显示内容
109
110
  --td-upload-add-disabled-bg-color | @bg-color-component-disabled | -
110
111
  --td-upload-add-icon-disabled-color | @text-color-disabled | -
111
112
  --td-upload-add-icon-size | 56rpx | -
112
- --td-upload-disabled-mask | rgba(0, 0.6) | -
113
+ --td-upload-disabled-mask | rgba(0, 0, 0, 0.6) | -
113
114
  --td-upload-drag-transition-duration | --td-upload-drag-transition-duration | -
114
115
  --td-upload-drag-transition-timing-function | --td-upload-drag-transition-timing-function | -
115
116
  --td-upload-drag-z-index | 999 | -
@@ -15,16 +15,14 @@ export default {
15
15
  addContent: {
16
16
  type: String,
17
17
  },
18
- /** 是否允许重复上传相同文件名的文件 */
19
- allowUploadDuplicateFile: Boolean,
20
18
  /** 图片上传配置,视频上传配置,文件上传配置等,包含图片尺寸、图片来源、视频来源、视频拍摄最长时间等。更多细节查看小程序官网。[图片上传](https://developers.weixin.qq.com/miniprogram/dev/api/media/image/wx.chooseImage.html)。[视频上传](https://developers.weixin.qq.com/miniprogram/dev/api/media/video/wx.chooseVideo.html) */
21
19
  config: {
22
20
  type: Object,
23
21
  },
24
22
  /** 是否禁用组件 */
25
23
  disabled: {
26
- type: Boolean,
27
- default: undefined,
24
+ type: [Boolean, null],
25
+ default: null as TdUploadProps['disabled'],
28
26
  },
29
27
  /** 是否支持拖拽排序。长按时是否振动,碰撞时是否振动。示例一:`true`。示例二:`{ vibrate: true, collisionVibrate: true }` */
30
28
  draggable: {