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