@rft-rc/recycle-ui 0.0.3-rc.7 → 0.0.3-rc.9
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/components/button/index.vue.d.ts +3 -0
- package/dist/components/button/index.vue.d.ts.map +1 -1
- package/dist/components/descriptions/item.vue.d.ts.map +1 -1
- package/dist/components/dropdown/index.vue.d.ts.map +1 -1
- package/dist/components/input/index.vue.d.ts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +613 -606
- package/dist/index.mjs.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as ue, inject as be, computed as
|
|
1
|
+
import { defineComponent as ue, inject as be, computed as A, onMounted as Je, createElementBlock as h, openBlock as c, 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 N, 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,39 +13,39 @@ const Lt = {
|
|
|
13
13
|
code: { default: "" }
|
|
14
14
|
},
|
|
15
15
|
setup(t) {
|
|
16
|
-
const
|
|
16
|
+
const u = t, l = be(ut, {}), e = A(() => (l == null ? void 0 : l.iconClass) || "iconfont"), g = A(() => u.name || ""), v = A(() => typeof u.size == "number" ? `${u.size}px` : u.size || "16px"), $ = A(() => ({
|
|
17
17
|
fontSize: v.value,
|
|
18
|
-
color:
|
|
18
|
+
color: u.color || void 0,
|
|
19
19
|
lineHeight: 1,
|
|
20
20
|
fontFamily: (l == null ? void 0 : l.iconClass) || "iconfont"
|
|
21
|
-
})), o =
|
|
22
|
-
const
|
|
23
|
-
if (
|
|
24
|
-
if (typeof
|
|
25
|
-
return String.fromCharCode(
|
|
26
|
-
const
|
|
27
|
-
return Number.isNaN(
|
|
21
|
+
})), o = A(() => {
|
|
22
|
+
const i = u.code;
|
|
23
|
+
if (i == null || i === "" || i === 0) return "";
|
|
24
|
+
if (typeof i == "number")
|
|
25
|
+
return String.fromCharCode(i);
|
|
26
|
+
const r = String(i).replace(/^0x/i, ""), E = parseInt(r, 16);
|
|
27
|
+
return Number.isNaN(E) ? "" : String.fromCharCode(E);
|
|
28
28
|
});
|
|
29
29
|
return Je(() => {
|
|
30
30
|
if (typeof window > "u") return;
|
|
31
|
-
const
|
|
32
|
-
if (!
|
|
33
|
-
const
|
|
34
|
-
if (!document.head.querySelector(
|
|
31
|
+
const i = l && l.iconCssUrl || ft.iconCssUrl;
|
|
32
|
+
if (!i) return;
|
|
33
|
+
const r = `link[rel="stylesheet"][data-rcui-icon="true"][href="${i}"]`;
|
|
34
|
+
if (!document.head.querySelector(r)) {
|
|
35
35
|
const C = document.createElement("link");
|
|
36
|
-
C.rel = "stylesheet", C.href =
|
|
36
|
+
C.rel = "stylesheet", C.href = i, C.setAttribute("data-rcui-icon", "true"), document.head.appendChild(C);
|
|
37
37
|
}
|
|
38
|
-
}), (
|
|
38
|
+
}), (i, r) => (c(), 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"
|
|
42
42
|
}, [
|
|
43
|
-
o.value ? (
|
|
43
|
+
o.value ? (c(), h("span", Lt, G(o.value), 1)) : F("", !0)
|
|
44
44
|
], 6));
|
|
45
45
|
}
|
|
46
|
-
}), ce = (t,
|
|
46
|
+
}), ce = (t, u) => {
|
|
47
47
|
const l = t.__vccOpts || t;
|
|
48
|
-
for (const [e, g] of
|
|
48
|
+
for (const [e, g] of u)
|
|
49
49
|
l[e] = g;
|
|
50
50
|
return l;
|
|
51
51
|
}, te = /* @__PURE__ */ ce(Wt, [["__scopeId", "data-v-3857a892"]]), Ot = ["disabled", "type"], Ht = {
|
|
@@ -70,11 +70,12 @@ const Lt = {
|
|
|
70
70
|
loading: { type: Boolean, default: !1 },
|
|
71
71
|
preIcon: { default: "" },
|
|
72
72
|
suffixIcon: { default: "" },
|
|
73
|
-
formType: { default: void 0 }
|
|
73
|
+
formType: { default: void 0 },
|
|
74
|
+
width: { default: void 0 }
|
|
74
75
|
},
|
|
75
76
|
emits: ["click"],
|
|
76
|
-
setup(t, { emit:
|
|
77
|
-
const l = t, e =
|
|
77
|
+
setup(t, { emit: u }) {
|
|
78
|
+
const l = t, e = u, g = be("rcFormActions", void 0), v = A(() => l.formType === "submit" ? "submit" : l.formType === "reset" ? "reset" : "button"), $ = (r) => {
|
|
78
79
|
if (!(l.disabled || l.loading)) {
|
|
79
80
|
if (l.formType && g)
|
|
80
81
|
if (l.formType === "submit") {
|
|
@@ -83,21 +84,27 @@ const Lt = {
|
|
|
83
84
|
} else l.formType === "button" ? (r.preventDefault(), g.submit()) : l.formType === "reset" && (r.preventDefault(), g.reset());
|
|
84
85
|
e("click", r);
|
|
85
86
|
}
|
|
86
|
-
}, o =
|
|
87
|
+
}, o = A(() => {
|
|
87
88
|
const r = l.round;
|
|
88
89
|
return typeof r == "boolean" ? r ? "999px" : "6px" : typeof r == "number" ? `${r}px` : String(r);
|
|
90
|
+
}), i = A(() => {
|
|
91
|
+
if (l.width === void 0)
|
|
92
|
+
return;
|
|
93
|
+
if (typeof l.width == "number") return `${l.width}px`;
|
|
94
|
+
const r = String(l.width);
|
|
95
|
+
return /^\d+$/.test(r) ? `${r}px` : r;
|
|
89
96
|
});
|
|
90
|
-
return (r,
|
|
97
|
+
return (r, E) => (c(), h("button", {
|
|
91
98
|
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
|
-
style: re({ borderRadius: o.value }),
|
|
99
|
+
style: re({ borderRadius: o.value, width: i.value }),
|
|
93
100
|
disabled: t.disabled || t.loading,
|
|
94
101
|
type: v.value,
|
|
95
102
|
onClick: $
|
|
96
103
|
}, [
|
|
97
|
-
t.loading ? (
|
|
98
|
-
t.preIcon || r.$slots.preIcon ? (
|
|
104
|
+
t.loading ? (c(), h("span", Ht)) : (c(), h(de, { key: 1 }, [
|
|
105
|
+
t.preIcon || r.$slots.preIcon ? (c(), h("span", Ut, [
|
|
99
106
|
Z(r.$slots, "preIcon", {}, () => [
|
|
100
|
-
t.preIcon ? (
|
|
107
|
+
t.preIcon ? (c(), se(te, {
|
|
101
108
|
key: 0,
|
|
102
109
|
name: t.preIcon
|
|
103
110
|
}, null, 8, ["name"])) : F("", !0)
|
|
@@ -107,9 +114,9 @@ const Lt = {
|
|
|
107
114
|
Z(r.$slots, "default", {}, () => [
|
|
108
115
|
Se(G(t.label), 1)
|
|
109
116
|
], !0),
|
|
110
|
-
!t.loading && (t.suffixIcon || r.$slots.suffixIcon) ? (
|
|
117
|
+
!t.loading && (t.suffixIcon || r.$slots.suffixIcon) ? (c(), h("span", qt, [
|
|
111
118
|
Z(r.$slots, "suffixIcon", {}, () => [
|
|
112
|
-
t.suffixIcon ? (
|
|
119
|
+
t.suffixIcon ? (c(), se(te, {
|
|
113
120
|
key: 0,
|
|
114
121
|
name: t.suffixIcon
|
|
115
122
|
}, null, 8, ["name"])) : F("", !0)
|
|
@@ -117,7 +124,7 @@ const Lt = {
|
|
|
117
124
|
])) : F("", !0)
|
|
118
125
|
], 14, Ot));
|
|
119
126
|
}
|
|
120
|
-
}), $e = /* @__PURE__ */ ce(Gt, [["__scopeId", "data-v-
|
|
127
|
+
}), $e = /* @__PURE__ */ ce(Gt, [["__scopeId", "data-v-4545bc18"]]);
|
|
121
128
|
$e && ($e.name = "rc-button");
|
|
122
129
|
function ht(t) {
|
|
123
130
|
return $e && t.component($e.name || "rc-button", $e), t;
|
|
@@ -132,40 +139,40 @@ const Kt = { class: "rc-desc-item__value" }, jt = /* @__PURE__ */ ue({
|
|
|
132
139
|
span: { default: 1 }
|
|
133
140
|
},
|
|
134
141
|
setup(t) {
|
|
135
|
-
const
|
|
142
|
+
const u = t;
|
|
136
143
|
be("rcDescItemWidth", void 0), be("rcDescSingleWidth", ""), be("rcDescGap", "0px");
|
|
137
|
-
const l = be("rcDescGapPx", 0), e = be("rcDescColCount", 1), g = be("rcDescLabelWidth", ""), v = be("rcDescLabelPosition", "left"), $ =
|
|
138
|
-
const
|
|
144
|
+
const l = be("rcDescGapPx", 0), e = be("rcDescColCount", 1), g = be("rcDescLabelWidth", ""), v = be("rcDescLabelPosition", "left"), $ = A(() => (typeof (v == null ? void 0 : v.value) == "string" ? v.value : v) || "left"), o = A(() => {
|
|
145
|
+
const E = typeof u.span == "string" ? parseInt(u.span, 10) : u.span, C = typeof (e == null ? void 0 : e.value) == "number" ? e.value : e, w = !Number.isNaN(E) && E > 0 ? E : 1;
|
|
139
146
|
return Math.min(w, C || 1);
|
|
140
|
-
}),
|
|
141
|
-
const
|
|
142
|
-
if (!
|
|
143
|
-
const
|
|
144
|
-
return `calc((100% - ${
|
|
145
|
-
}),
|
|
146
|
-
const
|
|
147
|
+
}), i = A(() => {
|
|
148
|
+
const E = 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;
|
|
149
|
+
if (!E || E <= 1 || w >= E) return "100%";
|
|
150
|
+
const D = (E - 1) * C, H = (w - 1) * C;
|
|
151
|
+
return `calc((100% - ${D}px) * ${w} / ${E} + ${H}px)`;
|
|
152
|
+
}), r = A(() => {
|
|
153
|
+
const E = typeof (g == null ? void 0 : g.value) == "string" ? g.value : g, C = u.labelWidth !== "" ? u.labelWidth : E || "";
|
|
147
154
|
return C ? { width: typeof C == "number" ? `${C}px` : String(C), flex: "0 0 auto" } : {};
|
|
148
155
|
});
|
|
149
|
-
return (
|
|
156
|
+
return (E, C) => (c(), h("div", {
|
|
150
157
|
class: J(["rc-desc-item", { "rc-desc-item--label-top": $.value === "top" }]),
|
|
151
|
-
style: re({ width:
|
|
158
|
+
style: re({ width: i.value, flex: `0 0 ${i.value}` })
|
|
152
159
|
}, [
|
|
153
|
-
|
|
160
|
+
N("div", {
|
|
154
161
|
class: "rc-desc-item__label",
|
|
155
|
-
style: re(
|
|
162
|
+
style: re(r.value)
|
|
156
163
|
}, [
|
|
157
|
-
Z(
|
|
164
|
+
Z(E.$slots, "label", {}, () => [
|
|
158
165
|
Se(G(t.label), 1)
|
|
159
166
|
], !0)
|
|
160
167
|
], 4),
|
|
161
|
-
|
|
162
|
-
Z(
|
|
168
|
+
N("div", Kt, [
|
|
169
|
+
Z(E.$slots, "default", {}, () => [
|
|
163
170
|
Se(G(t.value), 1)
|
|
164
171
|
], !0)
|
|
165
172
|
])
|
|
166
173
|
], 6));
|
|
167
174
|
}
|
|
168
|
-
}), Ke = /* @__PURE__ */ ce(jt, [["__scopeId", "data-v-
|
|
175
|
+
}), Ke = /* @__PURE__ */ ce(jt, [["__scopeId", "data-v-6f06edf0"]]), Jt = { class: "rc-descriptions" }, Qt = {
|
|
169
176
|
key: 0,
|
|
170
177
|
class: "rc-descriptions__title"
|
|
171
178
|
}, Xt = /* @__PURE__ */ ue({
|
|
@@ -181,47 +188,47 @@ const Kt = { class: "rc-desc-item__value" }, jt = /* @__PURE__ */ ue({
|
|
|
181
188
|
keyMap: {}
|
|
182
189
|
},
|
|
183
190
|
setup(t) {
|
|
184
|
-
const
|
|
185
|
-
const
|
|
186
|
-
return !Number.isNaN(
|
|
191
|
+
const u = t, l = W(null), e = A(() => typeof u.gap == "number" ? `${u.gap}px` : String(u.gap)), g = A(() => {
|
|
192
|
+
const r = typeof u.column == "string" ? Number.parseInt(u.column, 10) : u.column ?? 1;
|
|
193
|
+
return !Number.isNaN(r) && r > 0 ? r : 1;
|
|
187
194
|
}), v = W("100%"), $ = W("100%");
|
|
188
195
|
Et(() => {
|
|
189
|
-
const
|
|
190
|
-
if (
|
|
196
|
+
const r = g.value;
|
|
197
|
+
if (r <= 1)
|
|
191
198
|
v.value = "100%", $.value = "100%";
|
|
192
199
|
else {
|
|
193
|
-
const
|
|
200
|
+
const E = typeof u.gap == "number" ? u.gap : parseFloat(String(u.gap)) || 0, w = `calc((100% - ${(r - 1) * E}px) / ${r})`;
|
|
194
201
|
$.value = w, v.value = w;
|
|
195
202
|
}
|
|
196
|
-
}), Ce("rcDescItemWidth", v), Ce("rcDescSingleWidth", $), Ce("rcDescColCount", g), Ce("rcDescGapPx",
|
|
197
|
-
const o =
|
|
198
|
-
Ce("rcDescLabelWidth", o), Ce("rcDescGap",
|
|
199
|
-
const
|
|
200
|
-
var C, w,
|
|
201
|
-
const
|
|
202
|
-
return (
|
|
203
|
-
label: H == null ? void 0 : H[
|
|
204
|
-
value: H == null ? void 0 : H[
|
|
203
|
+
}), Ce("rcDescItemWidth", v), Ce("rcDescSingleWidth", $), Ce("rcDescColCount", g), Ce("rcDescGapPx", A(() => typeof u.gap == "number" ? u.gap : parseFloat(String(u.gap)) || 0));
|
|
204
|
+
const o = A(() => u.labelWidth === "" || u.labelWidth === void 0 ? "" : typeof u.labelWidth == "number" ? `${u.labelWidth}px` : String(u.labelWidth));
|
|
205
|
+
Ce("rcDescLabelWidth", o), Ce("rcDescGap", A(() => typeof u.gap == "number" ? `${u.gap}px` : String(u.gap))), Ce("rcDescLabelPosition", A(() => u.labelPosition || "left"));
|
|
206
|
+
const i = A(() => {
|
|
207
|
+
var C, w, D;
|
|
208
|
+
const r = ((C = u.keyMap) == null ? void 0 : C.key) ?? "label", E = ((w = u.keyMap) == null ? void 0 : w.value) ?? "value";
|
|
209
|
+
return (D = u.data) != null && D.length ? u.data.map((H) => ({
|
|
210
|
+
label: H == null ? void 0 : H[r],
|
|
211
|
+
value: H == null ? void 0 : H[E]
|
|
205
212
|
})) : [];
|
|
206
213
|
});
|
|
207
|
-
return (
|
|
208
|
-
|
|
209
|
-
Z(
|
|
214
|
+
return (r, E) => (c(), h("div", Jt, [
|
|
215
|
+
r.$slots.title || t.title ? (c(), h("div", Qt, [
|
|
216
|
+
Z(r.$slots, "title", {}, () => [
|
|
210
217
|
Se(G(t.title), 1)
|
|
211
218
|
], !0)
|
|
212
219
|
])) : F("", !0),
|
|
213
|
-
|
|
220
|
+
N("div", {
|
|
214
221
|
class: "rc-descriptions__body",
|
|
215
222
|
style: re({ gap: e.value }),
|
|
216
223
|
ref_key: "wrapEl",
|
|
217
224
|
ref: l
|
|
218
225
|
}, [
|
|
219
|
-
|
|
226
|
+
i.value.length ? (c(!0), h(de, { key: 0 }, ye(i.value, (C, w) => (c(), se(Ke, {
|
|
220
227
|
key: w,
|
|
221
228
|
label: C.label,
|
|
222
229
|
value: C.value,
|
|
223
230
|
"label-width": t.labelWidth
|
|
224
|
-
}, null, 8, ["label", "value", "label-width"]))), 128)) : Z(
|
|
231
|
+
}, null, 8, ["label", "value", "label-width"]))), 128)) : Z(r.$slots, "default", { key: 1 }, void 0, !0)
|
|
225
232
|
], 4)
|
|
226
233
|
]));
|
|
227
234
|
}
|
|
@@ -258,52 +265,52 @@ const Qa = Xe, Xa = Ke, Zt = { class: "rc-card__title" }, en = { class: "rc-card
|
|
|
258
265
|
height: { default: "" }
|
|
259
266
|
},
|
|
260
267
|
setup(t) {
|
|
261
|
-
const
|
|
262
|
-
const o = typeof
|
|
268
|
+
const u = t, l = A(() => {
|
|
269
|
+
const o = typeof u.round == "boolean" ? u.round ? "12px" : "0" : typeof u.round == "number" ? `${u.round}px` : String(u.round);
|
|
263
270
|
return {
|
|
264
|
-
backgroundColor:
|
|
271
|
+
backgroundColor: u.color || "var(--rc-white)",
|
|
265
272
|
borderRadius: o,
|
|
266
|
-
boxShadow: $(
|
|
267
|
-
width: v(
|
|
268
|
-
height: v(
|
|
273
|
+
boxShadow: $(u.elevation),
|
|
274
|
+
width: v(u.width),
|
|
275
|
+
height: v(u.height)
|
|
269
276
|
};
|
|
270
|
-
}), e =
|
|
271
|
-
() => typeof
|
|
277
|
+
}), e = A(() => u.padding || "16px"), g = A(
|
|
278
|
+
() => typeof u.gap == "number" ? `${u.gap}px` : String(u.gap)
|
|
272
279
|
);
|
|
273
280
|
function v(o) {
|
|
274
281
|
return o == null || o === "" ? "" : typeof o == "number" ? `${o}px` : String(o);
|
|
275
282
|
}
|
|
276
283
|
function $(o) {
|
|
277
284
|
if (!o || o <= 0) return "none";
|
|
278
|
-
const
|
|
279
|
-
return `0 ${Math.round(
|
|
280
|
-
|
|
281
|
-
)}px ${Math.round(
|
|
285
|
+
const i = 4 * o;
|
|
286
|
+
return `0 ${Math.round(i / 2)}px ${i}px rgba(0,0,0,0.06), 0 ${Math.round(
|
|
287
|
+
i / 4
|
|
288
|
+
)}px ${Math.round(i / 2)}px rgba(0,0,0,0.04)`;
|
|
282
289
|
}
|
|
283
|
-
return (o,
|
|
290
|
+
return (o, i) => (c(), h("div", {
|
|
284
291
|
class: J(["rc-card", [{ "rc-card--bordered": t.bordered }]]),
|
|
285
292
|
style: re(l.value)
|
|
286
293
|
}, [
|
|
287
|
-
o.$slots.title || t.title || o.$slots.status || t.status ? (
|
|
294
|
+
o.$slots.title || t.title || o.$slots.status || t.status ? (c(), h("div", {
|
|
288
295
|
key: 0,
|
|
289
296
|
class: "rc-card__top",
|
|
290
297
|
style: re({ backgroundColor: t.topBgColor || "rgba(29, 133, 252, 0.05)" })
|
|
291
298
|
}, [
|
|
292
|
-
|
|
299
|
+
N("div", Zt, [
|
|
293
300
|
Z(o.$slots, "title", {}, () => [
|
|
294
|
-
|
|
301
|
+
N("span", en, G(t.title), 1)
|
|
295
302
|
], !0)
|
|
296
303
|
]),
|
|
297
|
-
o.$slots.status || t.status ? (
|
|
304
|
+
o.$slots.status || t.status ? (c(), h("div", tn, [
|
|
298
305
|
Z(o.$slots, "status", {}, () => [
|
|
299
|
-
|
|
306
|
+
N("span", {
|
|
300
307
|
class: "rc-card__status-text",
|
|
301
308
|
style: re({ color: t.statusColor || "var(--rc-primary)" })
|
|
302
309
|
}, G(t.status), 5)
|
|
303
310
|
], !0)
|
|
304
311
|
])) : F("", !0)
|
|
305
312
|
], 4)) : F("", !0),
|
|
306
|
-
|
|
313
|
+
N("div", {
|
|
307
314
|
class: "rc-card__body",
|
|
308
315
|
style: re({ padding: e.value, gap: g.value })
|
|
309
316
|
}, [
|
|
@@ -311,8 +318,8 @@ const Qa = Xe, Xa = Ke, Zt = { class: "rc-card__title" }, en = { class: "rc-card
|
|
|
311
318
|
Z(o.$slots, "default", {}, void 0, !0)
|
|
312
319
|
], !0)
|
|
313
320
|
], 4),
|
|
314
|
-
o.$slots.action ? (
|
|
315
|
-
o.$slots.action ? (
|
|
321
|
+
o.$slots.action ? (c(), h("div", nn)) : F("", !0),
|
|
322
|
+
o.$slots.action ? (c(), h("div", an, [
|
|
316
323
|
Z(o.$slots, "action", {}, void 0, !0)
|
|
317
324
|
])) : F("", !0)
|
|
318
325
|
], 6));
|
|
@@ -344,7 +351,7 @@ const rn = {
|
|
|
344
351
|
mask: { type: Boolean, default: !1 },
|
|
345
352
|
onAfterLeave: {}
|
|
346
353
|
},
|
|
347
|
-
setup(t, { expose:
|
|
354
|
+
setup(t, { expose: u }) {
|
|
348
355
|
const l = t, e = W(!0);
|
|
349
356
|
let g;
|
|
350
357
|
function v() {
|
|
@@ -353,27 +360,27 @@ const rn = {
|
|
|
353
360
|
function $() {
|
|
354
361
|
v(), e.value = !1;
|
|
355
362
|
}
|
|
356
|
-
return
|
|
363
|
+
return u({ close: $ }), Je(() => {
|
|
357
364
|
l.duration && l.duration > 0 && (g = setTimeout(() => {
|
|
358
365
|
$();
|
|
359
366
|
}, l.duration));
|
|
360
367
|
}), nt(() => {
|
|
361
368
|
v();
|
|
362
|
-
}), (o,
|
|
363
|
-
(
|
|
369
|
+
}), (o, i) => (c(), h(de, null, [
|
|
370
|
+
(c(), se(dt, { to: "body" }, [
|
|
364
371
|
X(Ye, {
|
|
365
372
|
name: "rc-toast-fade",
|
|
366
373
|
onAfterLeave: t.onAfterLeave
|
|
367
374
|
}, {
|
|
368
375
|
default: oe(() => [
|
|
369
|
-
e.value ? (
|
|
376
|
+
e.value ? (c(), h("div", {
|
|
370
377
|
key: 0,
|
|
371
378
|
class: J(["rc-toast", [`rc-toast--${t.type}`]])
|
|
372
379
|
}, [
|
|
373
|
-
t.mask ? (
|
|
374
|
-
|
|
375
|
-
t.type === "loading" ? (
|
|
376
|
-
|
|
380
|
+
t.mask ? (c(), h("div", rn)) : F("", !0),
|
|
381
|
+
N("div", sn, [
|
|
382
|
+
t.type === "loading" ? (c(), h("div", un)) : t.type === "success" ? (c(), h("div", cn)) : t.type === "fail" ? (c(), h("div", dn)) : F("", !0),
|
|
383
|
+
N("div", fn, G(t.message), 1)
|
|
377
384
|
])
|
|
378
385
|
], 2)) : F("", !0)
|
|
379
386
|
]),
|
|
@@ -389,16 +396,16 @@ function bt() {
|
|
|
389
396
|
He && (He.unmount(), He = null), je && (document.body.removeChild(je), je = null);
|
|
390
397
|
}
|
|
391
398
|
function Za(t) {
|
|
392
|
-
const
|
|
399
|
+
const u = typeof t == "string" ? { message: t } : t || {};
|
|
393
400
|
bt(), je = document.createElement("div"), document.body.appendChild(je);
|
|
394
401
|
const l = {
|
|
395
|
-
message:
|
|
396
|
-
type:
|
|
397
|
-
duration:
|
|
398
|
-
mask:
|
|
402
|
+
message: u.message,
|
|
403
|
+
type: u.type ?? "text",
|
|
404
|
+
duration: u.duration ?? 2e3,
|
|
405
|
+
mask: u.mask ?? !1,
|
|
399
406
|
onAfterLeave: () => {
|
|
400
407
|
var e;
|
|
401
|
-
bt(), (e =
|
|
408
|
+
bt(), (e = u.onClose) == null || e.call(u);
|
|
402
409
|
}
|
|
403
410
|
};
|
|
404
411
|
return He = Pt(it, l), He.mount(je), {
|
|
@@ -406,8 +413,8 @@ function Za(t) {
|
|
|
406
413
|
};
|
|
407
414
|
}
|
|
408
415
|
function mn() {
|
|
409
|
-
var t,
|
|
410
|
-
He && ((l = (
|
|
416
|
+
var t, u, l;
|
|
417
|
+
He && ((l = (u = (t = He._instance) == null ? void 0 : t.exposed) == null ? void 0 : u.close) == null || l.call(u));
|
|
411
418
|
}
|
|
412
419
|
it.name = "rc-toast";
|
|
413
420
|
function _t(t) {
|
|
@@ -419,28 +426,28 @@ const pn = {
|
|
|
419
426
|
"aria-live": "polite"
|
|
420
427
|
}, hn = { class: "rc-message__content" }, yn = /* @__PURE__ */ ue({
|
|
421
428
|
__name: "index",
|
|
422
|
-
setup(t, { expose:
|
|
429
|
+
setup(t, { expose: u }) {
|
|
423
430
|
const l = Nt([]);
|
|
424
431
|
let e = 1;
|
|
425
432
|
function g($) {
|
|
426
|
-
const o = l.findIndex((
|
|
433
|
+
const o = l.findIndex((i) => i.id === $);
|
|
427
434
|
o >= 0 && l.splice(o, 1);
|
|
428
435
|
}
|
|
429
|
-
function v($, o,
|
|
430
|
-
const
|
|
431
|
-
return l.push({ id:
|
|
436
|
+
function v($, o, i) {
|
|
437
|
+
const r = e++;
|
|
438
|
+
return l.push({ id: r, type: $, content: o, duration: i }), i > 0 && window.setTimeout(() => g(r), i), r;
|
|
432
439
|
}
|
|
433
|
-
return
|
|
440
|
+
return u({ add: v, remove: g }), ($, o) => (c(), h("div", pn, [
|
|
434
441
|
X(zt, {
|
|
435
442
|
name: "rc-message-fade",
|
|
436
443
|
tag: "div"
|
|
437
444
|
}, {
|
|
438
445
|
default: oe(() => [
|
|
439
|
-
(
|
|
440
|
-
key:
|
|
441
|
-
class: J(["rc-message__item", `rc-message--${
|
|
446
|
+
(c(!0), h(de, null, ye(l, (i) => (c(), h("div", {
|
|
447
|
+
key: i.id,
|
|
448
|
+
class: J(["rc-message__item", `rc-message--${i.type}`])
|
|
442
449
|
}, [
|
|
443
|
-
|
|
450
|
+
N("span", hn, G(i.content), 1)
|
|
444
451
|
], 2))), 128))
|
|
445
452
|
]),
|
|
446
453
|
_: 1
|
|
@@ -450,36 +457,36 @@ const pn = {
|
|
|
450
457
|
}), gn = /* @__PURE__ */ ce(yn, [["__scopeId", "data-v-87811df0"]]);
|
|
451
458
|
let ze = null, Ne = null;
|
|
452
459
|
function bn() {
|
|
453
|
-
var
|
|
460
|
+
var u;
|
|
454
461
|
if (ze && Ne) return;
|
|
455
462
|
ze = document.createElement("div"), document.body.appendChild(ze);
|
|
456
463
|
const t = X(gn, {});
|
|
457
|
-
It(t, ze), Ne = (
|
|
464
|
+
It(t, ze), Ne = (u = t.component) == null ? void 0 : u.exposed;
|
|
458
465
|
}
|
|
459
|
-
function Ue(t,
|
|
466
|
+
function Ue(t, u, l) {
|
|
460
467
|
var g;
|
|
461
468
|
bn();
|
|
462
469
|
const e = typeof l == "number" ? l : t === "loading" ? 0 : 2e3;
|
|
463
|
-
return (g = Ne == null ? void 0 : Ne.add) == null ? void 0 : g.call(Ne, t,
|
|
470
|
+
return (g = Ne == null ? void 0 : Ne.add) == null ? void 0 : g.call(Ne, t, u, e);
|
|
464
471
|
}
|
|
465
472
|
const _n = {
|
|
466
473
|
open(t) {
|
|
467
474
|
return Ue(t.type || "info", t.content, t.duration);
|
|
468
475
|
},
|
|
469
|
-
info(t,
|
|
470
|
-
return Ue("info", t,
|
|
476
|
+
info(t, u) {
|
|
477
|
+
return Ue("info", t, u);
|
|
471
478
|
},
|
|
472
|
-
success(t,
|
|
473
|
-
return Ue("success", t,
|
|
479
|
+
success(t, u) {
|
|
480
|
+
return Ue("success", t, u);
|
|
474
481
|
},
|
|
475
|
-
warning(t,
|
|
476
|
-
return Ue("warning", t,
|
|
482
|
+
warning(t, u) {
|
|
483
|
+
return Ue("warning", t, u);
|
|
477
484
|
},
|
|
478
|
-
error(t,
|
|
479
|
-
return Ue("error", t,
|
|
485
|
+
error(t, u) {
|
|
486
|
+
return Ue("error", t, u);
|
|
480
487
|
},
|
|
481
|
-
loading(t,
|
|
482
|
-
return Ue("loading", t,
|
|
488
|
+
loading(t, u) {
|
|
489
|
+
return Ue("loading", t, u);
|
|
483
490
|
},
|
|
484
491
|
destroy() {
|
|
485
492
|
ze && (It(null, ze), ze.remove(), ze = null, Ne = null);
|
|
@@ -510,29 +517,29 @@ const kn = { class: "rc-popup__content" }, wn = /* @__PURE__ */ ue({
|
|
|
510
517
|
lockScroll: { type: Boolean, default: !0 }
|
|
511
518
|
},
|
|
512
519
|
emits: ["update:modelValue", "open", "close", "click-overlay"],
|
|
513
|
-
setup(t, { expose:
|
|
520
|
+
setup(t, { expose: u, emit: l }) {
|
|
514
521
|
const e = t, g = l, v = W(), $ = W(e.modelValue);
|
|
515
522
|
let o = !1;
|
|
516
|
-
function
|
|
523
|
+
function i() {
|
|
517
524
|
o || (o = !0, document.body.style.overflow = "hidden");
|
|
518
525
|
}
|
|
519
|
-
function
|
|
526
|
+
function r() {
|
|
520
527
|
o && (o = !1, document.body.style.overflow = "");
|
|
521
528
|
}
|
|
522
529
|
_e(
|
|
523
530
|
() => e.modelValue,
|
|
524
531
|
(f) => {
|
|
525
|
-
$.value = f, f ? (g("open"), e.lockScroll &&
|
|
532
|
+
$.value = f, f ? (g("open"), e.lockScroll && i()) : (g("close"), e.lockScroll && r());
|
|
526
533
|
},
|
|
527
534
|
{ immediate: !0 }
|
|
528
535
|
), _e($, (f) => {
|
|
529
536
|
f !== e.modelValue && g("update:modelValue", f);
|
|
530
537
|
});
|
|
531
|
-
const
|
|
538
|
+
const E = A(() => `rc-popup-slide-${e.position}`), C = A(() => ({ ...e.popupStyle || {} }));
|
|
532
539
|
function w() {
|
|
533
540
|
g("click-overlay"), e.closeOnClickOverlay && H();
|
|
534
541
|
}
|
|
535
|
-
function
|
|
542
|
+
function D() {
|
|
536
543
|
H();
|
|
537
544
|
}
|
|
538
545
|
function H() {
|
|
@@ -542,15 +549,15 @@ const kn = { class: "rc-popup__content" }, wn = /* @__PURE__ */ ue({
|
|
|
542
549
|
$.value = !0;
|
|
543
550
|
}
|
|
544
551
|
return nt(() => {
|
|
545
|
-
|
|
546
|
-
}),
|
|
552
|
+
r();
|
|
553
|
+
}), u({
|
|
547
554
|
open: I,
|
|
548
555
|
close: H,
|
|
549
556
|
visible: $
|
|
550
|
-
}), (f, ie) => (
|
|
557
|
+
}), (f, ie) => (c(), se(dt, { to: "body" }, [
|
|
551
558
|
X(Ye, { name: "rc-popup-fade" }, {
|
|
552
559
|
default: oe(() => [
|
|
553
|
-
$.value && e.overlay ? (
|
|
560
|
+
$.value && e.overlay ? (c(), h("div", {
|
|
554
561
|
key: 0,
|
|
555
562
|
class: J(["rc-popup__overlay", { "rc-popup__overlay--transparent": e.overlayClass === "transparent" }]),
|
|
556
563
|
style: re(e.overlayStyle),
|
|
@@ -559,9 +566,9 @@ const kn = { class: "rc-popup__content" }, wn = /* @__PURE__ */ ue({
|
|
|
559
566
|
]),
|
|
560
567
|
_: 1
|
|
561
568
|
}),
|
|
562
|
-
X(Ye, { name:
|
|
569
|
+
X(Ye, { name: E.value }, {
|
|
563
570
|
default: oe(() => [
|
|
564
|
-
$.value ? (
|
|
571
|
+
$.value ? (c(), h("div", {
|
|
565
572
|
key: 0,
|
|
566
573
|
ref_key: "popupRef",
|
|
567
574
|
ref: v,
|
|
@@ -573,17 +580,17 @@ const kn = { class: "rc-popup__content" }, wn = /* @__PURE__ */ ue({
|
|
|
573
580
|
onClick: ie[0] || (ie[0] = Be(() => {
|
|
574
581
|
}, ["stop"]))
|
|
575
582
|
}, [
|
|
576
|
-
t.closeable ? (
|
|
583
|
+
t.closeable ? (c(), h("div", {
|
|
577
584
|
key: 0,
|
|
578
585
|
class: J(["rc-popup__close", `rc-popup__close--${t.closeIconPosition}`]),
|
|
579
|
-
onClick:
|
|
586
|
+
onClick: D
|
|
580
587
|
}, [
|
|
581
588
|
X(te, {
|
|
582
589
|
name: t.closeIcon,
|
|
583
590
|
class: "rc-popup__close-icon"
|
|
584
591
|
}, null, 8, ["name"])
|
|
585
592
|
], 2)) : F("", !0),
|
|
586
|
-
|
|
593
|
+
N("div", kn, [
|
|
587
594
|
Z(f.$slots, "default", {}, void 0, !0)
|
|
588
595
|
])
|
|
589
596
|
], 6)) : F("", !0)
|
|
@@ -636,7 +643,7 @@ const Dn = {
|
|
|
636
643
|
maxRangeDays: {}
|
|
637
644
|
},
|
|
638
645
|
emits: ["select-day", "clear", "confirm", "shortcut-select"],
|
|
639
|
-
setup(t, { expose:
|
|
646
|
+
setup(t, { expose: u, emit: l }) {
|
|
640
647
|
const e = t, g = l, v = ["日", "一", "二", "三", "四", "五", "六"];
|
|
641
648
|
function $(a) {
|
|
642
649
|
if (!a) return null;
|
|
@@ -647,25 +654,25 @@ const Dn = {
|
|
|
647
654
|
const m = a.getFullYear(), k = String(a.getMonth() + 1).padStart(2, "0"), U = String(a.getDate()).padStart(2, "0");
|
|
648
655
|
return `${m}-${k}-${U}`;
|
|
649
656
|
}
|
|
650
|
-
const
|
|
657
|
+
const i = W(/* @__PURE__ */ new Date());
|
|
651
658
|
_e(
|
|
652
659
|
() => [e.selectedDate, e.rangeStart],
|
|
653
660
|
() => {
|
|
654
661
|
if (e.range && e.rangeStart) {
|
|
655
662
|
const a = $(e.rangeStart);
|
|
656
|
-
a && (
|
|
663
|
+
a && (i.value = a);
|
|
657
664
|
} else if (!e.range && e.selectedDate) {
|
|
658
665
|
const a = $(e.selectedDate);
|
|
659
|
-
a && (
|
|
666
|
+
a && (i.value = a);
|
|
660
667
|
}
|
|
661
668
|
},
|
|
662
669
|
{ immediate: !0 }
|
|
663
670
|
);
|
|
664
|
-
function
|
|
671
|
+
function r(a) {
|
|
665
672
|
const m = /* @__PURE__ */ new Date();
|
|
666
673
|
return a.getFullYear() === m.getFullYear() && a.getMonth() === m.getMonth() && a.getDate() === m.getDate();
|
|
667
674
|
}
|
|
668
|
-
function
|
|
675
|
+
function E(a) {
|
|
669
676
|
if (!e.rangeStart || !e.rangeEnd) return !1;
|
|
670
677
|
const m = o(a), k = e.rangeStart, U = e.rangeEnd;
|
|
671
678
|
return m > k && m < U;
|
|
@@ -717,21 +724,21 @@ const Dn = {
|
|
|
717
724
|
}
|
|
718
725
|
return xe;
|
|
719
726
|
}
|
|
720
|
-
const
|
|
721
|
-
const a =
|
|
727
|
+
const D = A(() => {
|
|
728
|
+
const a = i.value.getFullYear(), m = i.value.getMonth();
|
|
722
729
|
return w(a, m);
|
|
723
|
-
}), H =
|
|
724
|
-
const a =
|
|
730
|
+
}), H = A(() => {
|
|
731
|
+
const a = i.value.getFullYear(), m = i.value.getMonth() + 1;
|
|
725
732
|
return `${a}年${m}月`;
|
|
726
733
|
});
|
|
727
734
|
function I(a) {
|
|
728
735
|
const m = [];
|
|
729
|
-
if (a.type !== "current-month" && m.push("is-other-month"),
|
|
736
|
+
if (a.type !== "current-month" && m.push("is-other-month"), r(a.date) && m.push("is-today"), C(a.date))
|
|
730
737
|
return m.push("is-disabled"), m;
|
|
731
738
|
const k = o(a.date);
|
|
732
|
-
return e.range ? (e.rangeStart === k && m.push("is-start"), e.rangeEnd === k && m.push("is-end"),
|
|
739
|
+
return e.range ? (e.rangeStart === k && m.push("is-start"), e.rangeEnd === k && m.push("is-end"), E(a.date) && m.push("is-in-range")) : e.selectedDate === k && m.push("is-selected"), m;
|
|
733
740
|
}
|
|
734
|
-
const f =
|
|
741
|
+
const f = A(() => !!(e.rangeStart && e.rangeEnd)), ie = A(() => e.rangeStart && e.rangeEnd ? 2 : e.rangeStart || e.rangeEnd ? 1 : 0);
|
|
735
742
|
function ae(a) {
|
|
736
743
|
if (!e.minDate && !e.maxDate)
|
|
737
744
|
return !1;
|
|
@@ -752,13 +759,13 @@ const Dn = {
|
|
|
752
759
|
}
|
|
753
760
|
return !1;
|
|
754
761
|
}
|
|
755
|
-
const Y = W(!1), y = W("year"), _ = W(
|
|
762
|
+
const Y = W(!1), y = W("year"), _ = W(i.value.getFullYear()), S = W(i.value.getMonth() + 1), M = W(), R = W(1900), L = W(1920), T = W(1900), O = W(2100), fe = A(() => {
|
|
756
763
|
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
764
|
for (let xe = j; xe <= De; xe++)
|
|
758
765
|
a.push(xe);
|
|
759
766
|
return a;
|
|
760
767
|
});
|
|
761
|
-
_e(() =>
|
|
768
|
+
_e(() => i.value, (a) => {
|
|
762
769
|
_.value = a.getFullYear(), S.value = a.getMonth() + 1;
|
|
763
770
|
}, { immediate: !0 });
|
|
764
771
|
function ke() {
|
|
@@ -767,7 +774,7 @@ const Dn = {
|
|
|
767
774
|
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
775
|
}
|
|
769
776
|
function Me() {
|
|
770
|
-
_.value =
|
|
777
|
+
_.value = i.value.getFullYear(), S.value = i.value.getMonth() + 1, y.value = "year", Y.value = !0;
|
|
771
778
|
const a = _.value;
|
|
772
779
|
a < T.value ? T.value = Math.floor(a / 100) * 100 : a > O.value && (O.value = Math.ceil(a / 100) * 100 + 99), Ee(() => {
|
|
773
780
|
if (M.value) {
|
|
@@ -785,12 +792,12 @@ const Dn = {
|
|
|
785
792
|
R.value = T.value + U * he, L.value = R.value + ct * he - 1;
|
|
786
793
|
}
|
|
787
794
|
function V() {
|
|
788
|
-
const a = new Date(
|
|
789
|
-
a.setMonth(a.getMonth() - 1),
|
|
795
|
+
const a = new Date(i.value);
|
|
796
|
+
a.setMonth(a.getMonth() - 1), i.value = a;
|
|
790
797
|
}
|
|
791
|
-
function
|
|
792
|
-
const a = new Date(
|
|
793
|
-
a.setMonth(a.getMonth() + 1),
|
|
798
|
+
function B() {
|
|
799
|
+
const a = new Date(i.value);
|
|
800
|
+
a.setMonth(a.getMonth() + 1), i.value = a;
|
|
794
801
|
}
|
|
795
802
|
function K(a) {
|
|
796
803
|
ae(a) || (_.value = a, y.value = "month");
|
|
@@ -799,8 +806,8 @@ const Dn = {
|
|
|
799
806
|
b(_.value, a) || (S.value = a, ge());
|
|
800
807
|
}
|
|
801
808
|
function ge() {
|
|
802
|
-
const a = new Date(
|
|
803
|
-
a.setFullYear(_.value), a.setMonth(S.value - 1),
|
|
809
|
+
const a = new Date(i.value);
|
|
810
|
+
a.setFullYear(_.value), a.setMonth(S.value - 1), i.value = a, Y.value = !1, y.value = "year";
|
|
804
811
|
}
|
|
805
812
|
function we(a) {
|
|
806
813
|
g("select-day", a);
|
|
@@ -809,7 +816,7 @@ const Dn = {
|
|
|
809
816
|
g("clear");
|
|
810
817
|
}
|
|
811
818
|
function n() {
|
|
812
|
-
|
|
819
|
+
d.value && Re();
|
|
813
820
|
}
|
|
814
821
|
function s() {
|
|
815
822
|
g("confirm");
|
|
@@ -817,7 +824,7 @@ const Dn = {
|
|
|
817
824
|
function p() {
|
|
818
825
|
Y.value = !1;
|
|
819
826
|
}
|
|
820
|
-
function
|
|
827
|
+
function P(a) {
|
|
821
828
|
y.value = a;
|
|
822
829
|
}
|
|
823
830
|
function ee() {
|
|
@@ -828,14 +835,14 @@ const Dn = {
|
|
|
828
835
|
const m = (/* @__PURE__ */ new Date()).getMonth() + 1;
|
|
829
836
|
b(_.value, m) || (S.value = m, ge());
|
|
830
837
|
}
|
|
831
|
-
const
|
|
838
|
+
const d = A(() => e.range ? !!(e.rangeStart || e.rangeEnd) : !!e.selectedDate);
|
|
832
839
|
function z(a, m) {
|
|
833
840
|
const k = $(a), U = $(m);
|
|
834
841
|
if (!k || !U) return 0;
|
|
835
842
|
const j = Math.abs(U.getTime() - k.getTime());
|
|
836
843
|
return Math.ceil(j / (1e3 * 60 * 60 * 24)) + 1;
|
|
837
844
|
}
|
|
838
|
-
function
|
|
845
|
+
function x() {
|
|
839
846
|
return o(/* @__PURE__ */ new Date());
|
|
840
847
|
}
|
|
841
848
|
function q() {
|
|
@@ -872,7 +879,7 @@ const Dn = {
|
|
|
872
879
|
label: "本日",
|
|
873
880
|
days: 1,
|
|
874
881
|
getRange: () => {
|
|
875
|
-
const a =
|
|
882
|
+
const a = x();
|
|
876
883
|
return [a, a];
|
|
877
884
|
}
|
|
878
885
|
},
|
|
@@ -915,7 +922,7 @@ const Dn = {
|
|
|
915
922
|
days: 7,
|
|
916
923
|
getRange: () => {
|
|
917
924
|
const a = /* @__PURE__ */ new Date(), m = new Date(a);
|
|
918
|
-
return m.setDate(a.getDate() - 6), [o(m),
|
|
925
|
+
return m.setDate(a.getDate() - 6), [o(m), x()];
|
|
919
926
|
}
|
|
920
927
|
},
|
|
921
928
|
{
|
|
@@ -924,10 +931,10 @@ const Dn = {
|
|
|
924
931
|
days: 30,
|
|
925
932
|
getRange: () => {
|
|
926
933
|
const a = /* @__PURE__ */ new Date(), m = new Date(a);
|
|
927
|
-
return m.setDate(a.getDate() - 29), [o(m),
|
|
934
|
+
return m.setDate(a.getDate() - 29), [o(m), x()];
|
|
928
935
|
}
|
|
929
936
|
}
|
|
930
|
-
], lt =
|
|
937
|
+
], lt = A(() => at.filter((a) => {
|
|
931
938
|
if (e.maxRangeDays !== void 0) {
|
|
932
939
|
if (a.days !== void 0)
|
|
933
940
|
return a.days <= e.maxRangeDays;
|
|
@@ -947,27 +954,27 @@ const Dn = {
|
|
|
947
954
|
g("shortcut-select", m);
|
|
948
955
|
}
|
|
949
956
|
}
|
|
950
|
-
return
|
|
957
|
+
return u({
|
|
951
958
|
yearScrollRef: M
|
|
952
|
-
}), (a, m) => (
|
|
953
|
-
t.showTitle ? (
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
class: J(["rc-calendar__header-clear", { "is-disabled": !
|
|
959
|
+
}), (a, m) => (c(), h("div", null, [
|
|
960
|
+
t.showTitle ? (c(), h("div", Dn, [
|
|
961
|
+
N("div", xn, G(t.title), 1),
|
|
962
|
+
N("span", {
|
|
963
|
+
class: J(["rc-calendar__header-clear", { "is-disabled": !d.value }]),
|
|
957
964
|
onClick: n
|
|
958
965
|
}, " 清空 ", 2)
|
|
959
966
|
])) : F("", !0),
|
|
960
|
-
t.range ? (
|
|
961
|
-
|
|
962
|
-
(
|
|
967
|
+
t.range ? (c(), h("div", Cn, [
|
|
968
|
+
N("div", Sn, [
|
|
969
|
+
(c(!0), h(de, null, ye(lt.value, (k) => (c(), h("div", {
|
|
963
970
|
key: k.key,
|
|
964
971
|
class: "rc-calendar__shortcut-item",
|
|
965
972
|
onClick: (U) => ot(k)
|
|
966
973
|
}, G(k.label), 9, Mn))), 128))
|
|
967
974
|
])
|
|
968
975
|
])) : F("", !0),
|
|
969
|
-
|
|
970
|
-
|
|
976
|
+
N("div", Rn, [
|
|
977
|
+
N("div", {
|
|
971
978
|
class: "rc-calendar__nav-button",
|
|
972
979
|
onClick: V
|
|
973
980
|
}, [
|
|
@@ -976,13 +983,13 @@ const Dn = {
|
|
|
976
983
|
class: "rc-calendar__nav-icon"
|
|
977
984
|
})
|
|
978
985
|
]),
|
|
979
|
-
|
|
986
|
+
N("div", {
|
|
980
987
|
class: "rc-calendar__month-text",
|
|
981
988
|
onClick: Me
|
|
982
989
|
}, G(H.value), 1),
|
|
983
|
-
|
|
990
|
+
N("div", {
|
|
984
991
|
class: "rc-calendar__nav-button",
|
|
985
|
-
onClick:
|
|
992
|
+
onClick: B
|
|
986
993
|
}, [
|
|
987
994
|
X(ne(te), {
|
|
988
995
|
name: "icon_caret-right",
|
|
@@ -990,25 +997,25 @@ const Dn = {
|
|
|
990
997
|
})
|
|
991
998
|
])
|
|
992
999
|
]),
|
|
993
|
-
|
|
994
|
-
(
|
|
1000
|
+
N("div", Vn, [
|
|
1001
|
+
(c(), h(de, null, ye(v, (k) => N("div", {
|
|
995
1002
|
key: k,
|
|
996
1003
|
class: "rc-calendar__weekday"
|
|
997
1004
|
}, G(k), 1)), 64))
|
|
998
1005
|
]),
|
|
999
|
-
|
|
1000
|
-
(
|
|
1006
|
+
N("div", In, [
|
|
1007
|
+
(c(!0), h(de, null, ye(D.value, (k, U) => (c(), h("div", {
|
|
1001
1008
|
key: U,
|
|
1002
1009
|
class: J(["rc-calendar__day", I(k)]),
|
|
1003
1010
|
onClick: (j) => we(k)
|
|
1004
1011
|
}, [
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
k.bottomInfo ? (
|
|
1012
|
+
N("div", Fn, [
|
|
1013
|
+
N("span", An, G(k.text), 1),
|
|
1014
|
+
k.bottomInfo ? (c(), h("span", Bn, G(k.bottomInfo), 1)) : F("", !0)
|
|
1008
1015
|
])
|
|
1009
1016
|
], 10, Tn))), 128))
|
|
1010
1017
|
]),
|
|
1011
|
-
t.range && t.showFooter ? (
|
|
1018
|
+
t.range && t.showFooter ? (c(), h("div", En, [
|
|
1012
1019
|
X(ne($e), {
|
|
1013
1020
|
type: "default",
|
|
1014
1021
|
class: "rc-calendar__footer-reset",
|
|
@@ -1033,9 +1040,9 @@ const Dn = {
|
|
|
1033
1040
|
])) : F("", !0),
|
|
1034
1041
|
X(Ye, { name: "rc-calendar-fade" }, {
|
|
1035
1042
|
default: oe(() => [
|
|
1036
|
-
Y.value ? (
|
|
1037
|
-
|
|
1038
|
-
|
|
1043
|
+
Y.value ? (c(), h("div", Pn, [
|
|
1044
|
+
N("div", Nn, [
|
|
1045
|
+
N("div", zn, [
|
|
1039
1046
|
X(ne($e), {
|
|
1040
1047
|
type: "default",
|
|
1041
1048
|
mode: "text",
|
|
@@ -1047,17 +1054,17 @@ const Dn = {
|
|
|
1047
1054
|
])]),
|
|
1048
1055
|
_: 1
|
|
1049
1056
|
}),
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
onClick: m[0] || (m[0] = (k) =>
|
|
1057
|
+
N("div", Yn, [
|
|
1058
|
+
N("span", {
|
|
1059
|
+
onClick: m[0] || (m[0] = (k) => P("year"))
|
|
1053
1060
|
}, G(_.value) + "年", 1),
|
|
1054
|
-
y.value === "month" ? (
|
|
1055
|
-
y.value === "month" ? (
|
|
1061
|
+
y.value === "month" ? (c(), h("span", Ln, " - ")) : F("", !0),
|
|
1062
|
+
y.value === "month" ? (c(), h("span", {
|
|
1056
1063
|
key: 1,
|
|
1057
|
-
onClick: m[1] || (m[1] = (k) =>
|
|
1064
|
+
onClick: m[1] || (m[1] = (k) => P("month"))
|
|
1058
1065
|
}, G(S.value) + "月", 1)) : F("", !0)
|
|
1059
1066
|
]),
|
|
1060
|
-
y.value === "year" ? (
|
|
1067
|
+
y.value === "year" ? (c(), se(ne($e), {
|
|
1061
1068
|
key: 0,
|
|
1062
1069
|
type: "primary",
|
|
1063
1070
|
mode: "text",
|
|
@@ -1069,7 +1076,7 @@ const Dn = {
|
|
|
1069
1076
|
])]),
|
|
1070
1077
|
_: 1
|
|
1071
1078
|
})) : F("", !0),
|
|
1072
|
-
y.value === "month" ? (
|
|
1079
|
+
y.value === "month" ? (c(), se(ne($e), {
|
|
1073
1080
|
key: 1,
|
|
1074
1081
|
type: "primary",
|
|
1075
1082
|
mode: "text",
|
|
@@ -1082,19 +1089,19 @@ const Dn = {
|
|
|
1082
1089
|
_: 1
|
|
1083
1090
|
})) : F("", !0)
|
|
1084
1091
|
]),
|
|
1085
|
-
y.value === "year" ? (
|
|
1086
|
-
|
|
1092
|
+
y.value === "year" ? (c(), h("div", Wn, [
|
|
1093
|
+
N("div", {
|
|
1087
1094
|
class: "rc-calendar__year-picker-scroll",
|
|
1088
1095
|
ref_key: "yearScrollRef",
|
|
1089
1096
|
ref: M,
|
|
1090
1097
|
onScroll: ke
|
|
1091
1098
|
}, [
|
|
1092
|
-
|
|
1099
|
+
N("div", {
|
|
1093
1100
|
class: "rc-calendar__year-picker-spacer",
|
|
1094
1101
|
style: re({ height: `${Math.floor((R.value - T.value) / he) * rt}px` })
|
|
1095
1102
|
}, null, 4),
|
|
1096
|
-
|
|
1097
|
-
(
|
|
1103
|
+
N("div", On, [
|
|
1104
|
+
(c(!0), h(de, null, ye(fe.value, (k) => (c(), h("div", {
|
|
1098
1105
|
key: k,
|
|
1099
1106
|
class: J(["rc-calendar__year-picker-item", {
|
|
1100
1107
|
"is-selected": _.value === k,
|
|
@@ -1103,14 +1110,14 @@ const Dn = {
|
|
|
1103
1110
|
onClick: (U) => K(k)
|
|
1104
1111
|
}, G(k), 11, Hn))), 128))
|
|
1105
1112
|
]),
|
|
1106
|
-
|
|
1113
|
+
N("div", {
|
|
1107
1114
|
class: "rc-calendar__year-picker-spacer",
|
|
1108
1115
|
style: re({ height: `${Math.ceil((O.value - L.value) / he) * rt}px` })
|
|
1109
1116
|
}, null, 4)
|
|
1110
1117
|
], 544)
|
|
1111
1118
|
])) : F("", !0),
|
|
1112
|
-
y.value === "month" ? (
|
|
1113
|
-
(
|
|
1119
|
+
y.value === "month" ? (c(), h("div", Un, [
|
|
1120
|
+
(c(), h(de, null, ye(12, (k) => N("div", {
|
|
1114
1121
|
key: k,
|
|
1115
1122
|
class: J(["rc-calendar__month-picker-item", {
|
|
1116
1123
|
"is-selected": S.value === k,
|
|
@@ -1147,93 +1154,93 @@ const Dn = {
|
|
|
1147
1154
|
endDateOffset: { type: Boolean, default: !1 }
|
|
1148
1155
|
},
|
|
1149
1156
|
emits: ["update:modelValue", "change", "confirm"],
|
|
1150
|
-
setup(t, { emit:
|
|
1151
|
-
const l = t, e =
|
|
1157
|
+
setup(t, { emit: u }) {
|
|
1158
|
+
const l = t, e = u, g = W(), v = W(), $ = W(!1), o = W(""), i = A(() => l.range === !0 || typeof l.range == "number"), r = A(() => typeof l.range == "number" ? l.range : void 0), E = A(() => (V) => {
|
|
1152
1159
|
if (l.disabledDate && l.disabledDate(V))
|
|
1153
1160
|
return !0;
|
|
1154
|
-
if (
|
|
1155
|
-
const
|
|
1156
|
-
if (I(w.value) && ie(w.value,
|
|
1161
|
+
if (r.value !== void 0 && w.value && !D.value) {
|
|
1162
|
+
const B = f(V);
|
|
1163
|
+
if (I(w.value) && ie(w.value, B) > r.value)
|
|
1157
1164
|
return !0;
|
|
1158
1165
|
}
|
|
1159
1166
|
return !1;
|
|
1160
|
-
}), C = W(null), w = W(null),
|
|
1167
|
+
}), C = W(null), w = W(null), D = W(null);
|
|
1161
1168
|
_e(
|
|
1162
1169
|
() => l.modelValue,
|
|
1163
1170
|
(V) => {
|
|
1164
|
-
|
|
1171
|
+
i.value ? Array.isArray(V) && V.length === 2 ? (w.value = V[0], D.value = y(V[1])) : (w.value = null, D.value = null) : C.value = typeof V == "string" ? V : null, H();
|
|
1165
1172
|
},
|
|
1166
1173
|
{ immediate: !0 }
|
|
1167
1174
|
);
|
|
1168
1175
|
function H() {
|
|
1169
|
-
l.mode === "popup" && (
|
|
1176
|
+
l.mode === "popup" && (i.value ? w.value && D.value ? o.value = `${w.value} ~ ${D.value}` : w.value ? o.value = `${w.value} ~ ` : o.value = "" : o.value = C.value || "");
|
|
1170
1177
|
}
|
|
1171
1178
|
function I(V) {
|
|
1172
1179
|
if (!V) return null;
|
|
1173
|
-
const
|
|
1174
|
-
return isNaN(
|
|
1180
|
+
const B = new Date(V);
|
|
1181
|
+
return isNaN(B.getTime()) ? null : B;
|
|
1175
1182
|
}
|
|
1176
1183
|
function f(V) {
|
|
1177
|
-
const
|
|
1178
|
-
return `${
|
|
1184
|
+
const B = V.getFullYear(), K = String(V.getMonth() + 1).padStart(2, "0"), le = String(V.getDate()).padStart(2, "0");
|
|
1185
|
+
return `${B}-${K}-${le}`;
|
|
1179
1186
|
}
|
|
1180
|
-
function ie(V,
|
|
1181
|
-
const K = I(V), le = I(
|
|
1187
|
+
function ie(V, B) {
|
|
1188
|
+
const K = I(V), le = I(B);
|
|
1182
1189
|
if (!K || !le) return 0;
|
|
1183
1190
|
const ge = Math.abs(le.getTime() - K.getTime());
|
|
1184
1191
|
return Math.ceil(ge / (1e3 * 60 * 60 * 24));
|
|
1185
1192
|
}
|
|
1186
1193
|
function ae(V) {
|
|
1187
|
-
const
|
|
1188
|
-
return
|
|
1194
|
+
const B = I(V);
|
|
1195
|
+
return B ? (B.setDate(B.getDate() + 1), f(B)) : V;
|
|
1189
1196
|
}
|
|
1190
1197
|
function b(V) {
|
|
1191
|
-
const
|
|
1192
|
-
return
|
|
1198
|
+
const B = I(V);
|
|
1199
|
+
return B ? (B.setDate(B.getDate() - 1), f(B)) : V;
|
|
1193
1200
|
}
|
|
1194
1201
|
function Y(V) {
|
|
1195
|
-
return l.endDateOffset &&
|
|
1202
|
+
return l.endDateOffset && i.value ? ae(V) : V;
|
|
1196
1203
|
}
|
|
1197
1204
|
function y(V) {
|
|
1198
|
-
return l.endDateOffset &&
|
|
1205
|
+
return l.endDateOffset && i.value ? b(V) : V;
|
|
1199
1206
|
}
|
|
1200
1207
|
function _(V) {
|
|
1201
1208
|
if (V.type !== "current-month" || l.disabledDate && l.disabledDate(V.date))
|
|
1202
1209
|
return;
|
|
1203
|
-
const
|
|
1204
|
-
if (!(l.minDate &&
|
|
1205
|
-
if (
|
|
1206
|
-
if (!w.value || w.value &&
|
|
1207
|
-
w.value =
|
|
1210
|
+
const B = f(V.date);
|
|
1211
|
+
if (!(l.minDate && B < l.minDate) && !(l.maxDate && B > l.maxDate)) {
|
|
1212
|
+
if (i.value)
|
|
1213
|
+
if (!w.value || w.value && D.value)
|
|
1214
|
+
w.value = B, D.value = null;
|
|
1208
1215
|
else {
|
|
1209
|
-
let K = w.value, le =
|
|
1210
|
-
if (
|
|
1211
|
-
const ge = Y(
|
|
1216
|
+
let K = w.value, le = B;
|
|
1217
|
+
if (B < w.value && (le = w.value, K = B), w.value = K, D.value = le, w.value && D.value) {
|
|
1218
|
+
const ge = Y(D.value), we = [w.value, ge];
|
|
1212
1219
|
e("update:modelValue", we), e("change", we), l.showFooter || S();
|
|
1213
1220
|
}
|
|
1214
1221
|
}
|
|
1215
1222
|
else {
|
|
1216
|
-
C.value =
|
|
1217
|
-
const K =
|
|
1223
|
+
C.value = B;
|
|
1224
|
+
const K = B;
|
|
1218
1225
|
e("update:modelValue", K), e("change", K), l.mode && T();
|
|
1219
1226
|
}
|
|
1220
1227
|
H();
|
|
1221
1228
|
}
|
|
1222
1229
|
}
|
|
1223
1230
|
function S() {
|
|
1224
|
-
if (w.value &&
|
|
1225
|
-
const V = Y(
|
|
1226
|
-
e("update:modelValue",
|
|
1231
|
+
if (w.value && D.value) {
|
|
1232
|
+
const V = Y(D.value), B = [w.value, V];
|
|
1233
|
+
e("update:modelValue", B), e("change", B), e("confirm", B), T();
|
|
1227
1234
|
}
|
|
1228
1235
|
}
|
|
1229
1236
|
function M() {
|
|
1230
|
-
|
|
1237
|
+
i.value ? (w.value = null, D.value = null) : C.value = null;
|
|
1231
1238
|
const V = null;
|
|
1232
1239
|
e("update:modelValue", V), e("change", V), H();
|
|
1233
1240
|
}
|
|
1234
1241
|
function R(V) {
|
|
1235
|
-
w.value = V[0],
|
|
1236
|
-
const
|
|
1242
|
+
w.value = V[0], D.value = V[1];
|
|
1243
|
+
const B = Y(V[1]), K = [V[0], B];
|
|
1237
1244
|
e("update:modelValue", K), e("change", K), l.showFooter ? H() : S();
|
|
1238
1245
|
}
|
|
1239
1246
|
function L() {
|
|
@@ -1256,38 +1263,38 @@ const Dn = {
|
|
|
1256
1263
|
}
|
|
1257
1264
|
function Te() {
|
|
1258
1265
|
const V = o.value.trim();
|
|
1259
|
-
if (
|
|
1260
|
-
const
|
|
1261
|
-
if (
|
|
1262
|
-
const K = I(
|
|
1266
|
+
if (i.value) {
|
|
1267
|
+
const B = V.split("~").map((K) => K.trim());
|
|
1268
|
+
if (B.length === 2 && B[0] && B[1]) {
|
|
1269
|
+
const K = I(B[0]), le = I(B[1]);
|
|
1263
1270
|
if (K && le && !isNaN(K.getTime()) && !isNaN(le.getTime())) {
|
|
1264
1271
|
w.value = f(K);
|
|
1265
1272
|
const ge = f(le);
|
|
1266
|
-
|
|
1267
|
-
const we = Y(
|
|
1273
|
+
D.value = y(ge);
|
|
1274
|
+
const we = Y(D.value), Re = [w.value, we];
|
|
1268
1275
|
e("update:modelValue", Re), e("change", Re);
|
|
1269
1276
|
return;
|
|
1270
1277
|
}
|
|
1271
1278
|
}
|
|
1272
1279
|
} else {
|
|
1273
|
-
const
|
|
1274
|
-
if (
|
|
1275
|
-
C.value = f(
|
|
1280
|
+
const B = I(V);
|
|
1281
|
+
if (B && !isNaN(B.getTime())) {
|
|
1282
|
+
C.value = f(B), e("update:modelValue", C.value), e("change", C.value);
|
|
1276
1283
|
return;
|
|
1277
1284
|
}
|
|
1278
1285
|
}
|
|
1279
1286
|
H();
|
|
1280
1287
|
}
|
|
1281
|
-
return (V,
|
|
1282
|
-
t.mode === "popup" ? (
|
|
1288
|
+
return (V, B) => (c(), h("div", Kn, [
|
|
1289
|
+
t.mode === "popup" ? (c(), h("div", {
|
|
1283
1290
|
key: 0,
|
|
1284
1291
|
class: "rc-calendar__input",
|
|
1285
1292
|
onClick: L
|
|
1286
1293
|
}, [
|
|
1287
|
-
Tt(
|
|
1294
|
+
Tt(N("input", {
|
|
1288
1295
|
ref_key: "inputRef",
|
|
1289
1296
|
ref: g,
|
|
1290
|
-
"onUpdate:modelValue":
|
|
1297
|
+
"onUpdate:modelValue": B[0] || (B[0] = (K) => o.value = K),
|
|
1291
1298
|
type: "text",
|
|
1292
1299
|
class: "rc-calendar__input-field",
|
|
1293
1300
|
placeholder: t.placeholder,
|
|
@@ -1298,38 +1305,38 @@ const Dn = {
|
|
|
1298
1305
|
}, null, 40, jn), [
|
|
1299
1306
|
[Ft, o.value]
|
|
1300
1307
|
]),
|
|
1301
|
-
|
|
1308
|
+
N("div", Jn, [
|
|
1302
1309
|
X(ne(te), {
|
|
1303
1310
|
name: "icon_a-rili",
|
|
1304
1311
|
class: "rc-calendar__input-icon"
|
|
1305
1312
|
})
|
|
1306
1313
|
])
|
|
1307
1314
|
])) : F("", !0),
|
|
1308
|
-
t.mode === "default" ? (
|
|
1315
|
+
t.mode === "default" ? (c(), h("div", Qn, [
|
|
1309
1316
|
X(Dt, {
|
|
1310
1317
|
"show-title": t.showTitle,
|
|
1311
1318
|
title: t.title,
|
|
1312
|
-
range:
|
|
1319
|
+
range: i.value,
|
|
1313
1320
|
"selected-date": C.value,
|
|
1314
1321
|
"range-start": w.value,
|
|
1315
|
-
"range-end":
|
|
1322
|
+
"range-end": D.value,
|
|
1316
1323
|
"min-date": t.minDate,
|
|
1317
1324
|
"max-date": t.maxDate,
|
|
1318
|
-
"disabled-date":
|
|
1325
|
+
"disabled-date": E.value,
|
|
1319
1326
|
formatter: t.formatter,
|
|
1320
1327
|
"show-footer": !1,
|
|
1321
|
-
"max-range-days":
|
|
1328
|
+
"max-range-days": r.value,
|
|
1322
1329
|
onSelectDay: _,
|
|
1323
1330
|
onClear: M,
|
|
1324
1331
|
onConfirm: S,
|
|
1325
1332
|
onShortcutSelect: R
|
|
1326
1333
|
}, null, 8, ["show-title", "title", "range", "selected-date", "range-start", "range-end", "min-date", "max-date", "disabled-date", "formatter", "max-range-days"])
|
|
1327
1334
|
])) : F("", !0),
|
|
1328
|
-
t.mode === "popup" ? (
|
|
1335
|
+
t.mode === "popup" ? (c(), se(ne(Le), {
|
|
1329
1336
|
key: 2,
|
|
1330
1337
|
modelValue: $.value,
|
|
1331
1338
|
"onUpdate:modelValue": [
|
|
1332
|
-
|
|
1339
|
+
B[1] || (B[1] = (K) => $.value = K),
|
|
1333
1340
|
O
|
|
1334
1341
|
],
|
|
1335
1342
|
position: "bottom",
|
|
@@ -1339,7 +1346,7 @@ const Dn = {
|
|
|
1339
1346
|
"lock-scroll": !0
|
|
1340
1347
|
}, {
|
|
1341
1348
|
default: oe(() => [
|
|
1342
|
-
|
|
1349
|
+
N("div", {
|
|
1343
1350
|
ref_key: "popupPanelRef",
|
|
1344
1351
|
ref: v,
|
|
1345
1352
|
class: "rc-calendar__panel"
|
|
@@ -1347,16 +1354,16 @@ const Dn = {
|
|
|
1347
1354
|
X(Dt, {
|
|
1348
1355
|
"show-title": t.showTitle,
|
|
1349
1356
|
title: t.title,
|
|
1350
|
-
range:
|
|
1357
|
+
range: i.value,
|
|
1351
1358
|
"selected-date": C.value,
|
|
1352
1359
|
"range-start": w.value,
|
|
1353
|
-
"range-end":
|
|
1360
|
+
"range-end": D.value,
|
|
1354
1361
|
"min-date": t.minDate,
|
|
1355
1362
|
"max-date": t.maxDate,
|
|
1356
|
-
"disabled-date":
|
|
1363
|
+
"disabled-date": E.value,
|
|
1357
1364
|
formatter: t.formatter,
|
|
1358
1365
|
"show-footer": t.showFooter,
|
|
1359
|
-
"max-range-days":
|
|
1366
|
+
"max-range-days": r.value,
|
|
1360
1367
|
onSelectDay: _,
|
|
1361
1368
|
onClear: M,
|
|
1362
1369
|
onConfirm: S,
|
|
@@ -1408,14 +1415,14 @@ const ea = { class: "rc-search-area" }, ta = { class: "rc-search-area__bar" }, n
|
|
|
1408
1415
|
autoConfirm: { type: Boolean, default: !1 }
|
|
1409
1416
|
},
|
|
1410
1417
|
emits: ["update:modelValue", "change"],
|
|
1411
|
-
setup(t, { expose:
|
|
1412
|
-
const e = t, g = l, v = W(null), $ = W(null), o = W(null),
|
|
1418
|
+
setup(t, { expose: u, emit: l }) {
|
|
1419
|
+
const e = t, g = l, v = W(null), $ = W(null), o = W(null), i = W({ top: "0px" }), r = async () => {
|
|
1413
1420
|
if (v.value === null || !$.value)
|
|
1414
1421
|
return;
|
|
1415
1422
|
await Ee();
|
|
1416
1423
|
const s = $.value.getBoundingClientRect().top;
|
|
1417
|
-
|
|
1418
|
-
},
|
|
1424
|
+
i.value = { top: `${s}px` };
|
|
1425
|
+
}, E = (n) => {
|
|
1419
1426
|
if (v.value === null || !$.value)
|
|
1420
1427
|
return;
|
|
1421
1428
|
const s = n.target;
|
|
@@ -1423,22 +1430,22 @@ const ea = { class: "rc-search-area" }, ta = { class: "rc-search-area__bar" }, n
|
|
|
1423
1430
|
return;
|
|
1424
1431
|
const p = $.value.closest(".rc-search-area");
|
|
1425
1432
|
if (p) {
|
|
1426
|
-
const
|
|
1427
|
-
if (
|
|
1433
|
+
const P = p.querySelector(".rc-search-area__bar");
|
|
1434
|
+
if (P && P.contains(s))
|
|
1428
1435
|
return;
|
|
1429
1436
|
}
|
|
1430
1437
|
Y();
|
|
1431
1438
|
};
|
|
1432
1439
|
_e(v, async (n) => {
|
|
1433
|
-
n !== null ? (await Ee(),
|
|
1440
|
+
n !== null ? (await Ee(), r(), window.addEventListener("resize", r), window.addEventListener("scroll", r, !0), document.addEventListener("click", E, !0)) : (window.removeEventListener("resize", r), window.removeEventListener("scroll", r, !0), document.removeEventListener("click", E, !0));
|
|
1434
1441
|
}), nt(() => {
|
|
1435
|
-
window.removeEventListener("resize",
|
|
1442
|
+
window.removeEventListener("resize", r), window.removeEventListener("scroll", r, !0), document.removeEventListener("click", E, !0);
|
|
1436
1443
|
});
|
|
1437
|
-
const C = W({}), w = W(""),
|
|
1444
|
+
const C = W({}), w = W(""), D = W(null), H = W({}), I = W({ ...e.modelValue });
|
|
1438
1445
|
_e(() => e.modelValue, (n) => {
|
|
1439
1446
|
I.value = { ...n || {} };
|
|
1440
1447
|
}, { deep: !0, immediate: !0 });
|
|
1441
|
-
const f =
|
|
1448
|
+
const f = A(() => v.value === null ? null : e.items[v.value]), ie = A(() => {
|
|
1442
1449
|
if (!f.value) return "";
|
|
1443
1450
|
const n = Re(f.value);
|
|
1444
1451
|
return n > 0 ? `(${n}项)` : "";
|
|
@@ -1463,12 +1470,12 @@ const ea = { class: "rc-search-area" }, ta = { class: "rc-search-area__bar" }, n
|
|
|
1463
1470
|
} else {
|
|
1464
1471
|
const p = Array.isArray(s) ? s : [s];
|
|
1465
1472
|
if (p.length > 0) {
|
|
1466
|
-
const
|
|
1473
|
+
const P = p.map((ee) => {
|
|
1467
1474
|
const Q = M(n, ee);
|
|
1468
1475
|
return Q ? S(Q, n) : null;
|
|
1469
1476
|
}).filter((ee) => ee !== null);
|
|
1470
|
-
if (
|
|
1471
|
-
return `${n.label}: ${
|
|
1477
|
+
if (P.length > 0)
|
|
1478
|
+
return `${n.label}: ${P.join("、")}`;
|
|
1472
1479
|
}
|
|
1473
1480
|
}
|
|
1474
1481
|
return n.label;
|
|
@@ -1480,7 +1487,7 @@ const ea = { class: "rc-search-area" }, ta = { class: "rc-search-area__bar" }, n
|
|
|
1480
1487
|
return;
|
|
1481
1488
|
}
|
|
1482
1489
|
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" ?
|
|
1490
|
+
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" ? D.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
1491
|
}, Y = () => {
|
|
1485
1492
|
v.value = null;
|
|
1486
1493
|
}, y = (n, s) => {
|
|
@@ -1491,8 +1498,8 @@ const ea = { class: "rc-search-area" }, ta = { class: "rc-search-area__bar" }, n
|
|
|
1491
1498
|
if (typeof s.renderItem == "string")
|
|
1492
1499
|
return String(typeof p == "object" && p !== null ? p[s.renderItem] ?? "" : p);
|
|
1493
1500
|
{
|
|
1494
|
-
const
|
|
1495
|
-
return
|
|
1501
|
+
const P = s.renderItem(p);
|
|
1502
|
+
return P != null ? String(P) : "";
|
|
1496
1503
|
}
|
|
1497
1504
|
}
|
|
1498
1505
|
return typeof n == "string" ? n : n.label || String(n.value);
|
|
@@ -1502,29 +1509,29 @@ const ea = { class: "rc-search-area" }, ta = { class: "rc-search-area__bar" }, n
|
|
|
1502
1509
|
const p = n;
|
|
1503
1510
|
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
1511
|
}, S = (n, s) => {
|
|
1505
|
-
const p = n,
|
|
1506
|
-
if (
|
|
1507
|
-
if (typeof
|
|
1508
|
-
return String(typeof p == "object" && p !== null ? p[
|
|
1512
|
+
const p = n, P = s.renderResult || s.renderItem;
|
|
1513
|
+
if (P) {
|
|
1514
|
+
if (typeof P == "string")
|
|
1515
|
+
return String(typeof p == "object" && p !== null ? p[P] ?? "" : p);
|
|
1509
1516
|
{
|
|
1510
|
-
const ee =
|
|
1517
|
+
const ee = P(p);
|
|
1511
1518
|
return ee != null ? String(ee) : "";
|
|
1512
1519
|
}
|
|
1513
1520
|
}
|
|
1514
1521
|
return y(n, s);
|
|
1515
1522
|
}, M = (n, s, p) => {
|
|
1516
|
-
const
|
|
1517
|
-
if (!
|
|
1523
|
+
const P = p || n.options;
|
|
1524
|
+
if (!P) return null;
|
|
1518
1525
|
const ee = n.childrenKey || "children";
|
|
1519
|
-
for (const Q of
|
|
1520
|
-
const
|
|
1521
|
-
if (
|
|
1526
|
+
for (const Q of P) {
|
|
1527
|
+
const d = _(Q, n);
|
|
1528
|
+
if (d === s || String(d) === String(s))
|
|
1522
1529
|
return Q;
|
|
1523
1530
|
if (typeof Q == "object" && Q !== null) {
|
|
1524
1531
|
const z = Q[ee];
|
|
1525
1532
|
if (Array.isArray(z) && z.length > 0) {
|
|
1526
|
-
const
|
|
1527
|
-
if (
|
|
1533
|
+
const x = M(n, s, z);
|
|
1534
|
+
if (x) return x;
|
|
1528
1535
|
}
|
|
1529
1536
|
}
|
|
1530
1537
|
}
|
|
@@ -1532,29 +1539,29 @@ const ea = { class: "rc-search-area" }, ta = { class: "rc-search-area__bar" }, n
|
|
|
1532
1539
|
}, R = (n, s) => {
|
|
1533
1540
|
const p = s || n.options;
|
|
1534
1541
|
if (!p) return [];
|
|
1535
|
-
const
|
|
1542
|
+
const P = n.childrenKey || "children", ee = [];
|
|
1536
1543
|
for (const Q of p)
|
|
1537
1544
|
if (ee.push(Q), typeof Q == "object" && Q !== null) {
|
|
1538
|
-
const
|
|
1539
|
-
Array.isArray(
|
|
1545
|
+
const d = Q[P];
|
|
1546
|
+
Array.isArray(d) && d.length > 0 && ee.push(...R(n, d));
|
|
1540
1547
|
}
|
|
1541
1548
|
return ee;
|
|
1542
1549
|
}, L = (n) => {
|
|
1543
1550
|
if (!f.value) return !1;
|
|
1544
|
-
const s = f.value.key, p = C.value[s],
|
|
1545
|
-
return f.value.type === "single" || f.value.type === "tree-single" ? p != null && p ===
|
|
1551
|
+
const s = f.value.key, p = C.value[s], P = _(n, f.value);
|
|
1552
|
+
return f.value.type === "single" || f.value.type === "tree-single" ? p != null && p === P : (Array.isArray(p) ? p : []).some((Q) => Q === P || String(Q) === String(P));
|
|
1546
1553
|
}, T = (n) => n ? n.childrenKey ? R(n) : n.options || [] : [], O = (n) => {
|
|
1547
1554
|
if (!n) return [];
|
|
1548
1555
|
const s = n.childrenKey || "children";
|
|
1549
1556
|
return (n.options || []).filter((p) => {
|
|
1550
1557
|
if (typeof p == "string") return !1;
|
|
1551
|
-
const
|
|
1552
|
-
return Array.isArray(
|
|
1558
|
+
const P = p[s];
|
|
1559
|
+
return Array.isArray(P) && P.length > 0;
|
|
1553
1560
|
});
|
|
1554
1561
|
}, fe = (n, s) => {
|
|
1555
1562
|
if (!s || typeof n == "string") return [];
|
|
1556
|
-
const p = s.childrenKey || "children",
|
|
1557
|
-
return Array.isArray(
|
|
1563
|
+
const p = s.childrenKey || "children", P = n[p];
|
|
1564
|
+
return Array.isArray(P) ? P : [];
|
|
1558
1565
|
}, ke = (n) => {
|
|
1559
1566
|
if (n)
|
|
1560
1567
|
return H.value[n.key] !== void 0 ? H.value[n.key] : I.value[n.key];
|
|
@@ -1567,28 +1574,28 @@ const ea = { class: "rc-search-area" }, ta = { class: "rc-search-area__bar" }, n
|
|
|
1567
1574
|
if (!f.value) return;
|
|
1568
1575
|
const s = f.value.key, p = _(n, f.value);
|
|
1569
1576
|
I.value[s];
|
|
1570
|
-
let
|
|
1571
|
-
C.value[s] === p ?
|
|
1577
|
+
let P;
|
|
1578
|
+
C.value[s] === p ? P = void 0 : P = p, I.value[s] = P, g("update:modelValue", { ...I.value }), g("change", { ...I.value }, f.value), Y();
|
|
1572
1579
|
}, V = (n) => {
|
|
1573
1580
|
if (!f.value) return;
|
|
1574
|
-
const s = f.value.key, p = _(n, f.value),
|
|
1581
|
+
const s = f.value.key, p = _(n, f.value), P = Array.isArray(C.value[s]) ? [...C.value[s]] : [], ee = P.findIndex(
|
|
1575
1582
|
(Q) => Q === p || String(Q) === String(p)
|
|
1576
1583
|
);
|
|
1577
|
-
if (ee >= 0 ?
|
|
1578
|
-
const Q =
|
|
1584
|
+
if (ee >= 0 ? P.splice(ee, 1) : P.push(p), C.value[s] = P, e.autoConfirm) {
|
|
1585
|
+
const Q = P.length > 0 ? P : void 0;
|
|
1579
1586
|
I.value[s] = Q, g("update:modelValue", { ...I.value }), g("change", { ...I.value }, f.value), Y();
|
|
1580
1587
|
}
|
|
1581
|
-
},
|
|
1588
|
+
}, B = () => {
|
|
1582
1589
|
if (!f.value) return;
|
|
1583
1590
|
const n = f.value.key;
|
|
1584
|
-
f.value.slot ? H.value[n] = void 0 : f.value.type === "input" ? w.value = "" : f.value.type === "calendar" ?
|
|
1591
|
+
f.value.slot ? H.value[n] = void 0 : f.value.type === "input" ? w.value = "" : f.value.type === "calendar" ? D.value = null : f.value.type === "single" || f.value.type === "tree-single" ? C.value[n] = null : C.value[n] = [];
|
|
1585
1592
|
}, K = () => {
|
|
1586
1593
|
if (e.autoConfirm && f.value) {
|
|
1587
1594
|
const n = f.value.key, s = w.value.trim() || void 0;
|
|
1588
1595
|
I.value[n] = s, g("update:modelValue", { ...I.value }), g("change", { ...I.value }, f.value), Y();
|
|
1589
1596
|
}
|
|
1590
1597
|
}, le = (n) => {
|
|
1591
|
-
if (
|
|
1598
|
+
if (D.value = n, e.autoConfirm && f.value) {
|
|
1592
1599
|
const s = f.value.key, p = n ?? void 0;
|
|
1593
1600
|
I.value[s] = p, g("update:modelValue", { ...I.value }), g("change", { ...I.value }, f.value), Y();
|
|
1594
1601
|
}
|
|
@@ -1602,7 +1609,7 @@ const ea = { class: "rc-search-area" }, ta = { class: "rc-search-area__bar" }, n
|
|
|
1602
1609
|
else if (f.value.type === "input")
|
|
1603
1610
|
s = w.value.trim() || void 0, I.value[n] = s;
|
|
1604
1611
|
else if (f.value.type === "calendar")
|
|
1605
|
-
s =
|
|
1612
|
+
s = D.value !== null && D.value !== void 0 ? D.value : void 0, I.value[n] = s;
|
|
1606
1613
|
else if (f.value.type === "single" || f.value.type === "tree-single") {
|
|
1607
1614
|
const p = C.value[n];
|
|
1608
1615
|
s = p ?? void 0, I.value[n] = s;
|
|
@@ -1622,44 +1629,44 @@ const ea = { class: "rc-search-area" }, ta = { class: "rc-search-area__bar" }, n
|
|
|
1622
1629
|
if (n.type === "input")
|
|
1623
1630
|
return w.value.trim() ? 1 : 0;
|
|
1624
1631
|
if (n.type === "calendar")
|
|
1625
|
-
return
|
|
1632
|
+
return D.value !== null && D.value !== void 0 ? 1 : 0;
|
|
1626
1633
|
}
|
|
1627
1634
|
const s = C.value[n.key];
|
|
1628
1635
|
return s == null || s === "" ? 0 : n.type === "single" || n.type === "tree-single" ? 1 : Array.isArray(s) ? s.length : 0;
|
|
1629
1636
|
};
|
|
1630
|
-
return
|
|
1637
|
+
return u({
|
|
1631
1638
|
/** 获取当前筛选值 */
|
|
1632
1639
|
getValues: () => ({ ...I.value }),
|
|
1633
1640
|
/** 重置所有筛选 */
|
|
1634
1641
|
reset: () => {
|
|
1635
1642
|
I.value = {}, C.value = {}, H.value = {}, g("update:modelValue", {});
|
|
1636
1643
|
}
|
|
1637
|
-
}), (n, s) => (
|
|
1638
|
-
|
|
1639
|
-
(
|
|
1640
|
-
key:
|
|
1644
|
+
}), (n, s) => (c(), h("div", ea, [
|
|
1645
|
+
N("div", ta, [
|
|
1646
|
+
(c(!0), h(de, null, ye(e.items, (p, P) => (c(), h("div", {
|
|
1647
|
+
key: P,
|
|
1641
1648
|
class: J(["rc-search-area__item", {
|
|
1642
|
-
"is-active": v.value ===
|
|
1649
|
+
"is-active": v.value === P,
|
|
1643
1650
|
"has-value": we(p) > 0
|
|
1644
1651
|
}]),
|
|
1645
|
-
onClick: (ee) => b(
|
|
1652
|
+
onClick: (ee) => b(P)
|
|
1646
1653
|
}, [
|
|
1647
|
-
|
|
1654
|
+
N("span", aa, G(ae(p)), 1),
|
|
1648
1655
|
X(ne(te), {
|
|
1649
1656
|
name: "icon_a-xiala2",
|
|
1650
|
-
color: v.value !==
|
|
1651
|
-
class: J(["rc-search-area__item-arrow", { "is-up": v.value ===
|
|
1657
|
+
color: v.value !== P && we(p) > 0 ? "#1677ff" : "#969799",
|
|
1658
|
+
class: J(["rc-search-area__item-arrow", { "is-up": v.value === P }])
|
|
1652
1659
|
}, null, 8, ["color", "class"])
|
|
1653
1660
|
], 10, na))), 128))
|
|
1654
1661
|
]),
|
|
1655
1662
|
X(Ye, { name: "rc-search-area-fade" }, {
|
|
1656
1663
|
default: oe(() => [
|
|
1657
|
-
v.value !== null && e.showMask ? (
|
|
1664
|
+
v.value !== null && e.showMask ? (c(), h("div", {
|
|
1658
1665
|
key: 0,
|
|
1659
1666
|
ref_key: "maskRef",
|
|
1660
1667
|
ref: o,
|
|
1661
1668
|
class: "rc-search-area__mask",
|
|
1662
|
-
style: re(
|
|
1669
|
+
style: re(i.value),
|
|
1663
1670
|
onClick: Y
|
|
1664
1671
|
}, null, 4)) : F("", !0)
|
|
1665
1672
|
]),
|
|
@@ -1667,21 +1674,21 @@ const ea = { class: "rc-search-area" }, ta = { class: "rc-search-area__bar" }, n
|
|
|
1667
1674
|
}),
|
|
1668
1675
|
X(Ye, { name: "rc-search-area-slide" }, {
|
|
1669
1676
|
default: oe(() => {
|
|
1670
|
-
var p,
|
|
1677
|
+
var p, P, ee, Q, d, z, x, q, Ve, Fe, Ie, Qe, Ae, Pe, at, lt, ot, a, m;
|
|
1671
1678
|
return [
|
|
1672
|
-
v.value !== null ? (
|
|
1679
|
+
v.value !== null ? (c(), h("div", {
|
|
1673
1680
|
key: 0,
|
|
1674
1681
|
ref_key: "panelRef",
|
|
1675
1682
|
ref: $,
|
|
1676
1683
|
class: "rc-search-area__panel"
|
|
1677
1684
|
}, [
|
|
1678
|
-
|
|
1685
|
+
N("div", la, [
|
|
1679
1686
|
(p = f.value) != null && p.slot && n.$slots[f.value.key] ? Z(n.$slots, f.value.key, {
|
|
1680
1687
|
key: 0,
|
|
1681
1688
|
value: ke(f.value),
|
|
1682
1689
|
"update:value": (k) => Me(f.value, k)
|
|
1683
|
-
}, void 0, !0) : ((
|
|
1684
|
-
Tt(
|
|
1690
|
+
}, void 0, !0) : ((P = f.value) == null ? void 0 : P.type) === "input" ? (c(), h("div", oa, [
|
|
1691
|
+
Tt(N("input", {
|
|
1685
1692
|
"onUpdate:modelValue": s[0] || (s[0] = (k) => w.value = k),
|
|
1686
1693
|
type: "text",
|
|
1687
1694
|
class: "rc-search-area__input",
|
|
@@ -1690,33 +1697,33 @@ const ea = { class: "rc-search-area" }, ta = { class: "rc-search-area__bar" }, n
|
|
|
1690
1697
|
}, null, 40, ra), [
|
|
1691
1698
|
[Ft, w.value]
|
|
1692
1699
|
])
|
|
1693
|
-
])) : ((ee = f.value) == null ? void 0 : ee.type) === "calendar" ? (
|
|
1700
|
+
])) : ((ee = f.value) == null ? void 0 : ee.type) === "calendar" ? (c(), h("div", sa, [
|
|
1694
1701
|
X(ne(We), {
|
|
1695
|
-
modelValue:
|
|
1696
|
-
"onUpdate:modelValue": s[1] || (s[1] = (k) =>
|
|
1702
|
+
modelValue: D.value,
|
|
1703
|
+
"onUpdate:modelValue": s[1] || (s[1] = (k) => D.value = k),
|
|
1697
1704
|
range: ((Q = f.value.calendarConfig) == null ? void 0 : Q.range) || !1,
|
|
1698
1705
|
mode: "default",
|
|
1699
|
-
"min-date": (
|
|
1706
|
+
"min-date": (d = f.value.calendarConfig) == null ? void 0 : d.minDate,
|
|
1700
1707
|
"max-date": (z = f.value.calendarConfig) == null ? void 0 : z.maxDate,
|
|
1701
|
-
"disabled-date": (
|
|
1708
|
+
"disabled-date": (x = f.value.calendarConfig) == null ? void 0 : x.disabledDate,
|
|
1702
1709
|
formatter: (q = f.value.calendarConfig) == null ? void 0 : q.formatter,
|
|
1703
1710
|
"end-date-offset": ((Ve = f.value.calendarConfig) == null ? void 0 : Ve.endDateOffset) || !1,
|
|
1704
1711
|
onChange: le
|
|
1705
1712
|
}, null, 8, ["modelValue", "range", "min-date", "max-date", "disabled-date", "formatter", "end-date-offset"])
|
|
1706
|
-
])) : ((Fe = f.value) == null ? void 0 : Fe.type) === "tree-single" ? (
|
|
1707
|
-
(
|
|
1713
|
+
])) : ((Fe = f.value) == null ? void 0 : Fe.type) === "tree-single" ? (c(), h("div", ia, [
|
|
1714
|
+
(c(!0), h(de, null, ye(O(f.value), (k, U) => (c(), h("div", {
|
|
1708
1715
|
key: U,
|
|
1709
1716
|
class: "rc-search-area__tree-group"
|
|
1710
1717
|
}, [
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
(
|
|
1718
|
+
N("div", ua, G(y(k, f.value || void 0)), 1),
|
|
1719
|
+
N("div", ca, [
|
|
1720
|
+
(c(!0), h(de, null, ye(fe(k, f.value), (j, De) => (c(), h("div", {
|
|
1714
1721
|
key: De,
|
|
1715
1722
|
class: J(["rc-search-area__option", { "is-selected": L(j) }]),
|
|
1716
1723
|
onClick: (xe) => Te(j)
|
|
1717
1724
|
}, [
|
|
1718
|
-
|
|
1719
|
-
L(j) ? (
|
|
1725
|
+
N("span", fa, G(y(j, f.value || void 0)), 1),
|
|
1726
|
+
L(j) ? (c(), se(ne(te), {
|
|
1720
1727
|
key: 0,
|
|
1721
1728
|
name: "icon_check",
|
|
1722
1729
|
class: "rc-search-area__option-check"
|
|
@@ -1724,20 +1731,20 @@ const ea = { class: "rc-search-area" }, ta = { class: "rc-search-area__bar" }, n
|
|
|
1724
1731
|
], 10, da))), 128))
|
|
1725
1732
|
])
|
|
1726
1733
|
]))), 128))
|
|
1727
|
-
])) : ((Ie = f.value) == null ? void 0 : Ie.type) === "tree-multiple" ? (
|
|
1728
|
-
(
|
|
1734
|
+
])) : ((Ie = f.value) == null ? void 0 : Ie.type) === "tree-multiple" ? (c(), h("div", va, [
|
|
1735
|
+
(c(!0), h(de, null, ye(O(f.value), (k, U) => (c(), h("div", {
|
|
1729
1736
|
key: U,
|
|
1730
1737
|
class: "rc-search-area__tree-group"
|
|
1731
1738
|
}, [
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
(
|
|
1739
|
+
N("div", ma, G(y(k, f.value || void 0)), 1),
|
|
1740
|
+
N("div", pa, [
|
|
1741
|
+
(c(!0), h(de, null, ye(fe(k, f.value), (j, De) => (c(), h("div", {
|
|
1735
1742
|
key: De,
|
|
1736
1743
|
class: J(["rc-search-area__option", { "is-selected": L(j) }]),
|
|
1737
1744
|
onClick: (xe) => V(j)
|
|
1738
1745
|
}, [
|
|
1739
|
-
|
|
1740
|
-
L(j) ? (
|
|
1746
|
+
N("span", ya, G(y(j, f.value || void 0)), 1),
|
|
1747
|
+
L(j) ? (c(), se(ne(te), {
|
|
1741
1748
|
key: 0,
|
|
1742
1749
|
name: "icon_check",
|
|
1743
1750
|
class: "rc-search-area__option-check"
|
|
@@ -1745,41 +1752,41 @@ const ea = { class: "rc-search-area" }, ta = { class: "rc-search-area__bar" }, n
|
|
|
1745
1752
|
], 10, ha))), 128))
|
|
1746
1753
|
])
|
|
1747
1754
|
]))), 128))
|
|
1748
|
-
])) : ((Qe = f.value) == null ? void 0 : Qe.type) === "single" ? (
|
|
1749
|
-
(
|
|
1755
|
+
])) : ((Qe = f.value) == null ? void 0 : Qe.type) === "single" ? (c(), h("div", ga, [
|
|
1756
|
+
(c(!0), h(de, null, ye(T(f.value), (k, U) => (c(), h("div", {
|
|
1750
1757
|
key: U,
|
|
1751
1758
|
class: J(["rc-search-area__option", { "is-selected": L(k) }]),
|
|
1752
1759
|
onClick: (j) => Te(k)
|
|
1753
1760
|
}, [
|
|
1754
|
-
|
|
1755
|
-
L(k) ? (
|
|
1761
|
+
N("span", _a, G(y(k, f.value || void 0)), 1),
|
|
1762
|
+
L(k) ? (c(), se(ne(te), {
|
|
1756
1763
|
key: 0,
|
|
1757
1764
|
name: "icon_check",
|
|
1758
1765
|
class: "rc-search-area__option-check"
|
|
1759
1766
|
})) : F("", !0)
|
|
1760
1767
|
], 10, ba))), 128))
|
|
1761
|
-
])) : (
|
|
1762
|
-
(
|
|
1768
|
+
])) : (c(), h("div", ka, [
|
|
1769
|
+
(c(!0), h(de, null, ye(T(f.value), (k, U) => (c(), h("div", {
|
|
1763
1770
|
key: U,
|
|
1764
1771
|
class: J(["rc-search-area__option", { "is-selected": L(k) }]),
|
|
1765
1772
|
onClick: (j) => V(k)
|
|
1766
1773
|
}, [
|
|
1767
|
-
|
|
1768
|
-
L(k) ? (
|
|
1774
|
+
N("span", $a, G(y(k, f.value || void 0)), 1),
|
|
1775
|
+
L(k) ? (c(), se(ne(te), {
|
|
1769
1776
|
key: 0,
|
|
1770
1777
|
name: "icon_check",
|
|
1771
1778
|
class: "rc-search-area__option-check"
|
|
1772
1779
|
})) : F("", !0)
|
|
1773
1780
|
], 10, wa))), 128))
|
|
1774
1781
|
])),
|
|
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 ? (
|
|
1776
|
-
|
|
1782
|
+
((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 ? (c(), h("div", Da, [...s[2] || (s[2] = [
|
|
1783
|
+
N("p", null, "暂无选项", -1)
|
|
1777
1784
|
])])) : F("", !0)
|
|
1778
1785
|
]),
|
|
1779
|
-
!e.autoConfirm && ((a = f.value) == null ? void 0 : a.type) !== "single" && ((m = f.value) == null ? void 0 : m.type) !== "tree-single" ? (
|
|
1786
|
+
!e.autoConfirm && ((a = f.value) == null ? void 0 : a.type) !== "single" && ((m = f.value) == null ? void 0 : m.type) !== "tree-single" ? (c(), h("div", xa, [
|
|
1780
1787
|
X(ne($e), {
|
|
1781
1788
|
block: "",
|
|
1782
|
-
onClick:
|
|
1789
|
+
onClick: B
|
|
1783
1790
|
}, {
|
|
1784
1791
|
default: oe(() => [...s[3] || (s[3] = [
|
|
1785
1792
|
Se(" 重置 ", -1)
|
|
@@ -1862,84 +1869,84 @@ const ea = { class: "rc-search-area" }, ta = { class: "rc-search-area__bar" }, n
|
|
|
1862
1869
|
useGrouping: { type: Boolean, default: !1 }
|
|
1863
1870
|
},
|
|
1864
1871
|
emits: ["update:modelValue", "input", "change", "focus", "blur", "clear", "keydown", "mouseenter", "mouseleave", "compositionstart", "compositionupdate", "compositionend"],
|
|
1865
|
-
setup(t, { expose:
|
|
1866
|
-
const e = t, g = be(ut, {}), v = be("rcFormItem", void 0), $ =
|
|
1872
|
+
setup(t, { expose: u, emit: l }) {
|
|
1873
|
+
const e = t, g = be(ut, {}), v = be("rcFormItem", void 0), $ = A(() => e.deviceType || (g == null ? void 0 : g.inputDeviceType) || ft.inputDeviceType || "pc"), o = l, i = W(), r = W(e.modelValue ?? ""), E = W(!1), C = W(!1), w = W(!1);
|
|
1867
1874
|
_e(
|
|
1868
1875
|
() => e.modelValue,
|
|
1869
|
-
(
|
|
1870
|
-
|
|
1876
|
+
(d) => {
|
|
1877
|
+
r.value = d ?? "";
|
|
1871
1878
|
}
|
|
1872
1879
|
);
|
|
1873
|
-
const
|
|
1874
|
-
if (
|
|
1875
|
-
if (typeof
|
|
1876
|
-
return
|
|
1877
|
-
const z = _(
|
|
1880
|
+
const D = A(() => e.type === "number"), H = A(() => e.type === "password" ? C.value ? "text" : "password" : D.value ? "text" : e.type), I = A(() => {
|
|
1881
|
+
if (D.value) {
|
|
1882
|
+
if (typeof r.value == "string" && r.value.endsWith(".") && !r.value.includes("e") && !r.value.includes("E"))
|
|
1883
|
+
return r.value;
|
|
1884
|
+
const z = _(r.value);
|
|
1878
1885
|
if (z == null)
|
|
1879
|
-
return typeof
|
|
1880
|
-
let
|
|
1881
|
-
return e.precision !== void 0 && (
|
|
1886
|
+
return typeof r.value == "string" && (r.value === "-" || r.value === "") ? r.value : "";
|
|
1887
|
+
let x = String(z);
|
|
1888
|
+
return e.precision !== void 0 && (x = z.toFixed(e.precision)), e.useGrouping && !w.value && (x = S(x)), x;
|
|
1882
1889
|
}
|
|
1883
|
-
const
|
|
1884
|
-
return e.formatter && !w.value ? e.formatter(
|
|
1885
|
-
}), f =
|
|
1886
|
-
const
|
|
1887
|
-
return
|
|
1888
|
-
}), ie =
|
|
1890
|
+
const d = String(r.value ?? "");
|
|
1891
|
+
return e.formatter && !w.value ? e.formatter(d) : d;
|
|
1892
|
+
}), f = A(() => {
|
|
1893
|
+
const d = r.value;
|
|
1894
|
+
return d !== "" && d !== null && d !== void 0;
|
|
1895
|
+
}), ie = A(() => String(r.value ?? "").length), ae = A(() => !e.clearable || !f.value || e.disabled || e.readonly ? !1 : ($.value === "mobile", !0)), b = Yt(), Y = A(() => D.value && e.controls ? !!(e.suffixIcon || ae.value && ($.value === "mobile" || e.controls) || b.suffix) : !!(e.suffixIcon || e.showPassword && e.type === "password" || ae.value && e.type !== "textarea" && (!D.value || D.value && ($.value === "mobile" || e.controls)) || b.suffix)), y = A(() => {
|
|
1889
1896
|
if (e.type !== "textarea") return {};
|
|
1890
|
-
const
|
|
1891
|
-
return e.autosize ?
|
|
1897
|
+
const d = {};
|
|
1898
|
+
return e.autosize ? d.resize = "none" : e.resize !== void 0 ? d.resize = e.resize : d.resize = "vertical", d;
|
|
1892
1899
|
});
|
|
1893
|
-
function _(
|
|
1894
|
-
if (
|
|
1900
|
+
function _(d) {
|
|
1901
|
+
if (d == null || d === "")
|
|
1895
1902
|
return null;
|
|
1896
|
-
if (typeof
|
|
1897
|
-
return isNaN(
|
|
1898
|
-
const z = Number(String(
|
|
1903
|
+
if (typeof d == "number")
|
|
1904
|
+
return isNaN(d) ? null : d;
|
|
1905
|
+
const z = Number(String(d).replace(/,/g, ""));
|
|
1899
1906
|
return isNaN(z) ? null : z;
|
|
1900
1907
|
}
|
|
1901
|
-
function S(
|
|
1902
|
-
const z =
|
|
1908
|
+
function S(d) {
|
|
1909
|
+
const z = d.split(".");
|
|
1903
1910
|
return z[0] = z[0].replace(/\B(?=(\d{3})+(?!\d))/g, ","), z.join(".");
|
|
1904
1911
|
}
|
|
1905
|
-
function M(
|
|
1906
|
-
if (
|
|
1907
|
-
let z =
|
|
1912
|
+
function M(d) {
|
|
1913
|
+
if (d === null) return null;
|
|
1914
|
+
let z = d;
|
|
1908
1915
|
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;
|
|
1909
1916
|
}
|
|
1910
|
-
const R =
|
|
1911
|
-
if (!
|
|
1912
|
-
const
|
|
1913
|
-
return
|
|
1914
|
-
}), L =
|
|
1915
|
-
if (!
|
|
1916
|
-
const
|
|
1917
|
-
return
|
|
1917
|
+
const R = A(() => {
|
|
1918
|
+
if (!D.value || e.max === void 0) return !1;
|
|
1919
|
+
const d = _(r.value);
|
|
1920
|
+
return d !== null && d >= e.max;
|
|
1921
|
+
}), L = A(() => {
|
|
1922
|
+
if (!D.value || e.min === void 0) return !1;
|
|
1923
|
+
const d = _(r.value);
|
|
1924
|
+
return d !== null && d <= e.min;
|
|
1918
1925
|
});
|
|
1919
|
-
function T(
|
|
1926
|
+
function T(d) {
|
|
1920
1927
|
var Ve, Fe, Ie;
|
|
1921
|
-
let
|
|
1922
|
-
if (
|
|
1923
|
-
if (
|
|
1924
|
-
|
|
1928
|
+
let x = d.target.value;
|
|
1929
|
+
if (D.value && (x = x.replace(/,/g, "")), e.parser && !w.value && (x = e.parser(x)), D.value) {
|
|
1930
|
+
if (x === "" || x === "-" || x === ".") {
|
|
1931
|
+
r.value = x === "" ? void 0 : x, o("update:modelValue", x === "" ? void 0 : x), o("input", x === "" ? void 0 : x), (Ve = v == null ? void 0 : v.onChange) == null || Ve.call(v);
|
|
1925
1932
|
return;
|
|
1926
1933
|
}
|
|
1927
|
-
if (/^-?(\d+\.?\d*|\.\d+)([eE][+-]?\d+)?$/.test(
|
|
1928
|
-
const Ae = _(
|
|
1934
|
+
if (/^-?(\d+\.?\d*|\.\d+)([eE][+-]?\d+)?$/.test(x)) {
|
|
1935
|
+
const Ae = _(x);
|
|
1929
1936
|
if (Ae !== null)
|
|
1930
|
-
if (
|
|
1931
|
-
|
|
1937
|
+
if (x.endsWith(".") && !x.includes("e") && !x.includes("E"))
|
|
1938
|
+
r.value = x, o("update:modelValue", x), o("input", x);
|
|
1932
1939
|
else {
|
|
1933
1940
|
const Pe = M(Ae);
|
|
1934
|
-
|
|
1941
|
+
r.value = Pe, o("update:modelValue", Pe), o("input", Pe);
|
|
1935
1942
|
}
|
|
1936
1943
|
else
|
|
1937
|
-
|
|
1944
|
+
r.value = x, o("update:modelValue", x), o("input", x);
|
|
1938
1945
|
} else {
|
|
1939
1946
|
Ee(() => {
|
|
1940
|
-
if (
|
|
1947
|
+
if (i.value) {
|
|
1941
1948
|
const Ae = I.value;
|
|
1942
|
-
|
|
1949
|
+
i.value.value = Ae;
|
|
1943
1950
|
}
|
|
1944
1951
|
});
|
|
1945
1952
|
return;
|
|
@@ -1947,33 +1954,33 @@ const ea = { class: "rc-search-area" }, ta = { class: "rc-search-area__bar" }, n
|
|
|
1947
1954
|
(Fe = v == null ? void 0 : v.onChange) == null || Fe.call(v);
|
|
1948
1955
|
return;
|
|
1949
1956
|
}
|
|
1950
|
-
const q =
|
|
1951
|
-
|
|
1957
|
+
const q = x === "" ? void 0 : x;
|
|
1958
|
+
r.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(() => {
|
|
1952
1959
|
s();
|
|
1953
1960
|
});
|
|
1954
1961
|
}
|
|
1955
|
-
function O(
|
|
1956
|
-
|
|
1962
|
+
function O(d) {
|
|
1963
|
+
E.value = !0, o("focus", d);
|
|
1957
1964
|
}
|
|
1958
|
-
function fe(
|
|
1965
|
+
function fe(d) {
|
|
1959
1966
|
var z;
|
|
1960
|
-
if (
|
|
1961
|
-
const
|
|
1962
|
-
if (
|
|
1963
|
-
const q = M(
|
|
1964
|
-
|
|
1967
|
+
if (E.value = !1, D.value) {
|
|
1968
|
+
const x = _(r.value);
|
|
1969
|
+
if (x !== null) {
|
|
1970
|
+
const q = M(x);
|
|
1971
|
+
r.value = q, o("update:modelValue", q), o("change", q);
|
|
1965
1972
|
} else
|
|
1966
|
-
|
|
1973
|
+
r.value = void 0, o("update:modelValue", void 0), o("change", void 0);
|
|
1967
1974
|
} else {
|
|
1968
|
-
const
|
|
1969
|
-
o("change",
|
|
1975
|
+
const x = r.value;
|
|
1976
|
+
o("change", x === "" ? void 0 : x);
|
|
1970
1977
|
}
|
|
1971
|
-
o("blur",
|
|
1978
|
+
o("blur", d), (z = v == null ? void 0 : v.onBlur) == null || z.call(v);
|
|
1972
1979
|
}
|
|
1973
1980
|
function ke() {
|
|
1974
|
-
|
|
1975
|
-
var
|
|
1976
|
-
(
|
|
1981
|
+
r.value = void 0, o("update:modelValue", void 0), o("input", void 0), o("change", void 0), o("clear"), Ee(() => {
|
|
1982
|
+
var d;
|
|
1983
|
+
(d = i.value) == null || d.focus();
|
|
1977
1984
|
});
|
|
1978
1985
|
}
|
|
1979
1986
|
function Me() {
|
|
@@ -1982,143 +1989,143 @@ const ea = { class: "rc-search-area" }, ta = { class: "rc-search-area__bar" }, n
|
|
|
1982
1989
|
function Te() {
|
|
1983
1990
|
var q;
|
|
1984
1991
|
if (e.disabled || e.readonly || R.value) return;
|
|
1985
|
-
const
|
|
1986
|
-
let
|
|
1987
|
-
|
|
1992
|
+
const d = _(r.value), z = e.step ?? 1;
|
|
1993
|
+
let x;
|
|
1994
|
+
d === null ? x = M(e.min ?? 0) ?? 0 : x = M(d + z) ?? d, r.value = x, o("update:modelValue", x), o("input", x), o("change", x), (q = v == null ? void 0 : v.onChange) == null || q.call(v);
|
|
1988
1995
|
}
|
|
1989
1996
|
function V() {
|
|
1990
1997
|
var q;
|
|
1991
1998
|
if (e.disabled || e.readonly || L.value) return;
|
|
1992
|
-
const
|
|
1993
|
-
let
|
|
1994
|
-
|
|
1995
|
-
}
|
|
1996
|
-
function
|
|
1997
|
-
if (o("keydown",
|
|
1998
|
-
const z = e.step ?? 1,
|
|
1999
|
-
if (
|
|
2000
|
-
|
|
1999
|
+
const d = _(r.value), z = e.step ?? 1;
|
|
2000
|
+
let x;
|
|
2001
|
+
d === null ? x = M(e.max ?? 0) ?? 0 : x = M(d - z) ?? d, r.value = x, o("update:modelValue", x), o("input", x), o("change", x), (q = v == null ? void 0 : v.onChange) == null || q.call(v);
|
|
2002
|
+
}
|
|
2003
|
+
function B(d) {
|
|
2004
|
+
if (o("keydown", d), D.value && !e.disabled && !e.readonly) {
|
|
2005
|
+
const z = e.step ?? 1, x = _(r.value);
|
|
2006
|
+
if (d.key === "ArrowUp") {
|
|
2007
|
+
d.preventDefault(), Te();
|
|
2001
2008
|
return;
|
|
2002
2009
|
}
|
|
2003
|
-
if (
|
|
2004
|
-
|
|
2010
|
+
if (d.key === "ArrowDown") {
|
|
2011
|
+
d.preventDefault(), V();
|
|
2005
2012
|
return;
|
|
2006
2013
|
}
|
|
2007
|
-
if (
|
|
2008
|
-
if (
|
|
2009
|
-
const q = M(
|
|
2010
|
-
|
|
2014
|
+
if (d.key === "PageUp") {
|
|
2015
|
+
if (d.preventDefault(), x !== null) {
|
|
2016
|
+
const q = M(x + z * 10);
|
|
2017
|
+
r.value = q, o("update:modelValue", q), o("input", q), o("change", q);
|
|
2011
2018
|
}
|
|
2012
2019
|
return;
|
|
2013
2020
|
}
|
|
2014
|
-
if (
|
|
2015
|
-
if (
|
|
2016
|
-
const q = M(
|
|
2017
|
-
|
|
2021
|
+
if (d.key === "PageDown") {
|
|
2022
|
+
if (d.preventDefault(), x !== null) {
|
|
2023
|
+
const q = M(x - z * 10);
|
|
2024
|
+
r.value = q, o("update:modelValue", q), o("input", q), o("change", q);
|
|
2018
2025
|
}
|
|
2019
2026
|
return;
|
|
2020
2027
|
}
|
|
2021
2028
|
}
|
|
2022
|
-
if (
|
|
2023
|
-
const z =
|
|
2029
|
+
if (d.key === "Enter" && e.type !== "textarea") {
|
|
2030
|
+
const z = r.value;
|
|
2024
2031
|
o("change", z === "" ? void 0 : z);
|
|
2025
2032
|
}
|
|
2026
2033
|
}
|
|
2027
|
-
function K(
|
|
2028
|
-
o("mouseenter",
|
|
2034
|
+
function K(d) {
|
|
2035
|
+
o("mouseenter", d);
|
|
2029
2036
|
}
|
|
2030
|
-
function le(
|
|
2031
|
-
o("mouseleave",
|
|
2037
|
+
function le(d) {
|
|
2038
|
+
o("mouseleave", d);
|
|
2032
2039
|
}
|
|
2033
|
-
function ge(
|
|
2034
|
-
w.value = !0, o("compositionstart",
|
|
2040
|
+
function ge(d) {
|
|
2041
|
+
w.value = !0, o("compositionstart", d);
|
|
2035
2042
|
}
|
|
2036
|
-
function we(
|
|
2037
|
-
o("compositionupdate",
|
|
2043
|
+
function we(d) {
|
|
2044
|
+
o("compositionupdate", d);
|
|
2038
2045
|
}
|
|
2039
|
-
function Re(
|
|
2040
|
-
w.value = !1, o("compositionend",
|
|
2046
|
+
function Re(d) {
|
|
2047
|
+
w.value = !1, o("compositionend", d), d.target && T(d);
|
|
2041
2048
|
}
|
|
2042
2049
|
function n() {
|
|
2043
|
-
var
|
|
2044
|
-
e.disabled || e.readonly || (
|
|
2050
|
+
var d;
|
|
2051
|
+
e.disabled || e.readonly || (d = i.value) == null || d.focus();
|
|
2045
2052
|
}
|
|
2046
2053
|
function s() {
|
|
2047
|
-
if (e.type !== "textarea" || !
|
|
2048
|
-
const
|
|
2054
|
+
if (e.type !== "textarea" || !i.value) return;
|
|
2055
|
+
const d = i.value;
|
|
2049
2056
|
if (e.autosize) {
|
|
2050
|
-
|
|
2051
|
-
const z =
|
|
2057
|
+
d.style.height = "auto";
|
|
2058
|
+
const z = d.scrollHeight;
|
|
2052
2059
|
if (typeof e.autosize == "object") {
|
|
2053
|
-
const { minRows:
|
|
2054
|
-
|
|
2060
|
+
const { minRows: x = 2, maxRows: q } = e.autosize, Ve = parseInt(getComputedStyle(d).lineHeight) || 20, Fe = x * Ve, Ie = q ? q * Ve : 1 / 0;
|
|
2061
|
+
d.style.height = `${Math.min(Math.max(z, Fe), Ie)}px`;
|
|
2055
2062
|
} else
|
|
2056
|
-
|
|
2063
|
+
d.style.height = `${z}px`;
|
|
2057
2064
|
}
|
|
2058
2065
|
}
|
|
2059
2066
|
function p() {
|
|
2060
|
-
var
|
|
2061
|
-
(
|
|
2067
|
+
var d;
|
|
2068
|
+
(d = i.value) == null || d.focus();
|
|
2062
2069
|
}
|
|
2063
|
-
function
|
|
2064
|
-
var
|
|
2065
|
-
(
|
|
2070
|
+
function P() {
|
|
2071
|
+
var d;
|
|
2072
|
+
(d = i.value) == null || d.blur();
|
|
2066
2073
|
}
|
|
2067
2074
|
function ee() {
|
|
2068
|
-
|
|
2075
|
+
i.value && "select" in i.value && i.value.select();
|
|
2069
2076
|
}
|
|
2070
2077
|
function Q() {
|
|
2071
2078
|
ke();
|
|
2072
2079
|
}
|
|
2073
2080
|
return Je(() => {
|
|
2074
2081
|
e.type === "textarea" && e.autosize && s();
|
|
2075
|
-
}),
|
|
2082
|
+
}), u({
|
|
2076
2083
|
focus: p,
|
|
2077
|
-
blur:
|
|
2084
|
+
blur: P,
|
|
2078
2085
|
select: ee,
|
|
2079
2086
|
clear: Q,
|
|
2080
2087
|
resizeTextarea: s,
|
|
2081
|
-
inputRef:
|
|
2082
|
-
}), (
|
|
2088
|
+
inputRef: i
|
|
2089
|
+
}), (d, z) => (c(), h("div", {
|
|
2083
2090
|
class: J(["rc-input", [
|
|
2084
2091
|
`rc-input--${t.size}`,
|
|
2085
2092
|
{
|
|
2086
2093
|
"is-disabled": t.disabled,
|
|
2087
|
-
"is-focused":
|
|
2094
|
+
"is-focused": E.value,
|
|
2088
2095
|
"is-readonly": t.readonly,
|
|
2089
2096
|
"rc-input--textarea": t.type === "textarea",
|
|
2090
|
-
"has-prepend":
|
|
2091
|
-
"has-append":
|
|
2097
|
+
"has-prepend": d.$slots.prepend || D.value && t.controls,
|
|
2098
|
+
"has-append": d.$slots.append || D.value && t.controls
|
|
2092
2099
|
}
|
|
2093
2100
|
]]),
|
|
2094
2101
|
onClick: n
|
|
2095
2102
|
}, [
|
|
2096
|
-
|
|
2103
|
+
D.value && t.controls ? (c(), h("button", {
|
|
2097
2104
|
key: 0,
|
|
2098
2105
|
type: "button",
|
|
2099
2106
|
class: "rc-input__number-btn rc-input__number-btn--decrease rc-input__number-btn--prepend",
|
|
2100
2107
|
disabled: e.disabled || e.readonly || L.value,
|
|
2101
2108
|
onClick: Be(V, ["stop"])
|
|
2102
2109
|
}, [...z[0] || (z[0] = [
|
|
2103
|
-
|
|
2110
|
+
N("span", { class: "rc-input__number-text" }, "-", -1)
|
|
2104
2111
|
])], 8, Sa)) : F("", !0),
|
|
2105
|
-
|
|
2106
|
-
Z(
|
|
2112
|
+
d.$slots.prepend ? (c(), h("div", Ma, [
|
|
2113
|
+
Z(d.$slots, "prepend", {}, void 0, !0)
|
|
2107
2114
|
])) : F("", !0),
|
|
2108
|
-
|
|
2109
|
-
t.prefixIcon ||
|
|
2110
|
-
Z(
|
|
2111
|
-
t.prefixIcon ? (
|
|
2115
|
+
N("div", Ra, [
|
|
2116
|
+
t.prefixIcon || d.$slots.prefix ? (c(), h("div", Va, [
|
|
2117
|
+
Z(d.$slots, "prefix", {}, () => [
|
|
2118
|
+
t.prefixIcon ? (c(), se(ne(te), {
|
|
2112
2119
|
key: 0,
|
|
2113
2120
|
name: t.prefixIcon,
|
|
2114
2121
|
class: "rc-input__prefix-icon"
|
|
2115
2122
|
}, null, 8, ["name"])) : F("", !0)
|
|
2116
2123
|
], !0)
|
|
2117
2124
|
])) : F("", !0),
|
|
2118
|
-
t.type === "textarea" ? (
|
|
2119
|
-
(
|
|
2125
|
+
t.type === "textarea" ? (c(), h("div", Ia, [
|
|
2126
|
+
(c(), se(pt("textarea"), {
|
|
2120
2127
|
ref_key: "inputRef",
|
|
2121
|
-
ref:
|
|
2128
|
+
ref: i,
|
|
2122
2129
|
value: I.value,
|
|
2123
2130
|
class: "rc-input__field rc-input__field--textarea",
|
|
2124
2131
|
placeholder: t.placeholder,
|
|
@@ -2136,14 +2143,14 @@ const ea = { class: "rc-search-area" }, ta = { class: "rc-search-area__bar" }, n
|
|
|
2136
2143
|
onInput: T,
|
|
2137
2144
|
onFocus: O,
|
|
2138
2145
|
onBlur: fe,
|
|
2139
|
-
onKeydown:
|
|
2146
|
+
onKeydown: B,
|
|
2140
2147
|
onMouseenter: K,
|
|
2141
2148
|
onMouseleave: le,
|
|
2142
2149
|
onCompositionstart: ge,
|
|
2143
2150
|
onCompositionupdate: we,
|
|
2144
2151
|
onCompositionend: Re
|
|
2145
2152
|
}, null, 40, ["value", "placeholder", "disabled", "readonly", "maxlength", "minlength", "rows", "autocomplete", "name", "autofocus", "form", "tabindex", "style"])),
|
|
2146
|
-
ae.value && t.type === "textarea" ? (
|
|
2153
|
+
ae.value && t.type === "textarea" ? (c(), h("button", {
|
|
2147
2154
|
key: 0,
|
|
2148
2155
|
type: "button",
|
|
2149
2156
|
class: J(["rc-input__clear rc-input__clear--textarea", { "rc-input__clear--mobile": $.value === "mobile" }]),
|
|
@@ -2154,13 +2161,13 @@ const ea = { class: "rc-search-area" }, ta = { class: "rc-search-area__bar" }, n
|
|
|
2154
2161
|
class: "rc-input__clear-icon"
|
|
2155
2162
|
})
|
|
2156
2163
|
], 2)) : F("", !0)
|
|
2157
|
-
])) : (
|
|
2164
|
+
])) : (c(), se(pt("input"), {
|
|
2158
2165
|
key: 2,
|
|
2159
2166
|
ref_key: "inputRef",
|
|
2160
|
-
ref:
|
|
2167
|
+
ref: i,
|
|
2161
2168
|
value: I.value,
|
|
2162
2169
|
type: H.value,
|
|
2163
|
-
class: J(["rc-input__field", { "rc-input__field--number":
|
|
2170
|
+
class: J(["rc-input__field", { "rc-input__field--number": D.value }]),
|
|
2164
2171
|
placeholder: t.placeholder,
|
|
2165
2172
|
disabled: t.disabled,
|
|
2166
2173
|
readonly: t.readonly,
|
|
@@ -2171,24 +2178,24 @@ const ea = { class: "rc-search-area" }, ta = { class: "rc-search-area__bar" }, n
|
|
|
2171
2178
|
autofocus: t.autofocus,
|
|
2172
2179
|
form: t.form,
|
|
2173
2180
|
tabindex: t.tabindex,
|
|
2174
|
-
min:
|
|
2175
|
-
max:
|
|
2176
|
-
step:
|
|
2181
|
+
min: D.value ? t.min : void 0,
|
|
2182
|
+
max: D.value ? t.max : void 0,
|
|
2183
|
+
step: D.value ? t.step : void 0,
|
|
2177
2184
|
onInput: T,
|
|
2178
2185
|
onFocus: O,
|
|
2179
2186
|
onBlur: fe,
|
|
2180
|
-
onKeydown:
|
|
2187
|
+
onKeydown: B,
|
|
2181
2188
|
onMouseenter: K,
|
|
2182
2189
|
onMouseleave: le,
|
|
2183
2190
|
onCompositionstart: ge,
|
|
2184
2191
|
onCompositionupdate: we,
|
|
2185
2192
|
onCompositionend: Re
|
|
2186
2193
|
}, null, 40, ["value", "type", "class", "placeholder", "disabled", "readonly", "maxlength", "minlength", "autocomplete", "name", "autofocus", "form", "tabindex", "min", "max", "step"])),
|
|
2187
|
-
Y.value ? (
|
|
2188
|
-
|
|
2189
|
-
Z(
|
|
2194
|
+
Y.value ? (c(), h("div", Ta, [
|
|
2195
|
+
d.$slots.suffix ? (c(), h("div", Fa, [
|
|
2196
|
+
Z(d.$slots, "suffix", {}, void 0, !0)
|
|
2190
2197
|
])) : F("", !0),
|
|
2191
|
-
t.showPassword && t.type === "password" && f.value ? (
|
|
2198
|
+
t.showPassword && t.type === "password" && f.value ? (c(), h("button", {
|
|
2192
2199
|
key: 1,
|
|
2193
2200
|
type: "button",
|
|
2194
2201
|
class: "rc-input__password-toggle",
|
|
@@ -2199,7 +2206,7 @@ const ea = { class: "rc-search-area" }, ta = { class: "rc-search-area__bar" }, n
|
|
|
2199
2206
|
name: C.value ? "icon_view" : "icon_view-off"
|
|
2200
2207
|
}, null, 8, ["color", "name"])
|
|
2201
2208
|
])) : F("", !0),
|
|
2202
|
-
ae.value && t.type !== "textarea" && !
|
|
2209
|
+
ae.value && t.type !== "textarea" && (!D.value || D.value && ($.value === "mobile" || t.controls)) ? (c(), h("button", {
|
|
2203
2210
|
key: 2,
|
|
2204
2211
|
type: "button",
|
|
2205
2212
|
class: J(["rc-input__clear", { "rc-input__clear--mobile": $.value === "mobile" }]),
|
|
@@ -2210,29 +2217,29 @@ const ea = { class: "rc-search-area" }, ta = { class: "rc-search-area__bar" }, n
|
|
|
2210
2217
|
class: "rc-input__clear-icon"
|
|
2211
2218
|
})
|
|
2212
2219
|
], 2)) : F("", !0),
|
|
2213
|
-
t.suffixIcon && !t.clearable && !t.showPassword && !
|
|
2220
|
+
t.suffixIcon && !t.clearable && !t.showPassword && !D.value ? (c(), se(ne(te), {
|
|
2214
2221
|
key: 3,
|
|
2215
2222
|
name: t.suffixIcon,
|
|
2216
2223
|
class: "rc-input__suffix-icon"
|
|
2217
2224
|
}, null, 8, ["name"])) : F("", !0)
|
|
2218
2225
|
])) : F("", !0),
|
|
2219
|
-
t.showWordLimit && t.maxlength ? (
|
|
2226
|
+
t.showWordLimit && t.maxlength ? (c(), h("span", Aa, G(ie.value) + " / " + G(t.maxlength), 1)) : F("", !0)
|
|
2220
2227
|
]),
|
|
2221
|
-
|
|
2222
|
-
Z(
|
|
2228
|
+
d.$slots.append ? (c(), h("div", Ba, [
|
|
2229
|
+
Z(d.$slots, "append", {}, void 0, !0)
|
|
2223
2230
|
])) : F("", !0),
|
|
2224
|
-
|
|
2231
|
+
D.value && t.controls ? (c(), h("button", {
|
|
2225
2232
|
key: 3,
|
|
2226
2233
|
type: "button",
|
|
2227
2234
|
class: "rc-input__number-btn rc-input__number-btn--increase rc-input__number-btn--append",
|
|
2228
2235
|
disabled: e.disabled || e.readonly || R.value,
|
|
2229
2236
|
onClick: Be(Te, ["stop"])
|
|
2230
2237
|
}, [...z[1] || (z[1] = [
|
|
2231
|
-
|
|
2238
|
+
N("span", { class: "rc-input__number-text" }, "+", -1)
|
|
2232
2239
|
])], 8, Ea)) : F("", !0)
|
|
2233
2240
|
], 2));
|
|
2234
2241
|
}
|
|
2235
|
-
}), Ze = /* @__PURE__ */ ce(Pa, [["__scopeId", "data-v-
|
|
2242
|
+
}), Ze = /* @__PURE__ */ ce(Pa, [["__scopeId", "data-v-6bd7703b"]]);
|
|
2236
2243
|
Ze && (Ze.name = "rc-input");
|
|
2237
2244
|
function Mt(t) {
|
|
2238
2245
|
return Ze && t.component(Ze.name || "rc-input", Ze), t;
|
|
@@ -2246,47 +2253,47 @@ const Na = /* @__PURE__ */ ue({
|
|
|
2246
2253
|
maxHeight: { default: "" }
|
|
2247
2254
|
},
|
|
2248
2255
|
emits: ["mouseenter", "mouseleave"],
|
|
2249
|
-
setup(t, { expose:
|
|
2250
|
-
const e = t, g = W(), v =
|
|
2251
|
-
const
|
|
2252
|
-
return e.maxHeight && (
|
|
2256
|
+
setup(t, { expose: u, emit: l }) {
|
|
2257
|
+
const e = t, g = W(), v = A(() => e.visible === void 0 ? !0 : e.visible), $ = A(() => e.visible !== void 0), o = A(() => {
|
|
2258
|
+
const i = {};
|
|
2259
|
+
return e.maxHeight && (i.maxHeight = typeof e.maxHeight == "number" ? `${e.maxHeight}px` : e.maxHeight, i.overflowY = "auto"), i;
|
|
2253
2260
|
});
|
|
2254
|
-
return
|
|
2261
|
+
return u({
|
|
2255
2262
|
menuRef: g
|
|
2256
|
-
}), (
|
|
2263
|
+
}), (i, r) => $.value ? (c(), se(dt, {
|
|
2257
2264
|
key: 0,
|
|
2258
2265
|
to: "body"
|
|
2259
2266
|
}, [
|
|
2260
2267
|
X(Ye, { name: "rc-dropdown-fade" }, {
|
|
2261
2268
|
default: oe(() => [
|
|
2262
|
-
v.value ? (
|
|
2269
|
+
v.value ? (c(), h("ul", {
|
|
2263
2270
|
key: 0,
|
|
2264
2271
|
ref_key: "menuRef",
|
|
2265
2272
|
ref: g,
|
|
2266
2273
|
class: J(["rc-dropdown-menu", [`rc-dropdown-menu--${t.effect}`]]),
|
|
2267
2274
|
style: re(o.value),
|
|
2268
|
-
onClick:
|
|
2275
|
+
onClick: r[0] || (r[0] = Be(() => {
|
|
2269
2276
|
}, ["stop"])),
|
|
2270
|
-
onMouseenter:
|
|
2271
|
-
onMouseleave:
|
|
2277
|
+
onMouseenter: r[1] || (r[1] = (E) => i.$emit("mouseenter", E)),
|
|
2278
|
+
onMouseleave: r[2] || (r[2] = (E) => i.$emit("mouseleave", E))
|
|
2272
2279
|
}, [
|
|
2273
|
-
Z(
|
|
2280
|
+
Z(i.$slots, "default", {}, void 0, !0)
|
|
2274
2281
|
], 38)) : F("", !0)
|
|
2275
2282
|
]),
|
|
2276
2283
|
_: 3
|
|
2277
2284
|
})
|
|
2278
|
-
])) : (
|
|
2285
|
+
])) : (c(), h("ul", {
|
|
2279
2286
|
key: 1,
|
|
2280
2287
|
ref_key: "menuRef",
|
|
2281
2288
|
ref: g,
|
|
2282
2289
|
class: J(["rc-dropdown-menu rc-dropdown-menu--nested", [`rc-dropdown-menu--${t.effect}`]]),
|
|
2283
2290
|
style: re(o.value),
|
|
2284
|
-
onClick:
|
|
2291
|
+
onClick: r[3] || (r[3] = Be(() => {
|
|
2285
2292
|
}, ["stop"])),
|
|
2286
|
-
onMouseenter:
|
|
2287
|
-
onMouseleave:
|
|
2293
|
+
onMouseenter: r[4] || (r[4] = (E) => i.$emit("mouseenter", E)),
|
|
2294
|
+
onMouseleave: r[5] || (r[5] = (E) => i.$emit("mouseleave", E))
|
|
2288
2295
|
}, [
|
|
2289
|
-
Z(
|
|
2296
|
+
Z(i.$slots, "default", {}, void 0, !0)
|
|
2290
2297
|
], 38));
|
|
2291
2298
|
}
|
|
2292
2299
|
}), Oe = /* @__PURE__ */ ce(Na, [["__scopeId", "data-v-288e2690"]]), za = /* @__PURE__ */ ue({
|
|
@@ -2303,15 +2310,15 @@ const Na = /* @__PURE__ */ ue({
|
|
|
2303
2310
|
hideTimeout: { default: 150 }
|
|
2304
2311
|
},
|
|
2305
2312
|
emits: ["command", "visible-change"],
|
|
2306
|
-
setup(t, { expose:
|
|
2313
|
+
setup(t, { expose: u, emit: l }) {
|
|
2307
2314
|
const e = t, g = l, v = W(), $ = W(), o = W(!1);
|
|
2308
|
-
let
|
|
2309
|
-
function
|
|
2315
|
+
let i = null, r = null;
|
|
2316
|
+
function E(S) {
|
|
2310
2317
|
e.hideOnClick && (o.value = !1), S !== void 0 && g("command", S);
|
|
2311
2318
|
}
|
|
2312
|
-
Ce("handleItemClick",
|
|
2319
|
+
Ce("handleItemClick", E);
|
|
2313
2320
|
function C() {
|
|
2314
|
-
e.disabled || (
|
|
2321
|
+
e.disabled || (i && (clearTimeout(i), i = null), r && (clearTimeout(r), r = null), i = setTimeout(() => {
|
|
2315
2322
|
o.value = !0, requestAnimationFrame(() => {
|
|
2316
2323
|
Ee(() => {
|
|
2317
2324
|
Y();
|
|
@@ -2320,11 +2327,11 @@ const Na = /* @__PURE__ */ ue({
|
|
|
2320
2327
|
}, e.showTimeout));
|
|
2321
2328
|
}
|
|
2322
2329
|
function w() {
|
|
2323
|
-
e.trigger === "hover" && f.value || (
|
|
2330
|
+
e.trigger === "hover" && f.value || (r && (clearTimeout(r), r = null), i && (clearTimeout(i), i = null), r = setTimeout(() => {
|
|
2324
2331
|
o.value = !1, f.value = !1;
|
|
2325
2332
|
}, e.hideTimeout));
|
|
2326
2333
|
}
|
|
2327
|
-
function
|
|
2334
|
+
function D() {
|
|
2328
2335
|
e.disabled || (o.value ? w() : C());
|
|
2329
2336
|
}
|
|
2330
2337
|
function H() {
|
|
@@ -2337,13 +2344,13 @@ const Na = /* @__PURE__ */ ue({
|
|
|
2337
2344
|
}
|
|
2338
2345
|
const f = W(!1);
|
|
2339
2346
|
function ie() {
|
|
2340
|
-
e.trigger === "hover" && (f.value = !0,
|
|
2347
|
+
e.trigger === "hover" && (f.value = !0, i && (clearTimeout(i), i = null), r && (clearTimeout(r), r = null));
|
|
2341
2348
|
}
|
|
2342
2349
|
function ae() {
|
|
2343
2350
|
e.trigger === "hover" && (f.value = !1, w());
|
|
2344
2351
|
}
|
|
2345
2352
|
function b(S) {
|
|
2346
|
-
e.trigger === "click" && !e.disabled && (S.stopPropagation(),
|
|
2353
|
+
e.trigger === "click" && !e.disabled && (S.stopPropagation(), D());
|
|
2347
2354
|
}
|
|
2348
2355
|
function Y() {
|
|
2349
2356
|
var Me;
|
|
@@ -2418,13 +2425,13 @@ const Na = /* @__PURE__ */ ue({
|
|
|
2418
2425
|
return Je(() => {
|
|
2419
2426
|
window.addEventListener("resize", _), window.addEventListener("scroll", _, !0);
|
|
2420
2427
|
}), nt(() => {
|
|
2421
|
-
|
|
2422
|
-
}),
|
|
2428
|
+
i && clearTimeout(i), r && clearTimeout(r), document.removeEventListener("click", y), window.removeEventListener("resize", _), window.removeEventListener("scroll", _, !0);
|
|
2429
|
+
}), u({
|
|
2423
2430
|
show: C,
|
|
2424
2431
|
hide: w,
|
|
2425
|
-
toggle:
|
|
2432
|
+
toggle: D,
|
|
2426
2433
|
visible: o
|
|
2427
|
-
}), (S, M) => (
|
|
2434
|
+
}), (S, M) => (c(), h("div", {
|
|
2428
2435
|
ref_key: "dropdownRef",
|
|
2429
2436
|
ref: v,
|
|
2430
2437
|
class: J(["rc-dropdown", { "is-disabled": t.disabled }]),
|
|
@@ -2449,7 +2456,7 @@ const Na = /* @__PURE__ */ ue({
|
|
|
2449
2456
|
}, 8, ["visible", "effect", "max-height"])
|
|
2450
2457
|
], 34));
|
|
2451
2458
|
}
|
|
2452
|
-
}), qe = /* @__PURE__ */ ce(za, [["__scopeId", "data-v-
|
|
2459
|
+
}), qe = /* @__PURE__ */ ce(za, [["__scopeId", "data-v-544a2740"]]), Ya = { class: "rc-dropdown-item__text" }, La = /* @__PURE__ */ ue({
|
|
2453
2460
|
name: "rc-dropdown-item",
|
|
2454
2461
|
__name: "item",
|
|
2455
2462
|
props: {
|
|
@@ -2459,28 +2466,28 @@ const Na = /* @__PURE__ */ ue({
|
|
|
2459
2466
|
icon: { default: "" }
|
|
2460
2467
|
},
|
|
2461
2468
|
setup(t) {
|
|
2462
|
-
const
|
|
2469
|
+
const u = t, l = be("handleItemClick", () => {
|
|
2463
2470
|
});
|
|
2464
2471
|
function e(g) {
|
|
2465
|
-
if (
|
|
2472
|
+
if (u.disabled) {
|
|
2466
2473
|
g.stopPropagation();
|
|
2467
2474
|
return;
|
|
2468
2475
|
}
|
|
2469
|
-
l(
|
|
2476
|
+
l(u.command);
|
|
2470
2477
|
}
|
|
2471
|
-
return (g, v) => (
|
|
2478
|
+
return (g, v) => (c(), h("li", {
|
|
2472
2479
|
class: J(["rc-dropdown-item", {
|
|
2473
2480
|
"is-disabled": t.disabled,
|
|
2474
2481
|
"is-divided": t.divided
|
|
2475
2482
|
}]),
|
|
2476
2483
|
onClick: e
|
|
2477
2484
|
}, [
|
|
2478
|
-
t.icon ? (
|
|
2485
|
+
t.icon ? (c(), se(te, {
|
|
2479
2486
|
key: 0,
|
|
2480
2487
|
name: t.icon,
|
|
2481
2488
|
class: "rc-dropdown-item__icon"
|
|
2482
2489
|
}, null, 8, ["name"])) : F("", !0),
|
|
2483
|
-
|
|
2490
|
+
N("span", Ya, [
|
|
2484
2491
|
Z(g.$slots, "default", {}, void 0, !0)
|
|
2485
2492
|
])
|
|
2486
2493
|
], 2));
|
|
@@ -2507,24 +2514,24 @@ const Wa = /* @__PURE__ */ ue({
|
|
|
2507
2514
|
showMessage: { type: Boolean, default: !0 }
|
|
2508
2515
|
},
|
|
2509
2516
|
emits: ["validate"],
|
|
2510
|
-
setup(t, { expose:
|
|
2511
|
-
const e = t, g = l, v = W(), $ = W(/* @__PURE__ */ new Map()), o = W({}),
|
|
2517
|
+
setup(t, { expose: u, emit: l }) {
|
|
2518
|
+
const e = t, g = l, v = W(), $ = W(/* @__PURE__ */ new Map()), o = W({}), i = (y) => {
|
|
2512
2519
|
if (y === null || typeof y != "object")
|
|
2513
2520
|
return y;
|
|
2514
2521
|
if (y instanceof Date)
|
|
2515
2522
|
return new Date(y.getTime());
|
|
2516
2523
|
if (y instanceof Array)
|
|
2517
|
-
return y.map((_) =>
|
|
2524
|
+
return y.map((_) => i(_));
|
|
2518
2525
|
if (typeof y == "object") {
|
|
2519
2526
|
const _ = {};
|
|
2520
2527
|
for (const S in y)
|
|
2521
|
-
y.hasOwnProperty(S) && (_[S] =
|
|
2528
|
+
y.hasOwnProperty(S) && (_[S] = i(y[S]));
|
|
2522
2529
|
return _;
|
|
2523
2530
|
}
|
|
2524
2531
|
return y;
|
|
2525
|
-
},
|
|
2526
|
-
e.model && (o.value =
|
|
2527
|
-
},
|
|
2532
|
+
}, r = () => {
|
|
2533
|
+
e.model && (o.value = i(e.model));
|
|
2534
|
+
}, E = (y, _) => {
|
|
2528
2535
|
$.value.set(y, _);
|
|
2529
2536
|
}, C = (y) => {
|
|
2530
2537
|
$.value.delete(y);
|
|
@@ -2538,7 +2545,7 @@ const Wa = /* @__PURE__ */ ue({
|
|
|
2538
2545
|
disabled: e.disabled,
|
|
2539
2546
|
hideRequiredAsterisk: e.hideRequiredAsterisk,
|
|
2540
2547
|
showMessage: e.showMessage,
|
|
2541
|
-
registerFormItem:
|
|
2548
|
+
registerFormItem: E,
|
|
2542
2549
|
unregisterFormItem: C,
|
|
2543
2550
|
validateField: (y, _) => {
|
|
2544
2551
|
const S = $.value.get(y);
|
|
@@ -2546,7 +2553,7 @@ const Wa = /* @__PURE__ */ ue({
|
|
|
2546
2553
|
}
|
|
2547
2554
|
});
|
|
2548
2555
|
let w = !1;
|
|
2549
|
-
const
|
|
2556
|
+
const D = () => {
|
|
2550
2557
|
w || (w = !0, f((y) => {
|
|
2551
2558
|
w = !1, y ? console.log("表单验证通过", e.model) : console.log("表单验证失败");
|
|
2552
2559
|
}).catch(() => {
|
|
@@ -2554,7 +2561,7 @@ const Wa = /* @__PURE__ */ ue({
|
|
|
2554
2561
|
}));
|
|
2555
2562
|
};
|
|
2556
2563
|
Ce("rcFormActions", {
|
|
2557
|
-
submit:
|
|
2564
|
+
submit: D,
|
|
2558
2565
|
reset: () => {
|
|
2559
2566
|
ae();
|
|
2560
2567
|
}
|
|
@@ -2563,11 +2570,11 @@ const Wa = /* @__PURE__ */ ue({
|
|
|
2563
2570
|
_e(
|
|
2564
2571
|
() => e.model,
|
|
2565
2572
|
() => {
|
|
2566
|
-
!I && e.model && (
|
|
2573
|
+
!I && e.model && (r(), I = !0);
|
|
2567
2574
|
},
|
|
2568
2575
|
{ immediate: !0, deep: !0 }
|
|
2569
2576
|
), Je(() => {
|
|
2570
|
-
!I && e.model && (
|
|
2577
|
+
!I && e.model && (r(), I = !0);
|
|
2571
2578
|
}), _e(
|
|
2572
2579
|
() => e.rules,
|
|
2573
2580
|
() => {
|
|
@@ -2603,7 +2610,7 @@ const Wa = /* @__PURE__ */ ue({
|
|
|
2603
2610
|
}), e.model && o.value && (Object.keys(e.model).forEach((y) => {
|
|
2604
2611
|
delete e.model[y];
|
|
2605
2612
|
}), Object.keys(o.value).forEach((y) => {
|
|
2606
|
-
e.model[y] =
|
|
2613
|
+
e.model[y] = i(o.value[y]);
|
|
2607
2614
|
}));
|
|
2608
2615
|
}, b = (y) => {
|
|
2609
2616
|
const _ = y ? Array.isArray(y) ? y : [y] : void 0;
|
|
@@ -2611,15 +2618,15 @@ const Wa = /* @__PURE__ */ ue({
|
|
|
2611
2618
|
(!_ || _.includes(M)) && S.clearValidate();
|
|
2612
2619
|
});
|
|
2613
2620
|
}, Y = (y) => {
|
|
2614
|
-
y.preventDefault(),
|
|
2621
|
+
y.preventDefault(), D();
|
|
2615
2622
|
};
|
|
2616
|
-
return
|
|
2623
|
+
return u({
|
|
2617
2624
|
validate: f,
|
|
2618
2625
|
validateField: ie,
|
|
2619
2626
|
resetFields: ae,
|
|
2620
2627
|
clearValidate: b,
|
|
2621
2628
|
formRef: v
|
|
2622
|
-
}), (y, _) => (
|
|
2629
|
+
}), (y, _) => (c(), h("form", {
|
|
2623
2630
|
ref_key: "formRef",
|
|
2624
2631
|
ref: v,
|
|
2625
2632
|
class: J(["rc-form", [
|
|
@@ -2648,14 +2655,14 @@ const Wa = /* @__PURE__ */ ue({
|
|
|
2648
2655
|
inlineMessage: { type: Boolean, default: !1 },
|
|
2649
2656
|
error: { default: "" }
|
|
2650
2657
|
},
|
|
2651
|
-
setup(t, { expose:
|
|
2652
|
-
const l = t, e = be("rcForm", void 0), g = W(""), v = W(""), $ =
|
|
2658
|
+
setup(t, { expose: u }) {
|
|
2659
|
+
const l = t, e = be("rcForm", void 0), g = W(""), v = W(""), $ = A(() => {
|
|
2653
2660
|
const b = l.labelWidth ?? (e == null ? void 0 : e.labelWidth);
|
|
2654
2661
|
return b ? {
|
|
2655
2662
|
width: typeof b == "number" ? `${b}px` : b
|
|
2656
2663
|
} : {};
|
|
2657
|
-
}), o =
|
|
2658
|
-
}),
|
|
2664
|
+
}), o = A(() => {
|
|
2665
|
+
}), i = A(() => l.showMessage ?? (e == null ? void 0 : e.showMessage) ?? !0), r = A(() => (e == null ? void 0 : e.hideRequiredAsterisk) ?? !1), E = A(() => (e == null ? void 0 : e.labelPosition) ?? "left"), C = A(() => {
|
|
2659
2666
|
if (l.required !== void 0)
|
|
2660
2667
|
return l.required;
|
|
2661
2668
|
if (!l.prop || !e)
|
|
@@ -2669,7 +2676,7 @@ const Wa = /* @__PURE__ */ ue({
|
|
|
2669
2676
|
return [];
|
|
2670
2677
|
const b = e.rules[l.prop];
|
|
2671
2678
|
return b ? Array.isArray(b) ? b : [b] : [];
|
|
2672
|
-
},
|
|
2679
|
+
}, D = () => {
|
|
2673
2680
|
if (!(!l.prop || !e))
|
|
2674
2681
|
return e.model[l.prop];
|
|
2675
2682
|
}, H = (b, Y) => new Promise((y) => {
|
|
@@ -2765,7 +2772,7 @@ const Wa = /* @__PURE__ */ ue({
|
|
|
2765
2772
|
return;
|
|
2766
2773
|
}
|
|
2767
2774
|
g.value = "validating", v.value = "";
|
|
2768
|
-
const R =
|
|
2775
|
+
const R = D(), L = M.map((T) => H(T, R));
|
|
2769
2776
|
Promise.all(L).then((T) => {
|
|
2770
2777
|
const O = T.find((fe) => fe !== null);
|
|
2771
2778
|
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());
|
|
@@ -2779,7 +2786,7 @@ const Wa = /* @__PURE__ */ ue({
|
|
|
2779
2786
|
g.value = "", v.value = "";
|
|
2780
2787
|
};
|
|
2781
2788
|
return _e(
|
|
2782
|
-
() =>
|
|
2789
|
+
() => D(),
|
|
2783
2790
|
() => {
|
|
2784
2791
|
const b = w(), Y = b.some((_) => _.trigger === "change"), y = b.some((_) => _.trigger === "blur");
|
|
2785
2792
|
Y ? f("change").catch(() => {
|
|
@@ -2807,40 +2814,40 @@ const Wa = /* @__PURE__ */ ue({
|
|
|
2807
2814
|
});
|
|
2808
2815
|
}), nt(() => {
|
|
2809
2816
|
l.prop && e && e.unregisterFormItem(l.prop);
|
|
2810
|
-
}),
|
|
2817
|
+
}), u({
|
|
2811
2818
|
validate: f,
|
|
2812
2819
|
resetField: ie,
|
|
2813
2820
|
clearValidate: ae,
|
|
2814
2821
|
validateState: g,
|
|
2815
2822
|
validateMessage: v
|
|
2816
|
-
}), (b, Y) => (
|
|
2823
|
+
}), (b, Y) => (c(), h("div", {
|
|
2817
2824
|
class: J(["rc-form-item", [
|
|
2818
2825
|
{
|
|
2819
2826
|
"is-error": g.value === "error",
|
|
2820
2827
|
"is-validating": g.value === "validating",
|
|
2821
2828
|
"is-required": C.value,
|
|
2822
|
-
"is-no-asterisk":
|
|
2823
|
-
"is-label-top":
|
|
2829
|
+
"is-no-asterisk": r.value,
|
|
2830
|
+
"is-label-top": E.value === "top"
|
|
2824
2831
|
}
|
|
2825
2832
|
]])
|
|
2826
2833
|
}, [
|
|
2827
|
-
t.label || b.$slots.label ? (
|
|
2834
|
+
t.label || b.$slots.label ? (c(), h("label", {
|
|
2828
2835
|
key: 0,
|
|
2829
2836
|
class: "rc-form-item__label",
|
|
2830
2837
|
style: re($.value),
|
|
2831
2838
|
for: o.value
|
|
2832
2839
|
}, [
|
|
2833
2840
|
Z(b.$slots, "label", {}, () => [
|
|
2834
|
-
t.label ? (
|
|
2841
|
+
t.label ? (c(), h("span", Ha, G(t.label), 1)) : F("", !0)
|
|
2835
2842
|
], !0)
|
|
2836
2843
|
], 12, Oa)) : F("", !0),
|
|
2837
|
-
|
|
2838
|
-
|
|
2844
|
+
N("div", Ua, [
|
|
2845
|
+
N("div", qa, [
|
|
2839
2846
|
Z(b.$slots, "default", {}, void 0, !0)
|
|
2840
2847
|
]),
|
|
2841
2848
|
X(Ye, { name: "rc-form-item-error-fade" }, {
|
|
2842
2849
|
default: oe(() => [
|
|
2843
|
-
g.value === "error" &&
|
|
2850
|
+
g.value === "error" && i.value && v.value ? (c(), h("div", Ga, G(v.value), 1)) : F("", !0)
|
|
2844
2851
|
]),
|
|
2845
2852
|
_: 1
|
|
2846
2853
|
})
|
|
@@ -2865,11 +2872,11 @@ const ut = Symbol("RECYCLE_UI_CONFIG"), ft = {
|
|
|
2865
2872
|
// 输入框设备类型默认配置
|
|
2866
2873
|
inputDeviceType: "pc"
|
|
2867
2874
|
};
|
|
2868
|
-
function ja(t,
|
|
2869
|
-
|
|
2875
|
+
function ja(t, u) {
|
|
2876
|
+
u.autoRegister !== !1 && (typeof ht == "function" && ht(t), typeof yt == "function" && yt(t), typeof gt == "function" && gt(t), typeof _t == "function" && _t(t), typeof wt == "function" && wt(t), typeof kt == "function" && kt(t), typeof St == "function" && St(t), typeof xt == "function" && xt(t), typeof $t == "function" && $t(t), typeof Mt == "function" && Mt(t), typeof Rt == "function" && Rt(t), typeof Vt == "function" && Vt(t));
|
|
2870
2877
|
}
|
|
2871
|
-
const At = (t,
|
|
2872
|
-
const l = { ...ft, ...
|
|
2878
|
+
const At = (t, u) => {
|
|
2879
|
+
const l = { ...ft, ...u || {} };
|
|
2873
2880
|
if (t.provide(l.provideKey ?? ut, l), t.config.globalProperties.$recycleUI = l, typeof window < "u" && l.iconCssUrl) {
|
|
2874
2881
|
const e = `link[rel="stylesheet"][data-rcui-icon="true"][href="${l.iconCssUrl}"]`;
|
|
2875
2882
|
if (!document.head.querySelector(e)) {
|
|
@@ -2881,8 +2888,8 @@ const At = (t, i) => {
|
|
|
2881
2888
|
}, el = { install: At };
|
|
2882
2889
|
function tl(t) {
|
|
2883
2890
|
return {
|
|
2884
|
-
install(
|
|
2885
|
-
At(
|
|
2891
|
+
install(u) {
|
|
2892
|
+
At(u, t);
|
|
2886
2893
|
}
|
|
2887
2894
|
};
|
|
2888
2895
|
}
|