@tdesign/uniapp 0.7.3 → 0.8.0
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 +23 -0
- package/README.md +1 -1
- package/dist/action-sheet/README.md +1 -1
- package/dist/action-sheet/action-sheet.vue +158 -150
- package/dist/action-sheet/props.ts +2 -2
- package/dist/action-sheet/type.ts +1 -1
- package/dist/avatar/avatar.vue +89 -87
- package/dist/avatar-group/avatar-group.vue +69 -67
- package/dist/back-top/back-top.vue +60 -58
- package/dist/badge/badge.vue +69 -59
- package/dist/button/button.vue +121 -116
- package/dist/button/props.ts +2 -2
- package/dist/button/type.ts +1 -1
- package/dist/calendar/calendar-header.vue +4 -4
- package/dist/calendar/calendar.vue +308 -297
- package/dist/calendar/template.vue +1 -1
- package/dist/cascader/README.en-US.md +2 -1
- package/dist/cascader/README.md +2 -1
- package/dist/cascader/cascader.vue +340 -328
- package/dist/cascader/props.ts +6 -1
- package/dist/cascader/type.ts +6 -0
- package/dist/cell/cell.vue +127 -121
- package/dist/cell-group/cell-group.vue +32 -30
- package/dist/check-tag/check-tag.vue +73 -71
- package/dist/checkbox/checkbox.vue +127 -127
- package/dist/checkbox/props.ts +6 -6
- package/dist/checkbox/type.ts +3 -3
- package/dist/checkbox-group/checkbox-group.vue +175 -173
- package/dist/checkbox-group/props.ts +6 -6
- package/dist/checkbox-group/type.ts +4 -4
- package/dist/col/col.vue +26 -24
- package/dist/collapse/collapse.vue +83 -81
- package/dist/collapse-panel/collapse-panel.vue +121 -119
- package/dist/collapse-panel/props.ts +4 -4
- package/dist/collapse-panel/type.ts +2 -2
- package/dist/color-picker/README.md +1 -1
- package/dist/color-picker/color-picker.vue +324 -322
- package/dist/color-picker/props.ts +2 -2
- package/dist/color-picker/template.vue +14 -10
- package/dist/common/common.ts +1 -0
- package/dist/common/style/theme/index.css +5 -5
- package/dist/common/utils.js +7 -2
- package/dist/common/validator.js +172 -0
- package/dist/config-provider/README.en-US.md +184 -0
- package/dist/config-provider/README.md +234 -0
- package/dist/config-provider/config-provider.vue +105 -0
- package/dist/config-provider/config-store.js +70 -0
- package/dist/config-provider/props.ts +16 -0
- package/dist/config-provider/reactive-state.js +39 -0
- package/dist/config-provider/type.ts +401 -0
- package/dist/config-provider/use-config.js +29 -0
- package/dist/config-provider/utils.js +29 -0
- package/dist/count-down/count-down.vue +98 -97
- package/dist/date-time-picker/date-time-picker.vue +410 -395
- package/dist/demo/demo.vue +1 -0
- package/dist/dialog/dialog.vue +175 -173
- package/dist/divider/divider.vue +38 -36
- package/dist/draggable/draggable.vue +60 -58
- package/dist/drawer/README.md +1 -1
- package/dist/drawer/drawer.vue +48 -46
- package/dist/dropdown-item/dropdown-item.vue +209 -207
- package/dist/dropdown-item/props.ts +4 -4
- package/dist/dropdown-item/type.ts +3 -3
- package/dist/dropdown-menu/dropdown-menu.vue +93 -99
- package/dist/empty/empty.vue +43 -42
- package/dist/fab/fab.vue +88 -86
- package/dist/footer/footer.vue +36 -34
- package/dist/form/README.en-US.md +17 -24
- package/dist/form/README.md +18 -25
- package/dist/form/form.css +1 -166
- package/dist/form/form.vue +251 -236
- package/dist/form/props.ts +2 -21
- package/dist/form/type.ts +7 -70
- package/dist/form-item/README.en-US.md +4 -5
- package/dist/form-item/README.md +4 -5
- package/dist/form-item/form-item.css +69 -96
- package/dist/form-item/form-item.vue +315 -336
- package/dist/form-item/form-model.ts +125 -173
- package/dist/form-item/props.ts +4 -17
- package/dist/form-item/type.ts +43 -1
- package/dist/grid/grid.vue +53 -51
- package/dist/grid-item/grid-item.vue +121 -119
- package/dist/guide/README.md +1 -1
- package/dist/guide/guide.vue +281 -277
- package/dist/icon/README.md +2 -4
- package/dist/icon/icon.vue +78 -76
- package/dist/image/README.md +1 -1
- package/dist/image/image.vue +103 -101
- package/dist/image-viewer/image-viewer.vue +160 -158
- package/dist/image-viewer/props.ts +2 -2
- package/dist/image-viewer/type.ts +1 -1
- package/dist/index.js +3 -0
- package/dist/indexes/indexes.vue +264 -267
- package/dist/indexes-anchor/indexes-anchor.vue +41 -41
- package/dist/input/input.vue +192 -192
- package/dist/input/props.ts +6 -6
- package/dist/input/type.ts +3 -3
- package/dist/link/link.vue +73 -71
- package/dist/loading/loading.vue +59 -59
- package/dist/locale/ar_KW.ts +157 -0
- package/dist/locale/en_US.ts +146 -0
- package/dist/locale/it_IT.ts +145 -0
- package/dist/locale/ja_JP.ts +132 -0
- package/dist/locale/ko_KR.ts +132 -0
- package/dist/locale/ru_RU.ts +157 -0
- package/dist/locale/zh_CN.ts +133 -0
- package/dist/locale/zh_TW.ts +132 -0
- package/dist/message/message.vue +181 -173
- package/dist/message/props.ts +2 -2
- package/dist/message/type.ts +1 -1
- package/dist/message-item/message-item.vue +192 -184
- package/dist/mixins/using-config.js +39 -0
- package/dist/navbar/navbar.vue +201 -199
- package/dist/notice-bar/notice-bar.vue +175 -171
- package/dist/notice-bar/props.ts +2 -2
- package/dist/notice-bar/type.ts +1 -1
- package/dist/npm/dayjs/esm/locale/ar.js +81 -0
- package/dist/npm/dayjs/esm/locale/it.js +39 -0
- package/dist/overlay/overlay.vue +50 -48
- package/dist/picker/picker.vue +168 -161
- package/dist/picker-item/picker-item.vue +269 -269
- package/dist/popover/README.md +1 -1
- package/dist/popover/popover.vue +262 -261
- package/dist/popover/props.ts +4 -4
- package/dist/popover/type.ts +2 -2
- package/dist/popup/popup.vue +46 -45
- package/dist/progress/README.md +1 -1
- package/dist/progress/progress.vue +76 -76
- package/dist/pull-down-refresh/props.ts +2 -2
- package/dist/pull-down-refresh/pull-down-refresh.vue +240 -234
- package/dist/pull-down-refresh/type.ts +1 -1
- package/dist/qrcode/README.md +1 -1
- package/dist/qrcode/components/qrcode-canvas/qrcode-canvas.vue +340 -338
- package/dist/qrcode/components/qrcode-status/qrcode-status.vue +6 -6
- package/dist/qrcode/qrcode.vue +93 -87
- package/dist/radio/props.ts +6 -6
- package/dist/radio/radio.vue +118 -120
- package/dist/radio/type.ts +3 -3
- package/dist/radio-group/props.ts +4 -4
- package/dist/radio-group/radio-group.vue +136 -134
- package/dist/radio-group/type.ts +4 -4
- package/dist/rate/computed.js +2 -2
- package/dist/rate/props.ts +4 -4
- package/dist/rate/rate.vue +155 -154
- package/dist/rate/type.ts +2 -2
- package/dist/result/result.vue +41 -39
- package/dist/row/row.vue +38 -36
- package/dist/scroll-view/scroll-view.vue +24 -22
- package/dist/search/props.ts +2 -2
- package/dist/search/search.vue +127 -125
- package/dist/search/type.ts +1 -1
- package/dist/side-bar/side-bar.vue +57 -55
- package/dist/side-bar-item/side-bar-item.vue +86 -86
- package/dist/skeleton/skeleton.vue +126 -124
- package/dist/slider/README.md +1 -1
- package/dist/slider/props.ts +2 -2
- package/dist/slider/slider.vue +457 -457
- package/dist/slider/type.ts +1 -1
- package/dist/step-item/step-item.vue +77 -75
- package/dist/stepper/props.ts +2 -2
- package/dist/stepper/stepper.vue +168 -149
- package/dist/stepper/type.ts +1 -1
- package/dist/steps/props.ts +2 -2
- package/dist/steps/steps.vue +83 -81
- package/dist/steps/type.ts +1 -1
- package/dist/sticky/sticky.vue +104 -102
- package/dist/swipe-cell/swipe-cell.vue +91 -89
- package/dist/swiper/README.md +1 -1
- package/dist/swiper/swiper.vue +91 -89
- package/dist/swiper-nav/swiper-nav.vue +38 -36
- package/dist/switch/props.ts +2 -2
- package/dist/switch/switch.vue +62 -62
- package/dist/switch/type.ts +1 -1
- package/dist/tab-bar/tab-bar.vue +88 -86
- package/dist/tab-bar-item/tab-bar-item.vue +85 -82
- package/dist/tab-panel/tab-panel.vue +66 -64
- package/dist/tabs/tabs.vue +294 -287
- package/dist/tag/tag.vue +79 -77
- package/dist/textarea/props.ts +6 -6
- package/dist/textarea/textarea.vue +127 -126
- package/dist/textarea/type.ts +3 -3
- package/dist/toast/toast.vue +107 -106
- package/dist/transition/transition.vue +30 -28
- package/dist/tree-select/tree-select.vue +151 -151
- package/dist/types/config-provider.d.ts +7 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/popover.d.ts +7 -0
- package/dist/upload/README.en-US.md +13 -14
- package/dist/upload/README.md +11 -12
- package/dist/upload/props.ts +2 -4
- package/dist/upload/type.ts +12 -11
- package/dist/upload/upload.css +1 -1
- package/dist/upload/upload.vue +672 -512
- package/dist/watermark/watermark.vue +151 -149
- package/global.d.ts +2 -0
- package/package.json +15 -3
- package/dist/form/form-item-props.ts +0 -56
|
@@ -1,21 +1,19 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<view
|
|
3
3
|
:class="classPrefix + ' ' + tClass"
|
|
4
|
-
:style="tools._style([customStyle])"
|
|
4
|
+
:style="'' + tools._style([customStyle])"
|
|
5
5
|
>
|
|
6
6
|
<view
|
|
7
|
-
:class="
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
])
|
|
12
|
-
"
|
|
7
|
+
:class="'' + tools.cls(classPrefix + '__wrapper', [
|
|
8
|
+
['sticky', sticky],
|
|
9
|
+
['active', active]
|
|
10
|
+
])"
|
|
13
11
|
:style="anchorStyle"
|
|
14
12
|
>
|
|
15
13
|
<view :class="classPrefix + '__slot'">
|
|
16
14
|
<slot />
|
|
17
15
|
</view>
|
|
18
|
-
<view :class="tools.cls(classPrefix + '__header', [['active', active]])">
|
|
16
|
+
<view :class="'' + tools.cls(classPrefix + '__header', [['active', active]])">
|
|
19
17
|
{{ index }}
|
|
20
18
|
</view>
|
|
21
19
|
</view>
|
|
@@ -32,40 +30,42 @@ import { ChildrenMixin, RELATION_MAP } from '../common/relation';
|
|
|
32
30
|
const name = `${prefix}-indexes-anchor`;
|
|
33
31
|
|
|
34
32
|
|
|
35
|
-
export default
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
33
|
+
export default {
|
|
34
|
+
...uniComponent({
|
|
35
|
+
name,
|
|
36
|
+
options: {
|
|
37
|
+
styleIsolation: 'shared',
|
|
38
|
+
},
|
|
39
|
+
externalClasses: [
|
|
40
|
+
`${prefix}-class`,
|
|
41
|
+
],
|
|
42
|
+
mixins: [
|
|
43
|
+
ChildrenMixin(RELATION_MAP.IndexesAnchor, {
|
|
44
|
+
indexKey: 'tIndex',
|
|
45
|
+
}),
|
|
46
|
+
],
|
|
47
|
+
props: {
|
|
48
|
+
...props,
|
|
49
|
+
},
|
|
50
|
+
data() {
|
|
51
|
+
return {
|
|
52
|
+
prefix,
|
|
53
|
+
classPrefix: name,
|
|
54
|
+
anchorStyle: '',
|
|
55
|
+
sticky: false,
|
|
56
|
+
active: false,
|
|
57
|
+
tools,
|
|
58
|
+
};
|
|
59
|
+
},
|
|
60
|
+
watch: {
|
|
61
|
+
},
|
|
62
|
+
mounted() {
|
|
64
63
|
|
|
65
|
-
|
|
66
|
-
|
|
64
|
+
},
|
|
65
|
+
methods: {
|
|
67
66
|
|
|
68
|
-
|
|
69
|
-
})
|
|
67
|
+
},
|
|
68
|
+
}),
|
|
69
|
+
};
|
|
70
70
|
</script>
|
|
71
71
|
<style scoped src="./indexes-anchor.css"></style>
|
package/dist/input/input.vue
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<view
|
|
3
|
-
:style="tools._style([customStyle])"
|
|
4
|
-
:class="tools.cls(classPrefix, [['border', !borderless], ['readonly', readonly], ['disabled', disabled]])
|
|
3
|
+
:style="'' + tools._style([customStyle])"
|
|
4
|
+
:class="'' + tools.cls(classPrefix, [['border', !borderless], ['readonly', readonly], ['disabled', disabled]])
|
|
5
5
|
+ ' ' + classPrefix + '--layout-' + layout + ' ' + tClass"
|
|
6
6
|
aria-describedby
|
|
7
7
|
>
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
@click="onClick"
|
|
43
43
|
>
|
|
44
44
|
<input
|
|
45
|
-
:class="getInputClass(classPrefix, suffix, align, disabled) + ' ' + tClassInput"
|
|
45
|
+
:class="''+ getInputClass(classPrefix, suffix, align, disabled) + ' ' + tClassInput"
|
|
46
46
|
:maxlength="allowInputOverMax ? -1 : maxlength"
|
|
47
47
|
:disabled="disabled || readonly"
|
|
48
48
|
:placeholder="placeholder"
|
|
@@ -157,237 +157,237 @@ import { RELATION_MAP } from '../common/relation/parent-map.js';
|
|
|
157
157
|
const name = `${prefix}-input`;
|
|
158
158
|
|
|
159
159
|
|
|
160
|
-
export default
|
|
161
|
-
name,
|
|
162
|
-
options: {
|
|
163
|
-
styleIsolation: 'shared',
|
|
164
|
-
},
|
|
165
|
-
inject: {
|
|
166
|
-
[RELATION_MAP.FormKey]: {
|
|
167
|
-
default: null,
|
|
168
|
-
},
|
|
169
|
-
},
|
|
170
|
-
externalClasses: [
|
|
171
|
-
`${prefix}-class`,
|
|
172
|
-
`${prefix}-class-prefix-icon`,
|
|
173
|
-
`${prefix}-class-label`,
|
|
174
|
-
`${prefix}-class-input`,
|
|
175
|
-
`${prefix}-class-clearable`,
|
|
176
|
-
`${prefix}-class-suffix`,
|
|
177
|
-
`${prefix}-class-suffix-icon`,
|
|
178
|
-
`${prefix}-class-tips`,
|
|
179
|
-
],
|
|
160
|
+
export default {
|
|
180
161
|
components: {
|
|
181
162
|
TIcon,
|
|
182
163
|
},
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
prefix
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
164
|
+
...uniComponent({
|
|
165
|
+
name,
|
|
166
|
+
options: {
|
|
167
|
+
styleIsolation: 'shared',
|
|
168
|
+
},
|
|
169
|
+
inject: {
|
|
170
|
+
[RELATION_MAP.FormKey]: {
|
|
171
|
+
default: null,
|
|
172
|
+
},
|
|
173
|
+
},
|
|
174
|
+
externalClasses: [
|
|
175
|
+
`${prefix}-class`,
|
|
176
|
+
`${prefix}-class-prefix-icon`,
|
|
177
|
+
`${prefix}-class-label`,
|
|
178
|
+
`${prefix}-class-input`,
|
|
179
|
+
`${prefix}-class-clearable`,
|
|
180
|
+
`${prefix}-class-suffix`,
|
|
181
|
+
`${prefix}-class-suffix-icon`,
|
|
182
|
+
`${prefix}-class-tips`,
|
|
183
|
+
],
|
|
184
|
+
props: {
|
|
185
|
+
...props,
|
|
186
|
+
},
|
|
187
|
+
emits: [
|
|
188
|
+
'blur',
|
|
189
|
+
'change',
|
|
190
|
+
'clear',
|
|
191
|
+
'click',
|
|
192
|
+
'enter',
|
|
193
|
+
'focus',
|
|
194
|
+
'keyboardheightchange',
|
|
195
|
+
'nicknamereview',
|
|
196
|
+
'validate',
|
|
197
|
+
'update:value',
|
|
198
|
+
],
|
|
199
|
+
data() {
|
|
200
|
+
return {
|
|
201
|
+
prefix,
|
|
202
|
+
classPrefix: name,
|
|
203
|
+
classBasePrefix: prefix,
|
|
204
|
+
showClearIcon: true,
|
|
205
|
+
tools,
|
|
205
206
|
|
|
206
|
-
|
|
207
|
+
dataValue: coalesce(this.value, this.defaultValue),
|
|
207
208
|
|
|
208
209
|
// rawValue: '',
|
|
209
210
|
// innerMaxLen: -1,
|
|
210
|
-
|
|
211
|
-
},
|
|
212
|
-
computed: {
|
|
213
|
-
},
|
|
214
|
-
watch: {
|
|
215
|
-
prefixIcon: {
|
|
216
|
-
handler(v) {
|
|
217
|
-
this.iPrefixIcon = calcIcon(v);
|
|
218
|
-
},
|
|
219
|
-
immediate: true,
|
|
211
|
+
};
|
|
220
212
|
},
|
|
213
|
+
watch: {
|
|
214
|
+
prefixIcon: {
|
|
215
|
+
handler(v) {
|
|
216
|
+
this.iPrefixIcon = calcIcon(v);
|
|
217
|
+
},
|
|
218
|
+
immediate: true,
|
|
219
|
+
},
|
|
221
220
|
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
221
|
+
suffixIcon: {
|
|
222
|
+
handler(v) {
|
|
223
|
+
this.iSuffixIcon = calcIcon(v);
|
|
224
|
+
},
|
|
225
|
+
immediate: true,
|
|
225
226
|
},
|
|
226
|
-
immediate: true,
|
|
227
|
-
},
|
|
228
227
|
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
228
|
+
clearable: {
|
|
229
|
+
handler(v) {
|
|
230
|
+
this.iClearIcon = calcIcon(v, 'close-circle-filled');
|
|
231
|
+
},
|
|
232
|
+
immediate: true,
|
|
232
233
|
},
|
|
233
|
-
immediate: true,
|
|
234
|
-
},
|
|
235
234
|
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
235
|
+
clearTrigger: 'updateClearIconVisible',
|
|
236
|
+
disabled: 'updateClearIconVisible',
|
|
237
|
+
readonly: 'updateClearIconVisible',
|
|
239
238
|
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
this.dataValue = v;
|
|
243
|
-
nextTick().then(() => {
|
|
239
|
+
value: {
|
|
240
|
+
handler(v) {
|
|
244
241
|
this.dataValue = v;
|
|
242
|
+
nextTick().then(() => {
|
|
243
|
+
this.dataValue = v;
|
|
245
244
|
|
|
246
|
-
|
|
245
|
+
if (this[RELATION_MAP.FormKey]
|
|
247
246
|
&& this[RELATION_MAP.FormKey].onValueChange) {
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
247
|
+
this[RELATION_MAP.FormKey].onValueChange(v);
|
|
248
|
+
}
|
|
249
|
+
});
|
|
250
|
+
},
|
|
251
251
|
},
|
|
252
252
|
},
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
this.updateValue(coalesce(value, defaultValue, ''));
|
|
253
|
+
mounted() {
|
|
254
|
+
const { value, defaultValue } = this;
|
|
255
|
+
this.updateValue(coalesce(value, defaultValue, ''));
|
|
257
256
|
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
257
|
+
this.updateClearIconVisible();
|
|
258
|
+
},
|
|
259
|
+
methods: {
|
|
260
|
+
getInputClass,
|
|
261
|
+
updateValue(value) {
|
|
263
262
|
// this.rawValue = value;
|
|
264
|
-
|
|
263
|
+
this.dataValue = value;
|
|
265
264
|
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
265
|
+
const { allowInputOverMax, maxcharacter, maxlength } = this;
|
|
266
|
+
if (!allowInputOverMax && maxcharacter && maxcharacter > 0 && !Number.isNaN(maxcharacter)) {
|
|
267
|
+
const { length, characters } = getCharacterLength('maxcharacter', value, maxcharacter);
|
|
268
|
+
nextTick().then(() => {
|
|
269
|
+
this.dataValue = characters;
|
|
270
|
+
});
|
|
271
|
+
this.count = length;
|
|
272
|
+
} else if (!allowInputOverMax && maxlength && maxlength > 0 && !Number.isNaN(maxlength)) {
|
|
273
|
+
const { length, characters } = getCharacterLength('maxlength', value, maxlength);
|
|
274
|
+
nextTick().then(() => {
|
|
275
|
+
this.dataValue = characters;
|
|
276
|
+
});
|
|
277
|
+
this.count = length;
|
|
278
|
+
} else {
|
|
279
|
+
nextTick().then(() => {
|
|
280
|
+
this.dataValue = value;
|
|
281
|
+
});
|
|
281
282
|
this.dataValue = value;
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
this.count = isDef(value) ? String(value).length : 0;
|
|
285
|
-
}
|
|
283
|
+
this.count = isDef(value) ? String(value).length : 0;
|
|
284
|
+
}
|
|
286
285
|
|
|
287
286
|
// this.updateInnerMaxLen();
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
287
|
+
},
|
|
288
|
+
// updateInnerMaxLen() {
|
|
289
|
+
// this.innerMaxLen = this.getInnerMaxLen();
|
|
290
|
+
// },
|
|
291
|
+
// getInnerMaxLen() {
|
|
292
|
+
// const {
|
|
293
|
+
// allowInputOverMax,
|
|
294
|
+
// maxcharacter,
|
|
295
|
+
// maxlength,
|
|
296
|
+
// dataValue,
|
|
297
|
+
// rawValue,
|
|
298
|
+
// count,
|
|
299
|
+
// } = this;
|
|
300
|
+
// return getInnerMaxLen({
|
|
301
|
+
// allowInputOverMax,
|
|
302
|
+
// maxcharacter,
|
|
303
|
+
// maxlength,
|
|
304
|
+
// dataValue,
|
|
305
|
+
// rawValue,
|
|
306
|
+
// count,
|
|
307
|
+
// });
|
|
308
|
+
// },
|
|
310
309
|
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
310
|
+
updateClearIconVisible(value = false) {
|
|
311
|
+
const { clearTrigger, disabled, readonly } = this;
|
|
312
|
+
if (disabled || readonly) {
|
|
313
|
+
this.showClearIcon = false;
|
|
314
|
+
return;
|
|
315
|
+
}
|
|
316
|
+
this.showClearIcon = value || clearTrigger === 'always';
|
|
317
|
+
},
|
|
319
318
|
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
319
|
+
onInput(e) {
|
|
320
|
+
const { value, cursor, keyCode } = e.detail;
|
|
321
|
+
this.updateValue(value);
|
|
322
|
+
this.emitChange({ value: this.dataValue, cursor, keyCode });
|
|
323
|
+
},
|
|
325
324
|
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
325
|
+
onChange(e) {
|
|
326
|
+
if (this.type !== 'nickname') return;
|
|
327
|
+
const { value } = e.detail;
|
|
328
|
+
this.updateValue(value);
|
|
329
|
+
this.emitChange({ value: this.dataValue });
|
|
330
|
+
},
|
|
332
331
|
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
332
|
+
emitChange(data) {
|
|
333
|
+
this.$emit('change', data);
|
|
334
|
+
this.$emit('update:value', data.value);
|
|
335
|
+
},
|
|
337
336
|
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
337
|
+
onFocus(e) {
|
|
338
|
+
this.updateClearIconVisible(true);
|
|
339
|
+
this.$emit('focus', e.detail);
|
|
340
|
+
},
|
|
342
341
|
|
|
343
|
-
|
|
344
|
-
|
|
342
|
+
onBlur(e) {
|
|
343
|
+
this.updateClearIconVisible();
|
|
345
344
|
|
|
346
|
-
|
|
345
|
+
if (this[RELATION_MAP.FormKey]
|
|
347
346
|
&& this[RELATION_MAP.FormKey].onBlur) {
|
|
348
|
-
|
|
349
|
-
|
|
347
|
+
this[RELATION_MAP.FormKey].onBlur(this.dataValue);
|
|
348
|
+
}
|
|
350
349
|
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
350
|
+
// 失焦时处理 format
|
|
351
|
+
if (typeof this.format === 'function') {
|
|
352
|
+
const v = this.format(e.detail.value);
|
|
353
|
+
this.updateValue(v);
|
|
354
|
+
this.$emit('blur', { value: this.dataValue, cursor: this.count });
|
|
355
|
+
return;
|
|
356
|
+
}
|
|
357
|
+
this.$emit('blur', e.detail);
|
|
358
|
+
},
|
|
360
359
|
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
360
|
+
onConfirm(e) {
|
|
361
|
+
this.$emit('enter', e.detail);
|
|
362
|
+
},
|
|
364
363
|
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
364
|
+
onSuffixClick() {
|
|
365
|
+
this.$emit('click', { trigger: 'suffix' });
|
|
366
|
+
},
|
|
368
367
|
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
368
|
+
onSuffixIconClick() {
|
|
369
|
+
this.$emit('click', { trigger: 'suffix-icon' });
|
|
370
|
+
},
|
|
372
371
|
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
372
|
+
clearInput(e) {
|
|
373
|
+
this.$emit('clear', e.detail);
|
|
374
|
+
this.dataValue = '';
|
|
375
|
+
},
|
|
377
376
|
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
377
|
+
onKeyboardHeightChange(e) {
|
|
378
|
+
this.$emit('keyboardheightchange', e.detail);
|
|
379
|
+
},
|
|
381
380
|
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
381
|
+
onNickNameReview(e) {
|
|
382
|
+
this.$emit('nicknamereview', e.detail);
|
|
383
|
+
},
|
|
385
384
|
|
|
386
|
-
|
|
387
|
-
|
|
385
|
+
onClick() {
|
|
386
|
+
this.$emit('click', { trigger: 'input' });
|
|
387
|
+
},
|
|
388
388
|
},
|
|
389
|
-
},
|
|
390
|
-
}
|
|
389
|
+
}),
|
|
390
|
+
};
|
|
391
391
|
|
|
392
392
|
</script>
|
|
393
393
|
<style scoped src="./input.css"></style>
|
package/dist/input/props.ts
CHANGED
|
@@ -70,8 +70,8 @@ export default {
|
|
|
70
70
|
},
|
|
71
71
|
/** 是否禁用输入框 */
|
|
72
72
|
disabled: {
|
|
73
|
-
type: Boolean,
|
|
74
|
-
default:
|
|
73
|
+
type: [Boolean, null],
|
|
74
|
+
default: null as TdInputProps['disabled'],
|
|
75
75
|
},
|
|
76
76
|
/** 获取焦点 */
|
|
77
77
|
focus: Boolean,
|
|
@@ -105,8 +105,8 @@ export default {
|
|
|
105
105
|
},
|
|
106
106
|
/** 占位符 */
|
|
107
107
|
placeholder: {
|
|
108
|
-
type: String,
|
|
109
|
-
default:
|
|
108
|
+
type: [String, null],
|
|
109
|
+
default: null as TdInputProps['placeholder'],
|
|
110
110
|
},
|
|
111
111
|
/** 指定 placeholder 的样式类 */
|
|
112
112
|
placeholderClass: {
|
|
@@ -124,8 +124,8 @@ export default {
|
|
|
124
124
|
},
|
|
125
125
|
/** 只读状态 */
|
|
126
126
|
readonly: {
|
|
127
|
-
type: Boolean,
|
|
128
|
-
default:
|
|
127
|
+
type: [Boolean, null],
|
|
128
|
+
default: null as TdInputProps['readonly'],
|
|
129
129
|
},
|
|
130
130
|
/** 安全键盘加密公钥的路径,只支持包内路径 */
|
|
131
131
|
safePasswordCertPath: {
|
package/dist/input/type.ts
CHANGED
|
@@ -73,7 +73,7 @@ export interface TdInputProps {
|
|
|
73
73
|
/**
|
|
74
74
|
* 是否禁用输入框
|
|
75
75
|
*/
|
|
76
|
-
disabled?: boolean;
|
|
76
|
+
disabled?: boolean | null;
|
|
77
77
|
/**
|
|
78
78
|
* 获取焦点
|
|
79
79
|
* @default false
|
|
@@ -109,7 +109,7 @@ export interface TdInputProps {
|
|
|
109
109
|
/**
|
|
110
110
|
* 占位符
|
|
111
111
|
*/
|
|
112
|
-
placeholder?: string;
|
|
112
|
+
placeholder?: string | null;
|
|
113
113
|
/**
|
|
114
114
|
* 指定 placeholder 的样式类
|
|
115
115
|
* @default input-placeholder
|
|
@@ -127,7 +127,7 @@ export interface TdInputProps {
|
|
|
127
127
|
/**
|
|
128
128
|
* 只读状态
|
|
129
129
|
*/
|
|
130
|
-
readonly?: boolean;
|
|
130
|
+
readonly?: boolean | null;
|
|
131
131
|
/**
|
|
132
132
|
* 安全键盘加密公钥的路径,只支持包内路径
|
|
133
133
|
* @default ''
|