@whitesev/utils 2.5.1 → 2.5.3
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/index.amd.js +12 -6
- package/dist/index.amd.js.map +1 -1
- package/dist/index.cjs.js +12 -6
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +12 -6
- package/dist/index.esm.js.map +1 -1
- package/dist/index.iife.js +12 -6
- package/dist/index.iife.js.map +1 -1
- package/dist/index.system.js +12 -6
- package/dist/index.system.js.map +1 -1
- package/dist/index.umd.js +12 -6
- package/dist/index.umd.js.map +1 -1
- package/dist/types/src/Utils.d.ts +1 -1
- package/package.json +1 -1
- package/src/Utils.ts +14 -7
package/dist/index.iife.js
CHANGED
|
@@ -4111,7 +4111,7 @@ var Utils = (function () {
|
|
|
4111
4111
|
this.windowApi = new WindowApi(option);
|
|
4112
4112
|
}
|
|
4113
4113
|
/** 版本号 */
|
|
4114
|
-
version = "2024.11.
|
|
4114
|
+
version = "2024.11.16";
|
|
4115
4115
|
addStyle(cssText) {
|
|
4116
4116
|
if (typeof cssText !== "string") {
|
|
4117
4117
|
throw new Error("Utils.addStyle 参数cssText 必须为String类型");
|
|
@@ -4292,9 +4292,17 @@ var Utils = (function () {
|
|
|
4292
4292
|
return false;
|
|
4293
4293
|
}
|
|
4294
4294
|
}
|
|
4295
|
-
|
|
4295
|
+
/**
|
|
4296
|
+
* 复制formData数据
|
|
4297
|
+
* @param formData 需要clone的数据
|
|
4298
|
+
*/
|
|
4299
|
+
cloneFormData(formData, filterFn) {
|
|
4296
4300
|
let clonedFormData = new FormData();
|
|
4297
4301
|
for (let [key, value] of formData.entries()) {
|
|
4302
|
+
let isFilter = typeof filterFn === "function" ? filterFn(key, value) : false;
|
|
4303
|
+
if (typeof isFilter === "boolean" && isFilter) {
|
|
4304
|
+
continue;
|
|
4305
|
+
}
|
|
4298
4306
|
clonedFormData.append(key, value);
|
|
4299
4307
|
}
|
|
4300
4308
|
return clonedFormData;
|
|
@@ -4821,9 +4829,7 @@ var Utils = (function () {
|
|
|
4821
4829
|
getMaxZIndexNodeInfo(deviation = 1, target = this.windowApi.document, ignoreCallBack) {
|
|
4822
4830
|
deviation = Number.isNaN(deviation) ? 1 : deviation;
|
|
4823
4831
|
const UtilsContext = this;
|
|
4824
|
-
//
|
|
4825
|
-
const maxZIndex = Math.pow(2, 31) - 1;
|
|
4826
|
-
// 比较值2000000000
|
|
4832
|
+
// 比较值 2000000000
|
|
4827
4833
|
const maxZIndexCompare = 2 * Math.pow(10, 9);
|
|
4828
4834
|
// 当前页面最大的z-index
|
|
4829
4835
|
let zIndex = 0;
|
|
@@ -4875,7 +4881,7 @@ var Utils = (function () {
|
|
|
4875
4881
|
zIndex += deviation;
|
|
4876
4882
|
if (zIndex >= maxZIndexCompare) {
|
|
4877
4883
|
// 最好不要超过最大值
|
|
4878
|
-
zIndex =
|
|
4884
|
+
zIndex = maxZIndexCompare;
|
|
4879
4885
|
}
|
|
4880
4886
|
return {
|
|
4881
4887
|
node: maxZIndexNode,
|