@dazhicheng/ui 1.6.7 → 1.6.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/dist/components/tt-form/src/form-render/expandable.js +31 -32
  2. package/dist/components/tt-form/src/useFormContext.js +1 -1
  3. package/dist/components/tt-panel-select/src/index.vue.js +28 -28
  4. package/dist/components/tt-table/index.d.ts +3 -15
  5. package/dist/components/tt-table/index.js +5 -4
  6. package/dist/components/tt-table/src/Table.vue.d.ts +1 -1
  7. package/dist/components/tt-table/src/Table.vue.js +3 -3
  8. package/dist/components/tt-table/src/TableForm.vue.js +168 -159
  9. package/dist/components/tt-table/src/components/TableAction.vue.d.ts +2 -12
  10. package/dist/components/tt-table/src/components/TableAction.vue.js +78 -175
  11. package/dist/components/tt-table/src/hooks/useGridProps.js +64 -60
  12. package/dist/components/tt-table/src/hooks/useTableData.js +77 -74
  13. package/dist/components/tt-table/src/types/table.d.ts +2 -1
  14. package/dist/components/tt-table/src/utils/table-api.d.ts +2 -1
  15. package/dist/components/tt-table/src/utils/table-api.js +3 -2
  16. package/dist/components/tt-vtable/index.js +54 -0
  17. package/dist/components/tt-vtable/src/components/TtVTable.vue.d.ts +188 -0
  18. package/dist/components/tt-vtable/src/components/TtVTable.vue.js +227 -0
  19. package/dist/components/tt-vtable/src/components/TtVTable.vue2.js +4 -0
  20. package/dist/components/tt-vtable/src/components/TtVTableForm.vue.d.ts +32 -0
  21. package/dist/components/tt-vtable/src/components/TtVTableForm.vue.js +121 -0
  22. package/dist/components/tt-vtable/src/components/TtVTableForm.vue2.js +4 -0
  23. package/dist/components/tt-vtable/src/components/VTableEmpty.vue.d.ts +64 -0
  24. package/dist/components/tt-vtable/src/components/VTableEmpty.vue.js +97 -0
  25. package/dist/components/tt-vtable/src/components/VTableEmpty.vue2.js +4 -0
  26. package/dist/components/tt-vtable/src/components/VTablePagination.vue.d.ts +53 -0
  27. package/dist/components/tt-vtable/src/components/VTablePagination.vue.js +52 -0
  28. package/dist/components/tt-vtable/src/components/VTablePagination.vue2.js +4 -0
  29. package/dist/components/tt-vtable/src/components/VTableSelectionAlert.vue.d.ts +35 -0
  30. package/dist/components/tt-vtable/src/components/VTableSelectionAlert.vue.js +50 -0
  31. package/dist/components/tt-vtable/src/components/VTableSelectionAlert.vue2.js +4 -0
  32. package/dist/components/tt-vtable/src/components/VTableToolbar.vue.d.ts +63 -0
  33. package/dist/components/tt-vtable/src/components/VTableToolbar.vue.js +126 -0
  34. package/dist/components/tt-vtable/src/components/VTableToolbar.vue2.js +4 -0
  35. package/dist/components/tt-vtable/src/components/VTableViewport.vue.js +133 -0
  36. package/dist/components/tt-vtable/src/components/VTableViewport.vue2.js +4 -0
  37. package/dist/components/tt-vtable/src/composables/useVTable.d.ts +41 -0
  38. package/dist/components/tt-vtable/src/composables/useVTable.js +25 -0
  39. package/dist/components/tt-vtable/src/composables/useVTableFormRender.d.ts +13 -0
  40. package/dist/components/tt-vtable/src/composables/useVTableFormRender.js +92 -0
  41. package/dist/components/tt-vtable/src/composables/useVTableRender.d.ts +13 -0
  42. package/dist/components/tt-vtable/src/composables/useVTableRender.js +13 -0
  43. package/dist/components/tt-vtable/src/engine/visactor/createListTable.d.ts +10 -0
  44. package/dist/components/tt-vtable/src/engine/visactor/createListTable.js +63 -0
  45. package/dist/components/tt-vtable/src/engine/visactor/createVueCellLayout.d.ts +37 -0
  46. package/dist/components/tt-vtable/src/engine/visactor/createVueCellLayout.js +133 -0
  47. package/dist/components/tt-vtable/src/engine/visactor/index.d.ts +8 -0
  48. package/dist/components/tt-vtable/src/engine/visactor/native-boundaries.d.ts +23 -0
  49. package/dist/components/tt-vtable/src/engine/visactor/native-boundaries.js +70 -0
  50. package/dist/components/tt-vtable/src/engine/visactor/record-adapter.d.ts +38 -0
  51. package/dist/components/tt-vtable/src/engine/visactor/record-adapter.js +41 -0
  52. package/dist/components/tt-vtable/src/engine/visactor/toColumnDefinitions.d.ts +45 -0
  53. package/dist/components/tt-vtable/src/engine/visactor/toColumnDefinitions.js +73 -0
  54. package/dist/components/tt-vtable/src/engine/visactor/toListTableOptions.d.ts +25 -0
  55. package/dist/components/tt-vtable/src/engine/visactor/toListTableOptions.js +25 -0
  56. package/dist/components/tt-vtable/src/engine/visactor/types.d.ts +29 -0
  57. package/dist/components/tt-vtable/src/features/column-preferences/column-preference-storage.d.ts +5 -0
  58. package/dist/components/tt-vtable/src/features/column-preferences/column-preference-storage.js +52 -0
  59. package/dist/components/tt-vtable/src/features/column-preferences/useColumnPreferences.d.ts +74 -0
  60. package/dist/components/tt-vtable/src/features/column-preferences/useColumnPreferences.js +232 -0
  61. package/dist/components/tt-vtable/src/features/editing/useCellEditing.d.ts +48 -0
  62. package/dist/components/tt-vtable/src/features/editing/useCellEditing.js +102 -0
  63. package/dist/components/tt-vtable/src/features/form-integration/useVTableForm.d.ts +51 -0
  64. package/dist/components/tt-vtable/src/features/pagination/useTablePagination.d.ts +40 -0
  65. package/dist/components/tt-vtable/src/features/pagination/useTablePagination.js +51 -0
  66. package/dist/components/tt-vtable/src/features/querying/useRecordQuery.d.ts +38 -0
  67. package/dist/components/tt-vtable/src/features/querying/useRecordQuery.js +57 -0
  68. package/dist/components/tt-vtable/src/features/records/index.d.ts +3 -0
  69. package/dist/components/tt-vtable/src/features/records/record-index.d.ts +122 -0
  70. package/dist/components/tt-vtable/src/features/records/record-index.js +209 -0
  71. package/dist/components/tt-vtable/src/features/records/useRecordSource.d.ts +41 -0
  72. package/dist/components/tt-vtable/src/features/records/useRecordSource.js +249 -0
  73. package/dist/components/tt-vtable/src/features/selection/useRowSelection.d.ts +65 -0
  74. package/dist/components/tt-vtable/src/features/selection/useRowSelection.js +129 -0
  75. package/dist/components/tt-vtable/src/features/tree/useTreeRecords.d.ts +60 -0
  76. package/dist/components/tt-vtable/src/features/tree/useTreeRecords.js +125 -0
  77. package/dist/components/tt-vtable/src/public/column-preferences.d.ts +32 -0
  78. package/dist/components/tt-vtable/src/public/index.d.ts +8 -0
  79. package/dist/components/tt-vtable/src/public/table-api.d.ts +215 -0
  80. package/dist/components/tt-vtable/src/public/table-column.d.ts +123 -0
  81. package/dist/components/tt-vtable/src/public/table-errors.d.ts +26 -0
  82. package/dist/components/tt-vtable/src/public/table-errors.js +26 -0
  83. package/dist/components/tt-vtable/src/public/table-events.d.ts +69 -0
  84. package/dist/components/tt-vtable/src/public/table-props.d.ts +216 -0
  85. package/dist/components/tt-vtable/src/public/table-slots.d.ts +37 -0
  86. package/dist/components/tt-vtable/src/runtime/createVTableController.d.ts +12 -0
  87. package/dist/components/tt-vtable/src/runtime/createVTableController.js +238 -0
  88. package/dist/components/tt-vtable/src/runtime/createVTableRuntime.d.ts +79 -0
  89. package/dist/components/tt-vtable/src/runtime/createVTableRuntime.js +380 -0
  90. package/dist/index.d.ts +1 -0
  91. package/dist/index.js +129 -115
  92. package/dist/packages/utils/src/is.js +46 -37
  93. package/dist/style.css +1 -1
  94. package/package.json +3 -1
  95. package/dist/assets/svg/action_more.svg.js +0 -4
@@ -1,4 +1,4 @@
1
- import { defineComponent as Re, useSlots as _e, getCurrentInstance as Ie, ref as De, shallowReactive as Ke, onScopeDispose as X, computed as u, unref as r, shallowRef as Ve, toRaw as P, watch as h, toValue as S, onMounted as ke, nextTick as Y, createElementBlock as Z, openBlock as ee, normalizeClass as D, createCommentVNode as Be, createElementVNode as Le, createVNode as A, renderSlot as n, createSlots as K, renderList as te, withCtx as b, normalizeProps as oe, guardReactiveProps as re, mergeProps as se, toHandlers as xe, isRef as ze } from "vue";
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";
2
2
  import "../../tt-button/index.js";
3
3
  import "../../tt-checkbox/index.js";
4
4
  import "../../tt-empty/index.js";
@@ -7,11 +7,11 @@ import "element-plus";
7
7
  import { isFunction as je } from "../../../packages/utils/src/is.js";
8
8
  import "dayjs";
9
9
  import "numeral";
10
- import { extractResourceFromApi as Ne, generateTestId as M } from "../../../packages/utils/src/testid-helper.js";
10
+ import { extractResourceFromApi as Ne, generateTestId as O } 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 He } from "../../../packages/utils/src/merge.js";
14
+ import { mergeWithArrayOverride as We } 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 We } from "../../tt-form/src/useForm.js";
28
+ import { useForm as Je } from "../../tt-form/src/useForm.js";
29
29
  import "zod";
30
30
  import "@vee-validate/zod";
31
- import { useStore as Je } from "@tanstack/vue-store";
31
+ import { useStore as qe } 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 qe } from "../../../packages/hooks/src/useDesign.js";
37
- import { useDebounceFn as O } from "../../../packages/hooks/src/useDebounce.js";
36
+ import { useDesign as Ge } from "../../../packages/hooks/src/useDesign.js";
37
+ import { useDebounceFn as v } 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,8 +50,9 @@ 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 Ge } from "../../../hooks/useSetup.js";
53
+ import { GlobalConfig as Qe } from "../../../hooks/useSetup.js";
54
54
  import "../../tt-log/index.js";
55
+ import "../../tt-vtable/index.js";
55
56
  /* empty css */
56
57
  /* empty css */
57
58
  /* empty css */
@@ -62,24 +63,24 @@ import "../../tt-loading/index.js";
62
63
  import "../index.js";
63
64
  import "../../../hooks/basicDataCodes.js";
64
65
  import { useTemplateSlot as ae } from "../../../hooks/useTemplateSlot.js";
65
- import Qe from "./components/TableColumnModal.vue2.js";
66
+ import Ue from "./components/TableColumnModal.vue2.js";
66
67
  /* empty css */
67
- import Ue from "./components/TableToolbarTools.vue.js";
68
- import { basicTableEmits as Xe } from "./emits.js";
69
- import { useColumnPersistence as Ye } from "./hooks/useColumnPersistence.js";
70
- import { createTableFormContext as Ze } from "./hooks/useTableContext.js";
71
- import { useTableForm as et } from "./hooks/useTableForm.js";
72
- import { useSyncProps as tt } from "./hooks/useSyncProps.js";
73
- import { tableFormProps as ot } from "./props.js";
74
- import rt from "./Table.vue.js";
68
+ import Xe from "./components/TableToolbarTools.vue.js";
69
+ import { basicTableEmits as Ye } from "./emits.js";
70
+ import { useColumnPersistence as Ze } from "./hooks/useColumnPersistence.js";
71
+ import { createTableFormContext as et } from "./hooks/useTableContext.js";
72
+ import { useTableForm as tt } from "./hooks/useTableForm.js";
73
+ import { useSyncProps as ot } from "./hooks/useSyncProps.js";
74
+ import { tableFormProps as rt } from "./props.js";
75
+ import it from "./Table.vue.js";
75
76
  /* empty css */
76
77
  import { forwardedEventEntries as st } from "./table-mutation-events.js";
77
78
  import { TableFormApi as at } from "./utils/table-form-api.js";
78
- import { provideFormActionTestIds as it } from "./utils/context.js";
79
- const nt = ["data-testid"], lt = ["data-testid"], Do = /* @__PURE__ */ Re({
79
+ import { provideFormActionTestIds as nt } from "./utils/context.js";
80
+ const lt = ["data-testid"], mt = ["data-testid"], Ko = /* @__PURE__ */ _e({
80
81
  name: "TtTableForm",
81
82
  __name: "TableForm",
82
- props: ot,
83
+ props: rt,
83
84
  emits: [
84
85
  "register",
85
86
  "columns-setting",
@@ -87,285 +88,293 @@ const nt = ["data-testid"], lt = ["data-testid"], Do = /* @__PURE__ */ Re({
87
88
  "export",
88
89
  "import",
89
90
  "set-columns",
90
- ...Xe
91
+ ...Ye
91
92
  ],
92
- setup(ie, { expose: ne, emit: le }) {
93
- var J, q, G;
94
- const i = ie, y = le, $ = _e(), g = Ie(), { prefixCls: E } = qe("table-form");
95
- function V() {
93
+ setup(ne, { expose: le, emit: me }) {
94
+ var q, G, Q;
95
+ const a = ne, C = me, $ = Ie(), h = De(), { prefixCls: E } = Ge("table-form");
96
+ function k() {
96
97
  var e;
97
- return Object.hasOwn(((e = g == null ? void 0 : g.vnode) == null ? void 0 : e.props) || {}, "table");
98
+ return Object.hasOwn(((e = h == null ? void 0 : h.vnode) == null ? void 0 : e.props) || {}, "table");
98
99
  }
99
- const R = De();
100
- let t = i.tableFormApi;
101
- t || (t = new at(i), t.useStore = (e) => Je(t.store, e));
102
- const k = Ke({});
103
- function B() {
104
- Object.assign(k, P(t.store.state) || {});
100
+ const R = Ve();
101
+ let t = a.tableFormApi;
102
+ t || (t = new at(a), t.useStore = (e) => qe(t.store, e));
103
+ const B = Ke({});
104
+ function H() {
105
+ Object.assign(B, P(t.store.state) || {});
105
106
  }
106
- B(), X(t.store.subscribe(B));
107
- const c = u(() => k), w = u(() => {
107
+ H(), Y(t.store.subscribe(H));
108
+ const c = u(() => B), T = u(() => {
108
109
  var o;
109
- if (i.testId) return i.testId;
110
+ if (a.testId) return a.testId;
110
111
  const e = (o = r(c).table) == null ? void 0 : o.api;
111
112
  return e ? Ne(e) : "table";
112
- }), me = u(() => M(r(w), "tableform")), pe = u(() => M(r(w), "search-form-header"));
113
- it(
113
+ }), pe = u(() => O(r(T), "tableform")), ue = u(() => O(r(T), "search-form-header"));
114
+ nt(
114
115
  u(() => ({
115
- submit: M(r(w), "search-btn-query"),
116
- reset: M(r(w), "search-btn-reset")
116
+ submit: O(r(T), "search-btn-query"),
117
+ reset: O(r(T), "search-btn-reset")
117
118
  }))
118
119
  );
119
- const { getSlotKeys: ue, replaceSlotKey: ce } = ae("form-"), { getSlotKeys: de, replaceSlotKey: fe } = ae("t-"), { getFormProps: _, getTableProps: m, getTableToolProps: be, submitSearchQuery: L } = et(
120
+ const { getSlotKeys: ce, replaceSlotKey: de } = ae("form-"), { getSlotKeys: fe, replaceSlotKey: be } = ae("t-"), { getFormProps: _, getTableProps: m, getTableToolProps: ge, submitSearchQuery: L } = tt(
120
121
  c,
121
122
  t.tableApi.reload,
122
123
  t.tableApi.getLoading,
123
124
  t.tableApi.getPagination
124
- ), x = Ve([]), ge = u(() => (i.table, !V() || !i.table ? !1 : (i.table.data, Object.hasOwn(P(i.table), "data"))));
125
+ ), z = ke([]), he = u(() => (a.table, !k() || !a.table ? !1 : (a.table.data, Object.hasOwn(P(a.table), "data"))));
125
126
  let I = () => {
126
127
  };
127
- function he(e) {
128
- I(), I = h(
128
+ function we(e) {
129
+ I(), I = w(
129
130
  () => S(e),
130
131
  (o) => {
131
- x.value = o || [];
132
+ z.value = o || [];
132
133
  },
133
- { immediate: !0, deep: ze(e) ? !1 : 1 }
134
+ { immediate: !0, deep: xe(e) ? !1 : 1 }
134
135
  );
135
136
  }
136
137
  function Se() {
137
- if (i.table)
138
- return i.table.data, P(i.table).data;
138
+ if (a.table)
139
+ return a.table.data, P(a.table).data;
139
140
  }
140
- h(Se, (e) => he(e), { immediate: !0 });
141
- const { run: we } = O(
141
+ w(Se, (e) => we(e), { immediate: !0 });
142
+ const { run: Te } = v(
142
143
  async () => {
143
- const e = await s.getValues();
144
- await s.resetForm(e, { force: !0 });
145
- const o = await s.getValues();
146
- s.setLatestSubmissionValues(o), (await s.validate()).valid && L(o);
144
+ const e = await i.getValues();
145
+ await i.resetForm(e, { force: !0 });
146
+ const o = await i.getValues();
147
+ i.setLatestSubmissionValues(o), (await i.validate()).valid && L(o);
147
148
  },
148
149
  200,
149
150
  { leading: !0 }
150
- ), { run: Te } = O(
151
+ ), { run: ye } = v(
151
152
  async (e) => {
152
153
  await t.grid.clearFilter(), await L(e);
153
154
  },
154
155
  200,
155
156
  { leading: !0 }
156
- ), [ye, s] = We({
157
+ ), [ve, i] = Je({
157
158
  ...S(_),
158
- handleSubmit: Te,
159
- handleReset: we,
159
+ handleSubmit: ye,
160
+ handleReset: Te,
160
161
  submitOnEnter: !0,
161
162
  submitButtonOptions: {
162
- content: (J = Ge.form) == null ? void 0 : J.submitTitle
163
+ content: (q = Qe.form) == null ? void 0 : q.submitTitle
163
164
  },
164
165
  showCollapseButton: !0,
165
166
  collapsed: !0,
166
167
  collapseTriggerResize: !0,
167
168
  collapsedRows: 3
168
- }), { restoreColumns: ve, saveColumns: z } = Ye({
169
+ }), { restoreColumns: Ce, saveColumns: x } = Ze({
169
170
  getTableProps: m,
170
171
  getProps: c,
171
172
  tableMethods: t.tableApi
172
173
  });
173
174
  let d = !1;
174
- const T = {};
175
+ const y = {};
175
176
  st.forEach(([e, o]) => {
176
- T[o] = (...a) => y(e, ...a);
177
+ y[o] = (...s) => C(e, ...s);
177
178
  });
178
- const { run: Fe } = O(async () => {
179
+ const { run: Fe } = v(async () => {
179
180
  if (d || !r(m).useHttpCache) return;
180
181
  const e = (t.tableApi.getTableColumns() || []).map((o) => o.field).filter(Boolean);
181
- e.length && await z(JSON.stringify(e));
182
+ e.length && await x(JSON.stringify(e));
182
183
  }, 300);
183
- function Ce(e) {
184
+ function Ae(e) {
184
185
  var o;
185
- (o = T.columnDragend) == null || o.call(T, e), Fe();
186
+ (o = y.columnDragend) == null || o.call(y, e), Fe();
186
187
  }
187
- const Pe = u(() => ({ ...T, columnDragend: Ce }));
188
- function Ae(e) {
189
- t.setState((o) => o.table ? He(e, o) : {}), e.table && t.tableApi.setState(e.table), e.form && (s == null || s.setState(e.form));
188
+ const Pe = u(() => ({ ...y, columnDragend: Ae }));
189
+ function Me(e) {
190
+ t.setState((o) => o.table ? We(e, o) : {}), e.table && t.tableApi.setState(e.table), e.form && (i == null || i.setState(e.form));
190
191
  }
191
- const { run: Me } = O(
192
+ const { run: Oe } = v(
192
193
  async (e) => {
193
- if (s.isMounted && r(c).useSearchForm) {
194
- if (!(await s.validate()).valid) return;
195
- const a = await s.getValues();
196
- await t.tableApi.reload({ ...e, searchInfo: { ...e == null ? void 0 : e.searchInfo, ...a } });
194
+ if (i.isMounted && r(c).useSearchForm) {
195
+ if (!(await i.validate()).valid) return;
196
+ const s = await i.getValues();
197
+ await t.tableApi.reload({ ...e, searchInfo: { ...e == null ? void 0 : e.searchInfo, ...s } });
197
198
  return;
198
199
  }
199
200
  await t.tableApi.reload({ ...e, searchInfo: { ...e == null ? void 0 : e.searchInfo } });
200
201
  },
201
202
  200,
202
203
  { leading: !0 }
203
- ), v = {
204
+ ), F = {
204
205
  tableMethods: t.tableApi,
205
- formMethods: s,
206
+ formMethods: i,
206
207
  setTableProps: t.tableApi.setState,
207
- setFormProps: s.setState,
208
- setProps: Ae,
209
- reload: Me,
208
+ setFormProps: i.setState,
209
+ setProps: Me,
210
+ reload: Oe,
210
211
  selectedKeys: u(() => S(t.tableApi.selectedKeys))
211
212
  };
212
- async function Oe() {
213
+ async function $e() {
213
214
  const { tableRefreshBefore: e } = r(c);
214
- je(e) && await e(), v.reload();
215
- }
216
- async function j() {
217
- var e;
218
- await Y(), !d && ((e = t.tableApi) == null || e.redoHeight());
215
+ je(e) && await e(), F.reload();
219
216
  }
220
- async function $e(e) {
221
- var F, C;
217
+ let D = { width: window.innerWidth, height: window.innerHeight };
218
+ const { run: j } = v(async () => {
219
+ var n, f;
220
+ if (await Z(), d) return;
221
+ const { innerWidth: e, innerHeight: o } = window, s = e !== D.width || o !== D.height;
222
+ if (D = { width: e, height: o }, !s) {
223
+ if (!r(m).autoHeight) return;
224
+ (n = t.tableApi) == null || n.redoHeight(!1);
225
+ return;
226
+ }
227
+ (f = t.tableApi) == null || f.redoHeight();
228
+ }, 100);
229
+ async function Ee(e) {
230
+ var f, A;
222
231
  if (d) return;
223
- const o = S((C = (F = r(c)) == null ? void 0 : F.table) == null ? void 0 : C.columns) || [], a = new Map(o.map((f) => [f.field, f])), l = e.checkedModel.map((f) => a.get(f)).filter(Boolean);
232
+ 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);
224
233
  if (e.isExport) {
225
- y("export", e.checkedModel, e.modalApi);
234
+ C("export", e.checkedModel, e.modalApi);
226
235
  return;
227
236
  }
228
237
  e.modalApi.setModalProps({ confirmLoading: !0 });
229
238
  try {
230
- if (r(m).useHttpCache && await z(JSON.stringify(e.checkedModel)), d) return;
231
- t.tableApi.setTableColumns(l), e.modalApi.closeModal(), y("set-columns", l);
239
+ if (r(m).useHttpCache && await x(JSON.stringify(e.checkedModel)), d) return;
240
+ t.tableApi.setTableColumns(n), e.modalApi.closeModal(), C("set-columns", n);
232
241
  } finally {
233
242
  d || e.modalApi.setModalProps({ confirmLoading: !1 });
234
243
  }
235
244
  }
236
245
  function N(e, o = !1) {
237
- var f, Q, U;
238
- const { notSetColumnField: a, columns: l } = r(m), F = ((((f = t.tableApi.getTableInstance()) == null ? void 0 : f.getTableColumn()) || {}).visibleColumn || []).map((p) => p.field).filter(Boolean), C = (S(l) || []).filter((p) => p.visible === !0 || p.visible === void 0).map((p) => p.field);
239
- (Q = R.value) == null || Q.openModal({
240
- columns: (S(l) || []).filter((p) => p.visible !== !1),
241
- displayFields: o ? C : F,
242
- disabledColumnField: a || [],
246
+ var b, U, X;
247
+ 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);
248
+ (U = R.value) == null || U.openModal({
249
+ columns: (S(n) || []).filter((p) => p.visible !== !1),
250
+ displayFields: o ? A : f,
251
+ disabledColumnField: s || [],
243
252
  isExport: e
244
- }), (U = R.value) == null || U.setModalProps({ title: e ? "自定义导出" : "列设置" });
253
+ }), (X = R.value) == null || X.setModalProps({ title: e ? "自定义导出" : "列设置" });
245
254
  }
246
- function H(e = !1) {
255
+ function W(e = !1) {
247
256
  N(!1, e);
248
257
  }
249
- function W(e = !1) {
258
+ function J(e = !1) {
250
259
  N(!0, e);
251
260
  }
252
- function Ee() {
253
- const e = i.table;
254
- if (!V() || !e) return;
261
+ function Re() {
262
+ const e = a.table;
263
+ if (!k() || !e) return;
255
264
  const o = {};
256
- return Object.keys(P(e)).forEach((a) => {
257
- a !== "data" && Object.assign(o, { [a]: e[a] });
265
+ return Object.keys(P(e)).forEach((s) => {
266
+ s !== "data" && Object.assign(o, { [s]: e[s] });
258
267
  }), o;
259
268
  }
260
- return tt(i, t.setState, ["tableFormApi", "table"]), h(
261
- Ee,
269
+ return ot(a, t.setState, ["tableFormApi", "table"]), w(
270
+ Re,
262
271
  (e) => {
263
272
  e && t.setState({ table: e });
264
273
  },
265
274
  { deep: !0, immediate: !0 }
266
- ), Ze({ formInstance: s }), h(
275
+ ), et({ formInstance: i }), w(
267
276
  () => t.tableApi.getLoading.value,
268
277
  (e) => {
269
- s == null || s.setState({ submitButtonOptions: { loading: e } });
278
+ i == null || i.setState({ submitButtonOptions: { loading: e } });
270
279
  },
271
- { immediate: (G = (q = t.store.state) == null ? void 0 : q.table) == null ? void 0 : G.immediate }
272
- ), h(_, (e) => s == null ? void 0 : s.setState(e)), h(m, (e) => {
280
+ { immediate: (Q = (G = t.store.state) == null ? void 0 : G.table) == null ? void 0 : Q.immediate }
281
+ ), w(_, (e) => i == null ? void 0 : i.setState(e)), w(m, (e) => {
273
282
  var o;
274
283
  return (o = t.tableApi) == null ? void 0 : o.setState(e);
275
- }), ke(() => {
276
- g && y("register", v, g.uid), t.mount(v, s), s == null || s.setState(r(_)), Y(() => {
277
- d || ve();
284
+ }), Be(() => {
285
+ h && C("register", F, h.uid), t.mount(F, i), i == null || i.setState(r(_)), Z(() => {
286
+ d || Ce();
278
287
  }), window.addEventListener("resize", j);
279
- }), X(() => {
288
+ }), Y(() => {
280
289
  d = !0, I(), t == null || t.unmount(), window.removeEventListener("resize", j);
281
- }), ne({ ...v, instance: g }), (e, o) => (ee(), Z("div", {
282
- class: D(r(E)),
283
- "data-testid": me.value
290
+ }), le({ ...F, instance: h }), (e, o) => (te(), ee("div", {
291
+ class: V(r(E)),
292
+ "data-testid": pe.value
284
293
  }, [
285
- c.value.useSearchForm ? (ee(), Z("div", {
294
+ c.value.useSearchForm ? (te(), ee("div", {
286
295
  key: 0,
287
- class: D(`${r(E)}-header`),
288
- "data-testid": pe.value
296
+ class: V(`${r(E)}-header`),
297
+ "data-testid": ue.value
289
298
  }, [
290
- A(r(ye), {
291
- "test-id": `${w.value}-search-form`
299
+ M(r(ve), {
300
+ "test-id": `${T.value}-search-form`
292
301
  }, K({ _: 2 }, [
293
- te(r(ue)(r($)), (a) => ({
294
- name: r(ce)(a),
295
- fn: b((l) => [
296
- n(e.$slots, a, oe(re(l || {})))
302
+ oe(r(ce)(r($)), (s) => ({
303
+ name: r(de)(s),
304
+ fn: g((n) => [
305
+ l(e.$slots, s, re(ie(n || {})))
297
306
  ])
298
307
  }))
299
308
  ]), 1032, ["test-id"]),
300
- n(e.$slots, "header-down")
301
- ], 10, lt)) : Be("", !0),
309
+ l(e.$slots, "header-down")
310
+ ], 10, mt)) : He("", !0),
302
311
  Le("div", {
303
- class: D({
312
+ class: V({
304
313
  [`${r(E)}-wrapper`]: !0,
305
314
  "pt-(--tt-base-padding)!": !0,
306
315
  "pb-(--tt-base-padding)!": !r(m).showPager
307
316
  })
308
317
  }, [
309
- n(e.$slots, "table-top"),
310
- A(rt, se({
318
+ l(e.$slots, "table-top"),
319
+ M(it, se({
311
320
  ...r(m),
312
- ...ge.value ? { data: x.value } : {}
321
+ ...he.value ? { data: z.value } : {}
313
322
  }, {
314
- "form-api": r(s),
323
+ "form-api": r(i),
315
324
  "table-api": r(t).tableApi
316
- }, xe(Pe.value)), K({ _: 2 }, [
317
- te(r(de)(r($)), (a) => ({
318
- name: r(fe)(a),
319
- fn: b((l) => [
320
- n(e.$slots, a, oe(re(l || {})))
325
+ }, ze(Pe.value)), K({ _: 2 }, [
326
+ oe(r(fe)(r($)), (s) => ({
327
+ name: r(be)(s),
328
+ fn: g((n) => [
329
+ l(e.$slots, s, re(ie(n || {})))
321
330
  ])
322
331
  })),
323
332
  r(m).showToolbar ? {
324
333
  name: "toolbar_tools",
325
- fn: b(() => [
326
- A(Ue, se(r(be), {
327
- onOnRefresh: Oe,
328
- onOnExport: W,
329
- onOnColumnsSetting: H
334
+ fn: g(() => [
335
+ M(Xe, se(r(ge), {
336
+ onOnRefresh: $e,
337
+ onOnExport: J,
338
+ onOnColumnsSetting: W
330
339
  }), {
331
- "toolbar-left": b(() => [
332
- n(e.$slots, "t-toolbar_tools-left")
340
+ "toolbar-left": g(() => [
341
+ l(e.$slots, "t-toolbar_tools-left")
333
342
  ]),
334
- "toolbar-right": b(() => [
335
- n(e.$slots, "t-toolbar_tools-right")
343
+ "toolbar-right": g(() => [
344
+ l(e.$slots, "t-toolbar_tools-right")
336
345
  ]),
337
346
  _: 3
338
347
  }, 16),
339
- n(e.$slots, "t-toolbar_tools")
348
+ l(e.$slots, "t-toolbar_tools")
340
349
  ]),
341
350
  key: "0"
342
351
  } : void 0
343
352
  ]), 1040, ["form-api", "table-api"]),
344
- n(e.$slots, "table-bottom")
353
+ l(e.$slots, "table-bottom")
345
354
  ], 2),
346
- A(Qe, {
355
+ M(Ue, {
347
356
  ref_key: "columnModalRef",
348
357
  ref: R,
349
- "open-export": W,
350
- "open-column": H,
351
- onOnSubmit: $e
358
+ "open-export": J,
359
+ "open-column": W,
360
+ onOnSubmit: Ee
352
361
  }, K({
353
- beforeFooter: b(() => [
354
- n(e.$slots, "t-column-modal-before-footer")
362
+ beforeFooter: g(() => [
363
+ l(e.$slots, "t-column-modal-before-footer")
355
364
  ]),
356
365
  _: 2
357
366
  }, [
358
367
  r($)["t-column-modal-title"] ? {
359
368
  name: "title",
360
- fn: b(() => [
361
- n(e.$slots, "t-column-modal-title")
369
+ fn: g(() => [
370
+ l(e.$slots, "t-column-modal-title")
362
371
  ]),
363
372
  key: "0"
364
373
  } : void 0
365
374
  ]), 1536)
366
- ], 10, nt));
375
+ ], 10, lt));
367
376
  }
368
377
  });
369
378
  export {
370
- Do as default
379
+ Ko as default
371
380
  };
@@ -32,11 +32,7 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
32
32
  /** 是否分割线 */
33
33
  /** 是否清除冒泡 */
34
34
  stopButtonPropagation: any;
35
- /** 显示buttton的个数 默认是2 */
36
- showBtnNums: any;
37
- /** 弹出框的宽度 */
38
- popoverWidth: any;
39
- /** 是否自动换行 */
35
+ /** 操作按钮在宽度不足时是否自动换行 */
40
36
  wrap: any;
41
37
  }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
42
38
  /** 操作项 */
@@ -57,11 +53,7 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
57
53
  /** 是否分割线 */
58
54
  /** 是否清除冒泡 */
59
55
  stopButtonPropagation: any;
60
- /** 显示buttton的个数 默认是2 */
61
- showBtnNums: any;
62
- /** 弹出框的宽度 */
63
- popoverWidth: any;
64
- /** 是否自动换行 */
56
+ /** 操作按钮在宽度不足时是否自动换行 */
65
57
  wrap: any;
66
58
  }>> & Readonly<{}>, {
67
59
  wrap: any;
@@ -69,8 +61,6 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
69
61
  actions: TtActionItem[];
70
62
  slotContext: Record<string, any>;
71
63
  stopButtonPropagation: any;
72
- showBtnNums: any;
73
- popoverWidth: any;
74
64
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
75
65
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
76
66
  export default _default;