@tarojs/taro-h5 4.0.0-alpha.2 → 4.0.0-alpha.21
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/api/base/index.js +1 -1
- package/dist/api/base/index.js.map +1 -1
- package/dist/api/base/system.js +2 -2
- package/dist/api/base/system.js.map +1 -1
- package/dist/api/base/weapp/app-event.js +2 -2
- package/dist/api/base/weapp/app-event.js.map +1 -1
- package/dist/api/canvas/CanvasContext.d.ts +1 -1
- package/dist/api/canvas/CanvasContext.js.map +1 -1
- package/dist/api/canvas/canvasGetImageData.js.map +1 -1
- package/dist/api/canvas/canvasPutImageData.js.map +1 -1
- package/dist/api/canvas/canvasToTempFilePath.js.map +1 -1
- package/dist/api/device/accelerometer.js.map +1 -1
- package/dist/api/device/battery.js +1 -1
- package/dist/api/device/battery.js.map +1 -1
- package/dist/api/device/calendar.js.map +1 -1
- package/dist/api/device/clipboard.js +2 -2
- package/dist/api/device/clipboard.js.map +1 -1
- package/dist/api/device/compass.js.map +1 -1
- package/dist/api/device/motion.js.map +1 -1
- package/dist/api/device/network.js.map +1 -1
- package/dist/api/device/phone.js.map +1 -1
- package/dist/api/device/sms.js.map +1 -1
- package/dist/api/device/vibrate.js.map +1 -1
- package/dist/api/index.js +2 -1
- package/dist/api/index.js.map +1 -1
- package/dist/api/location/chooseLocation.js +2 -2
- package/dist/api/location/chooseLocation.js.map +1 -1
- package/dist/api/location/getLocation.js +3 -3
- package/dist/api/location/getLocation.js.map +1 -1
- package/dist/api/location/index.d.ts +2 -7
- package/dist/api/location/index.js +2 -8
- package/dist/api/location/index.js.map +1 -1
- package/dist/api/location/locationChange.d.ts +7 -0
- package/dist/api/location/locationChange.js +130 -0
- package/dist/api/location/locationChange.js.map +1 -0
- package/dist/api/location/style.scss.js +1 -1
- package/dist/api/location/utils.d.ts +2 -0
- package/dist/api/location/utils.js +4 -0
- package/dist/api/location/utils.js.map +1 -0
- package/dist/api/media/audio/InnerAudioContext.js.map +1 -1
- package/dist/api/media/background-audio/BackgroundAudioManager.d.ts +1 -1
- package/dist/api/media/background-audio/BackgroundAudioManager.js.map +1 -1
- package/dist/api/media/image/chooseImage.js.map +1 -1
- package/dist/api/media/image/getImageInfo.js.map +1 -1
- package/dist/api/media/image/previewImage.js.map +1 -1
- package/dist/api/media/image/saveImageToPhotosAlbum.js.map +1 -1
- package/dist/api/media/video/chooseMedia.js +3 -3
- package/dist/api/media/video/chooseMedia.js.map +1 -1
- package/dist/api/media/video/chooseVideo.js.map +1 -1
- package/dist/api/media/video/getVideoInfo.js.map +1 -1
- package/dist/api/media/video/saveVideoToPhotosAlbum.js.map +1 -1
- package/dist/api/network/request/index.js.map +1 -1
- package/dist/api/network/upload.js.map +1 -1
- package/dist/api/network/utils.js +4 -4
- package/dist/api/network/utils.js.map +1 -1
- package/dist/api/network/websocket/index.js.map +1 -1
- package/dist/api/network/websocket/socketTask.js.map +1 -1
- package/dist/api/storage/index.js.map +1 -1
- package/dist/api/taro.js +2 -2
- package/dist/api/taro.js.map +1 -1
- package/dist/api/ui/animation/index.js.map +1 -1
- package/dist/api/ui/fonts.js.map +1 -1
- package/dist/api/ui/interaction/actionSheet.js.map +1 -1
- package/dist/api/ui/interaction/index.js +2 -2
- package/dist/api/ui/interaction/index.js.map +1 -1
- package/dist/api/ui/interaction/modal.js.map +1 -1
- package/dist/api/ui/interaction/toast.js.map +1 -1
- package/dist/api/ui/navigation-bar/index.d.ts +8 -2
- package/dist/api/ui/navigation-bar/index.js +20 -4
- package/dist/api/ui/navigation-bar/index.js.map +1 -1
- package/dist/api/ui/scroll/index.js.map +1 -1
- package/dist/api/ui/tab-bar.js.map +1 -1
- package/dist/api/ui/window.js.map +1 -1
- package/dist/api/wxml/IntersectionObserver.js.map +1 -1
- package/dist/api/wxml/MediaQueryObserver.js.map +1 -1
- package/dist/api/wxml/selectorQuery.js.map +1 -1
- package/dist/index.cjs.d.ts +18 -11
- package/dist/index.cjs.js +168 -30
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.d.ts +18 -11
- package/dist/index.esm.js +172 -34
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/utils/animation.js.map +1 -1
- package/dist/utils/handler.d.ts +2 -0
- package/dist/utils/handler.js +4 -0
- package/dist/utils/handler.js.map +1 -1
- package/dist/utils/index.js +1 -1
- package/dist/utils/index.js.map +1 -1
- package/package.json +16 -25
- /package/dist/node_modules/.pnpm/{registry.npmjs.org_style-inject@0.3.0 → style-inject@0.3.0}/node_modules/style-inject/dist/style-inject.es.js +0 -0
- /package/dist/node_modules/.pnpm/{registry.npmjs.org_style-inject@0.3.0 → style-inject@0.3.0}/node_modules/style-inject/dist/style-inject.es.js.map +0 -0
package/dist/index.cjs.js
CHANGED
|
@@ -113,6 +113,10 @@ class CallbackManager {
|
|
|
113
113
|
}
|
|
114
114
|
});
|
|
115
115
|
};
|
|
116
|
+
/** 清空所有回调 */
|
|
117
|
+
this.clear = () => {
|
|
118
|
+
this.callbacks = [];
|
|
119
|
+
};
|
|
116
120
|
}
|
|
117
121
|
}
|
|
118
122
|
|
|
@@ -163,7 +167,7 @@ function findDOM(inst) {
|
|
|
163
167
|
}
|
|
164
168
|
const page = runtime.Current.page;
|
|
165
169
|
const path = page === null || page === void 0 ? void 0 : page.path;
|
|
166
|
-
const msg = '
|
|
170
|
+
const msg = '没有找到已经加载了的页面,请在页面加载完成后使用此 API。';
|
|
167
171
|
if (path == null) {
|
|
168
172
|
throw new Error(msg);
|
|
169
173
|
}
|
|
@@ -508,7 +512,7 @@ const getSystemInfoSync = () => {
|
|
|
508
512
|
return info;
|
|
509
513
|
};
|
|
510
514
|
/** 获取系统信息 */
|
|
511
|
-
const getSystemInfoAsync = (
|
|
515
|
+
const getSystemInfoAsync = (...args_1) => tslib.__awaiter(void 0, [...args_1], void 0, function* (options = {}) {
|
|
512
516
|
const { success, fail, complete } = options;
|
|
513
517
|
const handle = new MethodHandler({ name: 'getSystemInfoAsync', success, fail, complete });
|
|
514
518
|
try {
|
|
@@ -522,7 +526,7 @@ const getSystemInfoAsync = (options = {}) => tslib.__awaiter(void 0, void 0, voi
|
|
|
522
526
|
}
|
|
523
527
|
});
|
|
524
528
|
/** 获取系统信息 */
|
|
525
|
-
const getSystemInfo = (
|
|
529
|
+
const getSystemInfo = (...args_2) => tslib.__awaiter(void 0, [...args_2], void 0, function* (options = {}) {
|
|
526
530
|
const { success, fail, complete } = options;
|
|
527
531
|
const handle = new MethodHandler({ name: 'getSystemInfo', success, fail, complete });
|
|
528
532
|
try {
|
|
@@ -700,7 +704,7 @@ const env = {
|
|
|
700
704
|
TARO_VERSION: process.env.TARO_VERSION,
|
|
701
705
|
};
|
|
702
706
|
// Note: 该方法由 taro-plugin-platform-h5 实现
|
|
703
|
-
|
|
707
|
+
// export const canIUse = /* @__PURE__ */ temporarilyNotSupport('canIUse')
|
|
704
708
|
function arrayBufferToBase64(arrayBuffer) {
|
|
705
709
|
return base64Js.fromByteArray(arrayBuffer);
|
|
706
710
|
}
|
|
@@ -1114,7 +1118,7 @@ const checkIsOpenAccessibility = /* @__PURE__ */ temporarilyNotSupport('checkIsO
|
|
|
1114
1118
|
// 电量
|
|
1115
1119
|
// Note: 浏览器标准下不支持,其他实现方案不准确,不建议开发者使用
|
|
1116
1120
|
const getBatteryInfoSync = /* @__PURE__ */ permanentlyNotSupport('getBatteryInfoSync');
|
|
1117
|
-
const getBatteryInfo = (
|
|
1121
|
+
const getBatteryInfo = (...args_1) => tslib.__awaiter(void 0, [...args_1], void 0, function* ({ success, fail, complete } = {}) {
|
|
1118
1122
|
var _a;
|
|
1119
1123
|
const handle = new MethodHandler({ name: 'getBatteryInfo', success, fail, complete });
|
|
1120
1124
|
try {
|
|
@@ -2171,7 +2175,7 @@ const hideLoading = ({ noConflict = false, success, fail, complete } = {}) => {
|
|
|
2171
2175
|
toast.hide(0, noConflict ? 'loading' : '');
|
|
2172
2176
|
return handle.success();
|
|
2173
2177
|
};
|
|
2174
|
-
const showModal = (
|
|
2178
|
+
const showModal = (...args_1) => tslib.__awaiter(void 0, [...args_1], void 0, function* (options = {}) {
|
|
2175
2179
|
init(document);
|
|
2176
2180
|
options = Object.assign({
|
|
2177
2181
|
title: '',
|
|
@@ -2265,7 +2269,7 @@ function hideModal() {
|
|
|
2265
2269
|
return;
|
|
2266
2270
|
modal.hide();
|
|
2267
2271
|
}
|
|
2268
|
-
const showActionSheet = (
|
|
2272
|
+
const showActionSheet = (...args_2) => tslib.__awaiter(void 0, [...args_2], void 0, function* (options = { itemList: [] }, methodName = 'showActionSheet') {
|
|
2269
2273
|
init(document);
|
|
2270
2274
|
options = Object.assign({
|
|
2271
2275
|
itemColor: '#000000',
|
|
@@ -2355,7 +2359,7 @@ document.addEventListener('copy', () => {
|
|
|
2355
2359
|
/**
|
|
2356
2360
|
* 设置系统剪贴板的内容
|
|
2357
2361
|
*/
|
|
2358
|
-
const setClipboardData = (
|
|
2362
|
+
const setClipboardData = (_a) => tslib.__awaiter(void 0, [_a], void 0, function* ({ data, success, fail, complete }) {
|
|
2359
2363
|
const handle = new MethodHandler({ name: 'setClipboardData', success, fail, complete });
|
|
2360
2364
|
try {
|
|
2361
2365
|
setStorageSync(CLIPBOARD_STORAGE_NAME, data);
|
|
@@ -2394,7 +2398,7 @@ const setClipboardData = ({ data, success, fail, complete }) => tslib.__awaiter(
|
|
|
2394
2398
|
/**
|
|
2395
2399
|
* 获取系统剪贴板的内容
|
|
2396
2400
|
*/
|
|
2397
|
-
const getClipboardData = (
|
|
2401
|
+
const getClipboardData = (...args_1) => tslib.__awaiter(void 0, [...args_1], void 0, function* ({ success, fail, complete } = {}) {
|
|
2398
2402
|
const handle = new MethodHandler({ name: 'getClipboardData', success, fail, complete });
|
|
2399
2403
|
try {
|
|
2400
2404
|
const data = getStorageSync(CLIPBOARD_STORAGE_NAME);
|
|
@@ -2784,6 +2788,8 @@ const getApp = function () {
|
|
|
2784
2788
|
// 自定义组件
|
|
2785
2789
|
const getCurrentInstance = Taro.getCurrentInstance;
|
|
2786
2790
|
|
|
2791
|
+
const isGeolocationSupported = () => !!navigator.geolocation;
|
|
2792
|
+
|
|
2787
2793
|
const getLocationByW3CApi = (options) => {
|
|
2788
2794
|
var _a;
|
|
2789
2795
|
// 断言 options 必须是 Object
|
|
@@ -2798,7 +2804,7 @@ const getLocationByW3CApi = (options) => {
|
|
|
2798
2804
|
const handle = new MethodHandler({ name: 'getLocation', success, fail, complete });
|
|
2799
2805
|
// const defaultMaximumAge = 5 * 1000
|
|
2800
2806
|
const positionOptions = {
|
|
2801
|
-
enableHighAccuracy: options.isHighAccuracy || (options.altitude != null),
|
|
2807
|
+
enableHighAccuracy: options.isHighAccuracy || (options.altitude != null), // 海拔定位需要高精度
|
|
2802
2808
|
// maximumAge: defaultMaximumAge, // 允许取多久以内的缓存位置
|
|
2803
2809
|
timeout: options.highAccuracyExpireTime // 高精度定位超时时间
|
|
2804
2810
|
};
|
|
@@ -2809,8 +2815,7 @@ const getLocationByW3CApi = (options) => {
|
|
|
2809
2815
|
});
|
|
2810
2816
|
}
|
|
2811
2817
|
// 判断当前浏览器是否支持位置API
|
|
2812
|
-
|
|
2813
|
-
if (!geolocationSupported) {
|
|
2818
|
+
if (!isGeolocationSupported()) {
|
|
2814
2819
|
return handle.fail({
|
|
2815
2820
|
errMsg: 'The current browser does not support this feature'
|
|
2816
2821
|
});
|
|
@@ -2976,18 +2981,135 @@ const chooseLocation = ({ success, fail, complete, mapOpts } = {}) => {
|
|
|
2976
2981
|
});
|
|
2977
2982
|
};
|
|
2978
2983
|
|
|
2979
|
-
|
|
2980
|
-
const
|
|
2984
|
+
const _successCbManager = new CallbackManager();
|
|
2985
|
+
const _errorCbManager = new CallbackManager();
|
|
2986
|
+
let _watchID = -1;
|
|
2987
|
+
function onLocationChange(callback) {
|
|
2988
|
+
_successCbManager.add(callback);
|
|
2989
|
+
}
|
|
2990
|
+
function offLocationChange(callback) {
|
|
2991
|
+
if (callback && typeof callback === 'function') {
|
|
2992
|
+
_successCbManager.remove(callback);
|
|
2993
|
+
}
|
|
2994
|
+
else if (callback === undefined) {
|
|
2995
|
+
_successCbManager.clear();
|
|
2996
|
+
}
|
|
2997
|
+
else {
|
|
2998
|
+
console.warn('offLocationChange failed');
|
|
2999
|
+
}
|
|
3000
|
+
}
|
|
3001
|
+
function onLocationChangeError(callback) {
|
|
3002
|
+
_errorCbManager.add(callback);
|
|
3003
|
+
}
|
|
3004
|
+
function offLocationChangeError(callback) {
|
|
3005
|
+
if (callback && typeof callback === 'function') {
|
|
3006
|
+
_errorCbManager.remove(callback);
|
|
3007
|
+
}
|
|
3008
|
+
else if (callback === undefined) {
|
|
3009
|
+
_errorCbManager.clear();
|
|
3010
|
+
}
|
|
3011
|
+
else {
|
|
3012
|
+
console.warn('offLocationChangeError failed');
|
|
3013
|
+
}
|
|
3014
|
+
}
|
|
3015
|
+
/**
|
|
3016
|
+
* 开始监听位置信息
|
|
3017
|
+
* @param opts
|
|
3018
|
+
* @returns
|
|
3019
|
+
*/
|
|
3020
|
+
function startLocationUpdateByW3CApi(opts) {
|
|
3021
|
+
// 断言 options 必须是 Object
|
|
3022
|
+
const isObject = shouldBeObject(opts);
|
|
3023
|
+
if (!isObject.flag) {
|
|
3024
|
+
const res = { errMsg: `startLocationUpdate:fail ${isObject.msg}` };
|
|
3025
|
+
console.error(res.errMsg);
|
|
3026
|
+
return Promise.reject(res);
|
|
3027
|
+
}
|
|
3028
|
+
const { success, fail, complete } = opts;
|
|
3029
|
+
const handle = new MethodHandler({ name: 'startLocationUpdate', success, fail, complete });
|
|
3030
|
+
// 判断当前浏览器是否支持位置API
|
|
3031
|
+
if (!isGeolocationSupported()) {
|
|
3032
|
+
return handle.fail({
|
|
3033
|
+
errMsg: 'The current browser does not support this feature'
|
|
3034
|
+
});
|
|
3035
|
+
}
|
|
3036
|
+
try {
|
|
3037
|
+
if (_watchID > -1) {
|
|
3038
|
+
console.error('startLocationUpdate:fail');
|
|
3039
|
+
return handle.fail();
|
|
3040
|
+
}
|
|
3041
|
+
else {
|
|
3042
|
+
_watchID = navigator.geolocation.watchPosition(({ coords }) => {
|
|
3043
|
+
const { latitude, longitude, altitude, accuracy, speed } = coords;
|
|
3044
|
+
_successCbManager.trigger({
|
|
3045
|
+
accuracy,
|
|
3046
|
+
altitude,
|
|
3047
|
+
horizontalAccuracy: 0,
|
|
3048
|
+
verticalAccuracy: 0,
|
|
3049
|
+
latitude,
|
|
3050
|
+
longitude,
|
|
3051
|
+
speed,
|
|
3052
|
+
});
|
|
3053
|
+
}, err => {
|
|
3054
|
+
_errorCbManager.trigger({
|
|
3055
|
+
errMsg: 'Watch Position error',
|
|
3056
|
+
err
|
|
3057
|
+
});
|
|
3058
|
+
}, {
|
|
3059
|
+
timeout: 10,
|
|
3060
|
+
maximumAge: 0,
|
|
3061
|
+
enableHighAccuracy: true,
|
|
3062
|
+
});
|
|
3063
|
+
return handle.success();
|
|
3064
|
+
}
|
|
3065
|
+
}
|
|
3066
|
+
catch (error) {
|
|
3067
|
+
return handle.fail();
|
|
3068
|
+
}
|
|
3069
|
+
}
|
|
3070
|
+
/**
|
|
3071
|
+
* 停止监听位置信息
|
|
3072
|
+
* @param opts
|
|
3073
|
+
* @returns
|
|
3074
|
+
*/
|
|
3075
|
+
function stopLocationUpdateByW3CApi(opts) {
|
|
3076
|
+
const isObject = shouldBeObject(opts);
|
|
3077
|
+
if (!isObject.flag) {
|
|
3078
|
+
const res = { errMsg: `stopLocationUpdate:fail ${isObject.msg}` };
|
|
3079
|
+
console.error(res.errMsg);
|
|
3080
|
+
return Promise.reject(res);
|
|
3081
|
+
}
|
|
3082
|
+
const { success, fail, complete } = opts;
|
|
3083
|
+
const handle = new MethodHandler({ name: 'stopLocationUpdate', success, fail, complete });
|
|
3084
|
+
// 判断当前浏览器是否支持位置API
|
|
3085
|
+
if (!isGeolocationSupported()) {
|
|
3086
|
+
return handle.fail({
|
|
3087
|
+
errMsg: 'The current browser does not support this feature'
|
|
3088
|
+
});
|
|
3089
|
+
}
|
|
3090
|
+
try {
|
|
3091
|
+
navigator.geolocation.clearWatch(_watchID);
|
|
3092
|
+
_watchID = -1;
|
|
3093
|
+
return handle.success();
|
|
3094
|
+
}
|
|
3095
|
+
catch (error) {
|
|
3096
|
+
return handle.fail();
|
|
3097
|
+
}
|
|
3098
|
+
}
|
|
3099
|
+
const stopLocationUpdate = /* @__PURE__ */ processOpenApi({
|
|
3100
|
+
name: 'stopLocationUpdate',
|
|
3101
|
+
standardMethod: stopLocationUpdateByW3CApi
|
|
3102
|
+
});
|
|
3103
|
+
const startLocationUpdate = /* @__PURE__ */ processOpenApi({
|
|
3104
|
+
name: 'startLocationUpdate',
|
|
3105
|
+
standardMethod: startLocationUpdateByW3CApi
|
|
3106
|
+
});
|
|
3107
|
+
|
|
2981
3108
|
const startLocationUpdateBackground = /* @__PURE__ */ temporarilyNotSupport('startLocationUpdateBackground');
|
|
2982
|
-
const startLocationUpdate = /* @__PURE__ */ temporarilyNotSupport('startLocationUpdate');
|
|
2983
3109
|
const openLocation = /* @__PURE__ */ processOpenApi({
|
|
2984
3110
|
name: 'openLocation',
|
|
2985
3111
|
defaultOptions: { scale: 18 }
|
|
2986
3112
|
});
|
|
2987
|
-
const onLocationChangeError = /* @__PURE__ */ temporarilyNotSupport('onLocationChangeError');
|
|
2988
|
-
const onLocationChange = /* @__PURE__ */ temporarilyNotSupport('onLocationChange');
|
|
2989
|
-
const offLocationChangeError = /* @__PURE__ */ temporarilyNotSupport('offLocationChangeError');
|
|
2990
|
-
const offLocationChange = /* @__PURE__ */ temporarilyNotSupport('offLocationChange');
|
|
2991
3113
|
const choosePoi = /* @__PURE__ */ temporarilyNotSupport('choosePoi');
|
|
2992
3114
|
const getFuzzyLocation = /* @__PURE__ */ temporarilyNotSupport('getFuzzyLocation');
|
|
2993
3115
|
|
|
@@ -3740,7 +3862,15 @@ const loadFontFace = (options) => tslib.__awaiter(void 0, void 0, void 0, functi
|
|
|
3740
3862
|
const getMenuButtonBoundingClientRect = /* @__PURE__ */ temporarilyNotSupport('getMenuButtonBoundingClientRect');
|
|
3741
3863
|
|
|
3742
3864
|
// 导航栏
|
|
3743
|
-
|
|
3865
|
+
/**
|
|
3866
|
+
* 展示导航栏 loading 状态
|
|
3867
|
+
*/
|
|
3868
|
+
function showNavigationBarLoading(options = {}) {
|
|
3869
|
+
const { success, fail, complete } = options;
|
|
3870
|
+
const handle = new MethodHandler({ name: 'showNavigationBarLoading', success, fail, complete });
|
|
3871
|
+
router.setNavigationBarLoading(true);
|
|
3872
|
+
return handle.success();
|
|
3873
|
+
}
|
|
3744
3874
|
function setNavigationBarTitle(options) {
|
|
3745
3875
|
// options must be an Object
|
|
3746
3876
|
const isObject = shouldBeObject(options);
|
|
@@ -3776,7 +3906,15 @@ const setNavigationBarColor = (options) => {
|
|
|
3776
3906
|
router.setNavigationBarStyle({ frontColor, backgroundColor });
|
|
3777
3907
|
return handle.success();
|
|
3778
3908
|
};
|
|
3779
|
-
|
|
3909
|
+
/**
|
|
3910
|
+
* 隐藏导航栏 loading 状态
|
|
3911
|
+
*/
|
|
3912
|
+
function hideNavigationBarLoading(options = {}) {
|
|
3913
|
+
const { success, fail, complete } = options;
|
|
3914
|
+
const handle = new MethodHandler({ name: 'hideNavigationBarLoading', success, fail, complete });
|
|
3915
|
+
router.setNavigationBarLoading(false);
|
|
3916
|
+
return handle.success();
|
|
3917
|
+
}
|
|
3780
3918
|
const hideHomeButton = /* @__PURE__ */ temporarilyNotSupport('hideHomeButton');
|
|
3781
3919
|
|
|
3782
3920
|
/**
|
|
@@ -4203,9 +4341,9 @@ const checkIsPictureInPictureActive = /* @__PURE__ */ temporarilyNotSupport('che
|
|
|
4203
4341
|
/**
|
|
4204
4342
|
* 拍摄或从手机相册中选择图片或视频。
|
|
4205
4343
|
*/
|
|
4206
|
-
const chooseMedia = function (
|
|
4207
|
-
|
|
4208
|
-
|
|
4344
|
+
const chooseMedia = function (options_1) {
|
|
4345
|
+
return tslib.__awaiter(this, arguments, void 0, function* (options, methodName = 'chooseMedia') {
|
|
4346
|
+
var _a;
|
|
4209
4347
|
// options must be an Object
|
|
4210
4348
|
const isObject = shouldBeObject(options);
|
|
4211
4349
|
if (!isObject.flag) {
|
|
@@ -4646,10 +4784,10 @@ const openBusinessView = /* @__PURE__ */ temporarilyNotSupport('openBusinessView
|
|
|
4646
4784
|
*/
|
|
4647
4785
|
const NETWORK_TIMEOUT = 60000;
|
|
4648
4786
|
const XHR_STATS = {
|
|
4649
|
-
UNSENT: 0,
|
|
4650
|
-
OPENED: 1,
|
|
4651
|
-
HEADERS_RECEIVED: 2,
|
|
4652
|
-
LOADING: 3,
|
|
4787
|
+
UNSENT: 0, // Client has been created. open() not called yet.
|
|
4788
|
+
OPENED: 1, // open() has been called.
|
|
4789
|
+
HEADERS_RECEIVED: 2, // send() has been called, and headers and status are available.
|
|
4790
|
+
LOADING: 3, // Downloading; responseText holds partial data.
|
|
4653
4791
|
DONE: 4 // The operation is complete.
|
|
4654
4792
|
};
|
|
4655
4793
|
/**
|
|
@@ -5927,9 +6065,9 @@ const pxTransform = function (size = 0) {
|
|
|
5927
6065
|
const config = getConfig.call(this);
|
|
5928
6066
|
const baseFontSize = config.baseFontSize || defaultBaseFontSize;
|
|
5929
6067
|
const deviceRatio = config.deviceRatio || defaultDesignRatio;
|
|
5930
|
-
const designWidth = ((
|
|
6068
|
+
const designWidth = ((input = 0) => shared.isFunction(config.designWidth)
|
|
5931
6069
|
? config.designWidth(input)
|
|
5932
|
-
: config.designWidth)
|
|
6070
|
+
: config.designWidth)(size);
|
|
5933
6071
|
if (!(designWidth in config.deviceRatio)) {
|
|
5934
6072
|
throw new Error(`deviceRatio 配置中不存在 ${designWidth} 的设置!`);
|
|
5935
6073
|
}
|