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