@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,13 +1,15 @@
1
- import { defineComponent as q, useAttrs as G, ref as x, inject as A, computed as d, unref as r, h as J, onMounted as Q, createElementBlock as s, openBlock as i, normalizeClass as w, createVNode as k, createBlock as c, createCommentVNode as p, withCtx as u, Fragment as m, renderList as S, renderSlot as Z, withDirectives as F, mergeProps as ee, normalizeStyle as W, toDisplayString as E, createElementVNode as te, withModifiers as oe, createSlots as re, createTextVNode as ne } from "vue";
2
- import { propTypes as v } from "../../../../packages/hooks/src/propTypes.js";
3
- import { useDesign as ie } from "../../../../packages/hooks/src/useDesign.js";
1
+ import { defineComponent as F, useAttrs as j, inject as b, computed as d, unref as n, h as z, onMounted as E, createElementBlock as l, openBlock as i, normalizeClass as x, createVNode as O, withCtx as y, Fragment as p, renderList as P, renderSlot as R, withDirectives as U, mergeProps as K, createBlock as I, normalizeStyle as V, createCommentVNode as c, toDisplayString as H } from "vue";
2
+ import { propTypes as w } from "../../../../packages/hooks/src/propTypes.js";
3
+ import { useDesign as L } from "../../../../packages/hooks/src/useDesign.js";
4
4
  import "axios";
5
- import { ElDivider as le, ElSpace as se, ElPopover as ae } from "element-plus";
6
- import { isNullOrUnDef as f, isBoolean as de, isFunction as pe, isArray as ue, isObject as ce } from "../../../../packages/utils/src/is.js";
5
+ import { ElDivider as M, ElSpace as W } from "element-plus";
6
+ import { isNullOrUnDef as a, isBoolean as X, isFunction as Y, isArray as q, isObject as G } from "../../../../packages/utils/src/is.js";
7
7
  import "dayjs";
8
8
  import "numeral";
9
- import { generateTestId as M, toKebabCase as D } from "../../../../packages/utils/src/testid-helper.js";
10
- import { calcWordsWidth as me } from "../../../../packages/utils/src/tool.js";
9
+ import { generateTestId as g, toKebabCase as C } from "../../../../packages/utils/src/testid-helper.js";
10
+ import "xe-utils";
11
+ import "dayjs/plugin/utc";
12
+ import "dayjs/plugin/timezone";
11
13
  import "../../../../node_modules/.pnpm/decimal.js@10.6.0/node_modules/decimal.js/decimal.js";
12
14
  import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/aes.js";
13
15
  import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/enc-utf8.js";
@@ -15,13 +17,12 @@ import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mo
15
17
  import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-pkcs7.js";
16
18
  import "lodash-es";
17
19
  import "vue-router";
18
- import { TtButton as C } from "../../../tt-button/index.js";
19
- import { TtIcon as I } from "../../../tt-icon/index.js";
20
- import P from "../../../../directives/disabled-tip/index.js";
21
- import fe from "../../../../assets/svg/action_more.svg.js";
22
- import { ROW_INDEX_KEY as be } from "./RowContext.js";
23
- import { scheduleNormalizeActionTabIndex as ve } from "../utils/action-tab-index.js";
24
- const ye = { key: 1 }, ge = ["onClick"], Ve = /* @__PURE__ */ q({
20
+ import { TtButton as J } from "../../../tt-button/index.js";
21
+ import { TtIcon as Q } from "../../../tt-icon/index.js";
22
+ import Z from "../../../../directives/disabled-tip/index.js";
23
+ import { ROW_INDEX_KEY as tt } from "./RowContext.js";
24
+ import { scheduleNormalizeActionTabIndex as et } from "../utils/action-tab-index.js";
25
+ const ot = { key: 1 }, _t = /* @__PURE__ */ F({
25
26
  name: "TtTableAction",
26
27
  __name: "TableAction",
27
28
  props: {
@@ -43,199 +44,101 @@ const ye = { key: 1 }, ge = ["onClick"], Ve = /* @__PURE__ */ q({
43
44
  /** 是否分割线 */
44
45
  // divider: propTypes.bool.def(true),
45
46
  /** 是否清除冒泡 */
46
- stopButtonPropagation: v.bool.def(!1),
47
- /** 显示buttton的个数 默认是2 */
48
- showBtnNums: v.number.def(100),
49
- /** 弹出框的宽度 */
50
- popoverWidth: v.number.def(27),
51
- /** 是否自动换行 */
52
- wrap: v.bool.def(!0)
47
+ stopButtonPropagation: w.bool.def(!1),
48
+ /** 操作按钮在宽度不足时是否自动换行 */
49
+ wrap: w.bool.def(!0)
53
50
  },
54
- setup(T) {
55
- const l = T, B = G(), { prefixCls: N } = ie("table-action"), b = x(!1), z = A(
51
+ setup(u) {
52
+ const s = u, f = j(), { prefixCls: h } = L("table-action"), k = b(
56
53
  "tableIdContext",
57
54
  d(() => "")
58
- ), R = A(be, void 0), j = d(() => {
55
+ ), T = b(tt, void 0), v = d(() => {
59
56
  var o;
60
- if (!f(l.rowIndex))
61
- return l.rowIndex;
62
- const t = r(R);
63
- if (!f(t))
64
- return t;
65
- if (!f((o = l.slotContext) == null ? void 0 : o.$rowIndex))
66
- return l.slotContext.$rowIndex;
67
- if (!f(B.$rowIndex))
68
- return B.$rowIndex;
57
+ if (!a(s.rowIndex))
58
+ return s.rowIndex;
59
+ const e = n(T);
60
+ if (!a(e))
61
+ return e;
62
+ if (!a((o = s.slotContext) == null ? void 0 : o.$rowIndex))
63
+ return s.slotContext.$rowIndex;
64
+ if (!a(f.$rowIndex))
65
+ return f.$rowIndex;
69
66
  });
70
- function y(t) {
71
- const o = r(z), e = j.value;
72
- return f(e) ? M(o, "action", D(t)) : M(o, "action", `row${e}`, D(t));
67
+ function B(e) {
68
+ const o = n(k), t = v.value;
69
+ return a(t) ? g(o, "action", C(e)) : g(o, "action", `row${t}`, C(e));
73
70
  }
74
- function _(t) {
75
- const o = t.ifShow;
76
- let e = !0;
77
- return de(o) && (e = o), pe(o) && (e = o(t)), e;
71
+ function _(e) {
72
+ const o = e.ifShow;
73
+ let t = !0;
74
+ return X(o) && (t = o), Y(o) && (t = o(e)), t;
78
75
  }
79
- const O = d(() => (l.actions || []).filter((t) => _(t)).slice(0, l.showBtnNums)), g = d(() => (l.actions || []).filter((t) => _(t)).slice(l.showBtnNums)), V = d(() => r(g).length > 0), U = d(() => "left flex items-center"), K = d(() => {
80
- const t = document.getElementsByTagName("body")[0], o = window.getComputedStyle(t).fontFamily, e = g.value.map((a) => me(a.label, "12px", o) + 22), n = Math.max(...e);
81
- return n > l.popoverWidth ? n : l.popoverWidth;
82
- });
83
- function $(t, o) {
84
- const e = t;
85
- return ue(e) && e.length > 0 ? e.some((n) => !!(n != null && n.condition)) : ce(e) ? !!e.condition : !!o;
76
+ const A = d(() => (s.actions || []).filter((e) => _(e))), S = d(() => "left flex items-center");
77
+ function N(e, o) {
78
+ const t = e;
79
+ return q(t) && t.length > 0 ? t.some((r) => !!(r != null && r.condition)) : G(t) ? !!t.condition : !!o;
86
80
  }
87
- function H(t) {
88
- if (!l.stopButtonPropagation) return;
89
- t.composedPath().find((n) => {
90
- var a;
91
- return ((a = n.tagName) == null ? void 0 : a.toUpperCase()) === "BUTTON";
92
- }) && t.stopPropagation();
81
+ function $(e) {
82
+ if (!s.stopButtonPropagation) return;
83
+ e.composedPath().find((r) => {
84
+ var m;
85
+ return ((m = r.tagName) == null ? void 0 : m.toUpperCase()) === "BUTTON";
86
+ }) && e.stopPropagation();
93
87
  }
94
- const L = J(le, {
88
+ const D = z(M, {
95
89
  direction: "vertical",
96
90
  style: { fontSize: "12px", margin: "0 6px" }
97
91
  });
98
- function X(t) {
99
- b.value = !0, h.value = t.target && t.target.getBoundingClientRect();
100
- }
101
- const h = x({
102
- top: 0,
103
- left: 0,
104
- bottom: 0,
105
- right: 0
106
- });
107
- Q(() => ve());
108
- const Y = x({
109
- getBoundingClientRect() {
110
- return h.value;
111
- }
112
- });
113
- return (t, o) => (i(), s("div", {
114
- class: w([r(N), U.value]),
92
+ return E(() => et()), (e, o) => (i(), l("div", {
93
+ class: x([n(h), S.value]),
115
94
  tabindex: "-1",
116
- onClick: H
95
+ onClick: $
117
96
  }, [
118
- k(r(se), {
97
+ O(n(W), {
119
98
  size: 0,
120
- spacer: r(L),
121
- wrap: T.wrap
99
+ spacer: n(D),
100
+ wrap: u.wrap
122
101
  }, {
123
- default: u(() => [
124
- (i(!0), s(m, null, S(O.value, (e, n) => (i(), s(m, {
125
- key: `${n}-${e.label}`
102
+ default: y(() => [
103
+ (i(!0), l(p, null, P(A.value, (t, r) => (i(), l(p, {
104
+ key: `${r}-${t.label}`
126
105
  }, [
127
- e.slot ? Z(t.$slots, e.slot, ee({
106
+ t.slot ? R(e.$slots, t.slot, K({
128
107
  key: 0,
129
108
  ref_for: !0
130
- }, e)) : F((i(), c(r(C), {
109
+ }, t)) : U((i(), I(n(J), {
131
110
  key: 1,
132
111
  link: "",
133
- type: e.type || "primary",
134
- disabled: $(e.disabledTip, e.disabled),
135
- style: W({ color: e.color, visibility: e.isTextHide ? "hidden" : "visible" }),
136
- loading: e.loading,
137
- "data-index": n,
112
+ type: t.type || "primary",
113
+ disabled: N(t.disabledTip, t.disabled),
114
+ style: V({ color: t.color, visibility: t.isTextHide ? "hidden" : "visible" }),
115
+ loading: t.loading,
116
+ "data-index": r,
138
117
  "data-table-action-button": "",
139
- "data-testid": y(e.label || ""),
140
- onClick: e.onClick
118
+ "data-testid": B(t.label || ""),
119
+ onClick: t.onClick
141
120
  }, {
142
- default: u(() => [
143
- e.iconFont ? (i(), s(m, { key: 0 }, [
144
- e.iconFont ? (i(), c(r(I), {
121
+ default: y(() => [
122
+ t.iconFont ? (i(), l(p, { key: 0 }, [
123
+ t.iconFont ? (i(), I(n(Q), {
145
124
  key: 0,
146
- "icon-font": e.iconFont,
147
- class: w({ "mr-1": !!e.label })
148
- }, null, 8, ["icon-font", "class"])) : p("", !0)
149
- ], 64)) : p("", !0),
150
- e.label ? (i(), s("span", ye, E(e.label), 1)) : p("", !0)
125
+ "icon-font": t.iconFont,
126
+ class: x({ "mr-1": !!t.label })
127
+ }, null, 8, ["icon-font", "class"])) : c("", !0)
128
+ ], 64)) : c("", !0),
129
+ t.label ? (i(), l("span", ot, H(t.label), 1)) : c("", !0)
151
130
  ]),
152
131
  _: 2
153
132
  }, 1032, ["type", "disabled", "style", "loading", "data-index", "data-testid", "onClick"])), [
154
- [r(P), e.disabledTip]
133
+ [n(Z), t.disabledTip]
155
134
  ])
156
- ], 64))), 128)),
157
- V.value ? (i(), c(r(C), {
158
- key: 0,
159
- link: "",
160
- type: "primary",
161
- "data-testid": y("more")
162
- }, {
163
- default: u(() => [
164
- te("span", {
165
- onMouseover: oe(X, ["stop"]),
166
- onMouseleave: o[0] || (o[0] = (e) => b.value = !1)
167
- }, [
168
- k(r(I), {
169
- icon: r(fe),
170
- "is-custom-svg": "",
171
- size: 14
172
- }, null, 8, ["icon"])
173
- ], 32)
174
- ]),
175
- _: 1
176
- }, 8, ["data-testid"])) : p("", !0)
135
+ ], 64))), 128))
177
136
  ]),
178
137
  _: 3
179
- }, 8, ["spacer", "wrap"]),
180
- h.value.left ? (i(), c(r(ae), {
181
- key: 0,
182
- visible: b.value,
183
- "onUpdate:visible": o[1] || (o[1] = (e) => b.value = e),
184
- trigger: "hover",
185
- placement: "bottom",
186
- width: K.value,
187
- offset: 8,
188
- "hide-after": 0,
189
- "virtual-ref": Y.value,
190
- "virtual-triggering": "",
191
- "popper-class": `${r(N)}-popover-class`,
192
- "popper-style": {
193
- padding: "6px 0px",
194
- minWidth: "60px"
195
- }
196
- }, {
197
- default: u(() => [
198
- (i(!0), s(m, null, S(g.value, (e, n) => (i(), s("div", {
199
- key: `${n}-${e.label}`,
200
- onClick: () => {
201
- var a;
202
- !e.disabled && ((a = e.onClick) == null || a.call(e));
203
- }
204
- }, [
205
- F((i(), c(r(C), {
206
- link: "",
207
- disabled: $(e.disabledTip, e.disabled),
208
- type: e.type || "primary",
209
- style: W({ color: e.color }),
210
- "data-testid": y(e.label || "")
211
- }, re({
212
- default: u(() => [
213
- e.label ? (i(), s(m, { key: 0 }, [
214
- ne(E(e.label), 1)
215
- ], 64)) : p("", !0)
216
- ]),
217
- _: 2
218
- }, [
219
- e.iconFont ? {
220
- name: "icon",
221
- fn: u(() => [
222
- k(r(I), {
223
- "icon-font": e.iconFont,
224
- class: w({ "mr-1": !!e.label })
225
- }, null, 8, ["icon-font", "class"])
226
- ]),
227
- key: "0"
228
- } : void 0
229
- ]), 1032, ["disabled", "type", "style", "data-testid"])), [
230
- [r(P), e.disabledTip]
231
- ])
232
- ], 8, ge))), 128))
233
- ]),
234
- _: 1
235
- }, 8, ["visible", "width", "virtual-ref", "popper-class"])) : p("", !0)
138
+ }, 8, ["spacer", "wrap"])
236
139
  ], 2));
237
140
  }
238
141
  });
239
142
  export {
240
- Ve as default
143
+ _t as default
241
144
  };
@@ -1,121 +1,125 @@
1
- import { useTimeoutFn as H } from "@vueuse/core";
2
- import { omit as y } from "lodash-es";
3
- import { computed as b, unref as f } from "vue";
4
- import { tableProps as L } from "../props.js";
5
- const K = [...Object.keys(L), "modelValue", "data", "columns"], j = {
1
+ import { useTimeoutFn as K } from "@vueuse/core";
2
+ import { omit as S } from "lodash-es";
3
+ import { computed as T, unref as d } from "vue";
4
+ import { tableProps as j } from "../props.js";
5
+ const D = [...Object.keys(j), "modelValue", "data", "columns"], F = {
6
6
  orders: ["desc", "asc", null],
7
7
  trigger: "cell",
8
8
  allowClear: !0,
9
9
  showIcon: !0
10
10
  };
11
- function D(e) {
12
- const { expandConfig: i, hasExpandColumn: t, treeConfig: o } = e;
13
- return !(o && !o.transform || t && (i == null ? void 0 : i.mode) !== "fixed");
11
+ function q(o) {
12
+ return !!(o.autoHeight || o.height || o.maxHeight);
14
13
  }
15
- function F({
16
- $table: e,
14
+ function G(o) {
15
+ const { expandConfig: i, hasExpandColumn: t, treeConfig: e } = o;
16
+ return !(!o.hasScrollViewport || e && !e.transform || t && (i == null ? void 0 : i.mode) !== "fixed");
17
+ }
18
+ function I({
19
+ $table: o,
17
20
  column: i
18
21
  }) {
19
- var d, h;
20
- const t = (d = e == null ? void 0 : e.getEl) == null ? void 0 : d.call(e);
22
+ var f, h;
23
+ const t = (f = o == null ? void 0 : o.getEl) == null ? void 0 : f.call(o);
21
24
  if (!t) return "auto";
22
- const { visibleColumn: o = [] } = e.getTableColumn() || {}, a = o.reduce(
25
+ const { visibleColumn: e = [] } = o.getTableColumn() || {}, l = e.reduce(
23
26
  (r, n) => r + (n.id === i.id ? 0 : Number(n.renderWidth) || 0),
24
27
  0
25
- ), c = ((h = t.querySelector(".vxe-table--scroll-y-virtual")) == null ? void 0 : h.offsetWidth) || 0, l = t.clientWidth - a - c;
26
- return l > 0 ? l : "auto";
28
+ ), C = ((h = t.querySelector(".vxe-table--scroll-y-virtual")) == null ? void 0 : h.offsetWidth) || 0, a = t.clientWidth - l - C;
29
+ return a > 0 ? a : "auto";
27
30
  }
28
- function B(e, { attrs: i, slots: t }, o = {}) {
29
- const a = /* @__PURE__ */ new WeakMap(), { start: c } = H(() => {
31
+ function Q(o, { attrs: i, slots: t }, e = {}) {
32
+ const l = /* @__PURE__ */ new WeakMap(), { start: C } = K(() => {
30
33
  var r;
31
- return (r = o.onTreeLoadResolved) == null ? void 0 : r.call(o);
34
+ return (r = e.onTreeLoadResolved) == null ? void 0 : r.call(e);
32
35
  }, 0, {
33
36
  immediate: !1
34
37
  });
35
- function l(r) {
36
- const n = a.get(r);
38
+ function a(r) {
39
+ const n = l.get(r);
37
40
  if (n) return n;
38
- const g = async (p) => {
39
- var C;
40
- const m = await r(p);
41
- return (C = o.prepareRows) == null || C.call(o, m), c(), m;
41
+ const g = async (w) => {
42
+ var m;
43
+ const c = await r(w);
44
+ return (m = e.prepareRows) == null || m.call(e, c), C(), c;
42
45
  };
43
- return a.set(r, g), g;
46
+ return l.set(r, g), g;
44
47
  }
45
- const d = b(() => {
46
- var M;
48
+ const f = T(() => {
49
+ var y;
47
50
  const {
48
51
  checkboxConfig: r,
49
52
  rowConfig: n,
50
53
  columnConfig: g,
51
- resizableConfig: p,
52
- isCellResize: m,
53
- showToolbar: C,
54
- toolbarConfig: T = {},
54
+ resizableConfig: w,
55
+ isCellResize: c,
56
+ showToolbar: m,
57
+ toolbarConfig: V = {},
55
58
  showPager: W,
56
- autoHeight: E,
57
- virtualYConfig: w = {},
59
+ autoHeight: b,
60
+ virtualYConfig: p = {},
58
61
  expandConfig: v = {},
59
- treeConfig: s,
60
- sortConfig: R,
61
- showHeaderTooltip: z,
62
+ treeConfig: u,
63
+ sortConfig: z,
64
+ showHeaderTooltip: E,
62
65
  showCellTooltip: O,
63
- showOverflow: V,
64
- reserveSelection: Y,
66
+ showOverflow: R,
67
+ reserveSelection: H,
65
68
  footerMethod: _
66
- } = f(e), u = {}, P = Object.hasOwn(w, "enabled") ? w.enabled : D({
69
+ } = d(o), s = {}, P = Object.hasOwn(p, "enabled"), x = q(d(o)), Y = x ? P ? p.enabled : G({
67
70
  expandConfig: v,
68
- hasExpandColumn: f(o.hasExpandColumn),
69
- treeConfig: s
70
- }), S = ((M = o.toVxeRowConfig) == null ? void 0 : M.call(o, n)) || n, x = _ ? void 0 : f(o.footerSummaryMethod);
71
- return C && (u.toolbarConfig = {
71
+ hasExpandColumn: d(e.hasExpandColumn),
72
+ treeConfig: u,
73
+ hasScrollViewport: x
74
+ }) : !1, L = ((y = e.toVxeRowConfig) == null ? void 0 : y.call(e, n)) || n, M = _ ? void 0 : d(e.footerSummaryMethod);
75
+ return m && (s.toolbarConfig = {
72
76
  slots: t.toolbar_tools || t.toolbar_buttons ? {
73
77
  tools: t.toolbar_tools ? "toolbar_tools" : void 0,
74
78
  buttons: t.toolbar_buttons ? "toolbar_buttons" : void 0
75
79
  } : void 0,
76
- ...T
77
- }), W || (u.pagerConfig = void 0), E && (u.height = "auto", u.autoResize = !0, u.syncResize = !0), {
80
+ ...V
81
+ }), W || (s.pagerConfig = void 0), b && (s.height = "auto", s.autoResize = !0, s.syncResize = !0), {
78
82
  // 去除 data 与 columns,避免与内部数据、列管理冲突
79
- ...y(f(e), ["data", "columns"]),
80
- ...u,
81
- virtualYConfig: { enabled: P, mode: "wheel", ...w },
83
+ ...S(d(o), ["data", "columns"]),
84
+ ...s,
85
+ virtualYConfig: { enabled: Y, mode: "wheel", ...p },
82
86
  // 表头 tooltip 由 vxe 负责:开启时翻译成 showHeaderOverflow: "tooltip",
83
87
  // 由它自己做溢出检测(scrollWidth > clientWidth)并弹层,样式走原生 headerTooltipConfig。
84
88
  // 关闭时固定 false —— 一旦命中任意溢出值,vxe 会给表头单元格加 col--ellipsis 并把
85
89
  // 内层 .vxe-cell 的高度从 minHeight 改成固定 height,表头高度算法就变了。
86
90
  // 固定 false 也意味着调用方传入的 showHeaderOverflow 不参与判定,与改动前一致。
87
- showHeaderOverflow: z ? "tooltip" : !1,
91
+ showHeaderOverflow: E ? "tooltip" : !1,
88
92
  // 单元格 tooltip 同样交给 vxe,但与表头侧不对称:表头侧改动前无条件写死 false,
89
93
  // 所以关闭时也固定 false;单元格侧改动前是原样透传,所以关闭时必须沿用原值,
90
94
  // 否则会覆盖调用方传入的 showOverflow 与 GlobalConfig.table 的默认值。
91
- showOverflow: O ? "tooltip" : V,
95
+ showOverflow: O ? "tooltip" : R,
92
96
  // 列宽调整由 column-config.resizable 统一控制,列上单独设置的 resizable 优先
93
97
  // 排序交由 vxe 负责,组件只预置与改动前等价的交互口径
94
- sortConfig: { ...j, ...R },
95
- columnConfig: { useKey: !0, resizable: m, ...g },
96
- rowConfig: { useKey: !0, isHover: !0, isCurrent: !1, ...S },
97
- resizableConfig: { showDragTip: !0, minWidth: F, ...p },
98
+ sortConfig: { ...F, ...z },
99
+ columnConfig: { useKey: !0, resizable: c, ...g },
100
+ rowConfig: { useKey: !0, isHover: !0, isCurrent: !1, ...L },
101
+ resizableConfig: { showDragTip: !0, minWidth: I, ...w },
98
102
  // reserveSelection 开启时同时打开 vxe 的跨页保留存储,调用方显式配的 reserve 优先。
99
103
  // 只有存储打开,useRowSelection 才能从 getCheckboxReserveRecords 读到跨页那部分。
100
104
  // 关闭时不写 reserve 键,保持与改动前完全相同的配置对象(不覆盖 vxe 全局默认)。
101
- checkboxConfig: { highlight: !1, ...Y ? { reserve: !0 } : {}, ...r },
105
+ checkboxConfig: { highlight: !1, ...H ? { reserve: !0 } : {}, ...r },
102
106
  expandConfig: {
103
107
  padding: !0,
104
108
  iconClose: "vxe-icon-caret-down",
105
109
  iconOpen: "vxe-icon-caret-up",
106
110
  ...v
107
111
  },
108
- treeConfig: s != null && s.loadMethod ? { ...s, loadMethod: l(s.loadMethod) } : s,
112
+ treeConfig: u != null && u.loadMethod ? { ...u, loadMethod: a(u.loadMethod) } : u,
109
113
  round: !0,
110
114
  // 列上声明 summary 时自动开启表尾;没有任何列声明时不写这两个键,
111
115
  // 表尾相关配置与改动前完全一致(vxe 的 showFooter 默认 false,表尾不渲染)。
112
- ...x ? { showFooter: !0, footerMethod: x } : {},
116
+ ...M ? { showFooter: !0, footerMethod: M } : {},
113
117
  // loading 由外层容器接管
114
118
  loading: !1
115
119
  };
116
- }), h = b(() => y({ ...i, ...f(d) }, K));
117
- return { bindValues: d, gridProps: h };
120
+ }), h = T(() => S({ ...i, ...d(f) }, D));
121
+ return { bindValues: f, gridProps: h };
118
122
  }
119
123
  export {
120
- B as useGridProps
124
+ Q as useGridProps
121
125
  };