@dazhicheng/ui 1.5.265 → 1.6.0

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 (104) hide show
  1. package/dist/components/tt-area/TtArea.vue.js +1 -1
  2. package/dist/components/tt-drawer/src/components/DrawerHeader.vue.js +2 -2
  3. package/dist/components/tt-drawer/src/hooks/useResizable.js +2 -2
  4. package/dist/components/tt-form/src/components/FormElInput.vue.js +51 -38
  5. package/dist/components/tt-form/src/form-render/FormField.vue2.js +36 -36
  6. package/dist/components/tt-form/src/form-render/array-register/FormArrayRegister.d.ts +3 -3
  7. package/dist/components/tt-form/src/form-render/array-register/FormArrayRegister.js +3 -1
  8. package/dist/components/tt-icon/index.vue.js +2 -2
  9. package/dist/components/tt-loading/src/loading.vue.js +2 -2
  10. package/dist/components/tt-modal-form/index.vue.js +13 -12
  11. package/dist/components/tt-panel-select/src/components/PanelMiddle.vue.d.ts +2 -2
  12. package/dist/components/tt-panel-select/src/hooks/usePanelData.js +93 -86
  13. package/dist/components/tt-panel-select/src/index.vue.js +1 -0
  14. package/dist/components/tt-select/src/Select.vue.d.ts +4 -4
  15. package/dist/components/tt-select/src/components/Table.vue.d.ts +4 -4
  16. package/dist/components/tt-table/index.d.ts +523 -358
  17. package/dist/components/tt-table/index.js +7 -4
  18. package/dist/components/tt-table/src/Table.vue.d.ts +306 -216
  19. package/dist/components/tt-table/src/Table.vue.js +405 -618
  20. package/dist/components/tt-table/src/TableForm.vue.d.ts +384 -19
  21. package/dist/components/tt-table/src/TableForm.vue.js +219 -228
  22. package/dist/components/tt-table/src/components/TableAction.vue.js +108 -131
  23. package/dist/components/tt-table/src/components/TableButtons.js +25 -25
  24. package/dist/components/tt-table/src/components/TableColumnModal.vue2.js +88 -85
  25. package/dist/components/tt-table/src/components/TableToolbarTools.vue.d.ts +80 -0
  26. package/dist/components/tt-table/src/components/{TableToobalTools.vue.js → TableToolbarTools.vue.js} +29 -31
  27. package/dist/components/tt-table/src/components/TableToolbarTools.vue2.js +4 -0
  28. package/dist/components/tt-table/src/emits.js +2 -1
  29. package/dist/components/tt-table/src/hooks/useColumnPersistence.d.ts +19 -0
  30. package/dist/components/tt-table/src/hooks/useColumnPersistence.js +63 -0
  31. package/dist/components/tt-table/src/hooks/useColumns.d.ts +505 -21
  32. package/dist/components/tt-table/src/hooks/useColumns.js +100 -245
  33. package/dist/components/tt-table/src/hooks/useGridProps.d.ts +36 -0
  34. package/dist/components/tt-table/src/hooks/useGridProps.js +121 -0
  35. package/dist/components/tt-table/src/hooks/useKeyboardNav.d.ts +11 -0
  36. package/dist/components/tt-table/src/hooks/useKeyboardNav.js +97 -0
  37. package/dist/components/tt-table/src/hooks/usePagination.d.ts +14 -8
  38. package/dist/components/tt-table/src/hooks/usePagination.js +29 -33
  39. package/dist/components/tt-table/src/hooks/useQuery.d.ts +41 -0
  40. package/dist/components/tt-table/src/hooks/useQuery.js +147 -0
  41. package/dist/components/tt-table/src/hooks/useRowIdentity.d.ts +22 -0
  42. package/dist/components/tt-table/src/hooks/useRowIdentity.js +96 -0
  43. package/dist/components/tt-table/src/hooks/useRowSelection.d.ts +23 -7
  44. package/dist/components/tt-table/src/hooks/useRowSelection.js +95 -71
  45. package/dist/components/tt-table/src/hooks/{useLeftRightSlot.d.ts → useSideSlot.d.ts} +25 -17
  46. package/dist/components/tt-table/src/hooks/useSideSlot.js +77 -0
  47. package/dist/components/tt-table/src/hooks/useSyncProps.d.ts +12 -0
  48. package/dist/components/tt-table/src/hooks/useSyncProps.js +55 -0
  49. package/dist/components/tt-table/src/hooks/useTableData.d.ts +71 -0
  50. package/dist/components/tt-table/src/hooks/useTableData.js +307 -0
  51. package/dist/components/tt-table/src/hooks/useTableFooter.d.ts +15 -0
  52. package/dist/components/tt-table/src/hooks/useTableFooter.js +46 -0
  53. package/dist/components/tt-table/src/hooks/useTableForm.d.ts +10 -5
  54. package/dist/components/tt-table/src/hooks/useTableForm.js +55 -48
  55. package/dist/components/tt-table/src/hooks/useTableMethods.d.ts +165 -0
  56. package/dist/components/tt-table/src/hooks/useTableMethods.js +183 -0
  57. package/dist/components/tt-table/src/hooks/useTableRender.d.ts +24 -55
  58. package/dist/components/tt-table/src/props.d.ts +318 -151
  59. package/dist/components/tt-table/src/props.js +117 -270
  60. package/dist/components/tt-table/src/table-defaults.d.ts +25 -0
  61. package/dist/components/tt-table/src/table-defaults.js +71 -0
  62. package/dist/components/tt-table/src/table-mutation-events.d.ts +43 -0
  63. package/dist/components/tt-table/src/table-mutation-events.js +70 -0
  64. package/dist/components/tt-table/src/types/table.d.ts +207 -88
  65. package/dist/components/tt-table/src/types/tableAction.d.ts +23 -0
  66. package/dist/components/tt-table/src/types/tableForm.d.ts +15 -26
  67. package/dist/components/tt-table/src/utils/action-tab-index.d.ts +2 -0
  68. package/dist/components/tt-table/src/utils/action-tab-index.js +50 -0
  69. package/dist/components/tt-table/src/utils/context.js +25 -12
  70. package/dist/components/tt-table/src/utils/table-api.d.ts +136 -58
  71. package/dist/components/tt-table/src/utils/table-api.js +198 -165
  72. package/dist/components/tt-table/src/utils/table-form-api.d.ts +11 -11
  73. package/dist/components/tt-table/src/utils/table-form-api.js +41 -31
  74. package/dist/components/types.d.ts +0 -20
  75. package/dist/hooks/useSetup.js +0 -3
  76. package/dist/index.d.ts +1 -0
  77. package/dist/index.js +105 -101
  78. package/dist/packages/hooks/src/useDebounce.js +6 -6
  79. package/dist/packages/utils/src/is.js +20 -18
  80. package/dist/packages/utils/src/tool.js +76 -149
  81. package/dist/style.css +1 -1
  82. package/dist/utils/uppercaseInput.d.ts +29 -0
  83. package/dist/utils/uppercaseInput.js +16 -0
  84. package/package.json +3 -3
  85. package/dist/components/tt-table/src/components/TableToobalTools.vue.d.ts +0 -576
  86. package/dist/components/tt-table/src/components/TableToobalTools.vue2.js +0 -4
  87. package/dist/components/tt-table/src/enum.d.ts +0 -2
  88. package/dist/components/tt-table/src/hooks/useCellArea.d.ts +0 -15
  89. package/dist/components/tt-table/src/hooks/useCellArea.js +0 -15
  90. package/dist/components/tt-table/src/hooks/useCustomColumns.d.ts +0 -20
  91. package/dist/components/tt-table/src/hooks/useCustomColumns.js +0 -65
  92. package/dist/components/tt-table/src/hooks/useDataSource.d.ts +0 -29
  93. package/dist/components/tt-table/src/hooks/useDataSource.js +0 -232
  94. package/dist/components/tt-table/src/hooks/useLeftRightSlot.js +0 -64
  95. package/dist/components/tt-table/src/hooks/useTable.d.ts +0 -7
  96. package/dist/components/tt-table/src/hooks/useTableEvent.d.ts +0 -101
  97. package/dist/components/tt-table/src/hooks/useTableEvent.js +0 -197
  98. package/dist/components/tt-table/src/hooks/useTableFormEvent.d.ts +0 -10
  99. package/dist/components/tt-table/src/hooks/useTableHeight.d.ts +0 -15
  100. package/dist/components/tt-table/src/hooks/useTableSlot.d.ts +0 -11
  101. package/dist/components/tt-table/src/hooks/useTableSlot.js +0 -17
  102. package/dist/components/tt-table/src/utils/filters.d.ts +0 -109
  103. package/dist/components/tt-table/src/utils/vxeTable.d.ts +0 -28
  104. package/dist/packages/utils/src/check.js +0 -10
@@ -1,181 +1,108 @@
1
- import { isObject as v, isArray as E } from "./is.js";
1
+ import "dayjs";
2
2
  import "vue";
3
3
  import "xe-utils";
4
- import { twMerge as M } from "../../../node_modules/.pnpm/tailwind-merge@3.5.0/node_modules/tailwind-merge/dist/bundle-mjs.js";
5
- import { clsx as P } from "../../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.js";
6
- import { klona as U } from "../../../node_modules/.pnpm/klona@2.0.6/node_modules/klona/full/index.js";
7
- import "dayjs";
4
+ import { twMerge as N } from "../../../node_modules/.pnpm/tailwind-merge@3.5.0/node_modules/tailwind-merge/dist/bundle-mjs.js";
5
+ import { clsx as W } from "../../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.js";
6
+ import { klona as j } from "../../../node_modules/.pnpm/klona@2.0.6/node_modules/klona/full/index.js";
8
7
  import "dayjs/plugin/utc";
9
8
  import "dayjs/plugin/timezone";
10
- function J(n, i = "12", e = "Microsoft YaHei,Arial,-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,'Helvetica Neue','Noto Sans',sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol','Noto Color Emoji'") {
11
- let t = 0;
12
- const o = document.createElement("canvas").getContext("2d");
13
- return o && (o.font = `${i} ${e}`, t = o.measureText(n).width), t;
14
- }
15
- function S(n, i, e) {
16
- const t = (e == null ? void 0 : e.excludeAll) || [], f = (e == null ? void 0 : e.exclude) || [];
17
- return t.includes("Id") || t.push("Id"), t.includes("rowId") || t.push("rowId"), Object.fromEntries(
18
- Object.entries(n).reduce((o, [s, r]) => (t.includes(s) || f.includes(s) || (r && v(r) ? L(e, i, r, s, o) : r && E(r) ? z(e, i, r, s, o) : H(e, i, r, s, o)), o), [])
19
- );
20
- }
21
- function L(n, i, e, t, f) {
22
- const o = S(e, i[t] || {}, {
23
- excludeAll: n == null ? void 0 : n.excludeAll,
24
- ...n
25
- });
26
- Object.keys(o).length && f.push([t, o]);
27
- }
28
- function z(n, i, e, t, f) {
29
- var r, d, u;
30
- const o = [], s = (r = (n || {})[t]) == null ? void 0 : r.key;
31
- if (i[t]) {
32
- const a = (e == null ? void 0 : e.length) >= ((d = i[t]) == null ? void 0 : d.length) ? e : i[t], g = (e == null ? void 0 : e.length) < ((u = i[t]) == null ? void 0 : u.length) ? e : i[t];
33
- s ? a.forEach((l) => {
34
- const p = g.find((h) => h[s] === l[s]);
35
- if (p) {
36
- const h = S(l, p, {
37
- excludeAll: n == null ? void 0 : n.excludeAll,
38
- ...n[t]
39
- });
40
- Object.keys(h).length && o.push({ [s]: p[s], ...h });
41
- } else
42
- o.push(l);
43
- }) : a.forEach((l, p) => {
44
- const h = g[p];
45
- if (v(l) && !v(h) || E(l) && !E(h) || typeof l != typeof h || !h)
46
- o.push(l);
47
- else if (v(l) || E(l)) {
48
- const A = S(l, h, { excludeAll: n == null ? void 0 : n.excludeAll });
49
- Object.keys(A).length && o.push({ ...A });
50
- } else l !== h && o.push(l);
51
- });
52
- } else
53
- o.push(...e);
54
- o.length && f.push([t, o]);
55
- }
56
- function H(n, i, e, t, f) {
57
- const o = (n == null ? void 0 : n.notNullToFalse) || [];
58
- if (typeof e == "string" && typeof i[t] == "number" || typeof e == "number" && typeof i[t] == "string")
59
- Number(e) !== Number(i[t]) && f.push([t, e]);
60
- else if ([void 0, null, ""].includes(e))
61
- [void 0, null, ""].includes(i[t]) || f.push([t, e]);
62
- else if (e !== i[t]) {
63
- if (e === !1 && [void 0, null, ""].includes(i[t]) && !o.includes(t))
64
- return;
65
- f.push([t, e]);
66
- }
67
- }
68
- function W(n, i, e) {
69
- const t = {}, f = ["rowId", "row_id"], o = (e == null ? void 0 : e.excludeAll) || [], s = (e == null ? void 0 : e.exclude) || [];
70
- for (const r in i)
71
- if (Object.prototype.hasOwnProperty.call(i, r) && ![...o, ...f].includes(r) && ![...s, ...f].includes(r)) {
72
- const d = n[r], u = i[r];
73
- if (Array.isArray(u) && Array.isArray(d))
74
- (d.length !== u.length || d.some((g, l) => typeof g == "object" && typeof u[l] == "object" ? Object.keys(W(g, u[l], { excludeAll: o, ...e == null ? void 0 : e[r] })).length > 0 : g !== u[l])) && (t[r] = u);
75
- else if (typeof u == "object" && typeof d == "object" && u !== null && d !== null) {
76
- const a = W(d, u, { excludeAll: o, ...e == null ? void 0 : e[r] });
77
- Object.keys(a).length > 0 && (t[r] = a);
78
- } else d !== u && String(d) !== String(u) && (t[r] = u);
79
- }
80
- return t;
9
+ function P(o, i = "12", m = "Microsoft YaHei,Arial,-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,'Helvetica Neue','Noto Sans',sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol','Noto Color Emoji'") {
10
+ let s = 0;
11
+ const n = document.createElement("canvas").getContext("2d");
12
+ return n && (n.font = `${i} ${m}`, s = n.measureText(o).width), s;
81
13
  }
82
- function Q(n) {
83
- const i = Object.getPrototypeOf(n);
14
+ function z(o) {
15
+ const i = Object.getPrototypeOf(o);
84
16
  if (!i || i === Object.prototype)
85
- return n;
86
- const e = Object.getOwnPropertyNames(i);
87
- for (const t of e) {
88
- const f = n[t];
89
- t !== "constructor" && typeof f == "function" && (n[t] = f.bind(n));
17
+ return o;
18
+ const m = Object.getOwnPropertyNames(i);
19
+ for (const s of m) {
20
+ const f = o[s];
21
+ s !== "constructor" && typeof f == "function" && (o[s] = f.bind(o));
90
22
  }
91
- return n;
23
+ return o;
92
24
  }
93
- function X(...n) {
94
- for (const i of n)
25
+ function F(...o) {
26
+ for (const i of o)
95
27
  if (i != null)
96
28
  return i;
97
29
  }
98
- function Z(...n) {
99
- return M(P(n));
30
+ function H(...o) {
31
+ return N(W(o));
100
32
  }
101
- function y() {
102
- const n = new Event("resize");
103
- window.dispatchEvent(n);
33
+ function R() {
34
+ const o = new Event("resize");
35
+ window.dispatchEvent(o);
104
36
  }
105
- function b(n) {
106
- return U(n);
37
+ function $(o) {
38
+ return j(o);
107
39
  }
108
- function j(n, i = 200, e = {}) {
109
- const { leading: t = !1, trailing: f = !0, maxWait: o } = e;
110
- let s, r, d, u = 0, a, g;
111
- function l(c) {
112
- const m = a;
113
- return a = void 0, u = c, g = n(...m), g;
40
+ function B(o, i = 200, m = {}) {
41
+ const { leading: s = !1, trailing: f = !0, maxWait: n } = m;
42
+ let r, d, l, a = 0, c, u;
43
+ function g(t) {
44
+ const e = c;
45
+ return c = void 0, a = t, u = o(...e), u;
114
46
  }
115
47
  function p() {
116
- s !== void 0 && (window.clearTimeout(s), s = void 0), r !== void 0 && (window.clearTimeout(r), r = void 0);
48
+ r !== void 0 && (window.clearTimeout(r), r = void 0), d !== void 0 && (window.clearTimeout(d), d = void 0);
117
49
  }
118
- function h() {
119
- p(), u = 0, a = void 0, d = void 0, g = void 0;
50
+ function S() {
51
+ p(), a = 0, c = void 0, l = void 0, u = void 0;
120
52
  }
121
- function A(c) {
122
- const m = c - d, x = c - u, N = i - m;
123
- return o !== void 0 ? Math.min(N, o - x) : N;
53
+ function h(t) {
54
+ const e = t - l, w = t - a, b = i - e;
55
+ return n !== void 0 ? Math.min(b, n - w) : b;
124
56
  }
125
- function D(c) {
126
- if (d === void 0) return !0;
127
- const m = c - d, x = c - u;
128
- return m >= i || m < 0 || o !== void 0 && x >= o;
57
+ function x(t) {
58
+ if (l === void 0) return !0;
59
+ const e = t - l, w = t - a;
60
+ return e >= i || e < 0 || n !== void 0 && w >= n;
129
61
  }
130
- function C(c) {
131
- return u = c, p(), s = window.setTimeout(T, i), o !== void 0 && (r = window.setTimeout(I, o)), t ? l(c) : g;
62
+ function k(t) {
63
+ return a = t, p(), r = window.setTimeout(T, i), n !== void 0 && (d = window.setTimeout(E, n)), s ? g(t) : u;
132
64
  }
133
- function F(c) {
134
- return s = void 0, f && a !== void 0 ? l(c) : (a = void 0, g);
65
+ function I(t) {
66
+ return r = void 0, f && c !== void 0 ? g(t) : (c = void 0, u);
135
67
  }
136
68
  function T() {
137
- const c = Date.now();
138
- if (D(c)) {
139
- F(c);
69
+ const t = Date.now();
70
+ if (x(t)) {
71
+ I(t);
140
72
  return;
141
73
  }
142
- const m = A(c);
143
- m > 0 ? s = window.setTimeout(T, m) : s = void 0;
74
+ const e = h(t);
75
+ e > 0 ? r = window.setTimeout(T, e) : r = void 0;
144
76
  }
145
- function I() {
146
- const c = Date.now();
147
- p(), a !== void 0 && l(c);
77
+ function E() {
78
+ const t = Date.now();
79
+ p(), c !== void 0 && g(t);
148
80
  }
149
- const w = (...c) => {
150
- const m = Date.now(), x = D(m);
151
- if (a = c ?? [], d = m, x) {
152
- if (s === void 0)
153
- return C(m);
154
- if (o !== void 0)
155
- return p(), s = window.setTimeout(T, i), r = window.setTimeout(I, o), t ? l(m) : g;
81
+ const v = (...t) => {
82
+ const e = Date.now(), w = x(e);
83
+ if (c = t ?? [], l = e, w) {
84
+ if (r === void 0)
85
+ return k(e);
86
+ if (n !== void 0)
87
+ return p(), r = window.setTimeout(T, i), d = window.setTimeout(E, n), s ? g(e) : u;
156
88
  }
157
- return s === void 0 && (s = window.setTimeout(T, i), o !== void 0 && (r = window.setTimeout(I, o))), g;
89
+ return r === void 0 && (r = window.setTimeout(T, i), n !== void 0 && (d = window.setTimeout(E, n))), u;
158
90
  };
159
- return w.isPending = () => s !== void 0 || r !== void 0, w.cancel = () => {
160
- h();
161
- }, w.flush = (...c) => {
162
- if (!w.isPending())
163
- return c.length > 0 ? n(...c) : g;
164
- const m = a !== void 0 ? a : c;
165
- return h(), n(...m);
166
- }, w;
91
+ return v.isPending = () => r !== void 0 || d !== void 0, v.cancel = () => {
92
+ S();
93
+ }, v.flush = (...t) => {
94
+ if (!v.isPending())
95
+ return t.length > 0 ? o(...t) : u;
96
+ const e = c !== void 0 ? c : t;
97
+ return S(), o(...e);
98
+ }, v;
167
99
  }
168
100
  export {
169
- Q as bindMethods,
170
- J as calcWordsWidth,
171
- Z as clnm,
172
- b as cloneDeep,
173
- W as compareObjects,
174
- j as debounce,
175
- S as getDifference,
176
- X as getFirstNonNullOrUndefined,
177
- z as setDifferenceArr,
178
- H as setDifferenceField,
179
- L as setDifferenceObj,
180
- y as triggerWindowResize
101
+ z as bindMethods,
102
+ P as calcWordsWidth,
103
+ H as clnm,
104
+ $ as cloneDeep,
105
+ B as debounce,
106
+ F as getFirstNonNullOrUndefined,
107
+ R as triggerWindowResize
181
108
  };