@aplus-frontend/ui 7.15.8 → 7.17.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 (95) hide show
  1. package/es/index.mjs +285 -281
  2. package/es/src/ag-grid/components/header-cell/index.vue2.mjs +56 -41
  3. package/es/src/ag-grid/context.d.ts +8 -0
  4. package/es/src/ag-grid/context.mjs +18 -7
  5. package/es/src/ag-grid/hooks/use-columns-def.d.ts +2 -2
  6. package/es/src/ag-grid/hooks/use-columns-def.mjs +64 -61
  7. package/es/src/ag-grid/hooks/use-columns.mjs +39 -30
  8. package/es/src/ag-grid/index.vue.mjs +270 -255
  9. package/es/src/ag-grid/interface.d.ts +20 -1
  10. package/es/src/ag-grid/style/custom-header.mjs +22 -13
  11. package/es/src/ap-field/cascader/index.vue.d.ts +60 -0
  12. package/es/src/ap-field/cascader/index.vue.mjs +217 -0
  13. package/es/src/ap-field/cascader/index.vue2.mjs +4 -0
  14. package/es/src/ap-field/cascader/read.vue.d.ts +8 -0
  15. package/es/src/ap-field/cascader/read.vue.mjs +4 -0
  16. package/es/src/ap-field/cascader/read.vue2.mjs +159 -0
  17. package/es/src/ap-field/cascader/use-options.d.ts +25 -0
  18. package/es/src/ap-field/cascader/use-options.mjs +66 -0
  19. package/es/src/ap-field/hooks/use-default-placeholder.d.ts +3 -1
  20. package/es/src/ap-field/hooks/use-default-placeholder.mjs +13 -8
  21. package/es/src/ap-field/index.d.ts +8 -2
  22. package/es/src/ap-field/index.mjs +72 -65
  23. package/es/src/ap-field/interface.d.ts +27 -1
  24. package/es/src/ap-field/tree-select/index.vue.mjs +43 -39
  25. package/es/src/ap-field/tree-select/use-request.mjs +22 -19
  26. package/es/src/ap-form/items/cascader/index.vue.d.ts +435 -0
  27. package/es/src/ap-form/items/cascader/index.vue.mjs +102 -0
  28. package/es/src/ap-form/items/cascader/index.vue2.mjs +4 -0
  29. package/es/src/ap-form/items/index.d.ts +2 -1
  30. package/es/src/ap-form/items/index.mjs +3 -2
  31. package/es/src/ap-form/items/interface.d.ts +6 -1
  32. package/es/src/ap-table/components/setting/sortable/item.vue2.mjs +86 -65
  33. package/es/src/ap-table/constants.d.ts +269 -4
  34. package/es/src/ap-table/constants.mjs +29 -26
  35. package/es/src/ap-table/interface.d.ts +5 -1
  36. package/es/src/ap-table/style/setting.mjs +30 -27
  37. package/es/src/ap-table/utils.d.ts +1 -1
  38. package/es/src/business/ag-grid-modal/interface.d.ts +4 -0
  39. package/es/src/business/ag-grid-modal/modal-layout/index.vue.d.ts +1 -0
  40. package/es/src/business/ag-grid-modal/modal-layout/index.vue2.mjs +25 -21
  41. package/es/src/business/ag-grid-modal/style/index.mjs +1 -1
  42. package/es/src/business/ag-grid-modal/utils.d.ts +1 -0
  43. package/es/src/index.mjs +250 -246
  44. package/es/src/locale/lang/en.mjs +1 -0
  45. package/es/src/locale/lang/zh-cn.mjs +1 -0
  46. package/es/src/version.d.ts +1 -1
  47. package/es/src/version.mjs +1 -1
  48. package/lib/index.js +1 -1
  49. package/lib/src/ag-grid/components/header-cell/index.vue2.js +1 -1
  50. package/lib/src/ag-grid/context.d.ts +8 -0
  51. package/lib/src/ag-grid/context.js +1 -1
  52. package/lib/src/ag-grid/hooks/use-columns-def.d.ts +2 -2
  53. package/lib/src/ag-grid/hooks/use-columns-def.js +1 -1
  54. package/lib/src/ag-grid/hooks/use-columns.js +1 -1
  55. package/lib/src/ag-grid/index.vue.js +1 -1
  56. package/lib/src/ag-grid/interface.d.ts +20 -1
  57. package/lib/src/ag-grid/style/custom-header.js +1 -1
  58. package/lib/src/ap-field/cascader/index.vue.d.ts +60 -0
  59. package/lib/src/ap-field/cascader/index.vue.js +1 -0
  60. package/lib/src/ap-field/cascader/index.vue2.js +1 -0
  61. package/lib/src/ap-field/cascader/read.vue.d.ts +8 -0
  62. package/lib/src/ap-field/cascader/read.vue.js +1 -0
  63. package/lib/src/ap-field/cascader/read.vue2.js +1 -0
  64. package/lib/src/ap-field/cascader/use-options.d.ts +25 -0
  65. package/lib/src/ap-field/cascader/use-options.js +1 -0
  66. package/lib/src/ap-field/hooks/use-default-placeholder.d.ts +3 -1
  67. package/lib/src/ap-field/hooks/use-default-placeholder.js +1 -1
  68. package/lib/src/ap-field/index.d.ts +8 -2
  69. package/lib/src/ap-field/index.js +1 -1
  70. package/lib/src/ap-field/interface.d.ts +27 -1
  71. package/lib/src/ap-field/tree-select/index.vue.js +1 -1
  72. package/lib/src/ap-field/tree-select/use-request.js +1 -1
  73. package/lib/src/ap-form/items/cascader/index.vue.d.ts +435 -0
  74. package/lib/src/ap-form/items/cascader/index.vue.js +1 -0
  75. package/lib/src/ap-form/items/cascader/index.vue2.js +1 -0
  76. package/lib/src/ap-form/items/index.d.ts +2 -1
  77. package/lib/src/ap-form/items/index.js +1 -1
  78. package/lib/src/ap-form/items/interface.d.ts +6 -1
  79. package/lib/src/ap-table/components/setting/sortable/item.vue2.js +1 -1
  80. package/lib/src/ap-table/constants.d.ts +269 -4
  81. package/lib/src/ap-table/constants.js +1 -1
  82. package/lib/src/ap-table/interface.d.ts +5 -1
  83. package/lib/src/ap-table/style/setting.js +1 -1
  84. package/lib/src/ap-table/utils.d.ts +1 -1
  85. package/lib/src/business/ag-grid-modal/interface.d.ts +4 -0
  86. package/lib/src/business/ag-grid-modal/modal-layout/index.vue.d.ts +1 -0
  87. package/lib/src/business/ag-grid-modal/modal-layout/index.vue2.js +1 -1
  88. package/lib/src/business/ag-grid-modal/style/index.js +1 -1
  89. package/lib/src/business/ag-grid-modal/utils.d.ts +1 -0
  90. package/lib/src/index.js +1 -1
  91. package/lib/src/locale/lang/en.js +1 -1
  92. package/lib/src/locale/lang/zh-cn.js +1 -1
  93. package/lib/src/version.d.ts +1 -1
  94. package/lib/src/version.js +1 -1
  95. package/package.json +4 -4
@@ -1,41 +1,41 @@
1
- import { defineComponent as yo, useSlots as Co, ref as M, toRef as B, computed as n, unref as r, nextTick as A, watch as G, createElementBlock as L, openBlock as C, normalizeStyle as W, normalizeClass as h, createCommentVNode as de, createElementVNode as T, createVNode as ho, mergeProps as H, createSlots as Ro, withCtx as ce, Fragment as vo, renderList as bo, createBlock as U, resolveDynamicComponent as Mo, renderSlot as me } from "vue";
2
- import { AG_GRID_LOCALE_EN as Bo, AG_GRID_LOCALE_CN as Fo } from "@ag-grid-community/locale";
1
+ import { defineComponent as ho, useSlots as vo, ref as y, toRef as x, computed as n, unref as r, nextTick as A, watch as W, createElementBlock as H, openBlock as h, normalizeStyle as U, normalizeClass as v, createCommentVNode as ce, createElementVNode as T, createVNode as Ro, mergeProps as j, createSlots as bo, withCtx as me, Fragment as Mo, renderList as xo, createBlock as _, resolveDynamicComponent as Bo, renderSlot as pe } from "vue";
2
+ import { AG_GRID_LOCALE_EN as Fo, AG_GRID_LOCALE_CN as Io } from "@ag-grid-community/locale";
3
3
  import { Pagination as ko } from "@aplus-frontend/antdv";
4
- import { useToken as Io } from "@aplus-frontend/antdv/es/theme/internal";
5
- import { ModuleRegistry as xo, ValidationModule as Ao, ColumnAutoSizeModule as To, PinnedRowModule as No, RowAutoHeightModule as Do, RowStyleModule as Eo, CellSpanModule as zo, CellStyleModule as Ko, TooltipModule as Oo, RowSelectionModule as Po, LocaleModule as Vo, ValueCacheModule as Go, GridStateModule as Lo, ColumnApiModule as Wo, RowApiModule as Ho, CellApiModule as Uo, RenderApiModule as jo, EventApiModule as _o, ScrollApiModule as $o, ClientSideRowModelApiModule as qo, ClientSideRowModelModule as Jo } from "ag-grid-community";
6
- import { AgGridVue as Qo } from "ag-grid-vue3";
7
- import { isUndefined as F, isFunction as N } from "lodash-unified";
8
- import { DEFAULT_ROW_SELECTION_CONFIG as pe, sizeReverseMap as Xo, sizeMap as Yo } from "../ap-grid/constants.mjs";
9
- import { useProvideApTable as Zo } from "../ap-table/context.mjs";
10
- import { useTablePaging as et } from "../ap-table/hooks/use-table-paging-ng.mjs";
11
- import { recursionApColumns as ot } from "../ap-table/utils.mjs";
4
+ import { useToken as Ao } from "@aplus-frontend/antdv/es/theme/internal";
5
+ import { ModuleRegistry as To, ValidationModule as Eo, ColumnAutoSizeModule as No, PinnedRowModule as Do, RowAutoHeightModule as zo, RowStyleModule as Oo, CellSpanModule as Po, CellStyleModule as Ko, TooltipModule as Go, RowSelectionModule as Vo, LocaleModule as Lo, ValueCacheModule as Wo, GridStateModule as Ho, ColumnApiModule as Uo, RowApiModule as jo, CellApiModule as _o, RenderApiModule as $o, EventApiModule as qo, ScrollApiModule as Jo, ClientSideRowModelApiModule as Qo, ClientSideRowModelModule as Xo } from "ag-grid-community";
6
+ import { AgGridVue as Yo } from "ag-grid-vue3";
7
+ import { isUndefined as B, isFunction as E } from "lodash-unified";
8
+ import { DEFAULT_ROW_SELECTION_CONFIG as fe, sizeReverseMap as Zo, sizeMap as et } from "../ap-grid/constants.mjs";
9
+ import { useProvideApTable as ot } from "../ap-table/context.mjs";
10
+ import { useTablePaging as tt } from "../ap-table/hooks/use-table-paging-ng.mjs";
11
+ import { recursionApColumns as rt } from "../ap-table/utils.mjs";
12
12
  import "../config-provider/index.mjs";
13
13
  import "../utils/index.mjs";
14
- import { retryUntil as tt } from "../utils/retry.mjs";
15
- import { getValidVNodeList as rt } from "../utils/slot.mjs";
16
- import { ApForm as lt } from "../ap-form/index.mjs";
14
+ import { retryUntil as lt } from "../utils/retry.mjs";
15
+ import { getValidVNodeList as at } from "../utils/slot.mjs";
16
+ import { ApForm as nt } from "../ap-form/index.mjs";
17
17
  import "./components/empty/index.vue.mjs";
18
18
  import "./components/loading/index.vue.mjs";
19
19
  import "./components/row/index.vue.mjs";
20
- import { useProvideSorter as at } from "./context.mjs";
21
- import { useColumns as nt } from "./hooks/use-columns.mjs";
22
- import { useColumnsDef as st } from "./hooks/use-columns-def.mjs";
23
- import { usePinnedRow as it } from "./hooks/use-pinned-row.mjs";
24
- import ut from "./hooks/use-row-selection.mjs";
25
- import { useSearchForm as dt } from "./hooks/use-search-form.mjs";
26
- import ct from "./hooks/use-selection-col-def.mjs";
27
- import mt from "./hooks/use-virtual-config.mjs";
28
- import pt from "./style/index.mjs";
29
- import { useTheme as ft } from "./theme.mjs";
30
- import { mergeProps as gt } from "./utils.mjs";
31
- import { useNamespace as wt } from "../config-provider/hooks/use-namespace.mjs";
32
- import { useLocale as St } from "../config-provider/hooks/use-locale.mjs";
33
- import { useGlobalConfig as yt } from "../config-provider/hooks/use-global-config.mjs";
34
- import { isDef as Ct } from "../utils/is.mjs";
35
- import ht from "./components/row/index.vue2.mjs";
36
- import Rt from "./components/loading/index.vue2.mjs";
37
- import vt from "./components/empty/index.vue2.mjs";
38
- const nr = /* @__PURE__ */ yo({
20
+ import { useProvideSorter as st, useProvideExpandable as it } from "./context.mjs";
21
+ import { useColumns as ut } from "./hooks/use-columns.mjs";
22
+ import { useColumnsDef as dt } from "./hooks/use-columns-def.mjs";
23
+ import { usePinnedRow as ct } from "./hooks/use-pinned-row.mjs";
24
+ import mt from "./hooks/use-row-selection.mjs";
25
+ import { useSearchForm as pt } from "./hooks/use-search-form.mjs";
26
+ import ft from "./hooks/use-selection-col-def.mjs";
27
+ import gt from "./hooks/use-virtual-config.mjs";
28
+ import wt from "./style/index.mjs";
29
+ import { useTheme as St } from "./theme.mjs";
30
+ import { mergeProps as Ct } from "./utils.mjs";
31
+ import { useNamespace as yt } from "../config-provider/hooks/use-namespace.mjs";
32
+ import { useLocale as ht } from "../config-provider/hooks/use-locale.mjs";
33
+ import { useGlobalConfig as vt } from "../config-provider/hooks/use-global-config.mjs";
34
+ import { isDef as Rt } from "../utils/is.mjs";
35
+ import bt from "./components/row/index.vue2.mjs";
36
+ import Mt from "./components/loading/index.vue2.mjs";
37
+ import xt from "./components/empty/index.vue2.mjs";
38
+ const ur = /* @__PURE__ */ ho({
39
39
  name: "AgGrid",
40
40
  __name: "index",
41
41
  props: {
@@ -115,23 +115,21 @@ const nr = /* @__PURE__ */ yo({
115
115
  onColumnResized: {},
116
116
  animateRows: { type: Boolean, default: !0 }
117
117
  },
118
- setup(fe, { expose: ge }) {
119
- const we = {
120
- "zh-cn": Fo,
121
- en: Bo
118
+ setup(ge, { expose: we }) {
119
+ const Se = {
120
+ "zh-cn": Io,
121
+ en: Fo
122
122
  };
123
- xo.registerModules([
124
- Ao,
125
- To,
123
+ To.registerModules([
124
+ Eo,
126
125
  No,
127
126
  Do,
128
- Eo,
129
127
  zo,
130
- Ko,
131
128
  Oo,
132
129
  Po,
133
- Vo,
130
+ Ko,
134
131
  Go,
132
+ Vo,
135
133
  Lo,
136
134
  Wo,
137
135
  Ho,
@@ -140,42 +138,49 @@ const nr = /* @__PURE__ */ yo({
140
138
  _o,
141
139
  $o,
142
140
  qo,
143
- Jo
141
+ Jo,
142
+ Qo,
143
+ Xo
144
144
  ]);
145
- const o = fe, j = Co(), { e: D, b: d, be: Se } = wt("ag-grid"), { lang: _ } = St(), ye = pt("ag-grid"), R = M(o.size), Ce = ft(
145
+ const o = ge, N = vo(), { e: D, b: d, be: Ce } = yt("ag-grid"), { lang: $ } = ht(), ye = wt("ag-grid"), R = y(o.size), he = St(
146
146
  R,
147
- B(o, "rowHeight"),
148
- B(o, "theme")
149
- ), he = mt(B(o, "virtual")), { rowPinnedGridConfig: $, getRowPinnedCellClass: Re } = it(
150
- B(o, "summary")
151
- ), ve = yt("apGrid"), s = M(), [, be] = Io();
152
- let v = !!o.dataSource;
153
- const q = dt(o), {
147
+ x(o, "rowHeight"),
148
+ x(o, "theme")
149
+ ), ve = gt(x(o, "virtual")), { rowPinnedGridConfig: q, getRowPinnedCellClass: Re } = ct(
150
+ x(o, "summary")
151
+ ), be = vt("apGrid"), s = y(), [, Me] = Ao();
152
+ let b = !!o.dataSource;
153
+ const J = pt(o), {
154
154
  shownColumns: w,
155
- columns: J,
156
- columnKeys: Me,
155
+ columns: Q,
156
+ columnKeys: xe,
157
157
  getTargetColumnByKey: Be,
158
- defaultSortOrder: k
159
- } = nt(o), { defaultColDef: Fe, columnDefs: ke, gridWrapperRef: Ie } = st(J, o, Re), xe = {
158
+ defaultSortOrder: F
159
+ } = ut(o), { defaultColDef: Fe, columnDefs: Ie, gridWrapperRef: ke } = dt(
160
+ Q,
161
+ o,
162
+ Re,
163
+ N.headerCell
164
+ ), Ae = {
160
165
  asc: "ascend",
161
166
  desc: "descend"
162
- }, Q = {
167
+ }, X = {
163
168
  ascend: "asc",
164
169
  descend: "desc"
165
170
  };
166
- function Ae() {
167
- const e = k.value;
171
+ function Te() {
172
+ const e = F.value;
168
173
  return e ? {
169
- [e.colKey]: Q[e.order]
174
+ [e.colKey]: X[e.order]
170
175
  } : {};
171
176
  }
172
- function Te() {
173
- const e = X.value, t = k.value;
177
+ function Ee() {
178
+ const e = Y.value, t = F.value;
174
179
  if (t && e.includes(t.field))
175
180
  return t;
176
181
  }
177
- const I = M(Ae());
178
- at({
182
+ const I = y(Te());
183
+ st({
179
184
  sorter: I,
180
185
  setSorter(e) {
181
186
  I.value = e;
@@ -192,13 +197,13 @@ const nr = /* @__PURE__ */ yo({
192
197
  if (!l)
193
198
  return;
194
199
  const i = l.getColDef(), f = l.getSort(), g = Be(i.colId);
195
- Z(void 0, void 0, {
200
+ ee(void 0, void 0, {
196
201
  column: i,
197
202
  field: g?.field ?? i.field ?? i.colId,
198
- order: f ? xe[f] : null
203
+ order: f ? Ae[f] : null
199
204
  });
200
205
  }
201
- const X = n(() => ot(r(w), (e) => {
206
+ const Y = n(() => rt(r(w), (e) => {
202
207
  if (e.sorter === !0)
203
208
  return e.field ?? e.dataIndex ?? e.key;
204
209
  }).filter(Boolean)), De = () => {
@@ -208,22 +213,31 @@ const nr = /* @__PURE__ */ yo({
208
213
  return;
209
214
  const t = e.getColumnState()?.map((l) => ({ ...l, sort: null }));
210
215
  e.applyColumnState({ state: t });
211
- }, E = M(!0), Ee = n(() => Ct(o.manual) ? o.manual : rt(j.searchFormExtra?.() || []).some((t) => t.type?.name === "ApView")), {
216
+ }, z = y({});
217
+ it({ expandable: z });
218
+ function ze(e) {
219
+ const t = e.columnGroup;
220
+ t && (z.value = {
221
+ ...z.value,
222
+ [t.getGroupId()]: t.isExpanded()
223
+ });
224
+ }
225
+ const O = y(!0), Oe = n(() => Rt(o.manual) ? o.manual : at(N.searchFormExtra?.() || []).some((t) => t.type?.name === "ApView")), {
212
226
  formRef: S,
213
- submit: z,
227
+ submit: P,
214
228
  reset: K,
215
229
  data: m,
216
- tableProps: Y,
217
- handleTableChangeOptional: Z,
218
- submitWith: ee,
219
- refresh: oe,
220
- getPaging: ze,
230
+ tableProps: Z,
231
+ handleTableChangeOptional: ee,
232
+ submitWith: oe,
233
+ refresh: te,
234
+ getPaging: Pe,
221
235
  setPaging: Ke,
222
- setDataSource: Oe,
223
- getLastParams: Pe
224
- } = et({
236
+ setDataSource: Ge,
237
+ getLastParams: Ve
238
+ } = tt({
225
239
  async request(e) {
226
- if (v = !1, y.value && !y.value.preserveSelectedRowKeys && F(o.dataSource) && !E.value && V(), E.value && (E.value = !1), !F(o.dataSource)) {
240
+ if (b = !1, C.value && !C.value.preserveSelectedRowKeys && B(o.dataSource) && !O.value && L(), O.value && (O.value = !1), !B(o.dataSource)) {
227
241
  const l = e.pageSize * (e.current - 1);
228
242
  return {
229
243
  data: (o.pagination === !1 ? o.dataSource : o.dataSource.slice(l, l + e.pageSize)) || [],
@@ -237,152 +251,152 @@ const nr = /* @__PURE__ */ yo({
237
251
  };
238
252
  },
239
253
  namespace: "ap-grid",
240
- filterFields: M([]),
241
- params: B(o, "params"),
254
+ filterFields: y([]),
255
+ params: x(o, "params"),
242
256
  defaultData: o.defaultData,
243
- manual: r(Ee),
257
+ manual: r(Oe),
244
258
  formatParams: o.beforeSearchSubmit,
245
259
  pagination: o.pagination,
246
- sortFields: X,
260
+ sortFields: Y,
247
261
  onClickReset: De,
248
- defaultSortOrder: Te()
249
- }), y = n(() => {
250
- const e = o.rowSelection || ve.value?.rowSelection;
262
+ defaultSortOrder: Ee()
263
+ }), C = n(() => {
264
+ const e = o.rowSelection || be.value?.rowSelection;
251
265
  if (e)
252
- return e === !0 ? pe : {
253
- ...pe,
266
+ return e === !0 ? fe : {
267
+ ...fe,
254
268
  ...e
255
269
  };
256
- }), Ve = ct(o, w), Ge = n(
257
- () => F(o.dataSource) ? m.records : o.dataSource
270
+ }), Le = ft(o, w), We = n(
271
+ () => B(o.dataSource) ? m.records : o.dataSource
258
272
  ), {
259
- select: Le,
260
- unSelect: We,
261
- selectedRows: O,
262
- selectedRowKeys: He,
263
- clearAll: Ue,
264
- selectMultiByKeys: je,
265
- selectMulti: _e,
266
- unSelectMulti: $e
267
- } = ut({
268
- ...y.value,
269
- dataSource: Ge,
273
+ select: He,
274
+ unSelect: Ue,
275
+ selectedRows: G,
276
+ selectedRowKeys: je,
277
+ clearAll: _e,
278
+ selectMultiByKeys: $e,
279
+ selectMulti: qe,
280
+ unSelectMulti: Je
281
+ } = mt({
282
+ ...C.value,
283
+ dataSource: We,
270
284
  rowKey: o.rowKey
271
- }), qe = {
285
+ }), Qe = {
272
286
  checkbox: "multiRow",
273
287
  radio: "singleRow"
274
- }, Je = n(() => {
275
- const e = y.value;
288
+ }, Xe = n(() => {
289
+ const e = C.value;
276
290
  if (!e)
277
291
  return;
278
292
  const { type: t = "checkbox", disabled: l } = e;
279
293
  return {
280
- mode: qe[t],
294
+ mode: Qe[t],
281
295
  isRowSelectable: (u) => l ? !l(u.data) : !0,
282
296
  hideDisabledCheckboxes: e.hideDisabled ?? !1
283
297
  };
284
298
  });
285
- function P(e) {
286
- return N(o.rowKey) ? o.rowKey(e) : e[o.rowKey];
299
+ function V(e) {
300
+ return E(o.rowKey) ? o.rowKey(e) : e[o.rowKey];
287
301
  }
288
- const x = ({
302
+ const k = ({
289
303
  api: e = s.value
290
304
  }) => {
291
- if (o.onUpdate?.(), !y.value)
305
+ if (o.onUpdate?.(), !C.value)
292
306
  return;
293
- const t = O.value || [];
294
- v = !1;
307
+ const t = G.value || [];
308
+ b = !1;
295
309
  const l = [];
296
310
  e.forEachNode((u) => {
297
- const p = u.data, i = P(p), f = u.isSelected();
298
- t.find((g) => P(g) === i) ? !f && l.push(u) : f && u.setSelected(!1);
311
+ const p = u.data, i = V(p), f = u.isSelected();
312
+ t.find((g) => V(g) === i) ? !f && l.push(u) : f && u.setSelected(!1);
299
313
  }), e.setNodesSelected({ nodes: l, newValue: !0 }), setTimeout(() => {
300
- v = !0;
314
+ b = !0;
301
315
  }, 0);
302
- }, Qe = (e) => {
303
- v && (e.node.isSelected() ? Le(e.data) : We(e.data), N(y.value?.tooltip) && e.api.refreshCells({
316
+ }, Ye = (e) => {
317
+ b && (e.node.isSelected() ? He(e.data) : Ue(e.data), E(C.value?.tooltip) && e.api.refreshCells({
304
318
  rowNodes: [e.node],
305
319
  // todo: 取消硬编码
306
320
  columns: ["ag-Grid-SelectionColumn"],
307
321
  force: !0
308
322
  }));
309
- }, Xe = () => {
310
- v = !0;
323
+ }, Ze = () => {
324
+ b = !0;
311
325
  const e = s.value;
312
- if (!e || !k.value)
326
+ if (!e || !F.value)
313
327
  return;
314
- const t = e.getColumnState(), { colKey: l, order: u } = k.value, p = t.map((i) => ({
328
+ const t = e.getColumnState(), { colKey: l, order: u } = F.value, p = t.map((i) => ({
315
329
  ...i,
316
- sort: i.colId === l ? Q[u] : null
330
+ sort: i.colId === l ? X[u] : null
317
331
  }));
318
332
  e.applyColumnState({
319
333
  state: p
320
334
  });
321
- }, V = () => {
322
- Ue(), s.value?.deselectAll();
335
+ }, L = () => {
336
+ _e(), s.value?.deselectAll();
323
337
  };
324
- function Ye(e) {
325
- je(e), A(() => {
326
- x({});
338
+ function eo(e) {
339
+ $e(e), A(() => {
340
+ k({});
327
341
  });
328
342
  }
329
- const Ze = n(() => {
343
+ const oo = n(() => {
330
344
  const e = o.customRow;
331
345
  return e ? {
332
346
  isFullWidthRow: e.isCustomRow,
333
- fullWidthCellRenderer: ht,
347
+ fullWidthCellRenderer: bt,
334
348
  fullWidthCellRendererParams: {
335
349
  render: e.render
336
350
  }
337
351
  } : {};
338
352
  });
339
- function eo(e) {
340
- _e(e), A(() => {
341
- x({});
353
+ function to(e) {
354
+ qe(e), A(() => {
355
+ k({});
342
356
  });
343
357
  }
344
- function oo(e) {
345
- $e(e), A(() => {
346
- x({});
358
+ function ro(e) {
359
+ Je(e), A(() => {
360
+ k({});
347
361
  });
348
362
  }
349
- function te(e = !1) {
363
+ function re(e = !1) {
350
364
  const t = e ? "getFieldsValueTransformed" : "getFieldsValue";
351
365
  return S.value?.apForm?.[t]?.(!0);
352
366
  }
353
- function re(e) {
367
+ function le(e) {
354
368
  S.value?.apForm?.setFieldsValue?.(e);
355
369
  }
356
- function le() {
370
+ function ae() {
357
371
  return S.value?.getSorterItems() || [];
358
372
  }
359
- function ae(e) {
373
+ function ne(e) {
360
374
  S.value?.setSorterItems(e);
361
375
  }
362
- function ne() {
376
+ function se() {
363
377
  S.value?.resetSorterItems();
364
378
  }
365
- function se(e) {
379
+ function ie(e) {
366
380
  return e && String(e);
367
381
  }
368
- function to(e) {
382
+ function lo(e) {
369
383
  const t = s.value;
370
384
  if (!t)
371
385
  return;
372
386
  const l = t.getColumnState() || [], u = e.map((a) => a.key ? String(a.key) : a.key).filter(Boolean), p = l.map((a) => {
373
- if (!Me.value.includes(a.colId))
387
+ if (!xe.value.includes(a.colId))
374
388
  return a;
375
- const b = !u.includes(a.colId), ie = {
389
+ const M = !u.includes(a.colId), ue = {
376
390
  ...a,
377
- hide: b
378
- }, ue = e.find(
379
- (So) => se(So.key) === a.colId
391
+ hide: M
392
+ }, de = e.find(
393
+ (yo) => ie(yo.key) === a.colId
380
394
  );
381
- return ue && (ie.pinned = ue.fixed || null), ie;
395
+ return de && (ue.pinned = de.fixed || null), ue;
382
396
  }), i = new Map(
383
- e.map((a, b) => [se(a.key), b])
397
+ e.map((a, M) => [ie(a.key), M])
384
398
  ), f = p.filter((a) => i.has(a.colId)).sort(
385
- (a, b) => i.get(a.colId) - i.get(b.colId)
399
+ (a, M) => i.get(a.colId) - i.get(M.colId)
386
400
  ), g = [];
387
401
  let c = 0;
388
402
  for (const a of p)
@@ -392,15 +406,15 @@ const nr = /* @__PURE__ */ yo({
392
406
  applyOrder: !0
393
407
  });
394
408
  }
395
- Zo({
409
+ ot({
396
410
  columns: n(() => w.value),
397
- columnsBackup: n(() => J.value),
398
- size: n(() => Yo[R.value]),
411
+ columnsBackup: n(() => Q.value),
412
+ size: n(() => et[R.value]),
399
413
  updateColumns(e) {
400
- w.value = e, o.onShownColumnsChange?.(e), tt(
414
+ w.value = e, o.onShownColumnsChange?.(e), lt(
401
415
  () => s.value,
402
416
  () => {
403
- to(e);
417
+ lo(e);
404
418
  },
405
419
  {
406
420
  interval: 17
@@ -408,222 +422,223 @@ const nr = /* @__PURE__ */ yo({
408
422
  );
409
423
  },
410
424
  updateSize(e) {
411
- R.value = Xo[e];
425
+ R.value = Zo[e];
412
426
  },
413
427
  renderConfig: n(() => ({
414
- className: Se("table-header", "title"),
415
- color: be.value.colorTextTertiary
428
+ className: Ce("table-header", "title"),
429
+ color: Me.value.colorTextTertiary
416
430
  })),
417
431
  dataSource: n(() => r(m).records),
418
- getSearchFormValues: te,
419
- setSearchFormValues: re,
420
- submit: z,
421
- submitWith: ee,
432
+ getSearchFormValues: re,
433
+ setSearchFormValues: le,
434
+ submit: P,
435
+ submitWith: oe,
422
436
  reset: K,
423
- refresh: oe,
424
- getSearchFormSorterItems: le,
425
- setSearchFormSorterItems: ae,
426
- resetSearchFormSorterItems: ne,
427
- getLastParams: Pe
437
+ refresh: te,
438
+ getSearchFormSorterItems: ae,
439
+ setSearchFormSorterItems: ne,
440
+ resetSearchFormSorterItems: se,
441
+ getLastParams: Ve
428
442
  });
429
- const ro = n(
430
- () => F(o.loading) ? m.loading : o.loading
431
- ), lo = n(() => [
443
+ const ao = n(
444
+ () => B(o.loading) ? m.loading : o.loading
445
+ ), no = n(() => [
432
446
  d(),
433
447
  o.card ? null : d("wrapper"),
434
448
  d("adaptive"),
435
449
  d(`size-${R.value}`),
436
450
  o.autoHeight && m.records.length ? d("auto-height") : null,
437
451
  ye.value
438
- ].filter(Boolean)), ao = n(() => ({
452
+ ].filter(Boolean)), so = n(() => ({
439
453
  height: "100%",
440
454
  ...o.tableStyle || {}
441
- })), no = (e, t) => {
442
- Z({ current: e, pageSize: t });
455
+ })), io = (e, t) => {
456
+ ee({ current: e, pageSize: t });
443
457
  };
444
- function so(e) {
458
+ function uo(e) {
445
459
  const t = e.data;
446
- return P(t);
460
+ return V(t);
447
461
  }
448
- function io(e, t) {
449
- (N(e) ? s.value?.ensureNodeVisible : s.value?.ensureIndexVisible)?.(e, t);
462
+ function co(e, t) {
463
+ (E(e) ? s.value?.ensureNodeVisible : s.value?.ensureIndexVisible)?.(e, t);
450
464
  }
451
- function uo(e, t) {
465
+ function mo(e, t) {
452
466
  s.value?.ensureColumnVisible(e, t);
453
467
  }
454
- function co(e) {
468
+ function po(e) {
455
469
  o.onRowClicked?.(e.data, e.event);
456
470
  }
457
- function mo(e) {
471
+ function fo(e) {
458
472
  o.onScrollEnd?.(e.direction);
459
473
  }
460
- function po(e) {
474
+ function go(e) {
461
475
  return s.value?.refreshCells(e);
462
476
  }
463
- function fo(e) {
477
+ function wo(e) {
464
478
  return s.value?.redrawRows(e);
465
479
  }
466
- function go({ finished: e, column: t }) {
480
+ function So({ finished: e, column: t }) {
467
481
  !e || !t || o.onColumnResized?.(t.getColId(), t.getActualWidth());
468
482
  }
469
- const wo = (e) => {
483
+ const Co = (e) => {
470
484
  const t = [
471
- $.value.getRowClass?.(e)
485
+ q.value.getRowClass?.(e)
472
486
  ];
473
487
  if (!e.node.rowPinned) {
474
- const l = N(o.rowClassName) ? o.rowClassName(e.data, e.rowIndex) : o.rowClassName;
488
+ const l = E(o.rowClassName) ? o.rowClassName(e.data, e.rowIndex) : o.rowClassName;
475
489
  t.push(l);
476
490
  }
477
491
  return t.flat().filter(Boolean);
478
492
  };
479
- return G(
493
+ return W(
480
494
  () => o.dataSource,
481
495
  (e) => {
482
496
  A(() => {
483
- Oe(e);
497
+ Ge(e);
484
498
  });
485
499
  },
486
500
  { immediate: !0, deep: !0 }
487
- ), G(
501
+ ), W(
488
502
  () => o.size,
489
503
  (e) => {
490
504
  R.value = e;
491
505
  }
492
- ), G(
506
+ ), W(
493
507
  () => r(m).loading,
494
508
  (e) => {
495
509
  o.onLoadingChange?.(e);
496
510
  }
497
- ), ge({
498
- submit: z,
511
+ ), we({
512
+ submit: P,
499
513
  reset: K,
500
- refresh: oe,
501
- submitWith: ee,
502
- setSearchFormValues: re,
503
- getSearchFormValues: te,
514
+ refresh: te,
515
+ submitWith: oe,
516
+ setSearchFormValues: le,
517
+ getSearchFormValues: re,
504
518
  getShowColumns: () => r(w),
505
519
  rowSelection: {
506
- selectedRows: n(() => O.value),
507
- setSelectedRowKeys: Ye,
508
- setSelectedRows: eo,
509
- clearAll: V,
510
- unSelectRows: oo
520
+ selectedRows: n(() => G.value),
521
+ setSelectedRowKeys: eo,
522
+ setSelectedRows: to,
523
+ clearAll: L,
524
+ unSelectRows: ro
511
525
  },
512
- scrollToRow: io,
513
- scrollToColumn: uo,
526
+ scrollToRow: co,
527
+ scrollToColumn: mo,
514
528
  getDataSource: () => r(m.records),
515
- getPaging: ze,
529
+ getPaging: Pe,
516
530
  setPaging: Ke,
517
- getSearchFormSorterItems: le,
518
- setSearchFormSorterItems: ae,
519
- resetSearchFormSorterItems: ne,
520
- refreshCells: po,
521
- redrawRows: fo,
531
+ getSearchFormSorterItems: ae,
532
+ setSearchFormSorterItems: ne,
533
+ resetSearchFormSorterItems: se,
534
+ refreshCells: go,
535
+ redrawRows: wo,
522
536
  _internalGridApi: n(() => s.value)
523
- }), (e, t) => (C(), L("div", {
524
- class: h(lo.value),
525
- style: W(e.wrapperStyle)
537
+ }), (e, t) => (h(), H("div", {
538
+ class: v(no.value),
539
+ style: U(e.wrapperStyle)
526
540
  }, [
527
- r(F)(e.dataSource) && e.searchForm !== !1 && r(q).length > 0 ? (C(), L("div", {
541
+ r(B)(e.dataSource) && e.searchForm !== !1 && r(J).length > 0 ? (h(), H("div", {
528
542
  key: 0,
529
- class: h(e.card ? r(D)("search-wrapper") : null),
530
- style: W(e.searchFormWrapperStyle)
543
+ class: v(e.card ? r(D)("search-wrapper") : null),
544
+ style: U(e.searchFormWrapperStyle)
531
545
  }, [
532
- ho(r(lt).SearchForm, H(e.searchForm || {}, {
546
+ Ro(r(nt).SearchForm, j(e.searchForm || {}, {
533
547
  ref_key: "formRef",
534
548
  ref: S,
535
549
  "custom-reset": "",
536
- "submit-loading": r(Y).loading,
537
- onSubmit: r(z),
550
+ "submit-loading": r(Z).loading,
551
+ onSubmit: r(P),
538
552
  onReset: r(K)
539
- }), Ro({
540
- default: ce(() => [
541
- (C(!0), L(vo, null, bo(r(q), (l) => (C(), U(Mo(l.renderNode), {
553
+ }), bo({
554
+ default: me(() => [
555
+ (h(!0), H(Mo, null, xo(r(J), (l) => (h(), _(Bo(l.renderNode), {
542
556
  key: l.dataIndex
543
557
  }))), 128))
544
558
  ]),
545
559
  _: 2
546
560
  }, [
547
- j.searchFormExtra ? {
561
+ N.searchFormExtra ? {
548
562
  name: "extra",
549
- fn: ce(() => [
550
- me(e.$slots, "searchFormExtra")
563
+ fn: me(() => [
564
+ pe(e.$slots, "searchFormExtra")
551
565
  ]),
552
566
  key: "0"
553
567
  } : void 0
554
568
  ]), 1040, ["submit-loading", "onSubmit", "onReset"])
555
- ], 6)) : de("", !0),
569
+ ], 6)) : ce("", !0),
556
570
  T("div", {
557
- class: h([r(D)("table-wrapper"), e.card ? r(D)("table-wrapper-card") : null]),
558
- style: W(e.tableWrapperStyle)
571
+ class: v([r(D)("table-wrapper"), e.card ? r(D)("table-wrapper-card") : null]),
572
+ style: U(e.tableWrapperStyle)
559
573
  }, [
560
574
  T("div", {
561
- class: h(r(d)("header-wrapper"))
575
+ class: v(r(d)("header-wrapper"))
562
576
  }, [
563
- me(e.$slots, "title", {
564
- selectedRows: r(O),
565
- selectedRowKeys: r(He),
577
+ pe(e.$slots, "title", {
578
+ selectedRows: r(G),
579
+ selectedRowKeys: r(je),
566
580
  shownColumns: r(w),
567
- clearAll: V
581
+ clearAll: L
568
582
  })
569
583
  ], 2),
570
584
  T("div", {
571
585
  ref_key: "gridWrapperRef",
572
- ref: Ie,
573
- class: h(r(d)("grid-wrapper"))
586
+ ref: ke,
587
+ class: v(r(d)("grid-wrapper"))
574
588
  }, [
575
- (C(), U(r(Qo), H(
576
- r(gt)(r(he), r($), Ze.value),
589
+ (h(), _(r(Yo), j(
590
+ r(Ct)(r(ve), r(q), oo.value),
577
591
  {
578
- key: r(_),
592
+ key: r($),
579
593
  "animate-rows": e.animateRows,
580
- "get-row-class": wo,
581
- style: ao.value,
594
+ "get-row-class": Co,
595
+ style: so.value,
582
596
  "row-data": r(m).records,
583
- "column-defs": r(ke),
597
+ "column-defs": r(Ie),
584
598
  "default-col-def": r(Fe),
585
599
  "suppress-loading-overlay": "",
586
- "row-selection": Je.value,
587
- "selection-column-def": r(Ve),
588
- "get-row-id": so,
600
+ "row-selection": Xe.value,
601
+ "selection-column-def": r(Le),
602
+ "get-row-id": uo,
589
603
  "get-row-height": o.getRowHeight,
590
- theme: r(Ce),
604
+ theme: r(he),
591
605
  "tooltip-show-delay": 500,
592
606
  "enable-browser-tooltips": e.browserTooltips,
593
607
  "tooltip-interaction": "",
594
608
  "row-class-rules": e.rowClassRules,
595
- "no-rows-overlay-component": vt,
609
+ "no-rows-overlay-component": xt,
596
610
  "no-rows-overlay-component-params": { emptyComponent: e.emptyComponent, emptyText: e.emptyText },
597
- "loading-overlay-component": Rt,
598
- loading: ro.value,
611
+ "loading-overlay-component": Mt,
612
+ loading: ao.value,
599
613
  "suppress-cell-focus": "",
600
614
  "tab-to-next-cell": () => !1,
601
615
  "enable-cell-span": "",
602
616
  "dom-layout": e.autoHeight ? "autoHeight" : "normal",
603
- "locale-text": we[r(_)],
617
+ "locale-text": Se[r($)],
604
618
  onSortChanged: Ne,
605
619
  onGridReady: t[0] || (t[0] = (l) => s.value = l.api),
606
- onRowDataUpdated: x,
607
- onRowSelected: Qe,
608
- onFirstDataRendered: Xe,
609
- onRowClicked: co,
610
- onBodyScrollEnd: mo,
611
- onColumnResized: go
620
+ onRowDataUpdated: k,
621
+ onRowSelected: Ye,
622
+ onFirstDataRendered: Ze,
623
+ onRowClicked: po,
624
+ onBodyScrollEnd: fo,
625
+ onColumnResized: So,
626
+ onColumnGroupOpened: ze
612
627
  }
613
628
  ), null, 16, ["animate-rows", "style", "row-data", "column-defs", "default-col-def", "row-selection", "selection-column-def", "get-row-height", "theme", "enable-browser-tooltips", "row-class-rules", "no-rows-overlay-component-params", "loading", "dom-layout", "locale-text"]))
614
629
  ], 2),
615
630
  T("div", {
616
- class: h(r(d)("pagination-wrapper"))
631
+ class: v(r(d)("pagination-wrapper"))
617
632
  }, [
618
- e.pagination !== !1 ? (C(), U(r(ko), H({
633
+ e.pagination !== !1 ? (h(), _(r(ko), j({
619
634
  key: 0,
620
635
  class: r(d)("pagination")
621
- }, r(Y).pagination, { onChange: no }), null, 16, ["class"])) : de("", !0)
636
+ }, r(Z).pagination, { onChange: io }), null, 16, ["class"])) : ce("", !0)
622
637
  ], 2)
623
638
  ], 6)
624
639
  ], 6));
625
640
  }
626
641
  });
627
642
  export {
628
- nr as default
643
+ ur as default
629
644
  };