@dazhicheng/ui 1.6.7 → 1.6.8

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 (93) 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-table/index.d.ts +3 -15
  4. package/dist/components/tt-table/index.js +5 -4
  5. package/dist/components/tt-table/src/Table.vue.d.ts +1 -1
  6. package/dist/components/tt-table/src/Table.vue.js +3 -3
  7. package/dist/components/tt-table/src/TableForm.vue.js +168 -159
  8. package/dist/components/tt-table/src/components/TableAction.vue.d.ts +2 -12
  9. package/dist/components/tt-table/src/components/TableAction.vue.js +78 -175
  10. package/dist/components/tt-table/src/hooks/useGridProps.js +64 -60
  11. package/dist/components/tt-table/src/hooks/useTableData.js +77 -74
  12. package/dist/components/tt-table/src/types/table.d.ts +2 -1
  13. package/dist/components/tt-table/src/utils/table-api.d.ts +2 -1
  14. package/dist/components/tt-table/src/utils/table-api.js +3 -2
  15. package/dist/components/tt-vtable/index.js +54 -0
  16. package/dist/components/tt-vtable/src/components/TtVTable.vue.d.ts +188 -0
  17. package/dist/components/tt-vtable/src/components/TtVTable.vue.js +227 -0
  18. package/dist/components/tt-vtable/src/components/TtVTable.vue2.js +4 -0
  19. package/dist/components/tt-vtable/src/components/TtVTableForm.vue.d.ts +32 -0
  20. package/dist/components/tt-vtable/src/components/TtVTableForm.vue.js +121 -0
  21. package/dist/components/tt-vtable/src/components/TtVTableForm.vue2.js +4 -0
  22. package/dist/components/tt-vtable/src/components/VTableEmpty.vue.d.ts +64 -0
  23. package/dist/components/tt-vtable/src/components/VTableEmpty.vue.js +97 -0
  24. package/dist/components/tt-vtable/src/components/VTableEmpty.vue2.js +4 -0
  25. package/dist/components/tt-vtable/src/components/VTablePagination.vue.d.ts +53 -0
  26. package/dist/components/tt-vtable/src/components/VTablePagination.vue.js +52 -0
  27. package/dist/components/tt-vtable/src/components/VTablePagination.vue2.js +4 -0
  28. package/dist/components/tt-vtable/src/components/VTableSelectionAlert.vue.d.ts +35 -0
  29. package/dist/components/tt-vtable/src/components/VTableSelectionAlert.vue.js +50 -0
  30. package/dist/components/tt-vtable/src/components/VTableSelectionAlert.vue2.js +4 -0
  31. package/dist/components/tt-vtable/src/components/VTableToolbar.vue.d.ts +63 -0
  32. package/dist/components/tt-vtable/src/components/VTableToolbar.vue.js +126 -0
  33. package/dist/components/tt-vtable/src/components/VTableToolbar.vue2.js +4 -0
  34. package/dist/components/tt-vtable/src/components/VTableViewport.vue.js +133 -0
  35. package/dist/components/tt-vtable/src/components/VTableViewport.vue2.js +4 -0
  36. package/dist/components/tt-vtable/src/composables/useVTable.d.ts +41 -0
  37. package/dist/components/tt-vtable/src/composables/useVTable.js +25 -0
  38. package/dist/components/tt-vtable/src/composables/useVTableFormRender.d.ts +13 -0
  39. package/dist/components/tt-vtable/src/composables/useVTableFormRender.js +92 -0
  40. package/dist/components/tt-vtable/src/composables/useVTableRender.d.ts +13 -0
  41. package/dist/components/tt-vtable/src/composables/useVTableRender.js +13 -0
  42. package/dist/components/tt-vtable/src/engine/visactor/createListTable.d.ts +10 -0
  43. package/dist/components/tt-vtable/src/engine/visactor/createListTable.js +63 -0
  44. package/dist/components/tt-vtable/src/engine/visactor/createVueCellLayout.d.ts +37 -0
  45. package/dist/components/tt-vtable/src/engine/visactor/createVueCellLayout.js +133 -0
  46. package/dist/components/tt-vtable/src/engine/visactor/index.d.ts +8 -0
  47. package/dist/components/tt-vtable/src/engine/visactor/native-boundaries.d.ts +23 -0
  48. package/dist/components/tt-vtable/src/engine/visactor/native-boundaries.js +70 -0
  49. package/dist/components/tt-vtable/src/engine/visactor/record-adapter.d.ts +38 -0
  50. package/dist/components/tt-vtable/src/engine/visactor/record-adapter.js +41 -0
  51. package/dist/components/tt-vtable/src/engine/visactor/toColumnDefinitions.d.ts +45 -0
  52. package/dist/components/tt-vtable/src/engine/visactor/toColumnDefinitions.js +73 -0
  53. package/dist/components/tt-vtable/src/engine/visactor/toListTableOptions.d.ts +25 -0
  54. package/dist/components/tt-vtable/src/engine/visactor/toListTableOptions.js +25 -0
  55. package/dist/components/tt-vtable/src/engine/visactor/types.d.ts +29 -0
  56. package/dist/components/tt-vtable/src/features/column-preferences/column-preference-storage.d.ts +36 -0
  57. package/dist/components/tt-vtable/src/features/column-preferences/column-preference-storage.js +52 -0
  58. package/dist/components/tt-vtable/src/features/column-preferences/useColumnPreferences.d.ts +74 -0
  59. package/dist/components/tt-vtable/src/features/column-preferences/useColumnPreferences.js +232 -0
  60. package/dist/components/tt-vtable/src/features/editing/useCellEditing.d.ts +48 -0
  61. package/dist/components/tt-vtable/src/features/editing/useCellEditing.js +102 -0
  62. package/dist/components/tt-vtable/src/features/form-integration/useVTableForm.d.ts +51 -0
  63. package/dist/components/tt-vtable/src/features/pagination/useTablePagination.d.ts +40 -0
  64. package/dist/components/tt-vtable/src/features/pagination/useTablePagination.js +51 -0
  65. package/dist/components/tt-vtable/src/features/querying/useRecordQuery.d.ts +38 -0
  66. package/dist/components/tt-vtable/src/features/querying/useRecordQuery.js +57 -0
  67. package/dist/components/tt-vtable/src/features/records/index.d.ts +3 -0
  68. package/dist/components/tt-vtable/src/features/records/record-index.d.ts +122 -0
  69. package/dist/components/tt-vtable/src/features/records/record-index.js +209 -0
  70. package/dist/components/tt-vtable/src/features/records/useRecordSource.d.ts +41 -0
  71. package/dist/components/tt-vtable/src/features/records/useRecordSource.js +249 -0
  72. package/dist/components/tt-vtable/src/features/selection/useRowSelection.d.ts +65 -0
  73. package/dist/components/tt-vtable/src/features/selection/useRowSelection.js +129 -0
  74. package/dist/components/tt-vtable/src/features/tree/useTreeRecords.d.ts +60 -0
  75. package/dist/components/tt-vtable/src/features/tree/useTreeRecords.js +125 -0
  76. package/dist/components/tt-vtable/src/public/index.d.ts +7 -0
  77. package/dist/components/tt-vtable/src/public/table-api.d.ts +215 -0
  78. package/dist/components/tt-vtable/src/public/table-column.d.ts +123 -0
  79. package/dist/components/tt-vtable/src/public/table-errors.d.ts +26 -0
  80. package/dist/components/tt-vtable/src/public/table-errors.js +26 -0
  81. package/dist/components/tt-vtable/src/public/table-events.d.ts +69 -0
  82. package/dist/components/tt-vtable/src/public/table-props.d.ts +216 -0
  83. package/dist/components/tt-vtable/src/public/table-slots.d.ts +37 -0
  84. package/dist/components/tt-vtable/src/runtime/createVTableController.d.ts +12 -0
  85. package/dist/components/tt-vtable/src/runtime/createVTableController.js +238 -0
  86. package/dist/components/tt-vtable/src/runtime/createVTableRuntime.d.ts +79 -0
  87. package/dist/components/tt-vtable/src/runtime/createVTableRuntime.js +380 -0
  88. package/dist/index.d.ts +1 -0
  89. package/dist/index.js +129 -115
  90. package/dist/packages/utils/src/is.js +46 -37
  91. package/dist/style.css +1 -1
  92. package/package.json +3 -1
  93. package/dist/assets/svg/action_more.svg.js +0 -4
@@ -1,52 +1,51 @@
1
- import { useTemplateRef as y, ref as f, computed as b, watch as x, nextTick as m, onMounted as k } from "vue";
2
- import { useElementVisibility as C, useBreakpoints as B, breakpointsTailwind as I } from "@vueuse/core";
1
+ import { useTemplateRef as k, ref as d, computed as x, watch as B, nextTick as h, onMounted as C } from "vue";
2
+ import { useElementVisibility as I, useBreakpoints as S, breakpointsTailwind as M } from "@vueuse/core";
3
3
  function H(n) {
4
- const i = y("wrapperRef"), w = C(i), l = f({}), s = f(!1), d = B(I), g = b(() => {
5
- const e = n.collapsedRows ?? 1, o = l.value;
6
- let t = 0;
7
- for (let a = 1; a <= e; a++)
8
- t += (o == null ? void 0 : o[a]) ?? 0;
9
- return Math.max(t - 1, 1);
4
+ const i = k("wrapperRef"), p = I(i), r = d({}), l = d(!1), g = S(M), R = x(() => {
5
+ const e = n.collapsedRows ?? 1, a = r.value;
6
+ let o = 0;
7
+ for (let t = 1; t <= e; t++)
8
+ o += (a == null ? void 0 : a[t]) ?? 0;
9
+ return Math.max(o - 1, 1);
10
10
  });
11
- x(
11
+ B(
12
12
  [
13
13
  () => n.showCollapseButton,
14
- () => d.active().value,
14
+ () => g.active().value,
15
15
  () => {
16
16
  var e;
17
17
  return (e = n.schema) == null ? void 0 : e.length;
18
18
  },
19
- () => w.value
19
+ () => p.value
20
20
  ],
21
- async ([e, , , o]) => {
22
- var t;
23
- if (e && o) {
24
- if (await m(), !((t = i.value) != null && t.offsetParent))
25
- return;
26
- l.value = {}, s.value = !1, await c();
27
- }
21
+ async ([e, a, o, t], m) => {
22
+ var s;
23
+ if (!e || !t)
24
+ return;
25
+ const [, c, w] = m ?? [];
26
+ l.value && a === c && o === w || (await h(), (s = i.value) != null && s.offsetParent && (r.value = {}, l.value = !1, await f()));
28
27
  }
29
28
  );
30
- async function c() {
31
- if (!n.showCollapseButton || (await m(), !i.value))
29
+ async function f() {
30
+ if (!n.showCollapseButton || (await h(), !i.value))
32
31
  return;
33
- const e = i.value, t = window.getComputedStyle(e).getPropertyValue("grid-template-rows").split(" "), a = e == null ? void 0 : e.getBoundingClientRect();
34
- if (t[0] === "none" || a.height === 0)
32
+ const e = i.value, o = window.getComputedStyle(e).getPropertyValue("grid-template-rows").split(" "), t = e == null ? void 0 : e.getBoundingClientRect();
33
+ if (o[0] === "none" || t.height === 0)
35
34
  return;
36
- Array.from(e.children).forEach((h) => {
37
- const v = h.getBoundingClientRect().top - a.top;
38
- let r = 0, u = 0;
39
- for (const [p, R] of t.entries())
40
- if (u += Number.parseFloat(R), v < u) {
41
- r = p + 1;
35
+ Array.from(e.children).forEach((c) => {
36
+ const s = c.getBoundingClientRect().top - t.top;
37
+ let u = 0, v = 0;
38
+ for (const [y, b] of o.entries())
39
+ if (v += Number.parseFloat(b), s < v) {
40
+ u = y + 1;
42
41
  break;
43
42
  }
44
- r > ((n == null ? void 0 : n.collapsedRows) ?? 1) || (l.value[r] = (l.value[r] ?? 0) + 1, s.value = !0);
43
+ u > ((n == null ? void 0 : n.collapsedRows) ?? 1) || (r.value[u] = (r.value[u] ?? 0) + 1, l.value = !0);
45
44
  });
46
45
  }
47
- return k(() => {
48
- c();
49
- }), { isCalculated: s, keepFormItemIndex: g, wrapperRef: i };
46
+ return C(() => {
47
+ f();
48
+ }), { isCalculated: l, keepFormItemIndex: R, wrapperRef: i };
50
49
  }
51
50
  export {
52
51
  H as useExpandable
@@ -13,7 +13,7 @@ import "../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/aes.j
13
13
  import "../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/enc-utf8.js";
14
14
  import "../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-ecb.js";
15
15
  import "../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-pkcs7.js";
16
- import { get as R, cloneDeep as v, has as C } from "lodash-es";
16
+ import { get as R, has as C, cloneDeep as v } from "lodash-es";
17
17
  import { childArrayPath as w, normalizeArrayFieldPath as h } from "./utils/array-path.js";
18
18
  import { set as g } from "es-toolkit/compat";
19
19
  import { createContext as x } from "./shared/createContext.js";
@@ -14,8 +14,6 @@ export declare const TtTableAction: import('../../../../utils/src').SFCWithInsta
14
14
  default: undefined;
15
15
  };
16
16
  stopButtonPropagation: any;
17
- showBtnNums: any;
18
- popoverWidth: any;
19
17
  wrap: any;
20
18
  }>> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').PublicProps, {
21
19
  wrap: any;
@@ -23,8 +21,6 @@ export declare const TtTableAction: import('../../../../utils/src').SFCWithInsta
23
21
  actions: import('.').TtActionItem[];
24
22
  slotContext: Record<string, any>;
25
23
  stopButtonPropagation: any;
26
- showBtnNums: any;
27
- popoverWidth: any;
28
24
  }, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, HTMLDivElement, import('vue').ComponentProvideOptions, {
29
25
  P: {};
30
26
  B: {};
@@ -46,8 +42,6 @@ export declare const TtTableAction: import('../../../../utils/src').SFCWithInsta
46
42
  default: undefined;
47
43
  };
48
44
  stopButtonPropagation: any;
49
- showBtnNums: any;
50
- popoverWidth: any;
51
45
  wrap: any;
52
46
  }>> & Readonly<{}>, {}, {}, {}, {}, {
53
47
  wrap: any;
@@ -55,8 +49,6 @@ export declare const TtTableAction: import('../../../../utils/src').SFCWithInsta
55
49
  actions: import('.').TtActionItem[];
56
50
  slotContext: Record<string, any>;
57
51
  stopButtonPropagation: any;
58
- showBtnNums: any;
59
- popoverWidth: any;
60
52
  }>;
61
53
  __isFragment?: never;
62
54
  __isTeleport?: never;
@@ -75,8 +67,6 @@ export declare const TtTableAction: import('../../../../utils/src').SFCWithInsta
75
67
  default: undefined;
76
68
  };
77
69
  stopButtonPropagation: any;
78
- showBtnNums: any;
79
- popoverWidth: any;
80
70
  wrap: any;
81
71
  }>> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {
82
72
  wrap: any;
@@ -84,8 +74,6 @@ export declare const TtTableAction: import('../../../../utils/src').SFCWithInsta
84
74
  actions: import('.').TtActionItem[];
85
75
  slotContext: Record<string, any>;
86
76
  stopButtonPropagation: any;
87
- showBtnNums: any;
88
- popoverWidth: any;
89
77
  }, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
90
78
  $slots: Readonly<{
91
79
  [slotName: string]: (props: any) => import('vue').VNode;
@@ -382,7 +370,7 @@ export declare const TtTable: import('../../../../utils/src').SFCWithInstall<{
382
370
  }>, {
383
371
  xGrid: import('vue').ComputedRef<import('vxe-table').VxeGridInstance<import('../../../../utils/src').Recordable>>;
384
372
  reload: (data?: import('.').FetchParams) => Promise<void>;
385
- redoHeight: () => void;
373
+ redoHeight: (full?: boolean) => void;
386
374
  setProps: (props: Partial<import('.').TtTableProps>) => void;
387
375
  setLoading: (loading: boolean) => void;
388
376
  getLoading?: import('vue').ComputedRef<boolean | undefined>;
@@ -1069,7 +1057,7 @@ export declare const TtTable: import('../../../../utils/src').SFCWithInstall<{
1069
1057
  }>, {
1070
1058
  xGrid: import('vue').ComputedRef<import('vxe-table').VxeGridInstance<import('../../../../utils/src').Recordable>>;
1071
1059
  reload: (data?: import('.').FetchParams) => Promise<void>;
1072
- redoHeight: () => void;
1060
+ redoHeight: (full?: boolean) => void;
1073
1061
  setProps: (props: Partial<import('.').TtTableProps>) => void;
1074
1062
  setLoading: (loading: boolean) => void;
1075
1063
  getLoading?: import('vue').ComputedRef<boolean | undefined>;
@@ -1487,7 +1475,7 @@ export declare const TtTable: import('../../../../utils/src').SFCWithInstall<{
1487
1475
  }>, {
1488
1476
  xGrid: import('vue').ComputedRef<import('vxe-table').VxeGridInstance<import('../../../../utils/src').Recordable>>;
1489
1477
  reload: (data?: import('.').FetchParams) => Promise<void>;
1490
- redoHeight: () => void;
1478
+ redoHeight: (full?: boolean) => void;
1491
1479
  setProps: (props: Partial<import('.').TtTableProps>) => void;
1492
1480
  setLoading: (loading: boolean) => void;
1493
1481
  getLoading?: import('vue').ComputedRef<boolean | undefined>;
@@ -54,6 +54,7 @@ import "../tt-drawer/index.js";
54
54
  import "../tt-modal/index.js";
55
55
  import "../../directives/disabled-tip/index.js";
56
56
  import "../tt-log/index.js";
57
+ import "../tt-vtable/index.js";
57
58
  /* empty css */
58
59
  /* empty css */
59
60
  /* empty css */
@@ -68,9 +69,9 @@ import "./src/emits.js";
68
69
  import "./src/props.js";
69
70
  import "./src/table-mutation-events.js";
70
71
  import "./src/utils/context.js";
71
- const xt = t(o), At = t(r), Ct = t(m);
72
+ const At = t(o), Ct = t(r), It = t(m);
72
73
  export {
73
- Ct as TtTable,
74
- xt as TtTableAction,
75
- At as TtTableButton
74
+ It as TtTable,
75
+ At as TtTableAction,
76
+ Ct as TtTableButton
76
77
  };
@@ -554,7 +554,7 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
554
554
  }>, {
555
555
  xGrid: import('vue').ComputedRef<VxeGridInstance<Recordable>>;
556
556
  reload: (data?: import('..').FetchParams) => Promise<void>;
557
- redoHeight: () => void;
557
+ redoHeight: (full?: boolean) => void;
558
558
  setProps: (props: Partial<TtTableProps>) => void;
559
559
  setLoading: (loading: boolean) => void;
560
560
  getLoading?: import('vue').ComputedRef<boolean | undefined>;
@@ -219,10 +219,10 @@ const Co = ["data-testid"], xo = ["src"], $o = ["src"], To = ["src"], Ro = {
219
219
  async function St(t) {
220
220
  s.setState(t);
221
221
  }
222
- function me() {
222
+ function me(t = !0) {
223
223
  J(() => {
224
- var t;
225
- return (t = e(p)) == null ? void 0 : t.recalculate(!0);
224
+ var o;
225
+ return (o = e(p)) == null ? void 0 : o.recalculate(t);
226
226
  });
227
227
  }
228
228
  function wt(t, o) {