@tdesign/uniapp 0.7.0 → 0.7.2

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 (111) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/action-sheet/README.en-US.md +1 -1
  3. package/dist/action-sheet/README.md +1 -1
  4. package/dist/action-sheet/action-sheet.vue +27 -12
  5. package/dist/action-sheet/computed.js +14 -0
  6. package/dist/action-sheet/type.ts +2 -2
  7. package/dist/avatar/avatar.vue +6 -6
  8. package/dist/avatar-group/avatar-group.vue +1 -3
  9. package/dist/back-top/back-top.vue +13 -15
  10. package/dist/badge/badge.vue +1 -3
  11. package/dist/button/README.en-US.md +5 -2
  12. package/dist/button/README.md +5 -2
  13. package/dist/button/button.vue +18 -14
  14. package/dist/button/props.ts +14 -0
  15. package/dist/button/type.ts +14 -0
  16. package/dist/calendar/README.en-US.md +1 -0
  17. package/dist/calendar/README.md +1 -0
  18. package/dist/calendar/calendar-header.vue +1 -3
  19. package/dist/calendar/calendar.vue +28 -19
  20. package/dist/calendar/props.ts +5 -0
  21. package/dist/calendar/template.vue +1 -3
  22. package/dist/calendar/type.ts +6 -0
  23. package/dist/cascader/cascader.vue +9 -7
  24. package/dist/cell/cell.vue +51 -35
  25. package/dist/cell-group/cell-group.vue +1 -3
  26. package/dist/check-tag/check-tag.vue +12 -15
  27. package/dist/checkbox/checkbox.vue +13 -15
  28. package/dist/col/col.vue +1 -3
  29. package/dist/collapse/collapse.vue +1 -3
  30. package/dist/collapse-panel/collapse-panel.vue +1 -3
  31. package/dist/color-picker/color-picker.vue +2 -4
  32. package/dist/color-picker/template.vue +1 -3
  33. package/dist/common/src/instantiationDecorator.js +14 -0
  34. package/dist/common/style/theme/index.css +42 -90
  35. package/dist/count-down/count-down.vue +2 -4
  36. package/dist/date-time-picker/date-time-picker.vue +1 -3
  37. package/dist/dialog/dialog.vue +67 -69
  38. package/dist/divider/divider.vue +1 -3
  39. package/dist/draggable/draggable.vue +1 -3
  40. package/dist/drawer/drawer.vue +1 -3
  41. package/dist/dropdown-item/dropdown-item.vue +1 -3
  42. package/dist/dropdown-menu/dropdown-menu.vue +12 -14
  43. package/dist/empty/empty.vue +1 -3
  44. package/dist/fab/fab.vue +1 -3
  45. package/dist/footer/footer.vue +1 -3
  46. package/dist/form/form.vue +1 -3
  47. package/dist/form-item/form-item.css +16 -11
  48. package/dist/form-item/form-item.vue +2 -7
  49. package/dist/grid/grid.vue +1 -3
  50. package/dist/grid-item/grid-item.vue +3 -5
  51. package/dist/guide/content.vue +1 -3
  52. package/dist/guide/guide.vue +25 -40
  53. package/dist/icon/icon.vue +2 -4
  54. package/dist/image/image.vue +1 -3
  55. package/dist/image-viewer/image-viewer.vue +27 -30
  56. package/dist/indexes/indexes.vue +13 -15
  57. package/dist/indexes-anchor/indexes-anchor.vue +1 -3
  58. package/dist/input/input.vue +31 -31
  59. package/dist/link/link.vue +25 -26
  60. package/dist/loading/loading.vue +2 -2
  61. package/dist/message/index.d.ts +1 -1
  62. package/dist/message/message.interface.ts +2 -1
  63. package/dist/message-item/message-item.vue +34 -36
  64. package/dist/mixins/page-scroll.js +1 -1
  65. package/dist/navbar/navbar.vue +46 -33
  66. package/dist/notice-bar/notice-bar.vue +24 -26
  67. package/dist/overlay/overlay.vue +5 -7
  68. package/dist/picker/picker.vue +3 -4
  69. package/dist/picker-item/picker-item.vue +2 -4
  70. package/dist/popover/popover.vue +1 -3
  71. package/dist/popup/popup.vue +2 -4
  72. package/dist/progress/progress.vue +1 -3
  73. package/dist/pull-down-refresh/pull-down-refresh.vue +13 -15
  74. package/dist/qrcode/components/qrcode-canvas/qrcode-canvas.vue +1 -3
  75. package/dist/qrcode/components/qrcode-status/qrcode-status.vue +1 -3
  76. package/dist/qrcode/qrcode.vue +1 -3
  77. package/dist/radio/radio.vue +20 -22
  78. package/dist/rate/rate.vue +1 -3
  79. package/dist/result/result.vue +13 -15
  80. package/dist/row/row.vue +1 -3
  81. package/dist/search/README.en-US.md +1 -1
  82. package/dist/search/README.md +1 -1
  83. package/dist/search/search.vue +22 -10
  84. package/dist/search/type.ts +1 -1
  85. package/dist/side-bar/side-bar.vue +1 -3
  86. package/dist/side-bar-item/side-bar-item.vue +12 -15
  87. package/dist/skeleton/skeleton.vue +2 -4
  88. package/dist/slider/slider.vue +18 -20
  89. package/dist/step-item/step-item.vue +1 -3
  90. package/dist/stepper/stepper.vue +1 -3
  91. package/dist/steps/steps.vue +1 -2
  92. package/dist/sticky/sticky.vue +1 -3
  93. package/dist/swipe-cell/swipe-cell.vue +2 -5
  94. package/dist/swiper/swiper.vue +1 -3
  95. package/dist/swiper-nav/swiper-nav.vue +1 -3
  96. package/dist/switch/switch.vue +1 -3
  97. package/dist/tab-bar/tab-bar.vue +2 -1
  98. package/dist/tab-bar-item/tab-bar-item.vue +22 -25
  99. package/dist/tab-panel/tab-panel.vue +1 -3
  100. package/dist/tabs/tabs.vue +1 -2
  101. package/dist/tag/tag.vue +23 -26
  102. package/dist/textarea/textarea.vue +1 -3
  103. package/dist/toast/toast.vue +12 -14
  104. package/dist/transition/transition.vue +1 -3
  105. package/dist/tree-select/tree-select.vue +6 -9
  106. package/dist/upload/props.ts +1 -1
  107. package/dist/upload/upload.vue +1 -3
  108. package/dist/watermark/watermark.vue +1 -2
  109. package/package.json +3 -1
  110. package/dist/.eslintrc.js +0 -30
  111. package/dist/tsconfig.eslint.json +0 -13
@@ -110,9 +110,8 @@ export default uniComponent({
110
110
  },
111
111
  });
112
112
  </script>
113
+ <style scoped src="./steps.css"></style>
113
114
  <style scoped>
114
- @import './steps.css';
115
-
116
115
  /* #ifndef MP-WEIXIN */
117
116
  /* 适配 qq 小程序等 */
118
117
  :deep(t-step-item) {
@@ -139,6 +139,4 @@ export default uniComponent({
139
139
  });
140
140
 
141
141
  </script>
142
- <style scoped>
143
- @import './sticky.css';
144
- </style>
142
+ <style scoped src="./sticky.css"></style>
@@ -190,7 +190,7 @@ export default uniComponent({
190
190
  ARRAY.push(this);
191
191
  this.setSwipeWidth();
192
192
  },
193
- beforeUnMount() {
193
+ beforeUnmount() {
194
194
  ARRAY = ARRAY.filter(e => e !== this);
195
195
  },
196
196
  methods: {
@@ -239,7 +239,4 @@ export default uniComponent({
239
239
  },
240
240
  });
241
241
  </script>
242
- <style scoped>
243
- @import './swipe-cell.css';
244
-
245
- </style>
242
+ <style scoped src="./swipe-cell.css"></style>
@@ -188,6 +188,4 @@ export default uniComponent({
188
188
  });
189
189
 
190
190
  </script>
191
- <style scoped>
192
- @import './swiper.css';
193
- </style>
191
+ <style scoped src="./swiper.css"></style>
@@ -88,6 +88,4 @@ export default uniComponent({
88
88
  },
89
89
  });
90
90
  </script>
91
- <style scoped>
92
- @import './swiper-nav.css';
93
- </style>
91
+ <style scoped src="./swiper-nav.css"></style>
@@ -117,6 +117,4 @@ export default uniComponent({
117
117
  },
118
118
  });
119
119
  </script>
120
- <style scoped>
121
- @import './switch.css';
122
- </style>
120
+ <style scoped src="./switch.css"></style>
@@ -56,6 +56,7 @@ export default uniComponent({
56
56
  tools,
57
57
 
58
58
  dataValue: coalesce(this.value, this.defaultValue),
59
+ placeholderHeight: 56,
59
60
  };
60
61
  },
61
62
  watch: {
@@ -131,8 +132,8 @@ export default uniComponent({
131
132
  },
132
133
  });
133
134
  </script>
135
+ <style scoped src="./tab-bar.css"></style>
134
136
  <style scoped>
135
- @import './tab-bar.css';
136
137
  /* #ifndef MP-WEIXIN */
137
138
  :deep(t-tab-bar-item) {
138
139
  flex: 1;
@@ -33,20 +33,20 @@
33
33
  :t-class-count="prefix + '-badge-class'"
34
34
  >
35
35
  <block
36
- v-if="_icon"
36
+ v-if="innerIcon"
37
37
  name="icon"
38
38
  >
39
39
  <t-icon
40
- :custom-style="_icon.style || ''"
41
- :t-class="_icon.tClass || ''"
42
- :prefix="_icon.prefix"
43
- :name="_icon.name"
44
- :size="_icon.size || (iconOnly ? 24 : 20)"
45
- :color="_icon.color"
46
- :aria-hidden="_icon.ariaHidden"
47
- :aria-label="_icon.ariaLabel"
48
- :aria-role="_icon.ariaRole"
49
- @click="_icon.click || ''"
40
+ :custom-style="innerIcon.style || ''"
41
+ :t-class="innerIcon.tClass || ''"
42
+ :prefix="innerIcon.prefix"
43
+ :name="innerIcon.name"
44
+ :size="innerIcon.size || (iconOnly ? 24 : 20)"
45
+ :color="innerIcon.color"
46
+ :aria-hidden="innerIcon.ariaHidden"
47
+ :aria-label="innerIcon.ariaLabel"
48
+ :aria-role="innerIcon.ariaRole"
49
+ @click="innerIcon.click || ''"
50
50
  />
51
51
  </block>
52
52
  <!-- 避免被 badge 组件识别为空,t-badge__content:not(:empty) -->
@@ -57,16 +57,16 @@
57
57
  name="icon"
58
58
  >
59
59
  <t-icon
60
- :custom-style="_icon.style || ''"
61
- :t-class="_icon.tClass || ''"
62
- :prefix="_icon.prefix"
63
- :name="_icon.name"
64
- :size="_icon.size || (iconOnly ? 24 : 20)"
65
- :color="_icon.color"
60
+ :custom-style="innerIcon.style || ''"
61
+ :t-class="innerIcon.tClass || ''"
62
+ :prefix="innerIcon.prefix"
63
+ :name="innerIcon.name"
64
+ :size="innerIcon.size || (iconOnly ? 24 : 20)"
65
+ :color="innerIcon.color"
66
66
  :aria-hidden="!iconOnly"
67
- :aria-label="_icon.ariaLabel"
68
- :aria-role="_icon.ariaRole"
69
- @click="_icon.click || ''"
67
+ :aria-label="innerIcon.ariaLabel"
68
+ :aria-role="innerIcon.ariaRole"
69
+ @click="innerIcon.click || ''"
70
70
  />
71
71
  </block>
72
72
  <slot name="icon" />
@@ -148,7 +148,7 @@ export default uniComponent({
148
148
  },
149
149
  icon: {
150
150
  handler(v) {
151
- this._icon = calcIcon(v);
151
+ this.innerIcon = calcIcon(v);
152
152
  },
153
153
  immediate: true,
154
154
  },
@@ -216,7 +216,4 @@ export default uniComponent({
216
216
  },
217
217
  });
218
218
  </script>
219
- <style scoped>
220
- @import './tab-bar-item.css';
221
-
222
- </style>
219
+ <style scoped src="./tab-bar-item.css"></style>
@@ -95,6 +95,4 @@ export default uniComponent({
95
95
  },
96
96
  });
97
97
  </script>
98
- <style scoped>
99
- @import './tab-panel.css';
100
- </style>
98
+ <style scoped src="./tab-panel.css"></style>
@@ -478,9 +478,8 @@ export default uniComponent({
478
478
  },
479
479
  });
480
480
  </script>
481
+ <style scoped src="./tabs.css"></style>
481
482
  <style scoped>
482
- @import './tabs.css';
483
-
484
483
  /* #ifndef MP-WEIXIN */
485
484
  :deep(t-tab-panel) {
486
485
  flex-shrink: 0;
package/dist/tag/tag.vue CHANGED
@@ -9,19 +9,19 @@
9
9
  :class="classPrefix + '__icon'"
10
10
  >
11
11
  <block
12
- v-if="_icon"
12
+ v-if="innerIcon"
13
13
  name="icon"
14
14
  >
15
15
  <t-icon
16
- :custom-style="_icon.style || ''"
16
+ :custom-style="innerIcon.style || ''"
17
17
  :t-class="prefix + '-icon'"
18
- :prefix="_icon.prefix"
19
- :name="_icon.name"
20
- :size="_icon.size"
21
- :color="_icon.color"
22
- :aria-hidden="!!_icon.ariaHidden"
23
- :aria-label="_icon.ariaLabel"
24
- :aria-role="_icon.ariaRole"
18
+ :prefix="innerIcon.prefix"
19
+ :name="innerIcon.name"
20
+ :size="innerIcon.size"
21
+ :color="innerIcon.color"
22
+ :aria-hidden="!!innerIcon.ariaHidden"
23
+ :aria-label="innerIcon.ariaLabel"
24
+ :aria-role="innerIcon.ariaRole"
25
25
  />
26
26
  </block>
27
27
  <slot name="icon" />
@@ -30,19 +30,19 @@
30
30
  <slot />
31
31
  </view>
32
32
  <block
33
- v-if="_closable"
33
+ v-if="innerClosable"
34
34
  name="icon"
35
35
  >
36
36
  <t-icon
37
- :custom-style="_closable.style || ''"
37
+ :custom-style="innerClosable.style || ''"
38
38
  :t-class="classPrefix + '__icon-close ' + prefix + '-icon'"
39
- :prefix="_closable.prefix"
40
- :name="_closable.name"
41
- :size="_closable.size"
42
- :color="_closable.color"
43
- :aria-hidden="!!_closable.ariaHidden"
44
- :aria-label="_closable.ariaLabel || '关闭'"
45
- :aria-role="_closable.ariaRole"
39
+ :prefix="innerClosable.prefix"
40
+ :name="innerClosable.name"
41
+ :size="innerClosable.size"
42
+ :color="innerClosable.color"
43
+ :aria-hidden="!!innerClosable.ariaHidden"
44
+ :aria-label="innerClosable.ariaLabel || '关闭'"
45
+ :aria-role="innerClosable.ariaRole"
46
46
  @click="handleClose"
47
47
  />
48
48
  </block>
@@ -87,8 +87,8 @@ export default uniComponent({
87
87
  tagStyle: '',
88
88
  tools,
89
89
 
90
- _icon: null,
91
- _closable: null,
90
+ innerIcon: null,
91
+ innerClosable: null,
92
92
  };
93
93
  },
94
94
  watch: {
@@ -100,14 +100,14 @@ export default uniComponent({
100
100
  maxWidth: 'setTagStyle',
101
101
  icon: {
102
102
  handler(s) {
103
- this._icon = calcIcon(s);
103
+ this.innerIcon = calcIcon(s);
104
104
  },
105
105
  immediate: true,
106
106
  },
107
107
  closable: {
108
108
  handler(s) {
109
109
  this.setClass();
110
- this._closable = calcIcon(s, 'close');
110
+ this.innerClosable = calcIcon(s, 'close');
111
111
  },
112
112
  immediate: true,
113
113
  },
@@ -155,7 +155,4 @@ export default uniComponent({
155
155
  });
156
156
 
157
157
  </script>
158
- <style scoped>
159
- @import './tag.css';
160
-
161
- </style>
158
+ <style scoped src="./tag.css"></style>
@@ -222,6 +222,4 @@ export default uniComponent({
222
222
  },
223
223
  });
224
224
  </script>
225
- <style scoped>
226
- @import './textarea.css';
227
- </style>
225
+ <style scoped src="./textarea.css"></style>
@@ -17,20 +17,20 @@
17
17
  layout="vertical"
18
18
  />
19
19
  <block
20
- v-else-if="_icon"
20
+ v-else-if="innerIcon"
21
21
  name="icon"
22
22
  >
23
23
  <t-icon
24
- :custom-style="_icon.style || ''"
24
+ :custom-style="innerIcon.style || ''"
25
25
  :t-class="iconTClass"
26
26
  :class="iconClass"
27
- :prefix="_icon.prefix"
28
- :name="_icon.name"
29
- :size="_icon.size"
30
- :color="_icon.color"
27
+ :prefix="innerIcon.prefix"
28
+ :name="innerIcon.name"
29
+ :size="innerIcon.size"
30
+ :color="innerIcon.color"
31
31
  :aria-hidden="true"
32
- :aria-label="_icon.ariaLabel"
33
- :aria-role="_icon.ariaRole"
32
+ :aria-label="innerIcon.ariaLabel"
33
+ :aria-role="innerIcon.ariaRole"
34
34
  />
35
35
  </block>
36
36
  <slot name="icon" />
@@ -111,7 +111,7 @@ export default uniComponent({
111
111
  return {
112
112
  prefix,
113
113
  classPrefix: name,
114
- _icon: null,
114
+ innerIcon: null,
115
115
  ...info,
116
116
 
117
117
  isLoading: false,
@@ -139,7 +139,7 @@ export default uniComponent({
139
139
  },
140
140
  },
141
141
 
142
- beforeUnMount() {
142
+ beforeUnmount() {
143
143
  this.destroyed();
144
144
  },
145
145
  methods: {
@@ -168,7 +168,7 @@ export default uniComponent({
168
168
  ...options,
169
169
  realVisible: true,
170
170
  isLoading: options?.theme === 'loading',
171
- _icon: calcIcon(coalesce(typeMapIcon, options.icon)),
171
+ innerIcon: calcIcon(coalesce(typeMapIcon, options.icon)),
172
172
  };
173
173
 
174
174
  const { duration } = data;
@@ -208,6 +208,4 @@ export default uniComponent({
208
208
  });
209
209
 
210
210
  </script>
211
- <style scoped>
212
- @import './toast.css';
213
- </style>
211
+ <style scoped src="./toast.css"></style>
@@ -46,6 +46,4 @@ export default uniComponent({
46
46
  });
47
47
 
48
48
  </script>
49
- <style scoped>
50
- @import './transition.css';
51
- </style>
49
+ <style scoped src="./transition.css"></style>
@@ -252,13 +252,12 @@ export default uniComponent({
252
252
  getScrollIntoView(status) {
253
253
  const { innerValue: value, customValue, scrollIntoView } = this;
254
254
  if (status === 'init') {
255
- const _value = customValue || value;
256
- const scrollIntoView = Array.isArray(_value)
257
- ? _value.map(item => (Array.isArray(item) ? item[0] : item))
258
- : [_value];
259
- // setTimeout(() => {
255
+ const innerValue = customValue || value;
256
+ const scrollIntoView = Array.isArray(innerValue)
257
+ ? innerValue.map(item => (Array.isArray(item) ? item[0] : item))
258
+ : [innerValue];
259
+
260
260
  this.scrollIntoView = scrollIntoView;
261
- // }, 1000);
262
261
  } else {
263
262
  if (scrollIntoView === null) return;
264
263
  this.scrollIntoView = null;
@@ -314,6 +313,4 @@ export default uniComponent({
314
313
  },
315
314
  });
316
315
  </script>
317
- <style scoped>
318
- @import './tree-select.css';
319
- </style>
316
+ <style scoped src="./tree-select.css"></style>
@@ -59,7 +59,7 @@ export default {
59
59
  /** 支持上传的文件类型,图片或视频 */
60
60
  mediaType: {
61
61
  type: Array,
62
- default: ['image', 'video'],
62
+ default: () => ['image', 'video'],
63
63
  },
64
64
  /** 是否支持图片预览,文件没有预览 */
65
65
  preview: {
@@ -882,6 +882,4 @@ export default uniComponent({
882
882
  },
883
883
  });
884
884
  </script>
885
- <style scoped>
886
- @import './upload.css';
887
- </style>
885
+ <style scoped src="./upload.css"></style>
@@ -190,9 +190,8 @@ export default uniComponent({
190
190
  });
191
191
  </script>
192
192
 
193
+ <style scoped src="./watermark.css"></style>
193
194
  <style scoped>
194
- @import './watermark.css';
195
-
196
195
  /* diff with td-mini */
197
196
  .watermark-move {
198
197
  animation: watermark var(--watermark-animation-duration, 100s) linear infinite;
package/package.json CHANGED
@@ -1,9 +1,11 @@
1
1
  {
2
2
  "name": "@tdesign/uniapp",
3
- "version": "0.7.0",
3
+ "version": "0.7.2",
4
4
  "id": "tdesign-uniapp",
5
5
  "title": "tdesign-uniapp",
6
6
  "description": "TDesign Component for UniApp",
7
+ "author": "tdesign",
8
+ "license": "MIT",
7
9
  "keywords": [
8
10
  "tdesign",
9
11
  "miniprogram",
package/dist/.eslintrc.js DELETED
@@ -1,30 +0,0 @@
1
- module.exports = {
2
- root: true,
3
- extends: ['eslint-config-light-vue3'],
4
- globals: {
5
- getCurrentPages: true,
6
- uni: true,
7
- globalThis: true,
8
- qq: true,
9
- weex: true,
10
- plus: true,
11
- getApp: true,
12
- },
13
- parserOptions: {
14
- project: 'tsconfig.eslint.json',
15
- tsconfigRootDir: __dirname,
16
-
17
- ecmaVersion: 'latest',
18
- extraFileExtensions: ['.vue'],
19
- },
20
- rules: {
21
- 'vue/no-v-text-v-html-on-component': 0,
22
- 'vue/component-name-in-template-casing': [
23
- 2,
24
- 'kebab-case',
25
- {
26
- registeredComponentsOnly: true,
27
- },
28
- ],
29
- },
30
- };
@@ -1,13 +0,0 @@
1
- {
2
- "extends": "../../tsconfig.json",
3
- "include": [
4
- "**/*.ts",
5
- "**/*.js",
6
- "./**/*.d.ts",
7
- "./types/**/*.d.ts",
8
- "./**/*.ts",
9
- "./**/*.tsx",
10
- "./**/*.vue",
11
- ".eslintrc.js"
12
- ]
13
- }