@dazhicheng/ui 1.6.10 → 1.6.11

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 (87) 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-form/src/useFormContext.js +1 -1
  4. package/dist/components/tt-icon/index.vue.js +2 -2
  5. package/dist/components/tt-loading/src/loading.vue.js +2 -2
  6. package/dist/components/tt-table/index.js +4 -5
  7. package/dist/components/tt-table/src/TableForm.vue.js +2 -3
  8. package/dist/hooks/useBasicDataOptions.js +110 -91
  9. package/dist/index.d.ts +0 -1
  10. package/dist/index.js +115 -129
  11. package/dist/packages/utils/src/is.js +37 -46
  12. package/dist/style.css +1 -1
  13. package/package.json +1 -3
  14. package/dist/components/tt-vtable/index.js +0 -54
  15. package/dist/components/tt-vtable/src/components/TtVTable.vue.d.ts +0 -188
  16. package/dist/components/tt-vtable/src/components/TtVTable.vue.js +0 -227
  17. package/dist/components/tt-vtable/src/components/TtVTable.vue2.js +0 -4
  18. package/dist/components/tt-vtable/src/components/TtVTableForm.vue.d.ts +0 -32
  19. package/dist/components/tt-vtable/src/components/TtVTableForm.vue.js +0 -121
  20. package/dist/components/tt-vtable/src/components/TtVTableForm.vue2.js +0 -4
  21. package/dist/components/tt-vtable/src/components/VTableEmpty.vue.d.ts +0 -64
  22. package/dist/components/tt-vtable/src/components/VTableEmpty.vue.js +0 -97
  23. package/dist/components/tt-vtable/src/components/VTableEmpty.vue2.js +0 -4
  24. package/dist/components/tt-vtable/src/components/VTablePagination.vue.d.ts +0 -53
  25. package/dist/components/tt-vtable/src/components/VTablePagination.vue.js +0 -52
  26. package/dist/components/tt-vtable/src/components/VTablePagination.vue2.js +0 -4
  27. package/dist/components/tt-vtable/src/components/VTableSelectionAlert.vue.d.ts +0 -35
  28. package/dist/components/tt-vtable/src/components/VTableSelectionAlert.vue.js +0 -50
  29. package/dist/components/tt-vtable/src/components/VTableSelectionAlert.vue2.js +0 -4
  30. package/dist/components/tt-vtable/src/components/VTableToolbar.vue.d.ts +0 -63
  31. package/dist/components/tt-vtable/src/components/VTableToolbar.vue.js +0 -126
  32. package/dist/components/tt-vtable/src/components/VTableToolbar.vue2.js +0 -4
  33. package/dist/components/tt-vtable/src/components/VTableViewport.vue.js +0 -133
  34. package/dist/components/tt-vtable/src/components/VTableViewport.vue2.js +0 -4
  35. package/dist/components/tt-vtable/src/composables/useVTable.d.ts +0 -41
  36. package/dist/components/tt-vtable/src/composables/useVTable.js +0 -25
  37. package/dist/components/tt-vtable/src/composables/useVTableFormRender.d.ts +0 -13
  38. package/dist/components/tt-vtable/src/composables/useVTableFormRender.js +0 -92
  39. package/dist/components/tt-vtable/src/composables/useVTableRender.d.ts +0 -13
  40. package/dist/components/tt-vtable/src/composables/useVTableRender.js +0 -13
  41. package/dist/components/tt-vtable/src/engine/visactor/createListTable.d.ts +0 -10
  42. package/dist/components/tt-vtable/src/engine/visactor/createListTable.js +0 -63
  43. package/dist/components/tt-vtable/src/engine/visactor/createVueCellLayout.d.ts +0 -37
  44. package/dist/components/tt-vtable/src/engine/visactor/createVueCellLayout.js +0 -133
  45. package/dist/components/tt-vtable/src/engine/visactor/index.d.ts +0 -8
  46. package/dist/components/tt-vtable/src/engine/visactor/native-boundaries.d.ts +0 -23
  47. package/dist/components/tt-vtable/src/engine/visactor/native-boundaries.js +0 -70
  48. package/dist/components/tt-vtable/src/engine/visactor/record-adapter.d.ts +0 -38
  49. package/dist/components/tt-vtable/src/engine/visactor/record-adapter.js +0 -41
  50. package/dist/components/tt-vtable/src/engine/visactor/toColumnDefinitions.d.ts +0 -45
  51. package/dist/components/tt-vtable/src/engine/visactor/toColumnDefinitions.js +0 -73
  52. package/dist/components/tt-vtable/src/engine/visactor/toListTableOptions.d.ts +0 -25
  53. package/dist/components/tt-vtable/src/engine/visactor/toListTableOptions.js +0 -25
  54. package/dist/components/tt-vtable/src/engine/visactor/types.d.ts +0 -29
  55. package/dist/components/tt-vtable/src/features/column-preferences/column-preference-storage.d.ts +0 -5
  56. package/dist/components/tt-vtable/src/features/column-preferences/column-preference-storage.js +0 -52
  57. package/dist/components/tt-vtable/src/features/column-preferences/useColumnPreferences.d.ts +0 -74
  58. package/dist/components/tt-vtable/src/features/column-preferences/useColumnPreferences.js +0 -232
  59. package/dist/components/tt-vtable/src/features/editing/useCellEditing.d.ts +0 -48
  60. package/dist/components/tt-vtable/src/features/editing/useCellEditing.js +0 -102
  61. package/dist/components/tt-vtable/src/features/form-integration/useVTableForm.d.ts +0 -51
  62. package/dist/components/tt-vtable/src/features/pagination/useTablePagination.d.ts +0 -40
  63. package/dist/components/tt-vtable/src/features/pagination/useTablePagination.js +0 -51
  64. package/dist/components/tt-vtable/src/features/querying/useRecordQuery.d.ts +0 -38
  65. package/dist/components/tt-vtable/src/features/querying/useRecordQuery.js +0 -57
  66. package/dist/components/tt-vtable/src/features/records/index.d.ts +0 -3
  67. package/dist/components/tt-vtable/src/features/records/record-index.d.ts +0 -122
  68. package/dist/components/tt-vtable/src/features/records/record-index.js +0 -209
  69. package/dist/components/tt-vtable/src/features/records/useRecordSource.d.ts +0 -41
  70. package/dist/components/tt-vtable/src/features/records/useRecordSource.js +0 -249
  71. package/dist/components/tt-vtable/src/features/selection/useRowSelection.d.ts +0 -65
  72. package/dist/components/tt-vtable/src/features/selection/useRowSelection.js +0 -129
  73. package/dist/components/tt-vtable/src/features/tree/useTreeRecords.d.ts +0 -60
  74. package/dist/components/tt-vtable/src/features/tree/useTreeRecords.js +0 -125
  75. package/dist/components/tt-vtable/src/public/column-preferences.d.ts +0 -32
  76. package/dist/components/tt-vtable/src/public/index.d.ts +0 -8
  77. package/dist/components/tt-vtable/src/public/table-api.d.ts +0 -215
  78. package/dist/components/tt-vtable/src/public/table-column.d.ts +0 -123
  79. package/dist/components/tt-vtable/src/public/table-errors.d.ts +0 -26
  80. package/dist/components/tt-vtable/src/public/table-errors.js +0 -26
  81. package/dist/components/tt-vtable/src/public/table-events.d.ts +0 -69
  82. package/dist/components/tt-vtable/src/public/table-props.d.ts +0 -216
  83. package/dist/components/tt-vtable/src/public/table-slots.d.ts +0 -37
  84. package/dist/components/tt-vtable/src/runtime/createVTableController.d.ts +0 -12
  85. package/dist/components/tt-vtable/src/runtime/createVTableController.js +0 -238
  86. package/dist/components/tt-vtable/src/runtime/createVTableRuntime.d.ts +0 -79
  87. package/dist/components/tt-vtable/src/runtime/createVTableRuntime.js +0 -380
@@ -1,7 +1,7 @@
1
1
  import o from "./TtArea.vue3.js";
2
2
  /* empty css */
3
3
  import t from "../../_virtual/_plugin-vue_export-helper.js";
4
- const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-116cb5cb"]]);
4
+ const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-b814e001"]]);
5
5
  export {
6
6
  m as default
7
7
  };
@@ -1,7 +1,7 @@
1
1
  import r from "./DrawerHeader.vue2.js";
2
2
  /* empty css */
3
3
  import o from "../../../../_virtual/_plugin-vue_export-helper.js";
4
- const f = /* @__PURE__ */ o(r, [["__scopeId", "data-v-6cdf82e0"]]);
4
+ const c = /* @__PURE__ */ o(r, [["__scopeId", "data-v-9b698cc3"]]);
5
5
  export {
6
- f as default
6
+ c as default
7
7
  };
@@ -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, has as C, cloneDeep as v } from "lodash-es";
16
+ import { get as R, cloneDeep as v, has as C } 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";
@@ -2,7 +2,7 @@ import o from "./index.vue2.js";
2
2
  /* empty css */
3
3
  /* empty css */
4
4
  import t from "../../_virtual/_plugin-vue_export-helper.js";
5
- const a = /* @__PURE__ */ t(o, [["__scopeId", "data-v-d731bb93"]]);
5
+ const _ = /* @__PURE__ */ t(o, [["__scopeId", "data-v-6dba01d4"]]);
6
6
  export {
7
- a as default
7
+ _ as default
8
8
  };
@@ -1,7 +1,7 @@
1
1
  import o from "./loading.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../../../_virtual/_plugin-vue_export-helper.js";
4
- const r = /* @__PURE__ */ t(o, [["__scopeId", "data-v-7e6228e4"]]);
4
+ const a = /* @__PURE__ */ t(o, [["__scopeId", "data-v-5d760747"]]);
5
5
  export {
6
- r as default
6
+ a as default
7
7
  };
@@ -54,7 +54,6 @@ 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";
58
57
  /* empty css */
59
58
  /* empty css */
60
59
  /* empty css */
@@ -69,9 +68,9 @@ import "./src/emits.js";
69
68
  import "./src/props.js";
70
69
  import "./src/table-mutation-events.js";
71
70
  import "./src/utils/context.js";
72
- const At = t(o), Ct = t(r), It = t(m);
71
+ const xt = t(o), At = t(r), Ct = t(m);
73
72
  export {
74
- It as TtTable,
75
- At as TtTableAction,
76
- Ct as TtTableButton
73
+ Ct as TtTable,
74
+ xt as TtTableAction,
75
+ At as TtTableButton
77
76
  };
@@ -52,7 +52,6 @@ import "../../tt-text/index.js";
52
52
  import "../../../directives/disabled-tip/index.js";
53
53
  import { GlobalConfig as Qe } from "../../../hooks/useSetup.js";
54
54
  import "../../tt-log/index.js";
55
- import "../../tt-vtable/index.js";
56
55
  /* empty css */
57
56
  /* empty css */
58
57
  /* empty css */
@@ -77,7 +76,7 @@ import it from "./Table.vue.js";
77
76
  import { forwardedEventEntries as st } from "./table-mutation-events.js";
78
77
  import { TableFormApi as at } from "./utils/table-form-api.js";
79
78
  import { provideFormActionTestIds as nt } from "./utils/context.js";
80
- const lt = ["data-testid"], mt = ["data-testid"], Ko = /* @__PURE__ */ _e({
79
+ const lt = ["data-testid"], mt = ["data-testid"], Vo = /* @__PURE__ */ _e({
81
80
  name: "TtTableForm",
82
81
  __name: "TableForm",
83
82
  props: rt,
@@ -376,5 +375,5 @@ const lt = ["data-testid"], mt = ["data-testid"], Ko = /* @__PURE__ */ _e({
376
375
  }
377
376
  });
378
377
  export {
379
- Ko as default
378
+ Vo as default
380
379
  };
@@ -1,147 +1,166 @@
1
- import { ref as A, watchEffect as M, unref as C, watch as _, computed as F } from "vue";
2
- import { useRoute as K } from "vue-router";
3
- import { GEO_LEVEL_CODES as E, canDeriveGeoLevel as R, deriveRegionLevelOptionsFromGeoSource as T, resolveHighestGeoLevelCode as L, isGeoLevelCode as G, CODE_REGISTRY as V } from "./basicDataCodes.js";
4
- const o = /* @__PURE__ */ new Map(), D = /* @__PURE__ */ new Map(), m = /* @__PURE__ */ new Map();
5
- function v(t) {
6
- return Array.isArray(t) ? t : [];
1
+ import { ref as b, watchEffect as j, unref as L, watch as B, computed as H } from "vue";
2
+ import { useRoute as I } from "vue-router";
3
+ import { GEO_LEVEL_CODES as x, canDeriveGeoLevel as A, deriveRegionLevelOptionsFromGeoSource as Y, resolveHighestGeoLevelCode as F, isGeoLevelCode as M, CODE_REGISTRY as k } from "./basicDataCodes.js";
4
+ const c = /* @__PURE__ */ new Map(), C = /* @__PURE__ */ new Map(), O = /* @__PURE__ */ new Map(), m = /* @__PURE__ */ new Map(), v = /* @__PURE__ */ new Map();
5
+ function y(n) {
6
+ return Array.isArray(n) ? n : [];
7
7
  }
8
- function b(t) {
9
- return t.reduce((n, l) => (n[l] = [], n), {});
8
+ function J(n) {
9
+ return n.reduce((s, f) => (s[f] = [], s), {});
10
10
  }
11
- function O(t, n) {
12
- return Object.prototype.hasOwnProperty.call(t, n);
11
+ function w(n, s) {
12
+ return Object.prototype.hasOwnProperty.call(n, s);
13
13
  }
14
- function q(t) {
15
- return L(E.filter((n) => O(t, n)));
14
+ function _(n) {
15
+ return F(x.filter((s) => w(n, s)));
16
16
  }
17
- function y(t) {
18
- const n = q(t);
19
- if (!n) return t;
20
- const l = t[n];
21
- if (!Array.isArray(l)) return t;
22
- const u = { ...t };
17
+ function S(n) {
18
+ const s = _(n);
19
+ if (!s) return n;
20
+ const f = n[s];
21
+ if (!Array.isArray(f)) return n;
22
+ const u = { ...n };
23
23
  let d = !1;
24
- return E.forEach((i) => {
25
- R(n, i) && (O(u, i) || (u[i] = T(l, i), d = !0));
26
- }), d ? u : t;
24
+ return x.forEach((i) => {
25
+ A(s, i) && (w(u, i) || (u[i] = Y(f, i), d = !0));
26
+ }), d ? u : n;
27
27
  }
28
- function j(t, n) {
29
- const l = q(n), u = t.filter(G), d = l || L(u) || void 0;
30
- return d ? t.filter((i) => G(i) ? !(R(d, i) || i === d && O(n, d)) : !0) : t;
28
+ function N(n, s) {
29
+ const f = _(s), u = n.filter(M), d = f || F(u) || void 0;
30
+ return d ? n.filter((i) => M(i) ? !(A(d, i) || i === d && w(s, d)) : !0) : n;
31
31
  }
32
- function k(t) {
33
- const n = K(), l = A({});
34
- function u(s = {}) {
35
- l.value = t.codes.reduce(
36
- (e, r) => (e[r] = v(s[r]), e),
32
+ function Z(n) {
33
+ const s = I(), f = b({});
34
+ function u(t = {}) {
35
+ f.value = n.codes.reduce(
36
+ (e, r) => (e[r] = y(t[r]), e),
37
37
  {}
38
38
  );
39
39
  }
40
40
  u();
41
- async function d(s) {
42
- var h;
43
- const e = (h = n.meta) == null ? void 0 : h.permissionOnlyCode;
41
+ function d(t) {
42
+ c.delete(t), m.delete(t);
43
+ }
44
+ function i(t) {
45
+ const e = C.get(t) || /* @__PURE__ */ new Set(), r = e.size;
46
+ n.codes.forEach((l) => e.add(l)), C.set(t, e), e.size !== r && (m.delete(t), R(t));
47
+ }
48
+ function G(t) {
49
+ u(c.get(t));
50
+ }
51
+ function R(t) {
52
+ const e = m.get(t);
53
+ if (e) return e;
54
+ const r = Promise.resolve().then(() => q());
55
+ return m.set(t, r), r.finally(() => {
56
+ m.get(t) === r && m.delete(t);
57
+ }), r;
58
+ }
59
+ async function z(t) {
60
+ var l;
61
+ const e = (l = s.meta) == null ? void 0 : l.permissionOnlyCode;
44
62
  return (await Promise.allSettled(
45
- s.map(async (c) => {
63
+ t.map(async (o) => {
46
64
  try {
47
- const p = await V[c].fetchOptions({ permissionOnlyCode: e });
48
- return [c, v(p)];
65
+ const p = await k[o].fetchOptions({ permissionOnlyCode: e });
66
+ return [o, y(p)];
49
67
  } catch {
50
- return [c, []];
68
+ return [o, []];
51
69
  }
52
70
  })
53
- )).reduce((c, f, p) => {
54
- const S = s[p];
55
- return f.status === "fulfilled" ? c[f.value[0]] = v(f.value[1]) : c[S] = [], c;
71
+ )).reduce((o, g, p) => {
72
+ const D = t[p];
73
+ return g.status === "fulfilled" ? o[g.value[0]] = y(g.value[1]) : o[D] = [], o;
56
74
  }, {});
57
75
  }
58
- async function i(s = !1) {
59
- const e = n.path;
76
+ async function q(t = !1) {
77
+ const e = s.path;
60
78
  let r = [];
61
79
  try {
62
- const h = C(t.dataSource);
63
- if (h) {
64
- let a = { ...o.get(e) || {}, ...h };
65
- a = y(a), o.set(e, a), u(a);
80
+ const l = L(n.dataSource);
81
+ if (l) {
82
+ let a = { ...c.get(e) || {}, ...l };
83
+ a = S(a), c.set(e, a), u(a);
66
84
  return;
67
85
  }
68
- let c = y(o.get(e) || {});
69
- if (c !== (o.get(e) || {}) && o.set(e, c), r = s ? [...t.codes] : t.codes.filter((a) => !O(c, a)), !r.length) {
70
- u(c);
86
+ let o = S(c.get(e) || {});
87
+ o !== (c.get(e) || {}) && c.set(e, o);
88
+ const g = [...C.get(e) || n.codes];
89
+ if (r = t ? g : g.filter((a) => !w(o, a)), !r.length) {
90
+ u(o);
71
91
  return;
72
92
  }
73
- const f = s ? void 0 : D.get(e);
74
- if (f)
93
+ const p = t ? void 0 : O.get(e);
94
+ if (p)
75
95
  try {
76
- const a = await f, g = y({
77
- ...o.get(e) || {},
96
+ const a = await p, h = S({
97
+ ...c.get(e) || {},
78
98
  ...a
79
99
  });
80
- if (o.set(e, g), r = t.codes.filter((P) => !O(g, P)), !r.length) {
81
- u(g);
100
+ if (c.set(e, h), r = g.filter((V) => !w(h, V)), !r.length) {
101
+ u(h);
82
102
  return;
83
103
  }
84
- c = g;
104
+ o = h;
85
105
  } catch {
86
106
  }
87
- const p = j(r, c);
88
- if (!p.length) {
89
- const a = y(c);
90
- o.set(e, a), u(a);
107
+ const D = N(r, o);
108
+ if (!D.length) {
109
+ const a = S(o);
110
+ c.set(e, a), u(a);
91
111
  return;
92
112
  }
93
- const S = d(p), w = (m.get(e) || 0) + 1;
94
- m.set(e, w), D.set(e, S);
113
+ const P = z(D), E = (v.get(e) || 0) + 1;
114
+ v.set(e, E), O.set(e, P);
95
115
  try {
96
- const a = await S;
97
- if (m.get(e) !== w) return;
98
- let g = {
99
- ...o.get(e) || {},
116
+ const a = await P;
117
+ if (v.get(e) !== E) return;
118
+ let h = {
119
+ ...c.get(e) || {},
100
120
  ...a
101
121
  };
102
- g = y(g), o.set(e, g), u(g);
122
+ h = S(h), c.set(e, h), u(h);
103
123
  } finally {
104
- m.get(e) === w && D.delete(e);
124
+ v.get(e) === E && O.delete(e);
105
125
  }
106
126
  } catch {
107
- const h = b(r.length ? r : t.codes), f = { ...o.get(e) || {}, ...h };
108
- o.set(e, f), u(f);
127
+ const l = [...C.get(e) || n.codes], o = J(r.length ? r : l), p = { ...c.get(e) || {}, ...o };
128
+ c.set(e, p), u(p);
109
129
  }
110
130
  }
111
- async function x() {
112
- const s = n.path;
113
- D.clear(), o.clear(), m.clear(), o.delete(s), await i(!0);
131
+ async function T() {
132
+ const t = s.path, e = new Set(C.get(t) || n.codes);
133
+ O.clear(), m.clear(), c.clear(), C.clear(), v.clear(), C.set(t, e), d(t), await q(!0);
114
134
  }
115
- return M(() => {
116
- const s = C(t.dataSource);
117
- if (!s) return;
118
- const e = n.path;
119
- let r = { ...o.get(e) || {}, ...s };
120
- r = y(r), o.set(e, r), u(r);
121
- }), _(
122
- () => n.path,
123
- () => {
124
- i();
125
- },
126
- { immediate: !0 }
135
+ return j(() => {
136
+ const t = L(n.dataSource);
137
+ if (!t) return;
138
+ const e = s.path;
139
+ let r = { ...c.get(e) || {}, ...t };
140
+ r = S(r), c.set(e, r), u(r);
141
+ }), i(s.path), R(s.path).then(() => G(s.path)), B(
142
+ () => s.path,
143
+ (t) => {
144
+ i(t), R(t).then(() => G(t));
145
+ }
127
146
  ), {
128
- dataSource: F(() => {
129
- const s = t.codes.reduce(
130
- (e, r) => (e[r] = v(l.value[r]), e),
147
+ dataSource: H(() => {
148
+ const t = n.codes.reduce(
149
+ (e, r) => (e[r] = y(f.value[r]), e),
131
150
  {}
132
151
  );
133
- return new Proxy(s, {
152
+ return new Proxy(t, {
134
153
  get(e, r) {
135
- return typeof r != "string" ? [] : v(s[r]);
154
+ return typeof r != "string" ? [] : y(t[r]);
136
155
  },
137
156
  set() {
138
157
  return !1;
139
158
  }
140
159
  });
141
160
  }),
142
- reload: x
161
+ reload: T
143
162
  };
144
163
  }
145
164
  export {
146
- k as useBasicDataOptions
165
+ Z as useBasicDataOptions
147
166
  };
package/dist/index.d.ts CHANGED
@@ -16,7 +16,6 @@ export * from './components/tt-modal-form';
16
16
  export * from './components/tt-image';
17
17
  export * from './components/tt-loading';
18
18
  export * from './components/tt-table';
19
- export * from './components/tt-vtable';
20
19
  export * from './components/tt-upload';
21
20
  export * from './components/tt-nav-anchor';
22
21
  export * from './components/tt-api-component';