@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.
- package/dist/apis/base/system.ts +73 -20
- package/dist/apis/canvas/index.ts +10 -1
- package/dist/apis/device/clipboard.ts +16 -8
- package/dist/apis/framework/index.ts +1 -5
- package/dist/apis/index.ts +25 -17
- package/dist/apis/media/image/index.ts +1 -1
- package/dist/apis/storage/index.ts +146 -78
- package/dist/apis/ui/animation/animation.ts +71 -29
- package/dist/apis/ui/background.ts +2 -1
- package/dist/apis/ui/interaction/index.ts +42 -59
- package/dist/apis/ui/navigation-bar/index.ts +1 -1
- package/dist/apis/ui/pull-down-refresh.ts +9 -3
- package/dist/apis/ui/scroll/index.ts +5 -5
- package/dist/apis/ui/tab-bar.ts +3 -3
- package/dist/apis/utils/index.ts +2 -1
- package/dist/apis/wxml/IntersectionObserver.ts +18 -10
- package/dist/apis/wxml/selectorQuery.ts +26 -13
- package/dist/components-harmony-ets/button.ets +64 -34
- package/dist/components-harmony-ets/canvas.ets +51 -0
- package/dist/components-harmony-ets/checkbox.ets +72 -61
- package/dist/components-harmony-ets/form.ets +51 -29
- package/dist/components-harmony-ets/icon.ets +31 -19
- package/dist/components-harmony-ets/image.ets +34 -14
- package/dist/components-harmony-ets/index.ets +92 -0
- package/dist/components-harmony-ets/innerHtml.ets +11 -6
- package/dist/components-harmony-ets/input.ets +49 -41
- package/dist/components-harmony-ets/label.ets +71 -44
- package/dist/components-harmony-ets/listView.ets +26 -0
- package/dist/components-harmony-ets/movableArea.ets +126 -0
- package/dist/components-harmony-ets/movableView.ets +93 -0
- package/dist/components-harmony-ets/navigationBar.ets +65 -0
- package/dist/components-harmony-ets/pageMeta.ets +94 -0
- package/dist/components-harmony-ets/picker.ets +42 -38
- package/dist/components-harmony-ets/progress.ets +52 -0
- package/dist/components-harmony-ets/pseudo.ets +80 -0
- package/dist/components-harmony-ets/radio.ets +74 -64
- package/dist/components-harmony-ets/richText.ets +14 -30
- package/dist/components-harmony-ets/scrollList.ets +94 -0
- package/dist/components-harmony-ets/scrollView.ets +61 -57
- package/dist/components-harmony-ets/slider.ets +18 -14
- package/dist/components-harmony-ets/stickySection.ets +42 -0
- package/dist/components-harmony-ets/style.ets +381 -130
- package/dist/components-harmony-ets/swiper.ets +61 -20
- package/dist/components-harmony-ets/switch.ets +36 -32
- package/dist/components-harmony-ets/{index.ts → tag.ts} +6 -0
- package/dist/components-harmony-ets/text.ets +135 -49
- package/dist/components-harmony-ets/textArea.ets +50 -35
- package/dist/components-harmony-ets/utils/AttributeManager.ets +1 -1
- package/dist/components-harmony-ets/utils/DynamicCenter.ts +2 -2
- package/dist/components-harmony-ets/utils/flexManager.ets +49 -19
- package/dist/components-harmony-ets/utils/helper.ets +18 -5
- package/dist/components-harmony-ets/utils/htmlParser/HarmonyHTMLParser.ts +1 -2
- package/dist/components-harmony-ets/utils/htmlParser/index.ts +1 -1
- package/dist/components-harmony-ets/utils/index.ts +54 -50
- package/dist/components-harmony-ets/utils/styles.ets +170 -93
- package/dist/components-harmony-ets/video.ets +34 -21
- package/dist/components-harmony-ets/view.ets +63 -52
- package/dist/components-harmony-ets/webView.ets +40 -34
- package/dist/index.d.ts +152 -0
- package/dist/index.js +99 -55
- package/dist/index.js.map +1 -1
- package/dist/runtime-ets/bom/document.ts +6 -4
- package/dist/runtime-ets/bom/getComputedStyle.ts +2 -2
- package/dist/runtime-ets/bom/window.ts +7 -0
- package/dist/runtime-ets/current.ts +3 -0
- package/dist/runtime-ets/dom/bind.ts +28 -12
- package/dist/runtime-ets/dom/class-list.ts +2 -2
- package/dist/runtime-ets/dom/cssNesting.ts +419 -0
- package/dist/runtime-ets/dom/cssStyleDeclaration.ts +28 -42
- package/dist/runtime-ets/dom/document.ts +8 -11
- package/dist/runtime-ets/dom/element/canvas.ts +136 -0
- package/dist/runtime-ets/dom/element/element.ts +348 -57
- package/dist/runtime-ets/dom/element/form.ts +31 -26
- package/dist/runtime-ets/dom/element/index.ts +30 -2
- package/dist/runtime-ets/dom/element/movableArea.ts +11 -0
- package/dist/runtime-ets/dom/element/movableView.ts +244 -0
- package/dist/runtime-ets/dom/element/normal.ts +35 -8
- package/dist/runtime-ets/dom/element/progress.ts +11 -0
- package/dist/runtime-ets/dom/element/scrollView.ts +1 -0
- package/dist/runtime-ets/dom/element/text.ts +1 -8
- package/dist/runtime-ets/dom/element/video.ts +5 -4
- package/dist/runtime-ets/dom/element/webView.ts +12 -5
- package/dist/runtime-ets/dom/event.ts +2 -4
- package/dist/runtime-ets/dom/eventTarget.ts +2 -3
- package/dist/runtime-ets/dom/node.ts +54 -29
- package/dist/runtime-ets/dom/stylesheet/covertWeb2Hm.ts +416 -235
- package/dist/runtime-ets/dom/stylesheet/index.ts +29 -311
- package/dist/runtime-ets/dom/stylesheet/type.ts +51 -9
- package/dist/runtime-ets/dom/stylesheet/util.ts +33 -27
- package/dist/runtime-ets/index.ts +2 -1
- package/dist/runtime-ets/interface/event.ts +1 -1
- package/dist/runtime-ets/utils/index.ts +73 -13
- package/dist/runtime-ets/utils/info.ts +2 -2
- package/dist/runtime-framework/react/app.ts +9 -4
- package/dist/runtime-framework/react/hooks.ts +0 -1
- package/dist/runtime-framework/react/index.ts +0 -2
- package/dist/runtime-framework/react/native-page.ts +154 -77
- package/dist/runtime-framework/react/page.ts +3 -8
- package/dist/runtime-framework/solid/app.ts +25 -45
- package/dist/runtime-framework/solid/connect.ts +21 -3
- package/dist/runtime-framework/solid/hooks.ts +16 -11
- package/dist/runtime-framework/solid/index.ts +6 -2
- package/dist/runtime-framework/solid/page.ts +84 -30
- package/dist/runtime-framework/solid/reconciler/props.ts +70 -25
- package/dist/runtime-framework/solid/reconciler/render.ts +16 -6
- 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 +827 -0
- package/dist/runtime-utils.js +435 -218
- package/dist/runtime-utils.js.map +1 -1
- package/dist/runtime.d.ts +1 -0
- package/dist/runtime.js +435 -218
- package/dist/runtime.js.map +1 -1
- package/index.js +3 -1
- package/package.json +14 -15
- package/static/media/cancel.svg +1 -1
- package/static/media/circle.svg +1 -1
- package/static/media/clear.svg +1 -1
- package/static/media/download.svg +1 -1
- package/static/media/info.svg +1 -1
- package/static/media/info_circle.svg +1 -1
- package/static/media/search.svg +1 -1
- package/static/media/success.svg +1 -1
- package/static/media/success_no_circle.svg +1 -1
- package/static/media/warn.svg +1 -1
- package/types/harmony.d.ts +4 -0
- package/types/index.d.ts +4 -0
- package/types/runtime.d.ts +1 -1
- /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 {
|
|
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
|
-
|
|
115
|
-
this.hmStyle.
|
|
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
|
-
|
|
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
|
-
|
|
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)
|
|
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
|
-
|
|
580
|
-
this.hmStyle.
|
|
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
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
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
|
-
|
|
659
|
-
this.hmStyle.
|
|
377
|
+
get content () {
|
|
378
|
+
return this.hmStyle._content
|
|
660
379
|
}
|
|
661
380
|
}
|
|
662
|
-
|