@oneflowui/ui 0.7.0 → 0.8.1

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