@oneflowui/ui 0.8.3 → 0.8.4

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,50 +1,50 @@
1
- import { defineComponent as so, defineAsyncComponent as Qe, computed as k, ref as W, toRef as w, watch as Ue, unref as n, openBlock as r, createBlock as v, createSlots as io, withCtx as $, renderSlot as H, normalizeProps as uo, guardReactiveProps as co, createElementBlock as s, normalizeStyle as g, normalizeClass as F, createVNode as N, createElementVNode as h, Fragment as y, renderList as m, mergeProps as G, withModifiers as z, toDisplayString as B, createCommentVNode as M, Teleport as fo } from "vue";
2
- import Ce from "./TableHeaderRow.vue.js";
3
- import Ze from "./TableDataRow.vue.js";
4
- import de from "./TableGroupRow.vue.js";
5
- import yo from "./NewRowBtn.vue.js";
6
- import vo from "./DataTableDraftToolbar.vue.js";
7
- import bo from "./DataTableMobilePanel.vue.js";
8
- import go from "./DataTableDesktopFrame.vue.js";
9
- import V from "./FieldCell.vue.js";
10
- import { normalizeFieldType as _e, resolveRowId as ko, resolveFieldDef as wo, buildDataRowStyle as ho, buildBodyCellStyle as mo, buildGroupSpacerStyle as po, resolveFirstEditableFieldKey as Co } from "./dataTableUtils.js";
11
- import { useInlineEdit as Do } from "../../composables/useInlineEdit.js";
12
- import { useVirtualList as So } from "../../composables/useVirtualList.js";
13
- import { useTable as Ro } from "../../composables/useTable.js";
14
- import { useTableGroup as xo } from "../../composables/useTableGroup.js";
15
- import { useTableData as $o } from "../../composables/useTableData.js";
16
- import { useTableColumns as Fo } from "../../composables/useTableColumns.js";
17
- import { useColumnResize as Mo } from "../../composables/useColumnResize.js";
18
- import { useKeyboardNavigation as Ao } from "../../composables/useKeyboardNavigation.js";
19
- import { useBreakpoint as To } from "../../composables/useBreakpoint.js";
20
- import { useFixedColumns as Ko } from "../../composables/useFixedColumns.js";
21
- import { useRowDrag as zo } from "../../composables/useRowDrag.js";
22
- import { useDraftRows as Bo } from "../../composables/useDraftRows.js";
23
- import { useDataTableLayout as Ho } from "../../composables/useDataTableLayout.js";
24
- import { useDataTableSelection as Io } from "../../composables/useDataTableSelection.js";
25
- import { useDataTableDetailSheet as Eo } from "../../composables/useDataTableDetailSheet.js";
26
- const Po = ["onMouseenter", "onFocusin", "onClick", "onKeydown"], Lo = ["for"], Wo = ["id", "checked", "onChange"], Go = {
1
+ import { defineComponent as co, defineAsyncComponent as el, computed as k, ref as N, toRef as w, watch as ll, unref as n, openBlock as r, createBlock as v, createSlots as fo, withCtx as $, renderSlot as E, normalizeProps as yo, guardReactiveProps as vo, createElementBlock as i, normalizeStyle as g, normalizeClass as F, createVNode as j, createElementVNode as h, Fragment as y, renderList as p, mergeProps as O, withModifiers as z, toDisplayString as B, createCommentVNode as M, Teleport as bo } from "vue";
2
+ import xe from "./TableHeaderRow.vue.js";
3
+ import ol from "./TableDataRow.vue.js";
4
+ import ve from "./TableGroupRow.vue.js";
5
+ import go from "./NewRowBtn.vue.js";
6
+ import ko from "./DataTableDraftToolbar.vue.js";
7
+ import wo from "./DataTableMobilePanel.vue.js";
8
+ import ho from "./DataTableDesktopFrame.vue.js";
9
+ import Y from "./FieldCell.vue.js";
10
+ import { normalizeFieldType as nl, resolveRowId as po, resolveFieldDef as mo, buildDataRowStyle as Co, buildBodyCellStyle as Do, buildGroupSpacerStyle as Ro, resolveFirstEditableFieldKey as So } from "./dataTableUtils.js";
11
+ import { useInlineEdit as xo } from "../../composables/useInlineEdit.js";
12
+ import { useVirtualList as $o } from "../../composables/useVirtualList.js";
13
+ import { useTable as Fo } from "../../composables/useTable.js";
14
+ import { useTableGroup as Mo } from "../../composables/useTableGroup.js";
15
+ import { useTableData as Ao } from "../../composables/useTableData.js";
16
+ import { useTableColumns as To } from "../../composables/useTableColumns.js";
17
+ import { useColumnResize as Ko } from "../../composables/useColumnResize.js";
18
+ import { useKeyboardNavigation as zo } from "../../composables/useKeyboardNavigation.js";
19
+ import { useBreakpoint as Bo } from "../../composables/useBreakpoint.js";
20
+ import { useFixedColumns as Eo } from "../../composables/useFixedColumns.js";
21
+ import { useRowDrag as Ho } from "../../composables/useRowDrag.js";
22
+ import { useDraftRows as Io } from "../../composables/useDraftRows.js";
23
+ import { useDataTableLayout as Po } from "../../composables/useDataTableLayout.js";
24
+ import { useDataTableSelection as qo } from "../../composables/useDataTableSelection.js";
25
+ import { useDataTableDetailSheet as Lo } from "../../composables/useDataTableDetailSheet.js";
26
+ const Wo = ["onMouseenter", "onFocusin", "onClick", "onKeydown"], Go = ["for"], Vo = ["id", "checked", "onChange"], No = {
27
27
  key: 1,
28
28
  class: "of-td-text"
29
- }, Vo = ["disabled", "onClick"], No = ["onMouseenter", "onFocusin", "onClick", "onKeydown"], Oo = ["for"], Yo = ["id", "checked", "onChange"], jo = {
29
+ }, Oo = ["disabled", "onClick"], Yo = ["onMouseenter", "onFocusin", "onClick", "onKeydown"], jo = ["for"], Xo = ["id", "checked", "onChange"], Jo = {
30
30
  key: 1,
31
31
  class: "of-td-text"
32
- }, Xo = ["disabled", "onClick"], qo = ["onMouseenter", "onFocusin", "onClick", "onKeydown"], Jo = {
32
+ }, Qo = ["disabled", "onClick"], Uo = ["onMouseenter", "onFocusin", "onClick", "onKeydown"], Zo = {
33
33
  key: 1,
34
34
  class: "of-td-text"
35
- }, Qo = ["onMouseenter", "onFocusin", "onClick", "onKeydown"], Uo = {
35
+ }, _o = ["onMouseenter", "onFocusin", "onClick", "onKeydown"], en = {
36
36
  key: 1,
37
37
  class: "of-td-text"
38
- }, Zo = {
38
+ }, ln = {
39
39
  key: 1,
40
40
  class: "of-td-text"
41
- }, _o = {
41
+ }, on = {
42
42
  key: 1,
43
43
  class: "of-td-text"
44
- }, en = {
44
+ }, nn = {
45
45
  key: 0,
46
46
  class: "of-add-field-overlay"
47
- }, ln = { class: "of-add-field-popup" }, Mn = /* @__PURE__ */ so({
47
+ }, tn = { class: "of-add-field-popup" }, Kn = /* @__PURE__ */ co({
48
48
  __name: "DataTable",
49
49
  props: {
50
50
  tasks: { default: () => [] },
@@ -78,150 +78,150 @@ const Po = ["onMouseenter", "onFocusin", "onClick", "onKeydown"], Lo = ["for"],
78
78
  containerResponsive: { type: Boolean, default: !0 }
79
79
  },
80
80
  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", "row-delete", "schema-add-field", "schema-rename-field", "schema-change-field-type", "schema-hide-field", "schema-delete-field", "schema-duplicate-field", "bulk-action"],
81
- setup(u, { emit: el }) {
82
- const i = u, c = el, ll = Qe(() => import("./ColumnHeaderMenu.vue.js")), ol = Qe(() => import("./FieldTypePicker.vue.js")), nl = k(() => i.density ?? "standard"), { isMobile: ue } = To(), O = W(null), Y = W(null), De = W(null), {
81
+ setup(u, { emit: tl }) {
82
+ const d = u, c = tl, al = el(() => import("./ColumnHeaderMenu.vue.js")), rl = el(() => import("./FieldTypePicker.vue.js")), il = k(() => d.density ?? "standard"), { isMobile: be } = Bo(), X = N(null), J = N(null), $e = N(null), {
83
83
  containerDensity: A,
84
- densityMetrics: I,
85
- densityClass: Se,
86
- containerWidthClass: tl,
87
- densityStyle: Re
88
- } = Ho({
89
- tableContainerRef: Y,
90
- density: nl,
91
- containerResponsive: k(() => i.containerResponsive ?? !0),
92
- isMobile: ue
84
+ densityMetrics: H,
85
+ densityClass: Fe,
86
+ containerWidthClass: sl,
87
+ densityStyle: Me
88
+ } = Po({
89
+ tableContainerRef: J,
90
+ density: il,
91
+ containerResponsive: k(() => d.containerResponsive ?? !0),
92
+ isMobile: be
93
93
  }), {
94
- detailSheetVisible: al,
95
- detailSheetTableRow: rl,
96
- handleRowClick: sl,
97
- handleMobileRowClick: il,
98
- buildDetailSavePayloads: dl,
99
- closeDetailSheet: ul
100
- } = Eo(), cl = k(
101
- () => (i.fieldDefs ?? []).filter((e) => !e.readonly).map((e) => e.id)
94
+ detailSheetVisible: dl,
95
+ detailSheetTableRow: ul,
96
+ handleRowClick: cl,
97
+ handleMobileRowClick: fl,
98
+ buildDetailSavePayloads: yl,
99
+ closeDetailSheet: vl
100
+ } = Lo(), bl = k(
101
+ () => (d.fieldDefs ?? []).filter((e) => !e.readonly).map((e) => e.id)
102
102
  );
103
- function xe(e) {
104
- return Co({
103
+ function Ae(e) {
104
+ return So({
105
105
  row: e,
106
- readonly: i.readonly,
106
+ readonly: d.readonly,
107
107
  columns: D.value,
108
- editableFieldKeys: cl.value
108
+ editableFieldKeys: bl.value
109
109
  });
110
110
  }
111
- function j(e) {
111
+ function Q(e) {
112
112
  const o = [
113
113
  {
114
114
  key: "detail",
115
115
  label: "详情",
116
- onClick: () => p(e)
116
+ onClick: () => m(e)
117
117
  }
118
- ], l = xe(e);
118
+ ], l = Ae(e);
119
119
  return l && o.push({
120
120
  key: "edit",
121
121
  label: "编辑",
122
- onClick: () => $e(e, l)
122
+ onClick: () => Te(e, l)
123
123
  }), o;
124
124
  }
125
- function $e(e, o) {
126
- const l = d(e), t = o ?? xe(e);
125
+ function Te(e, o) {
126
+ const l = s(e), t = o ?? Ae(e);
127
127
  if (!t) {
128
- p(e);
128
+ m(e);
129
129
  return;
130
130
  }
131
- X.activate(l, t), i.enableKeyboard && ve(l, t);
131
+ I.activate(l, t), d.enableKeyboard && re(l, t);
132
132
  }
133
- function Fe(e, o) {
133
+ function Ke(e, o) {
134
134
  if (o === "detail") {
135
- p(e);
135
+ m(e);
136
136
  return;
137
137
  }
138
- o === "edit" && $e(e);
139
- }
140
- const X = Do(), { commit: fl, editingCell: yl } = X, { rows: ce } = $o({
141
- tasks: w(i, "tasks"),
142
- records: w(i, "records")
143
- }), { columns: Me } = Fo({
144
- columns: w(i, "columns"),
145
- schema: w(i, "schema"),
146
- view: w(i, "view")
138
+ o === "edit" && Te(e);
139
+ }
140
+ const I = xo(), { commit: gl, editingCell: U } = I, { rows: ge } = Ao({
141
+ tasks: w(d, "tasks"),
142
+ records: w(d, "records")
143
+ }), { columns: ze } = To({
144
+ columns: w(d, "columns"),
145
+ schema: w(d, "schema"),
146
+ view: w(d, "view")
147
147
  }), {
148
- startResize: vl,
149
- columnWidthOverrides: bl,
150
- showResizeIndicator: gl,
151
- resizeIndicatorX: kl,
152
- autoFitColumn: wl,
153
- resolvedWidth: Ae
154
- } = Mo({
155
- columns: Me,
156
- rows: ce,
148
+ startResize: kl,
149
+ columnWidthOverrides: wl,
150
+ showResizeIndicator: hl,
151
+ resizeIndicatorX: pl,
152
+ autoFitColumn: ml,
153
+ resolvedWidth: Be
154
+ } = Ko({
155
+ columns: ze,
156
+ rows: ge,
157
157
  density: A,
158
158
  onResize: (e, o) => c("column-resize", { colKey: e, width: o })
159
159
  }), D = k(() => {
160
- const e = bl.value;
161
- return Me.value.map((o) => {
160
+ const e = wl.value;
161
+ return ze.value.map((o) => {
162
162
  const l = e.get(o.key);
163
163
  return l !== void 0 ? { ...o, width: l } : o.width === "fill" ? {
164
164
  ...o,
165
- minWidth: o.minWidth ?? I.value.fillMinWidth
166
- } : typeof o.width == "number" ? o : { ...o, width: Ae(o.key) };
165
+ minWidth: o.minWidth ?? H.value.fillMinWidth
166
+ } : typeof o.width == "number" ? o : { ...o, width: Be(o.key) };
167
167
  });
168
168
  }), {
169
- data: fe,
170
- sort: E,
171
- toggleSort: q,
172
- selectedRows: S,
173
- clearSelection: hl,
174
- toggleSelectAll: ml,
175
- toggleRowSelection: pl,
176
- isAllSelected: Te,
177
- setData: Cl
178
- } = Ro({
179
- data: ce.value,
169
+ data: ke,
170
+ sort: P,
171
+ toggleSort: Z,
172
+ selectedRows: R,
173
+ clearSelection: Cl,
174
+ toggleSelectAll: Dl,
175
+ toggleRowSelection: Rl,
176
+ isAllSelected: Ee,
177
+ setData: Sl
178
+ } = Fo({
179
+ data: ge.value,
180
180
  pageSize: 999999
181
181
  });
182
- Ue(ce, (e) => Cl(e), { deep: !1 });
183
- const { groupedItems: T, collapsedGroups: Dl, toggleGroup: J, isGroupHeader: K } = xo({
184
- data: fe,
185
- groupBy: w(i, "groupBy"),
186
- groups: w(i, "groups"),
187
- aggregations: w(i, "aggregations")
188
- }), Sl = k(() => {
182
+ ll(ge, (e) => Sl(e), { deep: !1 });
183
+ const { groupedItems: T, collapsedGroups: xl, toggleGroup: _, isGroupHeader: K } = Mo({
184
+ data: ke,
185
+ groupBy: w(d, "groupBy"),
186
+ groups: w(d, "groups"),
187
+ aggregations: w(d, "aggregations")
188
+ }), $l = k(() => {
189
189
  var e;
190
- return (((e = i.fixedColumns) == null ? void 0 : e.length) ?? 0) > 0;
191
- }), Ke = W(0), Rl = k(() => Ke.value > 0), {
192
- fixedColumns: Q,
193
- scrollableColumns: U,
194
- fixedWidth: xl,
195
- handleScroll: $l,
196
- handleFixedScroll: Fl,
190
+ return (((e = d.fixedColumns) == null ? void 0 : e.length) ?? 0) > 0;
191
+ }), He = N(0), Fl = k(() => He.value > 0), {
192
+ fixedColumns: ee,
193
+ scrollableColumns: le,
194
+ fixedWidth: Ml,
195
+ handleScroll: Al,
196
+ handleFixedScroll: Tl,
197
197
  syncHover: b,
198
- isRowHovered: Z
199
- } = Ko({
198
+ isRowHovered: oe
199
+ } = Eo({
200
200
  columns: D,
201
- fixedColumnKeys: k(() => i.fixedColumns ?? []),
202
- scrollContainerRef: O,
203
- fixedContainerRef: De
204
- }), _ = k(() => i.virtual !== void 0 ? i.virtual : T.value.length >= i.virtualThreshold), { visibleItems: ye, totalHeight: ee, offsetY: le, scrollToIndex: Ml, observeRow: Al } = So({
201
+ fixedColumnKeys: k(() => d.fixedColumns ?? []),
202
+ scrollContainerRef: X,
203
+ fixedContainerRef: $e
204
+ }), ne = k(() => d.virtual !== void 0 ? d.virtual : T.value.length >= d.virtualThreshold), { visibleItems: we, totalHeight: te, offsetY: ae, scrollToIndex: Kl, observeRow: zl } = $o({
205
205
  items: T,
206
206
  itemHeight: (e) => {
207
207
  const o = T.value[e];
208
- return K(o) ? I.value.groupRowHeight : I.value.rowHeight;
208
+ return K(o) ? H.value.groupRowHeight : H.value.rowHeight;
209
209
  },
210
210
  overscan: 5,
211
- containerRef: O,
211
+ containerRef: X,
212
212
  invalidateKey: A,
213
213
  measureRow: !0
214
- }), ze = k(() => T.value.filter((e) => !K(e))), { activeCell: Be, selectedRange: Tl, setActiveCell: ve, handleKeyDown: Kl } = Ao({
214
+ }), Ie = k(() => T.value.filter((e) => !K(e))), { activeCell: Pe, selectedRange: Bl, setActiveCell: re, handleKeyDown: El } = zo({
215
215
  columns: D,
216
- rows: ze,
217
- containerRef: Y,
218
- editingCell: yl,
219
- enabled: k(() => i.enableKeyboard),
220
- onActivateEdit: (e, o) => X.activate(e, o),
221
- onCancelEdit: () => X.cancel(),
222
- onScrollToRow: (e) => Ml(e),
216
+ rows: Ie,
217
+ containerRef: J,
218
+ editingCell: U,
219
+ enabled: k(() => d.enableKeyboard),
220
+ onActivateEdit: (e, o) => I.activate(e, o),
221
+ onCancelEdit: () => I.cancel(),
222
+ onScrollToRow: (e) => Kl(e),
223
223
  getCellValue: (e, o) => {
224
- const l = ze.value.find((a) => a.id === e);
224
+ const l = Ie.value.find((a) => a.id === e);
225
225
  if (!l) return "";
226
226
  const t = l[o];
227
227
  return t != null ? String(t) : "";
@@ -230,124 +230,130 @@ const Po = ["onMouseenter", "onFocusin", "onClick", "onKeydown"], Lo = ["for"],
230
230
  c("paste", { startRowId: e, startColKey: o, data: l });
231
231
  }
232
232
  });
233
- Ue(Be, (e) => c("active-cell-change", e ?? null));
233
+ ll(Pe, (e) => c("active-cell-change", e ?? null));
234
234
  const {
235
- isDragging: zl,
236
- draggedRowId: Bl,
237
- dropTargetId: be,
238
- dropPosition: He,
239
- handleDragStart: Hl,
240
- handleDragOver: Il,
241
- handleDrop: El,
242
- handleDragEnd: Ie
243
- } = zo({
235
+ isDragging: Hl,
236
+ draggedRowId: Il,
237
+ dropTargetId: he,
238
+ dropPosition: qe,
239
+ handleDragStart: Pl,
240
+ handleDragOver: ql,
241
+ handleDrop: Ll,
242
+ handleDragEnd: Le
243
+ } = Ho({
244
244
  processedItems: T,
245
- enableCrossGroupDrag: k(() => i.enableCrossGroupDrag),
246
- groupFieldId: w(i, "groupBy")
245
+ enableCrossGroupDrag: k(() => d.enableCrossGroupDrag),
246
+ groupFieldId: w(d, "groupBy")
247
247
  });
248
- function Ee(e, o) {
249
- i.enableRowDrag && Hl(e, o);
248
+ function We(e, o) {
249
+ d.enableRowDrag && Pl(e, o);
250
250
  }
251
- function Pe(e, o) {
252
- i.enableRowDrag && Il(e, o);
251
+ function Ge(e, o) {
252
+ d.enableRowDrag && ql(e, o);
253
253
  }
254
- function Le(e, o) {
255
- i.enableRowDrag && El(e, o, {
254
+ function Ve(e, o) {
255
+ d.enableRowDrag && Ll(e, o, {
256
256
  onReorder: (l) => c("row-reorder", l),
257
257
  onGroupChange: (l) => c("row-group-change", l)
258
258
  });
259
259
  }
260
260
  const {
261
- drafts: We,
262
- addDraft: Pl,
263
- commitAll: Ll,
264
- discardAll: Wl
265
- } = Bo({
266
- schema: w(i, "schema"),
267
- groupFieldId: w(i, "groupBy")
268
- }), Gl = k(() => We.value.size > 0);
269
- function Vl() {
270
- i.schema ? Pl() : c("add-row");
271
- }
272
- function Nl() {
273
- const e = Ll();
261
+ drafts: Ne,
262
+ addDraft: Wl,
263
+ commitAll: Gl,
264
+ discardAll: Vl
265
+ } = Io({
266
+ schema: w(d, "schema"),
267
+ groupFieldId: w(d, "groupBy")
268
+ }), Nl = k(() => Ne.value.size > 0);
269
+ function Ol() {
270
+ d.schema ? Wl() : c("add-row");
271
+ }
272
+ function Yl() {
273
+ const e = Gl();
274
274
  e.length > 0 && c("drafts-commit-all", { records: e });
275
275
  }
276
- function Ol() {
277
- Wl();
276
+ function jl() {
277
+ Vl();
278
278
  }
279
- const R = W({ visible: !1, colKey: "", colLabel: "", x: 0, y: 0 }), oe = W(!1);
280
- function ge(e, o) {
279
+ const S = N({ visible: !1, colKey: "", colLabel: "", x: 0, y: 0 }), ie = N(!1);
280
+ function pe(e, o) {
281
281
  var a;
282
- const l = D.value.find((f) => f.key === o), t = (a = i.fieldDefs) == null ? void 0 : a.find((f) => f.id === o);
283
- R.value = {
282
+ const l = D.value.find((f) => f.key === o), t = (a = d.fieldDefs) == null ? void 0 : a.find((f) => f.id === o);
283
+ S.value = {
284
284
  visible: !0,
285
285
  colKey: o,
286
286
  colLabel: (l == null ? void 0 : l.label) ?? o,
287
- fieldType: _e(t == null ? void 0 : t.type),
287
+ fieldType: nl(t == null ? void 0 : t.type),
288
288
  x: e.clientX,
289
289
  y: e.clientY
290
290
  };
291
291
  }
292
- function ke(e) {
292
+ function me(e) {
293
293
  var l, t;
294
294
  const o = D.value.find((a) => a.key === e);
295
- R.value = {
295
+ S.value = {
296
296
  visible: !0,
297
297
  colKey: e,
298
298
  colLabel: (o == null ? void 0 : o.label) ?? e,
299
- fieldType: _e((t = (l = i.fieldDefs) == null ? void 0 : l.find((a) => a.id === e)) == null ? void 0 : t.type),
299
+ fieldType: nl((t = (l = d.fieldDefs) == null ? void 0 : l.find((a) => a.id === e)) == null ? void 0 : t.type),
300
300
  x: 200,
301
301
  y: 100
302
302
  };
303
303
  }
304
- function Yl(e, o) {
304
+ function Xl(e, o) {
305
305
  c("schema-rename-field", { fieldId: e, newName: o });
306
306
  }
307
- function jl(e, o) {
307
+ function Jl(e, o) {
308
308
  c("schema-change-field-type", { fieldId: e, newType: o });
309
309
  }
310
- function Xl(e) {
310
+ function Ql(e) {
311
311
  c("schema-hide-field", e);
312
312
  }
313
- function ql(e) {
313
+ function Ul(e) {
314
314
  c("schema-delete-field", e);
315
315
  }
316
- function Jl(e) {
316
+ function Zl(e) {
317
317
  c("schema-duplicate-field", e);
318
318
  }
319
- function we() {
320
- oe.value = !0;
319
+ function Ce() {
320
+ ie.value = !0;
321
321
  }
322
- function Ql(e) {
323
- c("schema-add-field", e), oe.value = !1;
322
+ function _l(e) {
323
+ c("schema-add-field", e), ie.value = !1;
324
324
  }
325
- const x = k(() => i.readonly ? !1 : i.selectable), Ge = k(() => i.readonly ? !1 : i.addable), { indeterminate: Ve, hasSelectionBar: Ul, resolvedBulkActionItems: Zl, handleSelectAll: Ne, handleSelect: ne, handleBulkAction: _l } = Io({
326
- rows: fe,
327
- selectedRows: S,
328
- rowKey: w(i, "rowKey"),
325
+ const x = k(() => d.readonly ? !1 : d.selectable), Oe = k(() => d.readonly ? !1 : d.addable), { indeterminate: Ye, hasSelectionBar: eo, resolvedBulkActionItems: lo, handleSelectAll: je, handleSelect: se, handleBulkAction: oo } = qo({
326
+ rows: ke,
327
+ selectedRows: R,
328
+ rowKey: w(d, "rowKey"),
329
329
  selectable: x,
330
- bulkActionItems: w(i, "bulkActionItems"),
331
- showSelectionBar: w(i, "showSelectionBar"),
330
+ bulkActionItems: w(d, "bulkActionItems"),
331
+ showSelectionBar: w(d, "showSelectionBar"),
332
332
  emitSelectionChange: (e) => c("selection-change", e),
333
- toggleSelectAll: ml,
334
- toggleRowSelection: (e, o = 0) => pl(e, o),
335
- clearSelection: hl,
333
+ toggleSelectAll: Dl,
334
+ toggleRowSelection: (e, o = 0) => Rl(e, o),
335
+ clearSelection: Cl,
336
336
  emitBulkAction: (e) => c("bulk-action", e)
337
337
  });
338
- function d(e) {
339
- return ko(e, i.rowKey);
338
+ function s(e) {
339
+ return po(e, d.rowKey);
340
340
  }
341
- function P(e) {
342
- return wo(i.fieldDefs, e);
341
+ function q(e) {
342
+ return mo(d.fieldDefs, e);
343
343
  }
344
344
  function L(e, o, l) {
345
- fl(e, o, l), c("cell-edit", { rowId: e, fieldId: o, value: l });
345
+ gl(e, o, l), c("cell-edit", { rowId: e, fieldId: o, value: l });
346
346
  }
347
- function p(e) {
348
- const o = sl({
347
+ function W(e, o) {
348
+ I.activate(e, o), d.enableKeyboard && re(e, o);
349
+ }
350
+ function G() {
351
+ I.cancel();
352
+ }
353
+ function m(e) {
354
+ const o = cl({
349
355
  row: e,
350
- isMobile: ue.value
356
+ isMobile: be.value
351
357
  });
352
358
  if (o.type === "emit-record") {
353
359
  c("row-click-record", o.row), c("row-click", o.row);
@@ -355,221 +361,224 @@ const Po = ["onMouseenter", "onFocusin", "onClick", "onKeydown"], Lo = ["for"],
355
361
  }
356
362
  o.type === "emit-row" && c("row-click", o.row);
357
363
  }
358
- function te(e, o) {
359
- e.target === e.currentTarget && (e.key !== "Enter" && e.key !== " " || (e.preventDefault(), p(o)));
364
+ function de(e, o) {
365
+ e.target === e.currentTarget && (e.key !== "Enter" && e.key !== " " || (e.preventDefault(), m(o)));
360
366
  }
361
367
  function C(e, o) {
362
368
  return e[o];
363
369
  }
364
- function eo(e) {
370
+ function no(e) {
365
371
  if (!e) return null;
366
372
  if (e instanceof HTMLElement) return e;
367
373
  const o = e.$el;
368
374
  return o instanceof HTMLElement ? o : null;
369
375
  }
370
- function ae(e, o) {
371
- Al(eo(e), o);
376
+ function ue(e, o) {
377
+ zl(no(e), o);
372
378
  }
373
- function he(e, o) {
374
- vl(e, o);
379
+ function De(e, o) {
380
+ kl(e, o);
375
381
  }
376
- function me(e) {
377
- wl(e, Y.value);
382
+ function Re(e) {
383
+ ml(e, J.value);
378
384
  }
379
- function Oe() {
380
- return ho(I.value.rowHeight);
385
+ function Xe() {
386
+ return Co(H.value.rowHeight);
381
387
  }
382
- function re(e) {
383
- return mo({
388
+ function ce(e) {
389
+ return Do({
384
390
  density: A.value,
385
391
  col: e,
386
- resolvedWidth: Ae(e.key),
387
- fillMinWidth: I.value.fillMinWidth
392
+ resolvedWidth: Be(e.key),
393
+ fillMinWidth: H.value.fillMinWidth
388
394
  });
389
395
  }
390
- function Ye() {
391
- return po(I.value.groupRowHeight);
396
+ function Je() {
397
+ return Ro(H.value.groupRowHeight);
392
398
  }
393
- function lo(e) {
394
- $l(e);
399
+ function to(e) {
400
+ Al(e);
395
401
  const o = e.target;
396
- Ke.value = o.scrollLeft;
402
+ He.value = o.scrollLeft;
397
403
  }
398
- function oo(e) {
399
- De.value = e;
404
+ function ao(e) {
405
+ $e.value = e;
400
406
  }
401
- function no(e) {
402
- O.value = e;
407
+ function ro(e) {
408
+ X.value = e;
403
409
  }
404
- function to(e) {
405
- O.value = e;
410
+ function io(e) {
411
+ X.value = e;
406
412
  }
407
- function se(e) {
413
+ function fe(e) {
408
414
  return {
409
415
  groupKey: e.__groupKey,
410
416
  count: e.__groupCount,
411
- collapsed: Dl.value.has(
417
+ collapsed: xl.value.has(
412
418
  e.__groupPath ? e.__groupPath.join("/") : e.__groupKey
413
419
  ),
414
- colorMap: i.groupColorMap,
420
+ colorMap: d.groupColorMap,
415
421
  selectable: x.value,
416
422
  level: e.__groupLevel ?? 0,
417
423
  aggregations: e.__aggregations
418
424
  };
419
425
  }
420
- function ie(e) {
426
+ function ye(e) {
421
427
  return e.__groupPath ? e.__groupPath.join("/") : e.__groupKey;
422
428
  }
423
- function je(e) {
429
+ function Qe(e) {
424
430
  return {
425
431
  row: e,
426
- rowKey: i.rowKey,
427
- selected: S.value.has(d(e)),
432
+ rowKey: d.rowKey,
433
+ selected: R.value.has(s(e)),
428
434
  selectable: x.value,
429
435
  columns: D.value,
430
- priorityColorMap: i.priorityColorMap,
431
- statusColorMap: i.statusColorMap
436
+ priorityColorMap: d.priorityColorMap,
437
+ statusColorMap: d.statusColorMap
432
438
  };
433
439
  }
434
- function Xe(e, o) {
435
- const l = Be.value;
440
+ function Ue(e, o) {
441
+ const l = Pe.value;
436
442
  return l !== null && l.rowId === e && l.colKey === o;
437
443
  }
438
- function qe(e, o) {
439
- return Tl.value.some((l) => l.rowId === e && l.colKey === o);
444
+ function Ze(e, o) {
445
+ return Bl.value.some((l) => l.rowId === e && l.colKey === o);
446
+ }
447
+ function V(e, o) {
448
+ return U.value !== null && U.value.rowId === e && U.value.fieldId === o;
440
449
  }
441
- function Je(e) {
442
- const o = d(e);
450
+ function _e(e) {
451
+ const o = s(e);
443
452
  return {
444
- "of-row-dragging": zl.value && Bl.value === o,
445
- "of-row-drop-target": be.value === o,
446
- "of-row-drop-before": be.value === o && He.value === "before",
447
- "of-row-drop-after": be.value === o && He.value === "after"
453
+ "of-row-dragging": Hl.value && Il.value === o,
454
+ "of-row-drop-target": he.value === o,
455
+ "of-row-drop-before": he.value === o && qe.value === "before",
456
+ "of-row-drop-after": he.value === o && qe.value === "after"
448
457
  };
449
458
  }
450
- function ao(e) {
451
- il(e);
459
+ function so(e) {
460
+ fl(e);
452
461
  }
453
- function ro(e) {
454
- for (const o of dl(e))
462
+ function uo(e) {
463
+ for (const o of yl(e))
455
464
  c("cell-edit", o);
456
465
  }
457
- return (e, o) => n(ue) ? (r(), v(bo, {
466
+ return (e, o) => n(be) ? (r(), v(wo, {
458
467
  key: 0,
459
- rows: n(fe),
468
+ rows: n(ke),
460
469
  columns: D.value,
461
470
  "field-defs": u.fieldDefs,
462
471
  selectable: x.value,
463
- addable: Ge.value,
472
+ addable: Oe.value,
464
473
  "status-color-map": u.statusColorMap,
465
474
  readonly: u.readonly,
466
- "density-class": n(Se),
467
- "density-style": n(Re),
468
- "detail-visible": n(al),
469
- "detail-row": n(rl),
470
- onRowClick: o[0] || (o[0] = (l) => ao(l)),
475
+ "density-class": n(Fe),
476
+ "density-style": n(Me),
477
+ "detail-visible": n(dl),
478
+ "detail-row": n(ul),
479
+ onRowClick: o[0] || (o[0] = (l) => so(l)),
471
480
  onAddRow: o[1] || (o[1] = (l) => c("add-row")),
472
- onCloseDetail: n(ul),
473
- onDetailSave: ro,
481
+ onCloseDetail: n(vl),
482
+ onDetailSave: uo,
474
483
  onRowDelete: o[2] || (o[2] = (l) => c("row-delete", l)),
475
484
  onCellEdit: o[3] || (o[3] = (l) => c("cell-edit", l))
476
- }, io({ _: 2 }, [
485
+ }, fo({ _: 2 }, [
477
486
  e.$slots.cell ? {
478
487
  name: "cell",
479
488
  fn: $((l) => [
480
- H(e.$slots, "cell", uo(co(l)), void 0, !0)
489
+ E(e.$slots, "cell", yo(vo(l)), void 0, !0)
481
490
  ]),
482
491
  key: "0"
483
492
  } : void 0
484
- ]), 1032, ["rows", "columns", "field-defs", "selectable", "addable", "status-color-map", "readonly", "density-class", "density-style", "detail-visible", "detail-row", "onCloseDetail"])) : (r(), s("div", {
493
+ ]), 1032, ["rows", "columns", "field-defs", "selectable", "addable", "status-color-map", "readonly", "density-class", "density-style", "detail-visible", "detail-row", "onCloseDetail"])) : (r(), i("div", {
485
494
  key: 1,
486
495
  ref_key: "tableContainerRef",
487
- ref: Y,
488
- class: F(["of-data-table", [n(Se), n(tl)]]),
489
- style: g(n(Re)),
496
+ ref: J,
497
+ class: F(["of-data-table", [n(Fe), n(sl)]]),
498
+ style: g(n(Me)),
490
499
  role: "grid",
491
500
  tabindex: "0",
492
- onKeydown: o[19] || (o[19] = (l) => u.enableKeyboard ? n(Kl)(l) : void 0)
501
+ onKeydown: o[19] || (o[19] = (l) => u.enableKeyboard ? n(El)(l) : void 0)
493
502
  }, [
494
- N(go, {
495
- "has-fixed-columns": Sl.value,
496
- "show-selection-bar": n(Ul),
497
- "selection-count": n(S).size,
498
- "selection-items": n(Zl),
499
- "fixed-width": n(xl),
500
- "show-fixed-shadow": Rl.value,
503
+ j(ho, {
504
+ "has-fixed-columns": $l.value,
505
+ "show-selection-bar": n(eo),
506
+ "selection-count": n(R).size,
507
+ "selection-items": n(lo),
508
+ "fixed-width": n(Ml),
509
+ "show-fixed-shadow": Fl.value,
501
510
  columns: D.value,
502
- "fixed-columns": n(Q),
503
- "scrollable-columns": n(U),
511
+ "fixed-columns": n(ee),
512
+ "scrollable-columns": n(le),
504
513
  selectable: x.value,
505
514
  "show-row-actions": u.showRowActions,
506
- "use-virtual": _.value,
507
- "total-height": n(ee),
508
- "offset-y": n(le),
509
- "set-fixed-region-ref": oo,
510
- "set-scroll-region-ref": no,
511
- "set-standard-scroll-ref": to,
512
- onSelectionAction: n(_l),
513
- onFixedScroll: n(Fl),
514
- onScroll: lo
515
+ "use-virtual": ne.value,
516
+ "total-height": n(te),
517
+ "offset-y": n(ae),
518
+ "set-fixed-region-ref": ao,
519
+ "set-scroll-region-ref": ro,
520
+ "set-standard-scroll-ref": io,
521
+ onSelectionAction: n(oo),
522
+ onFixedScroll: n(Tl),
523
+ onScroll: to
515
524
  }, {
516
525
  "fixed-header": $(() => [
517
- N(Ce, {
518
- columns: n(Q),
526
+ j(xe, {
527
+ columns: n(ee),
519
528
  selectable: x.value,
520
- "sort-key": n(E).field ?? "",
521
- "sort-order": n(E).order ?? "asc",
522
- "all-selected": n(Te),
523
- indeterminate: n(Ve),
529
+ "sort-key": n(P).field ?? "",
530
+ "sort-order": n(P).order ?? "asc",
531
+ "all-selected": n(Ee),
532
+ indeterminate: n(Ye),
524
533
  "enable-resize": u.enableResize,
525
534
  "enable-field-menu": u.enableFieldManagement,
526
535
  "enable-add-field": u.enableFieldManagement,
527
536
  density: n(A),
528
- onSort: n(q),
529
- onSelectAll: n(Ne),
530
- onResizeStart: he,
531
- onResizeDblclick: me,
532
- onHeaderContextmenu: ge,
533
- onHeaderDblclick: ke,
534
- onAddField: we
537
+ onSort: n(Z),
538
+ onSelectAll: n(je),
539
+ onResizeStart: De,
540
+ onResizeDblclick: Re,
541
+ onHeaderContextmenu: pe,
542
+ onHeaderDblclick: me,
543
+ onAddField: Ce
535
544
  }, null, 8, ["columns", "selectable", "sort-key", "sort-order", "all-selected", "indeterminate", "enable-resize", "enable-field-menu", "enable-add-field", "density", "onSort", "onSelectAll"])
536
545
  ]),
537
546
  "fixed-body": $(() => [
538
- _.value ? (r(), s("div", {
547
+ ne.value ? (r(), i("div", {
539
548
  key: 0,
540
- style: g({ height: n(ee) + "px", position: "relative" })
549
+ style: g({ height: n(te) + "px", position: "relative" })
541
550
  }, [
542
551
  h("div", {
543
- style: g({ transform: `translateY(${n(le)}px)` })
552
+ style: g({ transform: `translateY(${n(ae)}px)` })
544
553
  }, [
545
- (r(!0), s(y, null, m(n(ye), ({ data: l, index: t }) => (r(), s(y, {
554
+ (r(!0), i(y, null, p(n(we), ({ data: l, index: t }) => (r(), i(y, {
546
555
  key: l.id
547
556
  }, [
548
- n(K)(l) ? (r(), v(de, G({
557
+ n(K)(l) ? (r(), v(ve, O({
549
558
  key: 0,
550
559
  ref_for: !0,
551
- ref: (a) => ae(a, t)
552
- }, { ref_for: !0 }, se(l), {
553
- onToggle: (a) => n(J)(ie(l))
554
- }), null, 16, ["onToggle"])) : (r(), s("div", {
560
+ ref: (a) => ue(a, t)
561
+ }, { ref_for: !0 }, fe(l), {
562
+ onToggle: (a) => n(_)(ye(l))
563
+ }), null, 16, ["onToggle"])) : (r(), i("div", {
555
564
  key: 1,
556
565
  ref_for: !0,
557
- ref: (a) => ae(a, t),
566
+ ref: (a) => ue(a, t),
558
567
  class: F(["of-table-row", {
559
- "of-table-row--selected": n(S).has(d(l)),
560
- "of-table-row--hover": n(Z)(d(l))
568
+ "of-table-row--selected": n(R).has(s(l)),
569
+ "of-table-row--hover": n(oe)(s(l))
561
570
  }]),
562
571
  role: "row",
563
572
  tabindex: "0",
564
- style: g(Oe()),
565
- onMouseenter: (a) => n(b)(d(l)),
573
+ style: g(Xe()),
574
+ onMouseenter: (a) => n(b)(s(l)),
566
575
  onMouseleave: o[6] || (o[6] = (a) => n(b)(null)),
567
- onFocusin: (a) => n(b)(d(l)),
576
+ onFocusin: (a) => n(b)(s(l)),
568
577
  onFocusout: o[7] || (o[7] = (a) => n(b)(null)),
569
- onClick: (a) => p(l),
570
- onKeydown: (a) => te(a, l)
578
+ onClick: (a) => m(l),
579
+ onKeydown: (a) => de(a, l)
571
580
  }, [
572
- x.value ? (r(), s("div", {
581
+ x.value ? (r(), i("div", {
573
582
  key: 0,
574
583
  class: "of-td of-td-checkbox",
575
584
  role: "gridcell",
@@ -578,85 +587,88 @@ const Po = ["onMouseenter", "onFocusin", "onClick", "onKeydown"], Lo = ["for"],
578
587
  }, [
579
588
  h("label", {
580
589
  class: "of-checkbox-label",
581
- for: `fixed-row-select-${d(l)}`
590
+ for: `fixed-row-select-${s(l)}`
582
591
  }, [
583
592
  h("input", {
584
- id: `fixed-row-select-${d(l)}`,
593
+ id: `fixed-row-select-${s(l)}`,
585
594
  type: "checkbox",
586
595
  class: "of-checkbox",
587
- checked: n(S).has(d(l)),
588
- onChange: (a) => n(ne)(d(l))
589
- }, null, 40, Wo),
596
+ checked: n(R).has(s(l)),
597
+ onChange: (a) => n(se)(s(l))
598
+ }, null, 40, Vo),
590
599
  o[20] || (o[20] = h("span", { class: "of-sr-only" }, "选择当前行", -1))
591
- ], 8, Lo)
600
+ ], 8, Go)
592
601
  ])) : M("", !0),
593
- (r(!0), s(y, null, m(n(Q), (a) => (r(), s("div", {
602
+ (r(!0), i(y, null, p(n(ee), (a) => (r(), i("div", {
594
603
  key: a.key,
595
604
  class: "of-td",
596
605
  role: "gridcell",
597
- style: g(re(a))
606
+ style: g(ce(a))
598
607
  }, [
599
- H(e.$slots, "cell", {
608
+ E(e.$slots, "cell", {
600
609
  row: l,
601
610
  col: a
602
611
  }, () => {
603
612
  var f;
604
613
  return [
605
- (f = u.fieldDefs) != null && f.length ? (r(), v(V, {
614
+ (f = u.fieldDefs) != null && f.length ? (r(), v(Y, {
606
615
  key: 0,
607
- "row-id": d(l),
608
- field: P(a.key),
616
+ "row-id": s(l),
617
+ field: q(a.key),
609
618
  value: C(l, a.key),
610
- onCommit: L
611
- }, null, 8, ["row-id", "field", "value"])) : (r(), s("span", Go, B(C(l, a.key) ?? "-"), 1))
619
+ editing: V(s(l), a.key),
620
+ onCommit: L,
621
+ onRequestEdit: W,
622
+ onRequestCancel: G
623
+ }, null, 8, ["row-id", "field", "value", "editing"])) : (r(), i("span", No, B(C(l, a.key) ?? "-"), 1))
612
624
  ];
613
625
  }, !0)
614
626
  ], 4))), 128)),
615
- u.showRowActions ? (r(), s("div", {
627
+ u.showRowActions ? (r(), i("div", {
616
628
  key: 1,
617
629
  class: "of-table-row__actions",
618
630
  "aria-label": "行快捷操作",
619
631
  onClick: o[5] || (o[5] = z(() => {
620
632
  }, ["stop"]))
621
633
  }, [
622
- (r(!0), s(y, null, m(j(l), (a) => (r(), s("button", {
634
+ (r(!0), i(y, null, p(Q(l), (a) => (r(), i("button", {
623
635
  key: a.key,
624
636
  type: "button",
625
637
  class: F(["of-table-row__action-btn", { "of-table-row__action-btn--danger": a.variant === "danger" }]),
626
638
  disabled: a.disabled,
627
- onClick: z((f) => Fe(l, a.key), ["stop"])
639
+ onClick: z((f) => Ke(l, a.key), ["stop"])
628
640
  }, [
629
641
  h("span", null, B(a.label), 1)
630
- ], 10, Vo))), 128))
642
+ ], 10, Oo))), 128))
631
643
  ])) : M("", !0)
632
- ], 46, Po))
644
+ ], 46, Wo))
633
645
  ], 64))), 128))
634
646
  ], 4)
635
- ], 4)) : (r(!0), s(y, { key: 1 }, m(n(T), (l) => (r(), s(y, {
647
+ ], 4)) : (r(!0), i(y, { key: 1 }, p(n(T), (l) => (r(), i(y, {
636
648
  key: l.id
637
649
  }, [
638
- n(K)(l) ? (r(), v(de, G({
650
+ n(K)(l) ? (r(), v(ve, O({
639
651
  key: 0,
640
652
  ref_for: !0
641
- }, se(l), {
642
- onToggle: (t) => n(J)(ie(l))
643
- }), null, 16, ["onToggle"])) : (r(), s("div", {
653
+ }, fe(l), {
654
+ onToggle: (t) => n(_)(ye(l))
655
+ }), null, 16, ["onToggle"])) : (r(), i("div", {
644
656
  key: 1,
645
657
  class: F(["of-table-row", {
646
- "of-table-row--selected": n(S).has(d(l)),
647
- "of-table-row--hover": n(Z)(d(l))
658
+ "of-table-row--selected": n(R).has(s(l)),
659
+ "of-table-row--hover": n(oe)(s(l))
648
660
  }]),
649
661
  role: "row",
650
662
  tabindex: "0",
651
- style: g(Oe()),
652
- onMouseenter: (t) => n(b)(d(l)),
663
+ style: g(Xe()),
664
+ onMouseenter: (t) => n(b)(s(l)),
653
665
  onMouseleave: o[10] || (o[10] = (t) => n(b)(null)),
654
- onFocusin: (t) => n(b)(d(l)),
666
+ onFocusin: (t) => n(b)(s(l)),
655
667
  onFocusout: o[11] || (o[11] = (t) => n(b)(null)),
656
- onClick: (t) => p(l),
657
- onKeydown: (t) => te(t, l)
668
+ onClick: (t) => m(l),
669
+ onKeydown: (t) => de(t, l)
658
670
  }, [
659
- x.value ? (r(), s("div", {
671
+ x.value ? (r(), i("div", {
660
672
  key: 0,
661
673
  class: "of-td of-td-checkbox",
662
674
  role: "gridcell",
@@ -665,252 +677,264 @@ const Po = ["onMouseenter", "onFocusin", "onClick", "onKeydown"], Lo = ["for"],
665
677
  }, [
666
678
  h("label", {
667
679
  class: "of-checkbox-label",
668
- for: `row-select-${d(l)}`
680
+ for: `row-select-${s(l)}`
669
681
  }, [
670
682
  h("input", {
671
- id: `row-select-${d(l)}`,
683
+ id: `row-select-${s(l)}`,
672
684
  type: "checkbox",
673
685
  class: "of-checkbox",
674
- checked: n(S).has(d(l)),
675
- onChange: (t) => n(ne)(d(l))
676
- }, null, 40, Yo),
686
+ checked: n(R).has(s(l)),
687
+ onChange: (t) => n(se)(s(l))
688
+ }, null, 40, Xo),
677
689
  o[21] || (o[21] = h("span", { class: "of-sr-only" }, "选择当前行", -1))
678
- ], 8, Oo)
690
+ ], 8, jo)
679
691
  ])) : M("", !0),
680
- (r(!0), s(y, null, m(n(Q), (t) => (r(), s("div", {
692
+ (r(!0), i(y, null, p(n(ee), (t) => (r(), i("div", {
681
693
  key: t.key,
682
694
  class: "of-td",
683
695
  role: "gridcell",
684
- style: g(re(t))
696
+ style: g(ce(t))
685
697
  }, [
686
- H(e.$slots, "cell", {
698
+ E(e.$slots, "cell", {
687
699
  row: l,
688
700
  col: t
689
701
  }, () => {
690
702
  var a;
691
703
  return [
692
- (a = u.fieldDefs) != null && a.length ? (r(), v(V, {
704
+ (a = u.fieldDefs) != null && a.length ? (r(), v(Y, {
693
705
  key: 0,
694
- "row-id": d(l),
695
- field: P(t.key),
706
+ "row-id": s(l),
707
+ field: q(t.key),
696
708
  value: C(l, t.key),
697
- onCommit: L
698
- }, null, 8, ["row-id", "field", "value"])) : (r(), s("span", jo, B(C(l, t.key) ?? "-"), 1))
709
+ editing: V(s(l), t.key),
710
+ onCommit: L,
711
+ onRequestEdit: W,
712
+ onRequestCancel: G
713
+ }, null, 8, ["row-id", "field", "value", "editing"])) : (r(), i("span", Jo, B(C(l, t.key) ?? "-"), 1))
699
714
  ];
700
715
  }, !0)
701
716
  ], 4))), 128)),
702
- u.showRowActions ? (r(), s("div", {
717
+ u.showRowActions ? (r(), i("div", {
703
718
  key: 1,
704
719
  class: "of-table-row__actions",
705
720
  "aria-label": "行快捷操作",
706
721
  onClick: o[9] || (o[9] = z(() => {
707
722
  }, ["stop"]))
708
723
  }, [
709
- (r(!0), s(y, null, m(j(l), (t) => (r(), s("button", {
724
+ (r(!0), i(y, null, p(Q(l), (t) => (r(), i("button", {
710
725
  key: t.key,
711
726
  type: "button",
712
727
  class: F(["of-table-row__action-btn", { "of-table-row__action-btn--danger": t.variant === "danger" }]),
713
728
  disabled: t.disabled,
714
- onClick: z((a) => Fe(l, t.key), ["stop"])
729
+ onClick: z((a) => Ke(l, t.key), ["stop"])
715
730
  }, [
716
731
  h("span", null, B(t.label), 1)
717
- ], 10, Xo))), 128))
732
+ ], 10, Qo))), 128))
718
733
  ])) : M("", !0)
719
- ], 46, No))
734
+ ], 46, Yo))
720
735
  ], 64))), 128))
721
736
  ]),
722
737
  "scroll-header": $(() => [
723
- N(Ce, {
724
- columns: n(U),
738
+ j(xe, {
739
+ columns: n(le),
725
740
  selectable: !1,
726
- "sort-key": n(E).field ?? "",
727
- "sort-order": n(E).order ?? "asc",
741
+ "sort-key": n(P).field ?? "",
742
+ "sort-order": n(P).order ?? "asc",
728
743
  "enable-resize": u.enableResize,
729
744
  "enable-field-menu": u.enableFieldManagement,
730
745
  "enable-add-field": u.enableFieldManagement,
731
746
  density: n(A),
732
- onSort: n(q),
733
- onResizeStart: he,
734
- onResizeDblclick: me,
735
- onHeaderContextmenu: ge,
736
- onHeaderDblclick: ke,
737
- onAddField: we
747
+ onSort: n(Z),
748
+ onResizeStart: De,
749
+ onResizeDblclick: Re,
750
+ onHeaderContextmenu: pe,
751
+ onHeaderDblclick: me,
752
+ onAddField: Ce
738
753
  }, null, 8, ["columns", "sort-key", "sort-order", "enable-resize", "enable-field-menu", "enable-add-field", "density", "onSort"])
739
754
  ]),
740
755
  "scroll-body": $(() => [
741
- _.value ? (r(), s("div", {
756
+ ne.value ? (r(), i("div", {
742
757
  key: 0,
743
- style: g({ height: n(ee) + "px", position: "relative" })
758
+ style: g({ height: n(te) + "px", position: "relative" })
744
759
  }, [
745
760
  h("div", {
746
- style: g({ transform: `translateY(${n(le)}px)` })
761
+ style: g({ transform: `translateY(${n(ae)}px)` })
747
762
  }, [
748
- (r(!0), s(y, null, m(n(ye), ({ data: l }) => (r(), s(y, {
763
+ (r(!0), i(y, null, p(n(we), ({ data: l }) => (r(), i(y, {
749
764
  key: l.id
750
765
  }, [
751
- n(K)(l) ? (r(), s("div", {
766
+ n(K)(l) ? (r(), i("div", {
752
767
  key: 0,
753
- style: g(Ye())
754
- }, null, 4)) : (r(), s("div", {
768
+ style: g(Je())
769
+ }, null, 4)) : (r(), i("div", {
755
770
  key: 1,
756
771
  class: F(["of-table-row", {
757
- "of-table-row--selected": n(S).has(d(l)),
758
- "of-table-row--hover": n(Z)(d(l))
772
+ "of-table-row--selected": n(R).has(s(l)),
773
+ "of-table-row--hover": n(oe)(s(l))
759
774
  }]),
760
775
  role: "row",
761
776
  tabindex: "0",
762
- onMouseenter: (t) => n(b)(d(l)),
777
+ onMouseenter: (t) => n(b)(s(l)),
763
778
  onMouseleave: o[12] || (o[12] = (t) => n(b)(null)),
764
- onFocusin: (t) => n(b)(d(l)),
779
+ onFocusin: (t) => n(b)(s(l)),
765
780
  onFocusout: o[13] || (o[13] = (t) => n(b)(null)),
766
- onClick: (t) => p(l),
767
- onKeydown: (t) => te(t, l)
781
+ onClick: (t) => m(l),
782
+ onKeydown: (t) => de(t, l)
768
783
  }, [
769
- (r(!0), s(y, null, m(n(U), (t) => (r(), s("div", {
784
+ (r(!0), i(y, null, p(n(le), (t) => (r(), i("div", {
770
785
  key: t.key,
771
786
  class: "of-td",
772
787
  role: "gridcell",
773
- style: g(re(t))
788
+ style: g(ce(t))
774
789
  }, [
775
- H(e.$slots, "cell", {
790
+ E(e.$slots, "cell", {
776
791
  row: l,
777
792
  col: t
778
793
  }, () => {
779
794
  var a;
780
795
  return [
781
- (a = u.fieldDefs) != null && a.length ? (r(), v(V, {
796
+ (a = u.fieldDefs) != null && a.length ? (r(), v(Y, {
782
797
  key: 0,
783
- "row-id": d(l),
784
- field: P(t.key),
798
+ "row-id": s(l),
799
+ field: q(t.key),
785
800
  value: C(l, t.key),
786
- onCommit: L
787
- }, null, 8, ["row-id", "field", "value"])) : (r(), s("span", Jo, B(C(l, t.key) ?? "-"), 1))
801
+ editing: V(s(l), t.key),
802
+ onCommit: L,
803
+ onRequestEdit: W,
804
+ onRequestCancel: G
805
+ }, null, 8, ["row-id", "field", "value", "editing"])) : (r(), i("span", Zo, B(C(l, t.key) ?? "-"), 1))
788
806
  ];
789
807
  }, !0)
790
808
  ], 4))), 128))
791
- ], 42, qo))
809
+ ], 42, Uo))
792
810
  ], 64))), 128))
793
811
  ], 4)
794
- ], 4)) : (r(!0), s(y, { key: 1 }, m(n(T), (l) => (r(), s(y, {
812
+ ], 4)) : (r(!0), i(y, { key: 1 }, p(n(T), (l) => (r(), i(y, {
795
813
  key: l.id
796
814
  }, [
797
- n(K)(l) ? (r(), s("div", {
815
+ n(K)(l) ? (r(), i("div", {
798
816
  key: 0,
799
- style: g(Ye())
800
- }, null, 4)) : (r(), s("div", {
817
+ style: g(Je())
818
+ }, null, 4)) : (r(), i("div", {
801
819
  key: 1,
802
820
  class: F(["of-table-row", {
803
- "of-table-row--selected": n(S).has(d(l)),
804
- "of-table-row--hover": n(Z)(d(l))
821
+ "of-table-row--selected": n(R).has(s(l)),
822
+ "of-table-row--hover": n(oe)(s(l))
805
823
  }]),
806
824
  role: "row",
807
825
  tabindex: "0",
808
- onMouseenter: (t) => n(b)(d(l)),
826
+ onMouseenter: (t) => n(b)(s(l)),
809
827
  onMouseleave: o[14] || (o[14] = (t) => n(b)(null)),
810
- onFocusin: (t) => n(b)(d(l)),
828
+ onFocusin: (t) => n(b)(s(l)),
811
829
  onFocusout: o[15] || (o[15] = (t) => n(b)(null)),
812
- onClick: (t) => p(l),
813
- onKeydown: (t) => te(t, l)
830
+ onClick: (t) => m(l),
831
+ onKeydown: (t) => de(t, l)
814
832
  }, [
815
- (r(!0), s(y, null, m(n(U), (t) => (r(), s("div", {
833
+ (r(!0), i(y, null, p(n(le), (t) => (r(), i("div", {
816
834
  key: t.key,
817
835
  class: "of-td",
818
836
  role: "gridcell",
819
- style: g(re(t))
837
+ style: g(ce(t))
820
838
  }, [
821
- H(e.$slots, "cell", {
839
+ E(e.$slots, "cell", {
822
840
  row: l,
823
841
  col: t
824
842
  }, () => {
825
843
  var a;
826
844
  return [
827
- (a = u.fieldDefs) != null && a.length ? (r(), v(V, {
845
+ (a = u.fieldDefs) != null && a.length ? (r(), v(Y, {
828
846
  key: 0,
829
- "row-id": d(l),
830
- field: P(t.key),
847
+ "row-id": s(l),
848
+ field: q(t.key),
831
849
  value: C(l, t.key),
832
- onCommit: L
833
- }, null, 8, ["row-id", "field", "value"])) : (r(), s("span", Uo, B(C(l, t.key) ?? "-"), 1))
850
+ editing: V(s(l), t.key),
851
+ onCommit: L,
852
+ onRequestEdit: W,
853
+ onRequestCancel: G
854
+ }, null, 8, ["row-id", "field", "value", "editing"])) : (r(), i("span", en, B(C(l, t.key) ?? "-"), 1))
834
855
  ];
835
856
  }, !0)
836
857
  ], 4))), 128))
837
- ], 42, Qo))
858
+ ], 42, _o))
838
859
  ], 64))), 128))
839
860
  ]),
840
861
  "standard-header": $(() => [
841
- N(Ce, {
862
+ j(xe, {
842
863
  columns: D.value,
843
864
  selectable: x.value,
844
- "sort-key": n(E).field ?? "",
845
- "sort-order": n(E).order ?? "asc",
846
- "all-selected": n(Te),
847
- indeterminate: n(Ve),
865
+ "sort-key": n(P).field ?? "",
866
+ "sort-order": n(P).order ?? "asc",
867
+ "all-selected": n(Ee),
868
+ indeterminate: n(Ye),
848
869
  "enable-resize": u.enableResize,
849
870
  "enable-field-menu": u.enableFieldManagement,
850
871
  "enable-add-field": u.enableFieldManagement,
851
872
  density: n(A),
852
- onSort: n(q),
853
- onSelectAll: n(Ne),
854
- onResizeStart: he,
855
- onResizeDblclick: me,
856
- onHeaderContextmenu: ge,
857
- onHeaderDblclick: ke,
858
- onAddField: we
873
+ onSort: n(Z),
874
+ onSelectAll: n(je),
875
+ onResizeStart: De,
876
+ onResizeDblclick: Re,
877
+ onHeaderContextmenu: pe,
878
+ onHeaderDblclick: me,
879
+ onAddField: Ce
859
880
  }, null, 8, ["columns", "selectable", "sort-key", "sort-order", "all-selected", "indeterminate", "enable-resize", "enable-field-menu", "enable-add-field", "density", "onSort", "onSelectAll"])
860
881
  ]),
861
882
  "standard-body": $(() => [
862
- _.value ? (r(), s("div", {
883
+ ne.value ? (r(), i("div", {
863
884
  key: 0,
864
- style: g({ height: n(ee) + "px", position: "relative" })
885
+ style: g({ height: n(te) + "px", position: "relative" })
865
886
  }, [
866
887
  h("div", {
867
- style: g({ transform: `translateY(${n(le)}px)` })
888
+ style: g({ transform: `translateY(${n(ae)}px)` })
868
889
  }, [
869
- (r(!0), s(y, null, m(n(ye), ({ data: l, index: t }) => (r(), s(y, {
890
+ (r(!0), i(y, null, p(n(we), ({ data: l, index: t }) => (r(), i(y, {
870
891
  key: l.id
871
892
  }, [
872
- n(K)(l) ? (r(), v(de, G({
893
+ n(K)(l) ? (r(), v(ve, O({
873
894
  key: 0,
874
895
  ref_for: !0,
875
- ref: (a) => ae(a, t)
876
- }, { ref_for: !0 }, se(l), {
877
- onToggle: (a) => n(J)(ie(l))
878
- }), null, 16, ["onToggle"])) : (r(), v(Ze, G({
896
+ ref: (a) => ue(a, t)
897
+ }, { ref_for: !0 }, fe(l), {
898
+ onToggle: (a) => n(_)(ye(l))
899
+ }), null, 16, ["onToggle"])) : (r(), v(ol, O({
879
900
  key: 1,
880
901
  ref_for: !0,
881
- ref: (a) => ae(a, t)
882
- }, { ref_for: !0 }, je(l), {
902
+ ref: (a) => ue(a, t)
903
+ }, { ref_for: !0 }, Qe(l), {
883
904
  density: n(A),
884
905
  "show-row-actions": u.showRowActions,
885
- "row-action-items": j(l),
906
+ "row-action-items": Q(l),
886
907
  draggable: u.enableRowDrag,
887
- class: Je(l),
888
- onSelect: n(ne),
889
- onClick: (a) => p(l),
890
- onDragstart: (a) => Ee(a, l),
891
- onDragover: (a) => Pe(a, l),
892
- onDrop: (a) => Le(a, l),
893
- onDragend: n(Ie)
908
+ class: _e(l),
909
+ onSelect: n(se),
910
+ onClick: (a) => m(l),
911
+ onDragstart: (a) => We(a, l),
912
+ onDragover: (a) => Ge(a, l),
913
+ onDrop: (a) => Ve(a, l),
914
+ onDragend: n(Le)
894
915
  }), {
895
916
  cell: $(({ row: a, col: f }) => [
896
- H(e.$slots, "cell", {
917
+ E(e.$slots, "cell", {
897
918
  row: a,
898
919
  col: f
899
920
  }, () => {
900
- var pe;
921
+ var Se;
901
922
  return [
902
- (pe = u.fieldDefs) != null && pe.length ? (r(), v(V, {
923
+ (Se = u.fieldDefs) != null && Se.length ? (r(), v(Y, {
903
924
  key: 0,
904
- "row-id": d(a),
905
- field: P(f.key),
925
+ "row-id": s(a),
926
+ field: q(f.key),
906
927
  value: a[f.key],
928
+ editing: V(s(a), f.key),
907
929
  class: F({
908
- "of-cell--active": Xe(d(a), f.key),
909
- "of-cell--selected": qe(d(a), f.key)
930
+ "of-cell--active": Ue(s(a), f.key),
931
+ "of-cell--selected": Ze(s(a), f.key)
910
932
  }),
911
933
  onCommit: L,
912
- onClick: z((on) => u.enableKeyboard && n(ve)(d(a), f.key), ["stop"])
913
- }, null, 8, ["row-id", "field", "value", "class", "onClick"])) : (r(), s("span", Zo, B(C(a, f.key) ?? "-"), 1))
934
+ onRequestEdit: W,
935
+ onRequestCancel: G,
936
+ onClick: z((an) => u.enableKeyboard && n(re)(s(a), f.key), ["stop"])
937
+ }, null, 8, ["row-id", "field", "value", "editing", "class", "onClick"])) : (r(), i("span", ln, B(C(a, f.key) ?? "-"), 1))
914
938
  ];
915
939
  }, !0)
916
940
  ]),
@@ -918,49 +942,52 @@ const Po = ["onMouseenter", "onFocusin", "onClick", "onKeydown"], Lo = ["for"],
918
942
  }, 16, ["density", "show-row-actions", "row-action-items", "draggable", "class", "onSelect", "onClick", "onDragstart", "onDragover", "onDrop", "onDragend"]))
919
943
  ], 64))), 128))
920
944
  ], 4)
921
- ], 4)) : (r(!0), s(y, { key: 1 }, m(n(T), (l) => (r(), s(y, {
945
+ ], 4)) : (r(!0), i(y, { key: 1 }, p(n(T), (l) => (r(), i(y, {
922
946
  key: l.id
923
947
  }, [
924
- n(K)(l) ? (r(), v(de, G({
948
+ n(K)(l) ? (r(), v(ve, O({
925
949
  key: 0,
926
950
  ref_for: !0
927
- }, se(l), {
928
- onToggle: (t) => n(J)(ie(l))
929
- }), null, 16, ["onToggle"])) : (r(), v(Ze, G({
951
+ }, fe(l), {
952
+ onToggle: (t) => n(_)(ye(l))
953
+ }), null, 16, ["onToggle"])) : (r(), v(ol, O({
930
954
  key: 1,
931
955
  ref_for: !0
932
- }, je(l), {
956
+ }, Qe(l), {
933
957
  density: n(A),
934
958
  "show-row-actions": u.showRowActions,
935
- "row-action-items": j(l),
959
+ "row-action-items": Q(l),
936
960
  draggable: u.enableRowDrag,
937
- class: Je(l),
938
- onSelect: n(ne),
939
- onClick: (t) => p(l),
940
- onDragstart: (t) => Ee(t, l),
941
- onDragover: (t) => Pe(t, l),
942
- onDrop: (t) => Le(t, l),
943
- onDragend: n(Ie)
961
+ class: _e(l),
962
+ onSelect: n(se),
963
+ onClick: (t) => m(l),
964
+ onDragstart: (t) => We(t, l),
965
+ onDragover: (t) => Ge(t, l),
966
+ onDrop: (t) => Ve(t, l),
967
+ onDragend: n(Le)
944
968
  }), {
945
969
  cell: $(({ row: t, col: a }) => [
946
- H(e.$slots, "cell", {
970
+ E(e.$slots, "cell", {
947
971
  row: t,
948
972
  col: a
949
973
  }, () => {
950
974
  var f;
951
975
  return [
952
- (f = u.fieldDefs) != null && f.length ? (r(), v(V, {
976
+ (f = u.fieldDefs) != null && f.length ? (r(), v(Y, {
953
977
  key: 0,
954
- "row-id": d(t),
955
- field: P(a.key),
978
+ "row-id": s(t),
979
+ field: q(a.key),
956
980
  value: t[a.key],
981
+ editing: V(s(t), a.key),
957
982
  class: F({
958
- "of-cell--active": Xe(d(t), a.key),
959
- "of-cell--selected": qe(d(t), a.key)
983
+ "of-cell--active": Ue(s(t), a.key),
984
+ "of-cell--selected": Ze(s(t), a.key)
960
985
  }),
961
986
  onCommit: L,
962
- onClick: z((pe) => u.enableKeyboard && n(ve)(d(t), a.key), ["stop"])
963
- }, null, 8, ["row-id", "field", "value", "class", "onClick"])) : (r(), s("span", _o, B(C(t, a.key) ?? "-"), 1))
987
+ onRequestEdit: W,
988
+ onRequestCancel: G,
989
+ onClick: z((Se) => u.enableKeyboard && n(re)(s(t), a.key), ["stop"])
990
+ }, null, 8, ["row-id", "field", "value", "editing", "class", "onClick"])) : (r(), i("span", on, B(C(t, a.key) ?? "-"), 1))
964
991
  ];
965
992
  }, !0)
966
993
  ]),
@@ -970,48 +997,48 @@ const Po = ["onMouseenter", "onFocusin", "onClick", "onKeydown"], Lo = ["for"],
970
997
  ]),
971
998
  _: 3
972
999
  }, 8, ["has-fixed-columns", "show-selection-bar", "selection-count", "selection-items", "fixed-width", "show-fixed-shadow", "columns", "fixed-columns", "scrollable-columns", "selectable", "show-row-actions", "use-virtual", "total-height", "offset-y", "onSelectionAction", "onFixedScroll"]),
973
- n(gl) ? (r(), s("div", {
1000
+ n(hl) ? (r(), i("div", {
974
1001
  key: 0,
975
1002
  class: "of-resize-indicator",
976
- style: g({ left: n(kl) + "px" })
1003
+ style: g({ left: n(pl) + "px" })
977
1004
  }, null, 4)) : M("", !0),
978
- Gl.value ? (r(), v(vo, {
1005
+ Nl.value ? (r(), v(ko, {
979
1006
  key: 1,
980
- "draft-count": n(We).size,
981
- onCommitAll: Nl,
982
- onDiscardAll: Ol
1007
+ "draft-count": n(Ne).size,
1008
+ onCommitAll: Yl,
1009
+ onDiscardAll: jl
983
1010
  }, null, 8, ["draft-count"])) : M("", !0),
984
- Ge.value ? (r(), v(yo, {
1011
+ Oe.value ? (r(), v(go, {
985
1012
  key: 2,
986
- onClick: Vl
1013
+ onClick: Ol
987
1014
  })) : M("", !0),
988
- u.enableFieldManagement ? (r(), v(n(ll), {
1015
+ u.enableFieldManagement ? (r(), v(n(al), {
989
1016
  key: 3,
990
- visible: R.value.visible,
991
- "col-key": R.value.colKey,
992
- "col-label": R.value.colLabel,
993
- "field-type": R.value.fieldType,
994
- x: R.value.x,
995
- y: R.value.y,
996
- onClose: o[16] || (o[16] = (l) => R.value.visible = !1),
997
- onRename: Yl,
998
- onChangeType: jl,
999
- onSort: o[17] || (o[17] = (l, t) => n(q)(l)),
1000
- onHide: Xl,
1001
- onDelete: ql,
1002
- onDuplicate: Jl
1017
+ visible: S.value.visible,
1018
+ "col-key": S.value.colKey,
1019
+ "col-label": S.value.colLabel,
1020
+ "field-type": S.value.fieldType,
1021
+ x: S.value.x,
1022
+ y: S.value.y,
1023
+ onClose: o[16] || (o[16] = (l) => S.value.visible = !1),
1024
+ onRename: Xl,
1025
+ onChangeType: Jl,
1026
+ onSort: o[17] || (o[17] = (l, t) => n(Z)(l)),
1027
+ onHide: Ql,
1028
+ onDelete: Ul,
1029
+ onDuplicate: Zl
1003
1030
  }, null, 8, ["visible", "col-key", "col-label", "field-type", "x", "y"])) : M("", !0),
1004
- (r(), v(fo, { to: "body" }, [
1005
- oe.value ? (r(), s("div", en, [
1031
+ (r(), v(bo, { to: "body" }, [
1032
+ ie.value ? (r(), i("div", nn, [
1006
1033
  h("button", {
1007
1034
  type: "button",
1008
1035
  class: "of-add-field-overlay__backdrop",
1009
1036
  tabindex: "-1",
1010
1037
  "aria-hidden": "true",
1011
- onClick: o[18] || (o[18] = (l) => oe.value = !1)
1038
+ onClick: o[18] || (o[18] = (l) => ie.value = !1)
1012
1039
  }),
1013
- h("div", ln, [
1014
- N(n(ol), { onSelect: Ql })
1040
+ h("div", tn, [
1041
+ j(n(rl), { onSelect: _l })
1015
1042
  ])
1016
1043
  ])) : M("", !0)
1017
1044
  ]))
@@ -1019,5 +1046,5 @@ const Po = ["onMouseenter", "onFocusin", "onClick", "onKeydown"], Lo = ["for"],
1019
1046
  }
1020
1047
  });
1021
1048
  export {
1022
- Mn as default
1049
+ Kn as default
1023
1050
  };