pro-design-vue 1.3.41 → 1.4.0

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 (129) hide show
  1. package/dist/index.full.js +694 -494
  2. package/dist/index.full.min.js +7 -7
  3. package/dist/index.full.min.js.map +1 -1
  4. package/dist/index.full.min.mjs +7 -7
  5. package/dist/index.full.min.mjs.map +1 -1
  6. package/dist/index.full.mjs +695 -495
  7. package/es/components/form/src/context/FormContext.d.ts +1 -0
  8. package/es/components/form/src/hooks/useAction.d.ts +2 -1
  9. package/es/components/form/src/hooks/useInitialValues.d.ts +1 -1
  10. package/es/components/table/src/components/Body/Body.vue.d.ts +7 -13
  11. package/es/components/table/src/components/Body/BodyCell.vue.d.ts +6 -10
  12. package/es/components/table/src/components/Body/BodyRow.vue.d.ts +6 -12
  13. package/es/components/table/src/components/Body/BodyRows.vue.d.ts +6 -12
  14. package/es/components/table/src/components/Body/BodyTextCell.d.ts +0 -2
  15. package/es/components/table/src/components/InteralTable.vue.d.ts +7 -13
  16. package/es/packages/components/form/src/base/BaseForm.mjs +7 -6
  17. package/es/packages/components/form/src/base/BaseForm.mjs.map +1 -1
  18. package/es/packages/components/form/src/components/FormGroup.mjs +9 -3
  19. package/es/packages/components/form/src/components/FormGroup.mjs.map +1 -1
  20. package/es/packages/components/form/src/components/FormItem.mjs +36 -17
  21. package/es/packages/components/form/src/components/FormItem.mjs.map +1 -1
  22. package/es/packages/components/form/src/components/FormItems.mjs +75 -72
  23. package/es/packages/components/form/src/components/FormItems.mjs.map +1 -1
  24. package/es/packages/components/form/src/components/FormList.mjs +4 -2
  25. package/es/packages/components/form/src/components/FormList.mjs.map +1 -1
  26. package/es/packages/components/form/src/components/FormListContainer.mjs +57 -28
  27. package/es/packages/components/form/src/components/FormListContainer.mjs.map +1 -1
  28. package/es/packages/components/form/src/components/FormListItem.mjs +15 -12
  29. package/es/packages/components/form/src/components/FormListItem.mjs.map +1 -1
  30. package/es/packages/components/form/src/components/FormSet.mjs +7 -2
  31. package/es/packages/components/form/src/components/FormSet.mjs.map +1 -1
  32. package/es/packages/components/form/src/context/FormContext.mjs.map +1 -1
  33. package/es/packages/components/form/src/context/FormSlotsContext.mjs +2 -2
  34. package/es/packages/components/form/src/context/FormSlotsContext.mjs.map +1 -1
  35. package/es/packages/components/form/src/hooks/useAction.mjs +5 -0
  36. package/es/packages/components/form/src/hooks/useAction.mjs.map +1 -1
  37. package/es/packages/components/form/src/hooks/useFieldValue.mjs +11 -11
  38. package/es/packages/components/form/src/hooks/useFieldValue.mjs.map +1 -1
  39. package/es/packages/components/form/src/hooks/useInitialValues.mjs +2 -2
  40. package/es/packages/components/form/src/hooks/useInitialValues.mjs.map +1 -1
  41. package/es/packages/components/form/src/hooks/useLinkage.mjs +30 -3
  42. package/es/packages/components/form/src/hooks/useLinkage.mjs.map +1 -1
  43. package/es/packages/components/form/src/layouts/DrawerForm.mjs +11 -6
  44. package/es/packages/components/form/src/layouts/DrawerForm.mjs.map +1 -1
  45. package/es/packages/components/form/src/layouts/ModalForm.mjs +12 -7
  46. package/es/packages/components/form/src/layouts/ModalForm.mjs.map +1 -1
  47. package/es/packages/components/form/src/layouts/QueryFilter.mjs +78 -81
  48. package/es/packages/components/form/src/layouts/QueryFilter.mjs.map +1 -1
  49. package/es/packages/components/table/src/components/Body/Body.vue.mjs.map +1 -1
  50. package/es/packages/components/table/src/components/Body/Body.vue2.mjs +28 -18
  51. package/es/packages/components/table/src/components/Body/Body.vue2.mjs.map +1 -1
  52. package/es/packages/components/table/src/components/Body/BodyCell.vue.mjs +20 -5
  53. package/es/packages/components/table/src/components/Body/BodyCell.vue.mjs.map +1 -1
  54. package/es/packages/components/table/src/components/Body/BodyCell.vue2.mjs +2 -2
  55. package/es/packages/components/table/src/components/Body/BodyCell.vue2.mjs.map +1 -1
  56. package/es/packages/components/table/src/components/Body/BodyCellTooltip.vue2.mjs +3 -2
  57. package/es/packages/components/table/src/components/Body/BodyCellTooltip.vue2.mjs.map +1 -1
  58. package/es/packages/components/table/src/components/Body/BodyTextCell.mjs +56 -23
  59. package/es/packages/components/table/src/components/Body/BodyTextCell.mjs.map +1 -1
  60. package/es/packages/components/table/src/components/Table.mjs.map +1 -1
  61. package/es/packages/components/table/src/hooks/useColumns.mjs +180 -167
  62. package/es/packages/components/table/src/hooks/useColumns.mjs.map +1 -1
  63. package/es/packages/directives/resize.mjs +45 -20
  64. package/es/packages/directives/resize.mjs.map +1 -1
  65. package/es/version.d.ts +1 -1
  66. package/es/version.mjs +1 -1
  67. package/es/version.mjs.map +1 -1
  68. package/lib/components/form/src/context/FormContext.d.ts +1 -0
  69. package/lib/components/form/src/hooks/useAction.d.ts +2 -1
  70. package/lib/components/form/src/hooks/useInitialValues.d.ts +1 -1
  71. package/lib/components/table/src/components/Body/Body.vue.d.ts +7 -13
  72. package/lib/components/table/src/components/Body/BodyCell.vue.d.ts +6 -10
  73. package/lib/components/table/src/components/Body/BodyRow.vue.d.ts +6 -12
  74. package/lib/components/table/src/components/Body/BodyRows.vue.d.ts +6 -12
  75. package/lib/components/table/src/components/Body/BodyTextCell.d.ts +0 -2
  76. package/lib/components/table/src/components/InteralTable.vue.d.ts +7 -13
  77. package/lib/packages/components/form/src/base/BaseForm.js +7 -6
  78. package/lib/packages/components/form/src/base/BaseForm.js.map +1 -1
  79. package/lib/packages/components/form/src/components/FormGroup.js +9 -3
  80. package/lib/packages/components/form/src/components/FormGroup.js.map +1 -1
  81. package/lib/packages/components/form/src/components/FormItem.js +36 -17
  82. package/lib/packages/components/form/src/components/FormItem.js.map +1 -1
  83. package/lib/packages/components/form/src/components/FormItems.js +74 -71
  84. package/lib/packages/components/form/src/components/FormItems.js.map +1 -1
  85. package/lib/packages/components/form/src/components/FormList.js +4 -2
  86. package/lib/packages/components/form/src/components/FormList.js.map +1 -1
  87. package/lib/packages/components/form/src/components/FormListContainer.js +57 -28
  88. package/lib/packages/components/form/src/components/FormListContainer.js.map +1 -1
  89. package/lib/packages/components/form/src/components/FormListItem.js +15 -12
  90. package/lib/packages/components/form/src/components/FormListItem.js.map +1 -1
  91. package/lib/packages/components/form/src/components/FormSet.js +7 -2
  92. package/lib/packages/components/form/src/components/FormSet.js.map +1 -1
  93. package/lib/packages/components/form/src/context/FormContext.js.map +1 -1
  94. package/lib/packages/components/form/src/context/FormSlotsContext.js +1 -1
  95. package/lib/packages/components/form/src/context/FormSlotsContext.js.map +1 -1
  96. package/lib/packages/components/form/src/hooks/useAction.js +5 -0
  97. package/lib/packages/components/form/src/hooks/useAction.js.map +1 -1
  98. package/lib/packages/components/form/src/hooks/useFieldValue.js +10 -10
  99. package/lib/packages/components/form/src/hooks/useFieldValue.js.map +1 -1
  100. package/lib/packages/components/form/src/hooks/useInitialValues.js +1 -1
  101. package/lib/packages/components/form/src/hooks/useInitialValues.js.map +1 -1
  102. package/lib/packages/components/form/src/hooks/useLinkage.js +30 -3
  103. package/lib/packages/components/form/src/hooks/useLinkage.js.map +1 -1
  104. package/lib/packages/components/form/src/layouts/DrawerForm.js +11 -6
  105. package/lib/packages/components/form/src/layouts/DrawerForm.js.map +1 -1
  106. package/lib/packages/components/form/src/layouts/ModalForm.js +12 -7
  107. package/lib/packages/components/form/src/layouts/ModalForm.js.map +1 -1
  108. package/lib/packages/components/form/src/layouts/QueryFilter.js +77 -80
  109. package/lib/packages/components/form/src/layouts/QueryFilter.js.map +1 -1
  110. package/lib/packages/components/table/src/components/Body/Body.vue.js.map +1 -1
  111. package/lib/packages/components/table/src/components/Body/Body.vue2.js +27 -17
  112. package/lib/packages/components/table/src/components/Body/Body.vue2.js.map +1 -1
  113. package/lib/packages/components/table/src/components/Body/BodyCell.vue.js +19 -4
  114. package/lib/packages/components/table/src/components/Body/BodyCell.vue.js.map +1 -1
  115. package/lib/packages/components/table/src/components/Body/BodyCell.vue2.js +2 -2
  116. package/lib/packages/components/table/src/components/Body/BodyCell.vue2.js.map +1 -1
  117. package/lib/packages/components/table/src/components/Body/BodyCellTooltip.vue2.js +3 -2
  118. package/lib/packages/components/table/src/components/Body/BodyCellTooltip.vue2.js.map +1 -1
  119. package/lib/packages/components/table/src/components/Body/BodyTextCell.js +55 -22
  120. package/lib/packages/components/table/src/components/Body/BodyTextCell.js.map +1 -1
  121. package/lib/packages/components/table/src/components/Table.js.map +1 -1
  122. package/lib/packages/components/table/src/hooks/useColumns.js +179 -166
  123. package/lib/packages/components/table/src/hooks/useColumns.js.map +1 -1
  124. package/lib/packages/directives/resize.js +45 -20
  125. package/lib/packages/directives/resize.js.map +1 -1
  126. package/lib/version.d.ts +1 -1
  127. package/lib/version.js +1 -1
  128. package/lib/version.js.map +1 -1
  129. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- /*! Pro Design Vue v1.3.41 */
1
+ /*! Pro Design Vue v1.4.0 */
2
2
 
3
3
  (function (global, factory) {
4
4
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('ant-design-vue'), require('vue'), require('ant-design-vue/es/locale/zh_CN.js')) :
@@ -32,7 +32,7 @@
32
32
  const DEFAULT_NAMESPACE = "pro";
33
33
  const DEFAULT_LOCALE = "zh-CN";
34
34
 
35
- const version$1 = "1.3.41";
35
+ const version$1 = "1.4.0";
36
36
 
37
37
  const makeInstaller = (components = []) => {
38
38
  const install = (app) => {
@@ -10299,7 +10299,7 @@
10299
10299
 
10300
10300
  const ProIcon = withInstall(_sfc_main$W);
10301
10301
 
10302
- function _isSlot$8(s) {
10302
+ function _isSlot$9(s) {
10303
10303
  return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !vue.isVNode(s);
10304
10304
  }
10305
10305
  var Button = /* @__PURE__ */ vue.defineComponent({
@@ -10473,7 +10473,7 @@
10473
10473
  })();
10474
10474
  defaultDom = vue.createVNode(antDesignVue.Tooltip, vue.mergeProps(props.tooltipProps, {
10475
10475
  "title": props.tooltip
10476
- }), _isSlot$8(defaultDom) ? defaultDom : {
10476
+ }), _isSlot$9(defaultDom) ? defaultDom : {
10477
10477
  default: () => [_defaultDom]
10478
10478
  });
10479
10479
  }
@@ -10487,7 +10487,7 @@
10487
10487
  var _a2;
10488
10488
  return (_a2 = props.onCancel) == null ? void 0 : _a2.call(props, props.data);
10489
10489
  }
10490
- }), _isSlot$8(defaultDom) ? defaultDom : {
10490
+ }), _isSlot$9(defaultDom) ? defaultDom : {
10491
10491
  default: () => [defaultDom]
10492
10492
  });
10493
10493
  }
@@ -13725,7 +13725,7 @@
13725
13725
  }
13726
13726
  },
13727
13727
  setup(props, { slots }) {
13728
- const currentValue = vue.reactive({});
13728
+ const currentValue = vue.shallowReactive({});
13729
13729
  vue.watch(
13730
13730
  () => props.value,
13731
13731
  () => {
@@ -14055,7 +14055,7 @@
14055
14055
  return vue.inject(FormContextKey, {});
14056
14056
  };
14057
14057
 
14058
- function _isSlot$7(s) {
14058
+ function _isSlot$8(s) {
14059
14059
  return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !vue.isVNode(s);
14060
14060
  }
14061
14061
  var FieldReadonly = /* @__PURE__ */ vue.defineComponent({
@@ -14134,7 +14134,7 @@
14134
14134
  if (props.copy && props.text) {
14135
14135
  return vue.createVNode(ProClipboard, {
14136
14136
  "text": props.text
14137
- }, _isSlot$7(dom) ? dom : {
14137
+ }, _isSlot$8(dom) ? dom : {
14138
14138
  default: () => [dom]
14139
14139
  });
14140
14140
  }
@@ -14145,7 +14145,7 @@
14145
14145
  "placement": "topLeft",
14146
14146
  "title": title,
14147
14147
  "getPopupContainer": getPopupContainer
14148
- }, _isSlot$7(dom) ? dom : {
14148
+ }, _isSlot$8(dom) ? dom : {
14149
14149
  default: () => [dom]
14150
14150
  });
14151
14151
  }
@@ -15265,7 +15265,7 @@
15265
15265
  }
15266
15266
  });
15267
15267
 
15268
- function _isSlot$6(s) {
15268
+ function _isSlot$7(s) {
15269
15269
  return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !vue.isVNode(s);
15270
15270
  }
15271
15271
  var FieldRadioGroup = /* @__PURE__ */ vue.defineComponent({
@@ -15329,7 +15329,7 @@
15329
15329
  "value": props.value
15330
15330
  }, attrs, {
15331
15331
  "onChange": onChange
15332
- }), _isSlot$6(_slot = mergeOptions.value.map((option) => {
15332
+ }), _isSlot$7(_slot = mergeOptions.value.map((option) => {
15333
15333
  var _a2;
15334
15334
  return vue.createVNode(antDesignVue.Radio, {
15335
15335
  "value": option.value,
@@ -17579,7 +17579,7 @@
17579
17579
  const useInitialValues = (props) => {
17580
17580
  const hasInitial = vue.ref(true);
17581
17581
  const requestLoading = vue.ref(false);
17582
- const initialValues = vue.ref({ ...props.initialValues });
17582
+ const initialValues = vue.shallowRef({ ...props.initialValues });
17583
17583
  const fetchData = useFetchData$1({ request: props.request });
17584
17584
  vue.onMounted(async () => {
17585
17585
  var _a;
@@ -17600,7 +17600,14 @@
17600
17600
  const useLinkage = () => {
17601
17601
  const hiddenKeys = vue.shallowRef([]);
17602
17602
  const disabledKeys = vue.shallowRef([]);
17603
- const excludeKeys = vue.computed(() => hiddenKeys.value.map((key) => key.split(":")[1]));
17603
+ const hiddenExcludeSet = vue.computed(() => {
17604
+ const set = /* @__PURE__ */ new Set();
17605
+ for (const key of hiddenKeys.value) {
17606
+ const target = key.split(":")[1];
17607
+ if (target) set.add(target);
17608
+ }
17609
+ return set;
17610
+ });
17604
17611
  const genNewKeys = (originKeys, fieldKey, keys) => {
17605
17612
  if (!Array.isArray(keys)) {
17606
17613
  keys = [keys];
@@ -17616,10 +17623,30 @@
17616
17623
  disabledKeys.value = genNewKeys(disabledKeys.value, fieldKey, keys);
17617
17624
  };
17618
17625
  const allHiddenKeys = vue.computed(() => {
17619
- return hiddenKeys.value.filter((key) => !excludeKeys.value.includes(key.split(":")[0])).map((key) => key.split(":")[1]);
17626
+ const excludeSet = hiddenExcludeSet.value;
17627
+ const result = [];
17628
+ for (const key of hiddenKeys.value) {
17629
+ const idx = key.indexOf(":");
17630
+ const source = key.substring(0, idx);
17631
+ const target = key.substring(idx + 1);
17632
+ if (!excludeSet.has(source)) {
17633
+ result.push(target);
17634
+ }
17635
+ }
17636
+ return result;
17620
17637
  });
17621
17638
  const allDisabledKeys = vue.computed(() => {
17622
- return disabledKeys.value.filter((key) => !excludeKeys.value.includes(key.split(":")[0])).map((key) => key.split(":")[1]);
17639
+ const excludeSet = hiddenExcludeSet.value;
17640
+ const result = [];
17641
+ for (const key of disabledKeys.value) {
17642
+ const idx = key.indexOf(":");
17643
+ const source = key.substring(0, idx);
17644
+ const target = key.substring(idx + 1);
17645
+ if (!excludeSet.has(source)) {
17646
+ result.push(target);
17647
+ }
17648
+ }
17649
+ return result;
17623
17650
  });
17624
17651
  return {
17625
17652
  allHiddenKeys,
@@ -17770,6 +17797,7 @@
17770
17797
  props,
17771
17798
  formRef,
17772
17799
  formData,
17800
+ formDataVersion,
17773
17801
  initialValues,
17774
17802
  hasInitial,
17775
17803
  transformerMap,
@@ -17825,6 +17853,7 @@
17825
17853
  const namePath = covertFormName(name);
17826
17854
  if (!namePath) throw new Error("name is require");
17827
17855
  set(formData.value, namePath, value);
17856
+ formDataVersion.value++;
17828
17857
  };
17829
17858
  const setFieldsValue = (values, isMerge = true) => {
17830
17859
  if (!values) throw new Error("values is require");
@@ -17833,6 +17862,7 @@
17833
17862
  } else {
17834
17863
  formData.value = cloneDeep(values);
17835
17864
  }
17865
+ formDataVersion.value++;
17836
17866
  };
17837
17867
  const resetInitialValues = (values) => {
17838
17868
  if (!values) throw new Error("values is require");
@@ -17845,6 +17875,7 @@
17845
17875
  hasInitial.value = true;
17846
17876
  (_a = formRef.value) == null ? void 0 : _a.clearValidate();
17847
17877
  formData.value = cloneDeep(convertKeyInitialValue(initialValues.value, transformerMap.value));
17878
+ formDataVersion.value++;
17848
17879
  Promise.resolve().then(() => {
17849
17880
  hasInitial.value = false;
17850
17881
  onReset == null ? void 0 : onReset(transformKeySubmitValue(formData.value, transformerMap.value, props.omitNil));
@@ -17856,6 +17887,7 @@
17856
17887
  if (!namePath) throw new Error("name is require");
17857
17888
  (_a = formRef.value) == null ? void 0 : _a.clearValidate(name);
17858
17889
  set(formData.value, name, cloneDeep(get(initialValues.value, name)));
17890
+ formDataVersion.value++;
17859
17891
  };
17860
17892
  const clearValidate = (name) => {
17861
17893
  var _a;
@@ -18050,7 +18082,7 @@
18050
18082
  }
18051
18083
  });
18052
18084
 
18053
- function _isSlot$5(s) {
18085
+ function _isSlot$6(s) {
18054
18086
  return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !vue.isVNode(s);
18055
18087
  }
18056
18088
  var FormGroup = /* @__PURE__ */ vue.defineComponent({
@@ -18102,12 +18134,18 @@
18102
18134
  formData
18103
18135
  } = useInjectForm();
18104
18136
  const items = vue.computed(() => {
18105
- var _a, _b;
18106
- return (_b = formatItems == null ? void 0 : formatItems(runFunction((_a = props.items) != null ? _a : [], formData.value))) != null ? _b : [];
18137
+ var _a, _b, _c;
18138
+ const raw = (_a = props.items) != null ? _a : [];
18139
+ const fields = (_b = typeof raw === "function" ? runFunction(raw, formData.value) : raw) != null ? _b : [];
18140
+ return (_c = formatItems == null ? void 0 : formatItems(fields)) != null ? _c : [];
18107
18141
  });
18108
18142
  const formItemProps = vue.computed(() => {
18109
18143
  var _a;
18110
- return (_a = runFunction(props.formItemProps, formData.value)) != null ? _a : {};
18144
+ const raw = props.formItemProps;
18145
+ if (typeof raw === "function") {
18146
+ return (_a = runFunction(raw, formData.value)) != null ? _a : {};
18147
+ }
18148
+ return raw != null ? raw : {};
18111
18149
  });
18112
18150
  const isExistTitle = vue.computed(() => {
18113
18151
  if (!props.title) {
@@ -18150,7 +18188,7 @@
18150
18188
  }, null)]), vue.createVNode("div", null, [vue.createVNode(FormRowWrapper, {
18151
18189
  "rowProps": props.rowProps,
18152
18190
  "grid": props.grid
18153
- }, _isSlot$5(defaultDom) ? defaultDom : {
18191
+ }, _isSlot$6(defaultDom) ? defaultDom : {
18154
18192
  default: () => [defaultDom]
18155
18193
  })])])]
18156
18194
  });
@@ -18164,31 +18202,31 @@
18164
18202
  convertValue
18165
18203
  }) {
18166
18204
  const fieldValue = vue.shallowRef();
18167
- const { formData, initialValues } = useInjectForm();
18168
- const modelValue = vue.computed(() => get(formData.value, namePath.value));
18205
+ const { formData, formDataVersion, initialValues } = useInjectForm();
18206
+ const modelValue = vue.computed(() => {
18207
+ void formDataVersion.value;
18208
+ return get(formData.value, namePath.value);
18209
+ });
18169
18210
  const onValueChange = (value) => {
18170
18211
  set(formData.value, namePath.value, value);
18212
+ formDataVersion.value++;
18171
18213
  };
18172
18214
  vue.watch(
18173
18215
  modelValue,
18174
18216
  (newValue) => {
18175
- fieldValue.value = cloneDeep(newValue);
18217
+ fieldValue.value = newValue;
18176
18218
  },
18177
18219
  {
18178
- immediate: true,
18179
- deep: true
18220
+ immediate: true
18180
18221
  }
18181
18222
  );
18182
18223
  const initFieldInitialValue = () => {
18183
18224
  var _a;
18184
- if (
18185
- // !mountedRef.value &&
18186
- typeof modelValue.value === "undefined" && typeof initialValue !== "undefined"
18187
- ) {
18225
+ if (typeof modelValue.value === "undefined" && typeof initialValue !== "undefined") {
18188
18226
  const value = convertValue ? convertValue(initialValue, namePath.value) : initialValue;
18189
18227
  set((_a = initialValues == null ? void 0 : initialValues.value) != null ? _a : {}, namePath.value, cloneDeep(initialValue));
18190
18228
  set(formData.value, namePath.value, cloneDeep(value));
18191
- fieldValue.value = value;
18229
+ fieldValue.value = get(formData.value, namePath.value);
18192
18230
  }
18193
18231
  };
18194
18232
  initFieldInitialValue();
@@ -18265,14 +18303,19 @@
18265
18303
  });
18266
18304
  const formItemProps = vue.computed(() => {
18267
18305
  var _a;
18268
- return (_a = runFunction(props.formItemProps, formData.value)) != null ? _a : {};
18306
+ const raw = props.formItemProps;
18307
+ if (typeof raw === "function") {
18308
+ return (_a = runFunction(raw, formData.value)) != null ? _a : {};
18309
+ }
18310
+ return raw != null ? raw : {};
18269
18311
  });
18270
18312
  const restItemProps = vue.computed(() => omitUndefined({
18271
18313
  ...pickKeys(formItemProps.value, ALL_ANTD_PROP_KEYS$2)
18272
18314
  }));
18273
18315
  const items = vue.computed(() => {
18274
18316
  var _a, _b, _c;
18275
- let children = (_b = runFunction((_a = props.items) != null ? _a : [], formData.value)) != null ? _b : [];
18317
+ const raw = (_a = props.items) != null ? _a : [];
18318
+ let children = (_b = typeof raw === "function" ? runFunction(raw, formData.value) : raw) != null ? _b : [];
18276
18319
  if (Array.isArray(props.initialValue) && props.initialValue.length) {
18277
18320
  children = children.filter((item) => {
18278
18321
  var _a2;
@@ -18458,24 +18501,27 @@
18458
18501
  return newDependencies;
18459
18502
  };
18460
18503
  const genListItems = (fields) => {
18461
- return cloneDeep(fields).filter((item) => {
18504
+ return fields.filter((item) => {
18462
18505
  var _a;
18463
18506
  return !NOT_ALLOW_FIELD_TYPES.includes((_a = item.fieldType) != null ? _a : "");
18464
18507
  }).map((field) => {
18465
18508
  var _a, _b, _c, _d, _e, _f;
18466
- if (field.fieldType === ProFieldType.GROUP) {
18467
- field.children = genListItems((_b = runFunction((_a = field.children) != null ? _a : [], formData.value)) != null ? _b : []);
18468
- return field;
18469
- }
18470
- const originName = (_c = field.originName) != null ? _c : field.name;
18471
- const originKey = (_d = field.originKey) != null ? _d : field.key;
18472
- const namePath = covertFormName(field.name);
18473
- const title = index.value === 0 || props.alwaysShowItemLabel ? field.title : void 0;
18509
+ const cloned = {
18510
+ ...field
18511
+ };
18512
+ if (cloned.fieldType === ProFieldType.GROUP) {
18513
+ cloned.children = genListItems((_b = runFunction((_a = cloned.children) != null ? _a : [], formData.value)) != null ? _b : []);
18514
+ return cloned;
18515
+ }
18516
+ const originName = (_c = cloned.originName) != null ? _c : cloned.name;
18517
+ const originKey = (_d = cloned.originKey) != null ? _d : cloned.key;
18518
+ const namePath = covertFormName(cloned.name);
18519
+ const title = index.value === 0 || props.alwaysShowItemLabel ? cloned.title : void 0;
18474
18520
  const item = {
18475
- ...field,
18521
+ ...cloned,
18476
18522
  title,
18477
18523
  originKey,
18478
- key: `${listKey.value}_${(_e = field.key) != null ? _e : namePath == null ? void 0 : namePath.join("_")}`,
18524
+ key: `${listKey.value}_${(_e = cloned.key) != null ? _e : namePath == null ? void 0 : namePath.join("_")}`,
18479
18525
  originName,
18480
18526
  name: [...(_f = listName == null ? void 0 : listName.value) != null ? _f : [], namePath].filter((item2) => item2 !== void 0).flat(1)
18481
18527
  };
@@ -18487,7 +18533,8 @@
18487
18533
  };
18488
18534
  const items = vue.computed(() => {
18489
18535
  var _a, _b, _c;
18490
- const fields = (_b = runFunction((_a = props.items) != null ? _a : [], formData.value)) != null ? _b : [];
18536
+ const raw = (_a = props.items) != null ? _a : [];
18537
+ const fields = (_b = typeof raw === "function" ? runFunction(raw, formData.value) : raw) != null ? _b : [];
18491
18538
  return (_c = formatItems == null ? void 0 : formatItems(genListItems(fields))) != null ? _c : [];
18492
18539
  });
18493
18540
  const showRowTitle = vue.computed(() => props.alwaysShowRowTitle && props.rowTitle);
@@ -18625,7 +18672,7 @@
18625
18672
  }
18626
18673
  });
18627
18674
 
18628
- function _isSlot$4(s) {
18675
+ function _isSlot$5(s) {
18629
18676
  return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !vue.isVNode(s);
18630
18677
  }
18631
18678
  var FormListContainer = /* @__PURE__ */ vue.defineComponent({
@@ -18730,14 +18777,16 @@
18730
18777
  slots
18731
18778
  }) {
18732
18779
  const loading = vue.ref(false);
18733
- const listValues = vue.ref([]);
18734
18780
  const {
18735
18781
  prefixCls
18736
18782
  } = useInjectForm();
18783
+ const formItemContext = antDesignVue.Form.useInjectFormItemContext();
18737
18784
  const keyRef = vue.shallowRef({
18738
18785
  keys: [],
18739
18786
  id: 0
18740
18787
  });
18788
+ let lastActionVersion = 0;
18789
+ let watchedActionVersion = 0;
18741
18790
  const {
18742
18791
  fieldValue,
18743
18792
  onValueChange
@@ -18747,31 +18796,35 @@
18747
18796
  convertValue: props.convertValue,
18748
18797
  transform: props.transform
18749
18798
  });
18750
- const formItemContext = antDesignVue.Form.useInjectFormItemContext();
18751
18799
  const count = vue.computed(() => {
18752
18800
  var _a, _b;
18753
18801
  return (_b = (_a = fieldValue.value) == null ? void 0 : _a.length) != null ? _b : 0;
18754
18802
  });
18755
18803
  const action = {
18756
18804
  add: async (defaultValue, index) => {
18757
- var _a, _b, _c;
18805
+ var _a, _b;
18758
18806
  if ((_a = props.actionGuard) == null ? void 0 : _a.beforeAddRow) {
18759
18807
  const success = await ((_b = props.actionGuard) == null ? void 0 : _b.beforeAddRow(defaultValue, index, count.value));
18760
18808
  if (!success) {
18761
18809
  return false;
18762
18810
  }
18763
18811
  }
18764
- const newValue = cloneDeep((_c = fieldValue.value) != null ? _c : []);
18812
+ const newValue = fieldValue.value ? [...fieldValue.value] : [];
18765
18813
  if (index !== void 0 && index >= 0 && index <= newValue.length) {
18766
- keyRef.value.keys = [...keyRef.value.keys.slice(0, index), keyRef.value.id, ...keyRef.value.keys.slice(index)];
18767
- onValueChange(cloneDeep([...newValue.slice(0, index), defaultValue, ...newValue.slice(index)]));
18768
- formItemContext.onFieldChange();
18814
+ keyRef.value = {
18815
+ keys: [...keyRef.value.keys.slice(0, index), keyRef.value.id, ...keyRef.value.keys.slice(index)],
18816
+ id: keyRef.value.id + 1
18817
+ };
18818
+ onValueChange([...newValue.slice(0, index), defaultValue, ...newValue.slice(index)]);
18769
18819
  } else {
18770
- keyRef.value.keys = [...keyRef.value.keys, keyRef.value.id];
18771
- onValueChange(cloneDeep([...newValue, defaultValue]));
18772
- formItemContext.onFieldChange();
18820
+ keyRef.value = {
18821
+ keys: [...keyRef.value.keys, keyRef.value.id],
18822
+ id: keyRef.value.id + 1
18823
+ };
18824
+ onValueChange([...newValue, defaultValue]);
18773
18825
  }
18774
- keyRef.value.id += 1;
18826
+ lastActionVersion++;
18827
+ formItemContext.onFieldChange();
18775
18828
  Promise.resolve().then(() => {
18776
18829
  var _a2;
18777
18830
  (_a2 = props.onAfterAdd) == null ? void 0 : _a2.call(props, defaultValue, index, count.value);
@@ -18779,21 +18832,24 @@
18779
18832
  return true;
18780
18833
  },
18781
18834
  remove: async (index) => {
18782
- var _a, _b, _c;
18835
+ var _a, _b;
18783
18836
  if ((_a = props.actionGuard) == null ? void 0 : _a.beforeRemoveRow) {
18784
18837
  const success = await ((_b = props.actionGuard) == null ? void 0 : _b.beforeRemoveRow(index, count.value));
18785
18838
  if (!success) {
18786
18839
  return false;
18787
18840
  }
18788
18841
  }
18789
- const newValue = cloneDeep((_c = fieldValue.value) != null ? _c : []);
18842
+ const newValue = fieldValue.value ? [...fieldValue.value] : [];
18790
18843
  const indexSet = new Set(Array.isArray(index) ? index : [index]);
18791
18844
  if (indexSet.size <= 0) {
18792
18845
  return false;
18793
18846
  }
18794
- keyRef.value.keys = keyRef.value.keys.filter((_, keysIndex) => !indexSet.has(keysIndex));
18795
- const value = newValue.filter((_, valueIndex) => !indexSet.has(valueIndex));
18796
- onValueChange(value);
18847
+ keyRef.value = {
18848
+ keys: keyRef.value.keys.filter((_, keysIndex) => !indexSet.has(keysIndex)),
18849
+ id: keyRef.value.id
18850
+ };
18851
+ onValueChange(newValue.filter((_, valueIndex) => !indexSet.has(valueIndex)));
18852
+ lastActionVersion++;
18797
18853
  formItemContext.onFieldChange();
18798
18854
  Promise.resolve().then(() => {
18799
18855
  var _a2;
@@ -18818,10 +18874,32 @@
18818
18874
  const onCopy = async (index) => {
18819
18875
  await action.add(cloneDeep(fieldValue.value[index]), count.value + 1);
18820
18876
  };
18821
- vue.watch(fieldValue, () => {
18822
- var _a;
18823
- if (!isEqual(listValues.value, fieldValue.value)) {
18824
- listValues.value = cloneDeep((_a = fieldValue.value) != null ? _a : []);
18877
+ vue.watch(fieldValue, (newVal, oldVal) => {
18878
+ var _a, _b;
18879
+ if (lastActionVersion !== watchedActionVersion) {
18880
+ watchedActionVersion = lastActionVersion;
18881
+ return;
18882
+ }
18883
+ const len = (_a = newVal == null ? void 0 : newVal.length) != null ? _a : 0;
18884
+ const keysLen = keyRef.value.keys.length;
18885
+ if (keysLen !== len) {
18886
+ const newKeys = [];
18887
+ for (let i = 0; i < len; i++) {
18888
+ newKeys.push((_b = keyRef.value.keys[i]) != null ? _b : keyRef.value.id++);
18889
+ }
18890
+ keyRef.value = {
18891
+ keys: newKeys,
18892
+ id: keyRef.value.id
18893
+ };
18894
+ } else if (newVal !== oldVal) {
18895
+ const newKeys = [];
18896
+ for (let i = 0; i < len; i++) {
18897
+ newKeys.push(keyRef.value.id++);
18898
+ }
18899
+ keyRef.value = {
18900
+ keys: newKeys,
18901
+ id: keyRef.value.id
18902
+ };
18825
18903
  }
18826
18904
  }, {
18827
18905
  immediate: true
@@ -18846,7 +18924,7 @@
18846
18924
  }, restProps, {
18847
18925
  "loading": loading.value,
18848
18926
  "onClick": onAdd
18849
- }), _isSlot$4(creatorButtonText) ? creatorButtonText : {
18927
+ }), _isSlot$5(creatorButtonText) ? creatorButtonText : {
18850
18928
  default: () => [creatorButtonText]
18851
18929
  });
18852
18930
  if (slots.creator) {
@@ -18862,17 +18940,15 @@
18862
18940
  return defaultDom;
18863
18941
  });
18864
18942
  return () => {
18865
- var _a, _b, _c, _d, _e, _f, _g;
18866
- if (props.readonly && !((_a = listValues.value) == null ? void 0 : _a.length)) {
18867
- listValues.value = [{}];
18868
- }
18943
+ var _a, _b, _c, _d, _e;
18944
+ const listData = props.readonly && !((_a = fieldValue.value) == null ? void 0 : _a.length) ? [{}] : (_b = fieldValue.value) != null ? _b : [];
18869
18945
  return vue.createVNode("div", {
18870
18946
  "style": "width: max-content; max-width: 100%; min-width: 100%; ",
18871
18947
  "class": {
18872
18948
  [`${prefixCls}-list-container`]: true,
18873
- [`${prefixCls}-list-empty`]: ((_c = (_b = fieldValue.value) != null ? _b : []) == null ? void 0 : _c.length) == 0
18949
+ [`${prefixCls}-list-empty`]: listData.length === 0
18874
18950
  }
18875
- }, [props.creatorButtonProps !== false && ((_d = props.creatorButtonProps) == null ? void 0 : _d.position) === "top" && creatorButton.value, ((_e = listValues.value) != null ? _e : []).map((record, index) => {
18951
+ }, [props.creatorButtonProps !== false && ((_c = props.creatorButtonProps) == null ? void 0 : _c.position) === "top" && creatorButton.value, listData.map((record, index) => {
18876
18952
  let key = keyRef.value.keys[index];
18877
18953
  if (key === void 0) {
18878
18954
  keyRef.value.keys[index] = keyRef.value.id;
@@ -18905,7 +18981,7 @@
18905
18981
  action: slots.action,
18906
18982
  item: slots.item
18907
18983
  });
18908
- }), props.creatorButtonProps !== false && (((_f = props.creatorButtonProps) == null ? void 0 : _f.position) === "bottom" || ((_g = props.creatorButtonProps) == null ? void 0 : _g.position) === void 0) && creatorButton.value]);
18984
+ }), props.creatorButtonProps !== false && (((_d = props.creatorButtonProps) == null ? void 0 : _d.position) === "bottom" || ((_e = props.creatorButtonProps) == null ? void 0 : _e.position) === void 0) && creatorButton.value]);
18909
18985
  };
18910
18986
  }
18911
18987
  });
@@ -19062,8 +19138,10 @@
19062
19138
  });
19063
19139
  });
19064
19140
  const items = vue.computed(() => {
19065
- var _a, _b;
19066
- return (_b = formatItems == null ? void 0 : formatItems(runFunction((_a = props.items) != null ? _a : [], formData.value))) != null ? _b : [];
19141
+ var _a, _b, _c;
19142
+ const raw = (_a = props.items) != null ? _a : [];
19143
+ const fields = (_b = typeof raw === "function" ? runFunction(raw, formData.value) : raw) != null ? _b : [];
19144
+ return (_c = formatItems == null ? void 0 : formatItems(fields)) != null ? _c : [];
19067
19145
  });
19068
19146
  const slotsGetter = vue.computed(() => {
19069
19147
  const temp = {};
@@ -19791,6 +19869,7 @@
19791
19869
  formKey,
19792
19870
  prefixCls,
19793
19871
  formData,
19872
+ formDataVersion,
19794
19873
  readonly,
19795
19874
  readonlyProps,
19796
19875
  disabledKeys,
@@ -19809,6 +19888,7 @@
19809
19888
  rowData
19810
19889
  } = useInjectFormList();
19811
19890
  const formSlotsContext = useInjectSlots$1();
19891
+ const formItemContext = antDesignVue.Form.useInjectFormItemContext();
19812
19892
  const {
19813
19893
  fieldValue,
19814
19894
  onValueChange
@@ -19829,7 +19909,11 @@
19829
19909
  });
19830
19910
  const mergeReadonly = vue.computed(() => {
19831
19911
  var _a;
19832
- return runFunction((_a = props.item.readonly) != null ? _a : readonly == null ? void 0 : readonly.value, formData.value, rowData == null ? void 0 : rowData.value);
19912
+ const readonlyProp = (_a = props.item.readonly) != null ? _a : readonly == null ? void 0 : readonly.value;
19913
+ if (typeof readonlyProp === "function") {
19914
+ return runFunction(readonlyProp, formData.value, rowData == null ? void 0 : rowData.value);
19915
+ }
19916
+ return readonlyProp;
19833
19917
  });
19834
19918
  const mergeReadonlyProps = vue.computed(() => merge({}, readonlyProps == null ? void 0 : readonlyProps.value, props.item.readonlyProps));
19835
19919
  const linkageDisabledKeys = vue.computed(() => disabledKeys.value.map((key) => key.split(":")[1]));
@@ -19840,17 +19924,22 @@
19840
19924
  });
19841
19925
  const formItemProps = vue.computed(() => {
19842
19926
  var _a;
19843
- return (_a = runFunction(props.item.formItemProps, formData.value, rowData == null ? void 0 : rowData.value)) != null ? _a : {};
19927
+ const raw = props.item.formItemProps;
19928
+ if (typeof raw === "function") {
19929
+ return (_a = runFunction(raw, formData.value, rowData == null ? void 0 : rowData.value)) != null ? _a : {};
19930
+ }
19931
+ return raw != null ? raw : {};
19844
19932
  });
19845
19933
  const restItemProps = vue.computed(() => {
19846
19934
  var _a, _b, _c, _d, _e, _f, _g, _h;
19935
+ const rulesProp = (_a = props.item.rules) != null ? _a : formItemProps.value.rules;
19847
19936
  return omitUndefined({
19848
19937
  ...pickKeys(formItemProps.value, ALL_ANTD_PROP_KEYS),
19849
- labelCol: (_b = (_a = formItemProps.value) == null ? void 0 : _a.labelCol) != null ? _b : labelCol == null ? void 0 : labelCol.value,
19850
- wrapperCol: (_d = (_c = formItemProps.value) == null ? void 0 : _c.wrapperCol) != null ? _d : wrapperCol == null ? void 0 : wrapperCol.value,
19938
+ labelCol: (_c = (_b = formItemProps.value) == null ? void 0 : _b.labelCol) != null ? _c : labelCol == null ? void 0 : labelCol.value,
19939
+ wrapperCol: (_e = (_d = formItemProps.value) == null ? void 0 : _d.wrapperCol) != null ? _e : wrapperCol == null ? void 0 : wrapperCol.value,
19851
19940
  name: mergeReadonly.value ? void 0 : props.item.name,
19852
- htmlFor: mergeReadonly.value ? void 0 : (_g = (_e = formItemProps.value) == null ? void 0 : _e.htmlFor) != null ? _g : `form-${(_f = formKey.value) != null ? _f : ""}-${props.item.key}`,
19853
- rules: mergeReadonly.value ? void 0 : runFunction((_h = props.item.rules) != null ? _h : formItemProps.value.rules, formData.value, action, rowData == null ? void 0 : rowData.value)
19941
+ htmlFor: mergeReadonly.value ? void 0 : (_h = (_f = formItemProps.value) == null ? void 0 : _f.htmlFor) != null ? _h : `form-${(_g = formKey.value) != null ? _g : ""}-${props.item.key}`,
19942
+ rules: mergeReadonly.value ? void 0 : runFunction(rulesProp, formData.value, action, rowData == null ? void 0 : rowData.value)
19854
19943
  });
19855
19944
  });
19856
19945
  const clearOnChange = (newValue) => {
@@ -19861,27 +19950,33 @@
19861
19950
  if (clear) {
19862
19951
  const clearNamePaths = (_b = runFunction(clear, newValue, formData.value, rowData == null ? void 0 : rowData.value)) != null ? _b : [];
19863
19952
  if (clearNamePaths.length > 0) {
19953
+ let changed = false;
19864
19954
  clearNamePaths.forEach((namePath) => {
19865
19955
  var _a2;
19866
19956
  const path = isList ? [...(_a2 = listName == null ? void 0 : listName.value) != null ? _a2 : [], ...covertFormName(namePath)].filter((item) => item !== void 0).flat(1) : covertFormName(namePath);
19867
19957
  const value = get(formData.value, path);
19868
19958
  if (typeof value !== "undefined") {
19869
19959
  set(formData.value, path, void 0);
19960
+ changed = true;
19870
19961
  }
19871
19962
  });
19963
+ if (changed) {
19964
+ formDataVersion.value++;
19965
+ }
19872
19966
  }
19873
19967
  }
19874
19968
  };
19875
19969
  const fieldProps = vue.computed(() => {
19876
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
19877
- const baseProps = runFunction((_a = props.item.fieldProps) != null ? _a : {}, formData.value, action, rowData == null ? void 0 : rowData.value);
19970
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i;
19971
+ const raw = props.item.fieldProps;
19972
+ const baseProps = runFunction(raw != null ? raw : {}, formData.value, action, rowData == null ? void 0 : rowData.value);
19878
19973
  const mergeProps = {
19879
19974
  ...baseProps,
19880
- id: (_c = baseProps == null ? void 0 : baseProps.id) != null ? _c : `form-${(_b = formKey.value) != null ? _b : ""}-${props.item.key}`,
19881
- disabled: ((_e = runFunction((_d = props.item.disabled) != null ? _d : baseProps == null ? void 0 : baseProps.disabled, formData.value, rowData == null ? void 0 : rowData.value)) != null ? _e : allDisabledKeys.value.includes(props.item.key)) ? true : void 0,
19882
- placeholder: (_f = props.item.placeholder) != null ? _f : baseProps == null ? void 0 : baseProps.placeholder,
19883
- options: (_h = (_g = props.item.options) != null ? _g : baseProps == null ? void 0 : baseProps.options) != null ? _h : baseProps == null ? void 0 : baseProps.treeData,
19884
- allowClear: (_j = (_i = props.item.allowClear) != null ? _i : baseProps == null ? void 0 : baseProps.allowClear) != null ? _j : true
19975
+ id: (_b = baseProps == null ? void 0 : baseProps.id) != null ? _b : `form-${(_a = formKey.value) != null ? _a : ""}-${props.item.key}`,
19976
+ disabled: ((_d = runFunction((_c = props.item.disabled) != null ? _c : baseProps == null ? void 0 : baseProps.disabled, formData.value, rowData == null ? void 0 : rowData.value)) != null ? _d : allDisabledKeys.value.includes(props.item.key)) ? true : void 0,
19977
+ placeholder: (_e = props.item.placeholder) != null ? _e : baseProps == null ? void 0 : baseProps.placeholder,
19978
+ options: (_g = (_f = props.item.options) != null ? _f : baseProps == null ? void 0 : baseProps.options) != null ? _g : baseProps == null ? void 0 : baseProps.treeData,
19979
+ allowClear: (_i = (_h = props.item.allowClear) != null ? _h : baseProps == null ? void 0 : baseProps.allowClear) != null ? _i : true
19885
19980
  };
19886
19981
  return omitUndefined({
19887
19982
  valueEnum: props.item.valueEnum,
@@ -19894,6 +19989,7 @@
19894
19989
  var _a2, _b2;
19895
19990
  clearOnChange(value);
19896
19991
  onValueChange(value);
19992
+ formItemContext.onFieldChange();
19897
19993
  (_b2 = (_a2 = props.item).onChange) == null ? void 0 : _b2.call(_a2, value, ...args, action);
19898
19994
  },
19899
19995
  ...fieldPropsMap[fieldType.value] ? pickKeys(mergeProps, fieldPropsMap[fieldType.value]) : mergeProps
@@ -19901,9 +19997,8 @@
19901
19997
  });
19902
19998
  const fieldStyle = vue.computed(() => {
19903
19999
  var _a;
19904
- const baseProps = runFunction((_a = props.item.fieldProps) != null ? _a : {}, formData.value, rowData == null ? void 0 : rowData.value);
19905
20000
  const newStyle = {
19906
- ...baseProps == null ? void 0 : baseProps.style
20001
+ ...(_a = fieldProps.value) == null ? void 0 : _a.style
19907
20002
  };
19908
20003
  if (props.item.width && !fieldWidthSizeMap[props.item.width]) {
19909
20004
  newStyle.width = isNumber$2(props.item.width) ? props.item.width + "px" : props.item.width;
@@ -19999,8 +20094,10 @@
19999
20094
  vue.watch(() => {
20000
20095
  var _a;
20001
20096
  return (_a = restItemProps.value) == null ? void 0 : _a.rules;
20002
- }, () => {
20003
- action.clearValidate(props.item.name);
20097
+ }, (newRules, oldRules) => {
20098
+ if (!isEqual(newRules, oldRules)) {
20099
+ action.clearValidate(props.item.name);
20100
+ }
20004
20101
  });
20005
20102
  return () => {
20006
20103
  var _a, _b;
@@ -20067,6 +20164,9 @@
20067
20164
  }
20068
20165
  });
20069
20166
 
20167
+ function _isSlot$4(s) {
20168
+ return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !vue.isVNode(s);
20169
+ }
20070
20170
  const LIST_PROP_KEYS = ["min", "max", "rowTitle", "rowTitleStyle", "alwaysShowRowTitle", "isValidateList", "emptyListMessage", "creatorRecord", "creatorButtonProps", "alwaysShowItemLabel", "actionGuard", "copyIconProps", "deleteIconProps", "onAfterAdd", "onAfterRemove"];
20071
20171
  const LIST_SLOT_NAMES = ["action", "creator", "item"];
20072
20172
  var FormItems = /* @__PURE__ */ vue.defineComponent({
@@ -20105,86 +20205,86 @@
20105
20205
  var _a;
20106
20206
  return (_a = props.grid) != null ? _a : grid == null ? void 0 : grid.value;
20107
20207
  });
20108
- const getItemsDom = vue.computed(() => {
20109
- return props.list.filter((item) => !allHiddenKeys.value.includes(item.key)).map((item) => {
20110
- var _a;
20111
- if (item.fieldType === ProFieldType.GROUP) {
20112
- return vue.createVNode(FormGroup, {
20113
- "key": item.key,
20114
- "items": item.children,
20115
- "title": item.title,
20116
- "tooltip": item.tooltip,
20117
- "colProps": item.colProps,
20118
- "rowProps": item.rowProps,
20119
- "spaceProps": item.spaceProps,
20120
- "grid": item.grid,
20121
- "item": item,
20122
- "formItemProps": item.formItemProps
20123
- }, null);
20124
- }
20125
- if (item.fieldType === ProFieldType.FORM_SET) {
20126
- return vue.createVNode(FormSet, {
20127
- "key": item.key,
20128
- "name": item.name,
20129
- "items": item.children,
20130
- "title": item.title,
20131
- "tooltip": item.tooltip,
20132
- "colProps": item.colProps,
20133
- "rowProps": item.rowProps,
20134
- "spaceProps": item.spaceProps,
20135
- "formItemProps": item.formItemProps,
20136
- "initialValue": item.initialValue,
20137
- "convertValue": item.convertValue,
20138
- "transform": item.transform
20139
- }, null);
20140
- }
20141
- if (item.fieldType === ProFieldType.FORM_LIST) {
20142
- const fieldProps = omitUndefined(pickKeys((_a = item.fieldProps) != null ? _a : {}, LIST_PROP_KEYS));
20143
- const slotsGetter = {};
20144
- LIST_SLOT_NAMES.forEach((name) => {
20145
- var _a2;
20146
- const slot = getSlot((_a2 = item.fieldProps) == null ? void 0 : _a2[`${name}Render`], formSlotsContext);
20147
- if (slot) {
20148
- slotsGetter[name] = (args) => vue.createVNode(RenderVNode$1, {
20149
- "vnode": slot,
20150
- "props": args
20151
- }, null);
20152
- }
20153
- });
20154
- return vue.createVNode(FormList, vue.mergeProps({
20155
- "key": item.key,
20156
- "name": item.name,
20157
- "originName": item.originName,
20158
- "items": item.children,
20159
- "title": item.title,
20160
- "tooltip": item.tooltip,
20161
- "rules": item.rules,
20162
- "colProps": item.colProps,
20163
- "rowProps": item.rowProps,
20164
- "formItemProps": item.formItemProps,
20165
- "initialValue": item.initialValue,
20166
- "convertValue": item.convertValue,
20167
- "transform": item.transform
20168
- }, fieldProps), {
20169
- ...slotsGetter
20170
- });
20171
- }
20172
- return vue.createVNode(FormItem, {
20208
+ const visibleList = vue.computed(() => props.list.filter((item) => !allHiddenKeys.value.includes(item.key)));
20209
+ const renderItem = (item) => {
20210
+ var _a;
20211
+ if (item.fieldType === ProFieldType.GROUP) {
20212
+ return vue.createVNode(FormGroup, {
20173
20213
  "key": item.key,
20214
+ "items": item.children,
20215
+ "title": item.title,
20216
+ "tooltip": item.tooltip,
20217
+ "colProps": item.colProps,
20218
+ "rowProps": item.rowProps,
20219
+ "spaceProps": item.spaceProps,
20220
+ "grid": item.grid,
20174
20221
  "item": item,
20175
- "grid": mergeGrid.value
20222
+ "formItemProps": item.formItemProps
20176
20223
  }, null);
20177
- });
20178
- });
20224
+ }
20225
+ if (item.fieldType === ProFieldType.FORM_SET) {
20226
+ return vue.createVNode(FormSet, {
20227
+ "key": item.key,
20228
+ "name": item.name,
20229
+ "items": item.children,
20230
+ "title": item.title,
20231
+ "tooltip": item.tooltip,
20232
+ "colProps": item.colProps,
20233
+ "rowProps": item.rowProps,
20234
+ "spaceProps": item.spaceProps,
20235
+ "formItemProps": item.formItemProps,
20236
+ "initialValue": item.initialValue,
20237
+ "convertValue": item.convertValue,
20238
+ "transform": item.transform
20239
+ }, null);
20240
+ }
20241
+ if (item.fieldType === ProFieldType.FORM_LIST) {
20242
+ const fieldProps = omitUndefined(pickKeys((_a = item.fieldProps) != null ? _a : {}, LIST_PROP_KEYS));
20243
+ const slotsGetter = {};
20244
+ LIST_SLOT_NAMES.forEach((name) => {
20245
+ var _a2;
20246
+ const slot = getSlot((_a2 = item.fieldProps) == null ? void 0 : _a2[`${name}Render`], formSlotsContext);
20247
+ if (slot) {
20248
+ slotsGetter[name] = (args) => vue.createVNode(RenderVNode$1, {
20249
+ "vnode": slot,
20250
+ "props": args
20251
+ }, null);
20252
+ }
20253
+ });
20254
+ return vue.createVNode(FormList, vue.mergeProps({
20255
+ "key": item.key,
20256
+ "name": item.name,
20257
+ "originName": item.originName,
20258
+ "items": item.children,
20259
+ "title": item.title,
20260
+ "tooltip": item.tooltip,
20261
+ "rules": item.rules,
20262
+ "colProps": item.colProps,
20263
+ "rowProps": item.rowProps,
20264
+ "formItemProps": item.formItemProps,
20265
+ "initialValue": item.initialValue,
20266
+ "convertValue": item.convertValue,
20267
+ "transform": item.transform
20268
+ }, fieldProps), {
20269
+ ...slotsGetter
20270
+ });
20271
+ }
20272
+ return vue.createVNode(FormItem, {
20273
+ "key": item.key,
20274
+ "item": item,
20275
+ "grid": mergeGrid.value
20276
+ }, null);
20277
+ };
20179
20278
  return () => {
20279
+ const items = visibleList.value.map(renderItem);
20180
20280
  if (props.type === "space" && !(mergeGrid == null ? void 0 : mergeGrid.value)) {
20181
20281
  return vue.createVNode(antDesignVue.Space, vue.mergeProps(props.spaceProps, {
20182
20282
  "align": "start"
20183
- }), {
20184
- default: () => [getItemsDom.value]
20283
+ }), _isSlot$4(items) ? items : {
20284
+ default: () => [items]
20185
20285
  });
20186
20286
  }
20187
- return getItemsDom.value;
20287
+ return items;
20188
20288
  };
20189
20289
  }
20190
20290
  });
@@ -20387,6 +20487,7 @@
20387
20487
  const formRef = vue.ref();
20388
20488
  const prefixCls = usePrefixCls("form");
20389
20489
  const formData = vue.ref({});
20490
+ const formDataVersion = vue.ref(0);
20390
20491
  const formItems = vue.ref([]);
20391
20492
  const formKey = vue.computed(() => {
20392
20493
  var _a;
@@ -20409,7 +20510,7 @@
20409
20510
  const formProps = vue.computed(() => {
20410
20511
  var _a;
20411
20512
  return {
20412
- ...omitUndefined(omit(props, ["colProps", "submitter", "loading", "showLoading", "omitNil", "grid", "theme", "colon", "customUi", "gridSubmitter", "requestAbort", "isKeyPressSubmit", "formKey", "initialValues", "rowProps", "dateFormatter", "params", "readonly", "readonlyProps", "items", "request", "validateMessages", "requiredMark", "labelAlign", "labelCol", "wrapperCol", "submitOnLoading", "onLoadingChange", "onFinish", "onValuesChange"])),
20513
+ ...omitUndefined(omit(props, ["colProps", "submitter", "loading", "showLoading", "omitNil", "grid", "theme", "colon", "customUi", "gridSubmitter", "requestAbort", "isKeyPressSubmit", "formKey", "initialValues", "rowProps", "dateFormatter", "params", "readonly", "readonlyProps", "items", "request", "validateMessages", "requiredMark", "labelAlign", "labelCol", "wrapperCol", "submitOnLoading", "onLoadingChange", "onFinish", "onFinishFailed", "onReset", "onValuesChange", "onInit"])),
20413
20514
  layout: (_a = props.layout) != null ? _a : "vertical"
20414
20515
  };
20415
20516
  });
@@ -20451,6 +20552,7 @@
20451
20552
  vue.watch(initialValues, (newValues, oldValues) => {
20452
20553
  if (!isEqual(newValues, oldValues)) {
20453
20554
  formData.value = cloneDeep(convertKeyInitialValue(newValues, transformerMap.value));
20555
+ formDataVersion.value++;
20454
20556
  if (!props.request || props.requestAbort) {
20455
20557
  Promise.resolve().then(() => {
20456
20558
  hasInitial.value = false;
@@ -20458,8 +20560,7 @@
20458
20560
  }
20459
20561
  }
20460
20562
  }, {
20461
- immediate: true,
20462
- deep: true
20563
+ immediate: true
20463
20564
  });
20464
20565
  const onValuesChange = debounce(() => {
20465
20566
  var _a;
@@ -20482,18 +20583,17 @@
20482
20583
  }
20483
20584
  }
20484
20585
  };
20485
- vue.watch(formData, () => {
20586
+ vue.watch(formDataVersion, () => {
20486
20587
  if (!hasInitial.value) {
20487
20588
  onValuesChange();
20488
20589
  }
20489
- }, {
20490
- deep: true
20491
20590
  });
20492
20591
  const linkage = useLinkage();
20493
20592
  const action = useAction({
20494
20593
  props,
20495
20594
  formRef,
20496
20595
  formData,
20596
+ formDataVersion,
20497
20597
  initialValues,
20498
20598
  hasInitial,
20499
20599
  transformerMap,
@@ -20558,6 +20658,7 @@
20558
20658
  prefixCls,
20559
20659
  initialValues,
20560
20660
  formData,
20661
+ formDataVersion,
20561
20662
  hasInitial,
20562
20663
  theme: vue.computed(() => props.theme),
20563
20664
  customUi: vue.computed(() => props.customUi),
@@ -20650,7 +20751,8 @@
20650
20751
  emits: ["update:open"],
20651
20752
  setup(props, {
20652
20753
  slots,
20653
- emit
20754
+ emit,
20755
+ expose
20654
20756
  }) {
20655
20757
  const _open = vue.ref(false);
20656
20758
  const loading = vue.ref(false);
@@ -20762,6 +20864,7 @@
20762
20864
  (_c = (_b = formRef.value) == null ? void 0 : _b.reset) == null ? void 0 : _c.call(_b);
20763
20865
  }
20764
20866
  };
20867
+ expose(useFormExpose(formRef));
20765
20868
  const onFinishHandle = async (values) => {
20766
20869
  var _a;
20767
20870
  const response = (_a = props.onFinish) == null ? void 0 : _a.call(props, values);
@@ -20800,7 +20903,7 @@
20800
20903
  }
20801
20904
  }), {
20802
20905
  default: () => [vue.createVNode(BaseForm, vue.mergeProps(formProps.value, {
20803
- "submitter": submitterConfig.value,
20906
+ "submitter": props.readonly ? false : submitterConfig.value,
20804
20907
  "onFinish": async (values) => {
20805
20908
  const result = await onFinishHandle(values);
20806
20909
  return result;
@@ -20826,10 +20929,12 @@
20826
20929
  }
20827
20930
  }), formSlots.value)],
20828
20931
  ...drawerSlots.value,
20829
- footer: props.submitter !== false && !props.readonly ? () => vue.createVNode("div", {
20830
- "style": "display: flex; justify-content: flex-end;",
20831
- "ref": footerRef
20832
- }, null) : void 0
20932
+ ...props.submitter !== false && !props.readonly ? {
20933
+ footer: () => vue.createVNode("div", {
20934
+ "style": "display: flex; justify-content: flex-end;",
20935
+ "ref": footerRef
20936
+ }, null)
20937
+ } : {}
20833
20938
  }), triggerDom.value]);
20834
20939
  }
20835
20940
  });
@@ -20847,7 +20952,8 @@
20847
20952
  emits: ["update:open"],
20848
20953
  setup(props, {
20849
20954
  slots,
20850
- emit
20955
+ emit,
20956
+ expose
20851
20957
  }) {
20852
20958
  const _open = vue.ref(false);
20853
20959
  const loading = vue.ref(false);
@@ -20891,7 +20997,7 @@
20891
20997
  ...omit((_a = props.modalProps) != null ? _a : {}, ["title", "width", "footer", "onCancel", "afterClose"]),
20892
20998
  width: props.width,
20893
20999
  title: props.title,
20894
- footer: props.submitter === false ? null : void 0
21000
+ footer: props.readonly || props.submitter === false ? null : void 0
20895
21001
  });
20896
21002
  });
20897
21003
  const modalSlots = vue.computed(() => {
@@ -20961,6 +21067,7 @@
20961
21067
  (_c = (_b = formRef.value) == null ? void 0 : _b.reset) == null ? void 0 : _c.call(_b);
20962
21068
  }
20963
21069
  };
21070
+ expose(useFormExpose(formRef));
20964
21071
  const onFinishHandle = async (values) => {
20965
21072
  var _a;
20966
21073
  const response = (_a = props.onFinish) == null ? void 0 : _a.call(props, values);
@@ -20999,7 +21106,7 @@
20999
21106
  }
21000
21107
  }), {
21001
21108
  default: () => [vue.createVNode(BaseForm, vue.mergeProps(formProps.value, {
21002
- "submitter": submitterConfig.value,
21109
+ "submitter": props.readonly ? false : submitterConfig.value,
21003
21110
  "onFinish": async (values) => {
21004
21111
  const result = await onFinishHandle(values);
21005
21112
  return result;
@@ -21025,10 +21132,12 @@
21025
21132
  }
21026
21133
  }), formSlots.value)],
21027
21134
  ...modalSlots.value,
21028
- footer: props.submitter !== false && !props.readonly ? () => vue.createVNode("div", {
21029
- "style": "display: flex; justify-content: flex-end;",
21030
- "ref": footerRef
21031
- }, null) : void 0
21135
+ ...props.submitter !== false && !props.readonly ? {
21136
+ footer: () => vue.createVNode("div", {
21137
+ "style": "display: flex; justify-content: flex-end;",
21138
+ "ref": footerRef
21139
+ }, null)
21140
+ } : {}
21032
21141
  }), triggerDom.value]);
21033
21142
  }
21034
21143
  });
@@ -21077,7 +21186,7 @@
21077
21186
  const flatMapItems = (items, ignoreRules) => {
21078
21187
  return items == null ? void 0 : items.flatMap((item) => {
21079
21188
  if (item.fieldType === ProFieldType.GROUP && !item.title) {
21080
- return item.props.children;
21189
+ return item.children;
21081
21190
  }
21082
21191
  if (ignoreRules) {
21083
21192
  return {
@@ -21116,14 +21225,10 @@
21116
21225
  const {
21117
21226
  form
21118
21227
  } = useProConfigInject();
21119
- const totalSpan = vue.ref(0);
21120
- const totalSize = vue.ref(0);
21121
- const currentSpan = vue.ref(0);
21122
21228
  const intl = useIntl();
21123
21229
  const prefixCls = usePrefixCls("query-filter");
21124
21230
  const wrapEl = vue.useTemplateRef("wrapper");
21125
21231
  const formRef = vue.ref();
21126
- const processedList = vue.ref([]);
21127
21232
  const [width, setWidth] = useMergedState$1(defaultWidth);
21128
21233
  const formExpose = useFormExpose(formRef);
21129
21234
  useResizeObserver(wrapEl, useDebounceFn((entries) => {
@@ -21148,20 +21253,6 @@
21148
21253
  }
21149
21254
  return Math.max(1, 24 / spanSize.value.span - 1);
21150
21255
  });
21151
- const hiddenNum = vue.computed(() => props.showHiddenNum && processedList.value.filter((item) => item.hidden).length);
21152
- const needCollapse = vue.computed(() => {
21153
- if (totalSpan.value < 24 || totalSize.value <= showLength.value) {
21154
- return false;
21155
- }
21156
- return true;
21157
- });
21158
- const offset = vue.computed(() => {
21159
- const offsetSpan = currentSpan.value % 24 + spanSize.value.span;
21160
- if (offsetSpan > 24) {
21161
- return 24 - spanSize.value.span;
21162
- }
21163
- return 24 - offsetSpan;
21164
- });
21165
21256
  const formItemFixStyle = vue.computed(() => {
21166
21257
  var _a2, _b, _c;
21167
21258
  const labelWidth = (_c = (_b = props.labelWidth) != null ? _b : (_a2 = form == null ? void 0 : form.value) == null ? void 0 : _a2.labelWidth) != null ? _c : "80";
@@ -21188,6 +21279,80 @@
21188
21279
  emit("collapse", val);
21189
21280
  }
21190
21281
  });
21282
+ const processedResult = vue.computed(() => {
21283
+ var _a2;
21284
+ let _totalSpan = 0;
21285
+ let _totalSize = 0;
21286
+ let _currentSpan = 0;
21287
+ let list = [];
21288
+ if ((_a2 = props.items) == null ? void 0 : _a2.length) {
21289
+ let firstRowFull = false;
21290
+ list = flatMapItems(props.items, props.ignoreRules).map((item, index) => {
21291
+ var _a3;
21292
+ const colSize = (_a3 = item.colSize) != null ? _a3 : 1;
21293
+ const colSpan = Math.min(spanSize.value.span * (colSize || 1), 24);
21294
+ _totalSpan += colSpan;
21295
+ _totalSize += colSize;
21296
+ if (index === 0) {
21297
+ firstRowFull = colSpan === 24 && !item.hidden;
21298
+ }
21299
+ const hidden = item.hidden || collapsed.value && (firstRowFull || _totalSize > showLength.value) && !!index;
21300
+ if (hidden) {
21301
+ if (!props.preserve) {
21302
+ return {
21303
+ ...item,
21304
+ colProps: {
21305
+ span: 0
21306
+ },
21307
+ hidden: true
21308
+ };
21309
+ }
21310
+ return {
21311
+ ...item,
21312
+ colProps: {
21313
+ span: colSpan
21314
+ },
21315
+ hidden: true
21316
+ };
21317
+ }
21318
+ if (24 - _currentSpan % 24 < colSpan) {
21319
+ _totalSpan += 24 - _currentSpan % 24;
21320
+ _currentSpan += 24 - _currentSpan % 24;
21321
+ }
21322
+ _currentSpan += colSpan;
21323
+ return {
21324
+ ...item,
21325
+ hidden,
21326
+ formItemProps: {
21327
+ ...item.title ? formItemFixStyle.value : {},
21328
+ ...item.formItemProps
21329
+ },
21330
+ colProps: {
21331
+ span: colSpan
21332
+ }
21333
+ };
21334
+ });
21335
+ }
21336
+ return {
21337
+ list,
21338
+ totalSpan: _totalSpan,
21339
+ totalSize: _totalSize,
21340
+ currentSpan: _currentSpan
21341
+ };
21342
+ });
21343
+ const needCollapse = vue.computed(() => {
21344
+ if (processedResult.value.totalSpan < 24 || processedResult.value.totalSize <= showLength.value) {
21345
+ return false;
21346
+ }
21347
+ return true;
21348
+ });
21349
+ const offset = vue.computed(() => {
21350
+ const offsetSpan = processedResult.value.currentSpan % 24 + spanSize.value.span;
21351
+ if (offsetSpan > 24) {
21352
+ return 24 - spanSize.value.span;
21353
+ }
21354
+ return 24 - offsetSpan;
21355
+ });
21191
21356
  const formProps = vue.computed(() => {
21192
21357
  return {
21193
21358
  ...omitUndefined(omit(props, [
@@ -21238,66 +21403,7 @@
21238
21403
  }
21239
21404
  }, props.submitter);
21240
21405
  });
21241
- vue.watch([spanSize, collapsed, () => props.items], () => {
21242
- var _a2;
21243
- let firstRowFull = false;
21244
- currentSpan.value = 0;
21245
- totalSize.value = 0;
21246
- totalSpan.value = 0;
21247
- if ((_a2 = props.items) == null ? void 0 : _a2.length) {
21248
- processedList.value = flatMapItems(props.items, props.ignoreRules).map((item, index) => {
21249
- var _a3;
21250
- const colSize = (_a3 = item.colSize) != null ? _a3 : 1;
21251
- const colSpan = Math.min(spanSize.value.span * (colSize || 1), 24);
21252
- totalSpan.value += colSpan;
21253
- totalSize.value += colSize;
21254
- if (index === 0) {
21255
- firstRowFull = colSpan === 24 && !item.hidden;
21256
- }
21257
- const hidden = item.hidden || // 如果收起了
21258
- collapsed.value && (firstRowFull || // 如果 超过显示长度 且 总长度超过了 24
21259
- totalSize.value > showLength.value) && !!index;
21260
- if (hidden) {
21261
- if (!props.preserve) {
21262
- return {
21263
- ...item,
21264
- colProps: {
21265
- span: 0
21266
- },
21267
- hidden: true
21268
- };
21269
- }
21270
- return {
21271
- ...item,
21272
- colProps: {
21273
- span: colSpan
21274
- },
21275
- hidden: true
21276
- };
21277
- }
21278
- if (24 - currentSpan.value % 24 < colSpan) {
21279
- totalSpan.value += 24 - currentSpan.value % 24;
21280
- currentSpan.value += 24 - currentSpan.value % 24;
21281
- }
21282
- currentSpan.value += colSpan;
21283
- return {
21284
- ...item,
21285
- hidden,
21286
- formItemProps: {
21287
- ...item.title ? formItemFixStyle.value : {},
21288
- ...item.formItemProps
21289
- },
21290
- colProps: {
21291
- span: colSpan
21292
- }
21293
- };
21294
- });
21295
- } else {
21296
- processedList.value = [];
21297
- }
21298
- }, {
21299
- immediate: true
21300
- });
21406
+ const hiddenNum = vue.computed(() => props.showHiddenNum && processedResult.value.list.filter((item) => item.hidden).length);
21301
21407
  expose({
21302
21408
  formRef,
21303
21409
  ...formExpose
@@ -21321,7 +21427,7 @@
21321
21427
  "isKeyPressSubmit": (_a2 = props.isKeyPressSubmit) != null ? _a2 : true,
21322
21428
  "showLoading": false,
21323
21429
  "submitter": submitterConfig.value,
21324
- "items": processedList.value,
21430
+ "items": processedResult.value.list,
21325
21431
  "layout": spanSize.value.layout,
21326
21432
  "onReset": (values) => {
21327
21433
  var _a3, _b, _c, _d;
@@ -26260,43 +26366,68 @@
26260
26366
  }
26261
26367
  target.__resizeObserver__rect = { width: newWidth, height: newHeight };
26262
26368
  }
26263
- function resizeDisconnect(el) {
26264
- if (el.__resizeObserver__listeners) {
26265
- el.__resizeObserver__listeners.unobserve(el);
26266
- el.__resizeObserver__listeners.disconnect();
26267
- el.__resizeObserver__listeners = null;
26369
+ const sharedObservers = {};
26370
+ const observerRefCounts = {};
26371
+ function getSharedObserver(arg) {
26372
+ const key = arg || "__default__";
26373
+ if (!sharedObservers[key]) {
26374
+ sharedObservers[key] = new index((entries) => {
26375
+ for (let i = 0; i < entries.length; i++) {
26376
+ const entry = entries[i];
26377
+ const target = entry.target;
26378
+ resizeHandler(
26379
+ target,
26380
+ target.__resizeObserver__arg,
26381
+ entry.contentRect,
26382
+ target.__resizeObserver__rect || {}
26383
+ );
26384
+ }
26385
+ });
26386
+ observerRefCounts[key] = 0;
26268
26387
  }
26388
+ return sharedObservers[key];
26269
26389
  }
26270
- function resizeCallbackFactory(arg) {
26271
- return function(entries) {
26272
- const target = entries[0].target;
26273
- resizeHandler(target, arg, target.getBoundingClientRect(), target.__resizeObserver__rect || {});
26274
- };
26390
+ function sharedObserve(el, arg) {
26391
+ const key = arg || "__default__";
26392
+ el.__resizeObserver__arg = arg;
26393
+ const observer = getSharedObserver(arg);
26394
+ observer.observe(el);
26395
+ observerRefCounts[key] = (observerRefCounts[key] || 0) + 1;
26396
+ }
26397
+ function sharedUnobserve(el, arg) {
26398
+ const key = arg || "__default__";
26399
+ const observer = sharedObservers[key];
26400
+ if (observer) {
26401
+ observer.unobserve(el);
26402
+ observerRefCounts[key]--;
26403
+ if (observerRefCounts[key] <= 0) {
26404
+ observer.disconnect();
26405
+ delete sharedObservers[key];
26406
+ delete observerRefCounts[key];
26407
+ }
26408
+ }
26409
+ el.__resizeObserver__arg = void 0;
26275
26410
  }
26276
26411
  const resize = {
26277
26412
  created(el, binding) {
26278
26413
  const { arg, value = true } = binding;
26279
26414
  if (value) {
26280
- const resizeObserver = new index(resizeCallbackFactory(arg));
26281
- resizeObserver.observe(el);
26282
- el.__resizeObserver__listeners = resizeObserver;
26415
+ sharedObserve(el, arg);
26283
26416
  }
26284
26417
  },
26285
26418
  updated(el, binding) {
26286
26419
  const { arg, value = true } = binding;
26287
- if (value && !el.__resizeObserver__listeners) {
26288
- const resizeObserver = new index(resizeCallbackFactory(arg));
26289
- resizeObserver.observe(el);
26290
- el.__resizeObserver__listeners = resizeObserver;
26291
- } else if (!value) {
26292
- resizeDisconnect(el);
26420
+ if (value && el.__resizeObserver__arg === void 0) {
26421
+ sharedObserve(el, arg);
26422
+ } else if (!value && el.__resizeObserver__arg !== void 0) {
26423
+ sharedUnobserve(el, arg);
26293
26424
  }
26294
26425
  },
26295
26426
  beforeUnmount(el, binding) {
26296
26427
  const { arg, value = true } = binding;
26297
26428
  if (value) {
26298
26429
  resizeHandler(el, arg, { width: 0, height: 0 }, el.__resizeObserver__rect || {});
26299
- resizeDisconnect(el);
26430
+ sharedUnobserve(el, arg);
26300
26431
  }
26301
26432
  }
26302
26433
  };
@@ -26933,189 +27064,201 @@
26933
27064
  }
26934
27065
  mergeColumns.value = newColumns;
26935
27066
  });
26936
- vue.watch(
26937
- [mergeColumns, baseHeight, bodyScrollWidth, measureWidthRef],
26938
- () => {
26939
- var _a, _b, _c, _d;
26940
- const originMergeColumns = mergeColumns.value;
26941
- let newMaxRowSpan = 1;
26942
- const newLeftColumns = [];
26943
- const newRightColumns = [];
26944
- const newCenterColumns = [];
26945
- const newAutoHeightColumns = [];
26946
- const newLeftHeaderColumns = [];
26947
- const newRightHeaderColumns = [];
26948
- const newCenterHeaderColumns = [];
26949
- keyColumnMap.value = /* @__PURE__ */ new Map();
26950
- if (!measureWidthRef.value) {
26951
- return;
26952
- }
26953
- const autoWidthColumns = [];
26954
- let finallyWidthTotal = 0;
26955
- const genColumns = (allCols, leftHeaderCols, centerHeaderCols, rightHeaderCols, rowSpan, pos, fix) => {
26956
- for (let i = 0, len = allCols.length; i < len; i++) {
26957
- const originColumn = allCols[i];
26958
- if (!originColumn) {
26959
- continue;
27067
+ let columnsRafFrame;
27068
+ let isFirstRun = true;
27069
+ const recalcColumns = () => {
27070
+ var _a, _b, _c, _d;
27071
+ const originMergeColumns = mergeColumns.value;
27072
+ let newMaxRowSpan = 1;
27073
+ const newLeftColumns = [];
27074
+ const newRightColumns = [];
27075
+ const newCenterColumns = [];
27076
+ const newAutoHeightColumns = [];
27077
+ const newLeftHeaderColumns = [];
27078
+ const newRightHeaderColumns = [];
27079
+ const newCenterHeaderColumns = [];
27080
+ keyColumnMap.value = /* @__PURE__ */ new Map();
27081
+ if (!measureWidthRef.value) {
27082
+ return;
27083
+ }
27084
+ const autoWidthColumns = [];
27085
+ let finallyWidthTotal = 0;
27086
+ const genColumns = (allCols, leftHeaderCols, centerHeaderCols, rightHeaderCols, rowSpan, pos, fix) => {
27087
+ for (let i = 0, len = allCols.length; i < len; i++) {
27088
+ const originColumn = allCols[i];
27089
+ if (!originColumn) {
27090
+ continue;
27091
+ }
27092
+ const {
27093
+ width,
27094
+ fixed = fix,
27095
+ children,
27096
+ ellipsis = false,
27097
+ tooltip,
27098
+ minWidth,
27099
+ maxWidth
27100
+ } = originColumn;
27101
+ const columnWidth = columnWidthByString(measureWidthRef.value, bodyScrollWidth.value, width);
27102
+ const columnMinWidth = columnWidthByString(
27103
+ measureWidthRef.value,
27104
+ bodyScrollWidth.value,
27105
+ minWidth
27106
+ );
27107
+ const columnMaxWidth = maxWidth ? columnWidthByString(measureWidthRef.value, bodyScrollWidth.value, maxWidth) : 1 / 0;
27108
+ const finallyWidth = Math.min(Math.max(columnWidth, columnMinWidth), columnMaxWidth);
27109
+ const columnPos = getColumnPos(i, pos);
27110
+ const columnKey = originColumn.columnKey || originColumn.key || columnPos;
27111
+ const parseFiexed = fixed === true ? "left" : fixed;
27112
+ const finallyColumn = Object.assign({}, originColumn, {
27113
+ finallyWidth,
27114
+ columnKey,
27115
+ originColumn,
27116
+ showTitle: !tooltip && (ellipsis === true || typeof ellipsis === "object" && (ellipsis == null ? void 0 : ellipsis.showTitle) !== false),
27117
+ fixed: parseFiexed,
27118
+ hidden: true === originColumn.hidden
27119
+ });
27120
+ keyColumnMap.value.set(columnKey, finallyColumn);
27121
+ if (finallyColumn.hidden) {
27122
+ break;
27123
+ }
27124
+ if (children && children.length) {
27125
+ finallyColumn.children = [];
27126
+ if (parseFiexed === "left") {
27127
+ leftHeaderCols.push(finallyColumn);
27128
+ } else if (parseFiexed === "right") {
27129
+ rightHeaderCols.push(finallyColumn);
27130
+ } else {
27131
+ centerHeaderCols.push(finallyColumn);
26960
27132
  }
26961
- const {
26962
- width,
26963
- fixed = fix,
27133
+ newMaxRowSpan = Math.max(newMaxRowSpan, rowSpan + 1);
27134
+ genColumns(
26964
27135
  children,
26965
- ellipsis = false,
26966
- tooltip,
26967
- minWidth,
26968
- maxWidth
26969
- } = originColumn;
26970
- const columnWidth = columnWidthByString(
26971
- measureWidthRef.value,
26972
- bodyScrollWidth.value,
26973
- width
26974
- );
26975
- const columnMinWidth = columnWidthByString(
26976
- measureWidthRef.value,
26977
- bodyScrollWidth.value,
26978
- minWidth
27136
+ finallyColumn.children,
27137
+ finallyColumn.children,
27138
+ finallyColumn.children,
27139
+ rowSpan + 1,
27140
+ columnPos,
27141
+ parseFiexed
26979
27142
  );
26980
- const columnMaxWidth = maxWidth ? columnWidthByString(measureWidthRef.value, bodyScrollWidth.value, maxWidth) : 1 / 0;
26981
- const finallyWidth = Math.min(Math.max(columnWidth, columnMinWidth), columnMaxWidth);
26982
- const columnPos = getColumnPos(i, pos);
26983
- const columnKey = originColumn.columnKey || originColumn.key || columnPos;
26984
- const parseFiexed = fixed === true ? "left" : fixed;
26985
- const finallyColumn = Object.assign({}, originColumn, {
26986
- finallyWidth,
26987
- columnKey,
26988
- originColumn,
26989
- showTitle: !tooltip && (ellipsis === true || typeof ellipsis === "object" && (ellipsis == null ? void 0 : ellipsis.showTitle) !== false),
26990
- fixed: parseFiexed,
26991
- hidden: true === originColumn.hidden
26992
- });
26993
- keyColumnMap.value.set(columnKey, finallyColumn);
26994
- if (finallyColumn.hidden) {
26995
- break;
27143
+ } else {
27144
+ if (finallyColumn.width === void 0) {
27145
+ autoWidthColumns.push(finallyColumn);
26996
27146
  }
26997
- if (children && children.length) {
26998
- finallyColumn.children = [];
26999
- if (parseFiexed === "left") {
27000
- leftHeaderCols.push(finallyColumn);
27001
- } else if (parseFiexed === "right") {
27002
- rightHeaderCols.push(finallyColumn);
27003
- } else {
27004
- centerHeaderCols.push(finallyColumn);
27005
- }
27006
- newMaxRowSpan = Math.max(newMaxRowSpan, rowSpan + 1);
27007
- genColumns(
27008
- children,
27009
- finallyColumn.children,
27010
- finallyColumn.children,
27011
- finallyColumn.children,
27012
- rowSpan + 1,
27013
- columnPos,
27014
- parseFiexed
27015
- );
27147
+ finallyWidthTotal += finallyColumn.finallyWidth;
27148
+ if (parseFiexed === "left") {
27149
+ newLeftColumns.push(finallyColumn);
27150
+ leftHeaderCols.push(finallyColumn);
27151
+ } else if (parseFiexed === "right") {
27152
+ newRightColumns.push(finallyColumn);
27153
+ rightHeaderCols.push(finallyColumn);
27016
27154
  } else {
27017
- if (finallyColumn.width === void 0) {
27018
- autoWidthColumns.push(finallyColumn);
27019
- }
27020
- finallyWidthTotal += finallyColumn.finallyWidth;
27021
- if (parseFiexed === "left") {
27022
- newLeftColumns.push(finallyColumn);
27023
- leftHeaderCols.push(finallyColumn);
27024
- } else if (parseFiexed === "right") {
27025
- newRightColumns.push(finallyColumn);
27026
- rightHeaderCols.push(finallyColumn);
27027
- } else {
27028
- newCenterColumns.push(finallyColumn);
27029
- if (finallyColumn.autoHeight) {
27030
- newAutoHeightColumns.push(finallyColumn);
27031
- }
27032
- centerHeaderCols.push(finallyColumn);
27155
+ newCenterColumns.push(finallyColumn);
27156
+ if (finallyColumn.autoHeight) {
27157
+ newAutoHeightColumns.push(finallyColumn);
27033
27158
  }
27159
+ centerHeaderCols.push(finallyColumn);
27034
27160
  }
27035
27161
  }
27036
- };
27037
- genColumns(
27038
- originMergeColumns,
27039
- newLeftHeaderColumns,
27040
- newCenterHeaderColumns,
27041
- newRightHeaderColumns,
27042
- 1,
27043
- "__S_TABLE_COLUMN_Key__"
27044
- );
27045
- let differenceWidth = bodyScrollWidth.value - finallyWidthTotal;
27046
- const nonResizableColumns = autoWidthColumns.length ? autoWidthColumns : newLeftColumns.concat(newCenterColumns, newRightColumns).filter((column) => !column.resizable || !column.__Internal__Column__);
27047
- const widthDiffAverage = Math.floor(differenceWidth / nonResizableColumns.length);
27048
- if (differenceWidth > 0) {
27049
- for (let i = 0, len = nonResizableColumns.length; i < len; i++) {
27050
- const column = nonResizableColumns[i];
27051
- let finallyWidth = 0;
27052
- if (i == len - 1 && differenceWidth > widthDiffAverage) {
27053
- finallyWidth = column.finallyWidth + differenceWidth;
27054
- } else {
27055
- finallyWidth = Math.max(
27056
- Math.min(column.finallyWidth + widthDiffAverage, (_a = column.maxWidth) != null ? _a : 1 / 0),
27057
- (_b = column.minWidth) != null ? _b : 50
27058
- );
27059
- }
27060
- differenceWidth -= finallyWidth - column.finallyWidth;
27061
- column.finallyWidth = finallyWidth;
27162
+ }
27163
+ };
27164
+ genColumns(
27165
+ originMergeColumns,
27166
+ newLeftHeaderColumns,
27167
+ newCenterHeaderColumns,
27168
+ newRightHeaderColumns,
27169
+ 1,
27170
+ "__S_TABLE_COLUMN_Key__"
27171
+ );
27172
+ let differenceWidth = bodyScrollWidth.value - finallyWidthTotal;
27173
+ const nonResizableColumns = autoWidthColumns.length ? autoWidthColumns : newLeftColumns.concat(newCenterColumns, newRightColumns).filter((column) => !column.resizable || !column.__Internal__Column__);
27174
+ const widthDiffAverage = Math.floor(differenceWidth / nonResizableColumns.length);
27175
+ if (differenceWidth > 0) {
27176
+ for (let i = 0, len = nonResizableColumns.length; i < len; i++) {
27177
+ const column = nonResizableColumns[i];
27178
+ let finallyWidth = 0;
27179
+ if (i == len - 1 && differenceWidth > widthDiffAverage) {
27180
+ finallyWidth = column.finallyWidth + differenceWidth;
27181
+ } else {
27182
+ finallyWidth = Math.max(
27183
+ Math.min(column.finallyWidth + widthDiffAverage, (_a = column.maxWidth) != null ? _a : 1 / 0),
27184
+ (_b = column.minWidth) != null ? _b : 50
27185
+ );
27062
27186
  }
27187
+ differenceWidth -= finallyWidth - column.finallyWidth;
27188
+ column.finallyWidth = finallyWidth;
27189
+ }
27190
+ } else {
27191
+ for (let i = 0, len = autoWidthColumns.length; i < len; i++) {
27192
+ const column = autoWidthColumns[i];
27193
+ column.finallyWidth = Math.min((_c = column.minWidth) != null ? _c : 50, (_d = column.maxWidth) != null ? _d : 1 / 0);
27194
+ }
27195
+ }
27196
+ if (props.headerHeight !== void 0) {
27197
+ if (Array.isArray(props.headerHeight)) {
27198
+ headerHeight.value = props.headerHeight.concat(new Array(newMaxRowSpan).fill(baseHeight.value)).slice(0, newMaxRowSpan);
27063
27199
  } else {
27064
- for (let i = 0, len = autoWidthColumns.length; i < len; i++) {
27065
- const column = autoWidthColumns[i];
27066
- column.finallyWidth = Math.min((_c = column.minWidth) != null ? _c : 50, (_d = column.maxWidth) != null ? _d : 1 / 0);
27067
- }
27200
+ headerHeight.value = new Array(newMaxRowSpan).fill(props.headerHeight);
27068
27201
  }
27069
- if (props.headerHeight !== void 0) {
27070
- if (Array.isArray(props.headerHeight)) {
27071
- headerHeight.value = props.headerHeight.concat(new Array(newMaxRowSpan).fill(baseHeight.value)).slice(0, newMaxRowSpan);
27202
+ } else {
27203
+ headerHeight.value = new Array(newMaxRowSpan).fill(baseHeight.value);
27204
+ }
27205
+ const genHeaderColumns = (headerColumns, left, top, rowSpan) => {
27206
+ let totalFinallyWidth = 0;
27207
+ let totalLeft = left;
27208
+ headerColumns.forEach((column) => {
27209
+ column.left = totalLeft;
27210
+ column.top = top;
27211
+ if (column.children) {
27212
+ column.rowSpan = 1;
27213
+ column.height = headerHeight.value[newMaxRowSpan - rowSpan];
27214
+ column.finallyWidth = genHeaderColumns(
27215
+ column.children,
27216
+ totalLeft,
27217
+ column.height,
27218
+ rowSpan - 1
27219
+ );
27072
27220
  } else {
27073
- headerHeight.value = new Array(newMaxRowSpan).fill(props.headerHeight);
27221
+ column.rowSpan = rowSpan;
27222
+ column.height = headerHeight.value.slice(newMaxRowSpan - rowSpan).reduce((pre, cur) => pre + cur, 0);
27074
27223
  }
27075
- } else {
27076
- headerHeight.value = new Array(newMaxRowSpan).fill(baseHeight.value);
27077
- }
27078
- const genHeaderColumns = (headerColumns, left, top, rowSpan) => {
27079
- let totalFinallyWidth = 0;
27080
- let totalLeft = left;
27081
- headerColumns.forEach((column) => {
27082
- column.left = totalLeft;
27083
- column.top = top;
27084
- if (column.children) {
27085
- column.rowSpan = 1;
27086
- column.height = headerHeight.value[newMaxRowSpan - rowSpan];
27087
- column.finallyWidth = genHeaderColumns(
27088
- column.children,
27089
- totalLeft,
27090
- column.height,
27091
- rowSpan - 1
27092
- );
27093
- } else {
27094
- column.rowSpan = rowSpan;
27095
- column.height = headerHeight.value.slice(newMaxRowSpan - rowSpan).reduce((pre, cur) => pre + cur, 0);
27096
- }
27097
- totalLeft += column.finallyWidth;
27098
- totalFinallyWidth += column.finallyWidth;
27099
- });
27100
- return totalFinallyWidth;
27101
- };
27102
- genHeaderColumns(
27103
- newLeftHeaderColumns.concat(newCenterHeaderColumns, newRightHeaderColumns),
27104
- 0,
27105
- 0,
27106
- newMaxRowSpan
27107
- );
27108
- leftColumns.value = newLeftColumns;
27109
- rightColumns.value = newRightColumns;
27110
- centerColumns.value = newCenterColumns;
27111
- autoHeightColumns.value = newAutoHeightColumns;
27112
- leftHeaderColumns.value = newLeftHeaderColumns;
27113
- rightHeaderColumns.value = newRightHeaderColumns;
27114
- centerHeaderColumns.value = newCenterHeaderColumns;
27115
- maxRowSpan.value = newMaxRowSpan;
27224
+ totalLeft += column.finallyWidth;
27225
+ totalFinallyWidth += column.finallyWidth;
27226
+ });
27227
+ return totalFinallyWidth;
27228
+ };
27229
+ genHeaderColumns(
27230
+ newLeftHeaderColumns.concat(newCenterHeaderColumns, newRightHeaderColumns),
27231
+ 0,
27232
+ 0,
27233
+ newMaxRowSpan
27234
+ );
27235
+ leftColumns.value = newLeftColumns;
27236
+ rightColumns.value = newRightColumns;
27237
+ centerColumns.value = newCenterColumns;
27238
+ autoHeightColumns.value = newAutoHeightColumns;
27239
+ leftHeaderColumns.value = newLeftHeaderColumns;
27240
+ rightHeaderColumns.value = newRightHeaderColumns;
27241
+ centerHeaderColumns.value = newCenterHeaderColumns;
27242
+ maxRowSpan.value = newMaxRowSpan;
27243
+ };
27244
+ vue.watch(
27245
+ [mergeColumns, baseHeight, bodyScrollWidth, measureWidthRef],
27246
+ () => {
27247
+ if (isFirstRun) {
27248
+ isFirstRun = false;
27249
+ recalcColumns();
27250
+ return;
27251
+ }
27252
+ raf.cancel(columnsRafFrame);
27253
+ columnsRafFrame = raf(() => {
27254
+ recalcColumns();
27255
+ });
27116
27256
  },
27117
27257
  { immediate: true }
27118
27258
  );
27259
+ vue.onBeforeUnmount(() => {
27260
+ raf.cancel(columnsRafFrame);
27261
+ });
27119
27262
  const allColumns = vue.shallowRef([]);
27120
27263
  let cacheColumnKeyPositonMap = {};
27121
27264
  const columnKeyIndexMap = vue.shallowRef({});
@@ -32348,8 +32491,8 @@
32348
32491
  rowIndex: { type: Number, required: true },
32349
32492
  flattenRowIndex: { type: Number, required: true },
32350
32493
  rowKey: { type: [Number, String] },
32351
- column: { type: Object, default: () => ({}) },
32352
- item: { type: Object, default: () => ({}) },
32494
+ column: { type: Object },
32495
+ item: { type: Object },
32353
32496
  wrapText: { type: Boolean, default: false },
32354
32497
  type: { type: String },
32355
32498
  height: Number,
@@ -32375,6 +32518,39 @@
32375
32518
  error: "#e8353e",
32376
32519
  warning: "#eb8903"
32377
32520
  };
32521
+ let cachedPrefixCls = "";
32522
+ let cls = {
32523
+ cellInner: "",
32524
+ cellContent: "",
32525
+ cellWrapText: "",
32526
+ cellTextEllipsis: "",
32527
+ cell: "",
32528
+ firstCell: "",
32529
+ bodyCell: "",
32530
+ cellMulti: "",
32531
+ cellHidden: "",
32532
+ columnSort: "",
32533
+ withAppend: ""
32534
+ };
32535
+ function getCls(prefixCls) {
32536
+ if (prefixCls !== cachedPrefixCls) {
32537
+ cachedPrefixCls = prefixCls;
32538
+ cls = {
32539
+ cellInner: `${prefixCls}-cell-inner`,
32540
+ cellContent: `${prefixCls}-cell-content`,
32541
+ cellWrapText: `${prefixCls}-cell-wrap-text`,
32542
+ cellTextEllipsis: `${prefixCls}-cell-text-ellipsis`,
32543
+ cell: `${prefixCls}-cell`,
32544
+ firstCell: `${prefixCls}-first-cell`,
32545
+ bodyCell: `${prefixCls}-body-cell`,
32546
+ cellMulti: `${prefixCls}-cell-multi`,
32547
+ cellHidden: `${prefixCls}-cell-hidden`,
32548
+ columnSort: `${prefixCls}-column-sort`,
32549
+ withAppend: `${prefixCls}-with-append`
32550
+ };
32551
+ }
32552
+ return cls;
32553
+ }
32378
32554
  const BodyCell$1 = (props, { slots, emit }) => {
32379
32555
  var _a, _b, _c, _d, _e, _f, _g, _h;
32380
32556
  const { table } = useProConfigInject();
@@ -32395,11 +32571,13 @@
32395
32571
  let tooltipTitle = value;
32396
32572
  const valueStatus = runFunction(column == null ? void 0 : column.valueStatus, value, props.item, valueEnum == null ? void 0 : valueEnum[value]);
32397
32573
  const recordIndexs = tableContext.getIndexsByKey(rowKey);
32398
- const cellInnerClass = { [`${prefixCls}-cell-inner`]: true };
32574
+ const c = getCls(prefixCls);
32575
+ const cellInnerClass = c.cellInner;
32576
+ const isWrapText = column.wrapText === void 0 ? wrapText : column.wrapText;
32399
32577
  const cellContentClass = {
32400
- [`${prefixCls}-cell-content`]: true,
32401
- [`${prefixCls}-cell-wrap-text`]: column.wrapText === void 0 ? wrapText : column.wrapText,
32402
- [`${prefixCls}-cell-text-ellipsis`]: !!column.ellipsis
32578
+ [c.cellContent]: true,
32579
+ [c.cellWrapText]: isWrapText,
32580
+ [c.cellTextEllipsis]: !!column.ellipsis
32403
32581
  };
32404
32582
  const cellContentStyle = {
32405
32583
  textAlign: `${column.align}`,
@@ -32416,13 +32594,13 @@
32416
32594
  const cellProps2 = cellRender.props || {};
32417
32595
  const cellRowSpan = cellProps2.rowSpan;
32418
32596
  const cellClass = {
32419
- [`${prefixCls}-cell`]: true,
32420
- [`${prefixCls}-first-cell`]: column.columnIndex === 0,
32421
- [`${prefixCls}-body-cell`]: true,
32422
- [`${prefixCls}-cell-multi`]: cellRowSpan > 1,
32423
- [`${prefixCls}-cell-hidden`]: cellRowSpan === 0,
32424
- [`${prefixCls}-column-sort`]: sorterInfo.sorterOrder,
32425
- [`${prefixCls}-with-append`]: hasAppendNode
32597
+ [c.cell]: true,
32598
+ [c.firstCell]: column.columnIndex === 0,
32599
+ [c.bodyCell]: true,
32600
+ [c.cellMulti]: cellRowSpan > 1,
32601
+ [c.cellHidden]: cellRowSpan === 0,
32602
+ [c.columnSort]: sorterInfo.sorterOrder,
32603
+ [c.withAppend]: hasAppendNode
32426
32604
  };
32427
32605
  const cellRenderArgs = {
32428
32606
  record: item,
@@ -32430,7 +32608,7 @@
32430
32608
  text: value,
32431
32609
  value,
32432
32610
  index: rowIndex,
32433
- recordIndexs: tableContext.getIndexsByKey(rowKey),
32611
+ recordIndexs,
32434
32612
  key,
32435
32613
  valueStatus,
32436
32614
  cancelEditable: tableContext.cancelEditable,
@@ -32494,14 +32672,12 @@
32494
32672
  [
32495
32673
  vue.createVNode(
32496
32674
  "div",
32497
- vue.mergeProps(
32498
- {
32499
- class: cellContentClass,
32500
- style: cellContentStyle,
32501
- title: altTitle
32502
- },
32503
- cellKeyProps
32504
- ),
32675
+ {
32676
+ class: cellContentClass,
32677
+ style: cellContentStyle,
32678
+ title: altTitle,
32679
+ ...cellKeyProps
32680
+ },
32505
32681
  [hasAppendNode ? (_h = slots.appendNode) == null ? void 0 : _h.call(slots) : null, bodyCell]
32506
32682
  )
32507
32683
  ]
@@ -33048,8 +33224,8 @@
33048
33224
  rowIndex: { type: Number, required: true },
33049
33225
  flattenRowIndex: { type: Number, required: true },
33050
33226
  rowKey: { type: [Number, String] },
33051
- column: { type: Object, default: () => ({}) },
33052
- item: { type: Object, default: () => ({}) },
33227
+ column: { type: Object, required: true },
33228
+ item: { type: Object, required: true },
33053
33229
  wrapText: { type: Boolean, default: false },
33054
33230
  type: { type: String },
33055
33231
  height: Number,
@@ -33175,18 +33351,33 @@
33175
33351
  "edit-row": _ctx.editRow,
33176
33352
  "editable-keys": _ctx.editableKeys,
33177
33353
  "is-row-edit": _ctx.isRowEdit
33178
- }, null, 8, ["prefixCls", "rowIndex", "flattenRowIndex", "rowKey", "column", "item", "edit-row", "editable-keys", "is-row-edit"])) : (vue.openBlock(), vue.createBlock(_component_BodyTextCell, vue.mergeProps({ key: 1 }, _ctx.props, {
33179
- style: { cursor: _ctx.editable ? "poiner" : "" },
33354
+ }, null, 8, ["prefixCls", "rowIndex", "flattenRowIndex", "rowKey", "column", "item", "edit-row", "editable-keys", "is-row-edit"])) : (vue.openBlock(), vue.createBlock(_component_BodyTextCell, {
33355
+ key: 1,
33356
+ prefixCls: _ctx.prefixCls,
33357
+ rowIndex: _ctx.rowIndex,
33358
+ flattenRowIndex: _ctx.flattenRowIndex,
33359
+ rowKey: _ctx.rowKey,
33360
+ column: _ctx.column,
33361
+ item: _ctx.item,
33362
+ wrapText: _ctx.wrapText,
33363
+ type: _ctx.type,
33364
+ height: _ctx.height,
33365
+ hasAppendNode: _ctx.hasAppendNode,
33366
+ resizeObserver: _ctx.resizeObserver,
33367
+ calMaxHeight: _ctx.calMaxHeight,
33368
+ tooltipOpen: _ctx.tooltipOpen,
33369
+ getPopupContainer: _ctx.getPopupContainer,
33370
+ style: vue.normalizeStyle({ cursor: _ctx.editable ? "poiner" : "" }),
33180
33371
  onClick: _cache[0] || (_cache[0] = ($event) => _ctx.onCellEvent($event, "click")),
33181
33372
  onDblClick: _cache[1] || (_cache[1] = ($event) => _ctx.onCellEvent($event, "dblClick")),
33182
33373
  onContextmenu: _cache[2] || (_cache[2] = ($event) => _ctx.onCellEvent($event, "contextmenu"))
33183
- }), {
33374
+ }, {
33184
33375
  appendNode: vue.withCtx(() => [
33185
33376
  vue.renderSlot(_ctx.$slots, "appendNode")
33186
33377
  ]),
33187
33378
  _: 3
33188
33379
  /* FORWARDED */
33189
- }, 16, ["style"]));
33380
+ }, 8, ["prefixCls", "rowIndex", "flattenRowIndex", "rowKey", "column", "item", "wrapText", "type", "height", "hasAppendNode", "resizeObserver", "calMaxHeight", "tooltipOpen", "getPopupContainer", "style"]));
33190
33381
  }
33191
33382
  var BodyCell = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["render", _sfc_render$j]]);
33192
33383
 
@@ -34655,21 +34846,26 @@
34655
34846
  return summaryStyle.value;
34656
34847
  });
34657
34848
  const emptyStyle = vue.computed(() => ({ width: `${props.bodyWidth}px` }));
34658
- useResizeObserver(
34659
- measureDomRef,
34660
- useDebounceFn((entries) => {
34661
- var _a;
34662
- const contentRect = (_a = entries[0]) == null ? void 0 : _a.contentRect;
34663
- emit("update:bodyWidth", (contentRect == null ? void 0 : contentRect.width) || 0);
34664
- emit("update:bodyHeight", (contentRect == null ? void 0 : contentRect.height) || 0);
34665
- }, 100)
34666
- );
34667
- const handleBodyInnerResize = useDebounceFn((e) => {
34668
- bodyInnerWidth.value = e.detail.width;
34669
- }, 100);
34670
- const handleBodyScrollResize = (e) => {
34671
- emit("update:bodyScrollWidth", e.detail.width);
34672
- };
34849
+ let resizeRafFrame;
34850
+ let pendingWidth = 0;
34851
+ let pendingHeight = 0;
34852
+ useResizeObserver(measureDomRef, (entries) => {
34853
+ var _a;
34854
+ const contentRect = (_a = entries[0]) == null ? void 0 : _a.contentRect;
34855
+ const w = Math.floor((contentRect == null ? void 0 : contentRect.width) || 0);
34856
+ const h = Math.floor((contentRect == null ? void 0 : contentRect.height) || 0);
34857
+ if (w === pendingWidth && h === pendingHeight) return;
34858
+ pendingWidth = w;
34859
+ pendingHeight = h;
34860
+ raf.cancel(resizeRafFrame);
34861
+ resizeRafFrame = raf(() => {
34862
+ emit("update:bodyWidth", pendingWidth);
34863
+ emit("update:bodyHeight", pendingHeight);
34864
+ });
34865
+ });
34866
+ vue.onBeforeUnmount(() => {
34867
+ raf.cancel(resizeRafFrame);
34868
+ });
34673
34869
  return {
34674
34870
  bodyContainerStyle,
34675
34871
  measureDomStyle: vue.computed(() => ({
@@ -34713,8 +34909,12 @@
34713
34909
  centerColumns,
34714
34910
  rightColumns,
34715
34911
  bodyInnerWidth,
34716
- handleBodyInnerResize,
34717
- handleBodyScrollResize,
34912
+ handleBodyInnerResize: (e) => {
34913
+ bodyInnerWidth.value = e.detail.width;
34914
+ },
34915
+ handleBodyScrollResize: (e) => {
34916
+ emit("update:bodyScrollWidth", e.detail.width);
34917
+ },
34718
34918
  bodyRef,
34719
34919
  measureDomRef,
34720
34920
  bodyInnerRef,