@oneflowui/ui 0.4.3 → 0.4.4

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 (149) hide show
  1. package/dist/assets/tableWorker-CTsbCPPP.js +1 -0
  2. package/dist/components/ContextMenu/index.vue.d.ts +2 -1
  3. package/dist/components/ContextMenu/index.vue.js +2 -2
  4. package/dist/components/ContextMenu/index.vue2.js +37 -36
  5. package/dist/components/base/DropdownMenu.vue.js +2 -2
  6. package/dist/components/base/DropdownMenu.vue2.js +38 -39
  7. package/dist/components/base/MonitorItem.vue.d.ts +1 -1
  8. package/dist/components/base/PersonaCard.vue.d.ts +2 -1
  9. package/dist/components/base/PersonaCard.vue.js +3 -3
  10. package/dist/components/base/PersonaCard.vue2.js +51 -39
  11. package/dist/components/base/RefTag.vue.d.ts +2 -2
  12. package/dist/components/base/RefTag.vue.js +3 -3
  13. package/dist/components/base/SearchHighlight.vue.d.ts +6 -0
  14. package/dist/components/base/SearchHighlight.vue.js +7 -0
  15. package/dist/components/base/SearchHighlight.vue2.js +21 -0
  16. package/dist/components/base/ToolbarBtn.vue.d.ts +2 -1
  17. package/dist/components/base/ToolbarBtn.vue.js +1 -1
  18. package/dist/components/base/ViewModeGroup.vue.d.ts +2 -1
  19. package/dist/components/base/ViewModeGroup.vue.js +3 -3
  20. package/dist/components/base/ViewSwitcher.vue.d.ts +2 -1
  21. package/dist/components/base/ViewSwitcher.vue.js +2 -2
  22. package/dist/components/base/index.d.ts +1 -0
  23. package/dist/components/field/FieldAttachment.vue.d.ts +17 -0
  24. package/dist/components/field/FieldAttachment.vue.js +7 -0
  25. package/dist/components/field/FieldAttachment.vue2.js +69 -0
  26. package/dist/components/field/FieldAutoNumber.vue.d.ts +7 -0
  27. package/dist/components/field/FieldAutoNumber.vue.js +7 -0
  28. package/dist/components/field/FieldAutoNumber.vue2.js +15 -0
  29. package/dist/components/field/FieldCreator.vue.d.ts +7 -0
  30. package/dist/components/field/FieldCreator.vue.js +7 -0
  31. package/dist/components/field/FieldCreator.vue2.js +24 -0
  32. package/dist/components/field/FieldCurrency.vue.d.ts +17 -0
  33. package/dist/components/field/FieldCurrency.vue.js +7 -0
  34. package/dist/components/field/FieldCurrency.vue2.js +42 -0
  35. package/dist/components/field/FieldDate.vue.js +2 -2
  36. package/dist/components/field/FieldDate.vue2.js +13 -10
  37. package/dist/components/field/FieldDatetime.vue.js +1 -1
  38. package/dist/components/field/FieldMarkdownPreview.vue.d.ts +13 -0
  39. package/dist/components/field/FieldMarkdownPreview.vue.js +7 -0
  40. package/dist/components/field/FieldMarkdownPreview.vue2.js +37 -0
  41. package/dist/components/field/FieldMultiSelect.vue.js +2 -2
  42. package/dist/components/field/FieldPhone.vue.d.ts +17 -0
  43. package/dist/components/field/FieldPhone.vue.js +7 -0
  44. package/dist/components/field/FieldPhone.vue2.js +34 -0
  45. package/dist/components/field/FieldProgress.vue.d.ts +15 -0
  46. package/dist/components/field/FieldProgress.vue.js +7 -0
  47. package/dist/components/field/FieldProgress.vue2.js +40 -0
  48. package/dist/components/field/FieldRelation.vue.d.ts +17 -0
  49. package/dist/components/field/FieldRelation.vue.js +7 -0
  50. package/dist/components/field/FieldRelation.vue2.js +67 -0
  51. package/dist/components/field/FieldRichText.vue.d.ts +17 -0
  52. package/dist/components/field/FieldRichText.vue.js +7 -0
  53. package/dist/components/field/FieldRichText.vue2.js +65 -0
  54. package/dist/components/field/FieldSelect.vue.js +1 -1
  55. package/dist/components/field/FieldSelect.vue2.js +43 -42
  56. package/dist/components/form/FormDesigner.vue.js +2 -2
  57. package/dist/components/form/FormDesigner.vue2.js +62 -52
  58. package/dist/components/gallery/GalleryCard.vue.js +2 -2
  59. package/dist/components/gallery/GalleryView.vue.d.ts +6 -2
  60. package/dist/components/gallery/GalleryView.vue.js +2 -2
  61. package/dist/components/gallery/GalleryView.vue2.js +30 -20
  62. package/dist/components/kanban/KanbanBoard.vue.d.ts +5 -1
  63. package/dist/components/kanban/KanbanBoard.vue.js +4 -4
  64. package/dist/components/kanban/KanbanBoard.vue2.js +81 -48
  65. package/dist/components/layout/AppLayout.vue.js +2 -2
  66. package/dist/components/layout/AppLayout.vue2.js +46 -62
  67. package/dist/components/overlay/Drawer.vue.js +1 -1
  68. package/dist/components/overlay/Drawer.vue2.js +52 -68
  69. package/dist/components/overlay/Modal.vue.js +1 -1
  70. package/dist/components/overlay/Modal.vue2.js +52 -68
  71. package/dist/components/overlay/SidePanel.vue.js +2 -2
  72. package/dist/components/overlay/SidePanel.vue2.js +64 -80
  73. package/dist/components/table/ColumnHeaderMenu.vue.d.ts +33 -0
  74. package/dist/components/table/ColumnHeaderMenu.vue.js +7 -0
  75. package/dist/components/table/ColumnHeaderMenu.vue2.js +153 -0
  76. package/dist/components/table/DataTable.vue.d.ts +116 -25
  77. package/dist/components/table/DataTable.vue.js +4 -4
  78. package/dist/components/table/DataTable.vue2.js +775 -188
  79. package/dist/components/table/DetailSheet.vue.d.ts +43 -0
  80. package/dist/components/table/DetailSheet.vue.js +7 -0
  81. package/dist/components/table/DetailSheet.vue2.js +140 -0
  82. package/dist/components/table/FieldCell.vue.d.ts +1 -1
  83. package/dist/components/table/FieldCell.vue.js +1 -1
  84. package/dist/components/table/FieldCell.vue2.js +59 -44
  85. package/dist/components/table/FieldTypePicker.vue.d.ts +15 -0
  86. package/dist/components/table/FieldTypePicker.vue.js +7 -0
  87. package/dist/components/table/FieldTypePicker.vue2.js +92 -0
  88. package/dist/components/table/MobileListView.vue.d.ts +24 -0
  89. package/dist/components/table/MobileListView.vue.js +7 -0
  90. package/dist/components/table/MobileListView.vue2.js +90 -0
  91. package/dist/components/table/TableGroupRow.vue.d.ts +5 -0
  92. package/dist/components/table/TableGroupRow.vue.js +2 -2
  93. package/dist/components/table/TableGroupRow.vue2.js +33 -23
  94. package/dist/components/table/TableHeaderRow.vue.d.ts +16 -0
  95. package/dist/components/table/TableHeaderRow.vue.js +2 -2
  96. package/dist/components/table/TableHeaderRow.vue2.js +54 -33
  97. package/dist/components/table/TableToolbar.vue.d.ts +118 -0
  98. package/dist/components/table/TableToolbar.vue.js +7 -0
  99. package/dist/components/table/TableToolbar.vue2.js +273 -0
  100. package/dist/components/table/index.d.ts +5 -0
  101. package/dist/components/timeline/GanttTimeline.vue.js +1 -1
  102. package/dist/components/timeline/GanttTimeline.vue2.js +128 -127
  103. package/dist/components/toast/ToastItem.vue.js +3 -3
  104. package/dist/composables/index.d.ts +19 -0
  105. package/dist/composables/useBreakpoint.d.ts +2 -1
  106. package/dist/composables/useBreakpoint.js +14 -12
  107. package/dist/composables/useColumnResize.d.ts +19 -0
  108. package/dist/composables/useColumnResize.js +58 -0
  109. package/dist/composables/useDraftRows.d.ts +33 -0
  110. package/dist/composables/useDraftRows.js +103 -0
  111. package/dist/composables/useFixedColumns.d.ts +25 -0
  112. package/dist/composables/useFixedColumns.js +61 -0
  113. package/dist/composables/useFocusTrap.d.ts +10 -0
  114. package/dist/composables/useFocusTrap.js +37 -0
  115. package/dist/composables/useInlineEdit.js +3 -3
  116. package/dist/composables/useKeyboardNavigation.d.ts +45 -0
  117. package/dist/composables/useKeyboardNavigation.js +140 -0
  118. package/dist/composables/useRowDrag.d.ts +32 -0
  119. package/dist/composables/useRowDrag.js +85 -0
  120. package/dist/composables/useSchemaEngine.d.ts +31 -0
  121. package/dist/composables/useSchemaEngine.js +129 -0
  122. package/dist/composables/useSearch.d.ts +30 -0
  123. package/dist/composables/useSearch.js +59 -0
  124. package/dist/composables/useSupabaseProvider.d.ts +70 -0
  125. package/dist/composables/useSupabaseProvider.js +126 -0
  126. package/dist/composables/useTable.d.ts +3 -0
  127. package/dist/composables/useTable.js +103 -83
  128. package/dist/composables/useTableGroup.d.ts +14 -1
  129. package/dist/composables/useTableGroup.js +57 -33
  130. package/dist/composables/useViewPersistence.d.ts +98 -0
  131. package/dist/composables/useViewPersistence.js +141 -0
  132. package/dist/composables/useVirtualList.d.ts +4 -1
  133. package/dist/composables/useVirtualList.js +108 -85
  134. package/dist/composables/useWorkerSort.d.ts +14 -0
  135. package/dist/composables/useWorkerSort.js +61 -0
  136. package/dist/index.d.ts +28 -4
  137. package/dist/index.js +264 -216
  138. package/dist/style.css +1 -1
  139. package/dist/types/index.d.ts +63 -2
  140. package/dist/types/index.js +23 -6
  141. package/dist/types/table-internal.d.ts +64 -0
  142. package/dist/utils/aggregation.d.ts +5 -0
  143. package/dist/utils/aggregation.js +38 -0
  144. package/dist/utils/supabaseAdapter.d.ts +48 -0
  145. package/dist/utils/supabaseAdapter.js +76 -0
  146. package/dist/utils/supabaseSchema.d.ts +81 -0
  147. package/dist/utils/supabaseSchema.js +202 -0
  148. package/dist/workers/tableWorker.d.ts +31 -0
  149. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
1
  import t from "./GanttTimeline.vue2.js";
2
2
  /* empty css */
3
3
  import o from "../../_virtual/_plugin-vue_export-helper.js";
4
- const e = /* @__PURE__ */ o(t, [["__scopeId", "data-v-4c4406f6"]]);
4
+ const e = /* @__PURE__ */ o(t, [["__scopeId", "data-v-87818263"]]);
5
5
  export {
6
6
  e as default
7
7
  };
@@ -1,10 +1,10 @@
1
- import { defineComponent as Y, computed as o, ref as G, watch as N, openBlock as d, createElementBlock as f, normalizeStyle as _, createElementVNode as w, Fragment as M, renderList as T, normalizeClass as A, toDisplayString as W, createCommentVNode as R, createBlock as j } from "vue";
2
- import q from "./GanttRow.vue.js";
3
- import { taskToDataRecord as J } from "../../types/index.js";
4
- const K = { class: "gantt-timeline__header" }, P = { class: "gantt-timeline__rows" }, Q = {
1
+ import { defineComponent as J, computed as s, ref as K, watch as P, openBlock as l, createElementBlock as c, normalizeStyle as _, createElementVNode as I, Fragment as R, renderList as T, normalizeClass as Q, toDisplayString as U, createCommentVNode as b, createBlock as X } from "vue";
2
+ import Z from "./GanttRow.vue.js";
3
+ import { taskToDataRecord as tt, buildGanttItems as et } from "../../types/index.js";
4
+ const at = { class: "gantt-timeline__header" }, nt = { class: "gantt-timeline__rows" }, rt = {
5
5
  key: 0,
6
6
  class: "gantt-timeline__empty"
7
- }, m = 40, tt = /* @__PURE__ */ Y({
7
+ }, f = 40, lt = /* @__PURE__ */ J({
8
8
  __name: "GanttTimeline",
9
9
  props: {
10
10
  records: {},
@@ -19,167 +19,168 @@ const K = { class: "gantt-timeline__header" }, P = { class: "gantt-timeline__row
19
19
  days: { default: 30 }
20
20
  },
21
21
  emits: ["row-click", "record-change", "update:records"],
22
- setup(b, { emit: z }) {
23
- const r = b, x = z;
24
- function l(t) {
25
- return /* @__PURE__ */ new Date(`${t}T00:00:00`);
22
+ setup(E, { emit: L }) {
23
+ const n = E, S = L;
24
+ function i(e) {
25
+ return /* @__PURE__ */ new Date(`${e}T00:00:00`);
26
26
  }
27
- function p(t) {
28
- const e = t.getFullYear(), a = String(t.getMonth() + 1).padStart(2, "0"), n = String(t.getDate()).padStart(2, "0");
29
- return `${e}-${a}-${n}`;
27
+ function h(e) {
28
+ const t = e.getFullYear(), a = String(e.getMonth() + 1).padStart(2, "0"), r = String(e.getDate()).padStart(2, "0");
29
+ return `${t}-${a}-${r}`;
30
30
  }
31
- function h(t, e) {
32
- return Math.round((l(e).getTime() - l(t).getTime()) / 864e5);
31
+ function y(e, t) {
32
+ return Math.round((i(t).getTime() - i(e).getTime()) / 864e5);
33
33
  }
34
- function v(t, e) {
35
- const a = l(t), n = new Date(a);
36
- return n.setDate(a.getDate() + e), p(n);
34
+ function p(e, t) {
35
+ const a = i(e), r = new Date(a);
36
+ return r.setDate(a.getDate() + t), h(r);
37
37
  }
38
- function S(t) {
39
- if (typeof t != "string" || !t) return null;
40
- const e = t.match(/^(\d{4}-\d{2}-\d{2})/);
41
- return e ? e[1] : null;
38
+ function w(e) {
39
+ if (typeof e != "string" || !e) return null;
40
+ const t = e.match(/^(\d{4}-\d{2}-\d{2})/);
41
+ return t ? t[1] : null;
42
42
  }
43
- function I() {
44
- const t = /* @__PURE__ */ new Date();
45
- return `${t.getFullYear()}-${String(t.getMonth() + 1).padStart(2, "0")}-01`;
43
+ function x() {
44
+ const e = /* @__PURE__ */ new Date();
45
+ return `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-01`;
46
46
  }
47
- const $ = o(() => {
48
- var t, e;
49
- return (t = r.records) != null && t.length ? r.records : (e = r.data) != null && e.length ? r.data.map(J) : [];
50
- }), D = o(() => {
51
- var t, e;
52
- if ((t = r.records) != null && t.length || (e = r.data) != null && e.length) {
53
- const a = [];
54
- for (const n of $.value) {
55
- const i = S(n.fields[r.startFieldId]), c = S(n.fields[r.endFieldId]), s = n.fields[r.labelFieldId];
56
- !i || !c || a.push({
57
- id: n.id,
58
- sourceRecordId: n.id,
59
- title: typeof s == "string" && s ? s : n.id,
60
- status: typeof n.fields.status == "string" ? n.fields.status : "",
61
- priority: typeof n.fields.priority == "string" ? n.fields.priority : "",
62
- startDate: i,
63
- endDate: c
64
- });
65
- }
66
- return a;
67
- }
68
- return (r.items ?? []).map((a) => ({
69
- id: a.id,
70
- title: a.title,
71
- status: a.status,
72
- priority: a.priority,
73
- startDate: a.startDate,
74
- endDate: a.endDate,
75
- barColor: a.barColor
76
- }));
77
- }), B = o(() => {
78
- if (!D.value.length) return r.startDate || I();
79
- const t = Math.min(
80
- ...D.value.map((a) => l(a.startDate).getTime())
81
- ), e = new Date(t);
82
- return e.setDate(e.getDate() - 1), p(e);
83
- }), E = o(() => {
84
- if (!D.value.length)
85
- return v(r.startDate || I(), r.days - 1);
86
- const t = Math.max(...D.value.map((a) => l(a.endDate).getTime())), e = new Date(t);
87
- return e.setDate(e.getDate() + 1), p(e);
88
- }), g = o(() => r.startDate || B.value), y = o(() => r.startDate ? r.days : Math.max(r.days, h(g.value, E.value) + 1)), L = o(() => {
89
- const t = [];
90
- for (let e = 0; e < y.value; e++)
91
- t.push(v(g.value, e));
92
- return t;
93
- }), u = G([]);
94
- N(
95
- D,
96
- (t) => {
97
- u.value = t.map((e) => ({ ...e }));
47
+ const z = s(() => n.startFieldId ?? "startDate"), B = s(() => n.endFieldId ?? "endDate"), G = s(() => n.labelFieldId ?? "title"), F = s(() => {
48
+ var e, t;
49
+ return (e = n.records) != null && e.length ? n.records : (t = n.data) != null && t.length ? n.data.map(tt) : [];
50
+ }), H = s(() => {
51
+ var e, t, a;
52
+ return (e = n.items) != null && e.length ? n.items : (t = n.records) != null && t.length || (a = n.data) != null && a.length ? et(F.value, {
53
+ startFieldId: z.value,
54
+ endFieldId: B.value,
55
+ labelFieldId: G.value
56
+ }) : [];
57
+ }), m = s(() => H.value.map((t) => {
58
+ const a = w(t.startDate), r = w(t.endDate);
59
+ return {
60
+ id: t.id,
61
+ sourceRecordId: t.id,
62
+ title: t.title,
63
+ status: t.status,
64
+ priority: t.priority,
65
+ startDate: a ?? t.startDate,
66
+ endDate: r ?? t.endDate,
67
+ barColor: t.barColor
68
+ };
69
+ }).filter(
70
+ (t) => w(t.startDate) !== null && w(t.endDate) !== null
71
+ )), O = s(() => {
72
+ var a, r;
73
+ const e = [...m.value], t = (r = (a = n.viewConfig) == null ? void 0 : a.sorts) == null ? void 0 : r[0];
74
+ return t && e.sort((d, v) => {
75
+ const o = d[t.fieldId] ?? "", q = v[t.fieldId] ?? "", M = String(o).localeCompare(String(q));
76
+ return t.direction === "desc" ? -M : M;
77
+ }), e;
78
+ }), V = s(() => {
79
+ if (!m.value.length) return n.startDate || x();
80
+ const e = Math.min(
81
+ ...m.value.map((a) => i(a.startDate).getTime())
82
+ ), t = new Date(e);
83
+ return t.setDate(t.getDate() - 1), h(t);
84
+ }), Y = s(() => {
85
+ if (!m.value.length)
86
+ return p(n.startDate || x(), n.days - 1);
87
+ const e = Math.max(...m.value.map((a) => i(a.endDate).getTime())), t = new Date(e);
88
+ return t.setDate(t.getDate() + 1), h(t);
89
+ }), D = s(() => n.startDate || V.value), g = s(() => n.startDate ? n.days : Math.max(n.days, y(D.value, Y.value) + 1)), N = s(() => {
90
+ const e = [];
91
+ for (let t = 0; t < g.value; t++)
92
+ e.push(p(D.value, t));
93
+ return e;
94
+ }), u = K([]);
95
+ P(
96
+ O,
97
+ (e) => {
98
+ u.value = e.map((t) => ({ ...t }));
98
99
  },
99
100
  { immediate: !0 }
100
101
  );
101
- const k = o(() => {
102
- const t = g.value, e = y.value;
102
+ const C = s(() => {
103
+ const e = D.value, t = g.value;
103
104
  return u.value.map((a) => {
104
- const n = Math.max(0, h(t, a.startDate)), i = Math.max(n, h(t, a.endDate)), c = Math.max(1, i - n + 1);
105
- return { row: a, offsetDays: Math.min(n, e - 1), durationDays: c };
105
+ const r = Math.max(0, y(e, a.startDate)), d = Math.max(r, y(e, a.endDate)), v = Math.max(1, d - r + 1);
106
+ return { row: a, offsetDays: Math.min(r, t - 1), durationDays: v };
106
107
  });
107
- }), C = p(/* @__PURE__ */ new Date());
108
- function H(t) {
109
- return t === C;
108
+ }), $ = h(/* @__PURE__ */ new Date());
109
+ function A(e) {
110
+ return e === $;
110
111
  }
111
- function O(t) {
112
- const e = l(t);
113
- return `${String(e.getMonth() + 1).padStart(2, "0")}/${String(e.getDate()).padStart(2, "0")}`;
112
+ function W(e) {
113
+ const t = i(e);
114
+ return `${String(t.getMonth() + 1).padStart(2, "0")}/${String(t.getDate()).padStart(2, "0")}`;
114
115
  }
115
- const F = o(() => {
116
- const t = h(g.value, C);
117
- return t < 0 || t > y.value - 1 ? null : t * m + m / 2;
116
+ const k = s(() => {
117
+ const e = y(D.value, $);
118
+ return e < 0 || e > g.value - 1 ? null : e * f + f / 2;
118
119
  });
119
- function V(t) {
120
- const e = u.value.findIndex((s) => s.id === t.id);
121
- if (e === -1) return;
122
- const a = v(g.value, t.offsetDays), n = v(a, t.durationDays - 1);
123
- u.value[e] = {
124
- ...u.value[e],
120
+ function j(e) {
121
+ const t = u.value.findIndex((o) => o.id === e.id);
122
+ if (t === -1) return;
123
+ const a = p(D.value, e.offsetDays), r = p(a, e.durationDays - 1);
124
+ u.value[t] = {
125
+ ...u.value[t],
125
126
  startDate: a,
126
- endDate: n
127
+ endDate: r
127
128
  };
128
- const i = u.value[e].sourceRecordId;
129
- if (!i) return;
130
- x("record-change", {
131
- recordId: i,
129
+ const d = u.value[t].sourceRecordId;
130
+ if (!d) return;
131
+ S("record-change", {
132
+ recordId: d,
132
133
  startDate: a,
133
- endDate: n
134
+ endDate: r
134
135
  });
135
- const c = $.value.map((s) => s.id !== i ? s : {
136
- ...s,
136
+ const v = F.value.map((o) => o.id !== d ? o : {
137
+ ...o,
137
138
  fields: {
138
- ...s.fields,
139
- [r.startFieldId]: a,
140
- [r.endFieldId]: n
139
+ ...o.fields,
140
+ [n.startFieldId]: a,
141
+ [n.endFieldId]: r
141
142
  }
142
143
  });
143
- x("update:records", c);
144
+ S("update:records", v);
144
145
  }
145
- return (t, e) => (d(), f("div", {
146
+ return (e, t) => (l(), c("div", {
146
147
  class: "gantt-timeline",
147
- style: _({ "--day-width": `${m}px` })
148
+ style: _({ "--day-width": `${f}px` })
148
149
  }, [
149
- w("div", K, [
150
- e[0] || (e[0] = w("div", { class: "gantt-timeline__header-label" }, "任务", -1)),
151
- w("div", {
150
+ I("div", at, [
151
+ t[0] || (t[0] = I("div", { class: "gantt-timeline__header-label" }, "任务", -1)),
152
+ I("div", {
152
153
  class: "gantt-timeline__header-dates",
153
- style: _({ width: `${y.value * m}px` })
154
+ style: _({ width: `${g.value * f}px` })
154
155
  }, [
155
- (d(!0), f(M, null, T(L.value, (a) => (d(), f("div", {
156
+ (l(!0), c(R, null, T(N.value, (a) => (l(), c("div", {
156
157
  key: a,
157
- class: A(["gantt-timeline__header-cell", { "gantt-timeline__header-cell--today": H(a) }]),
158
- style: _({ width: `${m}px` })
159
- }, W(O(a)), 7))), 128)),
160
- F.value !== null ? (d(), f("div", {
158
+ class: Q(["gantt-timeline__header-cell", { "gantt-timeline__header-cell--today": A(a) }]),
159
+ style: _({ width: `${f}px` })
160
+ }, U(W(a)), 7))), 128)),
161
+ k.value !== null ? (l(), c("div", {
161
162
  key: 0,
162
163
  class: "gantt-timeline__today-line",
163
- style: _({ left: `${F.value}px` })
164
- }, null, 4)) : R("", !0)
164
+ style: _({ left: `${k.value}px` })
165
+ }, null, 4)) : b("", !0)
165
166
  ], 4)
166
167
  ]),
167
- w("div", P, [
168
- (d(!0), f(M, null, T(k.value, (a) => (d(), j(q, {
168
+ I("div", nt, [
169
+ (l(!0), c(R, null, T(C.value, (a) => (l(), X(Z, {
169
170
  key: a.row.id,
170
171
  item: a.row,
171
172
  "offset-days": a.offsetDays,
172
173
  "duration-days": a.durationDays,
173
- "day-width": m,
174
- "total-days": y.value,
175
- onChange: V,
176
- onClick: (n) => x("row-click", a.row)
174
+ "day-width": f,
175
+ "total-days": g.value,
176
+ onChange: j,
177
+ onClick: (r) => S("row-click", a.row)
177
178
  }, null, 8, ["item", "offset-days", "duration-days", "total-days", "onClick"]))), 128)),
178
- k.value.length === 0 ? (d(), f("div", Q, "暂无任务数据")) : R("", !0)
179
+ C.value.length === 0 ? (l(), c("div", rt, "暂无任务数据")) : b("", !0)
179
180
  ])
180
181
  ], 4));
181
182
  }
182
183
  });
183
184
  export {
184
- tt as default
185
+ lt as default
185
186
  };
@@ -1,7 +1,7 @@
1
- import a from "./ToastItem.vue2.js";
1
+ import o from "./ToastItem.vue2.js";
2
2
  /* empty css */
3
- import o from "../../_virtual/_plugin-vue_export-helper.js";
4
- const p = /* @__PURE__ */ o(a, [["__scopeId", "data-v-83caaa5a"]]);
3
+ import t from "../../_virtual/_plugin-vue_export-helper.js";
4
+ const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-1b04945c"]]);
5
5
  export {
6
6
  p as default
7
7
  };
@@ -23,3 +23,22 @@ export type { UseTableDataOptions } from './useTableData';
23
23
  export { useTableColumns } from './useTableColumns';
24
24
  export type { UseTableColumnsOptions } from './useTableColumns';
25
25
  export { useBreakpoint } from './useBreakpoint';
26
+ export { useColumnResize } from './useColumnResize';
27
+ export type { UseColumnResizeOptions } from './useColumnResize';
28
+ export { useFixedColumns } from './useFixedColumns';
29
+ export type { UseFixedColumnsOptions } from './useFixedColumns';
30
+ export { useKeyboardNavigation } from './useKeyboardNavigation';
31
+ export type { UseKeyboardNavigationOptions, SelectedCell } from './useKeyboardNavigation';
32
+ export { useRowDrag } from './useRowDrag';
33
+ export type { RowReorderPayload, RowGroupChangePayload } from './useRowDrag';
34
+ export { useDraftRows } from './useDraftRows';
35
+ export type { UseDraftRowsOptions } from './useDraftRows';
36
+ export { useWorkerSort } from './useWorkerSort';
37
+ export { useSchemaEngine } from './useSchemaEngine';
38
+ export type { ValidationRule, FilterFieldConfig, FilterPanelConfig, UseSchemaEngineOptions, } from './useSchemaEngine';
39
+ export { useSupabaseProvider } from './useSupabaseProvider';
40
+ export type { SupabaseQueryBuilder, SupabaseFilterBuilder, UseSupabaseProviderOptions, } from './useSupabaseProvider';
41
+ export { useViewPersistence, createLocalStorageBackend, createSupabaseBackend, } from './useViewPersistence';
42
+ export type { ViewStorageBackend, SupabaseViewBackendOptions, UseViewPersistenceOptions, } from './useViewPersistence';
43
+ export { useSearch } from './useSearch';
44
+ export type { UseSearchOptions, SearchHighlight } from './useSearch';
@@ -1,5 +1,6 @@
1
1
  export declare function useBreakpoint(): {
2
2
  isMobile: import('vue').Ref<boolean, boolean>;
3
3
  isTablet: import('vue').Ref<boolean, boolean>;
4
- isDesktop: import('vue').Ref<boolean, boolean>;
4
+ isDesktop: import('vue').ComputedRef<boolean>;
5
+ hasTouch: import('vue').Ref<boolean, boolean>;
5
6
  };
@@ -1,16 +1,18 @@
1
- import { ref as t, onMounted as s, onUnmounted as r } from "vue";
2
- function a() {
3
- const o = t(!1), i = t(!1);
4
- function e() {
5
- const n = window.innerWidth;
6
- o.value = n < 768, i.value = n >= 768 && n < 1024;
1
+ import { ref as i, onMounted as r, onUnmounted as d, computed as a } from "vue";
2
+ function c() {
3
+ const e = i(!1), n = i(!1), s = i(typeof window < "u" && "ontouchstart" in window);
4
+ function o() {
5
+ const t = window.innerWidth;
6
+ e.value = t < 768, n.value = t >= 768 && t < 1024;
7
7
  }
8
- return s(() => {
9
- e(), window.addEventListener("resize", e, { passive: !0 });
10
- }), r(() => {
11
- window.removeEventListener("resize", e);
12
- }), { isMobile: o, isTablet: i, isDesktop: t(!0) };
8
+ r(() => {
9
+ o(), window.addEventListener("resize", o, { passive: !0 });
10
+ }), d(() => {
11
+ window.removeEventListener("resize", o);
12
+ });
13
+ const u = a(() => !e.value && !n.value);
14
+ return { isMobile: e, isTablet: n, isDesktop: u, hasTouch: s };
13
15
  }
14
16
  export {
15
- a as useBreakpoint
17
+ c as useBreakpoint
16
18
  };
@@ -0,0 +1,19 @@
1
+ import { Ref } from 'vue';
2
+ import { TableColumn } from '../types';
3
+ export interface UseColumnResizeOptions {
4
+ columns: Ref<TableColumn[]>;
5
+ /** Minimum column width in px (default 60) */
6
+ minWidth?: number;
7
+ /** Called on every mousemove during resize */
8
+ onResize?: (colKey: string, newWidth: number) => void;
9
+ }
10
+ export declare function useColumnResize(options: UseColumnResizeOptions): {
11
+ startResize: (event: MouseEvent, colKey: string) => void;
12
+ isResizing: Readonly<Ref<boolean, boolean>>;
13
+ resizingColumn: Readonly<Ref<string | null, string | null>>;
14
+ columnWidthOverrides: Readonly<Ref<ReadonlyMap<string, number>, ReadonlyMap<string, number>>>;
15
+ resolvedWidth: (colKey: string) => number;
16
+ autoFitColumn: (colKey: string, containerEl: HTMLElement | null) => void;
17
+ resizeIndicatorX: Readonly<Ref<number, number>>;
18
+ showResizeIndicator: Readonly<Ref<boolean, boolean>>;
19
+ };
@@ -0,0 +1,58 @@
1
+ import { ref as o, onUnmounted as b, readonly as a } from "vue";
2
+ function E(u) {
3
+ const d = u.minWidth ?? 60, m = o(!1), v = o(null), i = o(/* @__PURE__ */ new Map()), f = o(0), h = o(!1);
4
+ let n = null, y = "", W = "";
5
+ function X(e) {
6
+ if (i.value.has(e))
7
+ return i.value.get(e);
8
+ const t = u.columns.value.find((s) => s.key === e);
9
+ return !t || t.width === "fill" ? 200 : t.width ?? 200;
10
+ }
11
+ function w(e) {
12
+ var r;
13
+ if (!n) return;
14
+ const t = e.clientX - n.startX, s = Math.max(d, n.initialWidth + t), l = new Map(i.value);
15
+ l.set(n.colKey, s), i.value = l, f.value = e.clientX, (r = u.onResize) == null || r.call(u, n.colKey, s);
16
+ }
17
+ function z() {
18
+ n && (document.body.style.cursor = y, document.body.style.userSelect = W, document.removeEventListener("mousemove", w), document.removeEventListener("mouseup", z), m.value = !1, v.value = null, h.value = !1, n = null);
19
+ }
20
+ function R(e, t) {
21
+ e.preventDefault(), e.stopPropagation(), n = {
22
+ colKey: t,
23
+ startX: e.clientX,
24
+ initialWidth: X(t)
25
+ }, m.value = !0, v.value = t, f.value = e.clientX, h.value = !0, y = document.body.style.cursor, W = document.body.style.userSelect, document.body.style.cursor = "col-resize", document.body.style.userSelect = "none", document.addEventListener("mousemove", w), document.addEventListener("mouseup", z);
26
+ }
27
+ function g(e) {
28
+ return X(e);
29
+ }
30
+ function C(e, t) {
31
+ var r;
32
+ if (!t) return;
33
+ const s = t.querySelectorAll(`[data-col-key="${e}"]`);
34
+ let l = d;
35
+ if (s.forEach((c) => {
36
+ const M = c.firstElementChild;
37
+ M && (l = Math.max(l, M.scrollWidth + 24));
38
+ }), l > d) {
39
+ const c = new Map(i.value);
40
+ c.set(e, l), i.value = c, (r = u.onResize) == null || r.call(u, e, l);
41
+ }
42
+ }
43
+ return b(() => {
44
+ n && z();
45
+ }), {
46
+ startResize: R,
47
+ isResizing: a(m),
48
+ resizingColumn: a(v),
49
+ columnWidthOverrides: a(i),
50
+ resolvedWidth: g,
51
+ autoFitColumn: C,
52
+ resizeIndicatorX: a(f),
53
+ showResizeIndicator: a(h)
54
+ };
55
+ }
56
+ export {
57
+ E as useColumnResize
58
+ };
@@ -0,0 +1,33 @@
1
+ import { Ref } from 'vue';
2
+ import { CellValue, DataRecord, TableSchema } from '../types';
3
+ export interface UseDraftRowsOptions {
4
+ schema: Ref<TableSchema | undefined>;
5
+ groupFieldId?: Ref<string | undefined>;
6
+ }
7
+ export declare function useDraftRows(options: UseDraftRowsOptions): {
8
+ drafts: Readonly<Ref<ReadonlyMap<string, {
9
+ readonly draftId: string;
10
+ readonly fields: {
11
+ readonly [x: string]: string | number | boolean | readonly string[] | null;
12
+ };
13
+ readonly dirtyFields: ReadonlySet<string>;
14
+ readonly validationErrors: ReadonlyMap<string, string>;
15
+ readonly groupFieldValue?: string | number | boolean | readonly string[] | null | undefined;
16
+ }>, ReadonlyMap<string, {
17
+ readonly draftId: string;
18
+ readonly fields: {
19
+ readonly [x: string]: string | number | boolean | readonly string[] | null;
20
+ };
21
+ readonly dirtyFields: ReadonlySet<string>;
22
+ readonly validationErrors: ReadonlyMap<string, string>;
23
+ readonly groupFieldValue?: string | number | boolean | readonly string[] | null | undefined;
24
+ }>>>;
25
+ addDraft: (groupFieldValue?: CellValue) => string;
26
+ updateDraftField: (draftId: string, fieldId: string, value: CellValue) => void;
27
+ removeDraft: (draftId: string) => void;
28
+ commitDraft: (draftId: string) => DataRecord | null;
29
+ commitAll: () => DataRecord[];
30
+ discardAll: () => void;
31
+ isDraft: (rowId: string) => boolean;
32
+ getDraftErrors: (draftId: string) => Map<string, string>;
33
+ };
@@ -0,0 +1,103 @@
1
+ import { ref as E, readonly as h } from "vue";
2
+ let g = 0;
3
+ function _() {
4
+ return `__draft__${++g}__${Date.now()}`;
5
+ }
6
+ function y(l) {
7
+ const n = E(/* @__PURE__ */ new Map());
8
+ function d(t) {
9
+ var i;
10
+ const e = _(), o = {}, r = l.schema.value;
11
+ if (r)
12
+ for (const D of r.fields)
13
+ o[D.id] = null;
14
+ const a = (i = l.groupFieldId) == null ? void 0 : i.value;
15
+ a && t !== void 0 && (o[a] = t);
16
+ const s = new Map(n.value);
17
+ return s.set(e, {
18
+ draftId: e,
19
+ fields: o,
20
+ dirtyFields: /* @__PURE__ */ new Set(),
21
+ validationErrors: /* @__PURE__ */ new Map(),
22
+ groupFieldValue: t
23
+ }), n.value = s, e;
24
+ }
25
+ function c(t, e, o) {
26
+ const r = n.value.get(t);
27
+ if (!r) return;
28
+ const a = new Map(n.value), s = {
29
+ ...r,
30
+ fields: { ...r.fields, [e]: o },
31
+ dirtyFields: /* @__PURE__ */ new Set([...r.dirtyFields, e])
32
+ };
33
+ if (r.validationErrors.has(e)) {
34
+ const i = new Map(r.validationErrors);
35
+ i.delete(e), s.validationErrors = i;
36
+ }
37
+ a.set(t, s), n.value = a;
38
+ }
39
+ function f(t) {
40
+ const e = new Map(n.value);
41
+ e.delete(t), n.value = e;
42
+ }
43
+ function v(t) {
44
+ const e = n.value.get(t);
45
+ if (!e) return null;
46
+ const o = u(e);
47
+ if (o.size > 0) {
48
+ const a = new Map(n.value);
49
+ return a.set(t, { ...e, validationErrors: o }), n.value = a, null;
50
+ }
51
+ const r = {
52
+ id: t,
53
+ // Consumer should replace with server-generated id
54
+ fields: { ...e.fields }
55
+ };
56
+ return f(t), r;
57
+ }
58
+ function w() {
59
+ const t = [], e = /* @__PURE__ */ new Map();
60
+ for (const [o, r] of n.value) {
61
+ const a = u(r);
62
+ a.size > 0 ? e.set(o, { ...r, validationErrors: a }) : t.push({
63
+ id: o,
64
+ fields: { ...r.fields }
65
+ });
66
+ }
67
+ return n.value = e, t;
68
+ }
69
+ function p() {
70
+ n.value = /* @__PURE__ */ new Map();
71
+ }
72
+ function m(t) {
73
+ return n.value.has(t);
74
+ }
75
+ function M(t) {
76
+ var e;
77
+ return ((e = n.value.get(t)) == null ? void 0 : e.validationErrors) ?? /* @__PURE__ */ new Map();
78
+ }
79
+ function u(t) {
80
+ const e = /* @__PURE__ */ new Map(), o = l.schema.value;
81
+ if (!o) return e;
82
+ for (const r of o.fields)
83
+ if (r.required) {
84
+ const a = t.fields[r.id];
85
+ (a == null || a === "") && e.set(r.id, `${r.name} 为必填项`);
86
+ }
87
+ return e;
88
+ }
89
+ return {
90
+ drafts: h(n),
91
+ addDraft: d,
92
+ updateDraftField: c,
93
+ removeDraft: f,
94
+ commitDraft: v,
95
+ commitAll: w,
96
+ discardAll: p,
97
+ isDraft: m,
98
+ getDraftErrors: M
99
+ };
100
+ }
101
+ export {
102
+ y as useDraftRows
103
+ };
@@ -0,0 +1,25 @@
1
+ import { Ref, ComputedRef } from 'vue';
2
+ import { TableColumn } from '../types';
3
+ export interface UseFixedColumnsOptions {
4
+ columns: Ref<TableColumn[]>;
5
+ fixedColumnKeys: Ref<string[]>;
6
+ scrollContainerRef: Ref<HTMLElement | null>;
7
+ fixedContainerRef: Ref<HTMLElement | null>;
8
+ /** Width of the selector checkbox column (default 40) */
9
+ selectorWidth?: number;
10
+ }
11
+ export declare function useFixedColumns(options: UseFixedColumnsOptions): {
12
+ fixedColumns: ComputedRef<TableColumn[]>;
13
+ scrollableColumns: ComputedRef<TableColumn[]>;
14
+ fixedWidth: ComputedRef<number>;
15
+ handleScroll: (e: Event) => void;
16
+ handleFixedScroll: (e: Event) => void;
17
+ scrollLeft: Readonly<Ref<number, number>>;
18
+ syncHover: (rowId: string | null) => void;
19
+ isRowHovered: (rowId: string) => boolean;
20
+ hoverState: Readonly<Ref<{
21
+ readonly rowId: string | null;
22
+ }, {
23
+ readonly rowId: string | null;
24
+ }>>;
25
+ };