@dazhicheng/ui 1.6.19 → 1.6.21

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/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 +0 -6
  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/index.d.ts +1 -0
  13. package/dist/components/tt-modal/index.js +8 -3
  14. package/dist/components/tt-modal/src/RenderModal.vue.js +224 -210
  15. package/dist/components/tt-modal/src/hooks/useModalRender.js +66 -67
  16. package/dist/components/tt-modal/src/index.js +9 -7
  17. package/dist/components/tt-modal/src/utils/modal-api.d.ts +9 -3
  18. package/dist/components/tt-modal/src/utils/modal-api.js +42 -36
  19. package/dist/components/tt-modal/src/utils/modal-close-transition.d.ts +13 -0
  20. package/dist/components/tt-modal/src/utils/modal-close-transition.js +13 -0
  21. package/dist/components/tt-modal/src/utils/modal-host-app.d.ts +5 -0
  22. package/dist/components/tt-modal/src/utils/modal-host-app.js +12 -0
  23. package/dist/components/tt-modal/src/utils/modal-scope.d.ts +21 -0
  24. package/dist/components/tt-modal/src/utils/modal-scope.js +20 -0
  25. package/dist/components/tt-modal/src/utils/modal-service.d.ts +23 -0
  26. package/dist/components/tt-modal/src/utils/modal-service.js +51 -0
  27. package/dist/components/tt-modal/src/utils/modal-stack.d.ts +14 -13
  28. package/dist/components/tt-modal/src/utils/modal-stack.js +20 -9
  29. package/dist/components/tt-modal/src/utils/modal-z-index.d.ts +15 -0
  30. package/dist/components/tt-modal/src/utils/modal-z-index.js +24 -0
  31. package/dist/components/tt-modal/src/utils/resolve-modal-target.d.ts +14 -0
  32. package/dist/components/tt-modal/src/utils/resolve-modal-target.js +83 -47
  33. package/dist/components/tt-modal-form/props.d.ts +9 -4
  34. package/dist/components/tt-modal-form/useModalForm.d.ts +1 -1
  35. package/dist/components/tt-table/index.d.ts +15 -0
  36. package/dist/components/tt-table/src/Table.vue.d.ts +9 -0
  37. package/dist/components/tt-table/src/Table.vue.js +240 -242
  38. package/dist/components/tt-table/src/TableForm.vue.d.ts +7 -5
  39. package/dist/components/tt-table/src/TableForm.vue.js +199 -180
  40. package/dist/components/tt-table/src/hooks/usePagination.d.ts +1 -1
  41. package/dist/components/tt-table/src/hooks/usePagination.js +38 -24
  42. package/dist/components/tt-table/src/hooks/useTableRender.d.ts +4 -4
  43. package/dist/components/tt-table/src/props.d.ts +6 -0
  44. package/dist/components/tt-table/src/props.js +5 -0
  45. package/dist/components/tt-table/src/types/table.d.ts +8 -0
  46. package/dist/components/tt-table/src/types/tableForm.d.ts +29 -14
  47. package/dist/components/tt-table/src/utils/table-form-api.d.ts +11 -11
  48. package/dist/index.js +132 -127
  49. package/package.json +1 -1
@@ -2,7 +2,7 @@ import { Slot, nextTick } from 'vue';
2
2
  import { TtModalExtendedModalApi } from '../../tt-modal';
3
3
  import { Recordable } from '../../../../../utils/src';
4
4
  import { TtTableProps } from './types/table';
5
- import { TtTableExtendedTableFormApi, TtTableFormProps } from './types/tableForm';
5
+ import { TtTableExtendedTableFormApi, TtTableFormProps, TtTableSearchBeforeResult, TtTableSearchTrigger } from './types/tableForm';
6
6
  declare function __VLS_template(): {
7
7
  attrs: Partial<{}>;
8
8
  slots: Readonly<{
@@ -331,6 +331,7 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
331
331
  immediate?: boolean;
332
332
  afterFetch?: ((data: any[], res: globalThis.Recordable | globalThis.Recordable[]) => Promise<any[]>) | undefined;
333
333
  beforeFetch?: (params: globalThis.Recordable) => Promise<globalThis.Recordable>;
334
+ beforePageChange?: (page: import("vxe-table").VxeGridPropTypes.PagerConfig) => boolean | Promise<boolean>;
334
335
  isScrollFetch?: boolean;
335
336
  showToolbar?: boolean;
336
337
  columnsFieldSort?: string[];
@@ -370,10 +371,10 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
370
371
  }>, {
371
372
  instance: import('vue').ComponentInternalInstance | null;
372
373
  setTableProps: (props: Partial<TtTableProps<any>>) => void;
373
- setFormProps: (props: import('../../../index').TtTableFormRenderFormProps) => void;
374
+ setFormProps: (props: Partial<import('../../../index').TtFormProps<Record<string, any>>>) => void;
374
375
  tableMethods: import('../../../index').TtTableMethods<any>;
375
- formMethods: import('../../../index').TtTableRenderFormInstance;
376
- setProps: (props: Partial<TtTableFormProps<any>>) => void;
376
+ formMethods: import('../../../index').TtTableRenderFormInstance<Record<string, any>>;
377
+ setProps: (props: Partial<TtTableFormProps<any, Record<string, any>>>) => void;
377
378
  reload: import('../../../index').TtTableMethods<Row>["reload"];
378
379
  selectedKeys: import('vue').MaybeRef<import('../../../index').TtSelectRowKeysType>;
379
380
  }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
@@ -558,6 +559,7 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
558
559
  immediate?: boolean;
559
560
  afterFetch?: ((data: any[], res: globalThis.Recordable | globalThis.Recordable[]) => Promise<any[]>) | undefined;
560
561
  beforeFetch?: (params: globalThis.Recordable) => Promise<globalThis.Recordable>;
562
+ beforePageChange?: (page: import("vxe-table").VxeGridPropTypes.PagerConfig) => boolean | Promise<boolean>;
561
563
  isScrollFetch?: boolean;
562
564
  showToolbar?: boolean;
563
565
  columnsFieldSort?: string[];
@@ -602,7 +604,7 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
602
604
  handleSearchInfoFn: Fn<any, any>;
603
605
  toolConfig: import('../../../index').TtTableToolsProps;
604
606
  tableRefreshBefore: Fn<any, any>;
605
- tableSearchBefore: (values: Recordable) => import('../../../index').TtTableSearchBeforeResult | Promise<import('../../../index').TtTableSearchBeforeResult>;
607
+ tableSearchBefore: (values: Record<string, any>, trigger: TtTableSearchTrigger) => TtTableSearchBeforeResult | Promise<TtTableSearchBeforeResult>;
606
608
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {
607
609
  columnModalRef: ({
608
610
  $: import('vue').ComponentInternalInstance;
@@ -1,17 +1,17 @@
1
- import { defineComponent as Ve, useSlots as Be, getCurrentInstance as Ke, ref as ke, shallowReactive as He, onScopeDispose as Y, computed as d, unref as r, shallowRef as Le, toRaw as P, watch as w, toValue as S, onMounted as ze, nextTick as Z, createElementBlock as ee, openBlock as te, normalizeClass as V, createCommentVNode as je, createElementVNode as xe, createVNode as M, renderSlot as l, createSlots as B, renderList as oe, withCtx as h, normalizeProps as re, guardReactiveProps as ae, mergeProps as ie, toHandlers as Ne, isRef as We } 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 se, isObject 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 qe, 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 Ge } 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 Qe } 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 Ue } 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 Xe } 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 Ye } 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 ne } from "../../../hooks/useTemplateSlot.js";
65
- import Ze 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 et from "./components/TableToolbarTools.vue.js";
68
- import { basicTableEmits as tt } from "./emits.js";
69
- import { useColumnPersistence as ot } from "./hooks/useColumnPersistence.js";
70
- import { createTableFormContext as rt } from "./hooks/useTableContext.js";
71
- import { useTableForm as at } from "./hooks/useTableForm.js";
72
- import { useSyncProps as it } from "./hooks/useSyncProps.js";
73
- import { tableFormProps as st } from "./props.js";
74
- import nt 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 lt } from "./table-mutation-events.js";
77
- import { TableFormApi as mt } from "./utils/table-form-api.js";
78
- import { provideFormActionTestIds as pt } from "./utils/context.js";
79
- const ct = ["data-testid"], ut = ["data-testid"], ko = /* @__PURE__ */ Ve({
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: st,
82
+ props: mt,
83
83
  emits: [
84
84
  "register",
85
85
  "columns-setting",
@@ -87,121 +87,138 @@ const ct = ["data-testid"], ut = ["data-testid"], ko = /* @__PURE__ */ Ve({
87
87
  "export",
88
88
  "import",
89
89
  "set-columns",
90
- ...tt
90
+ ...at
91
91
  ],
92
- setup(le, { expose: me, emit: pe }) {
93
- var q, G, Q;
94
- const n = le, C = pe, D = Be(), g = Ke(), { prefixCls: $ } = Xe("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
- return Object.hasOwn(((e = g == null ? void 0 : g.vnode) == null ? void 0 : e.props) || {}, "table");
97
+ return Object.hasOwn(((e = h == null ? void 0 : h.vnode) == null ? void 0 : e.props) || {}, "table");
98
98
  }
99
- const E = ke();
99
+ const E = ze();
100
100
  let o = n.tableFormApi;
101
- o || (o = new mt(n), o.useStore = (e) => Ue(o.store, e));
102
- const k = He({});
103
- function H() {
104
- Object.assign(k, P(o.store.state) || {});
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(o.store.subscribe(H));
107
- const c = d(() => k), T = d(() => {
106
+ z(), ee(o.store.subscribe(z));
107
+ const m = b(() => L), T = b(() => {
108
108
  var t;
109
109
  if (n.testId) return n.testId;
110
- const e = (t = r(c).table) == null ? void 0 : t.api;
111
- return e ? qe(e) : "table";
112
- }), ce = d(() => O(r(T), "tableform")), ue = d(() => O(r(T), "search-form-header"));
113
- pt(
114
- d(() => ({
115
- submit: O(r(T), "search-btn-query"),
116
- reset: O(r(T), "search-btn-reset")
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: de, replaceSlotKey: fe } = ne("form-"), { getSlotKeys: be, replaceSlotKey: he } = ne("t-"), { getFormProps: R, getTableProps: m, getTableToolProps: ge, submitSearchQuery: L } = at(
120
- c,
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
121
  o.tableApi.reload,
122
122
  o.tableApi.getLoading,
123
123
  o.tableApi.getPagination
124
- ), z = Le([]), we = d(() => (n.table, !K() || !n.table ? !1 : (n.table.data, Object.hasOwn(P(n.table), "data"))));
125
- let _ = () => {
124
+ ), x = xe([]), ye = b(() => (n.table, !H() || !n.table ? !1 : (n.table.data, Object.hasOwn(M(n.table), "data"))));
125
+ let I = () => {
126
126
  };
127
- function Se(e) {
128
- _(), _ = w(
129
- () => S(e),
127
+ function Te(e) {
128
+ I(), I = S(
129
+ () => y(e),
130
130
  (t) => {
131
- z.value = t || [];
131
+ x.value = t || [];
132
132
  },
133
- { immediate: !0, deep: We(e) ? !1 : 1 }
133
+ { immediate: !0, deep: qe(e) ? !1 : 1 }
134
134
  );
135
135
  }
136
- function Te() {
136
+ function Ce() {
137
137
  if (n.table)
138
- return n.table.data, P(n.table).data;
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 });
143
+ }
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;
139
164
  }
140
- w(Te, (e) => Se(e), { immediate: !0 });
141
- const { run: ye } = v(
165
+ async function Pe() {
166
+ return await P("page");
167
+ }
168
+ const { run: Ae } = F(
142
169
  async () => {
143
170
  const e = await a.getValues();
144
171
  await a.resetForm(e, { force: !0 });
145
172
  const t = await a.getValues();
146
- a.setLatestSubmissionValues(t), (await a.validate()).valid && L(t);
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
- );
151
- async function ve() {
152
- await o.tableApi.reloadData([]), o.tableApi.setPagination({ currentPage: 1, total: 0 });
153
- }
154
- async function Ce(e) {
155
- const { tableSearchBefore: t } = r(c);
156
- if (!se(t)) return !0;
157
- const i = await t(e), { canSearch: s, clearData: p } = Je(i) ? i : { canSearch: i, clearData: !1 };
158
- return p && await ve(), s !== !1;
159
- }
160
- const { run: Fe } = v(
177
+ ), { run: Me } = F(
161
178
  async (e) => {
162
179
  const t = e;
163
- await Ce(t) && (await o.grid.clearFilter(), await L(t));
180
+ await P("submit", t) && (await o.grid.clearFilter(), await j(t));
164
181
  },
165
182
  200,
166
183
  { leading: !0 }
167
- ), [Ae, a] = Qe({
168
- ...S(R),
169
- handleSubmit: Fe,
170
- handleReset: ye,
184
+ ), [Oe, a] = Ye({
185
+ ...y(_),
186
+ handleSubmit: Me,
187
+ handleReset: Ae,
171
188
  submitOnEnter: !0,
172
189
  submitButtonOptions: {
173
- content: (q = Ye.form) == null ? void 0 : q.submitTitle
190
+ content: (Q = tt.form) == null ? void 0 : Q.submitTitle
174
191
  },
175
192
  showCollapseButton: !0,
176
193
  collapsed: !0,
177
194
  collapseTriggerResize: !0,
178
195
  collapsedRows: 3
179
- }), { restoreColumns: Pe, saveColumns: j } = ot({
180
- getTableProps: m,
181
- getProps: c,
196
+ }), { restoreColumns: De, saveColumns: N } = it({
197
+ getTableProps: u,
198
+ getProps: m,
182
199
  tableMethods: o.tableApi
183
200
  });
184
- let f = !1;
185
- const y = {};
186
- lt.forEach(([e, t]) => {
187
- y[t] = (...i) => C(e, ...i);
201
+ let c = !1;
202
+ const C = {};
203
+ pt.forEach(([e, t]) => {
204
+ C[t] = (...i) => v(e, ...i);
188
205
  });
189
- const { run: Me } = v(async () => {
190
- if (f || !r(m).useHttpCache) return;
206
+ const { run: Re } = F(async () => {
207
+ if (c || !r(u).useHttpCache) return;
191
208
  const e = (o.tableApi.getTableColumns() || []).map((t) => t.field).filter(Boolean);
192
- e.length && await j(JSON.stringify(e));
209
+ e.length && await N(JSON.stringify(e));
193
210
  }, 300);
194
- function Oe(e) {
211
+ function $e(e) {
195
212
  var t;
196
- (t = y.columnDragend) == null || t.call(y, e), Me();
213
+ (t = C.columnDragend) == null || t.call(C, e), Re();
197
214
  }
198
- const De = d(() => ({ ...y, columnDragend: Oe }));
199
- function $e(e) {
200
- o.setState((t) => t.table ? Ge(e, t) : {}), e.table && o.tableApi.setState(e.table), e.form && (a == null || a.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));
201
218
  }
202
- const { run: Ee } = v(
219
+ const { run: Ie } = F(
203
220
  async (e) => {
204
- if (a.isMounted && r(c).useSearchForm) {
221
+ if (a.isMounted && r(m).useSearchForm) {
205
222
  if (!(await a.validate()).valid) return;
206
223
  const i = await a.getValues();
207
224
  await o.tableApi.reload({ ...e, searchInfo: { ...e == null ? void 0 : e.searchInfo, ...i } });
@@ -211,146 +228,148 @@ const ct = ["data-testid"], ut = ["data-testid"], ko = /* @__PURE__ */ Ve({
211
228
  },
212
229
  200,
213
230
  { leading: !0 }
214
- ), F = {
231
+ ), A = {
215
232
  tableMethods: o.tableApi,
216
233
  formMethods: a,
217
234
  setTableProps: o.tableApi.setState,
218
235
  setFormProps: a.setState,
219
- setProps: $e,
220
- reload: Ee,
221
- selectedKeys: d(() => S(o.tableApi.selectedKeys))
236
+ setProps: _e,
237
+ reload: Ie,
238
+ selectedKeys: b(() => y(o.tableApi.selectedKeys))
222
239
  };
223
- async function Re() {
224
- const { tableRefreshBefore: e } = r(c);
225
- se(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();
226
244
  }
227
- let I = { width: window.innerWidth, height: window.innerHeight };
228
- const { run: x } = v(async () => {
245
+ let B = { width: window.innerWidth, height: window.innerHeight };
246
+ const { run: W } = F(async () => {
229
247
  var s, p;
230
- if (await Z(), f) return;
231
- const { innerWidth: e, innerHeight: t } = window, i = e !== I.width || t !== I.height;
232
- if (I = { width: e, height: t }, !i) {
233
- if (!r(m).autoHeight) return;
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;
234
252
  (s = o.tableApi) == null || s.redoHeight(!1);
235
253
  return;
236
254
  }
237
255
  (p = o.tableApi) == null || p.redoHeight();
238
256
  }, 100);
239
- async function _e(e) {
240
- var p, A;
241
- if (f) return;
242
- const t = S((A = (p = r(c)) == null ? void 0 : p.table) == null ? void 0 : A.columns) || [], i = new Map(t.map((b) => [b.field, b])), s = e.checkedModel.map((b) => i.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);
243
261
  if (e.isExport) {
244
- C("export", e.checkedModel, e.modalApi);
262
+ v("export", e.checkedModel, e.modalApi);
245
263
  return;
246
264
  }
247
265
  e.modalApi.setModalProps({ confirmLoading: !0 });
248
266
  try {
249
- if (r(m).useHttpCache && await j(JSON.stringify(e.checkedModel)), f) return;
250
- o.tableApi.setTableColumns(s), e.modalApi.closeModal(), C("set-columns", s);
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);
251
269
  } finally {
252
- f || e.modalApi.setModalProps({ confirmLoading: !1 });
270
+ c || e.modalApi.setModalProps({ confirmLoading: !1 });
253
271
  }
254
272
  }
255
- function N(e, t = !1) {
256
- var b, U, X;
257
- const { notSetColumnField: i, columns: s } = r(m), p = ((((b = o.tableApi.getTableInstance()) == null ? void 0 : b.getTableColumn()) || {}).visibleColumn || []).map((u) => u.field).filter(Boolean), A = (S(s) || []).filter((u) => u.visible === !0 || u.visible === void 0).map((u) => u.field);
258
- (U = E.value) == null || U.openModal({
259
- columns: (S(s) || []).filter((u) => u.visible !== !1),
260
- displayFields: t ? A : p,
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,
261
279
  disabledColumnField: i || [],
262
280
  isExport: e
263
- }), (X = E.value) == null || X.setModalProps({ title: e ? "自定义导出" : "列设置" });
264
- }
265
- function W(e = !1) {
266
- N(!1, e);
281
+ }), (Z = E.value) == null || Z.setModalProps({ title: e ? "自定义导出" : "列设置" });
267
282
  }
268
283
  function J(e = !1) {
269
- N(!0, e);
284
+ G(!1, e);
285
+ }
286
+ function q(e = !1) {
287
+ G(!0, e);
270
288
  }
271
- function Ie() {
289
+ function Ke() {
272
290
  const e = n.table;
273
- if (!K() || !e) return;
291
+ if (!H() || !e) return;
274
292
  const t = {};
275
- return Object.keys(P(e)).forEach((i) => {
293
+ return Object.keys(M(e)).forEach((i) => {
276
294
  i !== "data" && Object.assign(t, { [i]: e[i] });
277
295
  }), t;
278
296
  }
279
- return it(n, o.setState, ["tableFormApi", "table"]), w(
280
- Ie,
297
+ return lt(n, o.setState, ["tableFormApi", "table"]), S(
298
+ Ke,
281
299
  (e) => {
282
300
  e && o.setState({ table: e });
283
301
  },
284
302
  { deep: !0, immediate: !0 }
285
- ), rt({ formInstance: a }), w(
303
+ ), st({ formInstance: a }), S(
286
304
  () => o.tableApi.getLoading.value,
287
305
  (e) => {
288
306
  a == null || a.setState({ submitButtonOptions: { loading: e } });
289
307
  },
290
- { immediate: (Q = (G = o.store.state) == null ? void 0 : G.table) == null ? void 0 : Q.immediate }
291
- ), w(R, (e) => a == null ? void 0 : a.setState(e)), w(m, (e) => {
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) => {
292
310
  var t;
293
311
  return (t = o.tableApi) == null ? void 0 : t.setState(e);
294
- }), ze(() => {
295
- g && C("register", F, g.uid), o.mount(F, a), a == null || a.setState(r(R)), Z(() => {
296
- f || Pe();
297
- }), window.addEventListener("resize", x);
298
- }), Y(() => {
299
- f = !0, _(), o == null || o.unmount(), window.removeEventListener("resize", x);
300
- }), me({ ...F, instance: g }), (e, t) => (te(), ee("div", {
301
- class: V(r($)),
302
- "data-testid": ce.value
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
303
321
  }, [
304
- c.value.useSearchForm ? (te(), ee("div", {
322
+ m.value.useSearchForm ? (re(), oe("div", {
305
323
  key: 0,
306
- class: V(`${r($)}-header`),
307
- "data-testid": ue.value
324
+ class: K(`${r($)}-header`),
325
+ "data-testid": de.value
308
326
  }, [
309
- M(r(Ae), {
327
+ O(r(Oe), {
310
328
  "test-id": `${T.value}-search-form`
311
- }, B({ _: 2 }, [
312
- oe(r(de)(r(D)), (i) => ({
313
- name: r(fe)(i),
314
- fn: h((s) => [
315
- l(e.$slots, i, re(ae(s || {})))
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 || {})))
316
334
  ])
317
335
  }))
318
336
  ]), 1032, ["test-id"]),
319
337
  l(e.$slots, "header-down")
320
- ], 10, ut)) : je("", !0),
321
- xe("div", {
322
- class: V({
338
+ ], 10, bt)) : We("", !0),
339
+ Ge("div", {
340
+ class: K({
323
341
  [`${r($)}-wrapper`]: !0,
324
342
  "pt-(--tt-base-padding)!": !0,
325
- "pb-(--tt-base-padding)!": !r(m).showPager
343
+ "pb-(--tt-base-padding)!": !r(u).showPager
326
344
  })
327
345
  }, [
328
346
  l(e.$slots, "table-top"),
329
- M(nt, ie({
330
- ...r(m),
331
- ...we.value ? { data: z.value } : {}
347
+ O(ut, ne({
348
+ ...r(u),
349
+ ...ye.value ? { data: x.value } : {},
350
+ beforePageChange: Pe
332
351
  }, {
333
352
  "form-api": r(a),
334
353
  "table-api": r(o).tableApi
335
- }, Ne(De.value)), B({ _: 2 }, [
336
- oe(r(be)(r(D)), (i) => ({
337
- name: r(he)(i),
338
- fn: h((s) => [
339
- l(e.$slots, i, re(ae(s || {})))
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 || {})))
340
359
  ])
341
360
  })),
342
- r(m).showToolbar ? {
361
+ r(u).showToolbar ? {
343
362
  name: "toolbar_tools",
344
- fn: h(() => [
345
- M(et, ie(r(ge), {
346
- onOnRefresh: Re,
347
- onOnExport: J,
348
- onOnColumnsSetting: W
363
+ fn: g(() => [
364
+ O(rt, ne(r(Se), {
365
+ onOnRefresh: Ve,
366
+ onOnExport: q,
367
+ onOnColumnsSetting: J
349
368
  }), {
350
- "toolbar-left": h(() => [
369
+ "toolbar-left": g(() => [
351
370
  l(e.$slots, "t-toolbar_tools-left")
352
371
  ]),
353
- "toolbar-right": h(() => [
372
+ "toolbar-right": g(() => [
354
373
  l(e.$slots, "t-toolbar_tools-right")
355
374
  ]),
356
375
  _: 3
@@ -362,29 +381,29 @@ const ct = ["data-testid"], ut = ["data-testid"], ko = /* @__PURE__ */ Ve({
362
381
  ]), 1040, ["form-api", "table-api"]),
363
382
  l(e.$slots, "table-bottom")
364
383
  ], 2),
365
- M(Ze, {
384
+ O(ot, {
366
385
  ref_key: "columnModalRef",
367
386
  ref: E,
368
- "open-export": J,
369
- "open-column": W,
370
- onOnSubmit: _e
371
- }, B({
372
- beforeFooter: h(() => [
387
+ "open-export": q,
388
+ "open-column": J,
389
+ onOnSubmit: Be
390
+ }, k({
391
+ beforeFooter: g(() => [
373
392
  l(e.$slots, "t-column-modal-before-footer")
374
393
  ]),
375
394
  _: 2
376
395
  }, [
377
- r(D)["t-column-modal-title"] ? {
396
+ r(R)["t-column-modal-title"] ? {
378
397
  name: "title",
379
- fn: h(() => [
398
+ fn: g(() => [
380
399
  l(e.$slots, "t-column-modal-title")
381
400
  ]),
382
401
  key: "0"
383
402
  } : void 0
384
403
  ]), 1536)
385
- ], 10, ct));
404
+ ], 10, dt));
386
405
  }
387
406
  });
388
407
  export {
389
- ko as default
408
+ zo as default
390
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 {};