@oneflowui/ui 0.6.0 → 0.8.0

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