@tarojs/runtime 4.0.0-alpha.43 → 4.0.0-alpha.45
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/bom/URLSearchParams.js +4 -12
- package/dist/bom/URLSearchParams.js.map +1 -1
- package/dist/bom/raf.js +2 -2
- package/dist/bom/raf.js.map +1 -1
- package/dist/dom/event.js +4 -5
- package/dist/dom/event.js.map +1 -1
- package/dist/dom-external/index.js +2 -1
- package/dist/dom-external/index.js.map +1 -1
- package/dist/index.cjs.js +11 -20
- package/dist/index.cjs.js.map +1 -1
- package/dist/runtime.esm.js +12 -21
- package/dist/runtime.esm.js.map +1 -1
- package/package.json +2 -2
package/dist/runtime.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { noop, hooks, Events, EMPTY_OBJ, isNumber, isString, isArray, isUndefined, warn, isFunction, getComponentsAlias as getComponentsAlias$1, internalComponents, toCamelCase, isObject, ensure, isNull, toDashed, controlledComponent, EventChannel } from '@tarojs/shared';
|
|
1
|
+
import { noop, hooks, Events, EMPTY_OBJ, isNumber, isString, isArray, isUndefined, warn, isFunction, getComponentsAlias as getComponentsAlias$1, internalComponents, toCamelCase, isObject, ensure, isNull, toDashed, PLATFORM_TYPE, controlledComponent, EventChannel } from '@tarojs/shared';
|
|
2
2
|
export { Events, hooks } from '@tarojs/shared';
|
|
3
3
|
import { __classPrivateFieldSet, __classPrivateFieldGet } from 'tslib';
|
|
4
4
|
|
|
@@ -427,19 +427,11 @@ const URLSearchParams = process.env.TARO_PLATFORM === 'web' ? env.window.URLSear
|
|
|
427
427
|
for (let pairs = query.split('&'), i = 0, length = pairs.length; i < length; i++) {
|
|
428
428
|
const value = pairs[i];
|
|
429
429
|
const index = value.indexOf('=');
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
if (index > -1) {
|
|
433
|
-
appendTo(dict, decode(value.slice(0, index)), decode(value.slice(index + 1)));
|
|
434
|
-
}
|
|
435
|
-
else if (value.length) {
|
|
436
|
-
appendTo(dict, decode(value), '');
|
|
437
|
-
}
|
|
430
|
+
if (index > -1) {
|
|
431
|
+
appendTo(dict, decode(value.slice(0, index)), decode(value.slice(index + 1)));
|
|
438
432
|
}
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
console.warn(`[Taro warn] URL 参数 ${value} decode 异常`);
|
|
442
|
-
}
|
|
433
|
+
else if (value.length) {
|
|
434
|
+
appendTo(dict, decode(value), '');
|
|
443
435
|
}
|
|
444
436
|
}
|
|
445
437
|
}
|
|
@@ -991,12 +983,12 @@ let now;
|
|
|
991
983
|
let lastTime = 0;
|
|
992
984
|
// https://gist.github.com/paulirish/1579671
|
|
993
985
|
// https://gist.github.com/jalbam/5fe05443270fa6d8136238ec72accbc0
|
|
994
|
-
const _raf =
|
|
986
|
+
const _raf = typeof requestAnimationFrame !== 'undefined' && requestAnimationFrame !== null ? requestAnimationFrame : function (callback) {
|
|
995
987
|
const _now = now();
|
|
996
988
|
const nextTime = Math.max(lastTime + 16, _now); // First time will execute it immediately but barely noticeable and performance is gained.
|
|
997
989
|
return setTimeout(function () { callback(lastTime = nextTime); }, nextTime - _now);
|
|
998
990
|
};
|
|
999
|
-
const _caf =
|
|
991
|
+
const _caf = typeof cancelAnimationFrame !== 'undefined' && cancelAnimationFrame !== null
|
|
1000
992
|
? cancelAnimationFrame
|
|
1001
993
|
: function (seed) {
|
|
1002
994
|
// fix https://github.com/NervJS/taro/issues/7749
|
|
@@ -3317,7 +3309,7 @@ function contains(node) {
|
|
|
3317
3309
|
return isContains;
|
|
3318
3310
|
}
|
|
3319
3311
|
|
|
3320
|
-
if (process.env.TARO_PLATFORM !==
|
|
3312
|
+
if (process.env.TARO_PLATFORM !== PLATFORM_TYPE.WEB && process.env.TARO_PLATFORM !== PLATFORM_TYPE.HARMONY) {
|
|
3321
3313
|
if (ENABLE_INNER_HTML) {
|
|
3322
3314
|
TaroNode.extend('innerHTML', {
|
|
3323
3315
|
set(html) {
|
|
@@ -3375,15 +3367,14 @@ class TaroEvent {
|
|
|
3375
3367
|
this.defaultPrevented = true;
|
|
3376
3368
|
}
|
|
3377
3369
|
get target() {
|
|
3378
|
-
var _a, _b, _c, _d
|
|
3370
|
+
var _a, _b, _c, _d;
|
|
3379
3371
|
const cacheTarget = this.cacheTarget;
|
|
3380
3372
|
if (!cacheTarget) {
|
|
3381
3373
|
const target = Object.create(((_a = this.mpEvent) === null || _a === void 0 ? void 0 : _a.target) || null);
|
|
3382
|
-
const currentEle = env.document.getElementById(((_b = target.dataset) === null || _b === void 0 ? void 0 : _b.sid) || target.id || null);
|
|
3383
3374
|
// Note:优先判断冒泡场景alipay的targetDataset的sid, 不然冒泡场景target属性吐出不对,其余拿取当前绑定id
|
|
3384
|
-
const element = env.document.getElementById(((
|
|
3385
|
-
target.dataset =
|
|
3386
|
-
for (const key in (
|
|
3375
|
+
const element = env.document.getElementById(((_b = target.targetDataset) === null || _b === void 0 ? void 0 : _b.sid) || ((_c = target.dataset) === null || _c === void 0 ? void 0 : _c.sid) || target.id || null);
|
|
3376
|
+
target.dataset = element !== null ? element.dataset : EMPTY_OBJ;
|
|
3377
|
+
for (const key in (_d = this.mpEvent) === null || _d === void 0 ? void 0 : _d.detail) {
|
|
3387
3378
|
target[key] = this.mpEvent.detail[key];
|
|
3388
3379
|
}
|
|
3389
3380
|
this.cacheTarget = target;
|