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