pro-design-vue 1.3.40 → 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 (161) hide show
  1. package/dist/index.full.js +754 -516
  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 +755 -517
  7. package/es/components/config-provider/src/typing.d.ts +12 -0
  8. package/es/components/form/src/context/FormContext.d.ts +1 -0
  9. package/es/components/form/src/hooks/useAction.d.ts +2 -1
  10. package/es/components/form/src/hooks/useInitialValues.d.ts +1 -1
  11. package/es/components/page/src/types.d.ts +1 -0
  12. package/es/components/table/src/components/Body/Body.vue.d.ts +6 -12
  13. package/es/components/table/src/components/Body/BodyCell.vue.d.ts +6 -10
  14. package/es/components/table/src/components/Body/BodyRow.vue.d.ts +6 -12
  15. package/es/components/table/src/components/Body/BodyRows.vue.d.ts +6 -12
  16. package/es/components/table/src/components/Body/BodyTextCell.d.ts +0 -2
  17. package/es/components/table/src/components/InteralTable.vue.d.ts +6 -12
  18. package/es/components/table/src/components/Table.d.ts +3 -3
  19. package/es/components/table/src/components/interface.d.ts +2 -2
  20. package/es/index.d.ts +16 -4
  21. package/es/packages/components/config-provider/src/config-provider-container.vue2.mjs +2 -0
  22. package/es/packages/components/config-provider/src/config-provider-container.vue2.mjs.map +1 -1
  23. package/es/packages/components/config-provider/src/config-provider.vue2.mjs +4 -2
  24. package/es/packages/components/config-provider/src/config-provider.vue2.mjs.map +1 -1
  25. package/es/packages/components/form/src/base/BaseForm.mjs +7 -6
  26. package/es/packages/components/form/src/base/BaseForm.mjs.map +1 -1
  27. package/es/packages/components/form/src/components/FormGroup.mjs +9 -3
  28. package/es/packages/components/form/src/components/FormGroup.mjs.map +1 -1
  29. package/es/packages/components/form/src/components/FormItem.mjs +36 -17
  30. package/es/packages/components/form/src/components/FormItem.mjs.map +1 -1
  31. package/es/packages/components/form/src/components/FormItems.mjs +75 -72
  32. package/es/packages/components/form/src/components/FormItems.mjs.map +1 -1
  33. package/es/packages/components/form/src/components/FormList.mjs +4 -2
  34. package/es/packages/components/form/src/components/FormList.mjs.map +1 -1
  35. package/es/packages/components/form/src/components/FormListContainer.mjs +57 -28
  36. package/es/packages/components/form/src/components/FormListContainer.mjs.map +1 -1
  37. package/es/packages/components/form/src/components/FormListItem.mjs +15 -12
  38. package/es/packages/components/form/src/components/FormListItem.mjs.map +1 -1
  39. package/es/packages/components/form/src/components/FormSet.mjs +7 -2
  40. package/es/packages/components/form/src/components/FormSet.mjs.map +1 -1
  41. package/es/packages/components/form/src/context/FormContext.mjs.map +1 -1
  42. package/es/packages/components/form/src/context/FormSlotsContext.mjs +2 -2
  43. package/es/packages/components/form/src/context/FormSlotsContext.mjs.map +1 -1
  44. package/es/packages/components/form/src/hooks/useAction.mjs +5 -0
  45. package/es/packages/components/form/src/hooks/useAction.mjs.map +1 -1
  46. package/es/packages/components/form/src/hooks/useFieldValue.mjs +11 -11
  47. package/es/packages/components/form/src/hooks/useFieldValue.mjs.map +1 -1
  48. package/es/packages/components/form/src/hooks/useInitialValues.mjs +2 -2
  49. package/es/packages/components/form/src/hooks/useInitialValues.mjs.map +1 -1
  50. package/es/packages/components/form/src/hooks/useLinkage.mjs +30 -3
  51. package/es/packages/components/form/src/hooks/useLinkage.mjs.map +1 -1
  52. package/es/packages/components/form/src/layouts/DrawerForm.mjs +12 -7
  53. package/es/packages/components/form/src/layouts/DrawerForm.mjs.map +1 -1
  54. package/es/packages/components/form/src/layouts/ModalForm.mjs +13 -8
  55. package/es/packages/components/form/src/layouts/ModalForm.mjs.map +1 -1
  56. package/es/packages/components/form/src/layouts/QueryFilter.mjs +81 -84
  57. package/es/packages/components/form/src/layouts/QueryFilter.mjs.map +1 -1
  58. package/es/packages/components/page/src/page.vue2.mjs +57 -30
  59. package/es/packages/components/page/src/page.vue2.mjs.map +1 -1
  60. package/es/packages/components/table/src/components/Body/Body.vue.mjs.map +1 -1
  61. package/es/packages/components/table/src/components/Body/Body.vue2.mjs +17 -2
  62. package/es/packages/components/table/src/components/Body/Body.vue2.mjs.map +1 -1
  63. package/es/packages/components/table/src/components/Body/BodyCell.vue.mjs +20 -5
  64. package/es/packages/components/table/src/components/Body/BodyCell.vue.mjs.map +1 -1
  65. package/es/packages/components/table/src/components/Body/BodyCell.vue2.mjs +2 -2
  66. package/es/packages/components/table/src/components/Body/BodyCell.vue2.mjs.map +1 -1
  67. package/es/packages/components/table/src/components/Body/BodyCellTooltip.vue2.mjs +3 -2
  68. package/es/packages/components/table/src/components/Body/BodyCellTooltip.vue2.mjs.map +1 -1
  69. package/es/packages/components/table/src/components/Body/BodyTextCell.mjs +56 -23
  70. package/es/packages/components/table/src/components/Body/BodyTextCell.mjs.map +1 -1
  71. package/es/packages/components/table/src/components/Table.mjs +5 -2
  72. package/es/packages/components/table/src/components/Table.mjs.map +1 -1
  73. package/es/packages/components/table/src/components/interface.mjs.map +1 -1
  74. package/es/packages/components/table/src/hooks/useColumns.mjs +180 -167
  75. package/es/packages/components/table/src/hooks/useColumns.mjs.map +1 -1
  76. package/es/packages/directives/resize.mjs +45 -20
  77. package/es/packages/directives/resize.mjs.map +1 -1
  78. package/es/packages/utils/performance.mjs +72 -0
  79. package/es/packages/utils/performance.mjs.map +1 -0
  80. package/es/utils/performance.d.ts +13 -0
  81. package/es/version.d.ts +1 -1
  82. package/es/version.mjs +1 -1
  83. package/es/version.mjs.map +1 -1
  84. package/lib/components/config-provider/src/typing.d.ts +12 -0
  85. package/lib/components/form/src/context/FormContext.d.ts +1 -0
  86. package/lib/components/form/src/hooks/useAction.d.ts +2 -1
  87. package/lib/components/form/src/hooks/useInitialValues.d.ts +1 -1
  88. package/lib/components/page/src/types.d.ts +1 -0
  89. package/lib/components/table/src/components/Body/Body.vue.d.ts +6 -12
  90. package/lib/components/table/src/components/Body/BodyCell.vue.d.ts +6 -10
  91. package/lib/components/table/src/components/Body/BodyRow.vue.d.ts +6 -12
  92. package/lib/components/table/src/components/Body/BodyRows.vue.d.ts +6 -12
  93. package/lib/components/table/src/components/Body/BodyTextCell.d.ts +0 -2
  94. package/lib/components/table/src/components/InteralTable.vue.d.ts +6 -12
  95. package/lib/components/table/src/components/Table.d.ts +3 -3
  96. package/lib/components/table/src/components/interface.d.ts +2 -2
  97. package/lib/index.d.ts +16 -4
  98. package/lib/packages/components/config-provider/src/config-provider-container.vue2.js +2 -0
  99. package/lib/packages/components/config-provider/src/config-provider-container.vue2.js.map +1 -1
  100. package/lib/packages/components/config-provider/src/config-provider.vue2.js +4 -2
  101. package/lib/packages/components/config-provider/src/config-provider.vue2.js.map +1 -1
  102. package/lib/packages/components/form/src/base/BaseForm.js +7 -6
  103. package/lib/packages/components/form/src/base/BaseForm.js.map +1 -1
  104. package/lib/packages/components/form/src/components/FormGroup.js +9 -3
  105. package/lib/packages/components/form/src/components/FormGroup.js.map +1 -1
  106. package/lib/packages/components/form/src/components/FormItem.js +36 -17
  107. package/lib/packages/components/form/src/components/FormItem.js.map +1 -1
  108. package/lib/packages/components/form/src/components/FormItems.js +74 -71
  109. package/lib/packages/components/form/src/components/FormItems.js.map +1 -1
  110. package/lib/packages/components/form/src/components/FormList.js +4 -2
  111. package/lib/packages/components/form/src/components/FormList.js.map +1 -1
  112. package/lib/packages/components/form/src/components/FormListContainer.js +57 -28
  113. package/lib/packages/components/form/src/components/FormListContainer.js.map +1 -1
  114. package/lib/packages/components/form/src/components/FormListItem.js +15 -12
  115. package/lib/packages/components/form/src/components/FormListItem.js.map +1 -1
  116. package/lib/packages/components/form/src/components/FormSet.js +7 -2
  117. package/lib/packages/components/form/src/components/FormSet.js.map +1 -1
  118. package/lib/packages/components/form/src/context/FormContext.js.map +1 -1
  119. package/lib/packages/components/form/src/context/FormSlotsContext.js +1 -1
  120. package/lib/packages/components/form/src/context/FormSlotsContext.js.map +1 -1
  121. package/lib/packages/components/form/src/hooks/useAction.js +5 -0
  122. package/lib/packages/components/form/src/hooks/useAction.js.map +1 -1
  123. package/lib/packages/components/form/src/hooks/useFieldValue.js +10 -10
  124. package/lib/packages/components/form/src/hooks/useFieldValue.js.map +1 -1
  125. package/lib/packages/components/form/src/hooks/useInitialValues.js +1 -1
  126. package/lib/packages/components/form/src/hooks/useInitialValues.js.map +1 -1
  127. package/lib/packages/components/form/src/hooks/useLinkage.js +30 -3
  128. package/lib/packages/components/form/src/hooks/useLinkage.js.map +1 -1
  129. package/lib/packages/components/form/src/layouts/DrawerForm.js +12 -7
  130. package/lib/packages/components/form/src/layouts/DrawerForm.js.map +1 -1
  131. package/lib/packages/components/form/src/layouts/ModalForm.js +13 -8
  132. package/lib/packages/components/form/src/layouts/ModalForm.js.map +1 -1
  133. package/lib/packages/components/form/src/layouts/QueryFilter.js +79 -82
  134. package/lib/packages/components/form/src/layouts/QueryFilter.js.map +1 -1
  135. package/lib/packages/components/page/src/page.vue2.js +56 -29
  136. package/lib/packages/components/page/src/page.vue2.js.map +1 -1
  137. package/lib/packages/components/table/src/components/Body/Body.vue.js.map +1 -1
  138. package/lib/packages/components/table/src/components/Body/Body.vue2.js +17 -2
  139. package/lib/packages/components/table/src/components/Body/Body.vue2.js.map +1 -1
  140. package/lib/packages/components/table/src/components/Body/BodyCell.vue.js +19 -4
  141. package/lib/packages/components/table/src/components/Body/BodyCell.vue.js.map +1 -1
  142. package/lib/packages/components/table/src/components/Body/BodyCell.vue2.js +2 -2
  143. package/lib/packages/components/table/src/components/Body/BodyCell.vue2.js.map +1 -1
  144. package/lib/packages/components/table/src/components/Body/BodyCellTooltip.vue2.js +3 -2
  145. package/lib/packages/components/table/src/components/Body/BodyCellTooltip.vue2.js.map +1 -1
  146. package/lib/packages/components/table/src/components/Body/BodyTextCell.js +55 -22
  147. package/lib/packages/components/table/src/components/Body/BodyTextCell.js.map +1 -1
  148. package/lib/packages/components/table/src/components/Table.js +5 -2
  149. package/lib/packages/components/table/src/components/Table.js.map +1 -1
  150. package/lib/packages/components/table/src/components/interface.js.map +1 -1
  151. package/lib/packages/components/table/src/hooks/useColumns.js +179 -166
  152. package/lib/packages/components/table/src/hooks/useColumns.js.map +1 -1
  153. package/lib/packages/directives/resize.js +45 -20
  154. package/lib/packages/directives/resize.js.map +1 -1
  155. package/lib/packages/utils/performance.js +76 -0
  156. package/lib/packages/utils/performance.js.map +1 -0
  157. package/lib/utils/performance.d.ts +13 -0
  158. package/lib/version.d.ts +1 -1
  159. package/lib/version.js +1 -1
  160. package/lib/version.js.map +1 -1
  161. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- /*! Pro Design Vue v1.3.40 */
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.40";
35
+ const version$1 = "1.4.0";
36
36
 
37
37
  const makeInstaller = (components = []) => {
38
38
  const install = (app) => {
@@ -8460,6 +8460,7 @@
8460
8460
  form: { type: Object, required: false },
8461
8461
  modal: { type: Object, required: false },
8462
8462
  drawer: { type: Object, required: false },
8463
+ page: { type: Object, required: false },
8463
8464
  app: { type: Object, required: false },
8464
8465
  iconPrefixCls: { type: String, required: false },
8465
8466
  getTargetContainer: { type: Function, required: false },
@@ -8490,6 +8491,7 @@
8490
8491
  useCssVariables(vue.computed(() => props.dark));
8491
8492
  useProConfigProvide({
8492
8493
  table: vue.computed(() => props.table),
8494
+ page: vue.computed(() => props.page),
8493
8495
  form: vue.computed(() => props.form),
8494
8496
  modal: vue.computed(() => props.modal),
8495
8497
  drawer: vue.computed(() => props.drawer),
@@ -8531,6 +8533,7 @@
8531
8533
  form: { type: Object, required: false },
8532
8534
  modal: { type: Object, required: false },
8533
8535
  drawer: { type: Object, required: false },
8536
+ page: { type: Object, required: false },
8534
8537
  app: { type: Object, required: false },
8535
8538
  iconPrefixCls: { type: String, required: false },
8536
8539
  getTargetContainer: { type: Function, required: false },
@@ -8556,7 +8559,7 @@
8556
8559
  wave: { type: Object, required: false }
8557
8560
  },
8558
8561
  setup(__props) {
8559
- const rest = vue.createPropsRestProxy(__props, ["intl", "proPrefixCls", "dark", "compact", "token", "locale", "theme", "table", "drawer", "modal", "form", "app", "prefixCls", "componentSize", "accessCodes"]);
8562
+ const rest = vue.createPropsRestProxy(__props, ["intl", "proPrefixCls", "dark", "compact", "token", "locale", "theme", "table", "page", "drawer", "modal", "form", "app", "prefixCls", "componentSize", "accessCodes"]);
8560
8563
  if (__props.locale.locale === DEFAULT_LOCALE.toLocaleLowerCase()) {
8561
8564
  Promise.resolve().then(function () { return zhCn$1; }).then((value) => {
8562
8565
  dayjs.locale(value);
@@ -8627,6 +8630,7 @@
8627
8630
  proPrefixCls: _ctx.proPrefixCls,
8628
8631
  table: _ctx.table,
8629
8632
  form: _ctx.form,
8633
+ page: _ctx.page,
8630
8634
  locale: _ctx.locale,
8631
8635
  drawer: _ctx.drawer,
8632
8636
  modal: _ctx.modal,
@@ -8639,7 +8643,7 @@
8639
8643
  ]),
8640
8644
  _: 3
8641
8645
  /* FORWARDED */
8642
- }, 8, ["contentOffsetTop", "intl", "dark", "proPrefixCls", "table", "form", "locale", "drawer", "modal", "prefixCls", "componentSize", "accessCodes"])
8646
+ }, 8, ["contentOffsetTop", "intl", "dark", "proPrefixCls", "table", "form", "page", "locale", "drawer", "modal", "prefixCls", "componentSize", "accessCodes"])
8643
8647
  ]),
8644
8648
  _: 3
8645
8649
  /* FORWARDED */
@@ -10295,7 +10299,7 @@
10295
10299
 
10296
10300
  const ProIcon = withInstall(_sfc_main$W);
10297
10301
 
10298
- function _isSlot$8(s) {
10302
+ function _isSlot$9(s) {
10299
10303
  return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !vue.isVNode(s);
10300
10304
  }
10301
10305
  var Button = /* @__PURE__ */ vue.defineComponent({
@@ -10469,7 +10473,7 @@
10469
10473
  })();
10470
10474
  defaultDom = vue.createVNode(antDesignVue.Tooltip, vue.mergeProps(props.tooltipProps, {
10471
10475
  "title": props.tooltip
10472
- }), _isSlot$8(defaultDom) ? defaultDom : {
10476
+ }), _isSlot$9(defaultDom) ? defaultDom : {
10473
10477
  default: () => [_defaultDom]
10474
10478
  });
10475
10479
  }
@@ -10483,7 +10487,7 @@
10483
10487
  var _a2;
10484
10488
  return (_a2 = props.onCancel) == null ? void 0 : _a2.call(props, props.data);
10485
10489
  }
10486
- }), _isSlot$8(defaultDom) ? defaultDom : {
10490
+ }), _isSlot$9(defaultDom) ? defaultDom : {
10487
10491
  default: () => [defaultDom]
10488
10492
  });
10489
10493
  }
@@ -13721,7 +13725,7 @@
13721
13725
  }
13722
13726
  },
13723
13727
  setup(props, { slots }) {
13724
- const currentValue = vue.reactive({});
13728
+ const currentValue = vue.shallowReactive({});
13725
13729
  vue.watch(
13726
13730
  () => props.value,
13727
13731
  () => {
@@ -14051,7 +14055,7 @@
14051
14055
  return vue.inject(FormContextKey, {});
14052
14056
  };
14053
14057
 
14054
- function _isSlot$7(s) {
14058
+ function _isSlot$8(s) {
14055
14059
  return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !vue.isVNode(s);
14056
14060
  }
14057
14061
  var FieldReadonly = /* @__PURE__ */ vue.defineComponent({
@@ -14130,7 +14134,7 @@
14130
14134
  if (props.copy && props.text) {
14131
14135
  return vue.createVNode(ProClipboard, {
14132
14136
  "text": props.text
14133
- }, _isSlot$7(dom) ? dom : {
14137
+ }, _isSlot$8(dom) ? dom : {
14134
14138
  default: () => [dom]
14135
14139
  });
14136
14140
  }
@@ -14141,7 +14145,7 @@
14141
14145
  "placement": "topLeft",
14142
14146
  "title": title,
14143
14147
  "getPopupContainer": getPopupContainer
14144
- }, _isSlot$7(dom) ? dom : {
14148
+ }, _isSlot$8(dom) ? dom : {
14145
14149
  default: () => [dom]
14146
14150
  });
14147
14151
  }
@@ -15261,7 +15265,7 @@
15261
15265
  }
15262
15266
  });
15263
15267
 
15264
- function _isSlot$6(s) {
15268
+ function _isSlot$7(s) {
15265
15269
  return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !vue.isVNode(s);
15266
15270
  }
15267
15271
  var FieldRadioGroup = /* @__PURE__ */ vue.defineComponent({
@@ -15325,7 +15329,7 @@
15325
15329
  "value": props.value
15326
15330
  }, attrs, {
15327
15331
  "onChange": onChange
15328
- }), _isSlot$6(_slot = mergeOptions.value.map((option) => {
15332
+ }), _isSlot$7(_slot = mergeOptions.value.map((option) => {
15329
15333
  var _a2;
15330
15334
  return vue.createVNode(antDesignVue.Radio, {
15331
15335
  "value": option.value,
@@ -17575,7 +17579,7 @@
17575
17579
  const useInitialValues = (props) => {
17576
17580
  const hasInitial = vue.ref(true);
17577
17581
  const requestLoading = vue.ref(false);
17578
- const initialValues = vue.ref({ ...props.initialValues });
17582
+ const initialValues = vue.shallowRef({ ...props.initialValues });
17579
17583
  const fetchData = useFetchData$1({ request: props.request });
17580
17584
  vue.onMounted(async () => {
17581
17585
  var _a;
@@ -17596,7 +17600,14 @@
17596
17600
  const useLinkage = () => {
17597
17601
  const hiddenKeys = vue.shallowRef([]);
17598
17602
  const disabledKeys = vue.shallowRef([]);
17599
- 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
+ });
17600
17611
  const genNewKeys = (originKeys, fieldKey, keys) => {
17601
17612
  if (!Array.isArray(keys)) {
17602
17613
  keys = [keys];
@@ -17612,10 +17623,30 @@
17612
17623
  disabledKeys.value = genNewKeys(disabledKeys.value, fieldKey, keys);
17613
17624
  };
17614
17625
  const allHiddenKeys = vue.computed(() => {
17615
- 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;
17616
17637
  });
17617
17638
  const allDisabledKeys = vue.computed(() => {
17618
- 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;
17619
17650
  });
17620
17651
  return {
17621
17652
  allHiddenKeys,
@@ -17766,6 +17797,7 @@
17766
17797
  props,
17767
17798
  formRef,
17768
17799
  formData,
17800
+ formDataVersion,
17769
17801
  initialValues,
17770
17802
  hasInitial,
17771
17803
  transformerMap,
@@ -17821,6 +17853,7 @@
17821
17853
  const namePath = covertFormName(name);
17822
17854
  if (!namePath) throw new Error("name is require");
17823
17855
  set(formData.value, namePath, value);
17856
+ formDataVersion.value++;
17824
17857
  };
17825
17858
  const setFieldsValue = (values, isMerge = true) => {
17826
17859
  if (!values) throw new Error("values is require");
@@ -17829,6 +17862,7 @@
17829
17862
  } else {
17830
17863
  formData.value = cloneDeep(values);
17831
17864
  }
17865
+ formDataVersion.value++;
17832
17866
  };
17833
17867
  const resetInitialValues = (values) => {
17834
17868
  if (!values) throw new Error("values is require");
@@ -17841,6 +17875,7 @@
17841
17875
  hasInitial.value = true;
17842
17876
  (_a = formRef.value) == null ? void 0 : _a.clearValidate();
17843
17877
  formData.value = cloneDeep(convertKeyInitialValue(initialValues.value, transformerMap.value));
17878
+ formDataVersion.value++;
17844
17879
  Promise.resolve().then(() => {
17845
17880
  hasInitial.value = false;
17846
17881
  onReset == null ? void 0 : onReset(transformKeySubmitValue(formData.value, transformerMap.value, props.omitNil));
@@ -17852,6 +17887,7 @@
17852
17887
  if (!namePath) throw new Error("name is require");
17853
17888
  (_a = formRef.value) == null ? void 0 : _a.clearValidate(name);
17854
17889
  set(formData.value, name, cloneDeep(get(initialValues.value, name)));
17890
+ formDataVersion.value++;
17855
17891
  };
17856
17892
  const clearValidate = (name) => {
17857
17893
  var _a;
@@ -18046,7 +18082,7 @@
18046
18082
  }
18047
18083
  });
18048
18084
 
18049
- function _isSlot$5(s) {
18085
+ function _isSlot$6(s) {
18050
18086
  return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !vue.isVNode(s);
18051
18087
  }
18052
18088
  var FormGroup = /* @__PURE__ */ vue.defineComponent({
@@ -18098,12 +18134,18 @@
18098
18134
  formData
18099
18135
  } = useInjectForm();
18100
18136
  const items = vue.computed(() => {
18101
- var _a, _b;
18102
- 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 : [];
18103
18141
  });
18104
18142
  const formItemProps = vue.computed(() => {
18105
18143
  var _a;
18106
- 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 : {};
18107
18149
  });
18108
18150
  const isExistTitle = vue.computed(() => {
18109
18151
  if (!props.title) {
@@ -18146,7 +18188,7 @@
18146
18188
  }, null)]), vue.createVNode("div", null, [vue.createVNode(FormRowWrapper, {
18147
18189
  "rowProps": props.rowProps,
18148
18190
  "grid": props.grid
18149
- }, _isSlot$5(defaultDom) ? defaultDom : {
18191
+ }, _isSlot$6(defaultDom) ? defaultDom : {
18150
18192
  default: () => [defaultDom]
18151
18193
  })])])]
18152
18194
  });
@@ -18160,31 +18202,31 @@
18160
18202
  convertValue
18161
18203
  }) {
18162
18204
  const fieldValue = vue.shallowRef();
18163
- const { formData, initialValues } = useInjectForm();
18164
- 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
+ });
18165
18210
  const onValueChange = (value) => {
18166
18211
  set(formData.value, namePath.value, value);
18212
+ formDataVersion.value++;
18167
18213
  };
18168
18214
  vue.watch(
18169
18215
  modelValue,
18170
18216
  (newValue) => {
18171
- fieldValue.value = cloneDeep(newValue);
18217
+ fieldValue.value = newValue;
18172
18218
  },
18173
18219
  {
18174
- immediate: true,
18175
- deep: true
18220
+ immediate: true
18176
18221
  }
18177
18222
  );
18178
18223
  const initFieldInitialValue = () => {
18179
18224
  var _a;
18180
- if (
18181
- // !mountedRef.value &&
18182
- typeof modelValue.value === "undefined" && typeof initialValue !== "undefined"
18183
- ) {
18225
+ if (typeof modelValue.value === "undefined" && typeof initialValue !== "undefined") {
18184
18226
  const value = convertValue ? convertValue(initialValue, namePath.value) : initialValue;
18185
18227
  set((_a = initialValues == null ? void 0 : initialValues.value) != null ? _a : {}, namePath.value, cloneDeep(initialValue));
18186
18228
  set(formData.value, namePath.value, cloneDeep(value));
18187
- fieldValue.value = value;
18229
+ fieldValue.value = get(formData.value, namePath.value);
18188
18230
  }
18189
18231
  };
18190
18232
  initFieldInitialValue();
@@ -18261,14 +18303,19 @@
18261
18303
  });
18262
18304
  const formItemProps = vue.computed(() => {
18263
18305
  var _a;
18264
- 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 : {};
18265
18311
  });
18266
18312
  const restItemProps = vue.computed(() => omitUndefined({
18267
18313
  ...pickKeys(formItemProps.value, ALL_ANTD_PROP_KEYS$2)
18268
18314
  }));
18269
18315
  const items = vue.computed(() => {
18270
18316
  var _a, _b, _c;
18271
- 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 : [];
18272
18319
  if (Array.isArray(props.initialValue) && props.initialValue.length) {
18273
18320
  children = children.filter((item) => {
18274
18321
  var _a2;
@@ -18454,24 +18501,27 @@
18454
18501
  return newDependencies;
18455
18502
  };
18456
18503
  const genListItems = (fields) => {
18457
- return cloneDeep(fields).filter((item) => {
18504
+ return fields.filter((item) => {
18458
18505
  var _a;
18459
18506
  return !NOT_ALLOW_FIELD_TYPES.includes((_a = item.fieldType) != null ? _a : "");
18460
18507
  }).map((field) => {
18461
18508
  var _a, _b, _c, _d, _e, _f;
18462
- if (field.fieldType === ProFieldType.GROUP) {
18463
- field.children = genListItems((_b = runFunction((_a = field.children) != null ? _a : [], formData.value)) != null ? _b : []);
18464
- return field;
18465
- }
18466
- const originName = (_c = field.originName) != null ? _c : field.name;
18467
- const originKey = (_d = field.originKey) != null ? _d : field.key;
18468
- const namePath = covertFormName(field.name);
18469
- 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;
18470
18520
  const item = {
18471
- ...field,
18521
+ ...cloned,
18472
18522
  title,
18473
18523
  originKey,
18474
- 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("_")}`,
18475
18525
  originName,
18476
18526
  name: [...(_f = listName == null ? void 0 : listName.value) != null ? _f : [], namePath].filter((item2) => item2 !== void 0).flat(1)
18477
18527
  };
@@ -18483,7 +18533,8 @@
18483
18533
  };
18484
18534
  const items = vue.computed(() => {
18485
18535
  var _a, _b, _c;
18486
- 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 : [];
18487
18538
  return (_c = formatItems == null ? void 0 : formatItems(genListItems(fields))) != null ? _c : [];
18488
18539
  });
18489
18540
  const showRowTitle = vue.computed(() => props.alwaysShowRowTitle && props.rowTitle);
@@ -18621,7 +18672,7 @@
18621
18672
  }
18622
18673
  });
18623
18674
 
18624
- function _isSlot$4(s) {
18675
+ function _isSlot$5(s) {
18625
18676
  return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !vue.isVNode(s);
18626
18677
  }
18627
18678
  var FormListContainer = /* @__PURE__ */ vue.defineComponent({
@@ -18726,14 +18777,16 @@
18726
18777
  slots
18727
18778
  }) {
18728
18779
  const loading = vue.ref(false);
18729
- const listValues = vue.ref([]);
18730
18780
  const {
18731
18781
  prefixCls
18732
18782
  } = useInjectForm();
18783
+ const formItemContext = antDesignVue.Form.useInjectFormItemContext();
18733
18784
  const keyRef = vue.shallowRef({
18734
18785
  keys: [],
18735
18786
  id: 0
18736
18787
  });
18788
+ let lastActionVersion = 0;
18789
+ let watchedActionVersion = 0;
18737
18790
  const {
18738
18791
  fieldValue,
18739
18792
  onValueChange
@@ -18743,31 +18796,35 @@
18743
18796
  convertValue: props.convertValue,
18744
18797
  transform: props.transform
18745
18798
  });
18746
- const formItemContext = antDesignVue.Form.useInjectFormItemContext();
18747
18799
  const count = vue.computed(() => {
18748
18800
  var _a, _b;
18749
18801
  return (_b = (_a = fieldValue.value) == null ? void 0 : _a.length) != null ? _b : 0;
18750
18802
  });
18751
18803
  const action = {
18752
18804
  add: async (defaultValue, index) => {
18753
- var _a, _b, _c;
18805
+ var _a, _b;
18754
18806
  if ((_a = props.actionGuard) == null ? void 0 : _a.beforeAddRow) {
18755
18807
  const success = await ((_b = props.actionGuard) == null ? void 0 : _b.beforeAddRow(defaultValue, index, count.value));
18756
18808
  if (!success) {
18757
18809
  return false;
18758
18810
  }
18759
18811
  }
18760
- const newValue = cloneDeep((_c = fieldValue.value) != null ? _c : []);
18812
+ const newValue = fieldValue.value ? [...fieldValue.value] : [];
18761
18813
  if (index !== void 0 && index >= 0 && index <= newValue.length) {
18762
- keyRef.value.keys = [...keyRef.value.keys.slice(0, index), keyRef.value.id, ...keyRef.value.keys.slice(index)];
18763
- onValueChange(cloneDeep([...newValue.slice(0, index), defaultValue, ...newValue.slice(index)]));
18764
- 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)]);
18765
18819
  } else {
18766
- keyRef.value.keys = [...keyRef.value.keys, keyRef.value.id];
18767
- onValueChange(cloneDeep([...newValue, defaultValue]));
18768
- formItemContext.onFieldChange();
18820
+ keyRef.value = {
18821
+ keys: [...keyRef.value.keys, keyRef.value.id],
18822
+ id: keyRef.value.id + 1
18823
+ };
18824
+ onValueChange([...newValue, defaultValue]);
18769
18825
  }
18770
- keyRef.value.id += 1;
18826
+ lastActionVersion++;
18827
+ formItemContext.onFieldChange();
18771
18828
  Promise.resolve().then(() => {
18772
18829
  var _a2;
18773
18830
  (_a2 = props.onAfterAdd) == null ? void 0 : _a2.call(props, defaultValue, index, count.value);
@@ -18775,21 +18832,24 @@
18775
18832
  return true;
18776
18833
  },
18777
18834
  remove: async (index) => {
18778
- var _a, _b, _c;
18835
+ var _a, _b;
18779
18836
  if ((_a = props.actionGuard) == null ? void 0 : _a.beforeRemoveRow) {
18780
18837
  const success = await ((_b = props.actionGuard) == null ? void 0 : _b.beforeRemoveRow(index, count.value));
18781
18838
  if (!success) {
18782
18839
  return false;
18783
18840
  }
18784
18841
  }
18785
- const newValue = cloneDeep((_c = fieldValue.value) != null ? _c : []);
18842
+ const newValue = fieldValue.value ? [...fieldValue.value] : [];
18786
18843
  const indexSet = new Set(Array.isArray(index) ? index : [index]);
18787
18844
  if (indexSet.size <= 0) {
18788
18845
  return false;
18789
18846
  }
18790
- keyRef.value.keys = keyRef.value.keys.filter((_, keysIndex) => !indexSet.has(keysIndex));
18791
- const value = newValue.filter((_, valueIndex) => !indexSet.has(valueIndex));
18792
- 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++;
18793
18853
  formItemContext.onFieldChange();
18794
18854
  Promise.resolve().then(() => {
18795
18855
  var _a2;
@@ -18814,10 +18874,32 @@
18814
18874
  const onCopy = async (index) => {
18815
18875
  await action.add(cloneDeep(fieldValue.value[index]), count.value + 1);
18816
18876
  };
18817
- vue.watch(fieldValue, () => {
18818
- var _a;
18819
- if (!isEqual(listValues.value, fieldValue.value)) {
18820
- 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
+ };
18821
18903
  }
18822
18904
  }, {
18823
18905
  immediate: true
@@ -18842,7 +18924,7 @@
18842
18924
  }, restProps, {
18843
18925
  "loading": loading.value,
18844
18926
  "onClick": onAdd
18845
- }), _isSlot$4(creatorButtonText) ? creatorButtonText : {
18927
+ }), _isSlot$5(creatorButtonText) ? creatorButtonText : {
18846
18928
  default: () => [creatorButtonText]
18847
18929
  });
18848
18930
  if (slots.creator) {
@@ -18858,17 +18940,15 @@
18858
18940
  return defaultDom;
18859
18941
  });
18860
18942
  return () => {
18861
- var _a, _b, _c, _d, _e, _f, _g;
18862
- if (props.readonly && !((_a = listValues.value) == null ? void 0 : _a.length)) {
18863
- listValues.value = [{}];
18864
- }
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 : [];
18865
18945
  return vue.createVNode("div", {
18866
18946
  "style": "width: max-content; max-width: 100%; min-width: 100%; ",
18867
18947
  "class": {
18868
18948
  [`${prefixCls}-list-container`]: true,
18869
- [`${prefixCls}-list-empty`]: ((_c = (_b = fieldValue.value) != null ? _b : []) == null ? void 0 : _c.length) == 0
18949
+ [`${prefixCls}-list-empty`]: listData.length === 0
18870
18950
  }
18871
- }, [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) => {
18872
18952
  let key = keyRef.value.keys[index];
18873
18953
  if (key === void 0) {
18874
18954
  keyRef.value.keys[index] = keyRef.value.id;
@@ -18901,7 +18981,7 @@
18901
18981
  action: slots.action,
18902
18982
  item: slots.item
18903
18983
  });
18904
- }), 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]);
18905
18985
  };
18906
18986
  }
18907
18987
  });
@@ -19058,8 +19138,10 @@
19058
19138
  });
19059
19139
  });
19060
19140
  const items = vue.computed(() => {
19061
- var _a, _b;
19062
- 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 : [];
19063
19145
  });
19064
19146
  const slotsGetter = vue.computed(() => {
19065
19147
  const temp = {};
@@ -19787,6 +19869,7 @@
19787
19869
  formKey,
19788
19870
  prefixCls,
19789
19871
  formData,
19872
+ formDataVersion,
19790
19873
  readonly,
19791
19874
  readonlyProps,
19792
19875
  disabledKeys,
@@ -19805,6 +19888,7 @@
19805
19888
  rowData
19806
19889
  } = useInjectFormList();
19807
19890
  const formSlotsContext = useInjectSlots$1();
19891
+ const formItemContext = antDesignVue.Form.useInjectFormItemContext();
19808
19892
  const {
19809
19893
  fieldValue,
19810
19894
  onValueChange
@@ -19825,7 +19909,11 @@
19825
19909
  });
19826
19910
  const mergeReadonly = vue.computed(() => {
19827
19911
  var _a;
19828
- 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;
19829
19917
  });
19830
19918
  const mergeReadonlyProps = vue.computed(() => merge({}, readonlyProps == null ? void 0 : readonlyProps.value, props.item.readonlyProps));
19831
19919
  const linkageDisabledKeys = vue.computed(() => disabledKeys.value.map((key) => key.split(":")[1]));
@@ -19836,17 +19924,22 @@
19836
19924
  });
19837
19925
  const formItemProps = vue.computed(() => {
19838
19926
  var _a;
19839
- 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 : {};
19840
19932
  });
19841
19933
  const restItemProps = vue.computed(() => {
19842
19934
  var _a, _b, _c, _d, _e, _f, _g, _h;
19935
+ const rulesProp = (_a = props.item.rules) != null ? _a : formItemProps.value.rules;
19843
19936
  return omitUndefined({
19844
19937
  ...pickKeys(formItemProps.value, ALL_ANTD_PROP_KEYS),
19845
- labelCol: (_b = (_a = formItemProps.value) == null ? void 0 : _a.labelCol) != null ? _b : labelCol == null ? void 0 : labelCol.value,
19846
- 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,
19847
19940
  name: mergeReadonly.value ? void 0 : props.item.name,
19848
- 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}`,
19849
- 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)
19850
19943
  });
19851
19944
  });
19852
19945
  const clearOnChange = (newValue) => {
@@ -19857,27 +19950,33 @@
19857
19950
  if (clear) {
19858
19951
  const clearNamePaths = (_b = runFunction(clear, newValue, formData.value, rowData == null ? void 0 : rowData.value)) != null ? _b : [];
19859
19952
  if (clearNamePaths.length > 0) {
19953
+ let changed = false;
19860
19954
  clearNamePaths.forEach((namePath) => {
19861
19955
  var _a2;
19862
19956
  const path = isList ? [...(_a2 = listName == null ? void 0 : listName.value) != null ? _a2 : [], ...covertFormName(namePath)].filter((item) => item !== void 0).flat(1) : covertFormName(namePath);
19863
19957
  const value = get(formData.value, path);
19864
19958
  if (typeof value !== "undefined") {
19865
19959
  set(formData.value, path, void 0);
19960
+ changed = true;
19866
19961
  }
19867
19962
  });
19963
+ if (changed) {
19964
+ formDataVersion.value++;
19965
+ }
19868
19966
  }
19869
19967
  }
19870
19968
  };
19871
19969
  const fieldProps = vue.computed(() => {
19872
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
19873
- 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);
19874
19973
  const mergeProps = {
19875
19974
  ...baseProps,
19876
- id: (_c = baseProps == null ? void 0 : baseProps.id) != null ? _c : `form-${(_b = formKey.value) != null ? _b : ""}-${props.item.key}`,
19877
- 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,
19878
- placeholder: (_f = props.item.placeholder) != null ? _f : baseProps == null ? void 0 : baseProps.placeholder,
19879
- options: (_h = (_g = props.item.options) != null ? _g : baseProps == null ? void 0 : baseProps.options) != null ? _h : baseProps == null ? void 0 : baseProps.treeData,
19880
- 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
19881
19980
  };
19882
19981
  return omitUndefined({
19883
19982
  valueEnum: props.item.valueEnum,
@@ -19890,6 +19989,7 @@
19890
19989
  var _a2, _b2;
19891
19990
  clearOnChange(value);
19892
19991
  onValueChange(value);
19992
+ formItemContext.onFieldChange();
19893
19993
  (_b2 = (_a2 = props.item).onChange) == null ? void 0 : _b2.call(_a2, value, ...args, action);
19894
19994
  },
19895
19995
  ...fieldPropsMap[fieldType.value] ? pickKeys(mergeProps, fieldPropsMap[fieldType.value]) : mergeProps
@@ -19897,9 +19997,8 @@
19897
19997
  });
19898
19998
  const fieldStyle = vue.computed(() => {
19899
19999
  var _a;
19900
- const baseProps = runFunction((_a = props.item.fieldProps) != null ? _a : {}, formData.value, rowData == null ? void 0 : rowData.value);
19901
20000
  const newStyle = {
19902
- ...baseProps == null ? void 0 : baseProps.style
20001
+ ...(_a = fieldProps.value) == null ? void 0 : _a.style
19903
20002
  };
19904
20003
  if (props.item.width && !fieldWidthSizeMap[props.item.width]) {
19905
20004
  newStyle.width = isNumber$2(props.item.width) ? props.item.width + "px" : props.item.width;
@@ -19995,8 +20094,10 @@
19995
20094
  vue.watch(() => {
19996
20095
  var _a;
19997
20096
  return (_a = restItemProps.value) == null ? void 0 : _a.rules;
19998
- }, () => {
19999
- action.clearValidate(props.item.name);
20097
+ }, (newRules, oldRules) => {
20098
+ if (!isEqual(newRules, oldRules)) {
20099
+ action.clearValidate(props.item.name);
20100
+ }
20000
20101
  });
20001
20102
  return () => {
20002
20103
  var _a, _b;
@@ -20063,6 +20164,9 @@
20063
20164
  }
20064
20165
  });
20065
20166
 
20167
+ function _isSlot$4(s) {
20168
+ return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !vue.isVNode(s);
20169
+ }
20066
20170
  const LIST_PROP_KEYS = ["min", "max", "rowTitle", "rowTitleStyle", "alwaysShowRowTitle", "isValidateList", "emptyListMessage", "creatorRecord", "creatorButtonProps", "alwaysShowItemLabel", "actionGuard", "copyIconProps", "deleteIconProps", "onAfterAdd", "onAfterRemove"];
20067
20171
  const LIST_SLOT_NAMES = ["action", "creator", "item"];
20068
20172
  var FormItems = /* @__PURE__ */ vue.defineComponent({
@@ -20101,86 +20205,86 @@
20101
20205
  var _a;
20102
20206
  return (_a = props.grid) != null ? _a : grid == null ? void 0 : grid.value;
20103
20207
  });
20104
- const getItemsDom = vue.computed(() => {
20105
- return props.list.filter((item) => !allHiddenKeys.value.includes(item.key)).map((item) => {
20106
- var _a;
20107
- if (item.fieldType === ProFieldType.GROUP) {
20108
- return vue.createVNode(FormGroup, {
20109
- "key": item.key,
20110
- "items": item.children,
20111
- "title": item.title,
20112
- "tooltip": item.tooltip,
20113
- "colProps": item.colProps,
20114
- "rowProps": item.rowProps,
20115
- "spaceProps": item.spaceProps,
20116
- "grid": item.grid,
20117
- "item": item,
20118
- "formItemProps": item.formItemProps
20119
- }, null);
20120
- }
20121
- if (item.fieldType === ProFieldType.FORM_SET) {
20122
- return vue.createVNode(FormSet, {
20123
- "key": item.key,
20124
- "name": item.name,
20125
- "items": item.children,
20126
- "title": item.title,
20127
- "tooltip": item.tooltip,
20128
- "colProps": item.colProps,
20129
- "rowProps": item.rowProps,
20130
- "spaceProps": item.spaceProps,
20131
- "formItemProps": item.formItemProps,
20132
- "initialValue": item.initialValue,
20133
- "convertValue": item.convertValue,
20134
- "transform": item.transform
20135
- }, null);
20136
- }
20137
- if (item.fieldType === ProFieldType.FORM_LIST) {
20138
- const fieldProps = omitUndefined(pickKeys((_a = item.fieldProps) != null ? _a : {}, LIST_PROP_KEYS));
20139
- const slotsGetter = {};
20140
- LIST_SLOT_NAMES.forEach((name) => {
20141
- var _a2;
20142
- const slot = getSlot((_a2 = item.fieldProps) == null ? void 0 : _a2[`${name}Render`], formSlotsContext);
20143
- if (slot) {
20144
- slotsGetter[name] = (args) => vue.createVNode(RenderVNode$1, {
20145
- "vnode": slot,
20146
- "props": args
20147
- }, null);
20148
- }
20149
- });
20150
- return vue.createVNode(FormList, vue.mergeProps({
20151
- "key": item.key,
20152
- "name": item.name,
20153
- "originName": item.originName,
20154
- "items": item.children,
20155
- "title": item.title,
20156
- "tooltip": item.tooltip,
20157
- "rules": item.rules,
20158
- "colProps": item.colProps,
20159
- "rowProps": item.rowProps,
20160
- "formItemProps": item.formItemProps,
20161
- "initialValue": item.initialValue,
20162
- "convertValue": item.convertValue,
20163
- "transform": item.transform
20164
- }, fieldProps), {
20165
- ...slotsGetter
20166
- });
20167
- }
20168
- 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, {
20169
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,
20170
20221
  "item": item,
20171
- "grid": mergeGrid.value
20222
+ "formItemProps": item.formItemProps
20172
20223
  }, null);
20173
- });
20174
- });
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
+ };
20175
20278
  return () => {
20279
+ const items = visibleList.value.map(renderItem);
20176
20280
  if (props.type === "space" && !(mergeGrid == null ? void 0 : mergeGrid.value)) {
20177
20281
  return vue.createVNode(antDesignVue.Space, vue.mergeProps(props.spaceProps, {
20178
20282
  "align": "start"
20179
- }), {
20180
- default: () => [getItemsDom.value]
20283
+ }), _isSlot$4(items) ? items : {
20284
+ default: () => [items]
20181
20285
  });
20182
20286
  }
20183
- return getItemsDom.value;
20287
+ return items;
20184
20288
  };
20185
20289
  }
20186
20290
  });
@@ -20383,6 +20487,7 @@
20383
20487
  const formRef = vue.ref();
20384
20488
  const prefixCls = usePrefixCls("form");
20385
20489
  const formData = vue.ref({});
20490
+ const formDataVersion = vue.ref(0);
20386
20491
  const formItems = vue.ref([]);
20387
20492
  const formKey = vue.computed(() => {
20388
20493
  var _a;
@@ -20405,7 +20510,7 @@
20405
20510
  const formProps = vue.computed(() => {
20406
20511
  var _a;
20407
20512
  return {
20408
- ...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"])),
20409
20514
  layout: (_a = props.layout) != null ? _a : "vertical"
20410
20515
  };
20411
20516
  });
@@ -20447,6 +20552,7 @@
20447
20552
  vue.watch(initialValues, (newValues, oldValues) => {
20448
20553
  if (!isEqual(newValues, oldValues)) {
20449
20554
  formData.value = cloneDeep(convertKeyInitialValue(newValues, transformerMap.value));
20555
+ formDataVersion.value++;
20450
20556
  if (!props.request || props.requestAbort) {
20451
20557
  Promise.resolve().then(() => {
20452
20558
  hasInitial.value = false;
@@ -20454,8 +20560,7 @@
20454
20560
  }
20455
20561
  }
20456
20562
  }, {
20457
- immediate: true,
20458
- deep: true
20563
+ immediate: true
20459
20564
  });
20460
20565
  const onValuesChange = debounce(() => {
20461
20566
  var _a;
@@ -20478,18 +20583,17 @@
20478
20583
  }
20479
20584
  }
20480
20585
  };
20481
- vue.watch(formData, () => {
20586
+ vue.watch(formDataVersion, () => {
20482
20587
  if (!hasInitial.value) {
20483
20588
  onValuesChange();
20484
20589
  }
20485
- }, {
20486
- deep: true
20487
20590
  });
20488
20591
  const linkage = useLinkage();
20489
20592
  const action = useAction({
20490
20593
  props,
20491
20594
  formRef,
20492
20595
  formData,
20596
+ formDataVersion,
20493
20597
  initialValues,
20494
20598
  hasInitial,
20495
20599
  transformerMap,
@@ -20554,6 +20658,7 @@
20554
20658
  prefixCls,
20555
20659
  initialValues,
20556
20660
  formData,
20661
+ formDataVersion,
20557
20662
  hasInitial,
20558
20663
  theme: vue.computed(() => props.theme),
20559
20664
  customUi: vue.computed(() => props.customUi),
@@ -20646,7 +20751,8 @@
20646
20751
  emits: ["update:open"],
20647
20752
  setup(props, {
20648
20753
  slots,
20649
- emit
20754
+ emit,
20755
+ expose
20650
20756
  }) {
20651
20757
  const _open = vue.ref(false);
20652
20758
  const loading = vue.ref(false);
@@ -20698,7 +20804,7 @@
20698
20804
  });
20699
20805
  const submitterConfig = vue.computed(() => {
20700
20806
  var _a, _b, _c, _d;
20701
- if (props.submitter === false) {
20807
+ if (props.submitter === false || props.readonly) {
20702
20808
  return false;
20703
20809
  }
20704
20810
  return merge({
@@ -20758,6 +20864,7 @@
20758
20864
  (_c = (_b = formRef.value) == null ? void 0 : _b.reset) == null ? void 0 : _c.call(_b);
20759
20865
  }
20760
20866
  };
20867
+ expose(useFormExpose(formRef));
20761
20868
  const onFinishHandle = async (values) => {
20762
20869
  var _a;
20763
20870
  const response = (_a = props.onFinish) == null ? void 0 : _a.call(props, values);
@@ -20796,7 +20903,7 @@
20796
20903
  }
20797
20904
  }), {
20798
20905
  default: () => [vue.createVNode(BaseForm, vue.mergeProps(formProps.value, {
20799
- "submitter": submitterConfig.value,
20906
+ "submitter": props.readonly ? false : submitterConfig.value,
20800
20907
  "onFinish": async (values) => {
20801
20908
  const result = await onFinishHandle(values);
20802
20909
  return result;
@@ -20822,10 +20929,12 @@
20822
20929
  }
20823
20930
  }), formSlots.value)],
20824
20931
  ...drawerSlots.value,
20825
- footer: props.submitter !== false ? () => vue.createVNode("div", {
20826
- "style": "display: flex; justify-content: flex-end;",
20827
- "ref": footerRef
20828
- }, 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
+ } : {}
20829
20938
  }), triggerDom.value]);
20830
20939
  }
20831
20940
  });
@@ -20843,7 +20952,8 @@
20843
20952
  emits: ["update:open"],
20844
20953
  setup(props, {
20845
20954
  slots,
20846
- emit
20955
+ emit,
20956
+ expose
20847
20957
  }) {
20848
20958
  const _open = vue.ref(false);
20849
20959
  const loading = vue.ref(false);
@@ -20887,7 +20997,7 @@
20887
20997
  ...omit((_a = props.modalProps) != null ? _a : {}, ["title", "width", "footer", "onCancel", "afterClose"]),
20888
20998
  width: props.width,
20889
20999
  title: props.title,
20890
- footer: props.submitter === false ? null : void 0
21000
+ footer: props.readonly || props.submitter === false ? null : void 0
20891
21001
  });
20892
21002
  });
20893
21003
  const modalSlots = vue.computed(() => {
@@ -20897,7 +21007,7 @@
20897
21007
  });
20898
21008
  const submitterConfig = vue.computed(() => {
20899
21009
  var _a, _b, _c, _d;
20900
- if (props.submitter === false) {
21010
+ if (props.submitter === false || props.readonly) {
20901
21011
  return false;
20902
21012
  }
20903
21013
  return merge({
@@ -20957,6 +21067,7 @@
20957
21067
  (_c = (_b = formRef.value) == null ? void 0 : _b.reset) == null ? void 0 : _c.call(_b);
20958
21068
  }
20959
21069
  };
21070
+ expose(useFormExpose(formRef));
20960
21071
  const onFinishHandle = async (values) => {
20961
21072
  var _a;
20962
21073
  const response = (_a = props.onFinish) == null ? void 0 : _a.call(props, values);
@@ -20995,7 +21106,7 @@
20995
21106
  }
20996
21107
  }), {
20997
21108
  default: () => [vue.createVNode(BaseForm, vue.mergeProps(formProps.value, {
20998
- "submitter": submitterConfig.value,
21109
+ "submitter": props.readonly ? false : submitterConfig.value,
20999
21110
  "onFinish": async (values) => {
21000
21111
  const result = await onFinishHandle(values);
21001
21112
  return result;
@@ -21021,10 +21132,12 @@
21021
21132
  }
21022
21133
  }), formSlots.value)],
21023
21134
  ...modalSlots.value,
21024
- footer: props.submitter !== false ? () => vue.createVNode("div", {
21025
- "style": "display: flex; justify-content: flex-end;",
21026
- "ref": footerRef
21027
- }, 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
+ } : {}
21028
21141
  }), triggerDom.value]);
21029
21142
  }
21030
21143
  });
@@ -21073,7 +21186,7 @@
21073
21186
  const flatMapItems = (items, ignoreRules) => {
21074
21187
  return items == null ? void 0 : items.flatMap((item) => {
21075
21188
  if (item.fieldType === ProFieldType.GROUP && !item.title) {
21076
- return item.props.children;
21189
+ return item.children;
21077
21190
  }
21078
21191
  if (ignoreRules) {
21079
21192
  return {
@@ -21112,17 +21225,13 @@
21112
21225
  const {
21113
21226
  form
21114
21227
  } = useProConfigInject();
21115
- const totalSpan = vue.ref(0);
21116
- const totalSize = vue.ref(0);
21117
- const currentSpan = vue.ref(0);
21118
21228
  const intl = useIntl();
21119
21229
  const prefixCls = usePrefixCls("query-filter");
21120
21230
  const wrapEl = vue.useTemplateRef("wrapper");
21121
21231
  const formRef = vue.ref();
21122
- const processedList = vue.ref([]);
21123
21232
  const [width, setWidth] = useMergedState$1(defaultWidth);
21124
21233
  const formExpose = useFormExpose(formRef);
21125
- useResizeObserver(wrapEl, (entries) => {
21234
+ useResizeObserver(wrapEl, useDebounceFn((entries) => {
21126
21235
  const entry = entries[0];
21127
21236
  const {
21128
21237
  width: newWidth,
@@ -21132,7 +21241,7 @@
21132
21241
  setWidth(newWidth);
21133
21242
  }
21134
21243
  emit("resize", newWidth, height);
21135
- });
21244
+ }, 100));
21136
21245
  const spanSize = vue.computed(() => getSpanConfig(props.layout, width.value + 16, props.span));
21137
21246
  const showLength = vue.computed(() => {
21138
21247
  if (props.defaultFormItemsNumber !== void 0) {
@@ -21144,20 +21253,6 @@
21144
21253
  }
21145
21254
  return Math.max(1, 24 / spanSize.value.span - 1);
21146
21255
  });
21147
- const hiddenNum = vue.computed(() => props.showHiddenNum && processedList.value.filter((item) => item.hidden).length);
21148
- const needCollapse = vue.computed(() => {
21149
- if (totalSpan.value < 24 || totalSize.value <= showLength.value) {
21150
- return false;
21151
- }
21152
- return true;
21153
- });
21154
- const offset = vue.computed(() => {
21155
- const offsetSpan = currentSpan.value % 24 + spanSize.value.span;
21156
- if (offsetSpan > 24) {
21157
- return 24 - spanSize.value.span;
21158
- }
21159
- return 24 - offsetSpan;
21160
- });
21161
21256
  const formItemFixStyle = vue.computed(() => {
21162
21257
  var _a2, _b, _c;
21163
21258
  const labelWidth = (_c = (_b = props.labelWidth) != null ? _b : (_a2 = form == null ? void 0 : form.value) == null ? void 0 : _a2.labelWidth) != null ? _c : "80";
@@ -21184,6 +21279,80 @@
21184
21279
  emit("collapse", val);
21185
21280
  }
21186
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
+ });
21187
21356
  const formProps = vue.computed(() => {
21188
21357
  return {
21189
21358
  ...omitUndefined(omit(props, [
@@ -21234,66 +21403,7 @@
21234
21403
  }
21235
21404
  }, props.submitter);
21236
21405
  });
21237
- vue.watch([spanSize, collapsed, () => props.items], () => {
21238
- var _a2;
21239
- let firstRowFull = false;
21240
- currentSpan.value = 0;
21241
- totalSize.value = 0;
21242
- totalSpan.value = 0;
21243
- if ((_a2 = props.items) == null ? void 0 : _a2.length) {
21244
- processedList.value = flatMapItems(props.items, props.ignoreRules).map((item, index) => {
21245
- var _a3;
21246
- const colSize = (_a3 = item.colSize) != null ? _a3 : 1;
21247
- const colSpan = Math.min(spanSize.value.span * (colSize || 1), 24);
21248
- totalSpan.value += colSpan;
21249
- totalSize.value += colSize;
21250
- if (index === 0) {
21251
- firstRowFull = colSpan === 24 && !item.hidden;
21252
- }
21253
- const hidden = item.hidden || // 如果收起了
21254
- collapsed.value && (firstRowFull || // 如果 超过显示长度 且 总长度超过了 24
21255
- totalSize.value > showLength.value) && !!index;
21256
- if (hidden) {
21257
- if (!props.preserve) {
21258
- return {
21259
- ...item,
21260
- colProps: {
21261
- span: 0
21262
- },
21263
- hidden: true
21264
- };
21265
- }
21266
- return {
21267
- ...item,
21268
- colProps: {
21269
- span: colSpan
21270
- },
21271
- hidden: true
21272
- };
21273
- }
21274
- if (24 - currentSpan.value % 24 < colSpan) {
21275
- totalSpan.value += 24 - currentSpan.value % 24;
21276
- currentSpan.value += 24 - currentSpan.value % 24;
21277
- }
21278
- currentSpan.value += colSpan;
21279
- return {
21280
- ...item,
21281
- hidden,
21282
- formItemProps: {
21283
- ...item.title ? formItemFixStyle.value : {},
21284
- ...item.formItemProps
21285
- },
21286
- colProps: {
21287
- span: colSpan
21288
- }
21289
- };
21290
- });
21291
- } else {
21292
- processedList.value = [];
21293
- }
21294
- }, {
21295
- immediate: true
21296
- });
21406
+ const hiddenNum = vue.computed(() => props.showHiddenNum && processedResult.value.list.filter((item) => item.hidden).length);
21297
21407
  expose({
21298
21408
  formRef,
21299
21409
  ...formExpose
@@ -21317,7 +21427,7 @@
21317
21427
  "isKeyPressSubmit": (_a2 = props.isKeyPressSubmit) != null ? _a2 : true,
21318
21428
  "showLoading": false,
21319
21429
  "submitter": submitterConfig.value,
21320
- "items": processedList.value,
21430
+ "items": processedResult.value.list,
21321
21431
  "layout": spanSize.value.layout,
21322
21432
  "onReset": (values) => {
21323
21433
  var _a3, _b, _c, _d;
@@ -26256,43 +26366,68 @@
26256
26366
  }
26257
26367
  target.__resizeObserver__rect = { width: newWidth, height: newHeight };
26258
26368
  }
26259
- function resizeDisconnect(el) {
26260
- if (el.__resizeObserver__listeners) {
26261
- el.__resizeObserver__listeners.unobserve(el);
26262
- el.__resizeObserver__listeners.disconnect();
26263
- 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;
26264
26387
  }
26388
+ return sharedObservers[key];
26265
26389
  }
26266
- function resizeCallbackFactory(arg) {
26267
- return function(entries) {
26268
- const target = entries[0].target;
26269
- resizeHandler(target, arg, target.getBoundingClientRect(), target.__resizeObserver__rect || {});
26270
- };
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;
26271
26410
  }
26272
26411
  const resize = {
26273
26412
  created(el, binding) {
26274
26413
  const { arg, value = true } = binding;
26275
26414
  if (value) {
26276
- const resizeObserver = new index(resizeCallbackFactory(arg));
26277
- resizeObserver.observe(el);
26278
- el.__resizeObserver__listeners = resizeObserver;
26415
+ sharedObserve(el, arg);
26279
26416
  }
26280
26417
  },
26281
26418
  updated(el, binding) {
26282
26419
  const { arg, value = true } = binding;
26283
- if (value && !el.__resizeObserver__listeners) {
26284
- const resizeObserver = new index(resizeCallbackFactory(arg));
26285
- resizeObserver.observe(el);
26286
- el.__resizeObserver__listeners = resizeObserver;
26287
- } else if (!value) {
26288
- 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);
26289
26424
  }
26290
26425
  },
26291
26426
  beforeUnmount(el, binding) {
26292
26427
  const { arg, value = true } = binding;
26293
26428
  if (value) {
26294
26429
  resizeHandler(el, arg, { width: 0, height: 0 }, el.__resizeObserver__rect || {});
26295
- resizeDisconnect(el);
26430
+ sharedUnobserve(el, arg);
26296
26431
  }
26297
26432
  }
26298
26433
  };
@@ -26929,189 +27064,201 @@
26929
27064
  }
26930
27065
  mergeColumns.value = newColumns;
26931
27066
  });
26932
- vue.watch(
26933
- [mergeColumns, baseHeight, bodyScrollWidth, measureWidthRef],
26934
- () => {
26935
- var _a, _b, _c, _d;
26936
- const originMergeColumns = mergeColumns.value;
26937
- let newMaxRowSpan = 1;
26938
- const newLeftColumns = [];
26939
- const newRightColumns = [];
26940
- const newCenterColumns = [];
26941
- const newAutoHeightColumns = [];
26942
- const newLeftHeaderColumns = [];
26943
- const newRightHeaderColumns = [];
26944
- const newCenterHeaderColumns = [];
26945
- keyColumnMap.value = /* @__PURE__ */ new Map();
26946
- if (!measureWidthRef.value) {
26947
- return;
26948
- }
26949
- const autoWidthColumns = [];
26950
- let finallyWidthTotal = 0;
26951
- const genColumns = (allCols, leftHeaderCols, centerHeaderCols, rightHeaderCols, rowSpan, pos, fix) => {
26952
- for (let i = 0, len = allCols.length; i < len; i++) {
26953
- const originColumn = allCols[i];
26954
- if (!originColumn) {
26955
- 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);
26956
27132
  }
26957
- const {
26958
- width,
26959
- fixed = fix,
27133
+ newMaxRowSpan = Math.max(newMaxRowSpan, rowSpan + 1);
27134
+ genColumns(
26960
27135
  children,
26961
- ellipsis = false,
26962
- tooltip,
26963
- minWidth,
26964
- maxWidth
26965
- } = originColumn;
26966
- const columnWidth = columnWidthByString(
26967
- measureWidthRef.value,
26968
- bodyScrollWidth.value,
26969
- width
26970
- );
26971
- const columnMinWidth = columnWidthByString(
26972
- measureWidthRef.value,
26973
- bodyScrollWidth.value,
26974
- minWidth
27136
+ finallyColumn.children,
27137
+ finallyColumn.children,
27138
+ finallyColumn.children,
27139
+ rowSpan + 1,
27140
+ columnPos,
27141
+ parseFiexed
26975
27142
  );
26976
- const columnMaxWidth = maxWidth ? columnWidthByString(measureWidthRef.value, bodyScrollWidth.value, maxWidth) : 1 / 0;
26977
- const finallyWidth = Math.min(Math.max(columnWidth, columnMinWidth), columnMaxWidth);
26978
- const columnPos = getColumnPos(i, pos);
26979
- const columnKey = originColumn.columnKey || originColumn.key || columnPos;
26980
- const parseFiexed = fixed === true ? "left" : fixed;
26981
- const finallyColumn = Object.assign({}, originColumn, {
26982
- finallyWidth,
26983
- columnKey,
26984
- originColumn,
26985
- showTitle: !tooltip && (ellipsis === true || typeof ellipsis === "object" && (ellipsis == null ? void 0 : ellipsis.showTitle) !== false),
26986
- fixed: parseFiexed,
26987
- hidden: true === originColumn.hidden
26988
- });
26989
- keyColumnMap.value.set(columnKey, finallyColumn);
26990
- if (finallyColumn.hidden) {
26991
- break;
27143
+ } else {
27144
+ if (finallyColumn.width === void 0) {
27145
+ autoWidthColumns.push(finallyColumn);
26992
27146
  }
26993
- if (children && children.length) {
26994
- finallyColumn.children = [];
26995
- if (parseFiexed === "left") {
26996
- leftHeaderCols.push(finallyColumn);
26997
- } else if (parseFiexed === "right") {
26998
- rightHeaderCols.push(finallyColumn);
26999
- } else {
27000
- centerHeaderCols.push(finallyColumn);
27001
- }
27002
- newMaxRowSpan = Math.max(newMaxRowSpan, rowSpan + 1);
27003
- genColumns(
27004
- children,
27005
- finallyColumn.children,
27006
- finallyColumn.children,
27007
- finallyColumn.children,
27008
- rowSpan + 1,
27009
- columnPos,
27010
- parseFiexed
27011
- );
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);
27012
27154
  } else {
27013
- if (finallyColumn.width === void 0) {
27014
- autoWidthColumns.push(finallyColumn);
27015
- }
27016
- finallyWidthTotal += finallyColumn.finallyWidth;
27017
- if (parseFiexed === "left") {
27018
- newLeftColumns.push(finallyColumn);
27019
- leftHeaderCols.push(finallyColumn);
27020
- } else if (parseFiexed === "right") {
27021
- newRightColumns.push(finallyColumn);
27022
- rightHeaderCols.push(finallyColumn);
27023
- } else {
27024
- newCenterColumns.push(finallyColumn);
27025
- if (finallyColumn.autoHeight) {
27026
- newAutoHeightColumns.push(finallyColumn);
27027
- }
27028
- centerHeaderCols.push(finallyColumn);
27155
+ newCenterColumns.push(finallyColumn);
27156
+ if (finallyColumn.autoHeight) {
27157
+ newAutoHeightColumns.push(finallyColumn);
27029
27158
  }
27159
+ centerHeaderCols.push(finallyColumn);
27030
27160
  }
27031
27161
  }
27032
- };
27033
- genColumns(
27034
- originMergeColumns,
27035
- newLeftHeaderColumns,
27036
- newCenterHeaderColumns,
27037
- newRightHeaderColumns,
27038
- 1,
27039
- "__S_TABLE_COLUMN_Key__"
27040
- );
27041
- let differenceWidth = bodyScrollWidth.value - finallyWidthTotal;
27042
- const nonResizableColumns = autoWidthColumns.length ? autoWidthColumns : newLeftColumns.concat(newCenterColumns, newRightColumns).filter((column) => !column.resizable || !column.__Internal__Column__);
27043
- const widthDiffAverage = Math.floor(differenceWidth / nonResizableColumns.length);
27044
- if (differenceWidth > 0) {
27045
- for (let i = 0, len = nonResizableColumns.length; i < len; i++) {
27046
- const column = nonResizableColumns[i];
27047
- let finallyWidth = 0;
27048
- if (i == len - 1 && differenceWidth > widthDiffAverage) {
27049
- finallyWidth = column.finallyWidth + differenceWidth;
27050
- } else {
27051
- finallyWidth = Math.max(
27052
- Math.min(column.finallyWidth + widthDiffAverage, (_a = column.maxWidth) != null ? _a : 1 / 0),
27053
- (_b = column.minWidth) != null ? _b : 50
27054
- );
27055
- }
27056
- differenceWidth -= finallyWidth - column.finallyWidth;
27057
- 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
+ );
27058
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);
27059
27199
  } else {
27060
- for (let i = 0, len = autoWidthColumns.length; i < len; i++) {
27061
- const column = autoWidthColumns[i];
27062
- column.finallyWidth = Math.min((_c = column.minWidth) != null ? _c : 50, (_d = column.maxWidth) != null ? _d : 1 / 0);
27063
- }
27200
+ headerHeight.value = new Array(newMaxRowSpan).fill(props.headerHeight);
27064
27201
  }
27065
- if (props.headerHeight !== void 0) {
27066
- if (Array.isArray(props.headerHeight)) {
27067
- 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
+ );
27068
27220
  } else {
27069
- 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);
27070
27223
  }
27071
- } else {
27072
- headerHeight.value = new Array(newMaxRowSpan).fill(baseHeight.value);
27073
- }
27074
- const genHeaderColumns = (headerColumns, left, top, rowSpan) => {
27075
- let totalFinallyWidth = 0;
27076
- let totalLeft = left;
27077
- headerColumns.forEach((column) => {
27078
- column.left = totalLeft;
27079
- column.top = top;
27080
- if (column.children) {
27081
- column.rowSpan = 1;
27082
- column.height = headerHeight.value[newMaxRowSpan - rowSpan];
27083
- column.finallyWidth = genHeaderColumns(
27084
- column.children,
27085
- totalLeft,
27086
- column.height,
27087
- rowSpan - 1
27088
- );
27089
- } else {
27090
- column.rowSpan = rowSpan;
27091
- column.height = headerHeight.value.slice(newMaxRowSpan - rowSpan).reduce((pre, cur) => pre + cur, 0);
27092
- }
27093
- totalLeft += column.finallyWidth;
27094
- totalFinallyWidth += column.finallyWidth;
27095
- });
27096
- return totalFinallyWidth;
27097
- };
27098
- genHeaderColumns(
27099
- newLeftHeaderColumns.concat(newCenterHeaderColumns, newRightHeaderColumns),
27100
- 0,
27101
- 0,
27102
- newMaxRowSpan
27103
- );
27104
- leftColumns.value = newLeftColumns;
27105
- rightColumns.value = newRightColumns;
27106
- centerColumns.value = newCenterColumns;
27107
- autoHeightColumns.value = newAutoHeightColumns;
27108
- leftHeaderColumns.value = newLeftHeaderColumns;
27109
- rightHeaderColumns.value = newRightHeaderColumns;
27110
- centerHeaderColumns.value = newCenterHeaderColumns;
27111
- 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
+ });
27112
27256
  },
27113
27257
  { immediate: true }
27114
27258
  );
27259
+ vue.onBeforeUnmount(() => {
27260
+ raf.cancel(columnsRafFrame);
27261
+ });
27115
27262
  const allColumns = vue.shallowRef([]);
27116
27263
  let cacheColumnKeyPositonMap = {};
27117
27264
  const columnKeyIndexMap = vue.shallowRef({});
@@ -32344,8 +32491,8 @@
32344
32491
  rowIndex: { type: Number, required: true },
32345
32492
  flattenRowIndex: { type: Number, required: true },
32346
32493
  rowKey: { type: [Number, String] },
32347
- column: { type: Object, default: () => ({}) },
32348
- item: { type: Object, default: () => ({}) },
32494
+ column: { type: Object },
32495
+ item: { type: Object },
32349
32496
  wrapText: { type: Boolean, default: false },
32350
32497
  type: { type: String },
32351
32498
  height: Number,
@@ -32371,6 +32518,39 @@
32371
32518
  error: "#e8353e",
32372
32519
  warning: "#eb8903"
32373
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
+ }
32374
32554
  const BodyCell$1 = (props, { slots, emit }) => {
32375
32555
  var _a, _b, _c, _d, _e, _f, _g, _h;
32376
32556
  const { table } = useProConfigInject();
@@ -32391,11 +32571,13 @@
32391
32571
  let tooltipTitle = value;
32392
32572
  const valueStatus = runFunction(column == null ? void 0 : column.valueStatus, value, props.item, valueEnum == null ? void 0 : valueEnum[value]);
32393
32573
  const recordIndexs = tableContext.getIndexsByKey(rowKey);
32394
- 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;
32395
32577
  const cellContentClass = {
32396
- [`${prefixCls}-cell-content`]: true,
32397
- [`${prefixCls}-cell-wrap-text`]: column.wrapText === void 0 ? wrapText : column.wrapText,
32398
- [`${prefixCls}-cell-text-ellipsis`]: !!column.ellipsis
32578
+ [c.cellContent]: true,
32579
+ [c.cellWrapText]: isWrapText,
32580
+ [c.cellTextEllipsis]: !!column.ellipsis
32399
32581
  };
32400
32582
  const cellContentStyle = {
32401
32583
  textAlign: `${column.align}`,
@@ -32412,13 +32594,13 @@
32412
32594
  const cellProps2 = cellRender.props || {};
32413
32595
  const cellRowSpan = cellProps2.rowSpan;
32414
32596
  const cellClass = {
32415
- [`${prefixCls}-cell`]: true,
32416
- [`${prefixCls}-first-cell`]: column.columnIndex === 0,
32417
- [`${prefixCls}-body-cell`]: true,
32418
- [`${prefixCls}-cell-multi`]: cellRowSpan > 1,
32419
- [`${prefixCls}-cell-hidden`]: cellRowSpan === 0,
32420
- [`${prefixCls}-column-sort`]: sorterInfo.sorterOrder,
32421
- [`${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
32422
32604
  };
32423
32605
  const cellRenderArgs = {
32424
32606
  record: item,
@@ -32426,7 +32608,7 @@
32426
32608
  text: value,
32427
32609
  value,
32428
32610
  index: rowIndex,
32429
- recordIndexs: tableContext.getIndexsByKey(rowKey),
32611
+ recordIndexs,
32430
32612
  key,
32431
32613
  valueStatus,
32432
32614
  cancelEditable: tableContext.cancelEditable,
@@ -32490,14 +32672,12 @@
32490
32672
  [
32491
32673
  vue.createVNode(
32492
32674
  "div",
32493
- vue.mergeProps(
32494
- {
32495
- class: cellContentClass,
32496
- style: cellContentStyle,
32497
- title: altTitle
32498
- },
32499
- cellKeyProps
32500
- ),
32675
+ {
32676
+ class: cellContentClass,
32677
+ style: cellContentStyle,
32678
+ title: altTitle,
32679
+ ...cellKeyProps
32680
+ },
32501
32681
  [hasAppendNode ? (_h = slots.appendNode) == null ? void 0 : _h.call(slots) : null, bodyCell]
32502
32682
  )
32503
32683
  ]
@@ -33044,8 +33224,8 @@
33044
33224
  rowIndex: { type: Number, required: true },
33045
33225
  flattenRowIndex: { type: Number, required: true },
33046
33226
  rowKey: { type: [Number, String] },
33047
- column: { type: Object, default: () => ({}) },
33048
- item: { type: Object, default: () => ({}) },
33227
+ column: { type: Object, required: true },
33228
+ item: { type: Object, required: true },
33049
33229
  wrapText: { type: Boolean, default: false },
33050
33230
  type: { type: String },
33051
33231
  height: Number,
@@ -33171,18 +33351,33 @@
33171
33351
  "edit-row": _ctx.editRow,
33172
33352
  "editable-keys": _ctx.editableKeys,
33173
33353
  "is-row-edit": _ctx.isRowEdit
33174
- }, 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, {
33175
- 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" : "" }),
33176
33371
  onClick: _cache[0] || (_cache[0] = ($event) => _ctx.onCellEvent($event, "click")),
33177
33372
  onDblClick: _cache[1] || (_cache[1] = ($event) => _ctx.onCellEvent($event, "dblClick")),
33178
33373
  onContextmenu: _cache[2] || (_cache[2] = ($event) => _ctx.onCellEvent($event, "contextmenu"))
33179
- }), {
33374
+ }, {
33180
33375
  appendNode: vue.withCtx(() => [
33181
33376
  vue.renderSlot(_ctx.$slots, "appendNode")
33182
33377
  ]),
33183
33378
  _: 3
33184
33379
  /* FORWARDED */
33185
- }, 16, ["style"]));
33380
+ }, 8, ["prefixCls", "rowIndex", "flattenRowIndex", "rowKey", "column", "item", "wrapText", "type", "height", "hasAppendNode", "resizeObserver", "calMaxHeight", "tooltipOpen", "getPopupContainer", "style"]));
33186
33381
  }
33187
33382
  var BodyCell = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["render", _sfc_render$j]]);
33188
33383
 
@@ -34651,11 +34846,25 @@
34651
34846
  return summaryStyle.value;
34652
34847
  });
34653
34848
  const emptyStyle = vue.computed(() => ({ width: `${props.bodyWidth}px` }));
34849
+ let resizeRafFrame;
34850
+ let pendingWidth = 0;
34851
+ let pendingHeight = 0;
34654
34852
  useResizeObserver(measureDomRef, (entries) => {
34655
34853
  var _a;
34656
34854
  const contentRect = (_a = entries[0]) == null ? void 0 : _a.contentRect;
34657
- emit("update:bodyWidth", (contentRect == null ? void 0 : contentRect.width) || 0);
34658
- emit("update:bodyHeight", (contentRect == null ? void 0 : contentRect.height) || 0);
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);
34659
34868
  });
34660
34869
  return {
34661
34870
  bodyContainerStyle,
@@ -37989,10 +38198,11 @@
37989
38198
  return false;
37990
38199
  });
37991
38200
  const showTableCard = vue.computed(() => {
38201
+ var _a2, _b2;
37992
38202
  if (counter.hasFullScreen.value) {
37993
38203
  return false;
37994
38204
  }
37995
- return props.cardProps !== false && !notNeedCardDom.value;
38205
+ return !!((_b2 = props.cardProps) != null ? _b2 : (_a2 = table == null ? void 0 : table.value) == null ? void 0 : _a2.cardProps) && !notNeedCardDom.value;
37996
38206
  });
37997
38207
  const cardBodyStyle = vue.computed(() => {
37998
38208
  if (!showTableCard.value) return {};
@@ -38187,13 +38397,14 @@
38187
38397
  footer: props.footer || slots.footer
38188
38398
  })]);
38189
38399
  if (showTableCard.value) {
38400
+ const cardProps = isObject$4(props.cardProps) ? props.cardProps : {};
38190
38401
  const _tableDom = /* @__PURE__ */ (function() {
38191
38402
  return tableDom;
38192
38403
  })();
38193
38404
  tableDom = vue.createVNode(antDesignVue.Card, vue.mergeProps({
38194
38405
  "bordered": isBordered("table", (_e = (_d = props.cardBordered) != null ? _d : (_c = table == null ? void 0 : table.value) == null ? void 0 : _c.cardBordered) != null ? _e : dark == null ? void 0 : dark.value),
38195
38406
  "bodyStyle": cardBodyStyle.value
38196
- }, props.cardProps), _isSlot(tableDom) ? tableDom : {
38407
+ }, cardProps), _isSlot(tableDom) ? tableDom : {
38197
38408
  default: () => [_tableDom]
38198
38409
  });
38199
38410
  }
@@ -38705,12 +38916,13 @@
38705
38916
  title: { type: String, required: false },
38706
38917
  description: { type: String, required: false },
38707
38918
  contentClass: { type: String, required: false, default: "" },
38919
+ pageStyle: { type: Object, required: false },
38708
38920
  contentStyle: { type: Object, required: false },
38709
- autoContentHeight: { type: Boolean, required: false, default: false },
38921
+ autoContentHeight: { type: Boolean, required: false },
38710
38922
  headerClass: { type: String, required: false, default: "" },
38711
38923
  footerClass: { type: String, required: false, default: "" },
38712
38924
  heightOffset: { type: Number, required: false, default: 0 },
38713
- contentPadding: { type: Number, required: false, default: 16 },
38925
+ contentPadding: { type: Number, required: false },
38714
38926
  tabList: { type: Array, required: false, default: () => [] },
38715
38927
  onTabChange: { type: null, required: false },
38716
38928
  tabProps: { type: Object, required: false },
@@ -38727,28 +38939,50 @@
38727
38939
  const footerHeight = vue.ref(0);
38728
38940
  const tabsHeight = vue.ref(0);
38729
38941
  const shouldAutoHeight = vue.ref(false);
38730
- const { contentOffsetTop } = useProConfigInject();
38942
+ const { contentOffsetTop, page } = useProConfigInject();
38731
38943
  const tabActiveKey = vue.useModel(__props, "activeKey");
38732
38944
  const headerRef = vue.useTemplateRef("header");
38733
38945
  const footerRef = vue.useTemplateRef("footer");
38734
38946
  const tabsRef = vue.useTemplateRef("tabs");
38735
- const headerCls = vue.computed(() => ({
38736
- [`${prefixCls}-header`]: true,
38737
- [__props.headerClass]: true
38738
- }));
38739
- const contentCls = vue.computed(() => ({
38740
- [`${prefixCls}-content`]: true,
38741
- [__props.contentClass]: true
38742
- }));
38743
- const footerCls = vue.computed(() => ({
38744
- [`${prefixCls}-footer`]: true,
38745
- [__props.footerClass]: true
38746
- }));
38947
+ const mergeContentPadding = vue.computed(() => {
38948
+ var _a;
38949
+ return __props.contentPadding || ((_a = page == null ? void 0 : page.value) == null ? void 0 : _a.contentPadding) || 16;
38950
+ });
38951
+ const mergeAutoContentHeight = vue.computed(
38952
+ () => {
38953
+ var _a;
38954
+ return __props.autoContentHeight || ((_a = page == null ? void 0 : page.value) == null ? void 0 : _a.autoContentHeight) || false;
38955
+ }
38956
+ );
38957
+ const headerCls = vue.computed(() => {
38958
+ var _a;
38959
+ return {
38960
+ [`${prefixCls}-header`]: true,
38961
+ [((_a = page == null ? void 0 : page.value) == null ? void 0 : _a.headerClass) || ""]: true,
38962
+ [__props.headerClass]: true
38963
+ };
38964
+ });
38965
+ const contentCls = vue.computed(() => {
38966
+ var _a;
38967
+ return {
38968
+ [`${prefixCls}-content`]: true,
38969
+ [((_a = page == null ? void 0 : page.value) == null ? void 0 : _a.contentClass) || ""]: true,
38970
+ [__props.contentClass]: true
38971
+ };
38972
+ });
38973
+ const footerCls = vue.computed(() => {
38974
+ var _a;
38975
+ return {
38976
+ [`${prefixCls}-footer`]: true,
38977
+ [((_a = page == null ? void 0 : page.value) == null ? void 0 : _a.footerClass) || ""]: true,
38978
+ [__props.footerClass]: true
38979
+ };
38980
+ });
38747
38981
  const offset = vue.computed(() => {
38748
- if (__props.autoContentHeight) {
38982
+ if (mergeAutoContentHeight.value) {
38749
38983
  return {
38750
- top: -__props.contentPadding,
38751
- bottom: -__props.contentPadding
38984
+ top: -mergeContentPadding.value,
38985
+ bottom: -mergeContentPadding.value
38752
38986
  };
38753
38987
  }
38754
38988
  return {
@@ -38757,16 +38991,19 @@
38757
38991
  };
38758
38992
  });
38759
38993
  const contentStyles = vue.computed(() => {
38760
- if (__props.autoContentHeight) {
38994
+ var _a, _b;
38995
+ if (mergeAutoContentHeight.value) {
38761
38996
  return {
38762
38997
  height: `calc(var(${CSS_VARIABLE_LAYOUT_CONTENT_HEIGHT}) - ${headerHeight.value}px - ${tabsHeight.value}px - ${typeof __props.heightOffset === "number" ? `${__props.heightOffset}px` : __props.heightOffset})`,
38763
38998
  overflowY: shouldAutoHeight.value ? "auto" : "unset",
38764
- padding: `${__props.contentPadding || 0}px`,
38999
+ padding: `${mergeContentPadding.value || 0}px`,
39000
+ ...(_a = page == null ? void 0 : page.value) == null ? void 0 : _a.contentStyle,
38765
39001
  ...__props.contentStyle
38766
39002
  };
38767
39003
  }
38768
39004
  return {
38769
- padding: `${__props.contentPadding || 0}px`,
39005
+ padding: `${mergeContentPadding.value || 0}px`,
39006
+ ...(_b = page == null ? void 0 : page.value) == null ? void 0 : _b.contentStyle,
38770
39007
  ...__props.contentStyle
38771
39008
  };
38772
39009
  });
@@ -38801,11 +39038,12 @@
38801
39038
  calcContentHeight();
38802
39039
  });
38803
39040
  return (_ctx, _cache) => {
38804
- var _a, _b, _c, _d, _e, _f, _g;
39041
+ var _a, _b, _c, _d, _e, _f, _g, _h;
38805
39042
  return vue.openBlock(), vue.createElementBlock(
38806
39043
  "div",
38807
39044
  {
38808
- class: vue.normalizeClass([vue.unref(prefixCls), ((_a = _ctx.tabList) == null ? void 0 : _a.length) ? `is-tabs` : ""])
39045
+ class: vue.normalizeClass([vue.unref(prefixCls), ((_a = _ctx.tabList) == null ? void 0 : _a.length) ? `is-tabs` : ""]),
39046
+ style: vue.normalizeStyle((_b = vue.unref(page)) == null ? void 0 : _b.pageStyle)
38809
39047
  },
38810
39048
  [
38811
39049
  _ctx.$slots.header || _ctx.description || _ctx.$slots.description || _ctx.title || _ctx.$slots.title || _ctx.$slots.extra ? (vue.openBlock(), vue.createElementBlock(
@@ -38859,7 +39097,7 @@
38859
39097
  2
38860
39098
  /* CLASS */
38861
39099
  )) : vue.createCommentVNode("v-if", true),
38862
- ((_b = _ctx.tabList) == null ? void 0 : _b.length) ? (vue.openBlock(), vue.createElementBlock(
39100
+ ((_c = _ctx.tabList) == null ? void 0 : _c.length) ? (vue.openBlock(), vue.createElementBlock(
38863
39101
  "div",
38864
39102
  {
38865
39103
  key: 1,
@@ -38906,12 +39144,12 @@
38906
39144
  },
38907
39145
  [
38908
39146
  vue.renderSlot(_ctx.$slots, "default", {
38909
- activeKey: (_d = tabActiveKey.value) != null ? _d : (_c = _ctx.tabList[0]) == null ? void 0 : _c.key,
39147
+ activeKey: (_e = tabActiveKey.value) != null ? _e : (_d = _ctx.tabList[0]) == null ? void 0 : _d.key,
38910
39148
  offset: offset.value
38911
39149
  }),
38912
- ((_e = _ctx.tabList) == null ? void 0 : _e.length) ? vue.renderSlot(_ctx.$slots, "tabs", {
39150
+ ((_f = _ctx.tabList) == null ? void 0 : _f.length) ? vue.renderSlot(_ctx.$slots, "tabs", {
38913
39151
  key: 0,
38914
- activeKey: (_g = tabActiveKey.value) != null ? _g : (_f = _ctx.tabList[0]) == null ? void 0 : _f.key,
39152
+ activeKey: (_h = tabActiveKey.value) != null ? _h : (_g = _ctx.tabList[0]) == null ? void 0 : _g.key,
38915
39153
  offset: offset.value
38916
39154
  }, () => [
38917
39155
  (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(tabComp.value)))
@@ -38934,8 +39172,8 @@
38934
39172
  /* CLASS */
38935
39173
  )) : vue.createCommentVNode("v-if", true)
38936
39174
  ],
38937
- 2
38938
- /* CLASS */
39175
+ 6
39176
+ /* CLASS, STYLE */
38939
39177
  );
38940
39178
  };
38941
39179
  }