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