@me-framework/me-ui-antdv-next 0.0.32 → 0.0.34

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