@oneflowui/ui 0.8.1 → 0.8.3
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/components/Dashboard/charts/BarChart.vue.js +2 -2
- package/dist/components/Dashboard/charts/BarChart.vue2.js +9 -9
- package/dist/components/Dashboard/charts/NumberCard.vue.js +2 -2
- package/dist/components/Dashboard/charts/PieChart.vue.js +1 -1
- package/dist/components/Dashboard/charts/PieChart.vue2.js +3 -3
- package/dist/components/Dashboard/charts/TableChart.vue.js +2 -2
- package/dist/components/Dashboard/index.vue.js +2 -2
- package/dist/components/base/InfoCard.vue.js +1 -1
- package/dist/components/base/InfoCard.vue2.js +40 -40
- package/dist/components/base/StatisticCard.vue.js +3 -3
- package/dist/components/base/StatusSummary.vue.js +1 -1
- package/dist/components/base/StatusSummary.vue2.js +5 -5
- package/dist/components/database/DatabaseDetailPresenter.vue.d.ts +41 -0
- package/dist/components/database/DatabaseDetailPresenter.vue.js +76 -0
- package/dist/components/database/DatabaseDetailPresenter.vue2.js +4 -0
- package/dist/components/database/DatabaseDetailWorkspace.vue.d.ts +37 -0
- package/dist/components/database/DatabaseDetailWorkspace.vue.js +7 -0
- package/dist/components/database/DatabaseDetailWorkspace.vue2.js +103 -0
- package/dist/components/database/DatabaseView.vue.d.ts +13 -76
- package/dist/components/database/DatabaseView.vue.js +2 -2
- package/dist/components/database/DatabaseView.vue2.js +322 -921
- package/dist/components/database/DatabaseViewContent.vue.d.ts +74 -0
- package/dist/components/database/DatabaseViewContent.vue.js +79 -0
- package/dist/components/database/DatabaseViewContent.vue2.js +4 -0
- package/dist/components/database/DatabaseViewDetailHost.vue.d.ts +43 -0
- package/dist/components/database/DatabaseViewDetailHost.vue.js +59 -0
- package/dist/components/database/DatabaseViewDetailHost.vue2.js +4 -0
- package/dist/components/database/DatabaseViewShell.vue.d.ts +35 -0
- package/dist/components/database/DatabaseViewShell.vue.js +7 -0
- package/dist/components/database/DatabaseViewShell.vue2.js +71 -0
- package/dist/components/database/DatabaseViewToolbar.vue.d.ts +77 -0
- package/dist/components/database/DatabaseViewToolbar.vue.js +62 -0
- package/dist/components/database/DatabaseViewToolbar.vue2.js +4 -0
- package/dist/components/database/databaseViewUtils.d.ts +91 -0
- package/dist/components/database/databaseViewUtils.js +266 -0
- package/dist/components/database/index.d.ts +1 -1
- package/dist/components/kanban/KanbanColumn.vue.d.ts +2 -2
- package/dist/components/layout/AppLayout.vue.js +1 -1
- package/dist/components/layout/Navbar.vue.js +1 -1
- package/dist/components/layout/Sidebar.vue.js +2 -2
- package/dist/components/layout/StatusBar.vue.js +2 -2
- package/dist/components/overlay/Dialog.vue.d.ts +1 -1
- package/dist/components/table/ColumnHeaderMenu.vue.js +3 -3
- package/dist/components/table/DataTable.vue.d.ts +6 -17
- package/dist/components/table/DataTable.vue.js +2 -2
- package/dist/components/table/DataTable.vue2.js +781 -872
- package/dist/components/table/DataTableDesktopFixedRegion.vue.d.ts +56 -0
- package/dist/components/table/DataTableDesktopFixedRegion.vue.js +7 -0
- package/dist/components/table/DataTableDesktopFixedRegion.vue2.js +67 -0
- package/dist/components/table/DataTableDesktopFrame.vue.d.ts +127 -0
- package/dist/components/table/DataTableDesktopFrame.vue.js +7 -0
- package/dist/components/table/DataTableDesktopFrame.vue2.js +196 -0
- package/dist/components/table/DataTableDesktopScrollRegion.vue.d.ts +55 -0
- package/dist/components/table/DataTableDesktopScrollRegion.vue.js +7 -0
- package/dist/components/table/DataTableDesktopScrollRegion.vue2.js +66 -0
- package/dist/components/table/DataTableDesktopStandardRegion.vue.d.ts +54 -0
- package/dist/components/table/DataTableDesktopStandardRegion.vue.js +7 -0
- package/dist/components/table/DataTableDesktopStandardRegion.vue2.js +65 -0
- package/dist/components/table/DataTableDraftToolbar.vue.d.ts +11 -0
- package/dist/components/table/DataTableDraftToolbar.vue.js +7 -0
- package/dist/components/table/DataTableDraftToolbar.vue2.js +25 -0
- package/dist/components/table/DataTableMobilePanel.vue.d.ts +79 -0
- package/dist/components/table/DataTableMobilePanel.vue.js +60 -0
- package/dist/components/table/DataTableMobilePanel.vue2.js +4 -0
- package/dist/components/table/DataTableSelectionBar.vue.d.ts +11 -0
- package/dist/components/table/DataTableSelectionBar.vue.js +7 -0
- package/dist/components/table/DataTableSelectionBar.vue2.js +33 -0
- package/dist/components/table/DetailSheet.vue.js +1 -1
- package/dist/components/table/DetailSheet.vue2.js +160 -187
- package/dist/components/table/FieldTypePicker.vue.js +3 -3
- package/dist/components/table/MobileListView.vue.js +1 -1
- package/dist/components/table/TableColumnManager.vue.js +3 -3
- package/dist/components/table/TableDataRow.vue.js +4 -4
- package/dist/components/table/TableFilterPanel.vue.js +1 -1
- package/dist/components/table/TableGroupRow.vue.js +2 -2
- package/dist/components/table/TableHeaderRow.vue.js +3 -3
- package/dist/components/table/TableToolbar.vue.js +2 -2
- package/dist/components/table/TableToolbar.vue2.js +126 -138
- package/dist/components/table/dataTableUtils.d.ts +26 -0
- package/dist/components/table/dataTableUtils.js +60 -0
- package/dist/composables/databaseDetailWorkspaceUtils.d.ts +59 -0
- package/dist/composables/databaseDetailWorkspaceUtils.js +160 -0
- package/dist/composables/index.d.ts +5 -0
- package/dist/composables/useDataTableDetailSheet.d.ts +47 -0
- package/dist/composables/useDataTableDetailSheet.js +58 -0
- package/dist/composables/useDataTableLayout.d.ts +16 -0
- package/dist/composables/useDataTableLayout.js +38 -0
- package/dist/composables/useDataTableSelection.d.ts +41 -0
- package/dist/composables/useDataTableSelection.js +73 -0
- package/dist/composables/useDatabaseDetailWorkspace.d.ts +67 -0
- package/dist/composables/useDatabaseDetailWorkspace.js +150 -0
- package/dist/composables/useDatabaseView.d.ts +3 -137
- package/dist/composables/useDatabaseWorkspace.d.ts +31 -0
- package/dist/composables/useDatabaseWorkspace.js +89 -0
- package/dist/composables/useTableToolbarPanels.d.ts +19 -0
- package/dist/composables/useTableToolbarPanels.js +53 -0
- package/dist/contracts/database.d.ts +252 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +261 -248
- package/dist/plugin.d.ts +2 -0
- package/dist/plugin.js +10 -261
- package/dist/registry/plugin-components.d.ts +291 -0
- package/dist/registry/plugin-components.js +114 -0
- package/dist/style.css +1 -1
- package/dist/types/data-table.d.ts +27 -0
- package/dist/types/data-table.js +29 -0
- package/package.json +1 -1
|
@@ -1,24 +1,25 @@
|
|
|
1
|
-
import { defineComponent as Q, computed as
|
|
2
|
-
import { resolveIcon as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { ListFilter as
|
|
6
|
-
|
|
1
|
+
import { defineComponent as Q, computed as S, ref as k, openBlock as o, createElementBlock as r, Fragment as B, renderList as $, normalizeClass as m, createBlock as y, resolveDynamicComponent as W, unref as n, createCommentVNode as s, createElementVNode as a, toDisplayString as p, withModifiers as d, createVNode as b, Teleport as w, normalizeStyle as C, renderSlot as X } from "vue";
|
|
2
|
+
import { resolveIcon as Y } from "../../utils/icon.js";
|
|
3
|
+
import Z from "./TableFilterPanel.vue.js";
|
|
4
|
+
import _ from "./TableColumnManager.vue.js";
|
|
5
|
+
import { ListFilter as h, ArrowUpDown as tt, Layers as et, Columns3 as ot, Search as lt } from "lucide-vue-next";
|
|
6
|
+
import { useTableToolbarPanels as nt } from "../../composables/useTableToolbarPanels.js";
|
|
7
|
+
const rt = { class: "of-table-toolbar" }, st = {
|
|
7
8
|
key: 0,
|
|
8
9
|
class: "of-table-toolbar__views"
|
|
9
|
-
},
|
|
10
|
+
}, at = ["onClick"], it = {
|
|
10
11
|
key: 1,
|
|
11
12
|
class: "of-table-toolbar__sep"
|
|
12
|
-
},
|
|
13
|
+
}, ut = {
|
|
13
14
|
key: 0,
|
|
14
15
|
class: "of-table-toolbar__badge"
|
|
15
|
-
},
|
|
16
|
+
}, dt = { class: "of-table-toolbar__simple-panel" }, bt = ["onClick"], ft = {
|
|
16
17
|
key: 0,
|
|
17
18
|
class: "of-table-toolbar__sort-dir"
|
|
18
|
-
},
|
|
19
|
+
}, vt = { class: "of-table-toolbar__simple-panel" }, mt = ["onClick"], yt = {
|
|
19
20
|
key: 6,
|
|
20
21
|
class: "of-table-toolbar__search"
|
|
21
|
-
},
|
|
22
|
+
}, pt = ["value"], $t = /* @__PURE__ */ Q({
|
|
22
23
|
__name: "TableToolbar",
|
|
23
24
|
props: {
|
|
24
25
|
currentView: { default: "table" },
|
|
@@ -39,220 +40,207 @@ const ie = { class: "of-table-toolbar" }, fe = {
|
|
|
39
40
|
savedViews: { default: void 0 }
|
|
40
41
|
},
|
|
41
42
|
emits: ["update:currentView", "update:columns", "update:searchKeyword", "add-filter", "remove-filter", "update-filter", "clear-filters", "update:filterLogic", "sort", "group", "save-view", "load-view"],
|
|
42
|
-
setup(l, { emit:
|
|
43
|
-
const
|
|
43
|
+
setup(l, { emit: F }) {
|
|
44
|
+
const g = l, i = F, U = [
|
|
44
45
|
{ value: "table", label: "表格", icon: "table-2" },
|
|
45
46
|
{ value: "kanban", label: "看板", icon: "columns-3" },
|
|
46
47
|
{ value: "timeline", label: "时间线", icon: "calendar" }
|
|
47
|
-
],
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
function H() {
|
|
69
|
-
k.value = !1, v.value = !1, c.value = !1, p.value = !1;
|
|
70
|
-
}
|
|
71
|
-
function h(r) {
|
|
72
|
-
const e = r.target;
|
|
73
|
-
!e.closest(".of-table-toolbar__btn-group") && !e.closest(".of-table-toolbar__dropdown") && H();
|
|
74
|
-
}
|
|
75
|
-
W(() => document.addEventListener("click", h, !0)), X(() => document.removeEventListener("click", h, !0));
|
|
76
|
-
const J = T(() => R.columns.filter((r) => !r.hidden)), O = T(
|
|
77
|
-
() => R.columns.filter(
|
|
78
|
-
(r) => !r.hidden && (r.type === "status" || r.type === "string" || r.type === "priority")
|
|
48
|
+
], K = S(() => g.viewTabs ?? U), T = k(null), V = k(null), R = k(null), D = k(null), {
|
|
49
|
+
showFilterPanel: E,
|
|
50
|
+
showSortPanel: N,
|
|
51
|
+
showGroupPanel: I,
|
|
52
|
+
showColumnPanel: M,
|
|
53
|
+
filterDropdownStyle: x,
|
|
54
|
+
sortDropdownStyle: j,
|
|
55
|
+
groupDropdownStyle: q,
|
|
56
|
+
columnDropdownStyle: H,
|
|
57
|
+
togglePanel: c,
|
|
58
|
+
closePanel: f
|
|
59
|
+
} = nt({
|
|
60
|
+
filter: T,
|
|
61
|
+
sort: V,
|
|
62
|
+
group: R,
|
|
63
|
+
column: D
|
|
64
|
+
}), J = S(() => g.columns.filter((u) => !u.hidden)), O = S(
|
|
65
|
+
() => g.columns.filter(
|
|
66
|
+
(u) => !u.hidden && (u.type === "status" || u.type === "string" || u.type === "priority")
|
|
79
67
|
)
|
|
80
68
|
);
|
|
81
|
-
return (
|
|
82
|
-
var
|
|
83
|
-
return o(),
|
|
84
|
-
l.showViewSwitch ? (o(),
|
|
85
|
-
(o(!0),
|
|
86
|
-
key:
|
|
87
|
-
class: m(["of-table-toolbar__view-tab", { "of-table-toolbar__view-tab--active": l.currentView ===
|
|
88
|
-
onClick: (
|
|
69
|
+
return (u, t) => {
|
|
70
|
+
var G, L, P;
|
|
71
|
+
return o(), r("div", rt, [
|
|
72
|
+
l.showViewSwitch ? (o(), r("div", st, [
|
|
73
|
+
(o(!0), r(B, null, $(K.value, (e) => (o(), r("button", {
|
|
74
|
+
key: e.value,
|
|
75
|
+
class: m(["of-table-toolbar__view-tab", { "of-table-toolbar__view-tab--active": l.currentView === e.value }]),
|
|
76
|
+
onClick: (v) => i("update:currentView", e.value)
|
|
89
77
|
}, [
|
|
90
|
-
|
|
78
|
+
e.icon ? (o(), y(W(n(Y)(e.icon)), {
|
|
91
79
|
key: 0,
|
|
92
80
|
class: "of-table-toolbar__tab-icon"
|
|
93
81
|
})) : s("", !0),
|
|
94
|
-
a("span", null,
|
|
95
|
-
], 10,
|
|
82
|
+
a("span", null, p(e.label), 1)
|
|
83
|
+
], 10, at))), 128))
|
|
96
84
|
])) : s("", !0),
|
|
97
|
-
l.showViewSwitch ? (o(),
|
|
98
|
-
l.showFilter ? (o(),
|
|
85
|
+
l.showViewSwitch ? (o(), r("div", it)) : s("", !0),
|
|
86
|
+
l.showFilter ? (o(), r("div", {
|
|
99
87
|
key: 2,
|
|
100
88
|
ref_key: "filterBtnRef",
|
|
101
|
-
ref:
|
|
89
|
+
ref: T,
|
|
102
90
|
class: "of-table-toolbar__btn-group"
|
|
103
91
|
}, [
|
|
104
92
|
a("button", {
|
|
105
93
|
class: m(["of-table-toolbar__btn", { "of-table-toolbar__btn--active": l.filterActive }]),
|
|
106
|
-
onClick:
|
|
94
|
+
onClick: t[0] || (t[0] = d((e) => n(c)("filter"), ["stop"]))
|
|
107
95
|
}, [
|
|
108
|
-
b(
|
|
109
|
-
|
|
110
|
-
l.filterActive ? (o(),
|
|
96
|
+
b(n(h), { size: 14 }),
|
|
97
|
+
t[19] || (t[19] = a("span", null, "筛选", -1)),
|
|
98
|
+
l.filterActive ? (o(), r("span", ut, p(((G = l.filterConditions) == null ? void 0 : G.length) ?? 0), 1)) : s("", !0)
|
|
111
99
|
], 2),
|
|
112
|
-
(o(),
|
|
113
|
-
|
|
100
|
+
(o(), y(w, { to: "body" }, [
|
|
101
|
+
n(E) ? (o(), r("div", {
|
|
114
102
|
key: 0,
|
|
115
103
|
class: "of-table-toolbar__dropdown",
|
|
116
|
-
style:
|
|
117
|
-
onClick:
|
|
104
|
+
style: C(n(x)),
|
|
105
|
+
onClick: t[7] || (t[7] = d(() => {
|
|
118
106
|
}, ["stop"]))
|
|
119
107
|
}, [
|
|
120
|
-
b(
|
|
108
|
+
b(Z, {
|
|
121
109
|
conditions: l.filterConditions ?? [],
|
|
122
110
|
columns: l.columns,
|
|
123
111
|
logic: l.filterLogic ?? "and",
|
|
124
112
|
visible: !0,
|
|
125
|
-
onAddCondition:
|
|
126
|
-
onRemoveCondition:
|
|
127
|
-
onUpdateCondition:
|
|
128
|
-
onClear:
|
|
129
|
-
"onUpdate:logic":
|
|
130
|
-
onClose:
|
|
113
|
+
onAddCondition: t[1] || (t[1] = (e) => i("add-filter")),
|
|
114
|
+
onRemoveCondition: t[2] || (t[2] = (e) => i("remove-filter", e)),
|
|
115
|
+
onUpdateCondition: t[3] || (t[3] = (e, v) => i("update-filter", e, v)),
|
|
116
|
+
onClear: t[4] || (t[4] = (e) => i("clear-filters")),
|
|
117
|
+
"onUpdate:logic": t[5] || (t[5] = (e) => i("update:filterLogic", e)),
|
|
118
|
+
onClose: t[6] || (t[6] = (e) => n(f)("filter"))
|
|
131
119
|
}, null, 8, ["conditions", "columns", "logic"])
|
|
132
120
|
], 4)) : s("", !0)
|
|
133
121
|
]))
|
|
134
122
|
], 512)) : s("", !0),
|
|
135
|
-
l.showSort ? (o(),
|
|
123
|
+
l.showSort ? (o(), r("div", {
|
|
136
124
|
key: 3,
|
|
137
125
|
ref_key: "sortBtnRef",
|
|
138
|
-
ref:
|
|
126
|
+
ref: V,
|
|
139
127
|
class: "of-table-toolbar__btn-group"
|
|
140
128
|
}, [
|
|
141
129
|
a("button", {
|
|
142
|
-
class: m(["of-table-toolbar__btn", { "of-table-toolbar__btn--active": (
|
|
143
|
-
onClick:
|
|
130
|
+
class: m(["of-table-toolbar__btn", { "of-table-toolbar__btn--active": (L = l.currentSort) == null ? void 0 : L.field }]),
|
|
131
|
+
onClick: t[8] || (t[8] = d((e) => n(c)("sort"), ["stop"]))
|
|
144
132
|
}, [
|
|
145
|
-
b(
|
|
146
|
-
|
|
133
|
+
b(n(tt), { size: 14 }),
|
|
134
|
+
t[20] || (t[20] = a("span", null, "排序", -1))
|
|
147
135
|
], 2),
|
|
148
|
-
(o(),
|
|
149
|
-
|
|
136
|
+
(o(), y(w, { to: "body" }, [
|
|
137
|
+
n(N) ? (o(), r("div", {
|
|
150
138
|
key: 0,
|
|
151
139
|
class: "of-table-toolbar__dropdown",
|
|
152
|
-
style:
|
|
153
|
-
onClick:
|
|
140
|
+
style: C(n(j)),
|
|
141
|
+
onClick: t[10] || (t[10] = d(() => {
|
|
154
142
|
}, ["stop"]))
|
|
155
143
|
}, [
|
|
156
|
-
a("div",
|
|
157
|
-
|
|
158
|
-
(o(!0),
|
|
159
|
-
var
|
|
160
|
-
return o(),
|
|
161
|
-
key:
|
|
162
|
-
class: m(["of-table-toolbar__sort-item", { active: ((
|
|
163
|
-
onClick: (
|
|
164
|
-
|
|
144
|
+
a("div", dt, [
|
|
145
|
+
t[21] || (t[21] = a("div", { class: "of-table-toolbar__panel-title" }, "排序", -1)),
|
|
146
|
+
(o(!0), r(B, null, $(J.value, (e) => {
|
|
147
|
+
var v, z, A;
|
|
148
|
+
return o(), r("button", {
|
|
149
|
+
key: e.key,
|
|
150
|
+
class: m(["of-table-toolbar__sort-item", { active: ((v = l.currentSort) == null ? void 0 : v.field) === e.key }]),
|
|
151
|
+
onClick: (ct) => {
|
|
152
|
+
i("sort", e.key), n(f)("sort");
|
|
165
153
|
}
|
|
166
154
|
}, [
|
|
167
|
-
a("span", null,
|
|
168
|
-
((
|
|
169
|
-
], 10,
|
|
155
|
+
a("span", null, p(e.label), 1),
|
|
156
|
+
((z = l.currentSort) == null ? void 0 : z.field) === e.key ? (o(), r("span", ft, p(((A = l.currentSort) == null ? void 0 : A.order) === "asc" ? "↑" : "↓"), 1)) : s("", !0)
|
|
157
|
+
], 10, bt);
|
|
170
158
|
}), 128)),
|
|
171
|
-
(
|
|
159
|
+
(P = l.currentSort) != null && P.field ? (o(), r("button", {
|
|
172
160
|
key: 0,
|
|
173
161
|
class: "of-table-toolbar__clear-btn",
|
|
174
|
-
onClick:
|
|
175
|
-
|
|
162
|
+
onClick: t[9] || (t[9] = (e) => {
|
|
163
|
+
i("sort", ""), n(f)("sort");
|
|
176
164
|
})
|
|
177
165
|
}, " 清除排序 ")) : s("", !0)
|
|
178
166
|
])
|
|
179
167
|
], 4)) : s("", !0)
|
|
180
168
|
]))
|
|
181
169
|
], 512)) : s("", !0),
|
|
182
|
-
l.showGroup ? (o(),
|
|
170
|
+
l.showGroup ? (o(), r("div", {
|
|
183
171
|
key: 4,
|
|
184
172
|
ref_key: "groupBtnRef",
|
|
185
|
-
ref:
|
|
173
|
+
ref: R,
|
|
186
174
|
class: "of-table-toolbar__btn-group"
|
|
187
175
|
}, [
|
|
188
176
|
a("button", {
|
|
189
177
|
class: m(["of-table-toolbar__btn", { "of-table-toolbar__btn--active": !!l.currentGroup }]),
|
|
190
|
-
onClick:
|
|
178
|
+
onClick: t[11] || (t[11] = d((e) => n(c)("group"), ["stop"]))
|
|
191
179
|
}, [
|
|
192
|
-
b(
|
|
193
|
-
|
|
180
|
+
b(n(et), { size: 14 }),
|
|
181
|
+
t[22] || (t[22] = a("span", null, "分组", -1))
|
|
194
182
|
], 2),
|
|
195
|
-
(o(),
|
|
196
|
-
|
|
183
|
+
(o(), y(w, { to: "body" }, [
|
|
184
|
+
n(I) ? (o(), r("div", {
|
|
197
185
|
key: 0,
|
|
198
186
|
class: "of-table-toolbar__dropdown",
|
|
199
|
-
style:
|
|
200
|
-
onClick:
|
|
187
|
+
style: C(n(q)),
|
|
188
|
+
onClick: t[13] || (t[13] = d(() => {
|
|
201
189
|
}, ["stop"]))
|
|
202
190
|
}, [
|
|
203
|
-
a("div",
|
|
204
|
-
|
|
205
|
-
(o(!0),
|
|
206
|
-
key:
|
|
207
|
-
class: m(["of-table-toolbar__sort-item", { active: l.currentGroup ===
|
|
208
|
-
onClick: (
|
|
209
|
-
|
|
191
|
+
a("div", vt, [
|
|
192
|
+
t[23] || (t[23] = a("div", { class: "of-table-toolbar__panel-title" }, "分组", -1)),
|
|
193
|
+
(o(!0), r(B, null, $(O.value, (e) => (o(), r("button", {
|
|
194
|
+
key: e.key,
|
|
195
|
+
class: m(["of-table-toolbar__sort-item", { active: l.currentGroup === e.key }]),
|
|
196
|
+
onClick: (v) => {
|
|
197
|
+
i("group", l.currentGroup === e.key ? null : e.key), n(f)("group");
|
|
210
198
|
}
|
|
211
|
-
},
|
|
212
|
-
l.currentGroup ? (o(),
|
|
199
|
+
}, p(e.label), 11, mt))), 128)),
|
|
200
|
+
l.currentGroup ? (o(), r("button", {
|
|
213
201
|
key: 0,
|
|
214
202
|
class: "of-table-toolbar__clear-btn",
|
|
215
|
-
onClick:
|
|
216
|
-
|
|
203
|
+
onClick: t[12] || (t[12] = (e) => {
|
|
204
|
+
i("group", null), n(f)("group");
|
|
217
205
|
})
|
|
218
206
|
}, " 取消分组 ")) : s("", !0)
|
|
219
207
|
])
|
|
220
208
|
], 4)) : s("", !0)
|
|
221
209
|
]))
|
|
222
210
|
], 512)) : s("", !0),
|
|
223
|
-
l.showColumns ? (o(),
|
|
211
|
+
l.showColumns ? (o(), r("div", {
|
|
224
212
|
key: 5,
|
|
225
213
|
ref_key: "columnBtnRef",
|
|
226
|
-
ref:
|
|
214
|
+
ref: D,
|
|
227
215
|
class: "of-table-toolbar__btn-group"
|
|
228
216
|
}, [
|
|
229
217
|
a("button", {
|
|
230
218
|
class: "of-table-toolbar__btn",
|
|
231
|
-
onClick:
|
|
219
|
+
onClick: t[14] || (t[14] = d((e) => n(c)("column"), ["stop"]))
|
|
232
220
|
}, [
|
|
233
|
-
b(
|
|
234
|
-
|
|
221
|
+
b(n(ot), { size: 14 }),
|
|
222
|
+
t[24] || (t[24] = a("span", null, "列", -1))
|
|
235
223
|
]),
|
|
236
|
-
(o(),
|
|
237
|
-
|
|
224
|
+
(o(), y(w, { to: "body" }, [
|
|
225
|
+
n(M) ? (o(), r("div", {
|
|
238
226
|
key: 0,
|
|
239
227
|
class: "of-table-toolbar__dropdown",
|
|
240
|
-
style:
|
|
241
|
-
onClick:
|
|
228
|
+
style: C(n(H)),
|
|
229
|
+
onClick: t[17] || (t[17] = d(() => {
|
|
242
230
|
}, ["stop"]))
|
|
243
231
|
}, [
|
|
244
|
-
b(
|
|
232
|
+
b(_, {
|
|
245
233
|
columns: l.columns,
|
|
246
234
|
visible: !0,
|
|
247
|
-
"onUpdate:columns":
|
|
248
|
-
onClose:
|
|
235
|
+
"onUpdate:columns": t[15] || (t[15] = (e) => i("update:columns", e)),
|
|
236
|
+
onClose: t[16] || (t[16] = (e) => n(f)("column"))
|
|
249
237
|
}, null, 8, ["columns"])
|
|
250
238
|
], 4)) : s("", !0)
|
|
251
239
|
]))
|
|
252
240
|
], 512)) : s("", !0),
|
|
253
|
-
|
|
254
|
-
l.showSearch ? (o(),
|
|
255
|
-
b(
|
|
241
|
+
t[25] || (t[25] = a("div", { class: "of-table-toolbar__spacer" }, null, -1)),
|
|
242
|
+
l.showSearch ? (o(), r("div", yt, [
|
|
243
|
+
b(n(lt), {
|
|
256
244
|
size: 14,
|
|
257
245
|
class: "of-table-toolbar__search-icon"
|
|
258
246
|
}),
|
|
@@ -260,14 +248,14 @@ const ie = { class: "of-table-toolbar" }, fe = {
|
|
|
260
248
|
class: "of-table-toolbar__search-input",
|
|
261
249
|
placeholder: "搜索...",
|
|
262
250
|
value: l.searchKeyword,
|
|
263
|
-
onInput:
|
|
264
|
-
}, null, 40,
|
|
251
|
+
onInput: t[18] || (t[18] = (e) => i("update:searchKeyword", e.target.value))
|
|
252
|
+
}, null, 40, pt)
|
|
265
253
|
])) : s("", !0),
|
|
266
|
-
|
|
254
|
+
X(u.$slots, "default", {}, void 0, !0)
|
|
267
255
|
]);
|
|
268
256
|
};
|
|
269
257
|
}
|
|
270
258
|
});
|
|
271
259
|
export {
|
|
272
|
-
|
|
260
|
+
$t as default
|
|
273
261
|
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { CSSProperties } from 'vue';
|
|
2
|
+
import { Density, FieldType, TableColumn } from '../../types';
|
|
3
|
+
import { BulkActionContext, BulkActionItem, ResolvedBulkActionItem } from '../../types/data-table';
|
|
4
|
+
import { FieldDef as CellFieldDef } from './FieldCell.vue';
|
|
5
|
+
export declare function normalizeFieldType(type?: CellFieldDef["type"]): FieldType | undefined;
|
|
6
|
+
export declare function resolveRowId(row: Record<string, unknown>, rowKey: string): string;
|
|
7
|
+
export declare function resolveFieldDef(fieldDefs: CellFieldDef[] | undefined, colKey: string): CellFieldDef;
|
|
8
|
+
export declare function resolveFirstEditableFieldKey<T extends Record<string, unknown>>(params: {
|
|
9
|
+
row: T;
|
|
10
|
+
readonly: boolean;
|
|
11
|
+
columns: TableColumn[];
|
|
12
|
+
editableFieldKeys: string[];
|
|
13
|
+
}): string | null;
|
|
14
|
+
export declare function buildResolvedBulkActionItems<TRecord>(customItems: BulkActionItem[] | undefined, context: BulkActionContext<TRecord>): ResolvedBulkActionItem[];
|
|
15
|
+
export declare function getDensityCellPadding(density: Density): {
|
|
16
|
+
x: number;
|
|
17
|
+
y: number;
|
|
18
|
+
};
|
|
19
|
+
export declare function buildDataRowStyle(rowHeight: number): CSSProperties;
|
|
20
|
+
export declare function buildBodyCellStyle(params: {
|
|
21
|
+
density: Density;
|
|
22
|
+
col: TableColumn;
|
|
23
|
+
resolvedWidth: number;
|
|
24
|
+
fillMinWidth: number;
|
|
25
|
+
}): CSSProperties;
|
|
26
|
+
export declare function buildGroupSpacerStyle(groupRowHeight: number): CSSProperties;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
function f(n) {
|
|
2
|
+
return n === "multiselect" ? "multi_select" : n;
|
|
3
|
+
}
|
|
4
|
+
function x(n, e) {
|
|
5
|
+
const t = n[e];
|
|
6
|
+
return t != null ? String(t) : "";
|
|
7
|
+
}
|
|
8
|
+
function y(n, e) {
|
|
9
|
+
return (n == null ? void 0 : n.find((t) => t.id === e)) ?? {
|
|
10
|
+
id: e,
|
|
11
|
+
type: "text",
|
|
12
|
+
label: e
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
function h(n) {
|
|
16
|
+
const { row: e, readonly: t, columns: r, editableFieldKeys: l } = n;
|
|
17
|
+
if (t) return null;
|
|
18
|
+
for (const i of r)
|
|
19
|
+
if (!i.hidden && l.includes(i.key) && !(e[i.key] === void 0 && !(i.key in e)))
|
|
20
|
+
return i.key;
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
function c(n) {
|
|
24
|
+
return n === "compact" ? { x: 10, y: 6 } : n === "comfortable" ? { x: 14, y: 10 } : { x: 12, y: 8 };
|
|
25
|
+
}
|
|
26
|
+
function p(n) {
|
|
27
|
+
return {
|
|
28
|
+
minHeight: `${n}px`
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
function a(n) {
|
|
32
|
+
const { density: e, col: t, resolvedWidth: r, fillMinWidth: l } = n, { x: i, y: d } = c(e), o = {
|
|
33
|
+
padding: `${d}px ${i}px`
|
|
34
|
+
};
|
|
35
|
+
if (t.width === "fill") {
|
|
36
|
+
const u = `${t.minWidth ?? l}px`;
|
|
37
|
+
return { ...o, flex: `1 1 ${u}`, minWidth: u };
|
|
38
|
+
}
|
|
39
|
+
return typeof t.width == "number" ? { ...o, width: `${t.width}px`, flexShrink: "0", flexGrow: "0" } : {
|
|
40
|
+
...o,
|
|
41
|
+
width: `${r}px`,
|
|
42
|
+
flexShrink: "0",
|
|
43
|
+
flexGrow: "0"
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
function s(n) {
|
|
47
|
+
return {
|
|
48
|
+
height: `${n}px`
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
export {
|
|
52
|
+
a as buildBodyCellStyle,
|
|
53
|
+
p as buildDataRowStyle,
|
|
54
|
+
s as buildGroupSpacerStyle,
|
|
55
|
+
c as getDensityCellPadding,
|
|
56
|
+
f as normalizeFieldType,
|
|
57
|
+
y as resolveFieldDef,
|
|
58
|
+
h as resolveFirstEditableFieldKey,
|
|
59
|
+
x as resolveRowId
|
|
60
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { DatabaseViewDetailPresentation, DatabaseViewResolvedDetailPresentation } from '../contracts/database';
|
|
2
|
+
import { CellValue, DataRecord, TableColumn, TableSchema } from '../types';
|
|
3
|
+
type DetailCellFieldType = "text" | "number" | "checkbox" | "select" | "multiselect" | "date" | "datetime" | "rating" | "url" | "email" | "currency" | "richtext" | "auto_number" | "creator" | "progress" | "relation" | "attachment" | "phone";
|
|
4
|
+
export interface DetailCellFieldDef {
|
|
5
|
+
id: string;
|
|
6
|
+
type: DetailCellFieldType;
|
|
7
|
+
label: string;
|
|
8
|
+
options?: {
|
|
9
|
+
label: string;
|
|
10
|
+
value: string;
|
|
11
|
+
color?: string;
|
|
12
|
+
}[];
|
|
13
|
+
max?: number;
|
|
14
|
+
readonly?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export interface DatabaseWorkspaceModeOption {
|
|
17
|
+
value: DatabaseViewResolvedDetailPresentation;
|
|
18
|
+
label: string;
|
|
19
|
+
}
|
|
20
|
+
export interface DatabaseDetailPropertyItem {
|
|
21
|
+
key: string;
|
|
22
|
+
label: string;
|
|
23
|
+
field: DetailCellFieldDef | null;
|
|
24
|
+
value: CellValue | undefined;
|
|
25
|
+
fallbackText: string;
|
|
26
|
+
}
|
|
27
|
+
export declare function buildDetailColumns(schema?: TableSchema | null, records?: DataRecord[]): {
|
|
28
|
+
key: string;
|
|
29
|
+
label: string;
|
|
30
|
+
type: "string" | "number" | "date" | "status" | "priority" | undefined;
|
|
31
|
+
hidden: boolean;
|
|
32
|
+
width: number | undefined;
|
|
33
|
+
}[];
|
|
34
|
+
export declare function buildDetailFieldDefs(schema?: TableSchema | null, records?: DataRecord[]): {
|
|
35
|
+
id: string;
|
|
36
|
+
type: DetailCellFieldType;
|
|
37
|
+
label: string;
|
|
38
|
+
}[];
|
|
39
|
+
export declare function toDetailRow(record: DataRecord | null): Record<string, unknown> & {
|
|
40
|
+
id: string;
|
|
41
|
+
};
|
|
42
|
+
export declare function buildDetailWorkspaceTitle(record: DataRecord | null): string;
|
|
43
|
+
export declare function partitionDetailColumns(columns: TableColumn[], fieldDefs: DetailCellFieldDef[]): {
|
|
44
|
+
propertyColumns: TableColumn[];
|
|
45
|
+
contentColumns: TableColumn[];
|
|
46
|
+
};
|
|
47
|
+
export declare function buildDetailWorkspaceDescription(columns: TableColumn[], row: Record<string, unknown>): string;
|
|
48
|
+
export declare function buildDetailPropertyItems(options: {
|
|
49
|
+
columns: TableColumn[];
|
|
50
|
+
fieldDefs: DetailCellFieldDef[];
|
|
51
|
+
row: Record<string, unknown>;
|
|
52
|
+
}): DatabaseDetailPropertyItem[];
|
|
53
|
+
export declare function resolveDetailPresentation(options: {
|
|
54
|
+
requested: DatabaseViewDetailPresentation;
|
|
55
|
+
preferred: DatabaseViewResolvedDetailPresentation | null;
|
|
56
|
+
isMobileViewport: boolean;
|
|
57
|
+
}): DatabaseViewResolvedDetailPresentation;
|
|
58
|
+
export declare function buildWorkspaceModes(isMobileViewport: boolean): DatabaseWorkspaceModeOption[];
|
|
59
|
+
export {};
|