@tarojs/plugin-platform-harmony-ets 4.0.3-alpha.4 → 4.0.3
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/weapp/life-cycle.ts +1 -1
- package/dist/apis/framework/index.ts +1 -1
- 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/ui/background.ts +1 -1
- package/dist/apis/ui/navigation-bar/index.ts +1 -1
- package/dist/apis/ui/tab-bar.ts +1 -2
- package/dist/apis/utils/handler.ts +2 -1
- package/dist/apis/utils/index.ts +1 -2
- package/dist/components-harmony-ets/button.ets +1 -1
- package/dist/components-harmony-ets/checkbox.ets +1 -2
- package/dist/components-harmony-ets/form.ets +0 -1
- package/dist/components-harmony-ets/index.ets +37 -90
- package/dist/components-harmony-ets/input.ets +11 -7
- package/dist/components-harmony-ets/label.ets +1 -2
- package/dist/components-harmony-ets/listView.ets +3 -2
- package/dist/components-harmony-ets/movableArea.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/pseudo.ets +1 -1
- package/dist/components-harmony-ets/radio.ets +2 -3
- package/dist/components-harmony-ets/scrollList.ets +2 -2
- package/dist/components-harmony-ets/scrollView.ets +8 -3
- package/dist/components-harmony-ets/slider.ets +1 -1
- package/dist/components-harmony-ets/stickySection.ets +2 -2
- package/dist/components-harmony-ets/style.ets +8 -7
- package/dist/components-harmony-ets/swiper.ets +1 -1
- package/dist/components-harmony-ets/switch.ets +1 -1
- package/dist/components-harmony-ets/text.ets +2 -2
- package/dist/components-harmony-ets/utils/helper.ets +2 -2
- package/dist/components-harmony-ets/utils/styles.ets +5 -6
- package/dist/components-harmony-ets/video.ets +1 -1
- package/dist/components-harmony-ets/view.ets +1 -2
- package/dist/components-harmony-ets/webView.ets +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/runtime-ets/bom/URL.ts +2 -0
- package/dist/runtime-ets/bom/document.ts +1 -2
- package/dist/runtime-ets/bom/getComputedStyle.ts +1 -2
- 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 +4 -5
- package/dist/runtime-ets/constant.ts +17 -10
- package/dist/runtime-ets/current.ts +24 -2
- package/dist/runtime-ets/dom/document.ts +1 -1
- package/dist/runtime-ets/dom/element/canvas.ts +3 -2
- package/dist/runtime-ets/dom/element/element.ts +6 -5
- package/dist/runtime-ets/dom/element/form.ts +6 -0
- package/dist/runtime-ets/dom/event-source.ts +1 -0
- package/dist/runtime-ets/dom/eventTarget.ts +1 -1
- package/dist/runtime-ets/dom/node.ts +3 -4
- package/dist/runtime-ets/emitter/emitter.ts +1 -0
- package/dist/runtime-ets/env.ts +1 -0
- package/dist/runtime-ets/index.ts +22 -7
- package/dist/runtime-ets/interface/index.ts +6 -0
- package/dist/runtime-ets/utils/index.ts +4 -6
- package/dist/runtime-ets/utils/router.ts +9 -0
- package/dist/runtime-framework/react/app.ts +1 -2
- package/dist/runtime-framework/react/hooks.ts +1 -1
- package/dist/runtime-framework/react/native-page.ts +1 -2
- package/dist/runtime-framework/react/page.ts +1 -2
- package/dist/runtime-framework/solid/app.ts +1 -2
- package/dist/runtime-framework/solid/hooks.ts +1 -1
- package/dist/runtime-framework/solid/page.ts +1 -2
- package/dist/runtime-framework/solid/reconciler/props.ts +9 -10
- package/dist/runtime-utils.d.ts +4 -5
- package/dist/runtime-utils.js +1 -2
- package/dist/runtime-utils.js.map +1 -1
- package/dist/runtime.js +1 -2
- package/dist/runtime.js.map +1 -1
- package/package.json +9 -9
- package/types/runtime.d.ts +7 -0
|
@@ -24,4 +24,4 @@ export { Current, getCurrentInstance } from '@tarojs/runtime'
|
|
|
24
24
|
|
|
25
25
|
export const requirePlugin = temporarilyNotSupport('requirePlugin')
|
|
26
26
|
|
|
27
|
-
export { eventCenter, Events, History } from '@tarojs/runtime
|
|
27
|
+
export { eventCenter, Events, History } from '@tarojs/runtime'
|
|
@@ -8,10 +8,12 @@
|
|
|
8
8
|
// ❌ DownloadTask.offHeadersReceived 此接口 ohos 不支持
|
|
9
9
|
|
|
10
10
|
import request from '@ohos.request'
|
|
11
|
-
import Taro, { DownloadTask } from '@tarojs/taro'
|
|
12
11
|
|
|
13
12
|
import { callAsyncFail, callAsyncSuccess, validateParams } from '../utils'
|
|
14
13
|
|
|
14
|
+
import type Taro from '@tarojs/taro/types'
|
|
15
|
+
import type { DownloadTask } from '@tarojs/taro/types'
|
|
16
|
+
|
|
15
17
|
interface IDownloadConfigOHOS {
|
|
16
18
|
url: string
|
|
17
19
|
header?: any
|
|
@@ -9,10 +9,12 @@
|
|
|
9
9
|
|
|
10
10
|
import request from '@ohos.request'
|
|
11
11
|
import { isUndefined } from '@tarojs/shared'
|
|
12
|
-
import Taro, { UploadTask } from '@tarojs/taro'
|
|
13
12
|
|
|
14
13
|
import { callAsyncFail, callAsyncSuccess, validateParams } from '../utils'
|
|
15
14
|
|
|
15
|
+
import type Taro from '@tarojs/taro/types'
|
|
16
|
+
import type { UploadTask } from '@tarojs/taro/types'
|
|
17
|
+
|
|
16
18
|
interface IOHOSFileType {
|
|
17
19
|
filename?: string
|
|
18
20
|
name?: string
|
package/dist/apis/route/index.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import router from '@ohos.router'
|
|
2
|
-
import { window } from '@tarojs/runtime'
|
|
3
|
-
import { eventCenter } from '@tarojs/runtime/dist/runtime.esm' // eslint-disable-line import/no-duplicates
|
|
2
|
+
import { eventCenter, window } from '@tarojs/runtime'
|
|
4
3
|
import { queryToJson } from '@tarojs/shared'
|
|
5
4
|
|
|
6
5
|
import { callAsyncFail, callAsyncSuccess } from '../utils'
|
package/dist/apis/ui/tab-bar.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { Current } from '@tarojs/runtime'
|
|
2
|
-
import { eventCenter } from '@tarojs/runtime/dist/runtime.esm' // eslint-disable-line import/no-duplicates
|
|
1
|
+
import { Current, eventCenter } from '@tarojs/runtime'
|
|
3
2
|
|
|
4
3
|
import { callAsyncFail, callAsyncSuccess } from '../utils'
|
|
5
4
|
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { isFunction } from '@tarojs/shared'
|
|
2
2
|
|
|
3
|
+
import type { TFunc } from '@tarojs/runtime'
|
|
4
|
+
|
|
3
5
|
export interface ICallbackResult {
|
|
4
6
|
/** 错误信息 */
|
|
5
7
|
errMsg: string
|
|
6
8
|
}
|
|
7
|
-
type TFunc = (...args: any[]) => any
|
|
8
9
|
|
|
9
10
|
type TCallback<T = Partial<ICallbackResult>> = (res: T) => Promise<void> | void
|
|
10
11
|
interface IMethodParam<T = Partial<ICallbackResult>> {
|
package/dist/apis/utils/index.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import abilityAccessCtrl from '@ohos.abilityAccessCtrl'
|
|
2
|
-
import { Current } from '@tarojs/runtime'
|
|
3
|
-
import { eventCenter } from '@tarojs/runtime/dist/runtime.esm' // eslint-disable-line import/no-duplicates
|
|
2
|
+
import { Current, eventCenter } from '@tarojs/runtime'
|
|
4
3
|
|
|
5
4
|
import { ICallbackResult, MethodHandler } from './handler'
|
|
6
5
|
|
|
@@ -4,7 +4,7 @@ import { BUTTON_THEME_COLOR } from './utils/constant/style'
|
|
|
4
4
|
import { TOUCH_EVENT_MAP } from './utils/constant/event'
|
|
5
5
|
import { shouldBindEvent, getNodeThresholds } from './utils/helper'
|
|
6
6
|
|
|
7
|
-
import type { TaroAny,
|
|
7
|
+
import type { TaroAny, TaroButtonElement, TaroEvent, TaroStyleType } from '@tarojs/runtime'
|
|
8
8
|
|
|
9
9
|
interface ButtonAttrs {
|
|
10
10
|
disabled?: boolean
|
|
@@ -4,8 +4,7 @@ import commonStyleModify, { rowModify, columnModify } from './style'
|
|
|
4
4
|
import { FlexManager } from './utils/flexManager'
|
|
5
5
|
import { shouldBindEvent, getNodeThresholds } from './utils/helper'
|
|
6
6
|
|
|
7
|
-
import type { TaroAny,
|
|
8
|
-
import { isUndefined } from '@tarojs/shared'
|
|
7
|
+
import type { TaroAny, TaroCheckboxElement, TaroCheckboxGroupElement, TaroEvent } from '@tarojs/runtime'
|
|
9
8
|
|
|
10
9
|
interface CheckboxOptions {
|
|
11
10
|
name?: string
|
|
@@ -7,7 +7,6 @@ import { FlexManager } from './utils/flexManager'
|
|
|
7
7
|
import { shouldBindEvent, getNodeThresholds } from './utils/helper'
|
|
8
8
|
|
|
9
9
|
import type { TaroAny, TaroFormElement } from '@tarojs/runtime'
|
|
10
|
-
import { isUndefined } from '@tarojs/shared'
|
|
11
10
|
|
|
12
11
|
@Component
|
|
13
12
|
export default struct TaroForm {
|
|
@@ -1,92 +1,39 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
1
|
+
export { default as TaroImage, getImageMode } from './image'
|
|
2
|
+
export { default as TaroText } from './text'
|
|
3
|
+
export { default as TaroView } from './view'
|
|
4
|
+
export { default as TaroIcon } from './icon'
|
|
5
|
+
export { default as TaroForm } from './form'
|
|
6
|
+
export { default as TaroLabel } from './label'
|
|
7
|
+
export { default as TaroInput } from './input'
|
|
8
|
+
export { default as TaroVideo } from './video'
|
|
9
|
+
export { default as TaroCanvas } from './canvas'
|
|
10
|
+
export { default as TaroButton, getButtonColor } from './button'
|
|
11
|
+
export { default as TaroPicker } from './picker'
|
|
12
|
+
export { default as TaroSlider } from './slider'
|
|
13
|
+
export { default as TaroSwitch } from './switch'
|
|
14
|
+
export { default as TaroSwiper } from './swiper'
|
|
15
|
+
export { default as TaroWebView } from './webView'
|
|
16
|
+
export { default as TaroTextArea } from './textArea'
|
|
17
|
+
export { default as TaroRichText } from './richText'
|
|
18
|
+
export { default as TaroProgress } from './progress'
|
|
19
|
+
export { default as TaroInnerHtml } from './innerHtml'
|
|
20
|
+
export { default as TaroScrollView } from './scrollView'
|
|
21
|
+
export { default as TaroMovableArea } from './movableArea'
|
|
22
|
+
export { default as TaroMovableView } from './movableView'
|
|
23
|
+
export { TaroRadio, TaroRadioGroup } from './radio'
|
|
24
|
+
export { TaroCheckboxGroup, TaroCheckbox } from './checkbox'
|
|
25
|
+
export { default as TaroPageMeta, IComponentAttributeUpdateEvents } from './pageMeta'
|
|
26
|
+
export { default as TaroNavigationBar } from './navigationBar'
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
export { default as TaroListView } from './listView'
|
|
29
|
+
export { default as TaroStickySection } from './stickySection'
|
|
30
|
+
export { default as TaroScrollList } from './scrollList'
|
|
31
31
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
export {
|
|
42
|
-
textModify,
|
|
43
|
-
getStyleAttr,
|
|
44
|
-
FlexManager,
|
|
45
|
-
DynamicCenter,
|
|
46
|
-
getButtonColor,
|
|
47
|
-
TOUCH_EVENT_MAP,
|
|
48
|
-
shouldBindEvent,
|
|
49
|
-
getFontAttributes,
|
|
50
|
-
commonStyleModify,
|
|
51
|
-
rowModify,
|
|
52
|
-
columnModify,
|
|
53
|
-
getNodeThresholds,
|
|
54
|
-
BUTTON_THEME_COLOR,
|
|
55
|
-
getNormalAttributes,
|
|
56
|
-
setNormalTextAttributeIntoInstance,
|
|
57
|
-
getImageMode,
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
export {
|
|
61
|
-
TaroImage,
|
|
62
|
-
TaroCanvas,
|
|
63
|
-
TaroText,
|
|
64
|
-
TaroView,
|
|
65
|
-
TaroIcon,
|
|
66
|
-
TaroForm,
|
|
67
|
-
TaroLabel,
|
|
68
|
-
TaroInput,
|
|
69
|
-
TaroVideo,
|
|
70
|
-
TaroButton,
|
|
71
|
-
TaroPicker,
|
|
72
|
-
TaroSlider,
|
|
73
|
-
TaroSwitch,
|
|
74
|
-
TaroSwiper,
|
|
75
|
-
TaroWebView,
|
|
76
|
-
TaroTextArea,
|
|
77
|
-
TaroRichText,
|
|
78
|
-
TaroProgress,
|
|
79
|
-
TaroInnerHtml,
|
|
80
|
-
TaroScrollView,
|
|
81
|
-
TaroMovableArea,
|
|
82
|
-
TaroMovableView,
|
|
83
|
-
TaroRadio,
|
|
84
|
-
TaroRadioGroup,
|
|
85
|
-
TaroCheckboxGroup,
|
|
86
|
-
TaroCheckbox,
|
|
87
|
-
TaroPageMeta,
|
|
88
|
-
TaroNavigationBar,
|
|
89
|
-
TaroListView,
|
|
90
|
-
TaroStickySection,
|
|
91
|
-
TaroScrollList
|
|
92
|
-
}
|
|
32
|
+
export { default as commonStyleModify, rowModify, columnModify, textModify, setNormalTextAttributeIntoInstance } from './style'
|
|
33
|
+
export { TOUCH_EVENT_MAP } from './utils/constant/event'
|
|
34
|
+
export { BUTTON_THEME_COLOR } from './utils/constant/style'
|
|
35
|
+
export { DynamicCenter } from './utils/DynamicCenter'
|
|
36
|
+
export { FlexManager } from './utils/flexManager'
|
|
37
|
+
export { isTagFirstChild } from './utils/helper'
|
|
38
|
+
export { getStyleAttr } from './utils/styles'
|
|
39
|
+
export { shouldBindEvent, getNodeThresholds, getNormalAttributes, getFontAttributes } from './utils/helper'
|
|
@@ -4,7 +4,7 @@ import commonStyleModify from './style'
|
|
|
4
4
|
import { parseStyles, shouldBindEvent, getNodeThresholds, getStyleAttr } from './utils/helper'
|
|
5
5
|
import { INPUT_TYPE_MAP, INPUT_CONFIRM_MAP } from './utils/constant/style'
|
|
6
6
|
|
|
7
|
-
import type {
|
|
7
|
+
import type { TaroAny, TaroEvent, TaroInputElement, TaroStyleType } from '@tarojs/runtime'
|
|
8
8
|
|
|
9
9
|
interface InputAttrs {
|
|
10
10
|
textAlign?: TextAlign
|
|
@@ -91,16 +91,20 @@ export default struct TaroInput {
|
|
|
91
91
|
.placeholderFont(getPlaceholderFont(this.node))
|
|
92
92
|
.enterKeyType(INPUT_CONFIRM_MAP.get(this.node._attrs?.confirmType) || EnterKeyType.Done)
|
|
93
93
|
.padding(0) // Note: 移出 Input 默认 padding 设置
|
|
94
|
-
.backgroundColor(getStyleAttr(this.node, "backgroundColor"))
|
|
94
|
+
.backgroundColor(getStyleAttr(this.node, "backgroundColor"))
|
|
95
95
|
.attributeModifier(commonStyleModify.setNode(this.node).setAnimationStyle(this.overwriteStyle))
|
|
96
96
|
.styles(this.node?.hmStyle)
|
|
97
97
|
.attrs(getAttributes(this.node))
|
|
98
98
|
.onChange((value: string) => {
|
|
99
|
-
const event: TaroEvent = createTaroEvent('
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
this.
|
|
103
|
-
|
|
99
|
+
const event: TaroEvent = createTaroEvent('change', { detail: { value } }, this.node)
|
|
100
|
+
eventHandler(event, 'change', this.node)
|
|
101
|
+
|
|
102
|
+
if (this.value !== value) {
|
|
103
|
+
const event: TaroEvent = createTaroEvent('input', { detail: { value } }, this.node)
|
|
104
|
+
this.value = value
|
|
105
|
+
this.node?.updateFormWidgetValue(value)
|
|
106
|
+
eventHandler(event, 'input', this.node)
|
|
107
|
+
}
|
|
104
108
|
})
|
|
105
109
|
.onSubmit(() => {
|
|
106
110
|
const event: TaroEvent = createTaroEvent('confirm', { detail: { value: this.value } }, this.node)
|
|
@@ -6,8 +6,7 @@ import { TOUCH_EVENT_MAP } from './utils/constant/event'
|
|
|
6
6
|
import { FlexManager } from './utils/flexManager'
|
|
7
7
|
import { shouldBindEvent, getNodeThresholds } from './utils/helper'
|
|
8
8
|
|
|
9
|
-
import type {
|
|
10
|
-
import { isUndefined } from '@tarojs/shared'
|
|
9
|
+
import type { TaroAny, TaroElement, TaroCheckboxElement, TaroLabelElement, TaroRadioElement } from '@tarojs/runtime'
|
|
11
10
|
|
|
12
11
|
function handleTargetChange (id: string) {
|
|
13
12
|
const taro: TaroAny = Current.taro
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import commonStyleModify from './style'
|
|
2
2
|
|
|
3
|
-
import type {
|
|
3
|
+
import type { TaroAny, TaroViewElement } from '@tarojs/runtime'
|
|
4
4
|
|
|
5
5
|
@Reusable
|
|
6
6
|
@Component
|
|
@@ -22,10 +22,11 @@ export default struct TaroListView {
|
|
|
22
22
|
|
|
23
23
|
build() {
|
|
24
24
|
ListItem() {
|
|
25
|
-
|
|
25
|
+
Column() {
|
|
26
26
|
this.createLazyChildren(this.node, 0)
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
.attributeModifier(commonStyleModify.setNode(this.node).setAnimationStyle(this.overwriteStyle))
|
|
30
|
+
.zIndex(0)
|
|
30
31
|
}
|
|
31
32
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { TaroAny, TaroMovableAreaElement, TaroMovableViewElement } from '@tarojs/runtime'
|
|
2
1
|
import { isTaroMovableViewElement } from '@tarojs/runtime'
|
|
3
2
|
import commonStyleModify, { rowModify, columnModify } from './style'
|
|
4
3
|
|
|
5
4
|
import { FlexManager } from './utils/flexManager'
|
|
6
|
-
|
|
5
|
+
|
|
6
|
+
import type { TaroAny, TaroMovableAreaElement } from '@tarojs/runtime'
|
|
7
7
|
|
|
8
8
|
@Component
|
|
9
9
|
export default struct TaroMovableArea {
|
|
@@ -123,4 +123,4 @@ function sizeChangeHandle(node: TaroMovableAreaElement, newValue: Area | SizeOpt
|
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
125
|
})
|
|
126
|
-
}
|
|
126
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getFontAttributes } from './utils/helper'
|
|
2
2
|
import { pseudoModify } from './style'
|
|
3
3
|
|
|
4
|
-
import type {
|
|
4
|
+
import type { TaroAny, TaroStyleType, TaroTextStyleType, TaroViewElement } from '@tarojs/runtime'
|
|
5
5
|
|
|
6
6
|
@Extend(Flex)
|
|
7
7
|
function flexAttrs (style: TaroStyleType) {
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import { eventHandler, getComponentEventCallback,
|
|
1
|
+
import { AREA_CHANGE_EVENT_NAME, eventHandler, getComponentEventCallback, VISIBLE_CHANGE_EVENT_NAME, createTaroEvent } from '@tarojs/runtime'
|
|
2
2
|
|
|
3
3
|
import commonStyleModify, { rowModify, columnModify } from './style'
|
|
4
4
|
import { TOUCH_EVENT_MAP } from './utils/constant/event'
|
|
5
5
|
import { FlexManager } from './utils/flexManager'
|
|
6
6
|
import { shouldBindEvent, getNodeThresholds } from './utils/helper'
|
|
7
7
|
|
|
8
|
-
import {
|
|
9
|
-
import { isUndefined } from '@tarojs/shared'
|
|
8
|
+
import type { HarmonyType, TaroAny, TaroEvent, TaroRadioElement, TaroRadioGroupElement } from '@tarojs/runtime'
|
|
10
9
|
|
|
11
10
|
interface RadioAttrs {
|
|
12
11
|
radioStyle?: HarmonyType.RadioStyle
|
|
@@ -4,7 +4,7 @@ import commonStyleModify from './style'
|
|
|
4
4
|
import { TOUCH_EVENT_MAP } from './utils/constant/event'
|
|
5
5
|
import { getNodeThresholds, shouldBindEvent } from './utils/helper'
|
|
6
6
|
|
|
7
|
-
import type {
|
|
7
|
+
import type { TaroAny, TaroEvent, TaroScrollViewElement } from '@tarojs/runtime'
|
|
8
8
|
|
|
9
9
|
interface ScrollViewAttrs {
|
|
10
10
|
scrollBar: BarState
|
|
@@ -67,7 +67,7 @@ export default struct TaroScrollList {
|
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
-
handleScroll = (scrollOffset: number) => {
|
|
70
|
+
handleScroll = (scrollOffset: number) => {
|
|
71
71
|
handleScrollEvent(this.node, 'scroll', scrollOffset)
|
|
72
72
|
}
|
|
73
73
|
|
|
@@ -6,7 +6,7 @@ import { FlexManager } from './utils/flexManager'
|
|
|
6
6
|
import { TOUCH_EVENT_MAP } from './utils/constant/event'
|
|
7
7
|
import { getNodeThresholds, getStyleAttr, shouldBindEvent } from './utils/helper'
|
|
8
8
|
|
|
9
|
-
import type { TaroAny,
|
|
9
|
+
import type { TaroAny, TaroEvent, TaroScrollViewElement } from '@tarojs/runtime'
|
|
10
10
|
|
|
11
11
|
interface ScrollViewAttrs {
|
|
12
12
|
scrollBar: BarState
|
|
@@ -36,8 +36,13 @@ function getAttributes (node: TaroScrollViewElement): ScrollViewAttrs {
|
|
|
36
36
|
|
|
37
37
|
function getScrollable (node: TaroScrollViewElement) {
|
|
38
38
|
const _attrs = node._attrs
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
if (_attrs.scrollX) {
|
|
40
|
+
return ScrollDirection.Horizontal
|
|
41
|
+
} else if (_attrs.scrollY) {
|
|
42
|
+
return ScrollDirection.Vertical
|
|
43
|
+
} else {
|
|
44
|
+
return ScrollDirection.None
|
|
45
|
+
}
|
|
41
46
|
}
|
|
42
47
|
|
|
43
48
|
function handleScrollEvent (node: TaroScrollViewElement, eventName = 'scroll', xOffset?: number, yOffset?: number) {
|
|
@@ -3,7 +3,7 @@ import { eventHandler, getComponentEventCallback, AREA_CHANGE_EVENT_NAME, VISIBL
|
|
|
3
3
|
import commonStyleModify from './style'
|
|
4
4
|
import { getNodeThresholds, shouldBindEvent } from './utils/helper'
|
|
5
5
|
|
|
6
|
-
import type { TaroAny,
|
|
6
|
+
import type { TaroAny, TaroEvent, TaroSliderElement } from '@tarojs/runtime'
|
|
7
7
|
|
|
8
8
|
interface SliderAttrs {
|
|
9
9
|
selectedColor?: ResourceColor
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import commonStyleModify from './style'
|
|
2
|
+
import TaroListView from './listView'
|
|
2
3
|
|
|
3
4
|
import type { TaroViewElement, TaroElement, TaroAny } from '@tarojs/runtime'
|
|
4
5
|
|
|
@@ -32,10 +33,9 @@ export default struct TaroStickySection {
|
|
|
32
33
|
}) {
|
|
33
34
|
ForEach(this.node.children, (item: TaroElement) => {
|
|
34
35
|
if (item.tagName === 'LIST-VIEW') {
|
|
35
|
-
|
|
36
|
+
TaroListView({ node: item as TaroAny, createLazyChildren: this.createLazyChildren }).reuseId(item._nid.toString())
|
|
36
37
|
}
|
|
37
38
|
}, (item: TaroElement) => `${item._nid}-${item._nodeInfo?.layer || 0}`)
|
|
38
|
-
|
|
39
39
|
}
|
|
40
40
|
.attributeModifier(commonStyleModify.setNode(this.node).setAnimationStyle(this.overwriteStyle))
|
|
41
41
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { TaroAny, HarmonyStyle, TaroElement, TaroStyleType, TaroTextElement } from '@tarojs/runtime'
|
|
2
1
|
import { ObjectAssign } from '@tarojs/runtime'
|
|
3
2
|
import { isUndefined } from '@tarojs/shared'
|
|
4
3
|
import { computeBackgroundPosition, convertVp2Px } from './utils'
|
|
@@ -6,6 +5,8 @@ import { getNormalAttributes } from './utils/helper'
|
|
|
6
5
|
import { isMaxWidthView } from './utils/styles'
|
|
7
6
|
import { FlexManager } from './utils/flexManager'
|
|
8
7
|
|
|
8
|
+
import type { HarmonyStyle, TaroAny, TaroElement, TaroStyleType, TaroTextElement } from '@tarojs/runtime'
|
|
9
|
+
|
|
9
10
|
class TextStyleModify implements AttributeModifier<TextAttribute> {
|
|
10
11
|
initStyle?: TaroStyleType
|
|
11
12
|
node: TaroTextElement | null = null
|
|
@@ -81,7 +82,7 @@ class CommonStyleModify implements AttributeModifier<CommonAttribute> {
|
|
|
81
82
|
}
|
|
82
83
|
return this
|
|
83
84
|
}
|
|
84
|
-
|
|
85
|
+
|
|
85
86
|
setAnimationStyle (overwriteStyle: Record<string, TaroAny>) {
|
|
86
87
|
this.overwriteStyle = overwriteStyle
|
|
87
88
|
if (this.style && this.overwriteStyle && Object.keys(this.overwriteStyle).length) {
|
|
@@ -248,9 +249,9 @@ export function setNormalAttributeIntoInstance(instance: CommonAttribute, style:
|
|
|
248
249
|
instance.key(style.id)
|
|
249
250
|
}
|
|
250
251
|
if (!isUndefined(style.display) || !isUndefined(style.visibility)) {
|
|
251
|
-
instance.visibility(style.display === 'none'
|
|
252
|
-
? Visibility.None :
|
|
253
|
-
!isUndefined(style.visibility)
|
|
252
|
+
instance.visibility(style.display === 'none'
|
|
253
|
+
? Visibility.None :
|
|
254
|
+
!isUndefined(style.visibility)
|
|
254
255
|
? (style.visibility === 'hidden' ? Visibility.Hidden : Visibility.Visible)
|
|
255
256
|
: Visibility.Visible
|
|
256
257
|
)
|
|
@@ -362,7 +363,7 @@ export function setNormalAttributeIntoInstance(instance: CommonAttribute, style:
|
|
|
362
363
|
})
|
|
363
364
|
}
|
|
364
365
|
if (!isUndefined(style.opacity)) {
|
|
365
|
-
instance.opacity(style.opacity)
|
|
366
|
+
instance.opacity(String(style.opacity) === '' ? 1: style.opacity)
|
|
366
367
|
}
|
|
367
368
|
if (!isUndefined(style.overflow)) {
|
|
368
369
|
instance.clip(style.overflow === 'hidden')
|
|
@@ -407,4 +408,4 @@ export const rowModify = new RowStyleModify()
|
|
|
407
408
|
export const columnModify = new ColumnStyleModify()
|
|
408
409
|
export const textModify = new TextStyleModify()
|
|
409
410
|
|
|
410
|
-
export default new CommonStyleModify()
|
|
411
|
+
export default new CommonStyleModify()
|
|
@@ -3,7 +3,7 @@ import { eventHandler, getComponentEventCallback, AREA_CHANGE_EVENT_NAME, VISIBL
|
|
|
3
3
|
import commonStyleModify from './style'
|
|
4
4
|
import { getNodeThresholds, shouldBindEvent } from './utils/helper'
|
|
5
5
|
|
|
6
|
-
import type {
|
|
6
|
+
import type { TaroAny, TaroEvent, TaroSwiperElement } from '@tarojs/runtime'
|
|
7
7
|
|
|
8
8
|
interface SwiperAttrs {
|
|
9
9
|
index?: number
|
|
@@ -3,7 +3,7 @@ import { eventHandler, getComponentEventCallback, AREA_CHANGE_EVENT_NAME, VISIBL
|
|
|
3
3
|
import commonStyleModify from './style'
|
|
4
4
|
import { getNodeThresholds, shouldBindEvent } from './utils/helper'
|
|
5
5
|
|
|
6
|
-
import type { TaroAny,
|
|
6
|
+
import type { TaroAny, TaroEvent, TaroSwitchElement } from '@tarojs/runtime'
|
|
7
7
|
|
|
8
8
|
interface SwitchAttrs {
|
|
9
9
|
selectedColor?: ResourceColor
|
|
@@ -7,7 +7,7 @@ import { getImageMode } from './image'
|
|
|
7
7
|
import { BUTTON_THEME_COLOR } from './utils/constant/style'
|
|
8
8
|
import { getNodeThresholds, getStyleAttr, shouldBindEvent, getNormalAttributes } from './utils/helper'
|
|
9
9
|
|
|
10
|
-
import type {
|
|
10
|
+
import type { HarmonyStyle, TaroAny, TaroButtonElement, TaroElement, TaroTextElement } from '@tarojs/runtime'
|
|
11
11
|
|
|
12
12
|
function getButtonFontSize (node: TaroButtonElement): string | number {
|
|
13
13
|
const isMini = node._attrs.size === 'mini'
|
|
@@ -125,4 +125,4 @@ class SpanStyleModify implements AttributeModifier<SpanAttribute> {
|
|
|
125
125
|
}
|
|
126
126
|
}
|
|
127
127
|
|
|
128
|
-
const spanModify = new SpanStyleModify()
|
|
128
|
+
const spanModify = new SpanStyleModify()
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { VIEW } from '@tarojs/runtime
|
|
1
|
+
import { VIEW } from '@tarojs/runtime'
|
|
2
2
|
|
|
3
3
|
import { getNormalAttributes, getFontAttributes, getStyleAttr } from './styles'
|
|
4
4
|
|
|
5
|
-
import type { TaroElement, TaroNode
|
|
5
|
+
import type { TaroAny, TaroElement, TaroNode } from '@tarojs/runtime'
|
|
6
6
|
|
|
7
7
|
export const parseStyles = (styles = ''): Record<string, string> => {
|
|
8
8
|
const styleObj: Record<string, string> = {}
|
|
@@ -4,7 +4,7 @@ import { ObjectAssign } from '@tarojs/runtime'
|
|
|
4
4
|
import { FlexManager } from './flexManager'
|
|
5
5
|
|
|
6
6
|
import type { StandardProps, TextProps } from '@tarojs/components/types'
|
|
7
|
-
import type { TaroAny, TaroElement,
|
|
7
|
+
import type { TaroAny, TaroElement, TaroTextStyleType, HarmonyStyle } from '@tarojs/runtime'
|
|
8
8
|
|
|
9
9
|
export function getFontAttributes (node: TaroElement): TaroTextStyleType {
|
|
10
10
|
let hmStyle = getNormalAttributes(node)
|
|
@@ -20,7 +20,7 @@ export function getFontAttributes (node: TaroElement): TaroTextStyleType {
|
|
|
20
20
|
let WebkitLineClamp = attrs.maxLines || hmStyle.WebkitLineClamp || Infinity
|
|
21
21
|
if (hmStyle.textOverflow && !isUndefined(hmStyle.textOverflow.overflow)) {
|
|
22
22
|
switch (hmStyle.textOverflow.overflow) {
|
|
23
|
-
case TextOverflow.Clip:
|
|
23
|
+
case TextOverflow.Clip:
|
|
24
24
|
case TextOverflow.Ellipsis:
|
|
25
25
|
case TextOverflow.None: WebkitLineClamp = WebkitLineClamp || 1; break
|
|
26
26
|
default: break
|
|
@@ -90,9 +90,8 @@ export function isMaxWidthView (node: TaroElement) {
|
|
|
90
90
|
|
|
91
91
|
export function getNormalAttributes (node: TaroElement, initStyle?: HarmonyStyle): HarmonyStyle {
|
|
92
92
|
if (!node) return {}
|
|
93
|
-
|
|
93
|
+
|
|
94
94
|
const hmStyle = node.hmStyle
|
|
95
|
-
|
|
96
95
|
if (!hmStyle) return {}
|
|
97
96
|
|
|
98
97
|
const _nid = node._nid
|
|
@@ -182,7 +181,7 @@ function getPseudoClass (node: TaroElement): HarmonyStyle | null {
|
|
|
182
181
|
function parseNthChild(selector: string): [number, number] | null {
|
|
183
182
|
const regex = /nth-child\((?:(-?\d*)n\s*)?([+-]?\s*\d+)?\)/;
|
|
184
183
|
const match = selector.match(regex);
|
|
185
|
-
|
|
184
|
+
|
|
186
185
|
if (match) {
|
|
187
186
|
const a = match[1] ? parseInt(match[1]) : 0;
|
|
188
187
|
const b = match[2] ? parseInt(match[2]) : 0;
|
|
@@ -202,4 +201,4 @@ export function getStyleAttr(node: TaroElement | null, key: string): TaroAny {
|
|
|
202
201
|
return isMaxWidthView(node) && isUndefined(hmStyle.width) ? '100%' : hmStyle.width
|
|
203
202
|
}
|
|
204
203
|
return hmStyle[key]
|
|
205
|
-
}
|
|
204
|
+
}
|
|
@@ -4,7 +4,7 @@ import commonStyleModify from './style'
|
|
|
4
4
|
import { TOUCH_EVENT_MAP } from './utils/constant/event'
|
|
5
5
|
import { shouldBindEvent, getNodeThresholds } from './utils/helper'
|
|
6
6
|
|
|
7
|
-
import type { TaroAny,
|
|
7
|
+
import type { TaroAny, TaroEvent, TaroVideoElement } from '@tarojs/runtime'
|
|
8
8
|
|
|
9
9
|
export interface VideoOptions {
|
|
10
10
|
src?: string | Resource
|
|
@@ -6,8 +6,7 @@ import { TOUCH_EVENT_MAP } from './utils/constant/event'
|
|
|
6
6
|
import { FlexManager } from './utils/flexManager'
|
|
7
7
|
import { getNodeThresholds, shouldBindEvent } from './utils/helper'
|
|
8
8
|
|
|
9
|
-
import type {
|
|
10
|
-
import { isUndefined } from '@tarojs/shared'
|
|
9
|
+
import type { TaroAny, TaroViewElement } from '@tarojs/runtime'
|
|
11
10
|
|
|
12
11
|
@Component
|
|
13
12
|
export default struct TaroView {
|
|
@@ -3,7 +3,7 @@ import { AREA_CHANGE_EVENT_NAME, eventHandler, getComponentEventCallback, VISIBL
|
|
|
3
3
|
import commonStyleModify from './style'
|
|
4
4
|
import { shouldBindEvent, getNodeThresholds } from './utils/helper'
|
|
5
5
|
|
|
6
|
-
import type { TaroAny,
|
|
6
|
+
import type { TaroAny, TaroEvent, TaroWebViewElement } from '@tarojs/runtime'
|
|
7
7
|
|
|
8
8
|
interface IPageLoad {
|
|
9
9
|
url: string
|