@rft-rc/recycle-ui 0.0.3-rc.5 → 0.0.3-rc.6
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.d.ts.map +1 -1
- package/dist/components/button/index.vue.d.ts +4 -0
- package/dist/components/button/index.vue.d.ts.map +1 -1
- package/dist/components/calendar/index.d.ts.map +1 -1
- package/dist/components/descriptions/index.d.ts +0 -6
- package/dist/components/descriptions/index.d.ts.map +1 -1
- package/dist/components/descriptions/index.vue.d.ts +1 -1
- package/dist/components/descriptions/index.vue.d.ts.map +1 -1
- package/dist/components/descriptions/item.vue.d.ts +0 -3
- package/dist/components/descriptions/item.vue.d.ts.map +1 -1
- package/dist/components/dropdown/index.d.ts.map +1 -1
- package/dist/components/dropdown/index.vue.d.ts.map +1 -1
- package/dist/components/form/index.d.ts +8 -0
- package/dist/components/form/index.d.ts.map +1 -0
- package/dist/components/form/index.vue.d.ts +76 -0
- package/dist/components/form/index.vue.d.ts.map +1 -0
- package/dist/components/form/item.vue.d.ts +49 -0
- package/dist/components/form/item.vue.d.ts.map +1 -0
- package/dist/components/icon/index.d.ts.map +1 -1
- package/dist/components/input/index.d.ts.map +1 -1
- package/dist/components/input/index.vue.d.ts +31 -12
- package/dist/components/input/index.vue.d.ts.map +1 -1
- package/dist/components/popup/index.d.ts.map +1 -1
- package/dist/components/popup/index.vue.d.ts.map +1 -1
- package/dist/components/search-area/index.vue.d.ts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +2072 -1598
- package/dist/index.mjs.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +15 -4
package/dist/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
const
|
|
1
|
+
import { defineComponent as ue, inject as be, computed as B, onMounted as Je, createElementBlock as h, openBlock as u, normalizeStyle as re, normalizeClass as J, createCommentVNode as F, toDisplayString as G, renderSlot as Z, Fragment as de, createBlock as se, createTextVNode as Se, createElementVNode as P, ref as W, watchEffect as Et, provide as Ce, renderList as ye, onUnmounted as tt, Teleport as dt, createVNode as X, Transition as Ne, withCtx as oe, createApp as Pt, reactive as Nt, TransitionGroup as zt, render as It, watch as _e, withModifiers as Ae, unref as ne, nextTick as ze, withDirectives as Tt, vModelText as Ft, useSlots as Yt, resolveDynamicComponent as pt } from "vue";
|
|
2
|
+
const Lt = {
|
|
3
3
|
key: 0,
|
|
4
4
|
class: "rc-icon__unicode"
|
|
5
|
-
},
|
|
5
|
+
}, Wt = /* @__PURE__ */ ue({
|
|
6
6
|
name: "rc-icon",
|
|
7
7
|
__name: "index",
|
|
8
8
|
props: {
|
|
@@ -12,52 +12,52 @@ const Yt = {
|
|
|
12
12
|
spin: { type: Boolean, default: !1 },
|
|
13
13
|
code: { default: "" }
|
|
14
14
|
},
|
|
15
|
-
setup(
|
|
16
|
-
const
|
|
17
|
-
fontSize:
|
|
18
|
-
color:
|
|
15
|
+
setup(t) {
|
|
16
|
+
const i = t, l = be(ut, {}), e = B(() => (l == null ? void 0 : l.iconClass) || "iconfont"), g = B(() => i.name || ""), f = B(() => typeof i.size == "number" ? `${i.size}px` : i.size || "16px"), $ = B(() => ({
|
|
17
|
+
fontSize: f.value,
|
|
18
|
+
color: i.color || void 0,
|
|
19
19
|
lineHeight: 1,
|
|
20
|
-
fontFamily: (
|
|
21
|
-
})),
|
|
22
|
-
const
|
|
23
|
-
if (
|
|
24
|
-
if (typeof
|
|
25
|
-
return String.fromCharCode(
|
|
26
|
-
const
|
|
27
|
-
return Number.isNaN(
|
|
20
|
+
fontFamily: (l == null ? void 0 : l.iconClass) || "iconfont"
|
|
21
|
+
})), o = B(() => {
|
|
22
|
+
const r = i.code;
|
|
23
|
+
if (r == null || r === "" || r === 0) return "";
|
|
24
|
+
if (typeof r == "number")
|
|
25
|
+
return String.fromCharCode(r);
|
|
26
|
+
const m = String(r).replace(/^0x/i, ""), N = parseInt(m, 16);
|
|
27
|
+
return Number.isNaN(N) ? "" : String.fromCharCode(N);
|
|
28
28
|
});
|
|
29
|
-
return
|
|
29
|
+
return Je(() => {
|
|
30
30
|
if (typeof window > "u") return;
|
|
31
|
-
const
|
|
32
|
-
if (!
|
|
33
|
-
const
|
|
34
|
-
if (!document.head.querySelector(
|
|
35
|
-
const
|
|
36
|
-
|
|
31
|
+
const r = l && l.iconCssUrl || ft.iconCssUrl;
|
|
32
|
+
if (!r) return;
|
|
33
|
+
const m = `link[rel="stylesheet"][data-rcui-icon="true"][href="${r}"]`;
|
|
34
|
+
if (!document.head.querySelector(m)) {
|
|
35
|
+
const x = document.createElement("link");
|
|
36
|
+
x.rel = "stylesheet", x.href = r, x.setAttribute("data-rcui-icon", "true"), document.head.appendChild(x);
|
|
37
37
|
}
|
|
38
|
-
}), (
|
|
39
|
-
class:
|
|
40
|
-
style:
|
|
38
|
+
}), (r, m) => (u(), h("i", {
|
|
39
|
+
class: J(["rc-icon", [e.value, g.value, { "rc-icon--spin": t.spin }]]),
|
|
40
|
+
style: re($.value),
|
|
41
41
|
"aria-hidden": "true"
|
|
42
42
|
}, [
|
|
43
|
-
|
|
43
|
+
o.value ? (u(), h("span", Lt, G(o.value), 1)) : F("", !0)
|
|
44
44
|
], 6));
|
|
45
45
|
}
|
|
46
|
-
}),
|
|
47
|
-
const
|
|
48
|
-
for (const [
|
|
49
|
-
|
|
50
|
-
return
|
|
51
|
-
},
|
|
46
|
+
}), ce = (t, i) => {
|
|
47
|
+
const l = t.__vccOpts || t;
|
|
48
|
+
for (const [e, g] of i)
|
|
49
|
+
l[e] = g;
|
|
50
|
+
return l;
|
|
51
|
+
}, te = /* @__PURE__ */ ce(Wt, [["__scopeId", "data-v-3857a892"]]), Ot = ["disabled", "type"], Ht = {
|
|
52
52
|
key: 0,
|
|
53
53
|
class: "rc-button__spinner"
|
|
54
|
-
},
|
|
54
|
+
}, Ut = {
|
|
55
55
|
key: 0,
|
|
56
56
|
class: "rc-button__icon rc-button__icon--prefix"
|
|
57
|
-
},
|
|
57
|
+
}, qt = {
|
|
58
58
|
key: 2,
|
|
59
59
|
class: "rc-button__icon rc-button__icon--suffix"
|
|
60
|
-
},
|
|
60
|
+
}, Gt = /* @__PURE__ */ ue({
|
|
61
61
|
__name: "index",
|
|
62
62
|
props: {
|
|
63
63
|
type: { default: "default" },
|
|
@@ -69,100 +69,106 @@ const Yt = {
|
|
|
69
69
|
disabled: { type: Boolean, default: !1 },
|
|
70
70
|
loading: { type: Boolean, default: !1 },
|
|
71
71
|
preIcon: { default: "" },
|
|
72
|
-
suffixIcon: { default: "" }
|
|
72
|
+
suffixIcon: { default: "" },
|
|
73
|
+
formType: { default: void 0 }
|
|
73
74
|
},
|
|
74
75
|
emits: ["click"],
|
|
75
|
-
setup(
|
|
76
|
-
const
|
|
77
|
-
!
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
76
|
+
setup(t, { emit: i }) {
|
|
77
|
+
const l = t, e = i, g = be("rcFormActions", void 0), f = B(() => l.formType === "submit" ? "submit" : l.formType === "reset" ? "reset" : "button"), $ = (r) => {
|
|
78
|
+
if (!(l.disabled || l.loading)) {
|
|
79
|
+
if (l.formType && g)
|
|
80
|
+
if (l.formType === "submit") {
|
|
81
|
+
r.preventDefault(), g.submit();
|
|
82
|
+
return;
|
|
83
|
+
} else l.formType === "button" ? (r.preventDefault(), g.submit()) : l.formType === "reset" && (r.preventDefault(), g.reset());
|
|
84
|
+
e("click", r);
|
|
85
|
+
}
|
|
86
|
+
}, o = B(() => {
|
|
87
|
+
const r = l.round;
|
|
88
|
+
return typeof r == "boolean" ? r ? "999px" : "6px" : typeof r == "number" ? `${r}px` : String(r);
|
|
81
89
|
});
|
|
82
|
-
return (
|
|
83
|
-
class:
|
|
84
|
-
style:
|
|
85
|
-
disabled:
|
|
86
|
-
|
|
90
|
+
return (r, m) => (u(), h("button", {
|
|
91
|
+
class: J(["rc-button", [`rc-button--${t.type}`, `rc-button--${t.size}`, t.mode ? `rc-button--${t.mode}` : "", { "is-block": t.block, "is-disabled": t.disabled, "is-loading": t.loading }]]),
|
|
92
|
+
style: re({ borderRadius: o.value }),
|
|
93
|
+
disabled: t.disabled || t.loading,
|
|
94
|
+
type: f.value,
|
|
95
|
+
onClick: $
|
|
87
96
|
}, [
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
97
|
+
t.loading ? (u(), h("span", Ht)) : (u(), h(de, { key: 1 }, [
|
|
98
|
+
t.preIcon || r.$slots.preIcon ? (u(), h("span", Ut, [
|
|
99
|
+
Z(r.$slots, "preIcon", {}, () => [
|
|
100
|
+
t.preIcon ? (u(), se(te, {
|
|
92
101
|
key: 0,
|
|
93
|
-
name:
|
|
94
|
-
}, null, 8, ["name"])) :
|
|
102
|
+
name: t.preIcon
|
|
103
|
+
}, null, 8, ["name"])) : F("", !0)
|
|
95
104
|
], !0)
|
|
96
|
-
])) :
|
|
105
|
+
])) : F("", !0)
|
|
97
106
|
], 64)),
|
|
98
|
-
|
|
99
|
-
|
|
107
|
+
Z(r.$slots, "default", {}, () => [
|
|
108
|
+
Se(G(t.label), 1)
|
|
100
109
|
], !0),
|
|
101
|
-
!
|
|
102
|
-
|
|
103
|
-
|
|
110
|
+
!t.loading && (t.suffixIcon || r.$slots.suffixIcon) ? (u(), h("span", qt, [
|
|
111
|
+
Z(r.$slots, "suffixIcon", {}, () => [
|
|
112
|
+
t.suffixIcon ? (u(), se(te, {
|
|
104
113
|
key: 0,
|
|
105
|
-
name:
|
|
106
|
-
}, null, 8, ["name"])) :
|
|
114
|
+
name: t.suffixIcon
|
|
115
|
+
}, null, 8, ["name"])) : F("", !0)
|
|
107
116
|
], !0)
|
|
108
|
-
])) :
|
|
109
|
-
], 14,
|
|
117
|
+
])) : F("", !0)
|
|
118
|
+
], 14, Ot));
|
|
110
119
|
}
|
|
111
|
-
}),
|
|
112
|
-
|
|
113
|
-
function
|
|
114
|
-
return e.component(
|
|
120
|
+
}), $e = /* @__PURE__ */ ce(Gt, [["__scopeId", "data-v-2f5f6c24"]]);
|
|
121
|
+
$e && ($e.name = "rc-button");
|
|
122
|
+
function ht(t) {
|
|
123
|
+
return $e && t.component($e.name || "rc-button", $e), t;
|
|
115
124
|
}
|
|
116
|
-
const
|
|
125
|
+
const Kt = { class: "rc-desc-item__value" }, jt = /* @__PURE__ */ ue({
|
|
117
126
|
name: "rc-descriptions-item",
|
|
118
127
|
__name: "item",
|
|
119
128
|
props: {
|
|
120
129
|
label: { default: "" },
|
|
121
130
|
value: { default: "" },
|
|
122
131
|
labelWidth: { default: "" },
|
|
123
|
-
span: { default: 1 }
|
|
124
|
-
labelPosition: { default: void 0 }
|
|
132
|
+
span: { default: 1 }
|
|
125
133
|
},
|
|
126
|
-
setup(
|
|
127
|
-
const
|
|
128
|
-
|
|
129
|
-
const
|
|
130
|
-
const
|
|
131
|
-
return Math.min(
|
|
132
|
-
}),
|
|
133
|
-
const
|
|
134
|
-
if (!
|
|
135
|
-
const
|
|
136
|
-
return `calc((100% - ${
|
|
137
|
-
}),
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
const b = typeof (y == null ? void 0 : y.value) == "string" ? y.value : y, g = r.labelWidth !== "" ? r.labelWidth : b || "";
|
|
141
|
-
return g ? { width: typeof g == "number" ? `${g}px` : String(g), flex: "0 0 auto" } : {};
|
|
134
|
+
setup(t) {
|
|
135
|
+
const i = t;
|
|
136
|
+
be("rcDescItemWidth", void 0), be("rcDescSingleWidth", ""), be("rcDescGap", "0px");
|
|
137
|
+
const l = be("rcDescGapPx", 0), e = be("rcDescColCount", 1), g = be("rcDescLabelWidth", ""), f = be("rcDescLabelPosition", "left"), $ = B(() => (typeof (f == null ? void 0 : f.value) == "string" ? f.value : f) || "left"), o = B(() => {
|
|
138
|
+
const N = typeof i.span == "string" ? parseInt(i.span, 10) : i.span, x = typeof (e == null ? void 0 : e.value) == "number" ? e.value : e, w = !Number.isNaN(N) && N > 0 ? N : 1;
|
|
139
|
+
return Math.min(w, x || 1);
|
|
140
|
+
}), r = B(() => {
|
|
141
|
+
const N = typeof (e == null ? void 0 : e.value) == "number" ? e.value : e, x = typeof (l == null ? void 0 : l.value) == "number" ? l.value : l, w = o.value;
|
|
142
|
+
if (!N || N <= 1 || w >= N) return "100%";
|
|
143
|
+
const D = (N - 1) * x, H = (w - 1) * x;
|
|
144
|
+
return `calc((100% - ${D}px) * ${w} / ${N} + ${H}px)`;
|
|
145
|
+
}), m = B(() => {
|
|
146
|
+
const N = typeof (g == null ? void 0 : g.value) == "string" ? g.value : g, x = i.labelWidth !== "" ? i.labelWidth : N || "";
|
|
147
|
+
return x ? { width: typeof x == "number" ? `${x}px` : String(x), flex: "0 0 auto" } : {};
|
|
142
148
|
});
|
|
143
|
-
return (
|
|
144
|
-
class:
|
|
145
|
-
style:
|
|
149
|
+
return (N, x) => (u(), h("div", {
|
|
150
|
+
class: J(["rc-desc-item", { "rc-desc-item--label-top": $.value === "top" }]),
|
|
151
|
+
style: re({ width: r.value, flex: `0 0 ${r.value}` })
|
|
146
152
|
}, [
|
|
147
|
-
|
|
153
|
+
P("div", {
|
|
148
154
|
class: "rc-desc-item__label",
|
|
149
|
-
style:
|
|
155
|
+
style: re(m.value)
|
|
150
156
|
}, [
|
|
151
|
-
|
|
152
|
-
|
|
157
|
+
Z(N.$slots, "label", {}, () => [
|
|
158
|
+
Se(G(t.label), 1)
|
|
153
159
|
], !0)
|
|
154
160
|
], 4),
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
161
|
+
P("div", Kt, [
|
|
162
|
+
Z(N.$slots, "default", {}, () => [
|
|
163
|
+
Se(G(t.value), 1)
|
|
158
164
|
], !0)
|
|
159
165
|
])
|
|
160
166
|
], 6));
|
|
161
167
|
}
|
|
162
|
-
}),
|
|
168
|
+
}), Ke = /* @__PURE__ */ ce(jt, [["__scopeId", "data-v-aeee0f24"]]), Jt = { class: "rc-descriptions" }, Qt = {
|
|
163
169
|
key: 0,
|
|
164
170
|
class: "rc-descriptions__title"
|
|
165
|
-
},
|
|
171
|
+
}, Xt = /* @__PURE__ */ ue({
|
|
166
172
|
name: "rc-descriptions",
|
|
167
173
|
__name: "index",
|
|
168
174
|
props: {
|
|
@@ -174,69 +180,67 @@ const Ut = { class: "rc-desc-item__value" }, jt = /* @__PURE__ */ se({
|
|
|
174
180
|
data: { default: () => [] },
|
|
175
181
|
keyMap: {}
|
|
176
182
|
},
|
|
177
|
-
setup(
|
|
178
|
-
const
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
if (h <= 1)
|
|
187
|
-
_.value = "100%", v.value = "100%";
|
|
183
|
+
setup(t) {
|
|
184
|
+
const i = t, l = W(null), e = B(() => typeof i.gap == "number" ? `${i.gap}px` : String(i.gap)), g = B(() => {
|
|
185
|
+
const m = typeof i.column == "string" ? Number.parseInt(i.column, 10) : i.column ?? 1;
|
|
186
|
+
return !Number.isNaN(m) && m > 0 ? m : 1;
|
|
187
|
+
}), f = W("100%"), $ = W("100%");
|
|
188
|
+
Et(() => {
|
|
189
|
+
const m = g.value;
|
|
190
|
+
if (m <= 1)
|
|
191
|
+
f.value = "100%", $.value = "100%";
|
|
188
192
|
else {
|
|
189
|
-
const
|
|
190
|
-
|
|
193
|
+
const N = typeof i.gap == "number" ? i.gap : parseFloat(String(i.gap)) || 0, w = `calc((100% - ${(m - 1) * N}px) / ${m})`;
|
|
194
|
+
$.value = w, f.value = w;
|
|
191
195
|
}
|
|
192
|
-
}),
|
|
193
|
-
const
|
|
194
|
-
|
|
195
|
-
const
|
|
196
|
-
var
|
|
197
|
-
const
|
|
198
|
-
return (
|
|
199
|
-
label:
|
|
200
|
-
value:
|
|
196
|
+
}), Ce("rcDescItemWidth", f), Ce("rcDescSingleWidth", $), Ce("rcDescColCount", g), Ce("rcDescGapPx", B(() => typeof i.gap == "number" ? i.gap : parseFloat(String(i.gap)) || 0));
|
|
197
|
+
const o = B(() => i.labelWidth === "" || i.labelWidth === void 0 ? "" : typeof i.labelWidth == "number" ? `${i.labelWidth}px` : String(i.labelWidth));
|
|
198
|
+
Ce("rcDescLabelWidth", o), Ce("rcDescGap", B(() => typeof i.gap == "number" ? `${i.gap}px` : String(i.gap))), Ce("rcDescLabelPosition", B(() => i.labelPosition || "left"));
|
|
199
|
+
const r = B(() => {
|
|
200
|
+
var x, w, D;
|
|
201
|
+
const m = ((x = i.keyMap) == null ? void 0 : x.key) ?? "label", N = ((w = i.keyMap) == null ? void 0 : w.value) ?? "value";
|
|
202
|
+
return (D = i.data) != null && D.length ? i.data.map((H) => ({
|
|
203
|
+
label: H == null ? void 0 : H[m],
|
|
204
|
+
value: H == null ? void 0 : H[N]
|
|
201
205
|
})) : [];
|
|
202
206
|
});
|
|
203
|
-
return (
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
+
return (m, N) => (u(), h("div", Jt, [
|
|
208
|
+
m.$slots.title || t.title ? (u(), h("div", Qt, [
|
|
209
|
+
Z(m.$slots, "title", {}, () => [
|
|
210
|
+
Se(G(t.title), 1)
|
|
207
211
|
], !0)
|
|
208
|
-
])) :
|
|
209
|
-
|
|
212
|
+
])) : F("", !0),
|
|
213
|
+
P("div", {
|
|
210
214
|
class: "rc-descriptions__body",
|
|
211
|
-
style:
|
|
215
|
+
style: re({ gap: e.value }),
|
|
212
216
|
ref_key: "wrapEl",
|
|
213
|
-
ref:
|
|
217
|
+
ref: l
|
|
214
218
|
}, [
|
|
215
|
-
|
|
216
|
-
key:
|
|
217
|
-
label:
|
|
218
|
-
value:
|
|
219
|
-
"label-width":
|
|
220
|
-
}, null, 8, ["label", "value", "label-width"]))), 128)) :
|
|
219
|
+
r.value.length ? (u(!0), h(de, { key: 0 }, ye(r.value, (x, w) => (u(), se(Ke, {
|
|
220
|
+
key: w,
|
|
221
|
+
label: x.label,
|
|
222
|
+
value: x.value,
|
|
223
|
+
"label-width": t.labelWidth
|
|
224
|
+
}, null, 8, ["label", "value", "label-width"]))), 128)) : Z(m.$slots, "default", { key: 1 }, void 0, !0)
|
|
221
225
|
], 4)
|
|
222
226
|
]));
|
|
223
227
|
}
|
|
224
|
-
}),
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
function
|
|
228
|
-
return
|
|
228
|
+
}), Qe = /* @__PURE__ */ ce(Xt, [["__scopeId", "data-v-2b1a493d"]]);
|
|
229
|
+
Qe.name = "rc-descriptions";
|
|
230
|
+
Ke.name = "rc-descriptions-item";
|
|
231
|
+
function yt(t) {
|
|
232
|
+
return t.component(Qe.name, Qe), t.component("RcDescriptions", Qe), t.component(Ke.name, Ke), t.component("RcDescriptionsItem", Ke), t;
|
|
229
233
|
}
|
|
230
|
-
const
|
|
234
|
+
const Qa = Qe, Xa = Ke, Zt = { class: "rc-card__title" }, en = { class: "rc-card__title-text" }, tn = {
|
|
231
235
|
key: 0,
|
|
232
236
|
class: "rc-card__status"
|
|
233
|
-
},
|
|
237
|
+
}, nn = {
|
|
234
238
|
key: 1,
|
|
235
239
|
class: "rc-card__divider"
|
|
236
|
-
},
|
|
240
|
+
}, an = {
|
|
237
241
|
key: 2,
|
|
238
242
|
class: "rc-card__action"
|
|
239
|
-
},
|
|
243
|
+
}, ln = /* @__PURE__ */ ue({
|
|
240
244
|
name: "rc-card",
|
|
241
245
|
__name: "index",
|
|
242
246
|
props: {
|
|
@@ -253,85 +257,85 @@ const za = We, Ya = Le, Jt = { class: "rc-card__title" }, Qt = { class: "rc-card
|
|
|
253
257
|
width: { default: "100%" },
|
|
254
258
|
height: { default: "" }
|
|
255
259
|
},
|
|
256
|
-
setup(
|
|
257
|
-
const
|
|
258
|
-
const
|
|
260
|
+
setup(t) {
|
|
261
|
+
const i = t, l = B(() => {
|
|
262
|
+
const o = typeof i.round == "boolean" ? i.round ? "12px" : "0" : typeof i.round == "number" ? `${i.round}px` : String(i.round);
|
|
259
263
|
return {
|
|
260
|
-
backgroundColor:
|
|
261
|
-
borderRadius:
|
|
262
|
-
boxShadow:
|
|
263
|
-
width:
|
|
264
|
-
height:
|
|
264
|
+
backgroundColor: i.color || "var(--rc-white)",
|
|
265
|
+
borderRadius: o,
|
|
266
|
+
boxShadow: $(i.elevation),
|
|
267
|
+
width: f(i.width),
|
|
268
|
+
height: f(i.height)
|
|
265
269
|
};
|
|
266
|
-
}),
|
|
267
|
-
() => typeof
|
|
270
|
+
}), e = B(() => i.padding || "16px"), g = B(
|
|
271
|
+
() => typeof i.gap == "number" ? `${i.gap}px` : String(i.gap)
|
|
268
272
|
);
|
|
269
|
-
function
|
|
270
|
-
return
|
|
271
|
-
}
|
|
272
|
-
function
|
|
273
|
-
if (!
|
|
274
|
-
const
|
|
275
|
-
return `0 ${Math.round(
|
|
276
|
-
|
|
277
|
-
)}px ${Math.round(
|
|
278
|
-
}
|
|
279
|
-
return (
|
|
280
|
-
class:
|
|
281
|
-
style:
|
|
273
|
+
function f(o) {
|
|
274
|
+
return o == null || o === "" ? "" : typeof o == "number" ? `${o}px` : String(o);
|
|
275
|
+
}
|
|
276
|
+
function $(o) {
|
|
277
|
+
if (!o || o <= 0) return "none";
|
|
278
|
+
const r = 4 * o;
|
|
279
|
+
return `0 ${Math.round(r / 2)}px ${r}px rgba(0,0,0,0.06), 0 ${Math.round(
|
|
280
|
+
r / 4
|
|
281
|
+
)}px ${Math.round(r / 2)}px rgba(0,0,0,0.04)`;
|
|
282
|
+
}
|
|
283
|
+
return (o, r) => (u(), h("div", {
|
|
284
|
+
class: J(["rc-card", [{ "rc-card--bordered": t.bordered }]]),
|
|
285
|
+
style: re(l.value)
|
|
282
286
|
}, [
|
|
283
|
-
|
|
287
|
+
o.$slots.title || t.title || o.$slots.status || t.status ? (u(), h("div", {
|
|
284
288
|
key: 0,
|
|
285
289
|
class: "rc-card__top",
|
|
286
|
-
style:
|
|
290
|
+
style: re({ backgroundColor: t.topBgColor || "rgba(29, 133, 252, 0.05)" })
|
|
287
291
|
}, [
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
292
|
+
P("div", Zt, [
|
|
293
|
+
Z(o.$slots, "title", {}, () => [
|
|
294
|
+
P("span", en, G(t.title), 1)
|
|
291
295
|
], !0)
|
|
292
296
|
]),
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
297
|
+
o.$slots.status || t.status ? (u(), h("div", tn, [
|
|
298
|
+
Z(o.$slots, "status", {}, () => [
|
|
299
|
+
P("span", {
|
|
296
300
|
class: "rc-card__status-text",
|
|
297
|
-
style:
|
|
298
|
-
},
|
|
301
|
+
style: re({ color: t.statusColor || "var(--rc-primary)" })
|
|
302
|
+
}, G(t.status), 5)
|
|
299
303
|
], !0)
|
|
300
|
-
])) :
|
|
301
|
-
], 4)) :
|
|
302
|
-
|
|
304
|
+
])) : F("", !0)
|
|
305
|
+
], 4)) : F("", !0),
|
|
306
|
+
P("div", {
|
|
303
307
|
class: "rc-card__body",
|
|
304
|
-
style:
|
|
308
|
+
style: re({ padding: e.value, gap: g.value })
|
|
305
309
|
}, [
|
|
306
|
-
|
|
307
|
-
|
|
310
|
+
Z(o.$slots, "content", {}, () => [
|
|
311
|
+
Z(o.$slots, "default", {}, void 0, !0)
|
|
308
312
|
], !0)
|
|
309
313
|
], 4),
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
])) :
|
|
314
|
+
o.$slots.action ? (u(), h("div", nn)) : F("", !0),
|
|
315
|
+
o.$slots.action ? (u(), h("div", an, [
|
|
316
|
+
Z(o.$slots, "action", {}, void 0, !0)
|
|
317
|
+
])) : F("", !0)
|
|
314
318
|
], 6));
|
|
315
319
|
}
|
|
316
|
-
}),
|
|
317
|
-
|
|
318
|
-
const
|
|
319
|
-
function
|
|
320
|
-
return
|
|
320
|
+
}), st = /* @__PURE__ */ ce(ln, [["__scopeId", "data-v-a7b95214"]]);
|
|
321
|
+
st.name = "rc-card";
|
|
322
|
+
const on = "RcCard";
|
|
323
|
+
function gt(t) {
|
|
324
|
+
return t.component(st.name, st), t.component(on, st), t;
|
|
321
325
|
}
|
|
322
|
-
const
|
|
326
|
+
const rn = {
|
|
323
327
|
key: 0,
|
|
324
328
|
class: "rc-toast__mask"
|
|
325
|
-
},
|
|
329
|
+
}, sn = { class: "rc-toast__content" }, un = {
|
|
326
330
|
key: 0,
|
|
327
331
|
class: "rc-toast__spinner"
|
|
328
|
-
},
|
|
332
|
+
}, cn = {
|
|
329
333
|
key: 1,
|
|
330
334
|
class: "rc-toast__icon rc-toast__icon--success"
|
|
331
|
-
},
|
|
335
|
+
}, dn = {
|
|
332
336
|
key: 2,
|
|
333
337
|
class: "rc-toast__icon rc-toast__icon--fail"
|
|
334
|
-
},
|
|
338
|
+
}, fn = { class: "rc-toast__text" }, vn = /* @__PURE__ */ ue({
|
|
335
339
|
__name: "index",
|
|
336
340
|
props: {
|
|
337
341
|
message: { default: "" },
|
|
@@ -340,155 +344,155 @@ const an = {
|
|
|
340
344
|
mask: { type: Boolean, default: !1 },
|
|
341
345
|
onAfterLeave: {}
|
|
342
346
|
},
|
|
343
|
-
setup(
|
|
344
|
-
const
|
|
345
|
-
let
|
|
346
|
-
function
|
|
347
|
-
|
|
348
|
-
}
|
|
349
|
-
function
|
|
350
|
-
|
|
351
|
-
}
|
|
352
|
-
return
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
},
|
|
356
|
-
}),
|
|
357
|
-
|
|
358
|
-
}), (
|
|
359
|
-
(
|
|
360
|
-
|
|
347
|
+
setup(t, { expose: i }) {
|
|
348
|
+
const l = t, e = W(!0);
|
|
349
|
+
let g;
|
|
350
|
+
function f() {
|
|
351
|
+
g && (clearTimeout(g), g = null);
|
|
352
|
+
}
|
|
353
|
+
function $() {
|
|
354
|
+
f(), e.value = !1;
|
|
355
|
+
}
|
|
356
|
+
return i({ close: $ }), Je(() => {
|
|
357
|
+
l.duration && l.duration > 0 && (g = setTimeout(() => {
|
|
358
|
+
$();
|
|
359
|
+
}, l.duration));
|
|
360
|
+
}), tt(() => {
|
|
361
|
+
f();
|
|
362
|
+
}), (o, r) => (u(), h(de, null, [
|
|
363
|
+
(u(), se(dt, { to: "body" }, [
|
|
364
|
+
X(Ne, {
|
|
361
365
|
name: "rc-toast-fade",
|
|
362
|
-
onAfterLeave:
|
|
366
|
+
onAfterLeave: t.onAfterLeave
|
|
363
367
|
}, {
|
|
364
|
-
default:
|
|
365
|
-
|
|
368
|
+
default: oe(() => [
|
|
369
|
+
e.value ? (u(), h("div", {
|
|
366
370
|
key: 0,
|
|
367
|
-
class:
|
|
371
|
+
class: J(["rc-toast", [`rc-toast--${t.type}`]])
|
|
368
372
|
}, [
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
+
t.mask ? (u(), h("div", rn)) : F("", !0),
|
|
374
|
+
P("div", sn, [
|
|
375
|
+
t.type === "loading" ? (u(), h("div", un)) : t.type === "success" ? (u(), h("div", cn)) : t.type === "fail" ? (u(), h("div", dn)) : F("", !0),
|
|
376
|
+
P("div", fn, G(t.message), 1)
|
|
373
377
|
])
|
|
374
|
-
], 2)) :
|
|
378
|
+
], 2)) : F("", !0)
|
|
375
379
|
]),
|
|
376
380
|
_: 1
|
|
377
381
|
}, 8, ["onAfterLeave"])
|
|
378
382
|
])),
|
|
379
|
-
|
|
383
|
+
Z(o.$slots, "default", {}, void 0, !0)
|
|
380
384
|
], 64));
|
|
381
385
|
}
|
|
382
|
-
}),
|
|
383
|
-
let
|
|
384
|
-
function
|
|
385
|
-
|
|
386
|
+
}), it = /* @__PURE__ */ ce(vn, [["__scopeId", "data-v-d234c9c5"]]);
|
|
387
|
+
let He = null, je = null;
|
|
388
|
+
function bt() {
|
|
389
|
+
He && (He.unmount(), He = null), je && (document.body.removeChild(je), je = null);
|
|
386
390
|
}
|
|
387
|
-
function
|
|
388
|
-
const
|
|
389
|
-
|
|
390
|
-
const
|
|
391
|
-
message:
|
|
392
|
-
type:
|
|
393
|
-
duration:
|
|
394
|
-
mask:
|
|
391
|
+
function Za(t) {
|
|
392
|
+
const i = typeof t == "string" ? { message: t } : t || {};
|
|
393
|
+
bt(), je = document.createElement("div"), document.body.appendChild(je);
|
|
394
|
+
const l = {
|
|
395
|
+
message: i.message,
|
|
396
|
+
type: i.type ?? "text",
|
|
397
|
+
duration: i.duration ?? 2e3,
|
|
398
|
+
mask: i.mask ?? !1,
|
|
395
399
|
onAfterLeave: () => {
|
|
396
|
-
var
|
|
397
|
-
|
|
400
|
+
var e;
|
|
401
|
+
bt(), (e = i.onClose) == null || e.call(i);
|
|
398
402
|
}
|
|
399
403
|
};
|
|
400
|
-
return
|
|
401
|
-
close:
|
|
404
|
+
return He = Pt(it, l), He.mount(je), {
|
|
405
|
+
close: mn
|
|
402
406
|
};
|
|
403
407
|
}
|
|
404
|
-
function
|
|
405
|
-
var
|
|
406
|
-
|
|
408
|
+
function mn() {
|
|
409
|
+
var t, i, l;
|
|
410
|
+
He && ((l = (i = (t = He._instance) == null ? void 0 : t.exposed) == null ? void 0 : i.close) == null || l.call(i));
|
|
407
411
|
}
|
|
408
|
-
|
|
409
|
-
function
|
|
410
|
-
return
|
|
412
|
+
it.name = "rc-toast";
|
|
413
|
+
function _t(t) {
|
|
414
|
+
return t.component(it.name, it), t;
|
|
411
415
|
}
|
|
412
|
-
const
|
|
416
|
+
const pn = {
|
|
413
417
|
class: "rc-message",
|
|
414
418
|
role: "alert",
|
|
415
419
|
"aria-live": "polite"
|
|
416
|
-
},
|
|
420
|
+
}, hn = { class: "rc-message__content" }, yn = /* @__PURE__ */ ue({
|
|
417
421
|
__name: "index",
|
|
418
|
-
setup(
|
|
419
|
-
const
|
|
420
|
-
let
|
|
421
|
-
function
|
|
422
|
-
const
|
|
423
|
-
|
|
424
|
-
}
|
|
425
|
-
function
|
|
426
|
-
const
|
|
427
|
-
return
|
|
428
|
-
}
|
|
429
|
-
return
|
|
430
|
-
|
|
422
|
+
setup(t, { expose: i }) {
|
|
423
|
+
const l = Nt([]);
|
|
424
|
+
let e = 1;
|
|
425
|
+
function g($) {
|
|
426
|
+
const o = l.findIndex((r) => r.id === $);
|
|
427
|
+
o >= 0 && l.splice(o, 1);
|
|
428
|
+
}
|
|
429
|
+
function f($, o, r) {
|
|
430
|
+
const m = e++;
|
|
431
|
+
return l.push({ id: m, type: $, content: o, duration: r }), r > 0 && window.setTimeout(() => g(m), r), m;
|
|
432
|
+
}
|
|
433
|
+
return i({ add: f, remove: g }), ($, o) => (u(), h("div", pn, [
|
|
434
|
+
X(zt, {
|
|
431
435
|
name: "rc-message-fade",
|
|
432
436
|
tag: "div"
|
|
433
437
|
}, {
|
|
434
|
-
default:
|
|
435
|
-
(
|
|
436
|
-
key:
|
|
437
|
-
class:
|
|
438
|
+
default: oe(() => [
|
|
439
|
+
(u(!0), h(de, null, ye(l, (r) => (u(), h("div", {
|
|
440
|
+
key: r.id,
|
|
441
|
+
class: J(["rc-message__item", `rc-message--${r.type}`])
|
|
438
442
|
}, [
|
|
439
|
-
|
|
443
|
+
P("span", hn, G(r.content), 1)
|
|
440
444
|
], 2))), 128))
|
|
441
445
|
]),
|
|
442
446
|
_: 1
|
|
443
447
|
})
|
|
444
448
|
]));
|
|
445
449
|
}
|
|
446
|
-
}),
|
|
447
|
-
let
|
|
448
|
-
function
|
|
449
|
-
var
|
|
450
|
-
if (
|
|
451
|
-
|
|
452
|
-
const
|
|
453
|
-
|
|
450
|
+
}), gn = /* @__PURE__ */ ce(yn, [["__scopeId", "data-v-87811df0"]]);
|
|
451
|
+
let Pe = null, Ee = null;
|
|
452
|
+
function bn() {
|
|
453
|
+
var i;
|
|
454
|
+
if (Pe && Ee) return;
|
|
455
|
+
Pe = document.createElement("div"), document.body.appendChild(Pe);
|
|
456
|
+
const t = X(gn, {});
|
|
457
|
+
It(t, Pe), Ee = (i = t.component) == null ? void 0 : i.exposed;
|
|
454
458
|
}
|
|
455
|
-
function
|
|
456
|
-
var
|
|
457
|
-
|
|
458
|
-
const
|
|
459
|
-
return (
|
|
459
|
+
function Ue(t, i, l) {
|
|
460
|
+
var g;
|
|
461
|
+
bn();
|
|
462
|
+
const e = typeof l == "number" ? l : t === "loading" ? 0 : 2e3;
|
|
463
|
+
return (g = Ee == null ? void 0 : Ee.add) == null ? void 0 : g.call(Ee, t, i, e);
|
|
460
464
|
}
|
|
461
|
-
const
|
|
462
|
-
open(
|
|
463
|
-
return
|
|
465
|
+
const _n = {
|
|
466
|
+
open(t) {
|
|
467
|
+
return Ue(t.type || "info", t.content, t.duration);
|
|
464
468
|
},
|
|
465
|
-
info(
|
|
466
|
-
return
|
|
469
|
+
info(t, i) {
|
|
470
|
+
return Ue("info", t, i);
|
|
467
471
|
},
|
|
468
|
-
success(
|
|
469
|
-
return
|
|
472
|
+
success(t, i) {
|
|
473
|
+
return Ue("success", t, i);
|
|
470
474
|
},
|
|
471
|
-
warning(
|
|
472
|
-
return
|
|
475
|
+
warning(t, i) {
|
|
476
|
+
return Ue("warning", t, i);
|
|
473
477
|
},
|
|
474
|
-
error(
|
|
475
|
-
return
|
|
478
|
+
error(t, i) {
|
|
479
|
+
return Ue("error", t, i);
|
|
476
480
|
},
|
|
477
|
-
loading(
|
|
478
|
-
return
|
|
481
|
+
loading(t, i) {
|
|
482
|
+
return Ue("loading", t, i);
|
|
479
483
|
},
|
|
480
484
|
destroy() {
|
|
481
|
-
|
|
485
|
+
Pe && (It(null, Pe), Pe.remove(), Pe = null, Ee = null);
|
|
482
486
|
}
|
|
483
487
|
};
|
|
484
|
-
function
|
|
485
|
-
return
|
|
488
|
+
function kt(t) {
|
|
489
|
+
return t.config.globalProperties.$message = _n, t;
|
|
486
490
|
}
|
|
487
|
-
|
|
488
|
-
function
|
|
489
|
-
return
|
|
491
|
+
te && (te.name = "rc-icon");
|
|
492
|
+
function wt(t) {
|
|
493
|
+
return te && (t.component(te.name || "rc-icon", te), t.component("RcIcon", te)), t;
|
|
490
494
|
}
|
|
491
|
-
const
|
|
495
|
+
const kn = { class: "rc-popup__content" }, wn = /* @__PURE__ */ ue({
|
|
492
496
|
name: "rc-popup",
|
|
493
497
|
__name: "index",
|
|
494
498
|
props: {
|
|
@@ -506,116 +510,116 @@ const gn = { class: "rc-popup__content" }, bn = /* @__PURE__ */ se({
|
|
|
506
510
|
lockScroll: { type: Boolean, default: !0 }
|
|
507
511
|
},
|
|
508
512
|
emits: ["update:modelValue", "open", "close", "click-overlay"],
|
|
509
|
-
setup(
|
|
510
|
-
const
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
(
|
|
514
|
-
|
|
513
|
+
setup(t, { expose: i, emit: l }) {
|
|
514
|
+
const e = t, g = l, f = W(), $ = W(e.modelValue);
|
|
515
|
+
let o = !1;
|
|
516
|
+
function r() {
|
|
517
|
+
o || (o = !0, document.body.style.overflow = "hidden");
|
|
518
|
+
}
|
|
519
|
+
function m() {
|
|
520
|
+
o && (o = !1, document.body.style.overflow = "");
|
|
521
|
+
}
|
|
522
|
+
_e(
|
|
523
|
+
() => e.modelValue,
|
|
524
|
+
(d) => {
|
|
525
|
+
$.value = d, d ? (g("open"), e.lockScroll && r()) : (g("close"), e.lockScroll && m());
|
|
515
526
|
},
|
|
516
527
|
{ immediate: !0 }
|
|
517
|
-
),
|
|
518
|
-
|
|
528
|
+
), _e($, (d) => {
|
|
529
|
+
d !== e.modelValue && g("update:modelValue", d);
|
|
519
530
|
});
|
|
520
|
-
const
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
h || (h = !0, document.body.style.overflow = "hidden");
|
|
524
|
-
}
|
|
525
|
-
function b() {
|
|
526
|
-
h && (h = !1, document.body.style.overflow = "");
|
|
527
|
-
}
|
|
528
|
-
function g() {
|
|
529
|
-
y("click-overlay"), t.closeOnClickOverlay && A();
|
|
531
|
+
const N = B(() => `rc-popup-slide-${e.position}`), x = B(() => ({ ...e.popupStyle || {} }));
|
|
532
|
+
function w() {
|
|
533
|
+
g("click-overlay"), e.closeOnClickOverlay && H();
|
|
530
534
|
}
|
|
531
|
-
function
|
|
532
|
-
|
|
535
|
+
function D() {
|
|
536
|
+
H();
|
|
533
537
|
}
|
|
534
|
-
function
|
|
535
|
-
|
|
538
|
+
function H() {
|
|
539
|
+
$.value = !1;
|
|
536
540
|
}
|
|
537
|
-
function
|
|
538
|
-
|
|
539
|
-
}
|
|
540
|
-
return
|
|
541
|
-
|
|
542
|
-
}),
|
|
543
|
-
open:
|
|
544
|
-
close:
|
|
545
|
-
visible:
|
|
546
|
-
}), (
|
|
547
|
-
|
|
548
|
-
default:
|
|
549
|
-
|
|
541
|
+
function T() {
|
|
542
|
+
$.value = !0;
|
|
543
|
+
}
|
|
544
|
+
return tt(() => {
|
|
545
|
+
m();
|
|
546
|
+
}), i({
|
|
547
|
+
open: T,
|
|
548
|
+
close: H,
|
|
549
|
+
visible: $
|
|
550
|
+
}), (d, ie) => (u(), se(dt, { to: "body" }, [
|
|
551
|
+
X(Ne, { name: "rc-popup-fade" }, {
|
|
552
|
+
default: oe(() => [
|
|
553
|
+
$.value && e.overlay ? (u(), h("div", {
|
|
550
554
|
key: 0,
|
|
551
|
-
class:
|
|
552
|
-
style:
|
|
553
|
-
onClick:
|
|
554
|
-
}, null, 6)) :
|
|
555
|
+
class: J(["rc-popup__overlay", { "rc-popup__overlay--transparent": e.overlayClass === "transparent" }]),
|
|
556
|
+
style: re(e.overlayStyle),
|
|
557
|
+
onClick: w
|
|
558
|
+
}, null, 6)) : F("", !0)
|
|
555
559
|
]),
|
|
556
560
|
_: 1
|
|
557
561
|
}),
|
|
558
|
-
|
|
559
|
-
default:
|
|
560
|
-
|
|
562
|
+
X(Ne, { name: N.value }, {
|
|
563
|
+
default: oe(() => [
|
|
564
|
+
$.value ? (u(), h("div", {
|
|
561
565
|
key: 0,
|
|
562
566
|
ref_key: "popupRef",
|
|
563
|
-
ref:
|
|
564
|
-
class:
|
|
565
|
-
`rc-popup--${
|
|
566
|
-
{ "rc-popup--round":
|
|
567
|
+
ref: f,
|
|
568
|
+
class: J(["rc-popup", [
|
|
569
|
+
`rc-popup--${t.position}`,
|
|
570
|
+
{ "rc-popup--round": t.round }
|
|
567
571
|
]]),
|
|
568
|
-
style:
|
|
569
|
-
onClick:
|
|
572
|
+
style: re(x.value),
|
|
573
|
+
onClick: ie[0] || (ie[0] = Ae(() => {
|
|
570
574
|
}, ["stop"]))
|
|
571
575
|
}, [
|
|
572
|
-
|
|
576
|
+
t.closeable ? (u(), h("div", {
|
|
573
577
|
key: 0,
|
|
574
|
-
class:
|
|
575
|
-
onClick:
|
|
578
|
+
class: J(["rc-popup__close", `rc-popup__close--${t.closeIconPosition}`]),
|
|
579
|
+
onClick: D
|
|
576
580
|
}, [
|
|
577
|
-
|
|
578
|
-
name:
|
|
581
|
+
X(te, {
|
|
582
|
+
name: t.closeIcon,
|
|
579
583
|
class: "rc-popup__close-icon"
|
|
580
584
|
}, null, 8, ["name"])
|
|
581
|
-
], 2)) :
|
|
582
|
-
|
|
583
|
-
|
|
585
|
+
], 2)) : F("", !0),
|
|
586
|
+
P("div", kn, [
|
|
587
|
+
Z(d.$slots, "default", {}, void 0, !0)
|
|
584
588
|
])
|
|
585
|
-
], 6)) :
|
|
589
|
+
], 6)) : F("", !0)
|
|
586
590
|
]),
|
|
587
591
|
_: 3
|
|
588
592
|
}, 8, ["name"])
|
|
589
593
|
]));
|
|
590
594
|
}
|
|
591
|
-
}),
|
|
592
|
-
|
|
593
|
-
const
|
|
594
|
-
function
|
|
595
|
-
return
|
|
595
|
+
}), Le = /* @__PURE__ */ ce(wn, [["__scopeId", "data-v-def84160"]]);
|
|
596
|
+
Le && (Le.name = "rc-popup");
|
|
597
|
+
const $n = "RcPopup";
|
|
598
|
+
function $t(t) {
|
|
599
|
+
return Le && (t.component(Le.name || "rc-popup", Le), t.component($n, Le)), t;
|
|
596
600
|
}
|
|
597
|
-
const
|
|
601
|
+
const Dn = {
|
|
598
602
|
key: 0,
|
|
599
603
|
class: "rc-calendar__header"
|
|
600
|
-
},
|
|
604
|
+
}, xn = { class: "rc-calendar__header-title" }, Cn = {
|
|
601
605
|
key: 1,
|
|
602
606
|
class: "rc-calendar__shortcuts"
|
|
603
|
-
},
|
|
607
|
+
}, Sn = { class: "rc-calendar__shortcuts-scroll" }, Mn = ["onClick"], Rn = { class: "rc-calendar__month-title" }, Vn = { class: "rc-calendar__weekdays" }, In = { class: "rc-calendar__days" }, Tn = ["onClick"], Fn = { class: "rc-calendar__day-content" }, An = { class: "rc-calendar__day-text" }, Bn = {
|
|
604
608
|
key: 0,
|
|
605
609
|
class: "rc-calendar__day-bottom"
|
|
606
610
|
}, En = {
|
|
607
611
|
key: 2,
|
|
608
612
|
class: "rc-calendar__footer"
|
|
609
|
-
},
|
|
613
|
+
}, Pn = {
|
|
610
614
|
key: 0,
|
|
611
615
|
class: "rc-calendar__month-picker-overlay"
|
|
612
|
-
},
|
|
616
|
+
}, Nn = { class: "rc-calendar__month-picker" }, zn = { class: "rc-calendar__month-picker-header" }, Yn = { class: "rc-calendar__month-picker-title" }, Ln = { key: 0 }, Wn = {
|
|
613
617
|
key: 0,
|
|
614
618
|
class: "rc-calendar__year-picker-content"
|
|
615
|
-
},
|
|
619
|
+
}, On = { class: "rc-calendar__year-picker-grid" }, Hn = ["onClick"], Un = {
|
|
616
620
|
key: 1,
|
|
617
621
|
class: "rc-calendar__month-picker-content"
|
|
618
|
-
},
|
|
622
|
+
}, qn = ["onClick"], rt = 48, he = 3, ct = 7, Gn = /* @__PURE__ */ ue({
|
|
619
623
|
__name: "panel-content",
|
|
620
624
|
props: {
|
|
621
625
|
showTitle: { type: Boolean },
|
|
@@ -632,243 +636,243 @@ const _n = {
|
|
|
632
636
|
maxRangeDays: {}
|
|
633
637
|
},
|
|
634
638
|
emits: ["select-day", "clear", "confirm", "shortcut-select"],
|
|
635
|
-
setup(
|
|
636
|
-
const
|
|
637
|
-
function
|
|
639
|
+
setup(t, { expose: i, emit: l }) {
|
|
640
|
+
const e = t, g = l, f = ["日", "一", "二", "三", "四", "五", "六"];
|
|
641
|
+
function $(a) {
|
|
638
642
|
if (!a) return null;
|
|
639
|
-
const
|
|
640
|
-
return isNaN(
|
|
643
|
+
const v = new Date(a);
|
|
644
|
+
return isNaN(v.getTime()) ? null : v;
|
|
641
645
|
}
|
|
642
|
-
function
|
|
643
|
-
const
|
|
644
|
-
return `${
|
|
646
|
+
function o(a) {
|
|
647
|
+
const v = a.getFullYear(), k = String(a.getMonth() + 1).padStart(2, "0"), U = String(a.getDate()).padStart(2, "0");
|
|
648
|
+
return `${v}-${k}-${U}`;
|
|
645
649
|
}
|
|
646
|
-
const
|
|
647
|
-
|
|
648
|
-
() => [
|
|
650
|
+
const r = W(/* @__PURE__ */ new Date());
|
|
651
|
+
_e(
|
|
652
|
+
() => [e.selectedDate, e.rangeStart],
|
|
649
653
|
() => {
|
|
650
|
-
if (
|
|
651
|
-
const a =
|
|
652
|
-
a && (
|
|
653
|
-
} else if (!
|
|
654
|
-
const a =
|
|
655
|
-
a && (
|
|
654
|
+
if (e.range && e.rangeStart) {
|
|
655
|
+
const a = $(e.rangeStart);
|
|
656
|
+
a && (r.value = a);
|
|
657
|
+
} else if (!e.range && e.selectedDate) {
|
|
658
|
+
const a = $(e.selectedDate);
|
|
659
|
+
a && (r.value = a);
|
|
656
660
|
}
|
|
657
661
|
},
|
|
658
662
|
{ immediate: !0 }
|
|
659
663
|
);
|
|
660
|
-
function
|
|
661
|
-
const
|
|
662
|
-
return a.getFullYear() ===
|
|
664
|
+
function m(a) {
|
|
665
|
+
const v = /* @__PURE__ */ new Date();
|
|
666
|
+
return a.getFullYear() === v.getFullYear() && a.getMonth() === v.getMonth() && a.getDate() === v.getDate();
|
|
663
667
|
}
|
|
664
|
-
function
|
|
665
|
-
if (!
|
|
666
|
-
const
|
|
667
|
-
return
|
|
668
|
+
function N(a) {
|
|
669
|
+
if (!e.rangeStart || !e.rangeEnd) return !1;
|
|
670
|
+
const v = o(a), k = e.rangeStart, U = e.rangeEnd;
|
|
671
|
+
return v > k && v < U;
|
|
668
672
|
}
|
|
669
|
-
function
|
|
670
|
-
if (
|
|
673
|
+
function x(a) {
|
|
674
|
+
if (e.disabledDate && e.disabledDate(a))
|
|
671
675
|
return !0;
|
|
672
|
-
const
|
|
673
|
-
return !!(
|
|
674
|
-
}
|
|
675
|
-
function
|
|
676
|
-
const k = new Date(a,
|
|
677
|
-
for (let
|
|
678
|
-
const
|
|
679
|
-
date: new Date(a,
|
|
676
|
+
const v = o(a);
|
|
677
|
+
return !!(e.minDate && v < e.minDate || e.maxDate && v > e.maxDate);
|
|
678
|
+
}
|
|
679
|
+
function w(a, v) {
|
|
680
|
+
const k = new Date(a, v, 1), U = new Date(a, v + 1, 0), j = k.getDay(), De = U.getDate(), xe = [], vt = new Date(a, v, 0).getDate();
|
|
681
|
+
for (let ve = j - 1; ve >= 0; ve--) {
|
|
682
|
+
const me = {
|
|
683
|
+
date: new Date(a, v - 1, vt - ve),
|
|
680
684
|
type: "prev-month",
|
|
681
|
-
text: String(
|
|
685
|
+
text: String(vt - ve)
|
|
682
686
|
};
|
|
683
|
-
if (
|
|
684
|
-
const
|
|
685
|
-
|
|
687
|
+
if (e.formatter) {
|
|
688
|
+
const pe = e.formatter(me);
|
|
689
|
+
pe.text && (me.text = pe.text), pe.bottomInfo && (me.bottomInfo = pe.bottomInfo);
|
|
686
690
|
}
|
|
687
|
-
|
|
691
|
+
xe.push(me);
|
|
688
692
|
}
|
|
689
|
-
for (let
|
|
690
|
-
const
|
|
691
|
-
date: new Date(a,
|
|
693
|
+
for (let ve = 1; ve <= De; ve++) {
|
|
694
|
+
const me = {
|
|
695
|
+
date: new Date(a, v, ve),
|
|
692
696
|
type: "current-month",
|
|
693
|
-
text: String(
|
|
697
|
+
text: String(ve)
|
|
694
698
|
};
|
|
695
|
-
if (
|
|
696
|
-
const
|
|
697
|
-
|
|
699
|
+
if (e.formatter) {
|
|
700
|
+
const pe = e.formatter(me);
|
|
701
|
+
pe.text && (me.text = pe.text), pe.bottomInfo && (me.bottomInfo = pe.bottomInfo);
|
|
698
702
|
}
|
|
699
|
-
|
|
703
|
+
xe.push(me);
|
|
700
704
|
}
|
|
701
|
-
const
|
|
702
|
-
for (let
|
|
703
|
-
const
|
|
704
|
-
date: new Date(a,
|
|
705
|
+
const Bt = 42 - xe.length;
|
|
706
|
+
for (let ve = 1; ve <= Bt; ve++) {
|
|
707
|
+
const me = {
|
|
708
|
+
date: new Date(a, v + 1, ve),
|
|
705
709
|
type: "next-month",
|
|
706
|
-
text: String(
|
|
710
|
+
text: String(ve)
|
|
707
711
|
};
|
|
708
|
-
if (
|
|
709
|
-
const
|
|
710
|
-
|
|
712
|
+
if (e.formatter) {
|
|
713
|
+
const pe = e.formatter(me);
|
|
714
|
+
pe.text && (me.text = pe.text), pe.bottomInfo && (me.bottomInfo = pe.bottomInfo);
|
|
711
715
|
}
|
|
712
|
-
|
|
716
|
+
xe.push(me);
|
|
713
717
|
}
|
|
714
|
-
return
|
|
715
|
-
}
|
|
716
|
-
const
|
|
717
|
-
const a =
|
|
718
|
-
return
|
|
719
|
-
}),
|
|
720
|
-
const a =
|
|
721
|
-
return `${a}年${
|
|
718
|
+
return xe;
|
|
719
|
+
}
|
|
720
|
+
const D = B(() => {
|
|
721
|
+
const a = r.value.getFullYear(), v = r.value.getMonth();
|
|
722
|
+
return w(a, v);
|
|
723
|
+
}), H = B(() => {
|
|
724
|
+
const a = r.value.getFullYear(), v = r.value.getMonth() + 1;
|
|
725
|
+
return `${a}年${v}月`;
|
|
722
726
|
});
|
|
723
|
-
function
|
|
724
|
-
const
|
|
725
|
-
if (a.type !== "current-month" &&
|
|
726
|
-
return
|
|
727
|
-
const k =
|
|
728
|
-
return
|
|
729
|
-
}
|
|
730
|
-
const
|
|
731
|
-
function
|
|
732
|
-
if (!
|
|
727
|
+
function T(a) {
|
|
728
|
+
const v = [];
|
|
729
|
+
if (a.type !== "current-month" && v.push("is-other-month"), m(a.date) && v.push("is-today"), x(a.date))
|
|
730
|
+
return v.push("is-disabled"), v;
|
|
731
|
+
const k = o(a.date);
|
|
732
|
+
return e.range ? (e.rangeStart === k && v.push("is-start"), e.rangeEnd === k && v.push("is-end"), N(a.date) && v.push("is-in-range")) : e.selectedDate === k && v.push("is-selected"), v;
|
|
733
|
+
}
|
|
734
|
+
const d = B(() => !!(e.rangeStart && e.rangeEnd)), ie = B(() => e.rangeStart && e.rangeEnd ? 2 : e.rangeStart || e.rangeEnd ? 1 : 0);
|
|
735
|
+
function ae(a) {
|
|
736
|
+
if (!e.minDate && !e.maxDate)
|
|
733
737
|
return !1;
|
|
734
|
-
const
|
|
735
|
-
return !!(
|
|
738
|
+
const v = e.minDate ? $(e.minDate) : null, k = e.maxDate ? $(e.maxDate) : null;
|
|
739
|
+
return !!(v && a < v.getFullYear() || k && a > k.getFullYear());
|
|
736
740
|
}
|
|
737
|
-
function
|
|
738
|
-
const k =
|
|
741
|
+
function b(a, v) {
|
|
742
|
+
const k = e.minDate ? $(e.minDate) : null, U = e.maxDate ? $(e.maxDate) : null;
|
|
739
743
|
if (k) {
|
|
740
|
-
const
|
|
741
|
-
if (a <
|
|
744
|
+
const j = k.getFullYear(), De = k.getMonth() + 1;
|
|
745
|
+
if (a < j || a === j && v < De)
|
|
742
746
|
return !0;
|
|
743
747
|
}
|
|
744
|
-
if (
|
|
745
|
-
const
|
|
746
|
-
if (a >
|
|
748
|
+
if (U) {
|
|
749
|
+
const j = U.getFullYear(), De = U.getMonth() + 1;
|
|
750
|
+
if (a > j || a === j && v > De)
|
|
747
751
|
return !0;
|
|
748
752
|
}
|
|
749
753
|
return !1;
|
|
750
754
|
}
|
|
751
|
-
const
|
|
752
|
-
const a = [], k = Math.floor((
|
|
753
|
-
for (let
|
|
754
|
-
a.push(
|
|
755
|
+
const Y = W(!1), y = W("year"), _ = W(r.value.getFullYear()), C = W(r.value.getMonth() + 1), S = W(), R = W(1900), L = W(1920), I = W(1900), O = W(2100), fe = B(() => {
|
|
756
|
+
const a = [], k = Math.floor((R.value - I.value) / he) - 3, U = Math.ceil((L.value - I.value) / he) + 3, j = I.value + Math.max(0, k) * he, De = I.value + U * he - 1;
|
|
757
|
+
for (let xe = j; xe <= De; xe++)
|
|
758
|
+
a.push(xe);
|
|
755
759
|
return a;
|
|
756
760
|
});
|
|
757
|
-
|
|
758
|
-
|
|
761
|
+
_e(() => r.value, (a) => {
|
|
762
|
+
_.value = a.getFullYear(), C.value = a.getMonth() + 1;
|
|
759
763
|
}, { immediate: !0 });
|
|
760
|
-
function be() {
|
|
761
|
-
if (!j.value) return;
|
|
762
|
-
const a = j.value.scrollTop, k = Math.max(0, Math.floor(a / Xe)), B = V.value + k * fe, Q = B + rt * fe - 1;
|
|
763
|
-
B < V.value ? V.value = B - 100 : Q > Y.value && (Y.value = Q + 100), (B !== S.value || Q !== T.value) && (S.value = B, T.value = Q);
|
|
764
|
-
}
|
|
765
764
|
function ke() {
|
|
766
|
-
|
|
767
|
-
const a = U.value;
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
765
|
+
if (!S.value) return;
|
|
766
|
+
const a = S.value.scrollTop, k = Math.max(0, Math.floor(a / rt)), U = I.value + k * he, j = U + ct * he - 1;
|
|
767
|
+
U < I.value ? I.value = U - 100 : j > O.value && (O.value = j + 100), (U !== R.value || j !== L.value) && (R.value = U, L.value = j);
|
|
768
|
+
}
|
|
769
|
+
function Me() {
|
|
770
|
+
_.value = r.value.getFullYear(), C.value = r.value.getMonth() + 1, y.value = "year", Y.value = !0;
|
|
771
|
+
const a = _.value;
|
|
772
|
+
a < I.value ? I.value = Math.floor(a / 100) * 100 : a > O.value && (O.value = Math.ceil(a / 100) * 100 + 99), ze(() => {
|
|
773
|
+
if (S.value) {
|
|
774
|
+
const v = Math.floor((a - I.value) / he), k = Math.max(0, v - 2);
|
|
775
|
+
R.value = I.value + k * he, L.value = R.value + ct * he - 1, Te(a);
|
|
772
776
|
}
|
|
773
777
|
});
|
|
774
778
|
}
|
|
775
|
-
function
|
|
776
|
-
if (!
|
|
777
|
-
a <
|
|
778
|
-
const
|
|
779
|
-
|
|
780
|
-
const
|
|
781
|
-
|
|
782
|
-
}
|
|
783
|
-
function $() {
|
|
784
|
-
const a = new Date(u.value);
|
|
785
|
-
a.setMonth(a.getMonth() - 1), u.value = a;
|
|
779
|
+
function Te(a) {
|
|
780
|
+
if (!S.value) return;
|
|
781
|
+
a < I.value ? I.value = Math.floor(a / 100) * 100 : a > O.value && (O.value = Math.ceil(a / 100) * 100 + 99);
|
|
782
|
+
const v = Math.floor((a - I.value) / he), k = v * rt;
|
|
783
|
+
S.value.scrollTop = k;
|
|
784
|
+
const U = Math.max(0, v - 2);
|
|
785
|
+
R.value = I.value + U * he, L.value = R.value + ct * he - 1;
|
|
786
786
|
}
|
|
787
|
-
function
|
|
788
|
-
const a = new Date(
|
|
789
|
-
a.setMonth(a.getMonth()
|
|
787
|
+
function V() {
|
|
788
|
+
const a = new Date(r.value);
|
|
789
|
+
a.setMonth(a.getMonth() - 1), r.value = a;
|
|
790
790
|
}
|
|
791
|
-
function
|
|
792
|
-
|
|
791
|
+
function A() {
|
|
792
|
+
const a = new Date(r.value);
|
|
793
|
+
a.setMonth(a.getMonth() + 1), r.value = a;
|
|
793
794
|
}
|
|
794
|
-
function
|
|
795
|
-
|
|
795
|
+
function K(a) {
|
|
796
|
+
ae(a) || (_.value = a, y.value = "month");
|
|
796
797
|
}
|
|
797
|
-
function
|
|
798
|
-
|
|
799
|
-
a.setFullYear(U.value), a.setMonth(z.value - 1), u.value = a, O.value = !1, H.value = "year";
|
|
798
|
+
function le(a) {
|
|
799
|
+
b(_.value, a) || (C.value = a, ge());
|
|
800
800
|
}
|
|
801
|
-
function
|
|
802
|
-
|
|
801
|
+
function ge() {
|
|
802
|
+
const a = new Date(r.value);
|
|
803
|
+
a.setFullYear(_.value), a.setMonth(C.value - 1), r.value = a, Y.value = !1, y.value = "year";
|
|
803
804
|
}
|
|
804
|
-
function
|
|
805
|
-
|
|
805
|
+
function we(a) {
|
|
806
|
+
g("select-day", a);
|
|
806
807
|
}
|
|
807
|
-
function
|
|
808
|
-
|
|
808
|
+
function Re() {
|
|
809
|
+
g("clear");
|
|
809
810
|
}
|
|
810
|
-
function
|
|
811
|
-
|
|
811
|
+
function n() {
|
|
812
|
+
c.value && Re();
|
|
812
813
|
}
|
|
813
|
-
function
|
|
814
|
-
|
|
814
|
+
function s() {
|
|
815
|
+
g("confirm");
|
|
815
816
|
}
|
|
816
|
-
function
|
|
817
|
-
|
|
817
|
+
function p() {
|
|
818
|
+
Y.value = !1;
|
|
818
819
|
}
|
|
819
|
-
function
|
|
820
|
-
|
|
821
|
-
he(o) || (U.value = o, H.value = "month");
|
|
820
|
+
function E(a) {
|
|
821
|
+
y.value = a;
|
|
822
822
|
}
|
|
823
823
|
function ee() {
|
|
824
|
-
const
|
|
825
|
-
|
|
824
|
+
const v = (/* @__PURE__ */ new Date()).getFullYear();
|
|
825
|
+
ae(v) || (_.value = v, y.value = "month");
|
|
826
826
|
}
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
if (!k || !B) return 0;
|
|
831
|
-
const Q = Math.abs(B.getTime() - k.getTime());
|
|
832
|
-
return Math.ceil(Q / (1e3 * 60 * 60 * 24)) + 1;
|
|
827
|
+
function Q() {
|
|
828
|
+
const v = (/* @__PURE__ */ new Date()).getMonth() + 1;
|
|
829
|
+
b(_.value, v) || (C.value = v, ge());
|
|
833
830
|
}
|
|
834
|
-
|
|
835
|
-
|
|
831
|
+
const c = B(() => e.range ? !!(e.rangeStart || e.rangeEnd) : !!e.selectedDate);
|
|
832
|
+
function z(a, v) {
|
|
833
|
+
const k = $(a), U = $(v);
|
|
834
|
+
if (!k || !U) return 0;
|
|
835
|
+
const j = Math.abs(U.getTime() - k.getTime());
|
|
836
|
+
return Math.ceil(j / (1e3 * 60 * 60 * 24)) + 1;
|
|
836
837
|
}
|
|
837
|
-
function
|
|
838
|
-
|
|
838
|
+
function M() {
|
|
839
|
+
return o(/* @__PURE__ */ new Date());
|
|
840
|
+
}
|
|
841
|
+
function q() {
|
|
842
|
+
const a = /* @__PURE__ */ new Date(), v = a.getDay(), k = a.getDate() - v + (v === 0 ? -6 : 1);
|
|
839
843
|
return new Date(a.getFullYear(), a.getMonth(), k);
|
|
840
844
|
}
|
|
841
|
-
function
|
|
842
|
-
const a =
|
|
843
|
-
return
|
|
845
|
+
function Ve() {
|
|
846
|
+
const a = q(), v = new Date(a);
|
|
847
|
+
return v.setDate(a.getDate() + 6), v;
|
|
844
848
|
}
|
|
845
|
-
function
|
|
849
|
+
function Fe() {
|
|
846
850
|
const a = /* @__PURE__ */ new Date();
|
|
847
851
|
return new Date(a.getFullYear(), a.getMonth(), 1);
|
|
848
852
|
}
|
|
849
|
-
function
|
|
853
|
+
function Ie() {
|
|
850
854
|
const a = /* @__PURE__ */ new Date();
|
|
851
855
|
return new Date(a.getFullYear(), a.getMonth() + 1, 0);
|
|
852
856
|
}
|
|
853
|
-
function
|
|
857
|
+
function Ye() {
|
|
854
858
|
const a = /* @__PURE__ */ new Date();
|
|
855
859
|
return new Date(a.getFullYear(), a.getMonth() - 2, 1);
|
|
856
860
|
}
|
|
857
|
-
function
|
|
861
|
+
function Be() {
|
|
858
862
|
const a = /* @__PURE__ */ new Date();
|
|
859
863
|
return new Date(a.getFullYear(), 0, 1);
|
|
860
864
|
}
|
|
861
|
-
function
|
|
865
|
+
function nt() {
|
|
862
866
|
const a = /* @__PURE__ */ new Date();
|
|
863
867
|
return new Date(a.getFullYear(), 11, 31);
|
|
864
868
|
}
|
|
865
|
-
const
|
|
869
|
+
const at = [
|
|
866
870
|
{
|
|
867
871
|
key: "today",
|
|
868
872
|
label: "本日",
|
|
869
873
|
days: 1,
|
|
870
874
|
getRange: () => {
|
|
871
|
-
const a =
|
|
875
|
+
const a = M();
|
|
872
876
|
return [a, a];
|
|
873
877
|
}
|
|
874
878
|
},
|
|
@@ -877,32 +881,32 @@ const _n = {
|
|
|
877
881
|
label: "本周",
|
|
878
882
|
days: 7,
|
|
879
883
|
getRange: () => {
|
|
880
|
-
const a =
|
|
881
|
-
return [a,
|
|
884
|
+
const a = o(q()), v = o(Ve());
|
|
885
|
+
return [a, v];
|
|
882
886
|
}
|
|
883
887
|
},
|
|
884
888
|
{
|
|
885
889
|
key: "month",
|
|
886
890
|
label: "本月",
|
|
887
891
|
getRange: () => {
|
|
888
|
-
const a =
|
|
889
|
-
return [a,
|
|
892
|
+
const a = o(Fe()), v = o(Ie());
|
|
893
|
+
return [a, v];
|
|
890
894
|
}
|
|
891
895
|
},
|
|
892
896
|
{
|
|
893
897
|
key: "threeMonths",
|
|
894
898
|
label: "近三月",
|
|
895
899
|
getRange: () => {
|
|
896
|
-
const a =
|
|
897
|
-
return [a,
|
|
900
|
+
const a = o(Ye()), v = o(Ie());
|
|
901
|
+
return [a, v];
|
|
898
902
|
}
|
|
899
903
|
},
|
|
900
904
|
{
|
|
901
905
|
key: "year",
|
|
902
906
|
label: "本年",
|
|
903
907
|
getRange: () => {
|
|
904
|
-
const a =
|
|
905
|
-
return [a,
|
|
908
|
+
const a = o(Be()), v = o(nt());
|
|
909
|
+
return [a, v];
|
|
906
910
|
}
|
|
907
911
|
},
|
|
908
912
|
{
|
|
@@ -910,8 +914,8 @@ const _n = {
|
|
|
910
914
|
label: "近7天",
|
|
911
915
|
days: 7,
|
|
912
916
|
getRange: () => {
|
|
913
|
-
const a = /* @__PURE__ */ new Date(),
|
|
914
|
-
return
|
|
917
|
+
const a = /* @__PURE__ */ new Date(), v = new Date(a);
|
|
918
|
+
return v.setDate(a.getDate() - 6), [o(v), M()];
|
|
915
919
|
}
|
|
916
920
|
},
|
|
917
921
|
{
|
|
@@ -919,213 +923,213 @@ const _n = {
|
|
|
919
923
|
label: "近30天",
|
|
920
924
|
days: 30,
|
|
921
925
|
getRange: () => {
|
|
922
|
-
const a = /* @__PURE__ */ new Date(),
|
|
923
|
-
return
|
|
926
|
+
const a = /* @__PURE__ */ new Date(), v = new Date(a);
|
|
927
|
+
return v.setDate(a.getDate() - 29), [o(v), M()];
|
|
924
928
|
}
|
|
925
929
|
}
|
|
926
|
-
],
|
|
927
|
-
if (
|
|
930
|
+
], lt = B(() => at.filter((a) => {
|
|
931
|
+
if (e.maxRangeDays !== void 0) {
|
|
928
932
|
if (a.days !== void 0)
|
|
929
|
-
return a.days <=
|
|
933
|
+
return a.days <= e.maxRangeDays;
|
|
930
934
|
{
|
|
931
|
-
const
|
|
932
|
-
if (
|
|
933
|
-
return
|
|
935
|
+
const v = a.getRange();
|
|
936
|
+
if (v)
|
|
937
|
+
return z(v[0], v[1]) <= e.maxRangeDays;
|
|
934
938
|
}
|
|
935
939
|
}
|
|
936
940
|
return !0;
|
|
937
941
|
}));
|
|
938
|
-
function
|
|
939
|
-
const
|
|
940
|
-
if (
|
|
941
|
-
if (
|
|
942
|
+
function ot(a) {
|
|
943
|
+
const v = a.getRange();
|
|
944
|
+
if (v) {
|
|
945
|
+
if (e.minDate && v[0] < e.minDate || e.maxDate && v[1] > e.maxDate)
|
|
942
946
|
return;
|
|
943
|
-
|
|
947
|
+
g("shortcut-select", v);
|
|
944
948
|
}
|
|
945
949
|
}
|
|
946
|
-
return
|
|
947
|
-
yearScrollRef:
|
|
948
|
-
}), (a,
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
class:
|
|
953
|
-
onClick:
|
|
950
|
+
return i({
|
|
951
|
+
yearScrollRef: S
|
|
952
|
+
}), (a, v) => (u(), h("div", null, [
|
|
953
|
+
t.showTitle ? (u(), h("div", Dn, [
|
|
954
|
+
P("div", xn, G(t.title), 1),
|
|
955
|
+
P("span", {
|
|
956
|
+
class: J(["rc-calendar__header-clear", { "is-disabled": !c.value }]),
|
|
957
|
+
onClick: n
|
|
954
958
|
}, " 清空 ", 2)
|
|
955
|
-
])) :
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
(
|
|
959
|
+
])) : F("", !0),
|
|
960
|
+
t.range ? (u(), h("div", Cn, [
|
|
961
|
+
P("div", Sn, [
|
|
962
|
+
(u(!0), h(de, null, ye(lt.value, (k) => (u(), h("div", {
|
|
959
963
|
key: k.key,
|
|
960
964
|
class: "rc-calendar__shortcut-item",
|
|
961
|
-
onClick: (
|
|
962
|
-
},
|
|
965
|
+
onClick: (U) => ot(k)
|
|
966
|
+
}, G(k.label), 9, Mn))), 128))
|
|
963
967
|
])
|
|
964
|
-
])) :
|
|
965
|
-
|
|
966
|
-
|
|
968
|
+
])) : F("", !0),
|
|
969
|
+
P("div", Rn, [
|
|
970
|
+
P("div", {
|
|
967
971
|
class: "rc-calendar__nav-button",
|
|
968
|
-
onClick:
|
|
972
|
+
onClick: V
|
|
969
973
|
}, [
|
|
970
|
-
|
|
974
|
+
X(ne(te), {
|
|
971
975
|
name: "icon_caret-left",
|
|
972
976
|
class: "rc-calendar__nav-icon"
|
|
973
977
|
})
|
|
974
978
|
]),
|
|
975
|
-
|
|
979
|
+
P("div", {
|
|
976
980
|
class: "rc-calendar__month-text",
|
|
977
|
-
onClick:
|
|
978
|
-
},
|
|
979
|
-
|
|
981
|
+
onClick: Me
|
|
982
|
+
}, G(H.value), 1),
|
|
983
|
+
P("div", {
|
|
980
984
|
class: "rc-calendar__nav-button",
|
|
981
|
-
onClick:
|
|
985
|
+
onClick: A
|
|
982
986
|
}, [
|
|
983
|
-
|
|
987
|
+
X(ne(te), {
|
|
984
988
|
name: "icon_caret-right",
|
|
985
989
|
class: "rc-calendar__nav-icon"
|
|
986
990
|
})
|
|
987
991
|
])
|
|
988
992
|
]),
|
|
989
|
-
|
|
990
|
-
(
|
|
993
|
+
P("div", Vn, [
|
|
994
|
+
(u(), h(de, null, ye(f, (k) => P("div", {
|
|
991
995
|
key: k,
|
|
992
996
|
class: "rc-calendar__weekday"
|
|
993
|
-
},
|
|
997
|
+
}, G(k), 1)), 64))
|
|
994
998
|
]),
|
|
995
|
-
|
|
996
|
-
(
|
|
997
|
-
key:
|
|
998
|
-
class:
|
|
999
|
-
onClick: (
|
|
999
|
+
P("div", In, [
|
|
1000
|
+
(u(!0), h(de, null, ye(D.value, (k, U) => (u(), h("div", {
|
|
1001
|
+
key: U,
|
|
1002
|
+
class: J(["rc-calendar__day", T(k)]),
|
|
1003
|
+
onClick: (j) => we(k)
|
|
1000
1004
|
}, [
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
k.bottomInfo ? (
|
|
1005
|
+
P("div", Fn, [
|
|
1006
|
+
P("span", An, G(k.text), 1),
|
|
1007
|
+
k.bottomInfo ? (u(), h("span", Bn, G(k.bottomInfo), 1)) : F("", !0)
|
|
1004
1008
|
])
|
|
1005
|
-
], 10,
|
|
1009
|
+
], 10, Tn))), 128))
|
|
1006
1010
|
]),
|
|
1007
|
-
|
|
1008
|
-
|
|
1011
|
+
t.range && t.showFooter ? (u(), h("div", En, [
|
|
1012
|
+
X(ne($e), {
|
|
1009
1013
|
type: "default",
|
|
1010
1014
|
class: "rc-calendar__footer-reset",
|
|
1011
|
-
onClick:
|
|
1015
|
+
onClick: Re
|
|
1012
1016
|
}, {
|
|
1013
|
-
default:
|
|
1014
|
-
|
|
1017
|
+
default: oe(() => [...v[2] || (v[2] = [
|
|
1018
|
+
Se("取消", -1)
|
|
1015
1019
|
])]),
|
|
1016
1020
|
_: 1
|
|
1017
1021
|
}),
|
|
1018
|
-
|
|
1022
|
+
X(ne($e), {
|
|
1019
1023
|
type: "primary",
|
|
1020
1024
|
class: "rc-calendar__footer-confirm",
|
|
1021
|
-
disabled: !
|
|
1022
|
-
onClick:
|
|
1025
|
+
disabled: !d.value,
|
|
1026
|
+
onClick: s
|
|
1023
1027
|
}, {
|
|
1024
|
-
default:
|
|
1025
|
-
|
|
1028
|
+
default: oe(() => [
|
|
1029
|
+
Se(G(d.value ? `确定(${ie.value}项)` : "确定"), 1)
|
|
1026
1030
|
]),
|
|
1027
1031
|
_: 1
|
|
1028
1032
|
}, 8, ["disabled"])
|
|
1029
|
-
])) :
|
|
1030
|
-
|
|
1031
|
-
default:
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1033
|
+
])) : F("", !0),
|
|
1034
|
+
X(Ne, { name: "rc-calendar-fade" }, {
|
|
1035
|
+
default: oe(() => [
|
|
1036
|
+
Y.value ? (u(), h("div", Pn, [
|
|
1037
|
+
P("div", Nn, [
|
|
1038
|
+
P("div", zn, [
|
|
1039
|
+
X(ne($e), {
|
|
1036
1040
|
type: "default",
|
|
1037
1041
|
mode: "text",
|
|
1038
1042
|
size: "small",
|
|
1039
|
-
onClick:
|
|
1043
|
+
onClick: p
|
|
1040
1044
|
}, {
|
|
1041
|
-
default:
|
|
1042
|
-
|
|
1045
|
+
default: oe(() => [...v[3] || (v[3] = [
|
|
1046
|
+
Se("取消", -1)
|
|
1043
1047
|
])]),
|
|
1044
1048
|
_: 1
|
|
1045
1049
|
}),
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
onClick:
|
|
1049
|
-
},
|
|
1050
|
-
|
|
1051
|
-
|
|
1050
|
+
P("div", Yn, [
|
|
1051
|
+
P("span", {
|
|
1052
|
+
onClick: v[0] || (v[0] = (k) => E("year"))
|
|
1053
|
+
}, G(_.value) + "年", 1),
|
|
1054
|
+
y.value === "month" ? (u(), h("span", Ln, " - ")) : F("", !0),
|
|
1055
|
+
y.value === "month" ? (u(), h("span", {
|
|
1052
1056
|
key: 1,
|
|
1053
|
-
onClick:
|
|
1054
|
-
},
|
|
1057
|
+
onClick: v[1] || (v[1] = (k) => E("month"))
|
|
1058
|
+
}, G(C.value) + "月", 1)) : F("", !0)
|
|
1055
1059
|
]),
|
|
1056
|
-
|
|
1060
|
+
y.value === "year" ? (u(), se(ne($e), {
|
|
1057
1061
|
key: 0,
|
|
1058
1062
|
type: "primary",
|
|
1059
1063
|
mode: "text",
|
|
1060
1064
|
size: "small",
|
|
1061
|
-
onClick:
|
|
1065
|
+
onClick: ee
|
|
1062
1066
|
}, {
|
|
1063
|
-
default:
|
|
1064
|
-
|
|
1067
|
+
default: oe(() => [...v[4] || (v[4] = [
|
|
1068
|
+
Se(" 本年 ", -1)
|
|
1065
1069
|
])]),
|
|
1066
1070
|
_: 1
|
|
1067
|
-
})) :
|
|
1068
|
-
|
|
1071
|
+
})) : F("", !0),
|
|
1072
|
+
y.value === "month" ? (u(), se(ne($e), {
|
|
1069
1073
|
key: 1,
|
|
1070
1074
|
type: "primary",
|
|
1071
1075
|
mode: "text",
|
|
1072
1076
|
size: "small",
|
|
1073
|
-
onClick:
|
|
1077
|
+
onClick: Q
|
|
1074
1078
|
}, {
|
|
1075
|
-
default:
|
|
1076
|
-
|
|
1079
|
+
default: oe(() => [...v[5] || (v[5] = [
|
|
1080
|
+
Se(" 本月 ", -1)
|
|
1077
1081
|
])]),
|
|
1078
1082
|
_: 1
|
|
1079
|
-
})) :
|
|
1083
|
+
})) : F("", !0)
|
|
1080
1084
|
]),
|
|
1081
|
-
|
|
1082
|
-
|
|
1085
|
+
y.value === "year" ? (u(), h("div", Wn, [
|
|
1086
|
+
P("div", {
|
|
1083
1087
|
class: "rc-calendar__year-picker-scroll",
|
|
1084
1088
|
ref_key: "yearScrollRef",
|
|
1085
|
-
ref:
|
|
1086
|
-
onScroll:
|
|
1089
|
+
ref: S,
|
|
1090
|
+
onScroll: ke
|
|
1087
1091
|
}, [
|
|
1088
|
-
|
|
1092
|
+
P("div", {
|
|
1089
1093
|
class: "rc-calendar__year-picker-spacer",
|
|
1090
|
-
style:
|
|
1094
|
+
style: re({ height: `${Math.floor((R.value - I.value) / he) * rt}px` })
|
|
1091
1095
|
}, null, 4),
|
|
1092
|
-
|
|
1093
|
-
(
|
|
1096
|
+
P("div", On, [
|
|
1097
|
+
(u(!0), h(de, null, ye(fe.value, (k) => (u(), h("div", {
|
|
1094
1098
|
key: k,
|
|
1095
|
-
class:
|
|
1096
|
-
"is-selected":
|
|
1097
|
-
"is-disabled":
|
|
1099
|
+
class: J(["rc-calendar__year-picker-item", {
|
|
1100
|
+
"is-selected": _.value === k,
|
|
1101
|
+
"is-disabled": ae(k)
|
|
1098
1102
|
}]),
|
|
1099
|
-
onClick: (
|
|
1100
|
-
},
|
|
1103
|
+
onClick: (U) => K(k)
|
|
1104
|
+
}, G(k), 11, Hn))), 128))
|
|
1101
1105
|
]),
|
|
1102
|
-
|
|
1106
|
+
P("div", {
|
|
1103
1107
|
class: "rc-calendar__year-picker-spacer",
|
|
1104
|
-
style:
|
|
1108
|
+
style: re({ height: `${Math.ceil((O.value - L.value) / he) * rt}px` })
|
|
1105
1109
|
}, null, 4)
|
|
1106
1110
|
], 544)
|
|
1107
|
-
])) :
|
|
1108
|
-
|
|
1109
|
-
(
|
|
1111
|
+
])) : F("", !0),
|
|
1112
|
+
y.value === "month" ? (u(), h("div", Un, [
|
|
1113
|
+
(u(), h(de, null, ye(12, (k) => P("div", {
|
|
1110
1114
|
key: k,
|
|
1111
|
-
class:
|
|
1112
|
-
"is-selected":
|
|
1113
|
-
"is-disabled":
|
|
1115
|
+
class: J(["rc-calendar__month-picker-item", {
|
|
1116
|
+
"is-selected": C.value === k,
|
|
1117
|
+
"is-disabled": b(_.value, k)
|
|
1114
1118
|
}]),
|
|
1115
|
-
onClick: (
|
|
1116
|
-
},
|
|
1117
|
-
])) :
|
|
1119
|
+
onClick: (U) => le(k)
|
|
1120
|
+
}, G(k) + "月 ", 11, qn)), 64))
|
|
1121
|
+
])) : F("", !0)
|
|
1118
1122
|
])
|
|
1119
|
-
])) :
|
|
1123
|
+
])) : F("", !0)
|
|
1120
1124
|
]),
|
|
1121
1125
|
_: 1
|
|
1122
1126
|
})
|
|
1123
1127
|
]));
|
|
1124
1128
|
}
|
|
1125
|
-
}),
|
|
1129
|
+
}), Dt = /* @__PURE__ */ ce(Gn, [["__scopeId", "data-v-0bf1834b"]]), Kn = { class: "rc-calendar" }, jn = ["placeholder"], Jn = { class: "rc-calendar__input-actions" }, Qn = {
|
|
1126
1130
|
key: 1,
|
|
1127
1131
|
class: "rc-calendar__panel"
|
|
1128
|
-
},
|
|
1132
|
+
}, Xn = /* @__PURE__ */ ue({
|
|
1129
1133
|
name: "rc-calendar",
|
|
1130
1134
|
__name: "index",
|
|
1131
1135
|
props: {
|
|
@@ -1143,190 +1147,190 @@ const _n = {
|
|
|
1143
1147
|
endDateOffset: { type: Boolean, default: !1 }
|
|
1144
1148
|
},
|
|
1145
1149
|
emits: ["update:modelValue", "change", "confirm"],
|
|
1146
|
-
setup(
|
|
1147
|
-
const
|
|
1148
|
-
if (
|
|
1150
|
+
setup(t, { emit: i }) {
|
|
1151
|
+
const l = t, e = i, g = W(), f = W(), $ = W(!1), o = W(""), r = B(() => l.range === !0 || typeof l.range == "number"), m = B(() => typeof l.range == "number" ? l.range : void 0), N = B(() => (V) => {
|
|
1152
|
+
if (l.disabledDate && l.disabledDate(V))
|
|
1149
1153
|
return !0;
|
|
1150
|
-
if (
|
|
1151
|
-
const
|
|
1152
|
-
if (
|
|
1154
|
+
if (m.value !== void 0 && w.value && !D.value) {
|
|
1155
|
+
const A = d(V);
|
|
1156
|
+
if (T(w.value) && ie(w.value, A) > m.value)
|
|
1153
1157
|
return !0;
|
|
1154
1158
|
}
|
|
1155
1159
|
return !1;
|
|
1156
|
-
}),
|
|
1157
|
-
|
|
1158
|
-
() =>
|
|
1159
|
-
(
|
|
1160
|
-
|
|
1160
|
+
}), x = W(null), w = W(null), D = W(null);
|
|
1161
|
+
_e(
|
|
1162
|
+
() => l.modelValue,
|
|
1163
|
+
(V) => {
|
|
1164
|
+
r.value ? Array.isArray(V) && V.length === 2 ? (w.value = V[0], D.value = y(V[1])) : (w.value = null, D.value = null) : x.value = typeof V == "string" ? V : null, H();
|
|
1161
1165
|
},
|
|
1162
1166
|
{ immediate: !0 }
|
|
1163
1167
|
);
|
|
1164
|
-
function
|
|
1165
|
-
|
|
1168
|
+
function H() {
|
|
1169
|
+
l.mode === "popup" && (r.value ? w.value && D.value ? o.value = `${w.value} ~ ${D.value}` : w.value ? o.value = `${w.value} ~ ` : o.value = "" : o.value = x.value || "");
|
|
1166
1170
|
}
|
|
1167
|
-
function
|
|
1168
|
-
if (
|
|
1169
|
-
const
|
|
1170
|
-
return isNaN(
|
|
1171
|
+
function T(V) {
|
|
1172
|
+
if (!V) return null;
|
|
1173
|
+
const A = new Date(V);
|
|
1174
|
+
return isNaN(A.getTime()) ? null : A;
|
|
1171
1175
|
}
|
|
1172
|
-
function
|
|
1173
|
-
const
|
|
1174
|
-
return `${
|
|
1176
|
+
function d(V) {
|
|
1177
|
+
const A = V.getFullYear(), K = String(V.getMonth() + 1).padStart(2, "0"), le = String(V.getDate()).padStart(2, "0");
|
|
1178
|
+
return `${A}-${K}-${le}`;
|
|
1175
1179
|
}
|
|
1176
|
-
function
|
|
1177
|
-
const
|
|
1178
|
-
if (!
|
|
1179
|
-
const
|
|
1180
|
-
return Math.ceil(
|
|
1180
|
+
function ie(V, A) {
|
|
1181
|
+
const K = T(V), le = T(A);
|
|
1182
|
+
if (!K || !le) return 0;
|
|
1183
|
+
const ge = Math.abs(le.getTime() - K.getTime());
|
|
1184
|
+
return Math.ceil(ge / (1e3 * 60 * 60 * 24));
|
|
1181
1185
|
}
|
|
1182
|
-
function
|
|
1183
|
-
const
|
|
1184
|
-
return
|
|
1186
|
+
function ae(V) {
|
|
1187
|
+
const A = T(V);
|
|
1188
|
+
return A ? (A.setDate(A.getDate() + 1), d(A)) : V;
|
|
1185
1189
|
}
|
|
1186
|
-
function
|
|
1187
|
-
const
|
|
1188
|
-
return
|
|
1190
|
+
function b(V) {
|
|
1191
|
+
const A = T(V);
|
|
1192
|
+
return A ? (A.setDate(A.getDate() - 1), d(A)) : V;
|
|
1189
1193
|
}
|
|
1190
|
-
function
|
|
1191
|
-
return
|
|
1194
|
+
function Y(V) {
|
|
1195
|
+
return l.endDateOffset && r.value ? ae(V) : V;
|
|
1192
1196
|
}
|
|
1193
|
-
function
|
|
1194
|
-
return
|
|
1197
|
+
function y(V) {
|
|
1198
|
+
return l.endDateOffset && r.value ? b(V) : V;
|
|
1195
1199
|
}
|
|
1196
|
-
function
|
|
1197
|
-
if (
|
|
1200
|
+
function _(V) {
|
|
1201
|
+
if (V.type !== "current-month" || l.disabledDate && l.disabledDate(V.date))
|
|
1198
1202
|
return;
|
|
1199
|
-
const
|
|
1200
|
-
if (!(
|
|
1201
|
-
if (
|
|
1202
|
-
if (!
|
|
1203
|
-
|
|
1203
|
+
const A = d(V.date);
|
|
1204
|
+
if (!(l.minDate && A < l.minDate) && !(l.maxDate && A > l.maxDate)) {
|
|
1205
|
+
if (r.value)
|
|
1206
|
+
if (!w.value || w.value && D.value)
|
|
1207
|
+
w.value = A, D.value = null;
|
|
1204
1208
|
else {
|
|
1205
|
-
let
|
|
1206
|
-
if (
|
|
1207
|
-
const
|
|
1208
|
-
|
|
1209
|
+
let K = w.value, le = A;
|
|
1210
|
+
if (A < w.value && (le = w.value, K = A), w.value = K, D.value = le, w.value && D.value) {
|
|
1211
|
+
const ge = Y(D.value), we = [w.value, ge];
|
|
1212
|
+
e("update:modelValue", we), e("change", we), l.showFooter || C();
|
|
1209
1213
|
}
|
|
1210
1214
|
}
|
|
1211
1215
|
else {
|
|
1212
|
-
|
|
1213
|
-
const
|
|
1214
|
-
|
|
1216
|
+
x.value = A;
|
|
1217
|
+
const K = A;
|
|
1218
|
+
e("update:modelValue", K), e("change", K), l.mode && I();
|
|
1215
1219
|
}
|
|
1216
|
-
|
|
1220
|
+
H();
|
|
1217
1221
|
}
|
|
1218
1222
|
}
|
|
1219
|
-
function
|
|
1220
|
-
if (
|
|
1221
|
-
const
|
|
1222
|
-
|
|
1223
|
+
function C() {
|
|
1224
|
+
if (w.value && D.value) {
|
|
1225
|
+
const V = Y(D.value), A = [w.value, V];
|
|
1226
|
+
e("update:modelValue", A), e("change", A), e("confirm", A), I();
|
|
1223
1227
|
}
|
|
1224
1228
|
}
|
|
1225
|
-
function
|
|
1226
|
-
|
|
1227
|
-
const
|
|
1228
|
-
|
|
1229
|
-
}
|
|
1230
|
-
function S($) {
|
|
1231
|
-
g.value = $[0], I.value = $[1];
|
|
1232
|
-
const x = O($[1]), L = [$[0], x];
|
|
1233
|
-
t("update:modelValue", L), t("change", L), m.showFooter ? A() : z();
|
|
1229
|
+
function S() {
|
|
1230
|
+
r.value ? (w.value = null, D.value = null) : x.value = null;
|
|
1231
|
+
const V = null;
|
|
1232
|
+
e("update:modelValue", V), e("change", V), H();
|
|
1234
1233
|
}
|
|
1235
|
-
function
|
|
1236
|
-
|
|
1234
|
+
function R(V) {
|
|
1235
|
+
w.value = V[0], D.value = V[1];
|
|
1236
|
+
const A = Y(V[1]), K = [V[0], A];
|
|
1237
|
+
e("update:modelValue", K), e("change", K), l.showFooter ? H() : C();
|
|
1237
1238
|
}
|
|
1238
|
-
function
|
|
1239
|
-
|
|
1239
|
+
function L() {
|
|
1240
|
+
$.value = !0;
|
|
1240
1241
|
}
|
|
1241
|
-
function
|
|
1242
|
-
|
|
1242
|
+
function I() {
|
|
1243
|
+
$.value = !1;
|
|
1243
1244
|
}
|
|
1244
|
-
function
|
|
1245
|
-
|
|
1245
|
+
function O(V) {
|
|
1246
|
+
$.value = V;
|
|
1246
1247
|
}
|
|
1247
|
-
function
|
|
1248
|
-
|
|
1248
|
+
function fe() {
|
|
1249
|
+
L();
|
|
1249
1250
|
}
|
|
1250
1251
|
function ke() {
|
|
1251
|
-
|
|
1252
|
-
}
|
|
1253
|
-
function
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1252
|
+
l.mode === "popup" && Te();
|
|
1253
|
+
}
|
|
1254
|
+
function Me() {
|
|
1255
|
+
$.value || L();
|
|
1256
|
+
}
|
|
1257
|
+
function Te() {
|
|
1258
|
+
const V = o.value.trim();
|
|
1259
|
+
if (r.value) {
|
|
1260
|
+
const A = V.split("~").map((K) => K.trim());
|
|
1261
|
+
if (A.length === 2 && A[0] && A[1]) {
|
|
1262
|
+
const K = T(A[0]), le = T(A[1]);
|
|
1263
|
+
if (K && le && !isNaN(K.getTime()) && !isNaN(le.getTime())) {
|
|
1264
|
+
w.value = d(K);
|
|
1265
|
+
const ge = d(le);
|
|
1266
|
+
D.value = y(ge);
|
|
1267
|
+
const we = Y(D.value), Re = [w.value, we];
|
|
1268
|
+
e("update:modelValue", Re), e("change", Re);
|
|
1265
1269
|
return;
|
|
1266
1270
|
}
|
|
1267
1271
|
}
|
|
1268
1272
|
} else {
|
|
1269
|
-
const
|
|
1270
|
-
if (
|
|
1271
|
-
|
|
1273
|
+
const A = T(V);
|
|
1274
|
+
if (A && !isNaN(A.getTime())) {
|
|
1275
|
+
x.value = d(A), e("update:modelValue", x.value), e("change", x.value);
|
|
1272
1276
|
return;
|
|
1273
1277
|
}
|
|
1274
1278
|
}
|
|
1275
|
-
|
|
1279
|
+
H();
|
|
1276
1280
|
}
|
|
1277
|
-
return (
|
|
1278
|
-
|
|
1281
|
+
return (V, A) => (u(), h("div", Kn, [
|
|
1282
|
+
t.mode === "popup" ? (u(), h("div", {
|
|
1279
1283
|
key: 0,
|
|
1280
1284
|
class: "rc-calendar__input",
|
|
1281
|
-
onClick:
|
|
1285
|
+
onClick: L
|
|
1282
1286
|
}, [
|
|
1283
|
-
|
|
1287
|
+
Tt(P("input", {
|
|
1284
1288
|
ref_key: "inputRef",
|
|
1285
|
-
ref:
|
|
1286
|
-
"onUpdate:modelValue":
|
|
1289
|
+
ref: g,
|
|
1290
|
+
"onUpdate:modelValue": A[0] || (A[0] = (K) => o.value = K),
|
|
1287
1291
|
type: "text",
|
|
1288
1292
|
class: "rc-calendar__input-field",
|
|
1289
|
-
placeholder:
|
|
1293
|
+
placeholder: t.placeholder,
|
|
1290
1294
|
readonly: "",
|
|
1291
|
-
onFocus:
|
|
1292
|
-
onBlur:
|
|
1293
|
-
onInput:
|
|
1295
|
+
onFocus: fe,
|
|
1296
|
+
onBlur: ke,
|
|
1297
|
+
onInput: Me
|
|
1294
1298
|
}, null, 40, jn), [
|
|
1295
|
-
[
|
|
1299
|
+
[Ft, o.value]
|
|
1296
1300
|
]),
|
|
1297
|
-
|
|
1298
|
-
|
|
1301
|
+
P("div", Jn, [
|
|
1302
|
+
X(ne(te), {
|
|
1299
1303
|
name: "icon_a-rili",
|
|
1300
1304
|
class: "rc-calendar__input-icon"
|
|
1301
1305
|
})
|
|
1302
1306
|
])
|
|
1303
|
-
])) :
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
"show-title":
|
|
1307
|
-
title:
|
|
1308
|
-
range:
|
|
1309
|
-
"selected-date":
|
|
1310
|
-
"range-start":
|
|
1311
|
-
"range-end":
|
|
1312
|
-
"min-date":
|
|
1313
|
-
"max-date":
|
|
1314
|
-
"disabled-date":
|
|
1315
|
-
formatter:
|
|
1307
|
+
])) : F("", !0),
|
|
1308
|
+
t.mode === "default" ? (u(), h("div", Qn, [
|
|
1309
|
+
X(Dt, {
|
|
1310
|
+
"show-title": t.showTitle,
|
|
1311
|
+
title: t.title,
|
|
1312
|
+
range: r.value,
|
|
1313
|
+
"selected-date": x.value,
|
|
1314
|
+
"range-start": w.value,
|
|
1315
|
+
"range-end": D.value,
|
|
1316
|
+
"min-date": t.minDate,
|
|
1317
|
+
"max-date": t.maxDate,
|
|
1318
|
+
"disabled-date": N.value,
|
|
1319
|
+
formatter: t.formatter,
|
|
1316
1320
|
"show-footer": !1,
|
|
1317
|
-
"max-range-days":
|
|
1318
|
-
onSelectDay:
|
|
1319
|
-
onClear:
|
|
1320
|
-
onConfirm:
|
|
1321
|
-
onShortcutSelect:
|
|
1321
|
+
"max-range-days": m.value,
|
|
1322
|
+
onSelectDay: _,
|
|
1323
|
+
onClear: S,
|
|
1324
|
+
onConfirm: C,
|
|
1325
|
+
onShortcutSelect: R
|
|
1322
1326
|
}, null, 8, ["show-title", "title", "range", "selected-date", "range-start", "range-end", "min-date", "max-date", "disabled-date", "formatter", "max-range-days"])
|
|
1323
|
-
])) :
|
|
1324
|
-
|
|
1327
|
+
])) : F("", !0),
|
|
1328
|
+
t.mode === "popup" ? (u(), se(ne(Le), {
|
|
1325
1329
|
key: 2,
|
|
1326
|
-
modelValue:
|
|
1330
|
+
modelValue: $.value,
|
|
1327
1331
|
"onUpdate:modelValue": [
|
|
1328
|
-
|
|
1329
|
-
|
|
1332
|
+
A[1] || (A[1] = (K) => $.value = K),
|
|
1333
|
+
O
|
|
1330
1334
|
],
|
|
1331
1335
|
position: "bottom",
|
|
1332
1336
|
overlay: !0,
|
|
@@ -1334,366 +1338,67 @@ const _n = {
|
|
|
1334
1338
|
"close-on-click-overlay": !0,
|
|
1335
1339
|
"lock-scroll": !0
|
|
1336
1340
|
}, {
|
|
1337
|
-
default:
|
|
1338
|
-
|
|
1341
|
+
default: oe(() => [
|
|
1342
|
+
P("div", {
|
|
1339
1343
|
ref_key: "popupPanelRef",
|
|
1340
|
-
ref:
|
|
1344
|
+
ref: f,
|
|
1341
1345
|
class: "rc-calendar__panel"
|
|
1342
1346
|
}, [
|
|
1343
|
-
|
|
1344
|
-
"show-title":
|
|
1345
|
-
title:
|
|
1346
|
-
range:
|
|
1347
|
-
"selected-date":
|
|
1348
|
-
"range-start":
|
|
1349
|
-
"range-end":
|
|
1350
|
-
"min-date":
|
|
1351
|
-
"max-date":
|
|
1352
|
-
"disabled-date":
|
|
1353
|
-
formatter:
|
|
1354
|
-
"show-footer":
|
|
1355
|
-
"max-range-days":
|
|
1356
|
-
onSelectDay:
|
|
1357
|
-
onClear:
|
|
1358
|
-
onConfirm:
|
|
1359
|
-
onShortcutSelect:
|
|
1347
|
+
X(Dt, {
|
|
1348
|
+
"show-title": t.showTitle,
|
|
1349
|
+
title: t.title,
|
|
1350
|
+
range: r.value,
|
|
1351
|
+
"selected-date": x.value,
|
|
1352
|
+
"range-start": w.value,
|
|
1353
|
+
"range-end": D.value,
|
|
1354
|
+
"min-date": t.minDate,
|
|
1355
|
+
"max-date": t.maxDate,
|
|
1356
|
+
"disabled-date": N.value,
|
|
1357
|
+
formatter: t.formatter,
|
|
1358
|
+
"show-footer": t.showFooter,
|
|
1359
|
+
"max-range-days": m.value,
|
|
1360
|
+
onSelectDay: _,
|
|
1361
|
+
onClear: S,
|
|
1362
|
+
onConfirm: C,
|
|
1363
|
+
onShortcutSelect: R
|
|
1360
1364
|
}, null, 8, ["show-title", "title", "range", "selected-date", "range-start", "range-end", "min-date", "max-date", "disabled-date", "formatter", "show-footer", "max-range-days"])
|
|
1361
1365
|
], 512)
|
|
1362
1366
|
]),
|
|
1363
1367
|
_: 1
|
|
1364
|
-
}, 8, ["modelValue"])) :
|
|
1368
|
+
}, 8, ["modelValue"])) : F("", !0)
|
|
1365
1369
|
]));
|
|
1366
1370
|
}
|
|
1367
|
-
}),
|
|
1368
|
-
|
|
1369
|
-
const
|
|
1370
|
-
function
|
|
1371
|
-
return
|
|
1372
|
-
}
|
|
1373
|
-
const Qn = {
|
|
1374
|
-
key: 0,
|
|
1375
|
-
class: "rc-input__prepend"
|
|
1376
|
-
}, Xn = {
|
|
1377
|
-
key: 0,
|
|
1378
|
-
class: "rc-input__prefix"
|
|
1379
|
-
}, Zn = {
|
|
1380
|
-
key: 1,
|
|
1381
|
-
class: "rc-input__textarea-wrapper"
|
|
1382
|
-
}, ea = {
|
|
1383
|
-
key: 3,
|
|
1384
|
-
class: "rc-input__suffix"
|
|
1385
|
-
}, ta = {
|
|
1386
|
-
key: 0,
|
|
1387
|
-
class: "rc-input__suffix-inner"
|
|
1388
|
-
}, na = {
|
|
1389
|
-
key: 4,
|
|
1390
|
-
class: "rc-input__count"
|
|
1391
|
-
}, aa = {
|
|
1392
|
-
key: 1,
|
|
1393
|
-
class: "rc-input__append"
|
|
1394
|
-
}, la = /* @__PURE__ */ se({
|
|
1395
|
-
__name: "index",
|
|
1396
|
-
props: {
|
|
1397
|
-
modelValue: { default: "" },
|
|
1398
|
-
type: { default: "text" },
|
|
1399
|
-
size: { default: "default" },
|
|
1400
|
-
placeholder: { default: "请输入" },
|
|
1401
|
-
disabled: { type: Boolean, default: !1 },
|
|
1402
|
-
clearable: { type: Boolean, default: !0 },
|
|
1403
|
-
showPassword: { type: Boolean, default: !1 },
|
|
1404
|
-
readonly: { type: Boolean, default: !1 },
|
|
1405
|
-
maxlength: { default: void 0 },
|
|
1406
|
-
minlength: { default: void 0 },
|
|
1407
|
-
showWordLimit: { type: Boolean, default: !1 },
|
|
1408
|
-
rows: { default: 2 },
|
|
1409
|
-
autosize: { type: [Boolean, Object], default: !1 },
|
|
1410
|
-
resize: { default: void 0 },
|
|
1411
|
-
prefixIcon: { default: "" },
|
|
1412
|
-
suffixIcon: { default: "" },
|
|
1413
|
-
autocomplete: { default: "off" },
|
|
1414
|
-
name: { default: void 0 },
|
|
1415
|
-
autofocus: { type: Boolean, default: !1 },
|
|
1416
|
-
form: { default: void 0 },
|
|
1417
|
-
tabindex: { default: void 0 },
|
|
1418
|
-
formatter: { type: Function, default: void 0 },
|
|
1419
|
-
parser: { type: Function, default: void 0 },
|
|
1420
|
-
deviceType: { default: void 0 }
|
|
1421
|
-
},
|
|
1422
|
-
emits: ["update:modelValue", "input", "change", "focus", "blur", "clear", "keydown", "mouseenter", "mouseleave", "compositionstart", "compositionupdate", "compositionend"],
|
|
1423
|
-
setup(e, { expose: r, emit: m }) {
|
|
1424
|
-
const t = e, y = De(ot, {}), _ = R(() => t.deviceType || (y == null ? void 0 : y.inputDeviceType) || ct.inputDeviceType || "pc"), v = m, d = E(), u = E(t.modelValue ?? ""), h = E(!1), F = E(!1), b = E(!1);
|
|
1425
|
-
Ie(
|
|
1426
|
-
() => t.modelValue,
|
|
1427
|
-
(p) => {
|
|
1428
|
-
u.value = p ?? "";
|
|
1429
|
-
}
|
|
1430
|
-
);
|
|
1431
|
-
const g = R(() => t.type === "password" ? F.value ? "text" : "password" : t.type), I = R(() => {
|
|
1432
|
-
const p = String(u.value ?? "");
|
|
1433
|
-
return t.formatter && !b.value ? t.formatter(p) : p;
|
|
1434
|
-
}), A = R(() => {
|
|
1435
|
-
const p = u.value;
|
|
1436
|
-
return p !== "" && p !== null && p !== void 0;
|
|
1437
|
-
}), C = R(() => String(u.value ?? "").length), i = R(() => !t.clearable || !A.value || t.disabled || t.readonly ? !1 : (_.value === "mobile", !0)), pe = zt(), he = R(() => !!(t.suffixIcon || t.showPassword && t.type === "password" || i.value && t.type !== "textarea" || pe.suffix)), ye = R(() => {
|
|
1438
|
-
if (t.type !== "textarea") return {};
|
|
1439
|
-
const p = {};
|
|
1440
|
-
return t.autosize ? p.resize = "none" : t.resize !== void 0 ? p.resize = t.resize : p.resize = "vertical", p;
|
|
1441
|
-
});
|
|
1442
|
-
function O(p) {
|
|
1443
|
-
let n = p.target.value;
|
|
1444
|
-
t.parser && !b.value && (n = t.parser(n));
|
|
1445
|
-
const l = n === "" ? void 0 : n;
|
|
1446
|
-
u.value = l, v("update:modelValue", l), v("input", l), t.type === "textarea" && t.autosize && Fe(() => {
|
|
1447
|
-
we();
|
|
1448
|
-
});
|
|
1449
|
-
}
|
|
1450
|
-
function H(p) {
|
|
1451
|
-
h.value = !0, v("focus", p);
|
|
1452
|
-
}
|
|
1453
|
-
function U(p) {
|
|
1454
|
-
h.value = !1;
|
|
1455
|
-
const Z = u.value, n = Z === "" ? void 0 : Z;
|
|
1456
|
-
v("blur", p), v("change", n);
|
|
1457
|
-
}
|
|
1458
|
-
function z() {
|
|
1459
|
-
u.value = void 0, v("update:modelValue", void 0), v("input", void 0), v("change", void 0), v("clear"), Fe(() => {
|
|
1460
|
-
var p;
|
|
1461
|
-
(p = d.value) == null || p.focus();
|
|
1462
|
-
});
|
|
1463
|
-
}
|
|
1464
|
-
function j() {
|
|
1465
|
-
F.value = !F.value;
|
|
1466
|
-
}
|
|
1467
|
-
function S(p) {
|
|
1468
|
-
if (v("keydown", p), p.key === "Enter" && t.type !== "textarea") {
|
|
1469
|
-
const Z = u.value;
|
|
1470
|
-
v("change", Z === "" ? void 0 : Z);
|
|
1471
|
-
}
|
|
1472
|
-
}
|
|
1473
|
-
function T(p) {
|
|
1474
|
-
v("mouseenter", p);
|
|
1475
|
-
}
|
|
1476
|
-
function V(p) {
|
|
1477
|
-
v("mouseleave", p);
|
|
1478
|
-
}
|
|
1479
|
-
function Y(p) {
|
|
1480
|
-
b.value = !0, v("compositionstart", p);
|
|
1481
|
-
}
|
|
1482
|
-
function ge(p) {
|
|
1483
|
-
v("compositionupdate", p);
|
|
1484
|
-
}
|
|
1485
|
-
function be(p) {
|
|
1486
|
-
b.value = !1, v("compositionend", p), p.target && O(p);
|
|
1487
|
-
}
|
|
1488
|
-
function ke() {
|
|
1489
|
-
var p;
|
|
1490
|
-
t.disabled || t.readonly || (p = d.value) == null || p.focus();
|
|
1491
|
-
}
|
|
1492
|
-
function we() {
|
|
1493
|
-
if (t.type !== "textarea" || !d.value) return;
|
|
1494
|
-
const p = d.value;
|
|
1495
|
-
if (t.autosize) {
|
|
1496
|
-
p.style.height = "auto";
|
|
1497
|
-
const Z = p.scrollHeight;
|
|
1498
|
-
if (typeof t.autosize == "object") {
|
|
1499
|
-
const { minRows: n = 2, maxRows: l } = t.autosize, c = parseInt(getComputedStyle(p).lineHeight) || 20, w = n * c, W = l ? l * c : 1 / 0;
|
|
1500
|
-
p.style.height = `${Math.min(Math.max(Z, w), W)}px`;
|
|
1501
|
-
} else
|
|
1502
|
-
p.style.height = `${Z}px`;
|
|
1503
|
-
}
|
|
1504
|
-
}
|
|
1505
|
-
function $() {
|
|
1506
|
-
var p;
|
|
1507
|
-
(p = d.value) == null || p.focus();
|
|
1508
|
-
}
|
|
1509
|
-
function x() {
|
|
1510
|
-
var p;
|
|
1511
|
-
(p = d.value) == null || p.blur();
|
|
1512
|
-
}
|
|
1513
|
-
function L() {
|
|
1514
|
-
d.value && "select" in d.value && d.value.select();
|
|
1515
|
-
}
|
|
1516
|
-
function te() {
|
|
1517
|
-
z();
|
|
1518
|
-
}
|
|
1519
|
-
return at(() => {
|
|
1520
|
-
t.type === "textarea" && t.autosize && we();
|
|
1521
|
-
}), r({
|
|
1522
|
-
focus: $,
|
|
1523
|
-
blur: x,
|
|
1524
|
-
select: L,
|
|
1525
|
-
clear: te,
|
|
1526
|
-
resizeTextarea: we,
|
|
1527
|
-
inputRef: d
|
|
1528
|
-
}), (p, Z) => (s(), f("div", {
|
|
1529
|
-
class: G(["rc-input", [
|
|
1530
|
-
`rc-input--${e.size}`,
|
|
1531
|
-
{
|
|
1532
|
-
"is-disabled": e.disabled,
|
|
1533
|
-
"is-focused": h.value,
|
|
1534
|
-
"is-readonly": e.readonly,
|
|
1535
|
-
"rc-input--textarea": e.type === "textarea",
|
|
1536
|
-
"has-prepend": p.$slots.prepend,
|
|
1537
|
-
"has-append": p.$slots.append
|
|
1538
|
-
}
|
|
1539
|
-
]]),
|
|
1540
|
-
onClick: ke
|
|
1541
|
-
}, [
|
|
1542
|
-
p.$slots.prepend ? (s(), f("div", Qn, [
|
|
1543
|
-
q(p.$slots, "prepend", {}, void 0, !0)
|
|
1544
|
-
])) : D("", !0),
|
|
1545
|
-
M("div", {
|
|
1546
|
-
class: G(["rc-input__wrapper", {
|
|
1547
|
-
"has-clear": i.value && e.type !== "textarea",
|
|
1548
|
-
"has-clear-textarea": i.value && e.type === "textarea",
|
|
1549
|
-
"has-clear-mobile": i.value && _.value === "mobile" && e.type !== "textarea",
|
|
1550
|
-
"has-clear-textarea-mobile": i.value && _.value === "mobile" && e.type === "textarea"
|
|
1551
|
-
}])
|
|
1552
|
-
}, [
|
|
1553
|
-
e.prefixIcon || p.$slots.prefix ? (s(), f("div", Xn, [
|
|
1554
|
-
q(p.$slots, "prefix", {}, () => [
|
|
1555
|
-
e.prefixIcon ? (s(), ne(J(X), {
|
|
1556
|
-
key: 0,
|
|
1557
|
-
name: e.prefixIcon,
|
|
1558
|
-
class: "rc-input__prefix-icon"
|
|
1559
|
-
}, null, 8, ["name"])) : D("", !0)
|
|
1560
|
-
], !0)
|
|
1561
|
-
])) : D("", !0),
|
|
1562
|
-
e.type === "textarea" ? (s(), f("div", Zn, [
|
|
1563
|
-
(s(), ne(vt("textarea"), {
|
|
1564
|
-
ref_key: "inputRef",
|
|
1565
|
-
ref: d,
|
|
1566
|
-
value: I.value,
|
|
1567
|
-
class: "rc-input__field rc-input__field--textarea",
|
|
1568
|
-
placeholder: e.placeholder,
|
|
1569
|
-
disabled: e.disabled,
|
|
1570
|
-
readonly: e.readonly,
|
|
1571
|
-
maxlength: e.maxlength,
|
|
1572
|
-
minlength: e.minlength,
|
|
1573
|
-
rows: e.rows,
|
|
1574
|
-
autocomplete: e.autocomplete,
|
|
1575
|
-
name: e.name,
|
|
1576
|
-
autofocus: e.autofocus,
|
|
1577
|
-
form: e.form,
|
|
1578
|
-
tabindex: e.tabindex,
|
|
1579
|
-
style: le(ye.value),
|
|
1580
|
-
onInput: O,
|
|
1581
|
-
onFocus: H,
|
|
1582
|
-
onBlur: U,
|
|
1583
|
-
onKeydown: S,
|
|
1584
|
-
onMouseenter: T,
|
|
1585
|
-
onMouseleave: V,
|
|
1586
|
-
onCompositionstart: Y,
|
|
1587
|
-
onCompositionupdate: ge,
|
|
1588
|
-
onCompositionend: be
|
|
1589
|
-
}, null, 40, ["value", "placeholder", "disabled", "readonly", "maxlength", "minlength", "rows", "autocomplete", "name", "autofocus", "form", "tabindex", "style"])),
|
|
1590
|
-
i.value && e.type === "textarea" ? (s(), f("button", {
|
|
1591
|
-
key: 0,
|
|
1592
|
-
type: "button",
|
|
1593
|
-
class: G(["rc-input__clear rc-input__clear--textarea", { "rc-input__clear--mobile": _.value === "mobile" }]),
|
|
1594
|
-
onClick: Ye(z, ["stop"])
|
|
1595
|
-
}, [
|
|
1596
|
-
K(J(X), {
|
|
1597
|
-
name: "icon_close_circle",
|
|
1598
|
-
class: "rc-input__clear-icon"
|
|
1599
|
-
})
|
|
1600
|
-
], 2)) : D("", !0)
|
|
1601
|
-
])) : (s(), ne(vt("input"), {
|
|
1602
|
-
key: 2,
|
|
1603
|
-
ref_key: "inputRef",
|
|
1604
|
-
ref: d,
|
|
1605
|
-
value: I.value,
|
|
1606
|
-
type: g.value,
|
|
1607
|
-
class: "rc-input__field",
|
|
1608
|
-
placeholder: e.placeholder,
|
|
1609
|
-
disabled: e.disabled,
|
|
1610
|
-
readonly: e.readonly,
|
|
1611
|
-
maxlength: e.maxlength,
|
|
1612
|
-
minlength: e.minlength,
|
|
1613
|
-
autocomplete: e.autocomplete,
|
|
1614
|
-
name: e.name,
|
|
1615
|
-
autofocus: e.autofocus,
|
|
1616
|
-
form: e.form,
|
|
1617
|
-
tabindex: e.tabindex,
|
|
1618
|
-
onInput: O,
|
|
1619
|
-
onFocus: H,
|
|
1620
|
-
onBlur: U,
|
|
1621
|
-
onKeydown: S,
|
|
1622
|
-
onMouseenter: T,
|
|
1623
|
-
onMouseleave: V,
|
|
1624
|
-
onCompositionstart: Y,
|
|
1625
|
-
onCompositionupdate: ge,
|
|
1626
|
-
onCompositionend: be
|
|
1627
|
-
}, null, 40, ["value", "type", "placeholder", "disabled", "readonly", "maxlength", "minlength", "autocomplete", "name", "autofocus", "form", "tabindex"])),
|
|
1628
|
-
he.value ? (s(), f("div", ea, [
|
|
1629
|
-
p.$slots.suffix ? (s(), f("div", ta, [
|
|
1630
|
-
q(p.$slots, "suffix", {}, void 0, !0)
|
|
1631
|
-
])) : D("", !0),
|
|
1632
|
-
e.showPassword && e.type === "password" && A.value ? (s(), f("button", {
|
|
1633
|
-
key: 1,
|
|
1634
|
-
type: "button",
|
|
1635
|
-
class: "rc-input__password-toggle",
|
|
1636
|
-
onClick: Ye(j, ["stop"])
|
|
1637
|
-
}, [
|
|
1638
|
-
K(J(X), {
|
|
1639
|
-
color: F.value ? "#1677ff" : "#999",
|
|
1640
|
-
name: F.value ? "icon_view" : "icon_view-off"
|
|
1641
|
-
}, null, 8, ["color", "name"])
|
|
1642
|
-
])) : D("", !0),
|
|
1643
|
-
i.value && e.type !== "textarea" ? (s(), f("button", {
|
|
1644
|
-
key: 2,
|
|
1645
|
-
type: "button",
|
|
1646
|
-
class: G(["rc-input__clear", { "rc-input__clear--mobile": _.value === "mobile" }]),
|
|
1647
|
-
onClick: Ye(z, ["stop"])
|
|
1648
|
-
}, [
|
|
1649
|
-
K(J(X), {
|
|
1650
|
-
name: "icon_close_circle",
|
|
1651
|
-
class: "rc-input__clear-icon"
|
|
1652
|
-
})
|
|
1653
|
-
], 2)) : D("", !0),
|
|
1654
|
-
e.suffixIcon && !e.clearable && !e.showPassword ? (s(), ne(J(X), {
|
|
1655
|
-
key: 3,
|
|
1656
|
-
name: e.suffixIcon,
|
|
1657
|
-
class: "rc-input__suffix-icon"
|
|
1658
|
-
}, null, 8, ["name"])) : D("", !0)
|
|
1659
|
-
])) : D("", !0),
|
|
1660
|
-
e.showWordLimit && e.maxlength ? (s(), f("span", na, N(C.value) + " / " + N(e.maxlength), 1)) : D("", !0)
|
|
1661
|
-
], 2),
|
|
1662
|
-
p.$slots.append ? (s(), f("div", aa, [
|
|
1663
|
-
q(p.$slots, "append", {}, void 0, !0)
|
|
1664
|
-
])) : D("", !0)
|
|
1665
|
-
], 2));
|
|
1666
|
-
}
|
|
1667
|
-
}), tt = /* @__PURE__ */ ue(la, [["__scopeId", "data-v-5e757433"]]);
|
|
1668
|
-
tt.name = "rc-input";
|
|
1669
|
-
function xt(e) {
|
|
1670
|
-
return e.component(tt.name, tt), e;
|
|
1371
|
+
}), We = /* @__PURE__ */ ce(Xn, [["__scopeId", "data-v-96b29c22"]]);
|
|
1372
|
+
We && (We.name = "rc-calendar");
|
|
1373
|
+
const Zn = "RcCalendar";
|
|
1374
|
+
function xt(t) {
|
|
1375
|
+
return We && (t.component(We.name || "rc-calendar", We), t.component(Zn, We)), t;
|
|
1671
1376
|
}
|
|
1672
|
-
const
|
|
1377
|
+
const ea = { class: "rc-search-area" }, ta = { class: "rc-search-area__bar" }, na = ["onClick"], aa = { class: "rc-search-area__item-label" }, la = { class: "rc-search-area__panel-content" }, oa = {
|
|
1673
1378
|
key: 1,
|
|
1674
1379
|
class: "rc-search-area__input-wrapper"
|
|
1675
|
-
},
|
|
1380
|
+
}, ra = ["placeholder"], sa = {
|
|
1676
1381
|
key: 2,
|
|
1677
1382
|
class: "rc-search-area__calendar-wrapper"
|
|
1678
|
-
},
|
|
1383
|
+
}, ia = {
|
|
1679
1384
|
key: 3,
|
|
1680
1385
|
class: "rc-search-area__tree-container"
|
|
1681
|
-
},
|
|
1386
|
+
}, ua = { class: "rc-search-area__tree-group-title" }, ca = { class: "rc-search-area__tree-group-options" }, da = ["onClick"], fa = { class: "rc-search-area__option-label" }, va = {
|
|
1682
1387
|
key: 4,
|
|
1683
1388
|
class: "rc-search-area__tree-container"
|
|
1684
|
-
},
|
|
1389
|
+
}, ma = { class: "rc-search-area__tree-group-title" }, pa = { class: "rc-search-area__tree-group-options" }, ha = ["onClick"], ya = { class: "rc-search-area__option-label" }, ga = {
|
|
1685
1390
|
key: 5,
|
|
1686
1391
|
class: "rc-search-area__options-grid"
|
|
1687
|
-
},
|
|
1392
|
+
}, ba = ["onClick"], _a = { class: "rc-search-area__option-label" }, ka = {
|
|
1688
1393
|
key: 6,
|
|
1689
1394
|
class: "rc-search-area__options-grid"
|
|
1690
|
-
},
|
|
1395
|
+
}, wa = ["onClick"], $a = { class: "rc-search-area__option-label" }, Da = {
|
|
1691
1396
|
key: 7,
|
|
1692
1397
|
class: "rc-search-area__empty"
|
|
1693
|
-
},
|
|
1398
|
+
}, xa = {
|
|
1694
1399
|
key: 0,
|
|
1695
1400
|
class: "rc-search-area__panel-footer"
|
|
1696
|
-
},
|
|
1401
|
+
}, Ca = /* @__PURE__ */ ue({
|
|
1697
1402
|
name: "rc-search-area",
|
|
1698
1403
|
__name: "index",
|
|
1699
1404
|
props: {
|
|
@@ -1703,415 +1408,820 @@ const oa = { class: "rc-search-area" }, ra = { class: "rc-search-area__bar" }, s
|
|
|
1703
1408
|
autoConfirm: { type: Boolean, default: !1 }
|
|
1704
1409
|
},
|
|
1705
1410
|
emits: ["update:modelValue", "change"],
|
|
1706
|
-
setup(
|
|
1707
|
-
const
|
|
1708
|
-
if (
|
|
1411
|
+
setup(t, { expose: i, emit: l }) {
|
|
1412
|
+
const e = t, g = l, f = W(null), $ = W(null), o = W(null), r = W({ top: "0px" }), m = async () => {
|
|
1413
|
+
if (f.value === null || !$.value)
|
|
1709
1414
|
return;
|
|
1710
|
-
await
|
|
1711
|
-
const
|
|
1712
|
-
|
|
1713
|
-
},
|
|
1714
|
-
if (
|
|
1415
|
+
await ze();
|
|
1416
|
+
const s = $.value.getBoundingClientRect().top;
|
|
1417
|
+
r.value = { top: `${s}px` };
|
|
1418
|
+
}, N = (n) => {
|
|
1419
|
+
if (f.value === null || !$.value)
|
|
1715
1420
|
return;
|
|
1716
|
-
const
|
|
1717
|
-
if (
|
|
1421
|
+
const s = n.target;
|
|
1422
|
+
if ($.value.contains(s))
|
|
1718
1423
|
return;
|
|
1719
|
-
const
|
|
1720
|
-
if (
|
|
1721
|
-
const
|
|
1722
|
-
if (
|
|
1424
|
+
const p = $.value.closest(".rc-search-area");
|
|
1425
|
+
if (p) {
|
|
1426
|
+
const E = p.querySelector(".rc-search-area__bar");
|
|
1427
|
+
if (E && E.contains(s))
|
|
1723
1428
|
return;
|
|
1724
1429
|
}
|
|
1725
|
-
|
|
1430
|
+
Y();
|
|
1726
1431
|
};
|
|
1727
|
-
|
|
1728
|
-
n !== null ? (await
|
|
1729
|
-
}),
|
|
1730
|
-
window.removeEventListener("resize",
|
|
1432
|
+
_e(f, async (n) => {
|
|
1433
|
+
n !== null ? (await ze(), m(), window.addEventListener("resize", m), window.addEventListener("scroll", m, !0), document.addEventListener("click", N, !0)) : (window.removeEventListener("resize", m), window.removeEventListener("scroll", m, !0), document.removeEventListener("click", N, !0));
|
|
1434
|
+
}), tt(() => {
|
|
1435
|
+
window.removeEventListener("resize", m), window.removeEventListener("scroll", m, !0), document.removeEventListener("click", N, !0);
|
|
1731
1436
|
});
|
|
1732
|
-
const
|
|
1733
|
-
|
|
1734
|
-
|
|
1437
|
+
const x = W({}), w = W(""), D = W(null), H = W({}), T = W({ ...e.modelValue });
|
|
1438
|
+
_e(() => e.modelValue, (n) => {
|
|
1439
|
+
T.value = { ...n || {} };
|
|
1735
1440
|
}, { deep: !0, immediate: !0 });
|
|
1736
|
-
const
|
|
1737
|
-
if (!
|
|
1738
|
-
const n =
|
|
1441
|
+
const d = B(() => f.value === null ? null : e.items[f.value]), ie = B(() => {
|
|
1442
|
+
if (!d.value) return "";
|
|
1443
|
+
const n = Re(d.value);
|
|
1739
1444
|
return n > 0 ? `(${n}项)` : "";
|
|
1740
|
-
}),
|
|
1741
|
-
const
|
|
1742
|
-
if (
|
|
1445
|
+
}), ae = (n) => {
|
|
1446
|
+
const s = T.value[n.key];
|
|
1447
|
+
if (s == null || s === "" || n.slot)
|
|
1743
1448
|
return n.label;
|
|
1744
1449
|
if (n.type === "input") {
|
|
1745
|
-
if (
|
|
1746
|
-
return `${n.label}: ${
|
|
1450
|
+
if (s && String(s).trim())
|
|
1451
|
+
return `${n.label}: ${s}`;
|
|
1747
1452
|
} else if (n.type === "calendar") {
|
|
1748
|
-
if (
|
|
1749
|
-
if (Array.isArray(
|
|
1750
|
-
return `${n.label}: ${
|
|
1751
|
-
if (typeof
|
|
1752
|
-
return `${n.label}: ${
|
|
1453
|
+
if (s) {
|
|
1454
|
+
if (Array.isArray(s) && s.length === 2)
|
|
1455
|
+
return `${n.label}: ${s[0]} ~ ${s[1]}`;
|
|
1456
|
+
if (typeof s == "string")
|
|
1457
|
+
return `${n.label}: ${s}`;
|
|
1753
1458
|
}
|
|
1754
1459
|
} else if (n.type === "single" || n.type === "tree-single") {
|
|
1755
|
-
const
|
|
1756
|
-
if (
|
|
1757
|
-
return `${n.label}: ${
|
|
1460
|
+
const p = S(n, s);
|
|
1461
|
+
if (p)
|
|
1462
|
+
return `${n.label}: ${C(p, n)}`;
|
|
1758
1463
|
} else {
|
|
1759
|
-
const
|
|
1760
|
-
if (
|
|
1761
|
-
const
|
|
1762
|
-
const
|
|
1763
|
-
return
|
|
1764
|
-
}).filter((
|
|
1765
|
-
if (
|
|
1766
|
-
return `${n.label}: ${
|
|
1464
|
+
const p = Array.isArray(s) ? s : [s];
|
|
1465
|
+
if (p.length > 0) {
|
|
1466
|
+
const E = p.map((ee) => {
|
|
1467
|
+
const Q = S(n, ee);
|
|
1468
|
+
return Q ? C(Q, n) : null;
|
|
1469
|
+
}).filter((ee) => ee !== null);
|
|
1470
|
+
if (E.length > 0)
|
|
1471
|
+
return `${n.label}: ${E.join("、")}`;
|
|
1767
1472
|
}
|
|
1768
1473
|
}
|
|
1769
1474
|
return n.label;
|
|
1770
|
-
},
|
|
1771
|
-
const
|
|
1772
|
-
if (!
|
|
1773
|
-
if (
|
|
1774
|
-
|
|
1475
|
+
}, b = (n) => {
|
|
1476
|
+
const s = e.items[n];
|
|
1477
|
+
if (!s) return;
|
|
1478
|
+
if (f.value === n) {
|
|
1479
|
+
f.value = null;
|
|
1775
1480
|
return;
|
|
1776
1481
|
}
|
|
1777
|
-
const
|
|
1778
|
-
|
|
1779
|
-
},
|
|
1780
|
-
|
|
1781
|
-
},
|
|
1782
|
-
if (!
|
|
1482
|
+
const p = T.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" ? D.value = p ?? null : s.type === "single" || s.type === "tree-single" ? x.value[s.key] = p !== void 0 ? p : null : x.value[s.key] = p !== void 0 ? Array.isArray(p) ? [...p] : [p] : [], f.value = n;
|
|
1484
|
+
}, Y = () => {
|
|
1485
|
+
f.value = null;
|
|
1486
|
+
}, y = (n, s) => {
|
|
1487
|
+
if (!s)
|
|
1783
1488
|
return typeof n == "string" ? n : n.label || String(n.value);
|
|
1784
|
-
const
|
|
1785
|
-
if (
|
|
1786
|
-
if (typeof
|
|
1787
|
-
return String(typeof
|
|
1489
|
+
const p = n;
|
|
1490
|
+
if (s.renderItem) {
|
|
1491
|
+
if (typeof s.renderItem == "string")
|
|
1492
|
+
return String(typeof p == "object" && p !== null ? p[s.renderItem] ?? "" : p);
|
|
1788
1493
|
{
|
|
1789
|
-
const
|
|
1790
|
-
return
|
|
1494
|
+
const E = s.renderItem(p);
|
|
1495
|
+
return E != null ? String(E) : "";
|
|
1791
1496
|
}
|
|
1792
1497
|
}
|
|
1793
1498
|
return typeof n == "string" ? n : n.label || String(n.value);
|
|
1794
|
-
},
|
|
1795
|
-
if (!
|
|
1499
|
+
}, _ = (n, s) => {
|
|
1500
|
+
if (!s)
|
|
1796
1501
|
return typeof n == "string" ? n : n.value !== void 0 ? n.value : n;
|
|
1797
|
-
const
|
|
1798
|
-
return
|
|
1799
|
-
},
|
|
1800
|
-
const
|
|
1801
|
-
if (
|
|
1802
|
-
if (typeof
|
|
1803
|
-
return String(typeof
|
|
1502
|
+
const p = n;
|
|
1503
|
+
return s.format ? typeof s.format == "string" ? typeof p == "object" && p !== null ? p[s.format] : p : s.format(p) : typeof n == "string" ? n : n.value !== void 0 ? n.value : n;
|
|
1504
|
+
}, C = (n, s) => {
|
|
1505
|
+
const p = n, E = s.renderResult || s.renderItem;
|
|
1506
|
+
if (E) {
|
|
1507
|
+
if (typeof E == "string")
|
|
1508
|
+
return String(typeof p == "object" && p !== null ? p[E] ?? "" : p);
|
|
1804
1509
|
{
|
|
1805
|
-
const
|
|
1806
|
-
return
|
|
1510
|
+
const ee = E(p);
|
|
1511
|
+
return ee != null ? String(ee) : "";
|
|
1807
1512
|
}
|
|
1808
1513
|
}
|
|
1809
|
-
return
|
|
1810
|
-
},
|
|
1811
|
-
const
|
|
1812
|
-
if (!
|
|
1813
|
-
const
|
|
1814
|
-
for (const
|
|
1815
|
-
const
|
|
1816
|
-
if (
|
|
1817
|
-
return
|
|
1818
|
-
if (typeof
|
|
1819
|
-
const
|
|
1820
|
-
if (Array.isArray(
|
|
1821
|
-
const
|
|
1822
|
-
if (
|
|
1514
|
+
return y(n, s);
|
|
1515
|
+
}, S = (n, s, p) => {
|
|
1516
|
+
const E = p || n.options;
|
|
1517
|
+
if (!E) return null;
|
|
1518
|
+
const ee = n.childrenKey || "children";
|
|
1519
|
+
for (const Q of E) {
|
|
1520
|
+
const c = _(Q, n);
|
|
1521
|
+
if (c === s || String(c) === String(s))
|
|
1522
|
+
return Q;
|
|
1523
|
+
if (typeof Q == "object" && Q !== null) {
|
|
1524
|
+
const z = Q[ee];
|
|
1525
|
+
if (Array.isArray(z) && z.length > 0) {
|
|
1526
|
+
const M = S(n, s, z);
|
|
1527
|
+
if (M) return M;
|
|
1823
1528
|
}
|
|
1824
1529
|
}
|
|
1825
1530
|
}
|
|
1826
1531
|
return null;
|
|
1827
|
-
},
|
|
1828
|
-
const
|
|
1829
|
-
if (!
|
|
1830
|
-
const
|
|
1831
|
-
for (const
|
|
1832
|
-
if (
|
|
1833
|
-
const
|
|
1834
|
-
Array.isArray(
|
|
1532
|
+
}, R = (n, s) => {
|
|
1533
|
+
const p = s || n.options;
|
|
1534
|
+
if (!p) return [];
|
|
1535
|
+
const E = n.childrenKey || "children", ee = [];
|
|
1536
|
+
for (const Q of p)
|
|
1537
|
+
if (ee.push(Q), typeof Q == "object" && Q !== null) {
|
|
1538
|
+
const c = Q[E];
|
|
1539
|
+
Array.isArray(c) && c.length > 0 && ee.push(...R(n, c));
|
|
1835
1540
|
}
|
|
1836
|
-
return
|
|
1837
|
-
},
|
|
1838
|
-
if (!
|
|
1839
|
-
const
|
|
1840
|
-
return
|
|
1841
|
-
},
|
|
1842
|
-
if (!n
|
|
1843
|
-
const
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
const xe = ee.length > 0 ? ee.join("-") : "";
|
|
1855
|
-
w.has(xe) || w.set(xe, []), w.get(xe).push(re);
|
|
1856
|
-
}
|
|
1857
|
-
}
|
|
1858
|
-
};
|
|
1859
|
-
W(n.options);
|
|
1860
|
-
for (const [P, ee] of w.entries())
|
|
1861
|
-
c.push({
|
|
1862
|
-
title: P || "全部",
|
|
1863
|
-
children: ee
|
|
1864
|
-
});
|
|
1865
|
-
return c;
|
|
1866
|
-
}, ge = (n) => {
|
|
1541
|
+
return ee;
|
|
1542
|
+
}, L = (n) => {
|
|
1543
|
+
if (!d.value) return !1;
|
|
1544
|
+
const s = d.value.key, p = x.value[s], E = _(n, d.value);
|
|
1545
|
+
return d.value.type === "single" || d.value.type === "tree-single" ? p != null && p === E : (Array.isArray(p) ? p : []).some((Q) => Q === E || String(Q) === String(E));
|
|
1546
|
+
}, I = (n) => n ? n.childrenKey ? R(n) : n.options || [] : [], O = (n) => {
|
|
1547
|
+
if (!n) return [];
|
|
1548
|
+
const s = n.childrenKey || "children";
|
|
1549
|
+
return (n.options || []).filter((p) => {
|
|
1550
|
+
if (typeof p == "string") return !1;
|
|
1551
|
+
const E = p[s];
|
|
1552
|
+
return Array.isArray(E) && E.length > 0;
|
|
1553
|
+
});
|
|
1554
|
+
}, fe = (n, s) => {
|
|
1555
|
+
if (!s || typeof n == "string") return [];
|
|
1556
|
+
const p = s.childrenKey || "children", E = n[p];
|
|
1557
|
+
return Array.isArray(E) ? E : [];
|
|
1558
|
+
}, ke = (n) => {
|
|
1867
1559
|
if (n)
|
|
1868
|
-
return
|
|
1869
|
-
},
|
|
1870
|
-
if (n && (
|
|
1871
|
-
const
|
|
1872
|
-
|
|
1560
|
+
return H.value[n.key] !== void 0 ? H.value[n.key] : T.value[n.key];
|
|
1561
|
+
}, Me = (n, s) => {
|
|
1562
|
+
if (n && (H.value[n.key] = s, e.autoConfirm)) {
|
|
1563
|
+
const p = n.key;
|
|
1564
|
+
T.value[p] = s, g("update:modelValue", { ...T.value }), g("change", { ...T.value }, n), Y();
|
|
1873
1565
|
}
|
|
1874
|
-
},
|
|
1875
|
-
if (!
|
|
1876
|
-
const
|
|
1877
|
-
|
|
1878
|
-
let
|
|
1879
|
-
|
|
1880
|
-
},
|
|
1881
|
-
if (!
|
|
1882
|
-
const
|
|
1883
|
-
(
|
|
1566
|
+
}, Te = (n) => {
|
|
1567
|
+
if (!d.value) return;
|
|
1568
|
+
const s = d.value.key, p = _(n, d.value);
|
|
1569
|
+
T.value[s];
|
|
1570
|
+
let E;
|
|
1571
|
+
x.value[s] === p ? E = void 0 : E = p, T.value[s] = E, g("update:modelValue", { ...T.value }), g("change", { ...T.value }, d.value), Y();
|
|
1572
|
+
}, V = (n) => {
|
|
1573
|
+
if (!d.value) return;
|
|
1574
|
+
const s = d.value.key, p = _(n, d.value), E = Array.isArray(x.value[s]) ? [...x.value[s]] : [], ee = E.findIndex(
|
|
1575
|
+
(Q) => Q === p || String(Q) === String(p)
|
|
1884
1576
|
);
|
|
1885
|
-
if (
|
|
1886
|
-
const
|
|
1887
|
-
|
|
1577
|
+
if (ee >= 0 ? E.splice(ee, 1) : E.push(p), x.value[s] = E, e.autoConfirm) {
|
|
1578
|
+
const Q = E.length > 0 ? E : void 0;
|
|
1579
|
+
T.value[s] = Q, g("update:modelValue", { ...T.value }), g("change", { ...T.value }, d.value), Y();
|
|
1888
1580
|
}
|
|
1889
|
-
},
|
|
1890
|
-
if (!
|
|
1891
|
-
const n =
|
|
1892
|
-
|
|
1893
|
-
},
|
|
1894
|
-
if (
|
|
1895
|
-
const
|
|
1896
|
-
|
|
1581
|
+
}, A = () => {
|
|
1582
|
+
if (!d.value) return;
|
|
1583
|
+
const n = d.value.key;
|
|
1584
|
+
d.value.slot ? H.value[n] = void 0 : d.value.type === "input" ? w.value = "" : d.value.type === "calendar" ? D.value = null : d.value.type === "single" || d.value.type === "tree-single" ? x.value[n] = null : x.value[n] = [];
|
|
1585
|
+
}, K = () => {
|
|
1586
|
+
if (e.autoConfirm && d.value) {
|
|
1587
|
+
const n = d.value.key, s = w.value.trim() || void 0;
|
|
1588
|
+
T.value[n] = s, g("update:modelValue", { ...T.value }), g("change", { ...T.value }, d.value), Y();
|
|
1897
1589
|
}
|
|
1898
|
-
},
|
|
1899
|
-
if (
|
|
1900
|
-
const
|
|
1901
|
-
|
|
1590
|
+
}, le = (n) => {
|
|
1591
|
+
if (D.value = n, e.autoConfirm && d.value) {
|
|
1592
|
+
const s = d.value.key, p = n ?? void 0;
|
|
1593
|
+
T.value[s] = p, g("update:modelValue", { ...T.value }), g("change", { ...T.value }, d.value), Y();
|
|
1902
1594
|
}
|
|
1903
|
-
},
|
|
1904
|
-
if (!
|
|
1905
|
-
const n =
|
|
1906
|
-
|
|
1907
|
-
let
|
|
1908
|
-
if (
|
|
1909
|
-
|
|
1910
|
-
else if (
|
|
1911
|
-
|
|
1912
|
-
else if (
|
|
1913
|
-
|
|
1914
|
-
else if (
|
|
1915
|
-
const
|
|
1916
|
-
|
|
1595
|
+
}, ge = () => {
|
|
1596
|
+
if (!d.value) return;
|
|
1597
|
+
const n = d.value.key;
|
|
1598
|
+
T.value[n];
|
|
1599
|
+
let s;
|
|
1600
|
+
if (d.value.slot)
|
|
1601
|
+
s = H.value[n], T.value[n] = s;
|
|
1602
|
+
else if (d.value.type === "input")
|
|
1603
|
+
s = w.value.trim() || void 0, T.value[n] = s;
|
|
1604
|
+
else if (d.value.type === "calendar")
|
|
1605
|
+
s = D.value !== null && D.value !== void 0 ? D.value : void 0, T.value[n] = s;
|
|
1606
|
+
else if (d.value.type === "single" || d.value.type === "tree-single") {
|
|
1607
|
+
const p = x.value[n];
|
|
1608
|
+
s = p ?? void 0, T.value[n] = s;
|
|
1917
1609
|
} else {
|
|
1918
|
-
const
|
|
1919
|
-
|
|
1610
|
+
const p = x.value[n];
|
|
1611
|
+
s = Array.isArray(p) && p.length > 0 ? p : void 0, T.value[n] = s;
|
|
1920
1612
|
}
|
|
1921
|
-
|
|
1922
|
-
},
|
|
1923
|
-
const
|
|
1924
|
-
return
|
|
1925
|
-
},
|
|
1613
|
+
g("update:modelValue", { ...T.value }), g("change", { ...T.value }, d.value), Y();
|
|
1614
|
+
}, we = (n) => {
|
|
1615
|
+
const s = T.value[n.key];
|
|
1616
|
+
return s == null || s === "" ? 0 : n.slot ? 1 : n.type === "input" ? String(s).trim() ? 1 : 0 : n.type === "single" || n.type === "tree-single" ? 1 : Array.isArray(s) ? s.length : s ? 1 : 0;
|
|
1617
|
+
}, Re = (n) => {
|
|
1926
1618
|
if (n.slot) {
|
|
1927
|
-
const
|
|
1928
|
-
return
|
|
1619
|
+
const p = H.value[n.key];
|
|
1620
|
+
return p != null && p !== "" ? 1 : 0;
|
|
1929
1621
|
} else {
|
|
1930
1622
|
if (n.type === "input")
|
|
1931
|
-
return
|
|
1623
|
+
return w.value.trim() ? 1 : 0;
|
|
1932
1624
|
if (n.type === "calendar")
|
|
1933
|
-
return
|
|
1625
|
+
return D.value !== null && D.value !== void 0 ? 1 : 0;
|
|
1934
1626
|
}
|
|
1935
|
-
const
|
|
1936
|
-
return
|
|
1627
|
+
const s = x.value[n.key];
|
|
1628
|
+
return s == null || s === "" ? 0 : n.type === "single" || n.type === "tree-single" ? 1 : Array.isArray(s) ? s.length : 0;
|
|
1937
1629
|
};
|
|
1938
|
-
return
|
|
1630
|
+
return i({
|
|
1939
1631
|
/** 获取当前筛选值 */
|
|
1940
|
-
getValues: () => ({ ...
|
|
1632
|
+
getValues: () => ({ ...T.value }),
|
|
1941
1633
|
/** 重置所有筛选 */
|
|
1942
1634
|
reset: () => {
|
|
1943
|
-
|
|
1635
|
+
T.value = {}, x.value = {}, H.value = {}, g("update:modelValue", {});
|
|
1944
1636
|
}
|
|
1945
|
-
}), (n,
|
|
1946
|
-
|
|
1947
|
-
(
|
|
1948
|
-
key:
|
|
1949
|
-
class:
|
|
1950
|
-
"is-active":
|
|
1951
|
-
"has-value": p
|
|
1637
|
+
}), (n, s) => (u(), h("div", ea, [
|
|
1638
|
+
P("div", ta, [
|
|
1639
|
+
(u(!0), h(de, null, ye(e.items, (p, E) => (u(), h("div", {
|
|
1640
|
+
key: E,
|
|
1641
|
+
class: J(["rc-search-area__item", {
|
|
1642
|
+
"is-active": f.value === E,
|
|
1643
|
+
"has-value": we(p) > 0
|
|
1952
1644
|
}]),
|
|
1953
|
-
onClick: (
|
|
1645
|
+
onClick: (ee) => b(E)
|
|
1954
1646
|
}, [
|
|
1955
|
-
|
|
1956
|
-
|
|
1647
|
+
P("span", aa, G(ae(p)), 1),
|
|
1648
|
+
X(ne(te), {
|
|
1957
1649
|
name: "icon_a-xiala2",
|
|
1958
|
-
color:
|
|
1959
|
-
class:
|
|
1650
|
+
color: f.value !== E && we(p) > 0 ? "#1677ff" : "#969799",
|
|
1651
|
+
class: J(["rc-search-area__item-arrow", { "is-up": f.value === E }])
|
|
1960
1652
|
}, null, 8, ["color", "class"])
|
|
1961
|
-
], 10,
|
|
1653
|
+
], 10, na))), 128))
|
|
1962
1654
|
]),
|
|
1963
|
-
|
|
1964
|
-
default:
|
|
1965
|
-
|
|
1655
|
+
X(Ne, { name: "rc-search-area-fade" }, {
|
|
1656
|
+
default: oe(() => [
|
|
1657
|
+
f.value !== null && e.showMask ? (u(), h("div", {
|
|
1966
1658
|
key: 0,
|
|
1967
1659
|
ref_key: "maskRef",
|
|
1968
|
-
ref:
|
|
1660
|
+
ref: o,
|
|
1969
1661
|
class: "rc-search-area__mask",
|
|
1970
|
-
style:
|
|
1971
|
-
onClick:
|
|
1972
|
-
}, null, 4)) :
|
|
1662
|
+
style: re(r.value),
|
|
1663
|
+
onClick: Y
|
|
1664
|
+
}, null, 4)) : F("", !0)
|
|
1973
1665
|
]),
|
|
1974
1666
|
_: 1
|
|
1975
1667
|
}),
|
|
1976
|
-
|
|
1977
|
-
default:
|
|
1978
|
-
var
|
|
1668
|
+
X(Ne, { name: "rc-search-area-slide" }, {
|
|
1669
|
+
default: oe(() => {
|
|
1670
|
+
var p, E, ee, Q, c, z, M, q, Ve, Fe, Ie, Ye, Be, nt, at, lt, ot, a, v;
|
|
1979
1671
|
return [
|
|
1980
|
-
|
|
1672
|
+
f.value !== null ? (u(), h("div", {
|
|
1981
1673
|
key: 0,
|
|
1982
1674
|
ref_key: "panelRef",
|
|
1983
|
-
ref:
|
|
1675
|
+
ref: $,
|
|
1984
1676
|
class: "rc-search-area__panel"
|
|
1985
1677
|
}, [
|
|
1986
|
-
|
|
1987
|
-
(
|
|
1678
|
+
P("div", la, [
|
|
1679
|
+
(p = d.value) != null && p.slot && n.$slots[d.value.key] ? Z(n.$slots, d.value.key, {
|
|
1988
1680
|
key: 0,
|
|
1989
|
-
value:
|
|
1990
|
-
"update:value": (
|
|
1991
|
-
}, void 0, !0) : ((
|
|
1992
|
-
|
|
1993
|
-
modelValue:
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
1681
|
+
value: ke(d.value),
|
|
1682
|
+
"update:value": (k) => Me(d.value, k)
|
|
1683
|
+
}, void 0, !0) : ((E = d.value) == null ? void 0 : E.type) === "input" ? (u(), h("div", oa, [
|
|
1684
|
+
Tt(P("input", {
|
|
1685
|
+
"onUpdate:modelValue": s[0] || (s[0] = (k) => w.value = k),
|
|
1686
|
+
type: "text",
|
|
1687
|
+
class: "rc-search-area__input",
|
|
1688
|
+
placeholder: d.value.placeholder || "请输入",
|
|
1689
|
+
onInput: K
|
|
1690
|
+
}, null, 40, ra), [
|
|
1691
|
+
[Ft, w.value]
|
|
1692
|
+
])
|
|
1693
|
+
])) : ((ee = d.value) == null ? void 0 : ee.type) === "calendar" ? (u(), h("div", sa, [
|
|
1694
|
+
X(ne(We), {
|
|
1695
|
+
modelValue: D.value,
|
|
1696
|
+
"onUpdate:modelValue": s[1] || (s[1] = (k) => D.value = k),
|
|
1697
|
+
range: ((Q = d.value.calendarConfig) == null ? void 0 : Q.range) || !1,
|
|
2003
1698
|
mode: "default",
|
|
2004
|
-
"min-date": (
|
|
2005
|
-
"max-date": (
|
|
2006
|
-
"disabled-date": (
|
|
2007
|
-
formatter: (
|
|
2008
|
-
"end-date-offset": ((
|
|
2009
|
-
onChange:
|
|
1699
|
+
"min-date": (c = d.value.calendarConfig) == null ? void 0 : c.minDate,
|
|
1700
|
+
"max-date": (z = d.value.calendarConfig) == null ? void 0 : z.maxDate,
|
|
1701
|
+
"disabled-date": (M = d.value.calendarConfig) == null ? void 0 : M.disabledDate,
|
|
1702
|
+
formatter: (q = d.value.calendarConfig) == null ? void 0 : q.formatter,
|
|
1703
|
+
"end-date-offset": ((Ve = d.value.calendarConfig) == null ? void 0 : Ve.endDateOffset) || !1,
|
|
1704
|
+
onChange: le
|
|
2010
1705
|
}, null, 8, ["modelValue", "range", "min-date", "max-date", "disabled-date", "formatter", "end-date-offset"])
|
|
2011
|
-
])) : ((
|
|
2012
|
-
(
|
|
2013
|
-
key:
|
|
1706
|
+
])) : ((Fe = d.value) == null ? void 0 : Fe.type) === "tree-single" ? (u(), h("div", ia, [
|
|
1707
|
+
(u(!0), h(de, null, ye(O(d.value), (k, U) => (u(), h("div", {
|
|
1708
|
+
key: U,
|
|
2014
1709
|
class: "rc-search-area__tree-group"
|
|
2015
1710
|
}, [
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
(
|
|
2019
|
-
key:
|
|
2020
|
-
class:
|
|
2021
|
-
onClick: (
|
|
1711
|
+
P("div", ua, G(y(k, d.value || void 0)), 1),
|
|
1712
|
+
P("div", ca, [
|
|
1713
|
+
(u(!0), h(de, null, ye(fe(k, d.value), (j, De) => (u(), h("div", {
|
|
1714
|
+
key: De,
|
|
1715
|
+
class: J(["rc-search-area__option", { "is-selected": L(j) }]),
|
|
1716
|
+
onClick: (xe) => Te(j)
|
|
2022
1717
|
}, [
|
|
2023
|
-
|
|
2024
|
-
|
|
1718
|
+
P("span", fa, G(y(j, d.value || void 0)), 1),
|
|
1719
|
+
L(j) ? (u(), se(ne(te), {
|
|
2025
1720
|
key: 0,
|
|
2026
1721
|
name: "icon_check",
|
|
2027
1722
|
class: "rc-search-area__option-check"
|
|
2028
|
-
})) :
|
|
2029
|
-
], 10,
|
|
1723
|
+
})) : F("", !0)
|
|
1724
|
+
], 10, da))), 128))
|
|
2030
1725
|
])
|
|
2031
1726
|
]))), 128))
|
|
2032
|
-
])) : ((
|
|
2033
|
-
(
|
|
2034
|
-
key:
|
|
1727
|
+
])) : ((Ie = d.value) == null ? void 0 : Ie.type) === "tree-multiple" ? (u(), h("div", va, [
|
|
1728
|
+
(u(!0), h(de, null, ye(O(d.value), (k, U) => (u(), h("div", {
|
|
1729
|
+
key: U,
|
|
2035
1730
|
class: "rc-search-area__tree-group"
|
|
2036
1731
|
}, [
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
(
|
|
2040
|
-
key:
|
|
2041
|
-
class:
|
|
2042
|
-
onClick: (
|
|
1732
|
+
P("div", ma, G(y(k, d.value || void 0)), 1),
|
|
1733
|
+
P("div", pa, [
|
|
1734
|
+
(u(!0), h(de, null, ye(fe(k, d.value), (j, De) => (u(), h("div", {
|
|
1735
|
+
key: De,
|
|
1736
|
+
class: J(["rc-search-area__option", { "is-selected": L(j) }]),
|
|
1737
|
+
onClick: (xe) => V(j)
|
|
2043
1738
|
}, [
|
|
2044
|
-
|
|
2045
|
-
|
|
1739
|
+
P("span", ya, G(y(j, d.value || void 0)), 1),
|
|
1740
|
+
L(j) ? (u(), se(ne(te), {
|
|
2046
1741
|
key: 0,
|
|
2047
1742
|
name: "icon_check",
|
|
2048
1743
|
class: "rc-search-area__option-check"
|
|
2049
|
-
})) :
|
|
2050
|
-
], 10,
|
|
1744
|
+
})) : F("", !0)
|
|
1745
|
+
], 10, ha))), 128))
|
|
2051
1746
|
])
|
|
2052
1747
|
]))), 128))
|
|
2053
|
-
])) : ((
|
|
2054
|
-
(
|
|
2055
|
-
key:
|
|
2056
|
-
class:
|
|
2057
|
-
onClick: (
|
|
1748
|
+
])) : ((Ye = d.value) == null ? void 0 : Ye.type) === "single" ? (u(), h("div", ga, [
|
|
1749
|
+
(u(!0), h(de, null, ye(I(d.value), (k, U) => (u(), h("div", {
|
|
1750
|
+
key: U,
|
|
1751
|
+
class: J(["rc-search-area__option", { "is-selected": L(k) }]),
|
|
1752
|
+
onClick: (j) => Te(k)
|
|
2058
1753
|
}, [
|
|
2059
|
-
|
|
2060
|
-
|
|
1754
|
+
P("span", _a, G(y(k, d.value || void 0)), 1),
|
|
1755
|
+
L(k) ? (u(), se(ne(te), {
|
|
2061
1756
|
key: 0,
|
|
2062
1757
|
name: "icon_check",
|
|
2063
1758
|
class: "rc-search-area__option-check"
|
|
2064
|
-
})) :
|
|
2065
|
-
], 10,
|
|
2066
|
-
])) : (
|
|
2067
|
-
(
|
|
2068
|
-
key:
|
|
2069
|
-
class:
|
|
2070
|
-
onClick: (
|
|
1759
|
+
})) : F("", !0)
|
|
1760
|
+
], 10, ba))), 128))
|
|
1761
|
+
])) : (u(), h("div", ka, [
|
|
1762
|
+
(u(!0), h(de, null, ye(I(d.value), (k, U) => (u(), h("div", {
|
|
1763
|
+
key: U,
|
|
1764
|
+
class: J(["rc-search-area__option", { "is-selected": L(k) }]),
|
|
1765
|
+
onClick: (j) => V(k)
|
|
2071
1766
|
}, [
|
|
2072
|
-
|
|
2073
|
-
|
|
1767
|
+
P("span", $a, G(y(k, d.value || void 0)), 1),
|
|
1768
|
+
L(k) ? (u(), se(ne(te), {
|
|
2074
1769
|
key: 0,
|
|
2075
1770
|
name: "icon_check",
|
|
2076
1771
|
class: "rc-search-area__option-check"
|
|
2077
|
-
})) :
|
|
2078
|
-
], 10,
|
|
1772
|
+
})) : F("", !0)
|
|
1773
|
+
], 10, wa))), 128))
|
|
2079
1774
|
])),
|
|
2080
|
-
((
|
|
2081
|
-
|
|
2082
|
-
])])) :
|
|
1775
|
+
((Be = d.value) == null ? void 0 : Be.type) !== "input" && ((nt = d.value) == null ? void 0 : nt.type) !== "calendar" && !((at = d.value) != null && at.slot) && ((ot = (lt = d.value) == null ? void 0 : lt.options) == null ? void 0 : ot.length) === 0 ? (u(), h("div", Da, [...s[2] || (s[2] = [
|
|
1776
|
+
P("p", null, "暂无选项", -1)
|
|
1777
|
+
])])) : F("", !0)
|
|
2083
1778
|
]),
|
|
2084
|
-
!
|
|
2085
|
-
|
|
1779
|
+
!e.autoConfirm && ((a = d.value) == null ? void 0 : a.type) !== "single" && ((v = d.value) == null ? void 0 : v.type) !== "tree-single" ? (u(), h("div", xa, [
|
|
1780
|
+
X(ne($e), {
|
|
2086
1781
|
block: "",
|
|
2087
|
-
onClick:
|
|
1782
|
+
onClick: A
|
|
2088
1783
|
}, {
|
|
2089
|
-
default:
|
|
2090
|
-
|
|
1784
|
+
default: oe(() => [...s[3] || (s[3] = [
|
|
1785
|
+
Se(" 重置 ", -1)
|
|
2091
1786
|
])]),
|
|
2092
1787
|
_: 1
|
|
2093
1788
|
}),
|
|
2094
|
-
|
|
1789
|
+
X(ne($e), {
|
|
2095
1790
|
type: "primary",
|
|
2096
1791
|
block: "",
|
|
2097
|
-
onClick:
|
|
1792
|
+
onClick: ge
|
|
2098
1793
|
}, {
|
|
2099
|
-
default:
|
|
2100
|
-
|
|
1794
|
+
default: oe(() => [
|
|
1795
|
+
Se(" 确定" + G(ie.value), 1)
|
|
2101
1796
|
]),
|
|
2102
1797
|
_: 1
|
|
2103
1798
|
})
|
|
2104
|
-
])) :
|
|
2105
|
-
], 512)) :
|
|
1799
|
+
])) : F("", !0)
|
|
1800
|
+
], 512)) : F("", !0)
|
|
2106
1801
|
];
|
|
2107
1802
|
}),
|
|
2108
1803
|
_: 3
|
|
2109
1804
|
})
|
|
2110
1805
|
]));
|
|
2111
1806
|
}
|
|
2112
|
-
}),
|
|
2113
|
-
|
|
2114
|
-
},
|
|
1807
|
+
}), Ct = /* @__PURE__ */ ce(Ca, [["__scopeId", "data-v-1418db5c"]]), St = (t) => {
|
|
1808
|
+
t.component("RcSearchArea", Ct), t.component("rc-search-area", Ct);
|
|
1809
|
+
}, Sa = ["disabled"], Ma = {
|
|
1810
|
+
key: 1,
|
|
1811
|
+
class: "rc-input__prepend"
|
|
1812
|
+
}, Ra = { class: "rc-input__wrapper" }, Va = {
|
|
1813
|
+
key: 0,
|
|
1814
|
+
class: "rc-input__prefix"
|
|
1815
|
+
}, Ia = {
|
|
1816
|
+
key: 1,
|
|
1817
|
+
class: "rc-input__textarea-wrapper"
|
|
1818
|
+
}, Ta = {
|
|
1819
|
+
key: 3,
|
|
1820
|
+
class: "rc-input__suffix"
|
|
1821
|
+
}, Fa = {
|
|
1822
|
+
key: 0,
|
|
1823
|
+
class: "rc-input__suffix-inner"
|
|
1824
|
+
}, Aa = {
|
|
1825
|
+
key: 4,
|
|
1826
|
+
class: "rc-input__count"
|
|
1827
|
+
}, Ba = {
|
|
1828
|
+
key: 2,
|
|
1829
|
+
class: "rc-input__append"
|
|
1830
|
+
}, Ea = ["disabled"], Pa = /* @__PURE__ */ ue({
|
|
1831
|
+
__name: "index",
|
|
1832
|
+
props: {
|
|
1833
|
+
modelValue: { default: "" },
|
|
1834
|
+
type: { default: "text" },
|
|
1835
|
+
size: { default: "default" },
|
|
1836
|
+
placeholder: { default: "请输入" },
|
|
1837
|
+
disabled: { type: Boolean, default: !1 },
|
|
1838
|
+
clearable: { type: Boolean, default: !0 },
|
|
1839
|
+
showPassword: { type: Boolean, default: !1 },
|
|
1840
|
+
readonly: { type: Boolean, default: !1 },
|
|
1841
|
+
maxlength: { default: void 0 },
|
|
1842
|
+
minlength: { default: void 0 },
|
|
1843
|
+
showWordLimit: { type: Boolean, default: !1 },
|
|
1844
|
+
rows: { default: 2 },
|
|
1845
|
+
autosize: { type: [Boolean, Object], default: !1 },
|
|
1846
|
+
resize: { default: void 0 },
|
|
1847
|
+
prefixIcon: { default: "" },
|
|
1848
|
+
suffixIcon: { default: "" },
|
|
1849
|
+
autocomplete: { default: "off" },
|
|
1850
|
+
name: { default: void 0 },
|
|
1851
|
+
autofocus: { type: Boolean, default: !1 },
|
|
1852
|
+
form: { default: void 0 },
|
|
1853
|
+
tabindex: { default: void 0 },
|
|
1854
|
+
formatter: { type: Function, default: void 0 },
|
|
1855
|
+
parser: { type: Function, default: void 0 },
|
|
1856
|
+
deviceType: { default: void 0 },
|
|
1857
|
+
min: { default: void 0 },
|
|
1858
|
+
max: { default: void 0 },
|
|
1859
|
+
step: { default: 1 },
|
|
1860
|
+
precision: { default: void 0 },
|
|
1861
|
+
controls: { type: Boolean, default: !1 },
|
|
1862
|
+
useGrouping: { type: Boolean, default: !1 }
|
|
1863
|
+
},
|
|
1864
|
+
emits: ["update:modelValue", "input", "change", "focus", "blur", "clear", "keydown", "mouseenter", "mouseleave", "compositionstart", "compositionupdate", "compositionend"],
|
|
1865
|
+
setup(t, { expose: i, emit: l }) {
|
|
1866
|
+
const e = t, g = be(ut, {}), f = be("rcFormItem", void 0), $ = B(() => e.deviceType || (g == null ? void 0 : g.inputDeviceType) || ft.inputDeviceType || "pc"), o = l, r = W(), m = W(e.modelValue ?? ""), N = W(!1), x = W(!1), w = W(!1);
|
|
1867
|
+
_e(
|
|
1868
|
+
() => e.modelValue,
|
|
1869
|
+
(c) => {
|
|
1870
|
+
m.value = c ?? "";
|
|
1871
|
+
}
|
|
1872
|
+
);
|
|
1873
|
+
const D = B(() => e.type === "number"), H = B(() => e.type === "password" ? x.value ? "text" : "password" : D.value ? "text" : e.type), T = B(() => {
|
|
1874
|
+
if (D.value) {
|
|
1875
|
+
const z = _(m.value);
|
|
1876
|
+
if (z == null)
|
|
1877
|
+
return "";
|
|
1878
|
+
let M = String(z);
|
|
1879
|
+
return e.precision !== void 0 && (M = z.toFixed(e.precision)), e.useGrouping && !w.value && (M = C(M)), M;
|
|
1880
|
+
}
|
|
1881
|
+
const c = String(m.value ?? "");
|
|
1882
|
+
return e.formatter && !w.value ? e.formatter(c) : c;
|
|
1883
|
+
}), d = B(() => {
|
|
1884
|
+
const c = m.value;
|
|
1885
|
+
return c !== "" && c !== null && c !== void 0;
|
|
1886
|
+
}), ie = B(() => String(m.value ?? "").length), ae = B(() => !e.clearable || !d.value || e.disabled || e.readonly ? !1 : ($.value === "mobile", !0)), b = Yt(), Y = B(() => D.value && e.controls ? !!(e.suffixIcon || b.suffix) : !!(e.suffixIcon || e.showPassword && e.type === "password" || ae.value && e.type !== "textarea" && !D.value || b.suffix)), y = B(() => {
|
|
1887
|
+
if (e.type !== "textarea") return {};
|
|
1888
|
+
const c = {};
|
|
1889
|
+
return e.autosize ? c.resize = "none" : e.resize !== void 0 ? c.resize = e.resize : c.resize = "vertical", c;
|
|
1890
|
+
});
|
|
1891
|
+
function _(c) {
|
|
1892
|
+
if (c == null || c === "")
|
|
1893
|
+
return null;
|
|
1894
|
+
if (typeof c == "number")
|
|
1895
|
+
return isNaN(c) ? null : c;
|
|
1896
|
+
const z = Number(String(c).replace(/,/g, ""));
|
|
1897
|
+
return isNaN(z) ? null : z;
|
|
1898
|
+
}
|
|
1899
|
+
function C(c) {
|
|
1900
|
+
const z = c.split(".");
|
|
1901
|
+
return z[0] = z[0].replace(/\B(?=(\d{3})+(?!\d))/g, ","), z.join(".");
|
|
1902
|
+
}
|
|
1903
|
+
function S(c) {
|
|
1904
|
+
if (c === null) return null;
|
|
1905
|
+
let z = c;
|
|
1906
|
+
return e.min !== void 0 && z < e.min && (z = e.min), e.max !== void 0 && z > e.max && (z = e.max), e.precision !== void 0 && (z = Number(z.toFixed(e.precision))), z;
|
|
1907
|
+
}
|
|
1908
|
+
const R = B(() => {
|
|
1909
|
+
if (!D.value || e.max === void 0) return !1;
|
|
1910
|
+
const c = _(m.value);
|
|
1911
|
+
return c !== null && c >= e.max;
|
|
1912
|
+
}), L = B(() => {
|
|
1913
|
+
if (!D.value || e.min === void 0) return !1;
|
|
1914
|
+
const c = _(m.value);
|
|
1915
|
+
return c !== null && c <= e.min;
|
|
1916
|
+
});
|
|
1917
|
+
function I(c) {
|
|
1918
|
+
var Ve, Fe, Ie;
|
|
1919
|
+
let M = c.target.value;
|
|
1920
|
+
if (D.value && (M = M.replace(/,/g, "")), e.parser && !w.value && (M = e.parser(M)), D.value) {
|
|
1921
|
+
if (M === "" || M === "-" || M === ".") {
|
|
1922
|
+
m.value = M === "" ? void 0 : M, o("update:modelValue", M === "" ? void 0 : M), o("input", M === "" ? void 0 : M), (Ve = f == null ? void 0 : f.onChange) == null || Ve.call(f);
|
|
1923
|
+
return;
|
|
1924
|
+
}
|
|
1925
|
+
const Ye = _(M);
|
|
1926
|
+
if (Ye !== null) {
|
|
1927
|
+
const Be = S(Ye);
|
|
1928
|
+
m.value = Be, o("update:modelValue", Be), o("input", Be);
|
|
1929
|
+
} else
|
|
1930
|
+
m.value = M, o("update:modelValue", M), o("input", M);
|
|
1931
|
+
(Fe = f == null ? void 0 : f.onChange) == null || Fe.call(f);
|
|
1932
|
+
return;
|
|
1933
|
+
}
|
|
1934
|
+
const q = M === "" ? void 0 : M;
|
|
1935
|
+
m.value = q, o("update:modelValue", q), o("input", q), (Ie = f == null ? void 0 : f.onChange) == null || Ie.call(f), e.type === "textarea" && e.autosize && ze(() => {
|
|
1936
|
+
s();
|
|
1937
|
+
});
|
|
1938
|
+
}
|
|
1939
|
+
function O(c) {
|
|
1940
|
+
N.value = !0, o("focus", c);
|
|
1941
|
+
}
|
|
1942
|
+
function fe(c) {
|
|
1943
|
+
var z;
|
|
1944
|
+
if (N.value = !1, D.value) {
|
|
1945
|
+
const M = _(m.value);
|
|
1946
|
+
if (M !== null) {
|
|
1947
|
+
const q = S(M);
|
|
1948
|
+
m.value = q, o("update:modelValue", q), o("change", q);
|
|
1949
|
+
} else
|
|
1950
|
+
m.value = void 0, o("update:modelValue", void 0), o("change", void 0);
|
|
1951
|
+
} else {
|
|
1952
|
+
const M = m.value;
|
|
1953
|
+
o("change", M === "" ? void 0 : M);
|
|
1954
|
+
}
|
|
1955
|
+
o("blur", c), (z = f == null ? void 0 : f.onBlur) == null || z.call(f);
|
|
1956
|
+
}
|
|
1957
|
+
function ke() {
|
|
1958
|
+
m.value = void 0, o("update:modelValue", void 0), o("input", void 0), o("change", void 0), o("clear"), ze(() => {
|
|
1959
|
+
var c;
|
|
1960
|
+
(c = r.value) == null || c.focus();
|
|
1961
|
+
});
|
|
1962
|
+
}
|
|
1963
|
+
function Me() {
|
|
1964
|
+
x.value = !x.value;
|
|
1965
|
+
}
|
|
1966
|
+
function Te() {
|
|
1967
|
+
var q;
|
|
1968
|
+
if (e.disabled || e.readonly || R.value) return;
|
|
1969
|
+
const c = _(m.value), z = e.step ?? 1;
|
|
1970
|
+
let M;
|
|
1971
|
+
c === null ? M = S(e.min ?? 0) ?? 0 : M = S(c + z) ?? c, m.value = M, o("update:modelValue", M), o("input", M), o("change", M), (q = f == null ? void 0 : f.onChange) == null || q.call(f);
|
|
1972
|
+
}
|
|
1973
|
+
function V() {
|
|
1974
|
+
var q;
|
|
1975
|
+
if (e.disabled || e.readonly || L.value) return;
|
|
1976
|
+
const c = _(m.value), z = e.step ?? 1;
|
|
1977
|
+
let M;
|
|
1978
|
+
c === null ? M = S(e.max ?? 0) ?? 0 : M = S(c - z) ?? c, m.value = M, o("update:modelValue", M), o("input", M), o("change", M), (q = f == null ? void 0 : f.onChange) == null || q.call(f);
|
|
1979
|
+
}
|
|
1980
|
+
function A(c) {
|
|
1981
|
+
if (o("keydown", c), D.value && !e.disabled && !e.readonly) {
|
|
1982
|
+
const z = e.step ?? 1, M = _(m.value);
|
|
1983
|
+
if (c.key === "ArrowUp") {
|
|
1984
|
+
c.preventDefault(), Te();
|
|
1985
|
+
return;
|
|
1986
|
+
}
|
|
1987
|
+
if (c.key === "ArrowDown") {
|
|
1988
|
+
c.preventDefault(), V();
|
|
1989
|
+
return;
|
|
1990
|
+
}
|
|
1991
|
+
if (c.key === "PageUp") {
|
|
1992
|
+
if (c.preventDefault(), M !== null) {
|
|
1993
|
+
const q = S(M + z * 10);
|
|
1994
|
+
m.value = q, o("update:modelValue", q), o("input", q), o("change", q);
|
|
1995
|
+
}
|
|
1996
|
+
return;
|
|
1997
|
+
}
|
|
1998
|
+
if (c.key === "PageDown") {
|
|
1999
|
+
if (c.preventDefault(), M !== null) {
|
|
2000
|
+
const q = S(M - z * 10);
|
|
2001
|
+
m.value = q, o("update:modelValue", q), o("input", q), o("change", q);
|
|
2002
|
+
}
|
|
2003
|
+
return;
|
|
2004
|
+
}
|
|
2005
|
+
}
|
|
2006
|
+
if (c.key === "Enter" && e.type !== "textarea") {
|
|
2007
|
+
const z = m.value;
|
|
2008
|
+
o("change", z === "" ? void 0 : z);
|
|
2009
|
+
}
|
|
2010
|
+
}
|
|
2011
|
+
function K(c) {
|
|
2012
|
+
o("mouseenter", c);
|
|
2013
|
+
}
|
|
2014
|
+
function le(c) {
|
|
2015
|
+
o("mouseleave", c);
|
|
2016
|
+
}
|
|
2017
|
+
function ge(c) {
|
|
2018
|
+
w.value = !0, o("compositionstart", c);
|
|
2019
|
+
}
|
|
2020
|
+
function we(c) {
|
|
2021
|
+
o("compositionupdate", c);
|
|
2022
|
+
}
|
|
2023
|
+
function Re(c) {
|
|
2024
|
+
w.value = !1, o("compositionend", c), c.target && I(c);
|
|
2025
|
+
}
|
|
2026
|
+
function n() {
|
|
2027
|
+
var c;
|
|
2028
|
+
e.disabled || e.readonly || (c = r.value) == null || c.focus();
|
|
2029
|
+
}
|
|
2030
|
+
function s() {
|
|
2031
|
+
if (e.type !== "textarea" || !r.value) return;
|
|
2032
|
+
const c = r.value;
|
|
2033
|
+
if (e.autosize) {
|
|
2034
|
+
c.style.height = "auto";
|
|
2035
|
+
const z = c.scrollHeight;
|
|
2036
|
+
if (typeof e.autosize == "object") {
|
|
2037
|
+
const { minRows: M = 2, maxRows: q } = e.autosize, Ve = parseInt(getComputedStyle(c).lineHeight) || 20, Fe = M * Ve, Ie = q ? q * Ve : 1 / 0;
|
|
2038
|
+
c.style.height = `${Math.min(Math.max(z, Fe), Ie)}px`;
|
|
2039
|
+
} else
|
|
2040
|
+
c.style.height = `${z}px`;
|
|
2041
|
+
}
|
|
2042
|
+
}
|
|
2043
|
+
function p() {
|
|
2044
|
+
var c;
|
|
2045
|
+
(c = r.value) == null || c.focus();
|
|
2046
|
+
}
|
|
2047
|
+
function E() {
|
|
2048
|
+
var c;
|
|
2049
|
+
(c = r.value) == null || c.blur();
|
|
2050
|
+
}
|
|
2051
|
+
function ee() {
|
|
2052
|
+
r.value && "select" in r.value && r.value.select();
|
|
2053
|
+
}
|
|
2054
|
+
function Q() {
|
|
2055
|
+
ke();
|
|
2056
|
+
}
|
|
2057
|
+
return Je(() => {
|
|
2058
|
+
e.type === "textarea" && e.autosize && s();
|
|
2059
|
+
}), i({
|
|
2060
|
+
focus: p,
|
|
2061
|
+
blur: E,
|
|
2062
|
+
select: ee,
|
|
2063
|
+
clear: Q,
|
|
2064
|
+
resizeTextarea: s,
|
|
2065
|
+
inputRef: r
|
|
2066
|
+
}), (c, z) => (u(), h("div", {
|
|
2067
|
+
class: J(["rc-input", [
|
|
2068
|
+
`rc-input--${t.size}`,
|
|
2069
|
+
{
|
|
2070
|
+
"is-disabled": t.disabled,
|
|
2071
|
+
"is-focused": N.value,
|
|
2072
|
+
"is-readonly": t.readonly,
|
|
2073
|
+
"rc-input--textarea": t.type === "textarea",
|
|
2074
|
+
"has-prepend": c.$slots.prepend || D.value && t.controls,
|
|
2075
|
+
"has-append": c.$slots.append || D.value && t.controls
|
|
2076
|
+
}
|
|
2077
|
+
]]),
|
|
2078
|
+
onClick: n
|
|
2079
|
+
}, [
|
|
2080
|
+
D.value && t.controls ? (u(), h("button", {
|
|
2081
|
+
key: 0,
|
|
2082
|
+
type: "button",
|
|
2083
|
+
class: "rc-input__number-btn rc-input__number-btn--decrease rc-input__number-btn--prepend",
|
|
2084
|
+
disabled: e.disabled || e.readonly || L.value,
|
|
2085
|
+
onClick: Ae(V, ["stop"])
|
|
2086
|
+
}, [...z[0] || (z[0] = [
|
|
2087
|
+
P("span", { class: "rc-input__number-text" }, "-", -1)
|
|
2088
|
+
])], 8, Sa)) : F("", !0),
|
|
2089
|
+
c.$slots.prepend ? (u(), h("div", Ma, [
|
|
2090
|
+
Z(c.$slots, "prepend", {}, void 0, !0)
|
|
2091
|
+
])) : F("", !0),
|
|
2092
|
+
P("div", Ra, [
|
|
2093
|
+
t.prefixIcon || c.$slots.prefix ? (u(), h("div", Va, [
|
|
2094
|
+
Z(c.$slots, "prefix", {}, () => [
|
|
2095
|
+
t.prefixIcon ? (u(), se(ne(te), {
|
|
2096
|
+
key: 0,
|
|
2097
|
+
name: t.prefixIcon,
|
|
2098
|
+
class: "rc-input__prefix-icon"
|
|
2099
|
+
}, null, 8, ["name"])) : F("", !0)
|
|
2100
|
+
], !0)
|
|
2101
|
+
])) : F("", !0),
|
|
2102
|
+
t.type === "textarea" ? (u(), h("div", Ia, [
|
|
2103
|
+
(u(), se(pt("textarea"), {
|
|
2104
|
+
ref_key: "inputRef",
|
|
2105
|
+
ref: r,
|
|
2106
|
+
value: T.value,
|
|
2107
|
+
class: "rc-input__field rc-input__field--textarea",
|
|
2108
|
+
placeholder: t.placeholder,
|
|
2109
|
+
disabled: t.disabled,
|
|
2110
|
+
readonly: t.readonly,
|
|
2111
|
+
maxlength: t.maxlength,
|
|
2112
|
+
minlength: t.minlength,
|
|
2113
|
+
rows: t.rows,
|
|
2114
|
+
autocomplete: t.autocomplete,
|
|
2115
|
+
name: t.name,
|
|
2116
|
+
autofocus: t.autofocus,
|
|
2117
|
+
form: t.form,
|
|
2118
|
+
tabindex: t.tabindex,
|
|
2119
|
+
style: re(y.value),
|
|
2120
|
+
onInput: I,
|
|
2121
|
+
onFocus: O,
|
|
2122
|
+
onBlur: fe,
|
|
2123
|
+
onKeydown: A,
|
|
2124
|
+
onMouseenter: K,
|
|
2125
|
+
onMouseleave: le,
|
|
2126
|
+
onCompositionstart: ge,
|
|
2127
|
+
onCompositionupdate: we,
|
|
2128
|
+
onCompositionend: Re
|
|
2129
|
+
}, null, 40, ["value", "placeholder", "disabled", "readonly", "maxlength", "minlength", "rows", "autocomplete", "name", "autofocus", "form", "tabindex", "style"])),
|
|
2130
|
+
ae.value && t.type === "textarea" ? (u(), h("button", {
|
|
2131
|
+
key: 0,
|
|
2132
|
+
type: "button",
|
|
2133
|
+
class: J(["rc-input__clear rc-input__clear--textarea", { "rc-input__clear--mobile": $.value === "mobile" }]),
|
|
2134
|
+
onClick: Ae(ke, ["stop"])
|
|
2135
|
+
}, [
|
|
2136
|
+
X(ne(te), {
|
|
2137
|
+
name: "icon_close_circle",
|
|
2138
|
+
class: "rc-input__clear-icon"
|
|
2139
|
+
})
|
|
2140
|
+
], 2)) : F("", !0)
|
|
2141
|
+
])) : (u(), se(pt("input"), {
|
|
2142
|
+
key: 2,
|
|
2143
|
+
ref_key: "inputRef",
|
|
2144
|
+
ref: r,
|
|
2145
|
+
value: T.value,
|
|
2146
|
+
type: H.value,
|
|
2147
|
+
class: J(["rc-input__field", { "rc-input__field--number": D.value }]),
|
|
2148
|
+
placeholder: t.placeholder,
|
|
2149
|
+
disabled: t.disabled,
|
|
2150
|
+
readonly: t.readonly,
|
|
2151
|
+
maxlength: t.maxlength,
|
|
2152
|
+
minlength: t.minlength,
|
|
2153
|
+
autocomplete: t.autocomplete,
|
|
2154
|
+
name: t.name,
|
|
2155
|
+
autofocus: t.autofocus,
|
|
2156
|
+
form: t.form,
|
|
2157
|
+
tabindex: t.tabindex,
|
|
2158
|
+
min: D.value ? t.min : void 0,
|
|
2159
|
+
max: D.value ? t.max : void 0,
|
|
2160
|
+
step: D.value ? t.step : void 0,
|
|
2161
|
+
onInput: I,
|
|
2162
|
+
onFocus: O,
|
|
2163
|
+
onBlur: fe,
|
|
2164
|
+
onKeydown: A,
|
|
2165
|
+
onMouseenter: K,
|
|
2166
|
+
onMouseleave: le,
|
|
2167
|
+
onCompositionstart: ge,
|
|
2168
|
+
onCompositionupdate: we,
|
|
2169
|
+
onCompositionend: Re
|
|
2170
|
+
}, null, 40, ["value", "type", "class", "placeholder", "disabled", "readonly", "maxlength", "minlength", "autocomplete", "name", "autofocus", "form", "tabindex", "min", "max", "step"])),
|
|
2171
|
+
Y.value ? (u(), h("div", Ta, [
|
|
2172
|
+
c.$slots.suffix ? (u(), h("div", Fa, [
|
|
2173
|
+
Z(c.$slots, "suffix", {}, void 0, !0)
|
|
2174
|
+
])) : F("", !0),
|
|
2175
|
+
t.showPassword && t.type === "password" && d.value ? (u(), h("button", {
|
|
2176
|
+
key: 1,
|
|
2177
|
+
type: "button",
|
|
2178
|
+
class: "rc-input__password-toggle",
|
|
2179
|
+
onClick: Ae(Me, ["stop"])
|
|
2180
|
+
}, [
|
|
2181
|
+
X(ne(te), {
|
|
2182
|
+
color: x.value ? "#1677ff" : "#999",
|
|
2183
|
+
name: x.value ? "icon_view" : "icon_view-off"
|
|
2184
|
+
}, null, 8, ["color", "name"])
|
|
2185
|
+
])) : F("", !0),
|
|
2186
|
+
ae.value && t.type !== "textarea" && !D.value ? (u(), h("button", {
|
|
2187
|
+
key: 2,
|
|
2188
|
+
type: "button",
|
|
2189
|
+
class: J(["rc-input__clear", { "rc-input__clear--mobile": $.value === "mobile" }]),
|
|
2190
|
+
onClick: Ae(ke, ["stop"])
|
|
2191
|
+
}, [
|
|
2192
|
+
X(ne(te), {
|
|
2193
|
+
name: "icon_close_circle",
|
|
2194
|
+
class: "rc-input__clear-icon"
|
|
2195
|
+
})
|
|
2196
|
+
], 2)) : F("", !0),
|
|
2197
|
+
t.suffixIcon && !t.clearable && !t.showPassword && !D.value ? (u(), se(ne(te), {
|
|
2198
|
+
key: 3,
|
|
2199
|
+
name: t.suffixIcon,
|
|
2200
|
+
class: "rc-input__suffix-icon"
|
|
2201
|
+
}, null, 8, ["name"])) : F("", !0)
|
|
2202
|
+
])) : F("", !0),
|
|
2203
|
+
t.showWordLimit && t.maxlength ? (u(), h("span", Aa, G(ie.value) + " / " + G(t.maxlength), 1)) : F("", !0)
|
|
2204
|
+
]),
|
|
2205
|
+
c.$slots.append ? (u(), h("div", Ba, [
|
|
2206
|
+
Z(c.$slots, "append", {}, void 0, !0)
|
|
2207
|
+
])) : F("", !0),
|
|
2208
|
+
D.value && t.controls ? (u(), h("button", {
|
|
2209
|
+
key: 3,
|
|
2210
|
+
type: "button",
|
|
2211
|
+
class: "rc-input__number-btn rc-input__number-btn--increase rc-input__number-btn--append",
|
|
2212
|
+
disabled: e.disabled || e.readonly || R.value,
|
|
2213
|
+
onClick: Ae(Te, ["stop"])
|
|
2214
|
+
}, [...z[1] || (z[1] = [
|
|
2215
|
+
P("span", { class: "rc-input__number-text" }, "+", -1)
|
|
2216
|
+
])], 8, Ea)) : F("", !0)
|
|
2217
|
+
], 2));
|
|
2218
|
+
}
|
|
2219
|
+
}), Xe = /* @__PURE__ */ ce(Pa, [["__scopeId", "data-v-df542089"]]);
|
|
2220
|
+
Xe && (Xe.name = "rc-input");
|
|
2221
|
+
function Mt(t) {
|
|
2222
|
+
return Xe && t.component(Xe.name || "rc-input", Xe), t;
|
|
2223
|
+
}
|
|
2224
|
+
const Na = /* @__PURE__ */ ue({
|
|
2115
2225
|
name: "rc-dropdown-menu",
|
|
2116
2226
|
__name: "menu",
|
|
2117
2227
|
props: {
|
|
@@ -2120,50 +2230,50 @@ const oa = { class: "rc-search-area" }, ra = { class: "rc-search-area__bar" }, s
|
|
|
2120
2230
|
maxHeight: { default: "" }
|
|
2121
2231
|
},
|
|
2122
2232
|
emits: ["mouseenter", "mouseleave"],
|
|
2123
|
-
setup(
|
|
2124
|
-
const
|
|
2125
|
-
const
|
|
2126
|
-
return
|
|
2233
|
+
setup(t, { expose: i, emit: l }) {
|
|
2234
|
+
const e = t, g = W(), f = B(() => e.visible === void 0 ? !0 : e.visible), $ = B(() => e.visible !== void 0), o = B(() => {
|
|
2235
|
+
const r = {};
|
|
2236
|
+
return e.maxHeight && (r.maxHeight = typeof e.maxHeight == "number" ? `${e.maxHeight}px` : e.maxHeight, r.overflowY = "auto"), r;
|
|
2127
2237
|
});
|
|
2128
|
-
return
|
|
2129
|
-
menuRef:
|
|
2130
|
-
}), (
|
|
2238
|
+
return i({
|
|
2239
|
+
menuRef: g
|
|
2240
|
+
}), (r, m) => $.value ? (u(), se(dt, {
|
|
2131
2241
|
key: 0,
|
|
2132
2242
|
to: "body"
|
|
2133
2243
|
}, [
|
|
2134
|
-
|
|
2135
|
-
default:
|
|
2136
|
-
|
|
2244
|
+
X(Ne, { name: "rc-dropdown-fade" }, {
|
|
2245
|
+
default: oe(() => [
|
|
2246
|
+
f.value ? (u(), h("ul", {
|
|
2137
2247
|
key: 0,
|
|
2138
2248
|
ref_key: "menuRef",
|
|
2139
|
-
ref:
|
|
2140
|
-
class:
|
|
2141
|
-
style:
|
|
2142
|
-
onClick:
|
|
2249
|
+
ref: g,
|
|
2250
|
+
class: J(["rc-dropdown-menu", [`rc-dropdown-menu--${t.effect}`]]),
|
|
2251
|
+
style: re(o.value),
|
|
2252
|
+
onClick: m[0] || (m[0] = Ae(() => {
|
|
2143
2253
|
}, ["stop"])),
|
|
2144
|
-
onMouseenter:
|
|
2145
|
-
onMouseleave:
|
|
2254
|
+
onMouseenter: m[1] || (m[1] = (N) => r.$emit("mouseenter", N)),
|
|
2255
|
+
onMouseleave: m[2] || (m[2] = (N) => r.$emit("mouseleave", N))
|
|
2146
2256
|
}, [
|
|
2147
|
-
|
|
2148
|
-
], 38)) :
|
|
2257
|
+
Z(r.$slots, "default", {}, void 0, !0)
|
|
2258
|
+
], 38)) : F("", !0)
|
|
2149
2259
|
]),
|
|
2150
2260
|
_: 3
|
|
2151
2261
|
})
|
|
2152
|
-
])) : (
|
|
2262
|
+
])) : (u(), h("ul", {
|
|
2153
2263
|
key: 1,
|
|
2154
2264
|
ref_key: "menuRef",
|
|
2155
|
-
ref:
|
|
2156
|
-
class:
|
|
2157
|
-
style:
|
|
2158
|
-
onClick:
|
|
2265
|
+
ref: g,
|
|
2266
|
+
class: J(["rc-dropdown-menu rc-dropdown-menu--nested", [`rc-dropdown-menu--${t.effect}`]]),
|
|
2267
|
+
style: re(o.value),
|
|
2268
|
+
onClick: m[3] || (m[3] = Ae(() => {
|
|
2159
2269
|
}, ["stop"])),
|
|
2160
|
-
onMouseenter:
|
|
2161
|
-
onMouseleave:
|
|
2270
|
+
onMouseenter: m[4] || (m[4] = (N) => r.$emit("mouseenter", N)),
|
|
2271
|
+
onMouseleave: m[5] || (m[5] = (N) => r.$emit("mouseleave", N))
|
|
2162
2272
|
}, [
|
|
2163
|
-
|
|
2273
|
+
Z(r.$slots, "default", {}, void 0, !0)
|
|
2164
2274
|
], 38));
|
|
2165
2275
|
}
|
|
2166
|
-
}),
|
|
2276
|
+
}), Oe = /* @__PURE__ */ ce(Na, [["__scopeId", "data-v-288e2690"]]), za = /* @__PURE__ */ ue({
|
|
2167
2277
|
name: "rc-dropdown",
|
|
2168
2278
|
__name: "index",
|
|
2169
2279
|
props: {
|
|
@@ -2177,153 +2287,153 @@ const oa = { class: "rc-search-area" }, ra = { class: "rc-search-area__bar" }, s
|
|
|
2177
2287
|
hideTimeout: { default: 150 }
|
|
2178
2288
|
},
|
|
2179
2289
|
emits: ["command", "visible-change"],
|
|
2180
|
-
setup(
|
|
2181
|
-
const
|
|
2182
|
-
let
|
|
2183
|
-
function
|
|
2184
|
-
|
|
2185
|
-
}
|
|
2186
|
-
|
|
2187
|
-
function
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2290
|
+
setup(t, { expose: i, emit: l }) {
|
|
2291
|
+
const e = t, g = l, f = W(), $ = W(), o = W(!1);
|
|
2292
|
+
let r = null, m = null;
|
|
2293
|
+
function N(C) {
|
|
2294
|
+
e.hideOnClick && (o.value = !1), C !== void 0 && g("command", C);
|
|
2295
|
+
}
|
|
2296
|
+
Ce("handleItemClick", N);
|
|
2297
|
+
function x() {
|
|
2298
|
+
e.disabled || (r && (clearTimeout(r), r = null), m && (clearTimeout(m), m = null), r = setTimeout(() => {
|
|
2299
|
+
o.value = !0, requestAnimationFrame(() => {
|
|
2300
|
+
ze(() => {
|
|
2301
|
+
Y();
|
|
2192
2302
|
});
|
|
2193
2303
|
});
|
|
2194
|
-
},
|
|
2304
|
+
}, e.showTimeout));
|
|
2195
2305
|
}
|
|
2196
|
-
function
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
},
|
|
2306
|
+
function w() {
|
|
2307
|
+
e.trigger === "hover" && d.value || (m && (clearTimeout(m), m = null), r && (clearTimeout(r), r = null), m = setTimeout(() => {
|
|
2308
|
+
o.value = !1, d.value = !1;
|
|
2309
|
+
}, e.hideTimeout));
|
|
2200
2310
|
}
|
|
2201
|
-
function
|
|
2202
|
-
|
|
2311
|
+
function D() {
|
|
2312
|
+
e.disabled || (o.value ? w() : x());
|
|
2203
2313
|
}
|
|
2204
|
-
function
|
|
2205
|
-
|
|
2314
|
+
function H() {
|
|
2315
|
+
e.trigger === "hover" && !e.disabled && x();
|
|
2206
2316
|
}
|
|
2207
|
-
function
|
|
2208
|
-
|
|
2209
|
-
|
|
2317
|
+
function T() {
|
|
2318
|
+
e.trigger === "hover" && setTimeout(() => {
|
|
2319
|
+
d.value || w();
|
|
2210
2320
|
}, 50);
|
|
2211
2321
|
}
|
|
2212
|
-
const
|
|
2213
|
-
function
|
|
2214
|
-
|
|
2322
|
+
const d = W(!1);
|
|
2323
|
+
function ie() {
|
|
2324
|
+
e.trigger === "hover" && (d.value = !0, r && (clearTimeout(r), r = null), m && (clearTimeout(m), m = null));
|
|
2215
2325
|
}
|
|
2216
|
-
function
|
|
2217
|
-
|
|
2326
|
+
function ae() {
|
|
2327
|
+
e.trigger === "hover" && (d.value = !1, w());
|
|
2218
2328
|
}
|
|
2219
|
-
function
|
|
2220
|
-
|
|
2329
|
+
function b(C) {
|
|
2330
|
+
e.trigger === "click" && !e.disabled && (C.stopPropagation(), D());
|
|
2221
2331
|
}
|
|
2222
|
-
function
|
|
2223
|
-
var
|
|
2224
|
-
if (!
|
|
2225
|
-
const
|
|
2226
|
-
if (!
|
|
2227
|
-
const
|
|
2228
|
-
if (
|
|
2332
|
+
function Y() {
|
|
2333
|
+
var Me;
|
|
2334
|
+
if (!f.value || !((Me = $.value) != null && Me.menuRef)) return;
|
|
2335
|
+
const C = f.value, S = $.value.menuRef;
|
|
2336
|
+
if (!C || !S) return;
|
|
2337
|
+
const R = C.getBoundingClientRect(), L = S.getBoundingClientRect();
|
|
2338
|
+
if (L.width === 0 || L.height === 0) {
|
|
2229
2339
|
setTimeout(() => {
|
|
2230
|
-
|
|
2340
|
+
o.value && Y();
|
|
2231
2341
|
}, 10);
|
|
2232
2342
|
return;
|
|
2233
2343
|
}
|
|
2234
|
-
let
|
|
2235
|
-
switch (
|
|
2344
|
+
let I = 0, O = 0;
|
|
2345
|
+
switch (e.placement) {
|
|
2236
2346
|
case "top":
|
|
2237
|
-
|
|
2347
|
+
I = R.top - L.height, O = R.left;
|
|
2238
2348
|
break;
|
|
2239
2349
|
case "top-start":
|
|
2240
|
-
|
|
2350
|
+
I = R.top - L.height, O = R.left;
|
|
2241
2351
|
break;
|
|
2242
2352
|
case "top-end":
|
|
2243
|
-
|
|
2353
|
+
I = R.top - L.height, O = R.left + R.width - L.width;
|
|
2244
2354
|
break;
|
|
2245
2355
|
case "bottom":
|
|
2246
|
-
|
|
2356
|
+
I = R.bottom, O = R.left + (R.width - L.width) / 2;
|
|
2247
2357
|
break;
|
|
2248
2358
|
case "bottom-start":
|
|
2249
|
-
|
|
2359
|
+
I = R.bottom, O = R.left;
|
|
2250
2360
|
break;
|
|
2251
2361
|
case "bottom-end":
|
|
2252
|
-
|
|
2362
|
+
I = R.bottom, O = R.left + R.width - L.width;
|
|
2253
2363
|
break;
|
|
2254
2364
|
case "left":
|
|
2255
|
-
|
|
2365
|
+
I = R.top + (R.height - L.height) / 2, O = R.left - L.width;
|
|
2256
2366
|
break;
|
|
2257
2367
|
case "left-start":
|
|
2258
|
-
|
|
2368
|
+
I = R.top, O = R.left - L.width;
|
|
2259
2369
|
break;
|
|
2260
2370
|
case "left-end":
|
|
2261
|
-
|
|
2371
|
+
I = R.top + R.height - L.height, O = R.left - L.width;
|
|
2262
2372
|
break;
|
|
2263
2373
|
case "right":
|
|
2264
|
-
|
|
2374
|
+
I = R.top + (R.height - L.height) / 2, O = R.right;
|
|
2265
2375
|
break;
|
|
2266
2376
|
case "right-start":
|
|
2267
|
-
|
|
2377
|
+
I = R.top, O = R.right;
|
|
2268
2378
|
break;
|
|
2269
2379
|
case "right-end":
|
|
2270
|
-
|
|
2380
|
+
I = R.top + R.height - L.height, O = R.right;
|
|
2271
2381
|
break;
|
|
2272
2382
|
}
|
|
2273
|
-
const
|
|
2274
|
-
|
|
2383
|
+
const fe = window.innerWidth, ke = window.innerHeight;
|
|
2384
|
+
O < 0 && (O = 8), O + L.width > fe && (O = fe - L.width - 8), I < 0 && (I = 8), I + L.height > ke && (I = ke - L.height - 8), S.style.top = `${I}px`, S.style.left = `${O}px`, S.style.position = "fixed", S.style.visibility = "visible", S.style.display = "block";
|
|
2275
2385
|
}
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2386
|
+
_e(o, (C) => {
|
|
2387
|
+
g("visible-change", C), C ? (requestAnimationFrame(() => {
|
|
2388
|
+
ze(() => {
|
|
2389
|
+
Y();
|
|
2280
2390
|
});
|
|
2281
|
-
}), document.addEventListener("click",
|
|
2391
|
+
}), document.addEventListener("click", y)) : document.removeEventListener("click", y);
|
|
2282
2392
|
});
|
|
2283
|
-
function
|
|
2284
|
-
if (
|
|
2285
|
-
const
|
|
2286
|
-
|
|
2393
|
+
function y(C) {
|
|
2394
|
+
if (e.trigger === "click" && !e.disabled) {
|
|
2395
|
+
const S = C.target;
|
|
2396
|
+
f.value && !f.value.contains(S) && w();
|
|
2287
2397
|
}
|
|
2288
2398
|
}
|
|
2289
|
-
function
|
|
2290
|
-
|
|
2291
|
-
}
|
|
2292
|
-
return
|
|
2293
|
-
window.addEventListener("resize",
|
|
2294
|
-
}),
|
|
2295
|
-
|
|
2296
|
-
}),
|
|
2297
|
-
show:
|
|
2298
|
-
hide:
|
|
2299
|
-
toggle:
|
|
2300
|
-
visible:
|
|
2301
|
-
}), (
|
|
2399
|
+
function _() {
|
|
2400
|
+
o.value && Y();
|
|
2401
|
+
}
|
|
2402
|
+
return Je(() => {
|
|
2403
|
+
window.addEventListener("resize", _), window.addEventListener("scroll", _, !0);
|
|
2404
|
+
}), tt(() => {
|
|
2405
|
+
r && clearTimeout(r), m && clearTimeout(m), document.removeEventListener("click", y), window.removeEventListener("resize", _), window.removeEventListener("scroll", _, !0);
|
|
2406
|
+
}), i({
|
|
2407
|
+
show: x,
|
|
2408
|
+
hide: w,
|
|
2409
|
+
toggle: D,
|
|
2410
|
+
visible: o
|
|
2411
|
+
}), (C, S) => (u(), h("div", {
|
|
2302
2412
|
ref_key: "dropdownRef",
|
|
2303
|
-
ref:
|
|
2304
|
-
class:
|
|
2305
|
-
onMouseenter:
|
|
2306
|
-
onMouseleave:
|
|
2307
|
-
onClick:
|
|
2413
|
+
ref: f,
|
|
2414
|
+
class: J(["rc-dropdown", { "is-disabled": t.disabled }]),
|
|
2415
|
+
onMouseenter: H,
|
|
2416
|
+
onMouseleave: T,
|
|
2417
|
+
onClick: b
|
|
2308
2418
|
}, [
|
|
2309
|
-
|
|
2310
|
-
|
|
2419
|
+
Z(C.$slots, "default", {}, void 0, !0),
|
|
2420
|
+
X(Oe, {
|
|
2311
2421
|
ref_key: "menuRef",
|
|
2312
|
-
ref:
|
|
2313
|
-
visible:
|
|
2314
|
-
effect:
|
|
2315
|
-
"max-height":
|
|
2316
|
-
onMouseenter:
|
|
2317
|
-
onMouseleave:
|
|
2422
|
+
ref: $,
|
|
2423
|
+
visible: o.value,
|
|
2424
|
+
effect: t.effect,
|
|
2425
|
+
"max-height": t.maxHeight,
|
|
2426
|
+
onMouseenter: ie,
|
|
2427
|
+
onMouseleave: ae
|
|
2318
2428
|
}, {
|
|
2319
|
-
default:
|
|
2320
|
-
|
|
2429
|
+
default: oe(() => [
|
|
2430
|
+
Z(C.$slots, "dropdown", {}, void 0, !0)
|
|
2321
2431
|
]),
|
|
2322
2432
|
_: 3
|
|
2323
2433
|
}, 8, ["visible", "effect", "max-height"])
|
|
2324
2434
|
], 34));
|
|
2325
2435
|
}
|
|
2326
|
-
}),
|
|
2436
|
+
}), qe = /* @__PURE__ */ ce(za, [["__scopeId", "data-v-3b38bb64"]]), Ya = { class: "rc-dropdown-item__text" }, La = /* @__PURE__ */ ue({
|
|
2327
2437
|
name: "rc-dropdown-item",
|
|
2328
2438
|
__name: "item",
|
|
2329
2439
|
props: {
|
|
@@ -2332,44 +2442,405 @@ const oa = { class: "rc-search-area" }, ra = { class: "rc-search-area__bar" }, s
|
|
|
2332
2442
|
divided: { type: Boolean, default: !1 },
|
|
2333
2443
|
icon: { default: "" }
|
|
2334
2444
|
},
|
|
2335
|
-
setup(
|
|
2336
|
-
const
|
|
2445
|
+
setup(t) {
|
|
2446
|
+
const i = t, l = be("handleItemClick", () => {
|
|
2337
2447
|
});
|
|
2338
|
-
function
|
|
2339
|
-
if (
|
|
2340
|
-
|
|
2448
|
+
function e(g) {
|
|
2449
|
+
if (i.disabled) {
|
|
2450
|
+
g.stopPropagation();
|
|
2341
2451
|
return;
|
|
2342
2452
|
}
|
|
2343
|
-
|
|
2453
|
+
l(i.command);
|
|
2344
2454
|
}
|
|
2345
|
-
return (
|
|
2346
|
-
class:
|
|
2347
|
-
"is-disabled":
|
|
2348
|
-
"is-divided":
|
|
2455
|
+
return (g, f) => (u(), h("li", {
|
|
2456
|
+
class: J(["rc-dropdown-item", {
|
|
2457
|
+
"is-disabled": t.disabled,
|
|
2458
|
+
"is-divided": t.divided
|
|
2349
2459
|
}]),
|
|
2350
|
-
onClick:
|
|
2460
|
+
onClick: e
|
|
2351
2461
|
}, [
|
|
2352
|
-
|
|
2462
|
+
t.icon ? (u(), se(te, {
|
|
2353
2463
|
key: 0,
|
|
2354
|
-
name:
|
|
2464
|
+
name: t.icon,
|
|
2355
2465
|
class: "rc-dropdown-item__icon"
|
|
2356
|
-
}, null, 8, ["name"])) :
|
|
2357
|
-
|
|
2358
|
-
|
|
2466
|
+
}, null, 8, ["name"])) : F("", !0),
|
|
2467
|
+
P("span", Ya, [
|
|
2468
|
+
Z(g.$slots, "default", {}, void 0, !0)
|
|
2469
|
+
])
|
|
2470
|
+
], 2));
|
|
2471
|
+
}
|
|
2472
|
+
}), Ge = /* @__PURE__ */ ce(La, [["__scopeId", "data-v-7c739fdf"]]);
|
|
2473
|
+
qe && (qe.name = "rc-dropdown");
|
|
2474
|
+
Oe && (Oe.name = "rc-dropdown-menu");
|
|
2475
|
+
Ge && (Ge.name = "rc-dropdown-item");
|
|
2476
|
+
function Rt(t) {
|
|
2477
|
+
return qe && (t.component(qe.name || "rc-dropdown", qe), t.component("RcDropdown", qe)), Oe && (t.component(Oe.name || "rc-dropdown-menu", Oe), t.component("RcDropdownMenu", Oe)), Ge && (t.component(Ge.name || "rc-dropdown-item", Ge), t.component("RcDropdownItem", Ge)), t;
|
|
2478
|
+
}
|
|
2479
|
+
const Wa = /* @__PURE__ */ ue({
|
|
2480
|
+
__name: "index",
|
|
2481
|
+
props: {
|
|
2482
|
+
model: { default: () => ({}) },
|
|
2483
|
+
rules: { default: () => ({}) },
|
|
2484
|
+
labelWidth: { default: void 0 },
|
|
2485
|
+
labelPosition: { default: "left" },
|
|
2486
|
+
inline: { type: Boolean, default: !1 },
|
|
2487
|
+
size: { default: "default" },
|
|
2488
|
+
disabled: { type: Boolean, default: !1 },
|
|
2489
|
+
validateOnRuleChange: { type: Boolean, default: !0 },
|
|
2490
|
+
hideRequiredAsterisk: { type: Boolean, default: !1 },
|
|
2491
|
+
showMessage: { type: Boolean, default: !0 }
|
|
2492
|
+
},
|
|
2493
|
+
emits: ["validate"],
|
|
2494
|
+
setup(t, { expose: i, emit: l }) {
|
|
2495
|
+
const e = t, g = l, f = W(), $ = W(/* @__PURE__ */ new Map()), o = W({}), r = (y) => {
|
|
2496
|
+
if (y === null || typeof y != "object")
|
|
2497
|
+
return y;
|
|
2498
|
+
if (y instanceof Date)
|
|
2499
|
+
return new Date(y.getTime());
|
|
2500
|
+
if (y instanceof Array)
|
|
2501
|
+
return y.map((_) => r(_));
|
|
2502
|
+
if (typeof y == "object") {
|
|
2503
|
+
const _ = {};
|
|
2504
|
+
for (const C in y)
|
|
2505
|
+
y.hasOwnProperty(C) && (_[C] = r(y[C]));
|
|
2506
|
+
return _;
|
|
2507
|
+
}
|
|
2508
|
+
return y;
|
|
2509
|
+
}, m = () => {
|
|
2510
|
+
e.model && (o.value = r(e.model));
|
|
2511
|
+
}, N = (y, _) => {
|
|
2512
|
+
$.value.set(y, _);
|
|
2513
|
+
}, x = (y) => {
|
|
2514
|
+
$.value.delete(y);
|
|
2515
|
+
};
|
|
2516
|
+
Ce("rcForm", {
|
|
2517
|
+
model: e.model,
|
|
2518
|
+
rules: e.rules,
|
|
2519
|
+
labelWidth: e.labelWidth,
|
|
2520
|
+
labelPosition: e.labelPosition,
|
|
2521
|
+
size: e.size,
|
|
2522
|
+
disabled: e.disabled,
|
|
2523
|
+
hideRequiredAsterisk: e.hideRequiredAsterisk,
|
|
2524
|
+
showMessage: e.showMessage,
|
|
2525
|
+
registerFormItem: N,
|
|
2526
|
+
unregisterFormItem: x,
|
|
2527
|
+
validateField: (y, _) => {
|
|
2528
|
+
const C = $.value.get(y);
|
|
2529
|
+
return C ? C.validate(_) : Promise.resolve();
|
|
2530
|
+
}
|
|
2531
|
+
});
|
|
2532
|
+
let w = !1;
|
|
2533
|
+
const D = () => {
|
|
2534
|
+
w || (w = !0, d((y) => {
|
|
2535
|
+
w = !1, y ? console.log("表单验证通过", e.model) : console.log("表单验证失败");
|
|
2536
|
+
}).catch(() => {
|
|
2537
|
+
w = !1;
|
|
2538
|
+
}));
|
|
2539
|
+
};
|
|
2540
|
+
Ce("rcFormActions", {
|
|
2541
|
+
submit: D,
|
|
2542
|
+
reset: () => {
|
|
2543
|
+
ae();
|
|
2544
|
+
}
|
|
2545
|
+
});
|
|
2546
|
+
let T = !1;
|
|
2547
|
+
_e(
|
|
2548
|
+
() => e.model,
|
|
2549
|
+
() => {
|
|
2550
|
+
!T && e.model && (m(), T = !0);
|
|
2551
|
+
},
|
|
2552
|
+
{ immediate: !0, deep: !0 }
|
|
2553
|
+
), Je(() => {
|
|
2554
|
+
!T && e.model && (m(), T = !0);
|
|
2555
|
+
}), _e(
|
|
2556
|
+
() => e.rules,
|
|
2557
|
+
() => {
|
|
2558
|
+
e.validateOnRuleChange && ze(() => {
|
|
2559
|
+
d().catch(() => {
|
|
2560
|
+
});
|
|
2561
|
+
});
|
|
2562
|
+
},
|
|
2563
|
+
{ deep: !0 }
|
|
2564
|
+
);
|
|
2565
|
+
const d = (y) => new Promise((_) => {
|
|
2566
|
+
const C = [], S = {};
|
|
2567
|
+
$.value.forEach((R, L) => {
|
|
2568
|
+
const I = R.validate().then(() => {
|
|
2569
|
+
g("validate", L, !0, "");
|
|
2570
|
+
}).catch((O) => {
|
|
2571
|
+
O && (S[L] = [O], g("validate", L, !1, O));
|
|
2572
|
+
});
|
|
2573
|
+
C.push(I);
|
|
2574
|
+
}), Promise.all(C).then(() => {
|
|
2575
|
+
const R = Object.keys(S).length === 0;
|
|
2576
|
+
y && y(R, R ? void 0 : S), _(R);
|
|
2577
|
+
}).catch(() => {
|
|
2578
|
+
const R = Object.keys(S).length === 0;
|
|
2579
|
+
y && y(R, R ? void 0 : S), _(R);
|
|
2580
|
+
});
|
|
2581
|
+
}), ie = (y, _) => {
|
|
2582
|
+
const C = $.value.get(y);
|
|
2583
|
+
return C ? C.validate(_) : Promise.resolve();
|
|
2584
|
+
}, ae = () => {
|
|
2585
|
+
$.value.forEach((y) => {
|
|
2586
|
+
y.resetField();
|
|
2587
|
+
}), e.model && o.value && (Object.keys(e.model).forEach((y) => {
|
|
2588
|
+
delete e.model[y];
|
|
2589
|
+
}), Object.keys(o.value).forEach((y) => {
|
|
2590
|
+
e.model[y] = r(o.value[y]);
|
|
2591
|
+
}));
|
|
2592
|
+
}, b = (y) => {
|
|
2593
|
+
const _ = y ? Array.isArray(y) ? y : [y] : void 0;
|
|
2594
|
+
$.value.forEach((C, S) => {
|
|
2595
|
+
(!_ || _.includes(S)) && C.clearValidate();
|
|
2596
|
+
});
|
|
2597
|
+
}, Y = (y) => {
|
|
2598
|
+
y.preventDefault(), D();
|
|
2599
|
+
};
|
|
2600
|
+
return i({
|
|
2601
|
+
validate: d,
|
|
2602
|
+
validateField: ie,
|
|
2603
|
+
resetFields: ae,
|
|
2604
|
+
clearValidate: b,
|
|
2605
|
+
formRef: f
|
|
2606
|
+
}), (y, _) => (u(), h("form", {
|
|
2607
|
+
ref_key: "formRef",
|
|
2608
|
+
ref: f,
|
|
2609
|
+
class: J(["rc-form", [
|
|
2610
|
+
`rc-form--${t.labelPosition}`,
|
|
2611
|
+
{
|
|
2612
|
+
"rc-form--inline": t.inline
|
|
2613
|
+
}
|
|
2614
|
+
]]),
|
|
2615
|
+
onSubmit: Ae(Y, ["prevent"])
|
|
2616
|
+
}, [
|
|
2617
|
+
Z(y.$slots, "default", {}, void 0, !0)
|
|
2618
|
+
], 34));
|
|
2619
|
+
}
|
|
2620
|
+
}), Ze = /* @__PURE__ */ ce(Wa, [["__scopeId", "data-v-194b6d22"]]), Oa = ["for"], Ha = { key: 0 }, Ua = { class: "rc-form-item__content" }, qa = { class: "rc-form-item__control" }, Ga = {
|
|
2621
|
+
key: 0,
|
|
2622
|
+
class: "rc-form-item__error"
|
|
2623
|
+
}, Ka = /* @__PURE__ */ ue({
|
|
2624
|
+
__name: "item",
|
|
2625
|
+
props: {
|
|
2626
|
+
prop: { default: "" },
|
|
2627
|
+
label: { default: "" },
|
|
2628
|
+
labelWidth: { default: void 0 },
|
|
2629
|
+
required: { type: Boolean, default: void 0 },
|
|
2630
|
+
rules: { default: void 0 },
|
|
2631
|
+
showMessage: { type: Boolean, default: void 0 },
|
|
2632
|
+
inlineMessage: { type: Boolean, default: !1 },
|
|
2633
|
+
error: { default: "" }
|
|
2634
|
+
},
|
|
2635
|
+
setup(t, { expose: i }) {
|
|
2636
|
+
const l = t, e = be("rcForm", void 0), g = W(""), f = W(""), $ = B(() => {
|
|
2637
|
+
const b = l.labelWidth ?? (e == null ? void 0 : e.labelWidth);
|
|
2638
|
+
return b ? {
|
|
2639
|
+
width: typeof b == "number" ? `${b}px` : b
|
|
2640
|
+
} : {};
|
|
2641
|
+
}), o = B(() => {
|
|
2642
|
+
}), r = B(() => l.showMessage ?? (e == null ? void 0 : e.showMessage) ?? !0), m = B(() => (e == null ? void 0 : e.hideRequiredAsterisk) ?? !1), N = B(() => (e == null ? void 0 : e.labelPosition) ?? "left"), x = B(() => {
|
|
2643
|
+
if (l.required !== void 0)
|
|
2644
|
+
return l.required;
|
|
2645
|
+
if (!l.prop || !e)
|
|
2646
|
+
return !1;
|
|
2647
|
+
const b = w();
|
|
2648
|
+
return b && b.length > 0 ? b.some((Y) => Y.required) : !1;
|
|
2649
|
+
}), w = () => {
|
|
2650
|
+
if (l.rules)
|
|
2651
|
+
return Array.isArray(l.rules) ? l.rules : [l.rules];
|
|
2652
|
+
if (!l.prop || !e)
|
|
2653
|
+
return [];
|
|
2654
|
+
const b = e.rules[l.prop];
|
|
2655
|
+
return b ? Array.isArray(b) ? b : [b] : [];
|
|
2656
|
+
}, D = () => {
|
|
2657
|
+
if (!(!l.prop || !e))
|
|
2658
|
+
return e.model[l.prop];
|
|
2659
|
+
}, H = (b, Y) => new Promise((y) => {
|
|
2660
|
+
let _ = Y;
|
|
2661
|
+
if (b.transform && (_ = b.transform(Y)), b.required && (_ == null || _ === "")) {
|
|
2662
|
+
const C = b.message || `${l.label || l.prop} 是必填项`;
|
|
2663
|
+
y(C);
|
|
2664
|
+
return;
|
|
2665
|
+
}
|
|
2666
|
+
if (b.type && _ !== void 0 && _ !== null && _ !== "" && !T(_, b.type)) {
|
|
2667
|
+
const S = b.message || `${l.label || l.prop} 格式不正确`;
|
|
2668
|
+
y(S);
|
|
2669
|
+
return;
|
|
2670
|
+
}
|
|
2671
|
+
if (b.min !== void 0 && _ !== void 0 && _ !== null && _ !== "" && (Array.isArray(_) || typeof _ == "string" ? _.length : _) < b.min) {
|
|
2672
|
+
const S = b.message || `${l.label || l.prop} 不能少于 ${b.min} 个字符`;
|
|
2673
|
+
y(S);
|
|
2674
|
+
return;
|
|
2675
|
+
}
|
|
2676
|
+
if (b.max !== void 0 && _ !== void 0 && _ !== null && _ !== "" && (Array.isArray(_) || typeof _ == "string" ? _.length : _) > b.max) {
|
|
2677
|
+
const S = b.message || `${l.label || l.prop} 不能超过 ${b.max} 个字符`;
|
|
2678
|
+
y(S);
|
|
2679
|
+
return;
|
|
2680
|
+
}
|
|
2681
|
+
if (b.pattern) {
|
|
2682
|
+
const C = typeof b.pattern == "string" ? new RegExp(b.pattern) : b.pattern;
|
|
2683
|
+
if (_ != null && _ !== "" && !C.test(String(_))) {
|
|
2684
|
+
const S = b.message || `${l.label || l.prop} 格式不正确`;
|
|
2685
|
+
y(S);
|
|
2686
|
+
return;
|
|
2687
|
+
}
|
|
2688
|
+
}
|
|
2689
|
+
if (b.validator) {
|
|
2690
|
+
const C = b.validator(b, _, (S) => {
|
|
2691
|
+
y(S ? S.message || b.message || `${l.label || l.prop} 验证失败` : null);
|
|
2692
|
+
});
|
|
2693
|
+
if (C instanceof Promise) {
|
|
2694
|
+
C.then(() => {
|
|
2695
|
+
y(null);
|
|
2696
|
+
}).catch((S) => {
|
|
2697
|
+
y((S == null ? void 0 : S.message) || b.message || `${l.label || l.prop} 验证失败`);
|
|
2698
|
+
});
|
|
2699
|
+
return;
|
|
2700
|
+
}
|
|
2701
|
+
}
|
|
2702
|
+
y(null);
|
|
2703
|
+
}), T = (b, Y) => {
|
|
2704
|
+
switch (Y) {
|
|
2705
|
+
case "string":
|
|
2706
|
+
return typeof b == "string";
|
|
2707
|
+
case "number":
|
|
2708
|
+
return typeof b == "number" && !isNaN(b);
|
|
2709
|
+
case "boolean":
|
|
2710
|
+
return typeof b == "boolean";
|
|
2711
|
+
case "integer":
|
|
2712
|
+
return Number.isInteger(b);
|
|
2713
|
+
case "float":
|
|
2714
|
+
return typeof b == "number" && !isNaN(b) && !Number.isInteger(b);
|
|
2715
|
+
case "array":
|
|
2716
|
+
return Array.isArray(b);
|
|
2717
|
+
case "object":
|
|
2718
|
+
return typeof b == "object" && b !== null && !Array.isArray(b);
|
|
2719
|
+
case "email":
|
|
2720
|
+
return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(String(b));
|
|
2721
|
+
case "url":
|
|
2722
|
+
try {
|
|
2723
|
+
return new URL(String(b)), !0;
|
|
2724
|
+
} catch {
|
|
2725
|
+
return !1;
|
|
2726
|
+
}
|
|
2727
|
+
case "date":
|
|
2728
|
+
return b instanceof Date || !isNaN(Date.parse(String(b)));
|
|
2729
|
+
default:
|
|
2730
|
+
return !0;
|
|
2731
|
+
}
|
|
2732
|
+
}, d = (b, Y) => new Promise((y, _) => {
|
|
2733
|
+
if (l.error) {
|
|
2734
|
+
g.value = "error", f.value = l.error, Y && Y(l.error), _(new Error(l.error));
|
|
2735
|
+
return;
|
|
2736
|
+
}
|
|
2737
|
+
if (!l.prop) {
|
|
2738
|
+
y();
|
|
2739
|
+
return;
|
|
2740
|
+
}
|
|
2741
|
+
const C = w();
|
|
2742
|
+
if (C.length === 0) {
|
|
2743
|
+
g.value = "", f.value = "", y();
|
|
2744
|
+
return;
|
|
2745
|
+
}
|
|
2746
|
+
let S;
|
|
2747
|
+
if (!b || b === "submit" ? S = C : S = C.filter((I) => I.trigger === b), S.length === 0) {
|
|
2748
|
+
y();
|
|
2749
|
+
return;
|
|
2750
|
+
}
|
|
2751
|
+
g.value = "validating", f.value = "";
|
|
2752
|
+
const R = D(), L = S.map((I) => H(I, R));
|
|
2753
|
+
Promise.all(L).then((I) => {
|
|
2754
|
+
const O = I.find((fe) => fe !== null);
|
|
2755
|
+
O ? (g.value = "error", f.value = O, Y && Y(O), _(new Error(O))) : ((!b || S.length === C.length) && (g.value = "success", f.value = ""), Y && Y(), y());
|
|
2756
|
+
}).catch((I) => {
|
|
2757
|
+
const O = (I == null ? void 0 : I.message) || "验证失败";
|
|
2758
|
+
g.value = "error", f.value = O, Y && Y(O), _(I);
|
|
2759
|
+
});
|
|
2760
|
+
}), ie = () => {
|
|
2761
|
+
g.value = "", f.value = "";
|
|
2762
|
+
}, ae = () => {
|
|
2763
|
+
g.value = "", f.value = "";
|
|
2764
|
+
};
|
|
2765
|
+
return _e(
|
|
2766
|
+
() => D(),
|
|
2767
|
+
() => {
|
|
2768
|
+
const b = w(), Y = b.some((_) => _.trigger === "change"), y = b.some((_) => _.trigger === "blur");
|
|
2769
|
+
Y ? d("change").catch(() => {
|
|
2770
|
+
}) : y && g.value;
|
|
2771
|
+
}
|
|
2772
|
+
), _e(
|
|
2773
|
+
() => l.error,
|
|
2774
|
+
(b) => {
|
|
2775
|
+
b ? (g.value = "error", f.value = b) : g.value === "error" && !l.prop && ae();
|
|
2776
|
+
}
|
|
2777
|
+
), Ce("rcFormItem", {
|
|
2778
|
+
onBlur: () => {
|
|
2779
|
+
w().some((y) => y.trigger === "blur") && d("blur").catch(() => {
|
|
2780
|
+
});
|
|
2781
|
+
},
|
|
2782
|
+
onChange: () => {
|
|
2783
|
+
w().some((y) => y.trigger === "change") && d("change").catch(() => {
|
|
2784
|
+
});
|
|
2785
|
+
}
|
|
2786
|
+
}), Je(() => {
|
|
2787
|
+
l.prop && e && e.registerFormItem(l.prop, {
|
|
2788
|
+
validate: d,
|
|
2789
|
+
resetField: ie,
|
|
2790
|
+
clearValidate: ae
|
|
2791
|
+
});
|
|
2792
|
+
}), tt(() => {
|
|
2793
|
+
l.prop && e && e.unregisterFormItem(l.prop);
|
|
2794
|
+
}), i({
|
|
2795
|
+
validate: d,
|
|
2796
|
+
resetField: ie,
|
|
2797
|
+
clearValidate: ae,
|
|
2798
|
+
validateState: g,
|
|
2799
|
+
validateMessage: f
|
|
2800
|
+
}), (b, Y) => (u(), h("div", {
|
|
2801
|
+
class: J(["rc-form-item", [
|
|
2802
|
+
{
|
|
2803
|
+
"is-error": g.value === "error",
|
|
2804
|
+
"is-validating": g.value === "validating",
|
|
2805
|
+
"is-required": x.value,
|
|
2806
|
+
"is-no-asterisk": m.value,
|
|
2807
|
+
"is-label-top": N.value === "top"
|
|
2808
|
+
}
|
|
2809
|
+
]])
|
|
2810
|
+
}, [
|
|
2811
|
+
t.label || b.$slots.label ? (u(), h("label", {
|
|
2812
|
+
key: 0,
|
|
2813
|
+
class: "rc-form-item__label",
|
|
2814
|
+
style: re($.value),
|
|
2815
|
+
for: o.value
|
|
2816
|
+
}, [
|
|
2817
|
+
Z(b.$slots, "label", {}, () => [
|
|
2818
|
+
t.label ? (u(), h("span", Ha, G(t.label), 1)) : F("", !0)
|
|
2819
|
+
], !0)
|
|
2820
|
+
], 12, Oa)) : F("", !0),
|
|
2821
|
+
P("div", Ua, [
|
|
2822
|
+
P("div", qa, [
|
|
2823
|
+
Z(b.$slots, "default", {}, void 0, !0)
|
|
2824
|
+
]),
|
|
2825
|
+
X(Ne, { name: "rc-form-item-error-fade" }, {
|
|
2826
|
+
default: oe(() => [
|
|
2827
|
+
g.value === "error" && r.value && f.value ? (u(), h("div", Ga, G(f.value), 1)) : F("", !0)
|
|
2828
|
+
]),
|
|
2829
|
+
_: 1
|
|
2830
|
+
})
|
|
2359
2831
|
])
|
|
2360
2832
|
], 2));
|
|
2361
2833
|
}
|
|
2362
|
-
}),
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
return e.component(st.name, st), e.component(nt.name, nt), e.component(ut.name, ut), e;
|
|
2834
|
+
}), et = /* @__PURE__ */ ce(Ka, [["__scopeId", "data-v-52add6c3"]]);
|
|
2835
|
+
Ze && (Ze.name = "rc-form");
|
|
2836
|
+
et && (et.name = "rc-form-item");
|
|
2837
|
+
function Vt(t) {
|
|
2838
|
+
return Ze && t.component(Ze.name || "rc-form", Ze), et && t.component(et.name || "rc-form-item", et), t;
|
|
2368
2839
|
}
|
|
2369
|
-
const
|
|
2840
|
+
const ut = Symbol("RECYCLE_UI_CONFIG"), ft = {
|
|
2370
2841
|
prefix: "rc",
|
|
2371
2842
|
autoRegister: !0,
|
|
2372
|
-
provideKey:
|
|
2843
|
+
provideKey: ut,
|
|
2373
2844
|
// 预留主题/其他全局配置
|
|
2374
2845
|
theme: {},
|
|
2375
2846
|
// IconFont 默认配置(可在 app.use 时覆盖)
|
|
@@ -2378,60 +2849,63 @@ const ot = Symbol("RECYCLE_UI_CONFIG"), ct = {
|
|
|
2378
2849
|
// 输入框设备类型默认配置
|
|
2379
2850
|
inputDeviceType: "pc"
|
|
2380
2851
|
};
|
|
2381
|
-
function
|
|
2382
|
-
|
|
2852
|
+
function ja(t, i) {
|
|
2853
|
+
i.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));
|
|
2383
2854
|
}
|
|
2384
|
-
const
|
|
2385
|
-
const
|
|
2386
|
-
if (
|
|
2387
|
-
const
|
|
2388
|
-
if (!document.head.querySelector(
|
|
2389
|
-
const
|
|
2390
|
-
|
|
2855
|
+
const At = (t, i) => {
|
|
2856
|
+
const l = { ...ft, ...i || {} };
|
|
2857
|
+
if (t.provide(l.provideKey ?? ut, l), t.config.globalProperties.$recycleUI = l, typeof window < "u" && l.iconCssUrl) {
|
|
2858
|
+
const e = `link[rel="stylesheet"][data-rcui-icon="true"][href="${l.iconCssUrl}"]`;
|
|
2859
|
+
if (!document.head.querySelector(e)) {
|
|
2860
|
+
const f = document.createElement("link");
|
|
2861
|
+
f.rel = "stylesheet", f.href = l.iconCssUrl, f.setAttribute("data-rcui-icon", "true"), document.head.appendChild(f);
|
|
2391
2862
|
}
|
|
2392
2863
|
}
|
|
2393
|
-
return
|
|
2394
|
-
},
|
|
2395
|
-
function
|
|
2864
|
+
return ja(t, l), t;
|
|
2865
|
+
}, el = { install: At };
|
|
2866
|
+
function tl(t) {
|
|
2396
2867
|
return {
|
|
2397
|
-
install(
|
|
2398
|
-
|
|
2868
|
+
install(i) {
|
|
2869
|
+
At(i, t);
|
|
2399
2870
|
}
|
|
2400
2871
|
};
|
|
2401
2872
|
}
|
|
2402
2873
|
export {
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
ht as
|
|
2425
|
-
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2874
|
+
ut as RECYCLE_UI_SYMBOL,
|
|
2875
|
+
$e as RcButton,
|
|
2876
|
+
We as RcCalendar,
|
|
2877
|
+
st as RcCard,
|
|
2878
|
+
Qa as RcDescriptions,
|
|
2879
|
+
Xa as RcDescriptionsItem,
|
|
2880
|
+
qe as RcDropdown,
|
|
2881
|
+
Ge as RcDropdownItem,
|
|
2882
|
+
Oe as RcDropdownMenu,
|
|
2883
|
+
Ze as RcForm,
|
|
2884
|
+
et as RcFormItem,
|
|
2885
|
+
te as RcIcon,
|
|
2886
|
+
Xe as RcInput,
|
|
2887
|
+
Le as RcPopup,
|
|
2888
|
+
Ct as RcSearchArea,
|
|
2889
|
+
it as RcToast,
|
|
2890
|
+
tl as createRecycleUI,
|
|
2891
|
+
el as default,
|
|
2892
|
+
ft as defaultRecycleUIConfig,
|
|
2893
|
+
mn as hideToast,
|
|
2894
|
+
At as install,
|
|
2895
|
+
ht as installButton,
|
|
2896
|
+
xt as installCalendar,
|
|
2897
|
+
gt as installCard,
|
|
2898
|
+
yt as installDescriptions,
|
|
2899
|
+
Rt as installDropdown,
|
|
2900
|
+
Vt as installForm,
|
|
2901
|
+
wt as installIcon,
|
|
2902
|
+
Mt as installInput,
|
|
2903
|
+
kt as installMessage,
|
|
2904
|
+
$t as installPopup,
|
|
2905
|
+
St as installSearchArea,
|
|
2906
|
+
_n as message,
|
|
2907
|
+
Qa as rcDescriptions,
|
|
2908
|
+
Xa as rcDescriptionsItem,
|
|
2909
|
+
Za as showToast
|
|
2436
2910
|
};
|
|
2437
2911
|
//# sourceMappingURL=index.mjs.map
|