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