@oneflowui/ui 0.5.7 → 0.5.9
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/index.vue.d.ts +1 -1
- package/dist/components/Dashboard/index.vue.js +3 -3
- 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/overlay/Drawer.vue.d.ts +1 -1
- package/dist/components/overlay/Modal.vue.d.ts +1 -1
- package/dist/components/table/ColumnHeaderMenu.vue.d.ts +2 -2
- package/dist/components/table/DataTable.vue.d.ts +3 -1
- package/dist/components/table/DataTable.vue.js +2 -2
- package/dist/components/table/DataTable.vue2.js +598 -526
- 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 +155 -76
- package/dist/components/table/TableDataRow.vue.d.ts +3 -1
- package/dist/components/table/TableDataRow.vue.js +3 -3
- package/dist/components/table/TableDataRow.vue2.js +95 -68
- package/dist/components/table/TableHeaderRow.vue.d.ts +3 -1
- package/dist/components/table/TableHeaderRow.vue.js +3 -3
- package/dist/components/table/TableHeaderRow.vue2.js +96 -60
- package/dist/composables/useColumnResize.d.ts +4 -1
- package/dist/composables/useColumnResize.js +114 -45
- package/dist/composables/useRowDrag.d.ts +1 -1
- package/dist/composables/useVirtualList.d.ts +1 -0
- package/dist/composables/useVirtualList.js +89 -77
- package/dist/plugin.js +240 -171
- package/dist/style.css +1 -1
- package/dist/types/index.d.ts +2 -1
- package/dist/utils/icon.js +25 -68
- package/dist/utils/iconRegistry.d.ts +7 -0
- package/dist/utils/iconRegistry.js +60 -0
- package/package.json +1 -1
|
@@ -1,36 +1,47 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Loader2 as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
|
|
1
|
+
import { defineComponent as Tt, ref as B, onMounted as Rt, onBeforeUnmount as Dt, computed as n, watch as F, openBlock as c, createElementBlock as w, mergeProps as Lt, createVNode as ae, unref as ie, createElementVNode as u, Fragment as le, createBlock as S, createCommentVNode as oe, withCtx as Et, toDisplayString as x, renderList as Ie } from "vue";
|
|
2
|
+
import { Loader2 as Bt, AlertCircle as At, Database as Nt } from "lucide-vue-next";
|
|
3
|
+
import Se from "../base/EmptyState.vue.js";
|
|
4
|
+
import xt from "../table/FieldCell.vue.js";
|
|
5
|
+
import Ut from "../table/DetailSheet.vue.js";
|
|
6
|
+
import Kt from "../overlay/SidePanel.vue.js";
|
|
7
|
+
import qt from "../table/TableToolbar.vue.js";
|
|
8
|
+
import Gt from "../table/DataTable.vue.js";
|
|
9
|
+
import Mt from "../kanban/KanbanBoard.vue.js";
|
|
10
|
+
import Pt from "../gallery/GalleryView.vue.js";
|
|
11
|
+
import Wt from "../timeline/GanttTimeline.vue.js";
|
|
12
|
+
import { useMarkdown as Ot } from "../../composables/useMarkdown.js";
|
|
13
|
+
import { useDatabaseView as $t } from "../../composables/useDatabaseView.js";
|
|
14
|
+
import { buildGanttItems as zt } from "../../types/index.js";
|
|
15
|
+
const jt = {
|
|
13
16
|
key: 0,
|
|
14
17
|
class: "of-database-view__state of-database-view__state--loading",
|
|
15
18
|
"data-role": "loading-state"
|
|
16
|
-
},
|
|
19
|
+
}, Ht = {
|
|
17
20
|
key: 1,
|
|
18
21
|
class: "of-database-view__state",
|
|
19
22
|
"data-role": "error-state"
|
|
20
|
-
},
|
|
23
|
+
}, Jt = {
|
|
21
24
|
key: 1,
|
|
22
25
|
class: "of-database-view__state of-database-view__state--empty",
|
|
23
26
|
"data-role": "empty-state"
|
|
24
|
-
},
|
|
27
|
+
}, Xt = ["data-view"], Yt = {
|
|
25
28
|
key: 4,
|
|
26
29
|
class: "of-database-view__detail-anchor"
|
|
27
|
-
},
|
|
30
|
+
}, Zt = ["data-record-id"], Qt = { class: "of-database-view__detail-workspace-header" }, ea = { class: "of-database-view__detail-workspace-heading" }, ta = { class: "of-database-view__detail-workspace-title" }, aa = { class: "of-database-view__detail-workspace-meta" }, ia = { class: "of-database-view__detail-workspace-id" }, la = { class: "of-database-view__detail-workspace-body" }, oa = { class: "of-database-view__detail-workspace-properties" }, ra = { class: "of-database-view__detail-workspace-label" }, na = { class: "of-database-view__detail-workspace-value" }, sa = {
|
|
31
|
+
key: 1,
|
|
32
|
+
class: "of-database-view__detail-workspace-fallback"
|
|
33
|
+
}, da = {
|
|
34
|
+
key: 0,
|
|
35
|
+
class: "of-database-view__detail-workspace-content"
|
|
36
|
+
}, ua = { class: "of-database-view__detail-workspace-content-label" }, ca = ["innerHTML"], va = { class: "of-database-view__detail-workspace-footer" }, fa = ["disabled"], k = "detail", wa = "(max-width: 768px)", Ra = /* @__PURE__ */ Tt({
|
|
28
37
|
name: "DatabaseView",
|
|
29
38
|
inheritAttrs: !1,
|
|
30
39
|
__name: "DatabaseView",
|
|
31
40
|
props: {
|
|
32
41
|
tableId: { default: "database-view" },
|
|
33
42
|
mode: { default: "local" },
|
|
43
|
+
detailPresentation: { default: "auto" },
|
|
44
|
+
density: { default: "standard" },
|
|
34
45
|
schema: { default: null },
|
|
35
46
|
records: { default: () => [] },
|
|
36
47
|
views: { default: () => [] },
|
|
@@ -58,27 +69,36 @@ const Vt = {
|
|
|
58
69
|
autoLoad: { type: Boolean, default: !0 }
|
|
59
70
|
},
|
|
60
71
|
emits: ["update:currentViewId", "update:selectedRecordId", "update:searchKeyword", "update:columns", "update:filterLogic", "update:records", "cell-edit", "select-record", "schema-add-field", "schema-rename-field", "schema-change-field-type", "schema-hide-field", "schema-delete-field", "schema-duplicate-field", "row-click", "card-click", "add", "add-column", "record-change", "load-view", "save-view", "sort", "group", "refresh"],
|
|
61
|
-
setup(T, { emit:
|
|
62
|
-
var
|
|
63
|
-
const l = T, d =
|
|
64
|
-
|
|
65
|
-
|
|
72
|
+
setup(T, { emit: Fe }) {
|
|
73
|
+
var ge, Ce;
|
|
74
|
+
const l = T, d = Fe, { renderMarkdown: Te } = Ot({ showCopyButton: !0 }), re = B(!1);
|
|
75
|
+
let g = null;
|
|
76
|
+
function O() {
|
|
77
|
+
re.value = (g == null ? void 0 : g.matches) ?? !1;
|
|
78
|
+
}
|
|
79
|
+
Rt(() => {
|
|
80
|
+
typeof window > "u" || typeof window.matchMedia != "function" || (g = window.matchMedia(wa), O(), g.addEventListener("change", O));
|
|
81
|
+
}), Dt(() => {
|
|
82
|
+
g == null || g.removeEventListener("change", O), g = null;
|
|
83
|
+
});
|
|
84
|
+
function ne(e) {
|
|
85
|
+
var t, a, i, o;
|
|
66
86
|
return {
|
|
67
87
|
...e,
|
|
68
88
|
visibleFields: [...e.visibleFields],
|
|
69
|
-
sorts: (t = e.sorts) == null ? void 0 : t.map((
|
|
70
|
-
groups: (a = e.groups) == null ? void 0 : a.map((
|
|
71
|
-
filters: (i = e.filters) == null ? void 0 : i.map((
|
|
72
|
-
aggregations: (
|
|
89
|
+
sorts: (t = e.sorts) == null ? void 0 : t.map((r) => ({ ...r })),
|
|
90
|
+
groups: (a = e.groups) == null ? void 0 : a.map((r) => ({ ...r })),
|
|
91
|
+
filters: (i = e.filters) == null ? void 0 : i.map((r) => ({ ...r })),
|
|
92
|
+
aggregations: (o = e.aggregations) == null ? void 0 : o.map((r) => ({ ...r })),
|
|
73
93
|
fixedColumns: e.fixedColumns ? [...e.fixedColumns] : void 0,
|
|
74
94
|
galleryCardFields: e.galleryCardFields ? [...e.galleryCardFields] : void 0
|
|
75
95
|
};
|
|
76
96
|
}
|
|
77
|
-
function
|
|
97
|
+
function Re(e) {
|
|
78
98
|
const t = e[0];
|
|
79
99
|
return t ? Object.keys(t.fields) : [];
|
|
80
100
|
}
|
|
81
|
-
function
|
|
101
|
+
function se(e) {
|
|
82
102
|
switch (e) {
|
|
83
103
|
case "kanban":
|
|
84
104
|
return "columns-3";
|
|
@@ -93,8 +113,8 @@ const Vt = {
|
|
|
93
113
|
return "table-2";
|
|
94
114
|
}
|
|
95
115
|
}
|
|
96
|
-
function
|
|
97
|
-
const a =
|
|
116
|
+
function De(e, t = []) {
|
|
117
|
+
const a = R(e, t);
|
|
98
118
|
return {
|
|
99
119
|
viewId: "table",
|
|
100
120
|
viewType: "table",
|
|
@@ -106,10 +126,10 @@ const Vt = {
|
|
|
106
126
|
fixedColumns: []
|
|
107
127
|
};
|
|
108
128
|
}
|
|
109
|
-
function
|
|
110
|
-
const a =
|
|
129
|
+
function Le(e, t = []) {
|
|
130
|
+
const a = R(e, t);
|
|
111
131
|
return {
|
|
112
|
-
viewId:
|
|
132
|
+
viewId: k,
|
|
113
133
|
viewType: "detail",
|
|
114
134
|
name: "详情",
|
|
115
135
|
visibleFields: a,
|
|
@@ -119,11 +139,11 @@ const Vt = {
|
|
|
119
139
|
fixedColumns: []
|
|
120
140
|
};
|
|
121
141
|
}
|
|
122
|
-
function
|
|
142
|
+
function $(e, t) {
|
|
123
143
|
var a;
|
|
124
144
|
return ((a = t == null ? void 0 : t.fields.find((i) => i.id === e)) == null ? void 0 : a.name) ?? e;
|
|
125
145
|
}
|
|
126
|
-
function
|
|
146
|
+
function de(e) {
|
|
127
147
|
switch (e == null ? void 0 : e.type) {
|
|
128
148
|
case "number":
|
|
129
149
|
case "currency":
|
|
@@ -139,7 +159,7 @@ const Vt = {
|
|
|
139
159
|
return "string";
|
|
140
160
|
}
|
|
141
161
|
}
|
|
142
|
-
function
|
|
162
|
+
function Ee(e) {
|
|
143
163
|
switch (e == null ? void 0 : e.type) {
|
|
144
164
|
case "number":
|
|
145
165
|
return "number";
|
|
@@ -182,79 +202,79 @@ const Vt = {
|
|
|
182
202
|
return "text";
|
|
183
203
|
}
|
|
184
204
|
}
|
|
185
|
-
function
|
|
186
|
-
var
|
|
187
|
-
return ((((
|
|
188
|
-
var
|
|
189
|
-
const
|
|
205
|
+
function Be(e, t, a = []) {
|
|
206
|
+
var o;
|
|
207
|
+
return ((((o = e.visibleFields) == null ? void 0 : o.length) ?? 0) > 0 ? e.visibleFields : R(t, a)).map((r) => {
|
|
208
|
+
var I;
|
|
209
|
+
const v = (I = t == null ? void 0 : t.fields) == null ? void 0 : I.find((p) => p.id === r);
|
|
190
210
|
return {
|
|
191
|
-
key:
|
|
192
|
-
label:
|
|
193
|
-
type:
|
|
194
|
-
hidden: (
|
|
195
|
-
width:
|
|
211
|
+
key: r,
|
|
212
|
+
label: $(r, t),
|
|
213
|
+
type: de(v),
|
|
214
|
+
hidden: (v == null ? void 0 : v.hidden) ?? !1,
|
|
215
|
+
width: v == null ? void 0 : v.width
|
|
196
216
|
};
|
|
197
217
|
});
|
|
198
218
|
}
|
|
199
|
-
function
|
|
200
|
-
return
|
|
201
|
-
var
|
|
202
|
-
const
|
|
219
|
+
function Ae(e, t = []) {
|
|
220
|
+
return R(e, t).map((i) => {
|
|
221
|
+
var r;
|
|
222
|
+
const o = (r = e == null ? void 0 : e.fields) == null ? void 0 : r.find((v) => v.id === i);
|
|
203
223
|
return {
|
|
204
224
|
key: i,
|
|
205
|
-
label:
|
|
206
|
-
type:
|
|
207
|
-
hidden: (
|
|
208
|
-
width:
|
|
225
|
+
label: $(i, e),
|
|
226
|
+
type: de(o),
|
|
227
|
+
hidden: (o == null ? void 0 : o.hidden) ?? !1,
|
|
228
|
+
width: o == null ? void 0 : o.width
|
|
209
229
|
};
|
|
210
230
|
});
|
|
211
231
|
}
|
|
212
|
-
function
|
|
213
|
-
return
|
|
214
|
-
var
|
|
215
|
-
const
|
|
232
|
+
function Ne(e, t = []) {
|
|
233
|
+
return R(e, t).map((i) => {
|
|
234
|
+
var r;
|
|
235
|
+
const o = (r = e == null ? void 0 : e.fields) == null ? void 0 : r.find((v) => v.id === i);
|
|
216
236
|
return {
|
|
217
237
|
id: i,
|
|
218
|
-
type:
|
|
219
|
-
label:
|
|
238
|
+
type: Ee(o),
|
|
239
|
+
label: $(i, e)
|
|
220
240
|
};
|
|
221
241
|
});
|
|
222
242
|
}
|
|
223
|
-
function
|
|
243
|
+
function U(e) {
|
|
224
244
|
return e == null ? "" : Array.isArray(e) ? e.map((t) => String(t)).join(", ") : String(e);
|
|
225
245
|
}
|
|
226
|
-
function
|
|
246
|
+
function A(e, t) {
|
|
227
247
|
if (e == null && t == null) return 0;
|
|
228
248
|
if (e == null) return -1;
|
|
229
249
|
if (t == null) return 1;
|
|
230
|
-
const a = Number(e), i = Number(t),
|
|
231
|
-
if (
|
|
232
|
-
const
|
|
233
|
-
return Number.isFinite(
|
|
250
|
+
const a = Number(e), i = Number(t), o = Number.isFinite(a) && `${e}`.trim() !== "", r = Number.isFinite(i) && `${t}`.trim() !== "";
|
|
251
|
+
if (o && r) return a - i;
|
|
252
|
+
const v = Date.parse(String(e)), I = Date.parse(String(t));
|
|
253
|
+
return Number.isFinite(v) && Number.isFinite(I) ? v - I : U(e).localeCompare(U(t), "zh-Hans-CN");
|
|
234
254
|
}
|
|
235
|
-
function
|
|
236
|
-
const a =
|
|
255
|
+
function xe(e, t) {
|
|
256
|
+
const a = U(e).trim(), i = (t.value ?? "").trim(), o = a.toLowerCase(), r = i.toLowerCase();
|
|
237
257
|
switch (t.operator) {
|
|
238
258
|
case "equals":
|
|
239
|
-
return
|
|
259
|
+
return o === r;
|
|
240
260
|
case "not_equals":
|
|
241
|
-
return
|
|
261
|
+
return o !== r;
|
|
242
262
|
case "contains":
|
|
243
|
-
return
|
|
263
|
+
return o.includes(r);
|
|
244
264
|
case "not_contains":
|
|
245
|
-
return !
|
|
265
|
+
return !o.includes(r);
|
|
246
266
|
case "starts_with":
|
|
247
|
-
return
|
|
267
|
+
return o.startsWith(r);
|
|
248
268
|
case "ends_with":
|
|
249
|
-
return
|
|
269
|
+
return o.endsWith(r);
|
|
250
270
|
case "gt":
|
|
251
|
-
return
|
|
271
|
+
return A(e, i) > 0;
|
|
252
272
|
case "gte":
|
|
253
|
-
return
|
|
273
|
+
return A(e, i) >= 0;
|
|
254
274
|
case "lt":
|
|
255
|
-
return
|
|
275
|
+
return A(e, i) < 0;
|
|
256
276
|
case "lte":
|
|
257
|
-
return
|
|
277
|
+
return A(e, i) <= 0;
|
|
258
278
|
case "is_empty":
|
|
259
279
|
return a === "";
|
|
260
280
|
case "is_not_empty":
|
|
@@ -263,7 +283,7 @@ const Vt = {
|
|
|
263
283
|
return !0;
|
|
264
284
|
}
|
|
265
285
|
}
|
|
266
|
-
function
|
|
286
|
+
function Ue(e) {
|
|
267
287
|
return {
|
|
268
288
|
id: `f_${Math.random().toString(36).slice(2, 8)}`,
|
|
269
289
|
field: e,
|
|
@@ -271,7 +291,7 @@ const Vt = {
|
|
|
271
291
|
value: ""
|
|
272
292
|
};
|
|
273
293
|
}
|
|
274
|
-
function
|
|
294
|
+
function Ke(e = []) {
|
|
275
295
|
return e.map((t, a) => ({
|
|
276
296
|
id: `f_${t.fieldId}_${a}`,
|
|
277
297
|
field: t.fieldId,
|
|
@@ -297,7 +317,7 @@ const Vt = {
|
|
|
297
317
|
value: t.value == null ? "" : String(t.value)
|
|
298
318
|
}));
|
|
299
319
|
}
|
|
300
|
-
function
|
|
320
|
+
function qe(e) {
|
|
301
321
|
return e.filter((t) => t.field).map((t) => {
|
|
302
322
|
let a;
|
|
303
323
|
switch (t.operator) {
|
|
@@ -336,37 +356,37 @@ const Vt = {
|
|
|
336
356
|
};
|
|
337
357
|
});
|
|
338
358
|
}
|
|
339
|
-
function
|
|
359
|
+
function R(e, t = []) {
|
|
340
360
|
var i;
|
|
341
|
-
const a = (i = e == null ? void 0 : e.fields) == null ? void 0 : i.filter((
|
|
342
|
-
return a != null && a.length ? a :
|
|
361
|
+
const a = (i = e == null ? void 0 : e.fields) == null ? void 0 : i.filter((o) => !o.hidden).map((o) => o.id);
|
|
362
|
+
return a != null && a.length ? a : Re(t);
|
|
343
363
|
}
|
|
344
|
-
function
|
|
364
|
+
function Ge(e) {
|
|
345
365
|
return e ? {
|
|
346
366
|
id: e.id,
|
|
347
367
|
...e.fields
|
|
348
368
|
} : { id: "__detail-empty__" };
|
|
349
369
|
}
|
|
350
|
-
function
|
|
370
|
+
function Me(e) {
|
|
351
371
|
if (e)
|
|
352
372
|
return {
|
|
353
373
|
label: "返回列表",
|
|
354
|
-
onClick: () =>
|
|
374
|
+
onClick: () => he(e)
|
|
355
375
|
};
|
|
356
376
|
}
|
|
357
|
-
const
|
|
358
|
-
var i,
|
|
359
|
-
const e = (l.views ?? []).map((
|
|
360
|
-
return t || e.unshift(
|
|
361
|
-
}), s =
|
|
377
|
+
const ue = n(() => l.schema ?? null), Pe = n(() => l.records ?? []), ce = n(() => {
|
|
378
|
+
var i, o;
|
|
379
|
+
const e = (l.views ?? []).map((r) => ne(r)), t = e.some((r) => r.viewType === "table") || (((i = l.schema) == null ? void 0 : i.views) ?? []).some((r) => r.viewType === "table"), a = e.some((r) => r.viewType === "detail") || (((o = l.schema) == null ? void 0 : o.views) ?? []).some((r) => r.viewType === "detail");
|
|
380
|
+
return t || e.unshift(De(l.schema, l.records ?? [])), a || e.push(Le(l.schema, l.records ?? [])), e;
|
|
381
|
+
}), s = $t({
|
|
362
382
|
tableId: l.tableId,
|
|
363
383
|
mode: l.mode,
|
|
364
|
-
schema:
|
|
365
|
-
records:
|
|
366
|
-
views:
|
|
384
|
+
schema: ue,
|
|
385
|
+
records: Pe,
|
|
386
|
+
views: ce,
|
|
367
387
|
provider: l.provider,
|
|
368
388
|
defaultView: l.defaultView,
|
|
369
|
-
initialViewId: l.currentViewId || l.initialViewId || ((
|
|
389
|
+
initialViewId: l.currentViewId || l.initialViewId || ((ge = l.defaultView) == null ? void 0 : ge.viewId) || ((Ce = ce.value[0]) == null ? void 0 : Ce.viewId) || "",
|
|
370
390
|
initialSelectedRecordId: l.selectedRecordId ?? l.initialSelectedRecordId,
|
|
371
391
|
pageSize: l.pageSize,
|
|
372
392
|
autoLoad: l.autoLoad,
|
|
@@ -412,363 +432,488 @@ const Vt = {
|
|
|
412
432
|
d("refresh"), await ((t = (e = l.actions) == null ? void 0 : e.onRefresh) == null ? void 0 : t.call(e));
|
|
413
433
|
}
|
|
414
434
|
}
|
|
415
|
-
}),
|
|
416
|
-
l.currentViewId ===
|
|
435
|
+
}), b = n(() => s.activeView.value), z = n(() => s.activeViewId.value), h = n(() => s.selectedRecord.value), We = n(() => s.selectedRecordId.value), V = n(() => s.schema.value ?? ue.value), C = n(() => [...s.records.value]), m = n(() => b.value.viewType || "table"), f = B({}), D = B(l.searchKeyword ?? ""), j = B("and"), y = B([]), _ = B(
|
|
436
|
+
l.currentViewId === k || l.initialViewId === k || l.selectedRecordId != null || l.initialSelectedRecordId != null
|
|
417
437
|
);
|
|
418
|
-
|
|
438
|
+
F(
|
|
419
439
|
() => l.searchKeyword,
|
|
420
440
|
(e) => {
|
|
421
|
-
|
|
441
|
+
D.value = e ?? "";
|
|
422
442
|
},
|
|
423
443
|
{ immediate: !0 }
|
|
424
|
-
),
|
|
444
|
+
), F(D, (e) => {
|
|
425
445
|
d("update:searchKeyword", e);
|
|
426
|
-
}),
|
|
427
|
-
|
|
446
|
+
}), F(
|
|
447
|
+
b,
|
|
428
448
|
(e) => {
|
|
429
|
-
|
|
449
|
+
y.value = Ke(e.filters ?? []);
|
|
430
450
|
},
|
|
431
451
|
{ immediate: !0 }
|
|
432
|
-
),
|
|
452
|
+
), F(
|
|
433
453
|
() => l.currentViewId,
|
|
434
454
|
(e) => {
|
|
435
|
-
!e || e ===
|
|
455
|
+
!e || e === z.value || (s.setActiveViewId(e), e === k && (_.value = !0));
|
|
436
456
|
},
|
|
437
457
|
{ immediate: !0 }
|
|
438
|
-
),
|
|
458
|
+
), F(
|
|
439
459
|
() => l.selectedRecordId,
|
|
440
460
|
(e) => {
|
|
441
461
|
if (e !== void 0) {
|
|
442
462
|
if (!e) {
|
|
443
|
-
|
|
463
|
+
_.value = !1, f.value = {}, s.clearSelectedRecord();
|
|
444
464
|
return;
|
|
445
465
|
}
|
|
446
|
-
|
|
466
|
+
_.value = !0, f.value = {}, s.setSelectedRecord(e);
|
|
447
467
|
}
|
|
448
468
|
},
|
|
449
469
|
{ immediate: !0 }
|
|
450
|
-
),
|
|
451
|
-
|
|
470
|
+
), F(
|
|
471
|
+
z,
|
|
452
472
|
(e, t) => {
|
|
453
473
|
var a, i;
|
|
454
|
-
d("update:currentViewId", e), e ===
|
|
474
|
+
d("update:currentViewId", e), e === k && (_.value = !0), t !== void 0 && e !== t && ((i = (a = l.actions) == null ? void 0 : a.onViewChange) == null || i.call(a, { tableId: l.tableId, view: ne(b.value) }));
|
|
455
475
|
},
|
|
456
476
|
{ immediate: !0 }
|
|
457
|
-
),
|
|
458
|
-
|
|
477
|
+
), F(
|
|
478
|
+
We,
|
|
459
479
|
(e, t) => {
|
|
460
|
-
d("update:selectedRecordId", e), t !== void 0 && e !== t && d("select-record",
|
|
480
|
+
d("update:selectedRecordId", e), t !== void 0 && e !== t && d("select-record", h.value ?? null);
|
|
461
481
|
},
|
|
462
482
|
{ immediate: !0 }
|
|
463
483
|
);
|
|
464
|
-
const
|
|
484
|
+
const H = n(() => {
|
|
465
485
|
const e = l.viewTabs && l.viewTabs.length > 0 ? l.viewTabs.map((i) => ({ ...i })) : s.viewList.value.map((i) => ({
|
|
466
486
|
value: i.id,
|
|
467
487
|
label: i.name,
|
|
468
|
-
icon:
|
|
488
|
+
icon: se(i.type)
|
|
469
489
|
})), t = [], a = /* @__PURE__ */ new Set();
|
|
470
490
|
for (const i of e)
|
|
471
491
|
a.has(i.value) || (a.add(i.value), t.push(i));
|
|
472
|
-
return a.has(
|
|
473
|
-
}),
|
|
492
|
+
return a.has(k) || t.push({ value: k, label: "详情", icon: se("detail") }), t;
|
|
493
|
+
}), Oe = n(
|
|
474
494
|
() => s.viewList.value.map((e) => ({
|
|
475
495
|
id: e.id,
|
|
476
496
|
name: e.name
|
|
477
497
|
}))
|
|
478
|
-
),
|
|
498
|
+
), J = n(() => Be(b.value, V.value, C.value)), X = n(() => Ae(V.value, C.value)), K = n(() => Ne(V.value, C.value)), Y = n(() => Ge(h.value)), ve = n(() => ({
|
|
499
|
+
...Y.value,
|
|
500
|
+
...f.value
|
|
501
|
+
})), fe = n(
|
|
502
|
+
() => new Set(K.value.filter((e) => e.type === "richtext").map((e) => e.id))
|
|
503
|
+
), $e = n(
|
|
504
|
+
() => X.value.filter((e) => !fe.value.has(e.key))
|
|
505
|
+
), we = n(
|
|
506
|
+
() => X.value.filter((e) => fe.value.has(e.key))
|
|
507
|
+
), ze = n(() => Object.keys(f.value).length > 0), je = n(() => R(V.value, C.value)), me = n(() => {
|
|
479
508
|
var t;
|
|
480
|
-
const e = (t =
|
|
509
|
+
const e = (t = b.value.sorts) == null ? void 0 : t[0];
|
|
481
510
|
return {
|
|
482
511
|
field: (e == null ? void 0 : e.fieldId) ?? null,
|
|
483
512
|
order: (e == null ? void 0 : e.direction) ?? null
|
|
484
513
|
};
|
|
485
|
-
}),
|
|
514
|
+
}), He = n(() => {
|
|
486
515
|
var e, t;
|
|
487
|
-
return ((t = (e =
|
|
488
|
-
}),
|
|
489
|
-
let e = [...
|
|
490
|
-
if (
|
|
491
|
-
const a =
|
|
516
|
+
return ((t = (e = b.value.groups) == null ? void 0 : e[0]) == null ? void 0 : t.fieldId) ?? void 0;
|
|
517
|
+
}), q = n(() => y.value), Je = n(() => q.value.length > 0), Xe = n(() => l.showToolbar !== !1), Ye = n(() => l.showViewSwitch !== !1 && H.value.length > 1), Ze = n(() => l.showFilter !== !1), Qe = n(() => l.showSort !== !1), et = n(() => l.showGroup !== !1), tt = n(() => l.showColumns !== !1), at = n(() => l.showSearch !== !1), N = n(() => _.value && !!h.value), pe = n(() => l.detailPresentation !== "auto" ? l.detailPresentation : re.value ? "sheet" : "side-panel"), it = n(() => l.loading ?? s.loading.value), G = n(() => l.error ?? s.error.value), L = n(() => {
|
|
518
|
+
let e = [...C.value];
|
|
519
|
+
if (D.value.trim()) {
|
|
520
|
+
const a = D.value.trim().toLowerCase();
|
|
492
521
|
e = e.filter(
|
|
493
|
-
(i) =>
|
|
494
|
-
(
|
|
522
|
+
(i) => je.value.some(
|
|
523
|
+
(o) => U(i.fields[o]).toLowerCase().includes(a)
|
|
495
524
|
)
|
|
496
525
|
);
|
|
497
526
|
}
|
|
498
|
-
|
|
499
|
-
const i =
|
|
500
|
-
const
|
|
501
|
-
return
|
|
527
|
+
q.value.length > 0 && (e = e.filter((a) => {
|
|
528
|
+
const i = q.value.map((o) => {
|
|
529
|
+
const r = a.fields[o.field];
|
|
530
|
+
return xe(r, o);
|
|
502
531
|
});
|
|
503
|
-
return
|
|
532
|
+
return j.value === "and" ? i.every(Boolean) : i.some(Boolean);
|
|
504
533
|
}));
|
|
505
|
-
const t =
|
|
534
|
+
const t = me.value;
|
|
506
535
|
return t.field && t.order && e.sort((a, i) => {
|
|
507
|
-
const
|
|
536
|
+
const o = A(
|
|
508
537
|
a.fields[t.field],
|
|
509
538
|
i.fields[t.field]
|
|
510
539
|
);
|
|
511
|
-
return t.order === "desc" ? -
|
|
540
|
+
return t.order === "desc" ? -o : o;
|
|
512
541
|
}), e;
|
|
513
|
-
}),
|
|
514
|
-
() =>
|
|
515
|
-
startFieldId:
|
|
516
|
-
endFieldId:
|
|
542
|
+
}), lt = n(
|
|
543
|
+
() => zt(L.value, {
|
|
544
|
+
startFieldId: m.value === "timeline" ? "startDate" : void 0,
|
|
545
|
+
endFieldId: m.value === "timeline" ? "endDate" : void 0,
|
|
517
546
|
labelFieldId: "title"
|
|
518
547
|
})
|
|
519
|
-
),
|
|
548
|
+
), Z = n(() => it.value ? "loading" : G.value ? "error" : m.value === "detail" ? N.value ? "normal" : "empty" : m.value === "timeline" ? lt.value.length > 0 ? "normal" : "empty" : L.value.length > 0 ? "normal" : "empty"), ot = n(() => {
|
|
520
549
|
var a;
|
|
521
|
-
if (
|
|
522
|
-
const e =
|
|
550
|
+
if (m.value !== "detail") return;
|
|
551
|
+
const e = C.value[0];
|
|
523
552
|
if (e)
|
|
524
553
|
return {
|
|
525
554
|
label: "打开第一条记录",
|
|
526
|
-
onClick: () =>
|
|
555
|
+
onClick: () => M(e)
|
|
527
556
|
};
|
|
528
|
-
const t = ((a =
|
|
529
|
-
return
|
|
557
|
+
const t = ((a = H.value.find((i) => i.value !== k)) == null ? void 0 : a.value) ?? null;
|
|
558
|
+
return Me(t);
|
|
530
559
|
});
|
|
531
|
-
function
|
|
560
|
+
function Q(e) {
|
|
532
561
|
s.setRecords(e), d("update:records", e);
|
|
533
562
|
}
|
|
534
|
-
function
|
|
535
|
-
e && (
|
|
563
|
+
function M(e) {
|
|
564
|
+
e && (_.value = !0, f.value = {}, s.setSelectedRecord(e));
|
|
536
565
|
}
|
|
537
|
-
function
|
|
538
|
-
return e ?
|
|
566
|
+
function be(e) {
|
|
567
|
+
return e ? C.value.find((t) => t.id === e) ?? null : null;
|
|
539
568
|
}
|
|
540
|
-
function
|
|
541
|
-
s.viewList.value.some((t) => t.id === e) && (e ===
|
|
569
|
+
function he(e) {
|
|
570
|
+
s.viewList.value.some((t) => t.id === e) && (e === k && (_.value = !0), s.switchView(e));
|
|
542
571
|
}
|
|
543
|
-
function
|
|
544
|
-
|
|
572
|
+
function rt(e) {
|
|
573
|
+
he(e);
|
|
545
574
|
}
|
|
546
|
-
function
|
|
575
|
+
function nt(e) {
|
|
547
576
|
var t, a;
|
|
548
|
-
s.viewList.value.some((i) => i.id === e) && (e ===
|
|
577
|
+
s.viewList.value.some((i) => i.id === e) && (e === k && (_.value = !0), s.switchView(e), d("load-view", e), (a = (t = l.actions) == null ? void 0 : t.onViewLoad) == null || a.call(t, { tableId: l.tableId, viewId: e }));
|
|
549
578
|
}
|
|
550
|
-
function
|
|
579
|
+
function st(e) {
|
|
551
580
|
s.saveView({ name: e });
|
|
552
581
|
}
|
|
553
|
-
function
|
|
582
|
+
function P() {
|
|
554
583
|
s.updateActiveView({
|
|
555
|
-
filters:
|
|
584
|
+
filters: qe(y.value)
|
|
556
585
|
});
|
|
557
586
|
}
|
|
558
|
-
function
|
|
587
|
+
function dt() {
|
|
559
588
|
var t;
|
|
560
|
-
const e = ((t =
|
|
561
|
-
e && (
|
|
589
|
+
const e = ((t = J.value.find((a) => !a.hidden)) == null ? void 0 : t.key) ?? "";
|
|
590
|
+
e && (y.value = [...y.value, Ue(e)], P());
|
|
562
591
|
}
|
|
563
|
-
function
|
|
564
|
-
|
|
592
|
+
function ut(e) {
|
|
593
|
+
y.value = y.value.filter((t) => t.id !== e), P();
|
|
565
594
|
}
|
|
566
|
-
function
|
|
567
|
-
|
|
595
|
+
function ct(e, t) {
|
|
596
|
+
y.value = y.value.map(
|
|
568
597
|
(a) => a.id === e ? { ...a, ...t } : a
|
|
569
|
-
),
|
|
598
|
+
), P();
|
|
570
599
|
}
|
|
571
|
-
function
|
|
572
|
-
|
|
600
|
+
function vt() {
|
|
601
|
+
y.value = [], P();
|
|
573
602
|
}
|
|
574
|
-
function
|
|
575
|
-
|
|
603
|
+
function ft(e) {
|
|
604
|
+
j.value = e, d("update:filterLogic", e);
|
|
576
605
|
}
|
|
577
|
-
function
|
|
606
|
+
function wt(e) {
|
|
578
607
|
d("update:columns", e), s.updateActiveView({
|
|
579
608
|
visibleFields: e.filter((t) => !t.hidden).map((t) => t.key)
|
|
580
609
|
});
|
|
581
610
|
}
|
|
582
|
-
function
|
|
611
|
+
function mt(e) {
|
|
583
612
|
var i;
|
|
584
613
|
if (!e) {
|
|
585
614
|
s.updateActiveView({ sorts: [] }), d("sort", e);
|
|
586
615
|
return;
|
|
587
616
|
}
|
|
588
|
-
const t = (i =
|
|
617
|
+
const t = (i = b.value.sorts) == null ? void 0 : i[0], a = (t == null ? void 0 : t.fieldId) === e && t.direction === "asc" ? "desc" : "asc";
|
|
589
618
|
s.updateActiveView({
|
|
590
619
|
sorts: [{ fieldId: e, direction: a }]
|
|
591
620
|
}), d("sort", e);
|
|
592
621
|
}
|
|
593
|
-
function
|
|
622
|
+
function pt(e) {
|
|
594
623
|
s.updateActiveView({
|
|
595
624
|
groups: e ? [{ fieldId: e }] : []
|
|
596
625
|
}), d("group", e);
|
|
597
626
|
}
|
|
598
|
-
function
|
|
599
|
-
|
|
627
|
+
function bt(e) {
|
|
628
|
+
D.value = e, d("update:searchKeyword", e);
|
|
600
629
|
}
|
|
601
|
-
function
|
|
630
|
+
function E(e) {
|
|
602
631
|
s.emitSchemaEvent(e);
|
|
603
632
|
}
|
|
604
|
-
function
|
|
605
|
-
const i =
|
|
606
|
-
...
|
|
633
|
+
function ht(e, t, a) {
|
|
634
|
+
const i = C.value.map((o) => o.id !== e ? o : {
|
|
635
|
+
...o,
|
|
607
636
|
fields: {
|
|
608
|
-
...
|
|
637
|
+
...o.fields,
|
|
609
638
|
[t]: a
|
|
610
639
|
}
|
|
611
640
|
});
|
|
612
|
-
|
|
641
|
+
Q(i);
|
|
613
642
|
}
|
|
614
|
-
function
|
|
615
|
-
|
|
643
|
+
function ee(e) {
|
|
644
|
+
ht(e.rowId, e.fieldId, e.value), s.emitCellEdit(e);
|
|
616
645
|
}
|
|
617
|
-
function
|
|
646
|
+
function yt(e) {
|
|
618
647
|
var t, a;
|
|
619
648
|
d("record-change", e), (a = (t = l.actions) == null ? void 0 : t.onRecordChange) == null || a.call(t, { tableId: l.tableId, ...e });
|
|
620
649
|
}
|
|
621
|
-
function
|
|
622
|
-
|
|
650
|
+
function _t(e) {
|
|
651
|
+
Q(e);
|
|
623
652
|
}
|
|
624
|
-
function
|
|
625
|
-
|
|
653
|
+
function kt(e) {
|
|
654
|
+
M(e);
|
|
626
655
|
}
|
|
627
|
-
function
|
|
656
|
+
function gt(e) {
|
|
628
657
|
d("row-click", e);
|
|
629
658
|
}
|
|
630
|
-
function
|
|
631
|
-
d("card-click", e),
|
|
659
|
+
function ye(e) {
|
|
660
|
+
d("card-click", e), M(be(e.id));
|
|
661
|
+
}
|
|
662
|
+
function Ct(e) {
|
|
663
|
+
d("row-click", e), M(be(e.sourceRecordId ?? e.id));
|
|
664
|
+
}
|
|
665
|
+
function W() {
|
|
666
|
+
_.value = !1, f.value = {}, s.clearSelectedRecord();
|
|
667
|
+
}
|
|
668
|
+
function _e(e) {
|
|
669
|
+
for (const [t, a] of Object.entries(e.fields))
|
|
670
|
+
ee({ rowId: e.rowId, fieldId: t, value: a });
|
|
671
|
+
f.value = {}, W();
|
|
632
672
|
}
|
|
633
|
-
function
|
|
634
|
-
|
|
673
|
+
function ke(e) {
|
|
674
|
+
const t = C.value.filter((a) => a.id !== e);
|
|
675
|
+
Q(t), _.value = !1, f.value = {}, s.clearSelectedRecord();
|
|
635
676
|
}
|
|
636
|
-
function
|
|
637
|
-
|
|
677
|
+
function Vt(e) {
|
|
678
|
+
return K.value.find((t) => t.id === e) ?? {
|
|
679
|
+
id: e,
|
|
680
|
+
type: "text",
|
|
681
|
+
label: e
|
|
682
|
+
};
|
|
683
|
+
}
|
|
684
|
+
function te(e) {
|
|
685
|
+
return Object.prototype.hasOwnProperty.call(f.value, e) ? f.value[e] : Y.value[e];
|
|
686
|
+
}
|
|
687
|
+
function It(e) {
|
|
688
|
+
const t = te(e);
|
|
689
|
+
return typeof t != "string" || !t ? "" : Te(t);
|
|
638
690
|
}
|
|
639
|
-
function
|
|
640
|
-
|
|
641
|
-
|
|
691
|
+
function St(e, t, a) {
|
|
692
|
+
f.value = {
|
|
693
|
+
...f.value,
|
|
694
|
+
[t]: a
|
|
695
|
+
};
|
|
696
|
+
}
|
|
697
|
+
function Ft() {
|
|
698
|
+
h.value && _e({
|
|
699
|
+
rowId: h.value.id,
|
|
700
|
+
fields: { ...f.value }
|
|
701
|
+
});
|
|
642
702
|
}
|
|
643
703
|
return (e, t) => {
|
|
644
704
|
var a;
|
|
645
|
-
return
|
|
705
|
+
return c(), w("section", Lt({
|
|
646
706
|
class: "of-database-view",
|
|
647
707
|
"data-role": "database-view"
|
|
648
708
|
}, e.$attrs), [
|
|
649
|
-
|
|
650
|
-
|
|
709
|
+
Z.value === "loading" ? (c(), w("div", jt, [
|
|
710
|
+
ae(ie(Bt), {
|
|
651
711
|
class: "of-database-view__spinner",
|
|
652
712
|
size: 20
|
|
653
713
|
}),
|
|
654
|
-
t[
|
|
655
|
-
|
|
656
|
-
|
|
714
|
+
t[10] || (t[10] = u("div", { class: "of-database-view__state-text" }, [
|
|
715
|
+
u("div", { class: "of-database-view__state-title" }, "正在加载数据视图"),
|
|
716
|
+
u("div", { class: "of-database-view__state-description" }, "请稍候,页面级编排器正在准备当前视图。")
|
|
657
717
|
], -1))
|
|
658
|
-
])) :
|
|
659
|
-
|
|
660
|
-
icon:
|
|
718
|
+
])) : Z.value === "error" ? (c(), w("div", Ht, [
|
|
719
|
+
ae(Se, {
|
|
720
|
+
icon: ie(At),
|
|
661
721
|
title: "数据视图加载失败",
|
|
662
|
-
description:
|
|
722
|
+
description: G.value instanceof Error ? G.value.message : String(G.value)
|
|
663
723
|
}, null, 8, ["icon", "description"])
|
|
664
|
-
])) : (
|
|
665
|
-
|
|
724
|
+
])) : (c(), w(le, { key: 2 }, [
|
|
725
|
+
Xe.value ? (c(), S(qt, {
|
|
666
726
|
key: 0,
|
|
667
727
|
class: "of-database-view__toolbar",
|
|
668
|
-
"current-view":
|
|
669
|
-
"view-tabs":
|
|
670
|
-
columns:
|
|
671
|
-
"filter-conditions":
|
|
672
|
-
"filter-logic":
|
|
673
|
-
"filter-active":
|
|
674
|
-
"current-sort":
|
|
675
|
-
"current-group":
|
|
676
|
-
"search-keyword":
|
|
677
|
-
"show-view-switch":
|
|
678
|
-
"show-filter":
|
|
679
|
-
"show-sort":
|
|
680
|
-
"show-group":
|
|
681
|
-
"show-columns":
|
|
682
|
-
"show-search":
|
|
683
|
-
"saved-views":
|
|
684
|
-
"onUpdate:currentView":
|
|
685
|
-
"onUpdate:columns":
|
|
686
|
-
"onUpdate:searchKeyword":
|
|
687
|
-
onAddFilter:
|
|
688
|
-
onRemoveFilter:
|
|
689
|
-
onUpdateFilter:
|
|
690
|
-
onClearFilters:
|
|
691
|
-
"onUpdate:filterLogic":
|
|
692
|
-
onSort:
|
|
693
|
-
onGroup:
|
|
694
|
-
onSaveView:
|
|
695
|
-
onLoadView:
|
|
696
|
-
}, null, 8, ["current-view", "view-tabs", "columns", "filter-conditions", "filter-logic", "filter-active", "current-sort", "current-group", "search-keyword", "show-view-switch", "show-filter", "show-sort", "show-group", "show-columns", "show-search", "saved-views"])) :
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
icon:
|
|
728
|
+
"current-view": z.value,
|
|
729
|
+
"view-tabs": H.value,
|
|
730
|
+
columns: J.value,
|
|
731
|
+
"filter-conditions": q.value,
|
|
732
|
+
"filter-logic": j.value,
|
|
733
|
+
"filter-active": Je.value,
|
|
734
|
+
"current-sort": me.value,
|
|
735
|
+
"current-group": He.value,
|
|
736
|
+
"search-keyword": D.value,
|
|
737
|
+
"show-view-switch": Ye.value,
|
|
738
|
+
"show-filter": Ze.value,
|
|
739
|
+
"show-sort": Qe.value,
|
|
740
|
+
"show-group": et.value,
|
|
741
|
+
"show-columns": tt.value,
|
|
742
|
+
"show-search": at.value,
|
|
743
|
+
"saved-views": Oe.value,
|
|
744
|
+
"onUpdate:currentView": rt,
|
|
745
|
+
"onUpdate:columns": wt,
|
|
746
|
+
"onUpdate:searchKeyword": bt,
|
|
747
|
+
onAddFilter: dt,
|
|
748
|
+
onRemoveFilter: ut,
|
|
749
|
+
onUpdateFilter: ct,
|
|
750
|
+
onClearFilters: vt,
|
|
751
|
+
"onUpdate:filterLogic": ft,
|
|
752
|
+
onSort: mt,
|
|
753
|
+
onGroup: pt,
|
|
754
|
+
onSaveView: st,
|
|
755
|
+
onLoadView: nt
|
|
756
|
+
}, null, 8, ["current-view", "view-tabs", "columns", "filter-conditions", "filter-logic", "filter-active", "current-sort", "current-group", "search-keyword", "show-view-switch", "show-filter", "show-sort", "show-group", "show-columns", "show-search", "saved-views"])) : oe("", !0),
|
|
757
|
+
Z.value === "empty" ? (c(), w("div", Jt, [
|
|
758
|
+
ae(Se, {
|
|
759
|
+
icon: ie(Nt),
|
|
700
760
|
title: "暂无记录",
|
|
701
|
-
description:
|
|
702
|
-
action:
|
|
761
|
+
description: m.value === "detail" ? "请选择一条记录,详情工作区会在这里打开。" : m.value === "timeline" ? "当前时间线没有可渲染的起止日期。" : "当前视图没有匹配的数据,或者被筛选条件过滤为空。",
|
|
762
|
+
action: ot.value
|
|
703
763
|
}, null, 8, ["icon", "description", "action"])
|
|
704
|
-
])) : (
|
|
764
|
+
])) : (c(), w("div", {
|
|
705
765
|
key: 2,
|
|
706
766
|
class: "of-database-view__content",
|
|
707
|
-
"data-view":
|
|
767
|
+
"data-view": m.value
|
|
708
768
|
}, [
|
|
709
|
-
|
|
769
|
+
m.value === "table" ? (c(), S(Gt, {
|
|
710
770
|
key: 0,
|
|
711
771
|
class: "of-database-view__view of-database-view__view--table",
|
|
712
|
-
records:
|
|
713
|
-
schema:
|
|
714
|
-
view:
|
|
715
|
-
columns:
|
|
772
|
+
records: L.value,
|
|
773
|
+
schema: V.value ?? void 0,
|
|
774
|
+
view: b.value,
|
|
775
|
+
columns: J.value,
|
|
716
776
|
readonly: T.readonly,
|
|
717
777
|
"enable-field-management": ((a = T.ui) == null ? void 0 : a.enableFieldManagement) ?? !1,
|
|
718
|
-
onCellEdit:
|
|
719
|
-
onSchemaAddField: t[0] || (t[0] = (i) =>
|
|
720
|
-
onSchemaRenameField: t[1] || (t[1] = ({ fieldId: i, newName:
|
|
721
|
-
onSchemaChangeFieldType: t[2] || (t[2] = ({ fieldId: i, newType:
|
|
722
|
-
onSchemaHideField: t[3] || (t[3] = (i) =>
|
|
723
|
-
onSchemaDeleteField: t[4] || (t[4] = (i) =>
|
|
724
|
-
onSchemaDuplicateField: t[5] || (t[5] = (i) =>
|
|
725
|
-
onRowClick:
|
|
726
|
-
onRowClickRecord:
|
|
727
|
-
}, null, 8, ["records", "schema", "view", "columns", "readonly", "enable-field-management"])) :
|
|
778
|
+
onCellEdit: ee,
|
|
779
|
+
onSchemaAddField: t[0] || (t[0] = (i) => E({ type: "schema-add-field", fieldType: i })),
|
|
780
|
+
onSchemaRenameField: t[1] || (t[1] = ({ fieldId: i, newName: o }) => E({ type: "schema-rename-field", fieldId: i, newName: o })),
|
|
781
|
+
onSchemaChangeFieldType: t[2] || (t[2] = ({ fieldId: i, newType: o }) => E({ type: "schema-change-field-type", fieldId: i, newType: o })),
|
|
782
|
+
onSchemaHideField: t[3] || (t[3] = (i) => E({ type: "schema-hide-field", fieldId: i })),
|
|
783
|
+
onSchemaDeleteField: t[4] || (t[4] = (i) => E({ type: "schema-delete-field", fieldId: i })),
|
|
784
|
+
onSchemaDuplicateField: t[5] || (t[5] = (i) => E({ type: "schema-duplicate-field", fieldId: i })),
|
|
785
|
+
onRowClick: gt,
|
|
786
|
+
onRowClickRecord: kt
|
|
787
|
+
}, null, 8, ["records", "schema", "view", "columns", "readonly", "enable-field-management"])) : m.value === "kanban" ? (c(), S(Mt, {
|
|
728
788
|
key: 1,
|
|
729
789
|
class: "of-database-view__view of-database-view__view--kanban",
|
|
730
|
-
records:
|
|
731
|
-
schema:
|
|
732
|
-
view:
|
|
733
|
-
onCardClick:
|
|
790
|
+
records: L.value,
|
|
791
|
+
schema: V.value ?? void 0,
|
|
792
|
+
view: b.value,
|
|
793
|
+
onCardClick: ye,
|
|
734
794
|
"onUpdate:columns": t[6] || (t[6] = () => {
|
|
735
795
|
}),
|
|
736
796
|
onAddColumn: t[7] || (t[7] = () => d("add-column"))
|
|
737
|
-
}, null, 8, ["records", "schema", "view"])) :
|
|
797
|
+
}, null, 8, ["records", "schema", "view"])) : m.value === "gallery" ? (c(), S(Pt, {
|
|
738
798
|
key: 2,
|
|
739
799
|
class: "of-database-view__view of-database-view__view--gallery",
|
|
740
|
-
records:
|
|
741
|
-
schema:
|
|
742
|
-
view:
|
|
743
|
-
onCardClick:
|
|
800
|
+
records: L.value,
|
|
801
|
+
schema: V.value ?? void 0,
|
|
802
|
+
view: b.value,
|
|
803
|
+
onCardClick: ye,
|
|
744
804
|
onAdd: t[8] || (t[8] = () => d("add"))
|
|
745
|
-
}, null, 8, ["records", "schema", "view"])) :
|
|
805
|
+
}, null, 8, ["records", "schema", "view"])) : m.value === "timeline" ? (c(), S(Wt, {
|
|
746
806
|
key: 3,
|
|
747
807
|
class: "of-database-view__view of-database-view__view--timeline",
|
|
748
|
-
records:
|
|
749
|
-
schema:
|
|
750
|
-
"view-config":
|
|
751
|
-
onRowClick:
|
|
752
|
-
onRecordChange:
|
|
753
|
-
"onUpdate:records":
|
|
754
|
-
}, null, 8, ["records", "schema", "view-config"])) : (
|
|
755
|
-
], 8,
|
|
808
|
+
records: L.value,
|
|
809
|
+
schema: V.value ?? void 0,
|
|
810
|
+
"view-config": b.value,
|
|
811
|
+
onRowClick: Ct,
|
|
812
|
+
onRecordChange: yt,
|
|
813
|
+
"onUpdate:records": _t
|
|
814
|
+
}, null, 8, ["records", "schema", "view-config"])) : (c(), w("div", Yt))
|
|
815
|
+
], 8, Xt))
|
|
756
816
|
], 64)),
|
|
757
|
-
N(
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
817
|
+
N.value && pe.value === "side-panel" ? (c(), S(Kt, {
|
|
818
|
+
key: 3,
|
|
819
|
+
"model-value": N.value,
|
|
820
|
+
title: "记录详情",
|
|
821
|
+
width: 640,
|
|
822
|
+
mode: "persistent",
|
|
823
|
+
"onUpdate:modelValue": W
|
|
824
|
+
}, {
|
|
825
|
+
default: Et(() => {
|
|
826
|
+
var i, o, r, v, I;
|
|
827
|
+
return [
|
|
828
|
+
u("div", {
|
|
829
|
+
class: "of-database-view__detail-workspace",
|
|
830
|
+
"data-record-id": ((i = h.value) == null ? void 0 : i.id) ?? ""
|
|
831
|
+
}, [
|
|
832
|
+
u("div", Qt, [
|
|
833
|
+
u("div", ea, [
|
|
834
|
+
t[11] || (t[11] = u("div", { class: "of-database-view__detail-workspace-kicker" }, "右侧工作区", -1)),
|
|
835
|
+
u("h3", ta, x(((r = (o = h.value) == null ? void 0 : o.fields) == null ? void 0 : r.title) ?? ((v = h.value) == null ? void 0 : v.id) ?? "记录详情"), 1)
|
|
836
|
+
]),
|
|
837
|
+
u("div", aa, [
|
|
838
|
+
u("span", ia, x((I = h.value) == null ? void 0 : I.id), 1),
|
|
839
|
+
t[12] || (t[12] = u("span", { class: "of-database-view__detail-workspace-mode" }, "side-panel", -1))
|
|
840
|
+
])
|
|
841
|
+
]),
|
|
842
|
+
u("div", la, [
|
|
843
|
+
u("section", oa, [
|
|
844
|
+
(c(!0), w(le, null, Ie($e.value, (p) => (c(), w("div", {
|
|
845
|
+
key: p.key,
|
|
846
|
+
class: "of-database-view__detail-workspace-field"
|
|
847
|
+
}, [
|
|
848
|
+
u("span", ra, x(p.label), 1),
|
|
849
|
+
u("div", na, [
|
|
850
|
+
K.value.length > 0 ? (c(), S(xt, {
|
|
851
|
+
key: 0,
|
|
852
|
+
"row-id": ve.value.id,
|
|
853
|
+
field: Vt(p.key),
|
|
854
|
+
value: te(p.key),
|
|
855
|
+
readonly: T.readonly,
|
|
856
|
+
onCommit: St
|
|
857
|
+
}, null, 8, ["row-id", "field", "value", "readonly"])) : (c(), w("span", sa, x(te(p.key) ?? "—"), 1))
|
|
858
|
+
])
|
|
859
|
+
]))), 128))
|
|
860
|
+
]),
|
|
861
|
+
we.value.length > 0 ? (c(), w("section", da, [
|
|
862
|
+
(c(!0), w(le, null, Ie(we.value, (p) => (c(), w("div", {
|
|
863
|
+
key: p.key,
|
|
864
|
+
class: "of-database-view__detail-workspace-content-block"
|
|
865
|
+
}, [
|
|
866
|
+
u("span", ua, x(p.label), 1),
|
|
867
|
+
u("div", {
|
|
868
|
+
class: "of-database-view__detail-workspace-markdown of-markdown",
|
|
869
|
+
innerHTML: It(p.key)
|
|
870
|
+
}, null, 8, ca)
|
|
871
|
+
]))), 128))
|
|
872
|
+
])) : oe("", !0)
|
|
873
|
+
]),
|
|
874
|
+
u("div", va, [
|
|
875
|
+
u("button", {
|
|
876
|
+
class: "of-database-view__detail-workspace-btn of-database-view__detail-workspace-btn--delete",
|
|
877
|
+
type: "button",
|
|
878
|
+
onClick: t[9] || (t[9] = (p) => {
|
|
879
|
+
var Ve;
|
|
880
|
+
return ke(((Ve = h.value) == null ? void 0 : Ve.id) ?? ve.value.id);
|
|
881
|
+
})
|
|
882
|
+
}, " 删除 "),
|
|
883
|
+
t[13] || (t[13] = u("div", { class: "of-database-view__detail-workspace-footer-spacer" }, null, -1)),
|
|
884
|
+
u("button", {
|
|
885
|
+
class: "of-database-view__detail-workspace-btn of-database-view__detail-workspace-btn--cancel",
|
|
886
|
+
type: "button",
|
|
887
|
+
onClick: W
|
|
888
|
+
}, " 取消 "),
|
|
889
|
+
u("button", {
|
|
890
|
+
class: "of-database-view__detail-workspace-btn of-database-view__detail-workspace-btn--save",
|
|
891
|
+
type: "button",
|
|
892
|
+
disabled: T.readonly || !ze.value,
|
|
893
|
+
onClick: Ft
|
|
894
|
+
}, " 保存 ", 8, fa)
|
|
895
|
+
])
|
|
896
|
+
], 8, Zt)
|
|
897
|
+
];
|
|
898
|
+
}),
|
|
899
|
+
_: 1
|
|
900
|
+
}, 8, ["model-value"])) : N.value ? (c(), S(Ut, {
|
|
901
|
+
key: 4,
|
|
902
|
+
visible: N.value,
|
|
903
|
+
row: Y.value,
|
|
904
|
+
columns: X.value,
|
|
905
|
+
"field-defs": K.value,
|
|
906
|
+
"full-page": pe.value === "full-page",
|
|
763
907
|
readonly: T.readonly,
|
|
764
|
-
onClose:
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
908
|
+
onClose: W,
|
|
909
|
+
onSave: _e,
|
|
910
|
+
onDelete: ke,
|
|
911
|
+
onCellEdit: ee
|
|
912
|
+
}, null, 8, ["visible", "row", "columns", "field-defs", "full-page", "readonly"])) : oe("", !0)
|
|
768
913
|
], 16);
|
|
769
914
|
};
|
|
770
915
|
}
|
|
771
916
|
});
|
|
772
917
|
export {
|
|
773
|
-
|
|
918
|
+
Ra as default
|
|
774
919
|
};
|