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