@fecp/mobile 1.0.25 → 1.0.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/es/mobile.css +7 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/index.mjs +38 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/adapters/adapters.mjs +60 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/adapters/fetch.mjs +174 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/adapters/xhr.mjs +138 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/axios.mjs +50 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/cancel/CancelToken.mjs +99 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/cancel/CanceledError.mjs +12 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/cancel/isCancel.mjs +6 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/core/Axios.mjs +181 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/core/AxiosError.mjs +76 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/core/AxiosHeaders.mjs +223 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/core/InterceptorManager.mjs +65 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/core/buildFullPath.mjs +12 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/core/dispatchRequest.mjs +52 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/core/mergeConfig.mjs +83 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/core/settle.mjs +18 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/core/transformData.mjs +17 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/defaults/index.mjs +116 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/defaults/transitional.mjs +8 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/env/data.mjs +4 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/helpers/AxiosURLSearchParams.mjs +34 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/helpers/HttpStatusCode.mjs +71 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/helpers/bind.mjs +8 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/helpers/buildURL.mjs +34 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/helpers/combineURLs.mjs +6 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/helpers/composeSignals.mjs +39 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/helpers/cookies.mjs +36 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/helpers/formDataToJSON.mjs +54 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/helpers/isAbsoluteURL.mjs +6 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/helpers/isAxiosError.mjs +7 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/helpers/isURLSameOrigin.mjs +11 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/helpers/null.mjs +4 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/helpers/parseHeaders.mjs +47 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/helpers/parseProtocol.mjs +7 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/helpers/progressEventReducer.mjs +41 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/helpers/resolveConfig.mjs +42 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/helpers/speedometer.mjs +36 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/helpers/spread.mjs +8 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/helpers/throttle.mjs +35 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/helpers/toFormData.mjs +114 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/helpers/toURLEncodedForm.mjs +17 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/helpers/trackStream.mjs +80 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/helpers/validator.mjs +67 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/platform/browser/classes/Blob.mjs +4 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/platform/browser/classes/FormData.mjs +4 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/platform/browser/classes/URLSearchParams.mjs +5 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/platform/browser/index.mjs +15 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/platform/common/utils.mjs +15 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/platform/index.mjs +9 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/utils.mjs +364 -0
- package/es/node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/composables/use-tab-status.mjs +4 -2
- package/es/node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/list/List.mjs +145 -0
- package/es/node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/list/index.mjs +8 -0
- package/es/packages/mobile/index.mjs +2 -0
- package/es/packages/mobile/src/axios/config.mjs +105 -0
- package/es/packages/mobile/src/axios/index.mjs +11 -0
- package/es/packages/mobile/src/components/all.mjs +2 -0
- package/es/packages/mobile/src/components/dataDisplay/list/List.vue.mjs +100 -0
- package/es/packages/mobile/src/components/dataDisplay/list/index.mjs +7 -0
- package/es/packages/mobile/src/components/form/field/Field.vue.mjs +6 -2
- package/es/packages/mobile/src/components/form/fieldCalendarPicker/FieldCalendarPicker.vue.mjs +22 -7
- package/es/packages/mobile/src/components/form/fieldCascaderPicker/fieldCascaderPicker.vue.mjs +27 -9
- package/es/packages/mobile/src/components/form/fieldCheckbox/FieldCheckbox.vue.mjs +14 -3
- package/es/packages/mobile/src/components/form/fieldDatePicker/FieldDatePicker.vue.mjs +24 -9
- package/es/packages/mobile/src/components/form/fieldPicker/FieldPicker.vue.mjs +23 -8
- package/es/packages/mobile/src/components/form/fieldTimePicker/FieldTimePicker.vue.mjs +24 -9
- package/es/packages/mobile/src/utils/dataSourceUtil.mjs +71 -0
- package/lib/mobile.css +7 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/index.js +38 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/adapters/adapters.js +60 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/adapters/fetch.js +174 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/adapters/xhr.js +138 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/axios.js +50 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/cancel/CancelToken.js +99 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/cancel/CanceledError.js +12 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/cancel/isCancel.js +6 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/core/Axios.js +181 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/core/AxiosError.js +76 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/core/AxiosHeaders.js +223 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/core/InterceptorManager.js +65 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/core/buildFullPath.js +12 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/core/dispatchRequest.js +52 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/core/mergeConfig.js +83 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/core/settle.js +18 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/core/transformData.js +17 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/defaults/index.js +116 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/defaults/transitional.js +8 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/env/data.js +4 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/helpers/AxiosURLSearchParams.js +34 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/helpers/HttpStatusCode.js +71 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/helpers/bind.js +8 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/helpers/buildURL.js +34 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/helpers/combineURLs.js +6 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/helpers/composeSignals.js +39 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/helpers/cookies.js +36 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/helpers/formDataToJSON.js +54 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/helpers/isAbsoluteURL.js +6 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/helpers/isAxiosError.js +7 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/helpers/isURLSameOrigin.js +11 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/helpers/null.js +4 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/helpers/parseHeaders.js +47 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/helpers/parseProtocol.js +7 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/helpers/progressEventReducer.js +41 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/helpers/resolveConfig.js +42 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/helpers/speedometer.js +36 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/helpers/spread.js +8 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/helpers/throttle.js +35 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/helpers/toFormData.js +114 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/helpers/toURLEncodedForm.js +17 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/helpers/trackStream.js +80 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/helpers/validator.js +67 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/platform/browser/classes/Blob.js +4 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/platform/browser/classes/FormData.js +4 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/platform/browser/classes/URLSearchParams.js +5 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/platform/browser/index.js +15 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/platform/common/utils.js +15 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/platform/index.js +9 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/utils.js +364 -0
- package/lib/node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/composables/use-tab-status.js +3 -1
- package/lib/node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/list/List.js +145 -0
- package/lib/node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/list/index.js +7 -0
- package/lib/packages/mobile/index.js +92 -90
- package/lib/packages/mobile/src/axios/config.js +105 -0
- package/lib/packages/mobile/src/axios/index.js +11 -0
- package/lib/packages/mobile/src/components/all.js +92 -90
- package/lib/packages/mobile/src/components/dataDisplay/list/List.vue.js +100 -0
- package/lib/packages/mobile/src/components/dataDisplay/list/index.js +7 -0
- package/lib/packages/mobile/src/components/form/field/Field.vue.js +5 -1
- package/lib/packages/mobile/src/components/form/fieldCalendarPicker/FieldCalendarPicker.vue.js +21 -6
- package/lib/packages/mobile/src/components/form/fieldCascaderPicker/fieldCascaderPicker.vue.js +26 -8
- package/lib/packages/mobile/src/components/form/fieldCheckbox/FieldCheckbox.vue.js +13 -2
- package/lib/packages/mobile/src/components/form/fieldDatePicker/FieldDatePicker.vue.js +23 -8
- package/lib/packages/mobile/src/components/form/fieldPicker/FieldPicker.vue.js +22 -7
- package/lib/packages/mobile/src/components/form/fieldTimePicker/FieldTimePicker.vue.js +23 -8
- package/lib/packages/mobile/src/utils/dataSourceUtil.js +71 -0
- package/package.json +1 -1
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
|
+
function speedometer(samplesCount, min) {
|
|
4
|
+
samplesCount = samplesCount || 10;
|
|
5
|
+
const bytes = new Array(samplesCount);
|
|
6
|
+
const timestamps = new Array(samplesCount);
|
|
7
|
+
let head = 0;
|
|
8
|
+
let tail = 0;
|
|
9
|
+
let firstSampleTS;
|
|
10
|
+
min = min !== void 0 ? min : 1e3;
|
|
11
|
+
return function push(chunkLength) {
|
|
12
|
+
const now = Date.now();
|
|
13
|
+
const startedAt = timestamps[tail];
|
|
14
|
+
if (!firstSampleTS) {
|
|
15
|
+
firstSampleTS = now;
|
|
16
|
+
}
|
|
17
|
+
bytes[head] = chunkLength;
|
|
18
|
+
timestamps[head] = now;
|
|
19
|
+
let i = tail;
|
|
20
|
+
let bytesCount = 0;
|
|
21
|
+
while (i !== head) {
|
|
22
|
+
bytesCount += bytes[i++];
|
|
23
|
+
i = i % samplesCount;
|
|
24
|
+
}
|
|
25
|
+
head = (head + 1) % samplesCount;
|
|
26
|
+
if (head === tail) {
|
|
27
|
+
tail = (tail + 1) % samplesCount;
|
|
28
|
+
}
|
|
29
|
+
if (now - firstSampleTS < min) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
const passed = startedAt && now - startedAt;
|
|
33
|
+
return passed ? Math.round(bytesCount * 1e3 / passed) : void 0;
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
exports.default = speedometer;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
|
+
function throttle(fn, freq) {
|
|
4
|
+
let timestamp = 0;
|
|
5
|
+
let threshold = 1e3 / freq;
|
|
6
|
+
let lastArgs;
|
|
7
|
+
let timer;
|
|
8
|
+
const invoke = (args, now = Date.now()) => {
|
|
9
|
+
timestamp = now;
|
|
10
|
+
lastArgs = null;
|
|
11
|
+
if (timer) {
|
|
12
|
+
clearTimeout(timer);
|
|
13
|
+
timer = null;
|
|
14
|
+
}
|
|
15
|
+
fn.apply(null, args);
|
|
16
|
+
};
|
|
17
|
+
const throttled = (...args) => {
|
|
18
|
+
const now = Date.now();
|
|
19
|
+
const passed = now - timestamp;
|
|
20
|
+
if (passed >= threshold) {
|
|
21
|
+
invoke(args, now);
|
|
22
|
+
} else {
|
|
23
|
+
lastArgs = args;
|
|
24
|
+
if (!timer) {
|
|
25
|
+
timer = setTimeout(() => {
|
|
26
|
+
timer = null;
|
|
27
|
+
invoke(lastArgs);
|
|
28
|
+
}, threshold - passed);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
const flush = () => lastArgs && invoke(lastArgs);
|
|
33
|
+
return [throttled, flush];
|
|
34
|
+
}
|
|
35
|
+
exports.default = throttle;
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
|
+
const utils = require("../utils.js");
|
|
4
|
+
const AxiosError = require("../core/AxiosError.js");
|
|
5
|
+
function isVisitable(thing) {
|
|
6
|
+
return utils.default.isPlainObject(thing) || utils.default.isArray(thing);
|
|
7
|
+
}
|
|
8
|
+
function removeBrackets(key) {
|
|
9
|
+
return utils.default.endsWith(key, "[]") ? key.slice(0, -2) : key;
|
|
10
|
+
}
|
|
11
|
+
function renderKey(path, key, dots) {
|
|
12
|
+
if (!path) return key;
|
|
13
|
+
return path.concat(key).map(function each(token, i) {
|
|
14
|
+
token = removeBrackets(token);
|
|
15
|
+
return !dots && i ? "[" + token + "]" : token;
|
|
16
|
+
}).join(dots ? "." : "");
|
|
17
|
+
}
|
|
18
|
+
function isFlatArray(arr) {
|
|
19
|
+
return utils.default.isArray(arr) && !arr.some(isVisitable);
|
|
20
|
+
}
|
|
21
|
+
const predicates = utils.default.toFlatObject(utils.default, {}, null, function filter(prop) {
|
|
22
|
+
return /^is[A-Z]/.test(prop);
|
|
23
|
+
});
|
|
24
|
+
function toFormData(obj, formData, options) {
|
|
25
|
+
if (!utils.default.isObject(obj)) {
|
|
26
|
+
throw new TypeError("target must be an object");
|
|
27
|
+
}
|
|
28
|
+
formData = formData || new FormData();
|
|
29
|
+
options = utils.default.toFlatObject(options, {
|
|
30
|
+
metaTokens: true,
|
|
31
|
+
dots: false,
|
|
32
|
+
indexes: false
|
|
33
|
+
}, false, function defined(option, source) {
|
|
34
|
+
return !utils.default.isUndefined(source[option]);
|
|
35
|
+
});
|
|
36
|
+
const metaTokens = options.metaTokens;
|
|
37
|
+
const visitor = options.visitor || defaultVisitor;
|
|
38
|
+
const dots = options.dots;
|
|
39
|
+
const indexes = options.indexes;
|
|
40
|
+
const _Blob = options.Blob || typeof Blob !== "undefined" && Blob;
|
|
41
|
+
const useBlob = _Blob && utils.default.isSpecCompliantForm(formData);
|
|
42
|
+
if (!utils.default.isFunction(visitor)) {
|
|
43
|
+
throw new TypeError("visitor must be a function");
|
|
44
|
+
}
|
|
45
|
+
function convertValue(value) {
|
|
46
|
+
if (value === null) return "";
|
|
47
|
+
if (utils.default.isDate(value)) {
|
|
48
|
+
return value.toISOString();
|
|
49
|
+
}
|
|
50
|
+
if (!useBlob && utils.default.isBlob(value)) {
|
|
51
|
+
throw new AxiosError.default("Blob is not supported. Use a Buffer instead.");
|
|
52
|
+
}
|
|
53
|
+
if (utils.default.isArrayBuffer(value) || utils.default.isTypedArray(value)) {
|
|
54
|
+
return useBlob && typeof Blob === "function" ? new Blob([value]) : Buffer.from(value);
|
|
55
|
+
}
|
|
56
|
+
return value;
|
|
57
|
+
}
|
|
58
|
+
function defaultVisitor(value, key, path) {
|
|
59
|
+
let arr = value;
|
|
60
|
+
if (value && !path && typeof value === "object") {
|
|
61
|
+
if (utils.default.endsWith(key, "{}")) {
|
|
62
|
+
key = metaTokens ? key : key.slice(0, -2);
|
|
63
|
+
value = JSON.stringify(value);
|
|
64
|
+
} else if (utils.default.isArray(value) && isFlatArray(value) || (utils.default.isFileList(value) || utils.default.endsWith(key, "[]")) && (arr = utils.default.toArray(value))) {
|
|
65
|
+
key = removeBrackets(key);
|
|
66
|
+
arr.forEach(function each(el, index) {
|
|
67
|
+
!(utils.default.isUndefined(el) || el === null) && formData.append(
|
|
68
|
+
// eslint-disable-next-line no-nested-ternary
|
|
69
|
+
indexes === true ? renderKey([key], index, dots) : indexes === null ? key : key + "[]",
|
|
70
|
+
convertValue(el)
|
|
71
|
+
);
|
|
72
|
+
});
|
|
73
|
+
return false;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
if (isVisitable(value)) {
|
|
77
|
+
return true;
|
|
78
|
+
}
|
|
79
|
+
formData.append(renderKey(path, key, dots), convertValue(value));
|
|
80
|
+
return false;
|
|
81
|
+
}
|
|
82
|
+
const stack = [];
|
|
83
|
+
const exposedHelpers = Object.assign(predicates, {
|
|
84
|
+
defaultVisitor,
|
|
85
|
+
convertValue,
|
|
86
|
+
isVisitable
|
|
87
|
+
});
|
|
88
|
+
function build(value, path) {
|
|
89
|
+
if (utils.default.isUndefined(value)) return;
|
|
90
|
+
if (stack.indexOf(value) !== -1) {
|
|
91
|
+
throw Error("Circular reference detected in " + path.join("."));
|
|
92
|
+
}
|
|
93
|
+
stack.push(value);
|
|
94
|
+
utils.default.forEach(value, function each(el, key) {
|
|
95
|
+
const result = !(utils.default.isUndefined(el) || el === null) && visitor.call(
|
|
96
|
+
formData,
|
|
97
|
+
el,
|
|
98
|
+
utils.default.isString(key) ? key.trim() : key,
|
|
99
|
+
path,
|
|
100
|
+
exposedHelpers
|
|
101
|
+
);
|
|
102
|
+
if (result === true) {
|
|
103
|
+
build(el, path ? path.concat(key) : [key]);
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
stack.pop();
|
|
107
|
+
}
|
|
108
|
+
if (!utils.default.isObject(obj)) {
|
|
109
|
+
throw new TypeError("data must be an object");
|
|
110
|
+
}
|
|
111
|
+
build(obj);
|
|
112
|
+
return formData;
|
|
113
|
+
}
|
|
114
|
+
exports.default = toFormData;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
|
+
const utils = require("../utils.js");
|
|
4
|
+
const toFormData = require("./toFormData.js");
|
|
5
|
+
const index = require("../platform/index.js");
|
|
6
|
+
function toURLEncodedForm(data, options) {
|
|
7
|
+
return toFormData.default(data, new index.default.classes.URLSearchParams(), Object.assign({
|
|
8
|
+
visitor: function(value, key, path, helpers) {
|
|
9
|
+
if (index.default.isNode && utils.default.isBuffer(value)) {
|
|
10
|
+
this.append(key, value.toString("base64"));
|
|
11
|
+
return false;
|
|
12
|
+
}
|
|
13
|
+
return helpers.defaultVisitor.apply(this, arguments);
|
|
14
|
+
}
|
|
15
|
+
}, options));
|
|
16
|
+
}
|
|
17
|
+
exports.default = toURLEncodedForm;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const streamChunk = function* (chunk, chunkSize) {
|
|
4
|
+
let len = chunk.byteLength;
|
|
5
|
+
if (len < chunkSize) {
|
|
6
|
+
yield chunk;
|
|
7
|
+
return;
|
|
8
|
+
}
|
|
9
|
+
let pos = 0;
|
|
10
|
+
let end;
|
|
11
|
+
while (pos < len) {
|
|
12
|
+
end = pos + chunkSize;
|
|
13
|
+
yield chunk.slice(pos, end);
|
|
14
|
+
pos = end;
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
const readBytes = async function* (iterable, chunkSize) {
|
|
18
|
+
for await (const chunk of readStream(iterable)) {
|
|
19
|
+
yield* streamChunk(chunk, chunkSize);
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
const readStream = async function* (stream) {
|
|
23
|
+
if (stream[Symbol.asyncIterator]) {
|
|
24
|
+
yield* stream;
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
const reader = stream.getReader();
|
|
28
|
+
try {
|
|
29
|
+
for (; ; ) {
|
|
30
|
+
const { done, value } = await reader.read();
|
|
31
|
+
if (done) {
|
|
32
|
+
break;
|
|
33
|
+
}
|
|
34
|
+
yield value;
|
|
35
|
+
}
|
|
36
|
+
} finally {
|
|
37
|
+
await reader.cancel();
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
const trackStream = (stream, chunkSize, onProgress, onFinish) => {
|
|
41
|
+
const iterator = readBytes(stream, chunkSize);
|
|
42
|
+
let bytes = 0;
|
|
43
|
+
let done;
|
|
44
|
+
let _onFinish = (e) => {
|
|
45
|
+
if (!done) {
|
|
46
|
+
done = true;
|
|
47
|
+
onFinish && onFinish(e);
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
return new ReadableStream({
|
|
51
|
+
async pull(controller) {
|
|
52
|
+
try {
|
|
53
|
+
const { done: done2, value } = await iterator.next();
|
|
54
|
+
if (done2) {
|
|
55
|
+
_onFinish();
|
|
56
|
+
controller.close();
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
let len = value.byteLength;
|
|
60
|
+
if (onProgress) {
|
|
61
|
+
let loadedBytes = bytes += len;
|
|
62
|
+
onProgress(loadedBytes);
|
|
63
|
+
}
|
|
64
|
+
controller.enqueue(new Uint8Array(value));
|
|
65
|
+
} catch (err) {
|
|
66
|
+
_onFinish(err);
|
|
67
|
+
throw err;
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
cancel(reason) {
|
|
71
|
+
_onFinish(reason);
|
|
72
|
+
return iterator.return();
|
|
73
|
+
}
|
|
74
|
+
}, {
|
|
75
|
+
highWaterMark: 2
|
|
76
|
+
});
|
|
77
|
+
};
|
|
78
|
+
exports.readBytes = readBytes;
|
|
79
|
+
exports.streamChunk = streamChunk;
|
|
80
|
+
exports.trackStream = trackStream;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
|
+
const data = require("../env/data.js");
|
|
4
|
+
const AxiosError = require("../core/AxiosError.js");
|
|
5
|
+
const validators = {};
|
|
6
|
+
["object", "boolean", "number", "function", "string", "symbol"].forEach((type, i) => {
|
|
7
|
+
validators[type] = function validator2(thing) {
|
|
8
|
+
return typeof thing === type || "a" + (i < 1 ? "n " : " ") + type;
|
|
9
|
+
};
|
|
10
|
+
});
|
|
11
|
+
const deprecatedWarnings = {};
|
|
12
|
+
validators.transitional = function transitional(validator2, version, message) {
|
|
13
|
+
function formatMessage(opt, desc) {
|
|
14
|
+
return "[Axios v" + data.VERSION + "] Transitional option '" + opt + "'" + desc + (message ? ". " + message : "");
|
|
15
|
+
}
|
|
16
|
+
return (value, opt, opts) => {
|
|
17
|
+
if (validator2 === false) {
|
|
18
|
+
throw new AxiosError.default(
|
|
19
|
+
formatMessage(opt, " has been removed" + (version ? " in " + version : "")),
|
|
20
|
+
AxiosError.default.ERR_DEPRECATED
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
if (version && !deprecatedWarnings[opt]) {
|
|
24
|
+
deprecatedWarnings[opt] = true;
|
|
25
|
+
console.warn(
|
|
26
|
+
formatMessage(
|
|
27
|
+
opt,
|
|
28
|
+
" has been deprecated since v" + version + " and will be removed in the near future"
|
|
29
|
+
)
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
return validator2 ? validator2(value, opt, opts) : true;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
validators.spelling = function spelling(correctSpelling) {
|
|
36
|
+
return (value, opt) => {
|
|
37
|
+
console.warn(`${opt} is likely a misspelling of ${correctSpelling}`);
|
|
38
|
+
return true;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
function assertOptions(options, schema, allowUnknown) {
|
|
42
|
+
if (typeof options !== "object") {
|
|
43
|
+
throw new AxiosError.default("options must be an object", AxiosError.default.ERR_BAD_OPTION_VALUE);
|
|
44
|
+
}
|
|
45
|
+
const keys = Object.keys(options);
|
|
46
|
+
let i = keys.length;
|
|
47
|
+
while (i-- > 0) {
|
|
48
|
+
const opt = keys[i];
|
|
49
|
+
const validator2 = schema[opt];
|
|
50
|
+
if (validator2) {
|
|
51
|
+
const value = options[opt];
|
|
52
|
+
const result = value === void 0 || validator2(value, opt, options);
|
|
53
|
+
if (result !== true) {
|
|
54
|
+
throw new AxiosError.default("option " + opt + " must be " + result, AxiosError.default.ERR_BAD_OPTION_VALUE);
|
|
55
|
+
}
|
|
56
|
+
continue;
|
|
57
|
+
}
|
|
58
|
+
if (allowUnknown !== true) {
|
|
59
|
+
throw new AxiosError.default("Unknown option " + opt, AxiosError.default.ERR_BAD_OPTION);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
const validator = {
|
|
64
|
+
assertOptions,
|
|
65
|
+
validators
|
|
66
|
+
};
|
|
67
|
+
exports.default = validator;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
|
+
const AxiosURLSearchParams = require("../../../helpers/AxiosURLSearchParams.js");
|
|
4
|
+
const URLSearchParams$1 = typeof URLSearchParams !== "undefined" ? URLSearchParams : AxiosURLSearchParams.default;
|
|
5
|
+
exports.default = URLSearchParams$1;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
|
+
const URLSearchParams = require("./classes/URLSearchParams.js");
|
|
4
|
+
const FormData = require("./classes/FormData.js");
|
|
5
|
+
const Blob = require("./classes/Blob.js");
|
|
6
|
+
const platform = {
|
|
7
|
+
isBrowser: true,
|
|
8
|
+
classes: {
|
|
9
|
+
URLSearchParams: URLSearchParams.default,
|
|
10
|
+
FormData: FormData.default,
|
|
11
|
+
Blob: Blob.default
|
|
12
|
+
},
|
|
13
|
+
protocols: ["http", "https", "file", "blob", "url", "data"]
|
|
14
|
+
};
|
|
15
|
+
exports.default = platform;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const hasBrowserEnv = typeof window !== "undefined" && typeof document !== "undefined";
|
|
4
|
+
const _navigator = typeof navigator === "object" && navigator || void 0;
|
|
5
|
+
const hasStandardBrowserEnv = hasBrowserEnv && (!_navigator || ["ReactNative", "NativeScript", "NS"].indexOf(_navigator.product) < 0);
|
|
6
|
+
const hasStandardBrowserWebWorkerEnv = (() => {
|
|
7
|
+
return typeof WorkerGlobalScope !== "undefined" && // eslint-disable-next-line no-undef
|
|
8
|
+
self instanceof WorkerGlobalScope && typeof self.importScripts === "function";
|
|
9
|
+
})();
|
|
10
|
+
const origin = hasBrowserEnv && window.location.href || "http://localhost";
|
|
11
|
+
exports.hasBrowserEnv = hasBrowserEnv;
|
|
12
|
+
exports.hasStandardBrowserEnv = hasStandardBrowserEnv;
|
|
13
|
+
exports.hasStandardBrowserWebWorkerEnv = hasStandardBrowserWebWorkerEnv;
|
|
14
|
+
exports.navigator = _navigator;
|
|
15
|
+
exports.origin = origin;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
|
+
const index = require("./browser/index.js");
|
|
4
|
+
const utils = require("./common/utils.js");
|
|
5
|
+
const platform = {
|
|
6
|
+
...utils,
|
|
7
|
+
...index.default
|
|
8
|
+
};
|
|
9
|
+
exports.default = platform;
|