@dazhicheng/ui 1.6.18 → 1.6.20

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 (27) hide show
  1. package/dist/components/tt-form/index.d.ts +2 -2
  2. package/dist/components/tt-form/src/formApi.d.ts +11 -2
  3. package/dist/components/tt-form/src/group-form/LazyFormField.vue.js +162 -114
  4. package/dist/components/tt-form/src/group-form/groupFormApi.js +8 -14
  5. package/dist/components/tt-form/src/group-form/lazyContext.d.ts +18 -0
  6. package/dist/components/tt-form/src/group-form/lazyContext.js +64 -36
  7. package/dist/components/tt-form/src/group-form/types.d.ts +39 -6
  8. package/dist/components/tt-form/src/group-form/useGroupForm.d.ts +7 -5
  9. package/dist/components/tt-form/src/types.d.ts +58 -26
  10. package/dist/components/tt-form/src/useForm.d.ts +1 -1
  11. package/dist/components/tt-form/src/useForm.js +5 -5
  12. package/dist/components/tt-modal-form/props.d.ts +9 -4
  13. package/dist/components/tt-modal-form/useModalForm.d.ts +1 -1
  14. package/dist/components/tt-table/index.d.ts +15 -0
  15. package/dist/components/tt-table/src/Table.vue.d.ts +9 -0
  16. package/dist/components/tt-table/src/Table.vue.js +240 -242
  17. package/dist/components/tt-table/src/TableForm.vue.d.ts +15 -4
  18. package/dist/components/tt-table/src/TableForm.vue.js +232 -202
  19. package/dist/components/tt-table/src/hooks/usePagination.d.ts +1 -1
  20. package/dist/components/tt-table/src/hooks/usePagination.js +38 -24
  21. package/dist/components/tt-table/src/hooks/useTableRender.d.ts +4 -4
  22. package/dist/components/tt-table/src/props.d.ts +12 -1
  23. package/dist/components/tt-table/src/props.js +14 -4
  24. package/dist/components/tt-table/src/types/table.d.ts +8 -0
  25. package/dist/components/tt-table/src/types/tableForm.d.ts +44 -10
  26. package/dist/components/tt-table/src/utils/table-form-api.d.ts +11 -11
  27. package/package.json +1 -1
@@ -1,17 +1,17 @@
1
- import { defineComponent as _e, useSlots as Ie, getCurrentInstance as De, ref as Ve, shallowReactive as Ke, onScopeDispose as Y, computed as u, unref as r, shallowRef as ke, toRaw as P, watch as w, toValue as S, onMounted as Be, nextTick as Z, createElementBlock as ee, openBlock as te, normalizeClass as V, createCommentVNode as He, createElementVNode as Le, createVNode as M, renderSlot as l, createSlots as K, renderList as oe, withCtx as g, normalizeProps as re, guardReactiveProps as ie, mergeProps as se, toHandlers as ze, isRef as xe } from "vue";
1
+ import { defineComponent as ke, useSlots as He, getCurrentInstance as Le, ref as ze, shallowReactive as je, onScopeDispose as ee, computed as b, unref as r, shallowRef as xe, toRaw as M, watch as S, toValue as y, onMounted as Ne, nextTick as te, createElementBlock as oe, openBlock as re, normalizeClass as K, createCommentVNode as We, createElementVNode as Ge, createVNode as O, renderSlot as l, createSlots as k, renderList as ae, withCtx as g, normalizeProps as ie, guardReactiveProps as se, mergeProps as ne, toHandlers as Je, isRef as qe } from "vue";
2
2
  import "../../tt-button/index.js";
3
3
  import "../../tt-checkbox/index.js";
4
4
  import "../../tt-empty/index.js";
5
5
  import "axios";
6
6
  import "element-plus";
7
- import { isFunction as je } from "../../../packages/utils/src/is.js";
7
+ import { isFunction as le, isObject as Qe } from "../../../packages/utils/src/is.js";
8
8
  import "dayjs";
9
9
  import "numeral";
10
- import { extractResourceFromApi as Ne, generateTestId as O } from "../../../packages/utils/src/testid-helper.js";
10
+ import { extractResourceFromApi as Ue, generateTestId as D } from "../../../packages/utils/src/testid-helper.js";
11
11
  import "xe-utils";
12
12
  import "dayjs/plugin/utc";
13
13
  import "dayjs/plugin/timezone";
14
- import { mergeWithArrayOverride as We } from "../../../packages/utils/src/merge.js";
14
+ import { mergeWithArrayOverride as Xe } from "../../../packages/utils/src/merge.js";
15
15
  import "../../../node_modules/.pnpm/decimal.js@10.6.0/node_modules/decimal.js/decimal.js";
16
16
  import "../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/aes.js";
17
17
  import "../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/enc-utf8.js";
@@ -25,16 +25,16 @@ import "../../tt-upload/index.js";
25
25
  import "../../tt-api-component/index.js";
26
26
  import "vee-validate";
27
27
  import "../../../utils/uppercaseInput.js";
28
- import { useForm as Je } from "../../tt-form/src/useForm.js";
28
+ import { useForm as Ye } from "../../tt-form/src/useForm.js";
29
29
  import "zod";
30
30
  import "@vee-validate/zod";
31
- import { useStore as qe } from "@tanstack/vue-store";
31
+ import { useStore as Ze } from "@tanstack/vue-store";
32
32
  import "es-toolkit/compat";
33
33
  import "../../tt-form/src/shared/zod-defaults.js";
34
34
  import "../../tt-nav-anchor/index.js";
35
35
  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";
36
- import { useDesign as Ge } from "../../../packages/hooks/src/useDesign.js";
37
- import { useDebounceFn as v } from "../../../packages/hooks/src/useDebounce.js";
36
+ import { useDesign as et } from "../../../packages/hooks/src/useDesign.js";
37
+ import { useDebounceFn as F } from "../../../packages/hooks/src/useDebounce.js";
38
38
  import "vue-router";
39
39
  import "../../tt-icon/index.js";
40
40
  import "../../tt-form/src/components/Slot.js";
@@ -50,7 +50,7 @@ import "../../tt-drawer/index.js";
50
50
  import "../../tt-modal/index.js";
51
51
  import "../../tt-text/index.js";
52
52
  import "../../../directives/disabled-tip/index.js";
53
- import { GlobalConfig as Qe } from "../../../hooks/useSetup.js";
53
+ import { GlobalConfig as tt } from "../../../hooks/useSetup.js";
54
54
  import "../../tt-log/index.js";
55
55
  /* empty css */
56
56
  /* empty css */
@@ -61,25 +61,25 @@ import "../../tt-log/index.js";
61
61
  import "../../tt-loading/index.js";
62
62
  import "../index.js";
63
63
  import "../../../hooks/basicDataCodes.js";
64
- import { useTemplateSlot as ae } from "../../../hooks/useTemplateSlot.js";
65
- import Ue from "./components/TableColumnModal.vue2.js";
64
+ import { useTemplateSlot as me } from "../../../hooks/useTemplateSlot.js";
65
+ import ot from "./components/TableColumnModal.vue2.js";
66
66
  /* empty css */
67
- import Xe from "./components/TableToolbarTools.vue.js";
68
- import { basicTableEmits as Ye } from "./emits.js";
69
- import { useColumnPersistence as Ze } from "./hooks/useColumnPersistence.js";
70
- import { createTableFormContext as et } from "./hooks/useTableContext.js";
71
- import { useTableForm as tt } from "./hooks/useTableForm.js";
72
- import { useSyncProps as ot } from "./hooks/useSyncProps.js";
73
- import { tableFormProps as rt } from "./props.js";
74
- import it from "./Table.vue.js";
67
+ import rt from "./components/TableToolbarTools.vue.js";
68
+ import { basicTableEmits as at } from "./emits.js";
69
+ import { useColumnPersistence as it } from "./hooks/useColumnPersistence.js";
70
+ import { createTableFormContext as st } from "./hooks/useTableContext.js";
71
+ import { useTableForm as nt } from "./hooks/useTableForm.js";
72
+ import { useSyncProps as lt } from "./hooks/useSyncProps.js";
73
+ import { tableFormProps as mt } from "./props.js";
74
+ import ut from "./Table.vue.js";
75
75
  /* empty css */
76
- import { forwardedEventEntries as st } from "./table-mutation-events.js";
77
- import { TableFormApi as at } from "./utils/table-form-api.js";
78
- import { provideFormActionTestIds as nt } from "./utils/context.js";
79
- const lt = ["data-testid"], mt = ["data-testid"], Vo = /* @__PURE__ */ _e({
76
+ import { forwardedEventEntries as pt } from "./table-mutation-events.js";
77
+ import { TableFormApi as ct } from "./utils/table-form-api.js";
78
+ import { provideFormActionTestIds as ft } from "./utils/context.js";
79
+ const dt = ["data-testid"], bt = ["data-testid"], zo = /* @__PURE__ */ ke({
80
80
  name: "TtTableForm",
81
81
  __name: "TableForm",
82
- props: rt,
82
+ props: mt,
83
83
  emits: [
84
84
  "register",
85
85
  "columns-setting",
@@ -87,254 +87,284 @@ const lt = ["data-testid"], mt = ["data-testid"], Vo = /* @__PURE__ */ _e({
87
87
  "export",
88
88
  "import",
89
89
  "set-columns",
90
- ...Ye
90
+ ...at
91
91
  ],
92
- setup(ne, { expose: le, emit: me }) {
93
- var q, G, Q;
94
- const a = ne, C = me, $ = Ie(), h = De(), { prefixCls: E } = Ge("table-form");
95
- function k() {
92
+ setup(ue, { expose: pe, emit: ce }) {
93
+ var Q, U, X;
94
+ const n = ue, v = ce, R = He(), h = Le(), { prefixCls: $ } = et("table-form");
95
+ function H() {
96
96
  var e;
97
97
  return Object.hasOwn(((e = h == null ? void 0 : h.vnode) == null ? void 0 : e.props) || {}, "table");
98
98
  }
99
- const R = Ve();
100
- let t = a.tableFormApi;
101
- t || (t = new at(a), t.useStore = (e) => qe(t.store, e));
102
- const B = Ke({});
103
- function H() {
104
- Object.assign(B, P(t.store.state) || {});
99
+ const E = ze();
100
+ let o = n.tableFormApi;
101
+ o || (o = new ct(n), o.useStore = (e) => Ze(o.store, e));
102
+ const L = je({});
103
+ function z() {
104
+ Object.assign(L, M(o.store.state) || {});
105
105
  }
106
- H(), Y(t.store.subscribe(H));
107
- const c = u(() => B), T = u(() => {
108
- var o;
109
- if (a.testId) return a.testId;
110
- const e = (o = r(c).table) == null ? void 0 : o.api;
111
- return e ? Ne(e) : "table";
112
- }), pe = u(() => O(r(T), "tableform")), ue = u(() => O(r(T), "search-form-header"));
113
- nt(
114
- u(() => ({
115
- submit: O(r(T), "search-btn-query"),
116
- reset: O(r(T), "search-btn-reset")
106
+ z(), ee(o.store.subscribe(z));
107
+ const m = b(() => L), T = b(() => {
108
+ var t;
109
+ if (n.testId) return n.testId;
110
+ const e = (t = r(m).table) == null ? void 0 : t.api;
111
+ return e ? Ue(e) : "table";
112
+ }), fe = b(() => D(r(T), "tableform")), de = b(() => D(r(T), "search-form-header"));
113
+ ft(
114
+ b(() => ({
115
+ submit: D(r(T), "search-btn-query"),
116
+ reset: D(r(T), "search-btn-reset")
117
117
  }))
118
118
  );
119
- const { getSlotKeys: ce, replaceSlotKey: de } = ae("form-"), { getSlotKeys: fe, replaceSlotKey: be } = ae("t-"), { getFormProps: _, getTableProps: m, getTableToolProps: ge, submitSearchQuery: L } = tt(
120
- c,
121
- t.tableApi.reload,
122
- t.tableApi.getLoading,
123
- t.tableApi.getPagination
124
- ), z = ke([]), he = u(() => (a.table, !k() || !a.table ? !1 : (a.table.data, Object.hasOwn(P(a.table), "data"))));
119
+ const { getSlotKeys: be, replaceSlotKey: ge } = me("form-"), { getSlotKeys: he, replaceSlotKey: we } = me("t-"), { getFormProps: _, getTableProps: u, getTableToolProps: Se, submitSearchQuery: j } = nt(
120
+ m,
121
+ o.tableApi.reload,
122
+ o.tableApi.getLoading,
123
+ o.tableApi.getPagination
124
+ ), x = xe([]), ye = b(() => (n.table, !H() || !n.table ? !1 : (n.table.data, Object.hasOwn(M(n.table), "data"))));
125
125
  let I = () => {
126
126
  };
127
- function we(e) {
128
- I(), I = w(
129
- () => S(e),
130
- (o) => {
131
- z.value = o || [];
127
+ function Te(e) {
128
+ I(), I = S(
129
+ () => y(e),
130
+ (t) => {
131
+ x.value = t || [];
132
132
  },
133
- { immediate: !0, deep: xe(e) ? !1 : 1 }
133
+ { immediate: !0, deep: qe(e) ? !1 : 1 }
134
134
  );
135
135
  }
136
- function Se() {
137
- if (a.table)
138
- return a.table.data, P(a.table).data;
136
+ function Ce() {
137
+ if (n.table)
138
+ return n.table.data, M(n.table).data;
139
+ }
140
+ S(Ce, (e) => Te(e), { immediate: !0 });
141
+ async function Fe() {
142
+ await o.tableApi.reloadData([]), o.tableApi.setPagination({ total: 0 });
139
143
  }
140
- w(Se, (e) => we(e), { immediate: !0 });
141
- const { run: Te } = v(
144
+ async function ve() {
145
+ return !r(m).useSearchForm || !a.isMounted ? {} : await a.getValues();
146
+ }
147
+ let V = !1;
148
+ async function P(e, t) {
149
+ const { tableSearchBefore: i } = r(m);
150
+ if (!le(i)) return !0;
151
+ if (V) return !1;
152
+ V = !0;
153
+ let s;
154
+ try {
155
+ s = await i(t || await ve(), e);
156
+ } catch {
157
+ return !1;
158
+ } finally {
159
+ V = !1;
160
+ }
161
+ if (c) return !1;
162
+ const { canSearch: p, clearData: w } = Qe(s) ? s : { canSearch: s, clearData: !1 };
163
+ return w && await Fe(), p !== !1;
164
+ }
165
+ async function Pe() {
166
+ return await P("page");
167
+ }
168
+ const { run: Ae } = F(
142
169
  async () => {
143
- const e = await i.getValues();
144
- await i.resetForm(e, { force: !0 });
145
- const o = await i.getValues();
146
- i.setLatestSubmissionValues(o), (await i.validate()).valid && L(o);
170
+ const e = await a.getValues();
171
+ await a.resetForm(e, { force: !0 });
172
+ const t = await a.getValues();
173
+ a.setLatestSubmissionValues(t), (await a.validate()).valid && await P("reset", t) && await j(t);
147
174
  },
148
175
  200,
149
176
  { leading: !0 }
150
- ), { run: ye } = v(
177
+ ), { run: Me } = F(
151
178
  async (e) => {
152
- await t.grid.clearFilter(), await L(e);
179
+ const t = e;
180
+ await P("submit", t) && (await o.grid.clearFilter(), await j(t));
153
181
  },
154
182
  200,
155
183
  { leading: !0 }
156
- ), [ve, i] = Je({
157
- ...S(_),
158
- handleSubmit: ye,
159
- handleReset: Te,
184
+ ), [Oe, a] = Ye({
185
+ ...y(_),
186
+ handleSubmit: Me,
187
+ handleReset: Ae,
160
188
  submitOnEnter: !0,
161
189
  submitButtonOptions: {
162
- content: (q = Qe.form) == null ? void 0 : q.submitTitle
190
+ content: (Q = tt.form) == null ? void 0 : Q.submitTitle
163
191
  },
164
192
  showCollapseButton: !0,
165
193
  collapsed: !0,
166
194
  collapseTriggerResize: !0,
167
195
  collapsedRows: 3
168
- }), { restoreColumns: Ce, saveColumns: x } = Ze({
169
- getTableProps: m,
170
- getProps: c,
171
- tableMethods: t.tableApi
196
+ }), { restoreColumns: De, saveColumns: N } = it({
197
+ getTableProps: u,
198
+ getProps: m,
199
+ tableMethods: o.tableApi
172
200
  });
173
- let d = !1;
174
- const y = {};
175
- st.forEach(([e, o]) => {
176
- y[o] = (...s) => C(e, ...s);
201
+ let c = !1;
202
+ const C = {};
203
+ pt.forEach(([e, t]) => {
204
+ C[t] = (...i) => v(e, ...i);
177
205
  });
178
- const { run: Fe } = v(async () => {
179
- if (d || !r(m).useHttpCache) return;
180
- const e = (t.tableApi.getTableColumns() || []).map((o) => o.field).filter(Boolean);
181
- e.length && await x(JSON.stringify(e));
206
+ const { run: Re } = F(async () => {
207
+ if (c || !r(u).useHttpCache) return;
208
+ const e = (o.tableApi.getTableColumns() || []).map((t) => t.field).filter(Boolean);
209
+ e.length && await N(JSON.stringify(e));
182
210
  }, 300);
183
- function Ae(e) {
184
- var o;
185
- (o = y.columnDragend) == null || o.call(y, e), Fe();
211
+ function $e(e) {
212
+ var t;
213
+ (t = C.columnDragend) == null || t.call(C, e), Re();
186
214
  }
187
- const Pe = u(() => ({ ...y, columnDragend: Ae }));
188
- function Me(e) {
189
- t.setState((o) => o.table ? We(e, o) : {}), e.table && t.tableApi.setState(e.table), e.form && (i == null || i.setState(e.form));
215
+ const Ee = b(() => ({ ...C, columnDragend: $e }));
216
+ function _e(e) {
217
+ o.setState((t) => t.table ? Xe(e, t) : {}), e.table && o.tableApi.setState(e.table), e.form && (a == null || a.setState(e.form));
190
218
  }
191
- const { run: Oe } = v(
219
+ const { run: Ie } = F(
192
220
  async (e) => {
193
- if (i.isMounted && r(c).useSearchForm) {
194
- if (!(await i.validate()).valid) return;
195
- const s = await i.getValues();
196
- await t.tableApi.reload({ ...e, searchInfo: { ...e == null ? void 0 : e.searchInfo, ...s } });
221
+ if (a.isMounted && r(m).useSearchForm) {
222
+ if (!(await a.validate()).valid) return;
223
+ const i = await a.getValues();
224
+ await o.tableApi.reload({ ...e, searchInfo: { ...e == null ? void 0 : e.searchInfo, ...i } });
197
225
  return;
198
226
  }
199
- await t.tableApi.reload({ ...e, searchInfo: { ...e == null ? void 0 : e.searchInfo } });
227
+ await o.tableApi.reload({ ...e, searchInfo: { ...e == null ? void 0 : e.searchInfo } });
200
228
  },
201
229
  200,
202
230
  { leading: !0 }
203
- ), F = {
204
- tableMethods: t.tableApi,
205
- formMethods: i,
206
- setTableProps: t.tableApi.setState,
207
- setFormProps: i.setState,
208
- setProps: Me,
209
- reload: Oe,
210
- selectedKeys: u(() => S(t.tableApi.selectedKeys))
231
+ ), A = {
232
+ tableMethods: o.tableApi,
233
+ formMethods: a,
234
+ setTableProps: o.tableApi.setState,
235
+ setFormProps: a.setState,
236
+ setProps: _e,
237
+ reload: Ie,
238
+ selectedKeys: b(() => y(o.tableApi.selectedKeys))
211
239
  };
212
- async function $e() {
213
- const { tableRefreshBefore: e } = r(c);
214
- je(e) && await e(), F.reload();
240
+ async function Ve() {
241
+ if (!await P("refresh")) return;
242
+ const { tableRefreshBefore: e } = r(m);
243
+ le(e) && await e(), A.reload();
215
244
  }
216
- let D = { width: window.innerWidth, height: window.innerHeight };
217
- const { run: j } = v(async () => {
218
- var n, f;
219
- if (await Z(), d) return;
220
- const { innerWidth: e, innerHeight: o } = window, s = e !== D.width || o !== D.height;
221
- if (D = { width: e, height: o }, !s) {
222
- if (!r(m).autoHeight) return;
223
- (n = t.tableApi) == null || n.redoHeight(!1);
245
+ let B = { width: window.innerWidth, height: window.innerHeight };
246
+ const { run: W } = F(async () => {
247
+ var s, p;
248
+ if (await te(), c) return;
249
+ const { innerWidth: e, innerHeight: t } = window, i = e !== B.width || t !== B.height;
250
+ if (B = { width: e, height: t }, !i) {
251
+ if (!r(u).autoHeight) return;
252
+ (s = o.tableApi) == null || s.redoHeight(!1);
224
253
  return;
225
254
  }
226
- (f = t.tableApi) == null || f.redoHeight();
255
+ (p = o.tableApi) == null || p.redoHeight();
227
256
  }, 100);
228
- async function Ee(e) {
229
- var f, A;
230
- if (d) return;
231
- const o = S((A = (f = r(c)) == null ? void 0 : f.table) == null ? void 0 : A.columns) || [], s = new Map(o.map((b) => [b.field, b])), n = e.checkedModel.map((b) => s.get(b)).filter(Boolean);
257
+ async function Be(e) {
258
+ var p, w;
259
+ if (c) return;
260
+ const t = y((w = (p = r(m)) == null ? void 0 : p.table) == null ? void 0 : w.columns) || [], i = new Map(t.map((f) => [f.field, f])), s = e.checkedModel.map((f) => i.get(f)).filter(Boolean);
232
261
  if (e.isExport) {
233
- C("export", e.checkedModel, e.modalApi);
262
+ v("export", e.checkedModel, e.modalApi);
234
263
  return;
235
264
  }
236
265
  e.modalApi.setModalProps({ confirmLoading: !0 });
237
266
  try {
238
- if (r(m).useHttpCache && await x(JSON.stringify(e.checkedModel)), d) return;
239
- t.tableApi.setTableColumns(n), e.modalApi.closeModal(), C("set-columns", n);
267
+ if (r(u).useHttpCache && await N(JSON.stringify(e.checkedModel)), c) return;
268
+ o.tableApi.setTableColumns(s), e.modalApi.closeModal(), v("set-columns", s);
240
269
  } finally {
241
- d || e.modalApi.setModalProps({ confirmLoading: !1 });
270
+ c || e.modalApi.setModalProps({ confirmLoading: !1 });
242
271
  }
243
272
  }
244
- function N(e, o = !1) {
245
- var b, U, X;
246
- const { notSetColumnField: s, columns: n } = r(m), f = ((((b = t.tableApi.getTableInstance()) == null ? void 0 : b.getTableColumn()) || {}).visibleColumn || []).map((p) => p.field).filter(Boolean), A = (S(n) || []).filter((p) => p.visible === !0 || p.visible === void 0).map((p) => p.field);
247
- (U = R.value) == null || U.openModal({
248
- columns: (S(n) || []).filter((p) => p.visible !== !1),
249
- displayFields: o ? A : f,
250
- disabledColumnField: s || [],
273
+ function G(e, t = !1) {
274
+ var f, Y, Z;
275
+ const { notSetColumnField: i, columns: s } = r(u), p = ((((f = o.tableApi.getTableInstance()) == null ? void 0 : f.getTableColumn()) || {}).visibleColumn || []).map((d) => d.field).filter(Boolean), w = (y(s) || []).filter((d) => d.visible === !0 || d.visible === void 0).map((d) => d.field);
276
+ (Y = E.value) == null || Y.openModal({
277
+ columns: (y(s) || []).filter((d) => d.visible !== !1),
278
+ displayFields: t ? w : p,
279
+ disabledColumnField: i || [],
251
280
  isExport: e
252
- }), (X = R.value) == null || X.setModalProps({ title: e ? "自定义导出" : "列设置" });
253
- }
254
- function W(e = !1) {
255
- N(!1, e);
281
+ }), (Z = E.value) == null || Z.setModalProps({ title: e ? "自定义导出" : "列设置" });
256
282
  }
257
283
  function J(e = !1) {
258
- N(!0, e);
284
+ G(!1, e);
285
+ }
286
+ function q(e = !1) {
287
+ G(!0, e);
259
288
  }
260
- function Re() {
261
- const e = a.table;
262
- if (!k() || !e) return;
263
- const o = {};
264
- return Object.keys(P(e)).forEach((s) => {
265
- s !== "data" && Object.assign(o, { [s]: e[s] });
266
- }), o;
289
+ function Ke() {
290
+ const e = n.table;
291
+ if (!H() || !e) return;
292
+ const t = {};
293
+ return Object.keys(M(e)).forEach((i) => {
294
+ i !== "data" && Object.assign(t, { [i]: e[i] });
295
+ }), t;
267
296
  }
268
- return ot(a, t.setState, ["tableFormApi", "table"]), w(
269
- Re,
297
+ return lt(n, o.setState, ["tableFormApi", "table"]), S(
298
+ Ke,
270
299
  (e) => {
271
- e && t.setState({ table: e });
300
+ e && o.setState({ table: e });
272
301
  },
273
302
  { deep: !0, immediate: !0 }
274
- ), et({ formInstance: i }), w(
275
- () => t.tableApi.getLoading.value,
303
+ ), st({ formInstance: a }), S(
304
+ () => o.tableApi.getLoading.value,
276
305
  (e) => {
277
- i == null || i.setState({ submitButtonOptions: { loading: e } });
306
+ a == null || a.setState({ submitButtonOptions: { loading: e } });
278
307
  },
279
- { immediate: (Q = (G = t.store.state) == null ? void 0 : G.table) == null ? void 0 : Q.immediate }
280
- ), w(_, (e) => i == null ? void 0 : i.setState(e)), w(m, (e) => {
281
- var o;
282
- return (o = t.tableApi) == null ? void 0 : o.setState(e);
283
- }), Be(() => {
284
- h && C("register", F, h.uid), t.mount(F, i), i == null || i.setState(r(_)), Z(() => {
285
- d || Ce();
286
- }), window.addEventListener("resize", j);
287
- }), Y(() => {
288
- d = !0, I(), t == null || t.unmount(), window.removeEventListener("resize", j);
289
- }), le({ ...F, instance: h }), (e, o) => (te(), ee("div", {
290
- class: V(r(E)),
291
- "data-testid": pe.value
308
+ { immediate: (X = (U = o.store.state) == null ? void 0 : U.table) == null ? void 0 : X.immediate }
309
+ ), S(_, (e) => a == null ? void 0 : a.setState(e)), S(u, (e) => {
310
+ var t;
311
+ return (t = o.tableApi) == null ? void 0 : t.setState(e);
312
+ }), Ne(() => {
313
+ h && v("register", A, h.uid), o.mount(A, a), a == null || a.setState(r(_)), te(() => {
314
+ c || De();
315
+ }), window.addEventListener("resize", W);
316
+ }), ee(() => {
317
+ c = !0, I(), o == null || o.unmount(), window.removeEventListener("resize", W);
318
+ }), pe({ ...A, instance: h }), (e, t) => (re(), oe("div", {
319
+ class: K(r($)),
320
+ "data-testid": fe.value
292
321
  }, [
293
- c.value.useSearchForm ? (te(), ee("div", {
322
+ m.value.useSearchForm ? (re(), oe("div", {
294
323
  key: 0,
295
- class: V(`${r(E)}-header`),
296
- "data-testid": ue.value
324
+ class: K(`${r($)}-header`),
325
+ "data-testid": de.value
297
326
  }, [
298
- M(r(ve), {
327
+ O(r(Oe), {
299
328
  "test-id": `${T.value}-search-form`
300
- }, K({ _: 2 }, [
301
- oe(r(ce)(r($)), (s) => ({
302
- name: r(de)(s),
303
- fn: g((n) => [
304
- l(e.$slots, s, re(ie(n || {})))
329
+ }, k({ _: 2 }, [
330
+ ae(r(be)(r(R)), (i) => ({
331
+ name: r(ge)(i),
332
+ fn: g((s) => [
333
+ l(e.$slots, i, ie(se(s || {})))
305
334
  ])
306
335
  }))
307
336
  ]), 1032, ["test-id"]),
308
337
  l(e.$slots, "header-down")
309
- ], 10, mt)) : He("", !0),
310
- Le("div", {
311
- class: V({
312
- [`${r(E)}-wrapper`]: !0,
338
+ ], 10, bt)) : We("", !0),
339
+ Ge("div", {
340
+ class: K({
341
+ [`${r($)}-wrapper`]: !0,
313
342
  "pt-(--tt-base-padding)!": !0,
314
- "pb-(--tt-base-padding)!": !r(m).showPager
343
+ "pb-(--tt-base-padding)!": !r(u).showPager
315
344
  })
316
345
  }, [
317
346
  l(e.$slots, "table-top"),
318
- M(it, se({
319
- ...r(m),
320
- ...he.value ? { data: z.value } : {}
347
+ O(ut, ne({
348
+ ...r(u),
349
+ ...ye.value ? { data: x.value } : {},
350
+ beforePageChange: Pe
321
351
  }, {
322
- "form-api": r(i),
323
- "table-api": r(t).tableApi
324
- }, ze(Pe.value)), K({ _: 2 }, [
325
- oe(r(fe)(r($)), (s) => ({
326
- name: r(be)(s),
327
- fn: g((n) => [
328
- l(e.$slots, s, re(ie(n || {})))
352
+ "form-api": r(a),
353
+ "table-api": r(o).tableApi
354
+ }, Je(Ee.value)), k({ _: 2 }, [
355
+ ae(r(he)(r(R)), (i) => ({
356
+ name: r(we)(i),
357
+ fn: g((s) => [
358
+ l(e.$slots, i, ie(se(s || {})))
329
359
  ])
330
360
  })),
331
- r(m).showToolbar ? {
361
+ r(u).showToolbar ? {
332
362
  name: "toolbar_tools",
333
363
  fn: g(() => [
334
- M(Xe, se(r(ge), {
335
- onOnRefresh: $e,
336
- onOnExport: J,
337
- onOnColumnsSetting: W
364
+ O(rt, ne(r(Se), {
365
+ onOnRefresh: Ve,
366
+ onOnExport: q,
367
+ onOnColumnsSetting: J
338
368
  }), {
339
369
  "toolbar-left": g(() => [
340
370
  l(e.$slots, "t-toolbar_tools-left")
@@ -351,19 +381,19 @@ const lt = ["data-testid"], mt = ["data-testid"], Vo = /* @__PURE__ */ _e({
351
381
  ]), 1040, ["form-api", "table-api"]),
352
382
  l(e.$slots, "table-bottom")
353
383
  ], 2),
354
- M(Ue, {
384
+ O(ot, {
355
385
  ref_key: "columnModalRef",
356
- ref: R,
357
- "open-export": J,
358
- "open-column": W,
359
- onOnSubmit: Ee
360
- }, K({
386
+ ref: E,
387
+ "open-export": q,
388
+ "open-column": J,
389
+ onOnSubmit: Be
390
+ }, k({
361
391
  beforeFooter: g(() => [
362
392
  l(e.$slots, "t-column-modal-before-footer")
363
393
  ]),
364
394
  _: 2
365
395
  }, [
366
- r($)["t-column-modal-title"] ? {
396
+ r(R)["t-column-modal-title"] ? {
367
397
  name: "title",
368
398
  fn: g(() => [
369
399
  l(e.$slots, "t-column-modal-title")
@@ -371,9 +401,9 @@ const lt = ["data-testid"], mt = ["data-testid"], Vo = /* @__PURE__ */ _e({
371
401
  key: "0"
372
402
  } : void 0
373
403
  ]), 1536)
374
- ], 10, lt));
404
+ ], 10, dt));
375
405
  }
376
406
  });
377
407
  export {
378
- Vo as default
408
+ zo as default
379
409
  };
@@ -104,6 +104,6 @@ export declare function usePagination(propsRef: ComputedRef<TtTableProps>, emit:
104
104
  paginationInfo: ComputedRef<VxeGridPropTypes.PagerConfig | undefined>;
105
105
  getPagination: () => VxeGridPropTypes.PagerConfig | undefined;
106
106
  setPagination: (info: Partial<PagerConfig>) => void;
107
- onPageChange: (data: VxePagerDefines.PageChangeEventParams | Parameters<VxePagerEvents.PageChange>[0]) => void;
107
+ onPageChange: (data: VxePagerDefines.PageChangeEventParams | Parameters<VxePagerEvents.PageChange>[0]) => Promise<void>;
108
108
  };
109
109
  export {};