@oneflowui/ui 0.6.0 → 0.7.0

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