@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.
- package/dist/assets/tableWorker-CTsbCPPP.js +1 -0
- package/dist/components/ContextMenu/index.vue.d.ts +2 -1
- package/dist/components/ContextMenu/index.vue.js +2 -2
- package/dist/components/ContextMenu/index.vue2.js +37 -36
- package/dist/components/base/DropdownMenu.vue.js +2 -2
- package/dist/components/base/DropdownMenu.vue2.js +38 -39
- package/dist/components/base/MonitorItem.vue.d.ts +1 -1
- package/dist/components/base/PersonaCard.vue.d.ts +2 -1
- package/dist/components/base/PersonaCard.vue.js +3 -3
- package/dist/components/base/PersonaCard.vue2.js +51 -39
- package/dist/components/base/RefTag.vue.d.ts +2 -2
- package/dist/components/base/RefTag.vue.js +3 -3
- package/dist/components/base/SearchHighlight.vue.d.ts +6 -0
- package/dist/components/base/SearchHighlight.vue.js +7 -0
- package/dist/components/base/SearchHighlight.vue2.js +21 -0
- package/dist/components/base/ToolbarBtn.vue.d.ts +2 -1
- package/dist/components/base/ToolbarBtn.vue.js +1 -1
- package/dist/components/base/ViewModeGroup.vue.d.ts +2 -1
- package/dist/components/base/ViewModeGroup.vue.js +3 -3
- package/dist/components/base/ViewSwitcher.vue.d.ts +2 -1
- package/dist/components/base/ViewSwitcher.vue.js +2 -2
- package/dist/components/base/index.d.ts +1 -0
- package/dist/components/field/FieldAttachment.vue.d.ts +17 -0
- package/dist/components/field/FieldAttachment.vue.js +7 -0
- package/dist/components/field/FieldAttachment.vue2.js +69 -0
- package/dist/components/field/FieldAutoNumber.vue.d.ts +7 -0
- package/dist/components/field/FieldAutoNumber.vue.js +7 -0
- package/dist/components/field/FieldAutoNumber.vue2.js +15 -0
- package/dist/components/field/FieldCreator.vue.d.ts +7 -0
- package/dist/components/field/FieldCreator.vue.js +7 -0
- package/dist/components/field/FieldCreator.vue2.js +24 -0
- package/dist/components/field/FieldCurrency.vue.d.ts +17 -0
- package/dist/components/field/FieldCurrency.vue.js +7 -0
- package/dist/components/field/FieldCurrency.vue2.js +42 -0
- package/dist/components/field/FieldDate.vue.js +2 -2
- package/dist/components/field/FieldDate.vue2.js +13 -10
- package/dist/components/field/FieldDatetime.vue.js +1 -1
- package/dist/components/field/FieldMarkdownPreview.vue.d.ts +13 -0
- package/dist/components/field/FieldMarkdownPreview.vue.js +7 -0
- package/dist/components/field/FieldMarkdownPreview.vue2.js +37 -0
- package/dist/components/field/FieldMultiSelect.vue.js +2 -2
- package/dist/components/field/FieldPhone.vue.d.ts +17 -0
- package/dist/components/field/FieldPhone.vue.js +7 -0
- package/dist/components/field/FieldPhone.vue2.js +34 -0
- package/dist/components/field/FieldProgress.vue.d.ts +15 -0
- package/dist/components/field/FieldProgress.vue.js +7 -0
- package/dist/components/field/FieldProgress.vue2.js +40 -0
- package/dist/components/field/FieldRelation.vue.d.ts +17 -0
- package/dist/components/field/FieldRelation.vue.js +7 -0
- package/dist/components/field/FieldRelation.vue2.js +67 -0
- package/dist/components/field/FieldRichText.vue.d.ts +17 -0
- package/dist/components/field/FieldRichText.vue.js +7 -0
- package/dist/components/field/FieldRichText.vue2.js +65 -0
- package/dist/components/field/FieldSelect.vue.js +1 -1
- package/dist/components/field/FieldSelect.vue2.js +43 -42
- package/dist/components/form/FormDesigner.vue.js +2 -2
- package/dist/components/form/FormDesigner.vue2.js +62 -52
- package/dist/components/gallery/GalleryCard.vue.js +2 -2
- package/dist/components/gallery/GalleryView.vue.d.ts +6 -2
- package/dist/components/gallery/GalleryView.vue.js +2 -2
- package/dist/components/gallery/GalleryView.vue2.js +30 -20
- package/dist/components/kanban/KanbanBoard.vue.d.ts +5 -1
- package/dist/components/kanban/KanbanBoard.vue.js +4 -4
- package/dist/components/kanban/KanbanBoard.vue2.js +81 -48
- package/dist/components/layout/AppLayout.vue.js +2 -2
- package/dist/components/layout/AppLayout.vue2.js +46 -62
- package/dist/components/overlay/Drawer.vue.js +1 -1
- package/dist/components/overlay/Drawer.vue2.js +52 -68
- package/dist/components/overlay/Modal.vue.js +1 -1
- package/dist/components/overlay/Modal.vue2.js +52 -68
- package/dist/components/overlay/SidePanel.vue.js +2 -2
- package/dist/components/overlay/SidePanel.vue2.js +64 -80
- package/dist/components/table/ColumnHeaderMenu.vue.d.ts +33 -0
- package/dist/components/table/ColumnHeaderMenu.vue.js +7 -0
- package/dist/components/table/ColumnHeaderMenu.vue2.js +153 -0
- package/dist/components/table/DataTable.vue.d.ts +116 -25
- package/dist/components/table/DataTable.vue.js +4 -4
- package/dist/components/table/DataTable.vue2.js +775 -188
- package/dist/components/table/DetailSheet.vue.d.ts +43 -0
- package/dist/components/table/DetailSheet.vue.js +7 -0
- package/dist/components/table/DetailSheet.vue2.js +140 -0
- package/dist/components/table/FieldCell.vue.d.ts +1 -1
- package/dist/components/table/FieldCell.vue.js +1 -1
- package/dist/components/table/FieldCell.vue2.js +59 -44
- package/dist/components/table/FieldTypePicker.vue.d.ts +15 -0
- package/dist/components/table/FieldTypePicker.vue.js +7 -0
- package/dist/components/table/FieldTypePicker.vue2.js +92 -0
- package/dist/components/table/MobileListView.vue.d.ts +24 -0
- package/dist/components/table/MobileListView.vue.js +7 -0
- package/dist/components/table/MobileListView.vue2.js +90 -0
- package/dist/components/table/TableGroupRow.vue.d.ts +5 -0
- package/dist/components/table/TableGroupRow.vue.js +2 -2
- package/dist/components/table/TableGroupRow.vue2.js +33 -23
- package/dist/components/table/TableHeaderRow.vue.d.ts +16 -0
- package/dist/components/table/TableHeaderRow.vue.js +2 -2
- package/dist/components/table/TableHeaderRow.vue2.js +54 -33
- package/dist/components/table/TableToolbar.vue.d.ts +118 -0
- package/dist/components/table/TableToolbar.vue.js +7 -0
- package/dist/components/table/TableToolbar.vue2.js +273 -0
- package/dist/components/table/index.d.ts +5 -0
- package/dist/components/timeline/GanttTimeline.vue.js +1 -1
- package/dist/components/timeline/GanttTimeline.vue2.js +128 -127
- package/dist/components/toast/ToastItem.vue.js +3 -3
- package/dist/composables/index.d.ts +19 -0
- package/dist/composables/useBreakpoint.d.ts +2 -1
- package/dist/composables/useBreakpoint.js +14 -12
- package/dist/composables/useColumnResize.d.ts +19 -0
- package/dist/composables/useColumnResize.js +58 -0
- package/dist/composables/useDraftRows.d.ts +33 -0
- package/dist/composables/useDraftRows.js +103 -0
- package/dist/composables/useFixedColumns.d.ts +25 -0
- package/dist/composables/useFixedColumns.js +61 -0
- package/dist/composables/useFocusTrap.d.ts +10 -0
- package/dist/composables/useFocusTrap.js +37 -0
- package/dist/composables/useInlineEdit.js +3 -3
- package/dist/composables/useKeyboardNavigation.d.ts +45 -0
- package/dist/composables/useKeyboardNavigation.js +140 -0
- package/dist/composables/useRowDrag.d.ts +32 -0
- package/dist/composables/useRowDrag.js +85 -0
- package/dist/composables/useSchemaEngine.d.ts +31 -0
- package/dist/composables/useSchemaEngine.js +129 -0
- package/dist/composables/useSearch.d.ts +30 -0
- package/dist/composables/useSearch.js +59 -0
- package/dist/composables/useSupabaseProvider.d.ts +70 -0
- package/dist/composables/useSupabaseProvider.js +126 -0
- package/dist/composables/useTable.d.ts +3 -0
- package/dist/composables/useTable.js +103 -83
- package/dist/composables/useTableGroup.d.ts +14 -1
- package/dist/composables/useTableGroup.js +57 -33
- package/dist/composables/useViewPersistence.d.ts +98 -0
- package/dist/composables/useViewPersistence.js +141 -0
- package/dist/composables/useVirtualList.d.ts +4 -1
- package/dist/composables/useVirtualList.js +108 -85
- package/dist/composables/useWorkerSort.d.ts +14 -0
- package/dist/composables/useWorkerSort.js +61 -0
- package/dist/index.d.ts +28 -4
- package/dist/index.js +264 -216
- package/dist/style.css +1 -1
- package/dist/types/index.d.ts +63 -2
- package/dist/types/index.js +23 -6
- package/dist/types/table-internal.d.ts +64 -0
- package/dist/utils/aggregation.d.ts +5 -0
- package/dist/utils/aggregation.js +38 -0
- package/dist/utils/supabaseAdapter.d.ts +48 -0
- package/dist/utils/supabaseAdapter.js +76 -0
- package/dist/utils/supabaseSchema.d.ts +81 -0
- package/dist/utils/supabaseSchema.js +202 -0
- package/dist/workers/tableWorker.d.ts +31 -0
- 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-
|
|
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
|
|
2
|
-
import
|
|
3
|
-
import { taskToDataRecord as
|
|
4
|
-
const
|
|
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
|
-
},
|
|
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(
|
|
23
|
-
const
|
|
24
|
-
function
|
|
25
|
-
return /* @__PURE__ */ new Date(`${
|
|
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
|
|
28
|
-
const
|
|
29
|
-
return `${
|
|
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
|
|
32
|
-
return Math.round((
|
|
31
|
+
function y(e, t) {
|
|
32
|
+
return Math.round((i(t).getTime() - i(e).getTime()) / 864e5);
|
|
33
33
|
}
|
|
34
|
-
function
|
|
35
|
-
const a =
|
|
36
|
-
return
|
|
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
|
|
39
|
-
if (typeof
|
|
40
|
-
const
|
|
41
|
-
return
|
|
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
|
|
44
|
-
const
|
|
45
|
-
return `${
|
|
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
|
|
48
|
-
var
|
|
49
|
-
return (
|
|
50
|
-
}),
|
|
51
|
-
var t,
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
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
|
|
102
|
-
const
|
|
102
|
+
const C = s(() => {
|
|
103
|
+
const e = D.value, t = g.value;
|
|
103
104
|
return u.value.map((a) => {
|
|
104
|
-
const
|
|
105
|
-
return { row: a, offsetDays: Math.min(
|
|
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
|
-
}),
|
|
108
|
-
function
|
|
109
|
-
return
|
|
108
|
+
}), $ = h(/* @__PURE__ */ new Date());
|
|
109
|
+
function A(e) {
|
|
110
|
+
return e === $;
|
|
110
111
|
}
|
|
111
|
-
function
|
|
112
|
-
const
|
|
113
|
-
return `${String(
|
|
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
|
|
116
|
-
const
|
|
117
|
-
return
|
|
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
|
|
120
|
-
const
|
|
121
|
-
if (
|
|
122
|
-
const a =
|
|
123
|
-
u.value[
|
|
124
|
-
...u.value[
|
|
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:
|
|
127
|
+
endDate: r
|
|
127
128
|
};
|
|
128
|
-
const
|
|
129
|
-
if (!
|
|
130
|
-
|
|
131
|
-
recordId:
|
|
129
|
+
const d = u.value[t].sourceRecordId;
|
|
130
|
+
if (!d) return;
|
|
131
|
+
S("record-change", {
|
|
132
|
+
recordId: d,
|
|
132
133
|
startDate: a,
|
|
133
|
-
endDate:
|
|
134
|
+
endDate: r
|
|
134
135
|
});
|
|
135
|
-
const
|
|
136
|
-
...
|
|
136
|
+
const v = F.value.map((o) => o.id !== d ? o : {
|
|
137
|
+
...o,
|
|
137
138
|
fields: {
|
|
138
|
-
...
|
|
139
|
-
[
|
|
140
|
-
[
|
|
139
|
+
...o.fields,
|
|
140
|
+
[n.startFieldId]: a,
|
|
141
|
+
[n.endFieldId]: r
|
|
141
142
|
}
|
|
142
143
|
});
|
|
143
|
-
|
|
144
|
+
S("update:records", v);
|
|
144
145
|
}
|
|
145
|
-
return (
|
|
146
|
+
return (e, t) => (l(), c("div", {
|
|
146
147
|
class: "gantt-timeline",
|
|
147
|
-
style: _({ "--day-width": `${
|
|
148
|
+
style: _({ "--day-width": `${f}px` })
|
|
148
149
|
}, [
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
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: `${
|
|
154
|
+
style: _({ width: `${g.value * f}px` })
|
|
154
155
|
}, [
|
|
155
|
-
(
|
|
156
|
+
(l(!0), c(R, null, T(N.value, (a) => (l(), c("div", {
|
|
156
157
|
key: a,
|
|
157
|
-
class:
|
|
158
|
-
style: _({ width: `${
|
|
159
|
-
}, W(
|
|
160
|
-
|
|
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: `${
|
|
164
|
-
}, null, 4)) :
|
|
164
|
+
style: _({ left: `${k.value}px` })
|
|
165
|
+
}, null, 4)) : b("", !0)
|
|
165
166
|
], 4)
|
|
166
167
|
]),
|
|
167
|
-
|
|
168
|
-
(
|
|
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":
|
|
174
|
-
"total-days":
|
|
175
|
-
onChange:
|
|
176
|
-
onClick: (
|
|
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
|
-
|
|
179
|
+
C.value.length === 0 ? (l(), c("div", rt, "暂无任务数据")) : b("", !0)
|
|
179
180
|
])
|
|
180
181
|
], 4));
|
|
181
182
|
}
|
|
182
183
|
});
|
|
183
184
|
export {
|
|
184
|
-
|
|
185
|
+
lt as default
|
|
185
186
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import o from "./ToastItem.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
4
|
-
const p = /* @__PURE__ */ o
|
|
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').
|
|
4
|
+
isDesktop: import('vue').ComputedRef<boolean>;
|
|
5
|
+
hasTouch: import('vue').Ref<boolean, boolean>;
|
|
5
6
|
};
|
|
@@ -1,16 +1,18 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
function
|
|
3
|
-
const
|
|
4
|
-
function
|
|
5
|
-
const
|
|
6
|
-
|
|
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
|
-
|
|
9
|
-
|
|
10
|
-
}),
|
|
11
|
-
window.removeEventListener("resize",
|
|
12
|
-
})
|
|
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
|
-
|
|
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
|
+
};
|