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