@dazhicheng/ui 1.6.1 → 1.6.2

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.
@@ -1,13 +1,13 @@
1
- import { defineComponent as vt, mergeModels as he, useModel as It, useAttrs as Vt, useSlots as Et, getCurrentInstance as _t, ref as q, shallowReactive as zt, onScopeDispose as ye, computed as m, provide as be, unref as e, toRaw as Se, nextTick as J, onMounted as Dt, createElementBlock as g, openBlock as c, normalizeClass as z, createVNode as D, mergeProps as Q, toHandlers as Mt, createSlots as Kt, withCtx as n, renderSlot as d, createBlock as X, createCommentVNode as M, normalizeStyle as y, createElementVNode as f, normalizeProps as P, guardReactiveProps as K, Fragment as At, toDisplayString as Y, renderList as Z, createTextVNode as Ce, toValue as Ft } from "vue";
2
- import { TtErrorTooltip as Lt } from "../../tt-form-item-error-tooltip/index.js";
3
- import { useLoading as Nt } from "../../../hooks/useLoading.js";
1
+ import { defineComponent as It, mergeModels as he, useModel as Vt, useAttrs as Et, useSlots as _t, getCurrentInstance as zt, ref as q, shallowReactive as Dt, onScopeDispose as ye, computed as m, provide as be, unref as e, toRaw as Se, nextTick as J, onMounted as Kt, createElementBlock as g, openBlock as c, normalizeClass as z, createVNode as D, mergeProps as Q, toHandlers as Mt, createSlots as At, withCtx as n, renderSlot as d, createBlock as X, createCommentVNode as K, normalizeStyle as y, createElementVNode as f, normalizeProps as P, guardReactiveProps as M, Fragment as Ft, toDisplayString as Y, renderList as Z, createTextVNode as we, toValue as Lt } from "vue";
2
+ import { TtErrorTooltip as Nt } from "../../tt-form-item-error-tooltip/index.js";
3
+ import { useLoading as Ot } from "../../../hooks/useLoading.js";
4
4
  import "../../../node_modules/.pnpm/vue-types@5.1.3_vue@3.5.21_typescript@5.9.3_/node_modules/vue-types/shim/index.modern.js";
5
- import { useDesign as Ot } from "../../../packages/hooks/src/useDesign.js";
5
+ import { useDesign as Ht } from "../../../packages/hooks/src/useDesign.js";
6
6
  import "axios";
7
- import { ElScrollbar as we } from "element-plus";
7
+ import { ElScrollbar as Ce } from "element-plus";
8
8
  import "dayjs";
9
9
  import "numeral";
10
- import { extractResourceFromApi as Ht, generateTestId as xe } from "../../../packages/utils/src/testid-helper.js";
10
+ import { extractResourceFromApi as Bt, generateTestId as xe } from "../../../packages/utils/src/testid-helper.js";
11
11
  import "xe-utils";
12
12
  import "dayjs/plugin/utc";
13
13
  import "dayjs/plugin/timezone";
@@ -18,173 +18,175 @@ import "../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-
18
18
  import "../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-pkcs7.js";
19
19
  import { omit as $e } from "lodash-es";
20
20
  import "vue-router";
21
- import { useStore as Bt } from "@tanstack/vue-store";
22
- import { VxePager as Gt } from "vxe-pc-ui";
23
- import { VxeGrid as jt } from "vxe-table";
24
- import { tableProps as Wt } from "vxe-table/es/table/src/props";
25
- import Ut from "../../../assets/svg/paixu-jiangxu.svg.js";
26
- import qt from "../../../assets/svg/paixu-moren.svg.js";
27
- import Jt from "../../../assets/svg/paixu-shengxu.svg.js";
28
- import { TtImage as Qt } from "../../tt-image/index.js";
29
- import { RowContext as Xt } from "./components/RowContext.js";
30
- import { basicTableEmits as Yt } from "./emits.js";
31
- import { useColumns as Zt } from "./hooks/useColumns.js";
32
- import { useGridProps as eo } from "./hooks/useGridProps.js";
33
- import { useKeyboardNav as to } from "./hooks/useKeyboardNav.js";
34
- import { usePagination as oo } from "./hooks/usePagination.js";
35
- import { useQuery as ro } from "./hooks/useQuery.js";
36
- import { useRowIdentity as so } from "./hooks/useRowIdentity.js";
37
- import { useRowSelection as lo } from "./hooks/useRowSelection.js";
38
- import { useSideSlot as ao } from "./hooks/useSideSlot.js";
39
- import { useSyncProps as no } from "./hooks/useSyncProps.js";
40
- import { createTableContext as io } from "./hooks/useTableContext.js";
41
- import { useTableData as co } from "./hooks/useTableData.js";
42
- import { useTableFooter as po } from "./hooks/useTableFooter.js";
43
- import { useTableMethods as mo } from "./hooks/useTableMethods.js";
44
- import { tableOtherProps as uo, tableProps as go } from "./props.js";
45
- import { forwardedEventEntries as fo, isDisplayOnlyEvent as ho, isRowDataMutationEvent as yo, getMutationCommitSource as bo } from "./table-mutation-events.js";
46
- import { TableApi as So } from "./utils/table-api.js";
47
- const Co = ["data-testid"], wo = ["src"], xo = ["src"], $o = ["src"], To = {
21
+ import { useStore as Gt } from "@tanstack/vue-store";
22
+ import { VxePager as jt } from "vxe-pc-ui";
23
+ import { VxeGrid as Wt } from "vxe-table";
24
+ import { tableProps as Ut } from "vxe-table/es/table/src/props";
25
+ import qt from "../../../assets/svg/paixu-jiangxu.svg.js";
26
+ import Jt from "../../../assets/svg/paixu-moren.svg.js";
27
+ import Qt from "../../../assets/svg/paixu-shengxu.svg.js";
28
+ import { TtImage as Xt } from "../../tt-image/index.js";
29
+ import { RowContext as Yt } from "./components/RowContext.js";
30
+ import { basicTableEmits as Zt } from "./emits.js";
31
+ import { useColumns as eo } from "./hooks/useColumns.js";
32
+ import { useGridProps as to } from "./hooks/useGridProps.js";
33
+ import { useKeyboardNav as oo } from "./hooks/useKeyboardNav.js";
34
+ import { usePagination as ro } from "./hooks/usePagination.js";
35
+ import { useQuery as so } from "./hooks/useQuery.js";
36
+ import { useRowIdentity as lo } from "./hooks/useRowIdentity.js";
37
+ import { useRowSelection as ao } from "./hooks/useRowSelection.js";
38
+ import { useSideSlot as no } from "./hooks/useSideSlot.js";
39
+ import { useSyncProps as io } from "./hooks/useSyncProps.js";
40
+ import { createTableContext as co } from "./hooks/useTableContext.js";
41
+ import { useTableData as po } from "./hooks/useTableData.js";
42
+ import { useTableFooter as mo } from "./hooks/useTableFooter.js";
43
+ import { useTableMethods as uo } from "./hooks/useTableMethods.js";
44
+ import { tableOtherProps as go, tableProps as fo } from "./props.js";
45
+ import { forwardedEventEntries as ho, isDisplayOnlyEvent as yo, isRowDataMutationEvent as bo, getMutationCommitSource as So } from "./table-mutation-events.js";
46
+ import { TableApi as wo } from "./utils/table-api.js";
47
+ const Co = ["data-testid"], xo = ["src"], $o = ["src"], To = ["src"], Ro = {
48
48
  style: {
49
49
  color: "#009ffa"
50
50
  }
51
- }, Ro = {
52
- key: 0
53
51
  }, ko = {
52
+ key: 0
53
+ }, Po = {
54
54
  key: 1
55
- }, Sr = /* @__PURE__ */ vt({
55
+ }, wr = /* @__PURE__ */ It({
56
56
  name: "TtTable",
57
57
  __name: "Table",
58
58
  props: /* @__PURE__ */ he({
59
- ...Wt,
60
- ...go,
61
- ...uo
59
+ ...Ut,
60
+ ...fo,
61
+ ...go
62
62
  }, {
63
63
  modelValue: {},
64
64
  modelModifiers: {}
65
65
  }),
66
- emits: /* @__PURE__ */ he(["register", "fetch-success", "fetch-error", "selection-change", ...Yt], ["update:modelValue"]),
66
+ emits: /* @__PURE__ */ he(["register", "fetch-success", "fetch-error", "selection-change", ...Zt], ["update:modelValue"]),
67
67
  setup(ee, {
68
68
  expose: Te,
69
69
  emit: Re
70
70
  }) {
71
71
  var ue, ge;
72
- const h = ee, ke = It(ee, "modelValue"), i = Re, te = Vt(), A = Et(), w = _t(), {
72
+ const h = ee, ke = Vt(ee, "modelValue"), i = Re, te = Et(), A = _t(), C = zt(), {
73
73
  prefixCls: b
74
- } = Ot("table"), Pe = Object.hasOwn(((ue = w == null ? void 0 : w.vnode) == null ? void 0 : ue.props) || {}, "data"), v = q(null), p = q(), F = q({});
74
+ } = Ht("table"), Pe = Object.hasOwn(((ue = C == null ? void 0 : C.vnode) == null ? void 0 : ue.props) || {}, "data"), v = q(null), p = q(), F = q({});
75
75
  let s = h.tableApi;
76
- s || (s = new So($e(h, ["modelValue"])), s.useStore = (t) => Bt(s.store, t));
77
- const I = zt({});
76
+ s || (s = new wo($e(h, ["modelValue"])), s.useStore = (t) => Gt(s.store, t));
77
+ const I = Dt({});
78
78
  function oe() {
79
79
  Object.assign(I, Se(s.store.state) || {});
80
80
  }
81
81
  oe(), ye(s.store.subscribe(oe));
82
- const l = m(() => I), ve = Pe ? () => Ft(h.data) : () => I.data, Ie = () => I.api;
82
+ const l = m(() => I), ve = Pe ? () => Lt(h.data) : () => I.data, Ie = () => I.api;
83
83
  be(`${b}-props`, l);
84
- const L = m(() => h.testId || (h.api ? Ht(h.api) : "table")), Ve = m(() => xe(e(L), "table")), Ee = m(() => xe(e(L), "table-toolbar"));
84
+ const L = m(() => h.testId || (h.api ? Bt(h.api) : "table")), Ve = m(() => xe(e(L), "table")), Ee = m(() => xe(e(L), "table-toolbar"));
85
85
  be("tableIdContext", L);
86
86
  const {
87
87
  getLoading: x,
88
88
  setLoading: re
89
- } = Nt(m(() => e(l).loading || !1)), {
89
+ } = Ot(m(() => e(l).loading || !1)), {
90
90
  pagination: $,
91
91
  paginationInfo: S,
92
92
  getPagination: _e,
93
93
  setPagination: N,
94
94
  onPageChange: ze
95
- } = oo(l, i), {
95
+ } = ro(l, i), {
96
96
  getRowKey: De,
97
+ getRowKeys: Ke,
97
98
  prepareRows: O,
98
99
  toVxeRowConfig: Me
99
- } = so(l), {
100
+ } = lo(l), {
100
101
  selectedKeys: H,
101
102
  selectedRows: B,
102
- selectedKeyList: Ke,
103
- getSelectRowKeys: Ae,
104
- getSelectRows: Fe,
105
- syncSelection: Le,
106
- setSelectedRowKeys: Ne,
103
+ selectedKeyList: Ae,
104
+ getSelectRowKeys: Fe,
105
+ getSelectRows: Le,
106
+ syncSelection: Ne,
107
+ setSelectedRowKeys: Oe,
107
108
  clearSelectedRowKeys: se,
108
- resetSelectionAfterFetch: Oe,
109
- onCheckboxChange: He,
110
- onCheckboxAll: Be,
111
- onCheckboxRangeChange: Ge,
112
- onRadioChange: je,
113
- onCellAreaSelectionEnd: We
114
- } = lo(l, p, i, {
115
- getRowKey: De
109
+ resetSelectionAfterFetch: He,
110
+ onCheckboxChange: Be,
111
+ onCheckboxAll: Ge,
112
+ onCheckboxRangeChange: je,
113
+ onRadioChange: We,
114
+ onCellAreaSelectionEnd: Ue
115
+ } = ao(l, p, i, {
116
+ getRowKey: De,
117
+ getRowKeys: Ke
116
118
  }), {
117
119
  rows: V,
118
- applyRows: Ue,
119
- getDataSource: qe,
120
- runDataOperation: Je,
120
+ applyRows: qe,
121
+ getDataSource: Je,
122
+ runDataOperation: Qe,
121
123
  scheduleRowsCommit: G,
122
- cancelRowsCommit: Qe,
123
- onDataChange: Xe,
124
- createTableInstanceFacade: Ye,
125
- isActive: Ze
126
- } = co(l, p, ke, i, {
124
+ cancelRowsCommit: Xe,
125
+ onDataChange: Ye,
126
+ createTableInstanceFacade: Ze,
127
+ isActive: et
128
+ } = po(l, p, ke, i, {
127
129
  data: ve,
128
130
  api: Ie,
129
131
  prepareRows: O,
130
- onSelectionMutated: Le
132
+ onSelectionMutated: Ne
131
133
  }), {
132
- refresh: et,
133
- syncScroll: tt,
134
+ refresh: tt,
135
+ syncScroll: ot,
134
136
  rowNodes: le,
135
137
  headerHeight: ae,
136
138
  bodyHeight: E,
137
- bodyWrapperHeight: C,
139
+ bodyWrapperHeight: w,
138
140
  bodyOffsetTop: ne,
139
141
  bodyScrollHeight: ie,
140
- leftScrollbarRef: ot,
141
- rightScrollbarRef: rt
142
- } = ao(l, p, V), {
143
- reload: st,
142
+ leftScrollbarRef: rt,
143
+ rightScrollbarRef: st
144
+ } = no(l, p, V), {
145
+ reload: lt,
144
146
  reloadFilter: de,
145
147
  isLoaded: ce
146
- } = ro(l, {
148
+ } = so(l, {
147
149
  grid: p,
148
150
  pagination: $,
149
151
  paginationInfo: S,
150
152
  setPagination: N,
151
153
  setLoading: re,
152
- resetSelectionAfterFetch: Oe,
154
+ resetSelectionAfterFetch: He,
153
155
  rows: V,
154
- applyRows: Ue
156
+ applyRows: qe
155
157
  }, i), {
156
- gridColumns: lt,
157
- hasExpandColumn: at,
158
- sortIconSlots: nt,
159
- validSlots: it,
160
- setTableColumns: dt,
161
- getTableColumns: ct,
162
- onColumnDragend: pt
163
- } = Zt(l, p, i), {
164
- footerSummaryMethod: mt
165
- } = po(lt), {
158
+ gridColumns: at,
159
+ hasExpandColumn: nt,
160
+ sortIconSlots: it,
161
+ validSlots: dt,
162
+ setTableColumns: ct,
163
+ getTableColumns: pt,
164
+ onColumnDragend: mt
165
+ } = eo(l, p, i), {
166
+ footerSummaryMethod: ut
167
+ } = mo(at), {
166
168
  bindValues: j,
167
- gridProps: ut
168
- } = eo(l, {
169
+ gridProps: gt
170
+ } = to(l, {
169
171
  attrs: te,
170
172
  slots: A
171
173
  }, {
172
- hasExpandColumn: at,
173
- footerSummaryMethod: mt,
174
+ hasExpandColumn: nt,
175
+ footerSummaryMethod: ut,
174
176
  onTreeLoadResolved: G,
175
177
  prepareRows: O,
176
178
  toVxeRowConfig: Me
177
179
  }), {
178
180
  onTableKeydown: pe
179
- } = to(v), gt = m(U), ft = mo(l, p, s, {
180
- runDataOperation: Je,
181
+ } = oo(v), ft = m(U), ht = uo(l, p, s, {
182
+ runDataOperation: Qe,
181
183
  clearSelectedRowKeys: se,
182
184
  getTableInstance: U,
183
- isActive: Ze,
185
+ isActive: et,
184
186
  prepareRows: O
185
187
  });
186
- no(h, s.setState, ["tableApi", "formApi", "modelValue"]);
187
- const ht = m(() => ({
188
+ io(h, s.setState, ["tableApi", "formApi", "modelValue"]);
189
+ const yt = m(() => ({
188
190
  ...e(l).emptyImageStyle
189
191
  })), W = m(() => {
190
192
  const {
@@ -194,27 +196,27 @@ const Co = ["data-testid"], wo = ["src"], xo = ["src"], $o = ["src"], To = {
194
196
  } = e(l);
195
197
  return e(ce) || !t ? o : r;
196
198
  }), u = {};
197
- fo.forEach(([t, o]) => {
199
+ ho.forEach(([t, o]) => {
198
200
  u[o] = (...r) => {
199
- t === "data-change" && Xe(), ho(t) && Qe(), yo(t, r, () => e(B)) && G(bo(t)), i(t, ...r);
201
+ t === "data-change" && Ye(), yo(t) && Xe(), bo(t, r, () => e(B)) && G(So(t)), i(t, ...r);
200
202
  };
201
203
  });
202
- const yt = m(() => ({
204
+ const bt = m(() => ({
203
205
  ...u,
204
206
  headerCellClick: Ct,
205
- sortChange: wt,
206
- radioChange: je,
207
- checkboxChange: He,
208
- checkboxAll: Be,
209
- checkboxRangeChange: Ge,
210
- cellAreaSelectionEnd: We,
211
- columnDragend: pt,
212
- scroll: xt,
213
- scrollBoundary: $t,
214
- toggleRowExpand: Tt,
215
- editClosed: Rt
207
+ sortChange: xt,
208
+ radioChange: We,
209
+ checkboxChange: Be,
210
+ checkboxAll: Ge,
211
+ checkboxRangeChange: je,
212
+ cellAreaSelectionEnd: Ue,
213
+ columnDragend: mt,
214
+ scroll: $t,
215
+ scrollBoundary: Tt,
216
+ toggleRowExpand: Rt,
217
+ editClosed: kt
216
218
  }));
217
- async function bt(t) {
219
+ async function St(t) {
218
220
  s.setState(t);
219
221
  }
220
222
  function me() {
@@ -223,7 +225,7 @@ const Co = ["data-testid"], wo = ["src"], xo = ["src"], $o = ["src"], To = {
223
225
  return (t = e(p)) == null ? void 0 : t.recalculate(!0);
224
226
  });
225
227
  }
226
- function St(t, o) {
228
+ function wt(t, o) {
227
229
  if (t) {
228
230
  F.value[o] = t;
229
231
  return;
@@ -244,14 +246,14 @@ const Co = ["data-testid"], wo = ["src"], xo = ["src"], $o = ["src"], To = {
244
246
  ...$e(r, ["order"])
245
247
  });
246
248
  }
247
- function wt(t) {
249
+ function xt(t) {
248
250
  var o;
249
251
  (o = u.sortChange) == null || o.call(u, t), de("sort");
250
252
  }
251
- function xt(t) {
252
- i("scroll", t), ((t == null ? void 0 : t.type) === "body" || (t == null ? void 0 : t.type) === "table") && tt(t == null ? void 0 : t.scrollTop);
253
- }
254
253
  function $t(t) {
254
+ i("scroll", t), ((t == null ? void 0 : t.type) === "body" || (t == null ? void 0 : t.type) === "table") && ot(t == null ? void 0 : t.scrollTop);
255
+ }
256
+ function Tt(t) {
255
257
  i("scroll-boundary", t);
256
258
  const {
257
259
  isScrollFetch: o
@@ -265,52 +267,52 @@ const Co = ["data-testid"], wo = ["src"], xo = ["src"], $o = ["src"], To = {
265
267
  currentPage: r + 1
266
268
  });
267
269
  }
268
- function Tt(t) {
269
- i("toggle-row-expand", t), et(!1);
270
- }
271
270
  function Rt(t) {
271
+ i("toggle-row-expand", t), tt(!1);
272
+ }
273
+ function kt(t) {
272
274
  G(), i("edit-closed", t);
273
275
  }
274
276
  function U() {
275
- return Ye(e(p));
277
+ return Ze(e(p));
276
278
  }
277
- function kt(t) {
279
+ function Pt(t) {
278
280
  return Object.keys(t).filter((o) => o !== "empty");
279
281
  }
280
282
  const _ = {
281
- reload: st,
282
- setProps: bt,
283
- setTableColumns: dt,
283
+ reload: lt,
284
+ setProps: St,
285
+ setTableColumns: ct,
284
286
  setPagination: N,
285
287
  setLoading: re,
286
288
  redoHeight: me,
287
- getDataSource: qe,
289
+ getDataSource: Je,
288
290
  getPagination: _e,
289
- getSelectRowKeys: Ae,
290
- getSelectRows: Fe,
291
+ getSelectRowKeys: Fe,
292
+ getSelectRows: Le,
291
293
  getTableInstance: U,
292
294
  getLoading: x,
293
- getTableColumns: ct,
294
- setSelectedRowKeys: Ne,
295
+ getTableColumns: pt,
296
+ setSelectedRowKeys: Oe,
295
297
  clearSelectedRowKeys: se,
296
298
  selectedKeys: H,
297
299
  selectedRows: B,
298
- ...ft
300
+ ...ht
299
301
  };
300
- return io({
302
+ return co({
301
303
  ..._,
302
304
  wrapRef: v,
303
305
  getBindValues: j
304
306
  }), Te({
305
307
  ..._,
306
- xGrid: gt
308
+ xGrid: ft
307
309
  }), (ge = s.bindState) == null || ge.call(s, {
308
310
  loading: x,
309
311
  selectedKeys: H,
310
312
  selectedRows: B
311
- }), w && i("register", _, `${w.uid}`), J(() => {
313
+ }), C && i("register", _, `${C.uid}`), J(() => {
312
314
  e(l).autoHeight && me();
313
- }), Dt(() => {
315
+ }), Kt(() => {
314
316
  var t;
315
317
  (t = s.mount) == null || t.call(s, e(p), _), J(() => {
316
318
  var o, r;
@@ -326,34 +328,34 @@ const Co = ["data-testid"], wo = ["src"], xo = ["src"], $o = ["src"], To = {
326
328
  "data-testid": Ve.value,
327
329
  onKeydownCapture: o[3] || (o[3] = //@ts-ignore
328
330
  (...r) => e(pe) && e(pe)(...r))
329
- }, [D(e(jt), Q({
331
+ }, [D(e(Wt), Q({
330
332
  ref_key: "xGrid",
331
333
  ref: p
332
- }, e(ut), Mt(yt.value), {
334
+ }, e(gt), Mt(bt.value), {
333
335
  onFilterChange: o[2] || (o[2] = (r) => e(de)())
334
- }), Kt({
335
- empty: n(() => [d(t.$slots, "empty", P(K({
336
+ }), At({
337
+ empty: n(() => [d(t.$slots, "empty", P(M({
336
338
  isLoaded: e(ce),
337
339
  loading: e(x),
338
340
  emptyTip: W.value
339
341
  })), () => [f("div", {
340
342
  class: z(`${e(b)}-empty-image`)
341
- }, [e(x) ? (c(), g("span", ko, Y(l.value.emptyText || ""), 1)) : (c(), g(At, {
343
+ }, [e(x) ? (c(), g("span", Po, Y(l.value.emptyText || ""), 1)) : (c(), g(Ft, {
342
344
  key: 0
343
- }, [D(e(Qt), {
344
- style: y(ht.value),
345
+ }, [D(e(Xt), {
346
+ style: y(yt.value),
345
347
  status: l.value.emptyImageStatus
346
- }, null, 8, ["style", "status"]), W.value ? (c(), g("span", Ro, Y(W.value), 1)) : M("", !0)], 64))], 2)])]),
347
- left: n(() => [d(t.$slots, "left", {}, () => [e(C) ? (c(), X(e(we), {
348
+ }, null, 8, ["style", "status"]), W.value ? (c(), g("span", ko, Y(W.value), 1)) : K("", !0)], 64))], 2)])]),
349
+ left: n(() => [d(t.$slots, "left", {}, () => [e(w) ? (c(), X(e(Ce), {
348
350
  key: 0,
349
351
  ref_key: "leftScrollbarRef",
350
- ref: ot,
352
+ ref: rt,
351
353
  "wrap-class": "overflow-hidden",
352
354
  class: "tt-table-left-right-scroll",
353
- height: `${e(C)}px`,
355
+ height: `${e(w)}px`,
354
356
  style: y({
355
357
  width: `${l.value.leftSlotWidth}px`,
356
- height: `${e(C)}px`,
358
+ height: `${e(w)}px`,
357
359
  marginTop: `${e(ae)}px`
358
360
  })
359
361
  }, {
@@ -369,23 +371,23 @@ const Co = ["data-testid"], wo = ["src"], xo = ["src"], $o = ["src"], To = {
369
371
  height: `${e(E)}px`,
370
372
  marginTop: `${e(ne)}px`
371
373
  })
372
- }, [d(t.$slots, "tableLeft", P(K({
374
+ }, [d(t.$slots, "tableLeft", P(M({
373
375
  rowNodes: e(le),
374
376
  height: e(E)
375
377
  })))], 4)]),
376
378
  _: 3
377
- }, 8, ["height", "style"])) : M("", !0)])]),
378
- right: n(() => [d(t.$slots, "right", {}, () => [e(C) ? (c(), X(e(we), {
379
+ }, 8, ["height", "style"])) : K("", !0)])]),
380
+ right: n(() => [d(t.$slots, "right", {}, () => [e(w) ? (c(), X(e(Ce), {
379
381
  key: 0,
380
382
  ref_key: "rightScrollbarRef",
381
- ref: rt,
383
+ ref: st,
382
384
  "wrap-class": "overflow-hidden",
383
385
  class: "tt-table-left-right-scroll",
384
386
  always: "",
385
- height: `${e(C)}px`,
387
+ height: `${e(w)}px`,
386
388
  style: y({
387
389
  width: `${l.value.rightSlotWidth}px`,
388
- height: `${e(C)}px`,
390
+ height: `${e(w)}px`,
389
391
  marginTop: `${e(ae)}px`
390
392
  })
391
393
  }, {
@@ -401,14 +403,14 @@ const Co = ["data-testid"], wo = ["src"], xo = ["src"], $o = ["src"], To = {
401
403
  height: `${e(E)}px`,
402
404
  marginTop: `${e(ne)}px`
403
405
  })
404
- }, [d(t.$slots, "tableRight", P(K({
406
+ }, [d(t.$slots, "tableRight", P(M({
405
407
  rowNodes: e(le),
406
408
  height: e(E)
407
409
  })))], 4)]),
408
410
  _: 3
409
- }, 8, ["height", "style"])) : M("", !0)])]),
411
+ }, 8, ["height", "style"])) : K("", !0)])]),
410
412
  _: 2
411
- }, [Z(e(nt), (r) => ({
413
+ }, [Z(e(it), (r) => ({
412
414
  name: r,
413
415
  fn: n(({
414
416
  column: a
@@ -419,17 +421,17 @@ const Co = ["data-testid"], wo = ["src"], xo = ["src"], $o = ["src"], To = {
419
421
  }])
420
422
  }, [a.order === "asc" ? (c(), g("img", {
421
423
  key: 0,
422
- src: e(Jt)
423
- }, null, 8, wo)) : a.order === "desc" ? (c(), g("img", {
424
+ src: e(Qt)
425
+ }, null, 8, xo)) : a.order === "desc" ? (c(), g("img", {
424
426
  key: 1,
425
- src: e(Ut)
426
- }, null, 8, xo)) : (c(), g("img", {
427
- key: 2,
428
427
  src: e(qt)
429
- }, null, 8, $o))], 2)])
430
- })), Z(kt(t.$slots), (r) => ({
428
+ }, null, 8, $o)) : (c(), g("img", {
429
+ key: 2,
430
+ src: e(Jt)
431
+ }, null, 8, To))], 2)])
432
+ })), Z(Pt(t.$slots), (r) => ({
431
433
  name: r,
432
- fn: n((a) => [r.includes("action") ? (c(), X(e(Xt), {
434
+ fn: n((a) => [r.includes("action") ? (c(), X(e(Yt), {
433
435
  key: 0,
434
436
  "row-index": a.$rowIndex
435
437
  }, {
@@ -444,7 +446,7 @@ const Co = ["data-testid"], wo = ["src"], xo = ["src"], $o = ["src"], To = {
444
446
  name: "top",
445
447
  fn: n(() => [f("div", {
446
448
  class: z(`${e(b)}-top-alert`)
447
- }, [o[4] || (o[4] = Ce(" 已选中 ", -1)), f("span", To, Y(e(Ke).length), 1), o[5] || (o[5] = Ce(" 条 ", -1)), d(t.$slots, "top_title")], 2)]),
449
+ }, [o[4] || (o[4] = we(" 已选中 ", -1)), f("span", Ro, Y(e(Ae).length), 1), o[5] || (o[5] = we(" 条 ", -1)), d(t.$slots, "top_title")], 2)]),
448
450
  key: "0"
449
451
  } : void 0, e(A).toolbar_buttons ? {
450
452
  name: "toolbar_buttons",
@@ -454,7 +456,7 @@ const Co = ["data-testid"], wo = ["src"], xo = ["src"], $o = ["src"], To = {
454
456
  name: "toolbar_tools",
455
457
  fn: n(() => [d(t.$slots, "toolbar_tools")]),
456
458
  key: "2"
457
- } : void 0, Z(e(it), (r) => ({
459
+ } : void 0, Z(e(dt), (r) => ({
458
460
  name: r,
459
461
  fn: n(({
460
462
  content: a,
@@ -464,18 +466,18 @@ const Co = ["data-testid"], wo = ["src"], xo = ["src"], $o = ["src"], To = {
464
466
  fixed: fe
465
467
  }) => [!fe || fe === k.fixed ? (c(), g("div", {
466
468
  key: 0,
467
- ref: (Pt) => St(Pt, `valid_${T}_${R}`),
469
+ ref: (vt) => wt(vt, `valid_${T}_${R}`),
468
470
  class: "h-full w-full"
469
- }, [D(e(Lt), {
471
+ }, [D(e(Nt), {
470
472
  placement: l.value.toolTipErrorPlacement,
471
473
  "err-msg": a,
472
474
  "ref-dom": F.value[`valid_${T}_${R}`]
473
- }, null, 8, ["placement", "err-msg", "ref-dom"])], 512)) : M("", !0)])
475
+ }, null, 8, ["placement", "err-msg", "ref-dom"])], 512)) : K("", !0)])
474
476
  })), e(j).showPager ? {
475
477
  name: "pager",
476
478
  fn: n(() => {
477
479
  var r, a, T, R;
478
- return [D(e(Gt), {
480
+ return [D(e(jt), {
479
481
  "current-page": e($).currentPage,
480
482
  "onUpdate:currentPage": o[0] || (o[0] = (k) => e($).currentPage = k),
481
483
  "page-size": e($).pageSize,
@@ -487,7 +489,7 @@ const Co = ["data-testid"], wo = ["src"], xo = ["src"], $o = ["src"], To = {
487
489
  "class-name": `${e(b)}-vxe-pager`,
488
490
  onPageChange: e(ze)
489
491
  }, {
490
- left: n(() => [d(t.$slots, "pager_left", P(K({
492
+ left: n(() => [d(t.$slots, "pager_left", P(M({
491
493
  selectedKeys: e(H)
492
494
  }))), d(t.$slots, "buttom_left")]),
493
495
  _: 3
@@ -498,5 +500,5 @@ const Co = ["data-testid"], wo = ["src"], xo = ["src"], $o = ["src"], To = {
498
500
  }
499
501
  });
500
502
  export {
501
- Sr as default
503
+ wr as default
502
504
  };
@@ -16,6 +16,7 @@ type RowConfig = VxeTablePropTypes.RowConfig<Recordable>;
16
16
  */
17
17
  export declare function useRowIdentity(propsRef: ComputedRef<TtTableProps>): {
18
18
  getRowKey: (row: Recordable) => RowKey | undefined;
19
+ getRowKeys: (rows: Recordable[]) => (RowKey | undefined)[];
19
20
  prepareRows: (records: Recordable | Recordable[]) => void;
20
21
  toVxeRowConfig: (rowConfig?: RowConfig) => RowConfig;
21
22
  };
@@ -1,7 +1,7 @@
1
1
  import "axios";
2
2
  import "element-plus";
3
- import { isObject as F, isFunction as x, isArray as _, isNumber as B, isString as E } from "../../../../packages/utils/src/is.js";
4
- import { getCurrentInstance as W, unref as a, toRaw as C } from "vue";
3
+ import { isObject as _, isFunction as E, isArray as C, isNumber as W, isString as $ } from "../../../../packages/utils/src/is.js";
4
+ import { getCurrentInstance as q, unref as s, toRaw as P } from "vue";
5
5
  import "dayjs";
6
6
  import "numeral";
7
7
  import "xe-utils";
@@ -12,86 +12,99 @@ import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/ae
12
12
  import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/enc-utf8.js";
13
13
  import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-ecb.js";
14
14
  import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-pkcs7.js";
15
- import { get as l } from "lodash-es";
16
- const y = "__tt_table_internal_row_key__";
17
- function c(o) {
18
- return B(o) ? !0 : E(o) && !!o;
15
+ import { get as S } from "lodash-es";
16
+ const l = "__tt_table_internal_row_key__";
17
+ function c(r) {
18
+ return W(r) ? !0 : $(r) && !!r;
19
19
  }
20
- function Y(o) {
20
+ function A(r) {
21
+ return r.includes(".") || r.includes("[");
22
+ }
23
+ function O(r, d) {
24
+ return A(d) ? S(r, d) : r[d];
25
+ }
26
+ function ne(r) {
21
27
  var v;
22
- const P = ((v = W()) == null ? void 0 : v.uid) || 0;
23
- let m = 0;
28
+ const d = ((v = q()) == null ? void 0 : v.uid) || 0;
29
+ let w = 0;
24
30
  const K = /* @__PURE__ */ new WeakSet();
25
- function w() {
26
- return a(o).tableRowId || "id";
31
+ function f() {
32
+ return s(r).tableRowId || "id";
27
33
  }
28
- function p(e) {
29
- const t = l(e, w());
30
- return c(t) ? t : void 0;
34
+ function p(e, t = f()) {
35
+ const n = O(e, t);
36
+ return c(n) ? n : void 0;
31
37
  }
32
38
  function g(e) {
33
- const t = Reflect.get(e, y);
39
+ const t = Reflect.get(e, l);
34
40
  return c(t) ? t : void 0;
35
41
  }
36
- function O() {
37
- return m += 1, `tt_row_${P}_${m}`;
42
+ function j() {
43
+ return w += 1, `tt_row_${d}_${w}`;
38
44
  }
39
- function S(e, t) {
40
- const r = C(e), n = Object.getOwnPropertyDescriptor(r, y), i = n && c(n.value) ? n.value : t;
41
- if (n && !n.enumerable && c(n.value)) return i;
45
+ function I(e, t) {
46
+ const n = P(e), i = Object.getOwnPropertyDescriptor(n, l), o = i && c(i.value) ? i.value : t;
47
+ if (i && !i.enumerable && c(i.value)) return o;
42
48
  try {
43
- Object.defineProperty(r, y, {
49
+ Object.defineProperty(n, l, {
44
50
  configurable: !0,
45
51
  enumerable: !1,
46
- value: i,
52
+ value: o,
47
53
  writable: !0
48
54
  });
49
55
  } catch {
50
- K.has(r) || K.add(r);
56
+ K.has(n) || K.add(n);
51
57
  }
52
- return i;
58
+ return o;
53
59
  }
54
- function f({ row: e }) {
55
- var d;
60
+ function m({ row: e }) {
61
+ var y;
56
62
  const t = g(e);
57
63
  if (c(t)) return t;
58
- const r = (d = a(o).rowConfig) == null ? void 0 : d.createKeyMethod, n = x(r) ? r({ row: e, keyField: w() }) : void 0, i = p(e), u = c(n) ? n : c(i) ? i : O();
59
- return S(e, u);
64
+ const n = (y = s(r).rowConfig) == null ? void 0 : y.createKeyMethod, i = E(n) ? n({ row: e, keyField: f() }) : void 0, o = p(e), u = c(i) ? i : c(o) ? o : j();
65
+ return I(e, u);
60
66
  }
61
- function j(e = {}) {
67
+ function M(e = {}) {
62
68
  return e.keyField ? e : {
63
69
  ...e,
64
- keyField: y,
65
- createKeyMethod: f
70
+ keyField: l,
71
+ createKeyMethod: m
66
72
  };
67
73
  }
68
- function I(e) {
69
- var i;
70
- const t = p(e);
71
- if (c(t)) return t;
72
- const r = (i = a(o).rowConfig) == null ? void 0 : i.keyField;
73
- if (r) {
74
- const u = l(e, r);
74
+ function R(e, t, n) {
75
+ const i = p(e, t);
76
+ if (c(i)) return i;
77
+ if (n) {
78
+ const u = O(e, n);
75
79
  return c(u) ? u : void 0;
76
80
  }
77
- const n = g(e);
78
- return c(n) ? n : f({ row: e });
81
+ const o = g(e);
82
+ return c(o) ? o : m({ row: e });
83
+ }
84
+ function x(e) {
85
+ var t;
86
+ return R(e, f(), (t = s(r).rowConfig) == null ? void 0 : t.keyField);
87
+ }
88
+ function B(e) {
89
+ var i;
90
+ const t = f(), n = (i = s(r).rowConfig) == null ? void 0 : i.keyField;
91
+ return e.map((o) => R(o, t, n));
79
92
  }
80
- function M(e) {
81
- var u, d, R;
82
- if ((u = a(o).rowConfig) != null && u.keyField) return;
83
- const t = _(e) ? e : [e], r = /* @__PURE__ */ new WeakSet(), n = ((d = a(o).treeConfig) == null ? void 0 : d.childrenField) || ((R = a(o).treeConfig) == null ? void 0 : R.children) || "children";
84
- function i(s) {
85
- const b = C(s);
86
- if (r.has(b)) return;
87
- r.add(b), f({ row: s });
88
- const h = l(s, n);
89
- _(h) && h.forEach((k) => F(k) && i(k));
93
+ function D(e) {
94
+ var u, y, F;
95
+ if ((u = s(r).rowConfig) != null && u.keyField) return;
96
+ const t = C(e) ? e : [e], n = /* @__PURE__ */ new WeakSet(), i = ((y = s(r).treeConfig) == null ? void 0 : y.childrenField) || ((F = s(r).treeConfig) == null ? void 0 : F.children) || "children";
97
+ function o(a) {
98
+ const k = P(a);
99
+ if (n.has(k)) return;
100
+ n.add(k), m({ row: a });
101
+ const b = S(a, i);
102
+ C(b) && b.forEach((h) => _(h) && o(h));
90
103
  }
91
- t.forEach((s) => F(s) && i(s));
104
+ t.forEach((a) => _(a) && o(a));
92
105
  }
93
- return { getRowKey: I, prepareRows: M, toVxeRowConfig: j };
106
+ return { getRowKey: x, getRowKeys: B, prepareRows: D, toVxeRowConfig: M };
94
107
  }
95
108
  export {
96
- Y as useRowIdentity
109
+ ne as useRowIdentity
97
110
  };
@@ -15,6 +15,8 @@ type SelectionEmit = {
15
15
  type RowSelectionIdentity = {
16
16
  /** 获取业务兼容的行主键。 */
17
17
  getRowKey: (row: Recordable) => number | string | undefined;
18
+ /** 批量获取行主键,配置只解析一次。 */
19
+ getRowKeys: (rows: Recordable[]) => Array<number | string | undefined>;
18
20
  };
19
21
  /**
20
22
  * 行选择状态(复选框、单选框、区域选择)
@@ -25,7 +27,7 @@ type RowSelectionIdentity = {
25
27
  */
26
28
  export declare function useRowSelection(propsRef: ComputedRef<TtTableProps>, grid: Ref<undefined | VxeGridInstance<Recordable>>, emit: SelectionEmit, identity: RowSelectionIdentity): {
27
29
  selectedKeys: Ref<any, any>;
28
- selectedRows: Ref<any, any>;
30
+ selectedRows: import('vue').ShallowRef<any, any>;
29
31
  selectedKeyList: ComputedRef<(string | number)[]>;
30
32
  getSelectRowKeys: () => any;
31
33
  getSelectRows: () => TtSelectRowsType;
@@ -1,8 +1,8 @@
1
- import { GlobalConfig as M } from "../../../../hooks/useSetup.js";
1
+ import { GlobalConfig as _ } from "../../../../hooks/useSetup.js";
2
2
  import "axios";
3
3
  import "element-plus";
4
- import { isArray as m } from "../../../../packages/utils/src/is.js";
5
- import { ref as S, computed as P, unref as t, toValue as V, nextTick as $ } from "vue";
4
+ import { isArray as S } from "../../../../packages/utils/src/is.js";
5
+ import { ref as $, shallowRef as j, computed as q, unref as t, toValue as z, nextTick as H } from "vue";
6
6
  import "dayjs";
7
7
  import "numeral";
8
8
  import "xe-utils";
@@ -14,96 +14,97 @@ import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/en
14
14
  import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-ecb.js";
15
15
  import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-pkcs7.js";
16
16
  import "lodash-es";
17
- function oe(R, r, i, d) {
18
- const { getRowKey: h } = d, a = S([]), k = S([]), K = P(() => {
19
- const { showCheckbox: e, showRadio: o } = t(R), c = V(a);
20
- return e ? c || [] : o ? c ? [c] : [] : [];
17
+ function re(f, s, i, A) {
18
+ const { getRowKey: K, getRowKeys: b } = A, l = $([]), k = j([]), B = q(() => {
19
+ const { showCheckbox: e, showRadio: o } = t(f), n = z(l);
20
+ return e ? n || [] : o ? n ? [n] : [] : [];
21
21
  });
22
22
  function x() {
23
- return t(a);
23
+ return t(l);
24
24
  }
25
- function v() {
26
- var n, s, w;
27
- const { showCheckbox: e, showRadio: o, reserveSelection: c } = t(R);
25
+ function y() {
26
+ var c, r, a;
27
+ const { showCheckbox: e, showRadio: o, reserveSelection: n } = t(f);
28
28
  if (e) {
29
- const C = ((n = t(r)) == null ? void 0 : n.getCheckboxRecords(!0)) || [];
30
- if (!c) return C;
31
- const g = ((s = t(r)) == null ? void 0 : s.getCheckboxReserveRecords(!0)) || [], f = /* @__PURE__ */ new Map();
32
- return C.forEach((l) => f.set(h(l), l)), g.forEach((l) => {
33
- const b = h(l);
34
- f.has(b) || f.set(b, l);
35
- }), [...f.values()];
29
+ const u = ((c = t(s)) == null ? void 0 : c.getCheckboxRecords(!0)) || [];
30
+ if (!n) return u;
31
+ const C = ((r = t(s)) == null ? void 0 : r.getCheckboxReserveRecords(!0)) || [];
32
+ if (!C.length) return u;
33
+ const w = /* @__PURE__ */ new Map(), m = b(u), g = b(C);
34
+ return u.forEach((R, v) => w.set(m[v], R)), C.forEach((R, v) => {
35
+ w.has(g[v]) || w.set(g[v], R);
36
+ }), [...w.values()];
36
37
  }
37
- return o ? (w = t(r)) == null ? void 0 : w.getRadioRecord(!0) : [];
38
+ return o ? (a = t(s)) == null ? void 0 : a.getRadioRecord(!0) : [];
38
39
  }
39
- function A() {
40
+ function E() {
40
41
  var e;
41
- return ((e = t(r)) == null ? void 0 : e.getTableData().fullData) || [];
42
+ return ((e = t(s)) == null ? void 0 : e.getTableData().fullData) || [];
42
43
  }
43
- function u(e) {
44
- const o = v();
45
- k.value = o, a.value = m(o) ? o.map((c) => h(c)) : o ? h(o) : void 0, i("selection-change", { keys: x(), rows: o, data: e });
44
+ function h(e) {
45
+ const o = y();
46
+ k.value = o, l.value = S(o) ? b(o) : o ? K(o) : void 0, i("selection-change", { keys: x(), rows: o, data: e });
46
47
  }
47
- const B = (e) => {
48
- u(e), i("checkbox-change", e);
49
- }, E = (e) => {
50
- u(e), i("checkbox-all", e);
51
- }, y = (e) => {
48
+ const T = (e) => {
49
+ h(e), i("checkbox-change", e);
50
+ }, D = (e) => {
51
+ h(e), i("checkbox-all", e);
52
+ }, d = (e) => {
52
53
  var o;
53
- i("checkbox-range-change", e), ((o = e.records) == null ? void 0 : o.length) !== 1 && u(e);
54
+ i("checkbox-range-change", e), ((o = e.records) == null ? void 0 : o.length) !== 1 && h(e);
54
55
  };
55
- function T(e) {
56
- k.value = e.row, a.value = e.row ? h(e.row) : void 0, i("radio-change", e), i("selection-change", { keys: x(), rows: v(), data: e });
56
+ function P(e) {
57
+ k.value = e.row, l.value = e.row ? K(e.row) : void 0, i("radio-change", e), i("selection-change", { keys: x(), rows: y(), data: e });
57
58
  }
58
- async function D(e) {
59
- const { rows: o, cols: c } = e;
59
+ async function F(e) {
60
+ const { rows: o, cols: n } = e;
60
61
  if (o.length === 1) return;
61
- const n = t(r);
62
- !n || !c.some((s) => s.type === "checkbox") || (await n.setCheckboxRow(o, !n.isCheckedByCheckboxRow(o[0])), u(e));
62
+ const c = t(s);
63
+ !c || !n.some((r) => r.type === "checkbox") || (await c.setCheckboxRow(o, !c.isCheckedByCheckboxRow(o[0])), h(e));
63
64
  }
64
- const F = (e) => {
65
- var n;
66
- const { checkboxConfig: o, showCheckbox: c } = t(R);
67
- o != null && o.range && c ? y({ records: e.rows }) : (n = M.table) != null && n.isAreaCheckboxSelection && D(e), i("cell-area-selection-end", e);
65
+ const G = (e) => {
66
+ var c;
67
+ const { checkboxConfig: o, showCheckbox: n } = t(f);
68
+ o != null && o.range && n ? d({ records: e.rows }) : (c = _.table) != null && c.isAreaCheckboxSelection && F(e), i("cell-area-selection-end", e);
68
69
  };
69
- async function G(e, o = []) {
70
- var f, l;
71
- const { showCheckbox: c, showRadio: n } = t(R), s = m(e) ? e : e ? [e] : [], w = /* @__PURE__ */ new Set([
72
- ...s.map((b) => h(b)),
73
- ...m(o) ? o : o == null ? [] : [o]
74
- ]), C = A().filter((b) => w.has(h(b))), g = C.length ? C : s;
75
- c && await ((f = t(r)) == null ? void 0 : f.setCheckboxRow(g, !0)), n && await ((l = t(r)) == null ? void 0 : l.setRadioRow(g[0])), await $(), u();
70
+ async function L(e, o = []) {
71
+ var g, R;
72
+ const { showCheckbox: n, showRadio: c } = t(f), r = S(e) ? e : e ? [e] : [], a = /* @__PURE__ */ new Set([
73
+ ...b(r),
74
+ ...S(o) ? o : o == null ? [] : [o]
75
+ ]), u = E(), C = b(u), w = u.filter((v, V) => a.has(C[V])), m = w.length ? w : r;
76
+ n && await ((g = t(s)) == null ? void 0 : g.setCheckboxRow(m, !0)), c && await ((R = t(s)) == null ? void 0 : R.setRadioRow(m[0])), await H(), h();
76
77
  }
77
78
  function p() {
78
- var n, s, w;
79
- const { showCheckbox: e, showRadio: o, reserveSelection: c } = t(R);
80
- !e && !o || (e && (a.value = [], k.value = [], (n = t(r)) == null || n.clearCheckboxRow(), c && ((s = t(r)) == null || s.clearCheckboxReserve())), o && (a.value = void 0, k.value = void 0, (w = t(r)) == null || w.clearRadioRow()), i("selection-change", { keys: x(), rows: v() }));
79
+ var c, r, a;
80
+ const { showCheckbox: e, showRadio: o, reserveSelection: n } = t(f);
81
+ !e && !o || (e && (l.value = [], k.value = [], (c = t(s)) == null || c.clearCheckboxRow(), n && ((r = t(s)) == null || r.clearCheckboxReserve())), o && (l.value = void 0, k.value = void 0, (a = t(s)) == null || a.clearRadioRow()), i("selection-change", { keys: x(), rows: y() }));
81
82
  }
82
- function L() {
83
- const { showCheckbox: e, reserveSelection: o } = t(R);
83
+ function M() {
84
+ const { showCheckbox: e, reserveSelection: o } = t(f);
84
85
  if (!e || !o) {
85
86
  p();
86
87
  return;
87
88
  }
88
- u();
89
+ h();
89
90
  }
90
91
  return {
91
- selectedKeys: a,
92
+ selectedKeys: l,
92
93
  selectedRows: k,
93
- selectedKeyList: K,
94
+ selectedKeyList: B,
94
95
  getSelectRowKeys: x,
95
- getSelectRows: v,
96
- syncSelection: u,
97
- setSelectedRowKeys: G,
96
+ getSelectRows: y,
97
+ syncSelection: h,
98
+ setSelectedRowKeys: L,
98
99
  clearSelectedRowKeys: p,
99
- resetSelectionAfterFetch: L,
100
- onCheckboxChange: B,
101
- onCheckboxAll: E,
102
- onCheckboxRangeChange: y,
103
- onRadioChange: T,
104
- onCellAreaSelectionEnd: F
100
+ resetSelectionAfterFetch: M,
101
+ onCheckboxChange: T,
102
+ onCheckboxAll: D,
103
+ onCheckboxRangeChange: d,
104
+ onRadioChange: P,
105
+ onCellAreaSelectionEnd: G
105
106
  };
106
107
  }
107
108
  export {
108
- oe as useRowSelection
109
+ re as useRowSelection
109
110
  };
@@ -34,12 +34,12 @@ export type TtUseTableRenderReturnType<Row = any> = [
34
34
  *
35
35
  * 返回 [FormTable 组件, TableFormApi API]。
36
36
  *
37
- * `options` `NoInfer` 包裹,`Row` 不再从传入的配置反向推断。业务常见写法是在
38
- * `form.schemas` 的回调里引用解构出来的 api
39
- * `const [FormTable, api] = useTableFormRender({ form: { schemas: [{ onChange: () => f(api) }] } })`,
40
- * `Row` `options` 推断,则 api 的类型依赖 options、options 又引用 api,TS 判定为循环,
41
- * 整个变量退化成隐式 any 并报 TS7022/TS7023。代价是需要显式写
42
- * `useTableFormRender<Row>({ ... })` 才能拿到行类型推断,不写则为 `any`。
37
+ * `options` 的类型不含 `Row`,`Row` 只出现在返回类型上。这是为了打断业务常见写法里的循环推断:
38
+ * `const [FormTable, api] = useTableFormRender({ form: { schemas: [{ onChange: () => f(api) }] } })`
39
+ * `api` 的类型来自返回值,而实参字面量里的回调又引用 `api`。只要参数类型带 `Row`,
40
+ * TS 就必须先检查实参才能定下返回类型,于是判定为循环并把 `api` 退化成隐式 any(TS7022/TS7023)。
41
+ * `NoInfer` 只能阻止推断、阻止不了这次实参检查,所以这里直接让参数与 `Row` 解耦。
42
+ * 需要行类型时显式写 `useTableFormRender<Row>({ ... })`,不写则为 `any`。
43
43
  *
44
44
  * @param options 表格渲染配置项
45
45
  * @returns [FormTable组件, TableFormApi API]
@@ -61,16 +61,16 @@ export type TtUseTableRenderReturnType<Row = any> = [
61
61
  * // 在模板中使用
62
62
  * <FormTable />
63
63
  */
64
- export declare function useTableFormRender<Row = any>(options: NoInfer<TtTableFormProps<Row>>): TtUseTableFormRenderReturnType<Row>;
64
+ export declare function useTableFormRender<Row = any>(options: TtTableFormProps<any>): TtUseTableFormRenderReturnType<Row>;
65
65
  /**
66
66
  * 用于渲染表格的 hooks,返回 [TableRender 组件, 表格API]。
67
67
  *
68
68
  * options 只接受表格配置;单向数据使用 data,双向数据绑定到返回的 TableRender 组件。
69
69
  *
70
- * `options` `NoInfer` 包裹,`Row` 不从配置反向推断。业务常见写法是初始化时给 `data: []`,
71
- * `Row` 从空数组推断会退化成 `never`,组件的 `data` prop 类型变成 `MaybeRef<never[]>`,
72
- * 之后传入任何具体行类型都会报 TS2322。代价是需要显式写 `useTableRender<Row>({ ... })`
73
- * 才能拿到行类型推断,不写则为 `any`。
70
+ * `options` 的类型不含 `Row`,与 `useTableFormRender` 保持一致:`Row` 参与参数类型时,
71
+ * 业务写 `useTableRender({ data: [], columns: [...] })` 会让 `Row` 从空数组推断成 `never`,
72
+ * 组件的 `data` prop 类型退化为 `MaybeRef<never[]>`,之后传入任何具体行类型都报 TS2322。
73
+ * 需要行类型时显式写 `useTableRender<Row>({ ... })`,不写则为 `any`。
74
74
  *
75
75
  * @param options 表格渲染配置项
76
76
  * @returns [TableRender组件, 表格API]
@@ -91,5 +91,5 @@ export declare function useTableFormRender<Row = any>(options: NoInfer<TtTableFo
91
91
  * // 在模板中使用
92
92
  * <TableRender />
93
93
  */
94
- export declare function useTableRender<Row = any>(options: NoInfer<TtTableProps<Row>>): TtUseTableRenderReturnType<Row>;
94
+ export declare function useTableRender<Row = any>(options: TtTableProps<any>): TtUseTableRenderReturnType<Row>;
95
95
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dazhicheng/ui",
3
- "version": "1.6.1",
3
+ "version": "1.6.2",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",