@tarojs/plugin-platform-harmony-ets 4.0.0-beta.0 → 4.0.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/dist/apis/media/video/VideoContext.ts +56 -7
  2. package/dist/apis/media/video/index.ts +3 -2
  3. package/dist/components-harmony-ets/button.ets +58 -23
  4. package/dist/components-harmony-ets/checkbox.ets +154 -67
  5. package/dist/components-harmony-ets/form.ets +52 -18
  6. package/dist/components-harmony-ets/icon.ets +53 -19
  7. package/dist/components-harmony-ets/image.ets +53 -19
  8. package/dist/components-harmony-ets/input.ets +57 -18
  9. package/dist/components-harmony-ets/label.ets +52 -18
  10. package/dist/components-harmony-ets/picker.ets +139 -37
  11. package/dist/components-harmony-ets/radio.ets +157 -70
  12. package/dist/components-harmony-ets/richText.ets +52 -18
  13. package/dist/components-harmony-ets/scrollView.ets +102 -44
  14. package/dist/components-harmony-ets/slider.ets +57 -18
  15. package/dist/components-harmony-ets/swiper.ets +52 -18
  16. package/dist/components-harmony-ets/switch.ets +92 -41
  17. package/dist/components-harmony-ets/text.ets +57 -20
  18. package/dist/components-harmony-ets/textArea.ets +58 -19
  19. package/dist/components-harmony-ets/utils/DynamicCenter.ts +2 -11
  20. package/dist/components-harmony-ets/utils/flexManager.ets +1 -1
  21. package/dist/components-harmony-ets/utils/styles.ets +46 -19
  22. package/dist/components-harmony-ets/video.ets +52 -18
  23. package/dist/components-harmony-ets/view.ets +100 -32
  24. package/dist/index.js +17 -4
  25. package/dist/index.js.map +1 -1
  26. package/dist/runtime-ets/dom/cssStyleDeclaration.ts +7 -3
  27. package/dist/runtime-ets/dom/element/element.ts +1 -0
  28. package/dist/runtime-ets/dom/element/form.ts +11 -2
  29. package/dist/runtime-ets/dom/node.ts +29 -16
  30. package/dist/runtime-ets/dom/stylesheet/covertWeb2Hm.ts +551 -0
  31. package/dist/runtime-ets/dom/stylesheet/index.ts +216 -354
  32. package/dist/runtime-ets/dom/stylesheet/type.ts +46 -11
  33. package/dist/runtime-ets/dom/stylesheet/util.ts +55 -5
  34. package/dist/runtime-ets/interface/event.ts +2 -1
  35. package/dist/runtime-ets/utils/index.ts +3 -1
  36. package/dist/runtime-ets/utils/info.ts +3 -1
  37. package/dist/runtime-utils.js +48 -13
  38. package/dist/runtime-utils.js.map +1 -1
  39. package/dist/runtime.js +48 -13
  40. package/dist/runtime.js.map +1 -1
  41. package/package.json +10 -9
  42. package/static/media/cancel.svg +1 -0
  43. package/static/media/circle.svg +1 -0
  44. package/static/media/clear.svg +1 -0
  45. package/static/media/download.svg +1 -0
  46. package/static/media/info.svg +1 -0
  47. package/static/media/info_circle.svg +1 -0
  48. package/static/media/search.svg +1 -0
  49. package/static/media/success.svg +1 -0
  50. package/static/media/success_no_circle.svg +1 -0
  51. package/static/media/taro_arrow_left.svg +1 -0
  52. package/static/media/taro_home.svg +1 -0
  53. package/static/media/waiting.svg +1 -0
  54. package/static/media/warn.svg +1 -0
@@ -1,19 +1,68 @@
1
+ // @ts-nocheck
2
+ import { document } from '@tarojs/runtime'
3
+
1
4
  import { temporarilyNotSupport } from '../../utils'
2
5
 
6
+ import type { TaroVideoElement } from '@tarojs/runtime'
3
7
  import type Taro from '@tarojs/taro/types'
4
8
 
5
9
  export class VideoContext implements Taro.VideoContext {
10
+ id: string
11
+
12
+ video: TaroVideoElement
13
+
14
+ controller: VideoController
15
+
16
+ constructor (id: string) {
17
+ this.id = id
18
+ this.video = document.getElementById(id)
19
+
20
+ if (this.video) {
21
+ this.controller = this.video.controller
22
+ }
23
+ }
24
+
25
+ play () {
26
+ if (!this.controller) return
27
+
28
+ this.controller.play()
29
+ }
30
+
31
+ pause () {
32
+ if (!this.controller) return
33
+
34
+ this.controller.pause()
35
+ }
36
+
37
+ stop () {
38
+ if (!this.controller) return
39
+
40
+ this.controller.stop()
41
+ }
42
+
43
+ seek (position: number) {
44
+ if (!this.controller) return
45
+
46
+ this.controller.setCurrentTime(position)
47
+ }
48
+
49
+ requestFullScreen () {
50
+ if (!this.controller) return
51
+
52
+ this.controller.requestFullscreen(true)
53
+ }
54
+
55
+ exitFullScreen () {
56
+ if (!this.controller) return
57
+
58
+ this.controller.exitFullscreen()
59
+ }
60
+
61
+ requestBackgroundPlayback = temporarilyNotSupport('VideoContext.requestBackgroundPlayback')
6
62
  exitBackgroundPlayback = temporarilyNotSupport('VideoContext.exitBackgroundPlayback')
7
- exitFullScreen = temporarilyNotSupport('VideoContext.exitFullScreen')
8
63
  exitPictureInPicture = temporarilyNotSupport('VideoContext.exitPictureInPicture')
9
64
  hideStatusBar = temporarilyNotSupport('VideoContext.hideStatusBar')
10
- pause = temporarilyNotSupport('VideoContext.pause')
11
- play = temporarilyNotSupport('VideoContext.play')
12
65
  playbackRate = temporarilyNotSupport('VideoContext.playbackRate')
13
- requestBackgroundPlayback = temporarilyNotSupport('VideoContext.requestBackgroundPlayback')
14
- requestFullScreen = temporarilyNotSupport('VideoContext.requestFullScreen')
15
- seek = temporarilyNotSupport('VideoContext.seek')
16
66
  sendDanmu = temporarilyNotSupport('VideoContext.sendDanmu')
17
67
  showStatusBar = temporarilyNotSupport('VideoContext.showStatusBar')
18
- stop = temporarilyNotSupport('VideoContext.stop')
19
68
  }
@@ -26,6 +26,7 @@ import mediaLibrary from '@ohos.multimedia.mediaLibrary'
26
26
  import { callAsyncFail, callAsyncSuccess, temporarilyNotSupport, validateParams } from '../../utils'
27
27
  import { VideoContext } from './VideoContext'
28
28
 
29
+ import type { TaroAny } from '@tarojs/runtime'
29
30
  import type Taro from '@tarojs/taro/types'
30
31
 
31
32
  interface IChooseVideoOptionOHOS {
@@ -43,8 +44,8 @@ const saveVideoToPhotosAlbumSchema = {
43
44
  filePath: 'String'
44
45
  }
45
46
 
46
- export const createVideoContext: typeof Taro.createVideoContext = () => {
47
- return new VideoContext()
47
+ export const createVideoContext: typeof Taro.createVideoContext = (id: string, _: TaroAny) => {
48
+ return new VideoContext(id)
48
49
  }
49
50
 
50
51
  // TODO: 1.返回属性补全
@@ -10,30 +10,65 @@ import type { TaroAny, TaroEvent, TaroButtonElement, TaroStyleType } from '@taro
10
10
  function attrs (style: TaroStyleType) {
11
11
  .id(style.id)
12
12
  .key(style.id)
13
- .width(style.width)
14
- .height(style.height)
15
- .padding({
16
- top: style.padding?.top,
17
- left: style.padding?.left || 10,
18
- right: style.padding?.right || 10,
19
- bottom: style.padding?.bottom,
20
- })
21
- .margin(style.margin)
22
13
  .flexGrow(style.flexGrow)
23
14
  .flexShrink(style.flexShrink)
24
15
  .flexBasis(style.flexBasis)
25
16
  .alignSelf(style.alignSelf)
26
- .backgroundImage(style.backgroundImage, style.backgroundRepeat)
27
- .backgroundImageSize(style.backgroundImageSize)
28
- .backgroundImagePosition(style.backgroundImagePosition)
29
- .rotate(style.rotate)
30
- .scale(style.scale)
31
- .translate(style.translate)
32
- .transform(style.transform)
33
- .borderStyle(style.borderStyle)
34
- .linearGradient(style.linearGradient)
17
+ .padding({
18
+ top: style.paddingTop,
19
+ right: style.paddingRight || 10,
20
+ bottom: style.paddingBottom,
21
+ left: style.paddingLeft || 10
22
+ })
23
+ .margin({
24
+ top: style.marginTop,
25
+ right: style.marginRight,
26
+ bottom: style.marginBottom,
27
+ left: style.marginLeft
28
+ })
29
+ .width(style.width)
30
+ .height(style.height)
31
+ .constraintSize({
32
+ minWidth: style.minWidth,
33
+ maxWidth: style.maxWidth,
34
+ minHeight: style.minHeight,
35
+ maxHeight: style.maxHeight
36
+ })
37
+ .backgroundColor(style.backgroundColor)
38
+ .backgroundImage(style.backgroundImage?.src, style.backgroundRepeat)
39
+ .backgroundImageSize(style.backgroundSize)
40
+ .backgroundImagePosition(style.backgroundPosition)
41
+ .borderStyle({
42
+ top: style.borderTopStyle,
43
+ right: style.borderRightStyle,
44
+ bottom: style.borderBottomStyle,
45
+ left: style.borderLeftStyle
46
+ })
47
+ .borderWidth({
48
+ top: style.borderTopWidth,
49
+ right: style.borderRightWidth,
50
+ bottom: style.borderBottomWidth,
51
+ left: style.borderLeftWidth
52
+ })
53
+ .borderColor({
54
+ top: style.borderTopColor,
55
+ right: style.borderRightColor,
56
+ bottom: style.borderBottomColor,
57
+ left: style.borderLeftColor
58
+ })
59
+ .borderRadius({
60
+ topLeft: style.borderTopLeftRadius,
61
+ topRight: style.borderTopRightRadius,
62
+ bottomLeft: style.borderBottomLeftRadius,
63
+ bottomRight: style.borderBottomRightRadius
64
+ })
35
65
  .zIndex(style.zIndex)
36
- .clip(style.clip)
66
+ .opacity(style.opacity)
67
+ .linearGradient(style.linearGradient)
68
+ .clip(style.overflow)
69
+ .rotate({ centerX: style.transformOrigin?.x, centerY: style.transformOrigin?.y, angle: 0 })
70
+ .scale({ centerX: style.transformOrigin?.x, centerY: style.transformOrigin?.y })
71
+ .transform(style.transform)
37
72
  }
38
73
 
39
74
  @Extend(Button)
@@ -123,10 +158,10 @@ export default function TaroButton (node: TaroButtonElement) {
123
158
  .themeStyles(getThemeAttributes(node))
124
159
  .attrs(getNormalAttributes(node))
125
160
  .constraintSize({
126
- minWidth: node.hmStyle?.constraintSize?.minWidth || getButtonMinWidth(node),
127
- minHeight: node.hmStyle?.constraintSize?.minHeight || getButtonMinHeight(node),
128
- maxWidth: node.hmStyle?.constraintSize?.maxWidth,
129
- maxHeight: node.hmStyle?.constraintSize?.maxHeight,
161
+ minWidth: node.hmStyle?.minWidth || getButtonMinWidth(node),
162
+ minHeight: node.hmStyle?.minHeight || getButtonMinHeight(node),
163
+ maxWidth: node.hmStyle?.maxWidth,
164
+ maxHeight: node.hmStyle?.maxHeight,
130
165
  })
131
166
  .type(ButtonType.Normal)
132
167
  .onClick((e: ClickEvent) => {
@@ -18,31 +18,65 @@ interface CheckboxAttrs {
18
18
  function checkboxStyle (style: TaroStyleType) {
19
19
  .id(style.id)
20
20
  .key(style.id)
21
- .padding(style.padding)
22
- .margin(style.margin)
23
- .width(style.width)
24
- .height(style.height)
25
- .constraintSize(style.constraintSize)
26
21
  .flexGrow(style.flexGrow)
27
22
  .flexShrink(style.flexShrink)
28
23
  .flexBasis(style.flexBasis)
29
24
  .alignSelf(style.alignSelf)
25
+ .padding({
26
+ top: style.paddingTop,
27
+ right: style.paddingRight,
28
+ bottom: style.paddingBottom,
29
+ left: style.paddingLeft
30
+ })
31
+ .margin({
32
+ top: style.marginTop,
33
+ right: style.marginRight,
34
+ bottom: style.marginBottom,
35
+ left: style.marginLeft
36
+ })
37
+ .width(style.width)
38
+ .height(style.height)
39
+ .constraintSize({
40
+ minWidth: style.minWidth,
41
+ maxWidth: style.maxWidth,
42
+ minHeight: style.minHeight,
43
+ maxHeight: style.maxHeight
44
+ })
30
45
  .backgroundColor(style.backgroundColor)
31
- .backgroundImage(style.backgroundImage, style.backgroundRepeat)
32
- .backgroundImageSize(style.backgroundImageSize)
33
- .backgroundImagePosition(style.backgroundImagePosition)
34
- .rotate(style.rotate)
35
- .scale(style.scale)
36
- .translate(style.translate)
37
- .transform(style.transform)
38
- .borderStyle(style.borderStyle)
39
- .borderWidth(style.borderWidth)
40
- .borderColor(style.borderColor)
41
- .borderRadius(style.borderRadius)
42
- .linearGradient(style.linearGradient)
46
+ .backgroundImage(style.backgroundImage?.src, style.backgroundRepeat)
47
+ .backgroundImageSize(style.backgroundSize)
48
+ .backgroundImagePosition(style.backgroundPosition)
49
+ .borderStyle({
50
+ top: style.borderTopStyle,
51
+ right: style.borderRightStyle,
52
+ bottom: style.borderBottomStyle,
53
+ left: style.borderLeftStyle
54
+ })
55
+ .borderWidth({
56
+ top: style.borderTopWidth,
57
+ right: style.borderRightWidth,
58
+ bottom: style.borderBottomWidth,
59
+ left: style.borderLeftWidth
60
+ })
61
+ .borderColor({
62
+ top: style.borderTopColor,
63
+ right: style.borderRightColor,
64
+ bottom: style.borderBottomColor,
65
+ left: style.borderLeftColor
66
+ })
67
+ .borderRadius({
68
+ topLeft: style.borderTopLeftRadius,
69
+ topRight: style.borderTopRightRadius,
70
+ bottomLeft: style.borderBottomLeftRadius,
71
+ bottomRight: style.borderBottomRightRadius
72
+ })
43
73
  .zIndex(style.zIndex)
44
74
  .opacity(style.opacity)
45
- .clip(style.clip)
75
+ .linearGradient(style.linearGradient)
76
+ .clip(style.overflow)
77
+ .rotate({ centerX: style.transformOrigin?.x, centerY: style.transformOrigin?.y, angle: 0 })
78
+ .scale({ centerX: style.transformOrigin?.x, centerY: style.transformOrigin?.y })
79
+ .transform(style.transform)
46
80
  }
47
81
 
48
82
  @Extend(Checkbox)
@@ -63,41 +97,60 @@ function getOptions (node: TaroCheckboxElement): CheckboxOptions {
63
97
  }
64
98
  }
65
99
 
66
- @Builder
67
- export function TaroCheckbox(node: TaroCheckboxElement) {
68
- Stack() {
69
- Row() {
70
- Checkbox(getOptions(node))
71
- .checkboxStyle(getNormalAttributes(node))
72
- .checkboxAttr(getAttributes(node))
73
- .opacity(!!node._attrs.disabled ? 0.4 : 1)
74
- .select(node.checked)
75
- .onChange((value: boolean) => {
76
- if (!!node?._attrs.disabled) {
77
- node.updateComponent()
78
- } else {
79
- node.updateCheckedValue(value)
80
-
81
- if (value) {
82
- const event: TaroEvent = createTaroEvent('change', { detail: { value: node?._attrs.value } }, node)
83
- eventHandler(event, 'change', node)
100
+ @Component
101
+ export struct TaroCheckbox {
102
+ node: TaroCheckboxElement | null = null
103
+
104
+ aboutToAppear () {
105
+ if (this.node && !this.node._isInit) {
106
+ this.node._isInit = true
107
+ this.node._reset = this.node.checked || false
108
+ }
109
+ }
110
+
111
+ build () {
112
+ if (this.node) {
113
+ Stack() {
114
+ Row() {
115
+ Checkbox(getOptions(this.node))
116
+ .checkboxStyle(getNormalAttributes(this.node))
117
+ .checkboxAttr(getAttributes(this.node))
118
+ .opacity(!!this.node._attrs.disabled ? 0.4 : 1)
119
+ .select(this.node.checked)
120
+ .onChange((value: boolean) => {
121
+ if (this.node) {
122
+ if (!!this.node?._attrs.disabled) {
123
+ this.node.updateComponent()
124
+ } else {
125
+ this.node.updateCheckedValue(value)
126
+
127
+ if (value) {
128
+ const event: TaroEvent = createTaroEvent('change', { detail: { value: this.node?._attrs.value } }, this.node)
129
+ eventHandler(event, 'change', this.node)
130
+ }
131
+ }
132
+ }
133
+ })
134
+ .onClick(shouldBindEvent((e: ClickEvent) => eventHandler(e, 'click', this.node), this.node, ['click']))
135
+ .onAreaChange(getComponentEventCallback(this.node, AREA_CHANGE_EVENT_NAME, (res: TaroAny) => {
136
+ if (this.node) {
137
+ this.node._nodeInfo.areaInfo = res[1]
138
+ }
139
+ }))
140
+ .onVisibleAreaChange(getNodeThresholds(this.node) || [0.0, 1.0], getComponentEventCallback(this.node, VISIBLE_CHANGE_EVENT_NAME))
141
+ Text(this.node.textContent)
142
+ .textAlign(TextAlign.Center)
143
+ .opacity(!!this.node._attrs.disabled ? 0.4 : 1)
144
+ }
145
+ .onClick(() => {
146
+ if (this.node) {
147
+ if (!this.node?._attrs.disabled) {
148
+ this.node.checked = !this.node.checked
84
149
  }
85
150
  }
86
151
  })
87
- .onClick(shouldBindEvent((e: ClickEvent) => eventHandler(e, 'click', node), node, ['click']))
88
- .onAreaChange(getComponentEventCallback(node, AREA_CHANGE_EVENT_NAME, (res: TaroAny) => {
89
- node._nodeInfo.areaInfo = res[1]
90
- }))
91
- .onVisibleAreaChange(getNodeThresholds(node) || [0.0, 1.0], getComponentEventCallback(node, VISIBLE_CHANGE_EVENT_NAME))
92
- Text(node.textContent)
93
- .textAlign(TextAlign.Center)
94
- .opacity(!!node._attrs.disabled ? 0.4 : 1)
95
- }
96
- .onClick(() => {
97
- if (!node?._attrs.disabled) {
98
- node.checked = !node.checked
99
152
  }
100
- })
153
+ }
101
154
  }
102
155
  }
103
156
 
@@ -105,31 +158,65 @@ export function TaroCheckbox(node: TaroCheckboxElement) {
105
158
  function checkboxGroupAttrs (style: TaroStyleType) {
106
159
  .id(style.id)
107
160
  .key(style.id)
108
- .padding(style.padding)
109
- .margin(style.margin)
110
- .width(style.width)
111
- .height(style.height)
112
- .constraintSize(style.constraintSize)
113
161
  .flexGrow(style.flexGrow)
114
162
  .flexShrink(style.flexShrink)
115
163
  .flexBasis(style.flexBasis)
116
164
  .alignSelf(style.alignSelf)
165
+ .padding({
166
+ top: style.paddingTop,
167
+ right: style.paddingRight,
168
+ bottom: style.paddingBottom,
169
+ left: style.paddingLeft
170
+ })
171
+ .margin({
172
+ top: style.marginTop,
173
+ right: style.marginRight,
174
+ bottom: style.marginBottom,
175
+ left: style.marginLeft
176
+ })
177
+ .width(style.width)
178
+ .height(style.height)
179
+ .constraintSize({
180
+ minWidth: style.minWidth,
181
+ maxWidth: style.maxWidth,
182
+ minHeight: style.minHeight,
183
+ maxHeight: style.maxHeight
184
+ })
117
185
  .backgroundColor(style.backgroundColor)
118
- .backgroundImage(style.backgroundImage, style.backgroundRepeat)
119
- .backgroundImageSize(style.backgroundImageSize)
120
- .backgroundImagePosition(style.backgroundImagePosition)
121
- .rotate(style.rotate)
122
- .scale(style.scale)
123
- .translate(style.translate)
124
- .transform(style.transform)
125
- .borderStyle(style.borderStyle)
126
- .borderWidth(style.borderWidth)
127
- .borderColor(style.borderColor)
128
- .borderRadius(style.borderRadius)
129
- .linearGradient(style.linearGradient)
186
+ .backgroundImage(style.backgroundImage?.src, style.backgroundRepeat)
187
+ .backgroundImageSize(style.backgroundSize)
188
+ .backgroundImagePosition(style.backgroundPosition)
189
+ .borderStyle({
190
+ top: style.borderTopStyle,
191
+ right: style.borderRightStyle,
192
+ bottom: style.borderBottomStyle,
193
+ left: style.borderLeftStyle
194
+ })
195
+ .borderWidth({
196
+ top: style.borderTopWidth,
197
+ right: style.borderRightWidth,
198
+ bottom: style.borderBottomWidth,
199
+ left: style.borderLeftWidth
200
+ })
201
+ .borderColor({
202
+ top: style.borderTopColor,
203
+ right: style.borderRightColor,
204
+ bottom: style.borderBottomColor,
205
+ left: style.borderLeftColor
206
+ })
207
+ .borderRadius({
208
+ topLeft: style.borderTopLeftRadius,
209
+ topRight: style.borderTopRightRadius,
210
+ bottomLeft: style.borderBottomLeftRadius,
211
+ bottomRight: style.borderBottomRightRadius
212
+ })
130
213
  .zIndex(style.zIndex)
131
214
  .opacity(style.opacity)
132
- .clip(style.clip)
215
+ .linearGradient(style.linearGradient)
216
+ .clip(style.overflow)
217
+ .rotate({ centerX: style.transformOrigin?.x, centerY: style.transformOrigin?.y, angle: 0 })
218
+ .scale({ centerX: style.transformOrigin?.x, centerY: style.transformOrigin?.y })
219
+ .transform(style.transform)
133
220
  }
134
221
 
135
222
  interface ChangeEventDetail { value: string[] }
@@ -11,31 +11,65 @@ import type { TaroAny, TaroFormElement, TaroStyleType } from '@tarojs/runtime'
11
11
  function attrs (style: TaroStyleType) {
12
12
  .id(style.id)
13
13
  .key(style.id)
14
- .padding(style.padding)
15
- .margin(style.margin)
16
- .width(style.width)
17
- .height(style.height)
18
- .constraintSize(style.constraintSize)
19
14
  .flexGrow(style.flexGrow)
20
15
  .flexShrink(style.flexShrink)
21
16
  .flexBasis(style.flexBasis)
22
17
  .alignSelf(style.alignSelf)
18
+ .padding({
19
+ top: style.paddingTop,
20
+ right: style.paddingRight,
21
+ bottom: style.paddingBottom,
22
+ left: style.paddingLeft
23
+ })
24
+ .margin({
25
+ top: style.marginTop,
26
+ right: style.marginRight,
27
+ bottom: style.marginBottom,
28
+ left: style.marginLeft
29
+ })
30
+ .width(style.width)
31
+ .height(style.height)
32
+ .constraintSize({
33
+ minWidth: style.minWidth,
34
+ maxWidth: style.maxWidth,
35
+ minHeight: style.minHeight,
36
+ maxHeight: style.maxHeight
37
+ })
23
38
  .backgroundColor(style.backgroundColor)
24
- .backgroundImage(style.backgroundImage, style.backgroundRepeat)
25
- .backgroundImageSize(style.backgroundImageSize)
26
- .backgroundImagePosition(style.backgroundImagePosition)
27
- .rotate(style.rotate)
28
- .scale(style.scale)
29
- .translate(style.translate)
30
- .transform(style.transform)
31
- .borderStyle(style.borderStyle)
32
- .borderWidth(style.borderWidth)
33
- .borderColor(style.borderColor)
34
- .borderRadius(style.borderRadius)
35
- .linearGradient(style.linearGradient)
39
+ .backgroundImage(style.backgroundImage?.src, style.backgroundRepeat)
40
+ .backgroundImageSize(style.backgroundSize)
41
+ .backgroundImagePosition(style.backgroundPosition)
42
+ .borderStyle({
43
+ top: style.borderTopStyle,
44
+ right: style.borderRightStyle,
45
+ bottom: style.borderBottomStyle,
46
+ left: style.borderLeftStyle
47
+ })
48
+ .borderWidth({
49
+ top: style.borderTopWidth,
50
+ right: style.borderRightWidth,
51
+ bottom: style.borderBottomWidth,
52
+ left: style.borderLeftWidth
53
+ })
54
+ .borderColor({
55
+ top: style.borderTopColor,
56
+ right: style.borderRightColor,
57
+ bottom: style.borderBottomColor,
58
+ left: style.borderLeftColor
59
+ })
60
+ .borderRadius({
61
+ topLeft: style.borderTopLeftRadius,
62
+ topRight: style.borderTopRightRadius,
63
+ bottomLeft: style.borderBottomLeftRadius,
64
+ bottomRight: style.borderBottomRightRadius
65
+ })
36
66
  .zIndex(style.zIndex)
37
67
  .opacity(style.opacity)
38
- .clip(style.clip)
68
+ .linearGradient(style.linearGradient)
69
+ .clip(style.overflow)
70
+ .rotate({ centerX: style.transformOrigin?.x, centerY: style.transformOrigin?.y, angle: 0 })
71
+ .scale({ centerX: style.transformOrigin?.x, centerY: style.transformOrigin?.y })
72
+ .transform(style.transform)
39
73
  }
40
74
 
41
75
  @Builder
@@ -1,4 +1,4 @@
1
- import { eventHandler, convertNumber2VP, getComponentEventCallback, AREA_CHANGE_EVENT_NAME, VISIBLE_CHANGE_EVENT_NAME } from '@tarojs/runtime'
1
+ import { eventHandler, convertNumber2VP, getComponentEventCallback, AREA_CHANGE_EVENT_NAME, VISIBLE_CHANGE_EVENT_NAME, convertNumber2PX } from '@tarojs/runtime'
2
2
 
3
3
  import { getNormalAttributes, shouldBindEvent, getNodeThresholds } from './utils/helper'
4
4
 
@@ -8,31 +8,65 @@ import type { TaroIconElement, TaroAny, TaroStyleType } from '@tarojs/runtime'
8
8
  function attrs (style: TaroStyleType) {
9
9
  .id(style.id)
10
10
  .key(style.id)
11
- .padding(style.padding)
12
- .margin(style.margin)
13
- .width(style.width || convertNumber2VP(23))
14
- .height(style.height || convertNumber2VP(23))
15
- .constraintSize(style.constraintSize)
16
11
  .flexGrow(style.flexGrow)
17
12
  .flexShrink(style.flexShrink)
18
13
  .flexBasis(style.flexBasis)
19
14
  .alignSelf(style.alignSelf)
15
+ .padding({
16
+ top: style.paddingTop,
17
+ right: style.paddingRight,
18
+ bottom: style.paddingBottom,
19
+ left: style.paddingLeft
20
+ })
21
+ .margin({
22
+ top: style.marginTop,
23
+ right: style.marginRight,
24
+ bottom: style.marginBottom,
25
+ left: style.marginLeft
26
+ })
27
+ .width(style.width || convertNumber2PX(23))
28
+ .height(style.height || convertNumber2PX(23))
29
+ .constraintSize({
30
+ minWidth: style.minWidth,
31
+ maxWidth: style.maxWidth,
32
+ minHeight: style.minHeight,
33
+ maxHeight: style.maxHeight
34
+ })
20
35
  .backgroundColor(style.backgroundColor)
21
- .backgroundImage(style.backgroundImage, style.backgroundRepeat)
22
- .backgroundImageSize(style.backgroundImageSize)
23
- .backgroundImagePosition(style.backgroundImagePosition)
24
- .rotate(style.rotate)
25
- .scale(style.scale)
26
- .translate(style.translate)
27
- .transform(style.transform)
28
- .borderStyle(style.borderStyle)
29
- .borderWidth(style.borderWidth)
30
- .borderColor(style.borderColor)
31
- .borderRadius(style.borderRadius)
32
- .linearGradient(style.linearGradient)
36
+ .backgroundImage(style.backgroundImage?.src, style.backgroundRepeat)
37
+ .backgroundImageSize(style.backgroundSize)
38
+ .backgroundImagePosition(style.backgroundPosition)
39
+ .borderStyle({
40
+ top: style.borderTopStyle,
41
+ right: style.borderRightStyle,
42
+ bottom: style.borderBottomStyle,
43
+ left: style.borderLeftStyle
44
+ })
45
+ .borderWidth({
46
+ top: style.borderTopWidth,
47
+ right: style.borderRightWidth,
48
+ bottom: style.borderBottomWidth,
49
+ left: style.borderLeftWidth
50
+ })
51
+ .borderColor({
52
+ top: style.borderTopColor,
53
+ right: style.borderRightColor,
54
+ bottom: style.borderBottomColor,
55
+ left: style.borderLeftColor
56
+ })
57
+ .borderRadius({
58
+ topLeft: style.borderTopLeftRadius,
59
+ topRight: style.borderTopRightRadius,
60
+ bottomLeft: style.borderBottomLeftRadius,
61
+ bottomRight: style.borderBottomRightRadius
62
+ })
33
63
  .zIndex(style.zIndex)
34
64
  .opacity(style.opacity)
35
- .clip(style.clip)
65
+ .linearGradient(style.linearGradient)
66
+ .clip(style.overflow)
67
+ .rotate({ centerX: style.transformOrigin?.x, centerY: style.transformOrigin?.y, angle: 0 })
68
+ .scale({ centerX: style.transformOrigin?.x, centerY: style.transformOrigin?.y })
69
+ .transform(style.transform)
36
70
  }
37
71
 
38
72
  const ICON_COLOR_MAP: TaroAny = {