@me-framework/me-ui-antdv-next 0.0.28 → 0.0.30

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