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