@tarojs/runtime 3.6.22-nightly.3 → 3.6.22-nightly.5
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/URL.js +1 -1
- package/dist/bom/URLSearchParams.js +1 -1
- package/dist/bom/history.js +1 -1
- package/dist/bom/location.js +1 -1
- package/dist/index.cjs.js +128 -157
- package/dist/index.cjs.js.map +1 -1
- package/dist/runtime.esm.js +1 -30
- package/dist/runtime.esm.js.map +1 -1
- package/package.json +5 -5
- package/dist/node_modules/.pnpm/registry.npmjs.org_tslib@2.5.0/node_modules/tslib/tslib.es6.js +0 -32
- package/dist/node_modules/.pnpm/registry.npmjs.org_tslib@2.5.0/node_modules/tslib/tslib.es6.js.map +0 -1
package/dist/bom/URL.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __classPrivateFieldSet, __classPrivateFieldGet } from '
|
|
1
|
+
import { __classPrivateFieldSet, __classPrivateFieldGet } from 'tslib';
|
|
2
2
|
import { isString, isUndefined } from '@tarojs/shared';
|
|
3
3
|
import env from '../env.js';
|
|
4
4
|
import { URLSearchParams } from './URLSearchParams.js';
|
package/dist/bom/history.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __classPrivateFieldSet, __classPrivateFieldGet } from '
|
|
1
|
+
import { __classPrivateFieldSet, __classPrivateFieldGet } from 'tslib';
|
|
2
2
|
import { Events, isNumber, isString } from '@tarojs/shared';
|
|
3
3
|
import { CONTEXT_ACTIONS } from '../constants/index.js';
|
|
4
4
|
import '../emitter/emitter.js';
|
package/dist/bom/location.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __classPrivateFieldSet, __classPrivateFieldGet } from '
|
|
1
|
+
import { __classPrivateFieldSet, __classPrivateFieldGet } from 'tslib';
|
|
2
2
|
import { Events, isString, isNumber, warn } from '@tarojs/shared';
|
|
3
3
|
import { CONTEXT_ACTIONS } from '../constants/index.js';
|
|
4
4
|
import { getCurrentInstance } from '../current.js';
|
package/dist/index.cjs.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var shared = require('@tarojs/shared');
|
|
4
|
+
var tslib = require('tslib');
|
|
4
5
|
|
|
5
6
|
const PROPERTY_THRESHOLD = 2046;
|
|
6
7
|
const TARO_RUNTIME = 'Taro runtime';
|
|
@@ -2839,36 +2840,6 @@ class TaroText extends TaroNode {
|
|
|
2839
2840
|
}
|
|
2840
2841
|
}
|
|
2841
2842
|
|
|
2842
|
-
/******************************************************************************
|
|
2843
|
-
Copyright (c) Microsoft Corporation.
|
|
2844
|
-
|
|
2845
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
2846
|
-
purpose with or without fee is hereby granted.
|
|
2847
|
-
|
|
2848
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
2849
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
2850
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
2851
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
2852
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
2853
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
2854
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
2855
|
-
***************************************************************************** */
|
|
2856
|
-
/* global Reflect, Promise */
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
2860
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
2861
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
2862
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
2863
|
-
}
|
|
2864
|
-
|
|
2865
|
-
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
2866
|
-
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
2867
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
2868
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
2869
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
2870
|
-
}
|
|
2871
|
-
|
|
2872
2843
|
var _dict, _a;
|
|
2873
2844
|
const findReg = /[!'()~]|%20|%00/g;
|
|
2874
2845
|
const plusReg = /\+/g;
|
|
@@ -2904,7 +2875,7 @@ const URLSearchParams = process.env.TARO_PLATFORM === 'web' ? env.window.URLSear
|
|
|
2904
2875
|
constructor(query) {
|
|
2905
2876
|
_dict.set(this, Object.create(null));
|
|
2906
2877
|
query !== null && query !== void 0 ? query : (query = '');
|
|
2907
|
-
const dict = __classPrivateFieldGet(this, _dict, "f");
|
|
2878
|
+
const dict = tslib.__classPrivateFieldGet(this, _dict, "f");
|
|
2908
2879
|
if (typeof query === 'string') {
|
|
2909
2880
|
if (query.charAt(0) === '?') {
|
|
2910
2881
|
query = query.slice(1);
|
|
@@ -2938,30 +2909,30 @@ const URLSearchParams = process.env.TARO_PLATFORM === 'web' ? env.window.URLSear
|
|
|
2938
2909
|
}
|
|
2939
2910
|
}
|
|
2940
2911
|
append(name, value) {
|
|
2941
|
-
appendTo(__classPrivateFieldGet(this, _dict, "f"), name, value);
|
|
2912
|
+
appendTo(tslib.__classPrivateFieldGet(this, _dict, "f"), name, value);
|
|
2942
2913
|
}
|
|
2943
2914
|
delete(name) {
|
|
2944
|
-
delete __classPrivateFieldGet(this, _dict, "f")[name];
|
|
2915
|
+
delete tslib.__classPrivateFieldGet(this, _dict, "f")[name];
|
|
2945
2916
|
}
|
|
2946
2917
|
get(name) {
|
|
2947
|
-
const dict = __classPrivateFieldGet(this, _dict, "f");
|
|
2918
|
+
const dict = tslib.__classPrivateFieldGet(this, _dict, "f");
|
|
2948
2919
|
return name in dict ? dict[name][0] : null;
|
|
2949
2920
|
}
|
|
2950
2921
|
getAll(name) {
|
|
2951
|
-
const dict = __classPrivateFieldGet(this, _dict, "f");
|
|
2922
|
+
const dict = tslib.__classPrivateFieldGet(this, _dict, "f");
|
|
2952
2923
|
return name in dict ? dict[name].slice(0) : [];
|
|
2953
2924
|
}
|
|
2954
2925
|
has(name) {
|
|
2955
|
-
return name in __classPrivateFieldGet(this, _dict, "f");
|
|
2926
|
+
return name in tslib.__classPrivateFieldGet(this, _dict, "f");
|
|
2956
2927
|
}
|
|
2957
2928
|
keys() {
|
|
2958
|
-
return Object.keys(__classPrivateFieldGet(this, _dict, "f"));
|
|
2929
|
+
return Object.keys(tslib.__classPrivateFieldGet(this, _dict, "f"));
|
|
2959
2930
|
}
|
|
2960
2931
|
set(name, value) {
|
|
2961
|
-
__classPrivateFieldGet(this, _dict, "f")[name] = ['' + value];
|
|
2932
|
+
tslib.__classPrivateFieldGet(this, _dict, "f")[name] = ['' + value];
|
|
2962
2933
|
}
|
|
2963
2934
|
forEach(callback, thisArg) {
|
|
2964
|
-
const dict = __classPrivateFieldGet(this, _dict, "f");
|
|
2935
|
+
const dict = tslib.__classPrivateFieldGet(this, _dict, "f");
|
|
2965
2936
|
Object.getOwnPropertyNames(dict).forEach(function (name) {
|
|
2966
2937
|
dict[name].forEach(function (value) {
|
|
2967
2938
|
callback.call(thisArg, value, name, this);
|
|
@@ -2972,7 +2943,7 @@ const URLSearchParams = process.env.TARO_PLATFORM === 'web' ? env.window.URLSear
|
|
|
2972
2943
|
return {};
|
|
2973
2944
|
}
|
|
2974
2945
|
toString() {
|
|
2975
|
-
const dict = __classPrivateFieldGet(this, _dict, "f");
|
|
2946
|
+
const dict = tslib.__classPrivateFieldGet(this, _dict, "f");
|
|
2976
2947
|
const query = [];
|
|
2977
2948
|
for (const key in dict) {
|
|
2978
2949
|
const name = encode(key);
|
|
@@ -3006,19 +2977,19 @@ class TaroURL {
|
|
|
3006
2977
|
url = String(url);
|
|
3007
2978
|
const parseResult = parseUrlBase(url, base);
|
|
3008
2979
|
const { hash, hostname, pathname, port, protocol, search } = parseResult;
|
|
3009
|
-
__classPrivateFieldSet(this, _TaroURL_hash, hash, "f");
|
|
3010
|
-
__classPrivateFieldSet(this, _TaroURL_hostname, hostname, "f");
|
|
3011
|
-
__classPrivateFieldSet(this, _TaroURL_pathname, pathname || '/', "f");
|
|
3012
|
-
__classPrivateFieldSet(this, _TaroURL_port, port, "f");
|
|
3013
|
-
__classPrivateFieldSet(this, _TaroURL_protocol, protocol, "f");
|
|
3014
|
-
__classPrivateFieldSet(this, _TaroURL_search, new URLSearchParams(search), "f");
|
|
2980
|
+
tslib.__classPrivateFieldSet(this, _TaroURL_hash, hash, "f");
|
|
2981
|
+
tslib.__classPrivateFieldSet(this, _TaroURL_hostname, hostname, "f");
|
|
2982
|
+
tslib.__classPrivateFieldSet(this, _TaroURL_pathname, pathname || '/', "f");
|
|
2983
|
+
tslib.__classPrivateFieldSet(this, _TaroURL_port, port, "f");
|
|
2984
|
+
tslib.__classPrivateFieldSet(this, _TaroURL_protocol, protocol, "f");
|
|
2985
|
+
tslib.__classPrivateFieldSet(this, _TaroURL_search, new URLSearchParams(search), "f");
|
|
3015
2986
|
}
|
|
3016
2987
|
/* public property */
|
|
3017
2988
|
get protocol() {
|
|
3018
|
-
return __classPrivateFieldGet(this, _TaroURL_protocol, "f");
|
|
2989
|
+
return tslib.__classPrivateFieldGet(this, _TaroURL_protocol, "f");
|
|
3019
2990
|
}
|
|
3020
2991
|
set protocol(val) {
|
|
3021
|
-
shared.isString(val) && (__classPrivateFieldSet(this, _TaroURL_protocol, val.trim(), "f"));
|
|
2992
|
+
shared.isString(val) && (tslib.__classPrivateFieldSet(this, _TaroURL_protocol, val.trim(), "f"));
|
|
3022
2993
|
}
|
|
3023
2994
|
get host() {
|
|
3024
2995
|
return this.hostname + (this.port ? ':' + this.port : '');
|
|
@@ -3032,19 +3003,19 @@ class TaroURL {
|
|
|
3032
3003
|
}
|
|
3033
3004
|
}
|
|
3034
3005
|
get hostname() {
|
|
3035
|
-
return __classPrivateFieldGet(this, _TaroURL_hostname, "f");
|
|
3006
|
+
return tslib.__classPrivateFieldGet(this, _TaroURL_hostname, "f");
|
|
3036
3007
|
}
|
|
3037
3008
|
set hostname(val) {
|
|
3038
|
-
val && shared.isString(val) && (__classPrivateFieldSet(this, _TaroURL_hostname, val.trim(), "f"));
|
|
3009
|
+
val && shared.isString(val) && (tslib.__classPrivateFieldSet(this, _TaroURL_hostname, val.trim(), "f"));
|
|
3039
3010
|
}
|
|
3040
3011
|
get port() {
|
|
3041
|
-
return __classPrivateFieldGet(this, _TaroURL_port, "f");
|
|
3012
|
+
return tslib.__classPrivateFieldGet(this, _TaroURL_port, "f");
|
|
3042
3013
|
}
|
|
3043
3014
|
set port(val) {
|
|
3044
|
-
shared.isString(val) && (__classPrivateFieldSet(this, _TaroURL_port, val.trim(), "f"));
|
|
3015
|
+
shared.isString(val) && (tslib.__classPrivateFieldSet(this, _TaroURL_port, val.trim(), "f"));
|
|
3045
3016
|
}
|
|
3046
3017
|
get pathname() {
|
|
3047
|
-
return __classPrivateFieldGet(this, _TaroURL_pathname, "f");
|
|
3018
|
+
return tslib.__classPrivateFieldGet(this, _TaroURL_pathname, "f");
|
|
3048
3019
|
}
|
|
3049
3020
|
set pathname(val) {
|
|
3050
3021
|
if (shared.isString(val)) {
|
|
@@ -3055,31 +3026,31 @@ class TaroURL {
|
|
|
3055
3026
|
temp = temp.replace(HEAD_REG, '');
|
|
3056
3027
|
}
|
|
3057
3028
|
if (temp)
|
|
3058
|
-
__classPrivateFieldSet(this, _TaroURL_pathname, '/' + temp, "f");
|
|
3029
|
+
tslib.__classPrivateFieldSet(this, _TaroURL_pathname, '/' + temp, "f");
|
|
3059
3030
|
else
|
|
3060
|
-
__classPrivateFieldSet(this, _TaroURL_pathname, '/', "f");
|
|
3031
|
+
tslib.__classPrivateFieldSet(this, _TaroURL_pathname, '/', "f");
|
|
3061
3032
|
}
|
|
3062
3033
|
}
|
|
3063
3034
|
get search() {
|
|
3064
|
-
const val = __classPrivateFieldGet(this, _TaroURL_search, "f").toString();
|
|
3035
|
+
const val = tslib.__classPrivateFieldGet(this, _TaroURL_search, "f").toString();
|
|
3065
3036
|
return (val.length === 0 || val.startsWith('?')) ? val : `?${val}`;
|
|
3066
3037
|
}
|
|
3067
3038
|
set search(val) {
|
|
3068
3039
|
if (shared.isString(val)) {
|
|
3069
3040
|
val = val.trim();
|
|
3070
|
-
__classPrivateFieldSet(this, _TaroURL_search, new URLSearchParams(val), "f");
|
|
3041
|
+
tslib.__classPrivateFieldSet(this, _TaroURL_search, new URLSearchParams(val), "f");
|
|
3071
3042
|
}
|
|
3072
3043
|
}
|
|
3073
3044
|
get hash() {
|
|
3074
|
-
return __classPrivateFieldGet(this, _TaroURL_hash, "f");
|
|
3045
|
+
return tslib.__classPrivateFieldGet(this, _TaroURL_hash, "f");
|
|
3075
3046
|
}
|
|
3076
3047
|
set hash(val) {
|
|
3077
3048
|
if (shared.isString(val)) {
|
|
3078
3049
|
val = val.trim();
|
|
3079
3050
|
if (val)
|
|
3080
|
-
__classPrivateFieldSet(this, _TaroURL_hash, val.startsWith('#') ? val : `#${val}`, "f");
|
|
3051
|
+
tslib.__classPrivateFieldSet(this, _TaroURL_hash, val.startsWith('#') ? val : `#${val}`, "f");
|
|
3081
3052
|
else
|
|
3082
|
-
__classPrivateFieldSet(this, _TaroURL_hash, '', "f");
|
|
3053
|
+
tslib.__classPrivateFieldSet(this, _TaroURL_hash, '', "f");
|
|
3083
3054
|
}
|
|
3084
3055
|
}
|
|
3085
3056
|
get href() {
|
|
@@ -3110,7 +3081,7 @@ class TaroURL {
|
|
|
3110
3081
|
}
|
|
3111
3082
|
}
|
|
3112
3083
|
get searchParams() {
|
|
3113
|
-
return __classPrivateFieldGet(this, _TaroURL_search, "f");
|
|
3084
|
+
return tslib.__classPrivateFieldGet(this, _TaroURL_search, "f");
|
|
3114
3085
|
}
|
|
3115
3086
|
// public method
|
|
3116
3087
|
toString() {
|
|
@@ -3401,61 +3372,61 @@ class TaroHistory extends shared.Events {
|
|
|
3401
3372
|
_TaroHistory_stack.set(this, []);
|
|
3402
3373
|
_TaroHistory_cur.set(this, 0);
|
|
3403
3374
|
_TaroHistory_window.set(this, void 0);
|
|
3404
|
-
__classPrivateFieldSet(this, _TaroHistory_window, options.window, "f");
|
|
3405
|
-
__classPrivateFieldSet(this, _TaroHistory_location, location, "f");
|
|
3406
|
-
__classPrivateFieldGet(this, _TaroHistory_location, "f").on('__record_history__', (href) => {
|
|
3375
|
+
tslib.__classPrivateFieldSet(this, _TaroHistory_window, options.window, "f");
|
|
3376
|
+
tslib.__classPrivateFieldSet(this, _TaroHistory_location, location, "f");
|
|
3377
|
+
tslib.__classPrivateFieldGet(this, _TaroHistory_location, "f").on('__record_history__', (href) => {
|
|
3407
3378
|
var _a;
|
|
3408
|
-
__classPrivateFieldSet(this, _TaroHistory_cur, (_a = __classPrivateFieldGet(this, _TaroHistory_cur, "f"), _a++, _a), "f");
|
|
3409
|
-
__classPrivateFieldSet(this, _TaroHistory_stack, __classPrivateFieldGet(this, _TaroHistory_stack, "f").slice(0, __classPrivateFieldGet(this, _TaroHistory_cur, "f")), "f");
|
|
3410
|
-
__classPrivateFieldGet(this, _TaroHistory_stack, "f").push({
|
|
3379
|
+
tslib.__classPrivateFieldSet(this, _TaroHistory_cur, (_a = tslib.__classPrivateFieldGet(this, _TaroHistory_cur, "f"), _a++, _a), "f");
|
|
3380
|
+
tslib.__classPrivateFieldSet(this, _TaroHistory_stack, tslib.__classPrivateFieldGet(this, _TaroHistory_stack, "f").slice(0, tslib.__classPrivateFieldGet(this, _TaroHistory_cur, "f")), "f");
|
|
3381
|
+
tslib.__classPrivateFieldGet(this, _TaroHistory_stack, "f").push({
|
|
3411
3382
|
state: null,
|
|
3412
3383
|
title: '',
|
|
3413
3384
|
url: href
|
|
3414
3385
|
});
|
|
3415
3386
|
}, null);
|
|
3416
|
-
__classPrivateFieldGet(this, _TaroHistory_location, "f").on('__reset_history__', (href) => {
|
|
3417
|
-
__classPrivateFieldGet(this, _TaroHistory_instances, "m", _TaroHistory_reset).call(this, href);
|
|
3387
|
+
tslib.__classPrivateFieldGet(this, _TaroHistory_location, "f").on('__reset_history__', (href) => {
|
|
3388
|
+
tslib.__classPrivateFieldGet(this, _TaroHistory_instances, "m", _TaroHistory_reset).call(this, href);
|
|
3418
3389
|
}, null);
|
|
3419
3390
|
// 切换上下文行为
|
|
3420
3391
|
this.on(exports.CONTEXT_ACTIONS.INIT, () => {
|
|
3421
|
-
__classPrivateFieldGet(this, _TaroHistory_instances, "m", _TaroHistory_reset).call(this);
|
|
3392
|
+
tslib.__classPrivateFieldGet(this, _TaroHistory_instances, "m", _TaroHistory_reset).call(this);
|
|
3422
3393
|
}, null);
|
|
3423
3394
|
this.on(exports.CONTEXT_ACTIONS.RESTORE, (pageId) => {
|
|
3424
3395
|
cache$1.set(pageId, {
|
|
3425
|
-
location: __classPrivateFieldGet(this, _TaroHistory_location, "f"),
|
|
3426
|
-
stack: __classPrivateFieldGet(this, _TaroHistory_stack, "f").slice(),
|
|
3427
|
-
cur: __classPrivateFieldGet(this, _TaroHistory_cur, "f")
|
|
3396
|
+
location: tslib.__classPrivateFieldGet(this, _TaroHistory_location, "f"),
|
|
3397
|
+
stack: tslib.__classPrivateFieldGet(this, _TaroHistory_stack, "f").slice(),
|
|
3398
|
+
cur: tslib.__classPrivateFieldGet(this, _TaroHistory_cur, "f")
|
|
3428
3399
|
});
|
|
3429
3400
|
}, null);
|
|
3430
3401
|
this.on(exports.CONTEXT_ACTIONS.RECOVER, (pageId) => {
|
|
3431
3402
|
if (cache$1.has(pageId)) {
|
|
3432
3403
|
const ctx = cache$1.get(pageId);
|
|
3433
|
-
__classPrivateFieldSet(this, _TaroHistory_location, ctx.location, "f");
|
|
3434
|
-
__classPrivateFieldSet(this, _TaroHistory_stack, ctx.stack, "f");
|
|
3435
|
-
__classPrivateFieldSet(this, _TaroHistory_cur, ctx.cur, "f");
|
|
3404
|
+
tslib.__classPrivateFieldSet(this, _TaroHistory_location, ctx.location, "f");
|
|
3405
|
+
tslib.__classPrivateFieldSet(this, _TaroHistory_stack, ctx.stack, "f");
|
|
3406
|
+
tslib.__classPrivateFieldSet(this, _TaroHistory_cur, ctx.cur, "f");
|
|
3436
3407
|
}
|
|
3437
3408
|
}, null);
|
|
3438
3409
|
this.on(exports.CONTEXT_ACTIONS.DESTORY, (pageId) => {
|
|
3439
3410
|
cache$1.delete(pageId);
|
|
3440
3411
|
}, null);
|
|
3441
|
-
__classPrivateFieldGet(this, _TaroHistory_instances, "m", _TaroHistory_reset).call(this);
|
|
3412
|
+
tslib.__classPrivateFieldGet(this, _TaroHistory_instances, "m", _TaroHistory_reset).call(this);
|
|
3442
3413
|
}
|
|
3443
3414
|
/* public property */
|
|
3444
3415
|
get length() {
|
|
3445
|
-
return __classPrivateFieldGet(this, _TaroHistory_stack, "f").length;
|
|
3416
|
+
return tslib.__classPrivateFieldGet(this, _TaroHistory_stack, "f").length;
|
|
3446
3417
|
}
|
|
3447
3418
|
get state() {
|
|
3448
|
-
return __classPrivateFieldGet(this, _TaroHistory_stack, "f")[__classPrivateFieldGet(this, _TaroHistory_cur, "f")].state;
|
|
3419
|
+
return tslib.__classPrivateFieldGet(this, _TaroHistory_stack, "f")[tslib.__classPrivateFieldGet(this, _TaroHistory_cur, "f")].state;
|
|
3449
3420
|
}
|
|
3450
3421
|
/* public method */
|
|
3451
3422
|
go(delta) {
|
|
3452
3423
|
if (!shared.isNumber(delta) || isNaN(delta))
|
|
3453
3424
|
return;
|
|
3454
|
-
let targetIdx = __classPrivateFieldGet(this, _TaroHistory_cur, "f") + delta;
|
|
3425
|
+
let targetIdx = tslib.__classPrivateFieldGet(this, _TaroHistory_cur, "f") + delta;
|
|
3455
3426
|
targetIdx = Math.min(Math.max(targetIdx, 0), this.length - 1);
|
|
3456
|
-
__classPrivateFieldSet(this, _TaroHistory_cur, targetIdx, "f");
|
|
3457
|
-
__classPrivateFieldGet(this, _TaroHistory_location, "f").trigger('__set_href_without_history__', __classPrivateFieldGet(this, _TaroHistory_stack, "f")[__classPrivateFieldGet(this, _TaroHistory_cur, "f")].url);
|
|
3458
|
-
__classPrivateFieldGet(this, _TaroHistory_window, "f").trigger('popstate', __classPrivateFieldGet(this, _TaroHistory_stack, "f")[__classPrivateFieldGet(this, _TaroHistory_cur, "f")]);
|
|
3427
|
+
tslib.__classPrivateFieldSet(this, _TaroHistory_cur, targetIdx, "f");
|
|
3428
|
+
tslib.__classPrivateFieldGet(this, _TaroHistory_location, "f").trigger('__set_href_without_history__', tslib.__classPrivateFieldGet(this, _TaroHistory_stack, "f")[tslib.__classPrivateFieldGet(this, _TaroHistory_cur, "f")].url);
|
|
3429
|
+
tslib.__classPrivateFieldGet(this, _TaroHistory_window, "f").trigger('popstate', tslib.__classPrivateFieldGet(this, _TaroHistory_stack, "f")[tslib.__classPrivateFieldGet(this, _TaroHistory_cur, "f")]);
|
|
3459
3430
|
}
|
|
3460
3431
|
back() {
|
|
3461
3432
|
this.go(-1);
|
|
@@ -3466,24 +3437,24 @@ class TaroHistory extends shared.Events {
|
|
|
3466
3437
|
pushState(state, title, url) {
|
|
3467
3438
|
if (!url || !shared.isString(url))
|
|
3468
3439
|
return;
|
|
3469
|
-
__classPrivateFieldSet(this, _TaroHistory_stack, __classPrivateFieldGet(this, _TaroHistory_stack, "f").slice(0, __classPrivateFieldGet(this, _TaroHistory_cur, "f") + 1), "f");
|
|
3470
|
-
__classPrivateFieldGet(this, _TaroHistory_stack, "f").push({
|
|
3440
|
+
tslib.__classPrivateFieldSet(this, _TaroHistory_stack, tslib.__classPrivateFieldGet(this, _TaroHistory_stack, "f").slice(0, tslib.__classPrivateFieldGet(this, _TaroHistory_cur, "f") + 1), "f");
|
|
3441
|
+
tslib.__classPrivateFieldGet(this, _TaroHistory_stack, "f").push({
|
|
3471
3442
|
state,
|
|
3472
3443
|
title,
|
|
3473
3444
|
url
|
|
3474
3445
|
});
|
|
3475
|
-
__classPrivateFieldSet(this, _TaroHistory_cur, this.length - 1, "f");
|
|
3476
|
-
__classPrivateFieldGet(this, _TaroHistory_location, "f").trigger('__set_href_without_history__', url);
|
|
3446
|
+
tslib.__classPrivateFieldSet(this, _TaroHistory_cur, this.length - 1, "f");
|
|
3447
|
+
tslib.__classPrivateFieldGet(this, _TaroHistory_location, "f").trigger('__set_href_without_history__', url);
|
|
3477
3448
|
}
|
|
3478
3449
|
replaceState(state, title, url) {
|
|
3479
3450
|
if (!url || !shared.isString(url))
|
|
3480
3451
|
return;
|
|
3481
|
-
__classPrivateFieldGet(this, _TaroHistory_stack, "f")[__classPrivateFieldGet(this, _TaroHistory_cur, "f")] = {
|
|
3452
|
+
tslib.__classPrivateFieldGet(this, _TaroHistory_stack, "f")[tslib.__classPrivateFieldGet(this, _TaroHistory_cur, "f")] = {
|
|
3482
3453
|
state,
|
|
3483
3454
|
title,
|
|
3484
3455
|
url
|
|
3485
3456
|
};
|
|
3486
|
-
__classPrivateFieldGet(this, _TaroHistory_location, "f").trigger('__set_href_without_history__', url);
|
|
3457
|
+
tslib.__classPrivateFieldGet(this, _TaroHistory_location, "f").trigger('__set_href_without_history__', url);
|
|
3487
3458
|
}
|
|
3488
3459
|
// For debug
|
|
3489
3460
|
get cache() {
|
|
@@ -3491,14 +3462,14 @@ class TaroHistory extends shared.Events {
|
|
|
3491
3462
|
}
|
|
3492
3463
|
}
|
|
3493
3464
|
_TaroHistory_location = new WeakMap(), _TaroHistory_stack = new WeakMap(), _TaroHistory_cur = new WeakMap(), _TaroHistory_window = new WeakMap(), _TaroHistory_instances = new WeakSet(), _TaroHistory_reset = function _TaroHistory_reset(href = '') {
|
|
3494
|
-
__classPrivateFieldSet(this, _TaroHistory_stack, [
|
|
3465
|
+
tslib.__classPrivateFieldSet(this, _TaroHistory_stack, [
|
|
3495
3466
|
{
|
|
3496
3467
|
state: null,
|
|
3497
3468
|
title: '',
|
|
3498
|
-
url: href || __classPrivateFieldGet(this, _TaroHistory_location, "f").href
|
|
3469
|
+
url: href || tslib.__classPrivateFieldGet(this, _TaroHistory_location, "f").href
|
|
3499
3470
|
}
|
|
3500
3471
|
], "f");
|
|
3501
|
-
__classPrivateFieldSet(this, _TaroHistory_cur, 0, "f");
|
|
3472
|
+
tslib.__classPrivateFieldSet(this, _TaroHistory_cur, 0, "f");
|
|
3502
3473
|
};
|
|
3503
3474
|
const History = process.env.TARO_PLATFORM === 'web' ? env.window.History : TaroHistory;
|
|
3504
3475
|
|
|
@@ -3520,20 +3491,20 @@ class TaroLocation extends shared.Events {
|
|
|
3520
3491
|
_TaroLocation_url.set(this, new URL(INIT_URL));
|
|
3521
3492
|
_TaroLocation_noCheckUrl.set(this, false);
|
|
3522
3493
|
_TaroLocation_window.set(this, void 0);
|
|
3523
|
-
__classPrivateFieldSet(this, _TaroLocation_window, options.window, "f");
|
|
3524
|
-
__classPrivateFieldGet(this, _TaroLocation_instances, "m", _TaroLocation_reset).call(this);
|
|
3494
|
+
tslib.__classPrivateFieldSet(this, _TaroLocation_window, options.window, "f");
|
|
3495
|
+
tslib.__classPrivateFieldGet(this, _TaroLocation_instances, "m", _TaroLocation_reset).call(this);
|
|
3525
3496
|
this.on('__set_href_without_history__', (href) => {
|
|
3526
|
-
__classPrivateFieldSet(this, _TaroLocation_noCheckUrl, true, "f");
|
|
3527
|
-
const lastHash = __classPrivateFieldGet(this, _TaroLocation_url, "f").hash;
|
|
3528
|
-
__classPrivateFieldGet(this, _TaroLocation_url, "f").href = generateFullUrl(href);
|
|
3529
|
-
if (lastHash !== __classPrivateFieldGet(this, _TaroLocation_url, "f").hash) {
|
|
3530
|
-
__classPrivateFieldGet(this, _TaroLocation_window, "f").trigger('hashchange');
|
|
3497
|
+
tslib.__classPrivateFieldSet(this, _TaroLocation_noCheckUrl, true, "f");
|
|
3498
|
+
const lastHash = tslib.__classPrivateFieldGet(this, _TaroLocation_url, "f").hash;
|
|
3499
|
+
tslib.__classPrivateFieldGet(this, _TaroLocation_url, "f").href = generateFullUrl(href);
|
|
3500
|
+
if (lastHash !== tslib.__classPrivateFieldGet(this, _TaroLocation_url, "f").hash) {
|
|
3501
|
+
tslib.__classPrivateFieldGet(this, _TaroLocation_window, "f").trigger('hashchange');
|
|
3531
3502
|
}
|
|
3532
|
-
__classPrivateFieldSet(this, _TaroLocation_noCheckUrl, false, "f");
|
|
3503
|
+
tslib.__classPrivateFieldSet(this, _TaroLocation_noCheckUrl, false, "f");
|
|
3533
3504
|
}, null);
|
|
3534
3505
|
// 切换上下文行为
|
|
3535
3506
|
this.on(exports.CONTEXT_ACTIONS.INIT, () => {
|
|
3536
|
-
__classPrivateFieldGet(this, _TaroLocation_instances, "m", _TaroLocation_reset).call(this);
|
|
3507
|
+
tslib.__classPrivateFieldGet(this, _TaroLocation_instances, "m", _TaroLocation_reset).call(this);
|
|
3537
3508
|
}, null);
|
|
3538
3509
|
this.on(exports.CONTEXT_ACTIONS.RESTORE, (pageId) => {
|
|
3539
3510
|
cache.set(pageId, {
|
|
@@ -3544,9 +3515,9 @@ class TaroLocation extends shared.Events {
|
|
|
3544
3515
|
// 数据恢复时,不需要执行跳转
|
|
3545
3516
|
if (cache.has(pageId)) {
|
|
3546
3517
|
const ctx = cache.get(pageId);
|
|
3547
|
-
__classPrivateFieldSet(this, _TaroLocation_noCheckUrl, true, "f");
|
|
3548
|
-
__classPrivateFieldGet(this, _TaroLocation_url, "f").href = ctx.lastHref;
|
|
3549
|
-
__classPrivateFieldSet(this, _TaroLocation_noCheckUrl, false, "f");
|
|
3518
|
+
tslib.__classPrivateFieldSet(this, _TaroLocation_noCheckUrl, true, "f");
|
|
3519
|
+
tslib.__classPrivateFieldGet(this, _TaroLocation_url, "f").href = ctx.lastHref;
|
|
3520
|
+
tslib.__classPrivateFieldSet(this, _TaroLocation_noCheckUrl, false, "f");
|
|
3550
3521
|
}
|
|
3551
3522
|
}, null);
|
|
3552
3523
|
this.on(exports.CONTEXT_ACTIONS.DESTORY, (pageId) => {
|
|
@@ -3555,81 +3526,81 @@ class TaroLocation extends shared.Events {
|
|
|
3555
3526
|
}
|
|
3556
3527
|
/* public property */
|
|
3557
3528
|
get protocol() {
|
|
3558
|
-
return __classPrivateFieldGet(this, _TaroLocation_url, "f").protocol;
|
|
3529
|
+
return tslib.__classPrivateFieldGet(this, _TaroLocation_url, "f").protocol;
|
|
3559
3530
|
}
|
|
3560
3531
|
set protocol(val) {
|
|
3561
3532
|
const REG = /^(http|https):$/i;
|
|
3562
3533
|
if (!val || !shared.isString(val) || !REG.test(val.trim()))
|
|
3563
3534
|
return;
|
|
3564
3535
|
val = val.trim();
|
|
3565
|
-
const preValue = __classPrivateFieldGet(this, _TaroLocation_instances, "m", _TaroLocation_getPreValue).call(this);
|
|
3566
|
-
__classPrivateFieldGet(this, _TaroLocation_url, "f").protocol = val;
|
|
3567
|
-
if (__classPrivateFieldGet(this, _TaroLocation_instances, "m", _TaroLocation_checkUrlChange).call(this, preValue))
|
|
3568
|
-
__classPrivateFieldGet(this, _TaroLocation_instances, "m", _TaroLocation_recordHistory).call(this);
|
|
3536
|
+
const preValue = tslib.__classPrivateFieldGet(this, _TaroLocation_instances, "m", _TaroLocation_getPreValue).call(this);
|
|
3537
|
+
tslib.__classPrivateFieldGet(this, _TaroLocation_url, "f").protocol = val;
|
|
3538
|
+
if (tslib.__classPrivateFieldGet(this, _TaroLocation_instances, "m", _TaroLocation_checkUrlChange).call(this, preValue))
|
|
3539
|
+
tslib.__classPrivateFieldGet(this, _TaroLocation_instances, "m", _TaroLocation_recordHistory).call(this);
|
|
3569
3540
|
}
|
|
3570
3541
|
get host() {
|
|
3571
|
-
return __classPrivateFieldGet(this, _TaroLocation_url, "f").host;
|
|
3542
|
+
return tslib.__classPrivateFieldGet(this, _TaroLocation_url, "f").host;
|
|
3572
3543
|
}
|
|
3573
3544
|
set host(val) {
|
|
3574
3545
|
if (!val || !shared.isString(val))
|
|
3575
3546
|
return;
|
|
3576
3547
|
val = val.trim();
|
|
3577
|
-
const preValue = __classPrivateFieldGet(this, _TaroLocation_instances, "m", _TaroLocation_getPreValue).call(this);
|
|
3578
|
-
__classPrivateFieldGet(this, _TaroLocation_url, "f").host = val;
|
|
3579
|
-
if (__classPrivateFieldGet(this, _TaroLocation_instances, "m", _TaroLocation_checkUrlChange).call(this, preValue))
|
|
3580
|
-
__classPrivateFieldGet(this, _TaroLocation_instances, "m", _TaroLocation_recordHistory).call(this);
|
|
3548
|
+
const preValue = tslib.__classPrivateFieldGet(this, _TaroLocation_instances, "m", _TaroLocation_getPreValue).call(this);
|
|
3549
|
+
tslib.__classPrivateFieldGet(this, _TaroLocation_url, "f").host = val;
|
|
3550
|
+
if (tslib.__classPrivateFieldGet(this, _TaroLocation_instances, "m", _TaroLocation_checkUrlChange).call(this, preValue))
|
|
3551
|
+
tslib.__classPrivateFieldGet(this, _TaroLocation_instances, "m", _TaroLocation_recordHistory).call(this);
|
|
3581
3552
|
}
|
|
3582
3553
|
get hostname() {
|
|
3583
|
-
return __classPrivateFieldGet(this, _TaroLocation_url, "f").hostname;
|
|
3554
|
+
return tslib.__classPrivateFieldGet(this, _TaroLocation_url, "f").hostname;
|
|
3584
3555
|
}
|
|
3585
3556
|
set hostname(val) {
|
|
3586
3557
|
if (!val || !shared.isString(val))
|
|
3587
3558
|
return;
|
|
3588
3559
|
val = val.trim();
|
|
3589
|
-
const preValue = __classPrivateFieldGet(this, _TaroLocation_instances, "m", _TaroLocation_getPreValue).call(this);
|
|
3590
|
-
__classPrivateFieldGet(this, _TaroLocation_url, "f").hostname = val;
|
|
3591
|
-
if (__classPrivateFieldGet(this, _TaroLocation_instances, "m", _TaroLocation_checkUrlChange).call(this, preValue))
|
|
3592
|
-
__classPrivateFieldGet(this, _TaroLocation_instances, "m", _TaroLocation_recordHistory).call(this);
|
|
3560
|
+
const preValue = tslib.__classPrivateFieldGet(this, _TaroLocation_instances, "m", _TaroLocation_getPreValue).call(this);
|
|
3561
|
+
tslib.__classPrivateFieldGet(this, _TaroLocation_url, "f").hostname = val;
|
|
3562
|
+
if (tslib.__classPrivateFieldGet(this, _TaroLocation_instances, "m", _TaroLocation_checkUrlChange).call(this, preValue))
|
|
3563
|
+
tslib.__classPrivateFieldGet(this, _TaroLocation_instances, "m", _TaroLocation_recordHistory).call(this);
|
|
3593
3564
|
}
|
|
3594
3565
|
get port() {
|
|
3595
|
-
return __classPrivateFieldGet(this, _TaroLocation_url, "f").port;
|
|
3566
|
+
return tslib.__classPrivateFieldGet(this, _TaroLocation_url, "f").port;
|
|
3596
3567
|
}
|
|
3597
3568
|
set port(val) {
|
|
3598
3569
|
const xVal = Number((val = val.trim()));
|
|
3599
3570
|
if (!shared.isNumber(xVal) || xVal <= 0)
|
|
3600
3571
|
return;
|
|
3601
|
-
const preValue = __classPrivateFieldGet(this, _TaroLocation_instances, "m", _TaroLocation_getPreValue).call(this);
|
|
3602
|
-
__classPrivateFieldGet(this, _TaroLocation_url, "f").port = val;
|
|
3603
|
-
if (__classPrivateFieldGet(this, _TaroLocation_instances, "m", _TaroLocation_checkUrlChange).call(this, preValue))
|
|
3604
|
-
__classPrivateFieldGet(this, _TaroLocation_instances, "m", _TaroLocation_recordHistory).call(this);
|
|
3572
|
+
const preValue = tslib.__classPrivateFieldGet(this, _TaroLocation_instances, "m", _TaroLocation_getPreValue).call(this);
|
|
3573
|
+
tslib.__classPrivateFieldGet(this, _TaroLocation_url, "f").port = val;
|
|
3574
|
+
if (tslib.__classPrivateFieldGet(this, _TaroLocation_instances, "m", _TaroLocation_checkUrlChange).call(this, preValue))
|
|
3575
|
+
tslib.__classPrivateFieldGet(this, _TaroLocation_instances, "m", _TaroLocation_recordHistory).call(this);
|
|
3605
3576
|
}
|
|
3606
3577
|
get pathname() {
|
|
3607
|
-
return __classPrivateFieldGet(this, _TaroLocation_url, "f").pathname;
|
|
3578
|
+
return tslib.__classPrivateFieldGet(this, _TaroLocation_url, "f").pathname;
|
|
3608
3579
|
}
|
|
3609
3580
|
set pathname(val) {
|
|
3610
3581
|
if (!val || !shared.isString(val))
|
|
3611
3582
|
return;
|
|
3612
3583
|
val = val.trim();
|
|
3613
|
-
const preValue = __classPrivateFieldGet(this, _TaroLocation_instances, "m", _TaroLocation_getPreValue).call(this);
|
|
3614
|
-
__classPrivateFieldGet(this, _TaroLocation_url, "f").pathname = val;
|
|
3615
|
-
if (__classPrivateFieldGet(this, _TaroLocation_instances, "m", _TaroLocation_checkUrlChange).call(this, preValue))
|
|
3616
|
-
__classPrivateFieldGet(this, _TaroLocation_instances, "m", _TaroLocation_recordHistory).call(this);
|
|
3584
|
+
const preValue = tslib.__classPrivateFieldGet(this, _TaroLocation_instances, "m", _TaroLocation_getPreValue).call(this);
|
|
3585
|
+
tslib.__classPrivateFieldGet(this, _TaroLocation_url, "f").pathname = val;
|
|
3586
|
+
if (tslib.__classPrivateFieldGet(this, _TaroLocation_instances, "m", _TaroLocation_checkUrlChange).call(this, preValue))
|
|
3587
|
+
tslib.__classPrivateFieldGet(this, _TaroLocation_instances, "m", _TaroLocation_recordHistory).call(this);
|
|
3617
3588
|
}
|
|
3618
3589
|
get search() {
|
|
3619
|
-
return __classPrivateFieldGet(this, _TaroLocation_url, "f").search;
|
|
3590
|
+
return tslib.__classPrivateFieldGet(this, _TaroLocation_url, "f").search;
|
|
3620
3591
|
}
|
|
3621
3592
|
set search(val) {
|
|
3622
3593
|
if (!val || !shared.isString(val))
|
|
3623
3594
|
return;
|
|
3624
3595
|
val = val.trim();
|
|
3625
3596
|
val = val.startsWith('?') ? val : `?${val}`;
|
|
3626
|
-
const preValue = __classPrivateFieldGet(this, _TaroLocation_instances, "m", _TaroLocation_getPreValue).call(this);
|
|
3627
|
-
__classPrivateFieldGet(this, _TaroLocation_url, "f").search = val;
|
|
3628
|
-
if (__classPrivateFieldGet(this, _TaroLocation_instances, "m", _TaroLocation_checkUrlChange).call(this, preValue))
|
|
3629
|
-
__classPrivateFieldGet(this, _TaroLocation_instances, "m", _TaroLocation_recordHistory).call(this);
|
|
3597
|
+
const preValue = tslib.__classPrivateFieldGet(this, _TaroLocation_instances, "m", _TaroLocation_getPreValue).call(this);
|
|
3598
|
+
tslib.__classPrivateFieldGet(this, _TaroLocation_url, "f").search = val;
|
|
3599
|
+
if (tslib.__classPrivateFieldGet(this, _TaroLocation_instances, "m", _TaroLocation_checkUrlChange).call(this, preValue))
|
|
3600
|
+
tslib.__classPrivateFieldGet(this, _TaroLocation_instances, "m", _TaroLocation_recordHistory).call(this);
|
|
3630
3601
|
}
|
|
3631
3602
|
get hash() {
|
|
3632
|
-
return __classPrivateFieldGet(this, _TaroLocation_url, "f").hash;
|
|
3603
|
+
return tslib.__classPrivateFieldGet(this, _TaroLocation_url, "f").hash;
|
|
3633
3604
|
}
|
|
3634
3605
|
// 小程序的navigateTo存在截断hash字符串的问题
|
|
3635
3606
|
set hash(val) {
|
|
@@ -3637,34 +3608,34 @@ class TaroLocation extends shared.Events {
|
|
|
3637
3608
|
return;
|
|
3638
3609
|
val = val.trim();
|
|
3639
3610
|
val = val.startsWith('#') ? val : `#${val}`;
|
|
3640
|
-
const preValue = __classPrivateFieldGet(this, _TaroLocation_instances, "m", _TaroLocation_getPreValue).call(this);
|
|
3641
|
-
__classPrivateFieldGet(this, _TaroLocation_url, "f").hash = val;
|
|
3642
|
-
if (__classPrivateFieldGet(this, _TaroLocation_instances, "m", _TaroLocation_checkUrlChange).call(this, preValue))
|
|
3643
|
-
__classPrivateFieldGet(this, _TaroLocation_instances, "m", _TaroLocation_recordHistory).call(this);
|
|
3611
|
+
const preValue = tslib.__classPrivateFieldGet(this, _TaroLocation_instances, "m", _TaroLocation_getPreValue).call(this);
|
|
3612
|
+
tslib.__classPrivateFieldGet(this, _TaroLocation_url, "f").hash = val;
|
|
3613
|
+
if (tslib.__classPrivateFieldGet(this, _TaroLocation_instances, "m", _TaroLocation_checkUrlChange).call(this, preValue))
|
|
3614
|
+
tslib.__classPrivateFieldGet(this, _TaroLocation_instances, "m", _TaroLocation_recordHistory).call(this);
|
|
3644
3615
|
}
|
|
3645
3616
|
get href() {
|
|
3646
|
-
return __classPrivateFieldGet(this, _TaroLocation_url, "f").href;
|
|
3617
|
+
return tslib.__classPrivateFieldGet(this, _TaroLocation_url, "f").href;
|
|
3647
3618
|
}
|
|
3648
3619
|
set href(val) {
|
|
3649
3620
|
const REG = /^(http:|https:)?\/\/.+/;
|
|
3650
3621
|
if (!val || !shared.isString(val) || !REG.test((val = val.trim())))
|
|
3651
3622
|
return;
|
|
3652
|
-
const preValue = __classPrivateFieldGet(this, _TaroLocation_instances, "m", _TaroLocation_getPreValue).call(this);
|
|
3653
|
-
__classPrivateFieldGet(this, _TaroLocation_url, "f").href = val;
|
|
3654
|
-
if (__classPrivateFieldGet(this, _TaroLocation_instances, "m", _TaroLocation_checkUrlChange).call(this, preValue))
|
|
3655
|
-
__classPrivateFieldGet(this, _TaroLocation_instances, "m", _TaroLocation_recordHistory).call(this);
|
|
3623
|
+
const preValue = tslib.__classPrivateFieldGet(this, _TaroLocation_instances, "m", _TaroLocation_getPreValue).call(this);
|
|
3624
|
+
tslib.__classPrivateFieldGet(this, _TaroLocation_url, "f").href = val;
|
|
3625
|
+
if (tslib.__classPrivateFieldGet(this, _TaroLocation_instances, "m", _TaroLocation_checkUrlChange).call(this, preValue))
|
|
3626
|
+
tslib.__classPrivateFieldGet(this, _TaroLocation_instances, "m", _TaroLocation_recordHistory).call(this);
|
|
3656
3627
|
}
|
|
3657
3628
|
get origin() {
|
|
3658
|
-
return __classPrivateFieldGet(this, _TaroLocation_url, "f").origin;
|
|
3629
|
+
return tslib.__classPrivateFieldGet(this, _TaroLocation_url, "f").origin;
|
|
3659
3630
|
}
|
|
3660
3631
|
set origin(val) {
|
|
3661
3632
|
const REG = /^(http:|https:)?\/\/.+/;
|
|
3662
3633
|
if (!val || !shared.isString(val) || !REG.test((val = val.trim())))
|
|
3663
3634
|
return;
|
|
3664
|
-
const preValue = __classPrivateFieldGet(this, _TaroLocation_instances, "m", _TaroLocation_getPreValue).call(this);
|
|
3665
|
-
__classPrivateFieldGet(this, _TaroLocation_url, "f").origin = val;
|
|
3666
|
-
if (__classPrivateFieldGet(this, _TaroLocation_instances, "m", _TaroLocation_checkUrlChange).call(this, preValue))
|
|
3667
|
-
__classPrivateFieldGet(this, _TaroLocation_instances, "m", _TaroLocation_recordHistory).call(this);
|
|
3635
|
+
const preValue = tslib.__classPrivateFieldGet(this, _TaroLocation_instances, "m", _TaroLocation_getPreValue).call(this);
|
|
3636
|
+
tslib.__classPrivateFieldGet(this, _TaroLocation_url, "f").origin = val;
|
|
3637
|
+
if (tslib.__classPrivateFieldGet(this, _TaroLocation_instances, "m", _TaroLocation_checkUrlChange).call(this, preValue))
|
|
3638
|
+
tslib.__classPrivateFieldGet(this, _TaroLocation_instances, "m", _TaroLocation_recordHistory).call(this);
|
|
3668
3639
|
}
|
|
3669
3640
|
/* public method */
|
|
3670
3641
|
assign() {
|
|
@@ -3694,23 +3665,23 @@ _TaroLocation_url = new WeakMap(), _TaroLocation_noCheckUrl = new WeakMap(), _Ta
|
|
|
3694
3665
|
});
|
|
3695
3666
|
const searchStr = searchArr.length > 0 ? '?' + searchArr.join('&') : '';
|
|
3696
3667
|
const url = `${INIT_URL}${path.startsWith('/') ? path : '/' + path}${searchStr}`;
|
|
3697
|
-
__classPrivateFieldSet(this, _TaroLocation_url, new URL(url), "f");
|
|
3668
|
+
tslib.__classPrivateFieldSet(this, _TaroLocation_url, new URL(url), "f");
|
|
3698
3669
|
this.trigger('__reset_history__', this.href);
|
|
3699
3670
|
}
|
|
3700
3671
|
}, _TaroLocation_getPreValue = function _TaroLocation_getPreValue() {
|
|
3701
|
-
return __classPrivateFieldGet(this, _TaroLocation_url, "f")._toRaw();
|
|
3672
|
+
return tslib.__classPrivateFieldGet(this, _TaroLocation_url, "f")._toRaw();
|
|
3702
3673
|
}, _TaroLocation_rollBack = function _TaroLocation_rollBack(href) {
|
|
3703
|
-
__classPrivateFieldGet(this, _TaroLocation_url, "f").href = href;
|
|
3674
|
+
tslib.__classPrivateFieldGet(this, _TaroLocation_url, "f").href = href;
|
|
3704
3675
|
}, _TaroLocation_recordHistory = function _TaroLocation_recordHistory() {
|
|
3705
3676
|
this.trigger('__record_history__', this.href);
|
|
3706
3677
|
}, _TaroLocation_checkUrlChange = function _TaroLocation_checkUrlChange(preValue) {
|
|
3707
|
-
if (__classPrivateFieldGet(this, _TaroLocation_noCheckUrl, "f")) {
|
|
3678
|
+
if (tslib.__classPrivateFieldGet(this, _TaroLocation_noCheckUrl, "f")) {
|
|
3708
3679
|
return false;
|
|
3709
3680
|
}
|
|
3710
|
-
const { protocol, hostname, port, pathname, search, hash } = __classPrivateFieldGet(this, _TaroLocation_url, "f")._toRaw();
|
|
3681
|
+
const { protocol, hostname, port, pathname, search, hash } = tslib.__classPrivateFieldGet(this, _TaroLocation_url, "f")._toRaw();
|
|
3711
3682
|
// 跨域三要素不允许修改
|
|
3712
3683
|
if (protocol !== preValue.protocol || hostname !== preValue.hostname || port !== preValue.port) {
|
|
3713
|
-
__classPrivateFieldGet(this, _TaroLocation_instances, "m", _TaroLocation_rollBack).call(this, preValue.href);
|
|
3684
|
+
tslib.__classPrivateFieldGet(this, _TaroLocation_instances, "m", _TaroLocation_rollBack).call(this, preValue.href);
|
|
3714
3685
|
return false;
|
|
3715
3686
|
}
|
|
3716
3687
|
// pathname
|
|
@@ -3723,10 +3694,10 @@ _TaroLocation_url = new WeakMap(), _TaroLocation_noCheckUrl = new WeakMap(), _Ta
|
|
|
3723
3694
|
}
|
|
3724
3695
|
// hashchange
|
|
3725
3696
|
if (hash !== preValue.hash) {
|
|
3726
|
-
__classPrivateFieldGet(this, _TaroLocation_window, "f").trigger('hashchange');
|
|
3697
|
+
tslib.__classPrivateFieldGet(this, _TaroLocation_window, "f").trigger('hashchange');
|
|
3727
3698
|
return true;
|
|
3728
3699
|
}
|
|
3729
|
-
__classPrivateFieldGet(this, _TaroLocation_instances, "m", _TaroLocation_rollBack).call(this, preValue.href);
|
|
3700
|
+
tslib.__classPrivateFieldGet(this, _TaroLocation_instances, "m", _TaroLocation_rollBack).call(this, preValue.href);
|
|
3730
3701
|
return false;
|
|
3731
3702
|
};
|
|
3732
3703
|
const Location = process.env.TARO_PLATFORM === 'web' ? env.window.Location : TaroLocation;
|