@tarojs/components 3.6.6 → 3.6.7-alpha.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/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/taro-components.cjs.js +1 -1
- package/dist/cjs/taro-input-core.cjs.entry.js +5 -5
- package/dist/cjs/taro-picker-core_2.cjs.entry.js +20 -13
- package/dist/cjs/taro-rich-text-core.cjs.entry.js +6 -0
- package/dist/cjs/taro-text-core.cjs.entry.js +9 -6
- package/dist/collection/components/checkbox/checkbox.js +4 -4
- package/dist/collection/components/input/input.js +5 -5
- package/dist/collection/components/picker/picker-group.js +29 -26
- package/dist/collection/components/picker/picker.js +34 -8
- package/dist/collection/components/rich-text/rich-text.js +71 -0
- package/dist/collection/components/rich-text/style/index.css +16 -0
- package/dist/collection/components/text/style/index.css +20 -3
- package/dist/collection/components/text/text.js +66 -6
- package/dist/components/picker-group.js +9 -9
- package/dist/components/taro-checkbox-core.js +1 -1
- package/dist/components/taro-input-core.js +5 -5
- package/dist/components/taro-picker-core.js +14 -7
- package/dist/components/taro-rich-text-core.js +10 -1
- package/dist/components/taro-text-core.js +13 -7
- package/dist/esm/loader.js +1 -1
- package/dist/esm/taro-components.js +1 -1
- package/dist/esm/taro-input-core.entry.js +5 -5
- package/dist/esm/taro-picker-core_2.entry.js +20 -13
- package/dist/esm/taro-rich-text-core.entry.js +6 -0
- package/dist/esm/taro-text-core.entry.js +9 -6
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/taro-components.js +1 -1
- package/dist/esm-es5/taro-input-core.entry.js +1 -1
- package/dist/esm-es5/taro-picker-core_2.entry.js +1 -1
- package/dist/esm-es5/taro-rich-text-core.entry.js +1 -1
- package/dist/esm-es5/taro-text-core.entry.js +1 -1
- package/dist/taro-components/{p-030715f1.system.entry.js → p-01e163f8.system.entry.js} +1 -1
- package/dist/taro-components/p-0944cb46.system.entry.js +1 -0
- package/dist/taro-components/p-0fa96970.entry.js +1 -0
- package/dist/taro-components/p-425c209a.entry.js +1 -0
- package/dist/taro-components/p-468245ea.entry.js +1 -0
- package/dist/taro-components/p-9edea30f.system.entry.js +1 -0
- package/dist/taro-components/p-e09451c5.system.entry.js +1 -0
- package/dist/taro-components/{p-98d771c3.entry.js → p-ebc7b6fc.entry.js} +1 -1
- package/dist/taro-components/p-ed331c06.system.js +1 -1
- package/dist/taro-components/taro-components.esm.js +1 -1
- package/dist/types/components/checkbox/checkbox.d.ts +1 -1
- package/dist/types/components/input/input.d.ts +1 -1
- package/dist/types/components/picker/picker-group.d.ts +3 -3
- package/dist/types/components/picker/picker.d.ts +6 -1
- package/dist/types/components/rich-text/rich-text.d.ts +4 -0
- package/dist/types/components/text/text.d.ts +4 -0
- package/dist/types/components.d.ts +24 -6
- package/lib/react/react-component-lib/utils/attachProps.js +1 -4
- package/lib/react/react-component-lib/utils/attachProps.js.map +1 -1
- package/lib/vue2/components.d.ts +8 -2
- package/lib/vue2/components.js +11 -5
- package/lib/vue2/components.js.map +1 -1
- package/lib/vue3/components.js +11 -4
- package/lib/vue3/components.js.map +1 -1
- package/package.json +4 -4
- package/types/Button.d.ts +3 -1
- package/types/Picker.d.ts +9 -0
- package/types/RichText.d.ts +6 -4
- package/types/Text.d.ts +4 -3
- package/types/Textarea.d.ts +4 -2
- package/dist/taro-components/p-5b67a98e.entry.js +0 -1
- package/dist/taro-components/p-8414da06.system.entry.js +0 -1
- package/dist/taro-components/p-af2cd702.entry.js +0 -1
- package/dist/taro-components/p-c43c5e89.system.entry.js +0 -1
- package/dist/taro-components/p-ed011ff9.entry.js +0 -1
- package/dist/taro-components/p-fa43177b.system.entry.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Host, h } from '@stencil/core';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
3
|
import { hoursRange, minutesRange, compareTime, verifyValue, verifyTime, verifyDate, getYearRange, getMonthRange, getDayRange, formatValue } from './utils';
|
|
4
4
|
import { TOP, LINE_HEIGHT } from './constant';
|
|
@@ -74,6 +74,13 @@ export class Picker {
|
|
|
74
74
|
value
|
|
75
75
|
});
|
|
76
76
|
};
|
|
77
|
+
this.handleColumnChange = (e) => {
|
|
78
|
+
const { columnId, height } = e.detail;
|
|
79
|
+
this.onColumnChange.emit({
|
|
80
|
+
column: Number(columnId),
|
|
81
|
+
value: (TOP - height) / LINE_HEIGHT
|
|
82
|
+
});
|
|
83
|
+
};
|
|
77
84
|
// 点击取消按钮或蒙层
|
|
78
85
|
this.handleCancel = () => {
|
|
79
86
|
this.hidePicker();
|
|
@@ -111,12 +118,6 @@ export class Picker {
|
|
|
111
118
|
}
|
|
112
119
|
}
|
|
113
120
|
};
|
|
114
|
-
this.handleColumnChange = (height, columnId) => {
|
|
115
|
-
this.onColumnChange.emit({
|
|
116
|
-
column: Number(columnId),
|
|
117
|
-
value: (TOP - height) / LINE_HEIGHT
|
|
118
|
-
});
|
|
119
|
-
};
|
|
120
121
|
this.updateDay = (value, fields) => {
|
|
121
122
|
const { _start, _end, _updateValue } = this.pickerDate;
|
|
122
123
|
_updateValue[fields] = value;
|
|
@@ -202,6 +203,7 @@ export class Picker {
|
|
|
202
203
|
this.end = '';
|
|
203
204
|
this.fields = 'day';
|
|
204
205
|
this.name = '';
|
|
206
|
+
this.textProps = {};
|
|
205
207
|
this.pickerValue = [];
|
|
206
208
|
this.height = [];
|
|
207
209
|
this.hidden = true;
|
|
@@ -291,6 +293,9 @@ export class Picker {
|
|
|
291
293
|
throw new Error('Date Interval Error');
|
|
292
294
|
}
|
|
293
295
|
}
|
|
296
|
+
else {
|
|
297
|
+
throw new Error(`Picker not support "${mode}" mode.`);
|
|
298
|
+
}
|
|
294
299
|
// Prop 变化时,无论是否正在显示弹层,都更新 height 值
|
|
295
300
|
this.height = this.getHeightByIndex();
|
|
296
301
|
// 同步表单 value 值,用于 form submit
|
|
@@ -306,6 +311,7 @@ export class Picker {
|
|
|
306
311
|
}
|
|
307
312
|
}
|
|
308
313
|
render() {
|
|
314
|
+
var _a, _b;
|
|
309
315
|
const { name, mode, fadeOut, hidden } = this;
|
|
310
316
|
// 选项条
|
|
311
317
|
let pickerGroup;
|
|
@@ -330,7 +336,7 @@ export class Picker {
|
|
|
330
336
|
'weui-animate-slide-down': fadeOut
|
|
331
337
|
});
|
|
332
338
|
const shouldDivHidden = hidden ? { display: 'none' } : {};
|
|
333
|
-
return (h(Host, null, h("div", { onClick: this.showPicker }, h("slot", null), h("input", { type: 'hidden', name: name, value: formatValue(this.pickerValue) })), h("div", { class: 'weui-picker__overlay', style: shouldDivHidden, ref: el => { this.overlay = el; } }, h("div", { class: clsMask, onClick: this.handleCancel }), h("div", { class: clsSlider }, h("div", { class: 'weui-picker__hd' }, h("div", { class: 'weui-picker__action', onClick: this.handleCancel },
|
|
339
|
+
return (h(Host, null, h("div", { onClick: this.showPicker }, h("slot", null), h("input", { type: 'hidden', name: name, value: formatValue(this.pickerValue) })), h("div", { class: 'weui-picker__overlay', style: shouldDivHidden, ref: el => { this.overlay = el; } }, h("div", { class: clsMask, onClick: this.handleCancel }), h("div", { class: clsSlider }, h("div", { class: 'weui-picker__hd' }, h("div", { class: 'weui-picker__action', onClick: this.handleCancel }, (_a = this.textProps.cancelText) !== null && _a !== void 0 ? _a : '取消'), h("div", { class: 'weui-picker__action', onClick: this.handleChange }, (_b = this.textProps.okText) !== null && _b !== void 0 ? _b : '确定')), h("div", { class: 'weui-picker__bd' }, pickerGroup), h("input", { type: 'hidden', name: name, value: formatValue(this.pickerValue) })))));
|
|
334
340
|
}
|
|
335
341
|
static get is() { return "taro-picker-core"; }
|
|
336
342
|
static get originalStyleUrls() {
|
|
@@ -514,6 +520,26 @@ export class Picker {
|
|
|
514
520
|
"attribute": "name",
|
|
515
521
|
"reflect": false,
|
|
516
522
|
"defaultValue": "''"
|
|
523
|
+
},
|
|
524
|
+
"textProps": {
|
|
525
|
+
"type": "unknown",
|
|
526
|
+
"mutable": false,
|
|
527
|
+
"complexType": {
|
|
528
|
+
"original": "PickerText",
|
|
529
|
+
"resolved": "PickerText",
|
|
530
|
+
"references": {
|
|
531
|
+
"PickerText": {
|
|
532
|
+
"location": "local"
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
},
|
|
536
|
+
"required": false,
|
|
537
|
+
"optional": false,
|
|
538
|
+
"docs": {
|
|
539
|
+
"tags": [],
|
|
540
|
+
"text": ""
|
|
541
|
+
},
|
|
542
|
+
"defaultValue": "{}"
|
|
517
543
|
}
|
|
518
544
|
};
|
|
519
545
|
}
|
|
@@ -48,6 +48,9 @@ export class RichText {
|
|
|
48
48
|
return null;
|
|
49
49
|
};
|
|
50
50
|
this.nodes = undefined;
|
|
51
|
+
this.selectable = false;
|
|
52
|
+
this.userSelect = false;
|
|
53
|
+
this.space = undefined;
|
|
51
54
|
}
|
|
52
55
|
render() {
|
|
53
56
|
const { nodes, renderNode } = this;
|
|
@@ -59,6 +62,16 @@ export class RichText {
|
|
|
59
62
|
}
|
|
60
63
|
}
|
|
61
64
|
static get is() { return "taro-rich-text-core"; }
|
|
65
|
+
static get originalStyleUrls() {
|
|
66
|
+
return {
|
|
67
|
+
"$": ["./style/index.scss"]
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
static get styleUrls() {
|
|
71
|
+
return {
|
|
72
|
+
"$": ["./style/index.css"]
|
|
73
|
+
};
|
|
74
|
+
}
|
|
62
75
|
static get properties() {
|
|
63
76
|
return {
|
|
64
77
|
"nodes": {
|
|
@@ -81,6 +94,64 @@ export class RichText {
|
|
|
81
94
|
},
|
|
82
95
|
"attribute": "nodes",
|
|
83
96
|
"reflect": false
|
|
97
|
+
},
|
|
98
|
+
"selectable": {
|
|
99
|
+
"type": "boolean",
|
|
100
|
+
"mutable": true,
|
|
101
|
+
"complexType": {
|
|
102
|
+
"original": "boolean",
|
|
103
|
+
"resolved": "boolean",
|
|
104
|
+
"references": {}
|
|
105
|
+
},
|
|
106
|
+
"required": false,
|
|
107
|
+
"optional": false,
|
|
108
|
+
"docs": {
|
|
109
|
+
"tags": [],
|
|
110
|
+
"text": ""
|
|
111
|
+
},
|
|
112
|
+
"attribute": "selectable",
|
|
113
|
+
"reflect": false,
|
|
114
|
+
"defaultValue": "false"
|
|
115
|
+
},
|
|
116
|
+
"userSelect": {
|
|
117
|
+
"type": "boolean",
|
|
118
|
+
"mutable": true,
|
|
119
|
+
"complexType": {
|
|
120
|
+
"original": "boolean",
|
|
121
|
+
"resolved": "boolean",
|
|
122
|
+
"references": {}
|
|
123
|
+
},
|
|
124
|
+
"required": false,
|
|
125
|
+
"optional": false,
|
|
126
|
+
"docs": {
|
|
127
|
+
"tags": [],
|
|
128
|
+
"text": ""
|
|
129
|
+
},
|
|
130
|
+
"attribute": "user-select",
|
|
131
|
+
"reflect": false,
|
|
132
|
+
"defaultValue": "false"
|
|
133
|
+
},
|
|
134
|
+
"space": {
|
|
135
|
+
"type": "string",
|
|
136
|
+
"mutable": false,
|
|
137
|
+
"complexType": {
|
|
138
|
+
"original": "keyof TextProps.TSpace",
|
|
139
|
+
"resolved": "\"emsp\" | \"ensp\" | \"nbsp\" | undefined",
|
|
140
|
+
"references": {
|
|
141
|
+
"TextProps": {
|
|
142
|
+
"location": "import",
|
|
143
|
+
"path": "types"
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
"required": false,
|
|
148
|
+
"optional": true,
|
|
149
|
+
"docs": {
|
|
150
|
+
"tags": [],
|
|
151
|
+
"text": ""
|
|
152
|
+
},
|
|
153
|
+
"attribute": "space",
|
|
154
|
+
"reflect": false
|
|
84
155
|
}
|
|
85
156
|
};
|
|
86
157
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
taro-rich-text-core {
|
|
2
|
+
user-select: none;
|
|
3
|
+
}
|
|
4
|
+
taro-rich-text-core[selectable=true], taro-rich-text-core[user-select=true] {
|
|
5
|
+
display: block;
|
|
6
|
+
user-select: text;
|
|
7
|
+
}
|
|
8
|
+
taro-rich-text-core[space] {
|
|
9
|
+
white-space: pre-wrap;
|
|
10
|
+
}
|
|
11
|
+
taro-rich-text-core[space=ensp] {
|
|
12
|
+
word-spacing: 0.5em;
|
|
13
|
+
}
|
|
14
|
+
taro-rich-text-core[space=nbsp] {
|
|
15
|
+
word-spacing: 1em;
|
|
16
|
+
}
|
|
@@ -1,9 +1,26 @@
|
|
|
1
1
|
taro-text-core {
|
|
2
2
|
display: inline;
|
|
3
3
|
user-select: none;
|
|
4
|
-
white-space: pre-wrap;
|
|
5
4
|
}
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
taro-text-core[selectable=true], taro-text-core[user-select=true] {
|
|
6
|
+
display: inline-block;
|
|
8
7
|
user-select: text;
|
|
8
|
+
}
|
|
9
|
+
taro-text-core[space] {
|
|
10
|
+
white-space: pre-wrap;
|
|
11
|
+
}
|
|
12
|
+
taro-text-core[space=ensp] {
|
|
13
|
+
word-spacing: 0.5em;
|
|
14
|
+
}
|
|
15
|
+
taro-text-core[space=nbsp] {
|
|
16
|
+
word-spacing: 1em;
|
|
17
|
+
}
|
|
18
|
+
taro-text-core[number-of-lines] {
|
|
19
|
+
--line-clamp: 2;
|
|
20
|
+
display: -webkit-box;
|
|
21
|
+
-webkit-box-orient: vertical;
|
|
22
|
+
word-wrap: break-word;
|
|
23
|
+
overflow: hidden;
|
|
24
|
+
text-overflow: ellipsis;
|
|
25
|
+
-webkit-line-clamp: var(--line-clamp);
|
|
9
26
|
}
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import { h, Host } from '@stencil/core';
|
|
2
|
-
import classNames from 'classnames';
|
|
3
2
|
export class Text {
|
|
4
3
|
constructor() {
|
|
5
4
|
this.selectable = false;
|
|
5
|
+
this.userSelect = false;
|
|
6
|
+
this.space = undefined;
|
|
7
|
+
this.numberOfLines = undefined;
|
|
6
8
|
}
|
|
7
9
|
render() {
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
const style = {};
|
|
11
|
+
if (typeof this.numberOfLines === 'number') {
|
|
12
|
+
style['--line-clamp'] = this.numberOfLines;
|
|
13
|
+
}
|
|
14
|
+
return (h(Host, { style: style }, h("slot", null)));
|
|
12
15
|
}
|
|
13
16
|
static get is() { return "taro-text-core"; }
|
|
14
17
|
static get originalStyleUrls() {
|
|
@@ -25,7 +28,7 @@ export class Text {
|
|
|
25
28
|
return {
|
|
26
29
|
"selectable": {
|
|
27
30
|
"type": "boolean",
|
|
28
|
-
"mutable":
|
|
31
|
+
"mutable": true,
|
|
29
32
|
"complexType": {
|
|
30
33
|
"original": "boolean",
|
|
31
34
|
"resolved": "boolean",
|
|
@@ -40,6 +43,63 @@ export class Text {
|
|
|
40
43
|
"attribute": "selectable",
|
|
41
44
|
"reflect": false,
|
|
42
45
|
"defaultValue": "false"
|
|
46
|
+
},
|
|
47
|
+
"userSelect": {
|
|
48
|
+
"type": "boolean",
|
|
49
|
+
"mutable": true,
|
|
50
|
+
"complexType": {
|
|
51
|
+
"original": "boolean",
|
|
52
|
+
"resolved": "boolean",
|
|
53
|
+
"references": {}
|
|
54
|
+
},
|
|
55
|
+
"required": false,
|
|
56
|
+
"optional": false,
|
|
57
|
+
"docs": {
|
|
58
|
+
"tags": [],
|
|
59
|
+
"text": ""
|
|
60
|
+
},
|
|
61
|
+
"attribute": "user-select",
|
|
62
|
+
"reflect": false,
|
|
63
|
+
"defaultValue": "false"
|
|
64
|
+
},
|
|
65
|
+
"space": {
|
|
66
|
+
"type": "string",
|
|
67
|
+
"mutable": true,
|
|
68
|
+
"complexType": {
|
|
69
|
+
"original": "keyof TextProps.TSpace",
|
|
70
|
+
"resolved": "\"emsp\" | \"ensp\" | \"nbsp\" | undefined",
|
|
71
|
+
"references": {
|
|
72
|
+
"TextProps": {
|
|
73
|
+
"location": "import",
|
|
74
|
+
"path": "types"
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
"required": false,
|
|
79
|
+
"optional": true,
|
|
80
|
+
"docs": {
|
|
81
|
+
"tags": [],
|
|
82
|
+
"text": ""
|
|
83
|
+
},
|
|
84
|
+
"attribute": "space",
|
|
85
|
+
"reflect": false
|
|
86
|
+
},
|
|
87
|
+
"numberOfLines": {
|
|
88
|
+
"type": "number",
|
|
89
|
+
"mutable": false,
|
|
90
|
+
"complexType": {
|
|
91
|
+
"original": "number",
|
|
92
|
+
"resolved": "number | undefined",
|
|
93
|
+
"references": {}
|
|
94
|
+
},
|
|
95
|
+
"required": false,
|
|
96
|
+
"optional": true,
|
|
97
|
+
"docs": {
|
|
98
|
+
"tags": [],
|
|
99
|
+
"text": ""
|
|
100
|
+
},
|
|
101
|
+
"attribute": "number-of-lines",
|
|
102
|
+
"reflect": false
|
|
43
103
|
}
|
|
44
104
|
};
|
|
45
105
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
1
|
+
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
2
|
|
|
3
3
|
const TOP = 102;
|
|
4
4
|
const LINE_HEIGHT = 34;
|
|
@@ -8,13 +8,13 @@ const TaroPickerGroup = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
8
8
|
constructor() {
|
|
9
9
|
super();
|
|
10
10
|
this.__registerHost();
|
|
11
|
+
this.onColumnChange = createEvent(this, "columnChange", 7);
|
|
11
12
|
this.mode = undefined;
|
|
12
13
|
this.range = [];
|
|
13
14
|
this.rangeKey = undefined;
|
|
14
15
|
this.height = undefined;
|
|
15
16
|
this.columnId = undefined;
|
|
16
17
|
this.updateHeight = undefined;
|
|
17
|
-
this.onColumnChange = undefined;
|
|
18
18
|
this.updateDay = undefined;
|
|
19
19
|
this.startY = undefined;
|
|
20
20
|
this.preY = undefined;
|
|
@@ -84,7 +84,7 @@ const TaroPickerGroup = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
84
84
|
this.updateHeight(newPos, this.columnId);
|
|
85
85
|
}
|
|
86
86
|
async handleMoveEnd(clientY) {
|
|
87
|
-
const { mode, range, height, updateHeight,
|
|
87
|
+
const { mode, range, height, updateHeight, columnId } = this;
|
|
88
88
|
const max = 0;
|
|
89
89
|
const min = -LINE_HEIGHT * (range.length - 1);
|
|
90
90
|
const endY = clientY;
|
|
@@ -135,7 +135,7 @@ const TaroPickerGroup = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
135
135
|
// 先按公式算出 index, 再用此 index 算出一个整数高度
|
|
136
136
|
const index = Math.round(absoluteHeight / -LINE_HEIGHT);
|
|
137
137
|
const relativeHeight = TOP - LINE_HEIGHT * index;
|
|
138
|
-
if (this.mode === 'date') {
|
|
138
|
+
if (this.mode === 'date' && typeof this.updateDay === 'function') {
|
|
139
139
|
if (this.columnId === '0') {
|
|
140
140
|
this.updateDay(+this.range[index].replace(/[^0-9]/gi, ''), 0);
|
|
141
141
|
}
|
|
@@ -147,14 +147,16 @@ const TaroPickerGroup = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
147
147
|
}
|
|
148
148
|
}
|
|
149
149
|
updateHeight(relativeHeight, columnId, mode === 'time');
|
|
150
|
-
onColumnChange
|
|
150
|
+
this.onColumnChange.emit({
|
|
151
|
+
columnId,
|
|
152
|
+
height: relativeHeight,
|
|
153
|
+
});
|
|
151
154
|
}
|
|
152
155
|
onMouseDown(e) {
|
|
153
156
|
this.isMove = true;
|
|
154
157
|
this.handleMoveStart(e.clientY);
|
|
155
158
|
}
|
|
156
159
|
onMouseMove(e) {
|
|
157
|
-
e.preventDefault();
|
|
158
160
|
if (!this.isMove)
|
|
159
161
|
return;
|
|
160
162
|
this.handleMoving(e.clientY);
|
|
@@ -169,7 +171,6 @@ const TaroPickerGroup = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
169
171
|
this.handleMoveStart(e.changedTouches[0].clientY);
|
|
170
172
|
}
|
|
171
173
|
onTouchMove(e) {
|
|
172
|
-
e.preventDefault();
|
|
173
174
|
this.handleMoving(e.changedTouches[0].clientY);
|
|
174
175
|
}
|
|
175
176
|
onTouchEnd(e) {
|
|
@@ -190,7 +191,6 @@ const TaroPickerGroup = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
190
191
|
"height": [2],
|
|
191
192
|
"columnId": [1, "column-id"],
|
|
192
193
|
"updateHeight": [16],
|
|
193
|
-
"onColumnChange": [16],
|
|
194
194
|
"updateDay": [16],
|
|
195
195
|
"startY": [32],
|
|
196
196
|
"preY": [32],
|
|
@@ -200,7 +200,7 @@ const TaroPickerGroup = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
200
200
|
"handleMoveStart": [64],
|
|
201
201
|
"handleMoving": [64],
|
|
202
202
|
"handleMoveEnd": [64]
|
|
203
|
-
}, [[1, "mousedown", "onMouseDown"], [
|
|
203
|
+
}, [[1, "mousedown", "onMouseDown"], [3, "mousemove", "onMouseMove"], [1, "mouseup", "onMouseMoveEnd"], [1, "mouseleave", "onMouseMoveEnd"], [1, "touchstart", "onTouchStart"], [3, "touchmove", "onTouchMove"], [1, "touchend", "onTouchEnd"]]]);
|
|
204
204
|
function defineCustomElement() {
|
|
205
205
|
if (typeof customElements === "undefined") {
|
|
206
206
|
return;
|
|
@@ -51,7 +51,7 @@ const Checkbox = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
51
51
|
static get style() { return indexCss; }
|
|
52
52
|
}, [4, "taro-checkbox-core", {
|
|
53
53
|
"name": [1],
|
|
54
|
-
"value": [
|
|
54
|
+
"value": [1032],
|
|
55
55
|
"color": [1],
|
|
56
56
|
"id": [1025],
|
|
57
57
|
"checked": [4],
|
|
@@ -126,7 +126,7 @@ const Input = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
126
126
|
this.isOnComposition = true;
|
|
127
127
|
}
|
|
128
128
|
};
|
|
129
|
-
this.
|
|
129
|
+
this.handleBeforeInput = (e) => {
|
|
130
130
|
if (!e.data)
|
|
131
131
|
return;
|
|
132
132
|
const isNumber = e.data && /[0-9]/.test(e.data);
|
|
@@ -176,8 +176,8 @@ const Input = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
176
176
|
else {
|
|
177
177
|
(_b = this.inputRef) === null || _b === void 0 ? void 0 : _b.addEventListener('compositionstart', this.handleComposition);
|
|
178
178
|
(_c = this.inputRef) === null || _c === void 0 ? void 0 : _c.addEventListener('compositionend', this.handleComposition);
|
|
179
|
-
(_d = this.inputRef) === null || _d === void 0 ? void 0 : _d.addEventListener('beforeinput', this.
|
|
180
|
-
(_e = this.inputRef) === null || _e === void 0 ? void 0 : _e.addEventListener('textInput', this.
|
|
179
|
+
(_d = this.inputRef) === null || _d === void 0 ? void 0 : _d.addEventListener('beforeinput', this.handleBeforeInput);
|
|
180
|
+
(_e = this.inputRef) === null || _e === void 0 ? void 0 : _e.addEventListener('textInput', this.handleBeforeInput);
|
|
181
181
|
}
|
|
182
182
|
}
|
|
183
183
|
disconnectedCallback() {
|
|
@@ -188,8 +188,8 @@ const Input = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
188
188
|
else {
|
|
189
189
|
(_b = this.inputRef) === null || _b === void 0 ? void 0 : _b.removeEventListener('compositionstart', this.handleComposition);
|
|
190
190
|
(_c = this.inputRef) === null || _c === void 0 ? void 0 : _c.removeEventListener('compositionend', this.handleComposition);
|
|
191
|
-
(_d = this.inputRef) === null || _d === void 0 ? void 0 : _d.removeEventListener('beforeinput', this.
|
|
192
|
-
(_e = this.inputRef) === null || _e === void 0 ? void 0 : _e.removeEventListener('textInput', this.
|
|
191
|
+
(_d = this.inputRef) === null || _d === void 0 ? void 0 : _d.removeEventListener('beforeinput', this.handleBeforeInput);
|
|
192
|
+
(_e = this.inputRef) === null || _e === void 0 ? void 0 : _e.removeEventListener('textInput', this.handleBeforeInput);
|
|
193
193
|
}
|
|
194
194
|
}
|
|
195
195
|
render() {
|
|
@@ -224,6 +224,13 @@ const Picker = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
224
224
|
value
|
|
225
225
|
});
|
|
226
226
|
};
|
|
227
|
+
this.handleColumnChange = (e) => {
|
|
228
|
+
const { columnId, height } = e.detail;
|
|
229
|
+
this.onColumnChange.emit({
|
|
230
|
+
column: Number(columnId),
|
|
231
|
+
value: (TOP - height) / LINE_HEIGHT
|
|
232
|
+
});
|
|
233
|
+
};
|
|
227
234
|
// 点击取消按钮或蒙层
|
|
228
235
|
this.handleCancel = () => {
|
|
229
236
|
this.hidePicker();
|
|
@@ -261,12 +268,6 @@ const Picker = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
261
268
|
}
|
|
262
269
|
}
|
|
263
270
|
};
|
|
264
|
-
this.handleColumnChange = (height, columnId) => {
|
|
265
|
-
this.onColumnChange.emit({
|
|
266
|
-
column: Number(columnId),
|
|
267
|
-
value: (TOP - height) / LINE_HEIGHT
|
|
268
|
-
});
|
|
269
|
-
};
|
|
270
271
|
this.updateDay = (value, fields) => {
|
|
271
272
|
const { _start, _end, _updateValue } = this.pickerDate;
|
|
272
273
|
_updateValue[fields] = value;
|
|
@@ -352,6 +353,7 @@ const Picker = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
352
353
|
this.end = '';
|
|
353
354
|
this.fields = 'day';
|
|
354
355
|
this.name = '';
|
|
356
|
+
this.textProps = {};
|
|
355
357
|
this.pickerValue = [];
|
|
356
358
|
this.height = [];
|
|
357
359
|
this.hidden = true;
|
|
@@ -441,6 +443,9 @@ const Picker = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
441
443
|
throw new Error('Date Interval Error');
|
|
442
444
|
}
|
|
443
445
|
}
|
|
446
|
+
else {
|
|
447
|
+
throw new Error(`Picker not support "${mode}" mode.`);
|
|
448
|
+
}
|
|
444
449
|
// Prop 变化时,无论是否正在显示弹层,都更新 height 值
|
|
445
450
|
this.height = this.getHeightByIndex();
|
|
446
451
|
// 同步表单 value 值,用于 form submit
|
|
@@ -456,6 +461,7 @@ const Picker = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
456
461
|
}
|
|
457
462
|
}
|
|
458
463
|
render() {
|
|
464
|
+
var _a, _b;
|
|
459
465
|
const { name, mode, fadeOut, hidden } = this;
|
|
460
466
|
// 选项条
|
|
461
467
|
let pickerGroup;
|
|
@@ -480,7 +486,7 @@ const Picker = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
480
486
|
'weui-animate-slide-down': fadeOut
|
|
481
487
|
});
|
|
482
488
|
const shouldDivHidden = hidden ? { display: 'none' } : {};
|
|
483
|
-
return (h(Host, null, h("div", { onClick: this.showPicker }, h("slot", null), h("input", { type: 'hidden', name: name, value: formatValue(this.pickerValue) })), h("div", { class: 'weui-picker__overlay', style: shouldDivHidden, ref: el => { this.overlay = el; } }, h("div", { class: clsMask, onClick: this.handleCancel }), h("div", { class: clsSlider }, h("div", { class: 'weui-picker__hd' }, h("div", { class: 'weui-picker__action', onClick: this.handleCancel },
|
|
489
|
+
return (h(Host, null, h("div", { onClick: this.showPicker }, h("slot", null), h("input", { type: 'hidden', name: name, value: formatValue(this.pickerValue) })), h("div", { class: 'weui-picker__overlay', style: shouldDivHidden, ref: el => { this.overlay = el; } }, h("div", { class: clsMask, onClick: this.handleCancel }), h("div", { class: clsSlider }, h("div", { class: 'weui-picker__hd' }, h("div", { class: 'weui-picker__action', onClick: this.handleCancel }, (_a = this.textProps.cancelText) !== null && _a !== void 0 ? _a : '取消'), h("div", { class: 'weui-picker__action', onClick: this.handleChange }, (_b = this.textProps.okText) !== null && _b !== void 0 ? _b : '确定')), h("div", { class: 'weui-picker__bd' }, pickerGroup), h("input", { type: 'hidden', name: name, value: formatValue(this.pickerValue) })))));
|
|
484
490
|
}
|
|
485
491
|
get el() { return this; }
|
|
486
492
|
static get watchers() { return {
|
|
@@ -501,6 +507,7 @@ const Picker = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
501
507
|
"end": [1],
|
|
502
508
|
"fields": [1],
|
|
503
509
|
"name": [1],
|
|
510
|
+
"textProps": [16],
|
|
504
511
|
"pickerValue": [32],
|
|
505
512
|
"height": [32],
|
|
506
513
|
"hidden": [32],
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
2
|
|
|
3
|
+
const indexCss = "taro-rich-text-core{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}taro-rich-text-core[selectable=true],taro-rich-text-core[user-select=true]{display:block;-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text}taro-rich-text-core[space]{white-space:pre-wrap}taro-rich-text-core[space=ensp]{word-spacing:0.5em}taro-rich-text-core[space=nbsp]{word-spacing:1em}";
|
|
4
|
+
|
|
3
5
|
const RichText = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
4
6
|
constructor() {
|
|
5
7
|
super();
|
|
@@ -51,6 +53,9 @@ const RichText = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
51
53
|
return null;
|
|
52
54
|
};
|
|
53
55
|
this.nodes = undefined;
|
|
56
|
+
this.selectable = false;
|
|
57
|
+
this.userSelect = false;
|
|
58
|
+
this.space = undefined;
|
|
54
59
|
}
|
|
55
60
|
render() {
|
|
56
61
|
const { nodes, renderNode } = this;
|
|
@@ -61,8 +66,12 @@ const RichText = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
61
66
|
return h(Host, { innerHTML: nodes });
|
|
62
67
|
}
|
|
63
68
|
}
|
|
69
|
+
static get style() { return indexCss; }
|
|
64
70
|
}, [0, "taro-rich-text-core", {
|
|
65
|
-
"nodes": [1]
|
|
71
|
+
"nodes": [1],
|
|
72
|
+
"selectable": [1028],
|
|
73
|
+
"userSelect": [1028, "user-select"],
|
|
74
|
+
"space": [1]
|
|
66
75
|
}]);
|
|
67
76
|
function defineCustomElement$1() {
|
|
68
77
|
if (typeof customElements === "undefined") {
|
|
@@ -1,23 +1,29 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
|
-
import { c as classnames } from './index2.js';
|
|
3
2
|
|
|
4
|
-
const indexCss = "taro-text-core{display:inline;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none
|
|
3
|
+
const indexCss = "taro-text-core{display:inline;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}taro-text-core[selectable=true],taro-text-core[user-select=true]{display:inline-block;-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text}taro-text-core[space]{white-space:pre-wrap}taro-text-core[space=ensp]{word-spacing:0.5em}taro-text-core[space=nbsp]{word-spacing:1em}taro-text-core[number-of-lines]{--line-clamp:2;display:-webkit-box;-webkit-box-orient:vertical;word-wrap:break-word;overflow:hidden;text-overflow:ellipsis;-webkit-line-clamp:var(--line-clamp)}";
|
|
5
4
|
|
|
6
5
|
const Text = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
7
6
|
constructor() {
|
|
8
7
|
super();
|
|
9
8
|
this.__registerHost();
|
|
10
9
|
this.selectable = false;
|
|
10
|
+
this.userSelect = false;
|
|
11
|
+
this.space = undefined;
|
|
12
|
+
this.numberOfLines = undefined;
|
|
11
13
|
}
|
|
12
14
|
render() {
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
const style = {};
|
|
16
|
+
if (typeof this.numberOfLines === 'number') {
|
|
17
|
+
style['--line-clamp'] = this.numberOfLines;
|
|
18
|
+
}
|
|
19
|
+
return (h(Host, { style: style }, h("slot", null)));
|
|
17
20
|
}
|
|
18
21
|
static get style() { return indexCss; }
|
|
19
22
|
}, [4, "taro-text-core", {
|
|
20
|
-
"selectable": [
|
|
23
|
+
"selectable": [1028],
|
|
24
|
+
"userSelect": [1028, "user-select"],
|
|
25
|
+
"space": [1025],
|
|
26
|
+
"numberOfLines": [2, "number-of-lines"]
|
|
21
27
|
}]);
|
|
22
28
|
function defineCustomElement$1() {
|
|
23
29
|
if (typeof customElements === "undefined") {
|