@oneflowui/ui 0.5.7 → 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.
@@ -1,36 +1,47 @@
1
- import { defineComponent as ot, computed as n, ref as B, watch as y, openBlock as v, createElementBlock as g, mergeProps as nt, createVNode as N, unref as j, createElementVNode as H, Fragment as st, createBlock as k, createCommentVNode as dt } from "vue";
2
- import { Loader2 as ut, AlertCircle as ct, Database as vt } from "lucide-vue-next";
3
- import re from "../base/EmptyState.vue.js";
4
- import ft from "../table/DetailSheet.vue.js";
5
- import mt from "../table/TableToolbar.vue.js";
6
- import wt from "../table/DataTable.vue.js";
7
- import pt from "../kanban/KanbanBoard.vue.js";
8
- import ht from "../gallery/GalleryView.vue.js";
9
- import bt from "../timeline/GanttTimeline.vue.js";
10
- import { useDatabaseView as yt } from "../../composables/useDatabaseView.js";
11
- import { buildGanttItems as gt } from "../../types/index.js";
12
- const Vt = {
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
- }, _t = {
19
+ }, Ht = {
17
20
  key: 1,
18
21
  class: "of-database-view__state",
19
22
  "data-role": "error-state"
20
- }, It = {
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
- }, Ct = ["data-view"], Ft = {
27
+ }, Xt = ["data-view"], Yt = {
25
28
  key: 4,
26
29
  class: "of-database-view__detail-anchor"
27
- }, p = "detail", xt = /* @__PURE__ */ ot({
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: oe }) {
62
- var ie, le;
63
- const l = T, d = oe;
64
- function M(e) {
65
- var t, a, i, r;
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((o) => ({ ...o })),
70
- groups: (a = e.groups) == null ? void 0 : a.map((o) => ({ ...o })),
71
- filters: (i = e.filters) == null ? void 0 : i.map((o) => ({ ...o })),
72
- aggregations: (r = e.aggregations) == null ? void 0 : r.map((o) => ({ ...o })),
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 ne(e) {
97
+ function Re(e) {
78
98
  const t = e[0];
79
99
  return t ? Object.keys(t.fields) : [];
80
100
  }
81
- function O(e) {
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 se(e, t = []) {
97
- const a = V(e, t);
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 de(e, t = []) {
110
- const a = V(e, t);
129
+ function Le(e, t = []) {
130
+ const a = R(e, t);
111
131
  return {
112
- viewId: p,
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 U(e, t) {
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 P(e) {
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 ue(e) {
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 ce(e, t, a = []) {
186
- var r;
187
- return ((((r = e.visibleFields) == null ? void 0 : r.length) ?? 0) > 0 ? e.visibleFields : V(t, a)).map((o) => {
188
- var S;
189
- const u = (S = t == null ? void 0 : t.fields) == null ? void 0 : S.find((rt) => rt.id === o);
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: o,
192
- label: U(o, t),
193
- type: P(u),
194
- hidden: (u == null ? void 0 : u.hidden) ?? !1,
195
- width: u == null ? void 0 : u.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 ve(e, t = []) {
200
- return V(e, t).map((i) => {
201
- var o;
202
- const r = (o = e == null ? void 0 : e.fields) == null ? void 0 : o.find((u) => u.id === i);
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: U(i, e),
206
- type: P(r),
207
- hidden: (r == null ? void 0 : r.hidden) ?? !1,
208
- width: r == null ? void 0 : r.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 fe(e, t = []) {
213
- return V(e, t).map((i) => {
214
- var o;
215
- const r = (o = e == null ? void 0 : e.fields) == null ? void 0 : o.find((u) => u.id === i);
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: ue(r),
219
- label: U(i, e)
238
+ type: Ee(o),
239
+ label: $(i, e)
220
240
  };
221
241
  });
222
242
  }
223
- function R(e) {
243
+ function U(e) {
224
244
  return e == null ? "" : Array.isArray(e) ? e.map((t) => String(t)).join(", ") : String(e);
225
245
  }
226
- function F(e, t) {
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), r = Number.isFinite(a) && `${e}`.trim() !== "", o = Number.isFinite(i) && `${t}`.trim() !== "";
231
- if (r && o) return a - i;
232
- const u = Date.parse(String(e)), S = Date.parse(String(t));
233
- return Number.isFinite(u) && Number.isFinite(S) ? u - S : R(e).localeCompare(R(t), "zh-Hans-CN");
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 me(e, t) {
236
- const a = R(e).trim(), i = (t.value ?? "").trim(), r = a.toLowerCase(), o = i.toLowerCase();
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 r === o;
259
+ return o === r;
240
260
  case "not_equals":
241
- return r !== o;
261
+ return o !== r;
242
262
  case "contains":
243
- return r.includes(o);
263
+ return o.includes(r);
244
264
  case "not_contains":
245
- return !r.includes(o);
265
+ return !o.includes(r);
246
266
  case "starts_with":
247
- return r.startsWith(o);
267
+ return o.startsWith(r);
248
268
  case "ends_with":
249
- return r.endsWith(o);
269
+ return o.endsWith(r);
250
270
  case "gt":
251
- return F(e, i) > 0;
271
+ return A(e, i) > 0;
252
272
  case "gte":
253
- return F(e, i) >= 0;
273
+ return A(e, i) >= 0;
254
274
  case "lt":
255
- return F(e, i) < 0;
275
+ return A(e, i) < 0;
256
276
  case "lte":
257
- return F(e, i) <= 0;
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 we(e) {
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 pe(e = []) {
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 he(e) {
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 V(e, t = []) {
359
+ function R(e, t = []) {
340
360
  var i;
341
- const a = (i = e == null ? void 0 : e.fields) == null ? void 0 : i.filter((r) => !r.hidden).map((r) => r.id);
342
- return a != null && a.length ? a : ne(t);
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 be(e) {
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 ye(e) {
370
+ function Me(e) {
351
371
  if (e)
352
372
  return {
353
373
  label: "返回列表",
354
- onClick: () => ee(e)
374
+ onClick: () => he(e)
355
375
  };
356
376
  }
357
- const J = n(() => l.schema ?? null), ge = n(() => l.records ?? []), Q = n(() => {
358
- var i, r;
359
- const e = (l.views ?? []).map((o) => M(o)), t = e.some((o) => o.viewType === "table") || (((i = l.schema) == null ? void 0 : i.views) ?? []).some((o) => o.viewType === "table"), a = e.some((o) => o.viewType === "detail") || (((r = l.schema) == null ? void 0 : r.views) ?? []).some((o) => o.viewType === "detail");
360
- return t || e.unshift(se(l.schema, l.records ?? [])), a || e.push(de(l.schema, l.records ?? [])), e;
361
- }), s = yt({
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: J,
365
- records: ge,
366
- views: Q,
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 || ((ie = l.defaultView) == null ? void 0 : ie.viewId) || ((le = Q.value[0]) == null ? void 0 : le.viewId) || "",
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
- }), f = n(() => s.activeView.value), x = n(() => s.activeViewId.value), q = n(() => s.selectedRecord.value), Ve = n(() => s.selectedRecordId.value), b = n(() => s.schema.value ?? J.value), h = n(() => [...s.records.value]), c = n(() => f.value.viewType || "table"), _ = B(l.searchKeyword ?? ""), K = B("and"), m = B([]), w = B(
416
- l.currentViewId === p || l.initialViewId === p || l.selectedRecordId != null || l.initialSelectedRecordId != null
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
- y(
438
+ F(
419
439
  () => l.searchKeyword,
420
440
  (e) => {
421
- _.value = e ?? "";
441
+ D.value = e ?? "";
422
442
  },
423
443
  { immediate: !0 }
424
- ), y(_, (e) => {
444
+ ), F(D, (e) => {
425
445
  d("update:searchKeyword", e);
426
- }), y(
427
- f,
446
+ }), F(
447
+ b,
428
448
  (e) => {
429
- m.value = pe(e.filters ?? []);
449
+ y.value = Ke(e.filters ?? []);
430
450
  },
431
451
  { immediate: !0 }
432
- ), y(
452
+ ), F(
433
453
  () => l.currentViewId,
434
454
  (e) => {
435
- !e || e === x.value || (s.setActiveViewId(e), e === p && (w.value = !0));
455
+ !e || e === z.value || (s.setActiveViewId(e), e === k && (_.value = !0));
436
456
  },
437
457
  { immediate: !0 }
438
- ), y(
458
+ ), F(
439
459
  () => l.selectedRecordId,
440
460
  (e) => {
441
461
  if (e !== void 0) {
442
462
  if (!e) {
443
- w.value = !1, s.clearSelectedRecord();
463
+ _.value = !1, f.value = {}, s.clearSelectedRecord();
444
464
  return;
445
465
  }
446
- w.value = !0, s.setSelectedRecord(e);
466
+ _.value = !0, f.value = {}, s.setSelectedRecord(e);
447
467
  }
448
468
  },
449
469
  { immediate: !0 }
450
- ), y(
451
- x,
470
+ ), F(
471
+ z,
452
472
  (e, t) => {
453
473
  var a, i;
454
- d("update:currentViewId", e), e === p && (w.value = !0), t !== void 0 && e !== t && ((i = (a = l.actions) == null ? void 0 : a.onViewChange) == null || i.call(a, { tableId: l.tableId, view: M(f.value) }));
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
- ), y(
458
- Ve,
477
+ ), F(
478
+ We,
459
479
  (e, t) => {
460
- d("update:selectedRecordId", e), t !== void 0 && e !== t && d("select-record", q.value ?? null);
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 G = n(() => {
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: O(i.type)
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(p) || t.push({ value: p, label: "详情", icon: O("detail") }), t;
473
- }), _e = n(
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
- ), z = n(() => ce(f.value, b.value, h.value)), Ie = n(() => ve(b.value, h.value)), Ce = n(() => fe(b.value, h.value)), Fe = n(() => be(q.value)), Se = n(() => V(b.value, h.value)), X = n(() => {
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 = f.value.sorts) == null ? void 0 : t[0];
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
- }), ke = n(() => {
514
+ }), He = n(() => {
486
515
  var e, t;
487
- return ((t = (e = f.value.groups) == null ? void 0 : e[0]) == null ? void 0 : t.fieldId) ?? void 0;
488
- }), D = n(() => m.value), Te = n(() => D.value.length > 0), Re = n(() => l.showToolbar !== !1), De = n(() => l.showViewSwitch !== !1 && G.value.length > 1), Le = n(() => l.showFilter !== !1), Ee = n(() => l.showSort !== !1), Ae = n(() => l.showGroup !== !1), Be = n(() => l.showColumns !== !1), Ne = n(() => l.showSearch !== !1), Y = n(() => w.value && !!q.value), Ue = n(() => l.loading ?? s.loading.value), L = n(() => l.error ?? s.error.value), I = n(() => {
489
- let e = [...h.value];
490
- if (_.value.trim()) {
491
- const a = _.value.trim().toLowerCase();
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) => Se.value.some(
494
- (r) => R(i.fields[r]).toLowerCase().includes(a)
522
+ (i) => je.value.some(
523
+ (o) => U(i.fields[o]).toLowerCase().includes(a)
495
524
  )
496
525
  );
497
526
  }
498
- D.value.length > 0 && (e = e.filter((a) => {
499
- const i = D.value.map((r) => {
500
- const o = a.fields[r.field];
501
- return me(o, r);
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 K.value === "and" ? i.every(Boolean) : i.some(Boolean);
532
+ return j.value === "and" ? i.every(Boolean) : i.some(Boolean);
504
533
  }));
505
- const t = X.value;
534
+ const t = me.value;
506
535
  return t.field && t.order && e.sort((a, i) => {
507
- const r = F(
536
+ const o = A(
508
537
  a.fields[t.field],
509
538
  i.fields[t.field]
510
539
  );
511
- return t.order === "desc" ? -r : r;
540
+ return t.order === "desc" ? -o : o;
512
541
  }), e;
513
- }), xe = n(
514
- () => gt(I.value, {
515
- startFieldId: c.value === "timeline" ? "startDate" : void 0,
516
- endFieldId: c.value === "timeline" ? "endDate" : void 0,
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
- ), $ = n(() => Ue.value ? "loading" : L.value ? "error" : c.value === "detail" ? Y.value ? "normal" : "empty" : c.value === "timeline" ? xe.value.length > 0 ? "normal" : "empty" : I.value.length > 0 ? "normal" : "empty"), qe = n(() => {
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 (c.value !== "detail") return;
522
- const e = h.value[0];
550
+ if (m.value !== "detail") return;
551
+ const e = C.value[0];
523
552
  if (e)
524
553
  return {
525
554
  label: "打开第一条记录",
526
- onClick: () => E(e)
555
+ onClick: () => M(e)
527
556
  };
528
- const t = ((a = G.value.find((i) => i.value !== p)) == null ? void 0 : a.value) ?? null;
529
- return ye(t);
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 W(e) {
560
+ function Q(e) {
532
561
  s.setRecords(e), d("update:records", e);
533
562
  }
534
- function E(e) {
535
- e && (w.value = !0, s.setSelectedRecord(e));
563
+ function M(e) {
564
+ e && (_.value = !0, f.value = {}, s.setSelectedRecord(e));
536
565
  }
537
- function Z(e) {
538
- return e ? h.value.find((t) => t.id === e) ?? null : null;
566
+ function be(e) {
567
+ return e ? C.value.find((t) => t.id === e) ?? null : null;
539
568
  }
540
- function ee(e) {
541
- s.viewList.value.some((t) => t.id === e) && (e === p && (w.value = !0), s.switchView(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 Ke(e) {
544
- ee(e);
572
+ function rt(e) {
573
+ he(e);
545
574
  }
546
- function Ge(e) {
575
+ function nt(e) {
547
576
  var t, a;
548
- s.viewList.value.some((i) => i.id === e) && (e === p && (w.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 }));
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 ze(e) {
579
+ function st(e) {
551
580
  s.saveView({ name: e });
552
581
  }
553
- function A() {
582
+ function P() {
554
583
  s.updateActiveView({
555
- filters: he(m.value)
584
+ filters: qe(y.value)
556
585
  });
557
586
  }
558
- function $e() {
587
+ function dt() {
559
588
  var t;
560
- const e = ((t = z.value.find((a) => !a.hidden)) == null ? void 0 : t.key) ?? "";
561
- e && (m.value = [...m.value, we(e)], A());
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 We(e) {
564
- m.value = m.value.filter((t) => t.id !== e), A();
592
+ function ut(e) {
593
+ y.value = y.value.filter((t) => t.id !== e), P();
565
594
  }
566
- function je(e, t) {
567
- m.value = m.value.map(
595
+ function ct(e, t) {
596
+ y.value = y.value.map(
568
597
  (a) => a.id === e ? { ...a, ...t } : a
569
- ), A();
598
+ ), P();
570
599
  }
571
- function He() {
572
- m.value = [], A();
600
+ function vt() {
601
+ y.value = [], P();
573
602
  }
574
- function Me(e) {
575
- K.value = e, d("update:filterLogic", e);
603
+ function ft(e) {
604
+ j.value = e, d("update:filterLogic", e);
576
605
  }
577
- function Oe(e) {
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 Pe(e) {
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 = f.value.sorts) == null ? void 0 : i[0], a = (t == null ? void 0 : t.fieldId) === e && t.direction === "asc" ? "desc" : "asc";
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 Je(e) {
622
+ function pt(e) {
594
623
  s.updateActiveView({
595
624
  groups: e ? [{ fieldId: e }] : []
596
625
  }), d("group", e);
597
626
  }
598
- function Qe(e) {
599
- _.value = e, d("update:searchKeyword", e);
627
+ function bt(e) {
628
+ D.value = e, d("update:searchKeyword", e);
600
629
  }
601
- function C(e) {
630
+ function E(e) {
602
631
  s.emitSchemaEvent(e);
603
632
  }
604
- function Xe(e, t, a) {
605
- const i = h.value.map((r) => r.id !== e ? r : {
606
- ...r,
633
+ function ht(e, t, a) {
634
+ const i = C.value.map((o) => o.id !== e ? o : {
635
+ ...o,
607
636
  fields: {
608
- ...r.fields,
637
+ ...o.fields,
609
638
  [t]: a
610
639
  }
611
640
  });
612
- W(i);
641
+ Q(i);
613
642
  }
614
- function te(e) {
615
- Xe(e.rowId, e.fieldId, e.value), s.emitCellEdit(e);
643
+ function ee(e) {
644
+ ht(e.rowId, e.fieldId, e.value), s.emitCellEdit(e);
616
645
  }
617
- function Ye(e) {
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 Ze(e) {
622
- W(e);
650
+ function _t(e) {
651
+ Q(e);
623
652
  }
624
- function et(e) {
625
- E(e);
653
+ function kt(e) {
654
+ M(e);
626
655
  }
627
- function tt(e) {
656
+ function gt(e) {
628
657
  d("row-click", e);
629
658
  }
630
- function ae(e) {
631
- d("card-click", e), E(Z(e.id));
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 at(e) {
634
- d("row-click", e), E(Z(e.sourceRecordId ?? e.id));
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 it() {
637
- w.value = !1, s.clearSelectedRecord();
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 lt(e) {
640
- const t = h.value.filter((a) => a.id !== e);
641
- W(t), w.value = !1, s.clearSelectedRecord();
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 v(), g("section", nt({
705
+ return c(), w("section", Lt({
646
706
  class: "of-database-view",
647
707
  "data-role": "database-view"
648
708
  }, e.$attrs), [
649
- $.value === "loading" ? (v(), g("div", Vt, [
650
- N(j(ut), {
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[9] || (t[9] = H("div", { class: "of-database-view__state-text" }, [
655
- H("div", { class: "of-database-view__state-title" }, "正在加载数据视图"),
656
- H("div", { class: "of-database-view__state-description" }, "请稍候,页面级编排器正在准备当前视图。")
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
- ])) : $.value === "error" ? (v(), g("div", _t, [
659
- N(re, {
660
- icon: j(ct),
718
+ ])) : Z.value === "error" ? (c(), w("div", Ht, [
719
+ ae(Se, {
720
+ icon: ie(At),
661
721
  title: "数据视图加载失败",
662
- description: L.value instanceof Error ? L.value.message : String(L.value)
722
+ description: G.value instanceof Error ? G.value.message : String(G.value)
663
723
  }, null, 8, ["icon", "description"])
664
- ])) : (v(), g(st, { key: 2 }, [
665
- Re.value ? (v(), k(mt, {
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": x.value,
669
- "view-tabs": G.value,
670
- columns: z.value,
671
- "filter-conditions": D.value,
672
- "filter-logic": K.value,
673
- "filter-active": Te.value,
674
- "current-sort": X.value,
675
- "current-group": ke.value,
676
- "search-keyword": _.value,
677
- "show-view-switch": De.value,
678
- "show-filter": Le.value,
679
- "show-sort": Ee.value,
680
- "show-group": Ae.value,
681
- "show-columns": Be.value,
682
- "show-search": Ne.value,
683
- "saved-views": _e.value,
684
- "onUpdate:currentView": Ke,
685
- "onUpdate:columns": Oe,
686
- "onUpdate:searchKeyword": Qe,
687
- onAddFilter: $e,
688
- onRemoveFilter: We,
689
- onUpdateFilter: je,
690
- onClearFilters: He,
691
- "onUpdate:filterLogic": Me,
692
- onSort: Pe,
693
- onGroup: Je,
694
- onSaveView: ze,
695
- onLoadView: Ge
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"])) : dt("", !0),
697
- $.value === "empty" ? (v(), g("div", It, [
698
- N(re, {
699
- icon: j(vt),
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: c.value === "detail" ? "请选择一条记录,详情工作区会在这里打开。" : c.value === "timeline" ? "当前时间线没有可渲染的起止日期。" : "当前视图没有匹配的数据,或者被筛选条件过滤为空。",
702
- action: qe.value
761
+ description: m.value === "detail" ? "请选择一条记录,详情工作区会在这里打开。" : m.value === "timeline" ? "当前时间线没有可渲染的起止日期。" : "当前视图没有匹配的数据,或者被筛选条件过滤为空。",
762
+ action: ot.value
703
763
  }, null, 8, ["icon", "description", "action"])
704
- ])) : (v(), g("div", {
764
+ ])) : (c(), w("div", {
705
765
  key: 2,
706
766
  class: "of-database-view__content",
707
- "data-view": c.value
767
+ "data-view": m.value
708
768
  }, [
709
- c.value === "table" ? (v(), k(wt, {
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: I.value,
713
- schema: b.value ?? void 0,
714
- view: f.value,
715
- columns: z.value,
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: te,
719
- onSchemaAddField: t[0] || (t[0] = (i) => C({ type: "schema-add-field", fieldType: i })),
720
- onSchemaRenameField: t[1] || (t[1] = ({ fieldId: i, newName: r }) => C({ type: "schema-rename-field", fieldId: i, newName: r })),
721
- onSchemaChangeFieldType: t[2] || (t[2] = ({ fieldId: i, newType: r }) => C({ type: "schema-change-field-type", fieldId: i, newType: r })),
722
- onSchemaHideField: t[3] || (t[3] = (i) => C({ type: "schema-hide-field", fieldId: i })),
723
- onSchemaDeleteField: t[4] || (t[4] = (i) => C({ type: "schema-delete-field", fieldId: i })),
724
- onSchemaDuplicateField: t[5] || (t[5] = (i) => C({ type: "schema-duplicate-field", fieldId: i })),
725
- onRowClick: tt,
726
- onRowClickRecord: et
727
- }, null, 8, ["records", "schema", "view", "columns", "readonly", "enable-field-management"])) : c.value === "kanban" ? (v(), k(pt, {
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: I.value,
731
- schema: b.value ?? void 0,
732
- view: f.value,
733
- onCardClick: ae,
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"])) : c.value === "gallery" ? (v(), k(ht, {
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: I.value,
741
- schema: b.value ?? void 0,
742
- view: f.value,
743
- onCardClick: ae,
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"])) : c.value === "timeline" ? (v(), k(bt, {
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: I.value,
749
- schema: b.value ?? void 0,
750
- "view-config": f.value,
751
- onRowClick: at,
752
- onRecordChange: Ye,
753
- "onUpdate:records": Ze
754
- }, null, 8, ["records", "schema", "view-config"])) : (v(), g("div", Ft))
755
- ], 8, Ct))
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(ft, {
758
- visible: Y.value,
759
- row: Fe.value,
760
- columns: Ie.value,
761
- "field-defs": Ce.value,
762
- "full-page": c.value === "detail",
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: it,
765
- onDelete: lt,
766
- onCellEdit: te
767
- }, null, 8, ["visible", "row", "columns", "field-defs", "full-page", "readonly"])
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
- xt as default
918
+ Ra as default
774
919
  };