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