@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.
- package/CHANGELOG.md +22 -0
- package/dist/action-sheet/README.en-US.md +1 -1
- package/dist/action-sheet/README.md +1 -1
- package/dist/action-sheet/action-sheet.vue +27 -12
- package/dist/action-sheet/computed.js +14 -0
- package/dist/action-sheet/type.ts +2 -2
- package/dist/avatar/avatar.vue +6 -6
- package/dist/avatar-group/avatar-group.vue +1 -3
- package/dist/back-top/back-top.vue +13 -15
- package/dist/badge/badge.vue +1 -3
- package/dist/button/README.en-US.md +5 -2
- package/dist/button/README.md +5 -2
- package/dist/button/button.vue +18 -14
- package/dist/button/props.ts +14 -0
- package/dist/button/type.ts +14 -0
- package/dist/calendar/README.en-US.md +1 -0
- package/dist/calendar/README.md +1 -0
- package/dist/calendar/calendar-header.vue +1 -3
- package/dist/calendar/calendar.vue +28 -19
- package/dist/calendar/props.ts +5 -0
- package/dist/calendar/template.vue +1 -3
- package/dist/calendar/type.ts +6 -0
- package/dist/cascader/cascader.vue +9 -7
- package/dist/cell/cell.vue +51 -35
- package/dist/cell-group/cell-group.vue +1 -3
- package/dist/check-tag/check-tag.vue +12 -15
- package/dist/checkbox/checkbox.vue +13 -15
- package/dist/col/col.vue +1 -3
- package/dist/collapse/collapse.vue +1 -3
- package/dist/collapse-panel/collapse-panel.vue +1 -3
- package/dist/color-picker/color-picker.vue +2 -4
- package/dist/color-picker/template.vue +1 -3
- package/dist/common/src/instantiationDecorator.js +14 -0
- package/dist/common/style/theme/index.css +42 -90
- package/dist/count-down/count-down.vue +2 -4
- package/dist/date-time-picker/date-time-picker.vue +1 -3
- package/dist/dialog/dialog.vue +67 -69
- package/dist/divider/divider.vue +1 -3
- package/dist/draggable/draggable.vue +1 -3
- package/dist/drawer/drawer.vue +1 -3
- package/dist/dropdown-item/dropdown-item.vue +1 -3
- package/dist/dropdown-menu/dropdown-menu.vue +12 -14
- package/dist/empty/empty.vue +1 -3
- package/dist/fab/fab.vue +1 -3
- package/dist/footer/footer.vue +1 -3
- package/dist/form/form.vue +1 -3
- package/dist/form-item/form-item.css +16 -11
- package/dist/form-item/form-item.vue +2 -7
- package/dist/grid/grid.vue +1 -3
- package/dist/grid-item/grid-item.vue +3 -5
- package/dist/guide/content.vue +1 -3
- package/dist/guide/guide.vue +25 -40
- package/dist/icon/icon.vue +2 -4
- package/dist/image/image.vue +1 -3
- package/dist/image-viewer/image-viewer.vue +27 -30
- package/dist/indexes/indexes.vue +13 -15
- package/dist/indexes-anchor/indexes-anchor.vue +1 -3
- package/dist/input/input.vue +31 -31
- package/dist/link/link.vue +25 -26
- package/dist/loading/loading.vue +2 -2
- package/dist/message/index.d.ts +1 -1
- package/dist/message/message.interface.ts +2 -1
- package/dist/message-item/message-item.vue +34 -36
- package/dist/mixins/page-scroll.js +1 -1
- package/dist/navbar/navbar.vue +46 -33
- package/dist/notice-bar/notice-bar.vue +24 -26
- package/dist/overlay/overlay.vue +5 -7
- package/dist/picker/picker.vue +3 -4
- package/dist/picker-item/picker-item.vue +2 -4
- package/dist/popover/popover.vue +1 -3
- package/dist/popup/popup.vue +2 -4
- package/dist/progress/progress.vue +1 -3
- package/dist/pull-down-refresh/pull-down-refresh.vue +13 -15
- package/dist/qrcode/components/qrcode-canvas/qrcode-canvas.vue +1 -3
- package/dist/qrcode/components/qrcode-status/qrcode-status.vue +1 -3
- package/dist/qrcode/qrcode.vue +1 -3
- package/dist/radio/radio.vue +20 -22
- package/dist/rate/rate.vue +1 -3
- package/dist/result/result.vue +13 -15
- package/dist/row/row.vue +1 -3
- package/dist/search/README.en-US.md +1 -1
- package/dist/search/README.md +1 -1
- package/dist/search/search.vue +22 -10
- package/dist/search/type.ts +1 -1
- package/dist/side-bar/side-bar.vue +1 -3
- package/dist/side-bar-item/side-bar-item.vue +12 -15
- package/dist/skeleton/skeleton.vue +2 -4
- package/dist/slider/slider.vue +18 -20
- package/dist/step-item/step-item.vue +1 -3
- package/dist/stepper/stepper.vue +1 -3
- package/dist/steps/steps.vue +1 -2
- package/dist/sticky/sticky.vue +1 -3
- package/dist/swipe-cell/swipe-cell.vue +2 -5
- package/dist/swiper/swiper.vue +1 -3
- package/dist/swiper-nav/swiper-nav.vue +1 -3
- package/dist/switch/switch.vue +1 -3
- package/dist/tab-bar/tab-bar.vue +2 -1
- package/dist/tab-bar-item/tab-bar-item.vue +22 -25
- package/dist/tab-panel/tab-panel.vue +1 -3
- package/dist/tabs/tabs.vue +1 -2
- package/dist/tag/tag.vue +23 -26
- package/dist/textarea/textarea.vue +1 -3
- package/dist/toast/toast.vue +12 -14
- package/dist/transition/transition.vue +1 -3
- package/dist/tree-select/tree-select.vue +6 -9
- package/dist/upload/props.ts +1 -1
- package/dist/upload/upload.vue +1 -3
- package/dist/watermark/watermark.vue +1 -2
- package/package.json +3 -1
- package/dist/.eslintrc.js +0 -30
- package/dist/tsconfig.eslint.json +0 -13
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
align-items: flex-start;
|
|
6
6
|
justify-content: var(--td-form-item-justify-content, space-between);
|
|
7
7
|
width: 100%;
|
|
8
|
-
padding: var(--td-form-item-
|
|
9
|
-
background-color: #ffffff;
|
|
8
|
+
padding: var(--td-form-item-vertical-padding, 32rpx) var(--td-form-item-horizontal-padding, 32rpx);
|
|
9
|
+
background-color: var(--td-form-bg-color, var(--td-bg-color-container, var(--td-font-white-1, #ffffff)));
|
|
10
10
|
--td-input-vertical-padding: 0rpx;
|
|
11
11
|
--td-textarea-vertical-padding: 0rpx;
|
|
12
12
|
--td-textarea-horizontal-padding: 0rpx;
|
|
@@ -60,13 +60,6 @@
|
|
|
60
60
|
.t-form-item__controls {
|
|
61
61
|
flex: 1;
|
|
62
62
|
width: 100%;
|
|
63
|
-
margin-top: 8rpx;
|
|
64
|
-
}
|
|
65
|
-
.t-form-item__controls--left {
|
|
66
|
-
text-align: left;
|
|
67
|
-
}
|
|
68
|
-
.t-form-item__controls--right {
|
|
69
|
-
text-align: right;
|
|
70
63
|
}
|
|
71
64
|
.t-form-item__controls-content {
|
|
72
65
|
width: 100%;
|
|
@@ -74,11 +67,23 @@
|
|
|
74
67
|
align-items: center;
|
|
75
68
|
justify-content: space-between;
|
|
76
69
|
}
|
|
70
|
+
.t-form-item__controls-content--left {
|
|
71
|
+
justify-content: flex-start;
|
|
72
|
+
}
|
|
73
|
+
.t-form-item__controls-content--right {
|
|
74
|
+
justify-content: flex-end;
|
|
75
|
+
}
|
|
77
76
|
.t-form-item__help {
|
|
78
|
-
font-size: var(--td-font-size-
|
|
79
|
-
color: var(--td-font-gray-
|
|
77
|
+
font-size: var(--td-font-size-s, 24rpx);
|
|
78
|
+
color: var(--td-text-color-disabled, var(--td-font-gray-4, rgba(0, 0, 0, 0.26)));
|
|
80
79
|
line-height: 1.4;
|
|
81
80
|
}
|
|
81
|
+
.t-form-item__help--left {
|
|
82
|
+
text-align: left;
|
|
83
|
+
}
|
|
84
|
+
.t-form-item__help--right {
|
|
85
|
+
text-align: right;
|
|
86
|
+
}
|
|
82
87
|
.t-form-item__desc-link {
|
|
83
88
|
margin-top: 8rpx;
|
|
84
89
|
color: var(--td-primary-color-7, #0052d9);
|
|
@@ -169,13 +169,10 @@ export default uniComponent({
|
|
|
169
169
|
created() {
|
|
170
170
|
// this.initFormItem();
|
|
171
171
|
},
|
|
172
|
-
|
|
172
|
+
beforeUnmount() {
|
|
173
173
|
if (this.form) {
|
|
174
174
|
this.form.unregisterChild(this.name);
|
|
175
175
|
}
|
|
176
|
-
},
|
|
177
|
-
mounted() {
|
|
178
|
-
|
|
179
176
|
},
|
|
180
177
|
methods: {
|
|
181
178
|
innerAfterLinked() {
|
|
@@ -391,6 +388,4 @@ export default uniComponent({
|
|
|
391
388
|
},
|
|
392
389
|
});
|
|
393
390
|
</script>
|
|
394
|
-
<style scoped>
|
|
395
|
-
@import './form-item.css';
|
|
396
|
-
</style>
|
|
391
|
+
<style scoped src="./form-item.css"></style>
|
package/dist/grid/grid.vue
CHANGED
|
@@ -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
|
|
64
|
-
@load="bindload($event
|
|
63
|
+
@error="binderror($event)"
|
|
64
|
+
@load="bindload($event)"
|
|
65
65
|
/>
|
|
66
66
|
</block>
|
|
67
67
|
<slot name="image" />
|
|
@@ -281,9 +281,7 @@ export default uniComponent({
|
|
|
281
281
|
},
|
|
282
282
|
});
|
|
283
283
|
</script>
|
|
284
|
-
<style scoped>
|
|
285
|
-
@import './grid-item.css';
|
|
286
|
-
</style>
|
|
284
|
+
<style scoped src="./grid-item.css"></style>
|
|
287
285
|
<style scoped>
|
|
288
286
|
.t-grid-item__content--left {
|
|
289
287
|
width: 100%;
|
package/dist/guide/content.vue
CHANGED
package/dist/guide/guide.vue
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
<ContentComp
|
|
21
21
|
:title="title"
|
|
22
22
|
:body="body"
|
|
23
|
-
: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="
|
|
123
|
+
:current="iCurrent"
|
|
124
124
|
:class-prefix="classPrefix"
|
|
125
125
|
:prefix="prefix"
|
|
126
126
|
:skip-button="skipButton"
|
|
@@ -269,8 +269,7 @@ export default uniComponent({
|
|
|
269
269
|
prefix,
|
|
270
270
|
classPrefix: name,
|
|
271
271
|
visible: false,
|
|
272
|
-
|
|
273
|
-
_steps: [],
|
|
272
|
+
iCurrent: -1,
|
|
274
273
|
referenceStyle: '',
|
|
275
274
|
popoverStyle: '',
|
|
276
275
|
title: '',
|
|
@@ -287,33 +286,31 @@ export default uniComponent({
|
|
|
287
286
|
watch: {
|
|
288
287
|
steps: {
|
|
289
288
|
handler() {
|
|
290
|
-
this.
|
|
289
|
+
this.innerInit();
|
|
291
290
|
},
|
|
292
291
|
deep: true,
|
|
293
292
|
},
|
|
294
293
|
current: {
|
|
295
294
|
handler(v) {
|
|
296
|
-
this.
|
|
295
|
+
this.iCurrent = v;
|
|
297
296
|
},
|
|
298
297
|
},
|
|
299
|
-
|
|
300
|
-
showOverlay: '
|
|
298
|
+
iCurrent: 'innerInit',
|
|
299
|
+
showOverlay: 'innerInit',
|
|
301
300
|
},
|
|
302
301
|
created() {
|
|
303
302
|
that = this;
|
|
304
|
-
|
|
305
|
-
this._getPlacement = this.getPlacement();
|
|
303
|
+
this.getPlacementResult = this.getPlacement();
|
|
306
304
|
},
|
|
307
305
|
mounted() {
|
|
308
|
-
this.
|
|
306
|
+
this.innerInit();
|
|
309
307
|
},
|
|
310
308
|
methods: {
|
|
311
|
-
|
|
309
|
+
innerInit: debounce(() => that.init(), 20),
|
|
312
310
|
async init() {
|
|
313
|
-
console.log('doing init');
|
|
314
311
|
const { steps } = this;
|
|
315
|
-
const {
|
|
316
|
-
const step = steps[
|
|
312
|
+
const { iCurrent } = this;
|
|
313
|
+
const step = steps[iCurrent];
|
|
317
314
|
if (!step) {
|
|
318
315
|
this.visible = false;
|
|
319
316
|
return;
|
|
@@ -325,10 +322,9 @@ export default uniComponent({
|
|
|
325
322
|
this.modeType = modeType;
|
|
326
323
|
|
|
327
324
|
|
|
328
|
-
// if (current === _current) return;
|
|
329
325
|
if (modeType === 'popover') {
|
|
330
326
|
const rect = await step.element();
|
|
331
|
-
|
|
327
|
+
|
|
332
328
|
if (!rect) return;
|
|
333
329
|
const highlightPadding = rpx2px(coalesce(step.highlightPadding, this.highlightPadding));
|
|
334
330
|
const referenceTop = rect.top - highlightPadding;
|
|
@@ -344,8 +340,6 @@ export default uniComponent({
|
|
|
344
340
|
width: `${referenceWidth}px`,
|
|
345
341
|
height: `${referenceHeight}px`,
|
|
346
342
|
};
|
|
347
|
-
this._steps = this.steps;
|
|
348
|
-
// this._current = this.current;
|
|
349
343
|
this.visible = true;
|
|
350
344
|
this.referenceStyle = styles(style);
|
|
351
345
|
this.title = coalesce(step.title, '');
|
|
@@ -355,8 +349,6 @@ export default uniComponent({
|
|
|
355
349
|
const popoverStyle = await this.placementOffset(step, style);
|
|
356
350
|
this.popoverStyle = popoverStyle;
|
|
357
351
|
} else {
|
|
358
|
-
this._steps = this.steps;
|
|
359
|
-
// this._current = this.current;
|
|
360
352
|
this.visible = true;
|
|
361
353
|
this.title = coalesce(step.title, '');
|
|
362
354
|
this.body = coalesce(step.body, '');
|
|
@@ -366,7 +358,7 @@ export default uniComponent({
|
|
|
366
358
|
async placementOffset({ placement, offset }, place) {
|
|
367
359
|
await nextTick();
|
|
368
360
|
const rect = await getRect(this, `.${name}__container`);
|
|
369
|
-
const style = this.
|
|
361
|
+
const style = this.getPlacementResult[placement]?.(rect, place, offset);
|
|
370
362
|
return styles({ position: 'absolute', ...style });
|
|
371
363
|
},
|
|
372
364
|
makeButtonProps(step, mode) {
|
|
@@ -422,9 +414,9 @@ export default uniComponent({
|
|
|
422
414
|
this.finishButton = finishButton;
|
|
423
415
|
},
|
|
424
416
|
renderCounter() {
|
|
425
|
-
const { steps,
|
|
417
|
+
const { steps, iCurrent, counter } = this;
|
|
426
418
|
const stepsTotal = steps.length;
|
|
427
|
-
const innerCurrent =
|
|
419
|
+
const innerCurrent = iCurrent + 1;
|
|
428
420
|
const popupSlotCounter = isFunction(counter) ? counter({ total: stepsTotal, current: innerCurrent }) : counter;
|
|
429
421
|
return counter ? popupSlotCounter : `(${innerCurrent}/${stepsTotal})`;
|
|
430
422
|
},
|
|
@@ -433,34 +425,29 @@ export default uniComponent({
|
|
|
433
425
|
return `${button.content.replace(/ \(.*?\)/, '')} ${hideCounter ? '' : this.renderCounter()}`;
|
|
434
426
|
},
|
|
435
427
|
onTplButtonTap(e, { type }) {
|
|
436
|
-
|
|
437
|
-
const params = { e, current: this._current, total: this.steps.length };
|
|
428
|
+
const params = { e, current: this.iCurrent, total: this.steps.length };
|
|
438
429
|
switch (type) {
|
|
439
430
|
case 'next':
|
|
440
|
-
this.$emit('next-step-click', { next: this.
|
|
441
|
-
|
|
442
|
-
this._current = this._current + 1;
|
|
431
|
+
this.$emit('next-step-click', { next: this.iCurrent + 1, ...params });
|
|
432
|
+
this.iCurrent = this.iCurrent + 1;
|
|
443
433
|
break;
|
|
444
434
|
case 'skip':
|
|
445
435
|
this.$emit('skip', params);
|
|
446
|
-
|
|
447
|
-
this._current = -1;
|
|
436
|
+
this.iCurrent = -1;
|
|
448
437
|
break;
|
|
449
438
|
case 'back':
|
|
450
439
|
this.$emit('back', params);
|
|
451
|
-
|
|
452
|
-
this._current = 0;
|
|
440
|
+
this.iCurrent = 0;
|
|
453
441
|
break;
|
|
454
442
|
case 'finish':
|
|
455
443
|
this.$emit('finish', params);
|
|
456
|
-
|
|
457
|
-
this._current = -1;
|
|
444
|
+
this.iCurrent = -1;
|
|
458
445
|
break;
|
|
459
446
|
default:
|
|
460
447
|
break;
|
|
461
448
|
}
|
|
462
|
-
|
|
463
|
-
this.$emit('change', { current: this.
|
|
449
|
+
|
|
450
|
+
this.$emit('change', { current: this.iCurrent });
|
|
464
451
|
},
|
|
465
452
|
getPlacement() {
|
|
466
453
|
const space = rpx2px(32);
|
|
@@ -530,9 +517,7 @@ export default uniComponent({
|
|
|
530
517
|
});
|
|
531
518
|
|
|
532
519
|
</script>
|
|
533
|
-
<style scoped>
|
|
534
|
-
@import './guide.css';
|
|
535
|
-
</style>
|
|
520
|
+
<style scoped src="./guide.css"></style>
|
|
536
521
|
<style scoped lang="less">
|
|
537
522
|
.t-guide__footer--dialog {
|
|
538
523
|
// 适配 QQ 小程序等
|
package/dist/icon/icon.vue
CHANGED
|
@@ -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
|
} : {};
|
|
@@ -116,6 +116,4 @@ export default uniComponent({
|
|
|
116
116
|
},
|
|
117
117
|
});
|
|
118
118
|
</script>
|
|
119
|
-
<style scoped>
|
|
120
|
-
@import './icon.css';
|
|
121
|
-
</style>
|
|
119
|
+
<style scoped src="./icon.css"></style>
|
package/dist/image/image.vue
CHANGED
|
@@ -62,20 +62,20 @@
|
|
|
62
62
|
>
|
|
63
63
|
<slot name="close-btn" />
|
|
64
64
|
<block
|
|
65
|
-
v-if="
|
|
65
|
+
v-if="iCloseBtn"
|
|
66
66
|
name="icon"
|
|
67
67
|
>
|
|
68
68
|
<t-icon
|
|
69
|
-
:custom-style="
|
|
70
|
-
:t-class="
|
|
71
|
-
:prefix="
|
|
72
|
-
:name="
|
|
73
|
-
:size="
|
|
74
|
-
:color="
|
|
75
|
-
:aria-hidden="!!
|
|
76
|
-
:aria-label="
|
|
77
|
-
:aria-role="
|
|
78
|
-
@click="
|
|
69
|
+
:custom-style="iCloseBtn.style || ''"
|
|
70
|
+
:t-class="iCloseBtn.tClass"
|
|
71
|
+
:prefix="iCloseBtn.prefix"
|
|
72
|
+
:name="iCloseBtn.name"
|
|
73
|
+
:size="iCloseBtn.size"
|
|
74
|
+
:color="iCloseBtn.color"
|
|
75
|
+
:aria-hidden="!!iCloseBtn.ariaHidden"
|
|
76
|
+
:aria-label="iCloseBtn.ariaLabel"
|
|
77
|
+
:aria-role="iCloseBtn.ariaRole"
|
|
78
|
+
@click="iCloseBtn.click || ''"
|
|
79
79
|
/>
|
|
80
80
|
</block>
|
|
81
81
|
</view>
|
|
@@ -93,17 +93,17 @@
|
|
|
93
93
|
>
|
|
94
94
|
<slot name="delete-btn" />
|
|
95
95
|
<t-icon
|
|
96
|
-
v-if="
|
|
97
|
-
:custom-style="
|
|
98
|
-
:t-class="
|
|
99
|
-
:prefix="
|
|
100
|
-
:name="
|
|
101
|
-
:size="
|
|
102
|
-
:color="
|
|
103
|
-
:aria-hidden="!!
|
|
104
|
-
:aria-label="
|
|
105
|
-
:aria-role="
|
|
106
|
-
@click="
|
|
96
|
+
v-if="iDeleteBtn"
|
|
97
|
+
:custom-style="iDeleteBtn.style || ''"
|
|
98
|
+
:t-class="iDeleteBtn.tClass"
|
|
99
|
+
:prefix="iDeleteBtn.prefix"
|
|
100
|
+
:name="iDeleteBtn.name"
|
|
101
|
+
:size="iDeleteBtn.size"
|
|
102
|
+
:color="iDeleteBtn.color"
|
|
103
|
+
:aria-hidden="!!iDeleteBtn.ariaHidden"
|
|
104
|
+
:aria-label="iDeleteBtn.ariaLabel"
|
|
105
|
+
:aria-role="iDeleteBtn.ariaRole"
|
|
106
|
+
@click="iDeleteBtn.click || ''"
|
|
107
107
|
/>
|
|
108
108
|
</view>
|
|
109
109
|
</view>
|
|
@@ -157,8 +157,8 @@ export default uniComponent({
|
|
|
157
157
|
maskTop: 0,
|
|
158
158
|
tools,
|
|
159
159
|
|
|
160
|
-
|
|
161
|
-
|
|
160
|
+
iDeleteBtn: null,
|
|
161
|
+
iCloseBtn: null,
|
|
162
162
|
dataVisible: this.visible,
|
|
163
163
|
};
|
|
164
164
|
},
|
|
@@ -174,14 +174,14 @@ export default uniComponent({
|
|
|
174
174
|
|
|
175
175
|
closeBtn: {
|
|
176
176
|
handler(v) {
|
|
177
|
-
this.
|
|
177
|
+
this.iCloseBtn = calcIcon(v, 'close');
|
|
178
178
|
},
|
|
179
179
|
immediate: true,
|
|
180
180
|
},
|
|
181
181
|
|
|
182
182
|
deleteBtn: {
|
|
183
183
|
handler(v) {
|
|
184
|
-
this.
|
|
184
|
+
this.iDeleteBtn = calcIcon(v, 'delete');
|
|
185
185
|
},
|
|
186
186
|
immediate: true,
|
|
187
187
|
},
|
|
@@ -311,7 +311,4 @@ export default uniComponent({
|
|
|
311
311
|
},
|
|
312
312
|
});
|
|
313
313
|
</script>
|
|
314
|
-
<style scoped>
|
|
315
|
-
@import './image-viewer.css';
|
|
316
|
-
|
|
317
|
-
</style>
|
|
314
|
+
<style scoped src="./image-viewer.css"></style>
|
package/dist/indexes/indexes.vue
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
@touchend.stop.prevent="onTouchEnd"
|
|
13
13
|
>
|
|
14
14
|
<view
|
|
15
|
-
v-for="(item, index) in
|
|
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"
|
|
@@ -89,8 +89,8 @@ export default uniComponent({
|
|
|
89
89
|
return {
|
|
90
90
|
prefix,
|
|
91
91
|
classPrefix: name,
|
|
92
|
-
|
|
93
|
-
|
|
92
|
+
innerHeight: 0,
|
|
93
|
+
innerIndexList: [],
|
|
94
94
|
scrollTop: 0,
|
|
95
95
|
activeAnchor: this.current,
|
|
96
96
|
showTips: false,
|
|
@@ -110,7 +110,7 @@ export default uniComponent({
|
|
|
110
110
|
handler(v, pre) {
|
|
111
111
|
const cb = () => {
|
|
112
112
|
this.setIndexList(v);
|
|
113
|
-
this.setHeight(this.
|
|
113
|
+
this.setHeight(this.innerHeight);
|
|
114
114
|
};
|
|
115
115
|
if (!pre?.length) {
|
|
116
116
|
// 防止抖音小程序报错
|
|
@@ -150,7 +150,7 @@ export default uniComponent({
|
|
|
150
150
|
this.groupTop = [];
|
|
151
151
|
this.sidebar = null;
|
|
152
152
|
|
|
153
|
-
if (this.
|
|
153
|
+
if (this.innerHeight === 0) {
|
|
154
154
|
this.setHeight();
|
|
155
155
|
}
|
|
156
156
|
|
|
@@ -165,7 +165,7 @@ export default uniComponent({
|
|
|
165
165
|
const { windowHeight } = systemInfo;
|
|
166
166
|
height = windowHeight;
|
|
167
167
|
}
|
|
168
|
-
this.
|
|
168
|
+
this.innerHeight = height;
|
|
169
169
|
|
|
170
170
|
setTimeout(() => {
|
|
171
171
|
this.getAllRect();
|
|
@@ -181,9 +181,9 @@ export default uniComponent({
|
|
|
181
181
|
alphabet.push(String.fromCharCode(i));
|
|
182
182
|
}
|
|
183
183
|
|
|
184
|
-
this.
|
|
184
|
+
this.innerIndexList = alphabet;
|
|
185
185
|
} else {
|
|
186
|
-
this.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
305
|
+
this.setAnchorByCurrent(this.innerIndexList[index], 'touch');
|
|
306
306
|
}, 1000 / 30), // 30 frame
|
|
307
307
|
|
|
308
308
|
setAnchorOnScroll(scrollTop) {
|
|
@@ -366,6 +366,4 @@ export default uniComponent({
|
|
|
366
366
|
},
|
|
367
367
|
});
|
|
368
368
|
</script>
|
|
369
|
-
<style scoped>
|
|
370
|
-
@import './indexes.css';
|
|
371
|
-
</style>
|
|
369
|
+
<style scoped src="./indexes.css"></style>
|
package/dist/input/input.vue
CHANGED
|
@@ -9,20 +9,20 @@
|
|
|
9
9
|
<view :class="classPrefix + '__icon--prefix'">
|
|
10
10
|
<slot name="prefix-icon" />
|
|
11
11
|
<block
|
|
12
|
-
v-if="
|
|
12
|
+
v-if="iPrefixIcon"
|
|
13
13
|
name="icon"
|
|
14
14
|
>
|
|
15
15
|
<t-icon
|
|
16
|
-
:custom-style="
|
|
16
|
+
:custom-style="iPrefixIcon.style || ''"
|
|
17
17
|
:t-class="tClassPrefixIcon"
|
|
18
|
-
:prefix="
|
|
19
|
-
:name="
|
|
20
|
-
:size="
|
|
21
|
-
:color="
|
|
18
|
+
:prefix="iPrefixIcon.prefix"
|
|
19
|
+
:name="iPrefixIcon.name"
|
|
20
|
+
:size="iPrefixIcon.size"
|
|
21
|
+
:color="iPrefixIcon.color"
|
|
22
22
|
:aria-hidden="true"
|
|
23
|
-
:aria-label="
|
|
24
|
-
:aria-role="
|
|
25
|
-
@click="
|
|
23
|
+
:aria-label="iPrefixIcon.ariaLabel"
|
|
24
|
+
:aria-role="iPrefixIcon.ariaRole"
|
|
25
|
+
@click="iPrefixIcon.click || ''"
|
|
26
26
|
/>
|
|
27
27
|
</block>
|
|
28
28
|
</view>
|
|
@@ -81,21 +81,21 @@
|
|
|
81
81
|
@nicknamereview="onNickNameReview"
|
|
82
82
|
>
|
|
83
83
|
<view
|
|
84
|
-
v-if="
|
|
84
|
+
v-if="iClearIcon && dataValue && dataValue.length && showClearIcon"
|
|
85
85
|
:class="classPrefix + '__wrap--clearable-icon'"
|
|
86
86
|
@click.stop="clearInput"
|
|
87
87
|
>
|
|
88
88
|
<t-icon
|
|
89
|
-
:custom-style="
|
|
89
|
+
:custom-style="iClearIcon.style || ''"
|
|
90
90
|
:t-class="tClassClearable"
|
|
91
|
-
:prefix="
|
|
92
|
-
:name="
|
|
93
|
-
:size="
|
|
94
|
-
:color="
|
|
91
|
+
:prefix="iClearIcon.prefix"
|
|
92
|
+
:name="iClearIcon.name"
|
|
93
|
+
:size="iClearIcon.size"
|
|
94
|
+
:color="iClearIcon.color"
|
|
95
95
|
:aria-hidden="false"
|
|
96
|
-
:aria-label="
|
|
97
|
-
:aria-role="
|
|
98
|
-
@click="
|
|
96
|
+
:aria-label="iClearIcon.ariaLabel || '清除'"
|
|
97
|
+
:aria-role="iClearIcon.ariaRole || 'button'"
|
|
98
|
+
@click="iClearIcon.click || ''"
|
|
99
99
|
/>
|
|
100
100
|
</view>
|
|
101
101
|
<view
|
|
@@ -113,20 +113,20 @@
|
|
|
113
113
|
>
|
|
114
114
|
<slot name="suffix-icon" />
|
|
115
115
|
<block
|
|
116
|
-
v-if="
|
|
116
|
+
v-if="iSuffixIcon"
|
|
117
117
|
name="icon"
|
|
118
118
|
>
|
|
119
119
|
<t-icon
|
|
120
|
-
:custom-style="
|
|
120
|
+
:custom-style="iSuffixIcon.style || ''"
|
|
121
121
|
:t-class="tClassSuffixIcon"
|
|
122
|
-
:prefix="
|
|
123
|
-
:name="
|
|
124
|
-
:size="
|
|
125
|
-
:color="
|
|
122
|
+
:prefix="iSuffixIcon.prefix"
|
|
123
|
+
:name="iSuffixIcon.name"
|
|
124
|
+
:size="iSuffixIcon.size"
|
|
125
|
+
:color="iSuffixIcon.color"
|
|
126
126
|
:aria-hidden="true"
|
|
127
|
-
:aria-label="
|
|
128
|
-
:aria-role="
|
|
129
|
-
@click="
|
|
127
|
+
:aria-label="iSuffixIcon.ariaLabel"
|
|
128
|
+
:aria-role="iSuffixIcon.ariaRole || 'button'"
|
|
129
|
+
@click="iSuffixIcon.click || ''"
|
|
130
130
|
/>
|
|
131
131
|
</block>
|
|
132
132
|
</view>
|
|
@@ -214,21 +214,21 @@ export default uniComponent({
|
|
|
214
214
|
watch: {
|
|
215
215
|
prefixIcon: {
|
|
216
216
|
handler(v) {
|
|
217
|
-
this.
|
|
217
|
+
this.iPrefixIcon = calcIcon(v);
|
|
218
218
|
},
|
|
219
219
|
immediate: true,
|
|
220
220
|
},
|
|
221
221
|
|
|
222
222
|
suffixIcon: {
|
|
223
223
|
handler(v) {
|
|
224
|
-
this.
|
|
224
|
+
this.iSuffixIcon = calcIcon(v);
|
|
225
225
|
},
|
|
226
226
|
immediate: true,
|
|
227
227
|
},
|
|
228
228
|
|
|
229
229
|
clearable: {
|
|
230
230
|
handler(v) {
|
|
231
|
-
this.
|
|
231
|
+
this.iClearIcon = calcIcon(v, 'close-circle-filled');
|
|
232
232
|
},
|
|
233
233
|
immediate: true,
|
|
234
234
|
},
|
|
@@ -390,8 +390,8 @@ export default uniComponent({
|
|
|
390
390
|
});
|
|
391
391
|
|
|
392
392
|
</script>
|
|
393
|
+
<style scoped src="./input.css"></style>
|
|
393
394
|
<style scoped>
|
|
394
|
-
@import './input.css';
|
|
395
395
|
/* #ifdef H5 */
|
|
396
396
|
.t-input--disabled {
|
|
397
397
|
:deep(input) {
|