@tarojs/plugin-platform-harmony-ets 4.0.0-beta.69 → 4.0.0-beta.70

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.
@@ -8,6 +8,7 @@ import type { TaroStyleType, TaroAny, TaroInputElement, TaroEvent } from '@taroj
8
8
 
9
9
  interface InputAttrs {
10
10
  textAlign?: TextAlign
11
+ autoFocus?: boolean
11
12
  }
12
13
 
13
14
  @Extend(TextInput)
@@ -22,12 +23,13 @@ function styles (style: TaroStyleType) {
22
23
  @Extend(TextInput)
23
24
  function attrs(attr: InputAttrs) {
24
25
  .textAlign(attr.textAlign)
26
+ .defaultFocus(attr.autoFocus)
25
27
  }
26
28
 
27
-
28
29
  function getAttributes(node: TaroInputElement): InputAttrs {
29
30
  return {
30
31
  textAlign: node.hmStyle.textAlign,
32
+ autoFocus: node._attrs.autoFocus || node._attrs.focus || false,
31
33
  }
32
34
  }
33
35
 
@@ -5,6 +5,10 @@ import { getNodeThresholds, getFontAttributes, shouldBindEvent, parseStyles } fr
5
5
 
6
6
  import type { TaroAny, TaroStyleType, TaroTextStyleType, TaroTextAreaElement, TaroEvent } from '@tarojs/runtime'
7
7
 
8
+ interface TextareaAttrs extends TaroTextStyleType {
9
+ autoFocus?: boolean
10
+ }
11
+
8
12
  @Extend(TextArea)
9
13
  function textStyle (style: TaroStyleType) {
10
14
  .fontColor(style.color)
@@ -15,9 +19,16 @@ function textStyle (style: TaroStyleType) {
15
19
  }
16
20
 
17
21
  @Extend(TextArea)
18
- function textAttr(attr: TaroTextStyleType) {
22
+ function textAttr(attr: TextareaAttrs) {
19
23
  .textAlign(attr.textAlign)
20
24
  .maxLines(attr.WebkitLineClamp)
25
+ .defaultFocus(attr.autoFocus)
26
+ }
27
+
28
+ function getAttributes(node: TaroTextAreaElement): TextareaAttrs {
29
+ const attrs: TaroAny = getFontAttributes(node)
30
+ attrs.autoFocus = node._attrs.autoFocus || node._attrs.focus || false
31
+ return attrs
21
32
  }
22
33
 
23
34
  function getPlaceholderColor (node: TaroTextAreaElement): string {
@@ -54,7 +65,7 @@ export default struct TaroTextArea {
54
65
  .placeholderColor(getPlaceholderColor(this.node))
55
66
  .attributeModifier(commonStyleModify.setNode(this.node).setAnimationStyle(this.overwriteStyle))
56
67
  .textStyle(this.node?.hmStyle)
57
- .textAttr(getFontAttributes(this.node))
68
+ .textAttr(getAttributes(this.node))
58
69
  .onChange((value: string) => {
59
70
  const event: TaroEvent = createTaroEvent('input', { detail: { value } }, this.node)
60
71
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tarojs/plugin-platform-harmony-ets",
3
- "version": "4.0.0-beta.69",
3
+ "version": "4.0.0-beta.70",
4
4
  "description": "OpenHarmony & 鸿蒙系统插件",
5
5
  "author": "O2Team",
6
6
  "homepage": "https://gitee.com/openharmony-sig/taro",
@@ -25,13 +25,13 @@
25
25
  },
26
26
  "dependencies": {
27
27
  "webpack-sources": "^3.2.3",
28
- "@tarojs/helper": "4.0.0-beta.69",
29
- "@tarojs/runtime": "4.0.0-beta.69",
30
- "@tarojs/runner-utils": "4.0.0-beta.69",
31
- "@tarojs/components": "4.0.0-beta.69",
32
- "@tarojs/shared": "4.0.0-beta.69",
33
- "@tarojs/service": "4.0.0-beta.69",
34
- "@tarojs/taro": "4.0.0-beta.69"
28
+ "@tarojs/components": "4.0.0-beta.70",
29
+ "@tarojs/helper": "4.0.0-beta.70",
30
+ "@tarojs/runner-utils": "4.0.0-beta.70",
31
+ "@tarojs/runtime": "4.0.0-beta.70",
32
+ "@tarojs/service": "4.0.0-beta.70",
33
+ "@tarojs/shared": "4.0.0-beta.70",
34
+ "@tarojs/taro": "4.0.0-beta.70"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@rollup/plugin-commonjs": "^25.0.7",
@@ -44,7 +44,7 @@
44
44
  "solid-js": "^1.8.16",
45
45
  "tslib": "^2.4.0",
46
46
  "typescript": "^4.8.2",
47
- "rollup-plugin-copy": "4.0.0-beta.69"
47
+ "rollup-plugin-copy": "4.0.0-beta.70"
48
48
  },
49
49
  "scripts": {
50
50
  "prebuild": "rimraf ./dist",