@xxlabs/antd-plus 1.5.1 → 1.5.2

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.
Files changed (3) hide show
  1. package/dist/index.d.ts +128 -126
  2. package/dist/index.js +94 -92
  3. package/package.json +9 -8
package/dist/index.js CHANGED
@@ -3,24 +3,24 @@ import { clsx } from "clsx";
3
3
  import { Children, Component, Fragment, cloneElement, createContext, createElement, createRef, forwardRef, isValidElement, memo, useCallback, useContext, useEffect, useEffectEvent, useImperativeHandle, useLayoutEffect, useMemo, useRef, useState } from "react";
4
4
  import { c } from "react/compiler-runtime";
5
5
  import { Keyframes, useCacheToken, useStyleRegister } from "@ant-design/cssinjs";
6
- import zh_CN from "antd/es/locale/zh_CN";
6
+ import zh_CN from "antd/es/locale/zh_CN.js";
7
7
  import dayjs from "dayjs";
8
- import "dayjs/locale/zh-cn";
8
+ import "dayjs/locale/zh-cn.js";
9
9
  import useSWR, { SWRConfig, useSWRConfig } from "swr";
10
10
  import { get, merge as merge$1, omit, set, toArray, useMergedState, useMergedState as useMergedState$1, warning } from "@rc-component/util";
11
11
  import { TinyColor } from "@ctrl/tinycolor";
12
12
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
13
13
  import { ArrowDownOutlined, ArrowLeftOutlined, ArrowRightOutlined, ArrowUpOutlined, CheckOutlined, CloseCircleFilled, CloseOutlined, ColumnHeightOutlined, CopyOutlined, CopyrightOutlined, DeleteOutlined, DownOutlined, EditOutlined, EllipsisOutlined, EyeInvisibleOutlined, EyeOutlined, FilterOutlined, FullscreenExitOutlined, FullscreenOutlined, HolderOutlined, InboxOutlined, InfoCircleOutlined, LoadingOutlined, MenuOutlined, NotificationOutlined, PlusOutlined, ProfileOutlined, QuestionCircleOutlined, ReloadOutlined, RightOutlined, SearchOutlined, SettingOutlined, UploadOutlined, VerticalAlignBottomOutlined, VerticalAlignMiddleOutlined, VerticalAlignTopOutlined, createFromIconfontCN } from "@ant-design/icons";
14
- import quarterOfYear from "dayjs/plugin/quarterOfYear";
15
- import customParseFormat from "dayjs/plugin/customParseFormat";
14
+ import quarterOfYear from "dayjs/plugin/quarterOfYear.js";
15
+ import customParseFormat from "dayjs/plugin/customParseFormat.js";
16
16
  import { configure } from "safe-stable-stringify";
17
- import useLazyKVMap from "antd/es/table/hooks/useLazyKVMap";
18
- import advancedFormat from "dayjs/plugin/advancedFormat";
19
- import isoWeek from "dayjs/plugin/isoWeek";
20
- import localeData from "dayjs/plugin/localeData";
21
- import weekday from "dayjs/plugin/weekday";
22
- import weekOfYear from "dayjs/plugin/weekOfYear";
23
- import relativeTime from "dayjs/plugin/relativeTime";
17
+ import useLazyKVMap from "antd/es/table/hooks/useLazyKVMap.js";
18
+ import advancedFormat from "dayjs/plugin/advancedFormat.js";
19
+ import isoWeek from "dayjs/plugin/isoWeek.js";
20
+ import localeData from "dayjs/plugin/localeData.js";
21
+ import weekday from "dayjs/plugin/weekday.js";
22
+ import weekOfYear from "dayjs/plugin/weekOfYear.js";
23
+ import relativeTime from "dayjs/plugin/relativeTime.js";
24
24
  import { FieldContext as FieldContext$1 } from "@rc-component/form";
25
25
  import { isEmpty, isEqual, merge as merge$2 } from "es-toolkit/compat";
26
26
  import { useUrlSearchParams } from "@umijs/use-params";
@@ -32,8 +32,8 @@ import { DndContext, MouseSensor, PointerSensor, rectIntersection, useSensor, us
32
32
  import { restrictToVerticalAxis } from "@dnd-kit/modifiers";
33
33
  import { SortableContext, arrayMove, useSortable, verticalListSortingStrategy } from "@dnd-kit/sortable";
34
34
  import { CSS } from "@dnd-kit/utilities";
35
- import usePagination from "antd/es/table/hooks/usePagination";
36
- import useSelection from "antd/es/table/hooks/useSelection";
35
+ import usePagination from "antd/es/table/hooks/usePagination.js";
36
+ import useSelection from "antd/es/table/hooks/useSelection.js";
37
37
  //#region src/provider/locale/ar_EG.tsx
38
38
  var ar_EG_default = {
39
39
  moneySymbol: "$",
@@ -2253,7 +2253,7 @@ var zh_TW_default$1 = {
2253
2253
  */
2254
2254
  const createIntl = (locale, localeMap) => ({
2255
2255
  getMessage: (id, defaultMessage) => {
2256
- const msg = get(localeMap, id.replace(/\[(\d+)\]/g, ".$1").split(".")) || "";
2256
+ const msg = get(localeMap, id.replaceAll(/\[(\d+)\]/g, ".$1").split(".")) || "";
2257
2257
  if (msg) return msg;
2258
2258
  if (locale.replace("_", "-") === "zh-CN") return defaultMessage;
2259
2259
  const intl = intlMap["zh-CN"];
@@ -2522,7 +2522,7 @@ const omitUndefined$1 = (obj) => {
2522
2522
  Object.keys(obj || {}).forEach((key) => {
2523
2523
  if (obj[key] !== void 0) newObj[key] = obj[key];
2524
2524
  });
2525
- if (Object.keys(newObj).length < 1) return;
2525
+ if (Object.keys(newObj).length === 0) return;
2526
2526
  return newObj;
2527
2527
  };
2528
2528
  /**
@@ -2635,7 +2635,7 @@ const ConfigProviderContainer = (props) => {
2635
2635
  if (proProvide.hashed === false) return "";
2636
2636
  if (isNeedOpenHash() === false) return "";
2637
2637
  else if (tokenContext.hashId) return tokenContext.hashId;
2638
- else return nativeHashId;
2638
+ return nativeHashId;
2639
2639
  }, [
2640
2640
  nativeHashId,
2641
2641
  proProvide.hashed,
@@ -2721,7 +2721,7 @@ const ProConfigProvider = (props) => {
2721
2721
  rest = $[2];
2722
2722
  theme$1 = $[3];
2723
2723
  }
2724
- if (needDeps && proProvide.hashId !== void 0 && Object.keys(props).sort().join("-") === "children-needDeps") {
2724
+ if (needDeps && proProvide.hashId !== void 0 && Object.keys(props).toSorted().join("-") === "children-needDeps") {
2725
2725
  let t1;
2726
2726
  if ($[4] !== props.children) {
2727
2727
  t1 = /* @__PURE__ */ jsx(Fragment$1, { children: props.children });
@@ -2953,7 +2953,7 @@ const DropdownFooter = (props) => {
2953
2953
  return t12;
2954
2954
  };
2955
2955
  function _temp$32(e_0) {
2956
- return e_0.target.getAttribute("data-type") !== "confirm" && e_0.stopPropagation();
2956
+ return e_0.target.dataset.type !== "confirm" && e_0.stopPropagation();
2957
2957
  }
2958
2958
  //#endregion
2959
2959
  //#region src/utils/components/ErrorBoundary/index.tsx
@@ -3107,7 +3107,7 @@ const FieldLabelFunction = (props, ref) => {
3107
3107
  return Array.isArray(aValue) ? wrapElements(aValue) : aValue;
3108
3108
  };
3109
3109
  const getTextByValue = (aLabel, aValue_0) => {
3110
- if (aValue_0 !== void 0 && aValue_0 !== null && aValue_0 !== "" && (!Array.isArray(aValue_0) || aValue_0.length)) {
3110
+ if (aValue_0 !== void 0 && aValue_0 !== null && aValue_0 !== "" && (!Array.isArray(aValue_0) || aValue_0.length > 0)) {
3111
3111
  const prefix = aLabel ? /* @__PURE__ */ jsxs("span", {
3112
3112
  className: `${prefixCls}-text`,
3113
3113
  onClick: () => {
@@ -3424,7 +3424,7 @@ const InlineErrorFormItemPopover = (t0) => {
3424
3424
  } else t14 = $[27];
3425
3425
  const t15 = popoverProps?.getPopupContainer;
3426
3426
  const t16 = popoverProps?.getTooltipContainer;
3427
- const t17 = errorStringList.length < 1 ? false : open;
3427
+ const t17 = errorStringList.length === 0 ? false : open;
3428
3428
  const t18 = popoverProps?.placement || "topLeft";
3429
3429
  let t19;
3430
3430
  if ($[28] !== popoverProps?.trigger) {
@@ -3517,7 +3517,7 @@ const InternalFormItemFunction = (t0) => {
3517
3517
  if (shouldName.length > 1) shouldName.pop();
3518
3518
  try {
3519
3519
  return JSON.stringify(get(prev, shouldName)) !== JSON.stringify(get(next, shouldName));
3520
- } catch (t3) {
3520
+ } catch {
3521
3521
  return true;
3522
3522
  }
3523
3523
  };
@@ -3609,7 +3609,7 @@ const InlineErrorFormItem = (props) => {
3609
3609
  if (shouldName.length > 1) shouldName.pop();
3610
3610
  try {
3611
3611
  return JSON.stringify(get(prev, shouldName)) !== JSON.stringify(get(next, shouldName));
3612
- } catch (t1) {
3612
+ } catch {
3613
3613
  return true;
3614
3614
  }
3615
3615
  } : void 0;
@@ -4188,7 +4188,7 @@ const isNode = typeof process !== "undefined" && process.versions != null && pro
4188
4188
  */
4189
4189
  const isBrowser = () => {
4190
4190
  if (typeof process !== "undefined" && process.env.NODE_ENV === "TEST") return true;
4191
- return typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.matchMedia !== "undefined" && !isNode;
4191
+ return typeof window !== "undefined" && window.document !== void 0 && window.matchMedia !== void 0 && !isNode;
4192
4192
  };
4193
4193
  //#endregion
4194
4194
  //#region src/utils/hooks/useDocumentTitle/index.ts
@@ -4303,8 +4303,7 @@ function useForceRender() {
4303
4303
  //#region src/utils/hooks/useRefCallback/index.ts
4304
4304
  function useRefCallback(callback, initialValue) {
4305
4305
  const ref = useMemo(() => {
4306
- const defaultValue = { current: initialValue };
4307
- return new Proxy(defaultValue, { set(target, prop, newValue) {
4306
+ return new Proxy({ current: initialValue }, { set(target, prop, newValue) {
4308
4307
  if (!Object.is(target[prop], newValue)) {
4309
4308
  target[prop] = newValue;
4310
4309
  callback(ref);
@@ -4344,7 +4343,7 @@ const isUrl = (path) => {
4344
4343
  if (!path.startsWith("http")) return false;
4345
4344
  try {
4346
4345
  return !!new URL(path);
4347
- } catch (_error) {
4346
+ } catch {
4348
4347
  return false;
4349
4348
  }
4350
4349
  };
@@ -4387,7 +4386,7 @@ let genNanoid = (t = 21) => {
4387
4386
  */
4388
4387
  const nanoid = () => {
4389
4388
  if (typeof window === "undefined") return genNanoid();
4390
- if (window.crypto && window.crypto.randomUUID && typeof crypto.randomUUID == "function") return crypto.randomUUID();
4389
+ if (window.crypto && window.crypto.randomUUID && typeof crypto.randomUUID === "function") return crypto.randomUUID();
4391
4390
  return genNanoid();
4392
4391
  };
4393
4392
  //#endregion
@@ -4407,7 +4406,7 @@ const omitUndefined = (obj) => {
4407
4406
  Object.keys(obj || {}).forEach((key) => {
4408
4407
  if (obj[key] !== void 0) newObj[key] = obj[key];
4409
4408
  });
4410
- if (Object.keys(newObj).length < 1) return;
4409
+ if (Object.keys(newObj).length === 0) return;
4411
4410
  return newObj;
4412
4411
  };
4413
4412
  //#endregion
@@ -4690,7 +4689,7 @@ function processDotPathTransforms(result, dotPathTransforms) {
4690
4689
  const parentPath = pathArray.slice(0, -1);
4691
4690
  const parentObj = parentPath.length > 0 ? get(result, parentPath) : result;
4692
4691
  if (parentObj && typeof parentObj === "object") {
4693
- const keyToDelete = pathArray[pathArray.length - 1];
4692
+ const keyToDelete = pathArray.at(-1);
4694
4693
  delete parentObj[keyToDelete];
4695
4694
  Object.assign(parentObj, transformed);
4696
4695
  }
@@ -4704,7 +4703,7 @@ function processDotPathTransforms(result, dotPathTransforms) {
4704
4703
  }
4705
4704
  current = current[key];
4706
4705
  }
4707
- current[pathArray[pathArray.length - 1]] = transformed;
4706
+ current[pathArray.at(-1)] = transformed;
4708
4707
  }
4709
4708
  }
4710
4709
  }
@@ -4783,7 +4782,7 @@ function processNestedObjectTransforms(tempValues, parentsKey, currentTransforms
4783
4782
  */
4784
4783
  const transformKeySubmitValue = (values, dataFormatMapRaw) => {
4785
4784
  const dataFormatMap = filterNilTransforms(dataFormatMapRaw);
4786
- if (Object.keys(dataFormatMap).length < 1) return values;
4785
+ if (Object.keys(dataFormatMap).length === 0) return values;
4787
4786
  if (typeof window === "undefined") return values;
4788
4787
  if (typeof values !== "object" || isNil(values) || values instanceof Blob) return values;
4789
4788
  let result = JSON.parse(JSON.stringify(values));
@@ -4925,7 +4924,7 @@ function SaveEditableAction({ recordKey, onSave, row, children, newLineConfig, e
4925
4924
  const save = useRefFunction(async () => {
4926
4925
  try {
4927
4926
  const isMapEditor = editorType === "Map";
4928
- const namePath = [tableName, Array.isArray(recordKey) ? recordKey[0] : recordKey].map((key) => key?.toString()).flat(1).filter(Boolean);
4927
+ const namePath = [tableName, Array.isArray(recordKey) ? recordKey[0] : recordKey].flatMap((key) => key?.toString()).filter(Boolean);
4929
4928
  setLoading(true);
4930
4929
  try {
4931
4930
  await form.validateFields(namePath, { recursive: true });
@@ -6212,7 +6211,7 @@ const CheckCardGroup = (props) => {
6212
6211
  if (!hasOption) changeValue_0.push(option_0.value);
6213
6212
  if (hasOption) changeValue_0 = changeValue_0.filter((itemValue) => itemValue !== option_0.value);
6214
6213
  const newOptions = getOptions();
6215
- const newValue = changeValue_0?.filter((val) => registerValueMap.current.has(val))?.sort((a, b) => {
6214
+ const newValue = changeValue_0?.filter((val) => registerValueMap.current.has(val))?.toSorted((a, b) => {
6216
6215
  return newOptions.findIndex((opt) => opt.value === a) - newOptions.findIndex((opt_0) => opt_0.value === b);
6217
6216
  });
6218
6217
  setStateValue(newValue);
@@ -7761,10 +7760,10 @@ const Highlight$1 = ({ label, words }) => {
7761
7760
  }
7762
7761
  };
7763
7762
  });
7764
- const matchKeywordsRE = new RegExp(words.map((word) => word.replace(/[-[\]/{}()*+?.\\^$|]/g, "\\$&")).join("|"), "gi");
7763
+ const matchKeywordsRE = new RegExp(words.map((word) => word.replaceAll(/[-[\]/{}()*+?.\\^$|]/g, "\\$&")).join("|"), "gi");
7765
7764
  let matchText = label;
7766
7765
  const elements = [];
7767
- while (matchText.length) {
7766
+ while (matchText.length > 0) {
7768
7767
  const match = matchKeywordsRE.exec(matchText);
7769
7768
  if (!match) {
7770
7769
  elements.push(matchText);
@@ -8550,7 +8549,7 @@ dayjs.extend(weekOfYear);
8550
8549
  const formatDate = (text, format) => {
8551
8550
  if (!text) return "-";
8552
8551
  if (typeof format === "function") return format(dayjs(text));
8553
- else return dayjs(text).format((Array.isArray(format) ? format[0] : format) || "YYYY-MM-DD");
8552
+ return dayjs(text).format((Array.isArray(format) ? format[0] : format) || "YYYY-MM-DD");
8554
8553
  };
8555
8554
  /**
8556
8555
  * 日期选择组件
@@ -9345,7 +9344,7 @@ const intlMap$1 = {
9345
9344
  * @returns A function that takes in 4 parameters and returns a string.
9346
9345
  */
9347
9346
  const getTextByLocale = (locale, paramsText, precision, config, moneySymbol = "") => {
9348
- let moneyText = paramsText?.toString().replace(/,/g, "");
9347
+ let moneyText = paramsText?.toString().replaceAll(",", "");
9349
9348
  if (typeof moneyText === "string") {
9350
9349
  const parsedNum = Number(moneyText);
9351
9350
  if (Number.isNaN(parsedNum)) return moneyText;
@@ -9369,7 +9368,8 @@ const getTextByLocale = (locale, paramsText, precision, config, moneySymbol = ""
9369
9368
  if (match) {
9370
9369
  const number = match[0];
9371
9370
  return Text.slice(Text.indexOf(number));
9372
- } else return Text;
9371
+ }
9372
+ return Text;
9373
9373
  };
9374
9374
  const pureMoneyText = doubleSymbolFormat(finalMoneyText);
9375
9375
  /**
@@ -9378,7 +9378,7 @@ const getTextByLocale = (locale, paramsText, precision, config, moneySymbol = ""
9378
9378
  const [operatorSymbol] = finalMoneyText || "";
9379
9379
  if (["+", "-"].includes(operatorSymbol)) return `${moneySymbol || ""}${operatorSymbol}${pureMoneyText}`;
9380
9380
  return `${moneySymbol || ""}${pureMoneyText}`;
9381
- } catch (_error) {
9381
+ } catch {
9382
9382
  return moneyText;
9383
9383
  }
9384
9384
  };
@@ -9540,7 +9540,7 @@ const FieldMoney = ({ text, mode: type, render, formItemRender, fieldProps, proF
9540
9540
  return value_0?.toString() || value_0;
9541
9541
  },
9542
9542
  parser: (value_1) => {
9543
- if (moneySymbol && value_1) return value_1.replace(new RegExp(`\\${moneySymbol}\\s?|(,*)`, "g"), "");
9543
+ if (moneySymbol && value_1) return value_1.replaceAll(new RegExp(`\\${moneySymbol}\\s?|(,*)`, "g"), "");
9544
9544
  return value_1;
9545
9545
  },
9546
9546
  placeholder: placeholderValue,
@@ -9556,7 +9556,7 @@ const FieldMoney = ({ text, mode: type, render, formItemRender, fieldProps, proF
9556
9556
  ]),
9557
9557
  onBlur: fieldProps.onBlur ? (e) => {
9558
9558
  let value_2 = e.target.value;
9559
- if (moneySymbol && value_2) value_2 = value_2.replace(new RegExp(`\\${moneySymbol}\\s?|(,*)`, "g"), "");
9559
+ if (moneySymbol && value_2) value_2 = value_2.replaceAll(new RegExp(`\\${moneySymbol}\\s?|(,*)`, "g"), "");
9560
9560
  fieldProps.onBlur?.(value_2);
9561
9561
  } : void 0
9562
9562
  });
@@ -9941,7 +9941,7 @@ const FieldPercent = (t0) => {
9941
9941
  } else t7 = $[12];
9942
9942
  let t8;
9943
9943
  if ($[13] !== realValue || $[14] !== showSymbol) {
9944
- t8 = showSymbol && /* @__PURE__ */ jsxs(Fragment, { children: [getSymbolByRealValue(realValue), " "] });
9944
+ t8 = showSymbol && /* @__PURE__ */ jsxs(Fragment$1, { children: [getSymbolByRealValue(realValue), " "] });
9945
9945
  $[13] = realValue;
9946
9946
  $[14] = showSymbol;
9947
9947
  $[15] = t8;
@@ -10005,7 +10005,7 @@ const FieldPercent = (t0) => {
10005
10005
  let t6;
10006
10006
  if ($[36] !== prefix) {
10007
10007
  t6 = (value) => {
10008
- if (value && prefix) return `${prefix} ${value}`.replace(/\B(?=(\d{3})+(?!\d)$)/g, ",");
10008
+ if (value && prefix) return `${prefix} ${value}`.replaceAll(/\B(?=(\d{3})+(?!\d)$)/g, ",");
10009
10009
  return value;
10010
10010
  };
10011
10011
  $[36] = prefix;
@@ -10048,7 +10048,7 @@ const FieldPercent = (t0) => {
10048
10048
  return null;
10049
10049
  };
10050
10050
  function _temp$28(value_0) {
10051
- return value_0 ? value_0.replace(/.*\s|,/g, "") : "";
10051
+ return value_0 ? value_0.replaceAll(/.*\s|,/g, "") : "";
10052
10052
  }
10053
10053
  //#endregion
10054
10054
  //#region src/field/components/Progress/index.tsx
@@ -10812,7 +10812,7 @@ const FieldSlider = (t0) => {
10812
10812
  const FieldSwitch = ({ text, mode, render, light, label, formItemRender, fieldProps, variant, ref }) => {
10813
10813
  const intl = useIntl();
10814
10814
  const dom = useMemo(() => {
10815
- if (text === void 0 || text === null || `${text}`.length < 1) return "-";
10815
+ if (text === void 0 || text === null || `${text}`.length === 0) return "-";
10816
10816
  return text ? fieldProps?.checkedChildren ?? intl.getMessage("switch.open", "打开") : fieldProps?.unCheckedChildren ?? intl.getMessage("switch.close", "关闭");
10817
10817
  }, [
10818
10818
  fieldProps?.checkedChildren,
@@ -11905,7 +11905,7 @@ const ProFieldComponent$1 = ({ text, valueType = "text", mode = "read", onChange
11905
11905
  restFieldProps,
11906
11906
  onChangeCallBack
11907
11907
  ]);
11908
- return /* @__PURE__ */ jsx(Fragment, { children: defaultRenderText(mode === "edit" ? fieldProps?.value ?? text ?? "" : text ?? fieldProps?.value ?? "", valueType || "text", omitUndefined({
11908
+ return /* @__PURE__ */ jsx(Fragment$1, { children: defaultRenderText(mode === "edit" ? fieldProps?.value ?? text ?? "" : text ?? fieldProps?.value ?? "", valueType || "text", omitUndefined({
11909
11909
  ref,
11910
11910
  ...rest,
11911
11911
  mode: readonly ? "read" : mode,
@@ -12065,7 +12065,7 @@ const ProFieldComponent = ({ text, valueType = "text", mode = "read", onChange,
12065
12065
  restFieldProps,
12066
12066
  onChangeCallBack
12067
12067
  ]);
12068
- return /* @__PURE__ */ jsx(Fragment, { children: pureRenderText(mode === "edit" ? fieldProps?.value ?? text ?? "" : text ?? fieldProps?.value ?? "", valueType || "text", omitUndefined({
12068
+ return /* @__PURE__ */ jsx(Fragment$1, { children: pureRenderText(mode === "edit" ? fieldProps?.value ?? text ?? "" : text ?? fieldProps?.value ?? "", valueType || "text", omitUndefined({
12069
12069
  ref,
12070
12070
  ...rest,
12071
12071
  mode: readonly ? "read" : mode,
@@ -12785,7 +12785,7 @@ const gridHelpers = ({ grid, rowProps, colProps }) => ({
12785
12785
  * `xs` takes precedence over `span`
12786
12786
  * avoid `span` doesn't work
12787
12787
  */
12788
- if (typeof originProps.span === "undefined" && typeof originProps.xs === "undefined") originProps.xs = 24;
12788
+ if (originProps.span === void 0 && originProps.xs === void 0) originProps.xs = 24;
12789
12789
  return originProps;
12790
12790
  }, [rest]);
12791
12791
  if (!grid) return Wrapper ? /* @__PURE__ */ jsx(Wrapper, { children }) : children;
@@ -13424,12 +13424,12 @@ const ProFormDependency = (t0) => {
13424
13424
  const itemName_0 = flattenNames[i];
13425
13425
  const originName = originDependencies[i];
13426
13426
  let value = context.getFieldFormatValueObject?.(itemName_0);
13427
- if (value && Object.keys(value).length) {
13427
+ if (value && Object.keys(value).length > 0) {
13428
13428
  values = merge$2({}, values, value);
13429
13429
  if (get(value, itemName_0)) values = set(values, [originName].flat(1), get(value, itemName_0));
13430
13430
  } else {
13431
13431
  value = form.getFieldValue?.(itemName_0);
13432
- if (typeof value !== "undefined") values = set(values, [originName].flat(1), value);
13432
+ if (value !== void 0) values = set(values, [originName].flat(1), value);
13433
13433
  }
13434
13434
  }
13435
13435
  return children?.(values, {
@@ -13789,12 +13789,12 @@ const WIDTH_SIZE_ENUM = {
13789
13789
  lg: 440,
13790
13790
  xl: 552
13791
13791
  };
13792
- const ignoreWidthValueType = [
13792
+ const ignoreWidthValueType = new Set([
13793
13793
  "switch",
13794
13794
  "radioButton",
13795
13795
  "radio",
13796
13796
  "rate"
13797
- ];
13797
+ ]);
13798
13798
  /**
13799
13799
  * 这个方法的主要作用是帮助 Field 增加 FormItem 同时也会处理 lightFilter
13800
13800
  *
@@ -13813,7 +13813,7 @@ function warpField(Field, config) {
13813
13813
  ...props
13814
13814
  };
13815
13815
  const valueType = tmpValueType || rest.valueType;
13816
- const isIgnoreWidth = useMemo(() => ignoreWidth || ignoreWidthValueType.includes(valueType), [ignoreWidth, valueType]);
13816
+ const isIgnoreWidth = useMemo(() => ignoreWidth || ignoreWidthValueType.has(valueType), [ignoreWidth, valueType]);
13817
13817
  const [, forceUpdate] = useState();
13818
13818
  const [onlyChange, forceUpdateByOnChange] = useState();
13819
13819
  /**
@@ -14415,7 +14415,7 @@ function BaseForm(props) {
14415
14415
  /** 在同步到 url 上时对参数进行转化 */
14416
14416
  setUrlSearch(genParams(syncToUrl, syncToUrlParams, "set"));
14417
14417
  }
14418
- } catch (_error) {
14418
+ } catch {
14419
14419
  setLoading(false);
14420
14420
  }
14421
14421
  });
@@ -17306,8 +17306,10 @@ function DrawerForm({ children, trigger, drawerProps, onFinish, submitTimeout, t
17306
17306
  maxWidth: isBrowser() ? window.innerWidth * .8 : void 0,
17307
17307
  minWidth: 300
17308
17308
  };
17309
- if (typeof resize === "boolean") if (resize) return defaultResize;
17310
- else return {};
17309
+ if (typeof resize === "boolean") {
17310
+ if (resize) return defaultResize;
17311
+ return {};
17312
+ }
17311
17313
  return omitUndefined({
17312
17314
  onResize: resize?.onResize ?? defaultResize.onResize,
17313
17315
  maxWidth: resize?.maxWidth ?? defaultResize.maxWidth,
@@ -17626,7 +17628,7 @@ const LightFilterContainer = (props) => {
17626
17628
  variant
17627
17629
  })
17628
17630
  }, key || index);
17629
- }), collapseItems.length ? /* @__PURE__ */ jsx("div", {
17631
+ }), collapseItems.length > 0 ? /* @__PURE__ */ jsx("div", {
17630
17632
  className: `${lightFilterClassName}-item ${hashId}`.trim(),
17631
17633
  children: /* @__PURE__ */ jsx(FilterDropdown, {
17632
17634
  footer: {
@@ -18319,8 +18321,8 @@ const QueryFilterContent = (props) => {
18319
18321
  label: " ",
18320
18322
  shouldUpdate: false,
18321
18323
  children: /* @__PURE__ */ jsx(Actions, {
18322
- collapseRender: needCollapseRender ? collapseRender : false,
18323
18324
  collapsed,
18325
+ collapseRender: needCollapseRender ? collapseRender : false,
18324
18326
  hiddenNum,
18325
18327
  setCollapsed,
18326
18328
  submitter
@@ -18519,8 +18521,8 @@ function QueryFilter(props) {
18519
18521
  className: clsx(baseClassName, hashId, rest.className),
18520
18522
  contentRender: (items, renderSubmitter, form) => /* @__PURE__ */ jsx(QueryFilterContent, {
18521
18523
  baseClassName,
18522
- collapseRender,
18523
18524
  collapsed: controlCollapsed,
18525
+ collapseRender,
18524
18526
  defaultCollapsed,
18525
18527
  form,
18526
18528
  ignoreRules,
@@ -18990,8 +18992,10 @@ function StepsForm$1(props) {
18990
18992
  stepsDom: finalStepsDom,
18991
18993
  formDom: formContainer
18992
18994
  };
18993
- if (stepsFormRender) if (propsLayoutRender) return stepsFormRender(propsLayoutRender(doms), submitterDom);
18994
- else return stepsFormRender(layoutRender(doms), submitterDom);
18995
+ if (stepsFormRender) {
18996
+ if (propsLayoutRender) return stepsFormRender(propsLayoutRender(doms), submitterDom);
18997
+ return stepsFormRender(layoutRender(doms), submitterDom);
18998
+ }
18995
18999
  if (propsLayoutRender) return propsLayoutRender(doms);
18996
19000
  return layoutRender(doms);
18997
19001
  }, [
@@ -19328,7 +19332,7 @@ function BetaSchemaForm(props) {
19328
19332
  const genItems = useRefFunction((items) => {
19329
19333
  return items.filter((originItem) => {
19330
19334
  return !(originItem.hideInForm && type === "form");
19331
- }).sort((a, b) => {
19335
+ }).toSorted((a, b) => {
19332
19336
  if (b.order || a.order) return (b.order || 0) - (a.order || 0);
19333
19337
  return (b.index || 0) - (a.index || 0);
19334
19338
  }).map((originItem_0, index) => {
@@ -19386,7 +19390,7 @@ function BetaSchemaForm(props) {
19386
19390
  propsOnValuesChange?.(changedValues, values);
19387
19391
  }, [propsRef, shouldUpdate]);
19388
19392
  const formChildrenDoms = useDeepCompareMemo(() => {
19389
- if (columns.length && Array.isArray(columns[0])) return;
19393
+ if (columns.length > 0 && Array.isArray(columns[0])) return;
19390
19394
  return genItems(columns);
19391
19395
  }, [
19392
19396
  columns,
@@ -22574,7 +22578,7 @@ const useFetchData$2 = (getData, options) => {
22574
22578
  const { data: data_0, success } = await getData() || {};
22575
22579
  if (success !== false) updateDataAndLoading(data_0);
22576
22580
  } catch (e) {
22577
- if (onRequestError === void 0) throw new Error(e);
22581
+ if (onRequestError === void 0) throw new Error(e, { cause: e });
22578
22582
  else onRequestError(e);
22579
22583
  setLoading(false);
22580
22584
  } finally {
@@ -22853,7 +22857,7 @@ const ProDescriptions = (props) => {
22853
22857
  if (!item_0) return false;
22854
22858
  if (item_0?.valueType && ["index", "indexBorder"].includes(item_0?.valueType)) return false;
22855
22859
  return !item_0?.hideInDescriptions;
22856
- }).sort((a, b) => {
22860
+ }).toSorted((a, b) => {
22857
22861
  if (b.order || a.order) return (b.order || 0) - (a.order || 0);
22858
22862
  return (b.index || 0) - (a.index || 0);
22859
22863
  });
@@ -23028,7 +23032,7 @@ const DefaultFooter = (t0) => {
23028
23032
  } else t1 = $[1];
23029
23033
  let t2;
23030
23034
  if ($[2] !== copyright) {
23031
- t2 = copyright === false ? null : /* @__PURE__ */ jsxs(Fragment, { children: [
23035
+ t2 = copyright === false ? null : /* @__PURE__ */ jsxs(Fragment$1, { children: [
23032
23036
  /* @__PURE__ */ jsx(CopyrightOutlined, {}),
23033
23037
  " ",
23034
23038
  copyright
@@ -23402,7 +23406,7 @@ const renderLogo$1 = (logo, title) => {
23402
23406
  });
23403
23407
  if (!logo && title && typeof title === "string") return /* @__PURE__ */ jsx("div", {
23404
23408
  id: "avatarLogo",
23405
- children: title.substring(0, 1)
23409
+ children: title.slice(0, 1)
23406
23410
  });
23407
23411
  return logo;
23408
23412
  };
@@ -24056,7 +24060,7 @@ const getIcon = (icon, iconPrefixes = "icon-", className) => {
24056
24060
  return icon;
24057
24061
  };
24058
24062
  const getMenuTitleSymbol = (title) => {
24059
- if (title && typeof title === "string") return title.substring(0, 1).toUpperCase();
24063
+ if (title && typeof title === "string") return title.slice(0, 1).toUpperCase();
24060
24064
  return null;
24061
24065
  };
24062
24066
  var MenuUtil = class {
@@ -24228,7 +24232,7 @@ var MenuUtil = class {
24228
24232
  };
24229
24233
  conversionPath = (path) => {
24230
24234
  if (path && path.indexOf("http") === 0) return path;
24231
- return `/${path || ""}`.replace(/\/+/g, "/");
24235
+ return `/${path || ""}`.replaceAll(/\/+/g, "/");
24232
24236
  };
24233
24237
  };
24234
24238
  /**
@@ -28282,7 +28286,7 @@ const BaseProLayout = (props) => {
28282
28286
  return getMatchMenu(location.pathname || "/", menuData || [], true);
28283
28287
  }, [location.pathname, menuData]);
28284
28288
  const matchMenuKeys = useMemo(() => Array.from(new Set(matchMenus.map((item) => item.key || item.path || ""))), [matchMenus]);
28285
- const currentMenu = matchMenus[matchMenus.length - 1] || {};
28289
+ const currentMenu = matchMenus.at(-1) || {};
28286
28290
  const currentMenuLayoutProps = useCurrentMenuLayoutProps(currentMenu);
28287
28291
  const { fixSiderbar, navTheme, layout: propsLayout, ...rest } = {
28288
28292
  ...props,
@@ -28567,14 +28571,14 @@ const Highlight = ({ label, words }) => {
28567
28571
  }
28568
28572
  };
28569
28573
  });
28570
- if (!words.length || !words[0]) return wrapSSR(createElement("div", {
28574
+ if (words.length === 0 || !words[0]) return wrapSSR(createElement("div", {
28571
28575
  title: label,
28572
28576
  className: optionCls
28573
28577
  }, label));
28574
- const matchKeywordsRE = new RegExp(words.map((word) => word.replace(/[-[\]/{}()*+?.\\^$|]/g, "\\$&")).join("|"), "gi");
28578
+ const matchKeywordsRE = new RegExp(words.map((word) => word.replaceAll(/[-[\]/{}()*+?.\\^$|]/g, "\\$&")).join("|"), "gi");
28575
28579
  let matchText = label;
28576
28580
  const elements = [];
28577
- while (matchText.length) {
28581
+ while (matchText.length > 0) {
28578
28582
  const match = matchKeywordsRE.exec(matchText);
28579
28583
  if (!match) {
28580
28584
  elements.push(matchText);
@@ -29925,7 +29929,7 @@ function TableAlert({ selectedRowKeys = [], onCleanSelected, alwaysShowAlert, se
29925
29929
  selectedRows,
29926
29930
  onCleanSelected
29927
29931
  });
29928
- if (dom === false || selectedRowKeys.length < 1 && !alwaysShowAlert) return null;
29932
+ if (dom === false || selectedRowKeys.length === 0 && !alwaysShowAlert) return null;
29929
29933
  return wrapSSR(/* @__PURE__ */ jsx("div", {
29930
29934
  className: `${className} ${hashId}`.trim(),
29931
29935
  children: /* @__PURE__ */ jsx("div", {
@@ -30011,7 +30015,7 @@ function useActionType(ref, action, props) {
30011
30015
  * @param pipeline
30012
30016
  */
30013
30017
  function postDataPipeline(data, pipeline) {
30014
- if (pipeline.filter((item) => item).length < 1) return data;
30018
+ if (pipeline.filter((item) => item).length === 0) return data;
30015
30019
  return pipeline.reduce((pre, postData) => {
30016
30020
  return postData(pre);
30017
30021
  }, data);
@@ -30627,7 +30631,7 @@ function TableRender(props) {
30627
30631
  //#endregion
30628
30632
  //#region src/table/components/Form/FormRender.tsx
30629
30633
  function toLowerLine(str) {
30630
- let temp = str.replace(/[A-Z]/g, (match) => {
30634
+ let temp = str.replaceAll(/[A-Z]/g, (match) => {
30631
30635
  return `-${match.toLowerCase()}`;
30632
30636
  });
30633
30637
  if (temp.startsWith("-")) temp = temp.slice(1);
@@ -31598,7 +31602,7 @@ const HeaderMenu = (props) => {
31598
31602
  $[4] = t3;
31599
31603
  } else t3 = $[4];
31600
31604
  const [activeKey, setActiveKey] = useMergedState$1(propActiveKey || defaultActiveKey, t3);
31601
- if (items.length < 1) return null;
31605
+ if (items.length === 0) return null;
31602
31606
  let t4;
31603
31607
  if ($[5] !== activeKey || $[6] !== items) {
31604
31608
  t4 = items.find((item) => item.key === activeKey) || items[0];
@@ -32018,7 +32022,7 @@ const ListToolBar = ({ prefixCls: customizePrefixCls, title, subTitle, tooltip,
32018
32022
  /** 没有 key 的时候帮忙加一下 key 不加的话很烦人 */
32019
32023
  const actionDom = useMemo(() => {
32020
32024
  if (!Array.isArray(actions)) return actions;
32021
- if (actions.length < 1) return null;
32025
+ if (actions.length === 0) return null;
32022
32026
  return /* @__PURE__ */ jsx("div", {
32023
32027
  style: {
32024
32028
  display: "flex",
@@ -32439,11 +32443,11 @@ var ToolbarRender = class extends Component {
32439
32443
  optionsRender,
32440
32444
  selectedRowKeys,
32441
32445
  selectedRows,
32442
- toolBarRender,
32443
32446
  toolbar: {
32444
32447
  filter: searchNode,
32445
32448
  ...toolbar
32446
32449
  },
32450
+ toolBarRender,
32447
32451
  tooltip,
32448
32452
  onSearch: this.onSearch
32449
32453
  });
@@ -32485,8 +32489,8 @@ function TableToolbar(props) {
32485
32489
  selectedRowKeys,
32486
32490
  selectedRows,
32487
32491
  tableColumn,
32488
- toolBarRender,
32489
32492
  toolbar,
32493
+ toolBarRender,
32490
32494
  tooltip,
32491
32495
  onFormSearchSubmit: t2
32492
32496
  });
@@ -32646,7 +32650,7 @@ const useFetchData$1 = (getData, defaultData, options) => {
32646
32650
  return responseData;
32647
32651
  } catch (e) {
32648
32652
  if (signal?.aborted) return [];
32649
- if (onRequestError === void 0) throw new Error(e);
32653
+ if (onRequestError === void 0) throw new Error(e, { cause: e });
32650
32654
  if (tableDataList === void 0) setTableDataList([]);
32651
32655
  onRequestError(e);
32652
32656
  } finally {
@@ -32785,19 +32789,19 @@ const columnSort = (columnsMap) => (a, b) => {
32785
32789
  };
32786
32790
  //#endregion
32787
32791
  //#region src/table/utils/cellRenderToFromItem.tsx
32788
- const SHOW_EMPTY_TEXT_LIST = [
32792
+ const SHOW_EMPTY_TEXT_LIST = new Set([
32789
32793
  "",
32790
32794
  null,
32791
32795
  void 0
32792
- ];
32796
+ ]);
32793
32797
  /**
32794
32798
  * 拼接用于编辑的 key
32795
32799
  */
32796
32800
  const spellNamePath = (...rest) => {
32797
- return rest.filter((index) => index !== void 0).map((item) => {
32801
+ return rest.filter((index) => index !== void 0).flatMap((item) => {
32798
32802
  if (typeof item === "number") return item.toString();
32799
32803
  return item;
32800
- }).flat(1);
32804
+ });
32801
32805
  };
32802
32806
  const CellRenderFromItem = (props) => {
32803
32807
  const formContext = useContext(FieldContext);
@@ -32926,7 +32930,7 @@ const CellRenderFromItem = (props) => {
32926
32930
  */
32927
32931
  function cellRenderToFromItem(config) {
32928
32932
  const { text, valueType, rowData, columnProps, index } = config;
32929
- if ((!valueType || ["textarea", "text"].includes(valueType.toString())) && !columnProps?.valueEnum && config.mode === "read") return SHOW_EMPTY_TEXT_LIST.includes(text) ? config.columnEmptyText : text;
32933
+ if ((!valueType || ["textarea", "text"].includes(valueType.toString())) && !columnProps?.valueEnum && config.mode === "read") return SHOW_EMPTY_TEXT_LIST.has(text) ? config.columnEmptyText : text;
32930
32934
  if (typeof valueType === "function" && rowData) return cellRenderToFromItem({
32931
32935
  ...config,
32932
32936
  valueType: valueType(rowData, config.type) || "text"
@@ -33004,8 +33008,7 @@ function isNotEditableCell(text, rowData, index, editable) {
33004
33008
  */
33005
33009
  const defaultOnFilter = (value, record, dataIndex) => {
33006
33010
  const recordElement = Array.isArray(dataIndex) ? get(record, dataIndex) : record[dataIndex];
33007
- const itemValue = String(recordElement);
33008
- return String(itemValue) === String(value);
33011
+ return String(String(recordElement)) === String(value);
33009
33012
  };
33010
33013
  /**
33011
33014
  * 这个组件负责单元格的具体渲染
@@ -33442,7 +33445,7 @@ const ProTable = (props) => {
33442
33445
  childrenColumnName: props.expandable?.childrenColumnName,
33443
33446
  proFilter,
33444
33447
  proSort
33445
- }).sort(columnSort(counter.columnsMap));
33448
+ }).toSorted(columnSort(counter.columnsMap));
33446
33449
  }, [
33447
33450
  propsColumns,
33448
33451
  counter?.sortKeyColumns,
@@ -33542,8 +33545,8 @@ const ProTable = (props) => {
33542
33545
  selectedRows,
33543
33546
  setFormSearch: setFormSearchWithRef,
33544
33547
  tableColumn,
33545
- toolBarRender,
33546
33548
  toolbar,
33549
+ toolBarRender,
33547
33550
  tooltip
33548
33551
  });
33549
33552
  const alertDom = useAlertDom({
@@ -34583,8 +34586,7 @@ function FieldEditableTable(props) {
34583
34586
  try {
34584
34587
  return JSON.stringify(get(prev, name)) !== JSON.stringify(get(next, name));
34585
34588
  } catch (t1) {
34586
- const error = t1;
34587
- console.error(error);
34589
+ console.error(t1);
34588
34590
  return true;
34589
34591
  }
34590
34592
  };