@tarojs/plugin-platform-harmony-ets 4.0.0-alpha.2 → 4.0.0-alpha.21

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 (129) hide show
  1. package/dist/apis/base/system.ts +73 -20
  2. package/dist/apis/canvas/index.ts +10 -1
  3. package/dist/apis/device/clipboard.ts +16 -8
  4. package/dist/apis/framework/index.ts +1 -5
  5. package/dist/apis/index.ts +25 -17
  6. package/dist/apis/media/image/index.ts +1 -1
  7. package/dist/apis/storage/index.ts +146 -78
  8. package/dist/apis/ui/animation/animation.ts +71 -29
  9. package/dist/apis/ui/background.ts +2 -1
  10. package/dist/apis/ui/interaction/index.ts +42 -59
  11. package/dist/apis/ui/navigation-bar/index.ts +1 -1
  12. package/dist/apis/ui/pull-down-refresh.ts +9 -3
  13. package/dist/apis/ui/scroll/index.ts +5 -5
  14. package/dist/apis/ui/tab-bar.ts +3 -3
  15. package/dist/apis/utils/index.ts +2 -1
  16. package/dist/apis/wxml/IntersectionObserver.ts +18 -10
  17. package/dist/apis/wxml/selectorQuery.ts +26 -13
  18. package/dist/components-harmony-ets/button.ets +64 -34
  19. package/dist/components-harmony-ets/canvas.ets +51 -0
  20. package/dist/components-harmony-ets/checkbox.ets +72 -61
  21. package/dist/components-harmony-ets/form.ets +51 -29
  22. package/dist/components-harmony-ets/icon.ets +31 -19
  23. package/dist/components-harmony-ets/image.ets +34 -14
  24. package/dist/components-harmony-ets/index.ets +92 -0
  25. package/dist/components-harmony-ets/innerHtml.ets +11 -6
  26. package/dist/components-harmony-ets/input.ets +49 -41
  27. package/dist/components-harmony-ets/label.ets +71 -44
  28. package/dist/components-harmony-ets/listView.ets +26 -0
  29. package/dist/components-harmony-ets/movableArea.ets +126 -0
  30. package/dist/components-harmony-ets/movableView.ets +93 -0
  31. package/dist/components-harmony-ets/navigationBar.ets +65 -0
  32. package/dist/components-harmony-ets/pageMeta.ets +94 -0
  33. package/dist/components-harmony-ets/picker.ets +42 -38
  34. package/dist/components-harmony-ets/progress.ets +52 -0
  35. package/dist/components-harmony-ets/pseudo.ets +80 -0
  36. package/dist/components-harmony-ets/radio.ets +74 -64
  37. package/dist/components-harmony-ets/richText.ets +14 -30
  38. package/dist/components-harmony-ets/scrollList.ets +94 -0
  39. package/dist/components-harmony-ets/scrollView.ets +61 -57
  40. package/dist/components-harmony-ets/slider.ets +18 -14
  41. package/dist/components-harmony-ets/stickySection.ets +42 -0
  42. package/dist/components-harmony-ets/style.ets +381 -130
  43. package/dist/components-harmony-ets/swiper.ets +61 -20
  44. package/dist/components-harmony-ets/switch.ets +36 -32
  45. package/dist/components-harmony-ets/{index.ts → tag.ts} +6 -0
  46. package/dist/components-harmony-ets/text.ets +135 -49
  47. package/dist/components-harmony-ets/textArea.ets +50 -35
  48. package/dist/components-harmony-ets/utils/AttributeManager.ets +1 -1
  49. package/dist/components-harmony-ets/utils/DynamicCenter.ts +2 -2
  50. package/dist/components-harmony-ets/utils/flexManager.ets +49 -19
  51. package/dist/components-harmony-ets/utils/helper.ets +18 -5
  52. package/dist/components-harmony-ets/utils/htmlParser/HarmonyHTMLParser.ts +1 -2
  53. package/dist/components-harmony-ets/utils/htmlParser/index.ts +1 -1
  54. package/dist/components-harmony-ets/utils/index.ts +54 -50
  55. package/dist/components-harmony-ets/utils/styles.ets +170 -93
  56. package/dist/components-harmony-ets/video.ets +34 -21
  57. package/dist/components-harmony-ets/view.ets +63 -52
  58. package/dist/components-harmony-ets/webView.ets +40 -34
  59. package/dist/index.d.ts +152 -0
  60. package/dist/index.js +99 -55
  61. package/dist/index.js.map +1 -1
  62. package/dist/runtime-ets/bom/document.ts +6 -4
  63. package/dist/runtime-ets/bom/getComputedStyle.ts +2 -2
  64. package/dist/runtime-ets/bom/window.ts +7 -0
  65. package/dist/runtime-ets/current.ts +3 -0
  66. package/dist/runtime-ets/dom/bind.ts +28 -12
  67. package/dist/runtime-ets/dom/class-list.ts +2 -2
  68. package/dist/runtime-ets/dom/cssNesting.ts +419 -0
  69. package/dist/runtime-ets/dom/cssStyleDeclaration.ts +28 -42
  70. package/dist/runtime-ets/dom/document.ts +8 -11
  71. package/dist/runtime-ets/dom/element/canvas.ts +136 -0
  72. package/dist/runtime-ets/dom/element/element.ts +348 -57
  73. package/dist/runtime-ets/dom/element/form.ts +31 -26
  74. package/dist/runtime-ets/dom/element/index.ts +30 -2
  75. package/dist/runtime-ets/dom/element/movableArea.ts +11 -0
  76. package/dist/runtime-ets/dom/element/movableView.ts +244 -0
  77. package/dist/runtime-ets/dom/element/normal.ts +35 -8
  78. package/dist/runtime-ets/dom/element/progress.ts +11 -0
  79. package/dist/runtime-ets/dom/element/scrollView.ts +1 -0
  80. package/dist/runtime-ets/dom/element/text.ts +1 -8
  81. package/dist/runtime-ets/dom/element/video.ts +5 -4
  82. package/dist/runtime-ets/dom/element/webView.ts +12 -5
  83. package/dist/runtime-ets/dom/event.ts +2 -4
  84. package/dist/runtime-ets/dom/eventTarget.ts +2 -3
  85. package/dist/runtime-ets/dom/node.ts +54 -29
  86. package/dist/runtime-ets/dom/stylesheet/covertWeb2Hm.ts +416 -235
  87. package/dist/runtime-ets/dom/stylesheet/index.ts +29 -311
  88. package/dist/runtime-ets/dom/stylesheet/type.ts +51 -9
  89. package/dist/runtime-ets/dom/stylesheet/util.ts +33 -27
  90. package/dist/runtime-ets/index.ts +2 -1
  91. package/dist/runtime-ets/interface/event.ts +1 -1
  92. package/dist/runtime-ets/utils/index.ts +73 -13
  93. package/dist/runtime-ets/utils/info.ts +2 -2
  94. package/dist/runtime-framework/react/app.ts +9 -4
  95. package/dist/runtime-framework/react/hooks.ts +0 -1
  96. package/dist/runtime-framework/react/index.ts +0 -2
  97. package/dist/runtime-framework/react/native-page.ts +154 -77
  98. package/dist/runtime-framework/react/page.ts +3 -8
  99. package/dist/runtime-framework/solid/app.ts +25 -45
  100. package/dist/runtime-framework/solid/connect.ts +21 -3
  101. package/dist/runtime-framework/solid/hooks.ts +16 -11
  102. package/dist/runtime-framework/solid/index.ts +6 -2
  103. package/dist/runtime-framework/solid/page.ts +84 -30
  104. package/dist/runtime-framework/solid/reconciler/props.ts +70 -25
  105. package/dist/runtime-framework/solid/reconciler/render.ts +16 -6
  106. package/dist/runtime-framework/solid/reconciler/use.ts +0 -1
  107. package/dist/runtime-framework/solid/utils/index.ts +0 -2
  108. package/dist/runtime-utils.d.ts +827 -0
  109. package/dist/runtime-utils.js +435 -218
  110. package/dist/runtime-utils.js.map +1 -1
  111. package/dist/runtime.d.ts +1 -0
  112. package/dist/runtime.js +435 -218
  113. package/dist/runtime.js.map +1 -1
  114. package/index.js +3 -1
  115. package/package.json +14 -15
  116. package/static/media/cancel.svg +1 -1
  117. package/static/media/circle.svg +1 -1
  118. package/static/media/clear.svg +1 -1
  119. package/static/media/download.svg +1 -1
  120. package/static/media/info.svg +1 -1
  121. package/static/media/info_circle.svg +1 -1
  122. package/static/media/search.svg +1 -1
  123. package/static/media/success.svg +1 -1
  124. package/static/media/success_no_circle.svg +1 -1
  125. package/static/media/warn.svg +1 -1
  126. package/types/harmony.d.ts +4 -0
  127. package/types/index.d.ts +4 -0
  128. package/types/runtime.d.ts +1 -1
  129. /package/dist/runtime-framework/solid/{contant.ts → constant.ts} +0 -0
@@ -1,32 +1,22 @@
1
1
  /* eslint-disable accessor-pairs */
2
2
  // @ts-nocheck
3
- import { TaroAny } from '../../'
4
- import { BORDER_STYLE_MAP, FlexManager, getTransform } from './util'
3
+ import { BORDER_STYLE_MAP, FlexManager } from './util'
5
4
 
6
5
  import type { HarmonyStyle, HarmonyType, TaroStyleType, TaroTextStyleType } from './type'
7
6
 
8
7
  export { HarmonyStyle, HarmonyType, TaroStyleType, TaroTextStyleType }
9
8
 
10
9
  export default class StyleSheet {
11
-
12
10
  public hmStyle: HarmonyStyle = {}
13
11
 
14
12
  get display () {
15
13
  return this.hmStyle.display
16
14
  }
17
15
 
18
- set display (value: string) {
19
- this.hmStyle.display = value
20
- }
21
-
22
16
  get position () {
23
17
  return this.hmStyle.position
24
18
  }
25
19
 
26
- set position (value: string) {
27
- this.hmStyle.position = value
28
- }
29
-
30
20
  get padding () {
31
21
  return `${this.hmStyle.paddingTop} ${this.hmStyle.paddingRight} ${this.hmStyle.paddingBottom} ${this.hmStyle.paddingLeft}`
32
22
  }
@@ -35,34 +25,18 @@ export default class StyleSheet {
35
25
  return this.hmStyle.paddingTop
36
26
  }
37
27
 
38
- set _paddingTop (value: Length) {
39
- this.hmStyle.paddingTop = value
40
- }
41
-
42
28
  get paddingBottom () {
43
29
  return this.hmStyle.paddingBottom
44
30
  }
45
31
 
46
- set _paddingBottom (value: Length) {
47
- this.hmStyle.paddingBottom = value
48
- }
49
-
50
32
  get paddingLeft () {
51
33
  return this.hmStyle.paddingLeft
52
34
  }
53
35
 
54
- set _paddingLeft (value: Length) {
55
- this.hmStyle.paddingLeft = value
56
- }
57
-
58
36
  get paddingRight () {
59
37
  return this.hmStyle.paddingRight
60
38
  }
61
39
 
62
- set _paddingRight (value: Length) {
63
- this.hmStyle.paddingRight = value
64
- }
65
-
66
40
  get margin () {
67
41
  return `${this.hmStyle.marginTop} ${this.hmStyle.marginRight} ${this.hmStyle.marginBottom} ${this.hmStyle.marginLeft}`
68
42
  }
@@ -71,48 +45,32 @@ export default class StyleSheet {
71
45
  return this.hmStyle.marginTop
72
46
  }
73
47
 
74
- set _marginTop (value: Length) {
75
- this.hmStyle.marginTop = value
76
- }
77
-
78
48
  get marginBottom () {
79
49
  return this.hmStyle.marginBottom
80
50
  }
81
51
 
82
- set _marginBottom (value: Length) {
83
- this.hmStyle.marginBottom = value
84
- }
85
-
86
52
  get marginLeft () {
87
53
  return this.hmStyle.marginLeft
88
54
  }
89
55
 
90
- set _marginLeft (value: Length) {
91
- this.hmStyle.marginLeft = value
92
- }
93
-
94
56
  get marginRight () {
95
57
  return this.hmStyle.marginRight
96
58
  }
97
59
 
98
- set _marginRight (value: Length) {
99
- this.hmStyle.marginRight = value
100
- }
101
-
102
60
  get top () {
103
61
  return this.hmStyle.top
104
62
  }
105
63
 
106
- set _top (value: Length) {
107
- this.hmStyle.top = value
108
- }
109
-
110
64
  get left () {
111
65
  return this.hmStyle.left
112
66
  }
113
67
 
114
- set _left (value: Length) {
115
- this.hmStyle.left = value
68
+ get right () {
69
+ return this.hmStyle.right
70
+ }
71
+
72
+ get bottom () {
73
+ return this.hmStyle.bottom
116
74
  }
117
75
 
118
76
  get flex () {
@@ -123,158 +81,74 @@ export default class StyleSheet {
123
81
  return this.hmStyle.flexBasis
124
82
  }
125
83
 
126
- set _flexBasis (value: number | string) {
127
- this.hmStyle.flexBasis = value
128
- }
129
-
130
84
  get flexGrow () {
131
85
  return Number(this.hmStyle.flexGrow)
132
86
  }
133
87
 
134
- set _flexGrow (value: number) {
135
- this.hmStyle.flexGrow = value
136
- }
137
-
138
88
  get flexShrink () {
139
89
  return Number(this.hmStyle.flexShrink)
140
90
  }
141
91
 
142
- set _flexShrink (value: number) {
143
- this.hmStyle.flexShrink = value
144
- }
145
-
146
92
  get alignSelf () {
147
93
  return FlexManager.reverseItemAlign(this.hmStyle.alignSelf)
148
94
  }
149
95
 
150
- set _alignSelf (value: ItemAlign) {
151
- this.hmStyle.alignSelf = value
152
- }
153
-
154
96
  get flexDirection () {
155
97
  return FlexManager.reverseDirection(this.hmStyle.flexDirection)
156
98
  }
157
99
 
158
-
159
- set _flexDirection (value: FlexDirection) {
160
- this.hmStyle.flexDirection = value
161
- }
162
-
163
100
  get justifyContent () {
164
101
  return FlexManager.reverseFlexAlign(this.hmStyle.justifyContent)
165
102
  }
166
103
 
167
- set _justifyContent (value: FlexAlign) {
168
- this.hmStyle.justifyContent = value
169
- }
170
-
171
104
  get alignItems () {
172
105
  return FlexManager.reverseItemAlign(this.hmStyle.alignItems)
173
106
  }
174
107
 
175
- set _alignItems (value: ItemAlign) {
176
- this.hmStyle.alignItems = value
177
- }
178
-
179
108
  get alignContent () {
180
109
  return FlexManager.reverseFlexAlign(this.hmStyle.alignContent)
181
110
  }
182
111
 
183
- set _alignContent (value: FlexAlign) {
184
- this.hmStyle.alignContent = value
185
- }
186
-
187
112
  get flexWrap () {
188
113
  return FlexManager.reverseFlexWrap(this.hmStyle.flexWrap)
189
114
  }
190
115
 
191
- set _flexWrap (value: FlexWrap) {
192
- this.hmStyle.flexWrap = value
193
- }
194
-
195
116
  get width () {
196
117
  return this.hmStyle.width
197
118
  }
198
119
 
199
- set _width (value: Length) {
200
- this.hmStyle.width = value
201
- }
202
-
203
120
  get height () {
204
121
  return this.hmStyle.height
205
122
  }
206
123
 
207
- set _height (value: Length) {
208
- this.hmStyle.height = value
209
- }
210
-
211
124
  get minHeight () {
212
125
  return this.hmStyle.minHeight
213
126
  }
214
127
 
215
- set _minHeight (value: Length) {
216
- this.hmStyle.minHeight = value
217
- }
218
-
219
128
  get maxHeight () {
220
129
  return this.hmStyle.maxHeight
221
130
  }
222
131
 
223
- set _maxHeight (value: Length) {
224
- this.hmStyle.maxHeight = value
225
- }
226
-
227
132
  get minWidth () {
228
133
  return this.hmStyle.minWidth
229
134
  }
230
135
 
231
- set _minWidth (value: Length) {
232
- this.hmStyle.minWidth = value
233
- }
234
-
235
136
  get maxWidth () {
236
137
  return this.hmStyle.maxWidth
237
138
  }
238
139
 
239
- set _maxWidth (value: Length) {
240
- this.hmStyle.maxWidth = value
241
- }
242
-
243
140
  get background () {
244
141
  return `${this.backgroundColor} ${this.backgroundImage} ${this.backgroundRepeat} ${this.backgroundSize}`.trim()
245
142
  }
246
143
 
247
- set _background (value: TaroAny) {
248
- const _backgroundImage: HarmonyType.Background.backgroundImage = value?.image?.[0]
249
- if (_backgroundImage) {
250
- this.hmStyle.backgroundImage = _backgroundImage.src
251
- if (_backgroundImage.repeat) {
252
- this.hmStyle.backgroundRepeat = _backgroundImage.repeat
253
- }
254
- }
255
- this.hmStyle.backgroundImageSize = value?.size?.[0]
256
- this.hmStyle.backgroundColor = this.hmStyle.backgroundImage ? null : value?.color
257
-
258
- const _backgroundPosition: HarmonyType.Background.backgroundImagePosition = value?.position?.[0]
259
- this.hmStyle.backgroundImagePosition = _backgroundPosition
260
- }
261
-
262
144
  get backgroundColor () {
263
145
  return this.hmStyle.backgroundColor
264
146
  }
265
147
 
266
- set _backgroundColor (value: ResourceColor) {
267
- this.hmStyle.backgroundColor = value
268
- }
269
-
270
148
  get backgroundImage () {
271
149
  return this.hmStyle.backgroundImage && `url(${this.hmStyle.backgroundImage})`
272
150
  }
273
151
 
274
- set _backgroundImage (value) {
275
- this.hmStyle.backgroundImage = value?.[0]
276
- }
277
-
278
152
  get backgroundRepeat () {
279
153
  if (this.hmStyle.backgroundRepeat) {
280
154
  switch (this.hmStyle.backgroundRepeat) {
@@ -282,24 +156,16 @@ export default class StyleSheet {
282
156
  case ImageRepeat.Y: return 'repeat-y'; break
283
157
  case ImageRepeat.XY: return 'repeat'; break
284
158
  case ImageRepeat.NoRepeat: return 'no-repeat'; break
285
- }
159
+ }
286
160
  }
287
161
  }
288
162
 
289
- set _backgroundRepeat (value: ImageRepeat[]) {
290
- this.hmStyle.backgroundRepeat = value?.[0]
291
- }
292
-
293
163
  get backgroundSize () {
294
164
  if (this.hmStyle.backgroundImage) {
295
165
  return [this.hmStyle.backgroundSize.width, this.hmStyle.backgroundSize.height].join(' ')
296
166
  }
297
167
  }
298
168
 
299
- set _backgroundSize (value: HarmonyType.Background.backgroundImageSize[]) {
300
- this.hmStyle.backgroundSize = value?.[0]
301
- }
302
-
303
169
  get backgroundPosition () {
304
170
  if (this.hmStyle.backgroundPosition) {
305
171
  switch (this.hmStyle.backgroundPosition) {
@@ -320,10 +186,6 @@ export default class StyleSheet {
320
186
  }
321
187
  }
322
188
  }
323
-
324
- set _backgroundPosition (value: HarmonyType.Background.backgroundImagePosition[]) {
325
- this.hmStyle.backgroundPosition = value?.[0]
326
- }
327
189
 
328
190
  get border () {
329
191
  return [this.borderWidth, this.borderStyle, this.bordercolor].join(' ')
@@ -333,220 +195,111 @@ export default class StyleSheet {
333
195
  return this.hmStyle.borderWidth
334
196
  }
335
197
 
336
- set _borderWidth (value: Length | EdgeWidths) {
337
- this.hmStyle.borderWidth = value
338
- }
339
-
340
- get borderLeftWidth () {
198
+ get borderLeftWidth () {
341
199
  return this.hmStyle.borderLeftWidth
342
200
  }
343
201
 
344
- set _borderLeftWidth (value: Length) {
345
- this.hmStyle.borderLeftWidth = value
346
- }
347
-
348
202
  get borderRightWidth () {
349
203
  return this.hmStyle.borderRightWidth
350
204
  }
351
205
 
352
- set _borderRightWidth (value: Length) {
353
- this.hmStyle.borderRightWidth = value
354
- }
355
-
356
206
  get borderTopWidth () {
357
207
  return this.hmStyle.borderTopWidth
358
208
  }
359
209
 
360
- set _borderTopWidth (value: Length) {
361
- this.hmStyle.borderTopWidth = value
362
- }
363
-
364
210
  get borderBottomWidth () {
365
211
  return this.hmStyle.borderBottomWidth
366
212
  }
367
213
 
368
- set _borderBottomWidth (value: Length) {
369
- this.hmStyle.borderBottomWidth = value
370
- }
371
-
372
214
  get borderColor () {
373
215
  return this.hmStyle.borderColor
374
216
  }
375
217
 
376
- set _borderColor (value: ResourceColor | EdgeColors) {
377
- this.hmStyle.borderColor = value
378
- }
379
-
380
218
  get borderLeftColor () {
381
219
  return this.hmStyle.borderLeftColor
382
220
  }
383
221
 
384
- set _borderLeftColor (value: ResourceColor) {
385
- this.hmStyle.borderLeftColor = value
386
- }
387
-
388
222
  get borderRightColor () {
389
223
  return this.hmStyle.borderRightColor
390
224
  }
391
225
 
392
- set _borderRightColor (value: ResourceColor) {
393
- this.hmStyle.borderRightColor = value
394
- }
395
-
396
226
  get borderTopColor () {
397
227
  return this.hmStyle.borderTopColor
398
228
  }
399
229
 
400
- set _borderTopColor (value: ResourceColor) {
401
- this.hmStyle.borderTopColor = value
402
- }
403
-
404
230
  get borderBottomColor () {
405
231
  return this.hmStyle.borderBottomColor
406
232
  }
407
233
 
408
- set _borderBottomColor (value: ResourceColor) {
409
- this.hmStyle.borderBottomColor = value
410
- }
411
-
412
234
  get borderStyle () {
413
235
  return BORDER_STYLE_MAP.reverse(this.hmStyle.borderStyle)
414
236
  }
415
237
 
416
- set _borderStyle (value: BorderStyle | EdgeStyles) {
417
- this.hmStyle.borderStyle = value
418
- }
419
-
420
238
  get borderLeftStyle () {
421
239
  return BORDER_STYLE_MAP.reverse(this.hmStyle.borderLeftStyle)
422
240
  }
423
241
 
424
- set _borderLeftStyle (value: BorderStyle) {
425
- this.hmStyle.borderLeftStyle = value
426
- }
427
-
428
242
  get borderRightStyle () {
429
243
  return BORDER_STYLE_MAP.reverse(this.hmStyle.borderRightStyle)
430
244
  }
431
245
 
432
- set _borderRightStyle (value: BorderStyle) {
433
- this.hmStyle.borderRightStyle = value
434
- }
435
-
436
246
  get borderTopStyle () {
437
247
  return BORDER_STYLE_MAP.reverse(this.hmStyle.borderTopStyle)
438
248
  }
439
249
 
440
- set _borderTopStyle (value: BorderStyle) {
441
- this.hmStyle.borderTopStyle = value
442
- }
443
-
444
250
  get borderBottomStyle () {
445
251
  return BORDER_STYLE_MAP.reverse(this.hmStyle.borderBottomStyle)
446
252
  }
447
253
 
448
- set _borderBottomStyle (value: BorderStyle) {
449
- this.hmStyle.borderBottomStyle = value
450
- }
451
-
452
254
  get borderRadius () {
453
255
  return this.hmStyle.borderRadius
454
256
  }
455
257
 
456
- set _borderRadius (value: Length | BorderRadiuses) {
457
- this.hmStyle.borderRadius = value
458
- }
459
-
460
258
  get borderTopLeftRadius () {
461
259
  return this.hmStyle.borderTopLeftRadius
462
260
  }
463
261
 
464
- set _borderTopLeftRadius (value: Length) {
465
- this.hmStyle.borderTopLeftRadius = value
466
- }
467
-
468
262
  get borderTopRightRadius () {
469
263
  return this.hmStyle.borderTopRightRadius
470
264
  }
471
265
 
472
- set _borderTopRightRadius (value: Length) {
473
- this.hmStyle.borderTopRightRadius = value
474
- }
475
-
476
266
  get borderBottomLeftRadius () {
477
267
  return this.hmStyle.borderBottomLeftRadius
478
268
  }
479
269
 
480
- set _borderBottomLeftRadius (value: Length) {
481
- this.hmStyle.borderBottomLeftRadius = value
482
- }
483
-
484
270
  get borderBottomRightRadius () {
485
271
  return this.hmStyle.borderBottomRightRadius
486
272
  }
487
273
 
488
- set _borderBottomRightRadius (value: Length) {
489
- this.hmStyle.borderBottomRightRadius = value
490
- }
491
-
492
- get zIndex (): number {
493
- return Number(this.hmStyle.zIndex)
494
- }
495
-
496
- set zIndex (value: string) {
497
- this.hmStyle.zIndex = Number(value)
274
+ get zIndex () {
275
+ return this.hmStyle.zIndex
498
276
  }
499
277
 
500
278
  get opacity () {
501
279
  return this.hmStyle.opacity
502
280
  }
503
281
 
504
- set opacity (value: string) {
505
- const val = Number(value)
506
- this.hmStyle.opacity = Number.isNaN(val) ? 1 : val
507
- }
508
-
509
282
  get overflow () {
510
283
  return this.hmStyle.overflow ? 'hidden' : 'visible'
511
284
  }
512
285
 
513
- set overflow (value: string) {
514
- this.hmStyle.overflow = value === 'hidden'
515
- }
516
-
517
286
  get focus () {
518
287
  return !!this.hmStyle.focus
519
288
  }
520
289
 
521
- set focus (value: boolean) {
522
- this.hmStyle.focus = value
523
- }
524
-
525
290
  // 文本相关
526
291
  get color () {
527
292
  return this.hmStyle.color
528
293
  }
529
294
 
530
- set _color (value: ResourceColor) {
531
- this.hmStyle.color = value
532
- }
533
-
534
295
  get fontSize () {
535
296
  return this.hmStyle.fontSize
536
297
  }
537
298
 
538
- set _fontSize (value: number | string | Resource) {
539
- this.hmStyle.fontSize = value
540
- }
541
-
542
299
  get fontWeight () {
543
300
  return this.hmStyle.fontWeight
544
301
  }
545
302
 
546
- set _fontWeight (value: number | FontWeight | string) {
547
- this.hmStyle.fontWeight = value
548
- }
549
-
550
303
  get fontStyle () {
551
304
  switch (this.hmStyle.fontStyle) {
552
305
  case FontStyle.Italic: return 'italic'; break
@@ -555,18 +308,10 @@ export default class StyleSheet {
555
308
  }
556
309
  }
557
310
 
558
- set _fontStyle (value: FontStyle) {
559
- this.hmStyle.fontStyle = value
560
- }
561
-
562
311
  get fontFamily () {
563
312
  return this.hmStyle.fontFamily
564
313
  }
565
314
 
566
- set fontFamily (value: string) {
567
- this.hmStyle.fontFamily = value
568
- }
569
-
570
315
  get textAlign () {
571
316
  switch (this.hmStyle.textAlign) {
572
317
  case TextAlign.End: return 'right'; break
@@ -576,38 +321,34 @@ export default class StyleSheet {
576
321
  }
577
322
  }
578
323
 
579
- set _textAlign (value: TextAlign) {
580
- this.hmStyle.textAlign = value
324
+ get verticalAlign() {
325
+ switch (this.hmStyle.verticalAlign) {
326
+ case Alignment.Center: return 'middle'; break
327
+ case Alignment.Top: return 'top'; break
328
+ case Alignment.Bottom: return 'bottom'; break
329
+ default: return ''
330
+ }
581
331
  }
582
332
 
583
333
  get lineHeight () {
584
334
  return this.hmStyle.lineHeight
585
335
  }
586
336
 
587
- set _lineHeight (value: string | number | Resource) {
588
- this.hmStyle.lineHeight = value
589
- }
590
-
591
337
  get letterSpacing () {
592
338
  return this.hmStyle.letterSpacing
593
339
  }
594
340
 
595
- set _letterSpacing (value: number | string) {
596
- this.hmStyle.letterSpacing = value
597
- }
598
-
599
341
  get textDecoration () {
600
- switch (this.hmStyle.decoration) {
601
- case TextDecorationType.Underline: return 'underline'; break
602
- case TextDecorationType.Overline: return 'overline'; break
603
- case TextDecorationType.LineThrough: return 'line-through'; break
604
- case TextDecorationType.None: return 'none'; break
605
- default: return ''
342
+ if (this.hmStyle.textDecoration) {
343
+ switch (this.hmStyle.textDecoration.type) {
344
+ case TextDecorationType.Underline: return 'underline'; break
345
+ case TextDecorationType.Overline: return 'overline'; break
346
+ case TextDecorationType.LineThrough: return 'line-through'; break
347
+ case TextDecorationType.None: return 'none'; break
348
+ default: return ''
349
+ }
606
350
  }
607
- }
608
-
609
- set _decoration (value: TextDecorationType) {
610
- this.hmStyle.textDecoration = value
351
+ return ''
611
352
  }
612
353
 
613
354
  get textOverflow () {
@@ -621,42 +362,19 @@ export default class StyleSheet {
621
362
  }
622
363
  }
623
364
 
624
- set _textOverflow (value: TextOverflow) {
625
- switch (value.overflow) {
626
- case TextOverflow.Clip:
627
- case TextOverflow.Ellipsis:
628
- case TextOverflow.None: this.hmStyle.WebkitLineClamp = this.hmStyle.WebkitLineClamp || 1; break
629
- default: break
630
- }
631
- this.hmStyle.textOverflow = value
632
- }
633
-
634
365
  get WebkitLineClamp () {
635
366
  return Number(this.hmStyle.WebkitLineClamp)
636
367
  }
637
368
 
638
- set WebkitLineClamp (value: number) {
639
- this.hmStyle.WebkitLineClamp = value
640
- }
641
-
642
- set _WebkitLineClamp (value: number) {
643
- this.hmStyle.WebkitLineClamp = value
644
- }
645
-
646
369
  get transform () {
647
370
  return this.hmStyle.transform
648
371
  }
649
372
 
650
- set _transform (value: HarmonyType.Transform.Transform) {
651
- this.hmStyle.transform = getTransform(value)
652
- }
653
-
654
373
  get transformOrigin () {
655
374
  return this.hmStyle.transformOrigin
656
375
  }
657
376
 
658
- set _transformOrigin(value) {
659
- this.hmStyle.transformOrigin = value
377
+ get content () {
378
+ return this.hmStyle._content
660
379
  }
661
380
  }
662
-