@me-framework/me-ui-antdv-next 0.0.35 → 0.0.36
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/README.md +160 -54
- package/dist/input-property/index.js +334 -321
- package/dist/me-ui-antdv-next.js +402 -389
- package/dist/me-ui-antdv-next.umd.cjs +10 -10
- package/package.json +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import e from "../icon/index.js";
|
|
2
2
|
import t from "../modal/index.js";
|
|
3
|
-
import { Fragment as n, computed as r, createBlock as i, createCommentVNode as a, createElementBlock as o, createElementVNode as
|
|
4
|
-
import { message as
|
|
5
|
-
import { useDraggable as
|
|
6
|
-
import
|
|
3
|
+
import { Fragment as n, computed as r, createBlock as i, createCommentVNode as a, createElementBlock as o, createElementVNode as ee, createTextVNode as te, createVNode as s, defineComponent as c, guardReactiveProps as ne, nextTick as l, normalizeClass as re, normalizeProps as ie, onMounted as u, openBlock as d, reactive as f, ref as p, resolveComponent as m, resolveDynamicComponent as ae, unref as h, watch as g, withCtx as _ } from "vue";
|
|
4
|
+
import { message as v } from "antdv-next";
|
|
5
|
+
import { useDraggable as y } from "vue-draggable-plus";
|
|
6
|
+
import b from "dayjs";
|
|
7
7
|
//#region src/components/input-property/types.ts
|
|
8
|
-
var
|
|
8
|
+
var x = [
|
|
9
9
|
{
|
|
10
10
|
label: "字符串",
|
|
11
11
|
value: "string"
|
|
@@ -30,7 +30,7 @@ var C = [
|
|
|
30
30
|
label: "时间",
|
|
31
31
|
value: "time"
|
|
32
32
|
}
|
|
33
|
-
],
|
|
33
|
+
], S = 2, C = "YYYY-MM-DD", w = "HH:mm:ss", oe = [{
|
|
34
34
|
label: "是",
|
|
35
35
|
value: !0
|
|
36
36
|
}, {
|
|
@@ -39,70 +39,70 @@ var C = [
|
|
|
39
39
|
}];
|
|
40
40
|
//#endregion
|
|
41
41
|
//#region src/components/input-property/validate.ts
|
|
42
|
-
function
|
|
42
|
+
function T() {
|
|
43
43
|
return `${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 8)}`;
|
|
44
44
|
}
|
|
45
|
-
var
|
|
46
|
-
function
|
|
45
|
+
var E = /^\d{4}-\d{2}-\d{2}$/, D = /^(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d)?$/;
|
|
46
|
+
function O(e) {
|
|
47
47
|
return Math.round((e + 2 ** -52) * 100) / 100;
|
|
48
48
|
}
|
|
49
|
-
function
|
|
49
|
+
function k(e) {
|
|
50
50
|
if (typeof e == "number") return Number.isInteger(e) ? "int" : "float";
|
|
51
51
|
if (typeof e == "boolean") return "boolean";
|
|
52
52
|
if (typeof e == "string") {
|
|
53
|
-
if (
|
|
54
|
-
if (
|
|
53
|
+
if (E.test(e)) return "date";
|
|
54
|
+
if (D.test(e)) return "time";
|
|
55
55
|
}
|
|
56
56
|
return "string";
|
|
57
57
|
}
|
|
58
|
-
function
|
|
59
|
-
return t === "string" ? e == null ? "" : String(e) : t === "boolean" ?
|
|
58
|
+
function se(e, t) {
|
|
59
|
+
return t === "string" ? e == null ? "" : String(e) : t === "boolean" ? N(e) : t === "int" || t === "float" ? A(e, t === "float") : ce(e, t === "date" ? C : w);
|
|
60
60
|
}
|
|
61
|
-
function
|
|
61
|
+
function A(e, t) {
|
|
62
62
|
if (e == null) return "";
|
|
63
|
-
let n = (e) => t ?
|
|
63
|
+
let n = (e) => t ? O(e) : e;
|
|
64
64
|
if (typeof e == "number") return n(e);
|
|
65
65
|
let r = String(e).trim();
|
|
66
66
|
if (r === "") return "";
|
|
67
67
|
let i = Number(r);
|
|
68
68
|
return Number.isNaN(i) ? e : n(i);
|
|
69
69
|
}
|
|
70
|
-
function
|
|
70
|
+
function j(e, t) {
|
|
71
71
|
if (t === "string") return e;
|
|
72
|
-
if (t === "boolean") return
|
|
73
|
-
if (t === "int" || t === "float") return
|
|
74
|
-
let n = t === "date" ?
|
|
75
|
-
return e == null || e === "" ? "" :
|
|
72
|
+
if (t === "boolean") return N(e);
|
|
73
|
+
if (t === "int" || t === "float") return M(e, t === "float");
|
|
74
|
+
let n = t === "date" ? C : w;
|
|
75
|
+
return e == null || e === "" ? "" : b.isDayjs(e) ? e.format(n) : typeof e == "string" ? e : "";
|
|
76
76
|
}
|
|
77
|
-
function
|
|
77
|
+
function M(e, t) {
|
|
78
78
|
if (e == null) return e;
|
|
79
|
-
let n = (e) => t ?
|
|
79
|
+
let n = (e) => t ? O(e) : e;
|
|
80
80
|
if (typeof e == "number") return n(e);
|
|
81
81
|
let r = String(e).trim();
|
|
82
82
|
if (r === "") return "";
|
|
83
83
|
let i = Number(r);
|
|
84
84
|
return Number.isNaN(i) ? e : n(i);
|
|
85
85
|
}
|
|
86
|
-
function
|
|
86
|
+
function N(e) {
|
|
87
87
|
if (typeof e == "boolean") return e;
|
|
88
88
|
if (e == null || e === "") return !1;
|
|
89
89
|
if (typeof e == "number") return e !== 0;
|
|
90
90
|
let t = String(e).trim().toLowerCase();
|
|
91
91
|
return t === "true" || t === "1" || t === "yes" || t === "on";
|
|
92
92
|
}
|
|
93
|
-
function
|
|
93
|
+
function ce(e, t) {
|
|
94
94
|
if (e == null || e === "") return "";
|
|
95
|
-
if (
|
|
96
|
-
let n =
|
|
95
|
+
if (b.isDayjs(e)) return e.format(t);
|
|
96
|
+
let n = b(e);
|
|
97
97
|
return n.isValid() ? n.format(t) : e;
|
|
98
98
|
}
|
|
99
|
-
function
|
|
99
|
+
function P(e) {
|
|
100
100
|
return e.trim().toLowerCase();
|
|
101
101
|
}
|
|
102
|
-
function
|
|
102
|
+
function le(e) {
|
|
103
103
|
let t = /* @__PURE__ */ new Map(), n = [];
|
|
104
104
|
for (let r of e) {
|
|
105
|
-
let e =
|
|
105
|
+
let e = P(r.key);
|
|
106
106
|
if (e) {
|
|
107
107
|
if (t.has(e)) {
|
|
108
108
|
let i = t.get(e);
|
|
@@ -114,12 +114,12 @@ function se(e) {
|
|
|
114
114
|
}
|
|
115
115
|
return n;
|
|
116
116
|
}
|
|
117
|
-
function
|
|
117
|
+
function ue(e, t) {
|
|
118
118
|
if (!e) return !1;
|
|
119
|
-
let n =
|
|
120
|
-
return t.some((e) =>
|
|
119
|
+
let n = P(e);
|
|
120
|
+
return t.some((e) => P(e) === n);
|
|
121
121
|
}
|
|
122
|
-
var
|
|
122
|
+
var de = {
|
|
123
123
|
minLength: ["string"],
|
|
124
124
|
maxLength: ["string"],
|
|
125
125
|
pattern: ["string"],
|
|
@@ -135,93 +135,93 @@ var le = {
|
|
|
135
135
|
"date",
|
|
136
136
|
"time"
|
|
137
137
|
]
|
|
138
|
-
},
|
|
139
|
-
function
|
|
140
|
-
if (
|
|
141
|
-
let n =
|
|
138
|
+
}, fe = ["required", "message"];
|
|
139
|
+
function F(e, t) {
|
|
140
|
+
if (fe.includes(e)) return !0;
|
|
141
|
+
let n = de[e];
|
|
142
142
|
return n ? n.includes(t) : !1;
|
|
143
143
|
}
|
|
144
|
-
function
|
|
144
|
+
function I(e) {
|
|
145
145
|
return typeof e == "number" && Number.isFinite(e);
|
|
146
146
|
}
|
|
147
|
-
function
|
|
147
|
+
function L(e) {
|
|
148
148
|
if (!e) return;
|
|
149
149
|
let t = {};
|
|
150
|
-
return e.required === !0 && (t.required = !0),
|
|
150
|
+
return e.required === !0 && (t.required = !0), I(e.minLength) && (t.minLength = e.minLength), I(e.maxLength) && (t.maxLength = e.maxLength), typeof e.pattern == "string" && e.pattern.trim() !== "" && (t.pattern = e.pattern), (I(e.min) || typeof e.min == "string" && e.min.trim() !== "") && (t.min = e.min), (I(e.max) || typeof e.max == "string" && e.max.trim() !== "") && (t.max = e.max), typeof e.message == "string" && e.message.trim() !== "" && (t.message = e.message), Object.keys(t).length > 0 ? t : void 0;
|
|
151
151
|
}
|
|
152
|
-
function
|
|
152
|
+
function pe(e, t) {
|
|
153
153
|
if (!e) return;
|
|
154
154
|
let n = {};
|
|
155
|
-
return e.required === !0 && (n.required = !0), typeof e.message == "string" && e.message.trim() !== "" && (n.message = e.message), t === "string" ? (
|
|
155
|
+
return e.required === !0 && (n.required = !0), typeof e.message == "string" && e.message.trim() !== "" && (n.message = e.message), t === "string" ? (I(e.minLength) && (n.minLength = e.minLength), I(e.maxLength) && (n.maxLength = e.maxLength), typeof e.pattern == "string" && e.pattern.trim() !== "" && (n.pattern = e.pattern)) : (t === "int" || t === "float" || t === "date" || t === "time") && ((I(e.min) || typeof e.min == "string" && e.min.trim() !== "") && (n.min = e.min), (I(e.max) || typeof e.max == "string" && e.max.trim() !== "") && (n.max = e.max)), L(n);
|
|
156
156
|
}
|
|
157
|
-
function
|
|
157
|
+
function R(e, t) {
|
|
158
158
|
return typeof e.message == "string" && e.message.trim() !== "" ? e.message : t;
|
|
159
159
|
}
|
|
160
|
-
function
|
|
161
|
-
let r =
|
|
160
|
+
function z(e, t, n) {
|
|
161
|
+
let r = L(n);
|
|
162
162
|
if (!r) return null;
|
|
163
163
|
let i = e === "" || e == null;
|
|
164
|
-
if (r.required && i) return
|
|
164
|
+
if (r.required && i) return R(r, "不能为空");
|
|
165
165
|
if (t === "string") {
|
|
166
166
|
if (typeof e != "string" || i) return null;
|
|
167
|
-
if (r.minLength != null && e.length < r.minLength) return
|
|
168
|
-
if (r.maxLength != null && e.length > r.maxLength) return
|
|
167
|
+
if (r.minLength != null && e.length < r.minLength) return R(r, `最短长度不能小于 ${r.minLength}`);
|
|
168
|
+
if (r.maxLength != null && e.length > r.maxLength) return R(r, `最大长度不能大于 ${r.maxLength}`);
|
|
169
169
|
if (r.pattern) {
|
|
170
170
|
let t = null;
|
|
171
171
|
try {
|
|
172
172
|
t = new RegExp(r.pattern);
|
|
173
173
|
} catch {}
|
|
174
|
-
if (t && !t.test(e)) return
|
|
174
|
+
if (t && !t.test(e)) return R(r, "格式不正确");
|
|
175
175
|
}
|
|
176
176
|
}
|
|
177
177
|
if (t === "int" || t === "float") {
|
|
178
178
|
if (i) return null;
|
|
179
179
|
let t = Number(e);
|
|
180
180
|
if (Number.isNaN(t)) return null;
|
|
181
|
-
if (r.min != null && t < Number(r.min)) return
|
|
182
|
-
if (r.max != null && t > Number(r.max)) return
|
|
181
|
+
if (r.min != null && t < Number(r.min)) return R(r, `不能小于 ${r.min}`);
|
|
182
|
+
if (r.max != null && t > Number(r.max)) return R(r, `不能大于 ${r.max}`);
|
|
183
183
|
}
|
|
184
184
|
if (t === "date" || t === "time") {
|
|
185
185
|
if (i) return null;
|
|
186
186
|
let t = String(e);
|
|
187
|
-
if (r.min != null && t < String(r.min)) return
|
|
188
|
-
if (r.max != null && t > String(r.max)) return
|
|
187
|
+
if (r.min != null && t < String(r.min)) return R(r, `不能早于 ${r.min}`);
|
|
188
|
+
if (r.max != null && t > String(r.max)) return R(r, `不能晚于 ${r.max}`);
|
|
189
189
|
}
|
|
190
190
|
return null;
|
|
191
191
|
}
|
|
192
|
-
function
|
|
192
|
+
function B(e) {
|
|
193
193
|
let t = {};
|
|
194
194
|
for (let n of e) {
|
|
195
195
|
let e = n.key.trim();
|
|
196
196
|
if (!e) continue;
|
|
197
|
-
let r =
|
|
197
|
+
let r = L(n.rules);
|
|
198
198
|
r && (t[e] = r);
|
|
199
199
|
}
|
|
200
200
|
return t;
|
|
201
201
|
}
|
|
202
|
-
function
|
|
203
|
-
return
|
|
202
|
+
function V(e, t, n) {
|
|
203
|
+
return z(e, t, n);
|
|
204
204
|
}
|
|
205
|
-
function
|
|
205
|
+
function H(e) {
|
|
206
206
|
let t = {};
|
|
207
207
|
for (let n of e) {
|
|
208
208
|
let e = n.key.trim();
|
|
209
209
|
if (!e) continue;
|
|
210
|
-
let r =
|
|
210
|
+
let r = V(n.value, n.type, n.rules);
|
|
211
211
|
r && (t[e] = r);
|
|
212
212
|
}
|
|
213
213
|
return t;
|
|
214
214
|
}
|
|
215
215
|
//#endregion
|
|
216
216
|
//#region src/components/input-property/index.vue?vue&type=script&setup=true&lang.ts
|
|
217
|
-
var
|
|
217
|
+
var me = {
|
|
218
218
|
key: 0,
|
|
219
219
|
class: "me-input-property__actions"
|
|
220
|
-
},
|
|
220
|
+
}, he = {
|
|
221
221
|
key: 0,
|
|
222
222
|
class: "me-input-property__drag",
|
|
223
223
|
title: "拖拽排序"
|
|
224
|
-
},
|
|
224
|
+
}, U = /* @__PURE__ */ c({
|
|
225
225
|
name: "MeInputProperty",
|
|
226
226
|
__name: "index",
|
|
227
227
|
props: {
|
|
@@ -275,19 +275,33 @@ var pe = {
|
|
|
275
275
|
"ok",
|
|
276
276
|
"cancel"
|
|
277
277
|
],
|
|
278
|
-
setup(
|
|
279
|
-
let
|
|
278
|
+
setup(c, { emit: b }) {
|
|
279
|
+
let S = c, E = b, D = p([]), O = p([]), A = p("object"), M = null;
|
|
280
|
+
function N(e, t) {
|
|
281
|
+
if (e === t) return !0;
|
|
282
|
+
if (typeof e != "object" || typeof t != "object" || e == null || t == null || Array.isArray(e) !== Array.isArray(t)) return !1;
|
|
283
|
+
if (Array.isArray(e)) {
|
|
284
|
+
if (e.length !== t.length) return !1;
|
|
285
|
+
for (let n = 0; n < e.length; n++) if (!N(e[n], t[n])) return !1;
|
|
286
|
+
return !0;
|
|
287
|
+
}
|
|
288
|
+
let n = Object.keys(e), r = Object.keys(t);
|
|
289
|
+
if (n.length !== r.length) return !1;
|
|
290
|
+
for (let r of n) if (!Object.prototype.hasOwnProperty.call(t, r) || !N(e[r], t[r])) return !1;
|
|
291
|
+
return !0;
|
|
292
|
+
}
|
|
293
|
+
let ce = r(() => {
|
|
280
294
|
let e = [{
|
|
281
|
-
title:
|
|
295
|
+
title: S.keyColumnTitle,
|
|
282
296
|
key: "key",
|
|
283
297
|
dataIndex: "key",
|
|
284
298
|
width: 180
|
|
285
299
|
}, {
|
|
286
|
-
title:
|
|
300
|
+
title: S.valueColumnTitle,
|
|
287
301
|
key: "value",
|
|
288
302
|
dataIndex: "value"
|
|
289
303
|
}];
|
|
290
|
-
return
|
|
304
|
+
return S.showRules && S.validate && e.push({
|
|
291
305
|
title: "校验",
|
|
292
306
|
key: "rules",
|
|
293
307
|
dataIndex: "rules",
|
|
@@ -300,103 +314,102 @@ var pe = {
|
|
|
300
314
|
width: 72,
|
|
301
315
|
align: "center"
|
|
302
316
|
}), e;
|
|
303
|
-
}),
|
|
304
|
-
function
|
|
305
|
-
|
|
306
|
-
let t = /* @__PURE__ */ new Map();
|
|
307
|
-
for (let e of
|
|
308
|
-
let
|
|
309
|
-
|
|
317
|
+
}), P = r(() => S.draggable && !S.disabled);
|
|
318
|
+
function de(e) {
|
|
319
|
+
A.value = Array.isArray(e) ? "array" : "object";
|
|
320
|
+
let t = /* @__PURE__ */ new Map(), n = [];
|
|
321
|
+
for (let e of D.value) {
|
|
322
|
+
let r = e.key.trim();
|
|
323
|
+
r ? t.set(r, e) : n.push(e);
|
|
310
324
|
}
|
|
311
|
-
let
|
|
312
|
-
|
|
313
|
-
|
|
325
|
+
let r = /* @__PURE__ */ new Set(), i = (e) => {
|
|
326
|
+
let n = t.get(e.trim());
|
|
327
|
+
if (n && !r.has(n.id)) return r.add(n.id), n.id;
|
|
328
|
+
let i = T();
|
|
329
|
+
return r.add(i), i;
|
|
330
|
+
}, a = (e) => t.get(e.trim())?.rules ?? S.rules?.[e.trim()], o = A.value === "array" ? e.map((e) => {
|
|
331
|
+
let t = String(e[S.keyField] ?? ""), n = e[S.valueField];
|
|
314
332
|
return {
|
|
315
|
-
id:
|
|
333
|
+
id: i(t),
|
|
316
334
|
key: t,
|
|
317
|
-
type:
|
|
318
|
-
value:
|
|
335
|
+
type: k(n),
|
|
336
|
+
value: n,
|
|
319
337
|
raw: { ...e },
|
|
320
|
-
rules:
|
|
338
|
+
rules: a(t)
|
|
321
339
|
};
|
|
322
|
-
}) :
|
|
323
|
-
id:
|
|
340
|
+
}) : Object.entries(e).map(([e, t]) => ({
|
|
341
|
+
id: i(e),
|
|
324
342
|
key: e,
|
|
325
|
-
type:
|
|
343
|
+
type: k(t),
|
|
326
344
|
value: t,
|
|
327
|
-
rules:
|
|
328
|
-
}))
|
|
345
|
+
rules: a(e)
|
|
346
|
+
}));
|
|
347
|
+
D.value = [...o, ...n], G();
|
|
329
348
|
}
|
|
330
|
-
function
|
|
349
|
+
function fe() {
|
|
331
350
|
let e = {};
|
|
332
|
-
for (let t of
|
|
351
|
+
for (let t of D.value) {
|
|
333
352
|
let n = t.key.trim();
|
|
334
|
-
n && (e[n] =
|
|
353
|
+
n && (e[n] = j(t.value, t.type));
|
|
335
354
|
}
|
|
336
355
|
return e;
|
|
337
356
|
}
|
|
338
|
-
function
|
|
357
|
+
function F() {
|
|
339
358
|
let e = [];
|
|
340
|
-
for (let t of
|
|
359
|
+
for (let t of D.value) {
|
|
341
360
|
let n = t.key.trim();
|
|
342
361
|
if (!n) continue;
|
|
343
362
|
let r = { ...t.raw };
|
|
344
|
-
r[
|
|
363
|
+
r[S.keyField] = n, r[S.valueField] = j(t.value, t.type), e.push(r);
|
|
345
364
|
}
|
|
346
365
|
return e;
|
|
347
366
|
}
|
|
348
|
-
function
|
|
349
|
-
let e =
|
|
350
|
-
|
|
351
|
-
let t =
|
|
352
|
-
duplicatedKeys:
|
|
353
|
-
hasEmptyKey:
|
|
354
|
-
rowRules:
|
|
355
|
-
valueErrors:
|
|
367
|
+
function I() {
|
|
368
|
+
let e = A.value === "array" ? F() : fe();
|
|
369
|
+
M = e, E("update:modelValue", e);
|
|
370
|
+
let t = S.validate ? {
|
|
371
|
+
duplicatedKeys: O.value,
|
|
372
|
+
hasEmptyKey: D.value.some((e) => !e.key.trim()),
|
|
373
|
+
rowRules: B(D.value),
|
|
374
|
+
valueErrors: H(D.value)
|
|
356
375
|
} : {
|
|
357
376
|
duplicatedKeys: [],
|
|
358
377
|
hasEmptyKey: !1,
|
|
359
378
|
rowRules: {},
|
|
360
379
|
valueErrors: {}
|
|
361
380
|
};
|
|
362
|
-
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
if (P) {
|
|
367
|
-
P = !1;
|
|
368
|
-
return;
|
|
369
|
-
}
|
|
370
|
-
I(e);
|
|
371
|
-
}
|
|
381
|
+
E("change", e, t);
|
|
382
|
+
}
|
|
383
|
+
g(() => S.modelValue, (e) => {
|
|
384
|
+
e && (M != null && N(e, M) || (M = null, de(e)));
|
|
372
385
|
}, { immediate: !0 });
|
|
373
|
-
let R =
|
|
374
|
-
|
|
386
|
+
let R = p(!!S.open);
|
|
387
|
+
g(() => S.open, (e) => {
|
|
375
388
|
R.value = !!e;
|
|
376
389
|
});
|
|
377
|
-
let
|
|
390
|
+
let z = r(() => S.modalMode ? {
|
|
378
391
|
open: R.value,
|
|
379
|
-
title:
|
|
380
|
-
width:
|
|
392
|
+
title: S.title,
|
|
393
|
+
width: S.modalWidth,
|
|
381
394
|
position: "center",
|
|
382
|
-
okText:
|
|
383
|
-
cancelText:
|
|
384
|
-
"onUpdate:open":
|
|
385
|
-
onOk:
|
|
386
|
-
onCancel:
|
|
395
|
+
okText: S.okText,
|
|
396
|
+
cancelText: S.cancelText,
|
|
397
|
+
"onUpdate:open": U,
|
|
398
|
+
onOk: ve,
|
|
399
|
+
onCancel: ge
|
|
387
400
|
} : {});
|
|
388
|
-
function
|
|
389
|
-
R.value = e,
|
|
390
|
-
}
|
|
391
|
-
function
|
|
392
|
-
|
|
393
|
-
}
|
|
394
|
-
function
|
|
395
|
-
return
|
|
396
|
-
duplicatedKeys:
|
|
397
|
-
hasEmptyKey:
|
|
398
|
-
rowRules:
|
|
399
|
-
valueErrors:
|
|
401
|
+
function U(e) {
|
|
402
|
+
R.value = e, E("update:open", e);
|
|
403
|
+
}
|
|
404
|
+
function ge() {
|
|
405
|
+
E("cancel");
|
|
406
|
+
}
|
|
407
|
+
function _e() {
|
|
408
|
+
return S.validate ? {
|
|
409
|
+
duplicatedKeys: le(D.value),
|
|
410
|
+
hasEmptyKey: D.value.some((e) => !e.key.trim()),
|
|
411
|
+
rowRules: B(D.value),
|
|
412
|
+
valueErrors: H(D.value)
|
|
400
413
|
} : {
|
|
401
414
|
duplicatedKeys: [],
|
|
402
415
|
hasEmptyKey: !1,
|
|
@@ -404,81 +417,81 @@ var pe = {
|
|
|
404
417
|
valueErrors: {}
|
|
405
418
|
};
|
|
406
419
|
}
|
|
407
|
-
function
|
|
408
|
-
let e =
|
|
420
|
+
function ve() {
|
|
421
|
+
let e = _e(), t = [];
|
|
409
422
|
e.hasEmptyKey && t.push("存在为空的 key,请补充或删除该属性"), e.duplicatedKeys.length && t.push(`key 重复(忽略大小写):${e.duplicatedKeys.join("、")}`);
|
|
410
423
|
for (let [n, r] of Object.entries(e.valueErrors)) t.push(`${n}:${r}`);
|
|
411
424
|
if (t.length) {
|
|
412
|
-
|
|
425
|
+
v.error(`校验未通过:${t.join(";")}`);
|
|
413
426
|
return;
|
|
414
427
|
}
|
|
415
|
-
R.value = !1,
|
|
428
|
+
R.value = !1, E("update:open", !1), E("ok", A.value === "array" ? F() : fe());
|
|
416
429
|
}
|
|
417
|
-
function
|
|
418
|
-
|
|
430
|
+
function ye(e) {
|
|
431
|
+
G(), I();
|
|
419
432
|
}
|
|
420
|
-
function
|
|
421
|
-
|
|
433
|
+
function W(e) {
|
|
434
|
+
G(), I();
|
|
422
435
|
}
|
|
423
|
-
function
|
|
424
|
-
e.type !== t && (e.type = t, e.value =
|
|
436
|
+
function be(e, t) {
|
|
437
|
+
e.type !== t && (e.type = t, e.value = se(e.value, t), e.rules = pe(e.rules, t), G(), I());
|
|
425
438
|
}
|
|
426
|
-
function
|
|
427
|
-
e.value = t,
|
|
439
|
+
function xe(e, t) {
|
|
440
|
+
e.value = t, G(), I();
|
|
428
441
|
}
|
|
429
|
-
function
|
|
430
|
-
|
|
431
|
-
id:
|
|
442
|
+
function Se() {
|
|
443
|
+
D.value = [...D.value, {
|
|
444
|
+
id: T(),
|
|
432
445
|
key: "",
|
|
433
446
|
type: "string",
|
|
434
447
|
value: "",
|
|
435
448
|
raw: {}
|
|
436
|
-
}],
|
|
437
|
-
}
|
|
438
|
-
function xe(e) {
|
|
439
|
-
let t = k.value.indexOf(e);
|
|
440
|
-
t !== -1 && (k.value.splice(t, 1), K(), L());
|
|
441
|
-
}
|
|
442
|
-
function K() {
|
|
443
|
-
A.value = se(k.value);
|
|
444
|
-
}
|
|
445
|
-
function Se(e) {
|
|
446
|
-
return ce(e, A.value);
|
|
449
|
+
}], G(), I();
|
|
447
450
|
}
|
|
448
451
|
function Ce(e) {
|
|
449
|
-
|
|
452
|
+
let t = D.value.indexOf(e);
|
|
453
|
+
t !== -1 && (D.value.splice(t, 1), G(), I());
|
|
454
|
+
}
|
|
455
|
+
function G() {
|
|
456
|
+
O.value = le(D.value);
|
|
450
457
|
}
|
|
451
458
|
function we(e) {
|
|
452
|
-
return
|
|
459
|
+
return ue(e, O.value);
|
|
453
460
|
}
|
|
454
461
|
function Te(e) {
|
|
455
|
-
return
|
|
462
|
+
return S.validate ? e.trim() ? we(e) ? "Key 不能重复(忽略大小写)" : "" : "Key 不能为空" : "";
|
|
456
463
|
}
|
|
457
464
|
function Ee(e) {
|
|
458
|
-
return
|
|
465
|
+
return S.validate ? !e.key.trim() || we(e.key) : !1;
|
|
466
|
+
}
|
|
467
|
+
function K(e) {
|
|
468
|
+
return S.disabled || !S.validate ? "" : V(e.value, e.type, e.rules) ?? "";
|
|
469
|
+
}
|
|
470
|
+
function De(e) {
|
|
471
|
+
return !!L(e.rules);
|
|
459
472
|
}
|
|
460
|
-
let q =
|
|
473
|
+
let q = p(!1), J = p(null), Oe = p(), Y = f({}), X = r(() => J.value?.type ?? "string"), ke = Object.fromEntries(x.map((e) => [e.value, e.label])), Ae = r(() => {
|
|
461
474
|
let e = J.value;
|
|
462
|
-
return e ? `校验规则${e.key.trim() ? ` · ${e.key.trim()}` : ""}(${
|
|
475
|
+
return e ? `校验规则${e.key.trim() ? ` · ${e.key.trim()}` : ""}(${ke[e.type] ?? e.type})` : "校验规则";
|
|
463
476
|
});
|
|
464
|
-
function
|
|
477
|
+
function je(e) {
|
|
465
478
|
return e === "int" || e === "float";
|
|
466
479
|
}
|
|
467
|
-
function
|
|
468
|
-
J.value = e, Object.keys(Y).forEach((e) => delete Y[e]), Object.assign(Y,
|
|
480
|
+
function Me(e) {
|
|
481
|
+
J.value = e, Object.keys(Y).forEach((e) => delete Y[e]), Object.assign(Y, L(e.rules) ?? {}), q.value = !0;
|
|
469
482
|
}
|
|
470
|
-
function
|
|
471
|
-
J.value &&
|
|
472
|
-
J.value && (J.value.rules =
|
|
483
|
+
function Ne() {
|
|
484
|
+
J.value && Oe.value?.validate().then(() => {
|
|
485
|
+
J.value && (J.value.rules = L(Y), q.value = !1, J.value = null, G(), I());
|
|
473
486
|
}).catch(() => {});
|
|
474
487
|
}
|
|
475
|
-
function
|
|
488
|
+
function Pe() {
|
|
476
489
|
q.value = !1, J.value = null;
|
|
477
490
|
}
|
|
478
|
-
function
|
|
491
|
+
function Fe(e, t) {
|
|
479
492
|
return typeof e == "string" && typeof t == "string" ? e < t ? -1 : +(e > t) : Number(e) - Number(t);
|
|
480
493
|
}
|
|
481
|
-
let
|
|
494
|
+
let Ie = r(() => {
|
|
482
495
|
let e = Y.minLength ?? null, t = Y.maxLength ?? null, n = Y.min ?? null, r = Y.max ?? null;
|
|
483
496
|
return {
|
|
484
497
|
minLength: [{ validator: (e, n) => n != null && t != null && n > t ? Promise.reject(/* @__PURE__ */ Error("最短长度不能大于最大长度")) : Promise.resolve() }],
|
|
@@ -491,36 +504,36 @@ var pe = {
|
|
|
491
504
|
}
|
|
492
505
|
return Promise.resolve();
|
|
493
506
|
} }],
|
|
494
|
-
min: [{ validator: (e, t) => t != null && r != null &&
|
|
495
|
-
max: [{ validator: (e, t) => t != null && n != null &&
|
|
507
|
+
min: [{ validator: (e, t) => t != null && r != null && Fe(t, r) > 0 ? Promise.reject(/* @__PURE__ */ Error("最小值不能大于最大值")) : Promise.resolve() }],
|
|
508
|
+
max: [{ validator: (e, t) => t != null && n != null && Fe(t, n) < 0 ? Promise.reject(/* @__PURE__ */ Error("最大值不能小于最小值")) : Promise.resolve() }]
|
|
496
509
|
};
|
|
497
|
-
}), Z =
|
|
498
|
-
function
|
|
510
|
+
}), Z = p(null), Q = p(null);
|
|
511
|
+
function Le() {
|
|
499
512
|
Z.value && (Q.value = Z.value.querySelector("tbody"));
|
|
500
513
|
}
|
|
501
|
-
function
|
|
502
|
-
Q.value && (
|
|
514
|
+
function Re() {
|
|
515
|
+
Q.value && (ze && We.destroy(), We.start(Q.value), ze = !0);
|
|
503
516
|
}
|
|
504
|
-
let
|
|
505
|
-
|
|
506
|
-
await
|
|
507
|
-
}),
|
|
508
|
-
!e || !
|
|
517
|
+
let ze = !1;
|
|
518
|
+
u(async () => {
|
|
519
|
+
await l(), Le(), Re();
|
|
520
|
+
}), g(R, async (e) => {
|
|
521
|
+
!e || !S.modalMode || (await l(), Le(), Re());
|
|
509
522
|
});
|
|
510
|
-
let $ =
|
|
511
|
-
function
|
|
523
|
+
let $ = p(null);
|
|
524
|
+
function Be() {
|
|
512
525
|
$.value && ($.value.style.display = "none");
|
|
513
526
|
}
|
|
514
|
-
function
|
|
527
|
+
function Ve(e) {
|
|
515
528
|
let t = Q.value, n = Z.value, r = $.value, i = e?.related, a = i instanceof Element ? i.closest("tr") : null;
|
|
516
529
|
if (!t || !n || !r || !a || !t.contains(a)) {
|
|
517
|
-
|
|
530
|
+
Be();
|
|
518
531
|
return;
|
|
519
532
|
}
|
|
520
|
-
let o = a.getBoundingClientRect(),
|
|
521
|
-
r.style.top = `${
|
|
533
|
+
let o = a.getBoundingClientRect(), ee = n.getBoundingClientRect(), te = e.willInsertAfter ? o.bottom : o.top;
|
|
534
|
+
r.style.top = `${te - ee.top - 1}px`, r.style.left = "0px", r.style.width = `${n.clientWidth}px`, r.style.display = "block";
|
|
522
535
|
}
|
|
523
|
-
function
|
|
536
|
+
function He(e) {
|
|
524
537
|
if (!e) return;
|
|
525
538
|
let t = document.querySelector(".me-input-property__drag-fallback");
|
|
526
539
|
if (!t) return;
|
|
@@ -531,57 +544,57 @@ var pe = {
|
|
|
531
544
|
r[t].style.width = `${e.getBoundingClientRect().width}px`;
|
|
532
545
|
});
|
|
533
546
|
}
|
|
534
|
-
let
|
|
547
|
+
let Ue = f({
|
|
535
548
|
handle: ".me-input-property__drag",
|
|
536
549
|
animation: 150,
|
|
537
550
|
forceFallback: !0,
|
|
538
551
|
fallbackOnBody: !0,
|
|
539
552
|
fallbackClass: "me-input-property__drag-fallback",
|
|
540
553
|
ghostClass: "me-input-property__row--ghost",
|
|
541
|
-
disabled: r(() => !
|
|
554
|
+
disabled: r(() => !P.value),
|
|
542
555
|
onStart: (e) => {
|
|
543
|
-
|
|
556
|
+
Be(), He(e.item);
|
|
544
557
|
},
|
|
545
|
-
onMove: ((e) => (
|
|
558
|
+
onMove: ((e) => (Ve(e), !0)),
|
|
546
559
|
onEnd: () => {
|
|
547
|
-
|
|
560
|
+
Be(), G(), I();
|
|
548
561
|
}
|
|
549
|
-
}),
|
|
550
|
-
...
|
|
562
|
+
}), We = y(Q, D, {
|
|
563
|
+
...Ue,
|
|
551
564
|
immediate: !1
|
|
552
565
|
});
|
|
553
|
-
return
|
|
554
|
-
|
|
555
|
-
}), (r,
|
|
556
|
-
let
|
|
557
|
-
return
|
|
558
|
-
default:
|
|
566
|
+
return g(P, (e) => {
|
|
567
|
+
We.option("disabled", !e);
|
|
568
|
+
}), (r, l) => {
|
|
569
|
+
let u = m("a-button"), f = m("a-tooltip"), p = m("a-input"), g = m("a-select"), v = m("a-input-number"), y = m("a-date-picker"), b = m("a-time-picker"), S = m("a-space-compact"), T = m("a-table"), E = m("a-checkbox"), O = m("a-form-item"), k = m("a-form");
|
|
570
|
+
return d(), i(ae(c.modalMode ? h(t) : "div"), ie(ne(z.value)), {
|
|
571
|
+
default: _(() => [ee("div", {
|
|
559
572
|
ref_key: "rootEl",
|
|
560
573
|
ref: Z,
|
|
561
574
|
class: "me-input-property"
|
|
562
575
|
}, [
|
|
563
|
-
|
|
564
|
-
columns:
|
|
565
|
-
"data-source":
|
|
576
|
+
s(T, {
|
|
577
|
+
columns: ce.value,
|
|
578
|
+
"data-source": D.value,
|
|
566
579
|
"row-key": (e) => e.id,
|
|
567
580
|
pagination: !1,
|
|
568
|
-
size:
|
|
569
|
-
locale: { emptyText:
|
|
581
|
+
size: c.size,
|
|
582
|
+
locale: { emptyText: c.emptyText },
|
|
570
583
|
class: "me-input-property__table"
|
|
571
584
|
}, {
|
|
572
|
-
headerCell:
|
|
585
|
+
headerCell: _(({ column: t }) => [t.key === "action" ? (d(), i(f, {
|
|
573
586
|
key: 0,
|
|
574
587
|
title: "新增"
|
|
575
588
|
}, {
|
|
576
|
-
default:
|
|
589
|
+
default: _(() => [s(u, {
|
|
577
590
|
type: "primary",
|
|
578
591
|
size: "small",
|
|
579
592
|
shape: "circle",
|
|
580
593
|
class: "me-input-property__add-btn",
|
|
581
|
-
disabled:
|
|
582
|
-
onClick:
|
|
594
|
+
disabled: c.disabled,
|
|
595
|
+
onClick: Se
|
|
583
596
|
}, {
|
|
584
|
-
default:
|
|
597
|
+
default: _(() => [s(h(e), {
|
|
585
598
|
name: "Plus",
|
|
586
599
|
size: 14
|
|
587
600
|
})]),
|
|
@@ -589,33 +602,33 @@ var pe = {
|
|
|
589
602
|
}, 8, ["disabled"])]),
|
|
590
603
|
_: 1
|
|
591
604
|
})) : a("", !0)]),
|
|
592
|
-
bodyCell:
|
|
605
|
+
bodyCell: _(({ column: t, record: n }) => [t.key === "action" ? (d(), o("div", me, [P.value ? (d(), o("span", he, [s(h(e), {
|
|
593
606
|
name: "GripVertical",
|
|
594
607
|
size: 14
|
|
595
|
-
})])) : a("", !0),
|
|
608
|
+
})])) : a("", !0), s(u, {
|
|
596
609
|
type: "text",
|
|
597
610
|
size: "small",
|
|
598
611
|
class: "me-input-property__del",
|
|
599
|
-
disabled:
|
|
612
|
+
disabled: c.disabled,
|
|
600
613
|
title: "删除该属性",
|
|
601
|
-
onClick: (e) =>
|
|
614
|
+
onClick: (e) => Ce(n)
|
|
602
615
|
}, {
|
|
603
|
-
default:
|
|
616
|
+
default: _(() => [s(h(e), {
|
|
604
617
|
name: "Trash2",
|
|
605
618
|
size: 14
|
|
606
619
|
})]),
|
|
607
620
|
_: 1
|
|
608
|
-
}, 8, ["disabled", "onClick"])])) : t.key === "key" ? (
|
|
621
|
+
}, 8, ["disabled", "onClick"])])) : t.key === "key" ? (d(), i(f, {
|
|
609
622
|
key: 1,
|
|
610
|
-
title:
|
|
611
|
-
visible: !
|
|
623
|
+
title: c.disabled ? "" : Te(n.key),
|
|
624
|
+
visible: !c.disabled && Ee(n)
|
|
612
625
|
}, {
|
|
613
|
-
default:
|
|
626
|
+
default: _(() => [s(p, {
|
|
614
627
|
value: n.key,
|
|
615
|
-
"onUpdate:value": [(e) => n.key = e, (e) =>
|
|
616
|
-
class:
|
|
617
|
-
disabled:
|
|
618
|
-
placeholder:
|
|
628
|
+
"onUpdate:value": [(e) => n.key = e, (e) => ye(n)],
|
|
629
|
+
class: re(["me-input-property__key-input", { "me-input-property__field--error": !c.disabled && Ee(n) }]),
|
|
630
|
+
disabled: c.disabled,
|
|
631
|
+
placeholder: c.keyPlaceholder
|
|
619
632
|
}, null, 8, [
|
|
620
633
|
"value",
|
|
621
634
|
"onUpdate:value",
|
|
@@ -624,96 +637,96 @@ var pe = {
|
|
|
624
637
|
"placeholder"
|
|
625
638
|
])]),
|
|
626
639
|
_: 2
|
|
627
|
-
}, 1032, ["title", "visible"])) : t.key === "value" ? (
|
|
640
|
+
}, 1032, ["title", "visible"])) : t.key === "value" ? (d(), i(f, {
|
|
628
641
|
key: 2,
|
|
629
|
-
title:
|
|
630
|
-
visible: !!
|
|
642
|
+
title: K(n),
|
|
643
|
+
visible: !!K(n)
|
|
631
644
|
}, {
|
|
632
|
-
default:
|
|
645
|
+
default: _(() => [s(S, {
|
|
633
646
|
block: !0,
|
|
634
|
-
class:
|
|
647
|
+
class: re(["me-input-property__value", { "me-input-property__field--error": !!K(n) }])
|
|
635
648
|
}, {
|
|
636
|
-
default:
|
|
649
|
+
default: _(() => [c.showType ? (d(), i(g, {
|
|
637
650
|
key: 0,
|
|
638
651
|
value: n.type,
|
|
639
|
-
disabled:
|
|
640
|
-
options:
|
|
652
|
+
disabled: c.disabled,
|
|
653
|
+
options: h(x),
|
|
641
654
|
class: "me-input-property__value-type",
|
|
642
|
-
onChange: (e) =>
|
|
655
|
+
onChange: (e) => be(n, e)
|
|
643
656
|
}, null, 8, [
|
|
644
657
|
"value",
|
|
645
658
|
"disabled",
|
|
646
659
|
"options",
|
|
647
660
|
"onChange"
|
|
648
|
-
])) : a("", !0), n.type === "string" ? (
|
|
661
|
+
])) : a("", !0), n.type === "string" ? (d(), i(p, {
|
|
649
662
|
key: 1,
|
|
650
663
|
value: n.value,
|
|
651
|
-
"onUpdate:value": [(e) => n.value = e, (e) =>
|
|
664
|
+
"onUpdate:value": [(e) => n.value = e, (e) => W(n)],
|
|
652
665
|
class: "me-input-property__value-editor",
|
|
653
|
-
disabled:
|
|
654
|
-
placeholder:
|
|
666
|
+
disabled: c.disabled,
|
|
667
|
+
placeholder: c.valuePlaceholder
|
|
655
668
|
}, null, 8, [
|
|
656
669
|
"value",
|
|
657
670
|
"onUpdate:value",
|
|
658
671
|
"disabled",
|
|
659
672
|
"placeholder"
|
|
660
|
-
])) : n.type === "int" ? (
|
|
673
|
+
])) : n.type === "int" ? (d(), i(v, {
|
|
661
674
|
key: 2,
|
|
662
675
|
value: n.value,
|
|
663
|
-
"onUpdate:value": [(e) => n.value = e, (e) =>
|
|
676
|
+
"onUpdate:value": [(e) => n.value = e, (e) => W(n)],
|
|
664
677
|
class: "me-input-property__value-editor",
|
|
665
|
-
disabled:
|
|
666
|
-
placeholder:
|
|
678
|
+
disabled: c.disabled,
|
|
679
|
+
placeholder: c.valuePlaceholder
|
|
667
680
|
}, null, 8, [
|
|
668
681
|
"value",
|
|
669
682
|
"onUpdate:value",
|
|
670
683
|
"disabled",
|
|
671
684
|
"placeholder"
|
|
672
|
-
])) : n.type === "float" ? (
|
|
685
|
+
])) : n.type === "float" ? (d(), i(v, {
|
|
673
686
|
key: 3,
|
|
674
687
|
value: n.value,
|
|
675
|
-
"onUpdate:value": [(e) => n.value = e, (e) =>
|
|
688
|
+
"onUpdate:value": [(e) => n.value = e, (e) => W(n)],
|
|
676
689
|
class: "me-input-property__value-editor",
|
|
677
|
-
disabled:
|
|
678
|
-
placeholder:
|
|
679
|
-
precision:
|
|
690
|
+
disabled: c.disabled,
|
|
691
|
+
placeholder: c.valuePlaceholder,
|
|
692
|
+
precision: h(2)
|
|
680
693
|
}, null, 8, [
|
|
681
694
|
"value",
|
|
682
695
|
"onUpdate:value",
|
|
683
696
|
"disabled",
|
|
684
697
|
"placeholder",
|
|
685
698
|
"precision"
|
|
686
|
-
])) : n.type === "date" ? (
|
|
699
|
+
])) : n.type === "date" ? (d(), i(y, {
|
|
687
700
|
key: 4,
|
|
688
701
|
value: n.value,
|
|
689
|
-
"onUpdate:value": [(e) => n.value = e, (e) =>
|
|
702
|
+
"onUpdate:value": [(e) => n.value = e, (e) => W(n)],
|
|
690
703
|
class: "me-input-property__value-editor",
|
|
691
|
-
"value-format":
|
|
692
|
-
disabled:
|
|
704
|
+
"value-format": h(C),
|
|
705
|
+
disabled: c.disabled
|
|
693
706
|
}, null, 8, [
|
|
694
707
|
"value",
|
|
695
708
|
"onUpdate:value",
|
|
696
709
|
"value-format",
|
|
697
710
|
"disabled"
|
|
698
|
-
])) : n.type === "time" ? (
|
|
711
|
+
])) : n.type === "time" ? (d(), i(b, {
|
|
699
712
|
key: 5,
|
|
700
713
|
value: n.value,
|
|
701
|
-
"onUpdate:value": [(e) => n.value = e, (e) =>
|
|
714
|
+
"onUpdate:value": [(e) => n.value = e, (e) => W(n)],
|
|
702
715
|
class: "me-input-property__value-editor",
|
|
703
|
-
"value-format":
|
|
704
|
-
disabled:
|
|
716
|
+
"value-format": h(w),
|
|
717
|
+
disabled: c.disabled
|
|
705
718
|
}, null, 8, [
|
|
706
719
|
"value",
|
|
707
720
|
"onUpdate:value",
|
|
708
721
|
"value-format",
|
|
709
722
|
"disabled"
|
|
710
|
-
])) : n.type === "boolean" ? (
|
|
723
|
+
])) : n.type === "boolean" ? (d(), i(g, {
|
|
711
724
|
key: 6,
|
|
712
725
|
value: n.value,
|
|
713
726
|
class: "me-input-property__value-editor",
|
|
714
|
-
disabled:
|
|
715
|
-
options:
|
|
716
|
-
onChange: (e) =>
|
|
727
|
+
disabled: c.disabled,
|
|
728
|
+
options: h(oe),
|
|
729
|
+
onChange: (e) => xe(n, e)
|
|
717
730
|
}, null, 8, [
|
|
718
731
|
"value",
|
|
719
732
|
"disabled",
|
|
@@ -723,18 +736,18 @@ var pe = {
|
|
|
723
736
|
_: 2
|
|
724
737
|
}, 1032, ["class"])]),
|
|
725
738
|
_: 2
|
|
726
|
-
}, 1032, ["title", "visible"])) : t.key === "rules" ? (
|
|
739
|
+
}, 1032, ["title", "visible"])) : t.key === "rules" ? (d(), i(f, {
|
|
727
740
|
key: 3,
|
|
728
741
|
title: "配置校验规则"
|
|
729
742
|
}, {
|
|
730
|
-
default:
|
|
743
|
+
default: _(() => [s(u, {
|
|
731
744
|
type: "text",
|
|
732
745
|
size: "small",
|
|
733
|
-
class:
|
|
734
|
-
disabled:
|
|
735
|
-
onClick: (e) =>
|
|
746
|
+
class: re(["me-input-property__rules-btn", { "is-active": De(n) }]),
|
|
747
|
+
disabled: c.disabled,
|
|
748
|
+
onClick: (e) => Me(n)
|
|
736
749
|
}, {
|
|
737
|
-
default:
|
|
750
|
+
default: _(() => [s(h(e), {
|
|
738
751
|
name: "WandSparkles",
|
|
739
752
|
size: 14
|
|
740
753
|
})]),
|
|
@@ -754,44 +767,44 @@ var pe = {
|
|
|
754
767
|
"size",
|
|
755
768
|
"locale"
|
|
756
769
|
]),
|
|
757
|
-
|
|
770
|
+
s(h(t), {
|
|
758
771
|
open: q.value,
|
|
759
|
-
"onUpdate:open":
|
|
772
|
+
"onUpdate:open": l[11] ||= (e) => q.value = e,
|
|
760
773
|
width: 480,
|
|
761
774
|
fullscreen: !1,
|
|
762
|
-
title:
|
|
775
|
+
title: Ae.value,
|
|
763
776
|
"ok-text": "保存",
|
|
764
777
|
"cancel-text": "取消",
|
|
765
|
-
onOk:
|
|
766
|
-
onCancel:
|
|
778
|
+
onOk: Ne,
|
|
779
|
+
onCancel: Pe
|
|
767
780
|
}, {
|
|
768
|
-
default:
|
|
781
|
+
default: _(() => [s(k, {
|
|
769
782
|
ref_key: "ruleFormRef",
|
|
770
|
-
ref:
|
|
783
|
+
ref: Oe,
|
|
771
784
|
model: Y,
|
|
772
|
-
rules:
|
|
785
|
+
rules: Ie.value,
|
|
773
786
|
layout: "vertical",
|
|
774
787
|
class: "me-input-property__rule-form"
|
|
775
788
|
}, {
|
|
776
|
-
default:
|
|
777
|
-
|
|
778
|
-
default:
|
|
789
|
+
default: _(() => [
|
|
790
|
+
s(O, { name: "required" }, {
|
|
791
|
+
default: _(() => [s(E, {
|
|
779
792
|
checked: Y.required,
|
|
780
|
-
"onUpdate:checked":
|
|
793
|
+
"onUpdate:checked": l[0] ||= (e) => Y.required = e
|
|
781
794
|
}, {
|
|
782
|
-
default:
|
|
795
|
+
default: _(() => [...l[12] ||= [te("必填(值不能为空)", -1)]]),
|
|
783
796
|
_: 1
|
|
784
797
|
}, 8, ["checked"])]),
|
|
785
798
|
_: 1
|
|
786
799
|
}),
|
|
787
|
-
X.value === "string" ? (
|
|
788
|
-
|
|
800
|
+
X.value === "string" ? (d(), o(n, { key: 0 }, [
|
|
801
|
+
s(O, {
|
|
789
802
|
name: "minLength",
|
|
790
803
|
label: "最短长度"
|
|
791
804
|
}, {
|
|
792
|
-
default:
|
|
805
|
+
default: _(() => [s(v, {
|
|
793
806
|
value: Y.minLength,
|
|
794
|
-
"onUpdate:value":
|
|
807
|
+
"onUpdate:value": l[1] ||= (e) => Y.minLength = e,
|
|
795
808
|
min: 0,
|
|
796
809
|
precision: 0,
|
|
797
810
|
placeholder: "不限",
|
|
@@ -799,13 +812,13 @@ var pe = {
|
|
|
799
812
|
}, null, 8, ["value"])]),
|
|
800
813
|
_: 1
|
|
801
814
|
}),
|
|
802
|
-
|
|
815
|
+
s(O, {
|
|
803
816
|
name: "maxLength",
|
|
804
817
|
label: "最大长度"
|
|
805
818
|
}, {
|
|
806
|
-
default:
|
|
819
|
+
default: _(() => [s(v, {
|
|
807
820
|
value: Y.maxLength,
|
|
808
|
-
"onUpdate:value":
|
|
821
|
+
"onUpdate:value": l[2] ||= (e) => Y.maxLength = e,
|
|
809
822
|
min: 0,
|
|
810
823
|
precision: 0,
|
|
811
824
|
placeholder: "不限",
|
|
@@ -813,90 +826,90 @@ var pe = {
|
|
|
813
826
|
}, null, 8, ["value"])]),
|
|
814
827
|
_: 1
|
|
815
828
|
}),
|
|
816
|
-
|
|
829
|
+
s(O, {
|
|
817
830
|
name: "pattern",
|
|
818
831
|
label: "正则模式",
|
|
819
832
|
extra: "校验值格式,如 ^[a-zA-Z0-9]+$"
|
|
820
833
|
}, {
|
|
821
|
-
default:
|
|
834
|
+
default: _(() => [s(p, {
|
|
822
835
|
value: Y.pattern,
|
|
823
|
-
"onUpdate:value":
|
|
836
|
+
"onUpdate:value": l[3] ||= (e) => Y.pattern = e,
|
|
824
837
|
placeholder: "如 ^[a-zA-Z0-9]+$",
|
|
825
838
|
"allow-clear": ""
|
|
826
839
|
}, null, 8, ["value"])]),
|
|
827
840
|
_: 1
|
|
828
841
|
})
|
|
829
842
|
], 64)) : a("", !0),
|
|
830
|
-
|
|
843
|
+
je(X.value) ? (d(), o(n, { key: 1 }, [s(O, {
|
|
831
844
|
name: "min",
|
|
832
845
|
label: "最小值"
|
|
833
846
|
}, {
|
|
834
|
-
default:
|
|
847
|
+
default: _(() => [s(v, {
|
|
835
848
|
value: Y.min,
|
|
836
|
-
"onUpdate:value":
|
|
837
|
-
precision: X.value === "float" ?
|
|
849
|
+
"onUpdate:value": l[4] ||= (e) => Y.min = e,
|
|
850
|
+
precision: X.value === "float" ? h(2) : 0,
|
|
838
851
|
placeholder: "不限",
|
|
839
852
|
class: "me-input-property__rule-input"
|
|
840
853
|
}, null, 8, ["value", "precision"])]),
|
|
841
854
|
_: 1
|
|
842
|
-
}),
|
|
855
|
+
}), s(O, {
|
|
843
856
|
name: "max",
|
|
844
857
|
label: "最大值"
|
|
845
858
|
}, {
|
|
846
|
-
default:
|
|
859
|
+
default: _(() => [s(v, {
|
|
847
860
|
value: Y.max,
|
|
848
|
-
"onUpdate:value":
|
|
849
|
-
precision: X.value === "float" ?
|
|
861
|
+
"onUpdate:value": l[5] ||= (e) => Y.max = e,
|
|
862
|
+
precision: X.value === "float" ? h(2) : 0,
|
|
850
863
|
placeholder: "不限",
|
|
851
864
|
class: "me-input-property__rule-input"
|
|
852
865
|
}, null, 8, ["value", "precision"])]),
|
|
853
866
|
_: 1
|
|
854
867
|
})], 64)) : a("", !0),
|
|
855
|
-
X.value === "date" || X.value === "time" ? (
|
|
868
|
+
X.value === "date" || X.value === "time" ? (d(), o(n, { key: 2 }, [s(O, {
|
|
856
869
|
name: "min",
|
|
857
870
|
label: "最早边界"
|
|
858
871
|
}, {
|
|
859
|
-
default:
|
|
872
|
+
default: _(() => [X.value === "date" ? (d(), i(y, {
|
|
860
873
|
key: 0,
|
|
861
874
|
value: Y.min,
|
|
862
|
-
"onUpdate:value":
|
|
863
|
-
"value-format":
|
|
875
|
+
"onUpdate:value": l[6] ||= (e) => Y.min = e,
|
|
876
|
+
"value-format": h(C),
|
|
864
877
|
style: { width: "100%" }
|
|
865
|
-
}, null, 8, ["value", "value-format"])) : (
|
|
878
|
+
}, null, 8, ["value", "value-format"])) : (d(), i(b, {
|
|
866
879
|
key: 1,
|
|
867
880
|
value: Y.min,
|
|
868
|
-
"onUpdate:value":
|
|
869
|
-
"value-format":
|
|
881
|
+
"onUpdate:value": l[7] ||= (e) => Y.min = e,
|
|
882
|
+
"value-format": h(w),
|
|
870
883
|
style: { width: "100%" }
|
|
871
884
|
}, null, 8, ["value", "value-format"]))]),
|
|
872
885
|
_: 1
|
|
873
|
-
}),
|
|
886
|
+
}), s(O, {
|
|
874
887
|
name: "max",
|
|
875
888
|
label: "最晚边界"
|
|
876
889
|
}, {
|
|
877
|
-
default:
|
|
890
|
+
default: _(() => [X.value === "date" ? (d(), i(y, {
|
|
878
891
|
key: 0,
|
|
879
892
|
value: Y.max,
|
|
880
|
-
"onUpdate:value":
|
|
881
|
-
"value-format":
|
|
893
|
+
"onUpdate:value": l[8] ||= (e) => Y.max = e,
|
|
894
|
+
"value-format": h(C),
|
|
882
895
|
style: { width: "100%" }
|
|
883
|
-
}, null, 8, ["value", "value-format"])) : (
|
|
896
|
+
}, null, 8, ["value", "value-format"])) : (d(), i(b, {
|
|
884
897
|
key: 1,
|
|
885
898
|
value: Y.max,
|
|
886
|
-
"onUpdate:value":
|
|
887
|
-
"value-format":
|
|
899
|
+
"onUpdate:value": l[9] ||= (e) => Y.max = e,
|
|
900
|
+
"value-format": h(w),
|
|
888
901
|
style: { width: "100%" }
|
|
889
902
|
}, null, 8, ["value", "value-format"]))]),
|
|
890
903
|
_: 1
|
|
891
904
|
})], 64)) : a("", !0),
|
|
892
|
-
|
|
905
|
+
s(O, {
|
|
893
906
|
name: "message",
|
|
894
907
|
label: "自定义错误提示",
|
|
895
908
|
extra: "可选,覆盖所有校验规则的默认提示文案"
|
|
896
909
|
}, {
|
|
897
|
-
default:
|
|
910
|
+
default: _(() => [s(p, {
|
|
898
911
|
value: Y.message,
|
|
899
|
-
"onUpdate:value":
|
|
912
|
+
"onUpdate:value": l[10] ||= (e) => Y.message = e,
|
|
900
913
|
placeholder: "如:该属性不合法",
|
|
901
914
|
"allow-clear": ""
|
|
902
915
|
}, null, 8, ["value"])]),
|
|
@@ -907,7 +920,7 @@ var pe = {
|
|
|
907
920
|
}, 8, ["model", "rules"])]),
|
|
908
921
|
_: 1
|
|
909
922
|
}, 8, ["open", "title"]),
|
|
910
|
-
|
|
923
|
+
ee("div", {
|
|
911
924
|
ref_key: "dropLineEl",
|
|
912
925
|
ref: $,
|
|
913
926
|
class: "me-input-property__drop-line"
|
|
@@ -920,9 +933,9 @@ var pe = {
|
|
|
920
933
|
});
|
|
921
934
|
//#endregion
|
|
922
935
|
//#region src/components/input-property/index.ts
|
|
923
|
-
|
|
924
|
-
e.component("MeInputProperty",
|
|
936
|
+
U.install = (e) => {
|
|
937
|
+
e.component("MeInputProperty", U);
|
|
925
938
|
};
|
|
926
|
-
var
|
|
939
|
+
var ge = U;
|
|
927
940
|
//#endregion
|
|
928
|
-
export {
|
|
941
|
+
export { oe as BOOLEAN_OPTIONS, C as DATE_FORMAT, S as FLOAT_PRECISION, U as MeInputProperty, w as TIME_FORMAT, x as VALUE_TYPE_OPTIONS, le as checkDuplicateKeys, ge as default, j as exportValue, T as genId, k as inferValueType, ue as isDuplicateKey, F as isRuleApplicable, P as normalizeKey, L as normalizeRuleSet, se as normalizeValue, pe as sanitizeRulesForType, B as toRuleMap, H as toValueErrorMap, z as validateValue, V as valueError };
|