@oneflowui/ui 0.5.4 → 0.5.5

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