@lumal/core 0.0.4-beta → 0.0.6-beta
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/CHANGELOG.md +20 -0
- package/README.md +13 -0
- package/dist/components-DFOgL7dc.cjs +2 -0
- package/dist/{components-B5Xd-iBK.js → components-DOLh1veJ.js} +603 -576
- package/dist/components.cjs +1 -1
- package/dist/components.js +1 -1
- package/dist/core.css +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +2 -2
- package/dist/{layout-zJLDCf1c.cjs → layout-7oFqNDTu.cjs} +1 -1
- package/dist/{layout-DQzFKvly.js → layout-CUlVQXlG.js} +101 -96
- package/dist/layout.cjs +1 -1
- package/dist/layout.js +1 -1
- package/dist/request.cjs +1 -1
- package/dist/request.js +114 -84
- package/dist/src/components/crud-table/LumalCrudTable.vue.d.ts.map +1 -1
- package/dist/src/components/crud-table/types.d.ts +3 -3
- package/dist/src/components/crud-table/types.d.ts.map +1 -1
- package/dist/src/components/schema-form/LumalSchemaForm.vue.d.ts +1 -0
- package/dist/src/components/schema-form/LumalSchemaForm.vue.d.ts.map +1 -1
- package/dist/src/components/schema-form/normalize.d.ts.map +1 -1
- package/dist/src/components/schema-form/types.d.ts +3 -0
- package/dist/src/components/schema-form/types.d.ts.map +1 -1
- package/dist/src/components/schema-table/LumalSchemaTable.vue.d.ts.map +1 -1
- package/dist/src/components/schema-table/cell.d.ts.map +1 -1
- package/dist/src/components/schema-table/index.d.ts +1 -1
- package/dist/src/components/schema-table/index.d.ts.map +1 -1
- package/dist/src/components/schema-table/normalize.d.ts.map +1 -1
- package/dist/src/components/schema-table/types.d.ts +12 -3
- package/dist/src/components/schema-table/types.d.ts.map +1 -1
- package/dist/src/exports/components.d.ts +1 -1
- package/dist/src/exports/components.d.ts.map +1 -1
- package/dist/src/layout/LumalLayout.vue.d.ts +4 -4
- package/dist/src/layout/LumalLayout.vue.d.ts.map +1 -1
- package/dist/src/request/client.d.ts.map +1 -1
- package/dist/src/request/types.d.ts +2 -2
- package/dist/src/request/types.d.ts.map +1 -1
- package/package.json +3 -3
- package/theme-chalk/index.scss +0 -4
- package/dist/components-CRxtQpsQ.cjs +0 -2
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { f as e, i as t, p as n } from "./composables-BxZG0_RZ.js";
|
|
2
2
|
import { t as r } from "./_plugin-vue_export-helper-B3ysoDQm.js";
|
|
3
|
-
import { Fragment as i, computed as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createSlots as u, createTextVNode as d, createVNode as f, defineComponent as p, guardReactiveProps as m, mergeModels as h, mergeProps as g, nextTick as _, normalizeClass as v, normalizeProps as y, normalizeStyle as b, onBeforeUnmount as x, onMounted as S, openBlock as C, reactive as
|
|
4
|
-
import { LumalIcon as I, LumalIcon as
|
|
5
|
-
import { ElButton as R, ElCheckbox as
|
|
3
|
+
import { Fragment as i, computed as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createSlots as u, createTextVNode as d, createVNode as f, defineComponent as p, guardReactiveProps as m, mergeModels as h, mergeProps as g, nextTick as _, normalizeClass as v, normalizeProps as y, normalizeStyle as b, onBeforeUnmount as x, onMounted as S, openBlock as C, reactive as ee, renderList as w, renderSlot as T, shallowRef as E, toDisplayString as D, toRaw as te, unref as O, useModel as k, useSlots as A, useTemplateRef as j, vShow as M, watch as N, withCtx as P, withDirectives as ne, withKeys as F, withModifiers as re } from "vue";
|
|
4
|
+
import { LumalIcon as I, LumalIcon as L, LumalIconPicker as ie, LumalIconPickerDialog as ae } from "@lumal/icons-vue";
|
|
5
|
+
import { ElButton as R, ElCheckbox as oe, ElCheckboxGroup as z, ElCol as se, ElDatePicker as B, ElDialog as V, ElDrawer as H, ElForm as ce, ElFormItem as le, ElInput as ue, ElInputNumber as de, ElLoading as fe, ElMessageBox as pe, ElOption as me, ElPagination as he, ElPopover as ge, ElRadio as _e, ElRadioGroup as ve, ElRow as ye, ElSelect as be, ElSwitch as xe, ElTable as Se, ElTableColumn as Ce, ElTreeSelect as we, ElUpload as Te } from "element-plus";
|
|
6
6
|
//#endregion
|
|
7
7
|
//#region src/components/pagination/LumalPagination.vue
|
|
8
|
-
var
|
|
8
|
+
var Ee = /*#__PURE__*/ r(/* @__PURE__ */ p({
|
|
9
9
|
__name: "LumalPagination",
|
|
10
10
|
props: /*@__PURE__*/ h({
|
|
11
11
|
total: {},
|
|
@@ -27,7 +27,7 @@ var De = /*#__PURE__*/ r(/* @__PURE__ */ p({
|
|
|
27
27
|
}),
|
|
28
28
|
emits: /*@__PURE__*/ h(["change"], ["update:page", "update:pageSize"]),
|
|
29
29
|
setup(e, { expose: t, emit: n }) {
|
|
30
|
-
let r = e, i = n, s =
|
|
30
|
+
let r = e, i = n, s = k(e, "page"), c = k(e, "pageSize"), l = j("paginationRef"), u = a(() => Math.max(1, Math.ceil(r.total / c.value)));
|
|
31
31
|
function d(e, t) {
|
|
32
32
|
i("change", {
|
|
33
33
|
page: e,
|
|
@@ -45,7 +45,7 @@ var De = /*#__PURE__*/ r(/* @__PURE__ */ p({
|
|
|
45
45
|
return t({
|
|
46
46
|
getPaginationElement: () => l.value?.$el,
|
|
47
47
|
getPaginationInstance: () => l.value
|
|
48
|
-
}), (t, n) => (C(), o(
|
|
48
|
+
}), (t, n) => (C(), o(O(he), {
|
|
49
49
|
ref_key: "paginationRef",
|
|
50
50
|
ref: l,
|
|
51
51
|
class: "lumal-pagination",
|
|
@@ -69,19 +69,19 @@ var De = /*#__PURE__*/ r(/* @__PURE__ */ p({
|
|
|
69
69
|
}), [["__scopeId", "data-v-d546f46b"]]);
|
|
70
70
|
//#endregion
|
|
71
71
|
//#region src/components/schema-form/normalize.ts
|
|
72
|
-
function
|
|
72
|
+
function De(e) {
|
|
73
73
|
return `lumal-schema-form-${e.replace(/[^\w-]/g, "-")}`;
|
|
74
74
|
}
|
|
75
|
-
function
|
|
75
|
+
function U(e, t) {
|
|
76
76
|
return typeof e == "function" ? !!e(t) : !!e;
|
|
77
77
|
}
|
|
78
|
-
function
|
|
78
|
+
function W(e, t, n) {
|
|
79
79
|
return typeof e == "function" ? e(t) : e ?? n;
|
|
80
80
|
}
|
|
81
|
-
function
|
|
81
|
+
function Oe(e, t) {
|
|
82
82
|
return !e.authority || t.canAccess?.(e.authority) !== !1;
|
|
83
83
|
}
|
|
84
|
-
function
|
|
84
|
+
function G(e = [], t = {}) {
|
|
85
85
|
let n = t.model ?? {};
|
|
86
86
|
return e.filter((e) => e.field.trim()).map((e) => {
|
|
87
87
|
let r = {
|
|
@@ -91,38 +91,39 @@ function U(e = [], t = {}) {
|
|
|
91
91
|
model: n,
|
|
92
92
|
setFieldValue: t.setFieldValue ?? (() => void 0),
|
|
93
93
|
value: n[e.field]
|
|
94
|
-
}, i = e.component ?? (e.dictionary || e.dictType ? "select" : "input"), a =
|
|
94
|
+
}, i = e.component ?? (e.dictionary || e.dictType ? "select" : "input"), a = U(e.hidden, r), o = U(e.disabled, r), s = e.readonlyAuthority ? t.canAccess?.(e.readonlyAuthority) === !1 : !1, c = r.mode === "view" || s || U(e.readonly, r), l = !a && i !== "hidden" && Oe(e, t), u = W(e.componentProps, r, {}), d = typeof e.options == "function" ? e.options(r) : O(e.options);
|
|
95
95
|
return {
|
|
96
96
|
...e,
|
|
97
|
-
id:
|
|
97
|
+
id: De(e.field),
|
|
98
98
|
component: i,
|
|
99
99
|
componentProps: { ...u },
|
|
100
|
-
description:
|
|
100
|
+
description: W(e.description, r, ""),
|
|
101
101
|
disabled: o,
|
|
102
|
-
help:
|
|
102
|
+
help: W(e.help, r, ""),
|
|
103
103
|
options: d ?? [],
|
|
104
|
-
required:
|
|
104
|
+
required: U(e.required, r),
|
|
105
105
|
readonly: c,
|
|
106
106
|
renderable: l,
|
|
107
|
-
|
|
107
|
+
visible: e.visible === void 0 || U(e.visible, r),
|
|
108
|
+
rules: W(e.rules, r, [])
|
|
108
109
|
};
|
|
109
110
|
});
|
|
110
111
|
}
|
|
111
|
-
function
|
|
112
|
+
function K(e, t = {}) {
|
|
112
113
|
return e.reduce((e, t) => (!(t.field in e) && t.defaultValue !== void 0 && (e[t.field] = t.defaultValue), e), { ...t });
|
|
113
114
|
}
|
|
114
115
|
//#endregion
|
|
115
116
|
//#region src/components/schema-form/LumalSchemaForm.vue?vue&type=script&setup=true&lang.ts
|
|
116
|
-
var
|
|
117
|
+
var ke = {
|
|
117
118
|
key: 0,
|
|
118
119
|
class: "lumal-schema-form__readonly-value"
|
|
119
|
-
},
|
|
120
|
+
}, q = {
|
|
120
121
|
key: 0,
|
|
121
122
|
class: "lumal-schema-form__description"
|
|
122
|
-
},
|
|
123
|
+
}, Ae = {
|
|
123
124
|
key: 1,
|
|
124
125
|
class: "lumal-schema-form__help"
|
|
125
|
-
},
|
|
126
|
+
}, J = /*#__PURE__*/ r(/* @__PURE__ */ p({
|
|
126
127
|
__name: "LumalSchemaForm",
|
|
127
128
|
props: /*@__PURE__*/ h({
|
|
128
129
|
canAccess: {},
|
|
@@ -159,6 +160,10 @@ var G = {
|
|
|
159
160
|
type: Boolean,
|
|
160
161
|
default: !1
|
|
161
162
|
},
|
|
163
|
+
submitDisabled: {
|
|
164
|
+
type: Boolean,
|
|
165
|
+
default: !1
|
|
166
|
+
},
|
|
162
167
|
submitOnEnter: {
|
|
163
168
|
type: Boolean,
|
|
164
169
|
default: !1
|
|
@@ -178,156 +183,156 @@ var G = {
|
|
|
178
183
|
"valuesChange"
|
|
179
184
|
], ["update:modelValue"]),
|
|
180
185
|
setup(e, { expose: n, emit: r }) {
|
|
181
|
-
let l = e, p = r, m =
|
|
186
|
+
let l = e, p = r, m = k(e, "modelValue"), h = j("formRef"), _ = fe.directive, y = E(l.mode);
|
|
182
187
|
N(() => l.mode, (e) => {
|
|
183
188
|
y.value = e;
|
|
184
189
|
});
|
|
185
|
-
let b =
|
|
190
|
+
let b = E({ ...m.value }), x = ee(K(G(l.schemas, {
|
|
186
191
|
canAccess: l.canAccess,
|
|
187
192
|
mode: y.value,
|
|
188
193
|
model: m.value,
|
|
189
|
-
setFieldValue:
|
|
190
|
-
}), m.value)), S = a(() => x),
|
|
191
|
-
function
|
|
192
|
-
|
|
194
|
+
setFieldValue: Me
|
|
195
|
+
}), m.value)), S = a(() => x), te = E([]);
|
|
196
|
+
function A() {
|
|
197
|
+
te.value = l.schemas.map((e) => a(() => G([e], {
|
|
193
198
|
canAccess: l.canAccess,
|
|
194
199
|
mode: y.value,
|
|
195
200
|
model: x,
|
|
196
|
-
setFieldValue:
|
|
201
|
+
setFieldValue: Me
|
|
197
202
|
})[0]));
|
|
198
|
-
let e =
|
|
203
|
+
let e = K(G(l.schemas, {
|
|
199
204
|
canAccess: l.canAccess,
|
|
200
205
|
mode: y.value,
|
|
201
206
|
model: x,
|
|
202
|
-
setFieldValue:
|
|
207
|
+
setFieldValue: Me
|
|
203
208
|
}), x);
|
|
204
209
|
Object.keys(e).forEach((t) => {
|
|
205
210
|
Object.hasOwn(x, t) || (x[t] = e[t]);
|
|
206
211
|
});
|
|
207
212
|
}
|
|
208
|
-
N(() => l.schemas,
|
|
213
|
+
N(() => l.schemas, A, {
|
|
209
214
|
deep: !0,
|
|
210
215
|
immediate: !0
|
|
211
216
|
});
|
|
212
|
-
let I = a(() =>
|
|
213
|
-
function
|
|
217
|
+
let I = a(() => te.value.map((e) => e.value).filter((e) => !!e)), L = a(() => I.value.filter((e) => e.renderable));
|
|
218
|
+
function ie(e) {
|
|
214
219
|
let t = x, n = e;
|
|
215
220
|
Object.keys(t).forEach((e) => {
|
|
216
221
|
Object.hasOwn(n, e) || delete t[e];
|
|
217
222
|
}), Object.assign(t, n);
|
|
218
223
|
}
|
|
219
|
-
N(() => m.value,
|
|
220
|
-
let { dictionaryMap:
|
|
221
|
-
function
|
|
224
|
+
N(() => m.value, ie, { deep: !0 });
|
|
225
|
+
let { dictionaryMap: ae } = t(() => I.value.map((e) => e.dictionary ?? e.dictType));
|
|
226
|
+
function V(e) {
|
|
222
227
|
let t = S.value[e];
|
|
223
228
|
return typeof t == "number" || typeof t == "string" ? t : t == null ? "" : String(t);
|
|
224
229
|
}
|
|
225
|
-
function
|
|
230
|
+
function H(e) {
|
|
226
231
|
let t = S.value[e];
|
|
227
232
|
return Array.isArray(t) ? t.filter((e) => typeof e == "boolean" || typeof e == "number" || typeof e == "string") : typeof t == "boolean" || typeof t == "number" || typeof t == "string" ? t : "";
|
|
228
233
|
}
|
|
229
|
-
function
|
|
230
|
-
let t =
|
|
234
|
+
function pe(e) {
|
|
235
|
+
let t = H(e);
|
|
231
236
|
return Array.isArray(t) ? t[0] ?? "" : t;
|
|
232
237
|
}
|
|
233
|
-
function
|
|
238
|
+
function he(e) {
|
|
234
239
|
let t = S.value[e];
|
|
235
240
|
if (typeof t == "number") return t;
|
|
236
241
|
if (typeof t == "string" && t.trim()) return Number(t);
|
|
237
242
|
}
|
|
238
|
-
function
|
|
243
|
+
function ge(e) {
|
|
239
244
|
return !!S.value[e];
|
|
240
245
|
}
|
|
241
|
-
function
|
|
246
|
+
function Se(e) {
|
|
242
247
|
let t = S.value[e];
|
|
243
248
|
return Array.isArray(t) ? t.filter((e) => typeof e == "number" || typeof e == "string") : [];
|
|
244
249
|
}
|
|
245
|
-
function
|
|
250
|
+
function Ce(e) {
|
|
246
251
|
let t = S.value[e];
|
|
247
252
|
if (t instanceof Date || typeof t == "number" || typeof t == "string" || Array.isArray(t) && t.every((e) => e instanceof Date || typeof e == "number" || typeof e == "string")) return t;
|
|
248
253
|
}
|
|
249
|
-
function
|
|
254
|
+
function Ee(e) {
|
|
250
255
|
return e.component === "datetime" ? "datetime" : e.component === "daterange" ? "daterange" : "date";
|
|
251
256
|
}
|
|
252
|
-
function
|
|
257
|
+
function De(e) {
|
|
253
258
|
let t = S.value[e];
|
|
254
259
|
if (typeof t == "boolean" || typeof t == "number" || typeof t == "string" || t && typeof t == "object") return t;
|
|
255
260
|
}
|
|
256
|
-
function
|
|
261
|
+
function U(e) {
|
|
257
262
|
return String(e.componentProps.type ?? "text");
|
|
258
263
|
}
|
|
259
|
-
function
|
|
264
|
+
function W(e) {
|
|
260
265
|
return e.component === "daterange" ? [`${e.id}-start`, `${e.id}-end`] : e.id;
|
|
261
266
|
}
|
|
262
|
-
function
|
|
267
|
+
function Oe(e) {
|
|
263
268
|
return e.component === "daterange" ? [`${e.field}-start`, `${e.field}-end`] : e.field;
|
|
264
269
|
}
|
|
265
|
-
function
|
|
270
|
+
function J(e) {
|
|
266
271
|
return l.disabled || e.disabled || e.readonly || y.value === "edit" && !!e.editDisabled || !!e.componentProps.disabled;
|
|
267
272
|
}
|
|
268
|
-
function
|
|
273
|
+
function Y(e) {
|
|
269
274
|
return typeof e.span == "number" ? Math.min(24, Math.max(1, e.span)) : Math.floor(24 / Math.max(1, l.columns));
|
|
270
275
|
}
|
|
271
|
-
function
|
|
276
|
+
function X(e) {
|
|
272
277
|
let t = e.dictionary ?? e.dictType;
|
|
273
|
-
return t ?
|
|
278
|
+
return t ? ae.value[t] ?? [] : e.options;
|
|
274
279
|
}
|
|
275
|
-
function
|
|
280
|
+
function Z(e) {
|
|
276
281
|
return e.componentProps;
|
|
277
282
|
}
|
|
278
|
-
function
|
|
283
|
+
function Q(e) {
|
|
279
284
|
let t = S.value[e.field];
|
|
280
285
|
if (e.formatter) return e.formatter(t, S.value);
|
|
281
|
-
let n = (Array.isArray(t) ? t : [t]).map((t) =>
|
|
286
|
+
let n = (Array.isArray(t) ? t : [t]).map((t) => X(e).find((e) => String(e.value) === String(t))?.label ?? t).filter((e) => e != null && e !== "");
|
|
282
287
|
return n.length > 0 ? n.map(String).join(", ") : "-";
|
|
283
288
|
}
|
|
284
|
-
function
|
|
289
|
+
function je(e, t) {
|
|
285
290
|
return {
|
|
286
291
|
field: e,
|
|
287
292
|
getValues: () => S.value,
|
|
288
293
|
mode: y.value,
|
|
289
294
|
model: S.value,
|
|
290
|
-
setFieldValue:
|
|
295
|
+
setFieldValue: Me,
|
|
291
296
|
value: t
|
|
292
297
|
};
|
|
293
298
|
}
|
|
294
|
-
function
|
|
299
|
+
function Me(e, t) {
|
|
295
300
|
x[e] = t;
|
|
296
301
|
let n = { ...x };
|
|
297
|
-
m.value = n, I.value.find((t) => t.field === e)?.onChange?.(t,
|
|
302
|
+
m.value = n, I.value.find((t) => t.field === e)?.onChange?.(t, je(e, t)), p("valuesChange", n, [e]);
|
|
298
303
|
}
|
|
299
304
|
function $(e, t) {
|
|
300
|
-
|
|
305
|
+
Me(e, t);
|
|
301
306
|
}
|
|
302
|
-
async function
|
|
303
|
-
y.value === "view" || l.submitLoading || await
|
|
307
|
+
async function Ne() {
|
|
308
|
+
y.value === "view" || l.submitLoading || l.submitDisabled || await Ve() && p("submit", S.value);
|
|
304
309
|
}
|
|
305
|
-
function
|
|
306
|
-
!l.submitOnEnter || e.isComposing || e.target?.tagName === "TEXTAREA" || (e.preventDefault(),
|
|
310
|
+
function Pe(e) {
|
|
311
|
+
!l.submitOnEnter || e.isComposing || e.target?.tagName === "TEXTAREA" || (e.preventDefault(), Ne());
|
|
307
312
|
}
|
|
308
|
-
function
|
|
309
|
-
|
|
313
|
+
function Fe() {
|
|
314
|
+
He(), p("reset", S.value);
|
|
310
315
|
}
|
|
311
|
-
function
|
|
316
|
+
function Ie(e) {
|
|
312
317
|
return `field-${e.field}`;
|
|
313
318
|
}
|
|
314
|
-
function
|
|
319
|
+
function Le(e) {
|
|
315
320
|
return `prefix-${e.field}`;
|
|
316
321
|
}
|
|
317
|
-
function
|
|
322
|
+
function Re(e) {
|
|
318
323
|
return `suffix-${e.field}`;
|
|
319
324
|
}
|
|
320
|
-
function
|
|
325
|
+
function ze(e) {
|
|
321
326
|
let t = {
|
|
322
327
|
...x,
|
|
323
328
|
...e
|
|
324
329
|
};
|
|
325
|
-
|
|
330
|
+
ie(t), m.value = t;
|
|
326
331
|
}
|
|
327
|
-
function
|
|
332
|
+
function Be(e) {
|
|
328
333
|
y.value = e;
|
|
329
334
|
}
|
|
330
|
-
async function
|
|
335
|
+
async function Ve() {
|
|
331
336
|
try {
|
|
332
337
|
return await h.value?.validate?.() !== !1;
|
|
333
338
|
} catch (e) {
|
|
@@ -338,54 +343,55 @@ var G = {
|
|
|
338
343
|
return !1;
|
|
339
344
|
}
|
|
340
345
|
}
|
|
341
|
-
function
|
|
346
|
+
function He() {
|
|
342
347
|
h.value?.resetFields?.();
|
|
343
|
-
let e =
|
|
344
|
-
|
|
348
|
+
let e = K(I.value, b.value);
|
|
349
|
+
ie(e), m.value = e;
|
|
345
350
|
}
|
|
346
|
-
function
|
|
351
|
+
function Ue(e) {
|
|
347
352
|
h.value?.clearValidate?.(e);
|
|
348
353
|
}
|
|
349
|
-
function
|
|
354
|
+
function We(e) {
|
|
350
355
|
h.value?.scrollToField?.(e);
|
|
351
356
|
}
|
|
352
|
-
function
|
|
357
|
+
function Ge(e) {
|
|
353
358
|
return (h.value?.$el)?.querySelector(`[data-field="${e}"] input, [data-field="${e}"] textarea, [data-field="${e}"] select, [data-field="${e}"] button`) ?? void 0;
|
|
354
359
|
}
|
|
355
360
|
return n({
|
|
356
|
-
clearValidate:
|
|
357
|
-
getFieldComponent:
|
|
361
|
+
clearValidate: Ue,
|
|
362
|
+
getFieldComponent: Ge,
|
|
358
363
|
getFormElement: () => h.value?.$el,
|
|
359
364
|
getFormInstance: () => h.value,
|
|
360
365
|
getValues: () => S.value,
|
|
361
|
-
resetFields:
|
|
362
|
-
scrollToField:
|
|
363
|
-
setFieldValue:
|
|
364
|
-
setMode:
|
|
365
|
-
setValues:
|
|
366
|
-
validate:
|
|
367
|
-
}), (t, n) =>
|
|
366
|
+
resetFields: He,
|
|
367
|
+
scrollToField: We,
|
|
368
|
+
setFieldValue: Me,
|
|
369
|
+
setMode: Be,
|
|
370
|
+
setValues: ze,
|
|
371
|
+
validate: Ve
|
|
372
|
+
}), (t, n) => ne((C(), o(O(ce), {
|
|
368
373
|
ref_key: "formRef",
|
|
369
374
|
ref: h,
|
|
375
|
+
novalidate: "",
|
|
370
376
|
class: v(["lumal-schema-form", { "is-compact": l.compact }]),
|
|
371
377
|
disabled: l.disabled,
|
|
372
378
|
"label-position": l.labelPosition,
|
|
373
379
|
"label-width": l.labelWidth,
|
|
374
380
|
model: S.value,
|
|
375
|
-
onKeydown:
|
|
376
|
-
onSubmit:
|
|
381
|
+
onKeydown: F(Pe, ["enter"]),
|
|
382
|
+
onSubmit: re(Ne, ["prevent"])
|
|
377
383
|
}, {
|
|
378
|
-
default: P(() => [f(
|
|
384
|
+
default: P(() => [f(O(ye), {
|
|
379
385
|
class: "lumal-schema-form__row",
|
|
380
386
|
gutter: l.gutter,
|
|
381
387
|
"data-columns": l.columns
|
|
382
388
|
}, {
|
|
383
|
-
default: P(() => [(C(!0), c(i, null,
|
|
389
|
+
default: P(() => [(C(!0), c(i, null, w(L.value, (e) => ne((C(), o(O(se), {
|
|
384
390
|
key: e.field,
|
|
385
|
-
span:
|
|
386
|
-
class: v({ "is-full-span":
|
|
391
|
+
span: Y(e),
|
|
392
|
+
class: v({ "is-full-span": Y(e) === 24 })
|
|
387
393
|
}, {
|
|
388
|
-
default: P(() => [f(
|
|
394
|
+
default: P(() => [f(O(le), {
|
|
389
395
|
class: "lumal-schema-form__item",
|
|
390
396
|
label: e.label,
|
|
391
397
|
prop: e.field,
|
|
@@ -394,24 +400,24 @@ var G = {
|
|
|
394
400
|
"data-field": e.field
|
|
395
401
|
}, {
|
|
396
402
|
default: P(() => [
|
|
397
|
-
|
|
403
|
+
T(t.$slots, Le(e), {
|
|
398
404
|
model: S.value,
|
|
399
405
|
schema: e,
|
|
400
406
|
value: S.value[e.field]
|
|
401
407
|
}, void 0, !0),
|
|
402
|
-
|
|
408
|
+
T(t.$slots, Ie(e), {
|
|
403
409
|
model: S.value,
|
|
404
410
|
schema: e,
|
|
405
411
|
value: S.value[e.field]
|
|
406
|
-
}, () => [y.value === "view" ? (C(), c("span",
|
|
412
|
+
}, () => [y.value === "view" ? (C(), c("span", ke, D(Q(e)), 1)) : e.component === "textarea" ? (C(), o(O(ue), g({
|
|
407
413
|
key: 1,
|
|
408
414
|
ref_for: !0
|
|
409
|
-
},
|
|
415
|
+
}, Z(e), {
|
|
410
416
|
id: e.id,
|
|
411
|
-
"model-value":
|
|
417
|
+
"model-value": V(e.field),
|
|
412
418
|
name: e.field,
|
|
413
419
|
placeholder: e.placeholder,
|
|
414
|
-
disabled:
|
|
420
|
+
disabled: J(e),
|
|
415
421
|
required: e.required,
|
|
416
422
|
type: "textarea",
|
|
417
423
|
"onUpdate:modelValue": (t) => $(e.field, t)
|
|
@@ -423,19 +429,19 @@ var G = {
|
|
|
423
429
|
"disabled",
|
|
424
430
|
"required",
|
|
425
431
|
"onUpdate:modelValue"
|
|
426
|
-
])) : e.component === "select" ? (C(), o(
|
|
432
|
+
])) : e.component === "select" ? (C(), o(O(be), g({
|
|
427
433
|
key: 2,
|
|
428
434
|
ref_for: !0
|
|
429
|
-
},
|
|
435
|
+
}, Z(e), {
|
|
430
436
|
id: e.id,
|
|
431
|
-
"model-value":
|
|
437
|
+
"model-value": H(e.field),
|
|
432
438
|
name: e.field,
|
|
433
439
|
placeholder: e.placeholder,
|
|
434
|
-
disabled:
|
|
440
|
+
disabled: J(e),
|
|
435
441
|
required: e.required,
|
|
436
442
|
"onUpdate:modelValue": (t) => $(e.field, t)
|
|
437
443
|
}), {
|
|
438
|
-
default: P(() => [(C(!0), c(i, null,
|
|
444
|
+
default: P(() => [(C(!0), c(i, null, w(X(e), (e) => (C(), o(O(me), {
|
|
439
445
|
key: String(e.value),
|
|
440
446
|
label: e.label,
|
|
441
447
|
value: e.value,
|
|
@@ -454,23 +460,23 @@ var G = {
|
|
|
454
460
|
"disabled",
|
|
455
461
|
"required",
|
|
456
462
|
"onUpdate:modelValue"
|
|
457
|
-
])) : e.component === "number" ? (C(), o(
|
|
463
|
+
])) : e.component === "number" ? (C(), o(O(de), g({
|
|
458
464
|
key: 3,
|
|
459
465
|
ref_for: !0
|
|
460
|
-
},
|
|
466
|
+
}, Z(e), {
|
|
461
467
|
id: e.id,
|
|
462
|
-
"model-value":
|
|
468
|
+
"model-value": he(e.field),
|
|
463
469
|
name: e.field,
|
|
464
470
|
placeholder: e.placeholder,
|
|
465
|
-
disabled:
|
|
471
|
+
disabled: J(e),
|
|
466
472
|
"onUpdate:modelValue": (t) => $(e.field, t)
|
|
467
473
|
}), u({ _: 2 }, [e.prefix ? {
|
|
468
474
|
name: "prefix",
|
|
469
|
-
fn: P(() => [d(
|
|
475
|
+
fn: P(() => [d(D(e.prefix), 1)]),
|
|
470
476
|
key: "0"
|
|
471
477
|
} : void 0, e.suffix ? {
|
|
472
478
|
name: "suffix",
|
|
473
|
-
fn: P(() => [d(
|
|
479
|
+
fn: P(() => [d(D(e.suffix), 1)]),
|
|
474
480
|
key: "1"
|
|
475
481
|
} : void 0]), 1040, [
|
|
476
482
|
"id",
|
|
@@ -479,29 +485,29 @@ var G = {
|
|
|
479
485
|
"placeholder",
|
|
480
486
|
"disabled",
|
|
481
487
|
"onUpdate:modelValue"
|
|
482
|
-
])) : e.component === "switch" ? (C(), o(
|
|
488
|
+
])) : e.component === "switch" ? (C(), o(O(xe), g({
|
|
483
489
|
key: 4,
|
|
484
490
|
ref_for: !0
|
|
485
|
-
},
|
|
486
|
-
"model-value":
|
|
491
|
+
}, Z(e), {
|
|
492
|
+
"model-value": ge(e.field),
|
|
487
493
|
name: e.field,
|
|
488
|
-
disabled:
|
|
494
|
+
disabled: J(e),
|
|
489
495
|
"onUpdate:modelValue": (t) => $(e.field, t)
|
|
490
496
|
}), null, 16, [
|
|
491
497
|
"model-value",
|
|
492
498
|
"name",
|
|
493
499
|
"disabled",
|
|
494
500
|
"onUpdate:modelValue"
|
|
495
|
-
])) : e.component === "date" || e.component === "datetime" || e.component === "daterange" ? (C(), o(
|
|
501
|
+
])) : e.component === "date" || e.component === "datetime" || e.component === "daterange" ? (C(), o(O(B), g({
|
|
496
502
|
key: 5,
|
|
497
503
|
ref_for: !0
|
|
498
|
-
},
|
|
499
|
-
id:
|
|
500
|
-
"model-value":
|
|
501
|
-
name:
|
|
504
|
+
}, Z(e), {
|
|
505
|
+
id: W(e),
|
|
506
|
+
"model-value": Ce(e.field),
|
|
507
|
+
name: Oe(e),
|
|
502
508
|
placeholder: e.placeholder,
|
|
503
|
-
disabled:
|
|
504
|
-
type:
|
|
509
|
+
disabled: J(e),
|
|
510
|
+
type: Ee(e),
|
|
505
511
|
"onUpdate:modelValue": (t) => $(e.field, t)
|
|
506
512
|
}), null, 16, [
|
|
507
513
|
"id",
|
|
@@ -511,21 +517,21 @@ var G = {
|
|
|
511
517
|
"disabled",
|
|
512
518
|
"type",
|
|
513
519
|
"onUpdate:modelValue"
|
|
514
|
-
])) : e.component === "radio" ? (C(), o(
|
|
520
|
+
])) : e.component === "radio" ? (C(), o(O(ve), g({
|
|
515
521
|
key: 6,
|
|
516
522
|
ref_for: !0
|
|
517
|
-
},
|
|
518
|
-
"model-value":
|
|
523
|
+
}, Z(e), {
|
|
524
|
+
"model-value": pe(e.field),
|
|
519
525
|
name: e.field,
|
|
520
|
-
disabled:
|
|
526
|
+
disabled: J(e),
|
|
521
527
|
"onUpdate:modelValue": (t) => $(e.field, t)
|
|
522
528
|
}), {
|
|
523
|
-
default: P(() => [(C(!0), c(i, null,
|
|
529
|
+
default: P(() => [(C(!0), c(i, null, w(X(e), (e) => (C(), o(O(_e), {
|
|
524
530
|
key: String(e.value),
|
|
525
531
|
value: e.value,
|
|
526
532
|
disabled: e.disabled
|
|
527
533
|
}, {
|
|
528
|
-
default: P(() => [d(
|
|
534
|
+
default: P(() => [d(D(e.label), 1)]),
|
|
529
535
|
_: 2
|
|
530
536
|
}, 1032, ["value", "disabled"]))), 128))]),
|
|
531
537
|
_: 2
|
|
@@ -534,21 +540,21 @@ var G = {
|
|
|
534
540
|
"name",
|
|
535
541
|
"disabled",
|
|
536
542
|
"onUpdate:modelValue"
|
|
537
|
-
])) : e.component === "checkbox" ? (C(), o(
|
|
543
|
+
])) : e.component === "checkbox" ? (C(), o(O(z), g({
|
|
538
544
|
key: 7,
|
|
539
545
|
ref_for: !0
|
|
540
|
-
},
|
|
541
|
-
"model-value":
|
|
546
|
+
}, Z(e), {
|
|
547
|
+
"model-value": Se(e.field),
|
|
542
548
|
name: e.field,
|
|
543
|
-
disabled:
|
|
549
|
+
disabled: J(e),
|
|
544
550
|
"onUpdate:modelValue": (t) => $(e.field, t)
|
|
545
551
|
}), {
|
|
546
|
-
default: P(() => [(C(!0), c(i, null,
|
|
552
|
+
default: P(() => [(C(!0), c(i, null, w(X(e), (e) => (C(), o(O(oe), {
|
|
547
553
|
key: String(e.value),
|
|
548
554
|
value: e.value,
|
|
549
555
|
disabled: e.disabled
|
|
550
556
|
}, {
|
|
551
|
-
default: P(() => [d(
|
|
557
|
+
default: P(() => [d(D(e.label), 1)]),
|
|
552
558
|
_: 2
|
|
553
559
|
}, 1032, ["value", "disabled"]))), 128))]),
|
|
554
560
|
_: 2
|
|
@@ -557,15 +563,15 @@ var G = {
|
|
|
557
563
|
"name",
|
|
558
564
|
"disabled",
|
|
559
565
|
"onUpdate:modelValue"
|
|
560
|
-
])) : e.component === "tree-select" ? (C(), o(
|
|
566
|
+
])) : e.component === "tree-select" ? (C(), o(O(we), g({
|
|
561
567
|
key: 8,
|
|
562
568
|
ref_for: !0
|
|
563
|
-
},
|
|
569
|
+
}, Z(e), {
|
|
564
570
|
id: e.id,
|
|
565
|
-
"model-value":
|
|
571
|
+
"model-value": De(e.field),
|
|
566
572
|
name: e.field,
|
|
567
573
|
placeholder: e.placeholder,
|
|
568
|
-
disabled:
|
|
574
|
+
disabled: J(e),
|
|
569
575
|
"onUpdate:modelValue": (t) => $(e.field, t)
|
|
570
576
|
}), null, 16, [
|
|
571
577
|
"id",
|
|
@@ -574,46 +580,46 @@ var G = {
|
|
|
574
580
|
"placeholder",
|
|
575
581
|
"disabled",
|
|
576
582
|
"onUpdate:modelValue"
|
|
577
|
-
])) : e.component === "upload" ? (C(), o(
|
|
583
|
+
])) : e.component === "upload" ? (C(), o(O(Te), g({
|
|
578
584
|
key: 9,
|
|
579
585
|
ref_for: !0
|
|
580
|
-
},
|
|
581
|
-
default: P(() => [f(
|
|
586
|
+
}, Z(e), { disabled: J(e) }), {
|
|
587
|
+
default: P(() => [f(O(R), { type: "primary" }, {
|
|
582
588
|
default: P(() => [...n[0] ||= [d(" 上传 ", -1)]]),
|
|
583
589
|
_: 1
|
|
584
590
|
})]),
|
|
585
591
|
_: 1
|
|
586
|
-
}, 16, ["disabled"])) : (C(), o(
|
|
592
|
+
}, 16, ["disabled"])) : (C(), o(O(ue), g({
|
|
587
593
|
key: 10,
|
|
588
594
|
ref_for: !0
|
|
589
|
-
},
|
|
595
|
+
}, Z(e), {
|
|
590
596
|
id: e.id,
|
|
591
|
-
"model-value":
|
|
597
|
+
"model-value": V(e.field),
|
|
592
598
|
name: e.field,
|
|
593
|
-
type:
|
|
599
|
+
type: U(e),
|
|
594
600
|
placeholder: e.placeholder,
|
|
595
|
-
disabled:
|
|
601
|
+
disabled: J(e),
|
|
596
602
|
required: e.required,
|
|
597
603
|
"onUpdate:modelValue": (t) => $(e.field, t)
|
|
598
604
|
}), u({ _: 2 }, [
|
|
599
605
|
e.prepend ? {
|
|
600
606
|
name: "prepend",
|
|
601
|
-
fn: P(() => [d(
|
|
607
|
+
fn: P(() => [d(D(e.prepend), 1)]),
|
|
602
608
|
key: "0"
|
|
603
609
|
} : void 0,
|
|
604
610
|
e.append ? {
|
|
605
611
|
name: "append",
|
|
606
|
-
fn: P(() => [d(
|
|
612
|
+
fn: P(() => [d(D(e.append), 1)]),
|
|
607
613
|
key: "1"
|
|
608
614
|
} : void 0,
|
|
609
615
|
e.prefix ? {
|
|
610
616
|
name: "prefix",
|
|
611
|
-
fn: P(() => [d(
|
|
617
|
+
fn: P(() => [d(D(e.prefix), 1)]),
|
|
612
618
|
key: "2"
|
|
613
619
|
} : void 0,
|
|
614
620
|
e.suffix ? {
|
|
615
621
|
name: "suffix",
|
|
616
|
-
fn: P(() => [d(
|
|
622
|
+
fn: P(() => [d(D(e.suffix), 1)]),
|
|
617
623
|
key: "3"
|
|
618
624
|
} : void 0
|
|
619
625
|
]), 1040, [
|
|
@@ -626,13 +632,13 @@ var G = {
|
|
|
626
632
|
"required",
|
|
627
633
|
"onUpdate:modelValue"
|
|
628
634
|
]))], !0),
|
|
629
|
-
|
|
635
|
+
T(t.$slots, Re(e), {
|
|
630
636
|
model: S.value,
|
|
631
637
|
schema: e,
|
|
632
638
|
value: S.value[e.field]
|
|
633
639
|
}, void 0, !0),
|
|
634
|
-
e.description ? (C(), c("p",
|
|
635
|
-
e.help ? (C(), c("p",
|
|
640
|
+
e.description ? (C(), c("p", q, D(e.description), 1)) : s("", !0),
|
|
641
|
+
e.help ? (C(), c("p", Ae, D(e.help), 1)) : s("", !0)
|
|
636
642
|
]),
|
|
637
643
|
_: 2
|
|
638
644
|
}, 1032, [
|
|
@@ -643,26 +649,26 @@ var G = {
|
|
|
643
649
|
"data-field"
|
|
644
650
|
])]),
|
|
645
651
|
_: 2
|
|
646
|
-
}, 1032, ["span", "class"]))), 128))]),
|
|
652
|
+
}, 1032, ["span", "class"])), [[M, e.visible]])), 128))]),
|
|
647
653
|
_: 3
|
|
648
654
|
}, 8, ["gutter", "data-columns"]), e.showActions && y.value !== "view" ? (C(), c("div", {
|
|
649
655
|
key: 0,
|
|
650
656
|
class: v(["lumal-schema-form__actions", [`is-${e.actionLayout}`, `is-${e.actionPosition}`]])
|
|
651
|
-
}, [e.showReset ? (C(), o(
|
|
657
|
+
}, [e.showReset ? (C(), o(O(R), {
|
|
652
658
|
key: 0,
|
|
653
659
|
"native-type": "button",
|
|
654
660
|
disabled: e.submitLoading,
|
|
655
|
-
onClick:
|
|
661
|
+
onClick: Fe
|
|
656
662
|
}, {
|
|
657
|
-
default: P(() => [d(
|
|
663
|
+
default: P(() => [d(D(e.resetText), 1)]),
|
|
658
664
|
_: 1
|
|
659
|
-
}, 8, ["disabled"])) : s("", !0), f(
|
|
665
|
+
}, 8, ["disabled"])) : s("", !0), f(O(R), {
|
|
660
666
|
type: "primary",
|
|
661
667
|
"native-type": "submit",
|
|
662
668
|
loading: e.submitLoading,
|
|
663
|
-
disabled: e.submitLoading
|
|
669
|
+
disabled: e.submitLoading || e.submitDisabled
|
|
664
670
|
}, {
|
|
665
|
-
default: P(() => [d(
|
|
671
|
+
default: P(() => [d(D(e.submitText), 1)]),
|
|
666
672
|
_: 1
|
|
667
673
|
}, 8, ["loading", "disabled"])], 2)) : s("", !0)]),
|
|
668
674
|
_: 3
|
|
@@ -672,15 +678,15 @@ var G = {
|
|
|
672
678
|
"label-position",
|
|
673
679
|
"label-width",
|
|
674
680
|
"model"
|
|
675
|
-
])), [[
|
|
681
|
+
])), [[O(_), l.loading]]);
|
|
676
682
|
}
|
|
677
|
-
}), [["__scopeId", "data-v-
|
|
683
|
+
}), [["__scopeId", "data-v-06645e2b"]]);
|
|
678
684
|
//#endregion
|
|
679
685
|
//#region src/components/schema-table/cell.ts
|
|
680
|
-
function
|
|
686
|
+
function Y(e) {
|
|
681
687
|
return e == null || typeof e == "boolean" || typeof e == "number" || typeof e == "string" || Array.isArray(e) && e.every((e) => typeof e == "boolean" || typeof e == "number" || typeof e == "string");
|
|
682
688
|
}
|
|
683
|
-
function
|
|
689
|
+
function X(t, n, r = e(t)) {
|
|
684
690
|
let i = (Array.isArray(n) ? n : [n]).map((e, t) => {
|
|
685
691
|
let n = r.get(String(e));
|
|
686
692
|
return {
|
|
@@ -691,7 +697,11 @@ function J(t, n, r = e(t)) {
|
|
|
691
697
|
});
|
|
692
698
|
return i.some((e) => e.color) ? i : [];
|
|
693
699
|
}
|
|
694
|
-
function
|
|
700
|
+
function Z(e, t, r, i = [], a) {
|
|
701
|
+
if (t.type === "index") return {
|
|
702
|
+
tags: [],
|
|
703
|
+
text: String(r + 1)
|
|
704
|
+
};
|
|
695
705
|
let o = e[t.field], s = t.formatter?.(o, e, r) ?? o;
|
|
696
706
|
return s == null || s === "" || Array.isArray(s) && s.length === 0 ? {
|
|
697
707
|
tags: [],
|
|
@@ -699,8 +709,8 @@ function Y(e, t, r, i = [], a) {
|
|
|
699
709
|
} : t.formatter ? {
|
|
700
710
|
tags: [],
|
|
701
711
|
text: String(s)
|
|
702
|
-
} : i.length > 0 &&
|
|
703
|
-
tags:
|
|
712
|
+
} : i.length > 0 && Y(s) ? {
|
|
713
|
+
tags: X(i, s, a),
|
|
704
714
|
text: n(i, s, a)
|
|
705
715
|
} : {
|
|
706
716
|
tags: [],
|
|
@@ -709,101 +719,101 @@ function Y(e, t, r, i = [], a) {
|
|
|
709
719
|
}
|
|
710
720
|
//#endregion
|
|
711
721
|
//#region src/components/schema-table/LumalSchemaTableCell.vue?vue&type=script&setup=true&lang.ts
|
|
712
|
-
var
|
|
722
|
+
var Q = {
|
|
713
723
|
key: 0,
|
|
714
724
|
class: "lumal-schema-table__dictionary-tags"
|
|
715
|
-
},
|
|
725
|
+
}, je = {
|
|
716
726
|
key: 0,
|
|
717
727
|
class: "lumal-schema-table__dictionary-dot",
|
|
718
728
|
"aria-hidden": "true"
|
|
719
|
-
},
|
|
729
|
+
}, Me = { key: 1 }, $ = /*#__PURE__*/ r(/* @__PURE__ */ p({
|
|
720
730
|
__name: "LumalSchemaTableCell",
|
|
721
731
|
props: { display: {} },
|
|
722
732
|
setup(e) {
|
|
723
733
|
function t(e) {
|
|
724
734
|
return e.color ? { "--lumal-dictionary-color": e.color } : void 0;
|
|
725
735
|
}
|
|
726
|
-
return (n, r) => e.display.tags.length ? (C(), c("div",
|
|
736
|
+
return (n, r) => e.display.tags.length ? (C(), c("div", Q, [(C(!0), c(i, null, w(e.display.tags, (e) => (C(), c("span", {
|
|
727
737
|
key: e.key,
|
|
728
738
|
class: "lumal-schema-table__dictionary-tag",
|
|
729
739
|
style: b(t(e))
|
|
730
|
-
}, [e.color ? (C(), c("span",
|
|
740
|
+
}, [e.color ? (C(), c("span", je)) : s("", !0), l("span", null, D(e.label), 1)], 4))), 128))])) : (C(), c("span", Me, D(e.display.text), 1));
|
|
731
741
|
}
|
|
732
742
|
}), [["__scopeId", "data-v-1569bd9d"]]);
|
|
733
743
|
//#endregion
|
|
734
744
|
//#region src/components/schema-table/normalize.ts
|
|
735
|
-
function
|
|
745
|
+
function Ne(e, t) {
|
|
736
746
|
return typeof e == "function" ? !!e(t) : !!e;
|
|
737
747
|
}
|
|
738
|
-
function
|
|
748
|
+
function Pe(e, t) {
|
|
739
749
|
return !e.authority || t.canAccess?.(e.authority) !== !1;
|
|
740
750
|
}
|
|
741
|
-
function
|
|
751
|
+
function Fe(e = [], t = {}) {
|
|
742
752
|
let n = { rows: t.rows ?? [] };
|
|
743
|
-
return e.map((e) => ({
|
|
753
|
+
return e.map((e, t) => ({
|
|
744
754
|
...e,
|
|
745
|
-
field: e.field
|
|
755
|
+
field: e.type === "index" ? `__lumal_index__${t}` : e.field?.trim()
|
|
746
756
|
})).filter((e) => e.field).map((e) => ({
|
|
747
757
|
...e,
|
|
748
758
|
align: e.align ?? "left",
|
|
749
759
|
componentProps: e.componentProps ?? {},
|
|
750
760
|
emptyText: e.emptyText ?? "-",
|
|
751
|
-
renderable: (typeof e.hidden == "function" || !
|
|
761
|
+
renderable: (typeof e.hidden == "function" || !Ne(e.hidden, n)) && Pe(e, t)
|
|
752
762
|
}));
|
|
753
763
|
}
|
|
754
764
|
//#endregion
|
|
755
765
|
//#region src/components/schema-table/LumalSchemaTable.vue?vue&type=script&setup=true&lang.ts
|
|
756
|
-
var
|
|
766
|
+
var Ie = {
|
|
757
767
|
key: 0,
|
|
758
768
|
class: "lumal-schema-table__toolbar"
|
|
759
|
-
},
|
|
769
|
+
}, Le = {
|
|
760
770
|
key: 0,
|
|
761
771
|
class: "lumal-schema-table__toolbar-title"
|
|
762
|
-
},
|
|
772
|
+
}, Re = {
|
|
763
773
|
key: 1,
|
|
764
774
|
class: "lumal-schema-table__toolbar-content"
|
|
765
|
-
},
|
|
775
|
+
}, ze = {
|
|
766
776
|
key: 2,
|
|
767
777
|
class: "lumal-schema-table__toolbar-tools"
|
|
768
|
-
},
|
|
778
|
+
}, Be = {
|
|
769
779
|
key: 0,
|
|
770
780
|
class: "lumal-schema-table__column-settings"
|
|
771
|
-
},
|
|
781
|
+
}, Ve = {
|
|
772
782
|
class: "lumal-schema-table__column-settings-trigger",
|
|
773
783
|
"aria-label": "列设置",
|
|
774
784
|
title: "列设置"
|
|
775
|
-
},
|
|
785
|
+
}, He = { class: "lumal-schema-table__column-options" }, Ue = [
|
|
776
786
|
"draggable",
|
|
777
787
|
"onDragstart",
|
|
778
788
|
"onDrop"
|
|
779
|
-
],
|
|
789
|
+
], We = {
|
|
780
790
|
key: 0,
|
|
781
791
|
class: "lumal-schema-table__column-order-actions"
|
|
782
|
-
},
|
|
792
|
+
}, Ge = [
|
|
783
793
|
"disabled",
|
|
784
794
|
"aria-label",
|
|
785
795
|
"title",
|
|
786
796
|
"onClick"
|
|
787
|
-
],
|
|
797
|
+
], Ke = [
|
|
788
798
|
"disabled",
|
|
789
799
|
"aria-label",
|
|
790
800
|
"title",
|
|
791
801
|
"onClick"
|
|
792
|
-
],
|
|
802
|
+
], qe = {
|
|
793
803
|
key: 1,
|
|
794
804
|
class: "lumal-schema-table__error",
|
|
795
805
|
role: "alert"
|
|
796
|
-
},
|
|
806
|
+
}, Je = {
|
|
797
807
|
key: 2,
|
|
798
808
|
class: "lumal-schema-table__scroll"
|
|
799
|
-
},
|
|
809
|
+
}, Ye = { class: "lumal-schema-table__actions lumal-schema-table__actions--desktop" }, Xe = [
|
|
800
810
|
"aria-expanded",
|
|
801
811
|
"onClick",
|
|
802
812
|
"onKeydown"
|
|
803
|
-
],
|
|
813
|
+
], Ze = {
|
|
804
814
|
key: 3,
|
|
805
815
|
class: "lumal-schema-table__pagination"
|
|
806
|
-
},
|
|
816
|
+
}, Qe = /*#__PURE__*/ r(/* @__PURE__ */ p({
|
|
807
817
|
__name: "LumalSchemaTable",
|
|
808
818
|
props: /*@__PURE__*/ h({
|
|
809
819
|
actionLabel: { default: "操作" },
|
|
@@ -892,280 +902,291 @@ var Fe = {
|
|
|
892
902
|
"selectionChange",
|
|
893
903
|
"sortChange"
|
|
894
904
|
], ["update:page", "update:pageSize"]),
|
|
895
|
-
setup(n, { expose: r, emit:
|
|
896
|
-
let
|
|
897
|
-
let e =
|
|
898
|
-
if (e.length === 0) return
|
|
905
|
+
setup(n, { expose: r, emit: p }) {
|
|
906
|
+
let m = n, h = p, v = k(n, "page"), y = k(n, "pageSize"), b = fe.directive, ee = j("containerRef"), A = j("tableRef"), M = E(/* @__PURE__ */ new Set()), L = E([]), ie = E([]), ae = E([]), R = E(typeof window < "u" && window.innerWidth <= 768), z = E(null), se, B, V = "", H = a(() => Fe(m.columns, { canAccess: m.canAccess })), ce = a(() => {
|
|
907
|
+
let e = L.value;
|
|
908
|
+
if (e.length === 0) return H.value;
|
|
899
909
|
let t = new Map(e.map((e, t) => [e, t]));
|
|
900
|
-
return [...
|
|
901
|
-
}), le = a(() => ce.value.filter((e) => e.renderable && !
|
|
902
|
-
let n =
|
|
910
|
+
return [...H.value].sort((e, n) => (t.get(String(e.field)) ?? 2 ** 53 - 1) - (t.get(String(n.field)) ?? 2 ** 53 - 1));
|
|
911
|
+
}), le = a(() => ce.value.filter((e) => e.renderable && !M.value.has(String(e.field)))), ue = a(() => ce.value.filter((e) => e.renderable && !e.fixed && e.configurable !== !1)), de = a(() => [...le.value].reverse().find((e) => !e.fixed)?.field), { dictionaryMap: pe } = t(() => H.value.filter((e) => e.type !== "index").map((e) => e.dictionary ?? e.dictType)), me = a(() => new Map(H.value.map((t) => {
|
|
912
|
+
let n = q(t);
|
|
903
913
|
return [String(t.field), e(n)];
|
|
904
|
-
}))), he = a(() => new Map(
|
|
905
|
-
if (typeof
|
|
906
|
-
let e =
|
|
914
|
+
}))), he = a(() => new Map(m.rows.map((e, t) => [e, t]))), _e = a(() => {
|
|
915
|
+
if (typeof m.rowKey != "function") return m.rowKey;
|
|
916
|
+
let e = m.rowKey, t = he.value;
|
|
907
917
|
return (n) => String(e(n, t.get(n) ?? -1));
|
|
908
|
-
}), ve = a(() =>
|
|
918
|
+
}), ve = a(() => m.pagination && m.total > 0), ye = a(() => m.showColumnSettings || m.columnSettings?.enabled), be = a(() => R.value ? m.mobileActionWidth : m.actionWidth), xe = a(() => m.error instanceof Error ? m.error.message || m.errorText : typeof m.error == "string" ? m.error : m.errorText), we = a(() => m.defaultExpandAll ?? !!m.tableProps.defaultExpandAll), Te = a(() => m.treeProps ?? m.tableProps.treeProps ?? {
|
|
909
919
|
children: "children",
|
|
910
920
|
hasChildren: "hasChildren"
|
|
911
921
|
});
|
|
912
|
-
function
|
|
913
|
-
let t = new Set(
|
|
922
|
+
function De(e) {
|
|
923
|
+
let t = new Set(M.value);
|
|
914
924
|
if (t.has(e)) t.delete(e);
|
|
915
925
|
else {
|
|
916
926
|
if (ue.value.filter((e) => !t.has(String(e.field))).length <= 1) return;
|
|
917
927
|
t.add(e);
|
|
918
928
|
}
|
|
919
|
-
|
|
929
|
+
M.value = t, K(), _(() => A.value?.doLayout?.());
|
|
920
930
|
}
|
|
921
|
-
function
|
|
922
|
-
|
|
931
|
+
function U() {
|
|
932
|
+
M.value = /* @__PURE__ */ new Set(), L.value = H.value.map((e) => String(e.field)), K(), _(() => A.value?.doLayout?.());
|
|
923
933
|
}
|
|
924
|
-
function
|
|
934
|
+
function W(e, t) {
|
|
925
935
|
let n = ue.value.map((e) => String(e.field)), r = n.indexOf(e), i = r + t;
|
|
926
936
|
if (r < 0 || i < 0 || i >= n.length) return;
|
|
927
937
|
let a = n[i], o = ce.value.map((e) => String(e.field)), s = o.indexOf(e), c = o.indexOf(a);
|
|
928
|
-
o.splice(s, 1), o.splice(c, 0, e),
|
|
938
|
+
o.splice(s, 1), o.splice(c, 0, e), L.value = o, K(), _(() => A.value?.doLayout?.());
|
|
929
939
|
}
|
|
930
|
-
function
|
|
931
|
-
|
|
940
|
+
function Oe(e) {
|
|
941
|
+
V = e;
|
|
932
942
|
}
|
|
933
|
-
function
|
|
934
|
-
if (!
|
|
935
|
-
|
|
943
|
+
function G(e) {
|
|
944
|
+
if (!V || V === e) {
|
|
945
|
+
V = "";
|
|
936
946
|
return;
|
|
937
947
|
}
|
|
938
|
-
let t = ce.value.map((e) => String(e.field)), n = t.indexOf(
|
|
939
|
-
n >= 0 && r >= 0 && (t.splice(n, 1), t.splice(r, 0,
|
|
948
|
+
let t = ce.value.map((e) => String(e.field)), n = t.indexOf(V), r = t.indexOf(e);
|
|
949
|
+
n >= 0 && r >= 0 && (t.splice(n, 1), t.splice(r, 0, V), L.value = t, K(), _(() => A.value?.doLayout?.())), V = "";
|
|
940
950
|
}
|
|
941
|
-
function
|
|
942
|
-
let e =
|
|
951
|
+
function K() {
|
|
952
|
+
let e = m.columnSettings?.storageKey;
|
|
943
953
|
if (!(!e || typeof localStorage > "u")) try {
|
|
944
954
|
localStorage.setItem(e, JSON.stringify({
|
|
945
|
-
hidden: [...
|
|
946
|
-
order:
|
|
955
|
+
hidden: [...M.value],
|
|
956
|
+
order: L.value
|
|
947
957
|
}));
|
|
948
958
|
} catch {}
|
|
949
959
|
}
|
|
950
|
-
function
|
|
951
|
-
|
|
952
|
-
let e =
|
|
960
|
+
function ke() {
|
|
961
|
+
L.value = H.value.map((e) => String(e.field));
|
|
962
|
+
let e = m.columnSettings?.storageKey;
|
|
953
963
|
if (!(!e || typeof localStorage > "u")) try {
|
|
954
|
-
let t = JSON.parse(localStorage.getItem(e) ?? "{}"), n = new Set(
|
|
955
|
-
|
|
964
|
+
let t = JSON.parse(localStorage.getItem(e) ?? "{}"), n = new Set(H.value.map((e) => String(e.field)));
|
|
965
|
+
M.value = new Set((t.hidden ?? []).filter((e) => n.has(e))), L.value = [...(t.order ?? []).filter((e) => n.has(e)), ...[...n].filter((e) => !(t.order ?? []).includes(e))];
|
|
956
966
|
} catch {
|
|
957
|
-
|
|
967
|
+
U();
|
|
958
968
|
}
|
|
959
969
|
}
|
|
960
|
-
function
|
|
970
|
+
function q(e) {
|
|
971
|
+
if (e.type === "index") return [];
|
|
961
972
|
let t = e.dictionary ?? e.dictType;
|
|
962
|
-
return t ?
|
|
973
|
+
return t ? pe.value[t] ?? [] : O(e.options) ?? [];
|
|
963
974
|
}
|
|
964
975
|
function Ae(e, t, n) {
|
|
965
976
|
return typeof t.hidden == "function" && !!t.hidden({
|
|
966
|
-
rows:
|
|
977
|
+
rows: m.rows,
|
|
967
978
|
row: e,
|
|
968
979
|
index: n
|
|
969
980
|
});
|
|
970
981
|
}
|
|
971
|
-
function
|
|
972
|
-
return
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
982
|
+
function J(e, t, n) {
|
|
983
|
+
return t.type === "index" ? {
|
|
984
|
+
tags: [],
|
|
985
|
+
text: String(Y(n))
|
|
986
|
+
} : Z(e, t, n, q(t), me.value.get(String(t.field)));
|
|
976
987
|
}
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
return je.value.get(String(e.field));
|
|
988
|
+
function Y(e) {
|
|
989
|
+
return (m.pagination ? (v.value - 1) * y.value : 0) + e + 1;
|
|
980
990
|
}
|
|
981
991
|
function X(e) {
|
|
982
|
-
|
|
992
|
+
return (t, n, r, i) => Ae(t, e, i) ? "" : J(t, e, i).text;
|
|
993
|
+
}
|
|
994
|
+
let Q = a(() => new Map(H.value.map((e) => [String(e.field), X(e)])));
|
|
995
|
+
function je(e) {
|
|
996
|
+
return Q.value.get(String(e.field));
|
|
997
|
+
}
|
|
998
|
+
function Me(e) {
|
|
999
|
+
if (!m.scaleColumnWidth) return;
|
|
983
1000
|
let t = e.minWidth ?? e.componentProps.minWidth;
|
|
984
1001
|
return e.field === de.value ? t ?? e.width ?? e.componentProps.width : t;
|
|
985
1002
|
}
|
|
986
|
-
function
|
|
987
|
-
if (!(!
|
|
1003
|
+
function Ne(e) {
|
|
1004
|
+
if (!(!m.scaleColumnWidth || e.field === de.value)) return e.width;
|
|
988
1005
|
}
|
|
989
|
-
function
|
|
990
|
-
if (typeof
|
|
991
|
-
let n =
|
|
1006
|
+
function Pe(e, t) {
|
|
1007
|
+
if (typeof m.rowKey == "function") return m.rowKey(e, t);
|
|
1008
|
+
let n = m.rowKey ? e[m.rowKey] : void 0;
|
|
992
1009
|
return typeof n == "string" || typeof n == "number" ? n : void 0;
|
|
993
1010
|
}
|
|
994
|
-
function
|
|
995
|
-
let n =
|
|
1011
|
+
function Qe(e, t) {
|
|
1012
|
+
let n = Pe(e, t);
|
|
996
1013
|
return n === void 0 ? `index:${t}` : `row:${typeof n}:${n}`;
|
|
997
1014
|
}
|
|
998
|
-
function
|
|
999
|
-
return
|
|
1015
|
+
function $e(e, t) {
|
|
1016
|
+
return z.value === Qe(e, t);
|
|
1000
1017
|
}
|
|
1001
|
-
function
|
|
1002
|
-
let r =
|
|
1003
|
-
n ?
|
|
1018
|
+
function et(e, t, n) {
|
|
1019
|
+
let r = Qe(e, t);
|
|
1020
|
+
n ? z.value = r : z.value === r && (z.value = null);
|
|
1004
1021
|
}
|
|
1005
|
-
function
|
|
1006
|
-
let n =
|
|
1007
|
-
|
|
1022
|
+
function tt(e, t) {
|
|
1023
|
+
let n = Qe(e, t);
|
|
1024
|
+
z.value = z.value === n ? null : n;
|
|
1008
1025
|
}
|
|
1009
|
-
function
|
|
1010
|
-
|
|
1026
|
+
function nt() {
|
|
1027
|
+
z.value = null;
|
|
1011
1028
|
}
|
|
1012
|
-
function
|
|
1013
|
-
|
|
1029
|
+
function rt(e) {
|
|
1030
|
+
ie.value = e, ae.value = e.map((e) => Pe(e, he.value.get(e) ?? -1)).filter((e) => e !== void 0), h("selectionChange", e, ae.value);
|
|
1014
1031
|
}
|
|
1015
|
-
function
|
|
1016
|
-
|
|
1032
|
+
function it(e) {
|
|
1033
|
+
h("pageChange", e);
|
|
1017
1034
|
}
|
|
1018
|
-
function
|
|
1019
|
-
|
|
1035
|
+
function at(e, t, n) {
|
|
1036
|
+
h("rowClick", e, t, n);
|
|
1020
1037
|
}
|
|
1021
|
-
function
|
|
1022
|
-
|
|
1038
|
+
function ot(e, t) {
|
|
1039
|
+
h("currentChange", e, t);
|
|
1023
1040
|
}
|
|
1024
|
-
function
|
|
1025
|
-
|
|
1041
|
+
function st(e, t) {
|
|
1042
|
+
h("expandChange", e, t);
|
|
1026
1043
|
}
|
|
1027
|
-
function
|
|
1044
|
+
function ct() {
|
|
1028
1045
|
if (typeof window > "u") return;
|
|
1029
1046
|
let e = window.innerWidth <= 768;
|
|
1030
|
-
e !==
|
|
1047
|
+
e !== R.value && (R.value = e, e || nt(), _(() => A.value?.doLayout?.()));
|
|
1031
1048
|
}
|
|
1032
|
-
function
|
|
1033
|
-
e.key === "Escape" &&
|
|
1049
|
+
function lt(e) {
|
|
1050
|
+
e.key === "Escape" && nt();
|
|
1034
1051
|
}
|
|
1035
|
-
function
|
|
1036
|
-
!
|
|
1037
|
-
|
|
1038
|
-
|
|
1052
|
+
function ut() {
|
|
1053
|
+
!m.autoResize || typeof ResizeObserver > "u" || !ee.value || (se = new ResizeObserver(() => {
|
|
1054
|
+
B && clearTimeout(B), B = setTimeout(() => {
|
|
1055
|
+
B = void 0, A.value?.doLayout?.();
|
|
1039
1056
|
});
|
|
1040
|
-
}),
|
|
1057
|
+
}), se.observe(ee.value));
|
|
1041
1058
|
}
|
|
1042
|
-
function
|
|
1043
|
-
|
|
1059
|
+
function dt() {
|
|
1060
|
+
se?.disconnect(), se = void 0, B &&= (clearTimeout(B), void 0);
|
|
1044
1061
|
}
|
|
1045
|
-
return N(() =>
|
|
1046
|
-
|
|
1047
|
-
}), N(() => [
|
|
1048
|
-
typeof document > "u" || (document.removeEventListener("keydown",
|
|
1062
|
+
return N(() => m.autoResize, () => {
|
|
1063
|
+
dt(), ut();
|
|
1064
|
+
}), N(() => [H.value.map((e) => String(e.field)).join("\0"), m.columnSettings?.storageKey], ke), N(z, (e) => {
|
|
1065
|
+
typeof document > "u" || (document.removeEventListener("keydown", lt), e !== null && document.addEventListener("keydown", lt));
|
|
1049
1066
|
}), S(() => {
|
|
1050
|
-
|
|
1067
|
+
ke(), ct(), ut(), window.addEventListener("resize", ct);
|
|
1051
1068
|
}), x(() => {
|
|
1052
|
-
|
|
1069
|
+
dt(), window.removeEventListener("resize", ct), document.removeEventListener("keydown", lt);
|
|
1053
1070
|
}), r({
|
|
1054
|
-
clearSelection: () =>
|
|
1055
|
-
doLayout: () =>
|
|
1056
|
-
getSelectedRowKeys: () => [...
|
|
1057
|
-
getSelectedRows: () => [...
|
|
1058
|
-
getColumnOrder: () => [...
|
|
1059
|
-
getExportData: (e =
|
|
1060
|
-
let t = new Map(
|
|
1071
|
+
clearSelection: () => A.value?.clearSelection?.(),
|
|
1072
|
+
doLayout: () => A.value?.doLayout?.(),
|
|
1073
|
+
getSelectedRowKeys: () => [...ae.value],
|
|
1074
|
+
getSelectedRows: () => [...ie.value],
|
|
1075
|
+
getColumnOrder: () => [...L.value],
|
|
1076
|
+
getExportData: (e = m.rows) => {
|
|
1077
|
+
let t = new Map(m.rows.map((e, t) => [te(e), t]));
|
|
1061
1078
|
return {
|
|
1062
1079
|
columns: le.value.map((e) => ({
|
|
1063
1080
|
field: String(e.field),
|
|
1064
1081
|
label: e.label
|
|
1065
1082
|
})),
|
|
1066
|
-
rows: e.map((e) => le.value.map((
|
|
1083
|
+
rows: e.map((e, n) => le.value.map((r) => J(e, r, t.get(te(e)) ?? n).text))
|
|
1067
1084
|
};
|
|
1068
1085
|
},
|
|
1069
1086
|
getVisibleColumns: () => [...le.value],
|
|
1070
|
-
resetColumnSettings:
|
|
1071
|
-
getTableElement: () =>
|
|
1072
|
-
getTableInstance: () =>
|
|
1073
|
-
toggleRowSelection: (e, t) =>
|
|
1087
|
+
resetColumnSettings: U,
|
|
1088
|
+
getTableElement: () => A.value?.$el,
|
|
1089
|
+
getTableInstance: () => A.value,
|
|
1090
|
+
toggleRowSelection: (e, t) => A.value?.toggleRowSelection?.(e, t)
|
|
1074
1091
|
}), (e, t) => (C(), c("div", {
|
|
1075
1092
|
ref_key: "containerRef",
|
|
1076
|
-
ref:
|
|
1093
|
+
ref: ee,
|
|
1077
1094
|
class: "lumal-schema-table"
|
|
1078
1095
|
}, [
|
|
1079
|
-
e.$slots["toolbar-title"] || e.$slots.toolbar || e.$slots["toolbar-tools"] || ye.value ? (C(), c("div",
|
|
1080
|
-
e.$slots["toolbar-title"] ? (C(), c("div",
|
|
1081
|
-
e.$slots.toolbar ? (C(), c("div",
|
|
1082
|
-
e.$slots["toolbar-tools"] || ye.value ? (C(), c("div",
|
|
1096
|
+
e.$slots["toolbar-title"] || e.$slots.toolbar || e.$slots["toolbar-tools"] || ye.value ? (C(), c("div", Ie, [
|
|
1097
|
+
e.$slots["toolbar-title"] ? (C(), c("div", Le, [T(e.$slots, "toolbar-title", {}, void 0, !0)])) : s("", !0),
|
|
1098
|
+
e.$slots.toolbar ? (C(), c("div", Re, [T(e.$slots, "toolbar", {}, void 0, !0)])) : s("", !0),
|
|
1099
|
+
e.$slots["toolbar-tools"] || ye.value ? (C(), c("div", ze, [T(e.$slots, "toolbar-tools", {}, void 0, !0), ye.value ? (C(), c("div", Be, [l("details", null, [l("summary", Ve, [f(O(I), { name: "lumal:grid" })]), l("div", He, [l("div", { class: "lumal-schema-table__column-options-header" }, [t[6] ||= l("strong", null, "列设置", -1), l("button", {
|
|
1083
1100
|
type: "button",
|
|
1084
|
-
onClick:
|
|
1085
|
-
}, " 恢复默认 ")]), (C(!0), c(i, null,
|
|
1101
|
+
onClick: U
|
|
1102
|
+
}, " 恢复默认 ")]), (C(!0), c(i, null, w(ue.value, (e, r) => (C(), c("div", {
|
|
1086
1103
|
key: String(e.field),
|
|
1087
1104
|
class: "lumal-schema-table__column-option",
|
|
1088
1105
|
draggable: n.columnSettings?.reorderable !== !1,
|
|
1089
|
-
onDragstart: (t) =>
|
|
1090
|
-
onDragover: t[0] ||=
|
|
1091
|
-
onDrop: (t) =>
|
|
1092
|
-
}, [f(
|
|
1093
|
-
"model-value": !
|
|
1094
|
-
"onUpdate:modelValue": (t) =>
|
|
1106
|
+
onDragstart: (t) => Oe(String(e.field)),
|
|
1107
|
+
onDragover: t[0] ||= re(() => {}, ["prevent"]),
|
|
1108
|
+
onDrop: (t) => G(String(e.field))
|
|
1109
|
+
}, [f(O(oe), {
|
|
1110
|
+
"model-value": !M.value.has(String(e.field)),
|
|
1111
|
+
"onUpdate:modelValue": (t) => De(String(e.field))
|
|
1095
1112
|
}, {
|
|
1096
|
-
default: P(() => [d(
|
|
1113
|
+
default: P(() => [d(D(e.label), 1)]),
|
|
1097
1114
|
_: 2
|
|
1098
|
-
}, 1032, ["model-value", "onUpdate:modelValue"]), n.columnSettings?.reorderable === !1 ? s("", !0) : (C(), c("span",
|
|
1115
|
+
}, 1032, ["model-value", "onUpdate:modelValue"]), n.columnSettings?.reorderable === !1 ? s("", !0) : (C(), c("span", We, [l("button", {
|
|
1099
1116
|
type: "button",
|
|
1100
1117
|
disabled: r === 0,
|
|
1101
1118
|
"aria-label": `上移${e.label}`,
|
|
1102
1119
|
title: `上移${e.label}`,
|
|
1103
|
-
onClick: (t) =>
|
|
1104
|
-
}, [f(
|
|
1120
|
+
onClick: (t) => W(String(e.field), -1)
|
|
1121
|
+
}, [f(O(I), { name: "lumal:arrow-up" })], 8, Ge), l("button", {
|
|
1105
1122
|
type: "button",
|
|
1106
1123
|
disabled: r === ue.value.length - 1,
|
|
1107
1124
|
"aria-label": `下移${e.label}`,
|
|
1108
1125
|
title: `下移${e.label}`,
|
|
1109
|
-
onClick: (t) =>
|
|
1110
|
-
}, [f(
|
|
1126
|
+
onClick: (t) => W(String(e.field), 1)
|
|
1127
|
+
}, [f(O(I), { name: "lumal:arrow-down" })], 8, Ke)]))], 40, Ue))), 128))])])])) : s("", !0)])) : s("", !0)
|
|
1111
1128
|
])) : s("", !0),
|
|
1112
|
-
n.error ? (C(), c("div",
|
|
1129
|
+
n.error ? (C(), c("div", qe, [l("span", null, D(xe.value), 1), l("button", {
|
|
1113
1130
|
type: "button",
|
|
1114
|
-
onClick: t[1] ||= (e) =>
|
|
1115
|
-
},
|
|
1131
|
+
onClick: t[1] ||= (e) => h("retry")
|
|
1132
|
+
}, D(n.retryText), 1)])) : (C(), c("div", Je, [ne((C(), o(O(Se), g({
|
|
1116
1133
|
ref_key: "tableRef",
|
|
1117
|
-
ref:
|
|
1134
|
+
ref: A
|
|
1118
1135
|
}, n.tableProps, {
|
|
1119
1136
|
class: "lumal-schema-table__body",
|
|
1120
1137
|
data: n.rows,
|
|
1121
|
-
"row-key":
|
|
1138
|
+
"row-key": _e.value,
|
|
1122
1139
|
"empty-text": n.emptyText,
|
|
1123
1140
|
"row-class-name": n.rowClassName,
|
|
1124
1141
|
"cell-class-name": n.cellClassName,
|
|
1125
1142
|
"header-cell-class-name": n.headerCellClassName,
|
|
1126
|
-
"default-expand-all":
|
|
1143
|
+
"default-expand-all": we.value,
|
|
1127
1144
|
"tree-props": Te.value,
|
|
1128
1145
|
"data-loading": n.loading,
|
|
1129
|
-
onSelectionChange:
|
|
1130
|
-
onSortChange: t[2] ||= (e) =>
|
|
1131
|
-
onFilterChange: t[3] ||= (e) =>
|
|
1132
|
-
onRowClick:
|
|
1133
|
-
onCurrentChange:
|
|
1134
|
-
onExpandChange:
|
|
1146
|
+
onSelectionChange: rt,
|
|
1147
|
+
onSortChange: t[2] ||= (e) => h("sortChange", e),
|
|
1148
|
+
onFilterChange: t[3] ||= (e) => h("filterChange", e),
|
|
1149
|
+
onRowClick: at,
|
|
1150
|
+
onCurrentChange: ot,
|
|
1151
|
+
onExpandChange: st
|
|
1135
1152
|
}), {
|
|
1136
1153
|
default: P(() => [
|
|
1137
|
-
n.selection ? (C(), o(
|
|
1154
|
+
n.selection ? (C(), o(O(Ce), {
|
|
1138
1155
|
key: 0,
|
|
1139
1156
|
type: "selection",
|
|
1140
1157
|
width: "48"
|
|
1141
1158
|
})) : s("", !0),
|
|
1142
|
-
n.showIndex ? (C(), o(
|
|
1159
|
+
n.showIndex ? (C(), o(O(Ce), {
|
|
1143
1160
|
key: 1,
|
|
1144
1161
|
type: "index",
|
|
1145
1162
|
label: n.indexLabel,
|
|
1146
1163
|
width: n.indexWidth
|
|
1147
1164
|
}, null, 8, ["label", "width"])) : s("", !0),
|
|
1148
|
-
(C(!0), c(i, null,
|
|
1149
|
-
|
|
1165
|
+
(C(!0), c(i, null, w(le.value, (t) => (C(), o(O(Ce), g({ key: String(t.field) }, { ref_for: !0 }, t.componentProps, {
|
|
1166
|
+
type: t.type,
|
|
1167
|
+
index: Y,
|
|
1168
|
+
prop: t.type === "index" ? void 0 : String(t.field),
|
|
1150
1169
|
label: t.label,
|
|
1151
1170
|
align: t.align,
|
|
1152
|
-
width:
|
|
1153
|
-
"min-width":
|
|
1171
|
+
width: Ne(t),
|
|
1172
|
+
"min-width": Me(t),
|
|
1154
1173
|
fixed: t.fixed,
|
|
1155
1174
|
resizable: n.columnResizable,
|
|
1156
1175
|
"show-overflow-tooltip": t.showOverflowTooltip ?? !0,
|
|
1157
|
-
formatter:
|
|
1176
|
+
formatter: je(t),
|
|
1158
1177
|
"data-field": String(t.field)
|
|
1159
|
-
}), {
|
|
1160
|
-
|
|
1178
|
+
}), u({ _: 2 }, [t.type === "index" ? void 0 : {
|
|
1179
|
+
name: "default",
|
|
1180
|
+
fn: P(({ row: n, $index: r }) => [Ae(n, t, r) ? s("", !0) : T(e.$slots, `table-${String(t.field)}`, {
|
|
1161
1181
|
key: 0,
|
|
1162
1182
|
row: n,
|
|
1163
1183
|
index: r,
|
|
1164
1184
|
column: t,
|
|
1165
1185
|
value: n[t.field]
|
|
1166
|
-
}, () => [f($, { display:
|
|
1167
|
-
|
|
1168
|
-
}, 1040, [
|
|
1186
|
+
}, () => [f($, { display: J(n, t, r) }, null, 8, ["display"])], !0)]),
|
|
1187
|
+
key: "0"
|
|
1188
|
+
}]), 1040, [
|
|
1189
|
+
"type",
|
|
1169
1190
|
"prop",
|
|
1170
1191
|
"label",
|
|
1171
1192
|
"align",
|
|
@@ -1177,38 +1198,38 @@ var Fe = {
|
|
|
1177
1198
|
"formatter",
|
|
1178
1199
|
"data-field"
|
|
1179
1200
|
]))), 128)),
|
|
1180
|
-
e.$slots.actions ? (C(), o(
|
|
1201
|
+
e.$slots.actions ? (C(), o(O(Ce), {
|
|
1181
1202
|
key: 2,
|
|
1182
1203
|
fixed: "right",
|
|
1183
1204
|
label: n.actionLabel,
|
|
1184
1205
|
width: be.value,
|
|
1185
1206
|
"data-field": "actions"
|
|
1186
1207
|
}, {
|
|
1187
|
-
default: P(({ row: t, $index: r }) => [l("div",
|
|
1208
|
+
default: P(({ row: t, $index: r }) => [l("div", Ye, [T(e.$slots, "actions", {
|
|
1188
1209
|
row: t,
|
|
1189
1210
|
index: r
|
|
1190
|
-
}, void 0, !0)]), f(
|
|
1191
|
-
visible:
|
|
1211
|
+
}, void 0, !0)]), f(O(ge), {
|
|
1212
|
+
visible: $e(t, r),
|
|
1192
1213
|
teleported: !0,
|
|
1193
1214
|
role: "menu",
|
|
1194
1215
|
trigger: "click",
|
|
1195
1216
|
placement: "bottom-end",
|
|
1196
1217
|
"popper-class": "lumal-schema-table__mobile-actions-popper",
|
|
1197
|
-
"onUpdate:visible": (e) =>
|
|
1218
|
+
"onUpdate:visible": (e) => et(t, r, e)
|
|
1198
1219
|
}, {
|
|
1199
1220
|
reference: P(() => [l("button", {
|
|
1200
1221
|
type: "button",
|
|
1201
1222
|
class: "lumal-schema-table__mobile-actions",
|
|
1202
1223
|
"aria-haspopup": "menu",
|
|
1203
|
-
"aria-expanded":
|
|
1204
|
-
onClick:
|
|
1205
|
-
onKeydown:
|
|
1206
|
-
},
|
|
1224
|
+
"aria-expanded": $e(t, r),
|
|
1225
|
+
onClick: re((e) => tt(t, r), ["stop"]),
|
|
1226
|
+
onKeydown: F(re(nt, ["stop", "prevent"]), ["esc"])
|
|
1227
|
+
}, D(n.mobileActionLabel), 41, Xe)]),
|
|
1207
1228
|
default: P(() => [l("div", {
|
|
1208
1229
|
class: "lumal-schema-table__mobile-actions-menu",
|
|
1209
1230
|
role: "menu",
|
|
1210
|
-
onClickCapture:
|
|
1211
|
-
}, [
|
|
1231
|
+
onClickCapture: nt
|
|
1232
|
+
}, [T(e.$slots, "actions", {
|
|
1212
1233
|
row: t,
|
|
1213
1234
|
index: r
|
|
1214
1235
|
}, void 0, !0)], 32)]),
|
|
@@ -1228,15 +1249,15 @@ var Fe = {
|
|
|
1228
1249
|
"default-expand-all",
|
|
1229
1250
|
"tree-props",
|
|
1230
1251
|
"data-loading"
|
|
1231
|
-
])), [[
|
|
1232
|
-
ve.value ? (C(), c("div",
|
|
1233
|
-
page:
|
|
1234
|
-
"onUpdate:page": t[4] ||= (e) =>
|
|
1235
|
-
"page-size":
|
|
1236
|
-
"onUpdate:pageSize": t[5] ||= (e) =>
|
|
1252
|
+
])), [[O(b), n.loading]])])),
|
|
1253
|
+
ve.value ? (C(), c("div", Ze, [f(O(Ee), {
|
|
1254
|
+
page: v.value,
|
|
1255
|
+
"onUpdate:page": t[4] ||= (e) => v.value = e,
|
|
1256
|
+
"page-size": y.value,
|
|
1257
|
+
"onUpdate:pageSize": t[5] ||= (e) => y.value = e,
|
|
1237
1258
|
total: n.total,
|
|
1238
1259
|
"page-sizes": n.pageSizes,
|
|
1239
|
-
onChange:
|
|
1260
|
+
onChange: it
|
|
1240
1261
|
}, null, 8, [
|
|
1241
1262
|
"page",
|
|
1242
1263
|
"page-size",
|
|
@@ -1245,7 +1266,7 @@ var Fe = {
|
|
|
1245
1266
|
])])) : s("", !0)
|
|
1246
1267
|
], 512));
|
|
1247
1268
|
}
|
|
1248
|
-
}), [["__scopeId", "data-v-
|
|
1269
|
+
}), [["__scopeId", "data-v-94010976"]]), $e = /* @__PURE__ */ p({
|
|
1249
1270
|
__name: "LumalCrudEditor",
|
|
1250
1271
|
props: /*@__PURE__*/ h({
|
|
1251
1272
|
beforeClose: {},
|
|
@@ -1269,8 +1290,8 @@ var Fe = {
|
|
|
1269
1290
|
}),
|
|
1270
1291
|
emits: ["update:modelValue"],
|
|
1271
1292
|
setup(e) {
|
|
1272
|
-
let t =
|
|
1273
|
-
return (n, r) => e.type === "drawer" ? (C(), o(
|
|
1293
|
+
let t = k(e, "modelValue");
|
|
1294
|
+
return (n, r) => e.type === "drawer" ? (C(), o(O(H), {
|
|
1274
1295
|
key: 0,
|
|
1275
1296
|
modelValue: t.value,
|
|
1276
1297
|
"onUpdate:modelValue": r[0] ||= (e) => t.value = e,
|
|
@@ -1281,8 +1302,8 @@ var Fe = {
|
|
|
1281
1302
|
"before-close": e.beforeClose,
|
|
1282
1303
|
class: "lumal-crud-table__drawer"
|
|
1283
1304
|
}, {
|
|
1284
|
-
footer: P(() => [
|
|
1285
|
-
default: P(() => [
|
|
1305
|
+
footer: P(() => [T(n.$slots, "footer")]),
|
|
1306
|
+
default: P(() => [T(n.$slots, "default")]),
|
|
1286
1307
|
_: 3
|
|
1287
1308
|
}, 8, [
|
|
1288
1309
|
"modelValue",
|
|
@@ -1291,7 +1312,7 @@ var Fe = {
|
|
|
1291
1312
|
"close-on-click-modal",
|
|
1292
1313
|
"destroy-on-close",
|
|
1293
1314
|
"before-close"
|
|
1294
|
-
])) : (C(), o(
|
|
1315
|
+
])) : (C(), o(O(V), {
|
|
1295
1316
|
key: 1,
|
|
1296
1317
|
modelValue: t.value,
|
|
1297
1318
|
"onUpdate:modelValue": r[1] ||= (e) => t.value = e,
|
|
@@ -1302,8 +1323,8 @@ var Fe = {
|
|
|
1302
1323
|
"before-close": e.beforeClose,
|
|
1303
1324
|
class: "lumal-crud-table__dialog"
|
|
1304
1325
|
}, {
|
|
1305
|
-
footer: P(() => [
|
|
1306
|
-
default: P(() => [
|
|
1326
|
+
footer: P(() => [T(n.$slots, "footer")]),
|
|
1327
|
+
default: P(() => [T(n.$slots, "default")]),
|
|
1307
1328
|
_: 3
|
|
1308
1329
|
}, 8, [
|
|
1309
1330
|
"modelValue",
|
|
@@ -1317,8 +1338,8 @@ var Fe = {
|
|
|
1317
1338
|
});
|
|
1318
1339
|
//#endregion
|
|
1319
1340
|
//#region src/components/crud-table/schema.ts
|
|
1320
|
-
function
|
|
1321
|
-
return t.length > 0 ? [...t] : e.filter((e) => e.showInForm !== !1 && e.field !== "action").map((e) => ({
|
|
1341
|
+
function et(e = [], t = []) {
|
|
1342
|
+
return t.length > 0 ? [...t] : e.filter((e) => e.type !== "index" && e.showInForm !== !1 && e.field !== "action").map((e) => ({
|
|
1322
1343
|
append: e.append,
|
|
1323
1344
|
component: e.component ?? (e.dictionary || e.dictType ? "select" : "input"),
|
|
1324
1345
|
componentProps: e.formComponentProps,
|
|
@@ -1340,14 +1361,14 @@ function $e(e = [], t = []) {
|
|
|
1340
1361
|
}
|
|
1341
1362
|
//#endregion
|
|
1342
1363
|
//#region src/components/crud-table/useCrudData.ts
|
|
1343
|
-
function
|
|
1364
|
+
function tt(e) {
|
|
1344
1365
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
1345
1366
|
}
|
|
1346
|
-
function
|
|
1347
|
-
let t =
|
|
1367
|
+
function nt(e) {
|
|
1368
|
+
let t = E([]), n = E(0), r = E(!1), i = E(""), o = 0, s = a(() => e.dataSource.value ? t.value : e.rows.value), c = a(() => e.dataSource.value ? n.value : e.total.value), l = a(() => e.loading.value || r.value);
|
|
1348
1369
|
function u(t) {
|
|
1349
1370
|
let n = e.dataSource.value;
|
|
1350
|
-
return n?.parseResponse ? n.parseResponse(t) : !
|
|
1371
|
+
return n?.parseResponse ? n.parseResponse(t) : !tt(t) || !Array.isArray(t.items) || typeof t.total != "number" ? {
|
|
1351
1372
|
items: [],
|
|
1352
1373
|
total: 0
|
|
1353
1374
|
} : {
|
|
@@ -1385,25 +1406,25 @@ function tt(e) {
|
|
|
1385
1406
|
}
|
|
1386
1407
|
//#endregion
|
|
1387
1408
|
//#region src/components/crud-table/useCrudDialog.ts
|
|
1388
|
-
function
|
|
1409
|
+
function rt(e) {
|
|
1389
1410
|
try {
|
|
1390
1411
|
return JSON.stringify(e);
|
|
1391
1412
|
} catch {
|
|
1392
1413
|
return String(e);
|
|
1393
1414
|
}
|
|
1394
1415
|
}
|
|
1395
|
-
function
|
|
1416
|
+
function it(e) {
|
|
1396
1417
|
try {
|
|
1397
1418
|
return structuredClone(e);
|
|
1398
1419
|
} catch {
|
|
1399
1420
|
return JSON.parse(JSON.stringify(e));
|
|
1400
1421
|
}
|
|
1401
1422
|
}
|
|
1402
|
-
function
|
|
1403
|
-
let t =
|
|
1423
|
+
function at(e) {
|
|
1424
|
+
let t = E(!1), n = E("create"), r = E({}), i = E("{}"), o = E(), s = E(!1), c = E(""), l = a(() => n.value !== "view" && rt(r.value) !== i.value);
|
|
1404
1425
|
function u(e, a) {
|
|
1405
|
-
let s = a ?
|
|
1406
|
-
n.value = e, o.value = a, r.value = s, i.value =
|
|
1426
|
+
let s = a ? it(a) : {};
|
|
1427
|
+
n.value = e, o.value = a, r.value = s, i.value = rt(s), c.value = "", t.value = !0;
|
|
1407
1428
|
}
|
|
1408
1429
|
async function d(r, a) {
|
|
1409
1430
|
if (s.value) return !1;
|
|
@@ -1411,7 +1432,7 @@ function it(e) {
|
|
|
1411
1432
|
if (!l) return t.value = !1, !0;
|
|
1412
1433
|
s.value = !0, c.value = "";
|
|
1413
1434
|
try {
|
|
1414
|
-
return a && !await a() ? !1 : (n.value === "edit" && o.value ? await l.update?.(o.value, r) : await l.create?.(r), i.value =
|
|
1435
|
+
return a && !await a() ? !1 : (n.value === "edit" && o.value ? await l.update?.(o.value, r) : await l.create?.(r), i.value = rt(r), t.value = !1, s.value = !1, await e.afterSave(), !0);
|
|
1415
1436
|
} catch (e) {
|
|
1416
1437
|
return c.value = e instanceof Error ? e.message : String(e), !1;
|
|
1417
1438
|
} finally {
|
|
@@ -1432,8 +1453,8 @@ function it(e) {
|
|
|
1432
1453
|
}
|
|
1433
1454
|
//#endregion
|
|
1434
1455
|
//#region src/components/crud-table/useCrudQuery.ts
|
|
1435
|
-
function
|
|
1436
|
-
let t =
|
|
1456
|
+
function ot(e) {
|
|
1457
|
+
let t = E(e.defaultCollapsed.value), n = a(() => K(G(e.schemas.value))), r = a(() => {
|
|
1437
1458
|
if (!e.collapsible.value || !t.value) return e.schemas.value;
|
|
1438
1459
|
let n = 24 / e.columns.value, r = e.columns.value * e.collapsedRows.value, i = 0;
|
|
1439
1460
|
return e.schemas.value.filter((e) => {
|
|
@@ -1459,8 +1480,8 @@ function at(e) {
|
|
|
1459
1480
|
}
|
|
1460
1481
|
//#endregion
|
|
1461
1482
|
//#region src/components/crud-table/useCrudSelection.ts
|
|
1462
|
-
function
|
|
1463
|
-
let e =
|
|
1483
|
+
function st() {
|
|
1484
|
+
let e = E([]), t = E([]);
|
|
1464
1485
|
function n() {
|
|
1465
1486
|
e.value = [], t.value = [];
|
|
1466
1487
|
}
|
|
@@ -1476,21 +1497,21 @@ function ot() {
|
|
|
1476
1497
|
}
|
|
1477
1498
|
//#endregion
|
|
1478
1499
|
//#region src/components/crud-table/LumalCrudTable.vue?vue&type=script&setup=true&lang.ts
|
|
1479
|
-
var
|
|
1500
|
+
var ct = { class: "lumal-crud-table__query-actions" }, lt = {
|
|
1480
1501
|
key: 1,
|
|
1481
1502
|
class: "lumal-crud-table__error",
|
|
1482
1503
|
role: "alert"
|
|
1483
|
-
},
|
|
1504
|
+
}, ut = { class: "lumal-crud-table__table-panel" }, dt = { class: "lumal-crud-table__body" }, ft = { class: "lumal-crud-table__toolbar-tools" }, pt = {
|
|
1484
1505
|
key: 0,
|
|
1485
1506
|
class: "lumal-crud-table__extra"
|
|
1486
|
-
},
|
|
1507
|
+
}, mt = {
|
|
1487
1508
|
key: 1,
|
|
1488
1509
|
class: "lumal-crud-table__pagination"
|
|
1489
|
-
},
|
|
1510
|
+
}, ht = {
|
|
1490
1511
|
key: 0,
|
|
1491
1512
|
class: "lumal-crud-table__dialog-error",
|
|
1492
1513
|
role: "alert"
|
|
1493
|
-
},
|
|
1514
|
+
}, gt = { class: "lumal-crud-table__dialog-footer" }, _t = /*#__PURE__*/ r(/* @__PURE__ */ p({
|
|
1494
1515
|
__name: "LumalCrudTable",
|
|
1495
1516
|
props: /*@__PURE__*/ h({
|
|
1496
1517
|
title: {},
|
|
@@ -1549,35 +1570,35 @@ var st = { class: "lumal-crud-table__query-actions" }, ct = {
|
|
|
1549
1570
|
"update:pageSize"
|
|
1550
1571
|
]),
|
|
1551
1572
|
setup(e, { expose: t, emit: n }) {
|
|
1552
|
-
let r = e, i = n, p =
|
|
1573
|
+
let r = e, i = n, p = k(e, "queryModel"), h = k(e, "page"), g = k(e, "pageSize"), b = j("crudRef"), ee = j("queryRef"), te = j("queryFormRef"), A = j("dialogFormRef"), F = j("tableRef"), re = a(() => r.query?.schemas ?? r.querySchemas), L = a(() => r.table?.columns ?? r.columns), ie = a(() => L.value.filter((e) => e.showInTable !== !1)), ae = a(() => et(L.value, r.formSchemas)), oe = a(() => r.table?.rowKey ?? r.rowKey), z = a(() => r.table?.selection ?? r.selection), se = a(() => r.table?.emptyText ?? r.emptyText), B = E(3), V = a(() => Math.max(1, r.query?.columns ?? B.value)), H = a(() => r.query?.collapsible ?? !1), ce = a(() => r.query?.defaultCollapsed ?? !0), le = a(() => Math.max(1, r.query?.collapsedRows ?? 1)), ue = a(() => typeof r.pagination == "object" ? r.pagination.enabled !== !1 : r.pagination), de = a(() => typeof r.pagination == "object" ? r.pagination.pageSizes ?? r.pageSizes : r.pageSizes), fe = a(() => re.value.length > 0), me = a(() => ae.value.length > 0), he = a(() => me.value && r.toolbar?.create !== !1), ge = a(() => z.value && r.toolbar?.batchDelete !== !1), _e = a(() => !!r.dataSource && r.toolbar?.refresh !== !1), ve = a(() => !!r.toolbar?.export), ye = a(() => r.toolbar?.fullscreen !== !1), be = a(() => fe.value && r.toolbar?.queryToggle !== !1), xe = a(() => he.value || ge.value || ve.value), Se = a(() => be.value || _e.value || ye.value), Ce = typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(max-width: 768px)").matches, we = {
|
|
1553
1574
|
desktop: r.query?.defaultVisible ?? !0,
|
|
1554
1575
|
mobile: r.query?.mobileDefaultVisible ?? r.query?.defaultVisible ?? !0
|
|
1555
|
-
},
|
|
1556
|
-
dataSource:
|
|
1576
|
+
}, Te = a(() => r.dataSource), De = E(!1), U = E(!1), W = E(Ce), Oe = a(() => W.value ? "mobile" : "desktop"), G = E(we), K = E(we[Ce ? "mobile" : "desktop"]), ke, q, Ae, Y = nt({
|
|
1577
|
+
dataSource: Te,
|
|
1557
1578
|
loading: a(() => r.loading),
|
|
1558
1579
|
page: h,
|
|
1559
1580
|
pageSize: g,
|
|
1560
1581
|
queryModel: p,
|
|
1561
1582
|
rows: a(() => r.rows),
|
|
1562
1583
|
total: a(() => r.total)
|
|
1563
|
-
}),
|
|
1564
|
-
collapsedRows:
|
|
1565
|
-
collapsible:
|
|
1566
|
-
columns:
|
|
1567
|
-
defaultCollapsed:
|
|
1584
|
+
}), X = ot({
|
|
1585
|
+
collapsedRows: le,
|
|
1586
|
+
collapsible: H,
|
|
1587
|
+
columns: V,
|
|
1588
|
+
defaultCollapsed: ce,
|
|
1568
1589
|
model: p,
|
|
1569
1590
|
schemas: re
|
|
1570
|
-
}),
|
|
1571
|
-
dataSource:
|
|
1572
|
-
afterSave:
|
|
1573
|
-
}),
|
|
1591
|
+
}), Z = st(), Q = at({
|
|
1592
|
+
dataSource: Te,
|
|
1593
|
+
afterSave: Y.load
|
|
1594
|
+
}), je = a(() => Y.currentLoading.value || De.value), Me = a(() => ue.value && Y.currentTotal.value > 0), $ = a(() => ({
|
|
1574
1595
|
create: r.editor?.createTitle ?? r.toolbar?.createText ?? r.createText,
|
|
1575
1596
|
edit: r.editor?.editTitle ?? "编辑",
|
|
1576
1597
|
view: r.editor?.viewTitle ?? "查看"
|
|
1577
|
-
})[
|
|
1578
|
-
N(() => r.dataSource, () => void
|
|
1598
|
+
})[Q.mode.value]);
|
|
1599
|
+
N(() => r.dataSource, () => void Y.load(), { immediate: !0 }), N([h, g], () => void Y.load());
|
|
1579
1600
|
function Ne() {
|
|
1580
|
-
|
|
1601
|
+
U.value = typeof document < "u" && document.fullscreenElement === b.value;
|
|
1581
1602
|
}
|
|
1582
1603
|
function Pe(e) {
|
|
1583
1604
|
if (r.query?.columns !== void 0 || e <= 0) return;
|
|
@@ -1585,40 +1606,40 @@ var st = { class: "lumal-crud-table__query-actions" }, ct = {
|
|
|
1585
1606
|
B.value !== t && (B.value = t);
|
|
1586
1607
|
}
|
|
1587
1608
|
function Fe() {
|
|
1588
|
-
|
|
1609
|
+
q?.disconnect(), q = void 0, ee.value && (Pe(ee.value.clientWidth), !(typeof ResizeObserver > "u") && (q = new ResizeObserver((e) => Pe(e[0]?.contentRect.width ?? 0)), q.observe(ee.value)));
|
|
1589
1610
|
}
|
|
1590
1611
|
function Ie(e) {
|
|
1591
|
-
|
|
1592
|
-
|
|
1612
|
+
W.value !== e && (W.value = e, K.value = G.value[Oe.value], _(() => {
|
|
1613
|
+
K.value ? Fe() : q?.disconnect(), F.value?.doLayout();
|
|
1593
1614
|
}));
|
|
1594
1615
|
}
|
|
1595
1616
|
function Le(e) {
|
|
1596
1617
|
Ie(e.matches);
|
|
1597
1618
|
}
|
|
1598
1619
|
S(() => {
|
|
1599
|
-
typeof document < "u" && document.addEventListener("fullscreenchange", Ne), typeof window < "u" && typeof window.matchMedia == "function" && (
|
|
1620
|
+
typeof document < "u" && document.addEventListener("fullscreenchange", Ne), typeof window < "u" && typeof window.matchMedia == "function" && (Ae = window.matchMedia("(max-width: 768px)"), Ie(Ae.matches), Ae.addEventListener?.("change", Le)), Fe();
|
|
1600
1621
|
}), x(() => {
|
|
1601
|
-
typeof document < "u" && document.removeEventListener("fullscreenchange", Ne),
|
|
1622
|
+
typeof document < "u" && document.removeEventListener("fullscreenchange", Ne), Ae?.removeEventListener?.("change", Le), q?.disconnect(), ke && clearTimeout(ke);
|
|
1602
1623
|
}), N(() => r.query?.columns, (e) => {
|
|
1603
|
-
e === void 0 && Pe(
|
|
1624
|
+
e === void 0 && Pe(ee.value?.clientWidth ?? 0);
|
|
1604
1625
|
}), N([() => r.query?.defaultVisible, () => r.query?.mobileDefaultVisible], ([e, t]) => {
|
|
1605
|
-
|
|
1626
|
+
G.value = {
|
|
1606
1627
|
desktop: e ?? !0,
|
|
1607
1628
|
mobile: t ?? e ?? !0
|
|
1608
|
-
},
|
|
1629
|
+
}, K.value = G.value[Oe.value];
|
|
1609
1630
|
});
|
|
1610
1631
|
function Re() {
|
|
1611
|
-
i("search", { ...p.value }), h.value === 1 ?
|
|
1632
|
+
i("search", { ...p.value }), h.value === 1 ? Y.load() : h.value = 1;
|
|
1612
1633
|
}
|
|
1613
1634
|
function ze() {
|
|
1614
|
-
let e =
|
|
1615
|
-
|
|
1635
|
+
let e = X.reset();
|
|
1636
|
+
te.value?.resetFields(), i("reset", e), h.value === 1 ? Y.load() : h.value = 1;
|
|
1616
1637
|
}
|
|
1617
1638
|
function Be() {
|
|
1618
|
-
r.query?.submitOnChange && (
|
|
1639
|
+
r.query?.submitOnChange && (ke && clearTimeout(ke), ke = setTimeout(Re, Math.max(0, r.query.submitDebounce ?? 300)));
|
|
1619
1640
|
}
|
|
1620
1641
|
async function Ve() {
|
|
1621
|
-
let e = [...
|
|
1642
|
+
let e = [...Z.selectedRows.value], t = e.length > 0 ? e : Y.currentRows.value, n = {
|
|
1622
1643
|
columns: ie.value,
|
|
1623
1644
|
query: { ...p.value },
|
|
1624
1645
|
rows: t,
|
|
@@ -1649,31 +1670,31 @@ var st = { class: "lumal-crud-table__query-actions" }, ct = {
|
|
|
1649
1670
|
i("pageChange", e);
|
|
1650
1671
|
}
|
|
1651
1672
|
function We() {
|
|
1652
|
-
if (
|
|
1653
|
-
...
|
|
1654
|
-
[
|
|
1655
|
-
},
|
|
1673
|
+
if (K.value = !K.value, G.value = {
|
|
1674
|
+
...G.value,
|
|
1675
|
+
[Oe.value]: K.value
|
|
1676
|
+
}, K.value) {
|
|
1656
1677
|
_(() => {
|
|
1657
1678
|
Fe(), F.value?.doLayout();
|
|
1658
1679
|
});
|
|
1659
1680
|
return;
|
|
1660
1681
|
}
|
|
1661
|
-
|
|
1682
|
+
q?.disconnect(), _(() => F.value?.doLayout());
|
|
1662
1683
|
}
|
|
1663
1684
|
function Ge(e, t, n, r) {
|
|
1664
1685
|
return typeof e == "function" ? e(n, r) : e ?? t;
|
|
1665
1686
|
}
|
|
1666
1687
|
function Ke() {
|
|
1667
|
-
|
|
1688
|
+
Q.open("create");
|
|
1668
1689
|
}
|
|
1669
1690
|
function qe(e) {
|
|
1670
|
-
|
|
1691
|
+
Q.open("edit", e);
|
|
1671
1692
|
}
|
|
1672
1693
|
function Je(e) {
|
|
1673
|
-
|
|
1694
|
+
Q.open("view", e);
|
|
1674
1695
|
}
|
|
1675
1696
|
async function Ye(e) {
|
|
1676
|
-
!await
|
|
1697
|
+
!await Q.submit(e, async () => await A.value?.validate() !== !1) && Q.error.value && i("operationError", Error(Q.error.value));
|
|
1677
1698
|
}
|
|
1678
1699
|
async function Xe(e) {
|
|
1679
1700
|
let t = r.actions?.confirmRemove;
|
|
@@ -1681,7 +1702,7 @@ var st = { class: "lumal-crud-table__query-actions" }, ct = {
|
|
|
1681
1702
|
if (typeof t == "function") return t(e);
|
|
1682
1703
|
let n = typeof t?.message == "function" ? t.message(e) : t?.message ?? `确定删除选中的 ${e.length} 条数据吗?`;
|
|
1683
1704
|
try {
|
|
1684
|
-
return await
|
|
1705
|
+
return await pe.confirm(n, t?.title ?? "删除确认", {
|
|
1685
1706
|
cancelButtonText: t?.cancelButtonText ?? "取消",
|
|
1686
1707
|
confirmButtonText: t?.confirmButtonText ?? "删除",
|
|
1687
1708
|
type: "warning"
|
|
@@ -1690,34 +1711,34 @@ var st = { class: "lumal-crud-table__query-actions" }, ct = {
|
|
|
1690
1711
|
return !1;
|
|
1691
1712
|
}
|
|
1692
1713
|
}
|
|
1693
|
-
async function
|
|
1694
|
-
|
|
1714
|
+
async function Ze(e) {
|
|
1715
|
+
De.value = !0;
|
|
1695
1716
|
try {
|
|
1696
|
-
return await e(), bt(), await
|
|
1717
|
+
return await e(), bt(), await Y.load(), !0;
|
|
1697
1718
|
} catch (e) {
|
|
1698
1719
|
return i("operationError", e), !1;
|
|
1699
1720
|
} finally {
|
|
1700
|
-
|
|
1721
|
+
De.value = !1;
|
|
1701
1722
|
}
|
|
1702
1723
|
}
|
|
1703
|
-
async function
|
|
1724
|
+
async function tt(e) {
|
|
1704
1725
|
let t = r.dataSource?.remove, n = !r.dataSource?.beforeRemove || await r.dataSource.beforeRemove([e]);
|
|
1705
|
-
!t || !n || !await Xe([e]) || await
|
|
1726
|
+
!t || !n || !await Xe([e]) || await Ze(() => t(e));
|
|
1706
1727
|
}
|
|
1707
1728
|
async function rt() {
|
|
1708
|
-
let e = [...
|
|
1709
|
-
e.length === 0 || !t || !await Xe(e) || await
|
|
1729
|
+
let e = [...Z.selectedRows.value], t = !r.dataSource?.beforeRemove || await r.dataSource.beforeRemove(e);
|
|
1730
|
+
e.length === 0 || !t || !await Xe(e) || await Ze(() => r.dataSource?.removeMany ? r.dataSource.removeMany(e) : Promise.all(e.map((e) => r.dataSource?.remove?.(e))));
|
|
1710
1731
|
}
|
|
1711
|
-
async function
|
|
1712
|
-
if (
|
|
1713
|
-
if (!
|
|
1732
|
+
async function it() {
|
|
1733
|
+
if (Q.saving.value) return !1;
|
|
1734
|
+
if (!Q.dirty.value) return !0;
|
|
1714
1735
|
if (r.editor?.confirmClose) return r.editor.confirmClose({
|
|
1715
|
-
mode:
|
|
1716
|
-
model:
|
|
1717
|
-
row:
|
|
1736
|
+
mode: Q.mode.value,
|
|
1737
|
+
model: Q.model.value,
|
|
1738
|
+
row: Q.editingRow.value
|
|
1718
1739
|
});
|
|
1719
1740
|
try {
|
|
1720
|
-
return await
|
|
1741
|
+
return await pe.confirm("表单内容尚未保存,确定关闭吗?", "关闭确认", {
|
|
1721
1742
|
cancelButtonText: "继续编辑",
|
|
1722
1743
|
confirmButtonText: "关闭",
|
|
1723
1744
|
type: "warning"
|
|
@@ -1727,117 +1748,120 @@ var st = { class: "lumal-crud-table__query-actions" }, ct = {
|
|
|
1727
1748
|
}
|
|
1728
1749
|
}
|
|
1729
1750
|
function _t(e) {
|
|
1730
|
-
|
|
1751
|
+
it().then((t) => {
|
|
1731
1752
|
t && e();
|
|
1732
1753
|
});
|
|
1733
1754
|
}
|
|
1734
1755
|
function vt() {
|
|
1735
|
-
|
|
1736
|
-
e && (
|
|
1756
|
+
it().then((e) => {
|
|
1757
|
+
e && (Q.visible.value = !1);
|
|
1737
1758
|
});
|
|
1738
1759
|
}
|
|
1739
1760
|
function yt() {
|
|
1740
|
-
Ye(
|
|
1761
|
+
Ye(Q.model.value);
|
|
1741
1762
|
}
|
|
1742
1763
|
function bt() {
|
|
1743
|
-
|
|
1764
|
+
Z.clear(), F.value?.clearSelection();
|
|
1744
1765
|
}
|
|
1745
1766
|
return t({
|
|
1746
1767
|
clearSelection: bt,
|
|
1747
1768
|
getCrudElement: () => b.value,
|
|
1748
1769
|
closeEditor: vt,
|
|
1749
|
-
getEditorForm: () =>
|
|
1750
|
-
getQueryForm: () =>
|
|
1751
|
-
getSelectedRowKeys: () => [...
|
|
1752
|
-
getSelectedRows: () => [...
|
|
1770
|
+
getEditorForm: () => A.value,
|
|
1771
|
+
getQueryForm: () => te.value,
|
|
1772
|
+
getSelectedRowKeys: () => [...Z.selectedRowKeys.value],
|
|
1773
|
+
getSelectedRows: () => [...Z.selectedRows.value],
|
|
1753
1774
|
getTable: () => F.value,
|
|
1754
|
-
isLoading: () =>
|
|
1775
|
+
isLoading: () => je.value,
|
|
1755
1776
|
openCreate: Ke,
|
|
1756
1777
|
openEdit: qe,
|
|
1757
1778
|
openView: Je,
|
|
1758
1779
|
query: Re,
|
|
1759
1780
|
reset: ze,
|
|
1760
|
-
reload:
|
|
1761
|
-
removeRow:
|
|
1781
|
+
reload: Y.load,
|
|
1782
|
+
removeRow: tt,
|
|
1762
1783
|
removeSelectedRows: rt,
|
|
1763
|
-
setFormData: (e) =>
|
|
1784
|
+
setFormData: (e) => A.value?.setValues(e),
|
|
1764
1785
|
toggleFullscreen: He,
|
|
1765
|
-
toggleQuery:
|
|
1786
|
+
toggleQuery: X.toggle,
|
|
1766
1787
|
toggleQueryPanel: We
|
|
1767
1788
|
}), (t, n) => (C(), c("div", {
|
|
1768
1789
|
ref_key: "crudRef",
|
|
1769
1790
|
ref: b,
|
|
1770
1791
|
class: "lumal-crud-table"
|
|
1771
1792
|
}, [
|
|
1772
|
-
|
|
1793
|
+
fe.value ? ne((C(), c("div", {
|
|
1773
1794
|
key: 0,
|
|
1774
1795
|
ref_key: "queryRef",
|
|
1775
|
-
ref:
|
|
1776
|
-
class: v(["lumal-crud-table__query", { "is-collapsed":
|
|
1777
|
-
}, [f(
|
|
1796
|
+
ref: ee,
|
|
1797
|
+
class: v(["lumal-crud-table__query", { "is-collapsed": O(X).collapsed.value }])
|
|
1798
|
+
}, [f(O(J), {
|
|
1778
1799
|
ref_key: "queryFormRef",
|
|
1779
|
-
ref:
|
|
1800
|
+
ref: te,
|
|
1780
1801
|
modelValue: p.value,
|
|
1781
1802
|
"onUpdate:modelValue": n[0] ||= (e) => p.value = e,
|
|
1782
|
-
schemas:
|
|
1783
|
-
columns:
|
|
1803
|
+
schemas: O(X).visibleSchemas.value,
|
|
1804
|
+
columns: V.value,
|
|
1784
1805
|
"label-width": e.query?.labelWidth ?? 88,
|
|
1785
1806
|
class: "lumal-crud-table__query-form",
|
|
1786
1807
|
onValuesChange: Be
|
|
1787
|
-
}, u({ _: 2 }, [
|
|
1808
|
+
}, u({ _: 2 }, [w(O(X).visibleSchemas.value.filter((e) => t.$slots[`query-${String(e.field)}`]), (e) => ({
|
|
1788
1809
|
name: `field-${String(e.field)}`,
|
|
1789
|
-
fn: P((n) => [
|
|
1810
|
+
fn: P((n) => [T(t.$slots, `query-${String(e.field)}`, y(m(n)), void 0, !0)])
|
|
1790
1811
|
}))]), 1032, [
|
|
1791
1812
|
"modelValue",
|
|
1792
1813
|
"schemas",
|
|
1793
1814
|
"columns",
|
|
1794
1815
|
"label-width"
|
|
1795
|
-
]), l("div",
|
|
1796
|
-
f(
|
|
1816
|
+
]), l("div", ct, [
|
|
1817
|
+
f(O(R), {
|
|
1797
1818
|
type: "primary",
|
|
1798
1819
|
"native-type": "button",
|
|
1799
1820
|
"data-action": "search",
|
|
1800
1821
|
onClick: Re
|
|
1801
1822
|
}, {
|
|
1802
|
-
default: P(() => [d(
|
|
1823
|
+
default: P(() => [d(D(e.query?.searchText ?? e.searchText), 1)]),
|
|
1803
1824
|
_: 1
|
|
1804
1825
|
}),
|
|
1805
|
-
f(
|
|
1826
|
+
f(O(R), {
|
|
1806
1827
|
"native-type": "button",
|
|
1807
1828
|
"data-action": "reset",
|
|
1808
1829
|
onClick: ze
|
|
1809
1830
|
}, {
|
|
1810
|
-
default: P(() => [d(
|
|
1831
|
+
default: P(() => [d(D(e.query?.resetText ?? e.resetText), 1)]),
|
|
1811
1832
|
_: 1
|
|
1812
1833
|
}),
|
|
1813
|
-
|
|
1834
|
+
O(X).canCollapse.value ? (C(), o(O(R), {
|
|
1814
1835
|
key: 0,
|
|
1815
1836
|
"native-type": "button",
|
|
1816
1837
|
"data-action": "toggle-query",
|
|
1817
|
-
"aria-expanded": String(!
|
|
1818
|
-
onClick:
|
|
1838
|
+
"aria-expanded": String(!O(X).collapsed.value),
|
|
1839
|
+
onClick: O(X).toggle
|
|
1819
1840
|
}, {
|
|
1820
|
-
default: P(() => [d(O(
|
|
1841
|
+
default: P(() => [d(D(O(X).collapsed.value ? "展开" : "收起"), 1)]),
|
|
1821
1842
|
_: 1
|
|
1822
1843
|
}, 8, ["aria-expanded", "onClick"])) : s("", !0)
|
|
1823
|
-
])], 2)), [[M,
|
|
1824
|
-
|
|
1844
|
+
])], 2)), [[M, K.value]]) : s("", !0),
|
|
1845
|
+
O(Y).error.value ? (C(), c("div", lt, [l("span", null, D(O(Y).error.value), 1), f(O(R), {
|
|
1825
1846
|
"native-type": "button",
|
|
1826
1847
|
"data-action": "retry",
|
|
1827
|
-
onClick:
|
|
1848
|
+
onClick: O(Y).load
|
|
1828
1849
|
}, {
|
|
1829
1850
|
default: P(() => [...n[5] ||= [d(" 重试 ", -1)]]),
|
|
1830
1851
|
_: 1
|
|
1831
1852
|
}, 8, ["onClick"])])) : s("", !0),
|
|
1832
|
-
l("section",
|
|
1833
|
-
l("div",
|
|
1853
|
+
l("section", ut, [
|
|
1854
|
+
l("div", dt, [f(O(Qe), {
|
|
1834
1855
|
ref_key: "tableRef",
|
|
1835
1856
|
ref: F,
|
|
1836
1857
|
columns: ie.value,
|
|
1837
|
-
|
|
1858
|
+
page: h.value,
|
|
1859
|
+
"page-size": g.value,
|
|
1860
|
+
pagination: ue.value,
|
|
1861
|
+
rows: O(Y).currentRows.value,
|
|
1838
1862
|
"row-key": oe.value,
|
|
1839
1863
|
"empty-text": se.value,
|
|
1840
|
-
loading:
|
|
1864
|
+
loading: je.value,
|
|
1841
1865
|
selection: z.value,
|
|
1842
1866
|
"show-column-settings": e.table?.showColumnSettings,
|
|
1843
1867
|
"column-settings": e.table?.columnSettings,
|
|
@@ -1848,77 +1872,77 @@ var st = { class: "lumal-crud-table__query-actions" }, ct = {
|
|
|
1848
1872
|
height: "100%",
|
|
1849
1873
|
border: !0
|
|
1850
1874
|
},
|
|
1851
|
-
onSelectionChange:
|
|
1875
|
+
onSelectionChange: O(Z).update
|
|
1852
1876
|
}, u({ _: 2 }, [
|
|
1853
1877
|
t.$slots["table-title"] || e.title ? {
|
|
1854
1878
|
name: "toolbar-title",
|
|
1855
|
-
fn: P(() => [
|
|
1879
|
+
fn: P(() => [T(t.$slots, "table-title", {}, () => [d(D(e.title), 1)], !0)]),
|
|
1856
1880
|
key: "0"
|
|
1857
1881
|
} : void 0,
|
|
1858
|
-
|
|
1882
|
+
xe.value || t.$slots.actions || t.$slots["toolbar-actions"] ? {
|
|
1859
1883
|
name: "toolbar",
|
|
1860
1884
|
fn: P(() => [l("div", { class: v(["lumal-crud-table__toolbar", `is-${e.toolbar?.actionsPosition ?? "right"}`]) }, [
|
|
1861
|
-
|
|
1885
|
+
he.value ? T(t.$slots, "create-action", {
|
|
1862
1886
|
key: 0,
|
|
1863
1887
|
openCreate: Ke
|
|
1864
|
-
}, () => [f(
|
|
1888
|
+
}, () => [f(O(R), {
|
|
1865
1889
|
type: "primary",
|
|
1866
1890
|
"native-type": "button",
|
|
1867
1891
|
"data-action": "create",
|
|
1868
1892
|
onClick: Ke
|
|
1869
1893
|
}, {
|
|
1870
|
-
default: P(() => [f(
|
|
1894
|
+
default: P(() => [f(O(I), { name: "lumal:plus" }), d(" " + D(e.toolbar?.createText ?? e.createText), 1)]),
|
|
1871
1895
|
_: 1
|
|
1872
1896
|
})], !0) : s("", !0),
|
|
1873
|
-
|
|
1897
|
+
ge.value ? (C(), o(O(R), {
|
|
1874
1898
|
key: 1,
|
|
1875
1899
|
"native-type": "button",
|
|
1876
1900
|
"data-action": "batch-remove",
|
|
1877
|
-
disabled:
|
|
1901
|
+
disabled: O(Z).selectedRows.value.length === 0 || De.value,
|
|
1878
1902
|
onClick: rt
|
|
1879
1903
|
}, {
|
|
1880
|
-
default: P(() => [d(
|
|
1904
|
+
default: P(() => [d(D(e.toolbar?.batchDeleteText ?? e.batchDeleteText), 1)]),
|
|
1881
1905
|
_: 1
|
|
1882
1906
|
}, 8, ["disabled"])) : s("", !0),
|
|
1883
|
-
|
|
1907
|
+
ve.value ? (C(), o(O(R), {
|
|
1884
1908
|
key: 2,
|
|
1885
1909
|
"native-type": "button",
|
|
1886
1910
|
"data-action": "export",
|
|
1887
1911
|
onClick: Ve
|
|
1888
1912
|
}, {
|
|
1889
|
-
default: P(() => [d(
|
|
1913
|
+
default: P(() => [d(D(e.toolbar?.exportText ?? "导出"), 1)]),
|
|
1890
1914
|
_: 1
|
|
1891
1915
|
})) : s("", !0),
|
|
1892
|
-
|
|
1893
|
-
reload:
|
|
1916
|
+
T(t.$slots, "toolbar-actions", {
|
|
1917
|
+
reload: O(Y).load,
|
|
1894
1918
|
openCreate: Ke,
|
|
1895
|
-
selectedRows:
|
|
1896
|
-
selectedRowKeys:
|
|
1919
|
+
selectedRows: O(Z).selectedRows.value,
|
|
1920
|
+
selectedRowKeys: O(Z).selectedRowKeys.value,
|
|
1897
1921
|
clearSelection: bt
|
|
1898
1922
|
}, void 0, !0),
|
|
1899
|
-
|
|
1923
|
+
T(t.$slots, "actions", {}, void 0, !0)
|
|
1900
1924
|
], 2)]),
|
|
1901
1925
|
key: "1"
|
|
1902
1926
|
} : void 0,
|
|
1903
|
-
|
|
1927
|
+
Se.value || t.$slots["toolbar-tools"] ? {
|
|
1904
1928
|
name: "toolbar-tools",
|
|
1905
|
-
fn: P(() => [l("div",
|
|
1906
|
-
|
|
1907
|
-
reload:
|
|
1929
|
+
fn: P(() => [l("div", ft, [
|
|
1930
|
+
T(t.$slots, "toolbar-tools", {
|
|
1931
|
+
reload: O(Y).load,
|
|
1908
1932
|
toggleFullscreen: He
|
|
1909
1933
|
}, void 0, !0),
|
|
1910
|
-
|
|
1934
|
+
be.value ? (C(), o(O(R), {
|
|
1911
1935
|
key: 0,
|
|
1912
1936
|
circle: "",
|
|
1913
1937
|
"native-type": "button",
|
|
1914
1938
|
"data-action": "toggle-query-panel",
|
|
1915
|
-
class: v({ "is-active":
|
|
1916
|
-
"aria-expanded": String(
|
|
1917
|
-
"aria-label":
|
|
1918
|
-
title:
|
|
1939
|
+
class: v({ "is-active": K.value }),
|
|
1940
|
+
"aria-expanded": String(K.value),
|
|
1941
|
+
"aria-label": K.value ? "隐藏筛选条件" : "显示筛选条件",
|
|
1942
|
+
title: K.value ? "隐藏筛选条件" : "显示筛选条件",
|
|
1919
1943
|
onClick: We
|
|
1920
1944
|
}, {
|
|
1921
|
-
default: P(() => [f(
|
|
1945
|
+
default: P(() => [f(O(I), { name: "lumal:filter" })]),
|
|
1922
1946
|
_: 1
|
|
1923
1947
|
}, 8, [
|
|
1924
1948
|
"class",
|
|
@@ -1926,33 +1950,33 @@ var st = { class: "lumal-crud-table__query-actions" }, ct = {
|
|
|
1926
1950
|
"aria-label",
|
|
1927
1951
|
"title"
|
|
1928
1952
|
])) : s("", !0),
|
|
1929
|
-
|
|
1953
|
+
_e.value ? (C(), o(O(R), {
|
|
1930
1954
|
key: 1,
|
|
1931
1955
|
circle: "",
|
|
1932
1956
|
"native-type": "button",
|
|
1933
1957
|
"data-action": "refresh",
|
|
1934
1958
|
"aria-label": e.toolbar?.refreshText ?? "刷新",
|
|
1935
1959
|
title: e.toolbar?.refreshText ?? "刷新",
|
|
1936
|
-
onClick:
|
|
1960
|
+
onClick: O(Y).load
|
|
1937
1961
|
}, {
|
|
1938
|
-
default: P(() => [f(
|
|
1962
|
+
default: P(() => [f(O(I), { name: "lumal:refresh" })]),
|
|
1939
1963
|
_: 1
|
|
1940
1964
|
}, 8, [
|
|
1941
1965
|
"aria-label",
|
|
1942
1966
|
"title",
|
|
1943
1967
|
"onClick"
|
|
1944
1968
|
])) : s("", !0),
|
|
1945
|
-
|
|
1969
|
+
ye.value ? (C(), o(O(R), {
|
|
1946
1970
|
key: 2,
|
|
1947
1971
|
circle: "",
|
|
1948
1972
|
"native-type": "button",
|
|
1949
1973
|
"data-action": "fullscreen",
|
|
1950
|
-
"aria-label": e.toolbar?.fullscreenText ?? (
|
|
1951
|
-
title: e.toolbar?.fullscreenText ?? (
|
|
1974
|
+
"aria-label": e.toolbar?.fullscreenText ?? (U.value ? "退出全屏" : "全屏"),
|
|
1975
|
+
title: e.toolbar?.fullscreenText ?? (U.value ? "退出全屏" : "全屏"),
|
|
1952
1976
|
onClick: He
|
|
1953
1977
|
}, {
|
|
1954
|
-
default: P(() => [f(
|
|
1955
|
-
name:
|
|
1978
|
+
default: P(() => [f(O(I), {
|
|
1979
|
+
name: U.value ? "lumal:fullscreen-exit" : "lumal:fullscreen",
|
|
1956
1980
|
morph: ""
|
|
1957
1981
|
}, null, 8, ["name"])]),
|
|
1958
1982
|
_: 1
|
|
@@ -1960,45 +1984,45 @@ var st = { class: "lumal-crud-table__query-actions" }, ct = {
|
|
|
1960
1984
|
])]),
|
|
1961
1985
|
key: "2"
|
|
1962
1986
|
} : void 0,
|
|
1963
|
-
|
|
1987
|
+
w(ie.value.filter((e) => t.$slots[`table-${String(e.field)}`]), (e) => ({
|
|
1964
1988
|
name: `table-${String(e.field)}`,
|
|
1965
|
-
fn: P((n) => [
|
|
1989
|
+
fn: P((n) => [T(t.$slots, `table-${String(e.field)}`, y(m(n)), void 0, !0)])
|
|
1966
1990
|
})),
|
|
1967
|
-
|
|
1991
|
+
me.value || Te.value?.remove || t.$slots["row-actions"] ? {
|
|
1968
1992
|
name: "actions",
|
|
1969
|
-
fn: P(({ row: n, index: r }) => [
|
|
1993
|
+
fn: P(({ row: n, index: r }) => [T(t.$slots, "row-actions", {
|
|
1970
1994
|
row: n,
|
|
1971
1995
|
index: r,
|
|
1972
1996
|
openView: Je,
|
|
1973
1997
|
openEdit: qe,
|
|
1974
|
-
removeRow:
|
|
1998
|
+
removeRow: tt
|
|
1975
1999
|
}, () => [
|
|
1976
|
-
Ge(e.actions?.view,
|
|
2000
|
+
Ge(e.actions?.view, me.value, n, r) ? (C(), o(O(R), {
|
|
1977
2001
|
key: 0,
|
|
1978
2002
|
"native-type": "button",
|
|
1979
2003
|
"data-action": "view",
|
|
1980
2004
|
onClick: (e) => Je(n)
|
|
1981
2005
|
}, {
|
|
1982
|
-
default: P(() => [d(
|
|
2006
|
+
default: P(() => [d(D(e.actions?.viewText ?? "查看"), 1)]),
|
|
1983
2007
|
_: 1
|
|
1984
2008
|
}, 8, ["onClick"])) : s("", !0),
|
|
1985
|
-
Ge(e.actions?.edit,
|
|
2009
|
+
Ge(e.actions?.edit, me.value, n, r) ? (C(), o(O(R), {
|
|
1986
2010
|
key: 1,
|
|
1987
2011
|
"native-type": "button",
|
|
1988
2012
|
"data-action": "edit",
|
|
1989
2013
|
onClick: (e) => qe(n)
|
|
1990
2014
|
}, {
|
|
1991
|
-
default: P(() => [d(
|
|
2015
|
+
default: P(() => [d(D(e.actions?.editText ?? "编辑"), 1)]),
|
|
1992
2016
|
_: 1
|
|
1993
2017
|
}, 8, ["onClick"])) : s("", !0),
|
|
1994
|
-
Ge(e.actions?.remove, !!
|
|
2018
|
+
Ge(e.actions?.remove, !!Te.value?.remove, n, r) ? (C(), o(O(R), {
|
|
1995
2019
|
key: 2,
|
|
1996
2020
|
type: "danger",
|
|
1997
2021
|
"native-type": "button",
|
|
1998
2022
|
"data-action": "remove",
|
|
1999
|
-
onClick: (e) =>
|
|
2023
|
+
onClick: (e) => tt(n)
|
|
2000
2024
|
}, {
|
|
2001
|
-
default: P(() => [d(
|
|
2025
|
+
default: P(() => [d(D(e.actions?.removeText ?? "删除"), 1)]),
|
|
2002
2026
|
_: 1
|
|
2003
2027
|
}, 8, ["onClick"])) : s("", !0)
|
|
2004
2028
|
], !0)]),
|
|
@@ -2006,6 +2030,9 @@ var st = { class: "lumal-crud-table__query-actions" }, ct = {
|
|
|
2006
2030
|
} : void 0
|
|
2007
2031
|
]), 1032, [
|
|
2008
2032
|
"columns",
|
|
2033
|
+
"page",
|
|
2034
|
+
"page-size",
|
|
2035
|
+
"pagination",
|
|
2009
2036
|
"rows",
|
|
2010
2037
|
"row-key",
|
|
2011
2038
|
"empty-text",
|
|
@@ -2018,14 +2045,14 @@ var st = { class: "lumal-crud-table__query-actions" }, ct = {
|
|
|
2018
2045
|
"mobile-action-width",
|
|
2019
2046
|
"onSelectionChange"
|
|
2020
2047
|
])]),
|
|
2021
|
-
t.$slots.default ? (C(), c("div",
|
|
2022
|
-
|
|
2048
|
+
t.$slots.default ? (C(), c("div", pt, [T(t.$slots, "default", {}, void 0, !0)])) : s("", !0),
|
|
2049
|
+
Me.value ? (C(), c("div", mt, [f(O(Ee), {
|
|
2023
2050
|
page: h.value,
|
|
2024
2051
|
"onUpdate:page": n[1] ||= (e) => h.value = e,
|
|
2025
2052
|
"page-size": g.value,
|
|
2026
2053
|
"onUpdate:pageSize": n[2] ||= (e) => g.value = e,
|
|
2027
|
-
total:
|
|
2028
|
-
"page-sizes":
|
|
2054
|
+
total: O(Y).currentTotal.value,
|
|
2055
|
+
"page-sizes": de.value,
|
|
2029
2056
|
onChange: Ue
|
|
2030
2057
|
}, null, 8, [
|
|
2031
2058
|
"page",
|
|
@@ -2034,54 +2061,54 @@ var st = { class: "lumal-crud-table__query-actions" }, ct = {
|
|
|
2034
2061
|
"page-sizes"
|
|
2035
2062
|
])])) : s("", !0)
|
|
2036
2063
|
]),
|
|
2037
|
-
f(
|
|
2038
|
-
modelValue:
|
|
2039
|
-
"onUpdate:modelValue": n[4] ||= (e) =>
|
|
2040
|
-
title:
|
|
2064
|
+
f($e, {
|
|
2065
|
+
modelValue: O(Q).visible.value,
|
|
2066
|
+
"onUpdate:modelValue": n[4] ||= (e) => O(Q).visible.value = e,
|
|
2067
|
+
title: $.value,
|
|
2041
2068
|
type: e.editor?.type ?? "dialog",
|
|
2042
2069
|
width: e.editor?.width ?? (e.editor?.type === "drawer" ? "min(720px, 92vw)" : "min(920px, calc(100vw - 32px))"),
|
|
2043
2070
|
"close-on-click-modal": e.editor?.closeOnClickModal ?? !1,
|
|
2044
2071
|
"destroy-on-close": e.editor?.destroyOnClose ?? !0,
|
|
2045
2072
|
"before-close": _t
|
|
2046
2073
|
}, {
|
|
2047
|
-
footer: P(() => [
|
|
2048
|
-
mode:
|
|
2049
|
-
model:
|
|
2074
|
+
footer: P(() => [T(t.$slots, "footer", {
|
|
2075
|
+
mode: O(Q).mode.value,
|
|
2076
|
+
model: O(Q).model.value,
|
|
2050
2077
|
close: vt,
|
|
2051
2078
|
submit: yt
|
|
2052
|
-
}, () => [l("div",
|
|
2079
|
+
}, () => [l("div", gt, [f(O(R), {
|
|
2053
2080
|
"native-type": "button",
|
|
2054
2081
|
onClick: vt
|
|
2055
2082
|
}, {
|
|
2056
|
-
default: P(() => [d(O(
|
|
2083
|
+
default: P(() => [d(D(O(Q).mode.value === "view" ? "关闭" : "取消"), 1)]),
|
|
2057
2084
|
_: 1
|
|
2058
|
-
}),
|
|
2085
|
+
}), O(Q).mode.value === "view" ? s("", !0) : (C(), o(O(R), {
|
|
2059
2086
|
key: 0,
|
|
2060
2087
|
type: "primary",
|
|
2061
2088
|
"native-type": "button",
|
|
2062
|
-
loading:
|
|
2089
|
+
loading: O(Q).saving.value,
|
|
2063
2090
|
onClick: yt
|
|
2064
2091
|
}, {
|
|
2065
|
-
default: P(() => [d(
|
|
2092
|
+
default: P(() => [d(D(e.editor?.submitText ?? "保存"), 1)]),
|
|
2066
2093
|
_: 1
|
|
2067
2094
|
}, 8, ["loading"]))])], !0)]),
|
|
2068
|
-
default: P(() => [
|
|
2095
|
+
default: P(() => [O(Q).error.value ? (C(), c("div", ht, D(O(Q).error.value), 1)) : s("", !0), f(O(J), {
|
|
2069
2096
|
ref_key: "dialogFormRef",
|
|
2070
|
-
ref:
|
|
2071
|
-
modelValue:
|
|
2072
|
-
"onUpdate:modelValue": n[3] ||= (e) =>
|
|
2073
|
-
mode:
|
|
2097
|
+
ref: A,
|
|
2098
|
+
modelValue: O(Q).model.value,
|
|
2099
|
+
"onUpdate:modelValue": n[3] ||= (e) => O(Q).model.value = e,
|
|
2100
|
+
mode: O(Q).mode.value,
|
|
2074
2101
|
schemas: ae.value,
|
|
2075
2102
|
columns: e.editor?.columns ?? 2,
|
|
2076
2103
|
"label-width": e.editor?.labelWidth ?? 88,
|
|
2077
2104
|
loading: e.editor?.loading,
|
|
2078
|
-
disabled:
|
|
2079
|
-
"submit-loading":
|
|
2105
|
+
disabled: O(Q).saving.value || e.editor?.disabled,
|
|
2106
|
+
"submit-loading": O(Q).saving.value,
|
|
2080
2107
|
"show-actions": !1,
|
|
2081
2108
|
onSubmit: Ye
|
|
2082
|
-
}, u({ _: 2 }, [
|
|
2109
|
+
}, u({ _: 2 }, [w(ae.value.filter((e) => t.$slots[`form-${String(e.field)}`]), (e) => ({
|
|
2083
2110
|
name: `field-${String(e.field)}`,
|
|
2084
|
-
fn: P((n) => [
|
|
2111
|
+
fn: P((n) => [T(t.$slots, `form-${String(e.field)}`, y(m(n)), void 0, !0)])
|
|
2085
2112
|
}))]), 1032, [
|
|
2086
2113
|
"modelValue",
|
|
2087
2114
|
"mode",
|
|
@@ -2103,7 +2130,7 @@ var st = { class: "lumal-crud-table__query-actions" }, ct = {
|
|
|
2103
2130
|
])
|
|
2104
2131
|
], 512));
|
|
2105
2132
|
}
|
|
2106
|
-
}), [["__scopeId", "data-v-
|
|
2133
|
+
}), [["__scopeId", "data-v-8f16b57f"]]), vt = { class: "lumal-info-table__value" }, yt = /*#__PURE__*/ r(/* @__PURE__ */ p({
|
|
2107
2134
|
__name: "LumalInfoTable",
|
|
2108
2135
|
props: {
|
|
2109
2136
|
items: {},
|
|
@@ -2128,31 +2155,31 @@ var st = { class: "lumal-crud-table__query-actions" }, ct = {
|
|
|
2128
2155
|
ref: r,
|
|
2129
2156
|
class: v(["lumal-info-table", { "lumal-info-table--bordered": e.bordered }]),
|
|
2130
2157
|
style: b(s.value)
|
|
2131
|
-
}, [(C(!0), c(i, null,
|
|
2158
|
+
}, [(C(!0), c(i, null, w(o.value, (e) => (C(), c("div", {
|
|
2132
2159
|
key: e.label,
|
|
2133
2160
|
class: "lumal-info-table__item",
|
|
2134
2161
|
style: b({ gridColumn: `span ${f(e)}` })
|
|
2135
2162
|
}, [l("dt", {
|
|
2136
2163
|
class: "lumal-info-table__label",
|
|
2137
2164
|
style: b(u.value)
|
|
2138
|
-
},
|
|
2165
|
+
}, D(e.label), 5), l("dd", vt, D(d(e)), 1)], 4))), 128))], 6));
|
|
2139
2166
|
}
|
|
2140
|
-
}), [["__scopeId", "data-v-3dfbcf43"]]),
|
|
2167
|
+
}), [["__scopeId", "data-v-3dfbcf43"]]), bt = {
|
|
2141
2168
|
key: 0,
|
|
2142
2169
|
class: "lumal-page__header"
|
|
2143
|
-
},
|
|
2170
|
+
}, xt = { class: "lumal-page__heading" }, St = {
|
|
2144
2171
|
key: 0,
|
|
2145
2172
|
class: "lumal-page__title"
|
|
2146
|
-
},
|
|
2173
|
+
}, Ct = {
|
|
2147
2174
|
key: 0,
|
|
2148
2175
|
class: "lumal-page__description"
|
|
2149
|
-
},
|
|
2176
|
+
}, wt = {
|
|
2150
2177
|
key: 0,
|
|
2151
2178
|
class: "lumal-page__actions"
|
|
2152
|
-
},
|
|
2179
|
+
}, Tt = {
|
|
2153
2180
|
key: 1,
|
|
2154
2181
|
class: "lumal-page__loading"
|
|
2155
|
-
},
|
|
2182
|
+
}, Et = /*#__PURE__*/ r(/* @__PURE__ */ p({
|
|
2156
2183
|
__name: "LumalPage",
|
|
2157
2184
|
props: {
|
|
2158
2185
|
title: {},
|
|
@@ -2182,21 +2209,21 @@ var st = { class: "lumal-crud-table__query-actions" }, ct = {
|
|
|
2182
2209
|
"is-no-padding": e.noPadding
|
|
2183
2210
|
}])
|
|
2184
2211
|
}, [
|
|
2185
|
-
o.value ? (C(), c("header",
|
|
2186
|
-
l("div", { class: v(["lumal-page__body", e.contentClass]) }, [
|
|
2187
|
-
e.loading ? (C(), c("div",
|
|
2212
|
+
o.value ? (C(), c("header", bt, [l("div", xt, [T(t.$slots, "title", {}, () => [e.title ? (C(), c("h2", St, D(e.title), 1)) : s("", !0)], !0), e.description ? (C(), c("p", Ct, D(e.description), 1)) : s("", !0)]), t.$slots.actions ? (C(), c("div", wt, [T(t.$slots, "actions", {}, void 0, !0)])) : s("", !0)])) : s("", !0),
|
|
2213
|
+
l("div", { class: v(["lumal-page__body", e.contentClass]) }, [T(t.$slots, "default", {}, void 0, !0)], 2),
|
|
2214
|
+
e.loading ? (C(), c("div", Tt, D(e.loadingText), 1)) : s("", !0)
|
|
2188
2215
|
], 2));
|
|
2189
2216
|
}
|
|
2190
|
-
}), [["__scopeId", "data-v-c57520b6"]]),
|
|
2217
|
+
}), [["__scopeId", "data-v-c57520b6"]]), Dt = {
|
|
2191
2218
|
key: 0,
|
|
2192
2219
|
class: "lumal-page-layout__query"
|
|
2193
|
-
},
|
|
2220
|
+
}, Ot = { class: "lumal-page-layout__query-body" }, kt = { class: "lumal-page-layout__query-actions" }, At = {
|
|
2194
2221
|
key: 1,
|
|
2195
2222
|
class: "lumal-page-layout__toolbar"
|
|
2196
|
-
},
|
|
2223
|
+
}, jt = { class: "lumal-page-layout__content" }, Mt = {
|
|
2197
2224
|
key: 2,
|
|
2198
2225
|
class: "lumal-page-layout__pagination"
|
|
2199
|
-
},
|
|
2226
|
+
}, Nt = /*#__PURE__*/ r(/* @__PURE__ */ p({
|
|
2200
2227
|
__name: "LumalPageLayout",
|
|
2201
2228
|
props: {
|
|
2202
2229
|
contentScrollable: {
|
|
@@ -2236,27 +2263,27 @@ var st = { class: "lumal-crud-table__query-actions" }, ct = {
|
|
|
2236
2263
|
"is-surface": e.surface
|
|
2237
2264
|
}])
|
|
2238
2265
|
}, [
|
|
2239
|
-
p.value ? (C(), c("div",
|
|
2266
|
+
p.value ? (C(), c("div", Dt, [ne(l("div", Ot, [T(t.$slots, "query", {}, () => [T(t.$slots, "form", {}, void 0, !0)], !0)], 512), [[M, !r.queryCollapsed]]), l("div", kt, [f(O(R), {
|
|
2240
2267
|
type: "primary",
|
|
2241
2268
|
"native-type": "button",
|
|
2242
2269
|
"data-action": "search",
|
|
2243
2270
|
onClick: g
|
|
2244
2271
|
}, {
|
|
2245
|
-
default: P(() => [d(
|
|
2272
|
+
default: P(() => [d(D(r.searchText), 1)]),
|
|
2246
2273
|
_: 1
|
|
2247
|
-
}), f(
|
|
2274
|
+
}), f(O(R), {
|
|
2248
2275
|
"native-type": "button",
|
|
2249
2276
|
"data-action": "reset",
|
|
2250
2277
|
onClick: _
|
|
2251
2278
|
}, {
|
|
2252
|
-
default: P(() => [d(
|
|
2279
|
+
default: P(() => [d(D(r.resetText), 1)]),
|
|
2253
2280
|
_: 1
|
|
2254
2281
|
})])])) : s("", !0),
|
|
2255
|
-
m.value ? (C(), c("div",
|
|
2256
|
-
l("div",
|
|
2257
|
-
h.value ? (C(), c("div",
|
|
2282
|
+
m.value ? (C(), c("div", At, [T(t.$slots, "toolbar", {}, void 0, !0)])) : s("", !0),
|
|
2283
|
+
l("div", jt, [T(t.$slots, "default", {}, void 0, !0)]),
|
|
2284
|
+
h.value ? (C(), c("div", Mt, [T(t.$slots, "pagination", {}, void 0, !0)])) : s("", !0)
|
|
2258
2285
|
], 2));
|
|
2259
2286
|
}
|
|
2260
2287
|
}), [["__scopeId", "data-v-d4b9bb06"]]);
|
|
2261
2288
|
//#endregion
|
|
2262
|
-
export {
|
|
2289
|
+
export { Et as a, et as c, Ee as d, Nt as i, Qe as l, ie as n, yt as o, ae as r, _t as s, L as t, J as u };
|