@oneflowui/ui 0.5.1 → 0.5.2
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/charts/BarChart.vue.js +2 -2
- package/dist/components/Dashboard/charts/BarChart.vue2.js +11 -8
- package/dist/components/Dashboard/charts/PieChart.vue.js +2 -2
- package/dist/components/Dashboard/charts/PieChart.vue2.js +8 -5
- package/dist/components/Dashboard/index.vue.js +1 -1
- package/dist/components/Dashboard/index.vue2.js +20 -25
- package/dist/components/editor/RichTextEditor.vue2.js +1 -1
- package/dist/components/table/DataTable.vue.js +1 -1
- package/dist/components/table/DataTable.vue2.js +134 -135
- package/dist/components/table/FieldCell.vue.js +2 -2
- package/dist/components/table/FieldCell.vue2.js +16 -15
- package/dist/composables/useMarkdown.js +23 -23
- package/dist/index.d.ts +1 -5
- package/dist/index.js +250 -350
- package/dist/plugin.d.ts +5 -0
- package/dist/plugin.js +197 -0
- package/dist/style.css +1 -1
- package/dist/utils/echarts.d.ts +2 -0
- package/dist/utils/icon.d.ts +0 -5
- package/dist/utils/icon.js +72 -11
- package/package.json +2 -3
- package/dist/_virtual/_commonjsHelpers.js +0 -6
- package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/core.js +0 -5
- package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/bash.js +0 -377
- package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/css.js +0 -923
- package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/go.js +0 -151
- package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/java.js +0 -240
- package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/javascript.js +0 -658
- package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/json.js +0 -38
- package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/markdown.js +0 -216
- package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/plaintext.js +0 -13
- package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/python.js +0 -399
- package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/rust.js +0 -305
- package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/sql.js +0 -615
- package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/typescript.js +0 -753
- package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/xml.js +0 -219
- package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/yaml.js +0 -183
- package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/core.js +0 -1063
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
1
|
+
import { defineComponent as Hl, defineAsyncComponent as be, ref as S, toRef as h, computed as b, watch as ke, unref as t, openBlock as a, createElementBlock as s, Fragment as v, createVNode as T, createBlock as y, createCommentVNode as M, createElementVNode as g, normalizeStyle as k, normalizeClass as z, renderList as m, mergeProps as K, withModifiers as _, renderSlot as Q, toDisplayString as L, createSlots as Pe, withCtx as Ve, Teleport as Bl } from "vue";
|
|
2
|
+
import he from "./TableHeaderRow.vue.js";
|
|
3
3
|
import Oe from "./TableDataRow.vue.js";
|
|
4
4
|
import Z from "./TableGroupRow.vue.js";
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import Kl from "./DetailSheet.vue.js";
|
|
5
|
+
import Il from "./NewRowBtn.vue.js";
|
|
6
|
+
import Kl from "./MobileListView.vue.js";
|
|
8
7
|
import E from "./FieldCell.vue.js";
|
|
9
8
|
import { useInlineEdit as El } from "../../composables/useInlineEdit.js";
|
|
10
9
|
import { useVirtualList as _l } from "../../composables/useVirtualList.js";
|
|
@@ -43,7 +42,7 @@ const Ul = ["tabindex"], ql = {
|
|
|
43
42
|
}, co = {
|
|
44
43
|
key: 3,
|
|
45
44
|
class: "of-data-table-draft-toolbar"
|
|
46
|
-
}, vo = { class: "of-data-table-draft-count" }, yo = { class: "of-add-field-popup" }, go = 36, bo = 44,
|
|
45
|
+
}, vo = { class: "of-data-table-draft-count" }, yo = { class: "of-add-field-popup" }, go = 36, bo = 44, Oo = /* @__PURE__ */ Hl({
|
|
47
46
|
__name: "DataTable",
|
|
48
47
|
props: {
|
|
49
48
|
tasks: {},
|
|
@@ -73,18 +72,18 @@ const Ul = ["tabindex"], ql = {
|
|
|
73
72
|
},
|
|
74
73
|
emits: ["row-click", "row-click-record", "add-row", "selection-change", "cell-edit", "column-resize", "active-cell-change", "row-reorder", "row-group-change", "draft-commit", "draft-discard", "drafts-commit-all", "paste", "schema-add-field", "schema-rename-field", "schema-change-field-type", "schema-hide-field", "schema-delete-field", "schema-duplicate-field"],
|
|
75
74
|
setup(f, { emit: Ne }) {
|
|
76
|
-
const We =
|
|
75
|
+
const We = be(() => import("./ColumnHeaderMenu.vue.js")), Ye = be(() => import("./FieldTypePicker.vue.js")), je = be(() => import("./DetailSheet.vue.js")), i = f, c = Ne, { isMobile: me } = Wl(), G = S(!1), P = S(null), ee = El(), { commit: Xe, editingCell: Ue } = ee, { rows: pe } = Pl({
|
|
77
76
|
tasks: h(i, "tasks"),
|
|
78
77
|
records: h(i, "records")
|
|
79
78
|
}), { columns: le } = Vl({
|
|
80
79
|
columns: h(i, "columns"),
|
|
81
80
|
schema: h(i, "schema"),
|
|
82
81
|
view: h(i, "view")
|
|
83
|
-
}), { startResize:
|
|
82
|
+
}), { startResize: qe, columnWidthOverrides: Je, showResizeIndicator: Qe, resizeIndicatorX: Ze, autoFitColumn: el } = Ol({
|
|
84
83
|
columns: le,
|
|
85
84
|
onResize: (l, o) => c("column-resize", { colKey: l, width: o })
|
|
86
85
|
}), C = b(() => {
|
|
87
|
-
const l =
|
|
86
|
+
const l = Je.value;
|
|
88
87
|
return l.size === 0 ? le.value : le.value.map((o) => {
|
|
89
88
|
const e = l.get(o.key);
|
|
90
89
|
return e !== void 0 ? { ...o, width: e } : o;
|
|
@@ -94,29 +93,29 @@ const Ul = ["tabindex"], ql = {
|
|
|
94
93
|
sort: A,
|
|
95
94
|
toggleSort: O,
|
|
96
95
|
selectedRows: p,
|
|
97
|
-
toggleSelectAll:
|
|
98
|
-
toggleRowSelection:
|
|
96
|
+
toggleSelectAll: ll,
|
|
97
|
+
toggleRowSelection: ol,
|
|
99
98
|
isAllSelected: oe,
|
|
100
|
-
setData:
|
|
99
|
+
setData: tl
|
|
101
100
|
} = Ll({
|
|
102
|
-
data:
|
|
101
|
+
data: pe.value,
|
|
103
102
|
pageSize: 999999
|
|
104
103
|
});
|
|
105
|
-
|
|
106
|
-
const { groupedItems: D, collapsedGroups:
|
|
104
|
+
ke(pe, (l) => tl(l), { deep: !1 });
|
|
105
|
+
const { groupedItems: D, collapsedGroups: nl, toggleGroup: N, isGroupHeader: x } = Gl({
|
|
107
106
|
data: V,
|
|
108
107
|
groupBy: h(i, "groupBy"),
|
|
109
108
|
groups: h(i, "groups"),
|
|
110
109
|
aggregations: h(i, "aggregations")
|
|
111
|
-
}), W = S(null), te = S(null),
|
|
110
|
+
}), W = S(null), te = S(null), we = S(null), al = b(() => {
|
|
112
111
|
var l;
|
|
113
112
|
return (((l = i.fixedColumns) == null ? void 0 : l.length) ?? 0) > 0;
|
|
114
|
-
}),
|
|
113
|
+
}), Ce = S(0), rl = b(() => Ce.value > 0), {
|
|
115
114
|
fixedColumns: ne,
|
|
116
115
|
scrollableColumns: ae,
|
|
117
|
-
fixedWidth:
|
|
118
|
-
handleScroll:
|
|
119
|
-
handleFixedScroll:
|
|
116
|
+
fixedWidth: De,
|
|
117
|
+
handleScroll: sl,
|
|
118
|
+
handleFixedScroll: xe,
|
|
120
119
|
scrollLeft: ko,
|
|
121
120
|
syncHover: R,
|
|
122
121
|
isRowHovered: Y
|
|
@@ -124,8 +123,8 @@ const Ul = ["tabindex"], ql = {
|
|
|
124
123
|
columns: C,
|
|
125
124
|
fixedColumnKeys: b(() => i.fixedColumns ?? []),
|
|
126
125
|
scrollContainerRef: W,
|
|
127
|
-
fixedContainerRef:
|
|
128
|
-
}), re = b(() => i.virtual !== void 0 ? i.virtual : D.value.length >= i.virtualThreshold), { visibleItems: se, totalHeight: de, offsetY: ie, scrollToIndex:
|
|
126
|
+
fixedContainerRef: we
|
|
127
|
+
}), re = b(() => i.virtual !== void 0 ? i.virtual : D.value.length >= i.virtualThreshold), { visibleItems: se, totalHeight: de, offsetY: ie, scrollToIndex: dl, observeRow: j } = _l({
|
|
129
128
|
items: D,
|
|
130
129
|
itemHeight: (l) => {
|
|
131
130
|
const o = D.value[l];
|
|
@@ -134,17 +133,17 @@ const Ul = ["tabindex"], ql = {
|
|
|
134
133
|
overscan: 5,
|
|
135
134
|
containerRef: W,
|
|
136
135
|
measureRow: !0
|
|
137
|
-
}),
|
|
136
|
+
}), Re = b(() => D.value.filter((l) => !x(l))), { activeCell: Se, selectedRange: il, setActiveCell: Me, handleKeyDown: ul } = Nl({
|
|
138
137
|
columns: C,
|
|
139
|
-
rows:
|
|
138
|
+
rows: Re,
|
|
140
139
|
containerRef: te,
|
|
141
|
-
editingCell:
|
|
140
|
+
editingCell: Ue,
|
|
142
141
|
enabled: b(() => i.enableKeyboard),
|
|
143
142
|
onActivateEdit: (l, o) => ee.activate(l, o),
|
|
144
143
|
onCancelEdit: () => ee.cancel(),
|
|
145
|
-
onScrollToRow: (l) =>
|
|
144
|
+
onScrollToRow: (l) => dl(l),
|
|
146
145
|
getCellValue: (l, o) => {
|
|
147
|
-
const e =
|
|
146
|
+
const e = Re.value.find((r) => r.id === l);
|
|
148
147
|
if (!e) return "";
|
|
149
148
|
const n = e[o];
|
|
150
149
|
return n != null ? String(n) : "";
|
|
@@ -153,56 +152,56 @@ const Ul = ["tabindex"], ql = {
|
|
|
153
152
|
c("paste", { startRowId: l, startColKey: o, data: e });
|
|
154
153
|
}
|
|
155
154
|
});
|
|
156
|
-
|
|
155
|
+
ke(Se, (l) => c("active-cell-change", l ?? null));
|
|
157
156
|
const {
|
|
158
|
-
isDragging:
|
|
159
|
-
draggedRowId:
|
|
157
|
+
isDragging: fl,
|
|
158
|
+
draggedRowId: cl,
|
|
160
159
|
dropTargetId: ue,
|
|
161
|
-
dropPosition:
|
|
162
|
-
handleDragStart:
|
|
163
|
-
handleDragOver:
|
|
164
|
-
handleDrop:
|
|
165
|
-
handleDragEnd:
|
|
160
|
+
dropPosition: $e,
|
|
161
|
+
handleDragStart: vl,
|
|
162
|
+
handleDragOver: yl,
|
|
163
|
+
handleDrop: gl,
|
|
164
|
+
handleDragEnd: Te
|
|
166
165
|
} = jl({
|
|
167
166
|
processedItems: D,
|
|
168
167
|
enableCrossGroupDrag: b(() => i.enableCrossGroupDrag),
|
|
169
168
|
groupFieldId: h(i, "groupBy")
|
|
170
169
|
});
|
|
171
|
-
function Te(l, o) {
|
|
172
|
-
i.enableRowDrag && cl(l, o);
|
|
173
|
-
}
|
|
174
170
|
function ze(l, o) {
|
|
175
171
|
i.enableRowDrag && vl(l, o);
|
|
176
172
|
}
|
|
177
173
|
function Ae(l, o) {
|
|
178
|
-
i.enableRowDrag && yl(l, o
|
|
174
|
+
i.enableRowDrag && yl(l, o);
|
|
175
|
+
}
|
|
176
|
+
function Fe(l, o) {
|
|
177
|
+
i.enableRowDrag && gl(l, o, {
|
|
179
178
|
onReorder: (e) => c("row-reorder", e),
|
|
180
179
|
onGroupChange: (e) => c("row-group-change", e)
|
|
181
180
|
});
|
|
182
181
|
}
|
|
183
182
|
const {
|
|
184
|
-
drafts:
|
|
185
|
-
addDraft:
|
|
183
|
+
drafts: He,
|
|
184
|
+
addDraft: bl,
|
|
186
185
|
updateDraftField: ho,
|
|
187
186
|
removeDraft: mo,
|
|
188
187
|
commitDraft: po,
|
|
189
|
-
commitAll:
|
|
190
|
-
discardAll:
|
|
188
|
+
commitAll: kl,
|
|
189
|
+
discardAll: hl,
|
|
191
190
|
isDraft: wo,
|
|
192
191
|
getDraftErrors: Co
|
|
193
192
|
} = Xl({
|
|
194
193
|
schema: h(i, "schema"),
|
|
195
194
|
groupFieldId: h(i, "groupBy")
|
|
196
|
-
}),
|
|
197
|
-
function ml() {
|
|
198
|
-
i.schema ? gl() : c("add-row");
|
|
199
|
-
}
|
|
195
|
+
}), ml = b(() => He.value.size > 0);
|
|
200
196
|
function pl() {
|
|
201
|
-
|
|
202
|
-
l.length > 0 && c("drafts-commit-all", { records: l });
|
|
197
|
+
i.schema ? bl() : c("add-row");
|
|
203
198
|
}
|
|
204
199
|
function wl() {
|
|
205
|
-
kl();
|
|
200
|
+
const l = kl();
|
|
201
|
+
l.length > 0 && c("drafts-commit-all", { records: l });
|
|
202
|
+
}
|
|
203
|
+
function Cl() {
|
|
204
|
+
hl();
|
|
206
205
|
}
|
|
207
206
|
const w = S({ visible: !1, colKey: "", colLabel: "", x: 0, y: 0 }), X = S(!1);
|
|
208
207
|
function fe(l, o) {
|
|
@@ -229,36 +228,36 @@ const Ul = ["tabindex"], ql = {
|
|
|
229
228
|
y: 100
|
|
230
229
|
};
|
|
231
230
|
}
|
|
232
|
-
function
|
|
231
|
+
function Dl(l, o) {
|
|
233
232
|
c("schema-rename-field", { fieldId: l, newName: o });
|
|
234
233
|
}
|
|
235
|
-
function
|
|
234
|
+
function xl(l, o) {
|
|
236
235
|
c("schema-change-field-type", { fieldId: l, newType: o });
|
|
237
236
|
}
|
|
238
|
-
function
|
|
237
|
+
function Rl(l) {
|
|
239
238
|
c("schema-hide-field", l);
|
|
240
239
|
}
|
|
241
|
-
function
|
|
240
|
+
function Sl(l) {
|
|
242
241
|
c("schema-delete-field", l);
|
|
243
242
|
}
|
|
244
|
-
function
|
|
243
|
+
function Ml(l) {
|
|
245
244
|
c("schema-duplicate-field", l);
|
|
246
245
|
}
|
|
247
246
|
function ve() {
|
|
248
247
|
X.value = !0;
|
|
249
248
|
}
|
|
250
|
-
function
|
|
249
|
+
function $l(l) {
|
|
251
250
|
c("schema-add-field", l), X.value = !1;
|
|
252
251
|
}
|
|
253
|
-
const $ = b(() => i.readonly ? !1 : i.selectable),
|
|
254
|
-
function
|
|
255
|
-
|
|
252
|
+
const $ = b(() => i.readonly ? !1 : i.selectable), Be = b(() => i.readonly ? !1 : i.addable), Tl = b(() => Array.from(p.value)), Ie = b(() => p.value.size > 0 && !oe.value);
|
|
253
|
+
function Ke() {
|
|
254
|
+
ll(V.value);
|
|
256
255
|
}
|
|
257
256
|
function U(l) {
|
|
258
257
|
const o = V.value.find((e) => e[i.rowKey] === l);
|
|
259
|
-
o &&
|
|
258
|
+
o && ol(o, 0);
|
|
260
259
|
}
|
|
261
|
-
|
|
260
|
+
ke(Tl, (l) => c("selection-change", l), { immediate: !1 });
|
|
262
261
|
function u(l) {
|
|
263
262
|
const o = l[i.rowKey];
|
|
264
263
|
return o != null ? String(o) : "";
|
|
@@ -272,10 +271,10 @@ const Ul = ["tabindex"], ql = {
|
|
|
272
271
|
};
|
|
273
272
|
}
|
|
274
273
|
function H(l, o, e) {
|
|
275
|
-
|
|
274
|
+
Xe(l, o, e), c("cell-edit", { rowId: l, fieldId: o, value: e });
|
|
276
275
|
}
|
|
277
276
|
function B(l) {
|
|
278
|
-
if (
|
|
277
|
+
if (me.value) {
|
|
279
278
|
P.value = l, G.value = !0;
|
|
280
279
|
return;
|
|
281
280
|
}
|
|
@@ -287,21 +286,21 @@ const Ul = ["tabindex"], ql = {
|
|
|
287
286
|
c("row-click", l);
|
|
288
287
|
}
|
|
289
288
|
function ye(l, o) {
|
|
290
|
-
|
|
289
|
+
qe(l, o);
|
|
291
290
|
}
|
|
292
291
|
function ge(l) {
|
|
293
|
-
|
|
292
|
+
el(l, te.value);
|
|
294
293
|
}
|
|
295
|
-
function
|
|
296
|
-
|
|
294
|
+
function zl(l) {
|
|
295
|
+
sl(l);
|
|
297
296
|
const o = l.target;
|
|
298
|
-
|
|
297
|
+
Ce.value = o.scrollLeft;
|
|
299
298
|
}
|
|
300
299
|
function q(l) {
|
|
301
300
|
return {
|
|
302
301
|
groupKey: l.__groupKey,
|
|
303
302
|
count: l.__groupCount,
|
|
304
|
-
collapsed:
|
|
303
|
+
collapsed: nl.value.has(
|
|
305
304
|
l.__groupPath ? l.__groupPath.join("/") : l.__groupKey
|
|
306
305
|
),
|
|
307
306
|
colorMap: i.groupColorMap,
|
|
@@ -313,7 +312,7 @@ const Ul = ["tabindex"], ql = {
|
|
|
313
312
|
function J(l) {
|
|
314
313
|
return l.__groupPath ? l.__groupPath.join("/") : l.__groupKey;
|
|
315
314
|
}
|
|
316
|
-
function
|
|
315
|
+
function Ee(l) {
|
|
317
316
|
return {
|
|
318
317
|
row: l,
|
|
319
318
|
rowKey: i.rowKey,
|
|
@@ -324,48 +323,48 @@ const Ul = ["tabindex"], ql = {
|
|
|
324
323
|
statusColorMap: i.statusColorMap
|
|
325
324
|
};
|
|
326
325
|
}
|
|
327
|
-
function
|
|
328
|
-
const e =
|
|
326
|
+
function _e(l, o) {
|
|
327
|
+
const e = Se.value;
|
|
329
328
|
return e !== null && e.rowId === l && e.colKey === o;
|
|
330
329
|
}
|
|
331
|
-
function
|
|
332
|
-
return
|
|
330
|
+
function Le(l, o) {
|
|
331
|
+
return il.value.some((e) => e.rowId === l && e.colKey === o);
|
|
333
332
|
}
|
|
334
|
-
function
|
|
333
|
+
function Ge(l) {
|
|
335
334
|
const o = u(l);
|
|
336
335
|
return {
|
|
337
|
-
"of-row-dragging":
|
|
336
|
+
"of-row-dragging": fl.value && cl.value === o,
|
|
338
337
|
"of-row-drop-target": ue.value === o,
|
|
339
|
-
"of-row-drop-before": ue.value === o &&
|
|
340
|
-
"of-row-drop-after": ue.value === o &&
|
|
338
|
+
"of-row-drop-before": ue.value === o && $e.value === "before",
|
|
339
|
+
"of-row-drop-after": ue.value === o && $e.value === "after"
|
|
341
340
|
};
|
|
342
341
|
}
|
|
343
|
-
function
|
|
342
|
+
function Al(l) {
|
|
344
343
|
P.value = l, G.value = !0;
|
|
345
344
|
}
|
|
346
|
-
function
|
|
345
|
+
function Fl(l) {
|
|
347
346
|
for (const [o, e] of Object.entries(l.fields))
|
|
348
347
|
c("cell-edit", { rowId: l.rowId, fieldId: o, value: e });
|
|
349
348
|
}
|
|
350
|
-
return (l, o) => t(
|
|
351
|
-
T(
|
|
349
|
+
return (l, o) => t(me) ? (a(), s(v, { key: 0 }, [
|
|
350
|
+
T(Kl, {
|
|
352
351
|
rows: t(V),
|
|
353
352
|
columns: C.value,
|
|
354
353
|
selectable: $.value,
|
|
355
|
-
addable:
|
|
354
|
+
addable: Be.value,
|
|
356
355
|
"status-color-map": f.statusColorMap,
|
|
357
356
|
readonly: f.readonly,
|
|
358
|
-
onRowClick:
|
|
357
|
+
onRowClick: Al,
|
|
359
358
|
onAddRow: o[0] || (o[0] = (e) => c("add-row"))
|
|
360
359
|
}, null, 8, ["rows", "columns", "selectable", "addable", "status-color-map", "readonly"]),
|
|
361
|
-
P.value ? (a(), y(
|
|
360
|
+
P.value ? (a(), y(t(je), {
|
|
362
361
|
key: 0,
|
|
363
362
|
row: P.value,
|
|
364
363
|
columns: C.value,
|
|
365
364
|
"field-defs": f.fieldDefs,
|
|
366
365
|
visible: G.value,
|
|
367
366
|
onClose: o[1] || (o[1] = (e) => G.value = !1),
|
|
368
|
-
onSave:
|
|
367
|
+
onSave: Fl,
|
|
369
368
|
onDelete: o[2] || (o[2] = (e) => c("row-click", { id: e, __action: "delete" })),
|
|
370
369
|
onCellEdit: o[3] || (o[3] = (e) => c("cell-edit", e))
|
|
371
370
|
}, null, 8, ["row", "columns", "field-defs", "visible"])) : M("", !0)
|
|
@@ -376,29 +375,29 @@ const Ul = ["tabindex"], ql = {
|
|
|
376
375
|
class: "of-data-table",
|
|
377
376
|
role: "grid",
|
|
378
377
|
tabindex: f.enableKeyboard ? 0 : void 0,
|
|
379
|
-
onKeydown: o[14] || (o[14] = (e) => f.enableKeyboard ? t(
|
|
378
|
+
onKeydown: o[14] || (o[14] = (e) => f.enableKeyboard ? t(ul)(e) : void 0)
|
|
380
379
|
}, [
|
|
381
|
-
|
|
380
|
+
al.value ? (a(), s("div", ql, [
|
|
382
381
|
g("div", {
|
|
383
382
|
ref_key: "fixedContainerRef",
|
|
384
|
-
ref:
|
|
385
|
-
class: z(["of-data-table-fixed-region", { "of-fixed-shadow":
|
|
386
|
-
style: k({ width: t(
|
|
383
|
+
ref: we,
|
|
384
|
+
class: z(["of-data-table-fixed-region", { "of-fixed-shadow": rl.value }]),
|
|
385
|
+
style: k({ width: t(De) + "px" }),
|
|
387
386
|
onScroll: o[8] || (o[8] = //@ts-ignore
|
|
388
|
-
(...e) => t(
|
|
387
|
+
(...e) => t(xe) && t(xe)(...e))
|
|
389
388
|
}, [
|
|
390
|
-
T(
|
|
389
|
+
T(he, {
|
|
391
390
|
columns: t(ne),
|
|
392
391
|
selectable: $.value,
|
|
393
392
|
"sort-key": t(A).field ?? "",
|
|
394
393
|
"sort-order": t(A).order ?? "asc",
|
|
395
394
|
"all-selected": t(oe),
|
|
396
|
-
indeterminate:
|
|
395
|
+
indeterminate: Ie.value,
|
|
397
396
|
"enable-resize": f.enableResize,
|
|
398
397
|
"enable-field-menu": f.enableFieldManagement,
|
|
399
398
|
"enable-add-field": f.enableFieldManagement,
|
|
400
399
|
onSort: t(O),
|
|
401
|
-
onSelectAll:
|
|
400
|
+
onSelectAll: Ke,
|
|
402
401
|
onResizeStart: ye,
|
|
403
402
|
onResizeDblclick: ge,
|
|
404
403
|
onHeaderContextmenu: fe,
|
|
@@ -537,10 +536,10 @@ const Ul = ["tabindex"], ql = {
|
|
|
537
536
|
ref_key: "scrollContainerRef",
|
|
538
537
|
ref: W,
|
|
539
538
|
class: "of-data-table-scroll-region",
|
|
540
|
-
style: k({ marginLeft: t(
|
|
541
|
-
onScroll:
|
|
539
|
+
style: k({ marginLeft: t(De) + "px" }),
|
|
540
|
+
onScroll: zl
|
|
542
541
|
}, [
|
|
543
|
-
T(
|
|
542
|
+
T(he, {
|
|
544
543
|
columns: t(ae),
|
|
545
544
|
selectable: !1,
|
|
546
545
|
"sort-key": t(A).field ?? "",
|
|
@@ -645,18 +644,18 @@ const Ul = ["tabindex"], ql = {
|
|
|
645
644
|
])
|
|
646
645
|
], 36)
|
|
647
646
|
])) : (a(), s(v, { key: 1 }, [
|
|
648
|
-
T(
|
|
647
|
+
T(he, {
|
|
649
648
|
columns: C.value,
|
|
650
649
|
selectable: $.value,
|
|
651
650
|
"sort-key": t(A).field ?? "",
|
|
652
651
|
"sort-order": t(A).order ?? "asc",
|
|
653
652
|
"all-selected": t(oe),
|
|
654
|
-
indeterminate:
|
|
653
|
+
indeterminate: Ie.value,
|
|
655
654
|
"enable-resize": f.enableResize,
|
|
656
655
|
"enable-field-menu": f.enableFieldManagement,
|
|
657
656
|
"enable-add-field": f.enableFieldManagement,
|
|
658
657
|
onSort: t(O),
|
|
659
|
-
onSelectAll:
|
|
658
|
+
onSelectAll: Ke,
|
|
660
659
|
onResizeStart: ye,
|
|
661
660
|
onResizeDblclick: ge,
|
|
662
661
|
onHeaderContextmenu: fe,
|
|
@@ -690,15 +689,15 @@ const Ul = ["tabindex"], ql = {
|
|
|
690
689
|
key: 1,
|
|
691
690
|
ref_for: !0,
|
|
692
691
|
ref: (d) => t(j)((d == null ? void 0 : d.$el) ?? d, n)
|
|
693
|
-
}, { ref_for: !0 },
|
|
692
|
+
}, { ref_for: !0 }, Ee(e), {
|
|
694
693
|
draggable: f.enableRowDrag,
|
|
695
|
-
class:
|
|
694
|
+
class: Ge(e),
|
|
696
695
|
onSelect: U,
|
|
697
696
|
onClick: (d) => B(e),
|
|
698
|
-
onDragstart: (d) =>
|
|
699
|
-
onDragover: (d) =>
|
|
700
|
-
onDrop: (d) =>
|
|
701
|
-
onDragend: t(
|
|
697
|
+
onDragstart: (d) => ze(d, e),
|
|
698
|
+
onDragover: (d) => Ae(d, e),
|
|
699
|
+
onDrop: (d) => Fe(d, e),
|
|
700
|
+
onDragend: t(Te)
|
|
702
701
|
}), Pe({ _: 2 }, [
|
|
703
702
|
(r = f.fieldDefs) != null && r.length ? {
|
|
704
703
|
name: "cell",
|
|
@@ -708,11 +707,11 @@ const Ul = ["tabindex"], ql = {
|
|
|
708
707
|
field: F(I.key),
|
|
709
708
|
value: d[I.key],
|
|
710
709
|
class: z({
|
|
711
|
-
"of-cell--active":
|
|
712
|
-
"of-cell--selected":
|
|
710
|
+
"of-cell--active": _e(u(d), I.key),
|
|
711
|
+
"of-cell--selected": Le(u(d), I.key)
|
|
713
712
|
}),
|
|
714
713
|
onCommit: H,
|
|
715
|
-
onClick: _((Do) => f.enableKeyboard && t(
|
|
714
|
+
onClick: _((Do) => f.enableKeyboard && t(Me)(u(d), I.key), ["stop"])
|
|
716
715
|
}, null, 8, ["row-id", "field", "value", "class", "onClick"])
|
|
717
716
|
]),
|
|
718
717
|
key: "0"
|
|
@@ -734,15 +733,15 @@ const Ul = ["tabindex"], ql = {
|
|
|
734
733
|
}), null, 16, ["onToggle"])) : (a(), y(Oe, K({
|
|
735
734
|
key: 1,
|
|
736
735
|
ref_for: !0
|
|
737
|
-
},
|
|
736
|
+
}, Ee(e), {
|
|
738
737
|
draggable: f.enableRowDrag,
|
|
739
|
-
class:
|
|
738
|
+
class: Ge(e),
|
|
740
739
|
onSelect: U,
|
|
741
740
|
onClick: (r) => B(e),
|
|
742
|
-
onDragstart: (r) =>
|
|
743
|
-
onDragover: (r) =>
|
|
744
|
-
onDrop: (r) =>
|
|
745
|
-
onDragend: t(
|
|
741
|
+
onDragstart: (r) => ze(r, e),
|
|
742
|
+
onDragover: (r) => Ae(r, e),
|
|
743
|
+
onDrop: (r) => Fe(r, e),
|
|
744
|
+
onDragend: t(Te)
|
|
746
745
|
}), Pe({ _: 2 }, [
|
|
747
746
|
(n = f.fieldDefs) != null && n.length ? {
|
|
748
747
|
name: "cell",
|
|
@@ -752,11 +751,11 @@ const Ul = ["tabindex"], ql = {
|
|
|
752
751
|
field: F(d.key),
|
|
753
752
|
value: r[d.key],
|
|
754
753
|
class: z({
|
|
755
|
-
"of-cell--active":
|
|
756
|
-
"of-cell--selected":
|
|
754
|
+
"of-cell--active": _e(u(r), d.key),
|
|
755
|
+
"of-cell--selected": Le(u(r), d.key)
|
|
757
756
|
}),
|
|
758
757
|
onCommit: H,
|
|
759
|
-
onClick: _((I) => f.enableKeyboard && t(
|
|
758
|
+
onClick: _((I) => f.enableKeyboard && t(Me)(u(r), d.key), ["stop"])
|
|
760
759
|
}, null, 8, ["row-id", "field", "value", "class", "onClick"])
|
|
761
760
|
]),
|
|
762
761
|
key: "0"
|
|
@@ -766,25 +765,25 @@ const Ul = ["tabindex"], ql = {
|
|
|
766
765
|
}), 128))
|
|
767
766
|
], 512)
|
|
768
767
|
], 64)),
|
|
769
|
-
t(
|
|
768
|
+
t(Qe) ? (a(), s("div", {
|
|
770
769
|
key: 2,
|
|
771
770
|
class: "of-resize-indicator",
|
|
772
|
-
style: k({ left: t(
|
|
771
|
+
style: k({ left: t(Ze) + "px" })
|
|
773
772
|
}, null, 4)) : M("", !0),
|
|
774
|
-
|
|
775
|
-
g("span", vo, L(t(
|
|
773
|
+
ml.value ? (a(), s("div", co, [
|
|
774
|
+
g("span", vo, L(t(He).size) + " 条草稿", 1),
|
|
776
775
|
g("button", {
|
|
777
776
|
class: "of-data-table-draft-btn of-data-table-draft-btn--commit",
|
|
778
|
-
onClick:
|
|
777
|
+
onClick: wl
|
|
779
778
|
}, " 全部提交 "),
|
|
780
779
|
g("button", {
|
|
781
780
|
class: "of-data-table-draft-btn of-data-table-draft-btn--discard",
|
|
782
|
-
onClick:
|
|
781
|
+
onClick: Cl
|
|
783
782
|
}, " 全部放弃 ")
|
|
784
783
|
])) : M("", !0),
|
|
785
|
-
|
|
784
|
+
Be.value ? (a(), y(Il, {
|
|
786
785
|
key: 4,
|
|
787
|
-
onClick:
|
|
786
|
+
onClick: pl
|
|
788
787
|
})) : M("", !0),
|
|
789
788
|
f.enableFieldManagement ? (a(), y(t(We), {
|
|
790
789
|
key: 5,
|
|
@@ -795,21 +794,21 @@ const Ul = ["tabindex"], ql = {
|
|
|
795
794
|
x: w.value.x,
|
|
796
795
|
y: w.value.y,
|
|
797
796
|
onClose: o[11] || (o[11] = (e) => w.value.visible = !1),
|
|
798
|
-
onRename:
|
|
799
|
-
onChangeType:
|
|
797
|
+
onRename: Dl,
|
|
798
|
+
onChangeType: xl,
|
|
800
799
|
onSort: o[12] || (o[12] = (e, n) => t(O)(e)),
|
|
801
|
-
onHide:
|
|
802
|
-
onDelete:
|
|
803
|
-
onDuplicate:
|
|
800
|
+
onHide: Rl,
|
|
801
|
+
onDelete: Sl,
|
|
802
|
+
onDuplicate: Ml
|
|
804
803
|
}, null, 8, ["visible", "col-key", "col-label", "field-type", "x", "y"])) : M("", !0),
|
|
805
|
-
(a(), y(
|
|
804
|
+
(a(), y(Bl, { to: "body" }, [
|
|
806
805
|
X.value ? (a(), s("div", {
|
|
807
806
|
key: 0,
|
|
808
807
|
class: "of-add-field-overlay",
|
|
809
808
|
onClick: o[13] || (o[13] = _((e) => X.value = !1, ["self"]))
|
|
810
809
|
}, [
|
|
811
810
|
g("div", yo, [
|
|
812
|
-
T(t(Ye), { onSelect:
|
|
811
|
+
T(t(Ye), { onSelect: $l })
|
|
813
812
|
])
|
|
814
813
|
])) : M("", !0)
|
|
815
814
|
]))
|
|
@@ -817,5 +816,5 @@ const Ul = ["tabindex"], ql = {
|
|
|
817
816
|
}
|
|
818
817
|
});
|
|
819
818
|
export {
|
|
820
|
-
|
|
819
|
+
Oo as default
|
|
821
820
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./FieldCell.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-545cb874"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
p as default
|
|
7
7
|
};
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useInlineEdit as
|
|
3
|
-
|
|
4
|
-
const V = {
|
|
1
|
+
import { defineComponent as N, computed as o, defineAsyncComponent as e, openBlock as n, createElementBlock as a, normalizeClass as A, createBlock as c, Suspense as B, withCtx as f, resolveDynamicComponent as S, createElementVNode as F, Fragment as D, unref as M, toDisplayString as T } from "vue";
|
|
2
|
+
import { useInlineEdit as V } from "../../composables/useInlineEdit.js";
|
|
3
|
+
const j = {
|
|
5
4
|
key: 1,
|
|
6
5
|
class: "of-field-cell__display"
|
|
7
|
-
}, R = /* @__PURE__ */
|
|
6
|
+
}, R = /* @__PURE__ */ N({
|
|
8
7
|
__name: "FieldCell",
|
|
9
8
|
props: {
|
|
10
9
|
rowId: {},
|
|
@@ -14,7 +13,7 @@ const V = {
|
|
|
14
13
|
},
|
|
15
14
|
emits: ["commit", "cancel", "tabNext"],
|
|
16
15
|
setup(l, { emit: s }) {
|
|
17
|
-
const t = l, r = s, { isEditing: p, activate: y, commit: v, cancel: k } =
|
|
16
|
+
const t = l, r = s, { isEditing: p, activate: y, commit: v, cancel: k } = V(), d = o(() => p(t.rowId, t.field.id)), m = o(() => t.readonly || t.field.readonly);
|
|
18
17
|
function x() {
|
|
19
18
|
m.value || y(t.rowId, t.field.id);
|
|
20
19
|
}
|
|
@@ -46,23 +45,25 @@ const V = {
|
|
|
46
45
|
relation: e(() => import("../field/FieldRelation.vue.js")),
|
|
47
46
|
attachment: e(() => import("../field/FieldAttachment.vue.js")),
|
|
48
47
|
phone: e(() => import("../field/FieldPhone.vue.js"))
|
|
49
|
-
}, w =
|
|
48
|
+
}, w = e(
|
|
49
|
+
() => import("../field/FieldMarkdownPreview.vue.js")
|
|
50
|
+
), E = o(() => h[t.field.type]), I = o(() => {
|
|
50
51
|
const i = t.value;
|
|
51
52
|
return i == null || i === "" ? "—" : Array.isArray(i) ? i.join(", ") : typeof i == "boolean" ? i ? "✓" : "—" : String(i);
|
|
52
53
|
});
|
|
53
|
-
return (i, u) => (
|
|
54
|
-
class:
|
|
54
|
+
return (i, u) => (n(), a("div", {
|
|
55
|
+
class: A(["of-field-cell", {
|
|
55
56
|
"of-field-cell--editing": d.value,
|
|
56
57
|
"of-field-cell--readonly": m.value
|
|
57
58
|
}]),
|
|
58
59
|
onClick: x
|
|
59
60
|
}, [
|
|
60
|
-
d.value ? (
|
|
61
|
+
d.value ? (n(), c(B, { key: 0 }, {
|
|
61
62
|
fallback: f(() => [...u[0] || (u[0] = [
|
|
62
|
-
|
|
63
|
+
F("span", { class: "of-field-cell__loading" }, "...", -1)
|
|
63
64
|
])]),
|
|
64
65
|
default: f(() => [
|
|
65
|
-
(
|
|
66
|
+
(n(), c(S(E.value), {
|
|
66
67
|
value: l.value,
|
|
67
68
|
field: l.field,
|
|
68
69
|
onCommit: C,
|
|
@@ -71,12 +72,12 @@ const V = {
|
|
|
71
72
|
}, null, 40, ["value", "field"]))
|
|
72
73
|
]),
|
|
73
74
|
_: 1
|
|
74
|
-
})) : (
|
|
75
|
-
l.field.type === "richtext" && typeof l.value == "string" && l.value ? (
|
|
75
|
+
})) : (n(), a(D, { key: 1 }, [
|
|
76
|
+
l.field.type === "richtext" && typeof l.value == "string" && l.value ? (n(), c(M(w), {
|
|
76
77
|
key: 0,
|
|
77
78
|
content: l.value,
|
|
78
79
|
"max-lines": 2
|
|
79
|
-
}, null, 8, ["content"])) : (
|
|
80
|
+
}, null, 8, ["content"])) : (n(), a("span", j, T(I.value), 1))
|
|
80
81
|
], 64))
|
|
81
82
|
], 2));
|
|
82
83
|
}
|