@oneflowui/ui 0.5.6 → 0.5.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.
- package/README.md +11 -0
- package/dist/components/ContextMenu/index.vue.js +2 -2
- package/dist/components/Dashboard/charts/BarChart.vue.js +2 -2
- package/dist/components/Dashboard/charts/PieChart.vue.js +2 -2
- package/dist/components/Dashboard/index.vue.d.ts +3 -2
- package/dist/components/Dashboard/index.vue.js +2 -2
- package/dist/components/ai/AiSender.vue.js +2 -2
- package/dist/components/ai/AiSender.vue2.js +8 -7
- package/dist/components/auxiliary/ColorPanel.vue.js +2 -2
- package/dist/components/auxiliary/ColorPanel.vue2.js +25 -23
- package/dist/components/auxiliary/FileUpload.vue.js +2 -2
- package/dist/components/auxiliary/FileUpload.vue2.js +1 -0
- package/dist/components/auxiliary/PersonPanel.vue.js +1 -1
- package/dist/components/auxiliary/PersonPanel.vue2.js +2 -1
- package/dist/components/base/Accordion.vue.js +1 -1
- package/dist/components/base/Avatar.vue.d.ts +3 -0
- package/dist/components/base/Avatar.vue.js +4 -4
- package/dist/components/base/Avatar.vue2.js +8 -8
- package/dist/components/base/Badge.vue.d.ts +2 -0
- package/dist/components/base/Badge.vue.js +2 -2
- package/dist/components/base/Badge.vue2.js +2 -2
- package/dist/components/base/ButtonGroup.vue.js +2 -2
- package/dist/components/base/ButtonGroup.vue2.js +2 -2
- package/dist/components/base/ChainItem.vue.d.ts +6 -0
- package/dist/components/base/ChainItem.vue.js +2 -2
- package/dist/components/base/ChainItem.vue2.js +17 -17
- package/dist/components/base/DropdownMenu.vue.js +2 -2
- package/dist/components/base/DropdownMenu.vue2.js +22 -20
- package/dist/components/base/EmptyState.vue.js +2 -2
- package/dist/components/base/EmptyState.vue2.js +2 -2
- package/dist/components/base/InfoCard.vue.d.ts +9 -0
- package/dist/components/base/InfoCard.vue.js +2 -2
- package/dist/components/base/InfoCard.vue2.js +65 -57
- package/dist/components/base/MonitorItem.vue.js +2 -2
- package/dist/components/base/MonitorItem.vue2.js +33 -25
- package/dist/components/base/PersonaCard.vue.d.ts +5 -0
- package/dist/components/base/PersonaCard.vue.js +3 -3
- package/dist/components/base/PersonaCard.vue2.js +56 -50
- package/dist/components/base/ProgressBar.vue.d.ts +1 -0
- package/dist/components/base/ProgressBar.vue.js +2 -2
- package/dist/components/base/ProgressBar.vue2.js +10 -10
- package/dist/components/base/RangeSlider.vue.d.ts +15 -0
- package/dist/components/base/RangeSlider.vue.js +1 -1
- package/dist/components/base/RangeSlider.vue2.js +22 -15
- package/dist/components/base/RefTag.vue.d.ts +4 -0
- package/dist/components/base/RefTag.vue.js +3 -3
- package/dist/components/base/RefTag.vue2.js +14 -14
- package/dist/components/base/SearchHighlight.vue.js +1 -1
- package/dist/components/base/SectionBlock.vue.js +2 -2
- package/dist/components/base/SectionBlock.vue2.js +54 -48
- package/dist/components/base/SelectBadge.vue.d.ts +5 -0
- package/dist/components/base/SelectBadge.vue.js +3 -3
- package/dist/components/base/SelectBadge.vue2.js +36 -28
- package/dist/components/base/StatisticCard.vue.js +1 -1
- package/dist/components/base/StatusIndicator.vue.js +2 -2
- package/dist/components/base/StatusIndicator.vue2.js +2 -2
- package/dist/components/base/StatusSummary.vue.js +2 -2
- package/dist/components/base/Stepper.vue.js +2 -2
- package/dist/components/base/Switch.vue.js +2 -2
- package/dist/components/base/ToolbarBtn.vue.js +2 -2
- package/dist/components/base/ViewModeGroup.vue.js +1 -1
- package/dist/components/base/ViewModeGroup.vue2.js +3 -3
- package/dist/components/base/ViewSwitcher.vue.js +1 -1
- package/dist/components/base/ViewSwitcher.vue2.js +3 -3
- package/dist/components/base/ViewTab.vue.js +1 -1
- package/dist/components/base/ViewTab.vue2.js +5 -6
- package/dist/components/breadcrumb/Breadcrumb.vue.js +2 -2
- package/dist/components/breadcrumb/BreadcrumbItem.vue.js +2 -2
- package/dist/components/database/DatabaseView.vue.d.ts +6 -1
- package/dist/components/database/DatabaseView.vue.js +2 -2
- package/dist/components/database/DatabaseView.vue2.js +438 -293
- package/dist/components/detail/PropPanel.vue.js +2 -2
- package/dist/components/detail/PropPanel.vue2.js +34 -30
- package/dist/components/detail/PropRow.vue.d.ts +6 -0
- package/dist/components/detail/PropRow.vue.js +2 -2
- package/dist/components/detail/PropRow.vue2.js +24 -24
- package/dist/components/editor/BlockQuote.vue.d.ts +2 -1
- package/dist/components/editor/BlockQuote.vue.js +1 -1
- package/dist/components/editor/BlockQuote.vue2.js +43 -29
- package/dist/components/editor/ContentBlock.vue.d.ts +4 -2
- package/dist/components/editor/ContentBlock.vue.js +2 -2
- package/dist/components/editor/ContentBlock.vue2.js +54 -33
- package/dist/components/editor/RichTextEditor.vue.js +2 -2
- package/dist/components/editor/RichTextEditor.vue2.js +10 -14
- package/dist/components/field/FieldAttachment.vue.js +2 -2
- package/dist/components/field/FieldAttachment.vue2.js +30 -32
- package/dist/components/field/FieldAutoNumber.vue.js +2 -2
- package/dist/components/field/FieldCheckbox.vue.js +2 -2
- package/dist/components/field/FieldCheckbox.vue2.js +13 -11
- package/dist/components/field/FieldCreator.vue.js +2 -2
- package/dist/components/field/FieldCurrency.vue.js +2 -2
- package/dist/components/field/FieldCurrency.vue2.js +15 -14
- package/dist/components/field/FieldDate.vue.js +1 -1
- package/dist/components/field/FieldDate.vue2.js +14 -16
- package/dist/components/field/FieldDatetime.vue.js +1 -1
- package/dist/components/field/FieldDatetime.vue2.js +12 -11
- package/dist/components/field/FieldEmail.vue.js +2 -2
- package/dist/components/field/FieldEmail.vue2.js +14 -13
- package/dist/components/field/FieldMarkdownPreview.vue.js +2 -2
- package/dist/components/field/FieldMultiSelect.vue.d.ts +2 -2
- package/dist/components/field/FieldMultiSelect.vue.js +2 -2
- package/dist/components/field/FieldMultiSelect.vue2.js +80 -75
- package/dist/components/field/FieldNumber.vue.js +3 -3
- package/dist/components/field/FieldNumber.vue2.js +19 -18
- package/dist/components/field/FieldPhone.vue.js +2 -2
- package/dist/components/field/FieldPhone.vue2.js +12 -11
- package/dist/components/field/FieldProgress.vue.js +1 -1
- package/dist/components/field/FieldProgress.vue2.js +18 -17
- package/dist/components/field/FieldRating.vue.js +2 -2
- package/dist/components/field/FieldRating.vue2.js +22 -16
- package/dist/components/field/FieldRelation.vue.js +1 -1
- package/dist/components/field/FieldRelation.vue2.js +25 -22
- package/dist/components/field/FieldRichText.vue.js +1 -1
- package/dist/components/field/FieldRichText.vue2.js +10 -7
- package/dist/components/field/FieldSelect.vue.js +2 -2
- package/dist/components/field/FieldSelect.vue2.js +81 -63
- package/dist/components/field/FieldText.vue.js +2 -2
- package/dist/components/field/FieldText.vue2.js +17 -16
- package/dist/components/field/FieldUrl.vue.js +2 -2
- package/dist/components/field/FieldUrl.vue2.js +17 -16
- package/dist/components/form/FormDesigner.vue.js +2 -2
- package/dist/components/form/FormDesigner.vue2.js +83 -78
- package/dist/components/gallery/GalleryCard.vue.d.ts +1 -1
- package/dist/components/gallery/GalleryCard.vue.js +2 -2
- package/dist/components/gallery/GalleryCard.vue2.js +2 -1
- package/dist/components/kanban/KanbanCard.vue.d.ts +3 -1
- package/dist/components/kanban/KanbanCard.vue.js +1 -1
- package/dist/components/kanban/KanbanCard.vue2.js +15 -14
- package/dist/components/kanban/KanbanColumn.vue.d.ts +2 -0
- package/dist/components/kanban/KanbanColumn.vue.js +2 -2
- package/dist/components/kanban/KanbanColumn.vue2.js +9 -9
- package/dist/components/kanban/QuickAddRow.vue.js +2 -2
- package/dist/components/kanban/QuickAddRow.vue2.js +15 -14
- package/dist/components/layout/Navbar.vue.js +3 -3
- package/dist/components/layout/Navbar.vue2.js +5 -4
- package/dist/components/layout/Sidebar.vue.js +2 -2
- package/dist/components/layout/Sidebar.vue2.js +1 -1
- package/dist/components/mermaid/MermaidChart.vue.js +2 -2
- package/dist/components/mermaid/MermaidChart.vue2.js +17 -17
- package/dist/components/overlay/Dialog.vue.d.ts +1 -0
- package/dist/components/overlay/Dialog.vue.js +1 -1
- package/dist/components/overlay/Dialog.vue2.js +9 -9
- package/dist/components/overlay/Drawer.vue.d.ts +2 -1
- package/dist/components/overlay/Drawer.vue.js +2 -2
- package/dist/components/overlay/Drawer.vue2.js +35 -29
- package/dist/components/overlay/Modal.vue.d.ts +2 -1
- package/dist/components/overlay/Modal.vue.js +1 -1
- package/dist/components/overlay/Modal.vue2.js +34 -28
- package/dist/components/overlay/SidePanel.vue.d.ts +1 -0
- package/dist/components/overlay/SidePanel.vue.js +1 -1
- package/dist/components/overlay/SidePanel.vue2.js +6 -6
- package/dist/components/split/SplitPane.vue.js +2 -2
- package/dist/components/split/SplitPane.vue2.js +11 -9
- package/dist/components/table/ColumnHeaderMenu.vue.d.ts +4 -2
- package/dist/components/table/ColumnHeaderMenu.vue.js +1 -1
- package/dist/components/table/ColumnHeaderMenu.vue2.js +42 -36
- package/dist/components/table/DataTable.vue.d.ts +9 -6
- package/dist/components/table/DataTable.vue.js +2 -2
- package/dist/components/table/DataTable.vue2.js +643 -521
- package/dist/components/table/DetailSheet.vue.d.ts +2 -0
- package/dist/components/table/DetailSheet.vue.js +2 -2
- package/dist/components/table/DetailSheet.vue2.js +154 -70
- package/dist/components/table/FieldCell.vue.d.ts +2 -1
- package/dist/components/table/FieldCell.vue.js +1 -1
- package/dist/components/table/FieldCell.vue2.js +57 -48
- package/dist/components/table/FieldTypePicker.vue.d.ts +1 -0
- package/dist/components/table/FieldTypePicker.vue.js +4 -4
- package/dist/components/table/FieldTypePicker.vue2.js +1 -1
- package/dist/components/table/MobileListView.vue.d.ts +3 -2
- package/dist/components/table/MobileListView.vue.js +2 -2
- package/dist/components/table/MobileListView.vue2.js +57 -50
- package/dist/components/table/TableColumnManager.vue.js +1 -1
- package/dist/components/table/TableColumnManager.vue2.js +29 -28
- package/dist/components/table/TableDataRow.vue.d.ts +5 -1
- package/dist/components/table/TableDataRow.vue.js +3 -3
- package/dist/components/table/TableDataRow.vue2.js +102 -63
- package/dist/components/table/TableFilterPanel.vue.js +2 -2
- package/dist/components/table/TableFilterPanel.vue2.js +3 -0
- package/dist/components/table/TableGroupRow.vue.d.ts +2 -0
- package/dist/components/table/TableGroupRow.vue.js +2 -2
- package/dist/components/table/TableGroupRow.vue2.js +35 -30
- package/dist/components/table/TableHeaderRow.vue.d.ts +3 -1
- package/dist/components/table/TableHeaderRow.vue.js +1 -1
- package/dist/components/table/TableHeaderRow.vue2.js +111 -58
- package/dist/components/table/TableToolbar.vue.js +1 -1
- package/dist/components/table/TableToolbar.vue2.js +2 -2
- package/dist/components/tabs/TabPanel.vue.js +4 -4
- package/dist/components/tabs/TabPanel.vue2.js +1 -1
- package/dist/components/tabs/Tabs.vue.js +2 -2
- package/dist/components/tabs/Tabs.vue2.js +2 -2
- package/dist/components/timeline/GanttRow.vue.d.ts +2 -0
- package/dist/components/timeline/GanttRow.vue.js +2 -2
- package/dist/components/timeline/GanttRow.vue2.js +68 -52
- package/dist/components/timeline/GanttTimeline.vue.d.ts +6 -0
- package/dist/components/timeline/GanttTimeline.vue.js +2 -2
- package/dist/components/timeline/GanttTimeline.vue2.js +24 -24
- package/dist/composables/useColumnResize.d.ts +4 -1
- package/dist/composables/useColumnResize.js +114 -45
- package/dist/composables/useKeyboardNavigation.d.ts +1 -1
- package/dist/composables/useRowDrag.d.ts +7 -5
- package/dist/composables/useRowDrag.js +24 -24
- package/dist/composables/useSupabaseProvider.d.ts +8 -1
- package/dist/composables/useTableData.d.ts +5 -3
- package/dist/composables/useTableGroup.d.ts +2 -2
- package/dist/composables/useViewPersistence.d.ts +32 -3
- package/dist/composables/useVirtualList.d.ts +1 -0
- package/dist/composables/useVirtualList.js +94 -81
- package/dist/plugin.js +103 -102
- package/dist/style.css +1 -1
- package/dist/types/index.d.ts +2 -1
- package/dist/utils/echarts.d.ts +1 -0
- package/dist/utils/supabaseSchema.d.ts +12 -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
|
|
4
|
+
const a = /* @__PURE__ */ o(t, [["__scopeId", "data-v-2d350e85"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
a as default
|
|
7
7
|
};
|
|
@@ -7,15 +7,15 @@ const at = { class: "gantt-timeline__header" }, nt = { class: "gantt-timeline__r
|
|
|
7
7
|
}, f = 40, lt = /* @__PURE__ */ J({
|
|
8
8
|
__name: "GanttTimeline",
|
|
9
9
|
props: {
|
|
10
|
-
records: {},
|
|
11
|
-
schema: {},
|
|
12
|
-
viewConfig: {},
|
|
10
|
+
records: { default: void 0 },
|
|
11
|
+
schema: { default: void 0 },
|
|
12
|
+
viewConfig: { default: void 0 },
|
|
13
13
|
startFieldId: { default: "startDate" },
|
|
14
14
|
endFieldId: { default: "endDate" },
|
|
15
15
|
labelFieldId: { default: "title" },
|
|
16
|
-
items: {},
|
|
17
|
-
data: {},
|
|
18
|
-
startDate: {},
|
|
16
|
+
items: { default: void 0 },
|
|
17
|
+
data: { default: void 0 },
|
|
18
|
+
startDate: { default: void 0 },
|
|
19
19
|
days: { default: 30 }
|
|
20
20
|
},
|
|
21
21
|
emits: ["row-click", "record-change", "update:records"],
|
|
@@ -71,8 +71,8 @@ const at = { class: "gantt-timeline__header" }, nt = { class: "gantt-timeline__r
|
|
|
71
71
|
)), O = s(() => {
|
|
72
72
|
var a, r;
|
|
73
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((
|
|
75
|
-
const
|
|
74
|
+
return t && e.sort((o, g) => {
|
|
75
|
+
const d = o[t.fieldId] ?? "", q = g[t.fieldId] ?? "", M = String(d).localeCompare(String(q));
|
|
76
76
|
return t.direction === "desc" ? -M : M;
|
|
77
77
|
}), e;
|
|
78
78
|
}), V = s(() => {
|
|
@@ -86,9 +86,9 @@ const at = { class: "gantt-timeline__header" }, nt = { class: "gantt-timeline__r
|
|
|
86
86
|
return p(n.startDate || x(), n.days - 1);
|
|
87
87
|
const e = Math.max(...m.value.map((a) => i(a.endDate).getTime())), t = new Date(e);
|
|
88
88
|
return t.setDate(t.getDate() + 1), h(t);
|
|
89
|
-
}), D = s(() => n.startDate || V.value),
|
|
89
|
+
}), D = s(() => n.startDate || V.value), v = s(() => n.startDate ? n.days : Math.max(n.days, y(D.value, Y.value) + 1)), N = s(() => {
|
|
90
90
|
const e = [];
|
|
91
|
-
for (let t = 0; t <
|
|
91
|
+
for (let t = 0; t < v.value; t++)
|
|
92
92
|
e.push(p(D.value, t));
|
|
93
93
|
return e;
|
|
94
94
|
}), u = K([]);
|
|
@@ -100,10 +100,10 @@ const at = { class: "gantt-timeline__header" }, nt = { class: "gantt-timeline__r
|
|
|
100
100
|
{ immediate: !0 }
|
|
101
101
|
);
|
|
102
102
|
const C = s(() => {
|
|
103
|
-
const e = D.value, t =
|
|
103
|
+
const e = D.value, t = v.value;
|
|
104
104
|
return u.value.map((a) => {
|
|
105
|
-
const r = Math.max(0, y(e, a.startDate)),
|
|
106
|
-
return { row: a, offsetDays: Math.min(r, t - 1), durationDays:
|
|
105
|
+
const r = Math.max(0, y(e, a.startDate)), o = Math.max(r, y(e, a.endDate)), g = Math.max(1, o - r + 1);
|
|
106
|
+
return { row: a, offsetDays: Math.min(r, t - 1), durationDays: g };
|
|
107
107
|
});
|
|
108
108
|
}), $ = h(/* @__PURE__ */ new Date());
|
|
109
109
|
function A(e) {
|
|
@@ -115,10 +115,10 @@ const at = { class: "gantt-timeline__header" }, nt = { class: "gantt-timeline__r
|
|
|
115
115
|
}
|
|
116
116
|
const k = s(() => {
|
|
117
117
|
const e = y(D.value, $);
|
|
118
|
-
return e < 0 || e >
|
|
118
|
+
return e < 0 || e > v.value - 1 ? null : e * f + f / 2;
|
|
119
119
|
});
|
|
120
120
|
function j(e) {
|
|
121
|
-
const t = u.value.findIndex((
|
|
121
|
+
const t = u.value.findIndex((d) => d.id === e.id);
|
|
122
122
|
if (t === -1) return;
|
|
123
123
|
const a = p(D.value, e.offsetDays), r = p(a, e.durationDays - 1);
|
|
124
124
|
u.value[t] = {
|
|
@@ -126,22 +126,22 @@ const at = { class: "gantt-timeline__header" }, nt = { class: "gantt-timeline__r
|
|
|
126
126
|
startDate: a,
|
|
127
127
|
endDate: r
|
|
128
128
|
};
|
|
129
|
-
const
|
|
130
|
-
if (!
|
|
129
|
+
const o = u.value[t].sourceRecordId;
|
|
130
|
+
if (!o) return;
|
|
131
131
|
S("record-change", {
|
|
132
|
-
recordId:
|
|
132
|
+
recordId: o,
|
|
133
133
|
startDate: a,
|
|
134
134
|
endDate: r
|
|
135
135
|
});
|
|
136
|
-
const
|
|
137
|
-
...
|
|
136
|
+
const g = F.value.map((d) => d.id !== o ? d : {
|
|
137
|
+
...d,
|
|
138
138
|
fields: {
|
|
139
|
-
...
|
|
139
|
+
...d.fields,
|
|
140
140
|
[n.startFieldId]: a,
|
|
141
141
|
[n.endFieldId]: r
|
|
142
142
|
}
|
|
143
143
|
});
|
|
144
|
-
S("update:records",
|
|
144
|
+
S("update:records", g);
|
|
145
145
|
}
|
|
146
146
|
return (e, t) => (l(), c("div", {
|
|
147
147
|
class: "gantt-timeline",
|
|
@@ -151,7 +151,7 @@ const at = { class: "gantt-timeline__header" }, nt = { class: "gantt-timeline__r
|
|
|
151
151
|
t[0] || (t[0] = I("div", { class: "gantt-timeline__header-label" }, "任务", -1)),
|
|
152
152
|
I("div", {
|
|
153
153
|
class: "gantt-timeline__header-dates",
|
|
154
|
-
style: _({ width: `${
|
|
154
|
+
style: _({ width: `${v.value * f}px` })
|
|
155
155
|
}, [
|
|
156
156
|
(l(!0), c(R, null, T(N.value, (a) => (l(), c("div", {
|
|
157
157
|
key: a,
|
|
@@ -172,7 +172,7 @@ const at = { class: "gantt-timeline__header" }, nt = { class: "gantt-timeline__r
|
|
|
172
172
|
"offset-days": a.offsetDays,
|
|
173
173
|
"duration-days": a.durationDays,
|
|
174
174
|
"day-width": f,
|
|
175
|
-
"total-days":
|
|
175
|
+
"total-days": v.value,
|
|
176
176
|
onChange: j,
|
|
177
177
|
onClick: (r) => S("row-click", a.row)
|
|
178
178
|
}, null, 8, ["item", "offset-days", "duration-days", "total-days", "onClick"]))), 128)),
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { Ref } from 'vue';
|
|
2
|
-
import { TableColumn } from '../types';
|
|
2
|
+
import { Density, TableColumn } from '../types';
|
|
3
3
|
export interface UseColumnResizeOptions {
|
|
4
4
|
columns: Ref<TableColumn[]>;
|
|
5
|
+
rows?: Ref<ReadonlyArray<Record<string, unknown>>>;
|
|
6
|
+
density?: Ref<Density>;
|
|
7
|
+
sampleSize?: number;
|
|
5
8
|
/** Minimum column width in px (default 60) */
|
|
6
9
|
minWidth?: number;
|
|
7
10
|
/** Called on every mousemove during resize */
|
|
@@ -1,58 +1,127 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { ref as g, onUnmounted as E, readonly as M } from "vue";
|
|
2
|
+
const z = {
|
|
3
|
+
compact: {
|
|
4
|
+
fillMinWidth: 180,
|
|
5
|
+
basePadding: 18,
|
|
6
|
+
labelPadding: 22,
|
|
7
|
+
autoFitPadding: 18,
|
|
8
|
+
clampMax: 360
|
|
9
|
+
},
|
|
10
|
+
standard: {
|
|
11
|
+
fillMinWidth: 220,
|
|
12
|
+
basePadding: 24,
|
|
13
|
+
labelPadding: 26,
|
|
14
|
+
autoFitPadding: 24,
|
|
15
|
+
clampMax: 420
|
|
16
|
+
},
|
|
17
|
+
comfortable: {
|
|
18
|
+
fillMinWidth: 240,
|
|
19
|
+
basePadding: 28,
|
|
20
|
+
labelPadding: 30,
|
|
21
|
+
autoFitPadding: 30,
|
|
22
|
+
clampMax: 480
|
|
23
|
+
}
|
|
24
|
+
}, F = {
|
|
25
|
+
string: 180,
|
|
26
|
+
number: 110,
|
|
27
|
+
date: 140,
|
|
28
|
+
status: 124,
|
|
29
|
+
priority: 124
|
|
30
|
+
};
|
|
31
|
+
function S(t) {
|
|
32
|
+
return t ?? "standard";
|
|
33
|
+
}
|
|
34
|
+
function k(t) {
|
|
35
|
+
if (t == null) return "";
|
|
36
|
+
if (typeof t == "string") return t;
|
|
37
|
+
if (typeof t == "number" || typeof t == "boolean" || typeof t == "bigint")
|
|
38
|
+
return String(t);
|
|
39
|
+
if (t instanceof Date) return t.toISOString();
|
|
40
|
+
if (Array.isArray(t)) return t.map((a) => k(a)).join(", ");
|
|
41
|
+
if (typeof t == "object")
|
|
42
|
+
try {
|
|
43
|
+
return JSON.stringify(t);
|
|
44
|
+
} catch {
|
|
45
|
+
return String(t);
|
|
46
|
+
}
|
|
47
|
+
return String(t);
|
|
48
|
+
}
|
|
49
|
+
function w(t) {
|
|
50
|
+
let a = 0;
|
|
51
|
+
for (const s of t)
|
|
52
|
+
a += s.charCodeAt(0) <= 127 ? 7 : 14;
|
|
53
|
+
return a;
|
|
54
|
+
}
|
|
55
|
+
function D(t, a, s, m) {
|
|
56
|
+
const i = z[s], h = t.type ? F[t.type] : 168, y = w(t.label) + i.labelPadding, r = a.slice(0, Math.max(1, m));
|
|
57
|
+
let c = 0;
|
|
58
|
+
for (const p of r) {
|
|
59
|
+
const f = k(p[t.key]);
|
|
60
|
+
f && (c = Math.max(c, w(f) + i.basePadding));
|
|
61
|
+
}
|
|
62
|
+
const W = t.key === "id" ? 120 : t.key === "title" ? 220 : t.key === "description" ? 260 : 0, b = Math.max(h, y, c, W, i.fillMinWidth);
|
|
63
|
+
return Math.min(Math.max(b, i.fillMinWidth), i.clampMax);
|
|
64
|
+
}
|
|
65
|
+
function T(t) {
|
|
66
|
+
const a = t.minWidth ?? 60, s = g(!1), m = g(null), i = g(/* @__PURE__ */ new Map()), h = g(0), y = g(!1);
|
|
67
|
+
let r = null, c = "", W = "";
|
|
68
|
+
function b(e) {
|
|
69
|
+
var u, d;
|
|
6
70
|
if (i.value.has(e))
|
|
7
71
|
return i.value.get(e);
|
|
8
|
-
const
|
|
9
|
-
return
|
|
72
|
+
const n = t.columns.value.find((x) => x.key === e), l = S((u = t.density) == null ? void 0 : u.value), o = z[l];
|
|
73
|
+
return n ? n.width === "fill" ? n.minWidth ?? o.fillMinWidth : typeof n.width == "number" ? n.width : D(
|
|
74
|
+
n,
|
|
75
|
+
((d = t.rows) == null ? void 0 : d.value) ?? [],
|
|
76
|
+
l,
|
|
77
|
+
t.sampleSize ?? 8
|
|
78
|
+
) : o.fillMinWidth;
|
|
10
79
|
}
|
|
11
|
-
function
|
|
12
|
-
var
|
|
13
|
-
if (!
|
|
14
|
-
const
|
|
15
|
-
|
|
80
|
+
function p(e) {
|
|
81
|
+
var u;
|
|
82
|
+
if (!r) return;
|
|
83
|
+
const n = e.clientX - r.startX, l = Math.max(a, r.initialWidth + n), o = new Map(i.value);
|
|
84
|
+
o.set(r.colKey, l), i.value = o, h.value = e.clientX, (u = t.onResize) == null || u.call(t, r.colKey, l);
|
|
16
85
|
}
|
|
17
|
-
function
|
|
18
|
-
|
|
86
|
+
function f() {
|
|
87
|
+
r && (document.body.style.cursor = c, document.body.style.userSelect = W, document.removeEventListener("mousemove", p), document.removeEventListener("mouseup", f), s.value = !1, m.value = null, y.value = !1, r = null);
|
|
19
88
|
}
|
|
20
|
-
function
|
|
21
|
-
e.preventDefault(), e.stopPropagation(),
|
|
22
|
-
colKey:
|
|
89
|
+
function I(e, n) {
|
|
90
|
+
e.preventDefault(), e.stopPropagation(), r = {
|
|
91
|
+
colKey: n,
|
|
23
92
|
startX: e.clientX,
|
|
24
|
-
initialWidth:
|
|
25
|
-
},
|
|
26
|
-
}
|
|
27
|
-
function
|
|
28
|
-
return
|
|
29
|
-
}
|
|
30
|
-
function
|
|
31
|
-
var
|
|
32
|
-
if (!
|
|
33
|
-
const
|
|
34
|
-
let
|
|
35
|
-
if (
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
}),
|
|
39
|
-
const
|
|
40
|
-
|
|
93
|
+
initialWidth: b(n)
|
|
94
|
+
}, s.value = !0, m.value = n, h.value = e.clientX, y.value = !0, c = document.body.style.cursor, W = document.body.style.userSelect, document.body.style.cursor = "col-resize", document.body.style.userSelect = "none", document.addEventListener("mousemove", p), document.addEventListener("mouseup", f);
|
|
95
|
+
}
|
|
96
|
+
function X(e) {
|
|
97
|
+
return b(e);
|
|
98
|
+
}
|
|
99
|
+
function R(e, n) {
|
|
100
|
+
var x, C;
|
|
101
|
+
if (!n) return;
|
|
102
|
+
const l = S((x = t.density) == null ? void 0 : x.value), o = z[l].autoFitPadding, u = n.querySelectorAll(`[data-col-key="${e}"]`);
|
|
103
|
+
let d = a;
|
|
104
|
+
if (u.forEach((v) => {
|
|
105
|
+
const P = v.firstElementChild;
|
|
106
|
+
P && (d = Math.max(d, P.scrollWidth + o));
|
|
107
|
+
}), d > a) {
|
|
108
|
+
const v = new Map(i.value);
|
|
109
|
+
v.set(e, d), i.value = v, (C = t.onResize) == null || C.call(t, e, d);
|
|
41
110
|
}
|
|
42
111
|
}
|
|
43
|
-
return
|
|
44
|
-
|
|
112
|
+
return E(() => {
|
|
113
|
+
r && f();
|
|
45
114
|
}), {
|
|
46
|
-
startResize:
|
|
47
|
-
isResizing:
|
|
48
|
-
resizingColumn:
|
|
49
|
-
columnWidthOverrides:
|
|
50
|
-
resolvedWidth:
|
|
51
|
-
autoFitColumn:
|
|
52
|
-
resizeIndicatorX:
|
|
53
|
-
showResizeIndicator:
|
|
115
|
+
startResize: I,
|
|
116
|
+
isResizing: M(s),
|
|
117
|
+
resizingColumn: M(m),
|
|
118
|
+
columnWidthOverrides: M(i),
|
|
119
|
+
resolvedWidth: X,
|
|
120
|
+
autoFitColumn: R,
|
|
121
|
+
resizeIndicatorX: M(h),
|
|
122
|
+
showResizeIndicator: M(y)
|
|
54
123
|
};
|
|
55
124
|
}
|
|
56
125
|
export {
|
|
57
|
-
|
|
126
|
+
T as useColumnResize
|
|
58
127
|
};
|
|
@@ -5,7 +5,7 @@ export interface UseKeyboardNavigationOptions {
|
|
|
5
5
|
columns: Ref<TableColumn[]>;
|
|
6
6
|
rows: Ref<Array<{
|
|
7
7
|
id: string;
|
|
8
|
-
} & Record<string,
|
|
8
|
+
} & Record<string, unknown>>>;
|
|
9
9
|
containerRef: Ref<HTMLElement | null>;
|
|
10
10
|
editingCell: Ref<EditingCell | null>;
|
|
11
11
|
enabled: Ref<boolean>;
|
|
@@ -17,16 +17,18 @@ export interface RowGroupChangePayload {
|
|
|
17
17
|
groupFieldId: string;
|
|
18
18
|
newValue: unknown;
|
|
19
19
|
}
|
|
20
|
-
|
|
20
|
+
type RowDragItem<T> = T | GroupedListItem<T>;
|
|
21
|
+
export declare function useRowDrag<T extends Record<string, unknown>>(options: UseRowDragOptions<T>): {
|
|
21
22
|
isDragging: Readonly<Ref<boolean, boolean>>;
|
|
22
23
|
draggedRowId: Readonly<Ref<string | null, string | null>>;
|
|
23
24
|
dropTargetId: Readonly<Ref<string | null, string | null>>;
|
|
24
|
-
dropPosition: Readonly<Ref<"
|
|
25
|
-
handleDragStart: (e: DragEvent, item:
|
|
26
|
-
handleDragOver: (e: DragEvent, targetItem:
|
|
27
|
-
handleDrop: (e: DragEvent, targetItem:
|
|
25
|
+
dropPosition: Readonly<Ref<"after" | "before" | "into-group", "after" | "before" | "into-group">>;
|
|
26
|
+
handleDragStart: (e: DragEvent, item: RowDragItem<T>) => void;
|
|
27
|
+
handleDragOver: (e: DragEvent, targetItem: RowDragItem<T>) => void;
|
|
28
|
+
handleDrop: (e: DragEvent, targetItem: RowDragItem<T>, callbacks: {
|
|
28
29
|
onReorder?: (payload: RowReorderPayload) => void;
|
|
29
30
|
onGroupChange?: (payload: RowGroupChangePayload) => void;
|
|
30
31
|
}) => void;
|
|
31
32
|
handleDragEnd: () => void;
|
|
32
33
|
};
|
|
34
|
+
export {};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { ref as c, readonly as D } from "vue";
|
|
2
|
-
function
|
|
2
|
+
function x(i) {
|
|
3
3
|
const I = c(!1), u = c(null), g = c(null), s = c("before");
|
|
4
|
-
let
|
|
4
|
+
let p = null;
|
|
5
5
|
function f(e) {
|
|
6
|
-
return
|
|
6
|
+
return typeof e == "object" && e !== null && "__type" in e && e.__type === "group-header";
|
|
7
7
|
}
|
|
8
|
-
function
|
|
8
|
+
function l(e) {
|
|
9
9
|
return String(e.id ?? "");
|
|
10
10
|
}
|
|
11
11
|
function T(e, r) {
|
|
@@ -13,61 +13,61 @@ function y(i) {
|
|
|
13
13
|
e.preventDefault();
|
|
14
14
|
return;
|
|
15
15
|
}
|
|
16
|
-
|
|
16
|
+
p = r, u.value = l(r), I.value = !0, e.dataTransfer && (e.dataTransfer.effectAllowed = "move", e.dataTransfer.setData("text/plain", u.value));
|
|
17
17
|
}
|
|
18
18
|
function R(e, r) {
|
|
19
|
-
var
|
|
20
|
-
if (e.preventDefault(), !
|
|
19
|
+
var d;
|
|
20
|
+
if (e.preventDefault(), !p) return;
|
|
21
21
|
if (e.dataTransfer && (e.dataTransfer.dropEffect = "move"), f(r)) {
|
|
22
|
-
(
|
|
22
|
+
(d = i.enableCrossGroupDrag) != null && d.value && (g.value = r.id, s.value = "into-group");
|
|
23
23
|
return;
|
|
24
24
|
}
|
|
25
25
|
const n = e.currentTarget;
|
|
26
26
|
if (!n) return;
|
|
27
|
-
const t = n.getBoundingClientRect(),
|
|
28
|
-
g.value =
|
|
27
|
+
const t = n.getBoundingClientRect(), v = e.clientY - t.top < t.height / 2;
|
|
28
|
+
g.value = l(r), s.value = v ? "before" : "after";
|
|
29
29
|
}
|
|
30
|
-
function
|
|
31
|
-
var o,
|
|
32
|
-
if (e.preventDefault(), !
|
|
30
|
+
function _(e, r, n) {
|
|
31
|
+
var o, v, d, w;
|
|
32
|
+
if (e.preventDefault(), !p || !u.value) {
|
|
33
33
|
h();
|
|
34
34
|
return;
|
|
35
35
|
}
|
|
36
36
|
const t = u.value;
|
|
37
37
|
if (f(r)) {
|
|
38
38
|
const a = (o = i.groupFieldId) == null ? void 0 : o.value;
|
|
39
|
-
a && ((
|
|
39
|
+
a && ((v = i.enableCrossGroupDrag) != null && v.value) && ((d = n.onGroupChange) == null || d.call(n, {
|
|
40
40
|
rowId: t,
|
|
41
41
|
groupFieldId: a,
|
|
42
42
|
newValue: r.__groupKey
|
|
43
43
|
}));
|
|
44
44
|
} else {
|
|
45
|
-
const a =
|
|
45
|
+
const a = l(r);
|
|
46
46
|
t !== a && ((w = n.onReorder) == null || w.call(n, {
|
|
47
47
|
rowId: t,
|
|
48
|
-
beforeRowId: s.value === "before" ? a :
|
|
48
|
+
beforeRowId: s.value === "before" ? a : C(a)
|
|
49
49
|
}));
|
|
50
50
|
}
|
|
51
51
|
h();
|
|
52
52
|
}
|
|
53
|
-
function
|
|
53
|
+
function y() {
|
|
54
54
|
h();
|
|
55
55
|
}
|
|
56
|
-
function
|
|
56
|
+
function C(e) {
|
|
57
57
|
const r = i.processedItems.value;
|
|
58
58
|
for (let n = 0; n < r.length; n++) {
|
|
59
59
|
const t = r[n];
|
|
60
|
-
if (!f(t) &&
|
|
60
|
+
if (!f(t) && l(t) === e) {
|
|
61
61
|
for (let o = n + 1; o < r.length; o++)
|
|
62
62
|
if (!f(r[o]))
|
|
63
|
-
return
|
|
63
|
+
return l(r[o]);
|
|
64
64
|
return null;
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
return null;
|
|
68
68
|
}
|
|
69
69
|
function h() {
|
|
70
|
-
I.value = !1, u.value = null, g.value = null,
|
|
70
|
+
I.value = !1, u.value = null, g.value = null, p = null;
|
|
71
71
|
}
|
|
72
72
|
return {
|
|
73
73
|
isDragging: D(I),
|
|
@@ -76,10 +76,10 @@ function y(i) {
|
|
|
76
76
|
dropPosition: D(s),
|
|
77
77
|
handleDragStart: T,
|
|
78
78
|
handleDragOver: R,
|
|
79
|
-
handleDrop:
|
|
80
|
-
handleDragEnd:
|
|
79
|
+
handleDrop: _,
|
|
80
|
+
handleDragEnd: y
|
|
81
81
|
};
|
|
82
82
|
}
|
|
83
83
|
export {
|
|
84
|
-
|
|
84
|
+
x as useRowDrag
|
|
85
85
|
};
|
|
@@ -27,7 +27,14 @@ export interface SupabaseFilterBuilder {
|
|
|
27
27
|
type?: "plain" | "phrase" | "websearch";
|
|
28
28
|
}): SupabaseFilterBuilder;
|
|
29
29
|
or(filters: string): SupabaseFilterBuilder;
|
|
30
|
-
then<
|
|
30
|
+
then<TResult1 = SupabaseQueryResult>(onfulfilled?: ((value: SupabaseQueryResult) => TResult1 | PromiseLike<TResult1>) | null, onrejected?: ((reason: unknown) => TResult1 | PromiseLike<TResult1>) | null): Promise<TResult1>;
|
|
31
|
+
}
|
|
32
|
+
export interface SupabaseQueryResult {
|
|
33
|
+
data: Record<string, unknown>[] | null;
|
|
34
|
+
error: {
|
|
35
|
+
message: string;
|
|
36
|
+
} | null;
|
|
37
|
+
count: number | null;
|
|
31
38
|
}
|
|
32
39
|
export interface UseSupabaseProviderOptions {
|
|
33
40
|
/** Supabase client instance (pass your createClient() result) */
|
|
@@ -4,14 +4,16 @@ export interface UseTableDataOptions {
|
|
|
4
4
|
tasks?: Ref<Task[] | undefined>;
|
|
5
5
|
records?: Ref<DataRecord[] | undefined>;
|
|
6
6
|
}
|
|
7
|
+
type TableRowBase = {
|
|
8
|
+
id: string;
|
|
9
|
+
} & Record<string, unknown>;
|
|
7
10
|
/**
|
|
8
11
|
* 将 Task[] 或 DataRecord[] 标准化为统一的行格式 T[]。
|
|
9
12
|
*
|
|
10
13
|
* - 优先使用 records:展开 fields 并保留 createdAt/updatedAt/__record 元信息
|
|
11
14
|
* - 否则使用 tasks(原样透传,不做额外转换)
|
|
12
15
|
*/
|
|
13
|
-
export declare function useTableData<T extends {
|
|
14
|
-
id: string;
|
|
15
|
-
} & Record<string, any>>(options: UseTableDataOptions): {
|
|
16
|
+
export declare function useTableData<T extends TableRowBase>(options: UseTableDataOptions): {
|
|
16
17
|
rows: import('vue').ComputedRef<T[]>;
|
|
17
18
|
};
|
|
19
|
+
export {};
|
|
@@ -25,9 +25,9 @@ export type GroupHeaderItem = {
|
|
|
25
25
|
export type GroupedListItem<T> = (T & {
|
|
26
26
|
__type: "data-row";
|
|
27
27
|
}) | GroupHeaderItem;
|
|
28
|
-
export declare function useTableGroup<T extends Record<string,
|
|
28
|
+
export declare function useTableGroup<T extends Record<string, unknown>>(options: UseTableGroupOptions<T>): {
|
|
29
29
|
groupedItems: import('vue').ComputedRef<GroupedListItem<T>[]>;
|
|
30
30
|
collapsedGroups: Ref<Set<string> & Omit<Set<string>, keyof Set<any>>, Set<string> | (Set<string> & Omit<Set<string>, keyof Set<any>>)>;
|
|
31
31
|
toggleGroup: (groupKey: string) => void;
|
|
32
|
-
isGroupHeader: (item:
|
|
32
|
+
isGroupHeader: (item: GroupedListItem<T>) => item is GroupHeaderItem;
|
|
33
33
|
};
|
|
@@ -10,12 +10,40 @@ export interface ViewStorageBackend {
|
|
|
10
10
|
export declare function createLocalStorageBackend(): ViewStorageBackend;
|
|
11
11
|
export interface SupabaseViewBackendOptions {
|
|
12
12
|
/** Supabase client (最小接口:from().select/insert/update/delete) */
|
|
13
|
-
client:
|
|
14
|
-
from(table: string): any;
|
|
15
|
-
};
|
|
13
|
+
client: SupabaseViewClientLike;
|
|
16
14
|
/** 存储视图配置的表名,默认 'view_configs' */
|
|
17
15
|
tableName?: string;
|
|
18
16
|
}
|
|
17
|
+
interface SupabaseMutationResult {
|
|
18
|
+
error: {
|
|
19
|
+
message: string;
|
|
20
|
+
} | null;
|
|
21
|
+
}
|
|
22
|
+
interface SupabaseViewRow {
|
|
23
|
+
config: ViewConfig;
|
|
24
|
+
}
|
|
25
|
+
interface SupabaseViewDeleteBuilder extends PromiseLike<SupabaseMutationResult> {
|
|
26
|
+
eq(column: string, value: string): SupabaseViewDeleteBuilder;
|
|
27
|
+
}
|
|
28
|
+
interface SupabaseViewQueryBuilder {
|
|
29
|
+
select(columns: string): SupabaseViewQueryBuilder;
|
|
30
|
+
eq(column: string, value: string): SupabaseViewQueryBuilder;
|
|
31
|
+
order(column: string, options?: {
|
|
32
|
+
ascending?: boolean;
|
|
33
|
+
}): Promise<{
|
|
34
|
+
data: SupabaseViewRow[] | null;
|
|
35
|
+
error: {
|
|
36
|
+
message: string;
|
|
37
|
+
} | null;
|
|
38
|
+
}>;
|
|
39
|
+
upsert(value: Record<string, unknown>, options?: {
|
|
40
|
+
onConflict?: string;
|
|
41
|
+
}): Promise<SupabaseMutationResult>;
|
|
42
|
+
delete(): SupabaseViewDeleteBuilder;
|
|
43
|
+
}
|
|
44
|
+
interface SupabaseViewClientLike {
|
|
45
|
+
from(table: string): SupabaseViewQueryBuilder;
|
|
46
|
+
}
|
|
19
47
|
export declare function createSupabaseBackend(options: SupabaseViewBackendOptions): ViewStorageBackend;
|
|
20
48
|
export interface UseViewPersistenceOptions {
|
|
21
49
|
/** 表 ID */
|
|
@@ -96,3 +124,4 @@ export declare function useViewPersistence(options: UseViewPersistenceOptions):
|
|
|
96
124
|
duplicateView: (sourceViewId: string, newName: string) => Promise<string>;
|
|
97
125
|
updateActiveView: (patch: Partial<ViewConfig>) => void;
|
|
98
126
|
};
|
|
127
|
+
export {};
|
|
@@ -4,6 +4,7 @@ export interface UseVirtualListOptions<T> {
|
|
|
4
4
|
itemHeight: number | ((index: number) => number);
|
|
5
5
|
overscan?: number;
|
|
6
6
|
containerRef: Ref<HTMLElement | null>;
|
|
7
|
+
invalidateKey?: Ref<unknown>;
|
|
7
8
|
/** Optional callback to measure actual row height after render. When provided, measured heights override itemHeight. */
|
|
8
9
|
measureRow?: boolean;
|
|
9
10
|
}
|