@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,43 @@
1
+ import { FieldDef as CellFieldDef } from './FieldCell.vue';
2
+ import { TableColumn } from '../../types';
3
+ type TableRow = Record<string, unknown> & {
4
+ id: string;
5
+ };
6
+ type __VLS_Props = {
7
+ row: TableRow;
8
+ columns: TableColumn[];
9
+ fieldDefs?: CellFieldDef[];
10
+ visible: boolean;
11
+ /** 标记哪些字段是 content 字段(全宽 markdown 渲染) */
12
+ contentFields?: string[];
13
+ /** 是否显示为全屏模式(桌面端宽面板) */
14
+ fullPage?: boolean;
15
+ /** 只读模式 */
16
+ readonly?: boolean;
17
+ };
18
+ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
19
+ delete: (rowId: string) => any;
20
+ close: () => any;
21
+ save: (payload: {
22
+ rowId: string;
23
+ fields: Record<string, unknown>;
24
+ }) => any;
25
+ "cell-edit": (payload: {
26
+ rowId: string;
27
+ fieldId: string;
28
+ value: unknown;
29
+ }) => any;
30
+ }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
31
+ onDelete?: ((rowId: string) => any) | undefined;
32
+ onClose?: (() => any) | undefined;
33
+ onSave?: ((payload: {
34
+ rowId: string;
35
+ fields: Record<string, unknown>;
36
+ }) => any) | undefined;
37
+ "onCell-edit"?: ((payload: {
38
+ rowId: string;
39
+ fieldId: string;
40
+ value: unknown;
41
+ }) => any) | undefined;
42
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
43
+ export default _default;
@@ -0,0 +1,7 @@
1
+ import t from "./DetailSheet.vue2.js";
2
+ /* empty css */
3
+ import o from "../../_virtual/_plugin-vue_export-helper.js";
4
+ const f = /* @__PURE__ */ o(t, [["__scopeId", "data-v-63a6599f"]]);
5
+ export {
6
+ f as default
7
+ };
@@ -0,0 +1,140 @@
1
+ import { defineComponent as V, ref as L, computed as c, openBlock as o, createBlock as k, Teleport as N, createVNode as E, Transition as H, withCtx as j, createElementBlock as d, withModifiers as z, normalizeClass as h, createElementVNode as n, Fragment as b, renderList as C, toDisplayString as v, createCommentVNode as g } from "vue";
2
+ import O from "./FieldCell.vue.js";
3
+ import { useMarkdown as R } from "../../composables/useMarkdown.js";
4
+ const q = { class: "of-detail-sheet__properties" }, A = { class: "of-detail-sheet__label" }, G = { class: "of-detail-sheet__cell" }, I = {
5
+ key: 1,
6
+ class: "of-detail-sheet__value"
7
+ }, J = {
8
+ key: 0,
9
+ class: "of-detail-sheet__content"
10
+ }, Q = { class: "of-detail-sheet__content-label" }, U = ["innerHTML"], W = { class: "of-detail-sheet__footer" }, X = ["disabled"], K = /* @__PURE__ */ V({
11
+ __name: "DetailSheet",
12
+ props: {
13
+ row: {},
14
+ columns: {},
15
+ fieldDefs: {},
16
+ visible: { type: Boolean },
17
+ contentFields: {},
18
+ fullPage: { type: Boolean },
19
+ readonly: { type: Boolean }
20
+ },
21
+ emits: ["close", "save", "delete", "cell-edit"],
22
+ setup(s, { emit: p }) {
23
+ const i = s, r = p, { renderMarkdown: w } = R({ showCopyButton: !0 }), a = L({}), D = c(() => Object.keys(a.value).length > 0), B = c(() => new Set(i.contentFields ?? []));
24
+ function m(t) {
25
+ var l;
26
+ if (B.value.has(t.key)) return !0;
27
+ const e = (l = i.fieldDefs) == null ? void 0 : l.find((f) => f.id === t.key);
28
+ return (e == null ? void 0 : e.type) === "richtext";
29
+ }
30
+ const F = c(() => i.columns.filter((t) => !m(t))), y = c(() => i.columns.filter((t) => m(t)));
31
+ function x(t) {
32
+ var e;
33
+ return ((e = i.fieldDefs) == null ? void 0 : e.find((l) => l.id === t)) ?? {
34
+ id: t,
35
+ type: "text",
36
+ label: t
37
+ };
38
+ }
39
+ function u(t) {
40
+ return t.key in a.value ? a.value[t.key] : i.row[t.key];
41
+ }
42
+ function M(t) {
43
+ const e = u(t);
44
+ return typeof e != "string" || !e ? "" : w(e);
45
+ }
46
+ function S(t, e, l) {
47
+ a.value = { ...a.value, [e]: l }, r("cell-edit", { rowId: t, fieldId: e, value: l });
48
+ }
49
+ function P() {
50
+ r("save", { rowId: i.row.id, fields: { ...a.value } }), a.value = {}, r("close");
51
+ }
52
+ function _() {
53
+ a.value = {}, r("close");
54
+ }
55
+ function T() {
56
+ r("delete", i.row.id), r("close");
57
+ }
58
+ return (t, e) => (o(), k(N, { to: "body" }, [
59
+ E(H, { name: "of-sheet" }, {
60
+ default: j(() => [
61
+ s.visible ? (o(), d("div", {
62
+ key: 0,
63
+ class: h(["of-detail-sheet-overlay", { "of-detail-sheet-overlay--full-page": s.fullPage }]),
64
+ onClick: z(_, ["self"])
65
+ }, [
66
+ n("div", {
67
+ class: h(["of-detail-sheet", { "of-detail-sheet--full-page": s.fullPage }])
68
+ }, [
69
+ n("div", { class: "of-detail-sheet__header" }, [
70
+ n("button", {
71
+ class: "of-detail-sheet__close",
72
+ onClick: _
73
+ }, "✕"),
74
+ e[0] || (e[0] = n("h3", { class: "of-detail-sheet__title" }, "记录详情", -1)),
75
+ e[1] || (e[1] = n("div", { class: "of-detail-sheet__header-spacer" }, null, -1))
76
+ ]),
77
+ n("div", {
78
+ class: h(["of-detail-sheet__body", { "of-detail-sheet__body--full-page": s.fullPage }])
79
+ }, [
80
+ n("div", q, [
81
+ (o(!0), d(b, null, C(F.value, (l) => {
82
+ var f;
83
+ return o(), d("div", {
84
+ key: l.key,
85
+ class: "of-detail-sheet__field"
86
+ }, [
87
+ n("label", A, v(l.label), 1),
88
+ n("div", G, [
89
+ (f = s.fieldDefs) != null && f.length ? (o(), k(O, {
90
+ key: 0,
91
+ "row-id": s.row.id,
92
+ field: x(l.key),
93
+ value: u(l),
94
+ readonly: s.readonly,
95
+ onCommit: S
96
+ }, null, 8, ["row-id", "field", "value", "readonly"])) : (o(), d("span", I, v(u(l) ?? "—"), 1))
97
+ ])
98
+ ]);
99
+ }), 128))
100
+ ]),
101
+ y.value.length > 0 ? (o(), d("div", J, [
102
+ (o(!0), d(b, null, C(y.value, (l) => (o(), d("div", {
103
+ key: l.key,
104
+ class: "of-detail-sheet__content-block"
105
+ }, [
106
+ n("label", Q, v(l.label), 1),
107
+ n("div", {
108
+ class: "of-detail-sheet__markdown of-markdown",
109
+ innerHTML: M(l)
110
+ }, null, 8, U)
111
+ ]))), 128))
112
+ ])) : g("", !0)
113
+ ], 2),
114
+ n("div", W, [
115
+ n("button", {
116
+ class: "of-detail-sheet__btn of-detail-sheet__btn--delete",
117
+ onClick: T
118
+ }, " 删除 "),
119
+ e[2] || (e[2] = n("div", { class: "of-detail-sheet__footer-spacer" }, null, -1)),
120
+ n("button", {
121
+ class: "of-detail-sheet__btn of-detail-sheet__btn--cancel",
122
+ onClick: _
123
+ }, " 取消 "),
124
+ n("button", {
125
+ class: "of-detail-sheet__btn of-detail-sheet__btn--save",
126
+ disabled: !D.value,
127
+ onClick: P
128
+ }, " 保存 ", 8, X)
129
+ ])
130
+ ], 2)
131
+ ], 2)) : g("", !0)
132
+ ]),
133
+ _: 1
134
+ })
135
+ ]));
136
+ }
137
+ });
138
+ export {
139
+ K as default
140
+ };
@@ -1,4 +1,4 @@
1
- export type FieldType = "text" | "number" | "checkbox" | "select" | "multiselect" | "date" | "datetime" | "rating" | "url" | "email";
1
+ export type FieldType = "text" | "number" | "checkbox" | "select" | "multiselect" | "date" | "datetime" | "rating" | "url" | "email" | "currency" | "richtext" | "auto_number" | "creator" | "progress" | "relation" | "attachment" | "phone";
2
2
  export interface FieldOption {
3
3
  label: string;
4
4
  value: string;
@@ -1,7 +1,7 @@
1
1
  import o from "./FieldCell.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-f3efd289"]]);
4
+ const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-33585ca9"]]);
5
5
  export {
6
6
  m as default
7
7
  };
@@ -1,9 +1,10 @@
1
- import { defineComponent as E, computed as i, defineAsyncComponent as l, openBlock as o, createElementBlock as m, normalizeClass as I, createBlock as s, Suspense as N, withCtx as f, resolveDynamicComponent as B, createElementVNode as A, toDisplayString as S } from "vue";
2
- import { useInlineEdit as D } from "../../composables/useInlineEdit.js";
3
- const T = {
1
+ import { defineComponent as I, computed as n, defineAsyncComponent as e, openBlock as o, createElementBlock as a, normalizeClass as N, createBlock as c, Suspense as B, withCtx as f, resolveDynamicComponent as A, createElementVNode as S, Fragment as F, toDisplayString as D } from "vue";
2
+ import { useInlineEdit as M } from "../../composables/useInlineEdit.js";
3
+ import T from "../field/FieldMarkdownPreview.vue.js";
4
+ const V = {
4
5
  key: 1,
5
6
  class: "of-field-cell__display"
6
- }, z = /* @__PURE__ */ E({
7
+ }, R = /* @__PURE__ */ I({
7
8
  __name: "FieldCell",
8
9
  props: {
9
10
  rowId: {},
@@ -12,60 +13,74 @@ const T = {
12
13
  readonly: { type: Boolean, default: !1 }
13
14
  },
14
15
  emits: ["commit", "cancel", "tabNext"],
15
- setup(n, { emit: u }) {
16
- const e = n, a = u, { isEditing: p, activate: y, commit: v, cancel: C } = D(), r = i(() => p(e.rowId, e.field.id)), d = i(() => e.readonly || e.field.readonly);
17
- function b() {
18
- d.value || y(e.rowId, e.field.id);
19
- }
20
- function k(t) {
21
- v(e.rowId, e.field.id, t), a("commit", e.rowId, e.field.id, t);
22
- }
16
+ setup(l, { emit: s }) {
17
+ const t = l, r = s, { isEditing: p, activate: y, commit: v, cancel: k } = M(), d = n(() => p(t.rowId, t.field.id)), m = n(() => t.readonly || t.field.readonly);
23
18
  function x() {
24
- C(), a("cancel");
19
+ m.value || y(t.rowId, t.field.id);
20
+ }
21
+ function C(i) {
22
+ v(t.rowId, t.field.id, i), r("commit", t.rowId, t.field.id, i);
25
23
  }
26
24
  function g() {
27
- a("tabNext");
25
+ k(), r("cancel");
26
+ }
27
+ function b() {
28
+ r("tabNext");
28
29
  }
29
- const _ = {
30
- text: l(() => import("../field/FieldText.vue.js")),
31
- number: l(() => import("../field/FieldNumber.vue.js")),
32
- checkbox: l(() => import("../field/FieldCheckbox.vue.js")),
33
- select: l(() => import("../field/FieldSelect.vue.js")),
34
- multiselect: l(() => import("../field/FieldMultiSelect.vue.js")),
35
- date: l(() => import("../field/FieldDate.vue.js")),
36
- datetime: l(() => import("../field/FieldDatetime.vue.js")),
37
- rating: l(() => import("../field/FieldRating.vue.js")),
38
- url: l(() => import("../field/FieldUrl.vue.js")),
39
- email: l(() => import("../field/FieldEmail.vue.js"))
40
- }, h = i(() => _[e.field.type]), w = i(() => {
41
- const t = e.value;
42
- return t == null || t === "" ? "—" : Array.isArray(t) ? t.join(", ") : typeof t == "boolean" ? t ? "✓" : "—" : String(t);
30
+ const h = {
31
+ text: e(() => import("../field/FieldText.vue.js")),
32
+ number: e(() => import("../field/FieldNumber.vue.js")),
33
+ checkbox: e(() => import("../field/FieldCheckbox.vue.js")),
34
+ select: e(() => import("../field/FieldSelect.vue.js")),
35
+ multiselect: e(() => import("../field/FieldMultiSelect.vue.js")),
36
+ date: e(() => import("../field/FieldDate.vue.js")),
37
+ datetime: e(() => import("../field/FieldDatetime.vue.js")),
38
+ rating: e(() => import("../field/FieldRating.vue.js")),
39
+ url: e(() => import("../field/FieldUrl.vue.js")),
40
+ email: e(() => import("../field/FieldEmail.vue.js")),
41
+ currency: e(() => import("../field/FieldCurrency.vue.js")),
42
+ richtext: e(() => import("../field/FieldRichText.vue.js")),
43
+ auto_number: e(() => import("../field/FieldAutoNumber.vue.js")),
44
+ creator: e(() => import("../field/FieldCreator.vue.js")),
45
+ progress: e(() => import("../field/FieldProgress.vue.js")),
46
+ relation: e(() => import("../field/FieldRelation.vue.js")),
47
+ attachment: e(() => import("../field/FieldAttachment.vue.js")),
48
+ phone: e(() => import("../field/FieldPhone.vue.js"))
49
+ }, w = n(() => h[t.field.type]), E = n(() => {
50
+ const i = t.value;
51
+ return i == null || i === "" ? "—" : Array.isArray(i) ? i.join(", ") : typeof i == "boolean" ? i ? "✓" : "—" : String(i);
43
52
  });
44
- return (t, c) => (o(), m("div", {
45
- class: I(["of-field-cell", {
46
- "of-field-cell--editing": r.value,
47
- "of-field-cell--readonly": d.value
53
+ return (i, u) => (o(), a("div", {
54
+ class: N(["of-field-cell", {
55
+ "of-field-cell--editing": d.value,
56
+ "of-field-cell--readonly": m.value
48
57
  }]),
49
- onClick: b
58
+ onClick: x
50
59
  }, [
51
- r.value ? (o(), s(N, { key: 0 }, {
52
- fallback: f(() => [...c[0] || (c[0] = [
53
- A("span", { class: "of-field-cell__loading" }, "...", -1)
60
+ d.value ? (o(), c(B, { key: 0 }, {
61
+ fallback: f(() => [...u[0] || (u[0] = [
62
+ S("span", { class: "of-field-cell__loading" }, "...", -1)
54
63
  ])]),
55
64
  default: f(() => [
56
- (o(), s(B(h.value), {
57
- value: n.value,
58
- field: n.field,
59
- onCommit: k,
60
- onCancel: x,
61
- onTabNext: g
65
+ (o(), c(A(w.value), {
66
+ value: l.value,
67
+ field: l.field,
68
+ onCommit: C,
69
+ onCancel: g,
70
+ onTabNext: b
62
71
  }, null, 40, ["value", "field"]))
63
72
  ]),
64
73
  _: 1
65
- })) : (o(), m("span", T, S(w.value), 1))
74
+ })) : (o(), a(F, { key: 1 }, [
75
+ l.field.type === "richtext" && typeof l.value == "string" && l.value ? (o(), c(T, {
76
+ key: 0,
77
+ content: l.value,
78
+ "max-lines": 2
79
+ }, null, 8, ["content"])) : (o(), a("span", V, D(E.value), 1))
80
+ ], 64))
66
81
  ], 2));
67
82
  }
68
83
  });
69
84
  export {
70
- z as default
85
+ R as default
71
86
  };
@@ -0,0 +1,15 @@
1
+ import { FieldType } from '../../types';
2
+ type __VLS_Props = {
3
+ /** 当前选中的类型(高亮) */
4
+ currentType?: FieldType;
5
+ /** 搜索过滤 */
6
+ searchable?: boolean;
7
+ };
8
+ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
9
+ select: (type: FieldType) => any;
10
+ }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
11
+ onSelect?: ((type: FieldType) => any) | undefined;
12
+ }>, {
13
+ searchable: boolean;
14
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
15
+ export default _default;
@@ -0,0 +1,7 @@
1
+ import o from "./FieldTypePicker.vue2.js";
2
+ /* empty css */
3
+ import r from "../../_virtual/_plugin-vue_export-helper.js";
4
+ const a = /* @__PURE__ */ r(o, [["__scopeId", "data-v-a1d48545"]]);
5
+ export {
6
+ a as default
7
+ };
@@ -0,0 +1,92 @@
1
+ import { defineComponent as k, ref as v, computed as y, openBlock as l, createElementBlock as a, withDirectives as C, createElementVNode as i, vModelText as T, createCommentVNode as x, Fragment as p, renderList as u, toDisplayString as d, normalizeClass as S, createBlock as B, resolveDynamicComponent as L } from "vue";
2
+ import { Type as D, Hash as F, CheckSquare as E, ListChecks as g, Calendar as M, CalendarClock as P, Link as q, Mail as w, Phone as U, Star as V, DollarSign as z, BarChart3 as N, FileText as G, User as H, UserCheck as I, ListOrdered as O, GitBranch as Q, Paperclip as Y, FunctionSquare as $ } from "lucide-vue-next";
3
+ const j = { class: "of-field-type-picker" }, A = {
4
+ key: 0,
5
+ class: "of-field-type-picker__search"
6
+ }, J = { class: "of-field-type-picker__list" }, K = { class: "of-field-type-picker__group-label" }, R = ["onClick"], ee = /* @__PURE__ */ k({
7
+ __name: "FieldTypePicker",
8
+ props: {
9
+ currentType: {},
10
+ searchable: { type: Boolean, default: !0 }
11
+ },
12
+ emits: ["select"],
13
+ setup(n, { emit: f }) {
14
+ const m = f, r = v(""), s = [
15
+ // 基础
16
+ { type: "text", label: "文本", icon: D, category: "基础" },
17
+ { type: "number", label: "数字", icon: F, category: "基础" },
18
+ { type: "checkbox", label: "复选框", icon: E, category: "基础" },
19
+ { type: "select", label: "单选", icon: g, category: "基础" },
20
+ { type: "multi_select", label: "多选", icon: g, category: "基础" },
21
+ // 日期
22
+ { type: "date", label: "日期", icon: M, category: "日期" },
23
+ { type: "datetime", label: "日期时间", icon: P, category: "日期" },
24
+ // 联系方式
25
+ { type: "url", label: "链接", icon: q, category: "联系" },
26
+ { type: "email", label: "邮箱", icon: w, category: "联系" },
27
+ { type: "phone", label: "电话", icon: U, category: "联系" },
28
+ // 高级
29
+ { type: "rating", label: "评分", icon: V, category: "高级" },
30
+ { type: "currency", label: "货币", icon: z, category: "高级" },
31
+ { type: "progress", label: "进度", icon: N, category: "高级" },
32
+ { type: "richtext", label: "富文本", icon: G, category: "高级" },
33
+ // 系统
34
+ { type: "user", label: "用户", icon: H, category: "系统" },
35
+ { type: "creator", label: "创建者", icon: I, category: "系统" },
36
+ { type: "auto_number", label: "自动编号", icon: O, category: "系统" },
37
+ // 关联
38
+ { type: "relation", label: "关联", icon: Q, category: "关联" },
39
+ { type: "attachment", label: "附件", icon: Y, category: "关联" },
40
+ { type: "formula", label: "公式", icon: $, category: "关联" }
41
+ ], _ = y(() => {
42
+ if (!r.value) return s;
43
+ const o = r.value.toLowerCase();
44
+ return s.filter(
45
+ (t) => t.label.includes(o) || t.type.includes(o) || t.category.includes(o)
46
+ );
47
+ }), b = y(() => {
48
+ const o = [], t = /* @__PURE__ */ new Map();
49
+ for (const e of _.value)
50
+ t.has(e.category) || t.set(e.category, []), t.get(e.category).push(e);
51
+ for (const [e, c] of t)
52
+ o.push({ category: e, items: c });
53
+ return o;
54
+ });
55
+ function h(o) {
56
+ m("select", o);
57
+ }
58
+ return (o, t) => (l(), a("div", j, [
59
+ n.searchable ? (l(), a("div", A, [
60
+ C(i("input", {
61
+ "onUpdate:modelValue": t[0] || (t[0] = (e) => r.value = e),
62
+ class: "of-field-type-picker__search-input",
63
+ placeholder: "搜索字段类型..."
64
+ }, null, 512), [
65
+ [T, r.value]
66
+ ])
67
+ ])) : x("", !0),
68
+ i("div", J, [
69
+ (l(!0), a(p, null, u(b.value, (e) => (l(), a("div", {
70
+ key: e.category,
71
+ class: "of-field-type-picker__group"
72
+ }, [
73
+ i("div", K, d(e.category), 1),
74
+ (l(!0), a(p, null, u(e.items, (c) => (l(), a("button", {
75
+ key: c.type,
76
+ class: S(["of-field-type-picker__item", { "of-field-type-picker__item--active": n.currentType === c.type }]),
77
+ onClick: (W) => h(c.type)
78
+ }, [
79
+ (l(), B(L(c.icon), {
80
+ size: 14,
81
+ class: "of-field-type-picker__icon"
82
+ })),
83
+ i("span", null, d(c.label), 1)
84
+ ], 10, R))), 128))
85
+ ]))), 128))
86
+ ])
87
+ ]));
88
+ }
89
+ });
90
+ export {
91
+ ee as default
92
+ };
@@ -0,0 +1,24 @@
1
+ import { TableColumn, ColorMap } from '../../types';
2
+ type TableRow = Record<string, unknown> & {
3
+ id: string;
4
+ };
5
+ type __VLS_Props = {
6
+ rows: TableRow[];
7
+ columns: TableColumn[];
8
+ selectable?: boolean;
9
+ addable?: boolean;
10
+ statusColorMap?: ColorMap;
11
+ readonly?: boolean;
12
+ };
13
+ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
14
+ "row-click": (row: any) => any;
15
+ "add-row": () => any;
16
+ }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
17
+ "onRow-click"?: ((row: any) => any) | undefined;
18
+ "onAdd-row"?: (() => any) | undefined;
19
+ }>, {
20
+ selectable: boolean;
21
+ addable: boolean;
22
+ readonly: boolean;
23
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
24
+ export default _default;
@@ -0,0 +1,7 @@
1
+ import o from "./MobileListView.vue2.js";
2
+ /* empty css */
3
+ import t from "../../_virtual/_plugin-vue_export-helper.js";
4
+ const f = /* @__PURE__ */ t(o, [["__scopeId", "data-v-15efc0e6"]]);
5
+ export {
6
+ f as default
7
+ };
@@ -0,0 +1,90 @@
1
+ import { defineComponent as V, computed as f, ref as g, openBlock as l, createElementBlock as o, Fragment as v, renderList as C, createElementVNode as X, normalizeStyle as M, toDisplayString as d, createCommentVNode as i } from "vue";
2
+ import { mergeColorMap as A, DEFAULT_STATUS_MAP as L, resolveBadge as Y } from "../../composables/useBadge.js";
3
+ const $ = { class: "of-mobile-list" }, D = ["onClick", "onTouchstart"], F = {
4
+ key: 0,
5
+ class: "of-mobile-card__title"
6
+ }, N = {
7
+ key: 1,
8
+ class: "of-mobile-card__meta"
9
+ }, U = {
10
+ key: 1,
11
+ class: "of-mobile-card__tag"
12
+ }, w = {
13
+ key: 0,
14
+ class: "of-mobile-card__action-delete"
15
+ }, O = /* @__PURE__ */ V({
16
+ __name: "MobileListView",
17
+ props: {
18
+ rows: {},
19
+ columns: {},
20
+ selectable: { type: Boolean, default: !1 },
21
+ addable: { type: Boolean, default: !0 },
22
+ statusColorMap: {},
23
+ readonly: { type: Boolean, default: !1 }
24
+ },
25
+ emits: ["row-click", "add-row"],
26
+ setup(r, { emit: S }) {
27
+ const m = r, y = S, T = f(() => A(L, m.statusColorMap)), h = f(() => m.columns[0]), _ = f(() => m.columns.slice(1, 4));
28
+ function u(a, n) {
29
+ const e = a[n.key];
30
+ return e != null ? String(e) : "";
31
+ }
32
+ function p(a) {
33
+ return Y(a, T.value);
34
+ }
35
+ let b = 0, k = 0;
36
+ const c = g(null), s = g(0);
37
+ function B(a, n) {
38
+ b = a.touches[0].clientX, k = a.touches[0].clientY, c.value = n, s.value = 0;
39
+ }
40
+ function x(a) {
41
+ if (!c.value) return;
42
+ const n = a.touches[0].clientX - b, e = a.touches[0].clientY - k;
43
+ if (Math.abs(e) > Math.abs(n)) {
44
+ c.value = null;
45
+ return;
46
+ }
47
+ s.value = Math.max(-80, Math.min(0, n));
48
+ }
49
+ function E() {
50
+ s.value < -40 ? s.value = -80 : (s.value = 0, c.value = null);
51
+ }
52
+ return (a, n) => (l(), o("div", $, [
53
+ (l(!0), o(v, null, C(r.rows, (e) => (l(), o("div", {
54
+ key: e.id,
55
+ class: "of-mobile-card-wrapper"
56
+ }, [
57
+ X("div", {
58
+ class: "of-mobile-card",
59
+ style: M({ transform: c.value === e.id ? `translateX(${s.value}px)` : "" }),
60
+ onClick: (t) => y("row-click", e),
61
+ onTouchstart: (t) => B(t, e.id),
62
+ onTouchmove: x,
63
+ onTouchend: E
64
+ }, [
65
+ h.value ? (l(), o("div", F, d(u(e, h.value) || "—"), 1)) : i("", !0),
66
+ _.value.length > 0 ? (l(), o("div", N, [
67
+ (l(!0), o(v, null, C(_.value, (t) => (l(), o(v, {
68
+ key: t.key
69
+ }, [
70
+ t.key === "status" && u(e, t) ? (l(), o("span", {
71
+ key: 0,
72
+ class: "of-mobile-card__badge",
73
+ style: M(p(u(e, t)).style)
74
+ }, d(p(u(e, t)).label), 5)) : u(e, t) ? (l(), o("span", U, d(t.label) + ": " + d(u(e, t)), 1)) : i("", !0)
75
+ ], 64))), 128))
76
+ ])) : i("", !0)
77
+ ], 44, D),
78
+ c.value === e.id && s.value < -40 ? (l(), o("div", w, " 删除 ")) : i("", !0)
79
+ ]))), 128)),
80
+ r.addable && !r.readonly ? (l(), o("button", {
81
+ key: 0,
82
+ class: "of-mobile-add-btn",
83
+ onClick: n[0] || (n[0] = (e) => y("add-row"))
84
+ }, " + 新增记录 ")) : i("", !0)
85
+ ]));
86
+ }
87
+ });
88
+ export {
89
+ O as default
90
+ };
@@ -5,6 +5,10 @@ type __VLS_Props = {
5
5
  collapsed?: boolean;
6
6
  colorMap?: ColorMap;
7
7
  selectable?: boolean;
8
+ /** Nesting level for multi-level grouping (0-based) */
9
+ level?: number;
10
+ /** Aggregation results to display inline */
11
+ aggregations?: Record<string, number>;
8
12
  };
9
13
  declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
10
14
  toggle: () => any;
@@ -13,5 +17,6 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
13
17
  }>, {
14
18
  collapsed: boolean;
15
19
  selectable: boolean;
20
+ level: number;
16
21
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
17
22
  export default _default;
@@ -1,7 +1,7 @@
1
1
  import o from "./TableGroupRow.vue2.js";
2
2
  /* empty css */
3
3
  import r from "../../_virtual/_plugin-vue_export-helper.js";
4
- const m = /* @__PURE__ */ r(o, [["__scopeId", "data-v-3d4c6532"]]);
4
+ const a = /* @__PURE__ */ r(o, [["__scopeId", "data-v-c6e2f1e0"]]);
5
5
  export {
6
- m as default
6
+ a as default
7
7
  };