@me-framework/me-ui-antdv-next 0.0.30 → 0.0.32
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.
|
@@ -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
|
|
@@ -252,8 +254,8 @@ var ue = { class: "me-input-property__toolbar" }, de = {
|
|
|
252
254
|
rules: {}
|
|
253
255
|
},
|
|
254
256
|
emits: ["update:modelValue", "change"],
|
|
255
|
-
setup(
|
|
256
|
-
let
|
|
257
|
+
setup(l, { emit: x }) {
|
|
258
|
+
let C = l, D = x, O = h([]), k = h([]), M = h("object"), P = !1, F = r(() => {
|
|
257
259
|
let e = [{
|
|
258
260
|
title: "属性",
|
|
259
261
|
key: "key",
|
|
@@ -264,7 +266,7 @@ var ue = { class: "me-input-property__toolbar" }, de = {
|
|
|
264
266
|
key: "value",
|
|
265
267
|
dataIndex: "value"
|
|
266
268
|
}];
|
|
267
|
-
return
|
|
269
|
+
return C.showRules && C.validate && e.push({
|
|
268
270
|
title: "校验",
|
|
269
271
|
key: "rules",
|
|
270
272
|
dataIndex: "rules",
|
|
@@ -277,118 +279,142 @@ var ue = { class: "me-input-property__toolbar" }, de = {
|
|
|
277
279
|
width: 72,
|
|
278
280
|
align: "center"
|
|
279
281
|
}), e;
|
|
280
|
-
}),
|
|
281
|
-
function
|
|
282
|
+
}), I = r(() => C.draggable && !C.disabled);
|
|
283
|
+
function L(e) {
|
|
284
|
+
M.value = Array.isArray(e) ? "array" : "object";
|
|
282
285
|
let t = /* @__PURE__ */ new Map();
|
|
283
|
-
for (let e of
|
|
286
|
+
for (let e of O.value) {
|
|
284
287
|
let n = e.key.trim();
|
|
285
288
|
n && t.set(n, e);
|
|
286
289
|
}
|
|
287
|
-
|
|
288
|
-
|
|
290
|
+
let n = (e) => t.get(e.trim())?.rules ?? C.rules?.[e.trim()];
|
|
291
|
+
M.value === "array" ? O.value = e.map((e) => {
|
|
292
|
+
let t = String(e[C.keyField] ?? ""), r = e[C.valueField];
|
|
289
293
|
return {
|
|
290
|
-
id:
|
|
291
|
-
key:
|
|
292
|
-
type:
|
|
293
|
-
value:
|
|
294
|
-
|
|
294
|
+
id: E(),
|
|
295
|
+
key: t,
|
|
296
|
+
type: A(r),
|
|
297
|
+
value: r,
|
|
298
|
+
raw: { ...e },
|
|
299
|
+
rules: n(t)
|
|
295
300
|
};
|
|
296
|
-
}),
|
|
301
|
+
}) : O.value = Object.entries(e).map(([e, t]) => ({
|
|
302
|
+
id: E(),
|
|
303
|
+
key: e,
|
|
304
|
+
type: A(t),
|
|
305
|
+
value: t,
|
|
306
|
+
rules: n(e)
|
|
307
|
+
})), G();
|
|
297
308
|
}
|
|
298
|
-
function
|
|
309
|
+
function ie() {
|
|
299
310
|
let e = {};
|
|
300
|
-
for (let t of
|
|
311
|
+
for (let t of O.value) {
|
|
301
312
|
let n = t.key.trim();
|
|
302
|
-
n && (e[n] =
|
|
313
|
+
n && (e[n] = N(t.value, t.type));
|
|
303
314
|
}
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
315
|
+
return e;
|
|
316
|
+
}
|
|
317
|
+
function ae() {
|
|
318
|
+
let e = [];
|
|
319
|
+
for (let t of O.value) {
|
|
320
|
+
let n = t.key.trim();
|
|
321
|
+
if (!n) continue;
|
|
322
|
+
let r = { ...t.raw };
|
|
323
|
+
r[C.keyField] = n, r[C.valueField] = N(t.value, t.type), e.push(r);
|
|
324
|
+
}
|
|
325
|
+
return e;
|
|
326
|
+
}
|
|
327
|
+
function R() {
|
|
328
|
+
let e = M.value === "array" ? ae() : ie();
|
|
329
|
+
P = !0, D("update:modelValue", e);
|
|
330
|
+
let t = C.validate ? {
|
|
331
|
+
duplicatedKeys: k.value,
|
|
332
|
+
hasEmptyKey: O.value.some((e) => !e.key.trim()),
|
|
333
|
+
rowRules: se(O.value),
|
|
334
|
+
valueErrors: ce(O.value)
|
|
310
335
|
} : {
|
|
311
336
|
duplicatedKeys: [],
|
|
312
337
|
hasEmptyKey: !1,
|
|
313
338
|
rowRules: {},
|
|
314
339
|
valueErrors: {}
|
|
315
340
|
};
|
|
316
|
-
|
|
341
|
+
D("change", e, t);
|
|
317
342
|
}
|
|
318
|
-
|
|
343
|
+
v(() => C.modelValue, (e) => {
|
|
319
344
|
if (e) {
|
|
320
|
-
if (
|
|
321
|
-
|
|
345
|
+
if (P) {
|
|
346
|
+
P = !1;
|
|
322
347
|
return;
|
|
323
348
|
}
|
|
324
|
-
|
|
349
|
+
L(e);
|
|
325
350
|
}
|
|
326
351
|
}, { immediate: !0 });
|
|
327
|
-
function
|
|
328
|
-
|
|
352
|
+
function z(e) {
|
|
353
|
+
G(), R();
|
|
329
354
|
}
|
|
330
|
-
function
|
|
331
|
-
|
|
355
|
+
function V(e) {
|
|
356
|
+
G(), R();
|
|
332
357
|
}
|
|
333
|
-
function
|
|
334
|
-
e.type !== t && (e.type = t, e.value =
|
|
358
|
+
function H(e, t) {
|
|
359
|
+
e.type !== t && (e.type = t, e.value = j(e.value, t), e.rules = oe(e.rules, t), G(), R());
|
|
335
360
|
}
|
|
336
|
-
function
|
|
337
|
-
e.value = t,
|
|
361
|
+
function W(e, t) {
|
|
362
|
+
e.value = t, G(), R();
|
|
338
363
|
}
|
|
339
|
-
function
|
|
340
|
-
|
|
341
|
-
id:
|
|
364
|
+
function fe() {
|
|
365
|
+
O.value = [...O.value, {
|
|
366
|
+
id: E(),
|
|
342
367
|
key: "",
|
|
343
368
|
type: "string",
|
|
344
|
-
value: ""
|
|
345
|
-
|
|
369
|
+
value: "",
|
|
370
|
+
raw: {}
|
|
371
|
+
}], G(), R();
|
|
346
372
|
}
|
|
347
|
-
function
|
|
348
|
-
let t =
|
|
349
|
-
t !== -1 && (
|
|
373
|
+
function pe(e) {
|
|
374
|
+
let t = O.value.indexOf(e);
|
|
375
|
+
t !== -1 && (O.value.splice(t, 1), G(), R());
|
|
350
376
|
}
|
|
351
|
-
function
|
|
352
|
-
|
|
377
|
+
function G() {
|
|
378
|
+
k.value = ne(O.value);
|
|
353
379
|
}
|
|
354
|
-
function
|
|
355
|
-
return
|
|
380
|
+
function me(e) {
|
|
381
|
+
return re(e, k.value);
|
|
356
382
|
}
|
|
357
|
-
function
|
|
358
|
-
return
|
|
383
|
+
function he(e) {
|
|
384
|
+
return C.validate ? e.trim() ? me(e) ? "Key 不能重复(忽略大小写)" : "" : "Key 不能为空" : "";
|
|
359
385
|
}
|
|
360
|
-
function
|
|
361
|
-
return
|
|
386
|
+
function ge(e) {
|
|
387
|
+
return C.validate ? !e.key.trim() || me(e.key) : !1;
|
|
362
388
|
}
|
|
363
|
-
function
|
|
364
|
-
return
|
|
389
|
+
function K(e) {
|
|
390
|
+
return C.disabled || !C.validate ? "" : U(e.value, e.type, e.rules) ?? "";
|
|
365
391
|
}
|
|
366
|
-
function
|
|
367
|
-
return !!
|
|
392
|
+
function _e(e) {
|
|
393
|
+
return !!B(e.rules);
|
|
368
394
|
}
|
|
369
|
-
let
|
|
370
|
-
let e =
|
|
371
|
-
return e ? `校验规则${e.key.trim() ? ` · ${e.key.trim()}` : ""}(${
|
|
395
|
+
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(() => {
|
|
396
|
+
let e = J.value;
|
|
397
|
+
return e ? `校验规则${e.key.trim() ? ` · ${e.key.trim()}` : ""}(${ye[e.type] ?? e.type})` : "校验规则";
|
|
372
398
|
});
|
|
373
|
-
function
|
|
399
|
+
function xe(e) {
|
|
374
400
|
return e === "int" || e === "float";
|
|
375
401
|
}
|
|
376
|
-
function
|
|
377
|
-
|
|
402
|
+
function Se(e) {
|
|
403
|
+
J.value = e, Object.keys(Y).forEach((e) => delete Y[e]), Object.assign(Y, B(e.rules) ?? {}), q.value = !0;
|
|
378
404
|
}
|
|
379
|
-
function
|
|
380
|
-
|
|
381
|
-
|
|
405
|
+
function Ce() {
|
|
406
|
+
J.value && ve.value?.validate().then(() => {
|
|
407
|
+
J.value && (J.value.rules = B(Y), q.value = !1, J.value = null, G(), R());
|
|
382
408
|
}).catch(() => {});
|
|
383
409
|
}
|
|
384
|
-
function
|
|
385
|
-
|
|
410
|
+
function we() {
|
|
411
|
+
q.value = !1, J.value = null;
|
|
386
412
|
}
|
|
387
|
-
function
|
|
413
|
+
function Te(e, t) {
|
|
388
414
|
return typeof e == "string" && typeof t == "string" ? e < t ? -1 : +(e > t) : Number(e) - Number(t);
|
|
389
415
|
}
|
|
390
|
-
let
|
|
391
|
-
let e =
|
|
416
|
+
let Ee = r(() => {
|
|
417
|
+
let e = Y.minLength ?? null, t = Y.maxLength ?? null, n = Y.min ?? null, r = Y.max ?? null;
|
|
392
418
|
return {
|
|
393
419
|
minLength: [{ validator: (e, n) => n != null && t != null && n > t ? Promise.reject(/* @__PURE__ */ Error("最短长度不能大于最大长度")) : Promise.resolve() }],
|
|
394
420
|
maxLength: [{ validator: (t, n) => n != null && e != null && n < e ? Promise.reject(/* @__PURE__ */ Error("最大长度不能小于最短长度")) : Promise.resolve() }],
|
|
@@ -400,30 +426,30 @@ var ue = { class: "me-input-property__toolbar" }, de = {
|
|
|
400
426
|
}
|
|
401
427
|
return Promise.resolve();
|
|
402
428
|
} }],
|
|
403
|
-
min: [{ validator: (e, t) => t != null && r != null &&
|
|
404
|
-
max: [{ validator: (e, t) => t != null && n != null &&
|
|
429
|
+
min: [{ validator: (e, t) => t != null && r != null && Te(t, r) > 0 ? Promise.reject(/* @__PURE__ */ Error("最小值不能大于最大值")) : Promise.resolve() }],
|
|
430
|
+
max: [{ validator: (e, t) => t != null && n != null && Te(t, n) < 0 ? Promise.reject(/* @__PURE__ */ Error("最大值不能小于最小值")) : Promise.resolve() }]
|
|
405
431
|
};
|
|
406
|
-
}),
|
|
407
|
-
function
|
|
408
|
-
|
|
432
|
+
}), Z = h(null), Q = h(null);
|
|
433
|
+
function De() {
|
|
434
|
+
Q.value ||= Z.value?.querySelector("tbody") ?? null;
|
|
409
435
|
}
|
|
410
|
-
|
|
411
|
-
await
|
|
436
|
+
f(async () => {
|
|
437
|
+
await u(), De(), Q.value && Me.start(Q.value);
|
|
412
438
|
});
|
|
413
|
-
let
|
|
414
|
-
function
|
|
415
|
-
|
|
439
|
+
let $ = h(null);
|
|
440
|
+
function Oe() {
|
|
441
|
+
$.value && ($.value.style.display = "none");
|
|
416
442
|
}
|
|
417
|
-
function
|
|
418
|
-
let t =
|
|
443
|
+
function ke(e) {
|
|
444
|
+
let t = Q.value, n = Z.value, r = $.value, i = e?.related, a = i instanceof Element ? i.closest("tr") : null;
|
|
419
445
|
if (!t || !n || !r || !a || !t.contains(a)) {
|
|
420
|
-
|
|
446
|
+
Oe();
|
|
421
447
|
return;
|
|
422
448
|
}
|
|
423
|
-
let o = a.getBoundingClientRect(), s = n.getBoundingClientRect(),
|
|
424
|
-
r.style.top = `${
|
|
449
|
+
let o = a.getBoundingClientRect(), s = n.getBoundingClientRect(), ee = e.willInsertAfter ? o.bottom : o.top;
|
|
450
|
+
r.style.top = `${ee - s.top - 1}px`, r.style.left = "0px", r.style.width = `${n.clientWidth}px`, r.style.display = "block";
|
|
425
451
|
}
|
|
426
|
-
function
|
|
452
|
+
function Ae(e) {
|
|
427
453
|
if (!e) return;
|
|
428
454
|
let t = document.querySelector(".me-input-property__drag-fallback");
|
|
429
455
|
if (!t) return;
|
|
@@ -434,83 +460,83 @@ var ue = { class: "me-input-property__toolbar" }, de = {
|
|
|
434
460
|
r[t].style.width = `${e.getBoundingClientRect().width}px`;
|
|
435
461
|
});
|
|
436
462
|
}
|
|
437
|
-
let
|
|
463
|
+
let je = m({
|
|
438
464
|
handle: ".me-input-property__drag",
|
|
439
465
|
animation: 150,
|
|
440
466
|
forceFallback: !0,
|
|
441
467
|
fallbackOnBody: !0,
|
|
442
468
|
fallbackClass: "me-input-property__drag-fallback",
|
|
443
469
|
ghostClass: "me-input-property__row--ghost",
|
|
444
|
-
disabled: r(() => !
|
|
470
|
+
disabled: r(() => !I.value),
|
|
445
471
|
onStart: (e) => {
|
|
446
|
-
|
|
472
|
+
Oe(), Ae(e.item);
|
|
447
473
|
},
|
|
448
|
-
onMove: ((e) => (
|
|
474
|
+
onMove: ((e) => (ke(e), !0)),
|
|
449
475
|
onEnd: () => {
|
|
450
|
-
|
|
476
|
+
Oe(), G(), R();
|
|
451
477
|
}
|
|
452
|
-
}),
|
|
453
|
-
...
|
|
478
|
+
}), Me = b(Q, O, {
|
|
479
|
+
...je,
|
|
454
480
|
immediate: !1
|
|
455
481
|
});
|
|
456
|
-
return
|
|
457
|
-
|
|
458
|
-
}), (r,
|
|
459
|
-
let
|
|
460
|
-
return
|
|
482
|
+
return v(I, (e) => {
|
|
483
|
+
Me.option("disabled", !e);
|
|
484
|
+
}), (r, u) => {
|
|
485
|
+
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");
|
|
486
|
+
return p(), o("div", {
|
|
461
487
|
ref_key: "rootEl",
|
|
462
|
-
ref:
|
|
488
|
+
ref: Z,
|
|
463
489
|
class: "me-input-property"
|
|
464
490
|
}, [
|
|
465
|
-
s("div",
|
|
491
|
+
s("div", le, [c(f, {
|
|
466
492
|
size: "small",
|
|
467
493
|
class: "me-input-property__add-btn",
|
|
468
|
-
disabled:
|
|
469
|
-
onClick:
|
|
494
|
+
disabled: l.disabled,
|
|
495
|
+
onClick: fe
|
|
470
496
|
}, {
|
|
471
|
-
icon:
|
|
497
|
+
icon: y(() => [c(_(e), {
|
|
472
498
|
name: "Plus",
|
|
473
499
|
size: 14
|
|
474
500
|
})]),
|
|
475
|
-
default:
|
|
501
|
+
default: y(() => [u[12] ||= ee(" 新增属性 ", -1)]),
|
|
476
502
|
_: 1
|
|
477
503
|
}, 8, ["disabled"])]),
|
|
478
|
-
|
|
479
|
-
columns:
|
|
480
|
-
"data-source":
|
|
504
|
+
c(D, {
|
|
505
|
+
columns: F.value,
|
|
506
|
+
"data-source": O.value,
|
|
481
507
|
"row-key": (e) => e.id,
|
|
482
508
|
pagination: !1,
|
|
483
|
-
size:
|
|
484
|
-
locale: { emptyText:
|
|
509
|
+
size: l.size,
|
|
510
|
+
locale: { emptyText: l.emptyText },
|
|
485
511
|
class: "me-input-property__table"
|
|
486
512
|
}, {
|
|
487
|
-
bodyCell:
|
|
513
|
+
bodyCell: y(({ column: t, record: n }) => [t.key === "action" ? (p(), o("div", ue, [I.value ? (p(), o("span", de, [c(_(e), {
|
|
488
514
|
name: "GripVertical",
|
|
489
515
|
size: 14
|
|
490
|
-
})])) : a("", !0),
|
|
516
|
+
})])) : a("", !0), c(f, {
|
|
491
517
|
type: "text",
|
|
492
518
|
size: "small",
|
|
493
519
|
class: "me-input-property__del",
|
|
494
|
-
disabled:
|
|
520
|
+
disabled: l.disabled,
|
|
495
521
|
title: "删除该属性",
|
|
496
|
-
onClick: (e) =>
|
|
522
|
+
onClick: (e) => pe(n)
|
|
497
523
|
}, {
|
|
498
|
-
default:
|
|
524
|
+
default: y(() => [c(_(e), {
|
|
499
525
|
name: "Trash2",
|
|
500
526
|
size: 14
|
|
501
527
|
})]),
|
|
502
528
|
_: 1
|
|
503
|
-
}, 8, ["disabled", "onClick"])])) : t.key === "key" ? (
|
|
529
|
+
}, 8, ["disabled", "onClick"])])) : t.key === "key" ? (p(), i(h, {
|
|
504
530
|
key: 1,
|
|
505
|
-
title:
|
|
506
|
-
visible: !
|
|
531
|
+
title: l.disabled ? "" : he(n.key),
|
|
532
|
+
visible: !l.disabled && ge(n)
|
|
507
533
|
}, {
|
|
508
|
-
default:
|
|
534
|
+
default: y(() => [c(m, {
|
|
509
535
|
value: n.key,
|
|
510
|
-
"onUpdate:value": [(e) => n.key = e, (e) =>
|
|
511
|
-
class:
|
|
512
|
-
disabled:
|
|
513
|
-
placeholder:
|
|
536
|
+
"onUpdate:value": [(e) => n.key = e, (e) => z(n)],
|
|
537
|
+
class: d(["me-input-property__key-input", { "me-input-property__field--error": !l.disabled && ge(n) }]),
|
|
538
|
+
disabled: l.disabled,
|
|
539
|
+
placeholder: l.keyPlaceholder
|
|
514
540
|
}, null, 8, [
|
|
515
541
|
"value",
|
|
516
542
|
"onUpdate:value",
|
|
@@ -519,96 +545,96 @@ var ue = { class: "me-input-property__toolbar" }, de = {
|
|
|
519
545
|
"placeholder"
|
|
520
546
|
])]),
|
|
521
547
|
_: 2
|
|
522
|
-
}, 1032, ["title", "visible"])) : t.key === "value" ? (
|
|
548
|
+
}, 1032, ["title", "visible"])) : t.key === "value" ? (p(), i(h, {
|
|
523
549
|
key: 2,
|
|
524
|
-
title:
|
|
525
|
-
visible: !!
|
|
550
|
+
title: K(n),
|
|
551
|
+
visible: !!K(n)
|
|
526
552
|
}, {
|
|
527
|
-
default:
|
|
553
|
+
default: y(() => [c(E, {
|
|
528
554
|
block: !0,
|
|
529
|
-
class:
|
|
555
|
+
class: d(["me-input-property__value", { "me-input-property__field--error": !!K(n) }])
|
|
530
556
|
}, {
|
|
531
|
-
default:
|
|
557
|
+
default: y(() => [l.showType ? (p(), i(v, {
|
|
532
558
|
key: 0,
|
|
533
559
|
value: n.type,
|
|
534
|
-
disabled:
|
|
535
|
-
options:
|
|
560
|
+
disabled: l.disabled,
|
|
561
|
+
options: _(S),
|
|
536
562
|
class: "me-input-property__value-type",
|
|
537
|
-
onChange: (e) =>
|
|
563
|
+
onChange: (e) => H(n, e)
|
|
538
564
|
}, null, 8, [
|
|
539
565
|
"value",
|
|
540
566
|
"disabled",
|
|
541
567
|
"options",
|
|
542
568
|
"onChange"
|
|
543
|
-
])) : a("", !0), n.type === "string" ? (
|
|
569
|
+
])) : a("", !0), n.type === "string" ? (p(), i(m, {
|
|
544
570
|
key: 1,
|
|
545
571
|
value: n.value,
|
|
546
|
-
"onUpdate:value": [(e) => n.value = e, (e) =>
|
|
572
|
+
"onUpdate:value": [(e) => n.value = e, (e) => V(n)],
|
|
547
573
|
class: "me-input-property__value-editor",
|
|
548
|
-
disabled:
|
|
549
|
-
placeholder:
|
|
574
|
+
disabled: l.disabled,
|
|
575
|
+
placeholder: l.valuePlaceholder
|
|
550
576
|
}, null, 8, [
|
|
551
577
|
"value",
|
|
552
578
|
"onUpdate:value",
|
|
553
579
|
"disabled",
|
|
554
580
|
"placeholder"
|
|
555
|
-
])) : n.type === "int" ? (
|
|
581
|
+
])) : n.type === "int" ? (p(), i(b, {
|
|
556
582
|
key: 2,
|
|
557
583
|
value: n.value,
|
|
558
|
-
"onUpdate:value": [(e) => n.value = e, (e) =>
|
|
584
|
+
"onUpdate:value": [(e) => n.value = e, (e) => V(n)],
|
|
559
585
|
class: "me-input-property__value-editor",
|
|
560
|
-
disabled:
|
|
561
|
-
placeholder:
|
|
586
|
+
disabled: l.disabled,
|
|
587
|
+
placeholder: l.valuePlaceholder
|
|
562
588
|
}, null, 8, [
|
|
563
589
|
"value",
|
|
564
590
|
"onUpdate:value",
|
|
565
591
|
"disabled",
|
|
566
592
|
"placeholder"
|
|
567
|
-
])) : n.type === "float" ? (
|
|
593
|
+
])) : n.type === "float" ? (p(), i(b, {
|
|
568
594
|
key: 3,
|
|
569
595
|
value: n.value,
|
|
570
|
-
"onUpdate:value": [(e) => n.value = e, (e) =>
|
|
596
|
+
"onUpdate:value": [(e) => n.value = e, (e) => V(n)],
|
|
571
597
|
class: "me-input-property__value-editor",
|
|
572
|
-
disabled:
|
|
573
|
-
placeholder:
|
|
574
|
-
precision:
|
|
598
|
+
disabled: l.disabled,
|
|
599
|
+
placeholder: l.valuePlaceholder,
|
|
600
|
+
precision: _(2)
|
|
575
601
|
}, null, 8, [
|
|
576
602
|
"value",
|
|
577
603
|
"onUpdate:value",
|
|
578
604
|
"disabled",
|
|
579
605
|
"placeholder",
|
|
580
606
|
"precision"
|
|
581
|
-
])) : n.type === "date" ? (
|
|
607
|
+
])) : n.type === "date" ? (p(), i(x, {
|
|
582
608
|
key: 4,
|
|
583
609
|
value: n.value,
|
|
584
|
-
"onUpdate:value": [(e) => n.value = e, (e) =>
|
|
610
|
+
"onUpdate:value": [(e) => n.value = e, (e) => V(n)],
|
|
585
611
|
class: "me-input-property__value-editor",
|
|
586
|
-
"value-format":
|
|
587
|
-
disabled:
|
|
612
|
+
"value-format": _(w),
|
|
613
|
+
disabled: l.disabled
|
|
588
614
|
}, null, 8, [
|
|
589
615
|
"value",
|
|
590
616
|
"onUpdate:value",
|
|
591
617
|
"value-format",
|
|
592
618
|
"disabled"
|
|
593
|
-
])) : n.type === "time" ? (
|
|
619
|
+
])) : n.type === "time" ? (p(), i(C, {
|
|
594
620
|
key: 5,
|
|
595
621
|
value: n.value,
|
|
596
|
-
"onUpdate:value": [(e) => n.value = e, (e) =>
|
|
622
|
+
"onUpdate:value": [(e) => n.value = e, (e) => V(n)],
|
|
597
623
|
class: "me-input-property__value-editor",
|
|
598
|
-
"value-format":
|
|
599
|
-
disabled:
|
|
624
|
+
"value-format": _(T),
|
|
625
|
+
disabled: l.disabled
|
|
600
626
|
}, null, 8, [
|
|
601
627
|
"value",
|
|
602
628
|
"onUpdate:value",
|
|
603
629
|
"value-format",
|
|
604
630
|
"disabled"
|
|
605
|
-
])) : n.type === "boolean" ? (
|
|
631
|
+
])) : n.type === "boolean" ? (p(), i(v, {
|
|
606
632
|
key: 6,
|
|
607
633
|
value: n.value,
|
|
608
634
|
class: "me-input-property__value-editor",
|
|
609
|
-
disabled:
|
|
610
|
-
options:
|
|
611
|
-
onChange: (e) =>
|
|
635
|
+
disabled: l.disabled,
|
|
636
|
+
options: _(te),
|
|
637
|
+
onChange: (e) => W(n, e)
|
|
612
638
|
}, null, 8, [
|
|
613
639
|
"value",
|
|
614
640
|
"disabled",
|
|
@@ -618,18 +644,18 @@ var ue = { class: "me-input-property__toolbar" }, de = {
|
|
|
618
644
|
_: 2
|
|
619
645
|
}, 1032, ["class"])]),
|
|
620
646
|
_: 2
|
|
621
|
-
}, 1032, ["title", "visible"])) : t.key === "rules" ? (
|
|
647
|
+
}, 1032, ["title", "visible"])) : t.key === "rules" ? (p(), i(h, {
|
|
622
648
|
key: 3,
|
|
623
649
|
title: "配置校验规则"
|
|
624
650
|
}, {
|
|
625
|
-
default:
|
|
651
|
+
default: y(() => [c(f, {
|
|
626
652
|
type: "text",
|
|
627
653
|
size: "small",
|
|
628
|
-
class:
|
|
629
|
-
disabled:
|
|
630
|
-
onClick: (e) =>
|
|
654
|
+
class: d(["me-input-property__rules-btn", { "is-active": _e(n) }]),
|
|
655
|
+
disabled: l.disabled,
|
|
656
|
+
onClick: (e) => Se(n)
|
|
631
657
|
}, {
|
|
632
|
-
default:
|
|
658
|
+
default: y(() => [c(_(e), {
|
|
633
659
|
name: "WandSparkles",
|
|
634
660
|
size: 14
|
|
635
661
|
})]),
|
|
@@ -649,44 +675,44 @@ var ue = { class: "me-input-property__toolbar" }, de = {
|
|
|
649
675
|
"size",
|
|
650
676
|
"locale"
|
|
651
677
|
]),
|
|
652
|
-
|
|
653
|
-
open:
|
|
654
|
-
"onUpdate:open":
|
|
678
|
+
c(_(t), {
|
|
679
|
+
open: q.value,
|
|
680
|
+
"onUpdate:open": u[11] ||= (e) => q.value = e,
|
|
655
681
|
width: 480,
|
|
656
682
|
fullscreen: !1,
|
|
657
|
-
title:
|
|
683
|
+
title: be.value,
|
|
658
684
|
"ok-text": "保存",
|
|
659
685
|
"cancel-text": "取消",
|
|
660
|
-
onOk:
|
|
661
|
-
onCancel:
|
|
686
|
+
onOk: Ce,
|
|
687
|
+
onCancel: we
|
|
662
688
|
}, {
|
|
663
|
-
default:
|
|
689
|
+
default: y(() => [c(j, {
|
|
664
690
|
ref_key: "ruleFormRef",
|
|
665
|
-
ref:
|
|
666
|
-
model:
|
|
667
|
-
rules:
|
|
691
|
+
ref: ve,
|
|
692
|
+
model: Y,
|
|
693
|
+
rules: Ee.value,
|
|
668
694
|
layout: "vertical",
|
|
669
695
|
class: "me-input-property__rule-form"
|
|
670
696
|
}, {
|
|
671
|
-
default:
|
|
672
|
-
|
|
673
|
-
default:
|
|
674
|
-
checked:
|
|
675
|
-
"onUpdate:checked":
|
|
697
|
+
default: y(() => [
|
|
698
|
+
c(A, { name: "required" }, {
|
|
699
|
+
default: y(() => [c(k, {
|
|
700
|
+
checked: Y.required,
|
|
701
|
+
"onUpdate:checked": u[0] ||= (e) => Y.required = e
|
|
676
702
|
}, {
|
|
677
|
-
default:
|
|
703
|
+
default: y(() => [...u[13] ||= [ee("必填(值不能为空)", -1)]]),
|
|
678
704
|
_: 1
|
|
679
705
|
}, 8, ["checked"])]),
|
|
680
706
|
_: 1
|
|
681
707
|
}),
|
|
682
|
-
|
|
683
|
-
|
|
708
|
+
X.value === "string" ? (p(), o(n, { key: 0 }, [
|
|
709
|
+
c(A, {
|
|
684
710
|
name: "minLength",
|
|
685
711
|
label: "最短长度"
|
|
686
712
|
}, {
|
|
687
|
-
default:
|
|
688
|
-
value:
|
|
689
|
-
"onUpdate:value":
|
|
713
|
+
default: y(() => [c(b, {
|
|
714
|
+
value: Y.minLength,
|
|
715
|
+
"onUpdate:value": u[1] ||= (e) => Y.minLength = e,
|
|
690
716
|
min: 0,
|
|
691
717
|
precision: 0,
|
|
692
718
|
placeholder: "不限",
|
|
@@ -694,13 +720,13 @@ var ue = { class: "me-input-property__toolbar" }, de = {
|
|
|
694
720
|
}, null, 8, ["value"])]),
|
|
695
721
|
_: 1
|
|
696
722
|
}),
|
|
697
|
-
|
|
723
|
+
c(A, {
|
|
698
724
|
name: "maxLength",
|
|
699
725
|
label: "最大长度"
|
|
700
726
|
}, {
|
|
701
|
-
default:
|
|
702
|
-
value:
|
|
703
|
-
"onUpdate:value":
|
|
727
|
+
default: y(() => [c(b, {
|
|
728
|
+
value: Y.maxLength,
|
|
729
|
+
"onUpdate:value": u[2] ||= (e) => Y.maxLength = e,
|
|
704
730
|
min: 0,
|
|
705
731
|
precision: 0,
|
|
706
732
|
placeholder: "不限",
|
|
@@ -708,90 +734,90 @@ var ue = { class: "me-input-property__toolbar" }, de = {
|
|
|
708
734
|
}, null, 8, ["value"])]),
|
|
709
735
|
_: 1
|
|
710
736
|
}),
|
|
711
|
-
|
|
737
|
+
c(A, {
|
|
712
738
|
name: "pattern",
|
|
713
739
|
label: "正则模式",
|
|
714
740
|
extra: "校验值格式,如 ^[a-zA-Z0-9]+$"
|
|
715
741
|
}, {
|
|
716
|
-
default:
|
|
717
|
-
value:
|
|
718
|
-
"onUpdate:value":
|
|
742
|
+
default: y(() => [c(m, {
|
|
743
|
+
value: Y.pattern,
|
|
744
|
+
"onUpdate:value": u[3] ||= (e) => Y.pattern = e,
|
|
719
745
|
placeholder: "如 ^[a-zA-Z0-9]+$",
|
|
720
746
|
"allow-clear": ""
|
|
721
747
|
}, null, 8, ["value"])]),
|
|
722
748
|
_: 1
|
|
723
749
|
})
|
|
724
750
|
], 64)) : a("", !0),
|
|
725
|
-
|
|
751
|
+
xe(X.value) ? (p(), o(n, { key: 1 }, [c(A, {
|
|
726
752
|
name: "min",
|
|
727
753
|
label: "最小值"
|
|
728
754
|
}, {
|
|
729
|
-
default:
|
|
730
|
-
value:
|
|
731
|
-
"onUpdate:value":
|
|
732
|
-
precision:
|
|
755
|
+
default: y(() => [c(b, {
|
|
756
|
+
value: Y.min,
|
|
757
|
+
"onUpdate:value": u[4] ||= (e) => Y.min = e,
|
|
758
|
+
precision: X.value === "float" ? _(2) : 0,
|
|
733
759
|
placeholder: "不限",
|
|
734
760
|
class: "me-input-property__rule-input"
|
|
735
761
|
}, null, 8, ["value", "precision"])]),
|
|
736
762
|
_: 1
|
|
737
|
-
}),
|
|
763
|
+
}), c(A, {
|
|
738
764
|
name: "max",
|
|
739
765
|
label: "最大值"
|
|
740
766
|
}, {
|
|
741
|
-
default:
|
|
742
|
-
value:
|
|
743
|
-
"onUpdate:value":
|
|
744
|
-
precision:
|
|
767
|
+
default: y(() => [c(b, {
|
|
768
|
+
value: Y.max,
|
|
769
|
+
"onUpdate:value": u[5] ||= (e) => Y.max = e,
|
|
770
|
+
precision: X.value === "float" ? _(2) : 0,
|
|
745
771
|
placeholder: "不限",
|
|
746
772
|
class: "me-input-property__rule-input"
|
|
747
773
|
}, null, 8, ["value", "precision"])]),
|
|
748
774
|
_: 1
|
|
749
775
|
})], 64)) : a("", !0),
|
|
750
|
-
|
|
776
|
+
X.value === "date" || X.value === "time" ? (p(), o(n, { key: 2 }, [c(A, {
|
|
751
777
|
name: "min",
|
|
752
778
|
label: "最早边界"
|
|
753
779
|
}, {
|
|
754
|
-
default:
|
|
780
|
+
default: y(() => [X.value === "date" ? (p(), i(x, {
|
|
755
781
|
key: 0,
|
|
756
|
-
value:
|
|
757
|
-
"onUpdate:value":
|
|
758
|
-
"value-format":
|
|
782
|
+
value: Y.min,
|
|
783
|
+
"onUpdate:value": u[6] ||= (e) => Y.min = e,
|
|
784
|
+
"value-format": _(w),
|
|
759
785
|
style: { width: "100%" }
|
|
760
|
-
}, null, 8, ["value", "value-format"])) : (
|
|
786
|
+
}, null, 8, ["value", "value-format"])) : (p(), i(C, {
|
|
761
787
|
key: 1,
|
|
762
|
-
value:
|
|
763
|
-
"onUpdate:value":
|
|
764
|
-
"value-format":
|
|
788
|
+
value: Y.min,
|
|
789
|
+
"onUpdate:value": u[7] ||= (e) => Y.min = e,
|
|
790
|
+
"value-format": _(T),
|
|
765
791
|
style: { width: "100%" }
|
|
766
792
|
}, null, 8, ["value", "value-format"]))]),
|
|
767
793
|
_: 1
|
|
768
|
-
}),
|
|
794
|
+
}), c(A, {
|
|
769
795
|
name: "max",
|
|
770
796
|
label: "最晚边界"
|
|
771
797
|
}, {
|
|
772
|
-
default:
|
|
798
|
+
default: y(() => [X.value === "date" ? (p(), i(x, {
|
|
773
799
|
key: 0,
|
|
774
|
-
value:
|
|
775
|
-
"onUpdate:value":
|
|
776
|
-
"value-format":
|
|
800
|
+
value: Y.max,
|
|
801
|
+
"onUpdate:value": u[8] ||= (e) => Y.max = e,
|
|
802
|
+
"value-format": _(w),
|
|
777
803
|
style: { width: "100%" }
|
|
778
|
-
}, null, 8, ["value", "value-format"])) : (
|
|
804
|
+
}, null, 8, ["value", "value-format"])) : (p(), i(C, {
|
|
779
805
|
key: 1,
|
|
780
|
-
value:
|
|
781
|
-
"onUpdate:value":
|
|
782
|
-
"value-format":
|
|
806
|
+
value: Y.max,
|
|
807
|
+
"onUpdate:value": u[9] ||= (e) => Y.max = e,
|
|
808
|
+
"value-format": _(T),
|
|
783
809
|
style: { width: "100%" }
|
|
784
810
|
}, null, 8, ["value", "value-format"]))]),
|
|
785
811
|
_: 1
|
|
786
812
|
})], 64)) : a("", !0),
|
|
787
|
-
|
|
813
|
+
c(A, {
|
|
788
814
|
name: "message",
|
|
789
815
|
label: "自定义错误提示",
|
|
790
816
|
extra: "可选,覆盖所有校验规则的默认提示文案"
|
|
791
817
|
}, {
|
|
792
|
-
default:
|
|
793
|
-
value:
|
|
794
|
-
"onUpdate:value":
|
|
818
|
+
default: y(() => [c(m, {
|
|
819
|
+
value: Y.message,
|
|
820
|
+
"onUpdate:value": u[10] ||= (e) => Y.message = e,
|
|
795
821
|
placeholder: "如:该属性不合法",
|
|
796
822
|
"allow-clear": ""
|
|
797
823
|
}, null, 8, ["value"])]),
|
|
@@ -804,7 +830,7 @@ var ue = { class: "me-input-property__toolbar" }, de = {
|
|
|
804
830
|
}, 8, ["open", "title"]),
|
|
805
831
|
s("div", {
|
|
806
832
|
ref_key: "dropLineEl",
|
|
807
|
-
ref:
|
|
833
|
+
ref: $,
|
|
808
834
|
class: "me-input-property__drop-line"
|
|
809
835
|
}, null, 512)
|
|
810
836
|
], 512);
|
|
@@ -813,9 +839,9 @@ var ue = { class: "me-input-property__toolbar" }, de = {
|
|
|
813
839
|
});
|
|
814
840
|
//#endregion
|
|
815
841
|
//#region src/components/input-property/index.ts
|
|
816
|
-
|
|
817
|
-
e.component("MeInputProperty",
|
|
842
|
+
W.install = (e) => {
|
|
843
|
+
e.component("MeInputProperty", W);
|
|
818
844
|
};
|
|
819
|
-
var
|
|
845
|
+
var fe = W;
|
|
820
846
|
//#endregion
|
|
821
|
-
export {
|
|
847
|
+
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 };
|