@oneflowui/ui 0.5.7 → 0.5.9

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