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