@tarojs/plugin-platform-harmony-ets 4.0.0-beta.13 → 4.0.0-beta.130
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 +60 -25
- package/dist/apis/base/weapp/life-cycle.ts +1 -1
- package/dist/apis/canvas/index.ts +10 -1
- package/dist/apis/device/clipboard.ts +23 -8
- package/dist/apis/framework/index.ts +1 -1
- package/dist/apis/index.ts +24 -16
- package/dist/apis/media/image/index.ts +169 -17
- package/dist/apis/network/downloadFile.ts +3 -1
- package/dist/apis/network/uploadFile.ts +3 -1
- package/dist/apis/route/index.ts +1 -2
- package/dist/apis/storage/index.ts +135 -131
- package/dist/apis/ui/animation/animation.ts +71 -29
- package/dist/apis/ui/background.ts +3 -2
- package/dist/apis/ui/interaction/index.ts +58 -59
- package/dist/apis/ui/navigation-bar/index.ts +2 -2
- 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 +4 -5
- package/dist/apis/utils/handler.ts +2 -1
- package/dist/apis/utils/index.ts +20 -2
- package/dist/apis/utils/permissions.ts +6 -0
- package/dist/apis/wxml/IntersectionObserver.ts +18 -10
- package/dist/apis/wxml/selectorQuery.ts +26 -13
- package/dist/components-harmony-ets/button.ets +36 -9
- package/dist/components-harmony-ets/canvas.ets +51 -0
- package/dist/components-harmony-ets/checkbox.ets +69 -60
- package/dist/components-harmony-ets/form.ets +33 -15
- package/dist/components-harmony-ets/icon.ets +16 -8
- package/dist/components-harmony-ets/image.ets +22 -6
- package/dist/components-harmony-ets/index.ets +39 -0
- package/dist/components-harmony-ets/innerHtml.ets +6 -5
- package/dist/components-harmony-ets/input.ets +63 -37
- package/dist/components-harmony-ets/label.ets +43 -21
- package/dist/components-harmony-ets/listView.ets +32 -0
- package/dist/components-harmony-ets/movableArea.ets +110 -51
- package/dist/components-harmony-ets/movableView.ets +74 -47
- 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 +36 -33
- package/dist/components-harmony-ets/progress.ets +31 -24
- package/dist/components-harmony-ets/pseudo.ets +43 -35
- package/dist/components-harmony-ets/radio.ets +75 -66
- package/dist/components-harmony-ets/richText.ets +4 -25
- package/dist/components-harmony-ets/scrollList.ets +108 -0
- package/dist/components-harmony-ets/scrollView.ets +53 -44
- package/dist/components-harmony-ets/slider.ets +19 -15
- package/dist/components-harmony-ets/stickySection.ets +42 -0
- package/dist/components-harmony-ets/style.ets +274 -38
- package/dist/components-harmony-ets/swiper.ets +42 -5
- 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 +102 -46
- package/dist/components-harmony-ets/textArea.ets +49 -34
- package/dist/components-harmony-ets/utils/AttributeManager.ets +2 -2
- package/dist/components-harmony-ets/utils/DynamicCenter.ts +2 -2
- package/dist/components-harmony-ets/utils/flexManager.ets +43 -13
- package/dist/components-harmony-ets/utils/helper.ets +20 -8
- 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 +165 -104
- package/dist/components-harmony-ets/video.ets +28 -20
- package/dist/components-harmony-ets/view.ets +44 -38
- package/dist/components-harmony-ets/webView.ets +6 -5
- package/dist/index.d.ts +152 -0
- package/dist/index.js +73 -44
- package/dist/index.js.map +1 -1
- package/dist/runtime-ets/bom/URL.ts +2 -0
- package/dist/runtime-ets/bom/document.ts +5 -4
- package/dist/runtime-ets/bom/getComputedStyle.ts +2 -3
- package/dist/runtime-ets/bom/history.ts +1 -0
- package/dist/runtime-ets/bom/location.ts +1 -0
- package/dist/runtime-ets/bom/navigator.ts +1 -21
- package/dist/runtime-ets/bom/raf.ts +1 -37
- package/dist/runtime-ets/bom/window.ts +9 -5
- package/dist/runtime-ets/constant.ts +17 -10
- package/dist/runtime-ets/current.ts +26 -2
- 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 +9 -12
- package/dist/runtime-ets/dom/element/canvas.ts +137 -0
- package/dist/runtime-ets/dom/element/element.ts +355 -71
- package/dist/runtime-ets/dom/element/form.ts +26 -22
- package/dist/runtime-ets/dom/element/index.ts +22 -2
- package/dist/runtime-ets/dom/element/movableArea.ts +0 -1
- package/dist/runtime-ets/dom/element/movableView.ts +238 -2
- package/dist/runtime-ets/dom/element/normal.ts +27 -6
- package/dist/runtime-ets/dom/element/progress.ts +0 -2
- package/dist/runtime-ets/dom/element/text.ts +0 -8
- package/dist/runtime-ets/dom/element/video.ts +4 -4
- package/dist/runtime-ets/dom/element/webView.ts +4 -5
- package/dist/runtime-ets/dom/event-source.ts +1 -0
- package/dist/runtime-ets/dom/event.ts +3 -5
- package/dist/runtime-ets/dom/eventTarget.ts +3 -4
- package/dist/runtime-ets/dom/node.ts +53 -22
- package/dist/runtime-ets/dom/stylesheet/covertWeb2Hm.ts +401 -243
- package/dist/runtime-ets/dom/stylesheet/index.ts +27 -316
- package/dist/runtime-ets/dom/stylesheet/type.ts +52 -11
- package/dist/runtime-ets/dom/stylesheet/util.ts +33 -27
- package/dist/runtime-ets/emitter/emitter.ts +1 -0
- package/dist/runtime-ets/env.ts +1 -0
- package/dist/runtime-ets/index.ts +23 -7
- package/dist/runtime-ets/interface/event.ts +1 -1
- package/dist/runtime-ets/interface/index.ts +6 -0
- package/dist/runtime-ets/utils/index.ts +78 -19
- package/dist/runtime-ets/utils/info.ts +2 -2
- package/dist/runtime-ets/utils/router.ts +9 -0
- package/dist/runtime-framework/react/app.ts +10 -10
- package/dist/runtime-framework/react/hooks.ts +1 -2
- package/dist/runtime-framework/react/index.ts +0 -2
- package/dist/runtime-framework/react/native-page.ts +212 -80
- package/dist/runtime-framework/react/page.ts +3 -10
- package/dist/runtime-framework/react/utils/index.ts +3 -3
- package/dist/runtime-framework/solid/app.ts +29 -46
- 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 -31
- package/dist/runtime-framework/solid/reconciler/props.ts +73 -29
- 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 +3 -5
- package/dist/runtime-utils.d.ts +826 -0
- package/dist/runtime-utils.js +575 -284
- package/dist/runtime-utils.js.map +1 -1
- package/dist/runtime.d.ts +1 -0
- package/dist/runtime.js +575 -284
- 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 +5 -0
- package/types/index.d.ts +4 -0
- package/types/runtime.d.ts +8 -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
|
|
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
|
|
256
|
-
this.hmStyle.backgroundColor = this.hmStyle.backgroundImage ? null : value?.color
|
|
257
|
-
|
|
258
|
-
const _backgroundPosition: HarmonyType.Background.backgroundImagePosition = value?.position
|
|
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
|
|
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
|
|
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
|
|
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
|
|
326
|
-
}
|
|
327
189
|
|
|
328
190
|
get border () {
|
|
329
191
|
return [this.borderWidth, this.borderStyle, this.bordercolor].join(' ')
|
|
@@ -333,219 +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: number) {
|
|
505
|
-
this.hmStyle.opacity = value
|
|
506
|
-
}
|
|
507
|
-
|
|
508
282
|
get overflow () {
|
|
509
283
|
return this.hmStyle.overflow ? 'hidden' : 'visible'
|
|
510
284
|
}
|
|
511
285
|
|
|
512
|
-
set _overflow (value: string) {
|
|
513
|
-
this.hmStyle.overflow = value === 'hidden'
|
|
514
|
-
}
|
|
515
|
-
|
|
516
286
|
get focus () {
|
|
517
287
|
return !!this.hmStyle.focus
|
|
518
288
|
}
|
|
519
289
|
|
|
520
|
-
set focus (value: boolean) {
|
|
521
|
-
this.hmStyle.focus = value
|
|
522
|
-
}
|
|
523
|
-
|
|
524
290
|
// 文本相关
|
|
525
291
|
get color () {
|
|
526
292
|
return this.hmStyle.color
|
|
527
293
|
}
|
|
528
294
|
|
|
529
|
-
set _color (value: ResourceColor) {
|
|
530
|
-
this.hmStyle.color = value
|
|
531
|
-
}
|
|
532
|
-
|
|
533
295
|
get fontSize () {
|
|
534
296
|
return this.hmStyle.fontSize
|
|
535
297
|
}
|
|
536
298
|
|
|
537
|
-
set _fontSize (value: number | string | Resource) {
|
|
538
|
-
this.hmStyle.fontSize = value
|
|
539
|
-
}
|
|
540
|
-
|
|
541
299
|
get fontWeight () {
|
|
542
300
|
return this.hmStyle.fontWeight
|
|
543
301
|
}
|
|
544
302
|
|
|
545
|
-
set _fontWeight (value: number | FontWeight | string) {
|
|
546
|
-
this.hmStyle.fontWeight = value
|
|
547
|
-
}
|
|
548
|
-
|
|
549
303
|
get fontStyle () {
|
|
550
304
|
switch (this.hmStyle.fontStyle) {
|
|
551
305
|
case FontStyle.Italic: return 'italic'; break
|
|
@@ -554,18 +308,10 @@ export default class StyleSheet {
|
|
|
554
308
|
}
|
|
555
309
|
}
|
|
556
310
|
|
|
557
|
-
set _fontStyle (value: FontStyle) {
|
|
558
|
-
this.hmStyle.fontStyle = value
|
|
559
|
-
}
|
|
560
|
-
|
|
561
311
|
get fontFamily () {
|
|
562
312
|
return this.hmStyle.fontFamily
|
|
563
313
|
}
|
|
564
314
|
|
|
565
|
-
set fontFamily (value: string) {
|
|
566
|
-
this.hmStyle.fontFamily = value
|
|
567
|
-
}
|
|
568
|
-
|
|
569
315
|
get textAlign () {
|
|
570
316
|
switch (this.hmStyle.textAlign) {
|
|
571
317
|
case TextAlign.End: return 'right'; break
|
|
@@ -575,38 +321,34 @@ export default class StyleSheet {
|
|
|
575
321
|
}
|
|
576
322
|
}
|
|
577
323
|
|
|
578
|
-
|
|
579
|
-
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
|
+
}
|
|
580
331
|
}
|
|
581
332
|
|
|
582
333
|
get lineHeight () {
|
|
583
334
|
return this.hmStyle.lineHeight
|
|
584
335
|
}
|
|
585
336
|
|
|
586
|
-
set _lineHeight (value: string | number | Resource) {
|
|
587
|
-
this.hmStyle.lineHeight = value
|
|
588
|
-
}
|
|
589
|
-
|
|
590
337
|
get letterSpacing () {
|
|
591
338
|
return this.hmStyle.letterSpacing
|
|
592
339
|
}
|
|
593
340
|
|
|
594
|
-
set _letterSpacing (value: number | string) {
|
|
595
|
-
this.hmStyle.letterSpacing = value
|
|
596
|
-
}
|
|
597
|
-
|
|
598
341
|
get textDecoration () {
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
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
|
+
}
|
|
605
350
|
}
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
set _decoration (value: TextDecorationType) {
|
|
609
|
-
this.hmStyle.textDecoration = value
|
|
351
|
+
return ''
|
|
610
352
|
}
|
|
611
353
|
|
|
612
354
|
get textOverflow () {
|
|
@@ -620,50 +362,19 @@ export default class StyleSheet {
|
|
|
620
362
|
}
|
|
621
363
|
}
|
|
622
364
|
|
|
623
|
-
set _textOverflow (value: TextOverflow) {
|
|
624
|
-
switch (value.overflow) {
|
|
625
|
-
case TextOverflow.Clip:
|
|
626
|
-
case TextOverflow.Ellipsis:
|
|
627
|
-
case TextOverflow.None: this.hmStyle.WebkitLineClamp = this.hmStyle.WebkitLineClamp || 1; break
|
|
628
|
-
default: break
|
|
629
|
-
}
|
|
630
|
-
this.hmStyle.textOverflow = value
|
|
631
|
-
}
|
|
632
|
-
|
|
633
365
|
get WebkitLineClamp () {
|
|
634
366
|
return Number(this.hmStyle.WebkitLineClamp)
|
|
635
367
|
}
|
|
636
368
|
|
|
637
|
-
set WebkitLineClamp (value: number) {
|
|
638
|
-
this.hmStyle.WebkitLineClamp = value
|
|
639
|
-
}
|
|
640
|
-
|
|
641
|
-
set _WebkitLineClamp (value: number) {
|
|
642
|
-
this.hmStyle.WebkitLineClamp = value
|
|
643
|
-
}
|
|
644
|
-
|
|
645
369
|
get transform () {
|
|
646
370
|
return this.hmStyle.transform
|
|
647
371
|
}
|
|
648
372
|
|
|
649
|
-
set _transform (value: HarmonyType.Transform.Transform) {
|
|
650
|
-
this.hmStyle.transform = getTransform(value)
|
|
651
|
-
}
|
|
652
|
-
|
|
653
373
|
get transformOrigin () {
|
|
654
374
|
return this.hmStyle.transformOrigin
|
|
655
375
|
}
|
|
656
376
|
|
|
657
|
-
set _transformOrigin(value) {
|
|
658
|
-
this.hmStyle.transformOrigin = value
|
|
659
|
-
}
|
|
660
|
-
|
|
661
377
|
get content () {
|
|
662
378
|
return this.hmStyle._content
|
|
663
379
|
}
|
|
664
|
-
|
|
665
|
-
set _content (value) {
|
|
666
|
-
this.hmStyle.content = value
|
|
667
|
-
}
|
|
668
380
|
}
|
|
669
|
-
|