@tarojs/plugin-platform-harmony-ets 4.0.0-beta.7 → 4.0.0-beta.9
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 -0
- package/dist/apis/network/request.ts +5 -5
- package/dist/apis/wxml/index.ts +2 -0
- package/dist/runtime-ets/dom/document.ts +21 -4
- package/dist/runtime-ets/index.ts +1 -1
- package/dist/runtime-utils.js +7 -5
- package/dist/runtime-utils.js.map +1 -1
- package/dist/runtime.js +7 -5
- package/dist/runtime.js.map +1 -1
- package/package.json +10 -10
package/dist/apis/index.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
// ✅ RequestTask.onHeadersReceived
|
|
7
7
|
|
|
8
8
|
import http from '@ohos.net.http'
|
|
9
|
-
import { isString
|
|
9
|
+
import { isString } from '@tarojs/shared'
|
|
10
10
|
|
|
11
11
|
import { callAsyncFail, callAsyncSuccess, validateParams } from '../utils'
|
|
12
12
|
|
|
@@ -59,10 +59,10 @@ export const request: typeof Taro.request = function (options) {
|
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
// 检查 Header 是否有 Referer
|
|
62
|
-
if (isUndefined(header.Referer)) {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}
|
|
62
|
+
// if (isUndefined(header.Referer)) {
|
|
63
|
+
// const error = { errMsg: 'request fail parameter error: the header doesn‘t support Referer property' }
|
|
64
|
+
// callAsyncFail(reject, error, options)
|
|
65
|
+
// }
|
|
66
66
|
|
|
67
67
|
// 检查 method 是否正确
|
|
68
68
|
if (method) {
|
package/dist/apis/wxml/index.ts
CHANGED
|
@@ -2,11 +2,11 @@ import { eventSource } from '@tarojs/runtime/dist/runtime.esm'
|
|
|
2
2
|
import { isUndefined } from '@tarojs/shared'
|
|
3
3
|
|
|
4
4
|
import { Current } from '../current'
|
|
5
|
+
import { findChildNodeWithDFS, getPageScrollerOrNode } from '../utils'
|
|
5
6
|
import { TaroComment } from './comment'
|
|
6
7
|
import { createCSSStyleDeclaration } from './cssStyleDeclaration'
|
|
7
8
|
import { TaroElement } from './element/element'
|
|
8
|
-
import { NodeType, TaroNode } from './node'
|
|
9
|
-
import { TaroTextNode } from './text'
|
|
9
|
+
import { NodeType, TaroNode, TaroTextNode } from './node'
|
|
10
10
|
|
|
11
11
|
import type { Window } from '../bom/window'
|
|
12
12
|
|
|
@@ -69,10 +69,27 @@ class TaroDocument extends TaroNode {
|
|
|
69
69
|
return isUndefined(el) ? null : el as unknown as T
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
+
public querySelector (selectors: string): TaroElement | null {
|
|
73
|
+
const taro = (Current as any).taro
|
|
74
|
+
const page = taro.getCurrentInstance().page
|
|
75
|
+
const element = getPageScrollerOrNode(page.node, page)
|
|
76
|
+
|
|
77
|
+
if (element == null) return null
|
|
78
|
+
|
|
79
|
+
return findChildNodeWithDFS(element, selectors)
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
public querySelectorAll (selectors: string): TaroElement[] {
|
|
83
|
+
const taro = (Current as any).taro
|
|
84
|
+
const page = taro.getCurrentInstance().page
|
|
85
|
+
const element = getPageScrollerOrNode(page.node, page)
|
|
86
|
+
|
|
87
|
+
if (element == null) return []
|
|
88
|
+
|
|
89
|
+
return findChildNodeWithDFS(element, selectors, true) || []
|
|
90
|
+
}
|
|
72
91
|
// @Todo
|
|
73
92
|
// public getElementsByClassName (names: string): TaroElement[]
|
|
74
|
-
// public querySelector (selectors: string): TaroElement | null
|
|
75
|
-
// public querySelectorAll (selectors: string): TaroElement[]
|
|
76
93
|
// public createElementNS
|
|
77
94
|
}
|
|
78
95
|
|
|
@@ -13,5 +13,5 @@ export * from './dom/stylesheet'
|
|
|
13
13
|
export * from './interface'
|
|
14
14
|
export * from './utils'
|
|
15
15
|
export * from './utils/info'
|
|
16
|
-
export { URLSearchParams, eventSource } from '@tarojs/runtime/dist/runtime.esm'
|
|
16
|
+
export { URLSearchParams, eventSource, Events } from '@tarojs/runtime/dist/runtime.esm'
|
|
17
17
|
export { hooks } from '@tarojs/shared'
|
package/dist/runtime-utils.js
CHANGED
|
@@ -2611,10 +2611,10 @@ const request = function (options) {
|
|
|
2611
2611
|
header['Content-Type'] = 'application/json';
|
|
2612
2612
|
}
|
|
2613
2613
|
// 检查 Header 是否有 Referer
|
|
2614
|
-
if (isUndefined(header.Referer)) {
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
}
|
|
2614
|
+
// if (isUndefined(header.Referer)) {
|
|
2615
|
+
// const error = { errMsg: 'request fail parameter error: the header doesn‘t support Referer property' }
|
|
2616
|
+
// callAsyncFail(reject, error, options)
|
|
2617
|
+
// }
|
|
2618
2618
|
// 检查 method 是否正确
|
|
2619
2619
|
if (method) {
|
|
2620
2620
|
if (!METHOD.includes(method)) {
|
|
@@ -4280,6 +4280,7 @@ var apis = /*#__PURE__*/Object.freeze({
|
|
|
4280
4280
|
ENV_TYPE: ENV_TYPE,
|
|
4281
4281
|
Events: Events,
|
|
4282
4282
|
History: History,
|
|
4283
|
+
IntersectionObserver: IntersectionObserver,
|
|
4283
4284
|
addCard: addCard,
|
|
4284
4285
|
addFileToFavorites: addFileToFavorites,
|
|
4285
4286
|
addPhoneCalendar: addPhoneCalendar,
|
|
@@ -4669,7 +4670,7 @@ var apis = /*#__PURE__*/Object.freeze({
|
|
|
4669
4670
|
writeBLECharacteristicValue: writeBLECharacteristicValue
|
|
4670
4671
|
});
|
|
4671
4672
|
|
|
4672
|
-
Object.assign({}, apis);
|
|
4673
|
+
const taro = Object.assign({}, apis);
|
|
4673
4674
|
const requirePlugin = /* @__PURE__ */ permanentlyNotSupport('requirePlugin');
|
|
4674
4675
|
function initNativeApi(taro) {
|
|
4675
4676
|
Current.taro = taro;
|
|
@@ -4733,6 +4734,7 @@ function getAppInfo() {
|
|
|
4733
4734
|
designWidth: config === null || config === void 0 ? void 0 : config.designWidth,
|
|
4734
4735
|
};
|
|
4735
4736
|
}
|
|
4737
|
+
initNativeApi(taro);
|
|
4736
4738
|
|
|
4737
4739
|
const components = {
|
|
4738
4740
|
Checkbox: {
|