@tarojs/plugin-platform-harmony-ets 3.7.0-alpha.27
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/LICENSE +160 -0
- package/dist/apis/apis.ts +15 -0
- package/dist/apis/base/index.ts +5 -0
- package/dist/apis/base/system.ts +77 -0
- package/dist/apis/device/accelerometer.ts +76 -0
- package/dist/apis/device/battery.ts +24 -0
- package/dist/apis/device/clipboard.ts +70 -0
- package/dist/apis/device/index.ts +9 -0
- package/dist/apis/device/keyboard.ts +62 -0
- package/dist/apis/device/memory.ts +4 -0
- package/dist/apis/device/network.ts +72 -0
- package/dist/apis/device/phone.ts +43 -0
- package/dist/apis/device/screen.ts +79 -0
- package/dist/apis/device/vibrate.ts +24 -0
- package/dist/apis/files/index.ts +135 -0
- package/dist/apis/files/manager.ts +941 -0
- package/dist/apis/framework/index.ts +32 -0
- package/dist/apis/index.ts +124 -0
- package/dist/apis/location/index.ts +133 -0
- package/dist/apis/media/common.ts +74 -0
- package/dist/apis/media/image.ts +122 -0
- package/dist/apis/media/index.ts +3 -0
- package/dist/apis/media/video.ts +86 -0
- package/dist/apis/navigate/index.ts +8 -0
- package/dist/apis/network/downloadFile.ts +113 -0
- package/dist/apis/network/index.ts +4 -0
- package/dist/apis/network/request.ts +113 -0
- package/dist/apis/network/uploadFile.ts +158 -0
- package/dist/apis/network/webSocket.ts +130 -0
- package/dist/apis/open-api/index.ts +7 -0
- package/dist/apis/open-api/user-info/index.ts +85 -0
- package/dist/apis/page/index.ts +92 -0
- package/dist/apis/route/index.ts +138 -0
- package/dist/apis/storage/index.ts +133 -0
- package/dist/apis/tabbar/index.ts +147 -0
- package/dist/apis/ui/animation.ts +222 -0
- package/dist/apis/ui/background.ts +35 -0
- package/dist/apis/ui/index.ts +14 -0
- package/dist/apis/ui/interaction/index.ts +195 -0
- package/dist/apis/ui/navigation-bar/index.ts +33 -0
- package/dist/apis/ui/pull-down-refresh.ts +41 -0
- package/dist/apis/utils/handler.ts +116 -0
- package/dist/apis/utils/index.ts +85 -0
- package/dist/apis/utils/types.ts +12 -0
- package/dist/apis/utils/validate.ts +87 -0
- package/dist/apis/wxml/IntersectionObserver.ts +119 -0
- package/dist/apis/wxml/index.ts +12 -0
- package/dist/apis/wxml/nodesRef.ts +56 -0
- package/dist/apis/wxml/selectorQuery.ts +287 -0
- package/dist/components/components-react.js +51 -0
- package/dist/components/components-react.js.map +1 -0
- package/dist/components-harmony/button/index.css +109 -0
- package/dist/components-harmony/button/index.hml +31 -0
- package/dist/components-harmony/button/index.js +105 -0
- package/dist/components-harmony/camera/index.hml +6 -0
- package/dist/components-harmony/camera/index.js +12 -0
- package/dist/components-harmony/checkbox/index.hml +11 -0
- package/dist/components-harmony/checkbox/index.js +60 -0
- package/dist/components-harmony/checkbox-group/index.hml +3 -0
- package/dist/components-harmony/checkbox-group/index.js +22 -0
- package/dist/components-harmony/cover-image/index.css +4 -0
- package/dist/components-harmony/cover-image/index.hml +9 -0
- package/dist/components-harmony/cover-image/index.js +15 -0
- package/dist/components-harmony/form/index.hml +10 -0
- package/dist/components-harmony/form/index.js +11 -0
- package/dist/components-harmony/icon/index.css +27 -0
- package/dist/components-harmony/icon/index.hml +54 -0
- package/dist/components-harmony/icon/index.js +17 -0
- package/dist/components-harmony/image/index.css +5 -0
- package/dist/components-harmony/image/index.hml +11 -0
- package/dist/components-harmony/image/index.js +28 -0
- package/dist/components-harmony/input/index.hml +21 -0
- package/dist/components-harmony/input/index.js +98 -0
- package/dist/components-harmony/label/index.hml +3 -0
- package/dist/components-harmony/label/index.js +6 -0
- package/dist/components-harmony/navbar/index.css +56 -0
- package/dist/components-harmony/navbar/index.hml +9 -0
- package/dist/components-harmony/navbar/index.js +30 -0
- package/dist/components-harmony/navigator/index.css +8 -0
- package/dist/components-harmony/navigator/index.hml +9 -0
- package/dist/components-harmony/navigator/index.js +104 -0
- package/dist/components-harmony/picker/index.hml +25 -0
- package/dist/components-harmony/picker/index.js +132 -0
- package/dist/components-harmony/picker-view/index.hml +23 -0
- package/dist/components-harmony/picker-view/index.js +161 -0
- package/dist/components-harmony/picker-view-column/index.hml +3 -0
- package/dist/components-harmony/picker-view-column/index.js +3 -0
- package/dist/components-harmony/progress/index.css +4 -0
- package/dist/components-harmony/progress/index.hml +28 -0
- package/dist/components-harmony/progress/index.js +23 -0
- package/dist/components-harmony/radio/index.hml +11 -0
- package/dist/components-harmony/radio/index.js +41 -0
- package/dist/components-harmony/radio-group/index.hml +3 -0
- package/dist/components-harmony/radio-group/index.js +11 -0
- package/dist/components-harmony/rich-text/index.hml +5 -0
- package/dist/components-harmony/rich-text/index.js +16 -0
- package/dist/components-harmony/scroll-view/index.css +5 -0
- package/dist/components-harmony/scroll-view/index.hml +12 -0
- package/dist/components-harmony/scroll-view/index.js +65 -0
- package/dist/components-harmony/slider/index.hml +16 -0
- package/dist/components-harmony/slider/index.js +53 -0
- package/dist/components-harmony/swiper/index.css +3 -0
- package/dist/components-harmony/swiper/index.hml +14 -0
- package/dist/components-harmony/swiper/index.js +19 -0
- package/dist/components-harmony/switch/index.hml +7 -0
- package/dist/components-harmony/switch/index.js +16 -0
- package/dist/components-harmony/tabbar/index.css +7 -0
- package/dist/components-harmony/tabbar/index.hml +26 -0
- package/dist/components-harmony/tabbar/index.js +42 -0
- package/dist/components-harmony/textarea/index.hml +24 -0
- package/dist/components-harmony/textarea/index.js +92 -0
- package/dist/components-harmony/utils/index.js +41 -0
- package/dist/components-harmony/video/index.hml +7 -0
- package/dist/components-harmony/video/index.js +73 -0
- package/dist/components-harmony/web-view/index.hml +8 -0
- package/dist/components-harmony/web-view/index.js +22 -0
- package/dist/components-harmony-ets/base.ets +63 -0
- package/dist/components-harmony-ets/button.ets +119 -0
- package/dist/components-harmony-ets/checkbox.ets +219 -0
- package/dist/components-harmony-ets/element.ets +223 -0
- package/dist/components-harmony-ets/form.ets +149 -0
- package/dist/components-harmony-ets/icon.ets +84 -0
- package/dist/components-harmony-ets/image.ets +85 -0
- package/dist/components-harmony-ets/index.ts +49 -0
- package/dist/components-harmony-ets/innerHtml.ets +79 -0
- package/dist/components-harmony-ets/input.ets +195 -0
- package/dist/components-harmony-ets/label.ets +111 -0
- package/dist/components-harmony-ets/picker.ets +370 -0
- package/dist/components-harmony-ets/radio.ets +225 -0
- package/dist/components-harmony-ets/richText.ets +97 -0
- package/dist/components-harmony-ets/scrollView.ets +199 -0
- package/dist/components-harmony-ets/slider.ets +159 -0
- package/dist/components-harmony-ets/swiper.ets +204 -0
- package/dist/components-harmony-ets/switch.ets +113 -0
- package/dist/components-harmony-ets/text.ets +97 -0
- package/dist/components-harmony-ets/textArea.ets +169 -0
- package/dist/components-harmony-ets/utils/AttributeManager.ets +250 -0
- package/dist/components-harmony-ets/utils/DynamicCenter.ts +48 -0
- package/dist/components-harmony-ets/utils/constant/event.ets +25 -0
- package/dist/components-harmony-ets/utils/constant/icon.ts +19 -0
- package/dist/components-harmony-ets/utils/constant/style.ets +88 -0
- package/dist/components-harmony-ets/utils/events.ts +24 -0
- package/dist/components-harmony-ets/utils/flexManager.ets +107 -0
- package/dist/components-harmony-ets/utils/helper.ets +99 -0
- package/dist/components-harmony-ets/utils/htmlParser/HarmonyHTMLParser.ts +103 -0
- package/dist/components-harmony-ets/utils/htmlParser/index.ts +56 -0
- package/dist/components-harmony-ets/utils/index.ts +83 -0
- package/dist/components-harmony-ets/utils/styles.ets +91 -0
- package/dist/components-harmony-ets/video.ets +161 -0
- package/dist/components-harmony-ets/view.ets +79 -0
- package/dist/index.js +1183 -0
- package/dist/index.js.map +1 -0
- package/dist/runtime-ets/bom/document.ts +38 -0
- package/dist/runtime-ets/bom/getComputedStyle.ts +5 -0
- package/dist/runtime-ets/bom/navigator.ts +21 -0
- package/dist/runtime-ets/bom/raf.ts +37 -0
- package/dist/runtime-ets/bom/window.ts +44 -0
- package/dist/runtime-ets/constant.ts +29 -0
- package/dist/runtime-ets/current.ts +16 -0
- package/dist/runtime-ets/dom/class-list.ts +117 -0
- package/dist/runtime-ets/dom/comment.ts +10 -0
- package/dist/runtime-ets/dom/cssStyleDeclaration.ts +105 -0
- package/dist/runtime-ets/dom/document.ts +108 -0
- package/dist/runtime-ets/dom/element.ts +457 -0
- package/dist/runtime-ets/dom/event.ts +164 -0
- package/dist/runtime-ets/dom/eventTarget.ts +98 -0
- package/dist/runtime-ets/dom/node.ts +215 -0
- package/dist/runtime-ets/dom/stylesheet/index.ts +687 -0
- package/dist/runtime-ets/dom/stylesheet/type.ts +136 -0
- package/dist/runtime-ets/dom/stylesheet/util.ts +134 -0
- package/dist/runtime-ets/dom/text.ts +19 -0
- package/dist/runtime-ets/index.ts +19 -0
- package/dist/runtime-ets/interface/event.ts +9 -0
- package/dist/runtime-ets/interface/index.ts +1 -0
- package/dist/runtime-ets/utils/bind.ts +35 -0
- package/dist/runtime-ets/utils/index.ts +135 -0
- package/dist/runtime-ets/utils/info.ts +128 -0
- package/dist/runtime-framework/react/app.ts +256 -0
- package/dist/runtime-framework/react/connect.ts +24 -0
- package/dist/runtime-framework/react/constant.ts +5 -0
- package/dist/runtime-framework/react/hooks.ts +101 -0
- package/dist/runtime-framework/react/index.ts +16 -0
- package/dist/runtime-framework/react/page.ts +263 -0
- package/dist/runtime-framework/react/utils/index.ts +25 -0
- package/dist/runtime-framework/react/utils/is.ts +46 -0
- package/dist/runtime-framework/solid/README.md +99 -0
- package/dist/runtime-framework/solid/app.ts +200 -0
- package/dist/runtime-framework/solid/connect.ts +11 -0
- package/dist/runtime-framework/solid/contant.ts +5 -0
- package/dist/runtime-framework/solid/hooks.ts +88 -0
- package/dist/runtime-framework/solid/index.ts +10 -0
- package/dist/runtime-framework/solid/page.ts +202 -0
- package/dist/runtime-framework/solid/reconciler/h.ts +132 -0
- package/dist/runtime-framework/solid/reconciler/index.ts +3 -0
- package/dist/runtime-framework/solid/reconciler/props.ts +151 -0
- package/dist/runtime-framework/solid/reconciler/render.ts +61 -0
- package/dist/runtime-framework/solid/reconciler/use.ts +8 -0
- package/dist/runtime-framework/solid/utils/index.ts +49 -0
- package/dist/runtime-framework/solid/utils/is.ts +46 -0
- package/dist/runtime-utils.js +4149 -0
- package/dist/runtime-utils.js.map +1 -0
- package/dist/runtime.js +4150 -0
- package/dist/runtime.js.map +1 -0
- package/dist/template/container.js +7 -0
- package/index.js +4 -0
- package/package.json +54 -0
- package/types/api.d.ts +4 -0
- package/types/component.d.ts +4 -0
- package/types/harmony.d.ts +11 -0
- package/types/runtime.d.ts +15 -0
- package/types/taro.d.ts +7 -0
- package/types/webpack-sources.d.ts +108 -0
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
import {
|
|
2
|
+
TaroButtonElement as _TaroButtonElement,
|
|
3
|
+
TaroCheckboxGroupElement as _TaroCheckboxGroupElement,
|
|
4
|
+
TaroScrollViewElement as _TaroScrollViewElement,
|
|
5
|
+
TaroElement as _TaroElement,
|
|
6
|
+
TaroFormWidgetElement as _TaroFormWidgetElement,
|
|
7
|
+
TaroIgnoreElement as _TaroIgnoreElement,
|
|
8
|
+
TaroImageElement as _TaroImageElement,
|
|
9
|
+
TaroInputElement as _TaroInputElement,
|
|
10
|
+
TaroPickerElement as _TaroPickerElement,
|
|
11
|
+
TaroRadioGroupElement as _TaroRadioGroupElement,
|
|
12
|
+
TaroSliderElement as _TaroSliderElement,
|
|
13
|
+
TaroSwitchElement as _TaroSwitchElement,
|
|
14
|
+
TaroTextElement as _TaroTextElement,
|
|
15
|
+
TaroVideoElement as _TaroVideoElement,
|
|
16
|
+
TaroViewElement as _TaroViewElement,
|
|
17
|
+
TaroCheckboxElement as _TaroCheckboxElement,
|
|
18
|
+
TaroRadioElement as _TaroRadioElement,
|
|
19
|
+
TaroIconElement as _TaroIconElement,
|
|
20
|
+
TaroLabelElement as _TaroLabelElement,
|
|
21
|
+
TaroRichTextElement as _TaroRichTextElement,
|
|
22
|
+
TaroSwiperElement as _TaroSwiperElement,
|
|
23
|
+
TaroSwiperItemElement as _TaroSwiperItemElement,
|
|
24
|
+
TaroTextAreaElement as _TaroTextAreaElement,
|
|
25
|
+
FormElement as _FormElement,
|
|
26
|
+
Current,
|
|
27
|
+
TaroAny
|
|
28
|
+
} from '@tarojs/runtime'
|
|
29
|
+
|
|
30
|
+
import { TaroCheckbox, TaroCheckboxGroup } from './checkbox'
|
|
31
|
+
import { TaroRadio, TaroRadioGroup } from './radio'
|
|
32
|
+
import TaroButton from './button'
|
|
33
|
+
import TaroView from './view'
|
|
34
|
+
import TaroForm from './form'
|
|
35
|
+
import TaroIcon from './icon'
|
|
36
|
+
import TaroText from './text'
|
|
37
|
+
import TaroImage from './image'
|
|
38
|
+
import TaroInput from './input'
|
|
39
|
+
import TaroScrollView from './scrollView'
|
|
40
|
+
import TaroTextArea from './textArea'
|
|
41
|
+
import TaroRichText from './richText'
|
|
42
|
+
import TaroLabel from './label'
|
|
43
|
+
import TaroVideo from './video'
|
|
44
|
+
import TaroPicker from './picker'
|
|
45
|
+
import TaroSwitch from './switch'
|
|
46
|
+
import TaroSlider from './slider'
|
|
47
|
+
import { TaroSwiper } from './swiper'
|
|
48
|
+
|
|
49
|
+
@Observed
|
|
50
|
+
class TaroElement extends _TaroElement {
|
|
51
|
+
constructor(tagName: string) {
|
|
52
|
+
super(tagName)
|
|
53
|
+
}
|
|
54
|
+
declare public _instance: TaroAny
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
@Observed
|
|
58
|
+
class TaroViewElement extends _TaroViewElement {
|
|
59
|
+
declare public _instance: TaroView
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
@Observed
|
|
63
|
+
class TaroTextElement extends _TaroTextElement {
|
|
64
|
+
declare public _instance: TaroText
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
@Observed
|
|
68
|
+
class TaroImageElement extends _TaroImageElement {
|
|
69
|
+
declare public _instance: TaroImage
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
@Observed
|
|
73
|
+
class TaroScrollViewElement extends _TaroScrollViewElement {
|
|
74
|
+
declare public _instance: TaroScrollView
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
@Observed
|
|
78
|
+
class TaroButtonElement extends _TaroButtonElement {
|
|
79
|
+
declare public _instance: TaroButton
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
@Observed
|
|
83
|
+
class TaroInputElement extends _TaroInputElement {
|
|
84
|
+
declare public _instance: TaroInput
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
@Observed
|
|
88
|
+
class TaroSliderElement extends _TaroSliderElement {
|
|
89
|
+
declare public _instance: TaroSlider
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
@Observed
|
|
93
|
+
class TaroSwitchElement extends _TaroSwitchElement {
|
|
94
|
+
declare public _instance: TaroSwitch
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
@Observed
|
|
98
|
+
class TaroCheckboxGroupElement extends _TaroCheckboxGroupElement {
|
|
99
|
+
declare public _instance: TaroCheckboxGroup
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
@Observed
|
|
103
|
+
class TaroRadioGroupElement extends _TaroRadioGroupElement {
|
|
104
|
+
declare public _instance: TaroRadioGroup
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
@Observed
|
|
108
|
+
class TaroPickerElement extends _TaroPickerElement {
|
|
109
|
+
declare public _instance: TaroPicker
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
@Observed
|
|
113
|
+
class TaroVideoElement extends _TaroVideoElement {
|
|
114
|
+
declare public _instance: TaroVideo
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
@Observed
|
|
118
|
+
class TaroCheckboxElement extends _TaroCheckboxElement{
|
|
119
|
+
declare public _instance: TaroCheckbox
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
@Observed
|
|
123
|
+
class TaroRadioElement extends _TaroRadioElement{
|
|
124
|
+
declare public _instance: TaroRadio
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
@Observed
|
|
128
|
+
class TaroIconElement extends _TaroIconElement{
|
|
129
|
+
declare public _instance: TaroIcon
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
@Observed
|
|
133
|
+
class TaroLabelElement extends _TaroLabelElement{
|
|
134
|
+
declare public _instance: TaroLabel
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
@Observed
|
|
138
|
+
class TaroRichTextElement extends _TaroRichTextElement{
|
|
139
|
+
declare public _instance: TaroRichText
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
@Observed
|
|
143
|
+
class TaroSwiperElement extends _TaroSwiperElement{
|
|
144
|
+
declare public _instance: TaroSwiper
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
@Observed
|
|
148
|
+
class TaroSwiperItemElement extends _TaroSwiperItemElement{
|
|
149
|
+
declare public _instance: TaroSwiper
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
@Observed
|
|
153
|
+
class TaroTextAreaElement extends _TaroTextAreaElement{
|
|
154
|
+
declare public _instance: TaroTextArea
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
@Observed
|
|
158
|
+
class TaroFormElement extends _FormElement {
|
|
159
|
+
declare public _instance: TaroForm
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
@Observed
|
|
163
|
+
class TaroFormWidgetElement extends _TaroFormWidgetElement {}
|
|
164
|
+
|
|
165
|
+
@Observed
|
|
166
|
+
class TaroIgnoreElement extends _TaroIgnoreElement {}
|
|
167
|
+
|
|
168
|
+
export function initHarmonyElement () {
|
|
169
|
+
Current.createHarmonyElement = (tagName: string) => {
|
|
170
|
+
switch (tagName) {
|
|
171
|
+
case 'view': return new TaroViewElement()
|
|
172
|
+
case 'image': return new TaroImageElement()
|
|
173
|
+
case 'text': return new TaroTextElement()
|
|
174
|
+
case 'button': return new TaroButtonElement()
|
|
175
|
+
case 'scroll-view': return new TaroScrollViewElement()
|
|
176
|
+
case 'checkbox-group': return new TaroCheckboxGroupElement()
|
|
177
|
+
case 'ignore': return new TaroIgnoreElement()
|
|
178
|
+
case 'input': return new TaroInputElement()
|
|
179
|
+
case 'picker': return new TaroPickerElement()
|
|
180
|
+
case 'radio-group': return new TaroRadioGroupElement()
|
|
181
|
+
case 'slider': return new TaroSliderElement()
|
|
182
|
+
case 'switch': return new TaroSwitchElement()
|
|
183
|
+
case 'video': return new TaroVideoElement()
|
|
184
|
+
case 'checkbox': return new TaroCheckboxElement()
|
|
185
|
+
case 'radio': return new TaroRadioElement()
|
|
186
|
+
case 'icon': return new TaroIconElement()
|
|
187
|
+
case 'label': return new TaroLabelElement()
|
|
188
|
+
case 'rich-text': return new TaroRichTextElement()
|
|
189
|
+
case 'swiper': return new TaroSwiperElement()
|
|
190
|
+
case 'swiper-item': return new TaroSwiperItemElement()
|
|
191
|
+
case 'text-area': return new TaroTextAreaElement()
|
|
192
|
+
case 'form': return new TaroFormElement()
|
|
193
|
+
default: return new TaroElement(tagName)
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
export {
|
|
199
|
+
TaroButtonElement,
|
|
200
|
+
TaroCheckboxGroupElement,
|
|
201
|
+
TaroElement,
|
|
202
|
+
TaroScrollViewElement,
|
|
203
|
+
TaroFormWidgetElement,
|
|
204
|
+
TaroIgnoreElement,
|
|
205
|
+
TaroImageElement,
|
|
206
|
+
TaroInputElement,
|
|
207
|
+
TaroPickerElement,
|
|
208
|
+
TaroRadioGroupElement,
|
|
209
|
+
TaroSliderElement,
|
|
210
|
+
TaroSwitchElement,
|
|
211
|
+
TaroTextElement,
|
|
212
|
+
TaroVideoElement,
|
|
213
|
+
TaroViewElement,
|
|
214
|
+
TaroCheckboxElement,
|
|
215
|
+
TaroRadioElement,
|
|
216
|
+
TaroIconElement,
|
|
217
|
+
TaroLabelElement,
|
|
218
|
+
TaroRichTextElement,
|
|
219
|
+
TaroSwiperElement,
|
|
220
|
+
TaroSwiperItemElement,
|
|
221
|
+
TaroTextAreaElement,
|
|
222
|
+
TaroFormElement
|
|
223
|
+
}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { bindInstanceToNode, AREA_CHANGE_EVENT_NAME, eventHandler, getComponentEventCallback, VISIBLE_CHANGE_EVENT_NAME, initComponentNodeInfo, findChildNodeWithDFS,
|
|
2
|
+
TaroEvent,
|
|
3
|
+
TaroAny,
|
|
4
|
+
TaroFormWidgetElement
|
|
5
|
+
} from '@tarojs/runtime'
|
|
6
|
+
|
|
7
|
+
import { createNode } from './render'
|
|
8
|
+
import TaroComponentWrapper from './base'
|
|
9
|
+
import { TOUCH_EVENT_MAP } from './utils/constant/event'
|
|
10
|
+
import { FlexManager } from './utils/FlexManager'
|
|
11
|
+
import { createTaroEvent } from './utils/events'
|
|
12
|
+
import { getNormalAttributes, shouldBindEvent, getNodeThresholds, bindAnimation } from './utils/helper'
|
|
13
|
+
|
|
14
|
+
import type { TaroFormElement, TaroElement, TaroCheckboxElement, TaroRadioElement, TaroInputElement,
|
|
15
|
+
TaroSliderElement,
|
|
16
|
+
TaroSwitchElement,
|
|
17
|
+
TaroPickerElement
|
|
18
|
+
} from './element'
|
|
19
|
+
import type { TaroStyleType } from '@tarojs/runtime'
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
@Extend(Flex)
|
|
23
|
+
function attrs (style: TaroStyleType) {
|
|
24
|
+
.id(style.id)
|
|
25
|
+
.key(style.id)
|
|
26
|
+
.padding(style.padding)
|
|
27
|
+
.margin(style.margin)
|
|
28
|
+
.width(style.width)
|
|
29
|
+
.height(style.height)
|
|
30
|
+
.constraintSize(style.constraintSize)
|
|
31
|
+
.flexGrow(style.flexGrow)
|
|
32
|
+
.flexShrink(style.flexShrink)
|
|
33
|
+
.flexBasis(style.flexBasis)
|
|
34
|
+
.alignSelf(style.alignSelf)
|
|
35
|
+
.backgroundColor(style.backgroundColor)
|
|
36
|
+
.backgroundImage(style.backgroundImage, style.backgroundRepeat)
|
|
37
|
+
.backgroundImageSize(style.backgroundImageSize)
|
|
38
|
+
.rotate(style.rotate)
|
|
39
|
+
.scale(style.scale)
|
|
40
|
+
.translate(style.translate)
|
|
41
|
+
.transform(style.transform)
|
|
42
|
+
.borderStyle(style.borderStyle)
|
|
43
|
+
.borderWidth(style.borderWidth)
|
|
44
|
+
.borderColor(style.borderColor)
|
|
45
|
+
.borderRadius(style.borderRadius)
|
|
46
|
+
.linearGradient(style.linearGradient)
|
|
47
|
+
.zIndex(style.zIndex)
|
|
48
|
+
.opacity(style.opacity)
|
|
49
|
+
.clip(style.clip)
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
@Component
|
|
53
|
+
export default struct TaroForm {
|
|
54
|
+
nodeInfoMap: TaroAny = {}
|
|
55
|
+
|
|
56
|
+
@Styles visibleChangeEvent () {
|
|
57
|
+
.onVisibleAreaChange(getNodeThresholds(this.node) || [0.0, 1.0], getComponentEventCallback(this.node, VISIBLE_CHANGE_EVENT_NAME))
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
@ObjectLink node: TaroFormElement
|
|
61
|
+
|
|
62
|
+
aboutToAppear () {
|
|
63
|
+
initComponentNodeInfo(this, this.node)
|
|
64
|
+
bindInstanceToNode(this.node, this)
|
|
65
|
+
// 绑定动画
|
|
66
|
+
bindAnimation(this.node)
|
|
67
|
+
|
|
68
|
+
// 监听submit冒泡
|
|
69
|
+
this.node.addEventListener('submit-btn', (e: TaroEvent) => {
|
|
70
|
+
e.stopPropagation()
|
|
71
|
+
const formResult: Record<string, string> = {}
|
|
72
|
+
findChildNodeWithDFS(this.node, (item: TaroFormWidgetElement) => {
|
|
73
|
+
switch (item.nodeName) {
|
|
74
|
+
case 'INPUT':
|
|
75
|
+
case 'SLIDER':
|
|
76
|
+
case 'SWITCH':
|
|
77
|
+
case 'RADIO-GROUP':
|
|
78
|
+
case 'CHECKBOX-GROUP':
|
|
79
|
+
case 'PICKER': {
|
|
80
|
+
formResult[item.name] = item.value
|
|
81
|
+
break
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
return false
|
|
85
|
+
}, true)
|
|
86
|
+
const event: TaroEvent = createTaroEvent('submit', { detail: { value: formResult } }, this.node)
|
|
87
|
+
eventHandler(event, 'submit', this.node)
|
|
88
|
+
})
|
|
89
|
+
// 监听reset冒泡
|
|
90
|
+
this.node.addEventListener('reset-btn', (e: TaroEvent) => {
|
|
91
|
+
findChildNodeWithDFS(this.node, (item: TaroFormWidgetElement) => {
|
|
92
|
+
e.stopPropagation()
|
|
93
|
+
switch (item.nodeName) {
|
|
94
|
+
case 'INPUT': {
|
|
95
|
+
item.value = (item as TaroInputElement)._attrs.value
|
|
96
|
+
break
|
|
97
|
+
}
|
|
98
|
+
case 'SLIDER': {
|
|
99
|
+
item.value = (item as TaroSliderElement)._attrs.value
|
|
100
|
+
break
|
|
101
|
+
}
|
|
102
|
+
case 'SWITCH': {
|
|
103
|
+
item.value = (item as TaroSwitchElement)._attrs.checked
|
|
104
|
+
break
|
|
105
|
+
}
|
|
106
|
+
case 'RADIO-GROUP': {
|
|
107
|
+
item.getElementsByTagName<TaroRadioElement>('RADIO').forEach(element => {
|
|
108
|
+
element._instance.checked = element._attrs.checked || false
|
|
109
|
+
})
|
|
110
|
+
break
|
|
111
|
+
}
|
|
112
|
+
case 'CHECKBOX-GROUP': {
|
|
113
|
+
item.getElementsByTagName<TaroCheckboxElement>('CHECKBOX').forEach(element => {
|
|
114
|
+
element._instance.checked = element._attrs.checked || false
|
|
115
|
+
})
|
|
116
|
+
break
|
|
117
|
+
}
|
|
118
|
+
case 'PICKER': {
|
|
119
|
+
item.value = (item as TaroPickerElement)._attrs.value
|
|
120
|
+
break
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
return false
|
|
124
|
+
}, true)
|
|
125
|
+
})
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
@Styles defaultEvent () {
|
|
129
|
+
.onClick(shouldBindEvent((e: ClickEvent) => eventHandler(e, 'click', this.node), this.node, ['click']))
|
|
130
|
+
.onTouch(shouldBindEvent((e: TouchEvent) => eventHandler(e, TOUCH_EVENT_MAP.get(e.type), this.node), this.node, TOUCH_EVENT_MAP.values()))
|
|
131
|
+
.onAreaChange(getComponentEventCallback(this.node, AREA_CHANGE_EVENT_NAME, res => {
|
|
132
|
+
const eventResult: TaroAny = res.eventResult
|
|
133
|
+
this.nodeInfoMap[this.node._nid].areaInfo = eventResult[1]
|
|
134
|
+
}))
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
build() {
|
|
138
|
+
TaroComponentWrapper({ node: this.node }) {
|
|
139
|
+
Flex(FlexManager.flexOptions(this.node)) {
|
|
140
|
+
ForEach(this.node.childNodes, (item: TaroElement) => {
|
|
141
|
+
createNode(item)
|
|
142
|
+
}, (item: TaroElement) => item._nid)
|
|
143
|
+
}
|
|
144
|
+
.attrs(getNormalAttributes(this.node))
|
|
145
|
+
.defaultEvent()
|
|
146
|
+
.visibleChangeEvent()
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { bindInstanceToNode, eventHandler, convertNumber2VP, getComponentEventCallback, AREA_CHANGE_EVENT_NAME, VISIBLE_CHANGE_EVENT_NAME, initComponentNodeInfo, TaroAny } from '@tarojs/runtime'
|
|
2
|
+
|
|
3
|
+
import TaroComponentWrapper from './base'
|
|
4
|
+
import { ICON_SVG_MAP } from './utils/constant/icon'
|
|
5
|
+
import { getNormalAttributes, shouldBindEvent, getNodeThresholds, bindAnimation } from './utils/helper'
|
|
6
|
+
|
|
7
|
+
import type { TaroIconElement } from './element'
|
|
8
|
+
import type { TaroStyleType } from '@tarojs/runtime'
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
@Extend(Image)
|
|
12
|
+
function attrs (style: TaroStyleType) {
|
|
13
|
+
.id(style.id)
|
|
14
|
+
.key(style.id)
|
|
15
|
+
.padding(style.padding)
|
|
16
|
+
.margin(style.margin)
|
|
17
|
+
.width(style.width || convertNumber2VP(23))
|
|
18
|
+
.height(style.height || convertNumber2VP(23))
|
|
19
|
+
.constraintSize(style.constraintSize)
|
|
20
|
+
.flexGrow(style.flexGrow)
|
|
21
|
+
.flexShrink(style.flexShrink)
|
|
22
|
+
.flexBasis(style.flexBasis)
|
|
23
|
+
.alignSelf(style.alignSelf)
|
|
24
|
+
.backgroundColor(style.backgroundColor)
|
|
25
|
+
.backgroundImage(style.backgroundImage, style.backgroundRepeat)
|
|
26
|
+
.backgroundImageSize(style.backgroundImageSize)
|
|
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)
|
|
36
|
+
.zIndex(style.zIndex)
|
|
37
|
+
.opacity(style.opacity)
|
|
38
|
+
.clip(style.clip)
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
@Component
|
|
42
|
+
export default struct TaroIcon {
|
|
43
|
+
nodeInfoMap: TaroAny = {}
|
|
44
|
+
|
|
45
|
+
@Styles visibleChangeEvent () {
|
|
46
|
+
.onVisibleAreaChange(getNodeThresholds(this.node) || [0.0, 1.0], getComponentEventCallback(this.node, VISIBLE_CHANGE_EVENT_NAME))
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
@ObjectLink node: TaroIconElement
|
|
50
|
+
|
|
51
|
+
aboutToAppear () {
|
|
52
|
+
initComponentNodeInfo(this, this.node)
|
|
53
|
+
bindInstanceToNode(this.node, this)
|
|
54
|
+
// 绑定动画
|
|
55
|
+
bindAnimation(this.node)
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
@Styles defaultEvent () {
|
|
59
|
+
.onClick(shouldBindEvent((e: ClickEvent) => eventHandler(e, 'click', this.node), this.node, ['click']))
|
|
60
|
+
.onAreaChange(getComponentEventCallback(this.node, AREA_CHANGE_EVENT_NAME, res => {
|
|
61
|
+
const eventResult: TaroAny = res.eventResult
|
|
62
|
+
this.nodeInfoMap[this.node._nid].areaInfo = eventResult[1]
|
|
63
|
+
}))
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
getIconData () {
|
|
67
|
+
if (!this.node || !this.node._attrs) return null
|
|
68
|
+
const type: string = this.node._attrs.type
|
|
69
|
+
// TODO:等待鸿蒙支持 base64 格式的 svg 图片,或者工程化支持图片资源的迁移
|
|
70
|
+
return ICON_SVG_MAP.get(type) || null
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
build() {
|
|
74
|
+
TaroComponentWrapper({ node: this.node }) {
|
|
75
|
+
Image(this.getIconData())
|
|
76
|
+
.defaultEvent()
|
|
77
|
+
.objectFit(ImageFit.Contain)
|
|
78
|
+
.fillColor(this.node._attrs.color)
|
|
79
|
+
.onComplete(e => eventHandler(e, 'complete', this.node))
|
|
80
|
+
.attrs(getNormalAttributes(this.node))
|
|
81
|
+
.visibleChangeEvent()
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { bindInstanceToNode, eventHandler, getComponentEventCallback, AREA_CHANGE_EVENT_NAME, VISIBLE_CHANGE_EVENT_NAME, initComponentNodeInfo, TaroAny } from '@tarojs/runtime'
|
|
2
|
+
|
|
3
|
+
import TaroComponentWrapper from './base'
|
|
4
|
+
import { getNormalAttributes, shouldBindEvent, getNodeThresholds, bindAnimation } from './utils/helper'
|
|
5
|
+
|
|
6
|
+
import type { TaroImageElement } from './element'
|
|
7
|
+
import type { TaroStyleType } from '@tarojs/runtime'
|
|
8
|
+
|
|
9
|
+
@Extend(Image)
|
|
10
|
+
function attrs (style: TaroStyleType) {
|
|
11
|
+
.id(style.id)
|
|
12
|
+
.key(style.id)
|
|
13
|
+
.padding(style.padding)
|
|
14
|
+
.margin(style.margin)
|
|
15
|
+
.width(style.width)
|
|
16
|
+
.height(style.height)
|
|
17
|
+
.constraintSize(style.constraintSize)
|
|
18
|
+
.flexGrow(style.flexGrow)
|
|
19
|
+
.flexShrink(style.flexShrink)
|
|
20
|
+
.flexBasis(style.flexBasis)
|
|
21
|
+
.alignSelf(style.alignSelf)
|
|
22
|
+
.backgroundColor(style.backgroundColor)
|
|
23
|
+
.backgroundImage(style.backgroundImage, style.backgroundRepeat)
|
|
24
|
+
.backgroundImageSize(style.backgroundImageSize)
|
|
25
|
+
.rotate(style.rotate)
|
|
26
|
+
.scale(style.scale)
|
|
27
|
+
.translate(style.translate)
|
|
28
|
+
.transform(style.transform)
|
|
29
|
+
.borderStyle(style.borderStyle)
|
|
30
|
+
.borderWidth(style.borderWidth)
|
|
31
|
+
.borderColor(style.borderColor)
|
|
32
|
+
.borderRadius(style.borderRadius)
|
|
33
|
+
.linearGradient(style.linearGradient)
|
|
34
|
+
.zIndex(style.zIndex)
|
|
35
|
+
.opacity(style.opacity)
|
|
36
|
+
.clip(style.clip)
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function getImageMode (mode: string): ImageFit {
|
|
40
|
+
switch (mode) {
|
|
41
|
+
case 'aspectFit': return ImageFit.Contain
|
|
42
|
+
case 'aspectFill': return ImageFit.Cover
|
|
43
|
+
case 'scaleToFill': return ImageFit.Fill
|
|
44
|
+
case 'widthFix': return ImageFit.Auto
|
|
45
|
+
case 'heightFix': return ImageFit.Auto
|
|
46
|
+
default: return ImageFit.Contain
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
@Component
|
|
51
|
+
export default struct TaroImage {
|
|
52
|
+
nodeInfoMap: TaroAny = {}
|
|
53
|
+
|
|
54
|
+
@Styles visibleChangeEvent () {
|
|
55
|
+
.onVisibleAreaChange(getNodeThresholds(this.node) || [0.0, 1.0], getComponentEventCallback(this.node, VISIBLE_CHANGE_EVENT_NAME))
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
@ObjectLink node: TaroImageElement
|
|
59
|
+
|
|
60
|
+
aboutToAppear () {
|
|
61
|
+
initComponentNodeInfo(this, this.node)
|
|
62
|
+
bindInstanceToNode(this.node, this)
|
|
63
|
+
// 绑定动画
|
|
64
|
+
bindAnimation(this.node)
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
@Styles defaultEvent () {
|
|
68
|
+
.onClick(shouldBindEvent((e: ClickEvent) => eventHandler(e, 'click', this.node), this.node, ['click']))
|
|
69
|
+
.onAreaChange(getComponentEventCallback(this.node, AREA_CHANGE_EVENT_NAME, res => {
|
|
70
|
+
const eventResult: TaroAny = res.eventResult
|
|
71
|
+
this.nodeInfoMap[this.node._nid].areaInfo = eventResult[1]
|
|
72
|
+
}))
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
build() {
|
|
76
|
+
TaroComponentWrapper({ node: this.node }) {
|
|
77
|
+
Image(this.node.getAttribute('src'))
|
|
78
|
+
.defaultEvent()
|
|
79
|
+
.objectFit(getImageMode(this.node.getAttribute('mode')))
|
|
80
|
+
.attrs(getNormalAttributes(this.node))
|
|
81
|
+
.onComplete(e => eventHandler(e, 'complete', this.node))
|
|
82
|
+
.visibleChangeEvent()
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
export const TaroViewTagName = 'view'
|
|
2
|
+
export const TaroIconTagName = 'icon'
|
|
3
|
+
export const TaroProgressTagName = 'progress'
|
|
4
|
+
export const TaroRichTextTagName = 'rich-text'
|
|
5
|
+
export const TaroTextTagName = 'text'
|
|
6
|
+
export const TaroButtonTagName = 'button'
|
|
7
|
+
export const TaroCheckboxTagName = 'checkbox'
|
|
8
|
+
export const TaroCheckboxGroupTagName = 'checkbox-group'
|
|
9
|
+
export const TaroFormTagName = 'form'
|
|
10
|
+
export const TaroInputTagName = 'input'
|
|
11
|
+
export const TaroLabelTagName = 'label'
|
|
12
|
+
export const TaroPickerTagName = 'picker'
|
|
13
|
+
export const TaroPickerViewTagName = 'picker-view'
|
|
14
|
+
export const TaroPickerViewColumnTagName = 'picker-view-column'
|
|
15
|
+
export const TaroRadioTagName = 'radio'
|
|
16
|
+
export const TaroRadioGroupTagName = 'radio-group'
|
|
17
|
+
export const TaroSliderTagName = 'slider'
|
|
18
|
+
export const TaroSwitchTagName = 'switch'
|
|
19
|
+
export const TaroCoverImageTagName = 'cover-image'
|
|
20
|
+
export const TaroTextareaTagName = 'textarea'
|
|
21
|
+
export const TaroCoverViewTagName = 'cover-view'
|
|
22
|
+
export const TaroMovableAreaTagName = 'movable-area'
|
|
23
|
+
export const TaroMovableViewTagName = 'movable-view'
|
|
24
|
+
export const TaroScrollViewTagName = 'scroll-view'
|
|
25
|
+
export const TaroSwiperTagName = 'swiper'
|
|
26
|
+
export const TaroSwiperItemTagName = 'swiper-item'
|
|
27
|
+
export const TaroNavigatorTagName = 'navigator'
|
|
28
|
+
export const TaroAudioTagName = 'audio'
|
|
29
|
+
export const TaroCameraTagName = 'camera'
|
|
30
|
+
export const TaroImageTagName = 'image'
|
|
31
|
+
export const TaroLivePlayerTagName = 'live-player'
|
|
32
|
+
export const TaroVideoTagName = 'video'
|
|
33
|
+
export const TaroCanvasTagName = 'canvas'
|
|
34
|
+
export const TaroAdTagName = 'ad'
|
|
35
|
+
export const TaroWebViewTagName = 'web-view'
|
|
36
|
+
export const TaroBlockTagName = 'block'
|
|
37
|
+
export const TaroMapTagName = 'map'
|
|
38
|
+
export const TaroSlotTagName = 'slot'
|
|
39
|
+
export const TaroNativeSlotTagName = 'native-slot'
|
|
40
|
+
export const TaroCustomWrapperTagName = 'custom-wrapper'
|
|
41
|
+
|
|
42
|
+
export const TaroSpanTagName = 'span'
|
|
43
|
+
export const TaroTabsTagName = 'tabs'
|
|
44
|
+
export const TaroTabBarTagName = 'tab-bar'
|
|
45
|
+
export const TaroTabContentTagName = 'tab-content'
|
|
46
|
+
export const TaroListTagName = 'list'
|
|
47
|
+
export const TaroListItemTagName = 'list-item'
|
|
48
|
+
export const TaroOpenDataTagName = 'open-data'
|
|
49
|
+
export const TaroIgnoreTagName = 'ignore'
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import TaroComponentWrapper from './base'
|
|
2
|
+
import web_webview from '@ohos.web.webview'
|
|
3
|
+
import htmlParser from './utils/htmlParser'
|
|
4
|
+
import { createNode } from './render'
|
|
5
|
+
import type { TaroElement } from './element'
|
|
6
|
+
|
|
7
|
+
@Component
|
|
8
|
+
export default struct TaroInnerHtml {
|
|
9
|
+
@ObjectLink node: TaroElement
|
|
10
|
+
|
|
11
|
+
// controller: web_webview.WebviewController = new web_webview.WebviewController();
|
|
12
|
+
|
|
13
|
+
// isLoaded: boolean = false
|
|
14
|
+
|
|
15
|
+
// @State isInit: boolean = false
|
|
16
|
+
|
|
17
|
+
// @State height: string = '2vp' // 如果起始高度不足,将不会渲染webview
|
|
18
|
+
|
|
19
|
+
// jsBridge = {
|
|
20
|
+
// // 获取父级高度,拿到实际的webview宽度,计算出高度
|
|
21
|
+
// load: (bodyHeight: number, bodyWidth: number) => {
|
|
22
|
+
// const { width } = this.node.parentElement.instance.info
|
|
23
|
+
// const widthPx = vp2px(width)
|
|
24
|
+
// this.height = Math.floor(widthPx / bodyWidth * bodyHeight) + 'px'
|
|
25
|
+
// this.isInit = true
|
|
26
|
+
// }
|
|
27
|
+
// }
|
|
28
|
+
|
|
29
|
+
build() {
|
|
30
|
+
TaroComponentWrapper({ node: this.node }) {
|
|
31
|
+
if (this.node.innerHTML) {
|
|
32
|
+
createNode(htmlParser(this.node.innerHTML))
|
|
33
|
+
}
|
|
34
|
+
// // webview实现
|
|
35
|
+
// if (this.node.innerHTML) {
|
|
36
|
+
// Web({ src: $rawfile('innerHTML.html'), controller: this.controller }).onPageBegin((event) => {
|
|
37
|
+
// if (this.isLoaded) return
|
|
38
|
+
// this.isLoaded = true
|
|
39
|
+
// // 注入jsBridge,监听页面onload行为,获取高度
|
|
40
|
+
// this.controller.registerJavaScriptProxy(this.jsBridge, 'jsBridge', ['load'])
|
|
41
|
+
// const innerString = this.node.innerHTML
|
|
42
|
+
// try {
|
|
43
|
+
// this.controller.loadData(
|
|
44
|
+
// `
|
|
45
|
+
// <html>
|
|
46
|
+
// <body onload="jsBridge.load(document.getElementById('container').clientHeight, document.body.clientWidth);" style="padding: 0;margin: 0">
|
|
47
|
+
// <div id="container">
|
|
48
|
+
// ${innerString}
|
|
49
|
+
// </div>
|
|
50
|
+
// </body>
|
|
51
|
+
// </html>
|
|
52
|
+
// `,
|
|
53
|
+
// "text/html",
|
|
54
|
+
// "UTF-8"
|
|
55
|
+
// )
|
|
56
|
+
// } catch (error) {
|
|
57
|
+
// console.log(`ErrorCode: ${error.code}, Message: ${error.message}`);
|
|
58
|
+
// }
|
|
59
|
+
// })
|
|
60
|
+
// .javaScriptAccess(true)
|
|
61
|
+
// .size({
|
|
62
|
+
// width: '100%',
|
|
63
|
+
// height: this.height
|
|
64
|
+
// })
|
|
65
|
+
// .visibility(this.isInit)
|
|
66
|
+
// // 覆盖webwiew的scroll
|
|
67
|
+
// Stack({ alignContent: Alignment.TopStart }) {
|
|
68
|
+
// Flex().size({
|
|
69
|
+
// height: this.height,
|
|
70
|
+
// width: '100%'
|
|
71
|
+
// })
|
|
72
|
+
// }.position({
|
|
73
|
+
// x: 0,
|
|
74
|
+
// y: 0
|
|
75
|
+
// })
|
|
76
|
+
// }
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|