@me-framework/me-ui-antdv-next 0.0.34 → 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/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 +317 -297
- 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 +1097 -584
- package/dist/me-ui-antdv-next.umd.cjs +3 -3
- 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
|
|
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 S = [
|
|
|
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 S = [
|
|
|
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 ce(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 ue = {
|
|
|
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: {
|
|
@@ -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,33 @@ var pe = { class: "me-input-property__toolbar" }, me = {
|
|
|
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 = { class: "me-input-property__toolbar" }, me = {
|
|
|
300
314
|
width: 72,
|
|
301
315
|
align: "center"
|
|
302
316
|
}), e;
|
|
303
|
-
}), P = r(() =>
|
|
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
367
|
function I() {
|
|
349
|
-
let e =
|
|
350
|
-
|
|
351
|
-
let t =
|
|
352
|
-
duplicatedKeys:
|
|
353
|
-
hasEmptyKey:
|
|
354
|
-
rowRules:
|
|
355
|
-
valueErrors:
|
|
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 (N) {
|
|
367
|
-
N = !1;
|
|
368
|
-
return;
|
|
369
|
-
}
|
|
370
|
-
F(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
|
|
374
|
-
|
|
375
|
-
|
|
386
|
+
let R = p(!!S.open);
|
|
387
|
+
g(() => S.open, (e) => {
|
|
388
|
+
R.value = !!e;
|
|
376
389
|
});
|
|
377
|
-
let z = r(() =>
|
|
378
|
-
open:
|
|
379
|
-
title:
|
|
380
|
-
width:
|
|
390
|
+
let z = r(() => S.modalMode ? {
|
|
391
|
+
open: R.value,
|
|
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
|
-
|
|
390
|
-
}
|
|
391
|
-
function W() {
|
|
392
|
-
D("cancel");
|
|
401
|
+
function U(e) {
|
|
402
|
+
R.value = e, E("update:open", e);
|
|
393
403
|
}
|
|
394
404
|
function ge() {
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
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,60 +417,60 @@ var pe = { class: "me-input-property__toolbar" }, me = {
|
|
|
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
|
-
|
|
416
|
-
}
|
|
417
|
-
function ve(e) {
|
|
418
|
-
K(), I();
|
|
428
|
+
R.value = !1, E("update:open", !1), E("ok", A.value === "array" ? F() : fe());
|
|
419
429
|
}
|
|
420
|
-
function
|
|
421
|
-
|
|
430
|
+
function ye(e) {
|
|
431
|
+
G(), I();
|
|
422
432
|
}
|
|
423
|
-
function
|
|
424
|
-
|
|
433
|
+
function W(e) {
|
|
434
|
+
G(), I();
|
|
425
435
|
}
|
|
426
436
|
function be(e, t) {
|
|
427
|
-
e.value = t,
|
|
437
|
+
e.type !== t && (e.type = t, e.value = se(e.value, t), e.rules = pe(e.rules, t), G(), I());
|
|
428
438
|
}
|
|
429
|
-
function xe() {
|
|
430
|
-
|
|
431
|
-
|
|
439
|
+
function xe(e, t) {
|
|
440
|
+
e.value = t, G(), I();
|
|
441
|
+
}
|
|
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 Se(e) {
|
|
439
|
-
let t = O.value.indexOf(e);
|
|
440
|
-
t !== -1 && (O.value.splice(t, 1), K(), I());
|
|
441
|
-
}
|
|
442
|
-
function K() {
|
|
443
|
-
k.value = ce(O.value);
|
|
449
|
+
}], G(), I();
|
|
444
450
|
}
|
|
445
451
|
function Ce(e) {
|
|
446
|
-
|
|
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);
|
|
447
457
|
}
|
|
448
458
|
function we(e) {
|
|
449
|
-
return
|
|
459
|
+
return ue(e, O.value);
|
|
450
460
|
}
|
|
451
461
|
function Te(e) {
|
|
452
|
-
return
|
|
462
|
+
return S.validate ? e.trim() ? we(e) ? "Key 不能重复(忽略大小写)" : "" : "Key 不能为空" : "";
|
|
453
463
|
}
|
|
454
464
|
function Ee(e) {
|
|
455
|
-
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) ?? "";
|
|
456
469
|
}
|
|
457
470
|
function De(e) {
|
|
458
|
-
return !!
|
|
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
475
|
return e ? `校验规则${e.key.trim() ? ` · ${e.key.trim()}` : ""}(${ke[e.type] ?? e.type})` : "校验规则";
|
|
463
476
|
});
|
|
@@ -465,11 +478,11 @@ var pe = { class: "me-input-property__toolbar" }, me = {
|
|
|
465
478
|
return e === "int" || e === "float";
|
|
466
479
|
}
|
|
467
480
|
function Me(e) {
|
|
468
|
-
J.value = e, Object.keys(Y).forEach((e) => delete Y[e]), Object.assign(Y,
|
|
481
|
+
J.value = e, Object.keys(Y).forEach((e) => delete Y[e]), Object.assign(Y, L(e.rules) ?? {}), q.value = !0;
|
|
469
482
|
}
|
|
470
483
|
function Ne() {
|
|
471
484
|
J.value && Oe.value?.validate().then(() => {
|
|
472
|
-
J.value && (J.value.rules =
|
|
485
|
+
J.value && (J.value.rules = L(Y), q.value = !1, J.value = null, G(), I());
|
|
473
486
|
}).catch(() => {});
|
|
474
487
|
}
|
|
475
488
|
function Pe() {
|
|
@@ -494,7 +507,7 @@ var pe = { class: "me-input-property__toolbar" }, me = {
|
|
|
494
507
|
min: [{ validator: (e, t) => t != null && r != null && Fe(t, r) > 0 ? Promise.reject(/* @__PURE__ */ Error("最小值不能大于最大值")) : Promise.resolve() }],
|
|
495
508
|
max: [{ validator: (e, t) => t != null && n != null && Fe(t, n) < 0 ? Promise.reject(/* @__PURE__ */ Error("最大值不能小于最小值")) : Promise.resolve() }]
|
|
496
509
|
};
|
|
497
|
-
}), Z =
|
|
510
|
+
}), Z = p(null), Q = p(null);
|
|
498
511
|
function Le() {
|
|
499
512
|
Z.value && (Q.value = Z.value.querySelector("tbody"));
|
|
500
513
|
}
|
|
@@ -502,12 +515,12 @@ var pe = { class: "me-input-property__toolbar" }, me = {
|
|
|
502
515
|
Q.value && (ze && We.destroy(), We.start(Q.value), ze = !0);
|
|
503
516
|
}
|
|
504
517
|
let ze = !1;
|
|
505
|
-
|
|
506
|
-
await
|
|
507
|
-
}),
|
|
508
|
-
!e || !
|
|
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 $ =
|
|
523
|
+
let $ = p(null);
|
|
511
524
|
function Be() {
|
|
512
525
|
$.value && ($.value.style.display = "none");
|
|
513
526
|
}
|
|
@@ -517,8 +530,8 @@ var pe = { class: "me-input-property__toolbar" }, me = {
|
|
|
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
536
|
function He(e) {
|
|
524
537
|
if (!e) return;
|
|
@@ -531,7 +544,7 @@ var pe = { class: "me-input-property__toolbar" }, me = {
|
|
|
531
544
|
r[t].style.width = `${e.getBoundingClientRect().width}px`;
|
|
532
545
|
});
|
|
533
546
|
}
|
|
534
|
-
let Ue =
|
|
547
|
+
let Ue = f({
|
|
535
548
|
handle: ".me-input-property__drag",
|
|
536
549
|
animation: 150,
|
|
537
550
|
forceFallback: !0,
|
|
@@ -544,71 +557,78 @@ var pe = { class: "me-input-property__toolbar" }, me = {
|
|
|
544
557
|
},
|
|
545
558
|
onMove: ((e) => (Ve(e), !0)),
|
|
546
559
|
onEnd: () => {
|
|
547
|
-
Be(),
|
|
560
|
+
Be(), G(), I();
|
|
548
561
|
}
|
|
549
|
-
}), We =
|
|
562
|
+
}), We = y(Q, D, {
|
|
550
563
|
...Ue,
|
|
551
564
|
immediate: !1
|
|
552
565
|
});
|
|
553
|
-
return
|
|
566
|
+
return g(P, (e) => {
|
|
554
567
|
We.option("disabled", !e);
|
|
555
|
-
}), (r,
|
|
556
|
-
let
|
|
557
|
-
return
|
|
558
|
-
default:
|
|
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
|
-
s(
|
|
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,
|
|
576
|
+
s(T, {
|
|
577
|
+
columns: ce.value,
|
|
578
|
+
"data-source": D.value,
|
|
579
579
|
"row-key": (e) => e.id,
|
|
580
580
|
pagination: !1,
|
|
581
|
-
size:
|
|
582
|
-
locale: { emptyText:
|
|
581
|
+
size: c.size,
|
|
582
|
+
locale: { emptyText: c.emptyText },
|
|
583
583
|
class: "me-input-property__table"
|
|
584
584
|
}, {
|
|
585
|
-
|
|
585
|
+
headerCell: _(({ column: t }) => [t.key === "action" ? (d(), i(f, {
|
|
586
|
+
key: 0,
|
|
587
|
+
title: "新增"
|
|
588
|
+
}, {
|
|
589
|
+
default: _(() => [s(u, {
|
|
590
|
+
type: "primary",
|
|
591
|
+
size: "small",
|
|
592
|
+
shape: "circle",
|
|
593
|
+
class: "me-input-property__add-btn",
|
|
594
|
+
disabled: c.disabled,
|
|
595
|
+
onClick: Se
|
|
596
|
+
}, {
|
|
597
|
+
default: _(() => [s(h(e), {
|
|
598
|
+
name: "Plus",
|
|
599
|
+
size: 14
|
|
600
|
+
})]),
|
|
601
|
+
_: 1
|
|
602
|
+
}, 8, ["disabled"])]),
|
|
603
|
+
_: 1
|
|
604
|
+
})) : a("", !0)]),
|
|
605
|
+
bodyCell: _(({ column: t, record: n }) => [t.key === "action" ? (d(), o("div", me, [P.value ? (d(), o("span", he, [s(h(e), {
|
|
586
606
|
name: "GripVertical",
|
|
587
607
|
size: 14
|
|
588
|
-
})])) : a("", !0),
|
|
608
|
+
})])) : a("", !0), s(u, {
|
|
589
609
|
type: "text",
|
|
590
610
|
size: "small",
|
|
591
611
|
class: "me-input-property__del",
|
|
592
|
-
disabled:
|
|
612
|
+
disabled: c.disabled,
|
|
593
613
|
title: "删除该属性",
|
|
594
|
-
onClick: (e) =>
|
|
614
|
+
onClick: (e) => Ce(n)
|
|
595
615
|
}, {
|
|
596
|
-
default:
|
|
616
|
+
default: _(() => [s(h(e), {
|
|
597
617
|
name: "Trash2",
|
|
598
618
|
size: 14
|
|
599
619
|
})]),
|
|
600
620
|
_: 1
|
|
601
|
-
}, 8, ["disabled", "onClick"])])) : t.key === "key" ? (
|
|
621
|
+
}, 8, ["disabled", "onClick"])])) : t.key === "key" ? (d(), i(f, {
|
|
602
622
|
key: 1,
|
|
603
|
-
title:
|
|
604
|
-
visible: !
|
|
623
|
+
title: c.disabled ? "" : Te(n.key),
|
|
624
|
+
visible: !c.disabled && Ee(n)
|
|
605
625
|
}, {
|
|
606
|
-
default:
|
|
626
|
+
default: _(() => [s(p, {
|
|
607
627
|
value: n.key,
|
|
608
|
-
"onUpdate:value": [(e) => n.key = e, (e) =>
|
|
609
|
-
class:
|
|
610
|
-
disabled:
|
|
611
|
-
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
|
|
612
632
|
}, null, 8, [
|
|
613
633
|
"value",
|
|
614
634
|
"onUpdate:value",
|
|
@@ -617,96 +637,96 @@ var pe = { class: "me-input-property__toolbar" }, me = {
|
|
|
617
637
|
"placeholder"
|
|
618
638
|
])]),
|
|
619
639
|
_: 2
|
|
620
|
-
}, 1032, ["title", "visible"])) : t.key === "value" ? (
|
|
640
|
+
}, 1032, ["title", "visible"])) : t.key === "value" ? (d(), i(f, {
|
|
621
641
|
key: 2,
|
|
622
|
-
title:
|
|
623
|
-
visible: !!
|
|
642
|
+
title: K(n),
|
|
643
|
+
visible: !!K(n)
|
|
624
644
|
}, {
|
|
625
|
-
default:
|
|
645
|
+
default: _(() => [s(S, {
|
|
626
646
|
block: !0,
|
|
627
|
-
class:
|
|
647
|
+
class: re(["me-input-property__value", { "me-input-property__field--error": !!K(n) }])
|
|
628
648
|
}, {
|
|
629
|
-
default:
|
|
649
|
+
default: _(() => [c.showType ? (d(), i(g, {
|
|
630
650
|
key: 0,
|
|
631
651
|
value: n.type,
|
|
632
|
-
disabled:
|
|
633
|
-
options:
|
|
652
|
+
disabled: c.disabled,
|
|
653
|
+
options: h(x),
|
|
634
654
|
class: "me-input-property__value-type",
|
|
635
|
-
onChange: (e) =>
|
|
655
|
+
onChange: (e) => be(n, e)
|
|
636
656
|
}, null, 8, [
|
|
637
657
|
"value",
|
|
638
658
|
"disabled",
|
|
639
659
|
"options",
|
|
640
660
|
"onChange"
|
|
641
|
-
])) : a("", !0), n.type === "string" ? (
|
|
661
|
+
])) : a("", !0), n.type === "string" ? (d(), i(p, {
|
|
642
662
|
key: 1,
|
|
643
663
|
value: n.value,
|
|
644
|
-
"onUpdate:value": [(e) => n.value = e, (e) =>
|
|
664
|
+
"onUpdate:value": [(e) => n.value = e, (e) => W(n)],
|
|
645
665
|
class: "me-input-property__value-editor",
|
|
646
|
-
disabled:
|
|
647
|
-
placeholder:
|
|
666
|
+
disabled: c.disabled,
|
|
667
|
+
placeholder: c.valuePlaceholder
|
|
648
668
|
}, null, 8, [
|
|
649
669
|
"value",
|
|
650
670
|
"onUpdate:value",
|
|
651
671
|
"disabled",
|
|
652
672
|
"placeholder"
|
|
653
|
-
])) : n.type === "int" ? (
|
|
673
|
+
])) : n.type === "int" ? (d(), i(v, {
|
|
654
674
|
key: 2,
|
|
655
675
|
value: n.value,
|
|
656
|
-
"onUpdate:value": [(e) => n.value = e, (e) =>
|
|
676
|
+
"onUpdate:value": [(e) => n.value = e, (e) => W(n)],
|
|
657
677
|
class: "me-input-property__value-editor",
|
|
658
|
-
disabled:
|
|
659
|
-
placeholder:
|
|
678
|
+
disabled: c.disabled,
|
|
679
|
+
placeholder: c.valuePlaceholder
|
|
660
680
|
}, null, 8, [
|
|
661
681
|
"value",
|
|
662
682
|
"onUpdate:value",
|
|
663
683
|
"disabled",
|
|
664
684
|
"placeholder"
|
|
665
|
-
])) : n.type === "float" ? (
|
|
685
|
+
])) : n.type === "float" ? (d(), i(v, {
|
|
666
686
|
key: 3,
|
|
667
687
|
value: n.value,
|
|
668
|
-
"onUpdate:value": [(e) => n.value = e, (e) =>
|
|
688
|
+
"onUpdate:value": [(e) => n.value = e, (e) => W(n)],
|
|
669
689
|
class: "me-input-property__value-editor",
|
|
670
|
-
disabled:
|
|
671
|
-
placeholder:
|
|
672
|
-
precision:
|
|
690
|
+
disabled: c.disabled,
|
|
691
|
+
placeholder: c.valuePlaceholder,
|
|
692
|
+
precision: h(2)
|
|
673
693
|
}, null, 8, [
|
|
674
694
|
"value",
|
|
675
695
|
"onUpdate:value",
|
|
676
696
|
"disabled",
|
|
677
697
|
"placeholder",
|
|
678
698
|
"precision"
|
|
679
|
-
])) : n.type === "date" ? (
|
|
699
|
+
])) : n.type === "date" ? (d(), i(y, {
|
|
680
700
|
key: 4,
|
|
681
701
|
value: n.value,
|
|
682
|
-
"onUpdate:value": [(e) => n.value = e, (e) =>
|
|
702
|
+
"onUpdate:value": [(e) => n.value = e, (e) => W(n)],
|
|
683
703
|
class: "me-input-property__value-editor",
|
|
684
|
-
"value-format":
|
|
685
|
-
disabled:
|
|
704
|
+
"value-format": h(C),
|
|
705
|
+
disabled: c.disabled
|
|
686
706
|
}, null, 8, [
|
|
687
707
|
"value",
|
|
688
708
|
"onUpdate:value",
|
|
689
709
|
"value-format",
|
|
690
710
|
"disabled"
|
|
691
|
-
])) : n.type === "time" ? (
|
|
711
|
+
])) : n.type === "time" ? (d(), i(b, {
|
|
692
712
|
key: 5,
|
|
693
713
|
value: n.value,
|
|
694
|
-
"onUpdate:value": [(e) => n.value = e, (e) =>
|
|
714
|
+
"onUpdate:value": [(e) => n.value = e, (e) => W(n)],
|
|
695
715
|
class: "me-input-property__value-editor",
|
|
696
|
-
"value-format":
|
|
697
|
-
disabled:
|
|
716
|
+
"value-format": h(w),
|
|
717
|
+
disabled: c.disabled
|
|
698
718
|
}, null, 8, [
|
|
699
719
|
"value",
|
|
700
720
|
"onUpdate:value",
|
|
701
721
|
"value-format",
|
|
702
722
|
"disabled"
|
|
703
|
-
])) : n.type === "boolean" ? (
|
|
723
|
+
])) : n.type === "boolean" ? (d(), i(g, {
|
|
704
724
|
key: 6,
|
|
705
725
|
value: n.value,
|
|
706
726
|
class: "me-input-property__value-editor",
|
|
707
|
-
disabled:
|
|
708
|
-
options:
|
|
709
|
-
onChange: (e) =>
|
|
727
|
+
disabled: c.disabled,
|
|
728
|
+
options: h(oe),
|
|
729
|
+
onChange: (e) => xe(n, e)
|
|
710
730
|
}, null, 8, [
|
|
711
731
|
"value",
|
|
712
732
|
"disabled",
|
|
@@ -716,18 +736,18 @@ var pe = { class: "me-input-property__toolbar" }, me = {
|
|
|
716
736
|
_: 2
|
|
717
737
|
}, 1032, ["class"])]),
|
|
718
738
|
_: 2
|
|
719
|
-
}, 1032, ["title", "visible"])) : t.key === "rules" ? (
|
|
739
|
+
}, 1032, ["title", "visible"])) : t.key === "rules" ? (d(), i(f, {
|
|
720
740
|
key: 3,
|
|
721
741
|
title: "配置校验规则"
|
|
722
742
|
}, {
|
|
723
|
-
default:
|
|
743
|
+
default: _(() => [s(u, {
|
|
724
744
|
type: "text",
|
|
725
745
|
size: "small",
|
|
726
|
-
class:
|
|
727
|
-
disabled:
|
|
746
|
+
class: re(["me-input-property__rules-btn", { "is-active": De(n) }]),
|
|
747
|
+
disabled: c.disabled,
|
|
728
748
|
onClick: (e) => Me(n)
|
|
729
749
|
}, {
|
|
730
|
-
default:
|
|
750
|
+
default: _(() => [s(h(e), {
|
|
731
751
|
name: "WandSparkles",
|
|
732
752
|
size: 14
|
|
733
753
|
})]),
|
|
@@ -747,9 +767,9 @@ var pe = { class: "me-input-property__toolbar" }, me = {
|
|
|
747
767
|
"size",
|
|
748
768
|
"locale"
|
|
749
769
|
]),
|
|
750
|
-
|
|
770
|
+
s(h(t), {
|
|
751
771
|
open: q.value,
|
|
752
|
-
"onUpdate:open":
|
|
772
|
+
"onUpdate:open": l[11] ||= (e) => q.value = e,
|
|
753
773
|
width: 480,
|
|
754
774
|
fullscreen: !1,
|
|
755
775
|
title: Ae.value,
|
|
@@ -758,7 +778,7 @@ var pe = { class: "me-input-property__toolbar" }, me = {
|
|
|
758
778
|
onOk: Ne,
|
|
759
779
|
onCancel: Pe
|
|
760
780
|
}, {
|
|
761
|
-
default:
|
|
781
|
+
default: _(() => [s(k, {
|
|
762
782
|
ref_key: "ruleFormRef",
|
|
763
783
|
ref: Oe,
|
|
764
784
|
model: Y,
|
|
@@ -766,25 +786,25 @@ var pe = { class: "me-input-property__toolbar" }, me = {
|
|
|
766
786
|
layout: "vertical",
|
|
767
787
|
class: "me-input-property__rule-form"
|
|
768
788
|
}, {
|
|
769
|
-
default:
|
|
770
|
-
|
|
771
|
-
default:
|
|
789
|
+
default: _(() => [
|
|
790
|
+
s(O, { name: "required" }, {
|
|
791
|
+
default: _(() => [s(E, {
|
|
772
792
|
checked: Y.required,
|
|
773
|
-
"onUpdate:checked":
|
|
793
|
+
"onUpdate:checked": l[0] ||= (e) => Y.required = e
|
|
774
794
|
}, {
|
|
775
|
-
default:
|
|
795
|
+
default: _(() => [...l[12] ||= [te("必填(值不能为空)", -1)]]),
|
|
776
796
|
_: 1
|
|
777
797
|
}, 8, ["checked"])]),
|
|
778
798
|
_: 1
|
|
779
799
|
}),
|
|
780
|
-
X.value === "string" ? (
|
|
781
|
-
|
|
800
|
+
X.value === "string" ? (d(), o(n, { key: 0 }, [
|
|
801
|
+
s(O, {
|
|
782
802
|
name: "minLength",
|
|
783
803
|
label: "最短长度"
|
|
784
804
|
}, {
|
|
785
|
-
default:
|
|
805
|
+
default: _(() => [s(v, {
|
|
786
806
|
value: Y.minLength,
|
|
787
|
-
"onUpdate:value":
|
|
807
|
+
"onUpdate:value": l[1] ||= (e) => Y.minLength = e,
|
|
788
808
|
min: 0,
|
|
789
809
|
precision: 0,
|
|
790
810
|
placeholder: "不限",
|
|
@@ -792,13 +812,13 @@ var pe = { class: "me-input-property__toolbar" }, me = {
|
|
|
792
812
|
}, null, 8, ["value"])]),
|
|
793
813
|
_: 1
|
|
794
814
|
}),
|
|
795
|
-
|
|
815
|
+
s(O, {
|
|
796
816
|
name: "maxLength",
|
|
797
817
|
label: "最大长度"
|
|
798
818
|
}, {
|
|
799
|
-
default:
|
|
819
|
+
default: _(() => [s(v, {
|
|
800
820
|
value: Y.maxLength,
|
|
801
|
-
"onUpdate:value":
|
|
821
|
+
"onUpdate:value": l[2] ||= (e) => Y.maxLength = e,
|
|
802
822
|
min: 0,
|
|
803
823
|
precision: 0,
|
|
804
824
|
placeholder: "不限",
|
|
@@ -806,90 +826,90 @@ var pe = { class: "me-input-property__toolbar" }, me = {
|
|
|
806
826
|
}, null, 8, ["value"])]),
|
|
807
827
|
_: 1
|
|
808
828
|
}),
|
|
809
|
-
|
|
829
|
+
s(O, {
|
|
810
830
|
name: "pattern",
|
|
811
831
|
label: "正则模式",
|
|
812
832
|
extra: "校验值格式,如 ^[a-zA-Z0-9]+$"
|
|
813
833
|
}, {
|
|
814
|
-
default:
|
|
834
|
+
default: _(() => [s(p, {
|
|
815
835
|
value: Y.pattern,
|
|
816
|
-
"onUpdate:value":
|
|
836
|
+
"onUpdate:value": l[3] ||= (e) => Y.pattern = e,
|
|
817
837
|
placeholder: "如 ^[a-zA-Z0-9]+$",
|
|
818
838
|
"allow-clear": ""
|
|
819
839
|
}, null, 8, ["value"])]),
|
|
820
840
|
_: 1
|
|
821
841
|
})
|
|
822
842
|
], 64)) : a("", !0),
|
|
823
|
-
je(X.value) ? (
|
|
843
|
+
je(X.value) ? (d(), o(n, { key: 1 }, [s(O, {
|
|
824
844
|
name: "min",
|
|
825
845
|
label: "最小值"
|
|
826
846
|
}, {
|
|
827
|
-
default:
|
|
847
|
+
default: _(() => [s(v, {
|
|
828
848
|
value: Y.min,
|
|
829
|
-
"onUpdate:value":
|
|
830
|
-
precision: X.value === "float" ?
|
|
849
|
+
"onUpdate:value": l[4] ||= (e) => Y.min = e,
|
|
850
|
+
precision: X.value === "float" ? h(2) : 0,
|
|
831
851
|
placeholder: "不限",
|
|
832
852
|
class: "me-input-property__rule-input"
|
|
833
853
|
}, null, 8, ["value", "precision"])]),
|
|
834
854
|
_: 1
|
|
835
|
-
}),
|
|
855
|
+
}), s(O, {
|
|
836
856
|
name: "max",
|
|
837
857
|
label: "最大值"
|
|
838
858
|
}, {
|
|
839
|
-
default:
|
|
859
|
+
default: _(() => [s(v, {
|
|
840
860
|
value: Y.max,
|
|
841
|
-
"onUpdate:value":
|
|
842
|
-
precision: X.value === "float" ?
|
|
861
|
+
"onUpdate:value": l[5] ||= (e) => Y.max = e,
|
|
862
|
+
precision: X.value === "float" ? h(2) : 0,
|
|
843
863
|
placeholder: "不限",
|
|
844
864
|
class: "me-input-property__rule-input"
|
|
845
865
|
}, null, 8, ["value", "precision"])]),
|
|
846
866
|
_: 1
|
|
847
867
|
})], 64)) : a("", !0),
|
|
848
|
-
X.value === "date" || X.value === "time" ? (
|
|
868
|
+
X.value === "date" || X.value === "time" ? (d(), o(n, { key: 2 }, [s(O, {
|
|
849
869
|
name: "min",
|
|
850
870
|
label: "最早边界"
|
|
851
871
|
}, {
|
|
852
|
-
default:
|
|
872
|
+
default: _(() => [X.value === "date" ? (d(), i(y, {
|
|
853
873
|
key: 0,
|
|
854
874
|
value: Y.min,
|
|
855
|
-
"onUpdate:value":
|
|
856
|
-
"value-format":
|
|
875
|
+
"onUpdate:value": l[6] ||= (e) => Y.min = e,
|
|
876
|
+
"value-format": h(C),
|
|
857
877
|
style: { width: "100%" }
|
|
858
|
-
}, null, 8, ["value", "value-format"])) : (
|
|
878
|
+
}, null, 8, ["value", "value-format"])) : (d(), i(b, {
|
|
859
879
|
key: 1,
|
|
860
880
|
value: Y.min,
|
|
861
|
-
"onUpdate:value":
|
|
862
|
-
"value-format":
|
|
881
|
+
"onUpdate:value": l[7] ||= (e) => Y.min = e,
|
|
882
|
+
"value-format": h(w),
|
|
863
883
|
style: { width: "100%" }
|
|
864
884
|
}, null, 8, ["value", "value-format"]))]),
|
|
865
885
|
_: 1
|
|
866
|
-
}),
|
|
886
|
+
}), s(O, {
|
|
867
887
|
name: "max",
|
|
868
888
|
label: "最晚边界"
|
|
869
889
|
}, {
|
|
870
|
-
default:
|
|
890
|
+
default: _(() => [X.value === "date" ? (d(), i(y, {
|
|
871
891
|
key: 0,
|
|
872
892
|
value: Y.max,
|
|
873
|
-
"onUpdate:value":
|
|
874
|
-
"value-format":
|
|
893
|
+
"onUpdate:value": l[8] ||= (e) => Y.max = e,
|
|
894
|
+
"value-format": h(C),
|
|
875
895
|
style: { width: "100%" }
|
|
876
|
-
}, null, 8, ["value", "value-format"])) : (
|
|
896
|
+
}, null, 8, ["value", "value-format"])) : (d(), i(b, {
|
|
877
897
|
key: 1,
|
|
878
898
|
value: Y.max,
|
|
879
|
-
"onUpdate:value":
|
|
880
|
-
"value-format":
|
|
899
|
+
"onUpdate:value": l[9] ||= (e) => Y.max = e,
|
|
900
|
+
"value-format": h(w),
|
|
881
901
|
style: { width: "100%" }
|
|
882
902
|
}, null, 8, ["value", "value-format"]))]),
|
|
883
903
|
_: 1
|
|
884
904
|
})], 64)) : a("", !0),
|
|
885
|
-
|
|
905
|
+
s(O, {
|
|
886
906
|
name: "message",
|
|
887
907
|
label: "自定义错误提示",
|
|
888
908
|
extra: "可选,覆盖所有校验规则的默认提示文案"
|
|
889
909
|
}, {
|
|
890
|
-
default:
|
|
910
|
+
default: _(() => [s(p, {
|
|
891
911
|
value: Y.message,
|
|
892
|
-
"onUpdate:value":
|
|
912
|
+
"onUpdate:value": l[10] ||= (e) => Y.message = e,
|
|
893
913
|
placeholder: "如:该属性不合法",
|
|
894
914
|
"allow-clear": ""
|
|
895
915
|
}, null, 8, ["value"])]),
|
|
@@ -900,7 +920,7 @@ var pe = { class: "me-input-property__toolbar" }, me = {
|
|
|
900
920
|
}, 8, ["model", "rules"])]),
|
|
901
921
|
_: 1
|
|
902
922
|
}, 8, ["open", "title"]),
|
|
903
|
-
|
|
923
|
+
ee("div", {
|
|
904
924
|
ref_key: "dropLineEl",
|
|
905
925
|
ref: $,
|
|
906
926
|
class: "me-input-property__drop-line"
|
|
@@ -913,9 +933,9 @@ var pe = { class: "me-input-property__toolbar" }, me = {
|
|
|
913
933
|
});
|
|
914
934
|
//#endregion
|
|
915
935
|
//#region src/components/input-property/index.ts
|
|
916
|
-
|
|
917
|
-
e.component("MeInputProperty",
|
|
936
|
+
U.install = (e) => {
|
|
937
|
+
e.component("MeInputProperty", U);
|
|
918
938
|
};
|
|
919
|
-
var ge =
|
|
939
|
+
var ge = U;
|
|
920
940
|
//#endregion
|
|
921
|
-
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 };
|