@tdesign/uniapp 0.7.0 → 0.7.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.
@@ -1,4 +1,3 @@
1
-
2
1
  /* ./raw/_light.less */
3
2
  @media (prefers-color-scheme: light) {
4
3
  /* #ifdef H5 */
@@ -76,7 +75,6 @@
76
75
  --td-gray-color-13: #242424;
77
76
  --td-gray-color-14: #181818;
78
77
 
79
- // 文字 & 图标 颜色
80
78
  --td-font-white-1: rgba(255, 255, 255, 1);
81
79
  --td-font-white-2: rgba(255, 255, 255, 0.55);
82
80
  --td-font-white-3: rgba(255, 255, 255, 0.35);
@@ -86,46 +84,39 @@
86
84
  --td-font-gray-3: rgba(0, 0, 0, 0.4);
87
85
  --td-font-gray-4: rgba(0, 0, 0, 0.26);
88
86
 
89
- // 基础颜色
90
87
  --td-brand-color: var(--td-primary-color-7);
91
88
  --td-warning-color: var(--td-warning-color-5);
92
89
  --td-error-color: var(--td-error-color-6);
93
90
  --td-success-color: var(--td-success-color-5);
94
91
 
95
- // 基础颜色的扩展 用于 聚焦 / 禁用 / 点击 等状态
96
92
  --td-brand-color-focus: var(--td-primary-color-1);
97
93
  --td-brand-color-active: var(--td-primary-color-8);
98
94
  --td-brand-color-disabled: var(--td-primary-color-3);
99
95
  --td-brand-color-light: var(--td-primary-color-1);
100
96
  --td-brand-color-light-active: var(--td-primary-color-2);
101
97
 
102
- // 警告色扩展
103
98
  --td-warning-color-active: var(--td-warning-color-6);
104
99
  --td-warning-color-disabled: var(--td-warning-color-3);
105
100
  --td-warning-color-focus: var(--td-warning-color-2);
106
101
  --td-warning-color-light: var(--td-warning-color-1);
107
102
  --td-warning-color-light-active: var(--td-warning-color-2);
108
103
 
109
- // 失败/错误色扩展
110
104
  --td-error-color-focus: var(--td-error-color-2);
111
105
  --td-error-color-active: var(--td-error-color-7);
112
106
  --td-error-color-disabled: var(--td-error-color-3);
113
107
  --td-error-color-light: var(--td-error-color-1);
114
108
  --td-error-color-light-active: var(--td-error-color-2);
115
109
 
116
- // 成功色扩展
117
110
  --td-success-color-focus: var(--td-success-color-2);
118
111
  --td-success-color-active: var(--td-success-color-6);
119
112
  --td-success-color-disabled: var(--td-success-color-3);
120
113
  --td-success-color-light: var(--td-success-color-1);
121
114
  --td-success-color-light-active: var(--td-success-color-2);
122
115
 
123
- // 遮罩
124
- --td-mask-active: rgba(0, 0, 0, 60%); // 遮罩-弹出
125
- --td-mask-disabled: rgba(255, 255, 255, 60%); // 遮罩-禁用
126
- --td-mask-background: rgba(255, 255, 255, 96%); // 二维码遮罩
116
+ --td-mask-active: rgba(0, 0, 0, 60%);
117
+ --td-mask-disabled: rgba(255, 255, 255, 60%);
118
+ --td-mask-background: rgba(255, 255, 255, 96%);
127
119
 
128
- // 背景色
129
120
  --td-bg-color-page: var(--td-gray-color-1);
130
121
  --td-bg-color-container: var(--td-font-white-1);
131
122
  --td-bg-color-container-active: var(--td-gray-color-3);
@@ -137,10 +128,8 @@
137
128
  --td-bg-color-secondarycomponent: var(--td-gray-color-4);
138
129
  --td-bg-color-secondarycomponent-active: var(--td-gray-color-6);
139
130
 
140
- // 特殊组件背景色,目前只用于 button、input 组件多主题场景,浅色主题下固定为白色,深色主题下为 transparent 适配背景颜色
141
131
  --td-bg-color-specialcomponent: #fff;
142
132
 
143
- // 文本颜色
144
133
  --td-text-color-primary: var(--td-font-gray-1);
145
134
  --td-text-color-secondary: var(--td-font-gray-2);
146
135
  --td-text-color-placeholder: var(--td-font-gray-3);
@@ -149,36 +138,26 @@
149
138
  --td-text-color-brand: var(--td-brand-color);
150
139
  --td-text-color-link: var(--td-brand-color);
151
140
 
152
- // 分割线
153
141
  --td-border-level-1-color: var(--td-gray-color-3);
154
142
  --td-component-stroke: var(--td-gray-color-3);
155
- // 边框
156
143
  --td-border-level-2-color: var(--td-gray-color-4);
157
144
  --td-component-border: var(--td-gray-color-4);
158
145
 
159
- // 基础/下层 投影 hover 使用的组件包括:表格 /
160
146
  --td-shadow-1: 0 1px 10px rgba(0, 0, 0, 5%), 0 4px 5px rgba(0, 0, 0, 8%), 0 2px 4px -1px rgba(0, 0, 0, 12%);
161
- // 中层投影 下拉 使用的组件包括:下拉菜单 / 气泡确认框 / 选择器 /
162
147
  --td-shadow-2: 0 3px 14px 2px rgba(0, 0, 0, 5%), 0 8px 10px 1px rgba(0, 0, 0, 6%), 0 5px 5px -3px rgba(0, 0, 0, 10%);
163
- // 上层投影(警示/弹窗)使用的组件包括:全局提示 / 消息通知
164
148
  --td-shadow-3: 0 6px 30px 5px rgba(0, 0, 0, 5%), 0 16px 24px 2px rgba(0, 0, 0, 4%),
165
149
  0 8px 10px -5px rgba(0, 0, 0, 8%);
166
150
  --td-shadow-4: 0 2px 8px 0 rgba(0, 0, 0, 0.06);
167
151
 
168
- // 内投影 用于弹窗类组件(气泡确认框 / 全局提示 / 消息通知)的内描边
169
152
  --td-shadow-inset-top: inset 0 0.5px 0 #dcdcdc;
170
153
  --td-shadow-inset-right: inset 0.5px 0 0 #dcdcdc;
171
154
  --td-shadow-inset-bottom: inset 0 -0.5px 0 #dcdcdc;
172
155
  --td-shadow-inset-left: inset -0.5px 0 0 #dcdcdc;
173
156
 
174
- // table 特定阴影
175
157
  --td-table-shadow-color: rgba(0, 0, 0, 8%);
176
158
 
177
- // 滚动条颜色
178
159
  --td-scrollbar-color: rgba(0, 0, 0, 10%);
179
- // 滚动条悬浮颜色( hover )
180
160
  --td-scrollbar-hover-color: rgba(0, 0, 0, 30%);
181
- // 滚动条轨道颜色,不能是带透明度,否则纵向滚动时,横向滚动条会穿透
182
161
  --td-scroll-track-color: #fff;
183
162
  }
184
163
  }
@@ -261,7 +240,6 @@
261
240
  --td-gray-color-13: #242424;
262
241
  --td-gray-color-14: #181818;
263
242
 
264
- // 文字 & 图标 颜色
265
243
  --td-font-white-1: rgba(255, 255, 255, 90%);
266
244
  --td-font-white-2: rgba(255, 255, 255, 55%);
267
245
  --td-font-white-3: rgba(255, 255, 255, 35%);
@@ -271,95 +249,77 @@
271
249
  --td-font-gray-3: rgba(0, 0, 0, 40%);
272
250
  --td-font-gray-4: rgba(0, 0, 0, 26%);
273
251
 
274
- // 基础颜色
275
- --td-brand-color: var(--td-primary-color-8); // 色彩-品牌-可操作
276
- --td-warning-color: var(--td-warning-color-5); // 色彩-功能-警告
277
- --td-error-color: var(--td-error-color-6); // 色彩-功能-失败
278
- --td-success-color: var(--td-success-color-5); // 色彩-功能-成功
252
+ --td-brand-color: var(--td-primary-color-8);
253
+ --td-warning-color: var(--td-warning-color-5);
254
+ --td-error-color: var(--td-error-color-6);
255
+ --td-success-color: var(--td-success-color-5);
279
256
 
280
- // 基础颜色的扩展 用于 聚焦 / 禁用 / 点击 等状态
281
- --td-brand-color-focus: var(--td-primary-color-1); // focus态,包括鼠标和键盘
282
- --td-brand-color-active: var(--td-primary-color-9); // 点击态
283
- --td-brand-color-disabled: var(--td-primary-color-3); // 禁用态
284
- --td-brand-color-light: var(--td-primary-color-1); // 浅色的选中态
285
- --td-brand-color-light-active: var(--td-primary-color-2); // 浅色的选中态
257
+ --td-brand-color-focus: var(--td-primary-color-1);
258
+ --td-brand-color-active: var(--td-primary-color-9);
259
+ --td-brand-color-disabled: var(--td-primary-color-3);
260
+ --td-brand-color-light: var(--td-primary-color-1);
261
+ --td-brand-color-light-active: var(--td-primary-color-2);
286
262
 
287
- // 警告色扩展
288
263
  --td-warning-color-focus: var(--td-warning-color-2);
289
264
  --td-warning-color-active: var(--td-warning-color-4);
290
265
  --td-warning-color-disabled: var(--td-warning-color-3);
291
266
  --td-warning-color-light: var(--td-warning-color-1);
292
267
  --td-warning-color-light-active: var(--td-warning-color-2);
293
268
 
294
- // 失败/错误色扩展
295
269
  --td-error-color-focus: var(--td-error-color-2);
296
270
  --td-error-color-active: var(--td-error-color-5);
297
271
  --td-error-color-disabled: var(--td-error-color-3);
298
272
  --td-error-color-light: var(--td-error-color-1);
299
273
  --td-error-color-light-active: var(--td-error-color-2);
300
274
 
301
- // 成功色扩展
302
275
  --td-success-color-focus: var(--td-success-color-2);
303
276
  --td-success-color-active: var(--td-success-color-4);
304
277
  --td-success-color-disabled: var(--td-success-color-3);
305
278
  --td-success-color-light: var(--td-success-color-1);
306
279
  --td-success-color-light-active: var(--td-success-color-2);
307
280
 
308
- // 遮罩
309
- --td-mask-active: rgba(0, 0, 0, 40%); // 遮罩-弹出
310
- --td-mask-disabled: rgba(0, 0, 0, 60%); // 遮罩-禁用
311
- --td-mask-background: rgba(36, 36, 36, 96%); // 二维码遮罩
312
-
313
- // 背景色
314
- --td-bg-color-page: var(--td-gray-color-14); // 色彩 - page
315
- --td-bg-color-container: var(--td-gray-color-13); // 色彩 - 容器
316
- --td-bg-color-secondarycontainer: var(--td-gray-color-12); // 色彩 - 次级容器
317
- --td-bg-color-component: var(--td-gray-color-11); // 色彩 - 组件
318
- --td-bg-color-container-active: var(--td-gray-color-12); // 色彩 - 容器 - active
319
- --td-bg-color-secondarycontainer-active: var(--td-gray-color-11); // 色彩 - 次级容器 - active
320
- --td-bg-color-component-active: var(--td-gray-color-10); // 色彩 - 组件 - active
321
- --td-bg-color-component-disabled: var(--td-gray-color-12); // 色彩 - 组件 - disabled
322
- --td-bg-color-secondarycomponent: var(--td-gray-color-10); // 色彩 - 次级组件
323
- --td-bg-color-secondarycomponent-active: var(--td-gray-color-8); // 色彩 - 次级组件 - active
324
-
325
- // 特殊组件背景色,目前只用于 button、input 组件多主题场景,浅色主题下固定为白色,深色主题下为 transparent 适配背景颜色
281
+ --td-mask-active: rgba(0, 0, 0, 40%);
282
+ --td-mask-disabled: rgba(0, 0, 0, 60%);
283
+ --td-mask-background: rgba(36, 36, 36, 96%);
284
+
285
+ --td-bg-color-page: var(--td-gray-color-14);
286
+ --td-bg-color-container: var(--td-gray-color-13);
287
+ --td-bg-color-secondarycontainer: var(--td-gray-color-12);
288
+ --td-bg-color-component: var(--td-gray-color-11);
289
+ --td-bg-color-container-active: var(--td-gray-color-12);
290
+ --td-bg-color-secondarycontainer-active: var(--td-gray-color-11);
291
+ --td-bg-color-component-active: var(--td-gray-color-10);
292
+ --td-bg-color-component-disabled: var(--td-gray-color-12);
293
+ --td-bg-color-secondarycomponent: var(--td-gray-color-10);
294
+ --td-bg-color-secondarycomponent-active: var(--td-gray-color-8);
295
+
326
296
  --td-bg-color-specialcomponent: transparent;
327
297
 
328
- // 文本颜色
329
- --td-text-color-primary: var(--td-font-white-1); // 色彩-文字-主要
330
- --td-text-color-secondary: var(--td-font-white-2); // 色彩-文字-次要
331
- --td-text-color-placeholder: var(--td-font-white-3); // 色彩-文字-占位符/说明
332
- --td-text-color-disabled: var(--td-font-white-4); // 色彩-文字-禁用
333
- --td-text-color-anti: var(--td-font-white-1); // 色彩-文字-反色
334
- --td-text-color-brand: var(--td-primary-color-8); // 色彩-文字-品牌
335
- --td-text-color-link: var(--td-primary-color-8); // 色彩-文字-链接
298
+ --td-text-color-primary: var(--td-font-white-1);
299
+ --td-text-color-secondary: var(--td-font-white-2);
300
+ --td-text-color-placeholder: var(--td-font-white-3);
301
+ --td-text-color-disabled: var(--td-font-white-4);
302
+ --td-text-color-anti: var(--td-font-white-1);
303
+ --td-text-color-brand: var(--td-primary-color-8);
304
+ --td-text-color-link: var(--td-primary-color-8);
336
305
 
337
- // 分割线
338
306
  --td-border-level-1-color: var(--td-gray-color-11);
339
307
  --td-component-stroke: var(--td-gray-color-11);
340
- // 边框
341
308
  --td-border-level-2-color: var(--td-gray-color-9);
342
309
  --td-component-border: var(--td-gray-color-9);
343
310
 
344
- // 基础/下层 投影 hover 使用的组件包括:表格 /
345
311
  --td-shadow-1: 0 4px 6px rgba(0, 0, 0, 6%), 0 1px 10px rgba(0, 0, 0, 8%), 0 2px 4px rgba(0, 0, 0, 12%);
346
- // 中层投影 下拉 使用的组件包括:下拉菜单 / 气泡确认框 / 选择器 /
347
312
  --td-shadow-2: 0 8px 10px rgba(0, 0, 0, 12%), 0 3px 14px rgba(0, 0, 0, 10%), 0 5px 5px rgba(0, 0, 0, 16%);
348
- // 上层投影(警示/弹窗)使用的组件包括:全局提示 / 消息通知
349
313
  --td-shadow-3: 0 16px 24px rgba(0, 0, 0, 14%), 0 6px 30px rgba(0, 0, 0, 12%), 0 8px 10px rgba(0, 0, 0, 20%);
350
- // 内投影 用于弹窗类组件(气泡确认框 / 全局提示 / 消息通知)的内描边
351
314
 
352
315
  --td-shadow-inset-top: inset 0 0.5px 0 #5e5e5e;
353
316
  --td-shadow-inset-right: inset 0.5px 0 0 #5e5e5e;
354
317
  --td-shadow-inset-bottom: inset 0 -0.5px 0 #5e5e5e;
355
318
  --td-shadow-inset-left: inset -0.5px 0 0 #5e5e5e;
356
319
 
357
- // table 特定阴影
358
320
  --td-table-shadow-color: rgba(0, 0, 0, 55%);
359
321
 
360
- // 滚动条颜色
361
322
  --td-scrollbar-color: rgba(255, 255, 255, 10%);
362
- // 滚动条轨道颜色,不能是带透明度,否则纵向滚动时,横向滚动条会穿透
363
323
  --td-scroll-track-color: #333;
364
324
  }
365
325
  }
@@ -368,7 +328,6 @@
368
328
  /* ./raw/_radius.less */
369
329
  page,
370
330
  .page {
371
- // 圆角
372
331
  --td-radius-small: 12px;
373
332
  --td-radius-default: 24px;
374
333
  --td-radius-large: 36px;
@@ -381,9 +340,8 @@ page,
381
340
  /* ./raw/_font.less */
382
341
  page,
383
342
  .page {
384
- // 字体family token
385
- --td-font-family: PingFang SC, Microsoft YaHei, Arial Regular; // 字体-磅数-常规
386
- --td-font-family-medium: PingFang SC, Microsoft YaHei, Arial Medium; // 字体-磅数-粗体
343
+ --td-font-family: PingFang SC, Microsoft YaHei, Arial Regular;
344
+ --td-font-family-medium: PingFang SC, Microsoft YaHei, Arial Medium;
387
345
 
388
346
  --td-font-size-link-small: 48px;
389
347
  --td-font-size-link-medium: 56px;
@@ -406,7 +364,6 @@ page,
406
364
  --td-font-size-display-medium: 192px;
407
365
  --td-font-size-display-large: 256px;
408
366
 
409
- // 字体行高 token
410
367
  --td-line-height-link-small: 80px;
411
368
  --td-line-height-link-medium: 88px;
412
369
  --td-line-height-link-large: 96px;
@@ -428,7 +385,6 @@ page,
428
385
  --td-line-height-display-medium: 224px;
429
386
  --td-line-height-display-large: 288px;
430
387
 
431
- // font token
432
388
  --td-font-link-small: var(--td-font-size-link-small) / var(--td-line-height-link-small) var(--td-font-family);
433
389
  --td-font-link-medium: var(--td-font-size-link-medium) / var(--td-line-height-link-medium) var(--td-font-family);
434
390
  --td-font-link-large: var(--td-font-size-link-large) / var(--td-line-height-link-large) var(--td-font-family);
@@ -459,7 +415,6 @@ page,
459
415
  --td-font-display-large: 600 var(--td-font-size-display-large) / var(--td-line-height-display-large)
460
416
  var(--td-font-family);
461
417
 
462
- // 字体大小 token
463
418
  --td-font-size: 40px;
464
419
  --td-font-size-xs: var(--td-font-size-body-extraSmall);
465
420
  --td-font-size-s: var(--td-font-size-body-small);
@@ -474,19 +429,17 @@ page,
474
429
  /* ./raw/_spacer.less */
475
430
  page,
476
431
  .page {
477
- // Spacer
478
432
  --td-spacer: 32px;
479
- --td-spacer-1: 48px; // 间距-小-x
480
- --td-spacer-2: 64px; // 间距-小
481
- --td-spacer-3: 96px; // 间距-中
482
- --td-spacer-4: 128px; // 间距-大
483
- --td-spacer-5: 192px; // 间距-大-x
484
- --td-spacer-6: 320px; // 间距-大-xx
433
+ --td-spacer-1: 48px;
434
+ --td-spacer-2: 64px;
435
+ --td-spacer-3: 96px;
436
+ --td-spacer-4: 128px;
437
+ --td-spacer-5: 192px;
438
+ --td-spacer-6: 320px;
485
439
  }
486
440
 
487
441
 
488
442
  /* ./raw/_components.less */
489
- // 部分特殊处理的组件级 token
490
443
  @media (prefers-color-scheme: light) {
491
444
  page,
492
445
  .page {
@@ -516,4 +469,3 @@ page,
516
469
  --td-progress-circle-inner-bg-color: var(--bg-color-page);
517
470
  }
518
471
  }
519
-
@@ -60,8 +60,8 @@
60
60
  :webp="imageProps.webp"
61
61
  :show-menu-by-longpress="imageProps.showMenuByLongpress"
62
62
  :data-custom="imageProps.dataset"
63
- @error="binderror($event, { custom: dataset || null })"
64
- @load="bindload($event, { custom: dataset || null })"
63
+ @error="binderror($event)"
64
+ @load="bindload($event)"
65
65
  />
66
66
  </block>
67
67
  <slot name="image" />
@@ -20,7 +20,7 @@
20
20
  <ContentComp
21
21
  :title="title"
22
22
  :body="body"
23
- :current="_current"
23
+ :current="iCurrent"
24
24
  :class-prefix="classPrefix"
25
25
  :prefix="prefix"
26
26
  :skip-button="skipButton"
@@ -120,7 +120,7 @@
120
120
  <ContentComp
121
121
  :title="title"
122
122
  :body="body"
123
- :current="_current"
123
+ :current="iCurrent"
124
124
  :class-prefix="classPrefix"
125
125
  :prefix="prefix"
126
126
  :skip-button="skipButton"
@@ -269,7 +269,7 @@ export default uniComponent({
269
269
  prefix,
270
270
  classPrefix: name,
271
271
  visible: false,
272
- _current: -1,
272
+ iCurrent: -1,
273
273
  _steps: [],
274
274
  referenceStyle: '',
275
275
  popoverStyle: '',
@@ -287,33 +287,31 @@ export default uniComponent({
287
287
  watch: {
288
288
  steps: {
289
289
  handler() {
290
- this._init();
290
+ this.innerInit();
291
291
  },
292
292
  deep: true,
293
293
  },
294
294
  current: {
295
295
  handler(v) {
296
- this._current = v;
296
+ this.iCurrent = v;
297
297
  },
298
298
  },
299
- _current: '_init',
300
- showOverlay: '_init',
299
+ iCurrent: 'innerInit',
300
+ showOverlay: 'innerInit',
301
301
  },
302
302
  created() {
303
303
  that = this;
304
- // this._init =
305
304
  this._getPlacement = this.getPlacement();
306
305
  },
307
306
  mounted() {
308
- this._init();
307
+ this.innerInit();
309
308
  },
310
309
  methods: {
311
- _init: debounce(() => that.init(), 20),
310
+ innerInit: debounce(() => that.init(), 20),
312
311
  async init() {
313
- console.log('doing init');
314
312
  const { steps } = this;
315
- const { _current } = this;
316
- const step = steps[_current];
313
+ const { iCurrent } = this;
314
+ const step = steps[iCurrent];
317
315
  if (!step) {
318
316
  this.visible = false;
319
317
  return;
@@ -325,10 +323,9 @@ export default uniComponent({
325
323
  this.modeType = modeType;
326
324
 
327
325
 
328
- // if (current === _current) return;
329
326
  if (modeType === 'popover') {
330
327
  const rect = await step.element();
331
- console.log('rect', rect);
328
+
332
329
  if (!rect) return;
333
330
  const highlightPadding = rpx2px(coalesce(step.highlightPadding, this.highlightPadding));
334
331
  const referenceTop = rect.top - highlightPadding;
@@ -345,7 +342,6 @@ export default uniComponent({
345
342
  height: `${referenceHeight}px`,
346
343
  };
347
344
  this._steps = this.steps;
348
- // this._current = this.current;
349
345
  this.visible = true;
350
346
  this.referenceStyle = styles(style);
351
347
  this.title = coalesce(step.title, '');
@@ -356,7 +352,6 @@ export default uniComponent({
356
352
  this.popoverStyle = popoverStyle;
357
353
  } else {
358
354
  this._steps = this.steps;
359
- // this._current = this.current;
360
355
  this.visible = true;
361
356
  this.title = coalesce(step.title, '');
362
357
  this.body = coalesce(step.body, '');
@@ -422,9 +417,9 @@ export default uniComponent({
422
417
  this.finishButton = finishButton;
423
418
  },
424
419
  renderCounter() {
425
- const { steps, _current, counter } = this;
420
+ const { steps, iCurrent, counter } = this;
426
421
  const stepsTotal = steps.length;
427
- const innerCurrent = _current + 1;
422
+ const innerCurrent = iCurrent + 1;
428
423
  const popupSlotCounter = isFunction(counter) ? counter({ total: stepsTotal, current: innerCurrent }) : counter;
429
424
  return counter ? popupSlotCounter : `(${innerCurrent}/${stepsTotal})`;
430
425
  },
@@ -433,34 +428,29 @@ export default uniComponent({
433
428
  return `${button.content.replace(/ \(.*?\)/, '')} ${hideCounter ? '' : this.renderCounter()}`;
434
429
  },
435
430
  onTplButtonTap(e, { type }) {
436
- console.log('onTplButtonTap.type', type);
437
- const params = { e, current: this._current, total: this.steps.length };
431
+ const params = { e, current: this.iCurrent, total: this.steps.length };
438
432
  switch (type) {
439
433
  case 'next':
440
- this.$emit('next-step-click', { next: this._current + 1, ...params });
441
- // this.setData({ current: this..current + 1 });
442
- this._current = this._current + 1;
434
+ this.$emit('next-step-click', { next: this.iCurrent + 1, ...params });
435
+ this.iCurrent = this.iCurrent + 1;
443
436
  break;
444
437
  case 'skip':
445
438
  this.$emit('skip', params);
446
- // this.setData({ current: -1 });
447
- this._current = -1;
439
+ this.iCurrent = -1;
448
440
  break;
449
441
  case 'back':
450
442
  this.$emit('back', params);
451
- // this.setData({ current: 0 });
452
- this._current = 0;
443
+ this.iCurrent = 0;
453
444
  break;
454
445
  case 'finish':
455
446
  this.$emit('finish', params);
456
- // this.setData({ current: -1 });
457
- this._current = -1;
447
+ this.iCurrent = -1;
458
448
  break;
459
449
  default:
460
450
  break;
461
451
  }
462
- console.log('_current', this._current);
463
- this.$emit('change', { current: this._current });
452
+
453
+ this.$emit('change', { current: this.iCurrent });
464
454
  },
465
455
  getPlacement() {
466
456
  const space = rpx2px(32);
@@ -88,7 +88,7 @@ export default uniComponent({
88
88
  classPrefix,
89
89
  } = this;
90
90
  const isImage = name.indexOf('/') !== -1;
91
- const sizeValue = addUnit(size);
91
+ const sizeValue = size !== null && size !== '' ? addUnit(size) : undefined;
92
92
  const colorStyle = color ? {
93
93
  color,
94
94
  } : {};
@@ -12,7 +12,7 @@
12
12
  @touchend.stop.prevent="onTouchEnd"
13
13
  >
14
14
  <view
15
- v-for="(item, index) in _indexList"
15
+ v-for="(item, index) in innerIndexList"
16
16
  :key="index"
17
17
  :class="tools.cls(classPrefix + '__sidebar-item', [['active', dataCurrent === item]]) + ' ' + tClassSidebarItem"
18
18
  :data-index="index"
@@ -90,7 +90,7 @@ export default uniComponent({
90
90
  prefix,
91
91
  classPrefix: name,
92
92
  _height: 0,
93
- _indexList: [],
93
+ innerIndexList: [],
94
94
  scrollTop: 0,
95
95
  activeAnchor: this.current,
96
96
  showTips: false,
@@ -181,9 +181,9 @@ export default uniComponent({
181
181
  alphabet.push(String.fromCharCode(i));
182
182
  }
183
183
 
184
- this._indexList = alphabet;
184
+ this.innerIndexList = alphabet;
185
185
  } else {
186
- this._indexList = list;
186
+ this.innerIndexList = list;
187
187
  }
188
188
  },
189
189
 
@@ -194,7 +194,7 @@ export default uniComponent({
194
194
  item.totalHeight = (next?.top || Infinity) - item.top;
195
195
  });
196
196
 
197
- const current = this.dataCurrent || this._indexList[0];
197
+ const current = this.dataCurrent || this.innerIndexList[0];
198
198
  this.setAnchorByCurrent(current, 'init');
199
199
  })
200
200
  .catch((err) => {
@@ -221,7 +221,7 @@ export default uniComponent({
221
221
  getSidebarRect() {
222
222
  getRect(this, `#id-${name}__bar`).then((rect) => {
223
223
  const { top, height } = rect;
224
- const { length } = this._indexList;
224
+ const { length } = this.innerIndexList;
225
225
 
226
226
  this.sidebar = {
227
227
  top,
@@ -288,7 +288,7 @@ export default uniComponent({
288
288
  onAnchorTouch: throttle(function (e) {
289
289
  const getAnchorIndex = (clientY) => {
290
290
  const offsetY = clientY - this.sidebar.top;
291
- const max = this._indexList.length - 1;
291
+ const max = this.innerIndexList.length - 1;
292
292
 
293
293
  if (offsetY <= 0) {
294
294
  return 0;
@@ -302,7 +302,7 @@ export default uniComponent({
302
302
  };
303
303
  const index = getAnchorIndex(e.changedTouches[0].clientY);
304
304
 
305
- this.setAnchorByCurrent(this._indexList[index], 'touch');
305
+ this.setAnchorByCurrent(this.innerIndexList[index], 'touch');
306
306
  }, 1000 / 30), // 30 frame
307
307
 
308
308
  setAnchorOnScroll(scrollTop) {
@@ -58,7 +58,7 @@
58
58
  :using-custom-navbar="usingCustomNavbar"
59
59
  :custom-navbar-height="customNavbarHeight"
60
60
  :z-index="(overlayProps && overlayProps.zIndex) || 11000"
61
- :duration="(overlayProps && overlayProps.duration) || 300"
61
+ :duration="(overlayProps && overlayProps.duration) || duration || 300"
62
62
  :background-color="(overlayProps && overlayProps.backgroundColor) || ''"
63
63
  :prevent-scroll-through="preventScrollThrough || (overlayProps ? !!overlayProps.preventScrollThrough : false)"
64
64
  :custom-style="(overlayProps && overlayProps.style) || ''"
@@ -2,7 +2,7 @@
2
2
  <view
3
3
  :id="tId"
4
4
  :style="tools._style([customStyle])"
5
- :class="tools.cls(classPrefix, [_placement, ['block', block], ['disabled', _disabled]]) + ' ' + tClass"
5
+ :class="tools.cls(classPrefix, [innerPlacement, ['block', block], ['disabled', _disabled]]) + ' ' + tClass"
6
6
  :disabled="_disabled"
7
7
  aria-role="radio"
8
8
  :aria-checked="dataChecked"
@@ -10,7 +10,7 @@
10
10
  :aria-disabled="_disabled"
11
11
  @click.stop="handleTap"
12
12
  >
13
- <view :class="tools.cls(classPrefix + '__icon', [_placement, ['checked', dataChecked], ['disabled', _disabled]]) + ' ' + tClassIcon">
13
+ <view :class="tools.cls(classPrefix + '__icon', [innerPlacement, ['checked', dataChecked], ['disabled', _disabled]]) + ' ' + tClassIcon">
14
14
  <slot
15
15
  v-if="slotIcon"
16
16
  name="icon"
@@ -86,7 +86,7 @@
86
86
  </view>
87
87
  <view
88
88
  v-if="!borderless"
89
- :class="tools.cls(classPrefix + '__border', [_placement]) + ' ' + tClassBorder"
89
+ :class="tools.cls(classPrefix + '__border', [innerPlacement]) + ' ' + tClassBorder"
90
90
  />
91
91
  </view>
92
92
  </template>
@@ -142,7 +142,7 @@ export default uniComponent({
142
142
  slotIcon: false,
143
143
  optionLinked: false,
144
144
  iconVal: [],
145
- _placement: '',
145
+ innerPlacement: '',
146
146
  _disabled: false,
147
147
  _readonly: false,
148
148
  tools,
@@ -207,7 +207,7 @@ export default uniComponent({
207
207
  this.customIcon = isIdArr;
208
208
  this.slotIcon = icon === 'slot';
209
209
  this.iconVal = isIdArr ? parent?.icon || icon : [];
210
- this._placement = this.placement || parent?.placement || 'left';
210
+ this.innerPlacement = this.placement || parent?.placement || 'left';
211
211
  },
212
212
 
213
213
  setDisabled(disabled) {
@@ -17,19 +17,19 @@
17
17
  mode="aspectFit"
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 || ''"
25
- :t-class="classPrefix + '__icon ' + classPrefix + '__icon--' + (_icon.activeIdx == _icon.index ? 'active ' : ' ')"
26
- :prefix="_icon.prefix"
27
- :name="_icon.name"
28
- :size="_icon.size"
29
- :color="_icon.color"
30
- :aria-hidden="!!_icon.ariaHidden"
31
- :aria-label="_icon.ariaLabel"
32
- :aria-role="_icon.ariaRole"
24
+ :custom-style="innerIcon.style || ''"
25
+ :t-class="classPrefix + '__icon ' + classPrefix + '__icon--' + (innerIcon.activeIdx == innerIcon.index ? 'active ' : ' ')"
26
+ :prefix="innerIcon.prefix"
27
+ :name="innerIcon.name"
28
+ :size="innerIcon.size"
29
+ :color="innerIcon.color"
30
+ :aria-hidden="!!innerIcon.ariaHidden"
31
+ :aria-label="innerIcon.ariaLabel"
32
+ :aria-role="innerIcon.ariaRole"
33
33
  />
34
34
  </block>
35
35
  <slot name="image" />
@@ -102,7 +102,7 @@ export default uniComponent({
102
102
  classPrefix: name,
103
103
  tools,
104
104
 
105
- _icon: null,
105
+ innerIcon: null,
106
106
  };
107
107
  },
108
108
  watch: {
@@ -118,7 +118,7 @@ export default uniComponent({
118
118
  icon,
119
119
  theme,
120
120
  } = this;
121
- this._icon = calcIcon(icon, THEME_ICON[theme]);
121
+ this.innerIcon = calcIcon(icon, THEME_ICON[theme]);
122
122
  },
123
123
  },
124
124
  });
@@ -42,7 +42,7 @@ name | params | description
42
42
  -- | -- | --
43
43
  action-click | \- | \-
44
44
  blur | `(context: { value: string })` | \-
45
- change | `(context: { value: string })` | \-
45
+ change | `(context: { value: string, trigger: 'input-change' \| 'option-click' \| 'clear' })` | \-
46
46
  clear | `(context: { value: string })` | \-
47
47
  focus | `(context: { value: string })` | \-
48
48
  submit | `(context: { value: string })` | \-