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