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