@tarojs/components 3.7.0-alpha.1 → 3.7.0-alpha.11
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/hls-00fec546.js +25673 -0
- package/dist/{esm/index-394db4c1.js → cjs/index-f6805218.js} +2 -6
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/taro-button-core.cjs.entry.js +2 -2
- package/dist/cjs/taro-components.cjs.js +1 -1
- package/dist/cjs/taro-cover-view-core.cjs.entry.js +1 -1
- package/dist/cjs/taro-icon-core.cjs.entry.js +1 -1
- package/dist/cjs/taro-image-core.cjs.entry.js +5 -4
- package/dist/cjs/taro-input-core.cjs.entry.js +6 -11
- package/dist/cjs/taro-navigator-core.cjs.entry.js +1 -1
- package/dist/cjs/taro-picker-core_2.cjs.entry.js +23 -20
- package/dist/cjs/taro-picker-view-column-core_2.cjs.entry.js +1 -1
- package/dist/cjs/taro-pull-to-refresh.cjs.entry.js +3 -3
- package/dist/cjs/taro-rich-text-core.cjs.entry.js +6 -0
- package/dist/cjs/taro-scroll-view-core.cjs.entry.js +5 -4
- package/dist/cjs/taro-swiper-core_2.cjs.entry.js +37 -36
- package/dist/cjs/taro-tabbar.cjs.entry.js +1 -1
- package/dist/cjs/taro-text-core.cjs.entry.js +9 -6
- package/dist/cjs/taro-textarea-core.cjs.entry.js +1 -8
- package/dist/cjs/taro-video-control_3.cjs.entry.js +3 -3
- package/dist/cjs/taro-view-core.cjs.entry.js +1 -1
- package/dist/collection/components/button/style/index.css +12 -0
- package/dist/collection/components/checkbox/checkbox.js +4 -4
- package/dist/collection/components/image/image.js +6 -4
- package/dist/collection/components/input/input.js +9 -13
- package/dist/collection/components/picker/picker-group.js +29 -26
- package/dist/collection/components/picker/picker.js +42 -16
- package/dist/collection/components/pull-to-refresh/pull-to-refresh.js +1 -1
- package/dist/collection/components/pull-to-refresh/style/index.css +0 -1
- 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/scroll-view/scroll-view.js +22 -4
- package/dist/collection/components/swiper/swiper-item.js +34 -35
- package/dist/collection/components/swiper/swiper.js +2 -0
- package/dist/collection/components/text/style/index.css +20 -3
- package/dist/collection/components/text/text.js +66 -6
- package/dist/collection/components/textarea/textarea.js +4 -10
- package/dist/collection/components/video/video.js +1 -1
- package/dist/components/hls.js +23206 -24210
- package/dist/components/index2.js +1 -7
- package/dist/components/picker-group.js +9 -9
- package/dist/components/taro-button-core.js +1 -1
- package/dist/components/taro-checkbox-core.js +1 -1
- package/dist/components/taro-image-core.js +6 -4
- package/dist/components/taro-input-core.js +7 -12
- package/dist/components/taro-picker-core.js +16 -13
- package/dist/components/taro-pull-to-refresh.js +2 -2
- package/dist/components/taro-rich-text-core.js +10 -1
- package/dist/components/taro-scroll-view-core.js +5 -3
- package/dist/components/taro-swiper-core.js +2 -0
- package/dist/components/taro-swiper-item-core.js +34 -35
- package/dist/components/taro-text-core.js +13 -7
- package/dist/components/taro-textarea-core.js +2 -9
- package/dist/components/taro-video-core.js +2 -2
- package/dist/esm/hls-4018c7ea.js +25671 -0
- package/dist/{cjs/index-067a58c1.js → esm/index-c3e4004b.js} +1 -12
- package/dist/esm/loader.js +1 -1
- package/dist/esm/taro-button-core.entry.js +2 -2
- package/dist/esm/taro-components.js +1 -1
- package/dist/esm/taro-cover-view-core.entry.js +1 -1
- package/dist/esm/taro-icon-core.entry.js +1 -1
- package/dist/esm/taro-image-core.entry.js +5 -4
- package/dist/esm/taro-input-core.entry.js +6 -11
- package/dist/esm/taro-navigator-core.entry.js +1 -1
- package/dist/esm/taro-picker-core_2.entry.js +23 -20
- package/dist/esm/taro-picker-view-column-core_2.entry.js +1 -1
- package/dist/esm/taro-pull-to-refresh.entry.js +3 -3
- package/dist/esm/taro-rich-text-core.entry.js +6 -0
- package/dist/esm/taro-scroll-view-core.entry.js +5 -4
- package/dist/esm/taro-swiper-core_2.entry.js +37 -36
- package/dist/esm/taro-tabbar.entry.js +1 -1
- package/dist/esm/taro-text-core.entry.js +9 -6
- package/dist/esm/taro-textarea-core.entry.js +1 -8
- package/dist/esm/taro-video-control_3.entry.js +3 -3
- package/dist/esm/taro-view-core.entry.js +1 -1
- package/dist/esm-es5/hls-4018c7ea.js +1 -0
- package/dist/esm-es5/index-c3e4004b.js +7 -0
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/taro-button-core.entry.js +1 -1
- package/dist/esm-es5/taro-components.js +1 -1
- package/dist/esm-es5/taro-cover-view-core.entry.js +1 -1
- package/dist/esm-es5/taro-icon-core.entry.js +1 -1
- package/dist/esm-es5/taro-image-core.entry.js +1 -1
- package/dist/esm-es5/taro-input-core.entry.js +1 -1
- package/dist/esm-es5/taro-navigator-core.entry.js +1 -1
- package/dist/esm-es5/taro-picker-core_2.entry.js +1 -1
- package/dist/esm-es5/taro-picker-view-column-core_2.entry.js +1 -1
- package/dist/esm-es5/taro-pull-to-refresh.entry.js +1 -1
- package/dist/esm-es5/taro-rich-text-core.entry.js +1 -1
- package/dist/esm-es5/taro-scroll-view-core.entry.js +1 -1
- package/dist/esm-es5/taro-swiper-core_2.entry.js +1 -1
- package/dist/esm-es5/taro-tabbar.entry.js +1 -1
- package/dist/esm-es5/taro-text-core.entry.js +1 -1
- package/dist/esm-es5/taro-textarea-core.entry.js +1 -1
- package/dist/esm-es5/taro-video-control_3.entry.js +1 -1
- package/dist/esm-es5/taro-view-core.entry.js +1 -1
- package/dist/taro-components/{p-1e43a2d5.entry.js → p-0114a2e4.entry.js} +1 -1
- package/dist/taro-components/p-01e163f8.system.entry.js +1 -0
- package/dist/taro-components/p-085076c5.system.entry.js +1 -0
- package/dist/taro-components/p-0fa96970.entry.js +1 -0
- package/dist/taro-components/{p-edbb1a17.system.entry.js → p-1991cc1a.system.entry.js} +1 -1
- package/dist/taro-components/{p-c0ec2f41.system.entry.js → p-2de2a3fd.system.entry.js} +1 -1
- package/dist/taro-components/p-2ec68968.system.js +7 -0
- package/dist/taro-components/{p-18703731.system.entry.js → p-416cc4dd.system.entry.js} +1 -1
- package/dist/taro-components/p-425c209a.entry.js +1 -0
- package/dist/taro-components/p-43efbf30.js +1 -0
- package/dist/taro-components/p-478deb81.entry.js +1 -0
- package/dist/taro-components/{p-2c89af5b.system.entry.js → p-657cb6e4.system.entry.js} +1 -1
- package/dist/taro-components/p-6cde180b.entry.js +1 -0
- package/dist/taro-components/{p-b898d734.entry.js → p-78e4805e.entry.js} +1 -1
- package/dist/taro-components/{p-c490cd45.entry.js → p-7b68dee8.entry.js} +1 -1
- package/dist/taro-components/{p-5905e3ef.system.entry.js → p-7e998213.system.entry.js} +1 -1
- package/dist/taro-components/p-982bb5bf.entry.js +1 -0
- package/dist/taro-components/{p-16336cc6.system.entry.js → p-98f9f50f.system.entry.js} +1 -1
- package/dist/taro-components/p-9edea30f.system.entry.js +1 -0
- package/dist/taro-components/{p-3f9f3448.entry.js → p-9fe49bab.entry.js} +1 -1
- package/dist/taro-components/{p-31bba7c3.entry.js → p-a20ecd3b.entry.js} +1 -1
- package/dist/taro-components/p-a20fed0a.entry.js +1 -0
- package/dist/taro-components/{p-e5f78321.system.entry.js → p-a4882902.system.entry.js} +1 -1
- package/dist/taro-components/{p-7c2454dd.system.entry.js → p-a8925584.system.entry.js} +1 -1
- package/dist/taro-components/p-a8e7cf87.entry.js +1 -0
- package/dist/taro-components/{p-c2322741.system.entry.js → p-b1d2b575.system.entry.js} +1 -1
- package/dist/taro-components/p-ba3b2aa5.system.entry.js +1 -0
- package/dist/taro-components/p-c39a46ca.system.entry.js +1 -0
- package/dist/taro-components/{p-ca3a269f.entry.js → p-c4b8851b.entry.js} +1 -1
- package/dist/taro-components/p-ce33f1f3.entry.js +1 -0
- package/dist/taro-components/p-dab28e1f.system.entry.js +1 -0
- package/dist/taro-components/p-de951a46.js +7 -0
- package/dist/taro-components/p-e09451c5.system.entry.js +1 -0
- package/dist/taro-components/{p-df4c2f21.entry.js → p-e33f3592.entry.js} +1 -1
- package/dist/taro-components/p-e78775ce.system.js +1 -0
- package/dist/taro-components/p-ebc7b6fc.entry.js +1 -0
- package/dist/taro-components/p-ed331c06.system.js +1 -1
- package/dist/taro-components/p-f02b6f70.entry.js +1 -0
- package/dist/taro-components/p-f6f6a996.system.entry.js +1 -0
- package/dist/taro-components/taro-components.css +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/image/image.d.ts +1 -0
- package/dist/types/components/input/input.d.ts +2 -2
- package/dist/types/components/picker/picker-group.d.ts +3 -3
- package/dist/types/components/picker/picker.d.ts +7 -2
- package/dist/types/components/rich-text/rich-text.d.ts +4 -0
- package/dist/types/components/scroll-view/scroll-view.d.ts +1 -0
- package/dist/types/components/text/text.d.ts +4 -0
- package/dist/types/components/textarea/textarea.d.ts +0 -1
- package/dist/types/components.d.ts +28 -8
- package/lib/react/component-lib/index.js +50 -50
- package/lib/react/component-lib/index.js.map +1 -1
- package/lib/react/component-lib/reactify-wc.js +1 -1
- package/lib/react/component-lib/reactify-wc.js.map +1 -1
- package/lib/react/components.d.ts +1 -3
- package/lib/react/components.js +2 -2
- package/lib/react/components.js.map +1 -1
- package/lib/react/helper.d.ts +1 -1
- package/lib/react/react-component-lib/createOverlayComponent.js.map +1 -1
- package/lib/react/react-component-lib/utils/attachProps.js +21 -5
- package/lib/react/react-component-lib/utils/attachProps.js.map +1 -1
- package/lib/vue2/component-lib/index.js +0 -5
- package/lib/vue2/component-lib/index.js.map +1 -1
- package/lib/vue2/components-loader.js +1 -1
- package/lib/vue2/components-loader.js.map +1 -1
- package/lib/vue2/components.d.ts +10 -3
- package/lib/vue2/components.js +13 -6
- package/lib/vue2/components.js.map +1 -1
- package/lib/vue2/vue-component-lib/utils.js.map +1 -1
- package/lib/vue3/component-lib/index.js +48 -48
- package/lib/vue3/component-lib/index.js.map +1 -1
- package/lib/vue3/components.d.ts +1 -1
- package/lib/vue3/components.js +14 -6
- package/lib/vue3/components.js.map +1 -1
- package/lib/vue3/vue-component-lib/utils.js.map +1 -1
- package/package.json +13 -11
- package/types/Button.d.ts +71 -8
- package/types/ChannelVideo.d.ts +4 -0
- package/types/Form.d.ts +11 -0
- package/types/Image.d.ts +5 -0
- package/types/Input.d.ts +6 -1
- package/types/LivePlayer.d.ts +17 -0
- package/types/LivePusher.d.ts +10 -0
- package/types/Picker.d.ts +9 -0
- package/types/Progress.d.ts +2 -2
- package/types/RichText.d.ts +6 -4
- package/types/ScrollView.d.ts +7 -7
- package/types/ShareElement.d.ts +39 -0
- package/types/StickySection.d.ts +0 -1
- package/types/Swiper.d.ts +10 -0
- package/types/Text.d.ts +8 -3
- package/types/Textarea.d.ts +11 -4
- package/types/Video.d.ts +12 -0
- package/types/View.d.ts +1 -1
- package/types/index.vue3.d.ts +18 -9
- package/virtual-list/index.js +2 -2
- package/dist/cjs/hls-0f2d4d85.js +0 -26677
- package/dist/esm/hls-0e83e558.js +0 -26675
- package/dist/esm-es5/hls-0e83e558.js +0 -289
- package/dist/esm-es5/index-394db4c1.js +0 -7
- package/dist/taro-components/p-198000d8.system.js +0 -289
- package/dist/taro-components/p-25adb80c.entry.js +0 -1
- package/dist/taro-components/p-2fad2a65.js +0 -7
- package/dist/taro-components/p-385d8aed.entry.js +0 -1
- package/dist/taro-components/p-387314fa.system.js +0 -7
- package/dist/taro-components/p-3e701660.js +0 -289
- package/dist/taro-components/p-4e9bd4f6.entry.js +0 -1
- package/dist/taro-components/p-589293fd.entry.js +0 -1
- package/dist/taro-components/p-58b19305.system.entry.js +0 -1
- package/dist/taro-components/p-5b67a98e.entry.js +0 -1
- package/dist/taro-components/p-6800ccdc.system.entry.js +0 -1
- package/dist/taro-components/p-735c2a72.system.entry.js +0 -1
- package/dist/taro-components/p-97f0ad72.system.entry.js +0 -1
- package/dist/taro-components/p-a132ebb9.entry.js +0 -1
- package/dist/taro-components/p-ab2d4f12.entry.js +0 -1
- package/dist/taro-components/p-c43c5e89.system.entry.js +0 -1
- package/dist/taro-components/p-cc7b95fd.system.entry.js +0 -1
- package/dist/taro-components/p-cd90bead.system.entry.js +0 -1
- package/dist/taro-components/p-d9e2e3aa.entry.js +0 -1
- package/dist/taro-components/p-dcbb7b2d.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
|
@@ -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,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Host, h } from '@stencil/core';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
3
|
import { debounce } from '../../utils';
|
|
4
4
|
function easeOutScroll(from, to, duration = 500, callback) {
|
|
@@ -52,6 +52,7 @@ export class ScrollView {
|
|
|
52
52
|
this.mpScrollTop = undefined;
|
|
53
53
|
this.mpScrollLeft = undefined;
|
|
54
54
|
this.mpScrollIntoView = undefined;
|
|
55
|
+
this.mpScrollIntoViewAlignment = undefined;
|
|
55
56
|
this.animated = false;
|
|
56
57
|
}
|
|
57
58
|
watchScrollLeft(newVal) {
|
|
@@ -111,9 +112,9 @@ export class ScrollView {
|
|
|
111
112
|
var _a;
|
|
112
113
|
if (typeof selector === 'string' && selector) {
|
|
113
114
|
(_a = document.querySelector(`#${selector}`)) === null || _a === void 0 ? void 0 : _a.scrollIntoView({
|
|
114
|
-
behavior: 'smooth',
|
|
115
|
-
block: 'center',
|
|
116
|
-
inline: 'start'
|
|
115
|
+
behavior: this.animated ? 'smooth' : 'auto',
|
|
116
|
+
block: this.scrollY ? (this.mpScrollIntoViewAlignment || 'center') : 'center',
|
|
117
|
+
inline: this.scrollX ? (this.mpScrollIntoViewAlignment || 'start') : 'start'
|
|
117
118
|
});
|
|
118
119
|
}
|
|
119
120
|
}
|
|
@@ -269,6 +270,23 @@ export class ScrollView {
|
|
|
269
270
|
"attribute": "scroll-into-view",
|
|
270
271
|
"reflect": true
|
|
271
272
|
},
|
|
273
|
+
"mpScrollIntoViewAlignment": {
|
|
274
|
+
"type": "string",
|
|
275
|
+
"mutable": false,
|
|
276
|
+
"complexType": {
|
|
277
|
+
"original": "'start' | 'center' | 'end' | 'nearest'",
|
|
278
|
+
"resolved": "\"center\" | \"end\" | \"nearest\" | \"start\"",
|
|
279
|
+
"references": {}
|
|
280
|
+
},
|
|
281
|
+
"required": false,
|
|
282
|
+
"optional": false,
|
|
283
|
+
"docs": {
|
|
284
|
+
"tags": [],
|
|
285
|
+
"text": ""
|
|
286
|
+
},
|
|
287
|
+
"attribute": "scroll-into-view-alignment",
|
|
288
|
+
"reflect": false
|
|
289
|
+
},
|
|
272
290
|
"animated": {
|
|
273
291
|
"type": "boolean",
|
|
274
292
|
"mutable": false,
|
|
@@ -1,49 +1,48 @@
|
|
|
1
1
|
import { Host, h } from '@stencil/core';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
continue;
|
|
18
|
-
}
|
|
19
|
-
if (target.childNodes.length > 0) {
|
|
20
|
-
const cleanAll = ['taro-image-core'].includes(target.tagName.toLocaleLowerCase());
|
|
21
|
-
parseChildNodes(item.childNodes, target.childNodes, cleanAll);
|
|
2
|
+
const nativeCloneNode = Node.prototype.cloneNode;
|
|
3
|
+
function cloneNode(node, deep) {
|
|
4
|
+
const clonedNode = nativeCloneNode.call(node, false);
|
|
5
|
+
const srcChildNodes = childNodes(node);
|
|
6
|
+
if (deep) {
|
|
7
|
+
for (let i = 0; i < srcChildNodes.length; i++) {
|
|
8
|
+
const srcNode = srcChildNodes[i];
|
|
9
|
+
let srcDeep = deep;
|
|
10
|
+
if (srcNode.nodeType !== 2 && srcNode.nodeType !== 8) {
|
|
11
|
+
// Note: 没有引用节点(s-cr[reference comment])的情况下,不复制子节点避免冗余(例如:Image 组件)
|
|
12
|
+
if (!srcNode['s-cr']) {
|
|
13
|
+
srcDeep = false;
|
|
14
|
+
}
|
|
15
|
+
const childClone = cloneNode(srcNode, srcDeep);
|
|
16
|
+
clonedNode.appendChild(childClone);
|
|
22
17
|
}
|
|
23
|
-
break;
|
|
24
18
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
19
|
+
}
|
|
20
|
+
return clonedNode;
|
|
21
|
+
}
|
|
22
|
+
function childNodes(node) {
|
|
23
|
+
const childNodes = node.childNodes;
|
|
24
|
+
// check if element is stencil element without shadow dom
|
|
25
|
+
// and then detect elements that were slotted into the element
|
|
26
|
+
if (node['s-sc']) {
|
|
27
|
+
const result = [];
|
|
28
|
+
for (let i = 0; i < childNodes.length; i++) {
|
|
29
|
+
const slot = childNodes[i]['s-nr'];
|
|
30
|
+
if (slot) {
|
|
31
|
+
result.push(slot);
|
|
32
|
+
}
|
|
29
33
|
}
|
|
34
|
+
return result;
|
|
30
35
|
}
|
|
36
|
+
return Array.from(childNodes);
|
|
31
37
|
}
|
|
32
38
|
export class SwiperItem {
|
|
33
39
|
constructor() {
|
|
34
40
|
this.itemId = undefined;
|
|
35
41
|
}
|
|
36
42
|
componentDidRender() {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
const list = Array
|
|
41
|
-
.from(((_b = (_a = el.parentElement) === null || _a === void 0 ? void 0 : _a.childNodes) === null || _b === void 0 ? void 0 : _b.values()) || [])
|
|
42
|
-
.filter((e) => e.tagName === 'TARO-SWIPER-ITEM-CORE');
|
|
43
|
-
if (list.length > 0) {
|
|
44
|
-
parseChildNodes(el.childNodes, (_c = list[list.indexOf(el) === 0 ? list.length - 2 : 1]) === null || _c === void 0 ? void 0 : _c.childNodes);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
43
|
+
this.el.cloneNode = (deep = false) => {
|
|
44
|
+
return cloneNode.call(null, this.el, deep);
|
|
45
|
+
};
|
|
47
46
|
}
|
|
48
47
|
render() {
|
|
49
48
|
return (h(Host, { class: 'swiper-slide', "item-id": this.itemId }));
|
|
@@ -133,6 +133,7 @@ export class Swiper {
|
|
|
133
133
|
};
|
|
134
134
|
this.el.addEventListener('DOMNodeInserted', this.handleSwiperSize);
|
|
135
135
|
this.el.addEventListener('DOMNodeRemoved', this.handleSwiperSize);
|
|
136
|
+
this.el.addEventListener('MutationObserver', this.handleSwiperSize);
|
|
136
137
|
}
|
|
137
138
|
watchCircular() {
|
|
138
139
|
if (this.swiper) {
|
|
@@ -176,6 +177,7 @@ export class Swiper {
|
|
|
176
177
|
var _a, _b, _c, _d, _e, _f;
|
|
177
178
|
this.el.removeEventListener('DOMNodeInserted', this.handleSwiperSize);
|
|
178
179
|
this.el.removeEventListener('DOMNodeRemoved', this.handleSwiperSize);
|
|
180
|
+
this.el.removeEventListener('MutationObserver', this.handleSwiperSize);
|
|
179
181
|
(_b = (_a = this.observer) === null || _a === void 0 ? void 0 : _a.disconnect) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
180
182
|
(_d = (_c = this.observerFirst) === null || _c === void 0 ? void 0 : _c.disconnect) === null || _d === void 0 ? void 0 : _d.call(_c);
|
|
181
183
|
(_f = (_e = this.observerLast) === null || _e === void 0 ? void 0 : _e.disconnect) === null || _f === void 0 ? void 0 : _f.call(_e);
|
|
@@ -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
|
}
|
|
@@ -96,7 +96,7 @@ export class Textarea {
|
|
|
96
96
|
numberOfLines = Math.floor(taHeight / taLineHeight);
|
|
97
97
|
return numberOfLines;
|
|
98
98
|
};
|
|
99
|
-
this.value =
|
|
99
|
+
this.value = '';
|
|
100
100
|
this.placeholder = undefined;
|
|
101
101
|
this.disabled = false;
|
|
102
102
|
this.maxlength = 140;
|
|
@@ -115,13 +115,6 @@ export class Textarea {
|
|
|
115
115
|
async focus() {
|
|
116
116
|
this.textareaRef.focus();
|
|
117
117
|
}
|
|
118
|
-
componentDidLoad() {
|
|
119
|
-
Object.defineProperty(this.el, 'value', {
|
|
120
|
-
get: () => this.textareaRef.value,
|
|
121
|
-
set: value => this.value !== value && (this.value = value),
|
|
122
|
-
configurable: true
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
118
|
render() {
|
|
126
119
|
const { value, placeholder, disabled, maxlength, autoFocus, autoHeight, name, nativeProps, handleInput, handleFocus, handleBlur, handleChange } = this;
|
|
127
120
|
const otherProps = {};
|
|
@@ -164,7 +157,8 @@ export class Textarea {
|
|
|
164
157
|
"text": ""
|
|
165
158
|
},
|
|
166
159
|
"attribute": "value",
|
|
167
|
-
"reflect": false
|
|
160
|
+
"reflect": false,
|
|
161
|
+
"defaultValue": "''"
|
|
168
162
|
},
|
|
169
163
|
"placeholder": {
|
|
170
164
|
"type": "string",
|
|
@@ -234,7 +228,7 @@ export class Textarea {
|
|
|
234
228
|
"text": ""
|
|
235
229
|
},
|
|
236
230
|
"attribute": "focus",
|
|
237
|
-
"reflect":
|
|
231
|
+
"reflect": false,
|
|
238
232
|
"defaultValue": "false"
|
|
239
233
|
},
|
|
240
234
|
"autoHeight": {
|