@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.esm.js
CHANGED
|
@@ -4108,7 +4108,7 @@ class Utils {
|
|
|
4108
4108
|
this.windowApi = new WindowApi(option);
|
|
4109
4109
|
}
|
|
4110
4110
|
/** 版本号 */
|
|
4111
|
-
version = "2024.11.
|
|
4111
|
+
version = "2024.11.16";
|
|
4112
4112
|
addStyle(cssText) {
|
|
4113
4113
|
if (typeof cssText !== "string") {
|
|
4114
4114
|
throw new Error("Utils.addStyle 参数cssText 必须为String类型");
|
|
@@ -4289,9 +4289,17 @@ class Utils {
|
|
|
4289
4289
|
return false;
|
|
4290
4290
|
}
|
|
4291
4291
|
}
|
|
4292
|
-
|
|
4292
|
+
/**
|
|
4293
|
+
* 复制formData数据
|
|
4294
|
+
* @param formData 需要clone的数据
|
|
4295
|
+
*/
|
|
4296
|
+
cloneFormData(formData, filterFn) {
|
|
4293
4297
|
let clonedFormData = new FormData();
|
|
4294
4298
|
for (let [key, value] of formData.entries()) {
|
|
4299
|
+
let isFilter = typeof filterFn === "function" ? filterFn(key, value) : false;
|
|
4300
|
+
if (typeof isFilter === "boolean" && isFilter) {
|
|
4301
|
+
continue;
|
|
4302
|
+
}
|
|
4295
4303
|
clonedFormData.append(key, value);
|
|
4296
4304
|
}
|
|
4297
4305
|
return clonedFormData;
|
|
@@ -4818,9 +4826,7 @@ class Utils {
|
|
|
4818
4826
|
getMaxZIndexNodeInfo(deviation = 1, target = this.windowApi.document, ignoreCallBack) {
|
|
4819
4827
|
deviation = Number.isNaN(deviation) ? 1 : deviation;
|
|
4820
4828
|
const UtilsContext = this;
|
|
4821
|
-
//
|
|
4822
|
-
const maxZIndex = Math.pow(2, 31) - 1;
|
|
4823
|
-
// 比较值2000000000
|
|
4829
|
+
// 比较值 2000000000
|
|
4824
4830
|
const maxZIndexCompare = 2 * Math.pow(10, 9);
|
|
4825
4831
|
// 当前页面最大的z-index
|
|
4826
4832
|
let zIndex = 0;
|
|
@@ -4872,7 +4878,7 @@ class Utils {
|
|
|
4872
4878
|
zIndex += deviation;
|
|
4873
4879
|
if (zIndex >= maxZIndexCompare) {
|
|
4874
4880
|
// 最好不要超过最大值
|
|
4875
|
-
zIndex =
|
|
4881
|
+
zIndex = maxZIndexCompare;
|
|
4876
4882
|
}
|
|
4877
4883
|
return {
|
|
4878
4884
|
node: maxZIndexNode,
|