@tarojs/components 3.6.6 → 3.6.7-alpha.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.
Files changed (174) hide show
  1. package/dist/cjs/hls-00fec546.js +25673 -0
  2. package/dist/{esm/index-394db4c1.js → cjs/index-f6805218.js} +2 -6
  3. package/dist/cjs/loader.cjs.js +1 -1
  4. package/dist/cjs/taro-button-core.cjs.entry.js +1 -1
  5. package/dist/cjs/taro-components.cjs.js +1 -1
  6. package/dist/cjs/taro-cover-view-core.cjs.entry.js +1 -1
  7. package/dist/cjs/taro-icon-core.cjs.entry.js +1 -1
  8. package/dist/cjs/taro-image-core.cjs.entry.js +1 -1
  9. package/dist/cjs/taro-input-core.cjs.entry.js +5 -5
  10. package/dist/cjs/taro-navigator-core.cjs.entry.js +1 -1
  11. package/dist/cjs/taro-picker-core_2.cjs.entry.js +21 -14
  12. package/dist/cjs/taro-picker-view-column-core_2.cjs.entry.js +1 -1
  13. package/dist/cjs/taro-pull-to-refresh.cjs.entry.js +1 -1
  14. package/dist/cjs/taro-rich-text-core.cjs.entry.js +6 -0
  15. package/dist/cjs/taro-scroll-view-core.cjs.entry.js +1 -1
  16. package/dist/cjs/taro-swiper-core_2.cjs.entry.js +1 -1
  17. package/dist/cjs/taro-tabbar.cjs.entry.js +1 -1
  18. package/dist/cjs/taro-text-core.cjs.entry.js +9 -6
  19. package/dist/cjs/taro-video-control_3.cjs.entry.js +3 -3
  20. package/dist/cjs/taro-view-core.cjs.entry.js +1 -1
  21. package/dist/collection/components/checkbox/checkbox.js +4 -4
  22. package/dist/collection/components/input/input.js +6 -6
  23. package/dist/collection/components/picker/picker-group.js +29 -26
  24. package/dist/collection/components/picker/picker.js +34 -8
  25. package/dist/collection/components/rich-text/rich-text.js +71 -0
  26. package/dist/collection/components/rich-text/style/index.css +16 -0
  27. package/dist/collection/components/text/style/index.css +20 -3
  28. package/dist/collection/components/text/text.js +66 -6
  29. package/dist/collection/components/textarea/textarea.js +1 -1
  30. package/dist/collection/components/video/video.js +1 -1
  31. package/dist/components/hls.js +23206 -24210
  32. package/dist/components/index2.js +1 -7
  33. package/dist/components/picker-group.js +9 -9
  34. package/dist/components/taro-checkbox-core.js +1 -1
  35. package/dist/components/taro-input-core.js +6 -6
  36. package/dist/components/taro-picker-core.js +14 -7
  37. package/dist/components/taro-rich-text-core.js +10 -1
  38. package/dist/components/taro-text-core.js +13 -7
  39. package/dist/components/taro-textarea-core.js +1 -1
  40. package/dist/components/taro-video-core.js +2 -2
  41. package/dist/esm/hls-4018c7ea.js +25671 -0
  42. package/dist/{cjs/index-067a58c1.js → esm/index-c3e4004b.js} +1 -12
  43. package/dist/esm/loader.js +1 -1
  44. package/dist/esm/taro-button-core.entry.js +1 -1
  45. package/dist/esm/taro-components.js +1 -1
  46. package/dist/esm/taro-cover-view-core.entry.js +1 -1
  47. package/dist/esm/taro-icon-core.entry.js +1 -1
  48. package/dist/esm/taro-image-core.entry.js +1 -1
  49. package/dist/esm/taro-input-core.entry.js +5 -5
  50. package/dist/esm/taro-navigator-core.entry.js +1 -1
  51. package/dist/esm/taro-picker-core_2.entry.js +21 -14
  52. package/dist/esm/taro-picker-view-column-core_2.entry.js +1 -1
  53. package/dist/esm/taro-pull-to-refresh.entry.js +1 -1
  54. package/dist/esm/taro-rich-text-core.entry.js +6 -0
  55. package/dist/esm/taro-scroll-view-core.entry.js +1 -1
  56. package/dist/esm/taro-swiper-core_2.entry.js +1 -1
  57. package/dist/esm/taro-tabbar.entry.js +1 -1
  58. package/dist/esm/taro-text-core.entry.js +9 -6
  59. package/dist/esm/taro-video-control_3.entry.js +3 -3
  60. package/dist/esm/taro-view-core.entry.js +1 -1
  61. package/dist/esm-es5/hls-4018c7ea.js +1 -0
  62. package/dist/esm-es5/index-c3e4004b.js +7 -0
  63. package/dist/esm-es5/loader.js +1 -1
  64. package/dist/esm-es5/taro-button-core.entry.js +1 -1
  65. package/dist/esm-es5/taro-components.js +1 -1
  66. package/dist/esm-es5/taro-cover-view-core.entry.js +1 -1
  67. package/dist/esm-es5/taro-icon-core.entry.js +1 -1
  68. package/dist/esm-es5/taro-image-core.entry.js +1 -1
  69. package/dist/esm-es5/taro-input-core.entry.js +1 -1
  70. package/dist/esm-es5/taro-navigator-core.entry.js +1 -1
  71. package/dist/esm-es5/taro-picker-core_2.entry.js +1 -1
  72. package/dist/esm-es5/taro-picker-view-column-core_2.entry.js +1 -1
  73. package/dist/esm-es5/taro-pull-to-refresh.entry.js +1 -1
  74. package/dist/esm-es5/taro-rich-text-core.entry.js +1 -1
  75. package/dist/esm-es5/taro-scroll-view-core.entry.js +1 -1
  76. package/dist/esm-es5/taro-swiper-core_2.entry.js +1 -1
  77. package/dist/esm-es5/taro-tabbar.entry.js +1 -1
  78. package/dist/esm-es5/taro-text-core.entry.js +1 -1
  79. package/dist/esm-es5/taro-video-control_3.entry.js +1 -1
  80. package/dist/esm-es5/taro-view-core.entry.js +1 -1
  81. package/dist/taro-components/{p-030715f1.system.entry.js → p-01e163f8.system.entry.js} +1 -1
  82. package/dist/taro-components/p-085076c5.system.entry.js +1 -0
  83. package/dist/taro-components/{p-25adb80c.entry.js → p-091a7153.entry.js} +1 -1
  84. package/dist/taro-components/{p-cd90bead.system.entry.js → p-0cf235de.system.entry.js} +1 -1
  85. package/dist/taro-components/p-0fa96970.entry.js +1 -0
  86. package/dist/taro-components/{p-edbb1a17.system.entry.js → p-1991cc1a.system.entry.js} +1 -1
  87. package/dist/taro-components/{p-c0ec2f41.system.entry.js → p-2accb92c.system.entry.js} +1 -1
  88. package/dist/taro-components/p-2ec68968.system.js +7 -0
  89. package/dist/taro-components/{p-18703731.system.entry.js → p-416cc4dd.system.entry.js} +1 -1
  90. package/dist/taro-components/p-425c209a.entry.js +1 -0
  91. package/dist/taro-components/p-43efbf30.js +1 -0
  92. package/dist/taro-components/{p-385d8aed.entry.js → p-4874f671.entry.js} +1 -1
  93. package/dist/taro-components/p-6cde180b.entry.js +1 -0
  94. package/dist/taro-components/{p-c490cd45.entry.js → p-7152d85b.entry.js} +1 -1
  95. package/dist/taro-components/{p-ab2d4f12.entry.js → p-719e1eaf.entry.js} +1 -1
  96. package/dist/taro-components/{p-b898d734.entry.js → p-78e4805e.entry.js} +1 -1
  97. package/dist/taro-components/{p-6800ccdc.system.entry.js → p-7ff654e6.system.entry.js} +1 -1
  98. package/dist/taro-components/{p-16336cc6.system.entry.js → p-98f9f50f.system.entry.js} +1 -1
  99. package/dist/taro-components/p-9edea30f.system.entry.js +1 -0
  100. package/dist/taro-components/{p-3f9f3448.entry.js → p-9fe49bab.entry.js} +1 -1
  101. package/dist/taro-components/{p-31bba7c3.entry.js → p-a20ecd3b.entry.js} +1 -1
  102. package/dist/taro-components/p-a20fed0a.entry.js +1 -0
  103. package/dist/taro-components/{p-7c2454dd.system.entry.js → p-a8925584.system.entry.js} +1 -1
  104. package/dist/taro-components/p-a8e7cf87.entry.js +1 -0
  105. package/dist/taro-components/{p-5905e3ef.system.entry.js → p-a96b4b19.system.entry.js} +1 -1
  106. package/dist/taro-components/{p-c2322741.system.entry.js → p-b1d2b575.system.entry.js} +1 -1
  107. package/dist/taro-components/p-c39a46ca.system.entry.js +1 -0
  108. package/dist/taro-components/{p-ca3a269f.entry.js → p-c4b8851b.entry.js} +1 -1
  109. package/dist/taro-components/{p-e5f78321.system.entry.js → p-cdb76676.system.entry.js} +1 -1
  110. package/dist/taro-components/p-de951a46.js +7 -0
  111. package/dist/taro-components/p-e09451c5.system.entry.js +1 -0
  112. package/dist/taro-components/{p-df4c2f21.entry.js → p-e33f3592.entry.js} +1 -1
  113. package/dist/taro-components/p-e78775ce.system.js +1 -0
  114. package/dist/taro-components/{p-98d771c3.entry.js → p-ebc7b6fc.entry.js} +1 -1
  115. package/dist/taro-components/p-ed331c06.system.js +1 -1
  116. package/dist/taro-components/{p-1e43a2d5.entry.js → p-f07cd1de.entry.js} +1 -1
  117. package/dist/taro-components/p-f6f6a996.system.entry.js +1 -0
  118. package/dist/taro-components/taro-components.esm.js +1 -1
  119. package/dist/types/components/checkbox/checkbox.d.ts +1 -1
  120. package/dist/types/components/input/input.d.ts +1 -1
  121. package/dist/types/components/picker/picker-group.d.ts +3 -3
  122. package/dist/types/components/picker/picker.d.ts +6 -1
  123. package/dist/types/components/rich-text/rich-text.d.ts +4 -0
  124. package/dist/types/components/text/text.d.ts +4 -0
  125. package/dist/types/components.d.ts +24 -6
  126. package/lib/react/component-lib/index.js +50 -50
  127. package/lib/react/component-lib/index.js.map +1 -1
  128. package/lib/react/components.d.ts +1 -3
  129. package/lib/react/components.js +2 -2
  130. package/lib/react/components.js.map +1 -1
  131. package/lib/react/helper.d.ts +1 -1
  132. package/lib/react/react-component-lib/utils/attachProps.js +1 -4
  133. package/lib/react/react-component-lib/utils/attachProps.js.map +1 -1
  134. package/lib/vue2/components.d.ts +8 -2
  135. package/lib/vue2/components.js +12 -6
  136. package/lib/vue2/components.js.map +1 -1
  137. package/lib/vue3/component-lib/index.js +48 -48
  138. package/lib/vue3/component-lib/index.js.map +1 -1
  139. package/lib/vue3/components.d.ts +1 -1
  140. package/lib/vue3/components.js +13 -6
  141. package/lib/vue3/components.js.map +1 -1
  142. package/package.json +9 -7
  143. package/types/Button.d.ts +9 -7
  144. package/types/ChannelVideo.d.ts +4 -0
  145. package/types/Form.d.ts +11 -0
  146. package/types/Image.d.ts +5 -0
  147. package/types/Input.d.ts +6 -1
  148. package/types/LivePlayer.d.ts +17 -0
  149. package/types/LivePusher.d.ts +10 -0
  150. package/types/Picker.d.ts +9 -0
  151. package/types/Progress.d.ts +2 -2
  152. package/types/RichText.d.ts +6 -4
  153. package/types/ScrollView.d.ts +3 -3
  154. package/types/Text.d.ts +8 -3
  155. package/types/Textarea.d.ts +5 -3
  156. package/types/Video.d.ts +12 -0
  157. package/dist/cjs/hls-0f2d4d85.js +0 -26677
  158. package/dist/esm/hls-0e83e558.js +0 -26675
  159. package/dist/esm-es5/hls-0e83e558.js +0 -289
  160. package/dist/esm-es5/index-394db4c1.js +0 -7
  161. package/dist/taro-components/p-198000d8.system.js +0 -289
  162. package/dist/taro-components/p-2fad2a65.js +0 -7
  163. package/dist/taro-components/p-387314fa.system.js +0 -7
  164. package/dist/taro-components/p-3e701660.js +0 -289
  165. package/dist/taro-components/p-4e9bd4f6.entry.js +0 -1
  166. package/dist/taro-components/p-58b19305.system.entry.js +0 -1
  167. package/dist/taro-components/p-5b67a98e.entry.js +0 -1
  168. package/dist/taro-components/p-8414da06.system.entry.js +0 -1
  169. package/dist/taro-components/p-97f0ad72.system.entry.js +0 -1
  170. package/dist/taro-components/p-af2cd702.entry.js +0 -1
  171. package/dist/taro-components/p-c43c5e89.system.entry.js +0 -1
  172. package/dist/taro-components/p-dcbb7b2d.entry.js +0 -1
  173. package/dist/taro-components/p-ed011ff9.entry.js +0 -1
  174. package/dist/taro-components/p-fa43177b.system.entry.js +0 -1
@@ -1,4 +1,4 @@
1
- import { h, Host } from '@stencil/core';
1
+ import { Host, h } from '@stencil/core';
2
2
  import { TOP, LINE_HEIGHT, MASK_HEIGHT } from './constant';
3
3
  export class TaroPickerGroup {
4
4
  constructor() {
@@ -8,7 +8,6 @@ export class TaroPickerGroup {
8
8
  this.height = undefined;
9
9
  this.columnId = undefined;
10
10
  this.updateHeight = undefined;
11
- this.onColumnChange = undefined;
12
11
  this.updateDay = undefined;
13
12
  this.startY = undefined;
14
13
  this.preY = undefined;
@@ -78,7 +77,7 @@ export class TaroPickerGroup {
78
77
  this.updateHeight(newPos, this.columnId);
79
78
  }
80
79
  async handleMoveEnd(clientY) {
81
- const { mode, range, height, updateHeight, onColumnChange, columnId } = this;
80
+ const { mode, range, height, updateHeight, columnId } = this;
82
81
  const max = 0;
83
82
  const min = -LINE_HEIGHT * (range.length - 1);
84
83
  const endY = clientY;
@@ -129,7 +128,7 @@ export class TaroPickerGroup {
129
128
  // 先按公式算出 index, 再用此 index 算出一个整数高度
130
129
  const index = Math.round(absoluteHeight / -LINE_HEIGHT);
131
130
  const relativeHeight = TOP - LINE_HEIGHT * index;
132
- if (this.mode === 'date') {
131
+ if (this.mode === 'date' && typeof this.updateDay === 'function') {
133
132
  if (this.columnId === '0') {
134
133
  this.updateDay(+this.range[index].replace(/[^0-9]/gi, ''), 0);
135
134
  }
@@ -141,14 +140,16 @@ export class TaroPickerGroup {
141
140
  }
142
141
  }
143
142
  updateHeight(relativeHeight, columnId, mode === 'time');
144
- onColumnChange && onColumnChange(relativeHeight, columnId);
143
+ this.onColumnChange.emit({
144
+ columnId,
145
+ height: relativeHeight,
146
+ });
145
147
  }
146
148
  onMouseDown(e) {
147
149
  this.isMove = true;
148
150
  this.handleMoveStart(e.clientY);
149
151
  }
150
152
  onMouseMove(e) {
151
- e.preventDefault();
152
153
  if (!this.isMove)
153
154
  return;
154
155
  this.handleMoving(e.clientY);
@@ -163,7 +164,6 @@ export class TaroPickerGroup {
163
164
  this.handleMoveStart(e.changedTouches[0].clientY);
164
165
  }
165
166
  onTouchMove(e) {
166
- e.preventDefault();
167
167
  this.handleMoving(e.changedTouches[0].clientY);
168
168
  }
169
169
  onTouchEnd(e) {
@@ -279,31 +279,16 @@ export class TaroPickerGroup {
279
279
  "text": ""
280
280
  }
281
281
  },
282
- "onColumnChange": {
283
- "type": "unknown",
284
- "mutable": false,
285
- "complexType": {
286
- "original": "(height: number, columnId: string) => void",
287
- "resolved": "(height: number, columnId: string) => void",
288
- "references": {}
289
- },
290
- "required": false,
291
- "optional": false,
292
- "docs": {
293
- "tags": [],
294
- "text": ""
295
- }
296
- },
297
282
  "updateDay": {
298
283
  "type": "unknown",
299
284
  "mutable": false,
300
285
  "complexType": {
301
286
  "original": "(value: number, fields: number) => void",
302
- "resolved": "(value: number, fields: number) => void",
287
+ "resolved": "((value: number, fields: number) => void) | undefined",
303
288
  "references": {}
304
289
  },
305
290
  "required": false,
306
- "optional": false,
291
+ "optional": true,
307
292
  "docs": {
308
293
  "tags": [],
309
294
  "text": ""
@@ -320,6 +305,24 @@ export class TaroPickerGroup {
320
305
  "isMove": {}
321
306
  };
322
307
  }
308
+ static get events() {
309
+ return [{
310
+ "method": "onColumnChange",
311
+ "name": "columnChange",
312
+ "bubbles": true,
313
+ "cancelable": true,
314
+ "composed": true,
315
+ "docs": {
316
+ "tags": [],
317
+ "text": ""
318
+ },
319
+ "complexType": {
320
+ "original": "any",
321
+ "resolved": "any",
322
+ "references": {}
323
+ }
324
+ }];
325
+ }
323
326
  static get methods() {
324
327
  return {
325
328
  "handleMoveStart": {
@@ -392,7 +395,7 @@ export class TaroPickerGroup {
392
395
  "name": "mousemove",
393
396
  "method": "onMouseMove",
394
397
  "target": undefined,
395
- "capture": false,
398
+ "capture": true,
396
399
  "passive": true
397
400
  }, {
398
401
  "name": "mouseup",
@@ -416,7 +419,7 @@ export class TaroPickerGroup {
416
419
  "name": "touchmove",
417
420
  "method": "onTouchMove",
418
421
  "target": undefined,
419
- "capture": false,
422
+ "capture": true,
420
423
  "passive": true
421
424
  }, {
422
425
  "name": "touchend",
@@ -1,4 +1,4 @@
1
- import { h, Host } from '@stencil/core';
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 }, "\u53D6\u6D88"), h("div", { class: 'weui-picker__action', onClick: this.handleChange }, "\u786E\u5B9A")), h("div", { class: 'weui-picker__bd' }, pickerGroup), h("input", { type: 'hidden', name: name, value: formatValue(this.pickerValue) })))));
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
- .taro-text__selectable {
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 cls = classNames({
9
- 'taro-text__selectable': this.selectable
10
- });
11
- return (h(Host, { class: cls }, h("slot", null)));
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": false,
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
  }
@@ -228,7 +228,7 @@ export class Textarea {
228
228
  "text": ""
229
229
  },
230
230
  "attribute": "focus",
231
- "reflect": true,
231
+ "reflect": false,
232
232
  "defaultValue": "false"
233
233
  },
234
234
  "autoHeight": {
@@ -60,7 +60,7 @@ export class Video {
60
60
  const { src, videoRef } = this;
61
61
  if (isHls(src)) {
62
62
  import(
63
- /* webpackMode: "weak" */
63
+ /* webpackExports: ["default"] */
64
64
  'hls.js').then(e => {
65
65
  const Hls = e.default;
66
66
  this.HLS = Hls;