@aplus-frontend/ui 7.15.7 → 7.16.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 (49) hide show
  1. package/es/src/ag-grid/components/header-cell/index.vue2.mjs +56 -41
  2. package/es/src/ag-grid/context.d.ts +8 -0
  3. package/es/src/ag-grid/context.mjs +18 -7
  4. package/es/src/ag-grid/hooks/use-columns-def.d.ts +2 -2
  5. package/es/src/ag-grid/hooks/use-columns-def.mjs +64 -61
  6. package/es/src/ag-grid/hooks/use-columns.mjs +39 -30
  7. package/es/src/ag-grid/index.vue.mjs +270 -255
  8. package/es/src/ag-grid/interface.d.ts +20 -1
  9. package/es/src/ag-grid/style/custom-header.mjs +22 -13
  10. package/es/src/ap-table/components/setting/sortable/item.vue2.mjs +86 -65
  11. package/es/src/ap-table/style/setting.mjs +30 -27
  12. package/es/src/business/ag-grid-modal/interface.d.ts +3 -1
  13. package/es/src/business/ag-grid-modal/utils.d.ts +3 -1
  14. package/es/src/business/ap-export-group/ApExportGroup.vue2.mjs +32 -31
  15. package/es/src/business/ap-view/ap-view.vue2.mjs +17 -17
  16. package/es/src/business/ap-view/components/main-button-content.vue.d.ts +1 -1
  17. package/es/src/business/ap-view/components/main-button-content.vue2.mjs +20 -20
  18. package/es/src/business/ap-view/components/menu-list-content.vue2.mjs +38 -38
  19. package/es/src/business/ap-view/hooks/use-view-provide.d.ts +1 -1
  20. package/es/src/locale/lang/en.mjs +1 -0
  21. package/es/src/locale/lang/zh-cn.mjs +1 -0
  22. package/es/src/version.d.ts +1 -1
  23. package/es/src/version.mjs +1 -1
  24. package/lib/src/ag-grid/components/header-cell/index.vue2.js +1 -1
  25. package/lib/src/ag-grid/context.d.ts +8 -0
  26. package/lib/src/ag-grid/context.js +1 -1
  27. package/lib/src/ag-grid/hooks/use-columns-def.d.ts +2 -2
  28. package/lib/src/ag-grid/hooks/use-columns-def.js +1 -1
  29. package/lib/src/ag-grid/hooks/use-columns.js +1 -1
  30. package/lib/src/ag-grid/index.vue.js +1 -1
  31. package/lib/src/ag-grid/interface.d.ts +20 -1
  32. package/lib/src/ag-grid/style/custom-header.js +1 -1
  33. package/lib/src/ap-table/components/setting/sortable/item.vue2.js +1 -1
  34. package/lib/src/ap-table/style/setting.js +1 -1
  35. package/lib/src/business/ag-grid-modal/interface.d.ts +3 -1
  36. package/lib/src/business/ag-grid-modal/utils.d.ts +3 -1
  37. package/lib/src/business/ap-export-group/ApExportGroup.vue2.js +1 -1
  38. package/lib/src/business/ap-view/ap-view.vue2.js +1 -1
  39. package/lib/src/business/ap-view/components/main-button-content.vue.d.ts +1 -1
  40. package/lib/src/business/ap-view/components/main-button-content.vue2.js +1 -1
  41. package/lib/src/business/ap-view/components/menu-list-content.vue2.js +1 -1
  42. package/lib/src/business/ap-view/hooks/use-view-provide.d.ts +1 -1
  43. package/lib/src/locale/lang/en.js +1 -1
  44. package/lib/src/locale/lang/zh-cn.js +1 -1
  45. package/lib/src/version.d.ts +1 -1
  46. package/lib/src/version.js +1 -1
  47. package/package.json +6 -6
  48. package/es/test/setup.d.ts +0 -1
  49. package/lib/test/setup.d.ts +0 -1
@@ -1,67 +1,82 @@
1
- import { defineComponent as B, computed as d, createElementBlock as f, openBlock as l, normalizeClass as r, unref as e, createBlock as _, createCommentVNode as D, resolveDynamicComponent as O, createVNode as g } from "vue";
2
- import { CaretUpOutlined as V, CaretDownOutlined as j } from "@ant-design/icons-vue";
3
- import { useToken as z } from "@aplus-frontend/antdv/es/theme/internal";
4
- import { useInjectSorter as A } from "../../context.mjs";
5
- import { getTableTitle as E } from "../../../ap-table/utils.mjs";
1
+ import { defineComponent as L, computed as l, createElementBlock as u, openBlock as o, normalizeClass as a, unref as e, createVNode as m, createCommentVNode as h, withModifiers as R, createBlock as S } from "vue";
2
+ import { CaretUpOutlined as V, CaretDownOutlined as _, CaretLeftOutlined as z, CaretRightOutlined as A } from "@ant-design/icons-vue";
3
+ import { useToken as M } from "@aplus-frontend/antdv/es/theme/internal";
4
+ import { useInjectSorter as U, useInjectExpandable as $ } from "../../context.mjs";
5
+ import { getTableTitle as q } from "../../../ap-table/utils.mjs";
6
6
  import "../../../config-provider/index.mjs";
7
- import U from "../../style/custom-header.mjs";
8
- import { useNamespace as C } from "../../../config-provider/hooks/use-namespace.mjs";
9
- const P = /* @__PURE__ */ B({
7
+ import "../../../render/index.mjs";
8
+ import F from "../../style/custom-header.mjs";
9
+ import { useNamespace as k } from "../../../config-provider/hooks/use-namespace.mjs";
10
+ import H from "../../../render/render.mjs";
11
+ const oe = /* @__PURE__ */ L({
10
12
  __name: "index",
11
13
  props: {
12
14
  params: {}
13
15
  },
14
- setup(S) {
15
- const o = S, { b: v, e: a } = C("ag-custom-header"), { be: b, bem: h } = C("ag-grid"), k = U("ag-custom-header"), [, I] = z(), { sorter: c, setSorter: T } = A(), n = d(() => o.params.column.sorter);
16
- function y(t) {
16
+ setup(v) {
17
+ const r = v, { b, e: n } = k("ag-custom-header"), { be: x, bem: I } = k("ag-grid"), y = F("ag-custom-header"), [, T] = M(), { sorter: p, setSorter: w } = U(), { expandable: E } = $(), s = l(() => r.params.column.sorter), G = l(() => r.params.columnGroup?.getLeafColumns?.()?.some((t) => t.getColDef().columnGroupShow)), i = l(() => {
18
+ const t = r.params.columnGroup?.getGroupId?.();
19
+ return t ? E.value[t] ?? !1 : !1;
20
+ });
21
+ function N(t) {
17
22
  return t ? t === "asc" ? "desc" : null : "asc";
18
23
  }
19
- const m = d(() => o.params?.column?.getColId?.());
20
- function x() {
21
- if (!n.value)
24
+ const d = l(() => r.params?.column?.getColId?.());
25
+ function O() {
26
+ if (!s.value)
22
27
  return;
23
- const s = o.params.column.getColId(), N = o.params.column.getSort(), u = y(N), p = o.params.api, w = p.getColumnState().map((i) => ({
24
- ...i,
25
- sort: i.colId === s ? u : null
28
+ const c = r.params.column.getColId(), j = r.params.column.getSort(), f = N(j), g = r.params.api, D = g.getColumnState().map((C) => ({
29
+ ...C,
30
+ sort: C.colId === c ? f : null
26
31
  }));
27
- p.applyColumnState({
28
- state: w
29
- }), T({ [s]: u });
32
+ g.applyColumnState({
33
+ state: D
34
+ }), w({ [c]: f });
30
35
  }
31
- return (t, s) => (l(), f("div", {
32
- class: r([
33
- e(v)(),
34
- { sortable: n.value },
36
+ function B() {
37
+ r.params.setExpanded(!i.value);
38
+ }
39
+ return (t, c) => (o(), u("div", {
40
+ class: a([
41
+ e(b)(),
42
+ { sortable: s.value },
35
43
  `align-${t.params.column.align || "left"}`,
36
- e(k)
44
+ e(y)
37
45
  ]),
38
- onClick: x
46
+ onClick: O
39
47
  }, [
40
- (l(), _(O(
41
- e(E)(
48
+ m(e(H), {
49
+ renderer: () => e(q)(
42
50
  t.params.column,
43
51
  [
44
- e(b)("table-header", "title"),
45
- t.params.column.tooltip ? "" : e(h)("table-header", "title", "single")
52
+ e(x)("table-header", "title"),
53
+ t.params.column.tooltip ? "" : e(I)("table-header", "title", "single")
46
54
  ],
47
- void 0,
48
- e(I).colorTextTertiary
55
+ t.params.headerCell,
56
+ e(T).colorTextTertiary
49
57
  )
50
- ))),
51
- n.value ? (l(), f("span", {
58
+ }, null, 8, ["renderer"]),
59
+ s.value ? (o(), u("span", {
52
60
  key: 0,
53
- class: r(e(a)("sort-wrapper"))
61
+ class: a(e(n)("sort-wrapper"))
54
62
  }, [
55
- g(e(V), {
56
- class: r({ [e(a)("sorter-up")]: !0, active: e(c)[m.value] === "asc" })
63
+ m(e(V), {
64
+ class: a({ [e(n)("sorter-up")]: !0, active: e(p)[d.value] === "asc" })
57
65
  }, null, 8, ["class"]),
58
- g(e(j), {
59
- class: r({ [e(a)("sorter-down")]: !0, active: e(c)[m.value] === "desc" })
66
+ m(e(_), {
67
+ class: a({ [e(n)("sorter-down")]: !0, active: e(p)[d.value] === "desc" })
60
68
  }, null, 8, ["class"])
61
- ], 2)) : D("", !0)
69
+ ], 2)) : h("", !0),
70
+ G.value ? (o(), u("span", {
71
+ key: 1,
72
+ class: a(e(n)("expand-wrapper")),
73
+ onClick: R(B, ["stop"])
74
+ }, [
75
+ i.value ? (o(), S(e(z), { key: 0 })) : (o(), S(e(A), { key: 1 }))
76
+ ], 2)) : h("", !0)
62
77
  ], 2));
63
78
  }
64
79
  });
65
80
  export {
66
- P as default
81
+ oe as default
67
82
  };
@@ -12,7 +12,15 @@ type AgGridSorterContextProps = {
12
12
  */
13
13
  setSorter: (nextSorter: Recordable) => void;
14
14
  };
15
+ type AgGirdColumnExpandedContextProps = {
16
+ expandable: Ref<Recordable<boolean>>;
17
+ };
18
+ export declare const AgGridExpandableContextKey: InjectionKey<AgGirdColumnExpandedContextProps>;
15
19
  export declare const AgGridSorterContextKey: InjectionKey<AgGridSorterContextProps>;
20
+ export declare function useProvideExpandable(state: AgGirdColumnExpandedContextProps): void;
21
+ export declare function useInjectExpandable(): {
22
+ expandable: Ref<Recordable<boolean>, Recordable<boolean>>;
23
+ };
16
24
  export declare function useProvideSorter(state: AgGridSorterContextProps): void;
17
25
  export declare function useInjectSorter(): AgGridSorterContextProps;
18
26
  export {};
@@ -1,17 +1,28 @@
1
- import { provide as t, inject as o, ref as n } from "vue";
2
- const r = /* @__PURE__ */ Symbol("formContextKey");
1
+ import { provide as r, inject as t, ref as n } from "vue";
2
+ const o = /* @__PURE__ */ Symbol("agGridExpandableKey"), i = /* @__PURE__ */ Symbol("agGridSorterContextKey");
3
+ function d(e) {
4
+ r(o, e);
5
+ }
6
+ function u() {
7
+ return t(o, {
8
+ expandable: n({})
9
+ });
10
+ }
3
11
  function c(e) {
4
- t(r, e);
12
+ r(i, e);
5
13
  }
6
- function f() {
7
- return o(r, {
14
+ function x() {
15
+ return t(i, {
8
16
  sorter: n({}),
9
17
  setSorter: () => {
10
18
  }
11
19
  });
12
20
  }
13
21
  export {
14
- r as AgGridSorterContextKey,
15
- f as useInjectSorter,
22
+ o as AgGridExpandableContextKey,
23
+ i as AgGridSorterContextKey,
24
+ u as useInjectExpandable,
25
+ x as useInjectSorter,
26
+ d as useProvideExpandable,
16
27
  c as useProvideSorter
17
28
  };
@@ -1,13 +1,13 @@
1
1
  import { CellClassFunc, ColDef, ColGroupDef } from 'ag-grid-community';
2
2
  import { Ref, ComputedRef } from 'vue';
3
- import { AgGridColumnType, AgGridProps } from '../interface';
3
+ import { AgGridColumnType, AgGridProps, AgGridSlots } from '../interface';
4
4
  /**
5
5
  * 维护AgGrid列配置
6
6
  * @param shownColumns
7
7
  * @param props
8
8
  * @returns
9
9
  */
10
- export declare const useColumnsDef: <RecordType>(columns: Ref<AgGridColumnType<RecordType>[]>, props: AgGridProps<RecordType>, customCellClass: (callback: CellClassFunc) => CellClassFunc) => {
10
+ export declare const useColumnsDef: <RecordType>(columns: Ref<AgGridColumnType<RecordType>[]>, props: AgGridProps<RecordType>, customCellClass: (callback: CellClassFunc) => CellClassFunc, headerCell?: AgGridSlots<RecordType>["headerCell"]) => {
11
11
  columnDefs: ComputedRef<(ColDef<any, any> | ColGroupDef<any>)[]>;
12
12
  defaultColDef: ComputedRef<ColDef<any, any>>;
13
13
  gridWrapperRef: Ref<HTMLDivElement | undefined, HTMLDivElement | undefined>;
@@ -1,36 +1,36 @@
1
- import { isNumber as u, isFunction as c } from "lodash-unified";
2
- import { ref as S, unref as x, computed as y } from "vue";
3
- import { dataIndexToField as D } from "../../ap-grid/utils/col.mjs";
4
- import { getTableRenderProps as b, objectToString as P } from "../../ap-table/utils.mjs";
1
+ import { isNumber as u, isFunction as b } from "lodash-unified";
2
+ import { ref as D, unref as C, computed as h } from "vue";
3
+ import { dataIndexToField as P } from "../../ap-grid/utils/col.mjs";
4
+ import { getTableRenderProps as m, objectToString as G } from "../../ap-table/utils.mjs";
5
5
  import "../../config-provider/index.mjs";
6
6
  import "../../utils/index.mjs";
7
7
  import "../components/body-cell/index.vue.mjs";
8
8
  import "../components/header-cell/index.vue.mjs";
9
9
  import "../components/tooltip/index.vue.mjs";
10
- import { rendererMap as v } from "../renderer/index.mjs";
10
+ import { rendererMap as T } from "../renderer/index.mjs";
11
11
  import { useGlobalConfig as I } from "../../config-provider/hooks/use-global-config.mjs";
12
12
  import { useNamespace as _ } from "../../config-provider/hooks/use-namespace.mjs";
13
- import G from "../components/body-cell/index.vue2.mjs";
14
- import W from "../components/tooltip/index.vue2.mjs";
15
- import { isDef as z } from "../../utils/is.mjs";
16
- import h from "../components/header-cell/index.vue2.mjs";
17
- function F(t) {
13
+ import W from "../components/body-cell/index.vue2.mjs";
14
+ import z from "../components/tooltip/index.vue2.mjs";
15
+ import { isDef as F } from "../../utils/is.mjs";
16
+ import c from "../components/header-cell/index.vue2.mjs";
17
+ function M(t) {
18
18
  return u(t) && t > 1;
19
19
  }
20
- function M(t, a) {
21
- if (a.bodyCellTooltip)
22
- return c(a.bodyCellTooltip) ? a.bodyCellTooltip(t.value, t.data) : a.bodyCellTooltip;
23
- if (a.renderText)
24
- return a.renderText({
20
+ function V(t, i) {
21
+ if (i.bodyCellTooltip)
22
+ return b(i.bodyCellTooltip) ? i.bodyCellTooltip(t.value, t.data) : i.bodyCellTooltip;
23
+ if (i.renderText)
24
+ return i.renderText({
25
25
  value: t.value,
26
26
  record: t.data,
27
- column: a,
27
+ column: i,
28
28
  text: t.value
29
29
  });
30
- const d = a.valueType || "text", p = v[d];
31
- if (p) {
32
- const f = b(
33
- { ...a, valueType: d },
30
+ const p = i.valueType || "text", d = T[p];
31
+ if (d) {
32
+ const f = m(
33
+ { ...i, valueType: p },
34
34
  {
35
35
  value: t.value,
36
36
  text: t.value,
@@ -40,22 +40,22 @@ function M(t, a) {
40
40
  pinned: t.node?.rowPinned
41
41
  }
42
42
  );
43
- return p(f);
43
+ return d(f);
44
44
  }
45
- return P(t.value);
45
+ return G(t.value);
46
46
  }
47
- const Y = (t, a, d) => {
48
- const p = I("valueTypeMap"), C = S(), { em: f } = _("ag-grid"), m = (r) => {
49
- const i = {
50
- cellRenderer: G,
47
+ const Z = (t, i, p, d) => {
48
+ const v = I("valueTypeMap"), f = D(), { em: y } = _("ag-grid"), w = (r) => {
49
+ const a = {
50
+ cellRenderer: W,
51
51
  cellRendererParams: {
52
52
  column: r,
53
- extraValueType: x(p),
54
- rowKey: a.rowKey
53
+ extraValueType: C(v),
54
+ rowKey: i.rowKey
55
55
  }
56
56
  };
57
57
  if (r.customRender)
58
- return i;
58
+ return a;
59
59
  if (r.renderText)
60
60
  return {
61
61
  valueFormatter: (o) => r.renderText({
@@ -65,10 +65,10 @@ const Y = (t, a, d) => {
65
65
  text: o.value
66
66
  })
67
67
  };
68
- const s = r.valueType || "text", e = v[s];
68
+ const s = r.valueType || "text", e = T[s];
69
69
  return e ? {
70
70
  valueFormatter: (o) => {
71
- const l = b(
71
+ const l = m(
72
72
  { ...r, valueType: s },
73
73
  {
74
74
  value: o.value,
@@ -81,26 +81,27 @@ const Y = (t, a, d) => {
81
81
  );
82
82
  return e(l);
83
83
  }
84
- } : i;
85
- }, w = (r) => {
86
- const i = r.valueType || "text", s = v[i], e = {}, o = r.bodyCellTooltip || !r.customRender && s && (r.ellipsis === !0 || r.ellipsis === "tooltip" || u(r.ellipsis)), l = u(r.ellipsis) && r.ellipsis > 1, n = u(r.ellipsis) ? r.ellipsis : 1;
87
- return e.tooltipValueGetter = o ? (T) => M(T, r) : void 0, e.wrapText = !r.ellipsis || l, e.cellStyle = {
84
+ } : a;
85
+ }, g = (r) => {
86
+ const a = r.valueType || "text", s = T[a], e = {}, o = r.bodyCellTooltip || !r.customRender && s && (r.ellipsis === !0 || r.ellipsis === "tooltip" || u(r.ellipsis)), l = u(r.ellipsis) && r.ellipsis > 1, n = u(r.ellipsis) ? r.ellipsis : 1;
87
+ return e.tooltipValueGetter = o ? (x) => V(x, r) : void 0, e.wrapText = !r.ellipsis || l, e.cellStyle = {
88
88
  "--ag-grid-line-clamp": n
89
- }, e.tooltipComponent = W, e.tooltipComponentParams = {
89
+ }, e.tooltipComponent = z, e.tooltipComponentParams = {
90
90
  lineClamp: n,
91
- gridWrapperRef: C
91
+ gridWrapperRef: f
92
92
  }, e;
93
- }, g = y(() => {
94
- const r = x(t);
95
- function i(s) {
93
+ }, S = h(() => {
94
+ const r = C(t);
95
+ function a(s) {
96
96
  return s.map((e) => {
97
97
  const o = {
98
- field: D(e.dataIndex),
99
- colId: z(e.key) ? String(e.key) : void 0,
98
+ field: P(e.dataIndex),
99
+ colId: F(e.key) ? String(e.key) : void 0,
100
100
  sortable: !!e.sorter,
101
101
  comparator: e.sorter === !0 ? () => 0 : e.sorter,
102
102
  headerComponentParams: {
103
- column: e
103
+ column: e,
104
+ headerCell: d
104
105
  },
105
106
  resizable: e.resizable,
106
107
  width: e.width,
@@ -108,53 +109,55 @@ const Y = (t, a, d) => {
108
109
  maxWidth: e.maxWidth,
109
110
  suppressKeyboardEvent: () => !0,
110
111
  // 避免单元格内元素事件被劫持
111
- flex: e.width ? void 0 : 1,
112
+ flex: e.width ? void 0 : e.flex ?? 1,
112
113
  // 如果没有设置确切的宽度,则设置为可自由伸缩列
113
114
  pinned: e.fixed || null,
114
115
  // undefined to null
115
116
  colSpan: e.colSpan,
116
117
  spanRows: e.spanRows,
117
- cellClass: d((l) => {
118
- const n = e.cellClass || "", T = c(n) ? n(l.data, l.node) : n;
118
+ cellClass: p((l) => {
119
+ const n = e.cellClass || "", x = b(n) ? n(l.data, l.node) : n;
119
120
  return [
120
- `${f("cell", e.align || "left")}`,
121
- F(e.ellipsis) ? f("cell", "multiline") : null,
122
- T
121
+ `${y("cell", e.align || "left")}`,
122
+ M(e.ellipsis) ? y("cell", "multiline") : null,
123
+ x
123
124
  ].flat().filter(Boolean);
124
125
  }),
125
126
  cellStyle: e.cellStyle,
126
127
  headerStyle: e.headerStyle,
127
128
  headerClass: e.headerClass,
129
+ columnGroupShow: e.columnGroupShow,
128
130
  autoHeight: !0,
129
131
  // 设置自动计算高度以自适应多行换行的场景
130
- ...w(e),
131
- ...m(e)
132
+ ...g(e),
133
+ ...w(e)
132
134
  };
133
135
  return e.children?.length ? {
134
136
  ...o,
135
- headerGroupComponent: h,
137
+ headerGroupComponent: c,
136
138
  headerGroupComponentParams: {
137
- column: e
139
+ column: e,
140
+ headerCell: d
138
141
  },
139
- children: i(e.children)
142
+ children: a(e.children)
140
143
  } : o;
141
144
  });
142
145
  }
143
- return i(r);
144
- }), R = y(
146
+ return a(r);
147
+ }), R = h(
145
148
  () => ({
146
- headerComponent: h,
147
- resizable: a.columnResizable,
149
+ headerComponent: c,
150
+ resizable: i.columnResizable,
148
151
  suppressMovable: !0,
149
152
  cellDataType: !1
150
153
  })
151
154
  );
152
155
  return {
153
- columnDefs: g,
156
+ columnDefs: S,
154
157
  defaultColDef: R,
155
- gridWrapperRef: C
158
+ gridWrapperRef: f
156
159
  };
157
160
  };
158
161
  export {
159
- Y as useColumnsDef
162
+ Z as useColumnsDef
160
163
  };
@@ -1,51 +1,60 @@
1
- import { ref as c, computed as s, watch as y } from "vue";
2
- import { getStringKey as i } from "../utils.mjs";
3
- const g = (r) => {
4
- const o = c([]), u = c([]);
5
- function m() {
6
- return r.columns?.filter((e) => !e.hideInTable) || [];
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([]);
5
+ function l(n = []) {
6
+ return n.filter((e) => !e.hideInTable).map((e) => {
7
+ if (e.children?.length) {
8
+ const r = l(e.children);
9
+ return r?.length ? {
10
+ ...e,
11
+ children: r
12
+ } : null;
13
+ }
14
+ return e;
15
+ }).filter(Boolean);
7
16
  }
8
- function d(e) {
9
- return o.value.find((n) => i(n.key) === e);
17
+ function f(n) {
18
+ return t.value.find((e) => d(e.key) === n);
10
19
  }
11
- const f = s(
12
- () => o.value.map((e) => i(e.key)).filter(Boolean)
20
+ const m = s(
21
+ () => t.value.map((n) => d(n.key)).filter(Boolean)
13
22
  );
14
- y(
15
- () => r.columns,
23
+ h(
24
+ () => o.columns,
16
25
  () => {
17
- const e = m();
18
- o.value = e, u.value = e, r.onShownColumnsChange?.(e);
26
+ const n = l(o.columns);
27
+ t.value = n, u.value = n, o.onShownColumnsChange?.(n);
19
28
  },
20
29
  {
21
30
  deep: !0,
22
31
  immediate: !0
23
32
  }
24
33
  );
25
- function l(e) {
26
- for (const n of e)
27
- if (n.children) {
28
- const t = l(n.children);
29
- if (t)
30
- return t;
31
- } else if (n.defaultSortOrder) {
32
- const t = n.field ?? n.dataIndex ?? n.key;
34
+ function i(n) {
35
+ for (const e of n)
36
+ if (e.children) {
37
+ const r = i(e.children);
38
+ if (r)
39
+ return r;
40
+ } else if (e.defaultSortOrder) {
41
+ const r = e.field ?? e.dataIndex ?? e.key;
33
42
  return {
34
- colKey: n.key,
35
- field: t,
36
- order: n.defaultSortOrder
43
+ colKey: e.key,
44
+ field: r,
45
+ order: e.defaultSortOrder
37
46
  };
38
47
  }
39
48
  }
40
- const a = s(() => l(o.value));
49
+ const a = s(() => i(t.value));
41
50
  return {
42
- columns: o,
51
+ columns: t,
43
52
  shownColumns: u,
44
- columnKeys: f,
45
- getTargetColumnByKey: d,
53
+ columnKeys: m,
54
+ getTargetColumnByKey: f,
46
55
  defaultSortOrder: a
47
56
  };
48
57
  };
49
58
  export {
50
- g as useColumns
59
+ C as useColumns
51
60
  };