@aplus-frontend/ui 7.19.0-beta.1 → 7.19.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 (165) hide show
  1. package/es/src/ag-grid/context.mjs +1 -1
  2. package/es/src/ag-grid/editable/form-item.vue.d.ts +2 -4
  3. package/es/src/ag-grid/editable/form-item.vue.mjs +88 -77
  4. package/es/src/ag-grid/editable/index.vue.d.ts +2 -4
  5. package/es/src/ag-grid/editable/index.vue.mjs +9 -8
  6. package/es/src/ag-grid/editable/interface.d.ts +15 -1
  7. package/es/src/ag-grid/hooks/use-columns.mjs +31 -23
  8. package/es/src/ag-grid/hooks/use-pinned-row.mjs +2 -2
  9. package/es/src/ag-grid/index.vue.d.ts +2 -4
  10. package/es/src/ag-grid/index.vue.mjs +353 -335
  11. package/es/src/ag-grid/interface.d.ts +40 -1
  12. package/es/src/ag-grid/utils.d.ts +18 -0
  13. package/es/src/ag-grid/utils.mjs +39 -18
  14. package/es/src/ap-field/cascader/use-options.d.ts +4 -4
  15. package/es/src/ap-field/date/index.vue.d.ts +0 -1
  16. package/es/src/ap-field/date-range/index.vue.d.ts +0 -1
  17. package/es/src/ap-field/select/use-select-options.d.ts +2 -2
  18. package/es/src/ap-field/text/password.vue.d.ts +4 -4
  19. package/es/src/ap-field/tree-select/use-request.d.ts +4 -4
  20. package/es/src/ap-form/ap-form.vue.d.ts +1 -2
  21. package/es/src/ap-form/ap-form.vue2.mjs +63 -61
  22. package/es/src/ap-form/context.mjs +1 -1
  23. package/es/src/ap-form/drawer-form/index.vue.d.ts +3 -4
  24. package/es/src/ap-form/interface.d.ts +4 -0
  25. package/es/src/ap-form/item/index.vue.d.ts +6 -6
  26. package/es/src/ap-form/item-group/helper.mjs +2 -2
  27. package/es/src/ap-form/items/date/index.vue.d.ts +9 -11
  28. package/es/src/ap-form/items/date-range/index.vue.d.ts +13 -15
  29. package/es/src/ap-form/items/number/index.vue.d.ts +2 -3
  30. package/es/src/ap-form/items/select/index.vue.d.ts +8 -8
  31. package/es/src/ap-form/modal-form/index.vue.d.ts +3 -4
  32. package/es/src/ap-form/provider/context.mjs +1 -1
  33. package/es/src/ap-form/search-form/index.vue.d.ts +3 -4
  34. package/es/src/ap-grid/editable/form-item.vue.d.ts +2 -4
  35. package/es/src/ap-grid/editable/index.vue.d.ts +2 -4
  36. package/es/src/ap-grid/index.vue.d.ts +2 -4
  37. package/es/src/ap-grid/utils/table.mjs +2 -2
  38. package/es/src/ap-list/index.vue.d.ts +2 -4
  39. package/es/src/ap-modal/utils/confirm.d.ts +1 -1
  40. package/es/src/ap-pro-card/components/card/index.vue2.mjs +2 -2
  41. package/es/src/ap-table/ap-table.vue.d.ts +2 -4
  42. package/es/src/ap-table/components/setting/context.d.ts +1 -1
  43. package/es/src/ap-table/components/setting/context.mjs +1 -1
  44. package/es/src/ap-table/components/setting/modal/index.vue.mjs +127 -117
  45. package/es/src/ap-table/components/setting/sorter/context.mjs +1 -1
  46. package/es/src/ap-table/components/setting/template/edit-form.vue.d.ts +2 -3
  47. package/es/src/ap-table/constants.d.ts +20 -22
  48. package/es/src/ap-table/context.mjs +1 -1
  49. package/es/src/ap-table/hooks/use-table-paging-ng.mjs +9 -9
  50. package/es/src/ap-table/hooks/use-table-template-storage.d.ts +9 -9
  51. package/es/src/ap-table/hooks/use-table-template-storage.mjs +102 -95
  52. package/es/src/ap-table/utils.mjs +1 -1
  53. package/es/src/business/ag-grid-modal/hooks/use-ag-grid-instance.mjs +1 -1
  54. package/es/src/business/ap-batch-action-group/index.d.ts +3 -3
  55. package/es/src/business/ap-download/hooks/index.mjs +1 -1
  56. package/es/src/business/ap-draggable-grid/ApDraggableGrid.vue.d.ts +1 -1
  57. package/es/src/business/ap-draggable-grid/ApDraggableGrid.vue2.mjs +1 -3
  58. package/es/src/business/ap-draggable-grid/index.d.ts +1 -1
  59. package/es/src/business/ap-expand-alert/ApExpandAlert.vue.d.ts +2 -4
  60. package/es/src/business/ap-keep-alive/hook.mjs +1 -1
  61. package/es/src/business/ap-keep-alive/utils.mjs +1 -1
  62. package/es/src/business/ap-select-layout/index.d.ts +2 -4
  63. package/es/src/business/ap-select-layout/select-layout.vue.d.ts +2 -4
  64. package/es/src/business/ap-table-modal/index.d.ts +17 -5
  65. package/es/src/business/ap-upload/components/MultipleFile.vue.d.ts +1 -1
  66. package/es/src/business/ap-upload/components/MultipleFile.vue2.mjs +128 -112
  67. package/es/src/business/ap-value-select-card/index.vue.d.ts +2 -4
  68. package/es/src/business/ap-view/ap-view.vue.d.ts +1 -1
  69. package/es/src/business/ap-view/ap-view.vue2.mjs +87 -81
  70. package/es/src/business/ap-view/components/main-button-content.vue.d.ts +2 -3
  71. package/es/src/business/ap-view/components/menu-list-content.vue.d.ts +2 -3
  72. package/es/src/business/ap-view/hooks/use-send-to-url.d.ts +2 -0
  73. package/es/src/business/ap-view/hooks/use-send-to-url.mjs +46 -30
  74. package/es/src/business/ap-view/hooks/use-view-provide.mjs +1 -1
  75. package/es/src/business/ap-view/index.d.ts +3 -3
  76. package/es/src/business/ap-view/interface.d.ts +7 -1
  77. package/es/src/check-card/context.mjs +1 -1
  78. package/es/src/config-provider/constants.mjs +1 -1
  79. package/es/src/config-provider/hooks/use-locale.mjs +1 -1
  80. package/es/src/config-provider/hooks/use-namespace.d.ts +5 -1
  81. package/es/src/config-provider/hooks/use-namespace.mjs +1 -1
  82. package/es/src/config-provider/hooks/use-token.mjs +1 -1
  83. package/es/src/editable-table/form-item.vue.d.ts +2 -4
  84. package/es/src/editable-table/index.vue.d.ts +2 -4
  85. package/es/src/editable-table/utils.mjs +1 -1
  86. package/es/src/scroll-view/index.vue.d.ts +5 -5
  87. package/es/src/tests/wrapper.d.ts +4 -4
  88. package/es/src/text/context.mjs +1 -1
  89. package/es/src/time-ago/useTimeAgo.mjs +1 -1
  90. package/es/src/type.d.ts +1 -0
  91. package/es/src/utils/slot.mjs +1 -1
  92. package/es/src/version.d.ts +1 -1
  93. package/es/src/version.mjs +1 -1
  94. package/lib/src/ag-grid/editable/form-item.vue.d.ts +2 -4
  95. package/lib/src/ag-grid/editable/form-item.vue.js +1 -1
  96. package/lib/src/ag-grid/editable/index.vue.d.ts +2 -4
  97. package/lib/src/ag-grid/editable/index.vue.js +1 -1
  98. package/lib/src/ag-grid/editable/interface.d.ts +15 -1
  99. package/lib/src/ag-grid/hooks/use-columns.js +1 -1
  100. package/lib/src/ag-grid/hooks/use-pinned-row.js +1 -1
  101. package/lib/src/ag-grid/index.vue.d.ts +2 -4
  102. package/lib/src/ag-grid/index.vue.js +1 -1
  103. package/lib/src/ag-grid/interface.d.ts +40 -1
  104. package/lib/src/ag-grid/utils.d.ts +18 -0
  105. package/lib/src/ag-grid/utils.js +1 -1
  106. package/lib/src/ap-field/cascader/use-options.d.ts +4 -4
  107. package/lib/src/ap-field/date/index.vue.d.ts +0 -1
  108. package/lib/src/ap-field/date-range/index.vue.d.ts +0 -1
  109. package/lib/src/ap-field/select/use-select-options.d.ts +2 -2
  110. package/lib/src/ap-field/text/password.vue.d.ts +4 -4
  111. package/lib/src/ap-field/tree-select/use-request.d.ts +4 -4
  112. package/lib/src/ap-form/ap-form.vue.d.ts +1 -2
  113. package/lib/src/ap-form/ap-form.vue2.js +1 -1
  114. package/lib/src/ap-form/drawer-form/index.vue.d.ts +3 -4
  115. package/lib/src/ap-form/interface.d.ts +4 -0
  116. package/lib/src/ap-form/item/index.vue.d.ts +6 -6
  117. package/lib/src/ap-form/items/date/index.vue.d.ts +9 -11
  118. package/lib/src/ap-form/items/date-range/index.vue.d.ts +13 -15
  119. package/lib/src/ap-form/items/number/index.vue.d.ts +2 -3
  120. package/lib/src/ap-form/items/select/index.vue.d.ts +8 -8
  121. package/lib/src/ap-form/modal-form/index.vue.d.ts +3 -4
  122. package/lib/src/ap-form/search-form/index.vue.d.ts +3 -4
  123. package/lib/src/ap-grid/editable/form-item.vue.d.ts +2 -4
  124. package/lib/src/ap-grid/editable/index.vue.d.ts +2 -4
  125. package/lib/src/ap-grid/index.vue.d.ts +2 -4
  126. package/lib/src/ap-grid/utils/table.js +1 -1
  127. package/lib/src/ap-list/index.vue.d.ts +2 -4
  128. package/lib/src/ap-modal/utils/confirm.d.ts +1 -1
  129. package/lib/src/ap-table/ap-table.vue.d.ts +2 -4
  130. package/lib/src/ap-table/components/setting/context.d.ts +1 -1
  131. package/lib/src/ap-table/components/setting/modal/index.vue.js +1 -1
  132. package/lib/src/ap-table/components/setting/template/edit-form.vue.d.ts +2 -3
  133. package/lib/src/ap-table/constants.d.ts +20 -22
  134. package/lib/src/ap-table/hooks/use-table-paging-ng.js +1 -1
  135. package/lib/src/ap-table/hooks/use-table-template-storage.d.ts +9 -9
  136. package/lib/src/ap-table/hooks/use-table-template-storage.js +1 -1
  137. package/lib/src/business/ap-batch-action-group/index.d.ts +3 -3
  138. package/lib/src/business/ap-draggable-grid/ApDraggableGrid.vue.d.ts +1 -1
  139. package/lib/src/business/ap-draggable-grid/ApDraggableGrid.vue2.js +1 -1
  140. package/lib/src/business/ap-draggable-grid/index.d.ts +1 -1
  141. package/lib/src/business/ap-expand-alert/ApExpandAlert.vue.d.ts +2 -4
  142. package/lib/src/business/ap-select-layout/index.d.ts +2 -4
  143. package/lib/src/business/ap-select-layout/select-layout.vue.d.ts +2 -4
  144. package/lib/src/business/ap-table-modal/index.d.ts +17 -5
  145. package/lib/src/business/ap-upload/components/MultipleFile.vue.d.ts +1 -1
  146. package/lib/src/business/ap-upload/components/MultipleFile.vue2.js +1 -1
  147. package/lib/src/business/ap-value-select-card/index.vue.d.ts +2 -4
  148. package/lib/src/business/ap-view/ap-view.vue.d.ts +1 -1
  149. package/lib/src/business/ap-view/ap-view.vue2.js +1 -1
  150. package/lib/src/business/ap-view/components/main-button-content.vue.d.ts +2 -3
  151. package/lib/src/business/ap-view/components/menu-list-content.vue.d.ts +2 -3
  152. package/lib/src/business/ap-view/hooks/use-send-to-url.d.ts +2 -0
  153. package/lib/src/business/ap-view/hooks/use-send-to-url.js +1 -1
  154. package/lib/src/business/ap-view/index.d.ts +3 -3
  155. package/lib/src/business/ap-view/interface.d.ts +7 -1
  156. package/lib/src/config-provider/hooks/use-namespace.d.ts +5 -1
  157. package/lib/src/editable-table/form-item.vue.d.ts +2 -4
  158. package/lib/src/editable-table/index.vue.d.ts +2 -4
  159. package/lib/src/scroll-view/index.vue.d.ts +5 -5
  160. package/lib/src/tests/wrapper.d.ts +4 -4
  161. package/lib/src/time-ago/useTimeAgo.js +1 -1
  162. package/lib/src/type.d.ts +1 -0
  163. package/lib/src/version.d.ts +1 -1
  164. package/lib/src/version.js +1 -1
  165. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  import { provide as r, inject as t, ref as n } from "vue";
2
- const o = Symbol("agGridExpandableKey"), i = Symbol("agGridSorterContextKey");
2
+ const o = /* @__PURE__ */ Symbol("agGridExpandableKey"), i = /* @__PURE__ */ Symbol("agGridSorterContextKey");
3
3
  function d(e) {
4
4
  r(o, e);
5
5
  }
@@ -1,15 +1,13 @@
1
1
  import { Recordable } from '../../type';
2
2
  import { EditableAgGridFormItemExpose, EditableAgGridFormItemProps } from './interface';
3
- import { VNodeProps, AllowedComponentProps, ComponentCustomProps, PublicProps, ShallowUnwrapRef, VNode, RendererNode, RendererElement } from 'vue';
3
+ import { VNodeProps, AllowedComponentProps, ComponentCustomProps, PublicProps, ShallowUnwrapRef, VNode } from 'vue';
4
4
  declare const _default: <RecordType extends Recordable = any>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
5
5
  props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{} & VNodeProps & AllowedComponentProps & ComponentCustomProps, never>, never> & EditableAgGridFormItemProps<RecordType> & Partial<{}>> & PublicProps;
6
6
  expose(exposed: ShallowUnwrapRef<EditableAgGridFormItemExpose<RecordType>>): void;
7
7
  attrs: any;
8
8
  slots: Readonly<Record<string, any>> & Record<string, any>;
9
9
  emit: {};
10
- }>) => VNode<RendererNode, RendererElement, {
11
- [key: string]: any;
12
- }> & {
10
+ }>) => VNode & {
13
11
  __ctx?: Awaited<typeof __VLS_setup>;
14
12
  };
15
13
  export default _default;
@@ -1,21 +1,21 @@
1
- import { defineComponent as L, useSlots as P, ref as y, onMounted as G, watch as W, createElementBlock as U, openBlock as $, Fragment as q, createVNode as p, unref as l, mergeProps as g, withCtx as h, createSlots as J, renderList as Q, renderSlot as X, normalizeProps as Y, guardReactiveProps as Z } from "vue";
2
- import { cloneDeep as u, isEqual as ee, omit as oe } from "lodash-unified";
3
- import { ApForm as C } from "../../ap-form/index.mjs";
4
- import { useInjectForm as te } from "../../ap-form/context.mjs";
5
- import { useWatch as ae } from "../../ap-form/hooks/use-watch.mjs";
6
- import { getModelValue as ne } from "../../ap-form/utils/get.mjs";
7
- import { transformValues as le } from "../../ap-form/utils/transform.mjs";
1
+ import { defineComponent as G, useSlots as W, ref as y, onMounted as U, watch as $, unref as r, createElementBlock as q, openBlock as J, Fragment as Q, createVNode as f, mergeProps as h, withCtx as C, createSlots as X, renderList as Y, renderSlot as Z, normalizeProps as ee, guardReactiveProps as oe } from "vue";
2
+ import { cloneDeep as u, isEqual as te, omit as ae } from "lodash-unified";
3
+ import { ApForm as b } from "../../ap-form/index.mjs";
4
+ import { useInjectForm as ne } from "../../ap-form/context.mjs";
5
+ import { useWatch as le } from "../../ap-form/hooks/use-watch.mjs";
6
+ import { getModelValue as re } from "../../ap-form/utils/get.mjs";
7
+ import { transformValues as ie } from "../../ap-form/utils/transform.mjs";
8
8
  import "../../config-provider/index.mjs";
9
- import { useGetEditableColumns as re } from "../hooks/use-editable-columns.mjs";
10
- import { useEditableFormItemApi as se } from "../hooks/use-editable-form-item-api.mjs";
9
+ import { useGetEditableColumns as se } from "../hooks/use-editable-columns.mjs";
10
+ import { useEditableFormItemApi as me } from "../hooks/use-editable-form-item-api.mjs";
11
11
  import "../index.vue2.mjs";
12
- import ie from "../style/editable.mjs";
13
- import { getShadowName as me } from "../utils.mjs";
14
- import { getColumnTransformOptions as ue, arrayToObject as b } from "./utils.mjs";
15
- import { useNamespace as de } from "../../config-provider/hooks/use-namespace.mjs";
16
- import { useGlobalConfig as pe } from "../../config-provider/hooks/use-global-config.mjs";
17
- import fe from "../index.vue.mjs";
18
- const Ne = /* @__PURE__ */ L({
12
+ import ue from "../style/editable.mjs";
13
+ import { getShadowName as de } from "../utils.mjs";
14
+ import { getColumnTransformOptions as pe, arrayToObject as R, getRowKey as fe } from "./utils.mjs";
15
+ import { useNamespace as ce } from "../../config-provider/hooks/use-namespace.mjs";
16
+ import { useGlobalConfig as we } from "../../config-provider/hooks/use-global-config.mjs";
17
+ import ge from "../index.vue.mjs";
18
+ const Ke = /* @__PURE__ */ G({
19
19
  name: "EditableGrid",
20
20
  __name: "form-item",
21
21
  props: {
@@ -128,6 +128,7 @@ const Ne = /* @__PURE__ */ L({
128
128
  animateRows: {
129
129
  type: Boolean
130
130
  },
131
+ plugins: {},
131
132
  columns: {},
132
133
  defaultValue: {},
133
134
  onChange: {},
@@ -137,112 +138,122 @@ const Ne = /* @__PURE__ */ L({
137
138
  name: {},
138
139
  formItem: {}
139
140
  },
140
- setup(R, {
141
+ setup(v, {
141
142
  expose: B
142
143
  }) {
143
- const v = P(), o = R, {
144
- b: x
145
- } = de("editable-aggrid"), I = ie("editable-aggrid"), r = y(), {
146
- internalInstance: s
147
- } = te();
148
- function S(e) {
149
- const t = ue(o.columns || []);
150
- if (!Object.keys(t).length || !e?.length)
144
+ const x = W(), a = v, {
145
+ b: S
146
+ } = ce("editable-aggrid"), I = ue("editable-aggrid"), m = y(), {
147
+ internalInstance: n
148
+ } = ne();
149
+ function F(e) {
150
+ const o = pe(a.columns || []);
151
+ if (!Object.keys(o).length || !e?.length)
151
152
  return e;
152
- let a = [];
153
- for (const m of e)
154
- a.push(le(m, t));
155
- return a;
153
+ let t = [];
154
+ for (const s of e)
155
+ t.push(ie(s, o));
156
+ return t;
156
157
  }
157
- const i = me(o.name);
158
- let f = [];
159
- G(() => {
160
- const e = o.formItem?.initialValue ?? ne(s?.getInitialValues() ?? {}, o.name);
161
- e && (s?.updateInitialModel(i, b(u(e), o.rowKey)), f = u(e), n.value || _(u(e), "suffix", !0));
158
+ const i = de(a.name);
159
+ let c = [];
160
+ U(() => {
161
+ const e = a.formItem?.initialValue ?? re(n?.getInitialValues() ?? {}, a.name);
162
+ e && (n?.updateInitialModel(i, R(u(e), a.rowKey)), c = u(e), l.value || j(u(e), "suffix", !0));
162
163
  });
163
- const n = y([]), T = ae(o.name);
164
- W(() => T.value, (e) => {
165
- ee(e, n.value) || c(e ?? u(f));
164
+ const l = y([]), T = le(a.name);
165
+ $(() => T.value, (e) => {
166
+ te(e, l.value) || w(e ?? u(c));
166
167
  }, {
167
168
  deep: !0,
168
169
  flush: "post",
169
170
  immediate: !0
170
171
  });
171
- const E = pe("valueTypeMap"), F = re(o, E, i), {
172
- add: V,
173
- addMultiple: N,
174
- __addMultiple: _,
175
- remove: j,
172
+ const E = we("valueTypeMap"), V = se(a, E, i), {
173
+ add: N,
174
+ addMultiple: _,
175
+ __addMultiple: j,
176
+ remove: K,
176
177
  removeByKey: k,
177
178
  getRowData: D,
178
179
  getRowsData: O,
179
180
  setRowData: z,
180
181
  clear: H,
181
182
  refreshRowIds: d
182
- } = se(o, s, n, i);
183
- function K() {
184
- const e = r.value?._internalGridApi;
183
+ } = me(a, n, l, i);
184
+ function L() {
185
+ const e = m.value?._internalGridApi;
185
186
  if (!d.value?.length || !e)
186
187
  return;
187
- const t = d.value.map((a) => e.getRowNode(a)).filter((a) => !!a);
188
+ const o = d.value.map((t) => e.getRowNode(t)).filter((t) => !!t);
188
189
  e.refreshCells({
189
- rowNodes: t,
190
+ rowNodes: o,
190
191
  force: !0
191
192
  }), d.value = [];
192
193
  }
193
- function c(e) {
194
- n.value = [...e];
195
- const t = b(e, o.rowKey);
196
- s?.setFieldValue(o.name, [...e]), s?.setFieldValue(i, t);
194
+ function w(e) {
195
+ l.value = [...e];
196
+ const o = R(e, a.rowKey);
197
+ n?.setFieldValue(a.name, [...e]), n?.setFieldValue(i, o);
197
198
  }
198
- function w(e, t) {
199
- const a = e === "end" ? n.value.length - 1 : e;
200
- r.value?.scrollToRow(a, t);
199
+ function g(e, o) {
200
+ const t = e === "end" ? l.value.length - 1 : e;
201
+ m.value?.scrollToRow(t, o);
201
202
  }
202
- function M(e, t) {
203
- r.value?.scrollToColumn(e, t);
203
+ function M(e, o) {
204
+ m.value?.scrollToColumn(e, o);
205
+ }
206
+ function P(e, o) {
207
+ const t = [i, String(e), o].flat();
208
+ return n?.validateFields([t]);
209
+ }
210
+ function A(e) {
211
+ const t = r(l).map((s, p) => [i, String(fe(s, p, a.rowKey)), e].flat());
212
+ return n?.validateFields(t);
204
213
  }
205
214
  return B({
206
- add: V,
207
- addMultiple: N,
208
- remove: j,
215
+ add: N,
216
+ addMultiple: _,
217
+ remove: K,
209
218
  removeByKey: k,
210
219
  getRowData: D,
211
220
  getRowsData: O,
212
221
  setRowData: z,
213
222
  clear: H,
214
- setTableData: c,
215
- scrollTo: w,
216
- scrollToRow: w,
223
+ setTableData: w,
224
+ scrollTo: g,
225
+ scrollToRow: g,
217
226
  scrollToColumn: M,
218
- table: r
219
- }), (e, t) => ($(), U(q, null, [p(l(C).FormItem, {
227
+ validateCell: P,
228
+ validateColumn: A,
229
+ table: m
230
+ }), (e, o) => (J(), q(Q, null, [f(r(b).FormItem, {
220
231
  hidden: "",
221
232
  name: e.name,
222
233
  "initial-value": e.formItem?.initialValue,
223
- transform: S
224
- }, null, 8, ["name", "initial-value"]), p(l(C).FormItem, g({
234
+ transform: F
235
+ }, null, 8, ["name", "initial-value"]), f(r(b).FormItem, h({
225
236
  label: e.label
226
237
  }, e.formItem), {
227
- default: h(() => [p(fe, g(l(oe)(o, ["name", "maxLength", "onChange", "defaultValue", "formItem"]), {
238
+ default: C(() => [f(ge, h(r(ae)(a, ["name", "maxLength", "onChange", "defaultValue", "formItem"]), {
228
239
  ref_key: "tableRef",
229
- ref: r,
230
- class: [l(x)(), l(I)],
240
+ ref: m,
241
+ class: [r(S)(), r(I)],
231
242
  size: "mini",
232
- columns: l(F),
233
- "data-source": n.value,
243
+ columns: r(V),
244
+ "data-source": l.value,
234
245
  "search-form": !1,
235
- onUpdate: K
236
- }), J({
246
+ onUpdate: L
247
+ }), X({
237
248
  _: 2
238
- }, [Q(v, (a, m) => ({
239
- name: m,
240
- fn: h((A) => [X(e.$slots, m, Y(Z(A || {})))])
249
+ }, [Y(x, (t, s) => ({
250
+ name: s,
251
+ fn: C((p) => [Z(e.$slots, s, ee(oe(p || {})))])
241
252
  }))]), 1040, ["class", "columns", "data-source"])]),
242
253
  _: 3
243
254
  }, 16, ["label"])], 64));
244
255
  }
245
256
  });
246
257
  export {
247
- Ne as default
258
+ Ke as default
248
259
  };
@@ -1,6 +1,6 @@
1
1
  import { Recordable } from '../../type';
2
2
  import { EditableAgGridExpose, EditableAgGridProps } from './interface';
3
- import { VNodeProps, AllowedComponentProps, ComponentCustomProps, PublicProps, ShallowUnwrapRef, VNode, RendererNode, RendererElement } from 'vue';
3
+ import { VNodeProps, AllowedComponentProps, ComponentCustomProps, PublicProps, ShallowUnwrapRef, VNode } from 'vue';
4
4
  declare const _default: <RecordType extends Recordable = any>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
5
5
  props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
6
6
  readonly "onUpdate:value"?: ((...args: any[]) => any) | undefined;
@@ -9,9 +9,7 @@ declare const _default: <RecordType extends Recordable = any>(__VLS_props: NonNu
9
9
  attrs: any;
10
10
  slots: Readonly<Record<string, any>> & Record<string, any>;
11
11
  emit: (event: "update:value", ...args: any[]) => void;
12
- }>) => VNode<RendererNode, RendererElement, {
13
- [key: string]: any;
14
- }> & {
12
+ }>) => VNode & {
15
13
  __ctx?: Awaited<typeof __VLS_setup>;
16
14
  };
17
15
  export default _default;
@@ -1,4 +1,4 @@
1
- import { defineComponent as M, useSlots as $, ref as h, watch as q, unref as l, createBlock as J, openBlock as Q, withCtx as p, createVNode as b, mergeProps as X, createSlots as Y, renderList as Z, renderSlot as ee, normalizeProps as oe, guardReactiveProps as ae } from "vue";
1
+ import { defineComponent as M, useSlots as $, ref as h, watch as q, unref as l, createBlock as J, openBlock as Q, withCtx as m, createVNode as b, mergeProps as X, createSlots as Y, renderList as Z, renderSlot as ee, normalizeProps as oe, guardReactiveProps as ae } from "vue";
2
2
  import { isEqual as te, isArray as v, omit as ne } from "lodash-unified";
3
3
  import { ApForm as c } from "../../ap-form/index.mjs";
4
4
  import "../../config-provider/index.mjs";
@@ -10,8 +10,8 @@ import se from "../style/editable.mjs";
10
10
  import { arrayToObject as f, getRowKey as ie } from "./utils.mjs";
11
11
  import { useNamespace as de } from "../../config-provider/hooks/use-namespace.mjs";
12
12
  import { useControllableValue as ue } from "../../hooks/useControllableValue.mjs";
13
- import { useGlobalConfig as me } from "../../config-provider/hooks/use-global-config.mjs";
14
- import pe from "../index.vue.mjs";
13
+ import { useGlobalConfig as pe } from "../../config-provider/hooks/use-global-config.mjs";
14
+ import me from "../index.vue.mjs";
15
15
  const Fe = /* @__PURE__ */ M({
16
16
  name: "EditableGrid",
17
17
  __name: "index",
@@ -125,6 +125,7 @@ const Fe = /* @__PURE__ */ M({
125
125
  animateRows: {
126
126
  type: Boolean
127
127
  },
128
+ plugins: {},
128
129
  columns: {},
129
130
  value: {},
130
131
  defaultValue: {},
@@ -153,7 +154,7 @@ const Fe = /* @__PURE__ */ M({
153
154
  }, {
154
155
  deep: !0
155
156
  });
156
- const K = me("valueTypeMap"), k = re(a, K), {
157
+ const K = pe("valueTypeMap"), k = re(a, K), {
157
158
  add: A,
158
159
  addMultiple: N,
159
160
  remove: j,
@@ -183,7 +184,7 @@ const Fe = /* @__PURE__ */ M({
183
184
  function g(e) {
184
185
  try {
185
186
  const o = Object.keys(e), t = s.value.map((n) => ie(n, void 0, a.rowKey));
186
- return o.sort((n, u) => t.findIndex((m) => String(m) === n) - t.findIndex((m) => String(m) === u)), o.map((n) => e[n]);
187
+ return o.sort((n, u) => t.findIndex((p) => String(p) === n) - t.findIndex((p) => String(p) === u)), o.map((n) => e[n]);
187
188
  } catch {
188
189
  return e;
189
190
  }
@@ -235,11 +236,11 @@ const Fe = /* @__PURE__ */ M({
235
236
  height: "100%"
236
237
  }
237
238
  }, {
238
- default: p(() => [b(l(c).FormItem, {
239
+ default: m(() => [b(l(c).FormItem, {
239
240
  name: e.name,
240
241
  "no-style": ""
241
242
  }, {
242
- default: p(() => [b(pe, X(l(ne)(a, ["name", "value", "onUpdate:value", "maxLength", "onChange", "defaultValue"]), {
243
+ default: m(() => [b(me, X(l(ne)(a, ["name", "value", "onUpdate:value", "maxLength", "onChange", "defaultValue"]), {
243
244
  ref_key: "tableRef",
244
245
  ref: i,
245
246
  class: [l(T)(), l(F)],
@@ -252,7 +253,7 @@ const Fe = /* @__PURE__ */ M({
252
253
  _: 2
253
254
  }, [Z(S, (t, n) => ({
254
255
  name: n,
255
- fn: p((u) => [ee(e.$slots, n, oe(ae(u || {})))])
256
+ fn: m((u) => [ee(e.$slots, n, oe(ae(u || {})))])
256
257
  }))]), 1040, ["class", "columns", "data-source"])]),
257
258
  _: 3
258
259
  }, 8, ["name"])]),
@@ -87,7 +87,21 @@ export type EditableAgGridExpose<RecordType = any, ModelType = RecordType[]> = O
87
87
  validateFieldsReturnTransformed: EditableTableExpose<ModelType, RecordType>['validateFields'];
88
88
  table: AgGridExpose;
89
89
  };
90
- export type EditableAgGridFormItemExpose<RecordType = any, ModelType = RecordType[]> = Omit<EditableAgGridExpose<RecordType, ModelType>, 'resetFields' | 'validateFields' | 'validateFieldsReturnTransformed'>;
90
+ export type EditableAgGridFormItemExpose<RecordType = any, ModelType = RecordType[]> = Omit<EditableAgGridExpose<RecordType, ModelType>, 'resetFields' | 'validateFields' | 'validateFieldsReturnTransformed'> & {
91
+ /**
92
+ * 校验单元格
93
+ * @param rowId 行唯一标识
94
+ * @param field 字段
95
+ * @returns
96
+ */
97
+ validateCell: (rowId: any, field: NamePath) => any;
98
+ /**
99
+ * 校验列
100
+ * @param colKey 列唯一标识
101
+ * @returns
102
+ */
103
+ validateColumn: (colKey: string | number) => any;
104
+ };
91
105
  export type EditableAgGridFormItemProps<RecordType = any> = Omit<EditableAgGridProps<RecordType>, 'name' | 'value' | 'onUpdate:value'> & {
92
106
  label?: string;
93
107
  /**
@@ -1,30 +1,38 @@
1
- import { ref as c, computed as s, watch as h } from "vue";
2
- import { getStringKey as d } from "../utils.mjs";
3
- const C = (o) => {
4
- const t = c([]), u = c([]);
1
+ import { ref as s, computed as c, watch as y } from "vue";
2
+ import { getStringKey as a, runPipelineHooks as C } from "../utils.mjs";
3
+ const w = (o) => {
4
+ const r = s([]), u = s([]);
5
5
  function l(n = []) {
6
6
  return n.filter((e) => !e.hideInTable).map((e) => {
7
7
  if (e.children?.length) {
8
- const r = l(e.children);
9
- return r?.length ? {
8
+ const t = l(e.children);
9
+ return t?.length ? {
10
10
  ...e,
11
- children: r
11
+ children: t
12
12
  } : null;
13
13
  }
14
14
  return e;
15
15
  }).filter(Boolean);
16
16
  }
17
17
  function f(n) {
18
- return t.value.find((e) => d(e.key) === n);
18
+ return r.value.find((e) => a(e.key) === n);
19
19
  }
20
- const m = s(
21
- () => t.value.map((n) => d(n.key)).filter(Boolean)
20
+ const m = c(
21
+ () => r.value.map((n) => a(n.key)).filter(Boolean)
22
22
  );
23
- h(
23
+ async function d(n, e) {
24
+ return await C(
25
+ o.plugins,
26
+ n,
27
+ (t) => t.beforeColumnsChange?.bind(t),
28
+ e
29
+ );
30
+ }
31
+ y(
24
32
  () => o.columns,
25
- () => {
26
- const n = l(o.columns);
27
- t.value = n, u.value = n, o.onShownColumnsChange?.(n);
33
+ async () => {
34
+ const n = l(o.columns), e = await d(n, r.value);
35
+ r.value = e, u.value = e, o.onShownColumnsChange?.(e);
28
36
  },
29
37
  {
30
38
  deep: !0,
@@ -34,27 +42,27 @@ const C = (o) => {
34
42
  function i(n) {
35
43
  for (const e of n)
36
44
  if (e.children) {
37
- const r = i(e.children);
38
- if (r)
39
- return r;
45
+ const t = i(e.children);
46
+ if (t)
47
+ return t;
40
48
  } else if (e.defaultSortOrder) {
41
- const r = e.field ?? e.dataIndex ?? e.key;
49
+ const t = e.field ?? e.dataIndex ?? e.key;
42
50
  return {
43
51
  colKey: e.key,
44
- field: r,
52
+ field: t,
45
53
  order: e.defaultSortOrder
46
54
  };
47
55
  }
48
56
  }
49
- const a = s(() => i(t.value));
57
+ const h = c(() => i(r.value));
50
58
  return {
51
- columns: t,
59
+ columns: r,
52
60
  shownColumns: u,
53
61
  columnKeys: m,
54
62
  getTargetColumnByKey: f,
55
- defaultSortOrder: a
63
+ defaultSortOrder: h
56
64
  };
57
65
  };
58
66
  export {
59
- C as useColumns
67
+ w as useColumns
60
68
  };
@@ -16,7 +16,7 @@ const P = (r) => {
16
16
  };
17
17
  });
18
18
  return {
19
- getRowPinnedCellClass: (o) => (n) => {
19
+ getRowPinnedCellClass: (o) => ((n) => {
20
20
  let t;
21
21
  const { cellClassName: e } = r.value || {};
22
22
  return !n.node.rowPinned || !e ? t = [o(n)] : t = [
@@ -28,7 +28,7 @@ const P = (r) => {
28
28
  n.rowIndex
29
29
  ) : e
30
30
  ], t.flat().filter(Boolean);
31
- },
31
+ }),
32
32
  rowPinnedGridConfig: d
33
33
  };
34
34
  };
@@ -1,15 +1,13 @@
1
1
  import { Recordable } from '../type';
2
2
  import { AgGridExpose, AgGridProps, AgGridSlots } from './interface';
3
- import { VNodeProps, AllowedComponentProps, ComponentCustomProps, PublicProps, ShallowUnwrapRef, VNode, RendererNode, RendererElement } from 'vue';
3
+ import { VNodeProps, AllowedComponentProps, ComponentCustomProps, PublicProps, ShallowUnwrapRef, VNode } from 'vue';
4
4
  declare const _default: <RecordType extends Recordable>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
5
5
  props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{} & VNodeProps & AllowedComponentProps & ComponentCustomProps, never>, never> & AgGridProps<RecordType> & Partial<{}>> & PublicProps;
6
6
  expose(exposed: ShallowUnwrapRef<AgGridExpose>): void;
7
7
  attrs: any;
8
8
  slots: Readonly<AgGridSlots<RecordType>> & AgGridSlots<RecordType>;
9
9
  emit: {};
10
- }>) => VNode<RendererNode, RendererElement, {
11
- [key: string]: any;
12
- }> & {
10
+ }>) => VNode & {
13
11
  __ctx?: Awaited<typeof __VLS_setup>;
14
12
  };
15
13
  export default _default;