@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.
- package/CHANGELOG.md +9 -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 +24 -7
- package/dist/action-sheet/computed.js +14 -0
- package/dist/action-sheet/type.ts +2 -2
- package/dist/button/README.en-US.md +5 -2
- package/dist/button/README.md +5 -2
- package/dist/button/button.vue +3 -0
- package/dist/button/props.ts +14 -0
- package/dist/button/type.ts +14 -0
- package/dist/cascader/cascader.vue +8 -4
- package/dist/common/src/instantiationDecorator.js +8 -0
- package/dist/common/style/theme/index.css +42 -90
- package/dist/grid-item/grid-item.vue +2 -2
- package/dist/guide/guide.vue +22 -32
- package/dist/icon/icon.vue +1 -1
- package/dist/indexes/indexes.vue +8 -8
- package/dist/popup/popup.vue +1 -1
- package/dist/radio/radio.vue +5 -5
- package/dist/result/result.vue +12 -12
- package/dist/search/README.en-US.md +1 -1
- package/dist/search/README.md +1 -1
- package/dist/search/search.vue +14 -7
- package/dist/search/type.ts +1 -1
- package/dist/slider/slider.vue +17 -17
- package/dist/upload/props.ts +1 -1
- package/package.json +3 -1
- package/dist/.eslintrc.js +0 -30
- package/dist/tsconfig.eslint.json +0 -13
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 {
|
|
@@ -214,7 +213,10 @@ export default uniComponent({
|
|
|
214
213
|
|
|
215
214
|
nextTick().then(() => {
|
|
216
215
|
this.dataValue = value;
|
|
217
|
-
this.$emit('change', {
|
|
216
|
+
this.$emit('change', {
|
|
217
|
+
value,
|
|
218
|
+
trigger: 'input-change',
|
|
219
|
+
});
|
|
218
220
|
});
|
|
219
221
|
// this.updateInnerMaxLen();
|
|
220
222
|
},
|
|
@@ -234,7 +236,10 @@ export default uniComponent({
|
|
|
234
236
|
handleClear() {
|
|
235
237
|
this.dataValue = '';
|
|
236
238
|
this.$emit('clear', { value: '' });
|
|
237
|
-
this.$emit('change', {
|
|
239
|
+
this.$emit('change', {
|
|
240
|
+
value: '',
|
|
241
|
+
trigger: 'clear',
|
|
242
|
+
});
|
|
238
243
|
},
|
|
239
244
|
|
|
240
245
|
onConfirm(e) {
|
|
@@ -246,13 +251,15 @@ export default uniComponent({
|
|
|
246
251
|
this.$emit('action-click');
|
|
247
252
|
},
|
|
248
253
|
|
|
249
|
-
|
|
254
|
+
onSelectOption(tools, { index }) {
|
|
250
255
|
const item = this.resultList[index];
|
|
251
256
|
this.dataValue = item;
|
|
252
257
|
this.isSelected = true;
|
|
253
258
|
|
|
254
|
-
this.$emit('change', {
|
|
255
|
-
|
|
259
|
+
this.$emit('change', {
|
|
260
|
+
value: item,
|
|
261
|
+
trigger: 'option-click',
|
|
262
|
+
});
|
|
256
263
|
},
|
|
257
264
|
highLight,
|
|
258
265
|
// updateInnerMaxLen() {
|
package/dist/search/type.ts
CHANGED
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 {
|
package/dist/upload/props.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tdesign/uniapp",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.1",
|
|
4
4
|
"id": "tdesign-uniapp",
|
|
5
5
|
"title": "tdesign-uniapp",
|
|
6
6
|
"description": "TDesign Component for UniApp",
|
|
7
|
+
"author": "tdesign",
|
|
8
|
+
"license": "MIT",
|
|
7
9
|
"keywords": [
|
|
8
10
|
"tdesign",
|
|
9
11
|
"miniprogram",
|
package/dist/.eslintrc.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
root: true,
|
|
3
|
-
extends: ['eslint-config-light-vue3'],
|
|
4
|
-
globals: {
|
|
5
|
-
getCurrentPages: true,
|
|
6
|
-
uni: true,
|
|
7
|
-
globalThis: true,
|
|
8
|
-
qq: true,
|
|
9
|
-
weex: true,
|
|
10
|
-
plus: true,
|
|
11
|
-
getApp: true,
|
|
12
|
-
},
|
|
13
|
-
parserOptions: {
|
|
14
|
-
project: 'tsconfig.eslint.json',
|
|
15
|
-
tsconfigRootDir: __dirname,
|
|
16
|
-
|
|
17
|
-
ecmaVersion: 'latest',
|
|
18
|
-
extraFileExtensions: ['.vue'],
|
|
19
|
-
},
|
|
20
|
-
rules: {
|
|
21
|
-
'vue/no-v-text-v-html-on-component': 0,
|
|
22
|
-
'vue/component-name-in-template-casing': [
|
|
23
|
-
2,
|
|
24
|
-
'kebab-case',
|
|
25
|
-
{
|
|
26
|
-
registeredComponentsOnly: true,
|
|
27
|
-
},
|
|
28
|
-
],
|
|
29
|
-
},
|
|
30
|
-
};
|