@tarojs/plugin-platform-harmony-ets 4.0.0-beta.36 → 4.0.0-beta.38
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/index.ts +2 -1
- package/dist/components-harmony-ets/button.ets +30 -32
- package/dist/components-harmony-ets/checkbox.ets +52 -56
- package/dist/components-harmony-ets/form.ets +25 -27
- package/dist/components-harmony-ets/icon.ets +17 -19
- package/dist/components-harmony-ets/image.ets +9 -11
- package/dist/components-harmony-ets/input.ets +36 -38
- package/dist/components-harmony-ets/label.ets +36 -38
- package/dist/components-harmony-ets/movableArea.ets +55 -57
- package/dist/components-harmony-ets/movableView.ets +44 -46
- package/dist/components-harmony-ets/picker.ets +15 -17
- package/dist/components-harmony-ets/progress.ets +22 -24
- package/dist/components-harmony-ets/radio.ets +54 -58
- package/dist/components-harmony-ets/richText.ets +7 -9
- package/dist/components-harmony-ets/scrollView.ets +47 -49
- package/dist/components-harmony-ets/slider.ets +8 -10
- package/dist/components-harmony-ets/style.ets +8 -0
- package/dist/components-harmony-ets/swiper.ets +17 -19
- package/dist/components-harmony-ets/switch.ets +24 -26
- package/dist/components-harmony-ets/text.ets +13 -15
- package/dist/components-harmony-ets/textArea.ets +28 -30
- package/dist/components-harmony-ets/video.ets +19 -21
- package/dist/components-harmony-ets/view.ets +31 -33
- package/dist/components-harmony-ets/webView.ets +30 -32
- package/dist/runtime-ets/dom/document.ts +2 -0
- package/dist/runtime-ets/dom/element/element.ts +45 -1
- package/dist/runtime-ets/dom/node.ts +11 -7
- package/dist/runtime-ets/dom/stylesheet/type.ts +1 -0
- package/dist/runtime-utils.js +5 -46
- package/dist/runtime-utils.js.map +1 -1
- package/dist/runtime.js +5 -46
- package/dist/runtime.js.map +1 -1
- package/package.json +9 -9
|
@@ -17,80 +17,78 @@ export default struct TaroMovableArea {
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
build() {
|
|
20
|
-
if (this.node && this.node.
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
.
|
|
20
|
+
if (FlexManager.isFlexNode(this.node) && FlexManager.flexOptions(this.node).direction !== FlexDirection.Column) {
|
|
21
|
+
Row() {
|
|
22
|
+
this.createLazyChildren(this.node)
|
|
23
|
+
}
|
|
24
|
+
.attributeModifier(rowModify.setNode(this.node).setAnimationStyle(this.overwriteStyle))
|
|
25
|
+
.alignItems(FlexManager.flexOptions(this.node).alignItems as VerticalAlign)
|
|
26
|
+
.justifyContent(FlexManager.flexOptions(this.node).justifyContent)
|
|
27
|
+
.clip(true)
|
|
28
|
+
.onAreaChange((oldValue: Area, newValue: Area) => {
|
|
29
|
+
this.node.childNodes.forEach(item => {
|
|
30
|
+
if(item.nodeName === 'MOVABLE-VIEW') {
|
|
31
|
+
;(item as TaroMovableViewElement).area = {
|
|
32
|
+
w: Number( newValue.width),
|
|
33
|
+
h: Number(newValue.height)
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
})
|
|
37
|
+
})
|
|
38
|
+
.gesture(
|
|
39
|
+
PinchGesture({ fingers: 2 }).onActionStart((event: GestureEvent) => {
|
|
30
40
|
this.node.childNodes.forEach(item => {
|
|
31
41
|
if(item.nodeName === 'MOVABLE-VIEW') {
|
|
32
|
-
;(item as TaroMovableViewElement).
|
|
33
|
-
w: Number( newValue.width),
|
|
34
|
-
h: Number(newValue.height)
|
|
35
|
-
}
|
|
42
|
+
;(item as TaroMovableViewElement).startScale()
|
|
36
43
|
}
|
|
37
44
|
})
|
|
38
|
-
})
|
|
39
|
-
|
|
40
|
-
|
|
45
|
+
}).onActionUpdate((event) => {
|
|
46
|
+
const scaleArea = this.node.getAttribute('scaleArea')
|
|
47
|
+
if (scaleArea) {
|
|
41
48
|
this.node.childNodes.forEach(item => {
|
|
42
49
|
if(item.nodeName === 'MOVABLE-VIEW') {
|
|
43
|
-
;(item as TaroMovableViewElement).
|
|
50
|
+
;(item as TaroMovableViewElement).doScale(event.scale)
|
|
44
51
|
}
|
|
45
52
|
})
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
53
|
+
}
|
|
54
|
+
})
|
|
55
|
+
)
|
|
56
|
+
} else {
|
|
57
|
+
Column() {
|
|
58
|
+
this.createLazyChildren(this.node)
|
|
59
|
+
}
|
|
60
|
+
.attributeModifier(columnModify.setNode(this.node).setAnimationStyle(this.overwriteStyle))
|
|
61
|
+
.alignItems(FlexManager.flexOptions(this.node).alignItems as HorizontalAlign)
|
|
62
|
+
.justifyContent(FlexManager.flexOptions(this.node).justifyContent)
|
|
63
|
+
.clip(true)
|
|
64
|
+
.onAreaChange((oldValue: Area, newValue: Area) => {
|
|
65
|
+
this.node.childNodes.forEach(item => {
|
|
66
|
+
if(item.nodeName === 'MOVABLE-VIEW') {
|
|
67
|
+
;(item as TaroMovableViewElement).area = {
|
|
68
|
+
w: Number( newValue.width),
|
|
69
|
+
h: Number(newValue.height)
|
|
54
70
|
}
|
|
55
|
-
}
|
|
56
|
-
)
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}
|
|
61
|
-
.attributeModifier(columnModify.setNode(this.node).setAnimationStyle(this.overwriteStyle))
|
|
62
|
-
.alignItems(FlexManager.flexOptions(this.node).alignItems as HorizontalAlign)
|
|
63
|
-
.justifyContent(FlexManager.flexOptions(this.node).justifyContent)
|
|
64
|
-
.clip(true)
|
|
65
|
-
.onAreaChange((oldValue: Area, newValue: Area) => {
|
|
71
|
+
}
|
|
72
|
+
})
|
|
73
|
+
})
|
|
74
|
+
.gesture(
|
|
75
|
+
PinchGesture({ fingers: 2 }).onActionStart((event: GestureEvent) => {
|
|
66
76
|
this.node.childNodes.forEach(item => {
|
|
67
77
|
if(item.nodeName === 'MOVABLE-VIEW') {
|
|
68
|
-
;(item as TaroMovableViewElement).
|
|
69
|
-
w: Number( newValue.width),
|
|
70
|
-
h: Number(newValue.height)
|
|
71
|
-
}
|
|
78
|
+
;(item as TaroMovableViewElement).startScale()
|
|
72
79
|
}
|
|
73
80
|
})
|
|
74
|
-
})
|
|
75
|
-
|
|
76
|
-
|
|
81
|
+
}).onActionUpdate((event) => {
|
|
82
|
+
const scaleArea = this.node.getAttribute('scaleArea')
|
|
83
|
+
if (scaleArea) {
|
|
77
84
|
this.node.childNodes.forEach(item => {
|
|
78
85
|
if(item.nodeName === 'MOVABLE-VIEW') {
|
|
79
|
-
;(item as TaroMovableViewElement).
|
|
86
|
+
;(item as TaroMovableViewElement).doScale(event.scale)
|
|
80
87
|
}
|
|
81
88
|
})
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
this.node.childNodes.forEach(item => {
|
|
86
|
-
if(item.nodeName === 'MOVABLE-VIEW') {
|
|
87
|
-
;(item as TaroMovableViewElement).doScale(event.scale)
|
|
88
|
-
}
|
|
89
|
-
})
|
|
90
|
-
}
|
|
91
|
-
})
|
|
92
|
-
)
|
|
93
|
-
}
|
|
89
|
+
}
|
|
90
|
+
})
|
|
91
|
+
)
|
|
94
92
|
}
|
|
95
93
|
}
|
|
96
94
|
}
|
|
@@ -18,57 +18,55 @@ export default struct TaroMovableView {
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
build() {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
this.createLazyChildren(this.node)
|
|
27
|
-
}
|
|
28
|
-
.attributeModifier(rowModify.setNode(this.node).setAnimationStyle(this.overwriteStyle))
|
|
29
|
-
.alignItems(FlexManager.flexOptions(this.node).alignItems as VerticalAlign)
|
|
30
|
-
.justifyContent(FlexManager.flexOptions(this.node).justifyContent)
|
|
31
|
-
} else {
|
|
32
|
-
Column() {
|
|
33
|
-
this.createLazyChildren(this.node)
|
|
34
|
-
}
|
|
35
|
-
.attributeModifier(columnModify.setNode(this.node).setAnimationStyle(this.overwriteStyle))
|
|
36
|
-
.alignItems(FlexManager.flexOptions(this.node).alignItems as HorizontalAlign)
|
|
37
|
-
.justifyContent(FlexManager.flexOptions(this.node).justifyContent)
|
|
21
|
+
Stack() {
|
|
22
|
+
if (FlexManager.isFlexNode(this.node) && FlexManager.flexOptions(this.node)
|
|
23
|
+
.direction !== FlexDirection.Column) {
|
|
24
|
+
Row() {
|
|
25
|
+
this.createLazyChildren(this.node)
|
|
38
26
|
}
|
|
27
|
+
.attributeModifier(rowModify.setNode(this.node).setAnimationStyle(this.overwriteStyle))
|
|
28
|
+
.alignItems(FlexManager.flexOptions(this.node).alignItems as VerticalAlign)
|
|
29
|
+
.justifyContent(FlexManager.flexOptions(this.node).justifyContent)
|
|
30
|
+
} else {
|
|
31
|
+
Column() {
|
|
32
|
+
this.createLazyChildren(this.node)
|
|
33
|
+
}
|
|
34
|
+
.attributeModifier(columnModify.setNode(this.node).setAnimationStyle(this.overwriteStyle))
|
|
35
|
+
.alignItems(FlexManager.flexOptions(this.node).alignItems as HorizontalAlign)
|
|
36
|
+
.justifyContent(FlexManager.flexOptions(this.node).justifyContent)
|
|
39
37
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
this.node.startMove()
|
|
50
|
-
}).onActionUpdate((e: GestureEvent) => {
|
|
38
|
+
}
|
|
39
|
+
.translate({ x: this.node.position.x, y: this.node.position.y })
|
|
40
|
+
.scale({ x: this.node.scaleValue, y: this.node.scaleValue })
|
|
41
|
+
.onAreaChange((oldValue: Area, newValue: Area) => {
|
|
42
|
+
this.node.selfSize = {w: Number(newValue.width), h: Number(newValue.height)}
|
|
43
|
+
})
|
|
44
|
+
.gesture(
|
|
45
|
+
GestureGroup(GestureMode.Exclusive,
|
|
46
|
+
PanGesture({fingers:1}).onActionStart((e: GestureEvent) => {
|
|
51
47
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
y: e.offsetY
|
|
55
|
-
})
|
|
56
|
-
// 事件处理
|
|
57
|
-
const bindchange = this.node.getAttribute('bindchange')
|
|
58
|
-
if (typeof bindchange === 'function') {
|
|
59
|
-
}
|
|
48
|
+
this.node.startMove()
|
|
49
|
+
}).onActionUpdate((e: GestureEvent) => {
|
|
60
50
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}),
|
|
65
|
-
PinchGesture({ fingers: 2 }).onActionStart((event: GestureEvent) => {
|
|
66
|
-
this.node.startScale()
|
|
67
|
-
}).onActionUpdate((event) => {
|
|
68
|
-
this.node.doScale(event.scale)
|
|
51
|
+
this.node.doMove({
|
|
52
|
+
x: e.offsetX,
|
|
53
|
+
y: e.offsetY
|
|
69
54
|
})
|
|
70
|
-
|
|
55
|
+
// 事件处理
|
|
56
|
+
const bindchange = this.node.getAttribute('bindchange')
|
|
57
|
+
if (typeof bindchange === 'function') {
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
}).onActionEnd(() => {
|
|
61
|
+
// this.updatePosition()
|
|
62
|
+
this.node.checkPositionBoundary(this.node.position, this.node.scaleValue)
|
|
63
|
+
}),
|
|
64
|
+
PinchGesture({ fingers: 2 }).onActionStart((event: GestureEvent) => {
|
|
65
|
+
this.node.startScale()
|
|
66
|
+
}).onActionUpdate((event) => {
|
|
67
|
+
this.node.doScale(event.scale)
|
|
68
|
+
})
|
|
71
69
|
)
|
|
72
|
-
|
|
70
|
+
)
|
|
73
71
|
}
|
|
74
72
|
}
|
|
@@ -311,24 +311,22 @@ export default struct TaroPicker {
|
|
|
311
311
|
}
|
|
312
312
|
|
|
313
313
|
build() {
|
|
314
|
-
if (this.node && this.node.
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
this.createLazyChildren(this.node)
|
|
326
|
-
}
|
|
327
|
-
.defaultEvent()
|
|
328
|
-
.visibleChangeEvent()
|
|
329
|
-
.alignItems(FlexManager.flexOptions(this.node).alignItems as HorizontalAlign)
|
|
330
|
-
.justifyContent(FlexManager.flexOptions(this.node).justifyContent)
|
|
314
|
+
if (FlexManager.isFlexNode(this.node) && FlexManager.flexOptions(this.node).direction !== FlexDirection.Column) {
|
|
315
|
+
Row() {
|
|
316
|
+
this.createLazyChildren(this.node)
|
|
317
|
+
}
|
|
318
|
+
.defaultEvent()
|
|
319
|
+
.visibleChangeEvent()
|
|
320
|
+
.alignItems(FlexManager.flexOptions(this.node).alignItems as VerticalAlign)
|
|
321
|
+
.justifyContent(FlexManager.flexOptions(this.node).justifyContent)
|
|
322
|
+
} else {
|
|
323
|
+
Column() {
|
|
324
|
+
this.createLazyChildren(this.node)
|
|
331
325
|
}
|
|
326
|
+
.defaultEvent()
|
|
327
|
+
.visibleChangeEvent()
|
|
328
|
+
.alignItems(FlexManager.flexOptions(this.node).alignItems as HorizontalAlign)
|
|
329
|
+
.justifyContent(FlexManager.flexOptions(this.node).justifyContent)
|
|
332
330
|
}
|
|
333
331
|
}
|
|
334
332
|
}
|
|
@@ -21,33 +21,31 @@ export default struct TaroProgress {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
build() {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
Row({ space: 5 }) {
|
|
25
|
+
Progress({
|
|
26
|
+
value: parseFloat(this.node.getAttribute('percent')),
|
|
27
|
+
type: ProgressType.Linear
|
|
28
|
+
})
|
|
29
|
+
.attributeModifier(commonStyleModify.setNode(this.node).setAnimationStyle(this.overwriteStyle))
|
|
30
|
+
.color(this.node.getAttribute('activeColor') ?? PROGRESS_ACTIVECOLOR)
|
|
31
|
+
.backgroundColor(this.node.getAttribute('backgroundColor') ?? PROGRESS_BACKGROUNDCOLOR)
|
|
32
|
+
.style({
|
|
33
|
+
strokeWidth: this.node.getAttribute('strokeWidth'),
|
|
34
|
+
strokeRadius: parseFloat(this.node.getAttribute('borderRadius')),
|
|
35
|
+
enableSmoothEffect: Boolean(this.node.getAttribute('active')),
|
|
29
36
|
})
|
|
30
|
-
.attributeModifier(commonStyleModify.setNode(this.node).setAnimationStyle(this.overwriteStyle))
|
|
31
|
-
.color(this.node.getAttribute('activeColor') ?? PROGRESS_ACTIVECOLOR)
|
|
32
|
-
.backgroundColor(this.node.getAttribute('backgroundColor') ?? PROGRESS_BACKGROUNDCOLOR)
|
|
33
|
-
.style({
|
|
34
|
-
strokeWidth: this.node.getAttribute('strokeWidth'),
|
|
35
|
-
strokeRadius: parseFloat(this.node.getAttribute('borderRadius')),
|
|
36
|
-
enableSmoothEffect: Boolean(this.node.getAttribute('active')),
|
|
37
|
-
})
|
|
38
37
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
38
|
+
.onClick(shouldBindEvent((e: ClickEvent) => eventHandler(e, 'click', this.node), this.node, ['click']))
|
|
39
|
+
.onVisibleAreaChange(getNodeThresholds(this.node) || [0.0, 1.0], getComponentEventCallback(this.node, VISIBLE_CHANGE_EVENT_NAME))
|
|
40
|
+
.onAreaChange(getComponentEventCallback(this.node, AREA_CHANGE_EVENT_NAME, (res: TaroAny) => {
|
|
41
|
+
if (this.node) {
|
|
42
|
+
this.node._nodeInfo.areaInfo = res[1]
|
|
43
|
+
}
|
|
44
|
+
}))
|
|
46
45
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}
|
|
46
|
+
if (this.node.getAttribute('showInfo')) {
|
|
47
|
+
Text(`${this.node.getAttribute('percent')}%`)
|
|
48
|
+
.fontSize(this.node.getAttribute('fontSize') ?? PROGRESS_DEFAULTINFOFONTSIZE)
|
|
51
49
|
}
|
|
52
50
|
}
|
|
53
51
|
}
|
|
@@ -48,49 +48,47 @@ export struct TaroRadio {
|
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
build () {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
.
|
|
62
|
-
if (this.node) {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
eventHandler(event, 'change', this.node)
|
|
71
|
-
}
|
|
51
|
+
Stack() {
|
|
52
|
+
Row() {
|
|
53
|
+
Radio({
|
|
54
|
+
group: this.node.group || this.node.parentNode?._nid || '',
|
|
55
|
+
value: this.node.value || '',
|
|
56
|
+
})
|
|
57
|
+
.checked(this.node.checked)
|
|
58
|
+
.attributeModifier(commonStyleModify.setNode(this.node).setAnimationStyle(this.overwriteStyle))
|
|
59
|
+
.radioAttr(getAttributes(this.node))
|
|
60
|
+
.onChange((value: boolean) => {
|
|
61
|
+
if (this.node) {
|
|
62
|
+
if (!!this.node?._attrs.disabled) {
|
|
63
|
+
this.node.updateComponent()
|
|
64
|
+
} else {
|
|
65
|
+
this.node.updateCheckedValue(value)
|
|
66
|
+
|
|
67
|
+
if (value) {
|
|
68
|
+
const event: TaroEvent = createTaroEvent('change', { detail: { value: this.node?._attrs.value } }, this.node)
|
|
69
|
+
eventHandler(event, 'change', this.node)
|
|
72
70
|
}
|
|
73
71
|
}
|
|
74
|
-
})
|
|
75
|
-
.onClick(shouldBindEvent((e: ClickEvent) => eventHandler(e, 'click', this.node), this.node, ['click']))
|
|
76
|
-
.onAreaChange(getComponentEventCallback(this.node, AREA_CHANGE_EVENT_NAME, (res: TaroAny) => {
|
|
77
|
-
if (this.node) {
|
|
78
|
-
this.node._nodeInfo.areaInfo = res[1]
|
|
79
|
-
}
|
|
80
|
-
}))
|
|
81
|
-
.onVisibleAreaChange(getNodeThresholds(this.node) || [0.0, 1.0], getComponentEventCallback(this.node, VISIBLE_CHANGE_EVENT_NAME))
|
|
82
|
-
Text(this.node.textContent)
|
|
83
|
-
.textAlign(TextAlign.Center)
|
|
84
|
-
.opacity(!!this.node?._attrs.disabled ? 0.4 : 1)
|
|
85
|
-
}
|
|
86
|
-
.onClick(() => {
|
|
87
|
-
if (this.node) {
|
|
88
|
-
if (!this.node._checked && !this.node?._attrs.disabled) {
|
|
89
|
-
this.node.checked = !this.node.checked
|
|
90
72
|
}
|
|
91
|
-
}
|
|
92
|
-
|
|
73
|
+
})
|
|
74
|
+
.onClick(shouldBindEvent((e: ClickEvent) => eventHandler(e, 'click', this.node), this.node, ['click']))
|
|
75
|
+
.onAreaChange(getComponentEventCallback(this.node, AREA_CHANGE_EVENT_NAME, (res: TaroAny) => {
|
|
76
|
+
if (this.node) {
|
|
77
|
+
this.node._nodeInfo.areaInfo = res[1]
|
|
78
|
+
}
|
|
79
|
+
}))
|
|
80
|
+
.onVisibleAreaChange(getNodeThresholds(this.node) || [0.0, 1.0], getComponentEventCallback(this.node, VISIBLE_CHANGE_EVENT_NAME))
|
|
81
|
+
Text(this.node.textContent)
|
|
82
|
+
.textAlign(TextAlign.Center)
|
|
83
|
+
.opacity(!!this.node?._attrs.disabled ? 0.4 : 1)
|
|
93
84
|
}
|
|
85
|
+
.onClick(() => {
|
|
86
|
+
if (this.node) {
|
|
87
|
+
if (!this.node._checked && !this.node?._attrs.disabled) {
|
|
88
|
+
this.node.checked = !this.node.checked
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
})
|
|
94
92
|
}
|
|
95
93
|
}
|
|
96
94
|
}
|
|
@@ -130,26 +128,24 @@ export struct TaroRadioGroup {
|
|
|
130
128
|
}
|
|
131
129
|
|
|
132
130
|
build() {
|
|
133
|
-
if (this.node && this.node.
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
this.createLazyChildren(this.node)
|
|
146
|
-
}
|
|
147
|
-
.attributeModifier(commonStyleModify.setNode(this.node).setAnimationStyle(this.overwriteStyle))
|
|
148
|
-
.defaultEvent()
|
|
149
|
-
.visibleChangeEvent()
|
|
150
|
-
.alignItems(FlexManager.flexOptions(this.node).alignItems as HorizontalAlign)
|
|
151
|
-
.justifyContent(FlexManager.flexOptions(this.node).justifyContent)
|
|
131
|
+
if (FlexManager.isFlexNode(this.node) && FlexManager.flexOptions(this.node).direction !== FlexDirection.Column) {
|
|
132
|
+
Row() {
|
|
133
|
+
this.createLazyChildren(this.node)
|
|
134
|
+
}
|
|
135
|
+
.attributeModifier(commonStyleModify.setNode(this.node).setAnimationStyle(this.overwriteStyle))
|
|
136
|
+
.defaultEvent()
|
|
137
|
+
.visibleChangeEvent()
|
|
138
|
+
.alignItems(FlexManager.flexOptions(this.node).alignItems as VerticalAlign)
|
|
139
|
+
.justifyContent(FlexManager.flexOptions(this.node).justifyContent)
|
|
140
|
+
} else {
|
|
141
|
+
Column() {
|
|
142
|
+
this.createLazyChildren(this.node)
|
|
152
143
|
}
|
|
144
|
+
.attributeModifier(commonStyleModify.setNode(this.node).setAnimationStyle(this.overwriteStyle))
|
|
145
|
+
.defaultEvent()
|
|
146
|
+
.visibleChangeEvent()
|
|
147
|
+
.alignItems(FlexManager.flexOptions(this.node).alignItems as HorizontalAlign)
|
|
148
|
+
.justifyContent(FlexManager.flexOptions(this.node).justifyContent)
|
|
153
149
|
}
|
|
154
150
|
}
|
|
155
151
|
}
|
|
@@ -13,15 +13,13 @@ export default struct TaroRichText {
|
|
|
13
13
|
@ObjectLink node: TaroRichTextElement
|
|
14
14
|
|
|
15
15
|
build () {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
.onVisibleAreaChange(getNodeThresholds(this.node) || [0.0, 1.0], getComponentEventCallback(this.node, VISIBLE_CHANGE_EVENT_NAME))
|
|
24
|
-
}
|
|
16
|
+
RichText(generateText(this.node))
|
|
17
|
+
.attributeModifier(commonStyleModify.setNode(this.node))
|
|
18
|
+
.onClick(shouldBindEvent((e: ClickEvent) => eventHandler(e, 'click', this.node), this.node, ['click']))
|
|
19
|
+
.onAreaChange(getComponentEventCallback(this.node, AREA_CHANGE_EVENT_NAME, (res: TaroAny) => {
|
|
20
|
+
this.node._nodeInfo.areaInfo = res[1]
|
|
21
|
+
}))
|
|
22
|
+
.onVisibleAreaChange(getNodeThresholds(this.node) || [0.0, 1.0], getComponentEventCallback(this.node, VISIBLE_CHANGE_EVENT_NAME))
|
|
25
23
|
}
|
|
26
24
|
}
|
|
27
25
|
|
|
@@ -71,59 +71,57 @@ export default struct TaroScrollView {
|
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
build () {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
this.createLazyChildren(this.node)
|
|
82
|
-
}
|
|
74
|
+
Scroll(this.node.scroller) {
|
|
75
|
+
if (this.node._attrs.scrollX) {
|
|
76
|
+
Row() {
|
|
77
|
+
if (this.node._pseudo_before || this.node._pseudo_after) {
|
|
78
|
+
PseduoChildren({ node: this.node, createLazyChildren: this.createLazyChildren })
|
|
79
|
+
} else {
|
|
80
|
+
this.createLazyChildren(this.node)
|
|
83
81
|
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
82
|
+
}
|
|
83
|
+
.attributeModifier(rowModify.setNode(this.node).setAnimationStyle(this.overwriteStyle))
|
|
84
|
+
.width(null)
|
|
85
|
+
.onAreaChange(shouldBindEvent((_: Area, areaResult: Area) => {
|
|
86
|
+
this.node._nodeInfo._scroll = areaResult
|
|
87
|
+
}, this.node, ['scroll', 'scrollstart', 'scrollend']))
|
|
88
|
+
.alignItems(FlexManager.flexOptions(this.node).alignItems as VerticalAlign)
|
|
89
|
+
.justifyContent(FlexManager.flexOptions(this.node).justifyContent)
|
|
90
|
+
.flexGrow(0).flexShrink(0)
|
|
91
|
+
} else {
|
|
92
|
+
Column() {
|
|
93
|
+
if (this.node._pseudo_before || this.node._pseudo_after) {
|
|
94
|
+
PseduoChildren({ node: this.node, createLazyChildren: this.createLazyChildren })
|
|
95
|
+
} else {
|
|
96
|
+
this.createLazyChildren(this.node)
|
|
99
97
|
}
|
|
100
|
-
.attributeModifier(columnModify.setNode(this.node).setAnimationStyle(this.overwriteStyle))
|
|
101
|
-
.height(null)
|
|
102
|
-
.alignItems(HorizontalAlign.Start)
|
|
103
|
-
.onAreaChange(shouldBindEvent((_: Area, areaResult: Area) => {
|
|
104
|
-
this.node._nodeInfo._scroll = areaResult
|
|
105
|
-
}, this.node, ['scroll', 'scrollstart', 'scrollend']))
|
|
106
|
-
.alignItems(FlexManager.flexOptions(this.node).alignItems as HorizontalAlign)
|
|
107
|
-
.justifyContent(FlexManager.flexOptions(this.node).justifyContent)
|
|
108
|
-
.flexGrow(0).flexShrink(0)
|
|
109
98
|
}
|
|
99
|
+
.attributeModifier(columnModify.setNode(this.node).setAnimationStyle(this.overwriteStyle))
|
|
100
|
+
.height(null)
|
|
101
|
+
.alignItems(HorizontalAlign.Start)
|
|
102
|
+
.onAreaChange(shouldBindEvent((_: Area, areaResult: Area) => {
|
|
103
|
+
this.node._nodeInfo._scroll = areaResult
|
|
104
|
+
}, this.node, ['scroll', 'scrollstart', 'scrollend']))
|
|
105
|
+
.alignItems(FlexManager.flexOptions(this.node).alignItems as HorizontalAlign)
|
|
106
|
+
.justifyContent(FlexManager.flexOptions(this.node).justifyContent)
|
|
107
|
+
.flexGrow(0).flexShrink(0)
|
|
110
108
|
}
|
|
111
|
-
.width(getStyleAttr(this.node, 'width'))
|
|
112
|
-
.height(getStyleAttr(this.node, 'height'))
|
|
113
|
-
.flexGrow(this.node.hmStyle?.flexGrow)
|
|
114
|
-
.flexShrink(this.node.hmStyle?.flexShrink)
|
|
115
|
-
.scrollable(getScrollable(this.node))
|
|
116
|
-
.scrollBar(getAttributes(this.node).scrollBar)
|
|
117
|
-
.onClick(shouldBindEvent((e: ClickEvent) => eventHandler(e, 'click', this.node), this.node, ['click']))
|
|
118
|
-
.onTouch(shouldBindEvent((e: TouchEvent) => eventHandler(e, TOUCH_EVENT_MAP.get(e.type), this.node), this.node, TOUCH_EVENT_MAP.values()))
|
|
119
|
-
.onAreaChange(getComponentEventCallback(this.node, AREA_CHANGE_EVENT_NAME, (res: TaroAny) => {
|
|
120
|
-
this.node._nodeInfo.areaInfo = res[1]
|
|
121
|
-
}))
|
|
122
|
-
.onScroll(shouldBindEvent(() => { handleScrollEvent(this.node, 'scroll') }, this.node, ['scroll']))
|
|
123
|
-
.onScrollStart(shouldBindEvent(() => { handleScrollEvent(this.node, 'scrollstart') }, this.node, ['scrollstart']))
|
|
124
|
-
.onScrollStop(shouldBindEvent(() => { handleScrollEvent(this.node, 'scrollend') }, this.node, ['scrollend']))
|
|
125
|
-
.onVisibleAreaChange(getNodeThresholds(this.node) || [0.0, 1.0], getComponentEventCallback(this.node, VISIBLE_CHANGE_EVENT_NAME))
|
|
126
|
-
.onReachEnd(shouldBindEvent(() => { handleScrollEvent(this.node, 'scrolltolower') }, this.node, ['scrolltolower']))
|
|
127
109
|
}
|
|
110
|
+
.width(getStyleAttr(this.node, 'width'))
|
|
111
|
+
.height(getStyleAttr(this.node, 'height'))
|
|
112
|
+
.flexGrow(this.node.hmStyle?.flexGrow)
|
|
113
|
+
.flexShrink(this.node.hmStyle?.flexShrink)
|
|
114
|
+
.scrollable(getScrollable(this.node))
|
|
115
|
+
.scrollBar(getAttributes(this.node).scrollBar)
|
|
116
|
+
.onClick(shouldBindEvent((e: ClickEvent) => eventHandler(e, 'click', this.node), this.node, ['click']))
|
|
117
|
+
.onTouch(shouldBindEvent((e: TouchEvent) => eventHandler(e, TOUCH_EVENT_MAP.get(e.type), this.node), this.node, TOUCH_EVENT_MAP.values()))
|
|
118
|
+
.onAreaChange(getComponentEventCallback(this.node, AREA_CHANGE_EVENT_NAME, (res: TaroAny) => {
|
|
119
|
+
this.node._nodeInfo.areaInfo = res[1]
|
|
120
|
+
}))
|
|
121
|
+
.onScroll(shouldBindEvent(() => { handleScrollEvent(this.node, 'scroll') }, this.node, ['scroll']))
|
|
122
|
+
.onScrollStart(shouldBindEvent(() => { handleScrollEvent(this.node, 'scrollstart') }, this.node, ['scrollstart']))
|
|
123
|
+
.onScrollStop(shouldBindEvent(() => { handleScrollEvent(this.node, 'scrollend') }, this.node, ['scrollend']))
|
|
124
|
+
.onVisibleAreaChange(getNodeThresholds(this.node) || [0.0, 1.0], getComponentEventCallback(this.node, VISIBLE_CHANGE_EVENT_NAME))
|
|
125
|
+
.onReachEnd(shouldBindEvent(() => { handleScrollEvent(this.node, 'scrolltolower') }, this.node, ['scrolltolower']))
|
|
128
126
|
}
|
|
129
127
|
}
|
|
@@ -97,18 +97,16 @@ export default struct TaroSlider {
|
|
|
97
97
|
}
|
|
98
98
|
|
|
99
99
|
build() {
|
|
100
|
-
if (this.node
|
|
101
|
-
|
|
102
|
-
Row() {
|
|
103
|
-
this.createSlider(this.node)
|
|
104
|
-
Text(Number(this.value).toFixed(0))
|
|
105
|
-
.width('10%')
|
|
106
|
-
.textAlign(TextAlign.Center)
|
|
107
|
-
.opacity(!!this.node._attrs.disabled ? 0.4 : 1)
|
|
108
|
-
}
|
|
109
|
-
} else {
|
|
100
|
+
if (!!this.node._attrs.showValue) {
|
|
101
|
+
Row() {
|
|
110
102
|
this.createSlider(this.node)
|
|
103
|
+
Text(Number(this.value).toFixed(0))
|
|
104
|
+
.width('10%')
|
|
105
|
+
.textAlign(TextAlign.Center)
|
|
106
|
+
.opacity(!!this.node._attrs.disabled ? 0.4 : 1)
|
|
111
107
|
}
|
|
108
|
+
} else {
|
|
109
|
+
this.createSlider(this.node)
|
|
112
110
|
}
|
|
113
111
|
}
|
|
114
112
|
}
|
|
@@ -208,6 +208,14 @@ export function setNormalAttributeIntoInstance(instance: CommonAttribute, style:
|
|
|
208
208
|
instance.id(style.id)
|
|
209
209
|
instance.key(style.id)
|
|
210
210
|
}
|
|
211
|
+
if (!isUndefined(style.display) || !isUndefined(style.visibility)) {
|
|
212
|
+
instance.visibility(style.display === 'none'
|
|
213
|
+
? Visibility.None :
|
|
214
|
+
!isUndefined(style.visibility)
|
|
215
|
+
? (style.visibility === 'hidden' ? Visibility.Hidden : Visibility.Visible)
|
|
216
|
+
: Visibility.Visible
|
|
217
|
+
)
|
|
218
|
+
}
|
|
211
219
|
if (!isUndefined(style.flexGrow)) {
|
|
212
220
|
instance.flexGrow(style.flexGrow)
|
|
213
221
|
}
|