@tarojs/plugin-platform-harmony-ets 4.0.0-beta.97 → 4.0.0-beta.99
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/components-harmony-ets/input.ets +1 -1
- package/dist/components-harmony-ets/label.ets +3 -3
- package/dist/components-harmony-ets/navigationBar.ets +1 -1
- package/dist/components-harmony-ets/pageMeta.ets +1 -1
- package/dist/components-harmony-ets/radio.ets +2 -2
- package/dist/components-harmony-ets/text.ets +13 -32
- package/dist/components-harmony-ets/textArea.ets +1 -1
- package/dist/components-harmony-ets/utils/styles.ets +1 -1
- package/package.json +9 -9
|
@@ -72,7 +72,7 @@ export default struct TaroInput {
|
|
|
72
72
|
|
|
73
73
|
build () {
|
|
74
74
|
TextInput({ text: this.value, placeholder: this.node._attrs?.placeholder || '', controller: this.node.controller })
|
|
75
|
-
.key(this.node._nid)
|
|
75
|
+
.key(this.node._nid.toString())
|
|
76
76
|
.type(getInputType(this.node))
|
|
77
77
|
.maxLength(Number(this.node._attrs?.maxlength) || null)
|
|
78
78
|
.placeholderColor(getPlaceholderColor(this.node))
|
|
@@ -56,7 +56,7 @@ export default struct TaroLabel {
|
|
|
56
56
|
.attributeModifier(commonStyleModify.setNode(this.node).setAnimationStyle(this.overwriteStyle))
|
|
57
57
|
.onClick((e: ClickEvent) => {
|
|
58
58
|
const firstChild: TaroElement | null = this.node.childNodes[0] as TaroElement | null
|
|
59
|
-
const id: string = this.node._attrs.for || firstChild?._attrs.id || firstChild?._nid || ''
|
|
59
|
+
const id: string = this.node._attrs.for || firstChild?._attrs.id || firstChild?._nid.toString() || ''
|
|
60
60
|
|
|
61
61
|
handleTargetChange(id)
|
|
62
62
|
eventHandler(e, 'click', this.node)
|
|
@@ -73,7 +73,7 @@ export default struct TaroLabel {
|
|
|
73
73
|
.attributeModifier(rowModify.setNode(this.node).setAnimationStyle(this.overwriteStyle))
|
|
74
74
|
.onClick((e: ClickEvent) => {
|
|
75
75
|
const firstChild: TaroElement | null = this.node.childNodes[0] as TaroElement | null
|
|
76
|
-
const id: string = this.node._attrs.for || firstChild?._attrs.id || firstChild?._nid || ''
|
|
76
|
+
const id: string = this.node._attrs.for || firstChild?._attrs.id || firstChild?._nid.toString() || ''
|
|
77
77
|
|
|
78
78
|
handleTargetChange(id)
|
|
79
79
|
eventHandler(e, 'click', this.node)
|
|
@@ -90,7 +90,7 @@ export default struct TaroLabel {
|
|
|
90
90
|
.attributeModifier(columnModify.setNode(this.node).setAnimationStyle(this.overwriteStyle))
|
|
91
91
|
.onClick((e: ClickEvent) => {
|
|
92
92
|
const firstChild: TaroElement | null = this.node.childNodes[0] as TaroElement | null
|
|
93
|
-
const id: string = this.node._attrs.for || firstChild?._attrs.id || firstChild?._nid || ''
|
|
93
|
+
const id: string = this.node._attrs.for || firstChild?._attrs.id || firstChild?._nid.toString() || ''
|
|
94
94
|
|
|
95
95
|
handleTargetChange(id)
|
|
96
96
|
eventHandler(e, 'click', this.node)
|
|
@@ -29,7 +29,7 @@ export default struct TaroNavigationBar {
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
handleAttributeUpdate = (opt: IComponentAttributeUpdateEvents) => {
|
|
32
|
-
if (opt.id === this.node._nid && opt.tagName === 'NAVIGATION-BAR') {
|
|
32
|
+
if (opt.id === this.node._nid.toString() && opt.tagName === 'NAVIGATION-BAR') {
|
|
33
33
|
const attrs: Record<string, TaroAny> = {}
|
|
34
34
|
attrs[opt.attribute] = opt.value
|
|
35
35
|
this.handleAttributes(attrs)
|
|
@@ -41,7 +41,7 @@ export default struct TaroPageMeta {
|
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
handleAttributeUpdate = (opt: IComponentAttributeUpdateEvents) => {
|
|
44
|
-
if (opt.id === this.node._nid && opt.tagName === 'PAGE-META') {
|
|
44
|
+
if (opt.id === this.node._nid.toString() && opt.tagName === 'PAGE-META') {
|
|
45
45
|
const attrs: Record<string, TaroAny> = {}
|
|
46
46
|
attrs[opt.attribute] = opt.value
|
|
47
47
|
this.handleAttributes(attrs)
|
|
@@ -55,7 +55,7 @@ export struct TaroRadio {
|
|
|
55
55
|
Stack() {
|
|
56
56
|
Row() {
|
|
57
57
|
Radio({
|
|
58
|
-
group: this.node.group || this.node.parentNode?._nid || '',
|
|
58
|
+
group: this.node.group || this.node.parentNode?._nid.toString() || '',
|
|
59
59
|
value: this.node.value || '',
|
|
60
60
|
})
|
|
61
61
|
.checked(this.node.checked)
|
|
@@ -114,7 +114,7 @@ export struct TaroRadioGroup {
|
|
|
114
114
|
this.node._instance = this
|
|
115
115
|
const childList = this.node.getElementsByTagName<TaroRadioElement>('RADIO')
|
|
116
116
|
childList.forEach(element => {
|
|
117
|
-
element.group = this.node?._attrs.name || this.node?._nid
|
|
117
|
+
element.group = this.node?._attrs.name || this.node?._nid.toString()
|
|
118
118
|
})
|
|
119
119
|
// 阻止事件冒泡传递上去
|
|
120
120
|
this.node.addEventListener('change', (e: TaroEvent) => e.stopPropagation())
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isString } from '@tarojs/shared'
|
|
2
2
|
import { eventHandler, convertNumber2VP, getComponentEventCallback, AREA_CHANGE_EVENT_NAME, VISIBLE_CHANGE_EVENT_NAME, NodeType } from '@tarojs/runtime'
|
|
3
3
|
|
|
4
|
-
import { textModify, setNormalTextAttributeIntoInstance } from './style'
|
|
4
|
+
import commonStyleModify, { textModify, setNormalTextAttributeIntoInstance } from './style'
|
|
5
5
|
import { getButtonColor } from './button'
|
|
6
6
|
import { getImageMode } from './image'
|
|
7
7
|
import { BUTTON_THEME_COLOR } from './utils/constant/style'
|
|
@@ -74,42 +74,23 @@ export default struct TaroText {
|
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
+
function getImageSpanAlignment (align: TaroAny): TaroAny {
|
|
78
|
+
if (align === Alignment.Top) {
|
|
79
|
+
return ImageSpanAlignment.TOP
|
|
80
|
+
} else if (align === Alignment.Bottom) {
|
|
81
|
+
return ImageSpanAlignment.BOTTOM
|
|
82
|
+
} else if (align === Alignment.Center) {
|
|
83
|
+
return ImageSpanAlignment.CENTER
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
77
87
|
@Builder
|
|
78
88
|
function createTextChildNode (item: TaroElement) {
|
|
79
89
|
if (item.tagName === 'IMAGE') {
|
|
80
90
|
ImageSpan(item.getAttribute('src'))
|
|
81
|
-
|
|
91
|
+
.attributeModifier(commonStyleModify.setNode(item))
|
|
82
92
|
.objectFit(getImageMode(item.getAttribute('mode')))
|
|
83
|
-
|
|
84
|
-
.width(item._st.hmStyle.width)
|
|
85
|
-
.height(item._st.hmStyle.height)
|
|
86
|
-
.margin({
|
|
87
|
-
top: item._st.hmStyle.marginTop,
|
|
88
|
-
left: item._st.hmStyle.marginLeft,
|
|
89
|
-
right: item._st.hmStyle.marginRight,
|
|
90
|
-
bottom: item._st.hmStyle.marginBottom,
|
|
91
|
-
})
|
|
92
|
-
.padding({
|
|
93
|
-
top: item._st.hmStyle.paddingTop,
|
|
94
|
-
left: item._st.hmStyle.paddingLeft,
|
|
95
|
-
right: item._st.hmStyle.paddingRight,
|
|
96
|
-
bottom: item._st.hmStyle.paddingBottom,
|
|
97
|
-
})
|
|
98
|
-
.textBackgroundStyle({
|
|
99
|
-
color: item._st.hmStyle.backgroundColor,
|
|
100
|
-
radius: {
|
|
101
|
-
topLeft: item._st.hmStyle.borderTopLeftRadius,
|
|
102
|
-
topRight: item._st.hmStyle.borderTopRightRadius,
|
|
103
|
-
bottomLeft: item._st.hmStyle.borderBottomLeftRadius,
|
|
104
|
-
bottomRight: item._st.hmStyle.borderBottomRightRadius,
|
|
105
|
-
}
|
|
106
|
-
})
|
|
107
|
-
.borderRadius({
|
|
108
|
-
topLeft: item._st.hmStyle.borderTopLeftRadius,
|
|
109
|
-
topRight: item._st.hmStyle.borderTopRightRadius,
|
|
110
|
-
bottomLeft: item._st.hmStyle.borderBottomLeftRadius,
|
|
111
|
-
bottomRight: item._st.hmStyle.borderBottomRightRadius
|
|
112
|
-
})
|
|
93
|
+
.verticalAlign(getImageSpanAlignment(item?.hmStyle?.verticalAlign))
|
|
113
94
|
.onClick(shouldBindEvent((e: ClickEvent) => { eventHandler(e, 'click', item) }, item, ['click']))
|
|
114
95
|
} else if (item.nodeType === NodeType.TEXT_NODE) {
|
|
115
96
|
Span(item.textContent)
|
|
@@ -63,7 +63,7 @@ export default struct TaroTextArea {
|
|
|
63
63
|
|
|
64
64
|
build () {
|
|
65
65
|
TextArea({ text: this.value, placeholder: this.node._attrs?.placeholder || '', controller: this.node.controller })
|
|
66
|
-
.key(this.node._nid)
|
|
66
|
+
.key(this.node._nid.toString())
|
|
67
67
|
.maxLength(Number(this.node._attrs?.maxlength) || null)
|
|
68
68
|
.placeholderColor(getPlaceholderColor(this.node))
|
|
69
69
|
.attributeModifier(commonStyleModify.setNode(this.node).setAnimationStyle(this.overwriteStyle))
|
|
@@ -99,7 +99,7 @@ export function getNormalAttributes (node: TaroElement, initStyle?: HarmonyStyle
|
|
|
99
99
|
let normalAttributes = hmStyle
|
|
100
100
|
|
|
101
101
|
// 覆盖属性
|
|
102
|
-
normalAttributes.id =
|
|
102
|
+
normalAttributes.id = _attrs.id || _nid.toString()
|
|
103
103
|
|
|
104
104
|
let pseudoStylesheet = getPseudoClass(node)
|
|
105
105
|
if (pseudoStylesheet) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tarojs/plugin-platform-harmony-ets",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.99",
|
|
4
4
|
"description": "OpenHarmony & 鸿蒙系统插件",
|
|
5
5
|
"author": "O2Team",
|
|
6
6
|
"homepage": "https://gitee.com/openharmony-sig/taro",
|
|
@@ -27,13 +27,13 @@
|
|
|
27
27
|
"webpack-sources": "^3.2.3",
|
|
28
28
|
"@babel/preset-react": "^7.24.1",
|
|
29
29
|
"webpack": "5.91.0",
|
|
30
|
-
"@tarojs/components": "4.0.0-beta.
|
|
31
|
-
"@tarojs/helper": "4.0.0-beta.
|
|
32
|
-
"@tarojs/runner-utils": "4.0.0-beta.
|
|
33
|
-
"@tarojs/
|
|
34
|
-
"@tarojs/
|
|
35
|
-
"@tarojs/
|
|
36
|
-
"@tarojs/
|
|
30
|
+
"@tarojs/components": "4.0.0-beta.99",
|
|
31
|
+
"@tarojs/helper": "4.0.0-beta.99",
|
|
32
|
+
"@tarojs/runner-utils": "4.0.0-beta.99",
|
|
33
|
+
"@tarojs/runtime": "4.0.0-beta.99",
|
|
34
|
+
"@tarojs/service": "4.0.0-beta.99",
|
|
35
|
+
"@tarojs/shared": "4.0.0-beta.99",
|
|
36
|
+
"@tarojs/taro": "4.0.0-beta.99"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"fast-glob": "^3.3.1",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"rollup-plugin-ts": "^3.0.2",
|
|
43
43
|
"solid-js": "^1.8.16",
|
|
44
44
|
"tslib": "^2.4.0",
|
|
45
|
-
"rollup-plugin-copy": "4.0.0-beta.
|
|
45
|
+
"rollup-plugin-copy": "4.0.0-beta.99"
|
|
46
46
|
},
|
|
47
47
|
"scripts": {
|
|
48
48
|
"prod": "pnpm run build",
|