@oneflowui/ui 0.4.3 → 0.5.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.
Files changed (158) hide show
  1. package/README.en.md +1 -1
  2. package/README.md +70 -0
  3. package/dist/assets/tableWorker-CTsbCPPP.js +1 -0
  4. package/dist/components/ContextMenu/index.vue.d.ts +2 -1
  5. package/dist/components/ContextMenu/index.vue.js +2 -2
  6. package/dist/components/ContextMenu/index.vue2.js +37 -36
  7. package/dist/components/base/DropdownMenu.vue.js +2 -2
  8. package/dist/components/base/DropdownMenu.vue2.js +38 -39
  9. package/dist/components/base/MonitorItem.vue.d.ts +1 -1
  10. package/dist/components/base/PersonaCard.vue.d.ts +2 -1
  11. package/dist/components/base/PersonaCard.vue.js +3 -3
  12. package/dist/components/base/PersonaCard.vue2.js +51 -39
  13. package/dist/components/base/RefTag.vue.d.ts +2 -2
  14. package/dist/components/base/RefTag.vue.js +3 -3
  15. package/dist/components/base/SearchHighlight.vue.d.ts +6 -0
  16. package/dist/components/base/SearchHighlight.vue.js +7 -0
  17. package/dist/components/base/SearchHighlight.vue2.js +21 -0
  18. package/dist/components/base/ToolbarBtn.vue.d.ts +2 -1
  19. package/dist/components/base/ToolbarBtn.vue.js +1 -1
  20. package/dist/components/base/ViewModeGroup.vue.d.ts +2 -1
  21. package/dist/components/base/ViewModeGroup.vue.js +3 -3
  22. package/dist/components/base/ViewSwitcher.vue.d.ts +2 -1
  23. package/dist/components/base/ViewSwitcher.vue.js +2 -2
  24. package/dist/components/base/index.d.ts +1 -0
  25. package/dist/components/database/DatabaseView.vue.d.ts +171 -0
  26. package/dist/components/database/DatabaseView.vue.js +7 -0
  27. package/dist/components/database/DatabaseView.vue2.js +774 -0
  28. package/dist/components/database/index.d.ts +2 -0
  29. package/dist/components/field/FieldAttachment.vue.d.ts +17 -0
  30. package/dist/components/field/FieldAttachment.vue.js +7 -0
  31. package/dist/components/field/FieldAttachment.vue2.js +69 -0
  32. package/dist/components/field/FieldAutoNumber.vue.d.ts +7 -0
  33. package/dist/components/field/FieldAutoNumber.vue.js +7 -0
  34. package/dist/components/field/FieldAutoNumber.vue2.js +15 -0
  35. package/dist/components/field/FieldCreator.vue.d.ts +7 -0
  36. package/dist/components/field/FieldCreator.vue.js +7 -0
  37. package/dist/components/field/FieldCreator.vue2.js +24 -0
  38. package/dist/components/field/FieldCurrency.vue.d.ts +17 -0
  39. package/dist/components/field/FieldCurrency.vue.js +7 -0
  40. package/dist/components/field/FieldCurrency.vue2.js +42 -0
  41. package/dist/components/field/FieldDate.vue.js +2 -2
  42. package/dist/components/field/FieldDate.vue2.js +13 -10
  43. package/dist/components/field/FieldDatetime.vue.js +1 -1
  44. package/dist/components/field/FieldMarkdownPreview.vue.d.ts +13 -0
  45. package/dist/components/field/FieldMarkdownPreview.vue.js +7 -0
  46. package/dist/components/field/FieldMarkdownPreview.vue2.js +37 -0
  47. package/dist/components/field/FieldMultiSelect.vue.js +2 -2
  48. package/dist/components/field/FieldPhone.vue.d.ts +17 -0
  49. package/dist/components/field/FieldPhone.vue.js +7 -0
  50. package/dist/components/field/FieldPhone.vue2.js +34 -0
  51. package/dist/components/field/FieldProgress.vue.d.ts +15 -0
  52. package/dist/components/field/FieldProgress.vue.js +7 -0
  53. package/dist/components/field/FieldProgress.vue2.js +40 -0
  54. package/dist/components/field/FieldRelation.vue.d.ts +17 -0
  55. package/dist/components/field/FieldRelation.vue.js +7 -0
  56. package/dist/components/field/FieldRelation.vue2.js +67 -0
  57. package/dist/components/field/FieldRichText.vue.d.ts +17 -0
  58. package/dist/components/field/FieldRichText.vue.js +7 -0
  59. package/dist/components/field/FieldRichText.vue2.js +65 -0
  60. package/dist/components/field/FieldSelect.vue.js +1 -1
  61. package/dist/components/field/FieldSelect.vue2.js +43 -42
  62. package/dist/components/form/FormDesigner.vue.js +2 -2
  63. package/dist/components/form/FormDesigner.vue2.js +62 -52
  64. package/dist/components/gallery/GalleryCard.vue.js +2 -2
  65. package/dist/components/gallery/GalleryView.vue.d.ts +6 -2
  66. package/dist/components/gallery/GalleryView.vue.js +2 -2
  67. package/dist/components/gallery/GalleryView.vue2.js +30 -20
  68. package/dist/components/kanban/KanbanBoard.vue.d.ts +5 -1
  69. package/dist/components/kanban/KanbanBoard.vue.js +4 -4
  70. package/dist/components/kanban/KanbanBoard.vue2.js +81 -48
  71. package/dist/components/layout/AppLayout.vue.js +2 -2
  72. package/dist/components/layout/AppLayout.vue2.js +46 -62
  73. package/dist/components/overlay/Drawer.vue.js +1 -1
  74. package/dist/components/overlay/Drawer.vue2.js +52 -68
  75. package/dist/components/overlay/Modal.vue.js +1 -1
  76. package/dist/components/overlay/Modal.vue2.js +52 -68
  77. package/dist/components/overlay/SidePanel.vue.js +2 -2
  78. package/dist/components/overlay/SidePanel.vue2.js +64 -80
  79. package/dist/components/table/ColumnHeaderMenu.vue.d.ts +33 -0
  80. package/dist/components/table/ColumnHeaderMenu.vue.js +7 -0
  81. package/dist/components/table/ColumnHeaderMenu.vue2.js +153 -0
  82. package/dist/components/table/DataTable.vue.d.ts +116 -25
  83. package/dist/components/table/DataTable.vue.js +4 -4
  84. package/dist/components/table/DataTable.vue2.js +775 -188
  85. package/dist/components/table/DetailSheet.vue.d.ts +43 -0
  86. package/dist/components/table/DetailSheet.vue.js +7 -0
  87. package/dist/components/table/DetailSheet.vue2.js +140 -0
  88. package/dist/components/table/FieldCell.vue.d.ts +1 -1
  89. package/dist/components/table/FieldCell.vue.js +1 -1
  90. package/dist/components/table/FieldCell.vue2.js +59 -44
  91. package/dist/components/table/FieldTypePicker.vue.d.ts +15 -0
  92. package/dist/components/table/FieldTypePicker.vue.js +7 -0
  93. package/dist/components/table/FieldTypePicker.vue2.js +92 -0
  94. package/dist/components/table/MobileListView.vue.d.ts +24 -0
  95. package/dist/components/table/MobileListView.vue.js +7 -0
  96. package/dist/components/table/MobileListView.vue2.js +90 -0
  97. package/dist/components/table/TableGroupRow.vue.d.ts +5 -0
  98. package/dist/components/table/TableGroupRow.vue.js +2 -2
  99. package/dist/components/table/TableGroupRow.vue2.js +33 -23
  100. package/dist/components/table/TableHeaderRow.vue.d.ts +16 -0
  101. package/dist/components/table/TableHeaderRow.vue.js +2 -2
  102. package/dist/components/table/TableHeaderRow.vue2.js +54 -33
  103. package/dist/components/table/TableToolbar.vue.d.ts +118 -0
  104. package/dist/components/table/TableToolbar.vue.js +7 -0
  105. package/dist/components/table/TableToolbar.vue2.js +273 -0
  106. package/dist/components/table/index.d.ts +5 -0
  107. package/dist/components/timeline/GanttTimeline.vue.js +1 -1
  108. package/dist/components/timeline/GanttTimeline.vue2.js +128 -127
  109. package/dist/components/toast/ToastItem.vue.js +3 -3
  110. package/dist/composables/index.d.ts +21 -0
  111. package/dist/composables/useBreakpoint.d.ts +2 -1
  112. package/dist/composables/useBreakpoint.js +14 -12
  113. package/dist/composables/useColumnResize.d.ts +19 -0
  114. package/dist/composables/useColumnResize.js +58 -0
  115. package/dist/composables/useDatabaseView.d.ts +138 -0
  116. package/dist/composables/useDatabaseView.js +388 -0
  117. package/dist/composables/useDraftRows.d.ts +33 -0
  118. package/dist/composables/useDraftRows.js +103 -0
  119. package/dist/composables/useFixedColumns.d.ts +25 -0
  120. package/dist/composables/useFixedColumns.js +61 -0
  121. package/dist/composables/useFocusTrap.d.ts +10 -0
  122. package/dist/composables/useFocusTrap.js +37 -0
  123. package/dist/composables/useInlineEdit.js +3 -3
  124. package/dist/composables/useKeyboardNavigation.d.ts +45 -0
  125. package/dist/composables/useKeyboardNavigation.js +140 -0
  126. package/dist/composables/useRowDrag.d.ts +32 -0
  127. package/dist/composables/useRowDrag.js +85 -0
  128. package/dist/composables/useSchemaEngine.d.ts +31 -0
  129. package/dist/composables/useSchemaEngine.js +129 -0
  130. package/dist/composables/useSearch.d.ts +30 -0
  131. package/dist/composables/useSearch.js +59 -0
  132. package/dist/composables/useSupabaseProvider.d.ts +70 -0
  133. package/dist/composables/useSupabaseProvider.js +126 -0
  134. package/dist/composables/useTable.d.ts +3 -0
  135. package/dist/composables/useTable.js +103 -83
  136. package/dist/composables/useTableGroup.d.ts +14 -1
  137. package/dist/composables/useTableGroup.js +57 -33
  138. package/dist/composables/useViewPersistence.d.ts +98 -0
  139. package/dist/composables/useViewPersistence.js +141 -0
  140. package/dist/composables/useVirtualList.d.ts +4 -1
  141. package/dist/composables/useVirtualList.js +108 -85
  142. package/dist/composables/useWorkerSort.d.ts +14 -0
  143. package/dist/composables/useWorkerSort.js +61 -0
  144. package/dist/index.d.ts +32 -4
  145. package/dist/index.js +274 -221
  146. package/dist/style.css +1 -1
  147. package/dist/tests/database-view.integration.spec.d.ts +1 -0
  148. package/dist/types/index.d.ts +63 -2
  149. package/dist/types/index.js +23 -6
  150. package/dist/types/table-internal.d.ts +64 -0
  151. package/dist/utils/aggregation.d.ts +5 -0
  152. package/dist/utils/aggregation.js +38 -0
  153. package/dist/utils/supabaseAdapter.d.ts +48 -0
  154. package/dist/utils/supabaseAdapter.js +76 -0
  155. package/dist/utils/supabaseSchema.d.ts +81 -0
  156. package/dist/utils/supabaseSchema.js +202 -0
  157. package/dist/workers/tableWorker.d.ts +31 -0
  158. package/package.json +17 -17
@@ -0,0 +1,65 @@
1
+ import { defineComponent as p, ref as d, onMounted as b, nextTick as x, openBlock as y, createElementBlock as M, createElementVNode as n, withModifiers as r } from "vue";
2
+ const k = { class: "of-field-richtext" }, w = { class: "of-field-richtext-toolbar" }, T = /* @__PURE__ */ p({
3
+ __name: "FieldRichText",
4
+ props: {
5
+ value: { type: [String, Number, Boolean, Array, null] },
6
+ field: {}
7
+ },
8
+ emits: ["commit", "cancel", "tabNext"],
9
+ setup(a, { emit: c }) {
10
+ const s = a, l = c, o = d(null), i = d(typeof s.value == "string" ? s.value : "");
11
+ b(
12
+ () => x(() => {
13
+ o.value && (o.value.innerHTML = i.value, o.value.focus());
14
+ })
15
+ );
16
+ function m(t) {
17
+ var e;
18
+ t.key === "Escape" && (t.preventDefault(), l("cancel")), t.key === "Enter" && (t.ctrlKey || t.metaKey) && (t.preventDefault(), l("commit", ((e = o.value) == null ? void 0 : e.innerHTML) ?? i.value));
19
+ }
20
+ function v() {
21
+ var t;
22
+ l("commit", ((t = o.value) == null ? void 0 : t.innerHTML) ?? i.value);
23
+ }
24
+ function u(t) {
25
+ var e;
26
+ document.execCommand(t, !1), (e = o.value) == null || e.focus();
27
+ }
28
+ return (t, e) => (y(), M("div", k, [
29
+ n("div", w, [
30
+ n("button", {
31
+ type: "button",
32
+ class: "of-field-richtext-btn",
33
+ onMousedown: e[0] || (e[0] = r((f) => u("bold"), ["prevent"]))
34
+ }, [...e[3] || (e[3] = [
35
+ n("strong", null, "B", -1)
36
+ ])], 32),
37
+ n("button", {
38
+ type: "button",
39
+ class: "of-field-richtext-btn",
40
+ onMousedown: e[1] || (e[1] = r((f) => u("italic"), ["prevent"]))
41
+ }, [...e[4] || (e[4] = [
42
+ n("em", null, "I", -1)
43
+ ])], 32),
44
+ n("button", {
45
+ type: "button",
46
+ class: "of-field-richtext-btn",
47
+ onMousedown: e[2] || (e[2] = r((f) => u("underline"), ["prevent"]))
48
+ }, [...e[5] || (e[5] = [
49
+ n("u", null, "U", -1)
50
+ ])], 32)
51
+ ]),
52
+ n("div", {
53
+ ref_key: "editorRef",
54
+ ref: o,
55
+ class: "of-field-richtext-editor",
56
+ contenteditable: "true",
57
+ onKeydown: m,
58
+ onBlur: v
59
+ }, null, 544)
60
+ ]));
61
+ }
62
+ });
63
+ export {
64
+ T as default
65
+ };
@@ -1,7 +1,7 @@
1
1
  import o from "./FieldSelect.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../../_virtual/_plugin-vue_export-helper.js";
4
- const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-a280810a"]]);
4
+ const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-602f7b18"]]);
5
5
  export {
6
6
  m as default
7
7
  };
@@ -1,35 +1,36 @@
1
- import { defineComponent as R, ref as f, computed as x, onMounted as S, nextTick as V, onBeforeUnmount as z, watch as A, openBlock as l, createElementBlock as a, normalizeStyle as b, toDisplayString as y, createBlock as I, Teleport as T, createElementVNode as F, withModifiers as C, normalizeClass as L, Fragment as O, renderList as P, createCommentVNode as U } from "vue";
2
- const K = {
1
+ import { defineComponent as V, ref as f, computed as b, onMounted as z, nextTick as A, onBeforeUnmount as I, watch as T, openBlock as l, createElementBlock as a, normalizeStyle as x, toDisplayString as _, createBlock as F, Teleport as O, unref as B, normalizeClass as h, createElementVNode as P, withModifiers as L, Fragment as U, renderList as K, createCommentVNode as W } from "vue";
2
+ import { useBreakpoint as j } from "../../composables/useBreakpoint.js";
3
+ const q = {
3
4
  key: 1,
4
5
  class: "of-field-select__display"
5
- }, W = ["onMouseenter", "onClick"], j = { key: 1 }, G = /* @__PURE__ */ R({
6
+ }, G = ["onMouseenter", "onClick"], H = { key: 1 }, X = /* @__PURE__ */ V({
6
7
  __name: "FieldSelect",
7
8
  props: {
8
9
  value: { type: [String, Number, Boolean, Array, null] },
9
10
  field: {}
10
11
  },
11
12
  emits: ["commit", "cancel", "tabNext"],
12
- setup(M, { emit: B }) {
13
- const i = M, _ = B, s = f(null), h = f(null), E = f({ top: "0px", left: "0px", width: "0px" }), p = f(!0), r = x(() => i.field.options ?? []), c = x(() => {
13
+ setup($, { emit: N }) {
14
+ const { isMobile: E } = j(), i = $, y = N, s = f(null), D = f(null), C = f({ top: "0px", left: "0px", width: "0px" }), p = f(!0), r = b(() => i.field.options ?? []), c = b(() => {
14
15
  const e = typeof i.value == "string" ? i.value : null;
15
16
  return r.value.findIndex((t) => t.value === e);
16
17
  }), n = f(0);
17
- function v() {
18
+ function d() {
18
19
  if (!s.value) return;
19
20
  const e = s.value.getBoundingClientRect();
20
- E.value = {
21
+ C.value = {
21
22
  top: `${e.bottom}px`,
22
23
  left: `${e.left}px`,
23
24
  width: `${Math.max(e.width, 160)}px`
24
25
  };
25
26
  }
26
27
  function m(e) {
27
- p.value = !1, _("commit", e);
28
+ p.value = !1, y("commit", e);
28
29
  }
29
30
  function k() {
30
- p.value && (p.value = !1, _("cancel"));
31
+ p.value && (p.value = !1, y("cancel"));
31
32
  }
32
- function $(e) {
33
+ function R(e) {
33
34
  var t, o;
34
35
  if (!r.value.length) {
35
36
  e.key === "Escape" && (e.preventDefault(), k());
@@ -51,71 +52,71 @@ const K = {
51
52
  e.preventDefault(), k();
52
53
  return;
53
54
  }
54
- e.key === "Tab" && (e.preventDefault(), m(((o = r.value[n.value]) == null ? void 0 : o.value) ?? null), _("tabNext"));
55
+ e.key === "Tab" && (e.preventDefault(), m(((o = r.value[n.value]) == null ? void 0 : o.value) ?? null), y("tabNext"));
55
56
  }
56
- function D(e) {
57
- var o, d;
57
+ function M(e) {
58
+ var o, v;
58
59
  const t = e.target;
59
- t && ((o = s.value) != null && o.contains(t) || (d = h.value) != null && d.contains(t) || k());
60
+ t && ((o = s.value) != null && o.contains(t) || (v = D.value) != null && v.contains(t) || k());
60
61
  }
61
- S(() => {
62
- n.value = c.value >= 0 ? c.value : 0, V(() => {
62
+ z(() => {
63
+ n.value = c.value >= 0 ? c.value : 0, A(() => {
63
64
  var e;
64
- v(), (e = s.value) == null || e.focus();
65
- }), window.addEventListener("resize", v), window.addEventListener("scroll", v, !0), window.addEventListener("mousedown", D, !0);
66
- }), z(() => {
67
- window.removeEventListener("resize", v), window.removeEventListener("scroll", v, !0), window.removeEventListener("mousedown", D, !0);
68
- }), A(c, (e) => {
65
+ d(), (e = s.value) == null || e.focus();
66
+ }), window.addEventListener("resize", d), window.addEventListener("scroll", d, !0), window.addEventListener("mousedown", M, !0);
67
+ }), I(() => {
68
+ window.removeEventListener("resize", d), window.removeEventListener("scroll", d, !0), window.removeEventListener("mousedown", M, !0);
69
+ }), T(c, (e) => {
69
70
  e >= 0 && (n.value = e);
70
71
  });
71
- const w = x(() => {
72
+ const w = b(() => {
72
73
  const e = typeof i.value == "string" ? i.value : null;
73
74
  return r.value.find((t) => t.value === e);
74
75
  });
75
76
  return (e, t) => {
76
- var o, d;
77
+ var o, v;
77
78
  return l(), a("div", {
78
79
  ref_key: "triggerRef",
79
80
  ref: s,
80
81
  class: "of-field-select",
81
82
  tabindex: "0",
82
- onKeydown: $
83
+ onKeydown: R
83
84
  }, [
84
85
  (o = w.value) != null && o.color ? (l(), a("span", {
85
86
  key: 0,
86
87
  class: "of-field-select__badge",
87
- style: b({ background: w.value.color })
88
- }, y(w.value.label), 5)) : (l(), a("span", K, y(((d = w.value) == null ? void 0 : d.label) ?? "—"), 1)),
89
- (l(), I(T, { to: "body" }, [
88
+ style: x({ background: w.value.color })
89
+ }, _(w.value.label), 5)) : (l(), a("span", q, _(((v = w.value) == null ? void 0 : v.label) ?? "—"), 1)),
90
+ (l(), F(O, { to: "body" }, [
90
91
  p.value ? (l(), a("div", {
91
92
  key: 0,
92
93
  ref_key: "dropdownRef",
93
- ref: h,
94
- class: "of-field-select__dropdown",
95
- style: b(E.value)
94
+ ref: D,
95
+ class: h(["of-field-select__dropdown", { "of-field-select__dropdown--sheet": B(E) }]),
96
+ style: x(B(E) ? {} : C.value)
96
97
  }, [
97
- F("div", {
98
- class: L(["of-field-select__option of-field-select__option--clear", { active: n.value === -1, selected: c.value === -1 }]),
99
- onClick: t[0] || (t[0] = C((u) => m(null), ["stop"]))
98
+ P("div", {
99
+ class: h(["of-field-select__option of-field-select__option--clear", { active: n.value === -1, selected: c.value === -1 }]),
100
+ onClick: t[0] || (t[0] = L((u) => m(null), ["stop"]))
100
101
  }, " — ", 2),
101
- (l(!0), a(O, null, P(r.value, (u, g) => (l(), a("div", {
102
+ (l(!0), a(U, null, K(r.value, (u, g) => (l(), a("div", {
102
103
  key: u.value,
103
- class: L(["of-field-select__option", { active: g === n.value, selected: g === c.value }]),
104
- onMouseenter: (N) => n.value = g,
105
- onClick: C((N) => m(u.value), ["stop"])
104
+ class: h(["of-field-select__option", { active: g === n.value, selected: g === c.value }]),
105
+ onMouseenter: (S) => n.value = g,
106
+ onClick: L((S) => m(u.value), ["stop"])
106
107
  }, [
107
108
  u.color ? (l(), a("span", {
108
109
  key: 0,
109
110
  class: "of-field-select__badge",
110
- style: b({ background: u.color })
111
- }, y(u.label), 5)) : (l(), a("span", j, y(u.label), 1))
112
- ], 42, W))), 128))
113
- ], 4)) : U("", !0)
111
+ style: x({ background: u.color })
112
+ }, _(u.label), 5)) : (l(), a("span", H, _(u.label), 1))
113
+ ], 42, G))), 128))
114
+ ], 6)) : W("", !0)
114
115
  ]))
115
116
  ], 544);
116
117
  };
117
118
  }
118
119
  });
119
120
  export {
120
- G as default
121
+ X as default
121
122
  };
@@ -1,7 +1,7 @@
1
1
  import o from "./FormDesigner.vue2.js";
2
2
  /* empty css */
3
3
  import r from "../../_virtual/_plugin-vue_export-helper.js";
4
- const e = /* @__PURE__ */ r(o, [["__scopeId", "data-v-7937cb8c"]]);
4
+ const p = /* @__PURE__ */ r(o, [["__scopeId", "data-v-85067929"]]);
5
5
  export {
6
- e as default
6
+ p as default
7
7
  };
@@ -1,11 +1,11 @@
1
- import { defineComponent as z, ref as T, watch as L, computed as P, openBlock as i, createElementBlock as d, createElementVNode as t, toDisplayString as c, createVNode as m, unref as f, createTextVNode as _, createCommentVNode as b, withCtx as $, Fragment as C, renderList as x, normalizeClass as j } from "vue";
1
+ import { defineComponent as z, ref as T, watch as L, computed as P, openBlock as i, createElementBlock as u, createElementVNode as a, toDisplayString as c, createVNode as m, unref as f, createTextVNode as _, createCommentVNode as b, withCtx as $, Fragment as C, renderList as x, normalizeClass as j } from "vue";
2
2
  import { Plus as G, GripVertical as U, Trash2 as Y } from "lucide-vue-next";
3
3
  import { VueDraggable as A } from "vue-draggable-plus";
4
4
  import { isSelectField as h } from "../../types/index.js";
5
- const H = { class: "of-form-designer" }, J = { class: "of-form-designer__header" }, K = { class: "of-form-designer__title" }, M = { class: "of-form-designer__meta" }, Q = { class: "of-form-designer__inputs" }, R = ["value", "disabled", "onInput"], W = ["value", "disabled", "onChange"], X = ["value"], Z = { class: "of-form-designer__checkbox-label" }, ee = ["checked", "disabled", "onChange"], ne = { class: "of-form-designer__checkbox-label" }, le = ["checked", "disabled", "onChange"], ae = ["onClick"], te = {
5
+ const H = { class: "of-form-designer" }, J = { class: "of-form-designer__header" }, K = { class: "of-form-designer__title" }, M = { class: "of-form-designer__meta" }, Q = { class: "of-form-designer__inputs" }, R = ["value", "disabled", "onInput"], W = ["value", "disabled", "onChange"], X = ["value"], Z = { class: "of-form-designer__checkbox-label" }, ee = ["checked", "disabled", "onChange"], ne = { class: "of-form-designer__checkbox-label" }, le = ["checked", "disabled", "onChange"], te = ["onClick"], ae = {
6
6
  key: 1,
7
7
  class: "of-form-designer__options-wrap"
8
- }, oe = ["value", "disabled", "onChange"], ue = /* @__PURE__ */ z({
8
+ }, oe = ["value", "disabled", "onChange"], de = /* @__PURE__ */ z({
9
9
  __name: "FormDesigner",
10
10
  props: {
11
11
  schema: {},
@@ -13,8 +13,8 @@ const H = { class: "of-form-designer" }, J = { class: "of-form-designer__header"
13
13
  readonly: { type: Boolean, default: !1 }
14
14
  },
15
15
  emits: ["update:schema", "change"],
16
- setup(r, { emit: y }) {
17
- const F = [
16
+ setup(r, { emit: F }) {
17
+ const S = [
18
18
  { value: "text", label: "文本" },
19
19
  { value: "number", label: "数字" },
20
20
  { value: "select", label: "单选" },
@@ -30,23 +30,23 @@ const H = { class: "of-form-designer" }, J = { class: "of-form-designer__header"
30
30
  { value: "attachment", label: "附件" },
31
31
  { value: "relation", label: "关联" },
32
32
  { value: "formula", label: "公式" }
33
- ], u = r, p = y, o = T(v(u.schema));
33
+ ], d = r, p = F, o = T(v(d.schema));
34
34
  L(
35
- () => u.schema,
35
+ () => d.schema,
36
36
  (e) => {
37
37
  o.value = v(e);
38
38
  },
39
39
  { deep: !0 }
40
40
  );
41
- const S = P(() => `${o.value.fields.length} 个字段`);
41
+ const w = P(() => `${o.value.fields.length} 个字段`);
42
42
  function v(e) {
43
43
  return {
44
44
  ...e,
45
- fields: e.fields.map(w),
45
+ fields: e.fields.map(y),
46
46
  views: e.views.map((n) => ({ ...n }))
47
47
  };
48
48
  }
49
- function w(e) {
49
+ function y(e) {
50
50
  return h(e) ? {
51
51
  ...e,
52
52
  options: e.options.map((n) => ({ ...n }))
@@ -96,6 +96,16 @@ const H = { class: "of-form-designer" }, J = { class: "of-form-designer__header"
96
96
  return { ...n, type: e };
97
97
  case "formula":
98
98
  return { ...n, type: e, formula: "" };
99
+ case "currency":
100
+ return { ...n, type: e };
101
+ case "richtext":
102
+ return { ...n, type: e };
103
+ case "auto_number":
104
+ return { ...n, type: e };
105
+ case "creator":
106
+ return { ...n, type: e };
107
+ case "progress":
108
+ return { ...n, type: e };
99
109
  }
100
110
  }
101
111
  function D() {
@@ -105,14 +115,14 @@ const H = { class: "of-form-designer" }, J = { class: "of-form-designer__header"
105
115
  ];
106
116
  }
107
117
  function B() {
108
- u.readonly || (o.value.fields.push(V()), s());
118
+ d.readonly || (o.value.fields.push(V()), s());
109
119
  }
110
120
  function E(e) {
111
- u.readonly || (o.value.fields = o.value.fields.filter((n) => n.id !== e), s());
121
+ d.readonly || (o.value.fields = o.value.fields.filter((n) => n.id !== e), s());
112
122
  }
113
123
  function q(e, n) {
114
- const a = o.value.fields.findIndex((g) => g.id === e.id);
115
- if (a === -1) return;
124
+ const t = o.value.fields.findIndex((g) => g.id === e.id);
125
+ if (t === -1) return;
116
126
  const l = {
117
127
  id: e.id,
118
128
  name: e.name,
@@ -120,7 +130,7 @@ const H = { class: "of-form-designer" }, J = { class: "of-form-designer__header"
120
130
  hidden: e.hidden,
121
131
  width: e.width
122
132
  };
123
- o.value.fields[a] = h(e) && (n === "select" || n === "multi_select") ? {
133
+ o.value.fields[t] = h(e) && (n === "select" || n === "multi_select") ? {
124
134
  ...l,
125
135
  type: n,
126
136
  options: e.options.map(
@@ -130,8 +140,8 @@ const H = { class: "of-form-designer" }, J = { class: "of-form-designer__header"
130
140
  }
131
141
  function I(e, n) {
132
142
  if (!h(e)) return;
133
- const a = n.split(",").map((l) => l.trim()).filter(Boolean);
134
- e.options = a.map((l) => ({ value: l, label: l })), s();
143
+ const t = n.split(",").map((l) => l.trim()).filter(Boolean);
144
+ e.options = t.map((l) => ({ value: l, label: l })), s();
135
145
  }
136
146
  function N(e) {
137
147
  return h(e) ? e.options.map((n) => n.label).join(", ") : "";
@@ -139,13 +149,13 @@ const H = { class: "of-form-designer" }, J = { class: "of-form-designer__header"
139
149
  function O() {
140
150
  s();
141
151
  }
142
- return (e, n) => (i(), d("div", H, [
143
- t("div", J, [
144
- t("div", null, [
145
- t("h3", K, c(r.title), 1),
146
- t("p", M, c(o.value.name) + " · " + c(S.value), 1)
152
+ return (e, n) => (i(), u("div", H, [
153
+ a("div", J, [
154
+ a("div", null, [
155
+ a("h3", K, c(r.title), 1),
156
+ a("p", M, c(o.value.name) + " · " + c(w.value), 1)
147
157
  ]),
148
- r.readonly ? b("", !0) : (i(), d("button", {
158
+ r.readonly ? b("", !0) : (i(), u("button", {
149
159
  key: 0,
150
160
  class: "of-form-designer__add-btn",
151
161
  onClick: B
@@ -156,81 +166,81 @@ const H = { class: "of-form-designer" }, J = { class: "of-form-designer__header"
156
166
  ]),
157
167
  m(f(A), {
158
168
  modelValue: o.value.fields,
159
- "onUpdate:modelValue": n[0] || (n[0] = (a) => o.value.fields = a),
169
+ "onUpdate:modelValue": n[0] || (n[0] = (t) => o.value.fields = t),
160
170
  handle: ".of-form-designer__drag",
161
171
  disabled: r.readonly,
162
172
  animation: 150,
163
173
  onEnd: O
164
174
  }, {
165
175
  default: $(() => [
166
- (i(!0), d(C, null, x(o.value.fields, (a) => (i(), d("div", {
167
- key: a.id,
176
+ (i(!0), u(C, null, x(o.value.fields, (t) => (i(), u("div", {
177
+ key: t.id,
168
178
  class: "of-form-designer__row"
169
179
  }, [
170
- t("span", {
180
+ a("span", {
171
181
  class: j(["of-form-designer__drag", { disabled: r.readonly }])
172
182
  }, [
173
183
  m(f(U), { size: 14 })
174
184
  ], 2),
175
- t("div", Q, [
176
- t("input", {
177
- value: a.name,
185
+ a("div", Q, [
186
+ a("input", {
187
+ value: t.name,
178
188
  class: "of-form-designer__input",
179
189
  placeholder: "字段名称",
180
190
  disabled: r.readonly,
181
191
  onInput: (l) => {
182
- a.name = String(l.target.value), s();
192
+ t.name = String(l.target.value), s();
183
193
  }
184
194
  }, null, 40, R),
185
- t("select", {
195
+ a("select", {
186
196
  class: "of-form-designer__select",
187
- value: a.type,
197
+ value: t.type,
188
198
  disabled: r.readonly,
189
- onChange: (l) => q(a, l.target.value)
199
+ onChange: (l) => q(t, l.target.value)
190
200
  }, [
191
- (i(), d(C, null, x(F, (l) => t("option", {
201
+ (i(), u(C, null, x(S, (l) => a("option", {
192
202
  key: l.value,
193
203
  value: l.value
194
204
  }, c(l.label), 9, X)), 64))
195
205
  ], 40, W),
196
- t("label", Z, [
197
- t("input", {
206
+ a("label", Z, [
207
+ a("input", {
198
208
  type: "checkbox",
199
- checked: !!a.required,
209
+ checked: !!t.required,
200
210
  disabled: r.readonly,
201
211
  onChange: (l) => {
202
- a.required = l.target.checked, s();
212
+ t.required = l.target.checked, s();
203
213
  }
204
214
  }, null, 40, ee),
205
215
  n[2] || (n[2] = _(" 必填 ", -1))
206
216
  ]),
207
- t("label", ne, [
208
- t("input", {
217
+ a("label", ne, [
218
+ a("input", {
209
219
  type: "checkbox",
210
- checked: !!a.hidden,
220
+ checked: !!t.hidden,
211
221
  disabled: r.readonly,
212
222
  onChange: (l) => {
213
- a.hidden = l.target.checked, s();
223
+ t.hidden = l.target.checked, s();
214
224
  }
215
225
  }, null, 40, le),
216
226
  n[3] || (n[3] = _(" 隐藏 ", -1))
217
227
  ])
218
228
  ]),
219
- r.readonly ? b("", !0) : (i(), d("button", {
229
+ r.readonly ? b("", !0) : (i(), u("button", {
220
230
  key: 0,
221
231
  class: "of-form-designer__remove-btn",
222
- onClick: (l) => E(a.id)
232
+ onClick: (l) => E(t.id)
223
233
  }, [
224
234
  m(f(Y), { size: 14 })
225
- ], 8, ae)),
226
- a.type === "select" || a.type === "multi_select" ? (i(), d("div", te, [
227
- n[4] || (n[4] = t("label", { class: "of-form-designer__options-label" }, "选项(逗号分隔)", -1)),
228
- t("input", {
229
- value: N(a),
235
+ ], 8, te)),
236
+ t.type === "select" || t.type === "multi_select" ? (i(), u("div", ae, [
237
+ n[4] || (n[4] = a("label", { class: "of-form-designer__options-label" }, "选项(逗号分隔)", -1)),
238
+ a("input", {
239
+ value: N(t),
230
240
  class: "of-form-designer__input",
231
241
  placeholder: "例如:待办, 进行中, 完成",
232
242
  disabled: r.readonly,
233
- onChange: (l) => I(a, String(l.target.value))
243
+ onChange: (l) => I(t, String(l.target.value))
234
244
  }, null, 40, oe)
235
245
  ])) : b("", !0)
236
246
  ]))), 128))
@@ -241,5 +251,5 @@ const H = { class: "of-form-designer" }, J = { class: "of-form-designer__header"
241
251
  }
242
252
  });
243
253
  export {
244
- ue as default
254
+ de as default
245
255
  };
@@ -1,7 +1,7 @@
1
1
  import o from "./GalleryCard.vue2.js";
2
2
  /* empty css */
3
3
  import r from "../../_virtual/_plugin-vue_export-helper.js";
4
- const p = /* @__PURE__ */ r(o, [["__scopeId", "data-v-4b208b49"]]);
4
+ const m = /* @__PURE__ */ r(o, [["__scopeId", "data-v-38d1e761"]]);
5
5
  export {
6
- p as default
6
+ m as default
7
7
  };
@@ -1,7 +1,9 @@
1
- import { DataRecord, GalleryItem } from '../../types';
1
+ import { DataRecord, GalleryItem, TableSchema, ViewConfig } from '../../types';
2
2
  type __VLS_Props = {
3
3
  items?: GalleryItem[];
4
4
  records?: DataRecord[];
5
+ schema?: TableSchema;
6
+ view?: ViewConfig;
5
7
  coverFieldId?: string;
6
8
  cardFieldIds?: string[];
7
9
  columns?: number;
@@ -15,9 +17,11 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
15
17
  "onCard-click"?: ((item: GalleryItem) => any) | undefined;
16
18
  }>, {
17
19
  items: GalleryItem[];
20
+ view: ViewConfig;
18
21
  columns: number;
19
- records: DataRecord[];
20
22
  addable: boolean;
23
+ records: DataRecord[];
24
+ schema: TableSchema;
21
25
  coverFieldId: string;
22
26
  cardFieldIds: string[];
23
27
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
@@ -1,7 +1,7 @@
1
1
  import o from "./GalleryView.vue2.js";
2
2
  /* empty css */
3
- import a from "../../_virtual/_plugin-vue_export-helper.js";
4
- const m = /* @__PURE__ */ a(o, [["__scopeId", "data-v-3e8ae97a"]]);
3
+ import r from "../../_virtual/_plugin-vue_export-helper.js";
4
+ const m = /* @__PURE__ */ r(o, [["__scopeId", "data-v-b432e370"]]);
5
5
  export {
6
6
  m as default
7
7
  };
@@ -1,48 +1,58 @@
1
- import { defineComponent as u, computed as n, openBlock as t, createElementBlock as d, normalizeStyle as m, Fragment as f, renderList as v, createBlock as p, createVNode as y, unref as k, createElementVNode as I, createCommentVNode as g } from "vue";
2
- import { PlusIcon as F } from "lucide-vue-next";
3
- import b from "./GalleryCard.vue.js";
4
- import { buildGalleryItems as C } from "../../types/index.js";
5
- const x = /* @__PURE__ */ u({
1
+ import { defineComponent as g, computed as t, openBlock as i, createElementBlock as o, normalizeStyle as p, Fragment as I, renderList as w, createBlock as C, createVNode as k, unref as b, createElementVNode as _, createCommentVNode as B } from "vue";
2
+ import { PlusIcon as V } from "lucide-vue-next";
3
+ import h from "./GalleryCard.vue.js";
4
+ import { buildGalleryItems as G } from "../../types/index.js";
5
+ const S = /* @__PURE__ */ g({
6
6
  __name: "GalleryView",
7
7
  props: {
8
8
  items: { default: () => [] },
9
9
  records: { default: () => [] },
10
+ schema: { default: void 0 },
11
+ view: { default: void 0 },
10
12
  coverFieldId: { default: "" },
11
13
  cardFieldIds: { default: () => [] },
12
14
  columns: { default: 4 },
13
15
  addable: { type: Boolean, default: !0 }
14
16
  },
15
17
  emits: ["card-click", "add"],
16
- setup(o, { emit: i }) {
17
- const e = o, a = i, s = n(() => ({
18
+ setup(n, { emit: v }) {
19
+ const e = n, s = v, m = t(() => ({
18
20
  "--columns": e.columns
19
- })), c = n(() => e.items.length > 0 ? e.items : e.records.length > 0 ? C(e.records, {
20
- coverFieldId: e.coverFieldId || void 0,
21
- cardFieldIds: e.cardFieldIds
21
+ })), c = t(
22
+ () => {
23
+ var d;
24
+ return e.coverFieldId || ((d = e.view) == null ? void 0 : d.galleryCoverFieldId) || "";
25
+ }
26
+ ), f = t(() => {
27
+ var d, l, r, a, u;
28
+ return (d = e.cardFieldIds) != null && d.length ? e.cardFieldIds : (r = (l = e.view) == null ? void 0 : l.galleryCardFields) != null && r.length ? e.view.galleryCardFields : (u = (a = e.view) == null ? void 0 : a.visibleFields) != null && u.length ? e.view.visibleFields.filter((F) => F !== c.value) : [];
29
+ }), y = t(() => e.items.length > 0 ? e.items : e.records.length > 0 ? G(e.records, {
30
+ coverFieldId: c.value || void 0,
31
+ cardFieldIds: f.value
22
32
  }) : []);
23
- return (_, l) => (t(), d("div", {
33
+ return (d, l) => (i(), o("div", {
24
34
  class: "gallery-view",
25
- style: m(s.value)
35
+ style: p(m.value)
26
36
  }, [
27
- (t(!0), d(f, null, v(c.value, (r) => (t(), p(b, {
37
+ (i(!0), o(I, null, w(y.value, (r) => (i(), C(h, {
28
38
  key: r.id,
29
39
  item: r,
30
- onClick: (w) => a("card-click", r)
40
+ onClick: (a) => s("card-click", r)
31
41
  }, null, 8, ["item", "onClick"]))), 128)),
32
- o.addable ? (t(), d("button", {
42
+ n.addable ? (i(), o("button", {
33
43
  key: 0,
34
44
  class: "gallery-view__add-btn",
35
- onClick: l[0] || (l[0] = (r) => a("add"))
45
+ onClick: l[0] || (l[0] = (r) => s("add"))
36
46
  }, [
37
- y(k(F), {
47
+ k(b(V), {
38
48
  size: 18,
39
49
  class: "gallery-view__add-icon"
40
50
  }),
41
- l[1] || (l[1] = I("span", { class: "gallery-view__add-label" }, "添加", -1))
42
- ])) : g("", !0)
51
+ l[1] || (l[1] = _("span", { class: "gallery-view__add-label" }, "添加", -1))
52
+ ])) : B("", !0)
43
53
  ], 4));
44
54
  }
45
55
  });
46
56
  export {
47
- x as default
57
+ S as default
48
58
  };
@@ -1,7 +1,9 @@
1
- import { DataRecord, KanbanColumnData, Task } from '../../types';
1
+ import { DataRecord, KanbanColumnData, Task, TableSchema, ViewConfig } from '../../types';
2
2
  type __VLS_Props = {
3
3
  columns?: KanbanColumnData[];
4
4
  records?: DataRecord[];
5
+ schema?: TableSchema;
6
+ view?: ViewConfig;
5
7
  kanbanFieldId?: string;
6
8
  laneOrder?: string[];
7
9
  laneTitles?: Record<string, string>;
@@ -16,8 +18,10 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
16
18
  "onCard-click"?: ((task: Task) => any) | undefined;
17
19
  "onAdd-column"?: (() => any) | undefined;
18
20
  }>, {
21
+ view: ViewConfig;
19
22
  columns: KanbanColumnData[];
20
23
  records: DataRecord[];
24
+ schema: TableSchema;
21
25
  kanbanFieldId: string;
22
26
  laneOrder: string[];
23
27
  laneTitles: Record<string, string>;
@@ -1,7 +1,7 @@
1
- import o from "./KanbanBoard.vue2.js";
1
+ import a from "./KanbanBoard.vue2.js";
2
2
  /* empty css */
3
- import a from "../../_virtual/_plugin-vue_export-helper.js";
4
- const f = /* @__PURE__ */ a(o, [["__scopeId", "data-v-210bcfc5"]]);
3
+ import o from "../../_virtual/_plugin-vue_export-helper.js";
4
+ const p = /* @__PURE__ */ o(a, [["__scopeId", "data-v-5b7aa191"]]);
5
5
  export {
6
- f as default
6
+ p as default
7
7
  };