@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
@@ -1,19 +1,49 @@
1
- import { defineComponent as ne, toRef as i, watch as I, ref as se, computed as f, openBlock as a, createElementBlock as c, createVNode as b, unref as r, createElementVNode as $, normalizeStyle as V, Fragment as v, renderList as z, createBlock as m, mergeProps as y, createSlots as N, withCtx as P, createCommentVNode as ie } from "vue";
2
- import ce from "./TableHeaderRow.vue.js";
3
- import F from "./TableDataRow.vue.js";
4
- import L from "./TableGroupRow.vue.js";
5
- import ue from "./NewRowBtn.vue.js";
6
- import O from "./FieldCell.vue.js";
7
- import { useInlineEdit as de } from "../../composables/useInlineEdit.js";
8
- import { useVirtualList as fe } from "../../composables/useVirtualList.js";
9
- import { useTable as me } from "../../composables/useTable.js";
10
- import { useTableGroup as pe } from "../../composables/useTableGroup.js";
11
- import { useTableData as ve } from "../../composables/useTableData.js";
12
- import { useTableColumns as ye } from "../../composables/useTableColumns.js";
13
- const ge = {
14
- class: "of-data-table",
15
- role: "grid"
16
- }, ke = 36, we = 44, Ee = /* @__PURE__ */ ne({
1
+ import { defineComponent as Fl, defineAsyncComponent as Ge, ref as S, toRef as h, computed as b, watch as be, unref as t, openBlock as a, createElementBlock as s, Fragment as v, createVNode as T, createBlock as y, createCommentVNode as M, createElementVNode as g, normalizeStyle as k, normalizeClass as z, renderList as m, mergeProps as K, withModifiers as _, renderSlot as Q, toDisplayString as L, createSlots as Pe, withCtx as Ve, Teleport as Hl } from "vue";
2
+ import ke from "./TableHeaderRow.vue.js";
3
+ import Oe from "./TableDataRow.vue.js";
4
+ import Z from "./TableGroupRow.vue.js";
5
+ import Bl from "./NewRowBtn.vue.js";
6
+ import Il from "./MobileListView.vue.js";
7
+ import Kl from "./DetailSheet.vue.js";
8
+ import E from "./FieldCell.vue.js";
9
+ import { useInlineEdit as El } from "../../composables/useInlineEdit.js";
10
+ import { useVirtualList as _l } from "../../composables/useVirtualList.js";
11
+ import { useTable as Ll } from "../../composables/useTable.js";
12
+ import { useTableGroup as Gl } from "../../composables/useTableGroup.js";
13
+ import { useTableData as Pl } from "../../composables/useTableData.js";
14
+ import { useTableColumns as Vl } from "../../composables/useTableColumns.js";
15
+ import { useColumnResize as Ol } from "../../composables/useColumnResize.js";
16
+ import { useKeyboardNavigation as Nl } from "../../composables/useKeyboardNavigation.js";
17
+ import { useBreakpoint as Wl } from "../../composables/useBreakpoint.js";
18
+ import { useFixedColumns as Yl } from "../../composables/useFixedColumns.js";
19
+ import { useRowDrag as jl } from "../../composables/useRowDrag.js";
20
+ import { useDraftRows as Xl } from "../../composables/useDraftRows.js";
21
+ const Ul = ["tabindex"], ql = {
22
+ key: 0,
23
+ class: "of-data-table-body",
24
+ style: { position: "relative" }
25
+ }, Jl = { class: "of-data-table-fixed-body" }, Ql = ["onMouseenter", "onClick"], Zl = ["checked", "onChange"], eo = {
26
+ key: 1,
27
+ class: "of-td-text"
28
+ }, lo = ["onMouseenter", "onClick"], oo = ["checked", "onChange"], to = {
29
+ key: 1,
30
+ class: "of-td-text"
31
+ }, no = { class: "of-data-table-scroll-body" }, ao = {
32
+ key: 0,
33
+ style: { height: "36px" }
34
+ }, ro = ["onMouseenter", "onClick"], so = {
35
+ key: 1,
36
+ class: "of-td-text"
37
+ }, io = {
38
+ key: 0,
39
+ style: { height: "36px" }
40
+ }, uo = ["onMouseenter", "onClick"], fo = {
41
+ key: 1,
42
+ class: "of-td-text"
43
+ }, co = {
44
+ key: 3,
45
+ class: "of-data-table-draft-toolbar"
46
+ }, vo = { class: "of-data-table-draft-count" }, yo = { class: "of-add-field-popup" }, go = 36, bo = 44, No = /* @__PURE__ */ Fl({
17
47
  __name: "DataTable",
18
48
  props: {
19
49
  tasks: {},
@@ -31,204 +61,761 @@ const ge = {
31
61
  groupColorMap: {},
32
62
  virtual: { type: Boolean },
33
63
  virtualThreshold: { default: 100 },
34
- readonly: { type: Boolean, default: !1 }
64
+ readonly: { type: Boolean, default: !1 },
65
+ fixedColumns: {},
66
+ enableResize: { type: Boolean, default: !1 },
67
+ enableKeyboard: { type: Boolean, default: !1 },
68
+ enableRowDrag: { type: Boolean, default: !1 },
69
+ enableCrossGroupDrag: { type: Boolean, default: !1 },
70
+ groups: {},
71
+ aggregations: {},
72
+ enableFieldManagement: { type: Boolean, default: !1 }
35
73
  },
36
- emits: ["row-click", "row-click-record", "add-row", "selection-change", "cell-edit"],
37
- setup(g, { emit: Y }) {
38
- const t = g, s = Y, { commit: U } = de(), { rows: T } = ve({
39
- tasks: i(t, "tasks"),
40
- records: i(t, "records")
41
- }), { columns: R } = ye({
42
- columns: i(t, "columns"),
43
- schema: i(t, "schema"),
44
- view: i(t, "view")
74
+ emits: ["row-click", "row-click-record", "add-row", "selection-change", "cell-edit", "column-resize", "active-cell-change", "row-reorder", "row-group-change", "draft-commit", "draft-discard", "drafts-commit-all", "paste", "schema-add-field", "schema-rename-field", "schema-change-field-type", "schema-hide-field", "schema-delete-field", "schema-duplicate-field"],
75
+ setup(f, { emit: Ne }) {
76
+ const We = Ge(() => import("./ColumnHeaderMenu.vue.js")), Ye = Ge(() => import("./FieldTypePicker.vue.js")), i = f, c = Ne, { isMobile: he } = Wl(), G = S(!1), P = S(null), ee = El(), { commit: je, editingCell: Xe } = ee, { rows: me } = Pl({
77
+ tasks: h(i, "tasks"),
78
+ records: h(i, "records")
79
+ }), { columns: le } = Vl({
80
+ columns: h(i, "columns"),
81
+ schema: h(i, "schema"),
82
+ view: h(i, "view")
83
+ }), { startResize: Ue, columnWidthOverrides: qe, showResizeIndicator: Je, resizeIndicatorX: Qe, autoFitColumn: Ze } = Ol({
84
+ columns: le,
85
+ onResize: (l, o) => c("column-resize", { colKey: l, width: o })
86
+ }), C = b(() => {
87
+ const l = qe.value;
88
+ return l.size === 0 ? le.value : le.value.map((o) => {
89
+ const e = l.get(o.key);
90
+ return e !== void 0 ? { ...o, width: e } : o;
91
+ });
45
92
  }), {
46
- data: k,
47
- sort: S,
48
- toggleSort: W,
49
- selectedRows: w,
50
- toggleSelectAll: j,
51
- toggleRowSelection: q,
52
- isAllSelected: D,
53
- setData: J
54
- } = me({
55
- data: T.value,
93
+ data: V,
94
+ sort: A,
95
+ toggleSort: O,
96
+ selectedRows: p,
97
+ toggleSelectAll: el,
98
+ toggleRowSelection: ll,
99
+ isAllSelected: oe,
100
+ setData: ol
101
+ } = Ll({
102
+ data: me.value,
56
103
  pageSize: 999999
57
- // Disable pagination inside DataTable for now or manage it externally
58
104
  });
59
- I(
60
- T,
61
- (e) => {
62
- J(e);
63
- },
64
- { deep: !1 }
65
- );
66
- const { groupedItems: p, collapsedGroups: Q, toggleGroup: B, isGroupHeader: _ } = pe({
67
- data: k,
68
- // Consumes sorted data from Brain 1
69
- groupBy: i(t, "groupBy")
70
- }), A = se(null), X = f(() => t.virtual !== void 0 ? t.virtual : p.value.length >= t.virtualThreshold), { visibleItems: Z, totalHeight: ee, offsetY: oe } = fe({
71
- items: p,
72
- itemHeight: (e) => {
73
- const l = p.value[e];
74
- return _(l) ? ke : we;
105
+ be(me, (l) => ol(l), { deep: !1 });
106
+ const { groupedItems: D, collapsedGroups: tl, toggleGroup: N, isGroupHeader: x } = Gl({
107
+ data: V,
108
+ groupBy: h(i, "groupBy"),
109
+ groups: h(i, "groups"),
110
+ aggregations: h(i, "aggregations")
111
+ }), W = S(null), te = S(null), pe = S(null), nl = b(() => {
112
+ var l;
113
+ return (((l = i.fixedColumns) == null ? void 0 : l.length) ?? 0) > 0;
114
+ }), we = S(0), al = b(() => we.value > 0), {
115
+ fixedColumns: ne,
116
+ scrollableColumns: ae,
117
+ fixedWidth: Ce,
118
+ handleScroll: rl,
119
+ handleFixedScroll: De,
120
+ scrollLeft: ko,
121
+ syncHover: R,
122
+ isRowHovered: Y
123
+ } = Yl({
124
+ columns: C,
125
+ fixedColumnKeys: b(() => i.fixedColumns ?? []),
126
+ scrollContainerRef: W,
127
+ fixedContainerRef: pe
128
+ }), re = b(() => i.virtual !== void 0 ? i.virtual : D.value.length >= i.virtualThreshold), { visibleItems: se, totalHeight: de, offsetY: ie, scrollToIndex: sl, observeRow: j } = _l({
129
+ items: D,
130
+ itemHeight: (l) => {
131
+ const o = D.value[l];
132
+ return x(o) ? go : bo;
75
133
  },
76
134
  overscan: 5,
77
- containerRef: A
78
- }), C = f(() => t.readonly ? !1 : t.selectable), te = f(() => t.readonly ? !1 : t.addable), le = f(() => Array.from(w.value)), re = f(() => w.value.size > 0 && !D.value);
79
- function ae() {
80
- j(k.value);
81
- }
82
- function H(e) {
83
- const l = k.value.find((o) => o[t.rowKey] === e);
84
- l && q(l, 0);
85
- }
86
- I(
87
- le,
88
- (e) => {
89
- s("selection-change", e);
135
+ containerRef: W,
136
+ measureRow: !0
137
+ }), xe = b(() => D.value.filter((l) => !x(l))), { activeCell: Re, selectedRange: dl, setActiveCell: Se, handleKeyDown: il } = Nl({
138
+ columns: C,
139
+ rows: xe,
140
+ containerRef: te,
141
+ editingCell: Xe,
142
+ enabled: b(() => i.enableKeyboard),
143
+ onActivateEdit: (l, o) => ee.activate(l, o),
144
+ onCancelEdit: () => ee.cancel(),
145
+ onScrollToRow: (l) => sl(l),
146
+ getCellValue: (l, o) => {
147
+ const e = xe.value.find((r) => r.id === l);
148
+ if (!e) return "";
149
+ const n = e[o];
150
+ return n != null ? String(n) : "";
90
151
  },
91
- { immediate: !1 }
92
- );
93
- function h(e) {
94
- const l = e[t.rowKey];
95
- return l != null ? String(l) : "";
152
+ onPaste: (l, o, e) => {
153
+ c("paste", { startRowId: l, startColKey: o, data: e });
154
+ }
155
+ });
156
+ be(Re, (l) => c("active-cell-change", l ?? null));
157
+ const {
158
+ isDragging: ul,
159
+ draggedRowId: fl,
160
+ dropTargetId: ue,
161
+ dropPosition: Me,
162
+ handleDragStart: cl,
163
+ handleDragOver: vl,
164
+ handleDrop: yl,
165
+ handleDragEnd: $e
166
+ } = jl({
167
+ processedItems: D,
168
+ enableCrossGroupDrag: b(() => i.enableCrossGroupDrag),
169
+ groupFieldId: h(i, "groupBy")
170
+ });
171
+ function Te(l, o) {
172
+ i.enableRowDrag && cl(l, o);
96
173
  }
97
- function M(e) {
98
- var l;
99
- return ((l = t.fieldDefs) == null ? void 0 : l.find((o) => o.id === e)) ?? {
100
- id: e,
174
+ function ze(l, o) {
175
+ i.enableRowDrag && vl(l, o);
176
+ }
177
+ function Ae(l, o) {
178
+ i.enableRowDrag && yl(l, o, {
179
+ onReorder: (e) => c("row-reorder", e),
180
+ onGroupChange: (e) => c("row-group-change", e)
181
+ });
182
+ }
183
+ const {
184
+ drafts: Fe,
185
+ addDraft: gl,
186
+ updateDraftField: ho,
187
+ removeDraft: mo,
188
+ commitDraft: po,
189
+ commitAll: bl,
190
+ discardAll: kl,
191
+ isDraft: wo,
192
+ getDraftErrors: Co
193
+ } = Xl({
194
+ schema: h(i, "schema"),
195
+ groupFieldId: h(i, "groupBy")
196
+ }), hl = b(() => Fe.value.size > 0);
197
+ function ml() {
198
+ i.schema ? gl() : c("add-row");
199
+ }
200
+ function pl() {
201
+ const l = bl();
202
+ l.length > 0 && c("drafts-commit-all", { records: l });
203
+ }
204
+ function wl() {
205
+ kl();
206
+ }
207
+ const w = S({ visible: !1, colKey: "", colLabel: "", x: 0, y: 0 }), X = S(!1);
208
+ function fe(l, o) {
209
+ var r;
210
+ const e = C.value.find((d) => d.key === o), n = (r = i.fieldDefs) == null ? void 0 : r.find((d) => d.id === o);
211
+ w.value = {
212
+ visible: !0,
213
+ colKey: o,
214
+ colLabel: (e == null ? void 0 : e.label) ?? o,
215
+ fieldType: n == null ? void 0 : n.type,
216
+ x: l.clientX,
217
+ y: l.clientY
218
+ };
219
+ }
220
+ function ce(l) {
221
+ var e, n;
222
+ const o = C.value.find((r) => r.key === l);
223
+ w.value = {
224
+ visible: !0,
225
+ colKey: l,
226
+ colLabel: (o == null ? void 0 : o.label) ?? l,
227
+ fieldType: (n = (e = i.fieldDefs) == null ? void 0 : e.find((r) => r.id === l)) == null ? void 0 : n.type,
228
+ x: 200,
229
+ y: 100
230
+ };
231
+ }
232
+ function Cl(l, o) {
233
+ c("schema-rename-field", { fieldId: l, newName: o });
234
+ }
235
+ function Dl(l, o) {
236
+ c("schema-change-field-type", { fieldId: l, newType: o });
237
+ }
238
+ function xl(l) {
239
+ c("schema-hide-field", l);
240
+ }
241
+ function Rl(l) {
242
+ c("schema-delete-field", l);
243
+ }
244
+ function Sl(l) {
245
+ c("schema-duplicate-field", l);
246
+ }
247
+ function ve() {
248
+ X.value = !0;
249
+ }
250
+ function Ml(l) {
251
+ c("schema-add-field", l), X.value = !1;
252
+ }
253
+ const $ = b(() => i.readonly ? !1 : i.selectable), He = b(() => i.readonly ? !1 : i.addable), $l = b(() => Array.from(p.value)), Be = b(() => p.value.size > 0 && !oe.value);
254
+ function Ie() {
255
+ el(V.value);
256
+ }
257
+ function U(l) {
258
+ const o = V.value.find((e) => e[i.rowKey] === l);
259
+ o && ll(o, 0);
260
+ }
261
+ be($l, (l) => c("selection-change", l), { immediate: !1 });
262
+ function u(l) {
263
+ const o = l[i.rowKey];
264
+ return o != null ? String(o) : "";
265
+ }
266
+ function F(l) {
267
+ var o;
268
+ return ((o = i.fieldDefs) == null ? void 0 : o.find((e) => e.id === l)) ?? {
269
+ id: l,
101
270
  type: "text",
102
- label: e
271
+ label: l
103
272
  };
104
273
  }
105
- function E(e, l, o) {
106
- U(e, l, o), s("cell-edit", { rowId: e, fieldId: l, value: o });
274
+ function H(l, o, e) {
275
+ je(l, o, e), c("cell-edit", { rowId: l, fieldId: o, value: e });
107
276
  }
108
- function G(e) {
109
- const l = e;
110
- if (l.__record) {
111
- s("row-click-record", l.__record), s("row-click", l.__record);
277
+ function B(l) {
278
+ if (he.value) {
279
+ P.value = l, G.value = !0;
280
+ return;
281
+ }
282
+ const o = l;
283
+ if (o.__record) {
284
+ c("row-click-record", o.__record), c("row-click", o.__record);
112
285
  return;
113
286
  }
114
- s("row-click", e);
287
+ c("row-click", l);
288
+ }
289
+ function ye(l, o) {
290
+ Ue(l, o);
291
+ }
292
+ function ge(l) {
293
+ Ze(l, te.value);
294
+ }
295
+ function Tl(l) {
296
+ rl(l);
297
+ const o = l.target;
298
+ we.value = o.scrollLeft;
115
299
  }
116
- function K(e) {
300
+ function q(l) {
117
301
  return {
118
- groupKey: e.__groupKey,
119
- count: e.__groupCount,
120
- collapsed: Q.value.has(e.__groupKey),
121
- colorMap: t.groupColorMap,
122
- selectable: C.value
302
+ groupKey: l.__groupKey,
303
+ count: l.__groupCount,
304
+ collapsed: tl.value.has(
305
+ l.__groupPath ? l.__groupPath.join("/") : l.__groupKey
306
+ ),
307
+ colorMap: i.groupColorMap,
308
+ selectable: $.value,
309
+ level: l.__groupLevel ?? 0,
310
+ aggregations: l.__aggregations
123
311
  };
124
312
  }
125
- function x(e) {
313
+ function J(l) {
314
+ return l.__groupPath ? l.__groupPath.join("/") : l.__groupKey;
315
+ }
316
+ function Ke(l) {
126
317
  return {
127
- row: e,
128
- rowKey: t.rowKey,
129
- selected: w.value.has(h(e)),
130
- selectable: C.value,
131
- columns: R.value,
132
- priorityColorMap: t.priorityColorMap,
133
- statusColorMap: t.statusColorMap
318
+ row: l,
319
+ rowKey: i.rowKey,
320
+ selected: p.value.has(u(l)),
321
+ selectable: $.value,
322
+ columns: C.value,
323
+ priorityColorMap: i.priorityColorMap,
324
+ statusColorMap: i.statusColorMap
134
325
  };
135
326
  }
136
- return (e, l) => (a(), c("div", ge, [
137
- b(ce, {
138
- columns: r(R),
139
- selectable: C.value,
140
- "sort-key": r(S).field ?? "",
141
- "sort-order": r(S).order ?? "asc",
142
- "all-selected": r(D),
143
- indeterminate: re.value,
144
- onSort: r(W),
145
- onSelectAll: ae
146
- }, null, 8, ["columns", "selectable", "sort-key", "sort-order", "all-selected", "indeterminate", "onSort"]),
147
- $("div", {
148
- ref_key: "scrollContainerRef",
149
- ref: A,
150
- class: "of-data-table-scroll-container"
151
- }, [
152
- X.value ? (a(), c("div", {
153
- key: 0,
154
- style: V({ height: r(ee) + "px", position: "relative" })
327
+ function Ee(l, o) {
328
+ const e = Re.value;
329
+ return e !== null && e.rowId === l && e.colKey === o;
330
+ }
331
+ function _e(l, o) {
332
+ return dl.value.some((e) => e.rowId === l && e.colKey === o);
333
+ }
334
+ function Le(l) {
335
+ const o = u(l);
336
+ return {
337
+ "of-row-dragging": ul.value && fl.value === o,
338
+ "of-row-drop-target": ue.value === o,
339
+ "of-row-drop-before": ue.value === o && Me.value === "before",
340
+ "of-row-drop-after": ue.value === o && Me.value === "after"
341
+ };
342
+ }
343
+ function zl(l) {
344
+ P.value = l, G.value = !0;
345
+ }
346
+ function Al(l) {
347
+ for (const [o, e] of Object.entries(l.fields))
348
+ c("cell-edit", { rowId: l.rowId, fieldId: o, value: e });
349
+ }
350
+ return (l, o) => t(he) ? (a(), s(v, { key: 0 }, [
351
+ T(Il, {
352
+ rows: t(V),
353
+ columns: C.value,
354
+ selectable: $.value,
355
+ addable: He.value,
356
+ "status-color-map": f.statusColorMap,
357
+ readonly: f.readonly,
358
+ onRowClick: zl,
359
+ onAddRow: o[0] || (o[0] = (e) => c("add-row"))
360
+ }, null, 8, ["rows", "columns", "selectable", "addable", "status-color-map", "readonly"]),
361
+ P.value ? (a(), y(Kl, {
362
+ key: 0,
363
+ row: P.value,
364
+ columns: C.value,
365
+ "field-defs": f.fieldDefs,
366
+ visible: G.value,
367
+ onClose: o[1] || (o[1] = (e) => G.value = !1),
368
+ onSave: Al,
369
+ onDelete: o[2] || (o[2] = (e) => c("row-click", { id: e, __action: "delete" })),
370
+ onCellEdit: o[3] || (o[3] = (e) => c("cell-edit", e))
371
+ }, null, 8, ["row", "columns", "field-defs", "visible"])) : M("", !0)
372
+ ], 64)) : (a(), s("div", {
373
+ key: 1,
374
+ ref_key: "tableContainerRef",
375
+ ref: te,
376
+ class: "of-data-table",
377
+ role: "grid",
378
+ tabindex: f.enableKeyboard ? 0 : void 0,
379
+ onKeydown: o[14] || (o[14] = (e) => f.enableKeyboard ? t(il)(e) : void 0)
380
+ }, [
381
+ nl.value ? (a(), s("div", ql, [
382
+ g("div", {
383
+ ref_key: "fixedContainerRef",
384
+ ref: pe,
385
+ class: z(["of-data-table-fixed-region", { "of-fixed-shadow": al.value }]),
386
+ style: k({ width: t(Ce) + "px" }),
387
+ onScroll: o[8] || (o[8] = //@ts-ignore
388
+ (...e) => t(De) && t(De)(...e))
155
389
  }, [
156
- $("div", {
157
- style: V({ transform: `translateY(${r(oe)}px)` })
158
- }, [
159
- (a(!0), c(v, null, z(r(Z), ({ data: o }) => {
160
- var u;
161
- return a(), c(v, {
162
- key: o.id
390
+ T(ke, {
391
+ columns: t(ne),
392
+ selectable: $.value,
393
+ "sort-key": t(A).field ?? "",
394
+ "sort-order": t(A).order ?? "asc",
395
+ "all-selected": t(oe),
396
+ indeterminate: Be.value,
397
+ "enable-resize": f.enableResize,
398
+ "enable-field-menu": f.enableFieldManagement,
399
+ "enable-add-field": f.enableFieldManagement,
400
+ onSort: t(O),
401
+ onSelectAll: Ie,
402
+ onResizeStart: ye,
403
+ onResizeDblclick: ge,
404
+ onHeaderContextmenu: fe,
405
+ onHeaderDblclick: ce,
406
+ onAddField: ve
407
+ }, null, 8, ["columns", "selectable", "sort-key", "sort-order", "all-selected", "indeterminate", "enable-resize", "enable-field-menu", "enable-add-field", "onSort"]),
408
+ g("div", Jl, [
409
+ re.value ? (a(), s("div", {
410
+ key: 0,
411
+ style: k({ height: t(de) + "px", position: "relative" })
412
+ }, [
413
+ g("div", {
414
+ style: k({ transform: `translateY(${t(ie)}px)` })
415
+ }, [
416
+ (a(!0), s(v, null, m(t(se), ({ data: e, index: n }) => (a(), s(v, {
417
+ key: e.id
418
+ }, [
419
+ t(x)(e) ? (a(), y(Z, K({
420
+ key: 0,
421
+ ref_for: !0,
422
+ ref: (r) => t(j)((r == null ? void 0 : r.$el) ?? r, n)
423
+ }, { ref_for: !0 }, q(e), {
424
+ onToggle: (r) => t(N)(J(e))
425
+ }), null, 16, ["onToggle"])) : (a(), s("div", {
426
+ key: 1,
427
+ ref_for: !0,
428
+ ref: (r) => t(j)(r, n),
429
+ class: z(["of-table-row", {
430
+ "of-table-row--selected": t(p).has(u(e)),
431
+ "of-table-row--hover": t(Y)(u(e))
432
+ }]),
433
+ onMouseenter: (r) => t(R)(u(e)),
434
+ onMouseleave: o[5] || (o[5] = (r) => t(R)(null)),
435
+ onClick: (r) => B(e)
436
+ }, [
437
+ $.value ? (a(), s("div", {
438
+ key: 0,
439
+ class: "of-td of-td-checkbox",
440
+ onClick: o[4] || (o[4] = _(() => {
441
+ }, ["stop"]))
442
+ }, [
443
+ g("input", {
444
+ type: "checkbox",
445
+ class: "of-checkbox",
446
+ checked: t(p).has(u(e)),
447
+ onChange: (r) => U(u(e))
448
+ }, null, 40, Zl)
449
+ ])) : M("", !0),
450
+ (a(!0), s(v, null, m(t(ne), (r) => (a(), s("div", {
451
+ key: r.key,
452
+ class: "of-td",
453
+ style: k({
454
+ width: (r.width === "fill" ? 200 : r.width) + "px",
455
+ flexShrink: "0"
456
+ })
457
+ }, [
458
+ Q(l.$slots, "cell", {
459
+ row: e,
460
+ col: r
461
+ }, () => {
462
+ var d;
463
+ return [
464
+ (d = f.fieldDefs) != null && d.length ? (a(), y(E, {
465
+ key: 0,
466
+ "row-id": u(e),
467
+ field: F(r.key),
468
+ value: e[r.key],
469
+ onCommit: H
470
+ }, null, 8, ["row-id", "field", "value"])) : (a(), s("span", eo, L(e[r.key] ?? "-"), 1))
471
+ ];
472
+ }, !0)
473
+ ], 4))), 128))
474
+ ], 42, Ql))
475
+ ], 64))), 128))
476
+ ], 4)
477
+ ], 4)) : (a(!0), s(v, { key: 1 }, m(t(D), (e) => (a(), s(v, {
478
+ key: e.id
479
+ }, [
480
+ t(x)(e) ? (a(), y(Z, K({
481
+ key: 0,
482
+ ref_for: !0
483
+ }, q(e), {
484
+ onToggle: (n) => t(N)(J(e))
485
+ }), null, 16, ["onToggle"])) : (a(), s("div", {
486
+ key: 1,
487
+ class: z(["of-table-row", {
488
+ "of-table-row--selected": t(p).has(u(e)),
489
+ "of-table-row--hover": t(Y)(u(e))
490
+ }]),
491
+ onMouseenter: (n) => t(R)(u(e)),
492
+ onMouseleave: o[7] || (o[7] = (n) => t(R)(null)),
493
+ onClick: (n) => B(e)
163
494
  }, [
164
- r(_)(o) ? (a(), m(L, y({
495
+ $.value ? (a(), s("div", {
165
496
  key: 0,
166
- ref_for: !0
167
- }, K(o), {
168
- onToggle: (n) => r(B)(o.__groupKey)
169
- }), null, 16, ["onToggle"])) : (a(), m(F, y({
170
- key: 1,
171
- ref_for: !0
172
- }, x(o), {
173
- onSelect: H,
174
- onClick: (n) => G(o)
175
- }), N({ _: 2 }, [
176
- (u = g.fieldDefs) != null && u.length ? {
177
- name: "cell",
178
- fn: P(({ row: n, col: d }) => [
179
- b(O, {
180
- "row-id": h(n),
181
- field: M(d.key),
182
- value: n[d.key],
183
- onCommit: E
184
- }, null, 8, ["row-id", "field", "value"])
185
- ]),
186
- key: "0"
187
- } : void 0
188
- ]), 1040, ["onClick"]))
189
- ], 64);
190
- }), 128))
191
- ], 4)
192
- ], 4)) : (a(!0), c(v, { key: 1 }, z(r(p), (o) => {
193
- var u;
194
- return a(), c(v, {
195
- key: o.id
196
- }, [
197
- r(_)(o) ? (a(), m(L, y({
497
+ class: "of-td of-td-checkbox",
498
+ onClick: o[6] || (o[6] = _(() => {
499
+ }, ["stop"]))
500
+ }, [
501
+ g("input", {
502
+ type: "checkbox",
503
+ class: "of-checkbox",
504
+ checked: t(p).has(u(e)),
505
+ onChange: (n) => U(u(e))
506
+ }, null, 40, oo)
507
+ ])) : M("", !0),
508
+ (a(!0), s(v, null, m(t(ne), (n) => (a(), s("div", {
509
+ key: n.key,
510
+ class: "of-td",
511
+ style: k({
512
+ width: (n.width === "fill" ? 200 : n.width) + "px",
513
+ flexShrink: "0"
514
+ })
515
+ }, [
516
+ Q(l.$slots, "cell", {
517
+ row: e,
518
+ col: n
519
+ }, () => {
520
+ var r;
521
+ return [
522
+ (r = f.fieldDefs) != null && r.length ? (a(), y(E, {
523
+ key: 0,
524
+ "row-id": u(e),
525
+ field: F(n.key),
526
+ value: e[n.key],
527
+ onCommit: H
528
+ }, null, 8, ["row-id", "field", "value"])) : (a(), s("span", to, L(e[n.key] ?? "-"), 1))
529
+ ];
530
+ }, !0)
531
+ ], 4))), 128))
532
+ ], 42, lo))
533
+ ], 64))), 128))
534
+ ])
535
+ ], 38),
536
+ g("div", {
537
+ ref_key: "scrollContainerRef",
538
+ ref: W,
539
+ class: "of-data-table-scroll-region",
540
+ style: k({ marginLeft: t(Ce) + "px" }),
541
+ onScroll: Tl
542
+ }, [
543
+ T(ke, {
544
+ columns: t(ae),
545
+ selectable: !1,
546
+ "sort-key": t(A).field ?? "",
547
+ "sort-order": t(A).order ?? "asc",
548
+ "enable-resize": f.enableResize,
549
+ "enable-field-menu": f.enableFieldManagement,
550
+ "enable-add-field": f.enableFieldManagement,
551
+ onSort: t(O),
552
+ onResizeStart: ye,
553
+ onResizeDblclick: ge,
554
+ onHeaderContextmenu: fe,
555
+ onHeaderDblclick: ce,
556
+ onAddField: ve
557
+ }, null, 8, ["columns", "sort-key", "sort-order", "enable-resize", "enable-field-menu", "enable-add-field", "onSort"]),
558
+ g("div", no, [
559
+ re.value ? (a(), s("div", {
198
560
  key: 0,
199
- ref_for: !0
200
- }, K(o), {
201
- onToggle: (n) => r(B)(o.__groupKey)
202
- }), null, 16, ["onToggle"])) : (a(), m(F, y({
203
- key: 1,
204
- ref_for: !0
205
- }, x(o), {
206
- onSelect: H,
207
- onClick: (n) => G(o)
208
- }), N({ _: 2 }, [
209
- (u = g.fieldDefs) != null && u.length ? {
210
- name: "cell",
211
- fn: P(({ row: n, col: d }) => [
212
- b(O, {
213
- "row-id": h(n),
214
- field: M(d.key),
215
- value: n[d.key],
216
- onCommit: E
217
- }, null, 8, ["row-id", "field", "value"])
218
- ]),
219
- key: "0"
220
- } : void 0
221
- ]), 1040, ["onClick"]))
222
- ], 64);
223
- }), 128))
224
- ], 512),
225
- te.value ? (a(), m(ue, {
226
- key: 0,
227
- onClick: l[0] || (l[0] = (o) => s("add-row"))
228
- })) : ie("", !0)
229
- ]));
561
+ style: k({ height: t(de) + "px", position: "relative" })
562
+ }, [
563
+ g("div", {
564
+ style: k({ transform: `translateY(${t(ie)}px)` })
565
+ }, [
566
+ (a(!0), s(v, null, m(t(se), ({ data: e }) => (a(), s(v, {
567
+ key: e.id
568
+ }, [
569
+ t(x)(e) ? (a(), s("div", ao)) : (a(), s("div", {
570
+ key: 1,
571
+ class: z(["of-table-row", {
572
+ "of-table-row--selected": t(p).has(u(e)),
573
+ "of-table-row--hover": t(Y)(u(e))
574
+ }]),
575
+ onMouseenter: (n) => t(R)(u(e)),
576
+ onMouseleave: o[9] || (o[9] = (n) => t(R)(null)),
577
+ onClick: (n) => B(e)
578
+ }, [
579
+ (a(!0), s(v, null, m(t(ae), (n) => (a(), s("div", {
580
+ key: n.key,
581
+ class: "of-td",
582
+ style: k({
583
+ width: n.width === "fill" ? void 0 : n.width + "px",
584
+ flex: n.width === "fill" ? "1 1 " + (n.minWidth ?? 220) + "px" : "0 0 auto"
585
+ })
586
+ }, [
587
+ Q(l.$slots, "cell", {
588
+ row: e,
589
+ col: n
590
+ }, () => {
591
+ var r;
592
+ return [
593
+ (r = f.fieldDefs) != null && r.length ? (a(), y(E, {
594
+ key: 0,
595
+ "row-id": u(e),
596
+ field: F(n.key),
597
+ value: e[n.key],
598
+ onCommit: H
599
+ }, null, 8, ["row-id", "field", "value"])) : (a(), s("span", so, L(e[n.key] ?? "-"), 1))
600
+ ];
601
+ }, !0)
602
+ ], 4))), 128))
603
+ ], 42, ro))
604
+ ], 64))), 128))
605
+ ], 4)
606
+ ], 4)) : (a(!0), s(v, { key: 1 }, m(t(D), (e) => (a(), s(v, {
607
+ key: e.id
608
+ }, [
609
+ t(x)(e) ? (a(), s("div", io)) : (a(), s("div", {
610
+ key: 1,
611
+ class: z(["of-table-row", {
612
+ "of-table-row--selected": t(p).has(u(e)),
613
+ "of-table-row--hover": t(Y)(u(e))
614
+ }]),
615
+ onMouseenter: (n) => t(R)(u(e)),
616
+ onMouseleave: o[10] || (o[10] = (n) => t(R)(null)),
617
+ onClick: (n) => B(e)
618
+ }, [
619
+ (a(!0), s(v, null, m(t(ae), (n) => (a(), s("div", {
620
+ key: n.key,
621
+ class: "of-td",
622
+ style: k({
623
+ width: n.width === "fill" ? void 0 : n.width + "px",
624
+ flex: n.width === "fill" ? "1 1 " + (n.minWidth ?? 220) + "px" : "0 0 auto"
625
+ })
626
+ }, [
627
+ Q(l.$slots, "cell", {
628
+ row: e,
629
+ col: n
630
+ }, () => {
631
+ var r;
632
+ return [
633
+ (r = f.fieldDefs) != null && r.length ? (a(), y(E, {
634
+ key: 0,
635
+ "row-id": u(e),
636
+ field: F(n.key),
637
+ value: e[n.key],
638
+ onCommit: H
639
+ }, null, 8, ["row-id", "field", "value"])) : (a(), s("span", fo, L(e[n.key] ?? "-"), 1))
640
+ ];
641
+ }, !0)
642
+ ], 4))), 128))
643
+ ], 42, uo))
644
+ ], 64))), 128))
645
+ ])
646
+ ], 36)
647
+ ])) : (a(), s(v, { key: 1 }, [
648
+ T(ke, {
649
+ columns: C.value,
650
+ selectable: $.value,
651
+ "sort-key": t(A).field ?? "",
652
+ "sort-order": t(A).order ?? "asc",
653
+ "all-selected": t(oe),
654
+ indeterminate: Be.value,
655
+ "enable-resize": f.enableResize,
656
+ "enable-field-menu": f.enableFieldManagement,
657
+ "enable-add-field": f.enableFieldManagement,
658
+ onSort: t(O),
659
+ onSelectAll: Ie,
660
+ onResizeStart: ye,
661
+ onResizeDblclick: ge,
662
+ onHeaderContextmenu: fe,
663
+ onHeaderDblclick: ce,
664
+ onAddField: ve
665
+ }, null, 8, ["columns", "selectable", "sort-key", "sort-order", "all-selected", "indeterminate", "enable-resize", "enable-field-menu", "enable-add-field", "onSort"]),
666
+ g("div", {
667
+ ref_key: "scrollContainerRef",
668
+ ref: W,
669
+ class: "of-data-table-scroll-container"
670
+ }, [
671
+ re.value ? (a(), s("div", {
672
+ key: 0,
673
+ style: k({ height: t(de) + "px", position: "relative" })
674
+ }, [
675
+ g("div", {
676
+ style: k({ transform: `translateY(${t(ie)}px)` })
677
+ }, [
678
+ (a(!0), s(v, null, m(t(se), ({ data: e, index: n }) => {
679
+ var r;
680
+ return a(), s(v, {
681
+ key: e.id
682
+ }, [
683
+ t(x)(e) ? (a(), y(Z, K({
684
+ key: 0,
685
+ ref_for: !0,
686
+ ref: (d) => t(j)((d == null ? void 0 : d.$el) ?? d, n)
687
+ }, { ref_for: !0 }, q(e), {
688
+ onToggle: (d) => t(N)(J(e))
689
+ }), null, 16, ["onToggle"])) : (a(), y(Oe, K({
690
+ key: 1,
691
+ ref_for: !0,
692
+ ref: (d) => t(j)((d == null ? void 0 : d.$el) ?? d, n)
693
+ }, { ref_for: !0 }, Ke(e), {
694
+ draggable: f.enableRowDrag,
695
+ class: Le(e),
696
+ onSelect: U,
697
+ onClick: (d) => B(e),
698
+ onDragstart: (d) => Te(d, e),
699
+ onDragover: (d) => ze(d, e),
700
+ onDrop: (d) => Ae(d, e),
701
+ onDragend: t($e)
702
+ }), Pe({ _: 2 }, [
703
+ (r = f.fieldDefs) != null && r.length ? {
704
+ name: "cell",
705
+ fn: Ve(({ row: d, col: I }) => [
706
+ T(E, {
707
+ "row-id": u(d),
708
+ field: F(I.key),
709
+ value: d[I.key],
710
+ class: z({
711
+ "of-cell--active": Ee(u(d), I.key),
712
+ "of-cell--selected": _e(u(d), I.key)
713
+ }),
714
+ onCommit: H,
715
+ onClick: _((Do) => f.enableKeyboard && t(Se)(u(d), I.key), ["stop"])
716
+ }, null, 8, ["row-id", "field", "value", "class", "onClick"])
717
+ ]),
718
+ key: "0"
719
+ } : void 0
720
+ ]), 1040, ["draggable", "class", "onClick", "onDragstart", "onDragover", "onDrop", "onDragend"]))
721
+ ], 64);
722
+ }), 128))
723
+ ], 4)
724
+ ], 4)) : (a(!0), s(v, { key: 1 }, m(t(D), (e) => {
725
+ var n;
726
+ return a(), s(v, {
727
+ key: e.id
728
+ }, [
729
+ t(x)(e) ? (a(), y(Z, K({
730
+ key: 0,
731
+ ref_for: !0
732
+ }, q(e), {
733
+ onToggle: (r) => t(N)(J(e))
734
+ }), null, 16, ["onToggle"])) : (a(), y(Oe, K({
735
+ key: 1,
736
+ ref_for: !0
737
+ }, Ke(e), {
738
+ draggable: f.enableRowDrag,
739
+ class: Le(e),
740
+ onSelect: U,
741
+ onClick: (r) => B(e),
742
+ onDragstart: (r) => Te(r, e),
743
+ onDragover: (r) => ze(r, e),
744
+ onDrop: (r) => Ae(r, e),
745
+ onDragend: t($e)
746
+ }), Pe({ _: 2 }, [
747
+ (n = f.fieldDefs) != null && n.length ? {
748
+ name: "cell",
749
+ fn: Ve(({ row: r, col: d }) => [
750
+ T(E, {
751
+ "row-id": u(r),
752
+ field: F(d.key),
753
+ value: r[d.key],
754
+ class: z({
755
+ "of-cell--active": Ee(u(r), d.key),
756
+ "of-cell--selected": _e(u(r), d.key)
757
+ }),
758
+ onCommit: H,
759
+ onClick: _((I) => f.enableKeyboard && t(Se)(u(r), d.key), ["stop"])
760
+ }, null, 8, ["row-id", "field", "value", "class", "onClick"])
761
+ ]),
762
+ key: "0"
763
+ } : void 0
764
+ ]), 1040, ["draggable", "class", "onClick", "onDragstart", "onDragover", "onDrop", "onDragend"]))
765
+ ], 64);
766
+ }), 128))
767
+ ], 512)
768
+ ], 64)),
769
+ t(Je) ? (a(), s("div", {
770
+ key: 2,
771
+ class: "of-resize-indicator",
772
+ style: k({ left: t(Qe) + "px" })
773
+ }, null, 4)) : M("", !0),
774
+ hl.value ? (a(), s("div", co, [
775
+ g("span", vo, L(t(Fe).size) + " 条草稿", 1),
776
+ g("button", {
777
+ class: "of-data-table-draft-btn of-data-table-draft-btn--commit",
778
+ onClick: pl
779
+ }, " 全部提交 "),
780
+ g("button", {
781
+ class: "of-data-table-draft-btn of-data-table-draft-btn--discard",
782
+ onClick: wl
783
+ }, " 全部放弃 ")
784
+ ])) : M("", !0),
785
+ He.value ? (a(), y(Bl, {
786
+ key: 4,
787
+ onClick: ml
788
+ })) : M("", !0),
789
+ f.enableFieldManagement ? (a(), y(t(We), {
790
+ key: 5,
791
+ visible: w.value.visible,
792
+ "col-key": w.value.colKey,
793
+ "col-label": w.value.colLabel,
794
+ "field-type": w.value.fieldType,
795
+ x: w.value.x,
796
+ y: w.value.y,
797
+ onClose: o[11] || (o[11] = (e) => w.value.visible = !1),
798
+ onRename: Cl,
799
+ onChangeType: Dl,
800
+ onSort: o[12] || (o[12] = (e, n) => t(O)(e)),
801
+ onHide: xl,
802
+ onDelete: Rl,
803
+ onDuplicate: Sl
804
+ }, null, 8, ["visible", "col-key", "col-label", "field-type", "x", "y"])) : M("", !0),
805
+ (a(), y(Hl, { to: "body" }, [
806
+ X.value ? (a(), s("div", {
807
+ key: 0,
808
+ class: "of-add-field-overlay",
809
+ onClick: o[13] || (o[13] = _((e) => X.value = !1, ["self"]))
810
+ }, [
811
+ g("div", yo, [
812
+ T(t(Ye), { onSelect: Ml })
813
+ ])
814
+ ])) : M("", !0)
815
+ ]))
816
+ ], 40, Ul));
230
817
  }
231
818
  });
232
819
  export {
233
- Ee as default
820
+ No as default
234
821
  };