@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
|
@@ -122,8 +122,8 @@ export default uniComponent({
|
|
|
122
122
|
loosing: false,
|
|
123
123
|
enableToRefresh: true,
|
|
124
124
|
scrollTop: 0,
|
|
125
|
-
|
|
126
|
-
|
|
125
|
+
iMaxBarHeight: 0,
|
|
126
|
+
iLoadingBarHeight: 0,
|
|
127
127
|
|
|
128
128
|
pixelRatio: 1,
|
|
129
129
|
startPoint: null,
|
|
@@ -171,15 +171,15 @@ export default uniComponent({
|
|
|
171
171
|
}, 240);
|
|
172
172
|
}
|
|
173
173
|
|
|
174
|
-
this.tipsHeight = Math.min(val, this.
|
|
174
|
+
this.tipsHeight = Math.min(val, this.iLoadingBarHeight);
|
|
175
175
|
},
|
|
176
176
|
|
|
177
177
|
maxBarHeight(v) {
|
|
178
|
-
this.
|
|
178
|
+
this.iMaxBarHeight = unitConvert(v);
|
|
179
179
|
},
|
|
180
180
|
|
|
181
181
|
loadingBarHeight(v) {
|
|
182
|
-
this.
|
|
182
|
+
this.iLoadingBarHeight = unitConvert(v);
|
|
183
183
|
},
|
|
184
184
|
},
|
|
185
185
|
mounted() {
|
|
@@ -187,8 +187,8 @@ export default uniComponent({
|
|
|
187
187
|
const { loadingTexts, maxBarHeight, loadingBarHeight } = this;
|
|
188
188
|
const isCustomLoadingTexts = Array.isArray(loadingTexts) && loadingTexts.length >= 4;
|
|
189
189
|
|
|
190
|
-
this.
|
|
191
|
-
this.
|
|
190
|
+
this.iMaxBarHeight = unitConvert(maxBarHeight);
|
|
191
|
+
this.iLoadingBarHeight = unitConvert(loadingBarHeight);
|
|
192
192
|
this.dataLoadingTexts = isCustomLoadingTexts ? loadingTexts : defaultLoadingTexts;
|
|
193
193
|
|
|
194
194
|
this.pixelRatio = 750 / screenWidth;
|
|
@@ -196,7 +196,7 @@ export default uniComponent({
|
|
|
196
196
|
this.updateDistanceTop();
|
|
197
197
|
},
|
|
198
198
|
|
|
199
|
-
|
|
199
|
+
beforeUnmount() {
|
|
200
200
|
clearTimeout(this.maxRefreshAnimateTimeFlag);
|
|
201
201
|
clearTimeout(this.closingAnimateTimeFlag);
|
|
202
202
|
this.resetTimer();
|
|
@@ -287,7 +287,7 @@ export default uniComponent({
|
|
|
287
287
|
this.loosing = true;
|
|
288
288
|
|
|
289
289
|
// 松开时高度超过阈值则触发刷新
|
|
290
|
-
if (barHeight > this.
|
|
290
|
+
if (barHeight > this.iLoadingBarHeight) {
|
|
291
291
|
this._trigger('change', { value: true });
|
|
292
292
|
this.$emit('refresh');
|
|
293
293
|
} else {
|
|
@@ -299,7 +299,7 @@ export default uniComponent({
|
|
|
299
299
|
|
|
300
300
|
doRefresh() {
|
|
301
301
|
if (this.disabled) return;
|
|
302
|
-
this.barHeight = this.
|
|
302
|
+
this.barHeight = this.iLoadingBarHeight;
|
|
303
303
|
this.refreshStatus = REFRESH_STATUS_MAP.LOADING;
|
|
304
304
|
this.loosing = true;
|
|
305
305
|
|
|
@@ -315,10 +315,10 @@ export default uniComponent({
|
|
|
315
315
|
},
|
|
316
316
|
|
|
317
317
|
setRefreshBarHeight(value) {
|
|
318
|
-
const barHeight = Math.min(value, this.
|
|
318
|
+
const barHeight = Math.min(value, this.iMaxBarHeight);
|
|
319
319
|
const data = { barHeight };
|
|
320
320
|
|
|
321
|
-
if (barHeight >= this.
|
|
321
|
+
if (barHeight >= this.iLoadingBarHeight) {
|
|
322
322
|
data.refreshStatus = REFRESH_STATUS_MAP.LOSING;
|
|
323
323
|
} else {
|
|
324
324
|
data.refreshStatus = REFRESH_STATUS_MAP.PULLING;
|
|
@@ -361,6 +361,4 @@ export default uniComponent({
|
|
|
361
361
|
},
|
|
362
362
|
});
|
|
363
363
|
</script>
|
|
364
|
-
<style scoped>
|
|
365
|
-
@import './pull-down-refresh.css';
|
|
366
|
-
</style>
|
|
364
|
+
<style scoped src="./pull-down-refresh.css"></style>
|
package/dist/qrcode/qrcode.vue
CHANGED
package/dist/radio/radio.vue
CHANGED
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
<view
|
|
3
3
|
:id="tId"
|
|
4
4
|
:style="tools._style([customStyle])"
|
|
5
|
-
:class="tools.cls(classPrefix, [
|
|
6
|
-
:disabled="
|
|
5
|
+
:class="tools.cls(classPrefix, [innerPlacement, ['block', block], ['disabled', iDisabled]]) + ' ' + tClass"
|
|
6
|
+
:disabled="iDisabled"
|
|
7
7
|
aria-role="radio"
|
|
8
8
|
:aria-checked="dataChecked"
|
|
9
9
|
:aria-label="label + content"
|
|
10
|
-
:aria-disabled="
|
|
10
|
+
:aria-disabled="iDisabled"
|
|
11
11
|
@click.stop="handleTap"
|
|
12
12
|
>
|
|
13
|
-
<view :class="tools.cls(classPrefix + '__icon', [
|
|
13
|
+
<view :class="tools.cls(classPrefix + '__icon', [innerPlacement, ['checked', dataChecked], ['disabled', iDisabled]]) + ' ' + tClassIcon">
|
|
14
14
|
<slot
|
|
15
15
|
v-if="slotIcon"
|
|
16
16
|
name="icon"
|
|
@@ -33,11 +33,11 @@
|
|
|
33
33
|
/>
|
|
34
34
|
<view
|
|
35
35
|
v-if="dataChecked && icon == 'dot'"
|
|
36
|
-
:class="tools.cls(classPrefix + '__icon-' + icon, [['disabled',
|
|
36
|
+
:class="tools.cls(classPrefix + '__icon-' + icon, [['disabled', iDisabled]])"
|
|
37
37
|
/>
|
|
38
38
|
<view
|
|
39
39
|
v-if="!dataChecked && (icon == 'circle' || icon == 'dot')"
|
|
40
|
-
:class="tools.cls(classPrefix + '__icon-circle', [['disabled',
|
|
40
|
+
:class="tools.cls(classPrefix + '__icon-circle', [['disabled', iDisabled]])"
|
|
41
41
|
/>
|
|
42
42
|
<view
|
|
43
43
|
v-if="!dataChecked && icon == 'line'"
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
<view
|
|
54
54
|
:class="
|
|
55
55
|
tools.cls(classPrefix + '__title', [
|
|
56
|
-
['disabled',
|
|
56
|
+
['disabled', iDisabled],
|
|
57
57
|
['checked', dataChecked]
|
|
58
58
|
]) +
|
|
59
59
|
' ' +
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
<view
|
|
71
71
|
:class="
|
|
72
72
|
tools.cls(classPrefix + '__description', [
|
|
73
|
-
['disabled',
|
|
73
|
+
['disabled', iDisabled],
|
|
74
74
|
['checked', dataChecked]
|
|
75
75
|
]) +
|
|
76
76
|
' ' +
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
</view>
|
|
87
87
|
<view
|
|
88
88
|
v-if="!borderless"
|
|
89
|
-
:class="tools.cls(classPrefix + '__border', [
|
|
89
|
+
:class="tools.cls(classPrefix + '__border', [innerPlacement]) + ' ' + tClassBorder"
|
|
90
90
|
/>
|
|
91
91
|
</view>
|
|
92
92
|
</template>
|
|
@@ -142,9 +142,9 @@ export default uniComponent({
|
|
|
142
142
|
slotIcon: false,
|
|
143
143
|
optionLinked: false,
|
|
144
144
|
iconVal: [],
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
145
|
+
innerPlacement: '',
|
|
146
|
+
iDisabled: false,
|
|
147
|
+
iReadonly: false,
|
|
148
148
|
tools,
|
|
149
149
|
|
|
150
150
|
dataChecked: coalesce(this.checked, this.defaultChecked),
|
|
@@ -164,13 +164,13 @@ export default uniComponent({
|
|
|
164
164
|
},
|
|
165
165
|
disabled: {
|
|
166
166
|
handler(v) {
|
|
167
|
-
this.
|
|
167
|
+
this.iDisabled = v;
|
|
168
168
|
},
|
|
169
169
|
immediate: true,
|
|
170
170
|
},
|
|
171
171
|
readonly: {
|
|
172
172
|
handler(v) {
|
|
173
|
-
this.
|
|
173
|
+
this.iReadonly = v;
|
|
174
174
|
},
|
|
175
175
|
immediate: true,
|
|
176
176
|
},
|
|
@@ -180,10 +180,10 @@ export default uniComponent({
|
|
|
180
180
|
},
|
|
181
181
|
methods: {
|
|
182
182
|
handleTap(e) {
|
|
183
|
-
const {
|
|
183
|
+
const { iDisabled, iReadonly, contentDisabled } = this;
|
|
184
184
|
const { target } = e.currentTarget.dataset;
|
|
185
185
|
|
|
186
|
-
if (
|
|
186
|
+
if (iDisabled || iReadonly || (target === 'text' && contentDisabled)) return;
|
|
187
187
|
|
|
188
188
|
this.doChange();
|
|
189
189
|
},
|
|
@@ -207,21 +207,19 @@ export default uniComponent({
|
|
|
207
207
|
this.customIcon = isIdArr;
|
|
208
208
|
this.slotIcon = icon === 'slot';
|
|
209
209
|
this.iconVal = isIdArr ? parent?.icon || icon : [];
|
|
210
|
-
this.
|
|
210
|
+
this.innerPlacement = this.placement || parent?.placement || 'left';
|
|
211
211
|
},
|
|
212
212
|
|
|
213
213
|
setDisabled(disabled) {
|
|
214
214
|
if (this.isIsolated) return;
|
|
215
215
|
|
|
216
|
-
this.
|
|
216
|
+
this.iDisabled = this.disabled || disabled;
|
|
217
217
|
},
|
|
218
218
|
|
|
219
219
|
setReadonly(readonly) {
|
|
220
|
-
this.
|
|
220
|
+
this.iReadonly = this.readonly || readonly;
|
|
221
221
|
},
|
|
222
222
|
},
|
|
223
223
|
});
|
|
224
224
|
</script>
|
|
225
|
-
<style scoped>
|
|
226
|
-
@import './radio.css';
|
|
227
|
-
</style>
|
|
225
|
+
<style scoped src="./radio.css"></style>
|
package/dist/rate/rate.vue
CHANGED
package/dist/result/result.vue
CHANGED
|
@@ -17,19 +17,19 @@
|
|
|
17
17
|
mode="aspectFit"
|
|
18
18
|
/>
|
|
19
19
|
<block
|
|
20
|
-
v-else-if="
|
|
20
|
+
v-else-if="innerIcon"
|
|
21
21
|
name="icon"
|
|
22
22
|
>
|
|
23
23
|
<t-icon
|
|
24
|
-
:custom-style="
|
|
25
|
-
:t-class="classPrefix + '__icon ' + classPrefix + '__icon--' + (
|
|
26
|
-
:prefix="
|
|
27
|
-
:name="
|
|
28
|
-
:size="
|
|
29
|
-
:color="
|
|
30
|
-
:aria-hidden="!!
|
|
31
|
-
:aria-label="
|
|
32
|
-
:aria-role="
|
|
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
|
-
|
|
105
|
+
innerIcon: null,
|
|
106
106
|
};
|
|
107
107
|
},
|
|
108
108
|
watch: {
|
|
@@ -118,11 +118,9 @@ export default uniComponent({
|
|
|
118
118
|
icon,
|
|
119
119
|
theme,
|
|
120
120
|
} = this;
|
|
121
|
-
this.
|
|
121
|
+
this.innerIcon = calcIcon(icon, THEME_ICON[theme]);
|
|
122
122
|
},
|
|
123
123
|
},
|
|
124
124
|
});
|
|
125
125
|
</script>
|
|
126
|
-
<style scoped>
|
|
127
|
-
@import './result.css';
|
|
128
|
-
</style>
|
|
126
|
+
<style scoped src="./result.css"></style>
|
package/dist/row/row.vue
CHANGED
|
@@ -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 })` | \-
|
package/dist/search/README.md
CHANGED
|
@@ -80,7 +80,7 @@ value | String | '' | 值 | N
|
|
|
80
80
|
-- | -- | --
|
|
81
81
|
action-click | \- | 点击右侧操作按钮文字时触发
|
|
82
82
|
blur | `(context: { value: string })` | 失去焦点时触发
|
|
83
|
-
change | `(context: { value: string })` | 值发生变化时触发
|
|
83
|
+
change | `(context: { value: string, trigger: 'input-change' \| 'option-click' \| 'clear' })` | 值发生变化时触发
|
|
84
84
|
clear | `(context: { value: string })` | 点击清除时触发
|
|
85
85
|
focus | `(context: { value: string })` | 聚焦时触发
|
|
86
86
|
submit | `(context: { value: string })` | 提交时触发
|
package/dist/search/search.vue
CHANGED
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
:t-class="classPrefix + '__result-item'"
|
|
89
89
|
hover
|
|
90
90
|
aria-role="option"
|
|
91
|
-
@click="
|
|
91
|
+
@click="onSelectOption($event, { index })"
|
|
92
92
|
>
|
|
93
93
|
<template
|
|
94
94
|
#title
|
|
@@ -136,7 +136,6 @@ export default uniComponent({
|
|
|
136
136
|
...props,
|
|
137
137
|
},
|
|
138
138
|
emits: [
|
|
139
|
-
'selectresult',
|
|
140
139
|
],
|
|
141
140
|
data() {
|
|
142
141
|
return {
|
|
@@ -171,6 +170,13 @@ export default uniComponent({
|
|
|
171
170
|
immediate: true,
|
|
172
171
|
},
|
|
173
172
|
|
|
173
|
+
value: {
|
|
174
|
+
handler(val) {
|
|
175
|
+
this.dataValue = val;
|
|
176
|
+
},
|
|
177
|
+
immediate: true,
|
|
178
|
+
},
|
|
179
|
+
|
|
174
180
|
dataValue: {
|
|
175
181
|
handler() {
|
|
176
182
|
// this.updateInnerMaxLen();
|
|
@@ -214,7 +220,10 @@ export default uniComponent({
|
|
|
214
220
|
|
|
215
221
|
nextTick().then(() => {
|
|
216
222
|
this.dataValue = value;
|
|
217
|
-
this.$emit('change', {
|
|
223
|
+
this.$emit('change', {
|
|
224
|
+
value,
|
|
225
|
+
trigger: 'input-change',
|
|
226
|
+
});
|
|
218
227
|
});
|
|
219
228
|
// this.updateInnerMaxLen();
|
|
220
229
|
},
|
|
@@ -234,7 +243,10 @@ export default uniComponent({
|
|
|
234
243
|
handleClear() {
|
|
235
244
|
this.dataValue = '';
|
|
236
245
|
this.$emit('clear', { value: '' });
|
|
237
|
-
this.$emit('change', {
|
|
246
|
+
this.$emit('change', {
|
|
247
|
+
value: '',
|
|
248
|
+
trigger: 'clear',
|
|
249
|
+
});
|
|
238
250
|
},
|
|
239
251
|
|
|
240
252
|
onConfirm(e) {
|
|
@@ -246,13 +258,15 @@ export default uniComponent({
|
|
|
246
258
|
this.$emit('action-click');
|
|
247
259
|
},
|
|
248
260
|
|
|
249
|
-
|
|
261
|
+
onSelectOption(tools, { index }) {
|
|
250
262
|
const item = this.resultList[index];
|
|
251
263
|
this.dataValue = item;
|
|
252
264
|
this.isSelected = true;
|
|
253
265
|
|
|
254
|
-
this.$emit('change', {
|
|
255
|
-
|
|
266
|
+
this.$emit('change', {
|
|
267
|
+
value: item,
|
|
268
|
+
trigger: 'option-click',
|
|
269
|
+
});
|
|
256
270
|
},
|
|
257
271
|
highLight,
|
|
258
272
|
// updateInnerMaxLen() {
|
|
@@ -280,6 +294,4 @@ export default uniComponent({
|
|
|
280
294
|
|
|
281
295
|
|
|
282
296
|
</script>
|
|
283
|
-
<style scoped>
|
|
284
|
-
@import './search.css';
|
|
285
|
-
</style>
|
|
297
|
+
<style scoped src="./search.css"></style>
|
package/dist/search/type.ts
CHANGED
|
@@ -32,20 +32,20 @@
|
|
|
32
32
|
/>
|
|
33
33
|
</block>
|
|
34
34
|
<block
|
|
35
|
-
v-if="
|
|
35
|
+
v-if="innerIcon"
|
|
36
36
|
name="icon"
|
|
37
37
|
>
|
|
38
38
|
<t-icon
|
|
39
39
|
:custom-style="iconCustomStyle"
|
|
40
40
|
:t-class="classPrefix + '__icon'"
|
|
41
|
-
:prefix="
|
|
42
|
-
:name="
|
|
43
|
-
:size="
|
|
44
|
-
:color="
|
|
45
|
-
:aria-hidden="!!
|
|
46
|
-
:aria-label="
|
|
47
|
-
:aria-role="
|
|
48
|
-
@click="
|
|
41
|
+
:prefix="innerIcon.prefix"
|
|
42
|
+
:name="innerIcon.name"
|
|
43
|
+
:size="innerIcon.size"
|
|
44
|
+
:color="innerIcon.color"
|
|
45
|
+
:aria-hidden="!!innerIcon.ariaHidden"
|
|
46
|
+
:aria-label="innerIcon.ariaLabel"
|
|
47
|
+
:aria-role="innerIcon.ariaRole"
|
|
48
|
+
@click="innerIcon.click || ''"
|
|
49
49
|
/>
|
|
50
50
|
</block>
|
|
51
51
|
<block v-if="badgeProps">
|
|
@@ -122,14 +122,14 @@ export default uniComponent({
|
|
|
122
122
|
fontSize: 'var(--td-side-bar-icon-size, 20px)',
|
|
123
123
|
marginRight: '2px',
|
|
124
124
|
},
|
|
125
|
-
this.
|
|
125
|
+
this.innerIcon.style || '',
|
|
126
126
|
]);
|
|
127
127
|
},
|
|
128
128
|
},
|
|
129
129
|
watch: {
|
|
130
130
|
icon: {
|
|
131
131
|
handler(v) {
|
|
132
|
-
this.
|
|
132
|
+
this.innerIcon = typeof v === 'string' ? { name: v } : v;
|
|
133
133
|
},
|
|
134
134
|
immediate: true,
|
|
135
135
|
},
|
|
@@ -162,7 +162,4 @@ export default uniComponent({
|
|
|
162
162
|
});
|
|
163
163
|
|
|
164
164
|
</script>
|
|
165
|
-
<style scoped>
|
|
166
|
-
@import './side-bar-item.css';
|
|
167
|
-
|
|
168
|
-
</style>
|
|
165
|
+
<style scoped src="./side-bar-item.css"></style>
|
|
@@ -105,7 +105,7 @@ export default uniComponent({
|
|
|
105
105
|
this.init();
|
|
106
106
|
this.isShowSkeleton();
|
|
107
107
|
},
|
|
108
|
-
|
|
108
|
+
beforeUnmount() {
|
|
109
109
|
this.clearTimer();
|
|
110
110
|
},
|
|
111
111
|
methods: {
|
|
@@ -206,6 +206,4 @@ export default uniComponent({
|
|
|
206
206
|
},
|
|
207
207
|
});
|
|
208
208
|
</script>
|
|
209
|
-
<style scoped>
|
|
210
|
-
@import './skeleton.css';
|
|
211
|
-
</style>
|
|
209
|
+
<style scoped src="./skeleton.css"></style>
|
package/dist/slider/slider.vue
CHANGED
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
:key="index"
|
|
32
32
|
:class="
|
|
33
33
|
tools.cls(classPrefix + '__scale-item', [
|
|
34
|
-
['active',
|
|
34
|
+
['active', innerValue >= item.val],
|
|
35
35
|
['disabled', disabled],
|
|
36
36
|
theme,
|
|
37
37
|
['hidden', ((index == 0 || index == scaleArray.length - 1) && theme == 'capsule') || value == item.val]
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
aria-live="assertive"
|
|
68
68
|
:aria-hidden="!isVisibleToScreenReader"
|
|
69
69
|
>
|
|
70
|
-
{{ getValue(label,
|
|
70
|
+
{{ getValue(label, innerValue) || innerValue }}
|
|
71
71
|
</view>
|
|
72
72
|
<view
|
|
73
73
|
:class="classPrefix + '__dot-slider'"
|
|
@@ -75,8 +75,8 @@
|
|
|
75
75
|
:aria-disabled="disabled"
|
|
76
76
|
:aria-valuemax="max"
|
|
77
77
|
:aria-valuemin="min"
|
|
78
|
-
:aria-valuenow="
|
|
79
|
-
:aria-valuetext="getValue(label,
|
|
78
|
+
:aria-valuenow="innerValue"
|
|
79
|
+
:aria-valuetext="getValue(label, innerValue) || innerValue"
|
|
80
80
|
/>
|
|
81
81
|
</view>
|
|
82
82
|
</view>
|
|
@@ -240,7 +240,7 @@ export default uniComponent({
|
|
|
240
240
|
lineLeft: 0,
|
|
241
241
|
lineRight: 0,
|
|
242
242
|
dotTopValue: [0, 0],
|
|
243
|
-
|
|
243
|
+
innerValue: 0,
|
|
244
244
|
blockSize: 20,
|
|
245
245
|
isScale: false,
|
|
246
246
|
scaleArray: [],
|
|
@@ -264,7 +264,7 @@ export default uniComponent({
|
|
|
264
264
|
// immediate: true,
|
|
265
265
|
deep: true,
|
|
266
266
|
},
|
|
267
|
-
|
|
267
|
+
innerValue: {
|
|
268
268
|
handler(newValue) {
|
|
269
269
|
this.bus.on('initial', () => this.renderLine(newValue));
|
|
270
270
|
this.toggleA11yTips();
|
|
@@ -294,7 +294,7 @@ export default uniComponent({
|
|
|
294
294
|
this.bus.on('initial', () => this.handleMark(this.marks));
|
|
295
295
|
this.bus.on('initial', () => {
|
|
296
296
|
nextTick().then(() => {
|
|
297
|
-
this.renderLine(this.
|
|
297
|
+
this.renderLine(this.innerValue);
|
|
298
298
|
});
|
|
299
299
|
});
|
|
300
300
|
this.toggleA11yTips();
|
|
@@ -371,7 +371,7 @@ export default uniComponent({
|
|
|
371
371
|
value: trimmedValue,
|
|
372
372
|
});
|
|
373
373
|
if (this._selfControlled) {
|
|
374
|
-
this.
|
|
374
|
+
this.innerValue = trimmedValue;
|
|
375
375
|
}
|
|
376
376
|
},
|
|
377
377
|
|
|
@@ -417,7 +417,7 @@ export default uniComponent({
|
|
|
417
417
|
}
|
|
418
418
|
|
|
419
419
|
const setValueAndTrigger = () => {
|
|
420
|
-
this.
|
|
420
|
+
this.innerValue = value;
|
|
421
421
|
this.realLabel = realLabel;
|
|
422
422
|
};
|
|
423
423
|
|
|
@@ -609,7 +609,7 @@ export default uniComponent({
|
|
|
609
609
|
// 当前leftdot中心 + 左侧偏移量 = 目标左侧中心距离
|
|
610
610
|
const left = pagePosition - initialLeft - offset;
|
|
611
611
|
const leftValue = this.convertPosToValue(left, 0);
|
|
612
|
-
this.triggerValue([this.stepValue(leftValue), this.
|
|
612
|
+
this.triggerValue([this.stepValue(leftValue), this.innerValue[1]]);
|
|
613
613
|
} else {
|
|
614
614
|
let right = -(pagePosition - initialRight);
|
|
615
615
|
if (vertical) {
|
|
@@ -617,7 +617,7 @@ export default uniComponent({
|
|
|
617
617
|
}
|
|
618
618
|
const rightValue = this.convertPosToValue(right, 1);
|
|
619
619
|
|
|
620
|
-
this.triggerValue([this.
|
|
620
|
+
this.triggerValue([this.innerValue[0], this.stepValue(rightValue)]);
|
|
621
621
|
}
|
|
622
622
|
});
|
|
623
623
|
},
|
|
@@ -635,7 +635,7 @@ export default uniComponent({
|
|
|
635
635
|
|
|
636
636
|
onTouchMoveLeft(e) {
|
|
637
637
|
const { disabled, theme } = this;
|
|
638
|
-
const { initialLeft,
|
|
638
|
+
const { initialLeft, innerValue, blockSize } = this;
|
|
639
639
|
if (disabled) return;
|
|
640
640
|
|
|
641
641
|
const touch = e.changedTouches.find(item => item.identifier === this.identifier[0]);
|
|
@@ -647,7 +647,7 @@ export default uniComponent({
|
|
|
647
647
|
}
|
|
648
648
|
const currentLeft = pagePosition - initialLeft - offset;
|
|
649
649
|
|
|
650
|
-
const newData = [...(
|
|
650
|
+
const newData = [...(innerValue)];
|
|
651
651
|
const leftValue = this.convertPosToValue(currentLeft, 0);
|
|
652
652
|
|
|
653
653
|
newData[0] = this.stepValue(leftValue);
|
|
@@ -657,7 +657,7 @@ export default uniComponent({
|
|
|
657
657
|
|
|
658
658
|
onTouchMoveRight(e) {
|
|
659
659
|
const { disabled, vertical, theme } = this;
|
|
660
|
-
const { initialRight,
|
|
660
|
+
const { initialRight, innerValue } = this;
|
|
661
661
|
if (disabled) return;
|
|
662
662
|
|
|
663
663
|
const touch = e.changedTouches.find(item => item.identifier === this.identifier[1]);
|
|
@@ -671,7 +671,7 @@ export default uniComponent({
|
|
|
671
671
|
}
|
|
672
672
|
const currentRight = -(pagePosition - initialRight - offset);
|
|
673
673
|
|
|
674
|
-
const newData = [...(
|
|
674
|
+
const newData = [...(innerValue)];
|
|
675
675
|
const rightValue = this.convertPosToValue(currentRight, 1);
|
|
676
676
|
newData[1] = this.stepValue(rightValue);
|
|
677
677
|
|
|
@@ -682,7 +682,7 @@ export default uniComponent({
|
|
|
682
682
|
const { theme } = this;
|
|
683
683
|
const { blockSize, maxRange } = this;
|
|
684
684
|
const halfBlock = (theme) === 'capsule' ? Number(blockSize) / 2 : 0;
|
|
685
|
-
const [a, b] = this.
|
|
685
|
+
const [a, b] = this.innerValue ;
|
|
686
686
|
const cut = v => parseInt(v, 10);
|
|
687
687
|
|
|
688
688
|
this.dotTopValue = [a, b];
|
|
@@ -698,7 +698,7 @@ export default uniComponent({
|
|
|
698
698
|
},
|
|
699
699
|
|
|
700
700
|
onTouchEnd(e) {
|
|
701
|
-
this.$emit('dragend', { e, value: this.
|
|
701
|
+
this.$emit('dragend', { e, value: this.innerValue });
|
|
702
702
|
if (e.currentTarget.id === 'rightDot') {
|
|
703
703
|
this.identifier[1] = -1;
|
|
704
704
|
} else {
|
|
@@ -714,6 +714,4 @@ export default uniComponent({
|
|
|
714
714
|
},
|
|
715
715
|
});
|
|
716
716
|
</script>
|
|
717
|
-
<style scoped>
|
|
718
|
-
@import './slider.css';
|
|
719
|
-
</style>
|
|
717
|
+
<style scoped src="./slider.css"></style>
|