@oneflowui/ui 0.5.4 → 0.5.6

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";
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 = {
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, createSlots as Hl, withCtx as he, renderSlot as T, normalizeProps as Bl, guardReactiveProps as Il, createBlock as y, createCommentVNode as $, createElementVNode as g, normalizeStyle as k, normalizeClass as z, renderList as m, mergeProps as K, withModifiers as P, toDisplayString as A, Teleport as Kl } from "vue";
2
+ import me from "./TableHeaderRow.vue.js";
3
+ import Ve from "./TableDataRow.vue.js";
4
+ import Q from "./TableGroupRow.vue.js";
5
+ import _l from "./NewRowBtn.vue.js";
6
+ import El from "./MobileListView.vue.js";
7
+ import _ from "./FieldCell.vue.js";
8
+ import { useInlineEdit as Pl } from "../../composables/useInlineEdit.js";
9
+ import { useVirtualList as Ll } from "../../composables/useVirtualList.js";
10
+ import { useTable as Gl } from "../../composables/useTable.js";
11
+ import { useTableGroup as Vl } from "../../composables/useTableGroup.js";
12
+ import { useTableData as Ol } from "../../composables/useTableData.js";
13
+ import { useTableColumns as Nl } from "../../composables/useTableColumns.js";
14
+ import { useColumnResize as Wl } from "../../composables/useColumnResize.js";
15
+ import { useKeyboardNavigation as Yl } from "../../composables/useKeyboardNavigation.js";
16
+ import { useBreakpoint as jl } from "../../composables/useBreakpoint.js";
17
+ import { useFixedColumns as Xl } from "../../composables/useFixedColumns.js";
18
+ import { useRowDrag as Ul } from "../../composables/useRowDrag.js";
19
+ import { useDraftRows as ql } from "../../composables/useDraftRows.js";
20
+ const Jl = ["tabindex"], Ql = {
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
+ }, Zl = { class: "of-data-table-fixed-body" }, eo = ["onMouseenter", "onClick"], lo = ["checked", "onChange"], oo = {
25
25
  key: 1,
26
26
  class: "of-td-text"
27
- }, lo = ["onMouseenter", "onClick"], oo = ["checked", "onChange"], to = {
27
+ }, to = ["onMouseenter", "onClick"], no = ["checked", "onChange"], ao = {
28
28
  key: 1,
29
29
  class: "of-td-text"
30
- }, no = { class: "of-data-table-scroll-body" }, ao = {
30
+ }, ro = { class: "of-data-table-scroll-body" }, so = {
31
31
  key: 0,
32
32
  style: { height: "36px" }
33
- }, ro = ["onMouseenter", "onClick"], so = {
33
+ }, io = ["onMouseenter", "onClick"], uo = {
34
34
  key: 1,
35
35
  class: "of-td-text"
36
- }, io = {
36
+ }, fo = {
37
37
  key: 0,
38
38
  style: { height: "36px" }
39
- }, uo = ["onMouseenter", "onClick"], fo = {
39
+ }, co = ["onMouseenter", "onClick"], vo = {
40
40
  key: 1,
41
41
  class: "of-td-text"
42
- }, co = {
42
+ }, yo = {
43
+ key: 1,
44
+ class: "of-td-text"
45
+ }, go = {
46
+ key: 1,
47
+ class: "of-td-text"
48
+ }, bo = {
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
+ }, ko = { class: "of-data-table-draft-count" }, ho = { class: "of-add-field-popup" }, mo = 36, po = 44, jo = /* @__PURE__ */ Fl({
46
52
  __name: "DataTable",
47
53
  props: {
48
54
  tasks: {},
@@ -71,142 +77,142 @@ 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: pe } = jl(), L = R(!1), G = R(null), Z = Pl(), { commit: je, editingCell: Xe } = Z, { rows: we } = Ol({
82
+ tasks: h(d, "tasks"),
83
+ records: h(d, "records")
84
+ }), { columns: ee } = Nl({
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 } = Wl({
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
  });
91
97
  }), {
92
98
  data: V,
93
- sort: A,
99
+ sort: F,
94
100
  toggleSort: O,
95
101
  selectedRows: p,
96
- toggleSelectAll: ll,
97
- toggleRowSelection: ol,
98
- isAllSelected: oe,
99
- setData: tl
100
- } = Ll({
101
- data: pe.value,
102
+ toggleSelectAll: el,
103
+ toggleRowSelection: ll,
104
+ isAllSelected: le,
105
+ setData: ol
106
+ } = Gl({
107
+ data: we.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(we, (l) => ol(l), { deep: !1 });
111
+ const { groupedItems: D, collapsedGroups: tl, toggleGroup: N, isGroupHeader: x } = Vl({
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), Ce = 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,
116
- fixedWidth: De,
117
- handleScroll: sl,
118
- handleFixedScroll: xe,
119
- scrollLeft: ko,
120
- syncHover: R,
118
+ return (((l = d.fixedColumns) == null ? void 0 : l.length) ?? 0) > 0;
119
+ }), De = R(0), al = b(() => De.value > 0), {
120
+ fixedColumns: te,
121
+ scrollableColumns: ne,
122
+ fixedWidth: xe,
123
+ handleScroll: rl,
124
+ handleFixedScroll: Se,
125
+ scrollLeft: wo,
126
+ syncHover: S,
121
127
  isRowHovered: Y
122
- } = Yl({
128
+ } = Xl({
123
129
  columns: C,
124
- fixedColumnKeys: b(() => i.fixedColumns ?? []),
130
+ fixedColumnKeys: b(() => d.fixedColumns ?? []),
125
131
  scrollContainerRef: W,
126
- 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({
132
+ fixedContainerRef: Ce
133
+ }), ae = b(() => d.virtual !== void 0 ? d.virtual : D.value.length >= d.virtualThreshold), { visibleItems: re, totalHeight: se, offsetY: de, scrollToIndex: sl, observeRow: j } = Ll({
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) ? mo : po;
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
+ }), Re = b(() => D.value.filter((l) => !x(l))), { activeCell: $e, selectedRange: dl, setActiveCell: Me, handleKeyDown: il } = Yl({
137
143
  columns: C,
138
144
  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),
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 = Re.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($e, (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,
164
- handleDragEnd: Te
165
- } = jl({
163
+ isDragging: ul,
164
+ draggedRowId: fl,
165
+ dropTargetId: ie,
166
+ dropPosition: Te,
167
+ handleDragStart: cl,
168
+ handleDragOver: vl,
169
+ handleDrop: yl,
170
+ handleDragEnd: ze
171
+ } = Ul({
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
- function ze(l, o) {
171
- i.enableRowDrag && vl(l, o);
172
- }
173
176
  function Ae(l, o) {
174
- i.enableRowDrag && yl(l, o);
177
+ d.enableRowDrag && cl(l, o);
175
178
  }
176
179
  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)
180
+ d.enableRowDrag && vl(l, o);
181
+ }
182
+ function He(l, o) {
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
- 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);
189
+ drafts: Be,
190
+ addDraft: gl,
191
+ updateDraftField: Co,
192
+ removeDraft: Do,
193
+ commitDraft: xo,
194
+ commitAll: bl,
195
+ discardAll: kl,
196
+ isDraft: So,
197
+ getDraftErrors: Ro
198
+ } = ql({
199
+ schema: h(d, "schema"),
200
+ groupFieldId: h(d, "groupBy")
201
+ }), hl = b(() => Be.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,95 +222,95 @@ 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), Ie = b(() => d.readonly ? !1 : d.addable), Ml = b(() => Array.from(p.value)), Ke = 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
- function F(l) {
271
+ function H(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
- function H(l, o, e) {
274
- Xe(l, o, e), c("cell-edit", { rowId: l, fieldId: o, value: e });
279
+ function B(l, o, e) {
280
+ je(l, o, e), f("cell-edit", { rowId: l, fieldId: o, value: e });
275
281
  }
276
- function B(l) {
277
- if (me.value) {
278
- P.value = l, G.value = !0;
282
+ function I(l) {
283
+ if (pe.value) {
284
+ G.value = l, L.value = !0;
279
285
  return;
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
- Ce.value = o.scrollLeft;
303
+ De.value = o.scrollLeft;
298
304
  }
299
305
  function q(l) {
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
  };
@@ -315,220 +321,234 @@ const Ul = ["tabindex"], ql = {
315
321
  function Ee(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 Pe(l, o) {
333
+ const e = $e.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 && Te.value === "before",
345
+ "of-row-drop-after": ie.value === o && Te.value === "after"
340
346
  };
341
347
  }
342
- function Al(l) {
343
- P.value = l, G.value = !0;
348
+ function zl(l) {
349
+ G.value = l, L.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(pe) ? (r(), s(c, { key: 0 }, [
356
+ E(El, {
351
357
  rows: t(V),
352
358
  columns: C.value,
353
- selectable: $.value,
354
- 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"))
359
- }, null, 8, ["rows", "columns", "selectable", "addable", "status-color-map", "readonly"]),
360
- P.value ? (a(), y(t(je), {
359
+ selectable: M.value,
360
+ addable: Ie.value,
361
+ "status-color-map": u.statusColorMap,
362
+ readonly: u.readonly,
363
+ onRowClick: zl,
364
+ onAddRow: o[0] || (o[0] = (e) => f("add-row"))
365
+ }, Hl({ _: 2 }, [
366
+ l.$slots.cell ? {
367
+ name: "cell",
368
+ fn: he((e) => [
369
+ T(l.$slots, "cell", Bl(Il(e)), void 0, !0)
370
+ ]),
371
+ key: "0"
372
+ } : void 0
373
+ ]), 1032, ["rows", "columns", "selectable", "addable", "status-color-map", "readonly"]),
374
+ G.value ? (r(), y(t(Ye), {
361
375
  key: 0,
362
- row: P.value,
376
+ row: G.value,
363
377
  columns: C.value,
364
- "field-defs": f.fieldDefs,
365
- visible: G.value,
366
- 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", {
378
+ "field-defs": u.fieldDefs,
379
+ visible: L.value,
380
+ onClose: o[1] || (o[1] = (e) => L.value = !1),
381
+ onSave: Al,
382
+ onDelete: o[2] || (o[2] = (e) => f("row-click", { id: e, __action: "delete" })),
383
+ onCellEdit: o[3] || (o[3] = (e) => f("cell-edit", e))
384
+ }, null, 8, ["row", "columns", "field-defs", "visible"])) : $("", !0)
385
+ ], 64)) : (r(), s("div", {
372
386
  key: 1,
373
387
  ref_key: "tableContainerRef",
374
- ref: te,
388
+ ref: oe,
375
389
  class: "of-data-table",
376
390
  role: "grid",
377
- tabindex: f.enableKeyboard ? 0 : void 0,
378
- onKeydown: o[14] || (o[14] = (e) => f.enableKeyboard ? t(ul)(e) : void 0)
391
+ tabindex: u.enableKeyboard ? 0 : void 0,
392
+ onKeydown: o[14] || (o[14] = (e) => u.enableKeyboard ? t(il)(e) : void 0)
379
393
  }, [
380
- al.value ? (a(), s("div", ql, [
394
+ nl.value ? (r(), s("div", Ql, [
381
395
  g("div", {
382
396
  ref_key: "fixedContainerRef",
383
- ref: we,
384
- class: z(["of-data-table-fixed-region", { "of-fixed-shadow": rl.value }]),
385
- style: k({ width: t(De) + "px" }),
397
+ ref: Ce,
398
+ class: z(["of-data-table-fixed-region", { "of-fixed-shadow": al.value }]),
399
+ style: k({ width: t(xe) + "px" }),
386
400
  onScroll: o[8] || (o[8] = //@ts-ignore
387
- (...e) => t(xe) && t(xe)(...e))
401
+ (...e) => t(Se) && t(Se)(...e))
388
402
  }, [
389
- T(he, {
390
- columns: t(ne),
391
- selectable: $.value,
392
- "sort-key": t(A).field ?? "",
393
- "sort-order": t(A).order ?? "asc",
394
- "all-selected": t(oe),
395
- indeterminate: Ie.value,
396
- "enable-resize": f.enableResize,
397
- "enable-field-menu": f.enableFieldManagement,
398
- "enable-add-field": f.enableFieldManagement,
403
+ E(me, {
404
+ columns: t(te),
405
+ selectable: M.value,
406
+ "sort-key": t(F).field ?? "",
407
+ "sort-order": t(F).order ?? "asc",
408
+ "all-selected": t(le),
409
+ indeterminate: Ke.value,
410
+ "enable-resize": u.enableResize,
411
+ "enable-field-menu": u.enableFieldManagement,
412
+ "enable-add-field": u.enableFieldManagement,
399
413
  onSort: t(O),
400
- onSelectAll: Ke,
401
- onResizeStart: ye,
402
- onResizeDblclick: ge,
403
- onHeaderContextmenu: fe,
404
- onHeaderDblclick: ce,
405
- onAddField: ve
414
+ onSelectAll: _e,
415
+ onResizeStart: ve,
416
+ onResizeDblclick: ye,
417
+ onHeaderContextmenu: ue,
418
+ onHeaderDblclick: fe,
419
+ onAddField: ce
406
420
  }, 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", {
421
+ g("div", Zl, [
422
+ ae.value ? (r(), s("div", {
409
423
  key: 0,
410
- style: k({ height: t(de) + "px", position: "relative" })
424
+ style: k({ height: t(se) + "px", position: "relative" })
411
425
  }, [
412
426
  g("div", {
413
- style: k({ transform: `translateY(${t(ie)}px)` })
427
+ style: k({ transform: `translateY(${t(de)}px)` })
414
428
  }, [
415
- (a(!0), s(v, null, m(t(se), ({ data: e, index: n }) => (a(), s(v, {
429
+ (r(!0), s(c, null, m(t(re), ({ data: e, index: n }) => (r(), s(c, {
416
430
  key: e.id
417
431
  }, [
418
- t(x)(e) ? (a(), y(Z, K({
432
+ t(x)(e) ? (r(), y(Q, K({
419
433
  key: 0,
420
434
  ref_for: !0,
421
- ref: (r) => t(j)((r == null ? void 0 : r.$el) ?? r, n)
435
+ ref: (a) => t(j)((a == null ? void 0 : a.$el) ?? a, n)
422
436
  }, { ref_for: !0 }, q(e), {
423
- onToggle: (r) => t(N)(J(e))
424
- }), null, 16, ["onToggle"])) : (a(), s("div", {
437
+ onToggle: (a) => t(N)(J(e))
438
+ }), null, 16, ["onToggle"])) : (r(), s("div", {
425
439
  key: 1,
426
440
  ref_for: !0,
427
- ref: (r) => t(j)(r, n),
441
+ ref: (a) => t(j)(a, n),
428
442
  class: z(["of-table-row", {
429
- "of-table-row--selected": t(p).has(u(e)),
430
- "of-table-row--hover": t(Y)(u(e))
443
+ "of-table-row--selected": t(p).has(i(e)),
444
+ "of-table-row--hover": t(Y)(i(e))
431
445
  }]),
432
- onMouseenter: (r) => t(R)(u(e)),
433
- onMouseleave: o[5] || (o[5] = (r) => t(R)(null)),
434
- onClick: (r) => B(e)
446
+ role: "row",
447
+ onMouseenter: (a) => t(S)(i(e)),
448
+ onMouseleave: o[5] || (o[5] = (a) => t(S)(null)),
449
+ onClick: (a) => I(e)
435
450
  }, [
436
- $.value ? (a(), s("div", {
451
+ M.value ? (r(), s("div", {
437
452
  key: 0,
438
453
  class: "of-td of-td-checkbox",
439
- onClick: o[4] || (o[4] = _(() => {
454
+ role: "gridcell",
455
+ onClick: o[4] || (o[4] = P(() => {
440
456
  }, ["stop"]))
441
457
  }, [
442
458
  g("input", {
443
459
  type: "checkbox",
444
460
  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,
461
+ checked: t(p).has(i(e)),
462
+ onChange: (a) => U(i(e))
463
+ }, null, 40, lo)
464
+ ])) : $("", !0),
465
+ (r(!0), s(c, null, m(t(te), (a) => (r(), s("div", {
466
+ key: a.key,
451
467
  class: "of-td",
468
+ role: "gridcell",
452
469
  style: k({
453
- width: (r.width === "fill" ? 200 : r.width) + "px",
470
+ width: (a.width === "fill" ? 200 : a.width) + "px",
454
471
  flexShrink: "0"
455
472
  })
456
473
  }, [
457
- Q(l.$slots, "cell", {
474
+ T(l.$slots, "cell", {
458
475
  row: e,
459
- col: r
476
+ col: a
460
477
  }, () => {
461
- var d;
478
+ var v;
462
479
  return [
463
- (d = f.fieldDefs) != null && d.length ? (a(), y(E, {
480
+ (v = u.fieldDefs) != null && v.length ? (r(), y(_, {
464
481
  key: 0,
465
- "row-id": u(e),
466
- field: F(r.key),
467
- value: e[r.key],
468
- onCommit: H
469
- }, null, 8, ["row-id", "field", "value"])) : (a(), s("span", eo, L(e[r.key] ?? "-"), 1))
482
+ "row-id": i(e),
483
+ field: H(a.key),
484
+ value: e[a.key],
485
+ onCommit: B
486
+ }, null, 8, ["row-id", "field", "value"])) : (r(), s("span", oo, A(e[a.key] ?? "-"), 1))
470
487
  ];
471
488
  }, !0)
472
489
  ], 4))), 128))
473
- ], 42, Ql))
490
+ ], 42, eo))
474
491
  ], 64))), 128))
475
492
  ], 4)
476
- ], 4)) : (a(!0), s(v, { key: 1 }, m(t(D), (e) => (a(), s(v, {
493
+ ], 4)) : (r(!0), s(c, { key: 1 }, m(t(D), (e) => (r(), s(c, {
477
494
  key: e.id
478
495
  }, [
479
- t(x)(e) ? (a(), y(Z, K({
496
+ t(x)(e) ? (r(), y(Q, K({
480
497
  key: 0,
481
498
  ref_for: !0
482
499
  }, q(e), {
483
500
  onToggle: (n) => t(N)(J(e))
484
- }), null, 16, ["onToggle"])) : (a(), s("div", {
501
+ }), null, 16, ["onToggle"])) : (r(), s("div", {
485
502
  key: 1,
486
503
  class: z(["of-table-row", {
487
- "of-table-row--selected": t(p).has(u(e)),
488
- "of-table-row--hover": t(Y)(u(e))
504
+ "of-table-row--selected": t(p).has(i(e)),
505
+ "of-table-row--hover": t(Y)(i(e))
489
506
  }]),
490
- onMouseenter: (n) => t(R)(u(e)),
491
- onMouseleave: o[7] || (o[7] = (n) => t(R)(null)),
492
- onClick: (n) => B(e)
507
+ role: "row",
508
+ onMouseenter: (n) => t(S)(i(e)),
509
+ onMouseleave: o[7] || (o[7] = (n) => t(S)(null)),
510
+ onClick: (n) => I(e)
493
511
  }, [
494
- $.value ? (a(), s("div", {
512
+ M.value ? (r(), s("div", {
495
513
  key: 0,
496
514
  class: "of-td of-td-checkbox",
497
- onClick: o[6] || (o[6] = _(() => {
515
+ role: "gridcell",
516
+ onClick: o[6] || (o[6] = P(() => {
498
517
  }, ["stop"]))
499
518
  }, [
500
519
  g("input", {
501
520
  type: "checkbox",
502
521
  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", {
522
+ checked: t(p).has(i(e)),
523
+ onChange: (n) => U(i(e))
524
+ }, null, 40, no)
525
+ ])) : $("", !0),
526
+ (r(!0), s(c, null, m(t(te), (n) => (r(), s("div", {
508
527
  key: n.key,
509
528
  class: "of-td",
529
+ role: "gridcell",
510
530
  style: k({
511
531
  width: (n.width === "fill" ? 200 : n.width) + "px",
512
532
  flexShrink: "0"
513
533
  })
514
534
  }, [
515
- Q(l.$slots, "cell", {
535
+ T(l.$slots, "cell", {
516
536
  row: e,
517
537
  col: n
518
538
  }, () => {
519
- var r;
539
+ var a;
520
540
  return [
521
- (r = f.fieldDefs) != null && r.length ? (a(), y(E, {
541
+ (a = u.fieldDefs) != null && a.length ? (r(), y(_, {
522
542
  key: 0,
523
- "row-id": u(e),
524
- field: F(n.key),
543
+ "row-id": i(e),
544
+ field: H(n.key),
525
545
  value: e[n.key],
526
- onCommit: H
527
- }, null, 8, ["row-id", "field", "value"])) : (a(), s("span", to, L(e[n.key] ?? "-"), 1))
546
+ onCommit: B
547
+ }, null, 8, ["row-id", "field", "value"])) : (r(), s("span", ao, A(e[n.key] ?? "-"), 1))
528
548
  ];
529
549
  }, !0)
530
550
  ], 4))), 128))
531
- ], 42, lo))
551
+ ], 42, to))
532
552
  ], 64))), 128))
533
553
  ])
534
554
  ], 38),
@@ -536,256 +556,266 @@ const Ul = ["tabindex"], ql = {
536
556
  ref_key: "scrollContainerRef",
537
557
  ref: W,
538
558
  class: "of-data-table-scroll-region",
539
- style: k({ marginLeft: t(De) + "px" }),
540
- onScroll: zl
559
+ style: k({ marginLeft: t(xe) + "px" }),
560
+ onScroll: Tl
541
561
  }, [
542
- T(he, {
543
- columns: t(ae),
562
+ E(me, {
563
+ columns: t(ne),
544
564
  selectable: !1,
545
- "sort-key": t(A).field ?? "",
546
- "sort-order": t(A).order ?? "asc",
547
- "enable-resize": f.enableResize,
548
- "enable-field-menu": f.enableFieldManagement,
549
- "enable-add-field": f.enableFieldManagement,
565
+ "sort-key": t(F).field ?? "",
566
+ "sort-order": t(F).order ?? "asc",
567
+ "enable-resize": u.enableResize,
568
+ "enable-field-menu": u.enableFieldManagement,
569
+ "enable-add-field": u.enableFieldManagement,
550
570
  onSort: t(O),
551
- onResizeStart: ye,
552
- onResizeDblclick: ge,
553
- onHeaderContextmenu: fe,
554
- onHeaderDblclick: ce,
555
- onAddField: ve
571
+ onResizeStart: ve,
572
+ onResizeDblclick: ye,
573
+ onHeaderContextmenu: ue,
574
+ onHeaderDblclick: fe,
575
+ onAddField: ce
556
576
  }, 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", {
577
+ g("div", ro, [
578
+ ae.value ? (r(), s("div", {
559
579
  key: 0,
560
- style: k({ height: t(de) + "px", position: "relative" })
580
+ style: k({ height: t(se) + "px", position: "relative" })
561
581
  }, [
562
582
  g("div", {
563
- style: k({ transform: `translateY(${t(ie)}px)` })
583
+ style: k({ transform: `translateY(${t(de)}px)` })
564
584
  }, [
565
- (a(!0), s(v, null, m(t(se), ({ data: e }) => (a(), s(v, {
585
+ (r(!0), s(c, null, m(t(re), ({ data: e }) => (r(), s(c, {
566
586
  key: e.id
567
587
  }, [
568
- t(x)(e) ? (a(), s("div", ao)) : (a(), s("div", {
588
+ t(x)(e) ? (r(), s("div", so)) : (r(), s("div", {
569
589
  key: 1,
570
590
  class: z(["of-table-row", {
571
- "of-table-row--selected": t(p).has(u(e)),
572
- "of-table-row--hover": t(Y)(u(e))
591
+ "of-table-row--selected": t(p).has(i(e)),
592
+ "of-table-row--hover": t(Y)(i(e))
573
593
  }]),
574
- onMouseenter: (n) => t(R)(u(e)),
575
- onMouseleave: o[9] || (o[9] = (n) => t(R)(null)),
576
- onClick: (n) => B(e)
594
+ role: "row",
595
+ onMouseenter: (n) => t(S)(i(e)),
596
+ onMouseleave: o[9] || (o[9] = (n) => t(S)(null)),
597
+ onClick: (n) => I(e)
577
598
  }, [
578
- (a(!0), s(v, null, m(t(ae), (n) => (a(), s("div", {
599
+ (r(!0), s(c, null, m(t(ne), (n) => (r(), s("div", {
579
600
  key: n.key,
580
601
  class: "of-td",
602
+ role: "gridcell",
581
603
  style: k({
582
604
  width: n.width === "fill" ? void 0 : n.width + "px",
583
605
  flex: n.width === "fill" ? "1 1 " + (n.minWidth ?? 220) + "px" : "0 0 auto"
584
606
  })
585
607
  }, [
586
- Q(l.$slots, "cell", {
608
+ T(l.$slots, "cell", {
587
609
  row: e,
588
610
  col: n
589
611
  }, () => {
590
- var r;
612
+ var a;
591
613
  return [
592
- (r = f.fieldDefs) != null && r.length ? (a(), y(E, {
614
+ (a = u.fieldDefs) != null && a.length ? (r(), y(_, {
593
615
  key: 0,
594
- "row-id": u(e),
595
- field: F(n.key),
616
+ "row-id": i(e),
617
+ field: H(n.key),
596
618
  value: e[n.key],
597
- onCommit: H
598
- }, null, 8, ["row-id", "field", "value"])) : (a(), s("span", so, L(e[n.key] ?? "-"), 1))
619
+ onCommit: B
620
+ }, null, 8, ["row-id", "field", "value"])) : (r(), s("span", uo, A(e[n.key] ?? "-"), 1))
599
621
  ];
600
622
  }, !0)
601
623
  ], 4))), 128))
602
- ], 42, ro))
624
+ ], 42, io))
603
625
  ], 64))), 128))
604
626
  ], 4)
605
- ], 4)) : (a(!0), s(v, { key: 1 }, m(t(D), (e) => (a(), s(v, {
627
+ ], 4)) : (r(!0), s(c, { key: 1 }, m(t(D), (e) => (r(), s(c, {
606
628
  key: e.id
607
629
  }, [
608
- t(x)(e) ? (a(), s("div", io)) : (a(), s("div", {
630
+ t(x)(e) ? (r(), s("div", fo)) : (r(), s("div", {
609
631
  key: 1,
610
632
  class: z(["of-table-row", {
611
- "of-table-row--selected": t(p).has(u(e)),
612
- "of-table-row--hover": t(Y)(u(e))
633
+ "of-table-row--selected": t(p).has(i(e)),
634
+ "of-table-row--hover": t(Y)(i(e))
613
635
  }]),
614
- onMouseenter: (n) => t(R)(u(e)),
615
- onMouseleave: o[10] || (o[10] = (n) => t(R)(null)),
616
- onClick: (n) => B(e)
636
+ role: "row",
637
+ onMouseenter: (n) => t(S)(i(e)),
638
+ onMouseleave: o[10] || (o[10] = (n) => t(S)(null)),
639
+ onClick: (n) => I(e)
617
640
  }, [
618
- (a(!0), s(v, null, m(t(ae), (n) => (a(), s("div", {
641
+ (r(!0), s(c, null, m(t(ne), (n) => (r(), s("div", {
619
642
  key: n.key,
620
643
  class: "of-td",
644
+ role: "gridcell",
621
645
  style: k({
622
646
  width: n.width === "fill" ? void 0 : n.width + "px",
623
647
  flex: n.width === "fill" ? "1 1 " + (n.minWidth ?? 220) + "px" : "0 0 auto"
624
648
  })
625
649
  }, [
626
- Q(l.$slots, "cell", {
650
+ T(l.$slots, "cell", {
627
651
  row: e,
628
652
  col: n
629
653
  }, () => {
630
- var r;
654
+ var a;
631
655
  return [
632
- (r = f.fieldDefs) != null && r.length ? (a(), y(E, {
656
+ (a = u.fieldDefs) != null && a.length ? (r(), y(_, {
633
657
  key: 0,
634
- "row-id": u(e),
635
- field: F(n.key),
658
+ "row-id": i(e),
659
+ field: H(n.key),
636
660
  value: e[n.key],
637
- onCommit: H
638
- }, null, 8, ["row-id", "field", "value"])) : (a(), s("span", fo, L(e[n.key] ?? "-"), 1))
661
+ onCommit: B
662
+ }, null, 8, ["row-id", "field", "value"])) : (r(), s("span", vo, A(e[n.key] ?? "-"), 1))
639
663
  ];
640
664
  }, !0)
641
665
  ], 4))), 128))
642
- ], 42, uo))
666
+ ], 42, co))
643
667
  ], 64))), 128))
644
668
  ])
645
669
  ], 36)
646
- ])) : (a(), s(v, { key: 1 }, [
647
- T(he, {
670
+ ])) : (r(), s(c, { key: 1 }, [
671
+ E(me, {
648
672
  columns: C.value,
649
- selectable: $.value,
650
- "sort-key": t(A).field ?? "",
651
- "sort-order": t(A).order ?? "asc",
652
- "all-selected": t(oe),
653
- indeterminate: Ie.value,
654
- "enable-resize": f.enableResize,
655
- "enable-field-menu": f.enableFieldManagement,
656
- "enable-add-field": f.enableFieldManagement,
673
+ selectable: M.value,
674
+ "sort-key": t(F).field ?? "",
675
+ "sort-order": t(F).order ?? "asc",
676
+ "all-selected": t(le),
677
+ indeterminate: Ke.value,
678
+ "enable-resize": u.enableResize,
679
+ "enable-field-menu": u.enableFieldManagement,
680
+ "enable-add-field": u.enableFieldManagement,
657
681
  onSort: t(O),
658
- onSelectAll: Ke,
659
- onResizeStart: ye,
660
- onResizeDblclick: ge,
661
- onHeaderContextmenu: fe,
662
- onHeaderDblclick: ce,
663
- onAddField: ve
682
+ onSelectAll: _e,
683
+ onResizeStart: ve,
684
+ onResizeDblclick: ye,
685
+ onHeaderContextmenu: ue,
686
+ onHeaderDblclick: fe,
687
+ onAddField: ce
664
688
  }, null, 8, ["columns", "selectable", "sort-key", "sort-order", "all-selected", "indeterminate", "enable-resize", "enable-field-menu", "enable-add-field", "onSort"]),
665
689
  g("div", {
666
690
  ref_key: "scrollContainerRef",
667
691
  ref: W,
668
692
  class: "of-data-table-scroll-container"
669
693
  }, [
670
- re.value ? (a(), s("div", {
694
+ ae.value ? (r(), s("div", {
671
695
  key: 0,
672
- style: k({ height: t(de) + "px", position: "relative" })
696
+ style: k({ height: t(se) + "px", position: "relative" })
673
697
  }, [
674
698
  g("div", {
675
- style: k({ transform: `translateY(${t(ie)}px)` })
699
+ style: k({ transform: `translateY(${t(de)}px)` })
676
700
  }, [
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],
701
+ (r(!0), s(c, null, m(t(re), ({ data: e, index: n }) => (r(), s(c, {
702
+ key: e.id
703
+ }, [
704
+ t(x)(e) ? (r(), y(Q, K({
705
+ key: 0,
706
+ ref_for: !0,
707
+ ref: (a) => t(j)((a == null ? void 0 : a.$el) ?? a, n)
708
+ }, { ref_for: !0 }, q(e), {
709
+ onToggle: (a) => t(N)(J(e))
710
+ }), null, 16, ["onToggle"])) : (r(), y(Ve, K({
711
+ key: 1,
712
+ ref_for: !0,
713
+ ref: (a) => t(j)((a == null ? void 0 : a.$el) ?? a, n)
714
+ }, { ref_for: !0 }, Ee(e), {
715
+ draggable: u.enableRowDrag,
716
+ class: Ge(e),
717
+ onSelect: U,
718
+ onClick: (a) => I(e),
719
+ onDragstart: (a) => Ae(a, e),
720
+ onDragover: (a) => Fe(a, e),
721
+ onDrop: (a) => He(a, e),
722
+ onDragend: t(ze)
723
+ }), {
724
+ cell: he(({ row: a, col: v }) => [
725
+ T(l.$slots, "cell", {
726
+ row: a,
727
+ col: v
728
+ }, () => {
729
+ var ge;
730
+ return [
731
+ (ge = u.fieldDefs) != null && ge.length ? (r(), y(_, {
732
+ key: 0,
733
+ "row-id": i(a),
734
+ field: H(v.key),
735
+ value: a[v.key],
709
736
  class: z({
710
- "of-cell--active": _e(u(d), I.key),
711
- "of-cell--selected": Le(u(d), I.key)
737
+ "of-cell--active": Pe(i(a), v.key),
738
+ "of-cell--selected": Le(i(a), v.key)
712
739
  }),
713
- 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))
740
+ onCommit: B,
741
+ onClick: P(($o) => u.enableKeyboard && t(Me)(i(a), v.key), ["stop"])
742
+ }, null, 8, ["row-id", "field", "value", "class", "onClick"])) : (r(), s("span", yo, A(a[v.key] ?? "-"), 1))
743
+ ];
744
+ }, !0)
745
+ ]),
746
+ _: 3
747
+ }, 16, ["draggable", "class", "onClick", "onDragstart", "onDragover", "onDrop", "onDragend"]))
748
+ ], 64))), 128))
722
749
  ], 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],
750
+ ], 4)) : (r(!0), s(c, { key: 1 }, m(t(D), (e) => (r(), s(c, {
751
+ key: e.id
752
+ }, [
753
+ t(x)(e) ? (r(), y(Q, K({
754
+ key: 0,
755
+ ref_for: !0
756
+ }, q(e), {
757
+ onToggle: (n) => t(N)(J(e))
758
+ }), null, 16, ["onToggle"])) : (r(), y(Ve, K({
759
+ key: 1,
760
+ ref_for: !0
761
+ }, Ee(e), {
762
+ draggable: u.enableRowDrag,
763
+ class: Ge(e),
764
+ onSelect: U,
765
+ onClick: (n) => I(e),
766
+ onDragstart: (n) => Ae(n, e),
767
+ onDragover: (n) => Fe(n, e),
768
+ onDrop: (n) => He(n, e),
769
+ onDragend: t(ze)
770
+ }), {
771
+ cell: he(({ row: n, col: a }) => [
772
+ T(l.$slots, "cell", {
773
+ row: n,
774
+ col: a
775
+ }, () => {
776
+ var v;
777
+ return [
778
+ (v = u.fieldDefs) != null && v.length ? (r(), y(_, {
779
+ key: 0,
780
+ "row-id": i(n),
781
+ field: H(a.key),
782
+ value: n[a.key],
753
783
  class: z({
754
- "of-cell--active": _e(u(r), d.key),
755
- "of-cell--selected": Le(u(r), d.key)
784
+ "of-cell--active": Pe(i(n), a.key),
785
+ "of-cell--selected": Le(i(n), a.key)
756
786
  }),
757
- 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))
787
+ onCommit: B,
788
+ onClick: P((ge) => u.enableKeyboard && t(Me)(i(n), a.key), ["stop"])
789
+ }, null, 8, ["row-id", "field", "value", "class", "onClick"])) : (r(), s("span", go, A(n[a.key] ?? "-"), 1))
790
+ ];
791
+ }, !0)
792
+ ]),
793
+ _: 3
794
+ }, 16, ["draggable", "class", "onClick", "onDragstart", "onDragover", "onDrop", "onDragend"]))
795
+ ], 64))), 128))
766
796
  ], 512)
767
797
  ], 64)),
768
- t(Qe) ? (a(), s("div", {
798
+ t(Je) ? (r(), s("div", {
769
799
  key: 2,
770
800
  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),
801
+ style: k({ left: t(Qe) + "px" })
802
+ }, null, 4)) : $("", !0),
803
+ hl.value ? (r(), s("div", bo, [
804
+ g("span", ko, A(t(Be).size) + " 条草稿", 1),
775
805
  g("button", {
776
806
  class: "of-data-table-draft-btn of-data-table-draft-btn--commit",
777
- onClick: wl
807
+ onClick: pl
778
808
  }, " 全部提交 "),
779
809
  g("button", {
780
810
  class: "of-data-table-draft-btn of-data-table-draft-btn--discard",
781
- onClick: Cl
811
+ onClick: wl
782
812
  }, " 全部放弃 ")
783
- ])) : M("", !0),
784
- Be.value ? (a(), y(Il, {
813
+ ])) : $("", !0),
814
+ Ie.value ? (r(), y(_l, {
785
815
  key: 4,
786
- onClick: pl
787
- })) : M("", !0),
788
- f.enableFieldManagement ? (a(), y(t(We), {
816
+ onClick: ml
817
+ })) : $("", !0),
818
+ u.enableFieldManagement ? (r(), y(t(Ne), {
789
819
  key: 5,
790
820
  visible: w.value.visible,
791
821
  "col-key": w.value.colKey,
@@ -794,27 +824,27 @@ const Ul = ["tabindex"], ql = {
794
824
  x: w.value.x,
795
825
  y: w.value.y,
796
826
  onClose: o[11] || (o[11] = (e) => w.value.visible = !1),
797
- onRename: Dl,
798
- onChangeType: xl,
827
+ onRename: Cl,
828
+ onChangeType: Dl,
799
829
  onSort: o[12] || (o[12] = (e, n) => t(O)(e)),
800
- onHide: Rl,
830
+ onHide: xl,
801
831
  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", {
832
+ onDuplicate: Rl
833
+ }, null, 8, ["visible", "col-key", "col-label", "field-type", "x", "y"])) : $("", !0),
834
+ (r(), y(Kl, { to: "body" }, [
835
+ X.value ? (r(), s("div", {
806
836
  key: 0,
807
837
  class: "of-add-field-overlay",
808
- onClick: o[13] || (o[13] = _((e) => X.value = !1, ["self"]))
838
+ onClick: o[13] || (o[13] = P((e) => X.value = !1, ["self"]))
809
839
  }, [
810
- g("div", yo, [
811
- T(t(Ye), { onSelect: $l })
840
+ g("div", ho, [
841
+ E(t(We), { onSelect: $l })
812
842
  ])
813
- ])) : M("", !0)
843
+ ])) : $("", !0)
814
844
  ]))
815
- ], 40, Ul));
845
+ ], 40, Jl));
816
846
  }
817
847
  });
818
848
  export {
819
- Oo as default
849
+ jo as default
820
850
  };