@rft-rc/recycle-ui 0.0.3-rc.6 → 0.0.3-rc.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as ue, inject as be, computed as B, onMounted as Je, createElementBlock as h, openBlock as u, normalizeStyle as re, normalizeClass as J, createCommentVNode as F, toDisplayString as G, renderSlot as Z, Fragment as de, createBlock as se, createTextVNode as Se, createElementVNode as P, ref as W, watchEffect as Et, provide as Ce, renderList as ye, onUnmounted as
|
|
1
|
+
import { defineComponent as ue, inject as be, computed as B, onMounted as Je, createElementBlock as h, openBlock as u, normalizeStyle as re, normalizeClass as J, createCommentVNode as F, toDisplayString as G, renderSlot as Z, Fragment as de, createBlock as se, createTextVNode as Se, createElementVNode as P, ref as W, watchEffect as Et, provide as Ce, renderList as ye, onUnmounted as nt, Teleport as dt, createVNode as X, Transition as Ye, withCtx as oe, createApp as Pt, reactive as Nt, TransitionGroup as zt, render as It, watch as _e, withModifiers as Be, unref as ne, nextTick as Ee, withDirectives as Tt, vModelText as Ft, useSlots as Yt, resolveDynamicComponent as pt } from "vue";
|
|
2
2
|
const Lt = {
|
|
3
3
|
key: 0,
|
|
4
4
|
class: "rc-icon__unicode"
|
|
@@ -13,8 +13,8 @@ const Lt = {
|
|
|
13
13
|
code: { default: "" }
|
|
14
14
|
},
|
|
15
15
|
setup(t) {
|
|
16
|
-
const i = t, l = be(ut, {}), e = B(() => (l == null ? void 0 : l.iconClass) || "iconfont"), g = B(() => i.name || ""),
|
|
17
|
-
fontSize:
|
|
16
|
+
const i = t, l = be(ut, {}), e = B(() => (l == null ? void 0 : l.iconClass) || "iconfont"), g = B(() => i.name || ""), v = B(() => typeof i.size == "number" ? `${i.size}px` : i.size || "16px"), $ = B(() => ({
|
|
17
|
+
fontSize: v.value,
|
|
18
18
|
color: i.color || void 0,
|
|
19
19
|
lineHeight: 1,
|
|
20
20
|
fontFamily: (l == null ? void 0 : l.iconClass) || "iconfont"
|
|
@@ -23,19 +23,19 @@ const Lt = {
|
|
|
23
23
|
if (r == null || r === "" || r === 0) return "";
|
|
24
24
|
if (typeof r == "number")
|
|
25
25
|
return String.fromCharCode(r);
|
|
26
|
-
const
|
|
26
|
+
const d = String(r).replace(/^0x/i, ""), N = parseInt(d, 16);
|
|
27
27
|
return Number.isNaN(N) ? "" : String.fromCharCode(N);
|
|
28
28
|
});
|
|
29
29
|
return Je(() => {
|
|
30
30
|
if (typeof window > "u") return;
|
|
31
31
|
const r = l && l.iconCssUrl || ft.iconCssUrl;
|
|
32
32
|
if (!r) return;
|
|
33
|
-
const
|
|
34
|
-
if (!document.head.querySelector(
|
|
35
|
-
const
|
|
36
|
-
|
|
33
|
+
const d = `link[rel="stylesheet"][data-rcui-icon="true"][href="${r}"]`;
|
|
34
|
+
if (!document.head.querySelector(d)) {
|
|
35
|
+
const C = document.createElement("link");
|
|
36
|
+
C.rel = "stylesheet", C.href = r, C.setAttribute("data-rcui-icon", "true"), document.head.appendChild(C);
|
|
37
37
|
}
|
|
38
|
-
}), (r,
|
|
38
|
+
}), (r, d) => (u(), h("i", {
|
|
39
39
|
class: J(["rc-icon", [e.value, g.value, { "rc-icon--spin": t.spin }]]),
|
|
40
40
|
style: re($.value),
|
|
41
41
|
"aria-hidden": "true"
|
|
@@ -74,7 +74,7 @@ const Lt = {
|
|
|
74
74
|
},
|
|
75
75
|
emits: ["click"],
|
|
76
76
|
setup(t, { emit: i }) {
|
|
77
|
-
const l = t, e = i, g = be("rcFormActions", void 0),
|
|
77
|
+
const l = t, e = i, g = be("rcFormActions", void 0), v = B(() => l.formType === "submit" ? "submit" : l.formType === "reset" ? "reset" : "button"), $ = (r) => {
|
|
78
78
|
if (!(l.disabled || l.loading)) {
|
|
79
79
|
if (l.formType && g)
|
|
80
80
|
if (l.formType === "submit") {
|
|
@@ -87,11 +87,11 @@ const Lt = {
|
|
|
87
87
|
const r = l.round;
|
|
88
88
|
return typeof r == "boolean" ? r ? "999px" : "6px" : typeof r == "number" ? `${r}px` : String(r);
|
|
89
89
|
});
|
|
90
|
-
return (r,
|
|
90
|
+
return (r, d) => (u(), h("button", {
|
|
91
91
|
class: J(["rc-button", [`rc-button--${t.type}`, `rc-button--${t.size}`, t.mode ? `rc-button--${t.mode}` : "", { "is-block": t.block, "is-disabled": t.disabled, "is-loading": t.loading }]]),
|
|
92
92
|
style: re({ borderRadius: o.value }),
|
|
93
93
|
disabled: t.disabled || t.loading,
|
|
94
|
-
type:
|
|
94
|
+
type: v.value,
|
|
95
95
|
onClick: $
|
|
96
96
|
}, [
|
|
97
97
|
t.loading ? (u(), h("span", Ht)) : (u(), h(de, { key: 1 }, [
|
|
@@ -134,25 +134,25 @@ const Kt = { class: "rc-desc-item__value" }, jt = /* @__PURE__ */ ue({
|
|
|
134
134
|
setup(t) {
|
|
135
135
|
const i = t;
|
|
136
136
|
be("rcDescItemWidth", void 0), be("rcDescSingleWidth", ""), be("rcDescGap", "0px");
|
|
137
|
-
const l = be("rcDescGapPx", 0), e = be("rcDescColCount", 1), g = be("rcDescLabelWidth", ""),
|
|
138
|
-
const N = typeof i.span == "string" ? parseInt(i.span, 10) : i.span,
|
|
139
|
-
return Math.min(w,
|
|
137
|
+
const l = be("rcDescGapPx", 0), e = be("rcDescColCount", 1), g = be("rcDescLabelWidth", ""), v = be("rcDescLabelPosition", "left"), $ = B(() => (typeof (v == null ? void 0 : v.value) == "string" ? v.value : v) || "left"), o = B(() => {
|
|
138
|
+
const N = typeof i.span == "string" ? parseInt(i.span, 10) : i.span, C = typeof (e == null ? void 0 : e.value) == "number" ? e.value : e, w = !Number.isNaN(N) && N > 0 ? N : 1;
|
|
139
|
+
return Math.min(w, C || 1);
|
|
140
140
|
}), r = B(() => {
|
|
141
|
-
const N = typeof (e == null ? void 0 : e.value) == "number" ? e.value : e,
|
|
141
|
+
const N = typeof (e == null ? void 0 : e.value) == "number" ? e.value : e, C = typeof (l == null ? void 0 : l.value) == "number" ? l.value : l, w = o.value;
|
|
142
142
|
if (!N || N <= 1 || w >= N) return "100%";
|
|
143
|
-
const
|
|
144
|
-
return `calc((100% - ${
|
|
145
|
-
}),
|
|
146
|
-
const N = typeof (g == null ? void 0 : g.value) == "string" ? g.value : g,
|
|
147
|
-
return
|
|
143
|
+
const x = (N - 1) * C, H = (w - 1) * C;
|
|
144
|
+
return `calc((100% - ${x}px) * ${w} / ${N} + ${H}px)`;
|
|
145
|
+
}), d = B(() => {
|
|
146
|
+
const N = typeof (g == null ? void 0 : g.value) == "string" ? g.value : g, C = i.labelWidth !== "" ? i.labelWidth : N || "";
|
|
147
|
+
return C ? { width: typeof C == "number" ? `${C}px` : String(C), flex: "0 0 auto" } : {};
|
|
148
148
|
});
|
|
149
|
-
return (N,
|
|
149
|
+
return (N, C) => (u(), h("div", {
|
|
150
150
|
class: J(["rc-desc-item", { "rc-desc-item--label-top": $.value === "top" }]),
|
|
151
151
|
style: re({ width: r.value, flex: `0 0 ${r.value}` })
|
|
152
152
|
}, [
|
|
153
153
|
P("div", {
|
|
154
154
|
class: "rc-desc-item__label",
|
|
155
|
-
style: re(
|
|
155
|
+
style: re(d.value)
|
|
156
156
|
}, [
|
|
157
157
|
Z(N.$slots, "label", {}, () => [
|
|
158
158
|
Se(G(t.label), 1)
|
|
@@ -165,7 +165,7 @@ const Kt = { class: "rc-desc-item__value" }, jt = /* @__PURE__ */ ue({
|
|
|
165
165
|
])
|
|
166
166
|
], 6));
|
|
167
167
|
}
|
|
168
|
-
}), Ke = /* @__PURE__ */ ce(jt, [["__scopeId", "data-v-
|
|
168
|
+
}), Ke = /* @__PURE__ */ ce(jt, [["__scopeId", "data-v-f486f0d5"]]), Jt = { class: "rc-descriptions" }, Qt = {
|
|
169
169
|
key: 0,
|
|
170
170
|
class: "rc-descriptions__title"
|
|
171
171
|
}, Xt = /* @__PURE__ */ ue({
|
|
@@ -182,31 +182,31 @@ const Kt = { class: "rc-desc-item__value" }, jt = /* @__PURE__ */ ue({
|
|
|
182
182
|
},
|
|
183
183
|
setup(t) {
|
|
184
184
|
const i = t, l = W(null), e = B(() => typeof i.gap == "number" ? `${i.gap}px` : String(i.gap)), g = B(() => {
|
|
185
|
-
const
|
|
186
|
-
return !Number.isNaN(
|
|
187
|
-
}),
|
|
185
|
+
const d = typeof i.column == "string" ? Number.parseInt(i.column, 10) : i.column ?? 1;
|
|
186
|
+
return !Number.isNaN(d) && d > 0 ? d : 1;
|
|
187
|
+
}), v = W("100%"), $ = W("100%");
|
|
188
188
|
Et(() => {
|
|
189
|
-
const
|
|
190
|
-
if (
|
|
191
|
-
|
|
189
|
+
const d = g.value;
|
|
190
|
+
if (d <= 1)
|
|
191
|
+
v.value = "100%", $.value = "100%";
|
|
192
192
|
else {
|
|
193
|
-
const N = typeof i.gap == "number" ? i.gap : parseFloat(String(i.gap)) || 0, w = `calc((100% - ${(
|
|
194
|
-
$.value = w,
|
|
193
|
+
const N = typeof i.gap == "number" ? i.gap : parseFloat(String(i.gap)) || 0, w = `calc((100% - ${(d - 1) * N}px) / ${d})`;
|
|
194
|
+
$.value = w, v.value = w;
|
|
195
195
|
}
|
|
196
|
-
}), Ce("rcDescItemWidth",
|
|
196
|
+
}), Ce("rcDescItemWidth", v), Ce("rcDescSingleWidth", $), Ce("rcDescColCount", g), Ce("rcDescGapPx", B(() => typeof i.gap == "number" ? i.gap : parseFloat(String(i.gap)) || 0));
|
|
197
197
|
const o = B(() => i.labelWidth === "" || i.labelWidth === void 0 ? "" : typeof i.labelWidth == "number" ? `${i.labelWidth}px` : String(i.labelWidth));
|
|
198
198
|
Ce("rcDescLabelWidth", o), Ce("rcDescGap", B(() => typeof i.gap == "number" ? `${i.gap}px` : String(i.gap))), Ce("rcDescLabelPosition", B(() => i.labelPosition || "left"));
|
|
199
199
|
const r = B(() => {
|
|
200
|
-
var
|
|
201
|
-
const
|
|
202
|
-
return (
|
|
203
|
-
label: H == null ? void 0 : H[
|
|
200
|
+
var C, w, x;
|
|
201
|
+
const d = ((C = i.keyMap) == null ? void 0 : C.key) ?? "label", N = ((w = i.keyMap) == null ? void 0 : w.value) ?? "value";
|
|
202
|
+
return (x = i.data) != null && x.length ? i.data.map((H) => ({
|
|
203
|
+
label: H == null ? void 0 : H[d],
|
|
204
204
|
value: H == null ? void 0 : H[N]
|
|
205
205
|
})) : [];
|
|
206
206
|
});
|
|
207
|
-
return (
|
|
208
|
-
|
|
209
|
-
Z(
|
|
207
|
+
return (d, N) => (u(), h("div", Jt, [
|
|
208
|
+
d.$slots.title || t.title ? (u(), h("div", Qt, [
|
|
209
|
+
Z(d.$slots, "title", {}, () => [
|
|
210
210
|
Se(G(t.title), 1)
|
|
211
211
|
], !0)
|
|
212
212
|
])) : F("", !0),
|
|
@@ -216,22 +216,22 @@ const Kt = { class: "rc-desc-item__value" }, jt = /* @__PURE__ */ ue({
|
|
|
216
216
|
ref_key: "wrapEl",
|
|
217
217
|
ref: l
|
|
218
218
|
}, [
|
|
219
|
-
r.value.length ? (u(!0), h(de, { key: 0 }, ye(r.value, (
|
|
219
|
+
r.value.length ? (u(!0), h(de, { key: 0 }, ye(r.value, (C, w) => (u(), se(Ke, {
|
|
220
220
|
key: w,
|
|
221
|
-
label:
|
|
222
|
-
value:
|
|
221
|
+
label: C.label,
|
|
222
|
+
value: C.value,
|
|
223
223
|
"label-width": t.labelWidth
|
|
224
|
-
}, null, 8, ["label", "value", "label-width"]))), 128)) : Z(
|
|
224
|
+
}, null, 8, ["label", "value", "label-width"]))), 128)) : Z(d.$slots, "default", { key: 1 }, void 0, !0)
|
|
225
225
|
], 4)
|
|
226
226
|
]));
|
|
227
227
|
}
|
|
228
|
-
}),
|
|
229
|
-
|
|
228
|
+
}), Xe = /* @__PURE__ */ ce(Xt, [["__scopeId", "data-v-f8388d0b"]]);
|
|
229
|
+
Xe.name = "rc-descriptions";
|
|
230
230
|
Ke.name = "rc-descriptions-item";
|
|
231
231
|
function yt(t) {
|
|
232
|
-
return t.component(
|
|
232
|
+
return t.component(Xe.name, Xe), t.component("RcDescriptions", Xe), t.component(Ke.name, Ke), t.component("RcDescriptionsItem", Ke), t;
|
|
233
233
|
}
|
|
234
|
-
const Qa =
|
|
234
|
+
const Qa = Xe, Xa = Ke, Zt = { class: "rc-card__title" }, en = { class: "rc-card__title-text" }, tn = {
|
|
235
235
|
key: 0,
|
|
236
236
|
class: "rc-card__status"
|
|
237
237
|
}, nn = {
|
|
@@ -264,13 +264,13 @@ const Qa = Qe, Xa = Ke, Zt = { class: "rc-card__title" }, en = { class: "rc-card
|
|
|
264
264
|
backgroundColor: i.color || "var(--rc-white)",
|
|
265
265
|
borderRadius: o,
|
|
266
266
|
boxShadow: $(i.elevation),
|
|
267
|
-
width:
|
|
268
|
-
height:
|
|
267
|
+
width: v(i.width),
|
|
268
|
+
height: v(i.height)
|
|
269
269
|
};
|
|
270
270
|
}), e = B(() => i.padding || "16px"), g = B(
|
|
271
271
|
() => typeof i.gap == "number" ? `${i.gap}px` : String(i.gap)
|
|
272
272
|
);
|
|
273
|
-
function
|
|
273
|
+
function v(o) {
|
|
274
274
|
return o == null || o === "" ? "" : typeof o == "number" ? `${o}px` : String(o);
|
|
275
275
|
}
|
|
276
276
|
function $(o) {
|
|
@@ -347,21 +347,21 @@ const rn = {
|
|
|
347
347
|
setup(t, { expose: i }) {
|
|
348
348
|
const l = t, e = W(!0);
|
|
349
349
|
let g;
|
|
350
|
-
function
|
|
350
|
+
function v() {
|
|
351
351
|
g && (clearTimeout(g), g = null);
|
|
352
352
|
}
|
|
353
353
|
function $() {
|
|
354
|
-
|
|
354
|
+
v(), e.value = !1;
|
|
355
355
|
}
|
|
356
356
|
return i({ close: $ }), Je(() => {
|
|
357
357
|
l.duration && l.duration > 0 && (g = setTimeout(() => {
|
|
358
358
|
$();
|
|
359
359
|
}, l.duration));
|
|
360
|
-
}),
|
|
361
|
-
|
|
360
|
+
}), nt(() => {
|
|
361
|
+
v();
|
|
362
362
|
}), (o, r) => (u(), h(de, null, [
|
|
363
363
|
(u(), se(dt, { to: "body" }, [
|
|
364
|
-
X(
|
|
364
|
+
X(Ye, {
|
|
365
365
|
name: "rc-toast-fade",
|
|
366
366
|
onAfterLeave: t.onAfterLeave
|
|
367
367
|
}, {
|
|
@@ -426,11 +426,11 @@ const pn = {
|
|
|
426
426
|
const o = l.findIndex((r) => r.id === $);
|
|
427
427
|
o >= 0 && l.splice(o, 1);
|
|
428
428
|
}
|
|
429
|
-
function
|
|
430
|
-
const
|
|
431
|
-
return l.push({ id:
|
|
429
|
+
function v($, o, r) {
|
|
430
|
+
const d = e++;
|
|
431
|
+
return l.push({ id: d, type: $, content: o, duration: r }), r > 0 && window.setTimeout(() => g(d), r), d;
|
|
432
432
|
}
|
|
433
|
-
return i({ add:
|
|
433
|
+
return i({ add: v, remove: g }), ($, o) => (u(), h("div", pn, [
|
|
434
434
|
X(zt, {
|
|
435
435
|
name: "rc-message-fade",
|
|
436
436
|
tag: "div"
|
|
@@ -448,19 +448,19 @@ const pn = {
|
|
|
448
448
|
]));
|
|
449
449
|
}
|
|
450
450
|
}), gn = /* @__PURE__ */ ce(yn, [["__scopeId", "data-v-87811df0"]]);
|
|
451
|
-
let
|
|
451
|
+
let ze = null, Ne = null;
|
|
452
452
|
function bn() {
|
|
453
453
|
var i;
|
|
454
|
-
if (
|
|
455
|
-
|
|
454
|
+
if (ze && Ne) return;
|
|
455
|
+
ze = document.createElement("div"), document.body.appendChild(ze);
|
|
456
456
|
const t = X(gn, {});
|
|
457
|
-
It(t,
|
|
457
|
+
It(t, ze), Ne = (i = t.component) == null ? void 0 : i.exposed;
|
|
458
458
|
}
|
|
459
459
|
function Ue(t, i, l) {
|
|
460
460
|
var g;
|
|
461
461
|
bn();
|
|
462
462
|
const e = typeof l == "number" ? l : t === "loading" ? 0 : 2e3;
|
|
463
|
-
return (g =
|
|
463
|
+
return (g = Ne == null ? void 0 : Ne.add) == null ? void 0 : g.call(Ne, t, i, e);
|
|
464
464
|
}
|
|
465
465
|
const _n = {
|
|
466
466
|
open(t) {
|
|
@@ -482,7 +482,7 @@ const _n = {
|
|
|
482
482
|
return Ue("loading", t, i);
|
|
483
483
|
},
|
|
484
484
|
destroy() {
|
|
485
|
-
|
|
485
|
+
ze && (It(null, ze), ze.remove(), ze = null, Ne = null);
|
|
486
486
|
}
|
|
487
487
|
};
|
|
488
488
|
function kt(t) {
|
|
@@ -511,44 +511,44 @@ const kn = { class: "rc-popup__content" }, wn = /* @__PURE__ */ ue({
|
|
|
511
511
|
},
|
|
512
512
|
emits: ["update:modelValue", "open", "close", "click-overlay"],
|
|
513
513
|
setup(t, { expose: i, emit: l }) {
|
|
514
|
-
const e = t, g = l,
|
|
514
|
+
const e = t, g = l, v = W(), $ = W(e.modelValue);
|
|
515
515
|
let o = !1;
|
|
516
516
|
function r() {
|
|
517
517
|
o || (o = !0, document.body.style.overflow = "hidden");
|
|
518
518
|
}
|
|
519
|
-
function
|
|
519
|
+
function d() {
|
|
520
520
|
o && (o = !1, document.body.style.overflow = "");
|
|
521
521
|
}
|
|
522
522
|
_e(
|
|
523
523
|
() => e.modelValue,
|
|
524
|
-
(
|
|
525
|
-
$.value =
|
|
524
|
+
(f) => {
|
|
525
|
+
$.value = f, f ? (g("open"), e.lockScroll && r()) : (g("close"), e.lockScroll && d());
|
|
526
526
|
},
|
|
527
527
|
{ immediate: !0 }
|
|
528
|
-
), _e($, (
|
|
529
|
-
|
|
528
|
+
), _e($, (f) => {
|
|
529
|
+
f !== e.modelValue && g("update:modelValue", f);
|
|
530
530
|
});
|
|
531
|
-
const N = B(() => `rc-popup-slide-${e.position}`),
|
|
531
|
+
const N = B(() => `rc-popup-slide-${e.position}`), C = B(() => ({ ...e.popupStyle || {} }));
|
|
532
532
|
function w() {
|
|
533
533
|
g("click-overlay"), e.closeOnClickOverlay && H();
|
|
534
534
|
}
|
|
535
|
-
function
|
|
535
|
+
function x() {
|
|
536
536
|
H();
|
|
537
537
|
}
|
|
538
538
|
function H() {
|
|
539
539
|
$.value = !1;
|
|
540
540
|
}
|
|
541
|
-
function
|
|
541
|
+
function I() {
|
|
542
542
|
$.value = !0;
|
|
543
543
|
}
|
|
544
|
-
return
|
|
545
|
-
|
|
544
|
+
return nt(() => {
|
|
545
|
+
d();
|
|
546
546
|
}), i({
|
|
547
|
-
open:
|
|
547
|
+
open: I,
|
|
548
548
|
close: H,
|
|
549
549
|
visible: $
|
|
550
|
-
}), (
|
|
551
|
-
X(
|
|
550
|
+
}), (f, ie) => (u(), se(dt, { to: "body" }, [
|
|
551
|
+
X(Ye, { name: "rc-popup-fade" }, {
|
|
552
552
|
default: oe(() => [
|
|
553
553
|
$.value && e.overlay ? (u(), h("div", {
|
|
554
554
|
key: 0,
|
|
@@ -559,24 +559,24 @@ const kn = { class: "rc-popup__content" }, wn = /* @__PURE__ */ ue({
|
|
|
559
559
|
]),
|
|
560
560
|
_: 1
|
|
561
561
|
}),
|
|
562
|
-
X(
|
|
562
|
+
X(Ye, { name: N.value }, {
|
|
563
563
|
default: oe(() => [
|
|
564
564
|
$.value ? (u(), h("div", {
|
|
565
565
|
key: 0,
|
|
566
566
|
ref_key: "popupRef",
|
|
567
|
-
ref:
|
|
567
|
+
ref: v,
|
|
568
568
|
class: J(["rc-popup", [
|
|
569
569
|
`rc-popup--${t.position}`,
|
|
570
570
|
{ "rc-popup--round": t.round }
|
|
571
571
|
]]),
|
|
572
|
-
style: re(
|
|
573
|
-
onClick: ie[0] || (ie[0] =
|
|
572
|
+
style: re(C.value),
|
|
573
|
+
onClick: ie[0] || (ie[0] = Be(() => {
|
|
574
574
|
}, ["stop"]))
|
|
575
575
|
}, [
|
|
576
576
|
t.closeable ? (u(), h("div", {
|
|
577
577
|
key: 0,
|
|
578
578
|
class: J(["rc-popup__close", `rc-popup__close--${t.closeIconPosition}`]),
|
|
579
|
-
onClick:
|
|
579
|
+
onClick: x
|
|
580
580
|
}, [
|
|
581
581
|
X(te, {
|
|
582
582
|
name: t.closeIcon,
|
|
@@ -584,7 +584,7 @@ const kn = { class: "rc-popup__content" }, wn = /* @__PURE__ */ ue({
|
|
|
584
584
|
}, null, 8, ["name"])
|
|
585
585
|
], 2)) : F("", !0),
|
|
586
586
|
P("div", kn, [
|
|
587
|
-
Z(
|
|
587
|
+
Z(f.$slots, "default", {}, void 0, !0)
|
|
588
588
|
])
|
|
589
589
|
], 6)) : F("", !0)
|
|
590
590
|
]),
|
|
@@ -592,7 +592,7 @@ const kn = { class: "rc-popup__content" }, wn = /* @__PURE__ */ ue({
|
|
|
592
592
|
}, 8, ["name"])
|
|
593
593
|
]));
|
|
594
594
|
}
|
|
595
|
-
}), Le = /* @__PURE__ */ ce(wn, [["__scopeId", "data-v-
|
|
595
|
+
}), Le = /* @__PURE__ */ ce(wn, [["__scopeId", "data-v-6face8e9"]]);
|
|
596
596
|
Le && (Le.name = "rc-popup");
|
|
597
597
|
const $n = "RcPopup";
|
|
598
598
|
function $t(t) {
|
|
@@ -637,15 +637,15 @@ const Dn = {
|
|
|
637
637
|
},
|
|
638
638
|
emits: ["select-day", "clear", "confirm", "shortcut-select"],
|
|
639
639
|
setup(t, { expose: i, emit: l }) {
|
|
640
|
-
const e = t, g = l,
|
|
640
|
+
const e = t, g = l, v = ["日", "一", "二", "三", "四", "五", "六"];
|
|
641
641
|
function $(a) {
|
|
642
642
|
if (!a) return null;
|
|
643
|
-
const
|
|
644
|
-
return isNaN(
|
|
643
|
+
const m = new Date(a);
|
|
644
|
+
return isNaN(m.getTime()) ? null : m;
|
|
645
645
|
}
|
|
646
646
|
function o(a) {
|
|
647
|
-
const
|
|
648
|
-
return `${
|
|
647
|
+
const m = a.getFullYear(), k = String(a.getMonth() + 1).padStart(2, "0"), U = String(a.getDate()).padStart(2, "0");
|
|
648
|
+
return `${m}-${k}-${U}`;
|
|
649
649
|
}
|
|
650
650
|
const r = W(/* @__PURE__ */ new Date());
|
|
651
651
|
_e(
|
|
@@ -661,26 +661,26 @@ const Dn = {
|
|
|
661
661
|
},
|
|
662
662
|
{ immediate: !0 }
|
|
663
663
|
);
|
|
664
|
-
function
|
|
665
|
-
const
|
|
666
|
-
return a.getFullYear() ===
|
|
664
|
+
function d(a) {
|
|
665
|
+
const m = /* @__PURE__ */ new Date();
|
|
666
|
+
return a.getFullYear() === m.getFullYear() && a.getMonth() === m.getMonth() && a.getDate() === m.getDate();
|
|
667
667
|
}
|
|
668
668
|
function N(a) {
|
|
669
669
|
if (!e.rangeStart || !e.rangeEnd) return !1;
|
|
670
|
-
const
|
|
671
|
-
return
|
|
670
|
+
const m = o(a), k = e.rangeStart, U = e.rangeEnd;
|
|
671
|
+
return m > k && m < U;
|
|
672
672
|
}
|
|
673
|
-
function
|
|
673
|
+
function C(a) {
|
|
674
674
|
if (e.disabledDate && e.disabledDate(a))
|
|
675
675
|
return !0;
|
|
676
|
-
const
|
|
677
|
-
return !!(e.minDate &&
|
|
676
|
+
const m = o(a);
|
|
677
|
+
return !!(e.minDate && m < e.minDate || e.maxDate && m > e.maxDate);
|
|
678
678
|
}
|
|
679
|
-
function w(a,
|
|
680
|
-
const k = new Date(a,
|
|
679
|
+
function w(a, m) {
|
|
680
|
+
const k = new Date(a, m, 1), U = new Date(a, m + 1, 0), j = k.getDay(), De = U.getDate(), xe = [], vt = new Date(a, m, 0).getDate();
|
|
681
681
|
for (let ve = j - 1; ve >= 0; ve--) {
|
|
682
682
|
const me = {
|
|
683
|
-
date: new Date(a,
|
|
683
|
+
date: new Date(a, m - 1, vt - ve),
|
|
684
684
|
type: "prev-month",
|
|
685
685
|
text: String(vt - ve)
|
|
686
686
|
};
|
|
@@ -692,7 +692,7 @@ const Dn = {
|
|
|
692
692
|
}
|
|
693
693
|
for (let ve = 1; ve <= De; ve++) {
|
|
694
694
|
const me = {
|
|
695
|
-
date: new Date(a,
|
|
695
|
+
date: new Date(a, m, ve),
|
|
696
696
|
type: "current-month",
|
|
697
697
|
text: String(ve)
|
|
698
698
|
};
|
|
@@ -705,7 +705,7 @@ const Dn = {
|
|
|
705
705
|
const Bt = 42 - xe.length;
|
|
706
706
|
for (let ve = 1; ve <= Bt; ve++) {
|
|
707
707
|
const me = {
|
|
708
|
-
date: new Date(a,
|
|
708
|
+
date: new Date(a, m + 1, ve),
|
|
709
709
|
type: "next-month",
|
|
710
710
|
text: String(ve)
|
|
711
711
|
};
|
|
@@ -717,72 +717,72 @@ const Dn = {
|
|
|
717
717
|
}
|
|
718
718
|
return xe;
|
|
719
719
|
}
|
|
720
|
-
const
|
|
721
|
-
const a = r.value.getFullYear(),
|
|
722
|
-
return w(a,
|
|
720
|
+
const x = B(() => {
|
|
721
|
+
const a = r.value.getFullYear(), m = r.value.getMonth();
|
|
722
|
+
return w(a, m);
|
|
723
723
|
}), H = B(() => {
|
|
724
|
-
const a = r.value.getFullYear(),
|
|
725
|
-
return `${a}年${
|
|
724
|
+
const a = r.value.getFullYear(), m = r.value.getMonth() + 1;
|
|
725
|
+
return `${a}年${m}月`;
|
|
726
726
|
});
|
|
727
|
-
function
|
|
728
|
-
const
|
|
729
|
-
if (a.type !== "current-month" &&
|
|
730
|
-
return
|
|
727
|
+
function I(a) {
|
|
728
|
+
const m = [];
|
|
729
|
+
if (a.type !== "current-month" && m.push("is-other-month"), d(a.date) && m.push("is-today"), C(a.date))
|
|
730
|
+
return m.push("is-disabled"), m;
|
|
731
731
|
const k = o(a.date);
|
|
732
|
-
return e.range ? (e.rangeStart === k &&
|
|
732
|
+
return e.range ? (e.rangeStart === k && m.push("is-start"), e.rangeEnd === k && m.push("is-end"), N(a.date) && m.push("is-in-range")) : e.selectedDate === k && m.push("is-selected"), m;
|
|
733
733
|
}
|
|
734
|
-
const
|
|
734
|
+
const f = B(() => !!(e.rangeStart && e.rangeEnd)), ie = B(() => e.rangeStart && e.rangeEnd ? 2 : e.rangeStart || e.rangeEnd ? 1 : 0);
|
|
735
735
|
function ae(a) {
|
|
736
736
|
if (!e.minDate && !e.maxDate)
|
|
737
737
|
return !1;
|
|
738
|
-
const
|
|
739
|
-
return !!(
|
|
738
|
+
const m = e.minDate ? $(e.minDate) : null, k = e.maxDate ? $(e.maxDate) : null;
|
|
739
|
+
return !!(m && a < m.getFullYear() || k && a > k.getFullYear());
|
|
740
740
|
}
|
|
741
|
-
function b(a,
|
|
741
|
+
function b(a, m) {
|
|
742
742
|
const k = e.minDate ? $(e.minDate) : null, U = e.maxDate ? $(e.maxDate) : null;
|
|
743
743
|
if (k) {
|
|
744
744
|
const j = k.getFullYear(), De = k.getMonth() + 1;
|
|
745
|
-
if (a < j || a === j &&
|
|
745
|
+
if (a < j || a === j && m < De)
|
|
746
746
|
return !0;
|
|
747
747
|
}
|
|
748
748
|
if (U) {
|
|
749
749
|
const j = U.getFullYear(), De = U.getMonth() + 1;
|
|
750
|
-
if (a > j || a === j &&
|
|
750
|
+
if (a > j || a === j && m > De)
|
|
751
751
|
return !0;
|
|
752
752
|
}
|
|
753
753
|
return !1;
|
|
754
754
|
}
|
|
755
|
-
const Y = W(!1), y = W("year"), _ = W(r.value.getFullYear()),
|
|
756
|
-
const a = [], k = Math.floor((R.value -
|
|
755
|
+
const Y = W(!1), y = W("year"), _ = W(r.value.getFullYear()), S = W(r.value.getMonth() + 1), M = W(), R = W(1900), L = W(1920), T = W(1900), O = W(2100), fe = B(() => {
|
|
756
|
+
const a = [], k = Math.floor((R.value - T.value) / he) - 3, U = Math.ceil((L.value - T.value) / he) + 3, j = T.value + Math.max(0, k) * he, De = T.value + U * he - 1;
|
|
757
757
|
for (let xe = j; xe <= De; xe++)
|
|
758
758
|
a.push(xe);
|
|
759
759
|
return a;
|
|
760
760
|
});
|
|
761
761
|
_e(() => r.value, (a) => {
|
|
762
|
-
_.value = a.getFullYear(),
|
|
762
|
+
_.value = a.getFullYear(), S.value = a.getMonth() + 1;
|
|
763
763
|
}, { immediate: !0 });
|
|
764
764
|
function ke() {
|
|
765
|
-
if (!
|
|
766
|
-
const a =
|
|
767
|
-
U <
|
|
765
|
+
if (!M.value) return;
|
|
766
|
+
const a = M.value.scrollTop, k = Math.max(0, Math.floor(a / rt)), U = T.value + k * he, j = U + ct * he - 1;
|
|
767
|
+
U < T.value ? T.value = U - 100 : j > O.value && (O.value = j + 100), (U !== R.value || j !== L.value) && (R.value = U, L.value = j);
|
|
768
768
|
}
|
|
769
769
|
function Me() {
|
|
770
|
-
_.value = r.value.getFullYear(),
|
|
770
|
+
_.value = r.value.getFullYear(), S.value = r.value.getMonth() + 1, y.value = "year", Y.value = !0;
|
|
771
771
|
const a = _.value;
|
|
772
|
-
a <
|
|
773
|
-
if (
|
|
774
|
-
const
|
|
775
|
-
R.value =
|
|
772
|
+
a < T.value ? T.value = Math.floor(a / 100) * 100 : a > O.value && (O.value = Math.ceil(a / 100) * 100 + 99), Ee(() => {
|
|
773
|
+
if (M.value) {
|
|
774
|
+
const m = Math.floor((a - T.value) / he), k = Math.max(0, m - 2);
|
|
775
|
+
R.value = T.value + k * he, L.value = R.value + ct * he - 1, Te(a);
|
|
776
776
|
}
|
|
777
777
|
});
|
|
778
778
|
}
|
|
779
779
|
function Te(a) {
|
|
780
|
-
if (!
|
|
781
|
-
a <
|
|
782
|
-
const
|
|
783
|
-
|
|
784
|
-
const U = Math.max(0,
|
|
785
|
-
R.value =
|
|
780
|
+
if (!M.value) return;
|
|
781
|
+
a < T.value ? T.value = Math.floor(a / 100) * 100 : a > O.value && (O.value = Math.ceil(a / 100) * 100 + 99);
|
|
782
|
+
const m = Math.floor((a - T.value) / he), k = m * rt;
|
|
783
|
+
M.value.scrollTop = k;
|
|
784
|
+
const U = Math.max(0, m - 2);
|
|
785
|
+
R.value = T.value + U * he, L.value = R.value + ct * he - 1;
|
|
786
786
|
}
|
|
787
787
|
function V() {
|
|
788
788
|
const a = new Date(r.value);
|
|
@@ -796,11 +796,11 @@ const Dn = {
|
|
|
796
796
|
ae(a) || (_.value = a, y.value = "month");
|
|
797
797
|
}
|
|
798
798
|
function le(a) {
|
|
799
|
-
b(_.value, a) || (
|
|
799
|
+
b(_.value, a) || (S.value = a, ge());
|
|
800
800
|
}
|
|
801
801
|
function ge() {
|
|
802
802
|
const a = new Date(r.value);
|
|
803
|
-
a.setFullYear(_.value), a.setMonth(
|
|
803
|
+
a.setFullYear(_.value), a.setMonth(S.value - 1), r.value = a, Y.value = !1, y.value = "year";
|
|
804
804
|
}
|
|
805
805
|
function we(a) {
|
|
806
806
|
g("select-day", a);
|
|
@@ -821,30 +821,30 @@ const Dn = {
|
|
|
821
821
|
y.value = a;
|
|
822
822
|
}
|
|
823
823
|
function ee() {
|
|
824
|
-
const
|
|
825
|
-
ae(
|
|
824
|
+
const m = (/* @__PURE__ */ new Date()).getFullYear();
|
|
825
|
+
ae(m) || (_.value = m, y.value = "month");
|
|
826
826
|
}
|
|
827
827
|
function Q() {
|
|
828
|
-
const
|
|
829
|
-
b(_.value,
|
|
828
|
+
const m = (/* @__PURE__ */ new Date()).getMonth() + 1;
|
|
829
|
+
b(_.value, m) || (S.value = m, ge());
|
|
830
830
|
}
|
|
831
831
|
const c = B(() => e.range ? !!(e.rangeStart || e.rangeEnd) : !!e.selectedDate);
|
|
832
|
-
function z(a,
|
|
833
|
-
const k = $(a), U = $(
|
|
832
|
+
function z(a, m) {
|
|
833
|
+
const k = $(a), U = $(m);
|
|
834
834
|
if (!k || !U) return 0;
|
|
835
835
|
const j = Math.abs(U.getTime() - k.getTime());
|
|
836
836
|
return Math.ceil(j / (1e3 * 60 * 60 * 24)) + 1;
|
|
837
837
|
}
|
|
838
|
-
function
|
|
838
|
+
function D() {
|
|
839
839
|
return o(/* @__PURE__ */ new Date());
|
|
840
840
|
}
|
|
841
841
|
function q() {
|
|
842
|
-
const a = /* @__PURE__ */ new Date(),
|
|
842
|
+
const a = /* @__PURE__ */ new Date(), m = a.getDay(), k = a.getDate() - m + (m === 0 ? -6 : 1);
|
|
843
843
|
return new Date(a.getFullYear(), a.getMonth(), k);
|
|
844
844
|
}
|
|
845
845
|
function Ve() {
|
|
846
|
-
const a = q(),
|
|
847
|
-
return
|
|
846
|
+
const a = q(), m = new Date(a);
|
|
847
|
+
return m.setDate(a.getDate() + 6), m;
|
|
848
848
|
}
|
|
849
849
|
function Fe() {
|
|
850
850
|
const a = /* @__PURE__ */ new Date();
|
|
@@ -854,15 +854,15 @@ const Dn = {
|
|
|
854
854
|
const a = /* @__PURE__ */ new Date();
|
|
855
855
|
return new Date(a.getFullYear(), a.getMonth() + 1, 0);
|
|
856
856
|
}
|
|
857
|
-
function
|
|
857
|
+
function Qe() {
|
|
858
858
|
const a = /* @__PURE__ */ new Date();
|
|
859
859
|
return new Date(a.getFullYear(), a.getMonth() - 2, 1);
|
|
860
860
|
}
|
|
861
|
-
function
|
|
861
|
+
function Ae() {
|
|
862
862
|
const a = /* @__PURE__ */ new Date();
|
|
863
863
|
return new Date(a.getFullYear(), 0, 1);
|
|
864
864
|
}
|
|
865
|
-
function
|
|
865
|
+
function Pe() {
|
|
866
866
|
const a = /* @__PURE__ */ new Date();
|
|
867
867
|
return new Date(a.getFullYear(), 11, 31);
|
|
868
868
|
}
|
|
@@ -872,7 +872,7 @@ const Dn = {
|
|
|
872
872
|
label: "本日",
|
|
873
873
|
days: 1,
|
|
874
874
|
getRange: () => {
|
|
875
|
-
const a =
|
|
875
|
+
const a = D();
|
|
876
876
|
return [a, a];
|
|
877
877
|
}
|
|
878
878
|
},
|
|
@@ -881,32 +881,32 @@ const Dn = {
|
|
|
881
881
|
label: "本周",
|
|
882
882
|
days: 7,
|
|
883
883
|
getRange: () => {
|
|
884
|
-
const a = o(q()),
|
|
885
|
-
return [a,
|
|
884
|
+
const a = o(q()), m = o(Ve());
|
|
885
|
+
return [a, m];
|
|
886
886
|
}
|
|
887
887
|
},
|
|
888
888
|
{
|
|
889
889
|
key: "month",
|
|
890
890
|
label: "本月",
|
|
891
891
|
getRange: () => {
|
|
892
|
-
const a = o(Fe()),
|
|
893
|
-
return [a,
|
|
892
|
+
const a = o(Fe()), m = o(Ie());
|
|
893
|
+
return [a, m];
|
|
894
894
|
}
|
|
895
895
|
},
|
|
896
896
|
{
|
|
897
897
|
key: "threeMonths",
|
|
898
898
|
label: "近三月",
|
|
899
899
|
getRange: () => {
|
|
900
|
-
const a = o(
|
|
901
|
-
return [a,
|
|
900
|
+
const a = o(Qe()), m = o(Ie());
|
|
901
|
+
return [a, m];
|
|
902
902
|
}
|
|
903
903
|
},
|
|
904
904
|
{
|
|
905
905
|
key: "year",
|
|
906
906
|
label: "本年",
|
|
907
907
|
getRange: () => {
|
|
908
|
-
const a = o(
|
|
909
|
-
return [a,
|
|
908
|
+
const a = o(Ae()), m = o(Pe());
|
|
909
|
+
return [a, m];
|
|
910
910
|
}
|
|
911
911
|
},
|
|
912
912
|
{
|
|
@@ -914,8 +914,8 @@ const Dn = {
|
|
|
914
914
|
label: "近7天",
|
|
915
915
|
days: 7,
|
|
916
916
|
getRange: () => {
|
|
917
|
-
const a = /* @__PURE__ */ new Date(),
|
|
918
|
-
return
|
|
917
|
+
const a = /* @__PURE__ */ new Date(), m = new Date(a);
|
|
918
|
+
return m.setDate(a.getDate() - 6), [o(m), D()];
|
|
919
919
|
}
|
|
920
920
|
},
|
|
921
921
|
{
|
|
@@ -923,8 +923,8 @@ const Dn = {
|
|
|
923
923
|
label: "近30天",
|
|
924
924
|
days: 30,
|
|
925
925
|
getRange: () => {
|
|
926
|
-
const a = /* @__PURE__ */ new Date(),
|
|
927
|
-
return
|
|
926
|
+
const a = /* @__PURE__ */ new Date(), m = new Date(a);
|
|
927
|
+
return m.setDate(a.getDate() - 29), [o(m), D()];
|
|
928
928
|
}
|
|
929
929
|
}
|
|
930
930
|
], lt = B(() => at.filter((a) => {
|
|
@@ -932,24 +932,24 @@ const Dn = {
|
|
|
932
932
|
if (a.days !== void 0)
|
|
933
933
|
return a.days <= e.maxRangeDays;
|
|
934
934
|
{
|
|
935
|
-
const
|
|
936
|
-
if (
|
|
937
|
-
return z(
|
|
935
|
+
const m = a.getRange();
|
|
936
|
+
if (m)
|
|
937
|
+
return z(m[0], m[1]) <= e.maxRangeDays;
|
|
938
938
|
}
|
|
939
939
|
}
|
|
940
940
|
return !0;
|
|
941
941
|
}));
|
|
942
942
|
function ot(a) {
|
|
943
|
-
const
|
|
944
|
-
if (
|
|
945
|
-
if (e.minDate &&
|
|
943
|
+
const m = a.getRange();
|
|
944
|
+
if (m) {
|
|
945
|
+
if (e.minDate && m[0] < e.minDate || e.maxDate && m[1] > e.maxDate)
|
|
946
946
|
return;
|
|
947
|
-
g("shortcut-select",
|
|
947
|
+
g("shortcut-select", m);
|
|
948
948
|
}
|
|
949
949
|
}
|
|
950
950
|
return i({
|
|
951
|
-
yearScrollRef:
|
|
952
|
-
}), (a,
|
|
951
|
+
yearScrollRef: M
|
|
952
|
+
}), (a, m) => (u(), h("div", null, [
|
|
953
953
|
t.showTitle ? (u(), h("div", Dn, [
|
|
954
954
|
P("div", xn, G(t.title), 1),
|
|
955
955
|
P("span", {
|
|
@@ -991,15 +991,15 @@ const Dn = {
|
|
|
991
991
|
])
|
|
992
992
|
]),
|
|
993
993
|
P("div", Vn, [
|
|
994
|
-
(u(), h(de, null, ye(
|
|
994
|
+
(u(), h(de, null, ye(v, (k) => P("div", {
|
|
995
995
|
key: k,
|
|
996
996
|
class: "rc-calendar__weekday"
|
|
997
997
|
}, G(k), 1)), 64))
|
|
998
998
|
]),
|
|
999
999
|
P("div", In, [
|
|
1000
|
-
(u(!0), h(de, null, ye(
|
|
1000
|
+
(u(!0), h(de, null, ye(x.value, (k, U) => (u(), h("div", {
|
|
1001
1001
|
key: U,
|
|
1002
|
-
class: J(["rc-calendar__day",
|
|
1002
|
+
class: J(["rc-calendar__day", I(k)]),
|
|
1003
1003
|
onClick: (j) => we(k)
|
|
1004
1004
|
}, [
|
|
1005
1005
|
P("div", Fn, [
|
|
@@ -1014,7 +1014,7 @@ const Dn = {
|
|
|
1014
1014
|
class: "rc-calendar__footer-reset",
|
|
1015
1015
|
onClick: Re
|
|
1016
1016
|
}, {
|
|
1017
|
-
default: oe(() => [...
|
|
1017
|
+
default: oe(() => [...m[2] || (m[2] = [
|
|
1018
1018
|
Se("取消", -1)
|
|
1019
1019
|
])]),
|
|
1020
1020
|
_: 1
|
|
@@ -1022,16 +1022,16 @@ const Dn = {
|
|
|
1022
1022
|
X(ne($e), {
|
|
1023
1023
|
type: "primary",
|
|
1024
1024
|
class: "rc-calendar__footer-confirm",
|
|
1025
|
-
disabled: !
|
|
1025
|
+
disabled: !f.value,
|
|
1026
1026
|
onClick: s
|
|
1027
1027
|
}, {
|
|
1028
1028
|
default: oe(() => [
|
|
1029
|
-
Se(G(
|
|
1029
|
+
Se(G(f.value ? `确定(${ie.value}项)` : "确定"), 1)
|
|
1030
1030
|
]),
|
|
1031
1031
|
_: 1
|
|
1032
1032
|
}, 8, ["disabled"])
|
|
1033
1033
|
])) : F("", !0),
|
|
1034
|
-
X(
|
|
1034
|
+
X(Ye, { name: "rc-calendar-fade" }, {
|
|
1035
1035
|
default: oe(() => [
|
|
1036
1036
|
Y.value ? (u(), h("div", Pn, [
|
|
1037
1037
|
P("div", Nn, [
|
|
@@ -1042,20 +1042,20 @@ const Dn = {
|
|
|
1042
1042
|
size: "small",
|
|
1043
1043
|
onClick: p
|
|
1044
1044
|
}, {
|
|
1045
|
-
default: oe(() => [...
|
|
1045
|
+
default: oe(() => [...m[3] || (m[3] = [
|
|
1046
1046
|
Se("取消", -1)
|
|
1047
1047
|
])]),
|
|
1048
1048
|
_: 1
|
|
1049
1049
|
}),
|
|
1050
1050
|
P("div", Yn, [
|
|
1051
1051
|
P("span", {
|
|
1052
|
-
onClick:
|
|
1052
|
+
onClick: m[0] || (m[0] = (k) => E("year"))
|
|
1053
1053
|
}, G(_.value) + "年", 1),
|
|
1054
1054
|
y.value === "month" ? (u(), h("span", Ln, " - ")) : F("", !0),
|
|
1055
1055
|
y.value === "month" ? (u(), h("span", {
|
|
1056
1056
|
key: 1,
|
|
1057
|
-
onClick:
|
|
1058
|
-
}, G(
|
|
1057
|
+
onClick: m[1] || (m[1] = (k) => E("month"))
|
|
1058
|
+
}, G(S.value) + "月", 1)) : F("", !0)
|
|
1059
1059
|
]),
|
|
1060
1060
|
y.value === "year" ? (u(), se(ne($e), {
|
|
1061
1061
|
key: 0,
|
|
@@ -1064,7 +1064,7 @@ const Dn = {
|
|
|
1064
1064
|
size: "small",
|
|
1065
1065
|
onClick: ee
|
|
1066
1066
|
}, {
|
|
1067
|
-
default: oe(() => [...
|
|
1067
|
+
default: oe(() => [...m[4] || (m[4] = [
|
|
1068
1068
|
Se(" 本年 ", -1)
|
|
1069
1069
|
])]),
|
|
1070
1070
|
_: 1
|
|
@@ -1076,7 +1076,7 @@ const Dn = {
|
|
|
1076
1076
|
size: "small",
|
|
1077
1077
|
onClick: Q
|
|
1078
1078
|
}, {
|
|
1079
|
-
default: oe(() => [...
|
|
1079
|
+
default: oe(() => [...m[5] || (m[5] = [
|
|
1080
1080
|
Se(" 本月 ", -1)
|
|
1081
1081
|
])]),
|
|
1082
1082
|
_: 1
|
|
@@ -1086,12 +1086,12 @@ const Dn = {
|
|
|
1086
1086
|
P("div", {
|
|
1087
1087
|
class: "rc-calendar__year-picker-scroll",
|
|
1088
1088
|
ref_key: "yearScrollRef",
|
|
1089
|
-
ref:
|
|
1089
|
+
ref: M,
|
|
1090
1090
|
onScroll: ke
|
|
1091
1091
|
}, [
|
|
1092
1092
|
P("div", {
|
|
1093
1093
|
class: "rc-calendar__year-picker-spacer",
|
|
1094
|
-
style: re({ height: `${Math.floor((R.value -
|
|
1094
|
+
style: re({ height: `${Math.floor((R.value - T.value) / he) * rt}px` })
|
|
1095
1095
|
}, null, 4),
|
|
1096
1096
|
P("div", On, [
|
|
1097
1097
|
(u(!0), h(de, null, ye(fe.value, (k) => (u(), h("div", {
|
|
@@ -1113,7 +1113,7 @@ const Dn = {
|
|
|
1113
1113
|
(u(), h(de, null, ye(12, (k) => P("div", {
|
|
1114
1114
|
key: k,
|
|
1115
1115
|
class: J(["rc-calendar__month-picker-item", {
|
|
1116
|
-
"is-selected":
|
|
1116
|
+
"is-selected": S.value === k,
|
|
1117
1117
|
"is-disabled": b(_.value, k)
|
|
1118
1118
|
}]),
|
|
1119
1119
|
onClick: (U) => le(k)
|
|
@@ -1148,48 +1148,48 @@ const Dn = {
|
|
|
1148
1148
|
},
|
|
1149
1149
|
emits: ["update:modelValue", "change", "confirm"],
|
|
1150
1150
|
setup(t, { emit: i }) {
|
|
1151
|
-
const l = t, e = i, g = W(),
|
|
1151
|
+
const l = t, e = i, g = W(), v = W(), $ = W(!1), o = W(""), r = B(() => l.range === !0 || typeof l.range == "number"), d = B(() => typeof l.range == "number" ? l.range : void 0), N = B(() => (V) => {
|
|
1152
1152
|
if (l.disabledDate && l.disabledDate(V))
|
|
1153
1153
|
return !0;
|
|
1154
|
-
if (
|
|
1155
|
-
const A =
|
|
1156
|
-
if (
|
|
1154
|
+
if (d.value !== void 0 && w.value && !x.value) {
|
|
1155
|
+
const A = f(V);
|
|
1156
|
+
if (I(w.value) && ie(w.value, A) > d.value)
|
|
1157
1157
|
return !0;
|
|
1158
1158
|
}
|
|
1159
1159
|
return !1;
|
|
1160
|
-
}),
|
|
1160
|
+
}), C = W(null), w = W(null), x = W(null);
|
|
1161
1161
|
_e(
|
|
1162
1162
|
() => l.modelValue,
|
|
1163
1163
|
(V) => {
|
|
1164
|
-
r.value ? Array.isArray(V) && V.length === 2 ? (w.value = V[0],
|
|
1164
|
+
r.value ? Array.isArray(V) && V.length === 2 ? (w.value = V[0], x.value = y(V[1])) : (w.value = null, x.value = null) : C.value = typeof V == "string" ? V : null, H();
|
|
1165
1165
|
},
|
|
1166
1166
|
{ immediate: !0 }
|
|
1167
1167
|
);
|
|
1168
1168
|
function H() {
|
|
1169
|
-
l.mode === "popup" && (r.value ? w.value &&
|
|
1169
|
+
l.mode === "popup" && (r.value ? w.value && x.value ? o.value = `${w.value} ~ ${x.value}` : w.value ? o.value = `${w.value} ~ ` : o.value = "" : o.value = C.value || "");
|
|
1170
1170
|
}
|
|
1171
|
-
function
|
|
1171
|
+
function I(V) {
|
|
1172
1172
|
if (!V) return null;
|
|
1173
1173
|
const A = new Date(V);
|
|
1174
1174
|
return isNaN(A.getTime()) ? null : A;
|
|
1175
1175
|
}
|
|
1176
|
-
function
|
|
1176
|
+
function f(V) {
|
|
1177
1177
|
const A = V.getFullYear(), K = String(V.getMonth() + 1).padStart(2, "0"), le = String(V.getDate()).padStart(2, "0");
|
|
1178
1178
|
return `${A}-${K}-${le}`;
|
|
1179
1179
|
}
|
|
1180
1180
|
function ie(V, A) {
|
|
1181
|
-
const K =
|
|
1181
|
+
const K = I(V), le = I(A);
|
|
1182
1182
|
if (!K || !le) return 0;
|
|
1183
1183
|
const ge = Math.abs(le.getTime() - K.getTime());
|
|
1184
1184
|
return Math.ceil(ge / (1e3 * 60 * 60 * 24));
|
|
1185
1185
|
}
|
|
1186
1186
|
function ae(V) {
|
|
1187
|
-
const A =
|
|
1188
|
-
return A ? (A.setDate(A.getDate() + 1),
|
|
1187
|
+
const A = I(V);
|
|
1188
|
+
return A ? (A.setDate(A.getDate() + 1), f(A)) : V;
|
|
1189
1189
|
}
|
|
1190
1190
|
function b(V) {
|
|
1191
|
-
const A =
|
|
1192
|
-
return A ? (A.setDate(A.getDate() - 1),
|
|
1191
|
+
const A = I(V);
|
|
1192
|
+
return A ? (A.setDate(A.getDate() - 1), f(A)) : V;
|
|
1193
1193
|
}
|
|
1194
1194
|
function Y(V) {
|
|
1195
1195
|
return l.endDateOffset && r.value ? ae(V) : V;
|
|
@@ -1200,46 +1200,46 @@ const Dn = {
|
|
|
1200
1200
|
function _(V) {
|
|
1201
1201
|
if (V.type !== "current-month" || l.disabledDate && l.disabledDate(V.date))
|
|
1202
1202
|
return;
|
|
1203
|
-
const A =
|
|
1203
|
+
const A = f(V.date);
|
|
1204
1204
|
if (!(l.minDate && A < l.minDate) && !(l.maxDate && A > l.maxDate)) {
|
|
1205
1205
|
if (r.value)
|
|
1206
|
-
if (!w.value || w.value &&
|
|
1207
|
-
w.value = A,
|
|
1206
|
+
if (!w.value || w.value && x.value)
|
|
1207
|
+
w.value = A, x.value = null;
|
|
1208
1208
|
else {
|
|
1209
1209
|
let K = w.value, le = A;
|
|
1210
|
-
if (A < w.value && (le = w.value, K = A), w.value = K,
|
|
1211
|
-
const ge = Y(
|
|
1212
|
-
e("update:modelValue", we), e("change", we), l.showFooter ||
|
|
1210
|
+
if (A < w.value && (le = w.value, K = A), w.value = K, x.value = le, w.value && x.value) {
|
|
1211
|
+
const ge = Y(x.value), we = [w.value, ge];
|
|
1212
|
+
e("update:modelValue", we), e("change", we), l.showFooter || S();
|
|
1213
1213
|
}
|
|
1214
1214
|
}
|
|
1215
1215
|
else {
|
|
1216
|
-
|
|
1216
|
+
C.value = A;
|
|
1217
1217
|
const K = A;
|
|
1218
|
-
e("update:modelValue", K), e("change", K), l.mode &&
|
|
1218
|
+
e("update:modelValue", K), e("change", K), l.mode && T();
|
|
1219
1219
|
}
|
|
1220
1220
|
H();
|
|
1221
1221
|
}
|
|
1222
1222
|
}
|
|
1223
|
-
function
|
|
1224
|
-
if (w.value &&
|
|
1225
|
-
const V = Y(
|
|
1226
|
-
e("update:modelValue", A), e("change", A), e("confirm", A),
|
|
1223
|
+
function S() {
|
|
1224
|
+
if (w.value && x.value) {
|
|
1225
|
+
const V = Y(x.value), A = [w.value, V];
|
|
1226
|
+
e("update:modelValue", A), e("change", A), e("confirm", A), T();
|
|
1227
1227
|
}
|
|
1228
1228
|
}
|
|
1229
|
-
function
|
|
1230
|
-
r.value ? (w.value = null,
|
|
1229
|
+
function M() {
|
|
1230
|
+
r.value ? (w.value = null, x.value = null) : C.value = null;
|
|
1231
1231
|
const V = null;
|
|
1232
1232
|
e("update:modelValue", V), e("change", V), H();
|
|
1233
1233
|
}
|
|
1234
1234
|
function R(V) {
|
|
1235
|
-
w.value = V[0],
|
|
1235
|
+
w.value = V[0], x.value = V[1];
|
|
1236
1236
|
const A = Y(V[1]), K = [V[0], A];
|
|
1237
|
-
e("update:modelValue", K), e("change", K), l.showFooter ? H() :
|
|
1237
|
+
e("update:modelValue", K), e("change", K), l.showFooter ? H() : S();
|
|
1238
1238
|
}
|
|
1239
1239
|
function L() {
|
|
1240
1240
|
$.value = !0;
|
|
1241
1241
|
}
|
|
1242
|
-
function
|
|
1242
|
+
function T() {
|
|
1243
1243
|
$.value = !1;
|
|
1244
1244
|
}
|
|
1245
1245
|
function O(V) {
|
|
@@ -1259,20 +1259,20 @@ const Dn = {
|
|
|
1259
1259
|
if (r.value) {
|
|
1260
1260
|
const A = V.split("~").map((K) => K.trim());
|
|
1261
1261
|
if (A.length === 2 && A[0] && A[1]) {
|
|
1262
|
-
const K =
|
|
1262
|
+
const K = I(A[0]), le = I(A[1]);
|
|
1263
1263
|
if (K && le && !isNaN(K.getTime()) && !isNaN(le.getTime())) {
|
|
1264
|
-
w.value =
|
|
1265
|
-
const ge =
|
|
1266
|
-
|
|
1267
|
-
const we = Y(
|
|
1264
|
+
w.value = f(K);
|
|
1265
|
+
const ge = f(le);
|
|
1266
|
+
x.value = y(ge);
|
|
1267
|
+
const we = Y(x.value), Re = [w.value, we];
|
|
1268
1268
|
e("update:modelValue", Re), e("change", Re);
|
|
1269
1269
|
return;
|
|
1270
1270
|
}
|
|
1271
1271
|
}
|
|
1272
1272
|
} else {
|
|
1273
|
-
const A =
|
|
1273
|
+
const A = I(V);
|
|
1274
1274
|
if (A && !isNaN(A.getTime())) {
|
|
1275
|
-
|
|
1275
|
+
C.value = f(A), e("update:modelValue", C.value), e("change", C.value);
|
|
1276
1276
|
return;
|
|
1277
1277
|
}
|
|
1278
1278
|
}
|
|
@@ -1310,18 +1310,18 @@ const Dn = {
|
|
|
1310
1310
|
"show-title": t.showTitle,
|
|
1311
1311
|
title: t.title,
|
|
1312
1312
|
range: r.value,
|
|
1313
|
-
"selected-date":
|
|
1313
|
+
"selected-date": C.value,
|
|
1314
1314
|
"range-start": w.value,
|
|
1315
|
-
"range-end":
|
|
1315
|
+
"range-end": x.value,
|
|
1316
1316
|
"min-date": t.minDate,
|
|
1317
1317
|
"max-date": t.maxDate,
|
|
1318
1318
|
"disabled-date": N.value,
|
|
1319
1319
|
formatter: t.formatter,
|
|
1320
1320
|
"show-footer": !1,
|
|
1321
|
-
"max-range-days":
|
|
1321
|
+
"max-range-days": d.value,
|
|
1322
1322
|
onSelectDay: _,
|
|
1323
|
-
onClear:
|
|
1324
|
-
onConfirm:
|
|
1323
|
+
onClear: M,
|
|
1324
|
+
onConfirm: S,
|
|
1325
1325
|
onShortcutSelect: R
|
|
1326
1326
|
}, null, 8, ["show-title", "title", "range", "selected-date", "range-start", "range-end", "min-date", "max-date", "disabled-date", "formatter", "max-range-days"])
|
|
1327
1327
|
])) : F("", !0),
|
|
@@ -1341,25 +1341,25 @@ const Dn = {
|
|
|
1341
1341
|
default: oe(() => [
|
|
1342
1342
|
P("div", {
|
|
1343
1343
|
ref_key: "popupPanelRef",
|
|
1344
|
-
ref:
|
|
1344
|
+
ref: v,
|
|
1345
1345
|
class: "rc-calendar__panel"
|
|
1346
1346
|
}, [
|
|
1347
1347
|
X(Dt, {
|
|
1348
1348
|
"show-title": t.showTitle,
|
|
1349
1349
|
title: t.title,
|
|
1350
1350
|
range: r.value,
|
|
1351
|
-
"selected-date":
|
|
1351
|
+
"selected-date": C.value,
|
|
1352
1352
|
"range-start": w.value,
|
|
1353
|
-
"range-end":
|
|
1353
|
+
"range-end": x.value,
|
|
1354
1354
|
"min-date": t.minDate,
|
|
1355
1355
|
"max-date": t.maxDate,
|
|
1356
1356
|
"disabled-date": N.value,
|
|
1357
1357
|
formatter: t.formatter,
|
|
1358
1358
|
"show-footer": t.showFooter,
|
|
1359
|
-
"max-range-days":
|
|
1359
|
+
"max-range-days": d.value,
|
|
1360
1360
|
onSelectDay: _,
|
|
1361
|
-
onClear:
|
|
1362
|
-
onConfirm:
|
|
1361
|
+
onClear: M,
|
|
1362
|
+
onConfirm: S,
|
|
1363
1363
|
onShortcutSelect: R
|
|
1364
1364
|
}, null, 8, ["show-title", "title", "range", "selected-date", "range-start", "range-end", "min-date", "max-date", "disabled-date", "formatter", "show-footer", "max-range-days"])
|
|
1365
1365
|
], 512)
|
|
@@ -1409,14 +1409,14 @@ const ea = { class: "rc-search-area" }, ta = { class: "rc-search-area__bar" }, n
|
|
|
1409
1409
|
},
|
|
1410
1410
|
emits: ["update:modelValue", "change"],
|
|
1411
1411
|
setup(t, { expose: i, emit: l }) {
|
|
1412
|
-
const e = t, g = l,
|
|
1413
|
-
if (
|
|
1412
|
+
const e = t, g = l, v = W(null), $ = W(null), o = W(null), r = W({ top: "0px" }), d = async () => {
|
|
1413
|
+
if (v.value === null || !$.value)
|
|
1414
1414
|
return;
|
|
1415
|
-
await
|
|
1415
|
+
await Ee();
|
|
1416
1416
|
const s = $.value.getBoundingClientRect().top;
|
|
1417
1417
|
r.value = { top: `${s}px` };
|
|
1418
1418
|
}, N = (n) => {
|
|
1419
|
-
if (
|
|
1419
|
+
if (v.value === null || !$.value)
|
|
1420
1420
|
return;
|
|
1421
1421
|
const s = n.target;
|
|
1422
1422
|
if ($.value.contains(s))
|
|
@@ -1429,21 +1429,21 @@ const ea = { class: "rc-search-area" }, ta = { class: "rc-search-area__bar" }, n
|
|
|
1429
1429
|
}
|
|
1430
1430
|
Y();
|
|
1431
1431
|
};
|
|
1432
|
-
_e(
|
|
1433
|
-
n !== null ? (await
|
|
1434
|
-
}),
|
|
1435
|
-
window.removeEventListener("resize",
|
|
1432
|
+
_e(v, async (n) => {
|
|
1433
|
+
n !== null ? (await Ee(), d(), window.addEventListener("resize", d), window.addEventListener("scroll", d, !0), document.addEventListener("click", N, !0)) : (window.removeEventListener("resize", d), window.removeEventListener("scroll", d, !0), document.removeEventListener("click", N, !0));
|
|
1434
|
+
}), nt(() => {
|
|
1435
|
+
window.removeEventListener("resize", d), window.removeEventListener("scroll", d, !0), document.removeEventListener("click", N, !0);
|
|
1436
1436
|
});
|
|
1437
|
-
const
|
|
1437
|
+
const C = W({}), w = W(""), x = W(null), H = W({}), I = W({ ...e.modelValue });
|
|
1438
1438
|
_e(() => e.modelValue, (n) => {
|
|
1439
|
-
|
|
1439
|
+
I.value = { ...n || {} };
|
|
1440
1440
|
}, { deep: !0, immediate: !0 });
|
|
1441
|
-
const
|
|
1442
|
-
if (!
|
|
1443
|
-
const n = Re(
|
|
1441
|
+
const f = B(() => v.value === null ? null : e.items[v.value]), ie = B(() => {
|
|
1442
|
+
if (!f.value) return "";
|
|
1443
|
+
const n = Re(f.value);
|
|
1444
1444
|
return n > 0 ? `(${n}项)` : "";
|
|
1445
1445
|
}), ae = (n) => {
|
|
1446
|
-
const s =
|
|
1446
|
+
const s = I.value[n.key];
|
|
1447
1447
|
if (s == null || s === "" || n.slot)
|
|
1448
1448
|
return n.label;
|
|
1449
1449
|
if (n.type === "input") {
|
|
@@ -1457,15 +1457,15 @@ const ea = { class: "rc-search-area" }, ta = { class: "rc-search-area__bar" }, n
|
|
|
1457
1457
|
return `${n.label}: ${s}`;
|
|
1458
1458
|
}
|
|
1459
1459
|
} else if (n.type === "single" || n.type === "tree-single") {
|
|
1460
|
-
const p =
|
|
1460
|
+
const p = M(n, s);
|
|
1461
1461
|
if (p)
|
|
1462
|
-
return `${n.label}: ${
|
|
1462
|
+
return `${n.label}: ${S(p, n)}`;
|
|
1463
1463
|
} else {
|
|
1464
1464
|
const p = Array.isArray(s) ? s : [s];
|
|
1465
1465
|
if (p.length > 0) {
|
|
1466
1466
|
const E = p.map((ee) => {
|
|
1467
|
-
const Q =
|
|
1468
|
-
return Q ?
|
|
1467
|
+
const Q = M(n, ee);
|
|
1468
|
+
return Q ? S(Q, n) : null;
|
|
1469
1469
|
}).filter((ee) => ee !== null);
|
|
1470
1470
|
if (E.length > 0)
|
|
1471
1471
|
return `${n.label}: ${E.join("、")}`;
|
|
@@ -1475,14 +1475,14 @@ const ea = { class: "rc-search-area" }, ta = { class: "rc-search-area__bar" }, n
|
|
|
1475
1475
|
}, b = (n) => {
|
|
1476
1476
|
const s = e.items[n];
|
|
1477
1477
|
if (!s) return;
|
|
1478
|
-
if (
|
|
1479
|
-
|
|
1478
|
+
if (v.value === n) {
|
|
1479
|
+
v.value = null;
|
|
1480
1480
|
return;
|
|
1481
1481
|
}
|
|
1482
|
-
const p =
|
|
1483
|
-
s.slot ? p != null ? Array.isArray(p) ? H.value[s.key] = [...p] : typeof p == "object" ? H.value[s.key] = { ...p } : H.value[s.key] = p : H.value[s.key] = void 0 : s.type === "input" ? w.value = p != null ? String(p) : "" : s.type === "calendar" ?
|
|
1482
|
+
const p = I.value[s.key];
|
|
1483
|
+
s.slot ? p != null ? Array.isArray(p) ? H.value[s.key] = [...p] : typeof p == "object" ? H.value[s.key] = { ...p } : H.value[s.key] = p : H.value[s.key] = void 0 : s.type === "input" ? w.value = p != null ? String(p) : "" : s.type === "calendar" ? x.value = p ?? null : s.type === "single" || s.type === "tree-single" ? C.value[s.key] = p !== void 0 ? p : null : C.value[s.key] = p !== void 0 ? Array.isArray(p) ? [...p] : [p] : [], v.value = n;
|
|
1484
1484
|
}, Y = () => {
|
|
1485
|
-
|
|
1485
|
+
v.value = null;
|
|
1486
1486
|
}, y = (n, s) => {
|
|
1487
1487
|
if (!s)
|
|
1488
1488
|
return typeof n == "string" ? n : n.label || String(n.value);
|
|
@@ -1501,7 +1501,7 @@ const ea = { class: "rc-search-area" }, ta = { class: "rc-search-area__bar" }, n
|
|
|
1501
1501
|
return typeof n == "string" ? n : n.value !== void 0 ? n.value : n;
|
|
1502
1502
|
const p = n;
|
|
1503
1503
|
return s.format ? typeof s.format == "string" ? typeof p == "object" && p !== null ? p[s.format] : p : s.format(p) : typeof n == "string" ? n : n.value !== void 0 ? n.value : n;
|
|
1504
|
-
},
|
|
1504
|
+
}, S = (n, s) => {
|
|
1505
1505
|
const p = n, E = s.renderResult || s.renderItem;
|
|
1506
1506
|
if (E) {
|
|
1507
1507
|
if (typeof E == "string")
|
|
@@ -1512,7 +1512,7 @@ const ea = { class: "rc-search-area" }, ta = { class: "rc-search-area__bar" }, n
|
|
|
1512
1512
|
}
|
|
1513
1513
|
}
|
|
1514
1514
|
return y(n, s);
|
|
1515
|
-
},
|
|
1515
|
+
}, M = (n, s, p) => {
|
|
1516
1516
|
const E = p || n.options;
|
|
1517
1517
|
if (!E) return null;
|
|
1518
1518
|
const ee = n.childrenKey || "children";
|
|
@@ -1523,8 +1523,8 @@ const ea = { class: "rc-search-area" }, ta = { class: "rc-search-area__bar" }, n
|
|
|
1523
1523
|
if (typeof Q == "object" && Q !== null) {
|
|
1524
1524
|
const z = Q[ee];
|
|
1525
1525
|
if (Array.isArray(z) && z.length > 0) {
|
|
1526
|
-
const
|
|
1527
|
-
if (
|
|
1526
|
+
const D = M(n, s, z);
|
|
1527
|
+
if (D) return D;
|
|
1528
1528
|
}
|
|
1529
1529
|
}
|
|
1530
1530
|
}
|
|
@@ -1540,10 +1540,10 @@ const ea = { class: "rc-search-area" }, ta = { class: "rc-search-area__bar" }, n
|
|
|
1540
1540
|
}
|
|
1541
1541
|
return ee;
|
|
1542
1542
|
}, L = (n) => {
|
|
1543
|
-
if (!
|
|
1544
|
-
const s =
|
|
1545
|
-
return
|
|
1546
|
-
},
|
|
1543
|
+
if (!f.value) return !1;
|
|
1544
|
+
const s = f.value.key, p = C.value[s], E = _(n, f.value);
|
|
1545
|
+
return f.value.type === "single" || f.value.type === "tree-single" ? p != null && p === E : (Array.isArray(p) ? p : []).some((Q) => Q === E || String(Q) === String(E));
|
|
1546
|
+
}, T = (n) => n ? n.childrenKey ? R(n) : n.options || [] : [], O = (n) => {
|
|
1547
1547
|
if (!n) return [];
|
|
1548
1548
|
const s = n.childrenKey || "children";
|
|
1549
1549
|
return (n.options || []).filter((p) => {
|
|
@@ -1557,62 +1557,62 @@ const ea = { class: "rc-search-area" }, ta = { class: "rc-search-area__bar" }, n
|
|
|
1557
1557
|
return Array.isArray(E) ? E : [];
|
|
1558
1558
|
}, ke = (n) => {
|
|
1559
1559
|
if (n)
|
|
1560
|
-
return H.value[n.key] !== void 0 ? H.value[n.key] :
|
|
1560
|
+
return H.value[n.key] !== void 0 ? H.value[n.key] : I.value[n.key];
|
|
1561
1561
|
}, Me = (n, s) => {
|
|
1562
1562
|
if (n && (H.value[n.key] = s, e.autoConfirm)) {
|
|
1563
1563
|
const p = n.key;
|
|
1564
|
-
|
|
1564
|
+
I.value[p] = s, g("update:modelValue", { ...I.value }), g("change", { ...I.value }, n), Y();
|
|
1565
1565
|
}
|
|
1566
1566
|
}, Te = (n) => {
|
|
1567
|
-
if (!
|
|
1568
|
-
const s =
|
|
1569
|
-
|
|
1567
|
+
if (!f.value) return;
|
|
1568
|
+
const s = f.value.key, p = _(n, f.value);
|
|
1569
|
+
I.value[s];
|
|
1570
1570
|
let E;
|
|
1571
|
-
|
|
1571
|
+
C.value[s] === p ? E = void 0 : E = p, I.value[s] = E, g("update:modelValue", { ...I.value }), g("change", { ...I.value }, f.value), Y();
|
|
1572
1572
|
}, V = (n) => {
|
|
1573
|
-
if (!
|
|
1574
|
-
const s =
|
|
1573
|
+
if (!f.value) return;
|
|
1574
|
+
const s = f.value.key, p = _(n, f.value), E = Array.isArray(C.value[s]) ? [...C.value[s]] : [], ee = E.findIndex(
|
|
1575
1575
|
(Q) => Q === p || String(Q) === String(p)
|
|
1576
1576
|
);
|
|
1577
|
-
if (ee >= 0 ? E.splice(ee, 1) : E.push(p),
|
|
1577
|
+
if (ee >= 0 ? E.splice(ee, 1) : E.push(p), C.value[s] = E, e.autoConfirm) {
|
|
1578
1578
|
const Q = E.length > 0 ? E : void 0;
|
|
1579
|
-
|
|
1579
|
+
I.value[s] = Q, g("update:modelValue", { ...I.value }), g("change", { ...I.value }, f.value), Y();
|
|
1580
1580
|
}
|
|
1581
1581
|
}, A = () => {
|
|
1582
|
-
if (!
|
|
1583
|
-
const n =
|
|
1584
|
-
|
|
1582
|
+
if (!f.value) return;
|
|
1583
|
+
const n = f.value.key;
|
|
1584
|
+
f.value.slot ? H.value[n] = void 0 : f.value.type === "input" ? w.value = "" : f.value.type === "calendar" ? x.value = null : f.value.type === "single" || f.value.type === "tree-single" ? C.value[n] = null : C.value[n] = [];
|
|
1585
1585
|
}, K = () => {
|
|
1586
|
-
if (e.autoConfirm &&
|
|
1587
|
-
const n =
|
|
1588
|
-
|
|
1586
|
+
if (e.autoConfirm && f.value) {
|
|
1587
|
+
const n = f.value.key, s = w.value.trim() || void 0;
|
|
1588
|
+
I.value[n] = s, g("update:modelValue", { ...I.value }), g("change", { ...I.value }, f.value), Y();
|
|
1589
1589
|
}
|
|
1590
1590
|
}, le = (n) => {
|
|
1591
|
-
if (
|
|
1592
|
-
const s =
|
|
1593
|
-
|
|
1591
|
+
if (x.value = n, e.autoConfirm && f.value) {
|
|
1592
|
+
const s = f.value.key, p = n ?? void 0;
|
|
1593
|
+
I.value[s] = p, g("update:modelValue", { ...I.value }), g("change", { ...I.value }, f.value), Y();
|
|
1594
1594
|
}
|
|
1595
1595
|
}, ge = () => {
|
|
1596
|
-
if (!
|
|
1597
|
-
const n =
|
|
1598
|
-
|
|
1596
|
+
if (!f.value) return;
|
|
1597
|
+
const n = f.value.key;
|
|
1598
|
+
I.value[n];
|
|
1599
1599
|
let s;
|
|
1600
|
-
if (
|
|
1601
|
-
s = H.value[n],
|
|
1602
|
-
else if (
|
|
1603
|
-
s = w.value.trim() || void 0,
|
|
1604
|
-
else if (
|
|
1605
|
-
s =
|
|
1606
|
-
else if (
|
|
1607
|
-
const p =
|
|
1608
|
-
s = p ?? void 0,
|
|
1600
|
+
if (f.value.slot)
|
|
1601
|
+
s = H.value[n], I.value[n] = s;
|
|
1602
|
+
else if (f.value.type === "input")
|
|
1603
|
+
s = w.value.trim() || void 0, I.value[n] = s;
|
|
1604
|
+
else if (f.value.type === "calendar")
|
|
1605
|
+
s = x.value !== null && x.value !== void 0 ? x.value : void 0, I.value[n] = s;
|
|
1606
|
+
else if (f.value.type === "single" || f.value.type === "tree-single") {
|
|
1607
|
+
const p = C.value[n];
|
|
1608
|
+
s = p ?? void 0, I.value[n] = s;
|
|
1609
1609
|
} else {
|
|
1610
|
-
const p =
|
|
1611
|
-
s = Array.isArray(p) && p.length > 0 ? p : void 0,
|
|
1610
|
+
const p = C.value[n];
|
|
1611
|
+
s = Array.isArray(p) && p.length > 0 ? p : void 0, I.value[n] = s;
|
|
1612
1612
|
}
|
|
1613
|
-
g("update:modelValue", { ...
|
|
1613
|
+
g("update:modelValue", { ...I.value }), g("change", { ...I.value }, f.value), Y();
|
|
1614
1614
|
}, we = (n) => {
|
|
1615
|
-
const s =
|
|
1615
|
+
const s = I.value[n.key];
|
|
1616
1616
|
return s == null || s === "" ? 0 : n.slot ? 1 : n.type === "input" ? String(s).trim() ? 1 : 0 : n.type === "single" || n.type === "tree-single" ? 1 : Array.isArray(s) ? s.length : s ? 1 : 0;
|
|
1617
1617
|
}, Re = (n) => {
|
|
1618
1618
|
if (n.slot) {
|
|
@@ -1622,24 +1622,24 @@ const ea = { class: "rc-search-area" }, ta = { class: "rc-search-area__bar" }, n
|
|
|
1622
1622
|
if (n.type === "input")
|
|
1623
1623
|
return w.value.trim() ? 1 : 0;
|
|
1624
1624
|
if (n.type === "calendar")
|
|
1625
|
-
return
|
|
1625
|
+
return x.value !== null && x.value !== void 0 ? 1 : 0;
|
|
1626
1626
|
}
|
|
1627
|
-
const s =
|
|
1627
|
+
const s = C.value[n.key];
|
|
1628
1628
|
return s == null || s === "" ? 0 : n.type === "single" || n.type === "tree-single" ? 1 : Array.isArray(s) ? s.length : 0;
|
|
1629
1629
|
};
|
|
1630
1630
|
return i({
|
|
1631
1631
|
/** 获取当前筛选值 */
|
|
1632
|
-
getValues: () => ({ ...
|
|
1632
|
+
getValues: () => ({ ...I.value }),
|
|
1633
1633
|
/** 重置所有筛选 */
|
|
1634
1634
|
reset: () => {
|
|
1635
|
-
|
|
1635
|
+
I.value = {}, C.value = {}, H.value = {}, g("update:modelValue", {});
|
|
1636
1636
|
}
|
|
1637
1637
|
}), (n, s) => (u(), h("div", ea, [
|
|
1638
1638
|
P("div", ta, [
|
|
1639
1639
|
(u(!0), h(de, null, ye(e.items, (p, E) => (u(), h("div", {
|
|
1640
1640
|
key: E,
|
|
1641
1641
|
class: J(["rc-search-area__item", {
|
|
1642
|
-
"is-active":
|
|
1642
|
+
"is-active": v.value === E,
|
|
1643
1643
|
"has-value": we(p) > 0
|
|
1644
1644
|
}]),
|
|
1645
1645
|
onClick: (ee) => b(E)
|
|
@@ -1647,14 +1647,14 @@ const ea = { class: "rc-search-area" }, ta = { class: "rc-search-area__bar" }, n
|
|
|
1647
1647
|
P("span", aa, G(ae(p)), 1),
|
|
1648
1648
|
X(ne(te), {
|
|
1649
1649
|
name: "icon_a-xiala2",
|
|
1650
|
-
color:
|
|
1651
|
-
class: J(["rc-search-area__item-arrow", { "is-up":
|
|
1650
|
+
color: v.value !== E && we(p) > 0 ? "#1677ff" : "#969799",
|
|
1651
|
+
class: J(["rc-search-area__item-arrow", { "is-up": v.value === E }])
|
|
1652
1652
|
}, null, 8, ["color", "class"])
|
|
1653
1653
|
], 10, na))), 128))
|
|
1654
1654
|
]),
|
|
1655
|
-
X(
|
|
1655
|
+
X(Ye, { name: "rc-search-area-fade" }, {
|
|
1656
1656
|
default: oe(() => [
|
|
1657
|
-
|
|
1657
|
+
v.value !== null && e.showMask ? (u(), h("div", {
|
|
1658
1658
|
key: 0,
|
|
1659
1659
|
ref_key: "maskRef",
|
|
1660
1660
|
ref: o,
|
|
@@ -1665,57 +1665,57 @@ const ea = { class: "rc-search-area" }, ta = { class: "rc-search-area__bar" }, n
|
|
|
1665
1665
|
]),
|
|
1666
1666
|
_: 1
|
|
1667
1667
|
}),
|
|
1668
|
-
X(
|
|
1668
|
+
X(Ye, { name: "rc-search-area-slide" }, {
|
|
1669
1669
|
default: oe(() => {
|
|
1670
|
-
var p, E, ee, Q, c, z,
|
|
1670
|
+
var p, E, ee, Q, c, z, D, q, Ve, Fe, Ie, Qe, Ae, Pe, at, lt, ot, a, m;
|
|
1671
1671
|
return [
|
|
1672
|
-
|
|
1672
|
+
v.value !== null ? (u(), h("div", {
|
|
1673
1673
|
key: 0,
|
|
1674
1674
|
ref_key: "panelRef",
|
|
1675
1675
|
ref: $,
|
|
1676
1676
|
class: "rc-search-area__panel"
|
|
1677
1677
|
}, [
|
|
1678
1678
|
P("div", la, [
|
|
1679
|
-
(p =
|
|
1679
|
+
(p = f.value) != null && p.slot && n.$slots[f.value.key] ? Z(n.$slots, f.value.key, {
|
|
1680
1680
|
key: 0,
|
|
1681
|
-
value: ke(
|
|
1682
|
-
"update:value": (k) => Me(
|
|
1683
|
-
}, void 0, !0) : ((E =
|
|
1681
|
+
value: ke(f.value),
|
|
1682
|
+
"update:value": (k) => Me(f.value, k)
|
|
1683
|
+
}, void 0, !0) : ((E = f.value) == null ? void 0 : E.type) === "input" ? (u(), h("div", oa, [
|
|
1684
1684
|
Tt(P("input", {
|
|
1685
1685
|
"onUpdate:modelValue": s[0] || (s[0] = (k) => w.value = k),
|
|
1686
1686
|
type: "text",
|
|
1687
1687
|
class: "rc-search-area__input",
|
|
1688
|
-
placeholder:
|
|
1688
|
+
placeholder: f.value.placeholder || "请输入",
|
|
1689
1689
|
onInput: K
|
|
1690
1690
|
}, null, 40, ra), [
|
|
1691
1691
|
[Ft, w.value]
|
|
1692
1692
|
])
|
|
1693
|
-
])) : ((ee =
|
|
1693
|
+
])) : ((ee = f.value) == null ? void 0 : ee.type) === "calendar" ? (u(), h("div", sa, [
|
|
1694
1694
|
X(ne(We), {
|
|
1695
|
-
modelValue:
|
|
1696
|
-
"onUpdate:modelValue": s[1] || (s[1] = (k) =>
|
|
1697
|
-
range: ((Q =
|
|
1695
|
+
modelValue: x.value,
|
|
1696
|
+
"onUpdate:modelValue": s[1] || (s[1] = (k) => x.value = k),
|
|
1697
|
+
range: ((Q = f.value.calendarConfig) == null ? void 0 : Q.range) || !1,
|
|
1698
1698
|
mode: "default",
|
|
1699
|
-
"min-date": (c =
|
|
1700
|
-
"max-date": (z =
|
|
1701
|
-
"disabled-date": (
|
|
1702
|
-
formatter: (q =
|
|
1703
|
-
"end-date-offset": ((Ve =
|
|
1699
|
+
"min-date": (c = f.value.calendarConfig) == null ? void 0 : c.minDate,
|
|
1700
|
+
"max-date": (z = f.value.calendarConfig) == null ? void 0 : z.maxDate,
|
|
1701
|
+
"disabled-date": (D = f.value.calendarConfig) == null ? void 0 : D.disabledDate,
|
|
1702
|
+
formatter: (q = f.value.calendarConfig) == null ? void 0 : q.formatter,
|
|
1703
|
+
"end-date-offset": ((Ve = f.value.calendarConfig) == null ? void 0 : Ve.endDateOffset) || !1,
|
|
1704
1704
|
onChange: le
|
|
1705
1705
|
}, null, 8, ["modelValue", "range", "min-date", "max-date", "disabled-date", "formatter", "end-date-offset"])
|
|
1706
|
-
])) : ((Fe =
|
|
1707
|
-
(u(!0), h(de, null, ye(O(
|
|
1706
|
+
])) : ((Fe = f.value) == null ? void 0 : Fe.type) === "tree-single" ? (u(), h("div", ia, [
|
|
1707
|
+
(u(!0), h(de, null, ye(O(f.value), (k, U) => (u(), h("div", {
|
|
1708
1708
|
key: U,
|
|
1709
1709
|
class: "rc-search-area__tree-group"
|
|
1710
1710
|
}, [
|
|
1711
|
-
P("div", ua, G(y(k,
|
|
1711
|
+
P("div", ua, G(y(k, f.value || void 0)), 1),
|
|
1712
1712
|
P("div", ca, [
|
|
1713
|
-
(u(!0), h(de, null, ye(fe(k,
|
|
1713
|
+
(u(!0), h(de, null, ye(fe(k, f.value), (j, De) => (u(), h("div", {
|
|
1714
1714
|
key: De,
|
|
1715
1715
|
class: J(["rc-search-area__option", { "is-selected": L(j) }]),
|
|
1716
1716
|
onClick: (xe) => Te(j)
|
|
1717
1717
|
}, [
|
|
1718
|
-
P("span", fa, G(y(j,
|
|
1718
|
+
P("span", fa, G(y(j, f.value || void 0)), 1),
|
|
1719
1719
|
L(j) ? (u(), se(ne(te), {
|
|
1720
1720
|
key: 0,
|
|
1721
1721
|
name: "icon_check",
|
|
@@ -1724,19 +1724,19 @@ const ea = { class: "rc-search-area" }, ta = { class: "rc-search-area__bar" }, n
|
|
|
1724
1724
|
], 10, da))), 128))
|
|
1725
1725
|
])
|
|
1726
1726
|
]))), 128))
|
|
1727
|
-
])) : ((Ie =
|
|
1728
|
-
(u(!0), h(de, null, ye(O(
|
|
1727
|
+
])) : ((Ie = f.value) == null ? void 0 : Ie.type) === "tree-multiple" ? (u(), h("div", va, [
|
|
1728
|
+
(u(!0), h(de, null, ye(O(f.value), (k, U) => (u(), h("div", {
|
|
1729
1729
|
key: U,
|
|
1730
1730
|
class: "rc-search-area__tree-group"
|
|
1731
1731
|
}, [
|
|
1732
|
-
P("div", ma, G(y(k,
|
|
1732
|
+
P("div", ma, G(y(k, f.value || void 0)), 1),
|
|
1733
1733
|
P("div", pa, [
|
|
1734
|
-
(u(!0), h(de, null, ye(fe(k,
|
|
1734
|
+
(u(!0), h(de, null, ye(fe(k, f.value), (j, De) => (u(), h("div", {
|
|
1735
1735
|
key: De,
|
|
1736
1736
|
class: J(["rc-search-area__option", { "is-selected": L(j) }]),
|
|
1737
1737
|
onClick: (xe) => V(j)
|
|
1738
1738
|
}, [
|
|
1739
|
-
P("span", ya, G(y(j,
|
|
1739
|
+
P("span", ya, G(y(j, f.value || void 0)), 1),
|
|
1740
1740
|
L(j) ? (u(), se(ne(te), {
|
|
1741
1741
|
key: 0,
|
|
1742
1742
|
name: "icon_check",
|
|
@@ -1745,13 +1745,13 @@ const ea = { class: "rc-search-area" }, ta = { class: "rc-search-area__bar" }, n
|
|
|
1745
1745
|
], 10, ha))), 128))
|
|
1746
1746
|
])
|
|
1747
1747
|
]))), 128))
|
|
1748
|
-
])) : ((
|
|
1749
|
-
(u(!0), h(de, null, ye(
|
|
1748
|
+
])) : ((Qe = f.value) == null ? void 0 : Qe.type) === "single" ? (u(), h("div", ga, [
|
|
1749
|
+
(u(!0), h(de, null, ye(T(f.value), (k, U) => (u(), h("div", {
|
|
1750
1750
|
key: U,
|
|
1751
1751
|
class: J(["rc-search-area__option", { "is-selected": L(k) }]),
|
|
1752
1752
|
onClick: (j) => Te(k)
|
|
1753
1753
|
}, [
|
|
1754
|
-
P("span", _a, G(y(k,
|
|
1754
|
+
P("span", _a, G(y(k, f.value || void 0)), 1),
|
|
1755
1755
|
L(k) ? (u(), se(ne(te), {
|
|
1756
1756
|
key: 0,
|
|
1757
1757
|
name: "icon_check",
|
|
@@ -1759,12 +1759,12 @@ const ea = { class: "rc-search-area" }, ta = { class: "rc-search-area__bar" }, n
|
|
|
1759
1759
|
})) : F("", !0)
|
|
1760
1760
|
], 10, ba))), 128))
|
|
1761
1761
|
])) : (u(), h("div", ka, [
|
|
1762
|
-
(u(!0), h(de, null, ye(
|
|
1762
|
+
(u(!0), h(de, null, ye(T(f.value), (k, U) => (u(), h("div", {
|
|
1763
1763
|
key: U,
|
|
1764
1764
|
class: J(["rc-search-area__option", { "is-selected": L(k) }]),
|
|
1765
1765
|
onClick: (j) => V(k)
|
|
1766
1766
|
}, [
|
|
1767
|
-
P("span", $a, G(y(k,
|
|
1767
|
+
P("span", $a, G(y(k, f.value || void 0)), 1),
|
|
1768
1768
|
L(k) ? (u(), se(ne(te), {
|
|
1769
1769
|
key: 0,
|
|
1770
1770
|
name: "icon_check",
|
|
@@ -1772,11 +1772,11 @@ const ea = { class: "rc-search-area" }, ta = { class: "rc-search-area__bar" }, n
|
|
|
1772
1772
|
})) : F("", !0)
|
|
1773
1773
|
], 10, wa))), 128))
|
|
1774
1774
|
])),
|
|
1775
|
-
((
|
|
1775
|
+
((Ae = f.value) == null ? void 0 : Ae.type) !== "input" && ((Pe = f.value) == null ? void 0 : Pe.type) !== "calendar" && !((at = f.value) != null && at.slot) && ((ot = (lt = f.value) == null ? void 0 : lt.options) == null ? void 0 : ot.length) === 0 ? (u(), h("div", Da, [...s[2] || (s[2] = [
|
|
1776
1776
|
P("p", null, "暂无选项", -1)
|
|
1777
1777
|
])])) : F("", !0)
|
|
1778
1778
|
]),
|
|
1779
|
-
!e.autoConfirm && ((a =
|
|
1779
|
+
!e.autoConfirm && ((a = f.value) == null ? void 0 : a.type) !== "single" && ((m = f.value) == null ? void 0 : m.type) !== "tree-single" ? (u(), h("div", xa, [
|
|
1780
1780
|
X(ne($e), {
|
|
1781
1781
|
block: "",
|
|
1782
1782
|
onClick: A
|
|
@@ -1804,7 +1804,7 @@ const ea = { class: "rc-search-area" }, ta = { class: "rc-search-area__bar" }, n
|
|
|
1804
1804
|
})
|
|
1805
1805
|
]));
|
|
1806
1806
|
}
|
|
1807
|
-
}), Ct = /* @__PURE__ */ ce(Ca, [["__scopeId", "data-v-
|
|
1807
|
+
}), Ct = /* @__PURE__ */ ce(Ca, [["__scopeId", "data-v-084a312b"]]), St = (t) => {
|
|
1808
1808
|
t.component("RcSearchArea", Ct), t.component("rc-search-area", Ct);
|
|
1809
1809
|
}, Sa = ["disabled"], Ma = {
|
|
1810
1810
|
key: 1,
|
|
@@ -1863,27 +1863,29 @@ const ea = { class: "rc-search-area" }, ta = { class: "rc-search-area__bar" }, n
|
|
|
1863
1863
|
},
|
|
1864
1864
|
emits: ["update:modelValue", "input", "change", "focus", "blur", "clear", "keydown", "mouseenter", "mouseleave", "compositionstart", "compositionupdate", "compositionend"],
|
|
1865
1865
|
setup(t, { expose: i, emit: l }) {
|
|
1866
|
-
const e = t, g = be(ut, {}),
|
|
1866
|
+
const e = t, g = be(ut, {}), v = be("rcFormItem", void 0), $ = B(() => e.deviceType || (g == null ? void 0 : g.inputDeviceType) || ft.inputDeviceType || "pc"), o = l, r = W(), d = W(e.modelValue ?? ""), N = W(!1), C = W(!1), w = W(!1);
|
|
1867
1867
|
_e(
|
|
1868
1868
|
() => e.modelValue,
|
|
1869
1869
|
(c) => {
|
|
1870
|
-
|
|
1870
|
+
d.value = c ?? "";
|
|
1871
1871
|
}
|
|
1872
1872
|
);
|
|
1873
|
-
const
|
|
1874
|
-
if (
|
|
1875
|
-
|
|
1873
|
+
const x = B(() => e.type === "number"), H = B(() => e.type === "password" ? C.value ? "text" : "password" : x.value ? "text" : e.type), I = B(() => {
|
|
1874
|
+
if (x.value) {
|
|
1875
|
+
if (typeof d.value == "string" && d.value.endsWith(".") && !d.value.includes("e") && !d.value.includes("E"))
|
|
1876
|
+
return d.value;
|
|
1877
|
+
const z = _(d.value);
|
|
1876
1878
|
if (z == null)
|
|
1877
|
-
return "";
|
|
1878
|
-
let
|
|
1879
|
-
return e.precision !== void 0 && (
|
|
1879
|
+
return typeof d.value == "string" && (d.value === "-" || d.value === "") ? d.value : "";
|
|
1880
|
+
let D = String(z);
|
|
1881
|
+
return e.precision !== void 0 && (D = z.toFixed(e.precision)), e.useGrouping && !w.value && (D = S(D)), D;
|
|
1880
1882
|
}
|
|
1881
|
-
const c = String(
|
|
1883
|
+
const c = String(d.value ?? "");
|
|
1882
1884
|
return e.formatter && !w.value ? e.formatter(c) : c;
|
|
1883
|
-
}),
|
|
1884
|
-
const c =
|
|
1885
|
+
}), f = B(() => {
|
|
1886
|
+
const c = d.value;
|
|
1885
1887
|
return c !== "" && c !== null && c !== void 0;
|
|
1886
|
-
}), ie = B(() => String(
|
|
1888
|
+
}), ie = B(() => String(d.value ?? "").length), ae = B(() => !e.clearable || !f.value || e.disabled || e.readonly ? !1 : ($.value === "mobile", !0)), b = Yt(), Y = B(() => x.value && e.controls ? !!(e.suffixIcon || b.suffix) : !!(e.suffixIcon || e.showPassword && e.type === "password" || ae.value && e.type !== "textarea" && !x.value || b.suffix)), y = B(() => {
|
|
1887
1889
|
if (e.type !== "textarea") return {};
|
|
1888
1890
|
const c = {};
|
|
1889
1891
|
return e.autosize ? c.resize = "none" : e.resize !== void 0 ? c.resize = e.resize : c.resize = "vertical", c;
|
|
@@ -1896,43 +1898,57 @@ const ea = { class: "rc-search-area" }, ta = { class: "rc-search-area__bar" }, n
|
|
|
1896
1898
|
const z = Number(String(c).replace(/,/g, ""));
|
|
1897
1899
|
return isNaN(z) ? null : z;
|
|
1898
1900
|
}
|
|
1899
|
-
function
|
|
1901
|
+
function S(c) {
|
|
1900
1902
|
const z = c.split(".");
|
|
1901
1903
|
return z[0] = z[0].replace(/\B(?=(\d{3})+(?!\d))/g, ","), z.join(".");
|
|
1902
1904
|
}
|
|
1903
|
-
function
|
|
1905
|
+
function M(c) {
|
|
1904
1906
|
if (c === null) return null;
|
|
1905
1907
|
let z = c;
|
|
1906
1908
|
return e.min !== void 0 && z < e.min && (z = e.min), e.max !== void 0 && z > e.max && (z = e.max), e.precision !== void 0 && (z = Number(z.toFixed(e.precision))), z;
|
|
1907
1909
|
}
|
|
1908
1910
|
const R = B(() => {
|
|
1909
|
-
if (!
|
|
1910
|
-
const c = _(
|
|
1911
|
+
if (!x.value || e.max === void 0) return !1;
|
|
1912
|
+
const c = _(d.value);
|
|
1911
1913
|
return c !== null && c >= e.max;
|
|
1912
1914
|
}), L = B(() => {
|
|
1913
|
-
if (!
|
|
1914
|
-
const c = _(
|
|
1915
|
+
if (!x.value || e.min === void 0) return !1;
|
|
1916
|
+
const c = _(d.value);
|
|
1915
1917
|
return c !== null && c <= e.min;
|
|
1916
1918
|
});
|
|
1917
|
-
function
|
|
1919
|
+
function T(c) {
|
|
1918
1920
|
var Ve, Fe, Ie;
|
|
1919
|
-
let
|
|
1920
|
-
if (
|
|
1921
|
-
if (
|
|
1922
|
-
|
|
1921
|
+
let D = c.target.value;
|
|
1922
|
+
if (x.value && (D = D.replace(/,/g, "")), e.parser && !w.value && (D = e.parser(D)), x.value) {
|
|
1923
|
+
if (D === "" || D === "-" || D === ".") {
|
|
1924
|
+
d.value = D === "" ? void 0 : D, o("update:modelValue", D === "" ? void 0 : D), o("input", D === "" ? void 0 : D), (Ve = v == null ? void 0 : v.onChange) == null || Ve.call(v);
|
|
1923
1925
|
return;
|
|
1924
1926
|
}
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1927
|
+
if (/^-?(\d+\.?\d*|\.\d+)([eE][+-]?\d+)?$/.test(D)) {
|
|
1928
|
+
const Ae = _(D);
|
|
1929
|
+
if (Ae !== null)
|
|
1930
|
+
if (D.endsWith(".") && !D.includes("e") && !D.includes("E"))
|
|
1931
|
+
d.value = D, o("update:modelValue", D), o("input", D);
|
|
1932
|
+
else {
|
|
1933
|
+
const Pe = M(Ae);
|
|
1934
|
+
d.value = Pe, o("update:modelValue", Pe), o("input", Pe);
|
|
1935
|
+
}
|
|
1936
|
+
else
|
|
1937
|
+
d.value = D, o("update:modelValue", D), o("input", D);
|
|
1938
|
+
} else {
|
|
1939
|
+
Ee(() => {
|
|
1940
|
+
if (r.value) {
|
|
1941
|
+
const Ae = I.value;
|
|
1942
|
+
r.value.value = Ae;
|
|
1943
|
+
}
|
|
1944
|
+
});
|
|
1945
|
+
return;
|
|
1946
|
+
}
|
|
1947
|
+
(Fe = v == null ? void 0 : v.onChange) == null || Fe.call(v);
|
|
1932
1948
|
return;
|
|
1933
1949
|
}
|
|
1934
|
-
const q =
|
|
1935
|
-
|
|
1950
|
+
const q = D === "" ? void 0 : D;
|
|
1951
|
+
d.value = q, o("update:modelValue", q), o("input", q), (Ie = v == null ? void 0 : v.onChange) == null || Ie.call(v), e.type === "textarea" && e.autosize && Ee(() => {
|
|
1936
1952
|
s();
|
|
1937
1953
|
});
|
|
1938
1954
|
}
|
|
@@ -1941,45 +1957,45 @@ const ea = { class: "rc-search-area" }, ta = { class: "rc-search-area__bar" }, n
|
|
|
1941
1957
|
}
|
|
1942
1958
|
function fe(c) {
|
|
1943
1959
|
var z;
|
|
1944
|
-
if (N.value = !1,
|
|
1945
|
-
const
|
|
1946
|
-
if (
|
|
1947
|
-
const q =
|
|
1948
|
-
|
|
1960
|
+
if (N.value = !1, x.value) {
|
|
1961
|
+
const D = _(d.value);
|
|
1962
|
+
if (D !== null) {
|
|
1963
|
+
const q = M(D);
|
|
1964
|
+
d.value = q, o("update:modelValue", q), o("change", q);
|
|
1949
1965
|
} else
|
|
1950
|
-
|
|
1966
|
+
d.value = void 0, o("update:modelValue", void 0), o("change", void 0);
|
|
1951
1967
|
} else {
|
|
1952
|
-
const
|
|
1953
|
-
o("change",
|
|
1968
|
+
const D = d.value;
|
|
1969
|
+
o("change", D === "" ? void 0 : D);
|
|
1954
1970
|
}
|
|
1955
|
-
o("blur", c), (z =
|
|
1971
|
+
o("blur", c), (z = v == null ? void 0 : v.onBlur) == null || z.call(v);
|
|
1956
1972
|
}
|
|
1957
1973
|
function ke() {
|
|
1958
|
-
|
|
1974
|
+
d.value = void 0, o("update:modelValue", void 0), o("input", void 0), o("change", void 0), o("clear"), Ee(() => {
|
|
1959
1975
|
var c;
|
|
1960
1976
|
(c = r.value) == null || c.focus();
|
|
1961
1977
|
});
|
|
1962
1978
|
}
|
|
1963
1979
|
function Me() {
|
|
1964
|
-
|
|
1980
|
+
C.value = !C.value;
|
|
1965
1981
|
}
|
|
1966
1982
|
function Te() {
|
|
1967
1983
|
var q;
|
|
1968
1984
|
if (e.disabled || e.readonly || R.value) return;
|
|
1969
|
-
const c = _(
|
|
1970
|
-
let
|
|
1971
|
-
c === null ?
|
|
1985
|
+
const c = _(d.value), z = e.step ?? 1;
|
|
1986
|
+
let D;
|
|
1987
|
+
c === null ? D = M(e.min ?? 0) ?? 0 : D = M(c + z) ?? c, d.value = D, o("update:modelValue", D), o("input", D), o("change", D), (q = v == null ? void 0 : v.onChange) == null || q.call(v);
|
|
1972
1988
|
}
|
|
1973
1989
|
function V() {
|
|
1974
1990
|
var q;
|
|
1975
1991
|
if (e.disabled || e.readonly || L.value) return;
|
|
1976
|
-
const c = _(
|
|
1977
|
-
let
|
|
1978
|
-
c === null ?
|
|
1992
|
+
const c = _(d.value), z = e.step ?? 1;
|
|
1993
|
+
let D;
|
|
1994
|
+
c === null ? D = M(e.max ?? 0) ?? 0 : D = M(c - z) ?? c, d.value = D, o("update:modelValue", D), o("input", D), o("change", D), (q = v == null ? void 0 : v.onChange) == null || q.call(v);
|
|
1979
1995
|
}
|
|
1980
1996
|
function A(c) {
|
|
1981
|
-
if (o("keydown", c),
|
|
1982
|
-
const z = e.step ?? 1,
|
|
1997
|
+
if (o("keydown", c), x.value && !e.disabled && !e.readonly) {
|
|
1998
|
+
const z = e.step ?? 1, D = _(d.value);
|
|
1983
1999
|
if (c.key === "ArrowUp") {
|
|
1984
2000
|
c.preventDefault(), Te();
|
|
1985
2001
|
return;
|
|
@@ -1989,22 +2005,22 @@ const ea = { class: "rc-search-area" }, ta = { class: "rc-search-area__bar" }, n
|
|
|
1989
2005
|
return;
|
|
1990
2006
|
}
|
|
1991
2007
|
if (c.key === "PageUp") {
|
|
1992
|
-
if (c.preventDefault(),
|
|
1993
|
-
const q =
|
|
1994
|
-
|
|
2008
|
+
if (c.preventDefault(), D !== null) {
|
|
2009
|
+
const q = M(D + z * 10);
|
|
2010
|
+
d.value = q, o("update:modelValue", q), o("input", q), o("change", q);
|
|
1995
2011
|
}
|
|
1996
2012
|
return;
|
|
1997
2013
|
}
|
|
1998
2014
|
if (c.key === "PageDown") {
|
|
1999
|
-
if (c.preventDefault(),
|
|
2000
|
-
const q =
|
|
2001
|
-
|
|
2015
|
+
if (c.preventDefault(), D !== null) {
|
|
2016
|
+
const q = M(D - z * 10);
|
|
2017
|
+
d.value = q, o("update:modelValue", q), o("input", q), o("change", q);
|
|
2002
2018
|
}
|
|
2003
2019
|
return;
|
|
2004
2020
|
}
|
|
2005
2021
|
}
|
|
2006
2022
|
if (c.key === "Enter" && e.type !== "textarea") {
|
|
2007
|
-
const z =
|
|
2023
|
+
const z = d.value;
|
|
2008
2024
|
o("change", z === "" ? void 0 : z);
|
|
2009
2025
|
}
|
|
2010
2026
|
}
|
|
@@ -2021,7 +2037,7 @@ const ea = { class: "rc-search-area" }, ta = { class: "rc-search-area__bar" }, n
|
|
|
2021
2037
|
o("compositionupdate", c);
|
|
2022
2038
|
}
|
|
2023
2039
|
function Re(c) {
|
|
2024
|
-
w.value = !1, o("compositionend", c), c.target &&
|
|
2040
|
+
w.value = !1, o("compositionend", c), c.target && T(c);
|
|
2025
2041
|
}
|
|
2026
2042
|
function n() {
|
|
2027
2043
|
var c;
|
|
@@ -2034,7 +2050,7 @@ const ea = { class: "rc-search-area" }, ta = { class: "rc-search-area__bar" }, n
|
|
|
2034
2050
|
c.style.height = "auto";
|
|
2035
2051
|
const z = c.scrollHeight;
|
|
2036
2052
|
if (typeof e.autosize == "object") {
|
|
2037
|
-
const { minRows:
|
|
2053
|
+
const { minRows: D = 2, maxRows: q } = e.autosize, Ve = parseInt(getComputedStyle(c).lineHeight) || 20, Fe = D * Ve, Ie = q ? q * Ve : 1 / 0;
|
|
2038
2054
|
c.style.height = `${Math.min(Math.max(z, Fe), Ie)}px`;
|
|
2039
2055
|
} else
|
|
2040
2056
|
c.style.height = `${z}px`;
|
|
@@ -2071,18 +2087,18 @@ const ea = { class: "rc-search-area" }, ta = { class: "rc-search-area__bar" }, n
|
|
|
2071
2087
|
"is-focused": N.value,
|
|
2072
2088
|
"is-readonly": t.readonly,
|
|
2073
2089
|
"rc-input--textarea": t.type === "textarea",
|
|
2074
|
-
"has-prepend": c.$slots.prepend ||
|
|
2075
|
-
"has-append": c.$slots.append ||
|
|
2090
|
+
"has-prepend": c.$slots.prepend || x.value && t.controls,
|
|
2091
|
+
"has-append": c.$slots.append || x.value && t.controls
|
|
2076
2092
|
}
|
|
2077
2093
|
]]),
|
|
2078
2094
|
onClick: n
|
|
2079
2095
|
}, [
|
|
2080
|
-
|
|
2096
|
+
x.value && t.controls ? (u(), h("button", {
|
|
2081
2097
|
key: 0,
|
|
2082
2098
|
type: "button",
|
|
2083
2099
|
class: "rc-input__number-btn rc-input__number-btn--decrease rc-input__number-btn--prepend",
|
|
2084
2100
|
disabled: e.disabled || e.readonly || L.value,
|
|
2085
|
-
onClick:
|
|
2101
|
+
onClick: Be(V, ["stop"])
|
|
2086
2102
|
}, [...z[0] || (z[0] = [
|
|
2087
2103
|
P("span", { class: "rc-input__number-text" }, "-", -1)
|
|
2088
2104
|
])], 8, Sa)) : F("", !0),
|
|
@@ -2103,7 +2119,7 @@ const ea = { class: "rc-search-area" }, ta = { class: "rc-search-area__bar" }, n
|
|
|
2103
2119
|
(u(), se(pt("textarea"), {
|
|
2104
2120
|
ref_key: "inputRef",
|
|
2105
2121
|
ref: r,
|
|
2106
|
-
value:
|
|
2122
|
+
value: I.value,
|
|
2107
2123
|
class: "rc-input__field rc-input__field--textarea",
|
|
2108
2124
|
placeholder: t.placeholder,
|
|
2109
2125
|
disabled: t.disabled,
|
|
@@ -2117,7 +2133,7 @@ const ea = { class: "rc-search-area" }, ta = { class: "rc-search-area__bar" }, n
|
|
|
2117
2133
|
form: t.form,
|
|
2118
2134
|
tabindex: t.tabindex,
|
|
2119
2135
|
style: re(y.value),
|
|
2120
|
-
onInput:
|
|
2136
|
+
onInput: T,
|
|
2121
2137
|
onFocus: O,
|
|
2122
2138
|
onBlur: fe,
|
|
2123
2139
|
onKeydown: A,
|
|
@@ -2131,7 +2147,7 @@ const ea = { class: "rc-search-area" }, ta = { class: "rc-search-area__bar" }, n
|
|
|
2131
2147
|
key: 0,
|
|
2132
2148
|
type: "button",
|
|
2133
2149
|
class: J(["rc-input__clear rc-input__clear--textarea", { "rc-input__clear--mobile": $.value === "mobile" }]),
|
|
2134
|
-
onClick:
|
|
2150
|
+
onClick: Be(ke, ["stop"])
|
|
2135
2151
|
}, [
|
|
2136
2152
|
X(ne(te), {
|
|
2137
2153
|
name: "icon_close_circle",
|
|
@@ -2142,9 +2158,9 @@ const ea = { class: "rc-search-area" }, ta = { class: "rc-search-area__bar" }, n
|
|
|
2142
2158
|
key: 2,
|
|
2143
2159
|
ref_key: "inputRef",
|
|
2144
2160
|
ref: r,
|
|
2145
|
-
value:
|
|
2161
|
+
value: I.value,
|
|
2146
2162
|
type: H.value,
|
|
2147
|
-
class: J(["rc-input__field", { "rc-input__field--number":
|
|
2163
|
+
class: J(["rc-input__field", { "rc-input__field--number": x.value }]),
|
|
2148
2164
|
placeholder: t.placeholder,
|
|
2149
2165
|
disabled: t.disabled,
|
|
2150
2166
|
readonly: t.readonly,
|
|
@@ -2155,10 +2171,10 @@ const ea = { class: "rc-search-area" }, ta = { class: "rc-search-area__bar" }, n
|
|
|
2155
2171
|
autofocus: t.autofocus,
|
|
2156
2172
|
form: t.form,
|
|
2157
2173
|
tabindex: t.tabindex,
|
|
2158
|
-
min:
|
|
2159
|
-
max:
|
|
2160
|
-
step:
|
|
2161
|
-
onInput:
|
|
2174
|
+
min: x.value ? t.min : void 0,
|
|
2175
|
+
max: x.value ? t.max : void 0,
|
|
2176
|
+
step: x.value ? t.step : void 0,
|
|
2177
|
+
onInput: T,
|
|
2162
2178
|
onFocus: O,
|
|
2163
2179
|
onBlur: fe,
|
|
2164
2180
|
onKeydown: A,
|
|
@@ -2172,29 +2188,29 @@ const ea = { class: "rc-search-area" }, ta = { class: "rc-search-area__bar" }, n
|
|
|
2172
2188
|
c.$slots.suffix ? (u(), h("div", Fa, [
|
|
2173
2189
|
Z(c.$slots, "suffix", {}, void 0, !0)
|
|
2174
2190
|
])) : F("", !0),
|
|
2175
|
-
t.showPassword && t.type === "password" &&
|
|
2191
|
+
t.showPassword && t.type === "password" && f.value ? (u(), h("button", {
|
|
2176
2192
|
key: 1,
|
|
2177
2193
|
type: "button",
|
|
2178
2194
|
class: "rc-input__password-toggle",
|
|
2179
|
-
onClick:
|
|
2195
|
+
onClick: Be(Me, ["stop"])
|
|
2180
2196
|
}, [
|
|
2181
2197
|
X(ne(te), {
|
|
2182
|
-
color:
|
|
2183
|
-
name:
|
|
2198
|
+
color: C.value ? "#1677ff" : "#999",
|
|
2199
|
+
name: C.value ? "icon_view" : "icon_view-off"
|
|
2184
2200
|
}, null, 8, ["color", "name"])
|
|
2185
2201
|
])) : F("", !0),
|
|
2186
|
-
ae.value && t.type !== "textarea" && !
|
|
2202
|
+
ae.value && t.type !== "textarea" && !x.value ? (u(), h("button", {
|
|
2187
2203
|
key: 2,
|
|
2188
2204
|
type: "button",
|
|
2189
2205
|
class: J(["rc-input__clear", { "rc-input__clear--mobile": $.value === "mobile" }]),
|
|
2190
|
-
onClick:
|
|
2206
|
+
onClick: Be(ke, ["stop"])
|
|
2191
2207
|
}, [
|
|
2192
2208
|
X(ne(te), {
|
|
2193
2209
|
name: "icon_close_circle",
|
|
2194
2210
|
class: "rc-input__clear-icon"
|
|
2195
2211
|
})
|
|
2196
2212
|
], 2)) : F("", !0),
|
|
2197
|
-
t.suffixIcon && !t.clearable && !t.showPassword && !
|
|
2213
|
+
t.suffixIcon && !t.clearable && !t.showPassword && !x.value ? (u(), se(ne(te), {
|
|
2198
2214
|
key: 3,
|
|
2199
2215
|
name: t.suffixIcon,
|
|
2200
2216
|
class: "rc-input__suffix-icon"
|
|
@@ -2205,21 +2221,21 @@ const ea = { class: "rc-search-area" }, ta = { class: "rc-search-area__bar" }, n
|
|
|
2205
2221
|
c.$slots.append ? (u(), h("div", Ba, [
|
|
2206
2222
|
Z(c.$slots, "append", {}, void 0, !0)
|
|
2207
2223
|
])) : F("", !0),
|
|
2208
|
-
|
|
2224
|
+
x.value && t.controls ? (u(), h("button", {
|
|
2209
2225
|
key: 3,
|
|
2210
2226
|
type: "button",
|
|
2211
2227
|
class: "rc-input__number-btn rc-input__number-btn--increase rc-input__number-btn--append",
|
|
2212
2228
|
disabled: e.disabled || e.readonly || R.value,
|
|
2213
|
-
onClick:
|
|
2229
|
+
onClick: Be(Te, ["stop"])
|
|
2214
2230
|
}, [...z[1] || (z[1] = [
|
|
2215
2231
|
P("span", { class: "rc-input__number-text" }, "+", -1)
|
|
2216
2232
|
])], 8, Ea)) : F("", !0)
|
|
2217
2233
|
], 2));
|
|
2218
2234
|
}
|
|
2219
|
-
}),
|
|
2220
|
-
|
|
2235
|
+
}), Ze = /* @__PURE__ */ ce(Pa, [["__scopeId", "data-v-2e3768e2"]]);
|
|
2236
|
+
Ze && (Ze.name = "rc-input");
|
|
2221
2237
|
function Mt(t) {
|
|
2222
|
-
return
|
|
2238
|
+
return Ze && t.component(Ze.name || "rc-input", Ze), t;
|
|
2223
2239
|
}
|
|
2224
2240
|
const Na = /* @__PURE__ */ ue({
|
|
2225
2241
|
name: "rc-dropdown-menu",
|
|
@@ -2231,28 +2247,28 @@ const Na = /* @__PURE__ */ ue({
|
|
|
2231
2247
|
},
|
|
2232
2248
|
emits: ["mouseenter", "mouseleave"],
|
|
2233
2249
|
setup(t, { expose: i, emit: l }) {
|
|
2234
|
-
const e = t, g = W(),
|
|
2250
|
+
const e = t, g = W(), v = B(() => e.visible === void 0 ? !0 : e.visible), $ = B(() => e.visible !== void 0), o = B(() => {
|
|
2235
2251
|
const r = {};
|
|
2236
2252
|
return e.maxHeight && (r.maxHeight = typeof e.maxHeight == "number" ? `${e.maxHeight}px` : e.maxHeight, r.overflowY = "auto"), r;
|
|
2237
2253
|
});
|
|
2238
2254
|
return i({
|
|
2239
2255
|
menuRef: g
|
|
2240
|
-
}), (r,
|
|
2256
|
+
}), (r, d) => $.value ? (u(), se(dt, {
|
|
2241
2257
|
key: 0,
|
|
2242
2258
|
to: "body"
|
|
2243
2259
|
}, [
|
|
2244
|
-
X(
|
|
2260
|
+
X(Ye, { name: "rc-dropdown-fade" }, {
|
|
2245
2261
|
default: oe(() => [
|
|
2246
|
-
|
|
2262
|
+
v.value ? (u(), h("ul", {
|
|
2247
2263
|
key: 0,
|
|
2248
2264
|
ref_key: "menuRef",
|
|
2249
2265
|
ref: g,
|
|
2250
2266
|
class: J(["rc-dropdown-menu", [`rc-dropdown-menu--${t.effect}`]]),
|
|
2251
2267
|
style: re(o.value),
|
|
2252
|
-
onClick:
|
|
2268
|
+
onClick: d[0] || (d[0] = Be(() => {
|
|
2253
2269
|
}, ["stop"])),
|
|
2254
|
-
onMouseenter:
|
|
2255
|
-
onMouseleave:
|
|
2270
|
+
onMouseenter: d[1] || (d[1] = (N) => r.$emit("mouseenter", N)),
|
|
2271
|
+
onMouseleave: d[2] || (d[2] = (N) => r.$emit("mouseleave", N))
|
|
2256
2272
|
}, [
|
|
2257
2273
|
Z(r.$slots, "default", {}, void 0, !0)
|
|
2258
2274
|
], 38)) : F("", !0)
|
|
@@ -2265,10 +2281,10 @@ const Na = /* @__PURE__ */ ue({
|
|
|
2265
2281
|
ref: g,
|
|
2266
2282
|
class: J(["rc-dropdown-menu rc-dropdown-menu--nested", [`rc-dropdown-menu--${t.effect}`]]),
|
|
2267
2283
|
style: re(o.value),
|
|
2268
|
-
onClick:
|
|
2284
|
+
onClick: d[3] || (d[3] = Be(() => {
|
|
2269
2285
|
}, ["stop"])),
|
|
2270
|
-
onMouseenter:
|
|
2271
|
-
onMouseleave:
|
|
2286
|
+
onMouseenter: d[4] || (d[4] = (N) => r.$emit("mouseenter", N)),
|
|
2287
|
+
onMouseleave: d[5] || (d[5] = (N) => r.$emit("mouseleave", N))
|
|
2272
2288
|
}, [
|
|
2273
2289
|
Z(r.$slots, "default", {}, void 0, !0)
|
|
2274
2290
|
], 38));
|
|
@@ -2288,112 +2304,112 @@ const Na = /* @__PURE__ */ ue({
|
|
|
2288
2304
|
},
|
|
2289
2305
|
emits: ["command", "visible-change"],
|
|
2290
2306
|
setup(t, { expose: i, emit: l }) {
|
|
2291
|
-
const e = t, g = l,
|
|
2292
|
-
let r = null,
|
|
2293
|
-
function N(
|
|
2294
|
-
e.hideOnClick && (o.value = !1),
|
|
2307
|
+
const e = t, g = l, v = W(), $ = W(), o = W(!1);
|
|
2308
|
+
let r = null, d = null;
|
|
2309
|
+
function N(S) {
|
|
2310
|
+
e.hideOnClick && (o.value = !1), S !== void 0 && g("command", S);
|
|
2295
2311
|
}
|
|
2296
2312
|
Ce("handleItemClick", N);
|
|
2297
|
-
function
|
|
2298
|
-
e.disabled || (r && (clearTimeout(r), r = null),
|
|
2313
|
+
function C() {
|
|
2314
|
+
e.disabled || (r && (clearTimeout(r), r = null), d && (clearTimeout(d), d = null), r = setTimeout(() => {
|
|
2299
2315
|
o.value = !0, requestAnimationFrame(() => {
|
|
2300
|
-
|
|
2316
|
+
Ee(() => {
|
|
2301
2317
|
Y();
|
|
2302
2318
|
});
|
|
2303
2319
|
});
|
|
2304
2320
|
}, e.showTimeout));
|
|
2305
2321
|
}
|
|
2306
2322
|
function w() {
|
|
2307
|
-
e.trigger === "hover" &&
|
|
2308
|
-
o.value = !1,
|
|
2323
|
+
e.trigger === "hover" && f.value || (d && (clearTimeout(d), d = null), r && (clearTimeout(r), r = null), d = setTimeout(() => {
|
|
2324
|
+
o.value = !1, f.value = !1;
|
|
2309
2325
|
}, e.hideTimeout));
|
|
2310
2326
|
}
|
|
2311
|
-
function
|
|
2312
|
-
e.disabled || (o.value ? w() :
|
|
2327
|
+
function x() {
|
|
2328
|
+
e.disabled || (o.value ? w() : C());
|
|
2313
2329
|
}
|
|
2314
2330
|
function H() {
|
|
2315
|
-
e.trigger === "hover" && !e.disabled &&
|
|
2331
|
+
e.trigger === "hover" && !e.disabled && C();
|
|
2316
2332
|
}
|
|
2317
|
-
function
|
|
2333
|
+
function I() {
|
|
2318
2334
|
e.trigger === "hover" && setTimeout(() => {
|
|
2319
|
-
|
|
2335
|
+
f.value || w();
|
|
2320
2336
|
}, 50);
|
|
2321
2337
|
}
|
|
2322
|
-
const
|
|
2338
|
+
const f = W(!1);
|
|
2323
2339
|
function ie() {
|
|
2324
|
-
e.trigger === "hover" && (
|
|
2340
|
+
e.trigger === "hover" && (f.value = !0, r && (clearTimeout(r), r = null), d && (clearTimeout(d), d = null));
|
|
2325
2341
|
}
|
|
2326
2342
|
function ae() {
|
|
2327
|
-
e.trigger === "hover" && (
|
|
2343
|
+
e.trigger === "hover" && (f.value = !1, w());
|
|
2328
2344
|
}
|
|
2329
|
-
function b(
|
|
2330
|
-
e.trigger === "click" && !e.disabled && (
|
|
2345
|
+
function b(S) {
|
|
2346
|
+
e.trigger === "click" && !e.disabled && (S.stopPropagation(), x());
|
|
2331
2347
|
}
|
|
2332
2348
|
function Y() {
|
|
2333
2349
|
var Me;
|
|
2334
|
-
if (!
|
|
2335
|
-
const
|
|
2336
|
-
if (!
|
|
2337
|
-
const R =
|
|
2350
|
+
if (!v.value || !((Me = $.value) != null && Me.menuRef)) return;
|
|
2351
|
+
const S = v.value, M = $.value.menuRef;
|
|
2352
|
+
if (!S || !M) return;
|
|
2353
|
+
const R = S.getBoundingClientRect(), L = M.getBoundingClientRect();
|
|
2338
2354
|
if (L.width === 0 || L.height === 0) {
|
|
2339
2355
|
setTimeout(() => {
|
|
2340
2356
|
o.value && Y();
|
|
2341
2357
|
}, 10);
|
|
2342
2358
|
return;
|
|
2343
2359
|
}
|
|
2344
|
-
let
|
|
2360
|
+
let T = 0, O = 0;
|
|
2345
2361
|
switch (e.placement) {
|
|
2346
2362
|
case "top":
|
|
2347
|
-
|
|
2363
|
+
T = R.top - L.height, O = R.left;
|
|
2348
2364
|
break;
|
|
2349
2365
|
case "top-start":
|
|
2350
|
-
|
|
2366
|
+
T = R.top - L.height, O = R.left;
|
|
2351
2367
|
break;
|
|
2352
2368
|
case "top-end":
|
|
2353
|
-
|
|
2369
|
+
T = R.top - L.height, O = R.left + R.width - L.width;
|
|
2354
2370
|
break;
|
|
2355
2371
|
case "bottom":
|
|
2356
|
-
|
|
2372
|
+
T = R.bottom, O = R.left + (R.width - L.width) / 2;
|
|
2357
2373
|
break;
|
|
2358
2374
|
case "bottom-start":
|
|
2359
|
-
|
|
2375
|
+
T = R.bottom, O = R.left;
|
|
2360
2376
|
break;
|
|
2361
2377
|
case "bottom-end":
|
|
2362
|
-
|
|
2378
|
+
T = R.bottom, O = R.left + R.width - L.width;
|
|
2363
2379
|
break;
|
|
2364
2380
|
case "left":
|
|
2365
|
-
|
|
2381
|
+
T = R.top + (R.height - L.height) / 2, O = R.left - L.width;
|
|
2366
2382
|
break;
|
|
2367
2383
|
case "left-start":
|
|
2368
|
-
|
|
2384
|
+
T = R.top, O = R.left - L.width;
|
|
2369
2385
|
break;
|
|
2370
2386
|
case "left-end":
|
|
2371
|
-
|
|
2387
|
+
T = R.top + R.height - L.height, O = R.left - L.width;
|
|
2372
2388
|
break;
|
|
2373
2389
|
case "right":
|
|
2374
|
-
|
|
2390
|
+
T = R.top + (R.height - L.height) / 2, O = R.right;
|
|
2375
2391
|
break;
|
|
2376
2392
|
case "right-start":
|
|
2377
|
-
|
|
2393
|
+
T = R.top, O = R.right;
|
|
2378
2394
|
break;
|
|
2379
2395
|
case "right-end":
|
|
2380
|
-
|
|
2396
|
+
T = R.top + R.height - L.height, O = R.right;
|
|
2381
2397
|
break;
|
|
2382
2398
|
}
|
|
2383
2399
|
const fe = window.innerWidth, ke = window.innerHeight;
|
|
2384
|
-
O < 0 && (O = 8), O + L.width > fe && (O = fe - L.width - 8),
|
|
2400
|
+
O < 0 && (O = 8), O + L.width > fe && (O = fe - L.width - 8), T < 0 && (T = 8), T + L.height > ke && (T = ke - L.height - 8), M.style.top = `${T}px`, M.style.left = `${O}px`, M.style.position = "fixed", M.style.visibility = "visible", M.style.display = "block";
|
|
2385
2401
|
}
|
|
2386
|
-
_e(o, (
|
|
2387
|
-
g("visible-change",
|
|
2388
|
-
|
|
2402
|
+
_e(o, (S) => {
|
|
2403
|
+
g("visible-change", S), S ? (requestAnimationFrame(() => {
|
|
2404
|
+
Ee(() => {
|
|
2389
2405
|
Y();
|
|
2390
2406
|
});
|
|
2391
2407
|
}), document.addEventListener("click", y)) : document.removeEventListener("click", y);
|
|
2392
2408
|
});
|
|
2393
|
-
function y(
|
|
2409
|
+
function y(S) {
|
|
2394
2410
|
if (e.trigger === "click" && !e.disabled) {
|
|
2395
|
-
const
|
|
2396
|
-
|
|
2411
|
+
const M = S.target;
|
|
2412
|
+
v.value && !v.value.contains(M) && w();
|
|
2397
2413
|
}
|
|
2398
2414
|
}
|
|
2399
2415
|
function _() {
|
|
@@ -2401,22 +2417,22 @@ const Na = /* @__PURE__ */ ue({
|
|
|
2401
2417
|
}
|
|
2402
2418
|
return Je(() => {
|
|
2403
2419
|
window.addEventListener("resize", _), window.addEventListener("scroll", _, !0);
|
|
2404
|
-
}),
|
|
2405
|
-
r && clearTimeout(r),
|
|
2420
|
+
}), nt(() => {
|
|
2421
|
+
r && clearTimeout(r), d && clearTimeout(d), document.removeEventListener("click", y), window.removeEventListener("resize", _), window.removeEventListener("scroll", _, !0);
|
|
2406
2422
|
}), i({
|
|
2407
|
-
show:
|
|
2423
|
+
show: C,
|
|
2408
2424
|
hide: w,
|
|
2409
|
-
toggle:
|
|
2425
|
+
toggle: x,
|
|
2410
2426
|
visible: o
|
|
2411
|
-
}), (
|
|
2427
|
+
}), (S, M) => (u(), h("div", {
|
|
2412
2428
|
ref_key: "dropdownRef",
|
|
2413
|
-
ref:
|
|
2429
|
+
ref: v,
|
|
2414
2430
|
class: J(["rc-dropdown", { "is-disabled": t.disabled }]),
|
|
2415
2431
|
onMouseenter: H,
|
|
2416
|
-
onMouseleave:
|
|
2432
|
+
onMouseleave: I,
|
|
2417
2433
|
onClick: b
|
|
2418
2434
|
}, [
|
|
2419
|
-
Z(
|
|
2435
|
+
Z(S.$slots, "default", {}, void 0, !0),
|
|
2420
2436
|
X(Oe, {
|
|
2421
2437
|
ref_key: "menuRef",
|
|
2422
2438
|
ref: $,
|
|
@@ -2427,13 +2443,13 @@ const Na = /* @__PURE__ */ ue({
|
|
|
2427
2443
|
onMouseleave: ae
|
|
2428
2444
|
}, {
|
|
2429
2445
|
default: oe(() => [
|
|
2430
|
-
Z(
|
|
2446
|
+
Z(S.$slots, "dropdown", {}, void 0, !0)
|
|
2431
2447
|
]),
|
|
2432
2448
|
_: 3
|
|
2433
2449
|
}, 8, ["visible", "effect", "max-height"])
|
|
2434
2450
|
], 34));
|
|
2435
2451
|
}
|
|
2436
|
-
}), qe = /* @__PURE__ */ ce(za, [["__scopeId", "data-v-
|
|
2452
|
+
}), qe = /* @__PURE__ */ ce(za, [["__scopeId", "data-v-1f778b7e"]]), Ya = { class: "rc-dropdown-item__text" }, La = /* @__PURE__ */ ue({
|
|
2437
2453
|
name: "rc-dropdown-item",
|
|
2438
2454
|
__name: "item",
|
|
2439
2455
|
props: {
|
|
@@ -2452,7 +2468,7 @@ const Na = /* @__PURE__ */ ue({
|
|
|
2452
2468
|
}
|
|
2453
2469
|
l(i.command);
|
|
2454
2470
|
}
|
|
2455
|
-
return (g,
|
|
2471
|
+
return (g, v) => (u(), h("li", {
|
|
2456
2472
|
class: J(["rc-dropdown-item", {
|
|
2457
2473
|
"is-disabled": t.disabled,
|
|
2458
2474
|
"is-divided": t.divided
|
|
@@ -2492,7 +2508,7 @@ const Wa = /* @__PURE__ */ ue({
|
|
|
2492
2508
|
},
|
|
2493
2509
|
emits: ["validate"],
|
|
2494
2510
|
setup(t, { expose: i, emit: l }) {
|
|
2495
|
-
const e = t, g = l,
|
|
2511
|
+
const e = t, g = l, v = W(), $ = W(/* @__PURE__ */ new Map()), o = W({}), r = (y) => {
|
|
2496
2512
|
if (y === null || typeof y != "object")
|
|
2497
2513
|
return y;
|
|
2498
2514
|
if (y instanceof Date)
|
|
@@ -2501,16 +2517,16 @@ const Wa = /* @__PURE__ */ ue({
|
|
|
2501
2517
|
return y.map((_) => r(_));
|
|
2502
2518
|
if (typeof y == "object") {
|
|
2503
2519
|
const _ = {};
|
|
2504
|
-
for (const
|
|
2505
|
-
y.hasOwnProperty(
|
|
2520
|
+
for (const S in y)
|
|
2521
|
+
y.hasOwnProperty(S) && (_[S] = r(y[S]));
|
|
2506
2522
|
return _;
|
|
2507
2523
|
}
|
|
2508
2524
|
return y;
|
|
2509
|
-
},
|
|
2525
|
+
}, d = () => {
|
|
2510
2526
|
e.model && (o.value = r(e.model));
|
|
2511
2527
|
}, N = (y, _) => {
|
|
2512
2528
|
$.value.set(y, _);
|
|
2513
|
-
},
|
|
2529
|
+
}, C = (y) => {
|
|
2514
2530
|
$.value.delete(y);
|
|
2515
2531
|
};
|
|
2516
2532
|
Ce("rcForm", {
|
|
@@ -2523,64 +2539,64 @@ const Wa = /* @__PURE__ */ ue({
|
|
|
2523
2539
|
hideRequiredAsterisk: e.hideRequiredAsterisk,
|
|
2524
2540
|
showMessage: e.showMessage,
|
|
2525
2541
|
registerFormItem: N,
|
|
2526
|
-
unregisterFormItem:
|
|
2542
|
+
unregisterFormItem: C,
|
|
2527
2543
|
validateField: (y, _) => {
|
|
2528
|
-
const
|
|
2529
|
-
return
|
|
2544
|
+
const S = $.value.get(y);
|
|
2545
|
+
return S ? S.validate(_) : Promise.resolve();
|
|
2530
2546
|
}
|
|
2531
2547
|
});
|
|
2532
2548
|
let w = !1;
|
|
2533
|
-
const
|
|
2534
|
-
w || (w = !0,
|
|
2549
|
+
const x = () => {
|
|
2550
|
+
w || (w = !0, f((y) => {
|
|
2535
2551
|
w = !1, y ? console.log("表单验证通过", e.model) : console.log("表单验证失败");
|
|
2536
2552
|
}).catch(() => {
|
|
2537
2553
|
w = !1;
|
|
2538
2554
|
}));
|
|
2539
2555
|
};
|
|
2540
2556
|
Ce("rcFormActions", {
|
|
2541
|
-
submit:
|
|
2557
|
+
submit: x,
|
|
2542
2558
|
reset: () => {
|
|
2543
2559
|
ae();
|
|
2544
2560
|
}
|
|
2545
2561
|
});
|
|
2546
|
-
let
|
|
2562
|
+
let I = !1;
|
|
2547
2563
|
_e(
|
|
2548
2564
|
() => e.model,
|
|
2549
2565
|
() => {
|
|
2550
|
-
!
|
|
2566
|
+
!I && e.model && (d(), I = !0);
|
|
2551
2567
|
},
|
|
2552
2568
|
{ immediate: !0, deep: !0 }
|
|
2553
2569
|
), Je(() => {
|
|
2554
|
-
!
|
|
2570
|
+
!I && e.model && (d(), I = !0);
|
|
2555
2571
|
}), _e(
|
|
2556
2572
|
() => e.rules,
|
|
2557
2573
|
() => {
|
|
2558
|
-
e.validateOnRuleChange &&
|
|
2559
|
-
|
|
2574
|
+
e.validateOnRuleChange && Ee(() => {
|
|
2575
|
+
f().catch(() => {
|
|
2560
2576
|
});
|
|
2561
2577
|
});
|
|
2562
2578
|
},
|
|
2563
2579
|
{ deep: !0 }
|
|
2564
2580
|
);
|
|
2565
|
-
const
|
|
2566
|
-
const
|
|
2581
|
+
const f = (y) => new Promise((_) => {
|
|
2582
|
+
const S = [], M = {};
|
|
2567
2583
|
$.value.forEach((R, L) => {
|
|
2568
|
-
const
|
|
2584
|
+
const T = R.validate().then(() => {
|
|
2569
2585
|
g("validate", L, !0, "");
|
|
2570
2586
|
}).catch((O) => {
|
|
2571
|
-
O && (
|
|
2587
|
+
O && (M[L] = [O], g("validate", L, !1, O));
|
|
2572
2588
|
});
|
|
2573
|
-
|
|
2574
|
-
}), Promise.all(
|
|
2575
|
-
const R = Object.keys(
|
|
2576
|
-
y && y(R, R ? void 0 :
|
|
2589
|
+
S.push(T);
|
|
2590
|
+
}), Promise.all(S).then(() => {
|
|
2591
|
+
const R = Object.keys(M).length === 0;
|
|
2592
|
+
y && y(R, R ? void 0 : M), _(R);
|
|
2577
2593
|
}).catch(() => {
|
|
2578
|
-
const R = Object.keys(
|
|
2579
|
-
y && y(R, R ? void 0 :
|
|
2594
|
+
const R = Object.keys(M).length === 0;
|
|
2595
|
+
y && y(R, R ? void 0 : M), _(R);
|
|
2580
2596
|
});
|
|
2581
2597
|
}), ie = (y, _) => {
|
|
2582
|
-
const
|
|
2583
|
-
return
|
|
2598
|
+
const S = $.value.get(y);
|
|
2599
|
+
return S ? S.validate(_) : Promise.resolve();
|
|
2584
2600
|
}, ae = () => {
|
|
2585
2601
|
$.value.forEach((y) => {
|
|
2586
2602
|
y.resetField();
|
|
@@ -2591,33 +2607,33 @@ const Wa = /* @__PURE__ */ ue({
|
|
|
2591
2607
|
}));
|
|
2592
2608
|
}, b = (y) => {
|
|
2593
2609
|
const _ = y ? Array.isArray(y) ? y : [y] : void 0;
|
|
2594
|
-
$.value.forEach((
|
|
2595
|
-
(!_ || _.includes(
|
|
2610
|
+
$.value.forEach((S, M) => {
|
|
2611
|
+
(!_ || _.includes(M)) && S.clearValidate();
|
|
2596
2612
|
});
|
|
2597
2613
|
}, Y = (y) => {
|
|
2598
|
-
y.preventDefault(),
|
|
2614
|
+
y.preventDefault(), x();
|
|
2599
2615
|
};
|
|
2600
2616
|
return i({
|
|
2601
|
-
validate:
|
|
2617
|
+
validate: f,
|
|
2602
2618
|
validateField: ie,
|
|
2603
2619
|
resetFields: ae,
|
|
2604
2620
|
clearValidate: b,
|
|
2605
|
-
formRef:
|
|
2621
|
+
formRef: v
|
|
2606
2622
|
}), (y, _) => (u(), h("form", {
|
|
2607
2623
|
ref_key: "formRef",
|
|
2608
|
-
ref:
|
|
2624
|
+
ref: v,
|
|
2609
2625
|
class: J(["rc-form", [
|
|
2610
2626
|
`rc-form--${t.labelPosition}`,
|
|
2611
2627
|
{
|
|
2612
2628
|
"rc-form--inline": t.inline
|
|
2613
2629
|
}
|
|
2614
2630
|
]]),
|
|
2615
|
-
onSubmit:
|
|
2631
|
+
onSubmit: Be(Y, ["prevent"])
|
|
2616
2632
|
}, [
|
|
2617
2633
|
Z(y.$slots, "default", {}, void 0, !0)
|
|
2618
2634
|
], 34));
|
|
2619
2635
|
}
|
|
2620
|
-
}),
|
|
2636
|
+
}), et = /* @__PURE__ */ ce(Wa, [["__scopeId", "data-v-194b6d22"]]), Oa = ["for"], Ha = { key: 0 }, Ua = { class: "rc-form-item__content" }, qa = { class: "rc-form-item__control" }, Ga = {
|
|
2621
2637
|
key: 0,
|
|
2622
2638
|
class: "rc-form-item__error"
|
|
2623
2639
|
}, Ka = /* @__PURE__ */ ue({
|
|
@@ -2633,13 +2649,13 @@ const Wa = /* @__PURE__ */ ue({
|
|
|
2633
2649
|
error: { default: "" }
|
|
2634
2650
|
},
|
|
2635
2651
|
setup(t, { expose: i }) {
|
|
2636
|
-
const l = t, e = be("rcForm", void 0), g = W(""),
|
|
2652
|
+
const l = t, e = be("rcForm", void 0), g = W(""), v = W(""), $ = B(() => {
|
|
2637
2653
|
const b = l.labelWidth ?? (e == null ? void 0 : e.labelWidth);
|
|
2638
2654
|
return b ? {
|
|
2639
2655
|
width: typeof b == "number" ? `${b}px` : b
|
|
2640
2656
|
} : {};
|
|
2641
2657
|
}), o = B(() => {
|
|
2642
|
-
}), r = B(() => l.showMessage ?? (e == null ? void 0 : e.showMessage) ?? !0),
|
|
2658
|
+
}), r = B(() => l.showMessage ?? (e == null ? void 0 : e.showMessage) ?? !0), d = B(() => (e == null ? void 0 : e.hideRequiredAsterisk) ?? !1), N = B(() => (e == null ? void 0 : e.labelPosition) ?? "left"), C = B(() => {
|
|
2643
2659
|
if (l.required !== void 0)
|
|
2644
2660
|
return l.required;
|
|
2645
2661
|
if (!l.prop || !e)
|
|
@@ -2653,54 +2669,54 @@ const Wa = /* @__PURE__ */ ue({
|
|
|
2653
2669
|
return [];
|
|
2654
2670
|
const b = e.rules[l.prop];
|
|
2655
2671
|
return b ? Array.isArray(b) ? b : [b] : [];
|
|
2656
|
-
},
|
|
2672
|
+
}, x = () => {
|
|
2657
2673
|
if (!(!l.prop || !e))
|
|
2658
2674
|
return e.model[l.prop];
|
|
2659
2675
|
}, H = (b, Y) => new Promise((y) => {
|
|
2660
2676
|
let _ = Y;
|
|
2661
2677
|
if (b.transform && (_ = b.transform(Y)), b.required && (_ == null || _ === "")) {
|
|
2662
|
-
const
|
|
2663
|
-
y(
|
|
2678
|
+
const S = b.message || `${l.label || l.prop} 是必填项`;
|
|
2679
|
+
y(S);
|
|
2664
2680
|
return;
|
|
2665
2681
|
}
|
|
2666
|
-
if (b.type && _ !== void 0 && _ !== null && _ !== "" && !
|
|
2667
|
-
const
|
|
2668
|
-
y(
|
|
2682
|
+
if (b.type && _ !== void 0 && _ !== null && _ !== "" && !I(_, b.type)) {
|
|
2683
|
+
const M = b.message || `${l.label || l.prop} 格式不正确`;
|
|
2684
|
+
y(M);
|
|
2669
2685
|
return;
|
|
2670
2686
|
}
|
|
2671
2687
|
if (b.min !== void 0 && _ !== void 0 && _ !== null && _ !== "" && (Array.isArray(_) || typeof _ == "string" ? _.length : _) < b.min) {
|
|
2672
|
-
const
|
|
2673
|
-
y(
|
|
2688
|
+
const M = b.message || `${l.label || l.prop} 不能少于 ${b.min} 个字符`;
|
|
2689
|
+
y(M);
|
|
2674
2690
|
return;
|
|
2675
2691
|
}
|
|
2676
2692
|
if (b.max !== void 0 && _ !== void 0 && _ !== null && _ !== "" && (Array.isArray(_) || typeof _ == "string" ? _.length : _) > b.max) {
|
|
2677
|
-
const
|
|
2678
|
-
y(
|
|
2693
|
+
const M = b.message || `${l.label || l.prop} 不能超过 ${b.max} 个字符`;
|
|
2694
|
+
y(M);
|
|
2679
2695
|
return;
|
|
2680
2696
|
}
|
|
2681
2697
|
if (b.pattern) {
|
|
2682
|
-
const
|
|
2683
|
-
if (_ != null && _ !== "" && !
|
|
2684
|
-
const
|
|
2685
|
-
y(
|
|
2698
|
+
const S = typeof b.pattern == "string" ? new RegExp(b.pattern) : b.pattern;
|
|
2699
|
+
if (_ != null && _ !== "" && !S.test(String(_))) {
|
|
2700
|
+
const M = b.message || `${l.label || l.prop} 格式不正确`;
|
|
2701
|
+
y(M);
|
|
2686
2702
|
return;
|
|
2687
2703
|
}
|
|
2688
2704
|
}
|
|
2689
2705
|
if (b.validator) {
|
|
2690
|
-
const
|
|
2691
|
-
y(
|
|
2706
|
+
const S = b.validator(b, _, (M) => {
|
|
2707
|
+
y(M ? M.message || b.message || `${l.label || l.prop} 验证失败` : null);
|
|
2692
2708
|
});
|
|
2693
|
-
if (
|
|
2694
|
-
|
|
2709
|
+
if (S instanceof Promise) {
|
|
2710
|
+
S.then(() => {
|
|
2695
2711
|
y(null);
|
|
2696
|
-
}).catch((
|
|
2697
|
-
y((
|
|
2712
|
+
}).catch((M) => {
|
|
2713
|
+
y((M == null ? void 0 : M.message) || b.message || `${l.label || l.prop} 验证失败`);
|
|
2698
2714
|
});
|
|
2699
2715
|
return;
|
|
2700
2716
|
}
|
|
2701
2717
|
}
|
|
2702
2718
|
y(null);
|
|
2703
|
-
}),
|
|
2719
|
+
}), I = (b, Y) => {
|
|
2704
2720
|
switch (Y) {
|
|
2705
2721
|
case "string":
|
|
2706
2722
|
return typeof b == "string";
|
|
@@ -2729,81 +2745,81 @@ const Wa = /* @__PURE__ */ ue({
|
|
|
2729
2745
|
default:
|
|
2730
2746
|
return !0;
|
|
2731
2747
|
}
|
|
2732
|
-
},
|
|
2748
|
+
}, f = (b, Y) => new Promise((y, _) => {
|
|
2733
2749
|
if (l.error) {
|
|
2734
|
-
g.value = "error",
|
|
2750
|
+
g.value = "error", v.value = l.error, Y && Y(l.error), _(new Error(l.error));
|
|
2735
2751
|
return;
|
|
2736
2752
|
}
|
|
2737
2753
|
if (!l.prop) {
|
|
2738
2754
|
y();
|
|
2739
2755
|
return;
|
|
2740
2756
|
}
|
|
2741
|
-
const
|
|
2742
|
-
if (
|
|
2743
|
-
g.value = "",
|
|
2757
|
+
const S = w();
|
|
2758
|
+
if (S.length === 0) {
|
|
2759
|
+
g.value = "", v.value = "", y();
|
|
2744
2760
|
return;
|
|
2745
2761
|
}
|
|
2746
|
-
let
|
|
2747
|
-
if (!b || b === "submit" ?
|
|
2762
|
+
let M;
|
|
2763
|
+
if (!b || b === "submit" ? M = S : M = S.filter((T) => T.trigger === b), M.length === 0) {
|
|
2748
2764
|
y();
|
|
2749
2765
|
return;
|
|
2750
2766
|
}
|
|
2751
|
-
g.value = "validating",
|
|
2752
|
-
const R =
|
|
2753
|
-
Promise.all(L).then((
|
|
2754
|
-
const O =
|
|
2755
|
-
O ? (g.value = "error",
|
|
2756
|
-
}).catch((
|
|
2757
|
-
const O = (
|
|
2758
|
-
g.value = "error",
|
|
2767
|
+
g.value = "validating", v.value = "";
|
|
2768
|
+
const R = x(), L = M.map((T) => H(T, R));
|
|
2769
|
+
Promise.all(L).then((T) => {
|
|
2770
|
+
const O = T.find((fe) => fe !== null);
|
|
2771
|
+
O ? (g.value = "error", v.value = O, Y && Y(O), _(new Error(O))) : ((!b || M.length === S.length) && (g.value = "success", v.value = ""), Y && Y(), y());
|
|
2772
|
+
}).catch((T) => {
|
|
2773
|
+
const O = (T == null ? void 0 : T.message) || "验证失败";
|
|
2774
|
+
g.value = "error", v.value = O, Y && Y(O), _(T);
|
|
2759
2775
|
});
|
|
2760
2776
|
}), ie = () => {
|
|
2761
|
-
g.value = "",
|
|
2777
|
+
g.value = "", v.value = "";
|
|
2762
2778
|
}, ae = () => {
|
|
2763
|
-
g.value = "",
|
|
2779
|
+
g.value = "", v.value = "";
|
|
2764
2780
|
};
|
|
2765
2781
|
return _e(
|
|
2766
|
-
() =>
|
|
2782
|
+
() => x(),
|
|
2767
2783
|
() => {
|
|
2768
2784
|
const b = w(), Y = b.some((_) => _.trigger === "change"), y = b.some((_) => _.trigger === "blur");
|
|
2769
|
-
Y ?
|
|
2785
|
+
Y ? f("change").catch(() => {
|
|
2770
2786
|
}) : y && g.value;
|
|
2771
2787
|
}
|
|
2772
2788
|
), _e(
|
|
2773
2789
|
() => l.error,
|
|
2774
2790
|
(b) => {
|
|
2775
|
-
b ? (g.value = "error",
|
|
2791
|
+
b ? (g.value = "error", v.value = b) : g.value === "error" && !l.prop && ae();
|
|
2776
2792
|
}
|
|
2777
2793
|
), Ce("rcFormItem", {
|
|
2778
2794
|
onBlur: () => {
|
|
2779
|
-
w().some((y) => y.trigger === "blur") &&
|
|
2795
|
+
w().some((y) => y.trigger === "blur") && f("blur").catch(() => {
|
|
2780
2796
|
});
|
|
2781
2797
|
},
|
|
2782
2798
|
onChange: () => {
|
|
2783
|
-
w().some((y) => y.trigger === "change") &&
|
|
2799
|
+
w().some((y) => y.trigger === "change") && f("change").catch(() => {
|
|
2784
2800
|
});
|
|
2785
2801
|
}
|
|
2786
2802
|
}), Je(() => {
|
|
2787
2803
|
l.prop && e && e.registerFormItem(l.prop, {
|
|
2788
|
-
validate:
|
|
2804
|
+
validate: f,
|
|
2789
2805
|
resetField: ie,
|
|
2790
2806
|
clearValidate: ae
|
|
2791
2807
|
});
|
|
2792
|
-
}),
|
|
2808
|
+
}), nt(() => {
|
|
2793
2809
|
l.prop && e && e.unregisterFormItem(l.prop);
|
|
2794
2810
|
}), i({
|
|
2795
|
-
validate:
|
|
2811
|
+
validate: f,
|
|
2796
2812
|
resetField: ie,
|
|
2797
2813
|
clearValidate: ae,
|
|
2798
2814
|
validateState: g,
|
|
2799
|
-
validateMessage:
|
|
2815
|
+
validateMessage: v
|
|
2800
2816
|
}), (b, Y) => (u(), h("div", {
|
|
2801
2817
|
class: J(["rc-form-item", [
|
|
2802
2818
|
{
|
|
2803
2819
|
"is-error": g.value === "error",
|
|
2804
2820
|
"is-validating": g.value === "validating",
|
|
2805
|
-
"is-required":
|
|
2806
|
-
"is-no-asterisk":
|
|
2821
|
+
"is-required": C.value,
|
|
2822
|
+
"is-no-asterisk": d.value,
|
|
2807
2823
|
"is-label-top": N.value === "top"
|
|
2808
2824
|
}
|
|
2809
2825
|
]])
|
|
@@ -2822,20 +2838,20 @@ const Wa = /* @__PURE__ */ ue({
|
|
|
2822
2838
|
P("div", qa, [
|
|
2823
2839
|
Z(b.$slots, "default", {}, void 0, !0)
|
|
2824
2840
|
]),
|
|
2825
|
-
X(
|
|
2841
|
+
X(Ye, { name: "rc-form-item-error-fade" }, {
|
|
2826
2842
|
default: oe(() => [
|
|
2827
|
-
g.value === "error" && r.value &&
|
|
2843
|
+
g.value === "error" && r.value && v.value ? (u(), h("div", Ga, G(v.value), 1)) : F("", !0)
|
|
2828
2844
|
]),
|
|
2829
2845
|
_: 1
|
|
2830
2846
|
})
|
|
2831
2847
|
])
|
|
2832
2848
|
], 2));
|
|
2833
2849
|
}
|
|
2834
|
-
}),
|
|
2835
|
-
|
|
2836
|
-
|
|
2850
|
+
}), tt = /* @__PURE__ */ ce(Ka, [["__scopeId", "data-v-52add6c3"]]);
|
|
2851
|
+
et && (et.name = "rc-form");
|
|
2852
|
+
tt && (tt.name = "rc-form-item");
|
|
2837
2853
|
function Vt(t) {
|
|
2838
|
-
return
|
|
2854
|
+
return et && t.component(et.name || "rc-form", et), tt && t.component(tt.name || "rc-form-item", tt), t;
|
|
2839
2855
|
}
|
|
2840
2856
|
const ut = Symbol("RECYCLE_UI_CONFIG"), ft = {
|
|
2841
2857
|
prefix: "rc",
|
|
@@ -2857,8 +2873,8 @@ const At = (t, i) => {
|
|
|
2857
2873
|
if (t.provide(l.provideKey ?? ut, l), t.config.globalProperties.$recycleUI = l, typeof window < "u" && l.iconCssUrl) {
|
|
2858
2874
|
const e = `link[rel="stylesheet"][data-rcui-icon="true"][href="${l.iconCssUrl}"]`;
|
|
2859
2875
|
if (!document.head.querySelector(e)) {
|
|
2860
|
-
const
|
|
2861
|
-
|
|
2876
|
+
const v = document.createElement("link");
|
|
2877
|
+
v.rel = "stylesheet", v.href = l.iconCssUrl, v.setAttribute("data-rcui-icon", "true"), document.head.appendChild(v);
|
|
2862
2878
|
}
|
|
2863
2879
|
}
|
|
2864
2880
|
return ja(t, l), t;
|
|
@@ -2880,10 +2896,10 @@ export {
|
|
|
2880
2896
|
qe as RcDropdown,
|
|
2881
2897
|
Ge as RcDropdownItem,
|
|
2882
2898
|
Oe as RcDropdownMenu,
|
|
2883
|
-
|
|
2884
|
-
|
|
2899
|
+
et as RcForm,
|
|
2900
|
+
tt as RcFormItem,
|
|
2885
2901
|
te as RcIcon,
|
|
2886
|
-
|
|
2902
|
+
Ze as RcInput,
|
|
2887
2903
|
Le as RcPopup,
|
|
2888
2904
|
Ct as RcSearchArea,
|
|
2889
2905
|
it as RcToast,
|