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