@rft-rc/recycle-ui 0.0.3-rc.2 → 0.0.3-rc.4
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/descriptions/index.d.ts +12 -0
- package/dist/components/descriptions/index.d.ts.map +1 -1
- package/dist/components/descriptions/index.vue.d.ts +3 -0
- package/dist/components/descriptions/index.vue.d.ts.map +1 -1
- package/dist/components/descriptions/item.vue.d.ts +3 -0
- package/dist/components/descriptions/item.vue.d.ts.map +1 -1
- package/dist/components/dropdown/index.vue.d.ts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +780 -774
- package/dist/index.mjs.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as se, inject as
|
|
1
|
+
import { defineComponent as se, inject as De, computed as R, onMounted as at, createElementBlock as f, openBlock as s, normalizeStyle as le, normalizeClass as G, createCommentVNode as D, toDisplayString as N, renderSlot as q, Fragment as oe, createBlock as ne, createTextVNode as _e, createElementVNode as M, ref as E, watchEffect as Vt, provide as Re, renderList as ve, onUnmounted as lt, Teleport as it, createVNode as K, Transition as Be, withCtx as ae, createApp as Tt, reactive as Et, TransitionGroup as Bt, render as Mt, watch as Ie, withModifiers as Ye, unref as J, nextTick as Fe, withDirectives as Ft, vModelText as At, useSlots as zt, resolveDynamicComponent as vt } from "vue";
|
|
2
2
|
const Yt = {
|
|
3
3
|
key: 0,
|
|
4
4
|
class: "rc-icon__unicode"
|
|
@@ -13,42 +13,42 @@ const Yt = {
|
|
|
13
13
|
code: { default: "" }
|
|
14
14
|
},
|
|
15
15
|
setup(e) {
|
|
16
|
-
const
|
|
17
|
-
fontSize:
|
|
18
|
-
color:
|
|
16
|
+
const r = e, m = De(ot, {}), t = R(() => (m == null ? void 0 : m.iconClass) || "iconfont"), y = R(() => r.name || ""), _ = R(() => typeof r.size == "number" ? `${r.size}px` : r.size || "16px"), v = R(() => ({
|
|
17
|
+
fontSize: _.value,
|
|
18
|
+
color: r.color || void 0,
|
|
19
19
|
lineHeight: 1,
|
|
20
20
|
fontFamily: (m == null ? void 0 : m.iconClass) || "iconfont"
|
|
21
21
|
})), d = R(() => {
|
|
22
|
-
const
|
|
23
|
-
if (
|
|
24
|
-
if (typeof
|
|
25
|
-
return String.fromCharCode(
|
|
26
|
-
const
|
|
27
|
-
return Number.isNaN(
|
|
22
|
+
const u = r.code;
|
|
23
|
+
if (u == null || u === "" || u === 0) return "";
|
|
24
|
+
if (typeof u == "number")
|
|
25
|
+
return String.fromCharCode(u);
|
|
26
|
+
const h = String(u).replace(/^0x/i, ""), F = parseInt(h, 16);
|
|
27
|
+
return Number.isNaN(F) ? "" : String.fromCharCode(F);
|
|
28
28
|
});
|
|
29
29
|
return at(() => {
|
|
30
30
|
if (typeof window > "u") return;
|
|
31
|
-
const
|
|
32
|
-
if (!
|
|
33
|
-
const
|
|
34
|
-
if (!document.head.querySelector(
|
|
35
|
-
const
|
|
36
|
-
|
|
31
|
+
const u = m && m.iconCssUrl || ct.iconCssUrl;
|
|
32
|
+
if (!u) return;
|
|
33
|
+
const h = `link[rel="stylesheet"][data-rcui-icon="true"][href="${u}"]`;
|
|
34
|
+
if (!document.head.querySelector(h)) {
|
|
35
|
+
const b = document.createElement("link");
|
|
36
|
+
b.rel = "stylesheet", b.href = u, b.setAttribute("data-rcui-icon", "true"), document.head.appendChild(b);
|
|
37
37
|
}
|
|
38
|
-
}), (
|
|
38
|
+
}), (u, h) => (s(), f("i", {
|
|
39
39
|
class: G(["rc-icon", [t.value, y.value, { "rc-icon--spin": e.spin }]]),
|
|
40
40
|
style: le(v.value),
|
|
41
41
|
"aria-hidden": "true"
|
|
42
42
|
}, [
|
|
43
|
-
d.value ? (
|
|
43
|
+
d.value ? (s(), f("span", Yt, N(d.value), 1)) : D("", !0)
|
|
44
44
|
], 6));
|
|
45
45
|
}
|
|
46
|
-
}), ue = (e,
|
|
46
|
+
}), ue = (e, r) => {
|
|
47
47
|
const m = e.__vccOpts || e;
|
|
48
|
-
for (const [t, y] of
|
|
48
|
+
for (const [t, y] of r)
|
|
49
49
|
m[t] = y;
|
|
50
50
|
return m;
|
|
51
|
-
}, X = /* @__PURE__ */ ue(Lt, [["__scopeId", "data-v-3857a892"]]),
|
|
51
|
+
}, X = /* @__PURE__ */ ue(Lt, [["__scopeId", "data-v-3857a892"]]), Pt = ["disabled"], Nt = {
|
|
52
52
|
key: 0,
|
|
53
53
|
class: "rc-button__spinner"
|
|
54
54
|
}, Wt = {
|
|
@@ -72,23 +72,23 @@ const Yt = {
|
|
|
72
72
|
suffixIcon: { default: "" }
|
|
73
73
|
},
|
|
74
74
|
emits: ["click"],
|
|
75
|
-
setup(e, { emit:
|
|
76
|
-
const m = e, t =
|
|
75
|
+
setup(e, { emit: r }) {
|
|
76
|
+
const m = e, t = r, y = (v) => {
|
|
77
77
|
!m.disabled && !m.loading && t("click", v);
|
|
78
|
-
},
|
|
78
|
+
}, _ = R(() => {
|
|
79
79
|
const v = m.round;
|
|
80
80
|
return typeof v == "boolean" ? v ? "999px" : "6px" : typeof v == "number" ? `${v}px` : String(v);
|
|
81
81
|
});
|
|
82
|
-
return (v, d) => (
|
|
82
|
+
return (v, d) => (s(), f("button", {
|
|
83
83
|
class: G(["rc-button", [`rc-button--${e.type}`, `rc-button--${e.size}`, e.mode ? `rc-button--${e.mode}` : "", { "is-block": e.block, "is-disabled": e.disabled, "is-loading": e.loading }]]),
|
|
84
|
-
style: le({ borderRadius:
|
|
84
|
+
style: le({ borderRadius: _.value }),
|
|
85
85
|
disabled: e.disabled || e.loading,
|
|
86
86
|
onClick: y
|
|
87
87
|
}, [
|
|
88
|
-
e.loading ? (
|
|
89
|
-
e.preIcon || v.$slots.preIcon ? (
|
|
88
|
+
e.loading ? (s(), f("span", Nt)) : (s(), f(oe, { key: 1 }, [
|
|
89
|
+
e.preIcon || v.$slots.preIcon ? (s(), f("span", Wt, [
|
|
90
90
|
q(v.$slots, "preIcon", {}, () => [
|
|
91
|
-
e.preIcon ? (
|
|
91
|
+
e.preIcon ? (s(), ne(X, {
|
|
92
92
|
key: 0,
|
|
93
93
|
name: e.preIcon
|
|
94
94
|
}, null, 8, ["name"])) : D("", !0)
|
|
@@ -96,22 +96,22 @@ const Yt = {
|
|
|
96
96
|
])) : D("", !0)
|
|
97
97
|
], 64)),
|
|
98
98
|
q(v.$slots, "default", {}, () => [
|
|
99
|
-
_e(
|
|
99
|
+
_e(N(e.label), 1)
|
|
100
100
|
], !0),
|
|
101
|
-
!e.loading && (e.suffixIcon || v.$slots.suffixIcon) ? (
|
|
101
|
+
!e.loading && (e.suffixIcon || v.$slots.suffixIcon) ? (s(), f("span", Ht, [
|
|
102
102
|
q(v.$slots, "suffixIcon", {}, () => [
|
|
103
|
-
e.suffixIcon ? (
|
|
103
|
+
e.suffixIcon ? (s(), ne(X, {
|
|
104
104
|
key: 0,
|
|
105
105
|
name: e.suffixIcon
|
|
106
106
|
}, null, 8, ["name"])) : D("", !0)
|
|
107
107
|
], !0)
|
|
108
108
|
])) : D("", !0)
|
|
109
|
-
], 14,
|
|
109
|
+
], 14, Pt));
|
|
110
110
|
}
|
|
111
|
-
}),
|
|
112
|
-
|
|
111
|
+
}), Ce = /* @__PURE__ */ ue(Ot, [["__scopeId", "data-v-4c6a5e4f"]]);
|
|
112
|
+
Ce.name = "rc-button";
|
|
113
113
|
function mt(e) {
|
|
114
|
-
return e.component(
|
|
114
|
+
return e.component(Ce.name, Ce), e;
|
|
115
115
|
}
|
|
116
116
|
const Ut = { class: "rc-desc-item__value" }, jt = /* @__PURE__ */ se({
|
|
117
117
|
name: "rc-descriptions-item",
|
|
@@ -120,43 +120,46 @@ const Ut = { class: "rc-desc-item__value" }, jt = /* @__PURE__ */ se({
|
|
|
120
120
|
label: { default: "" },
|
|
121
121
|
value: { default: "" },
|
|
122
122
|
labelWidth: { default: "" },
|
|
123
|
-
span: { default: 1 }
|
|
123
|
+
span: { default: 1 },
|
|
124
|
+
labelPosition: { default: void 0 }
|
|
124
125
|
},
|
|
125
126
|
setup(e) {
|
|
126
|
-
const
|
|
127
|
-
|
|
128
|
-
const m =
|
|
129
|
-
const
|
|
130
|
-
return Math.min(
|
|
131
|
-
}), v = R(() => {
|
|
132
|
-
const r = typeof (t == null ? void 0 : t.value) == "number" ? t.value : t, p = typeof (m == null ? void 0 : m.value) == "number" ? m.value : m, B = k.value;
|
|
133
|
-
if (!r || r <= 1 || B >= r) return "100%";
|
|
134
|
-
const x = (r - 1) * p, b = (B - 1) * p;
|
|
135
|
-
return `calc((100% - ${x}px) * ${B} / ${r} + ${b}px)`;
|
|
127
|
+
const r = e;
|
|
128
|
+
De("rcDescItemWidth", void 0), De("rcDescSingleWidth", ""), De("rcDescGap", "0px");
|
|
129
|
+
const m = De("rcDescGapPx", 0), t = De("rcDescColCount", 1), y = De("rcDescLabelWidth", ""), _ = De("rcDescLabelPosition", "left"), v = R(() => {
|
|
130
|
+
const b = typeof r.span == "string" ? parseInt(r.span, 10) : r.span, g = typeof (t == null ? void 0 : t.value) == "number" ? t.value : t, I = !Number.isNaN(b) && b > 0 ? b : 1;
|
|
131
|
+
return Math.min(I, g || 1);
|
|
136
132
|
}), d = R(() => {
|
|
137
|
-
const
|
|
138
|
-
|
|
133
|
+
const b = typeof (t == null ? void 0 : t.value) == "number" ? t.value : t, g = typeof (m == null ? void 0 : m.value) == "number" ? m.value : m, I = v.value;
|
|
134
|
+
if (!b || b <= 1 || I >= b) return "100%";
|
|
135
|
+
const A = (b - 1) * g, C = (I - 1) * g;
|
|
136
|
+
return `calc((100% - ${A}px) * ${I} / ${b} + ${C}px)`;
|
|
137
|
+
}), u = R(() => r.labelPosition !== void 0 ? r.labelPosition : (typeof (_ == null ? void 0 : _.value) == "string" ? _.value : _) || "left"), h = R(() => ({ width: d.value, flex: `0 0 ${d.value}` })), F = R(() => {
|
|
138
|
+
if (u.value === "top")
|
|
139
|
+
return {};
|
|
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" } : {};
|
|
139
142
|
});
|
|
140
|
-
return (
|
|
141
|
-
class: "rc-desc-item",
|
|
142
|
-
style: le(
|
|
143
|
+
return (b, g) => (s(), f("div", {
|
|
144
|
+
class: G(["rc-desc-item", { "rc-desc-item--label-top": u.value === "top" }]),
|
|
145
|
+
style: le(h.value)
|
|
143
146
|
}, [
|
|
144
|
-
|
|
147
|
+
M("div", {
|
|
145
148
|
class: "rc-desc-item__label",
|
|
146
|
-
style: le(
|
|
149
|
+
style: le(F.value)
|
|
147
150
|
}, [
|
|
148
|
-
q(
|
|
149
|
-
_e(
|
|
151
|
+
q(b.$slots, "label", {}, () => [
|
|
152
|
+
_e(N(e.label), 1)
|
|
150
153
|
], !0)
|
|
151
154
|
], 4),
|
|
152
|
-
|
|
153
|
-
q(
|
|
154
|
-
_e(
|
|
155
|
+
M("div", Ut, [
|
|
156
|
+
q(b.$slots, "default", {}, () => [
|
|
157
|
+
_e(N(e.value), 1)
|
|
155
158
|
], !0)
|
|
156
159
|
])
|
|
157
|
-
],
|
|
160
|
+
], 6));
|
|
158
161
|
}
|
|
159
|
-
}), Le = /* @__PURE__ */ ue(jt, [["__scopeId", "data-v-
|
|
162
|
+
}), Le = /* @__PURE__ */ ue(jt, [["__scopeId", "data-v-77b4359d"]]), Kt = { class: "rc-descriptions" }, Gt = {
|
|
160
163
|
key: 0,
|
|
161
164
|
class: "rc-descriptions__title"
|
|
162
165
|
}, qt = /* @__PURE__ */ se({
|
|
@@ -167,55 +170,58 @@ const Ut = { class: "rc-desc-item__value" }, jt = /* @__PURE__ */ se({
|
|
|
167
170
|
column: { default: 2 },
|
|
168
171
|
gap: { default: 4 },
|
|
169
172
|
labelWidth: { default: "" },
|
|
173
|
+
labelPosition: { default: "left" },
|
|
170
174
|
data: { default: () => [] },
|
|
171
175
|
keyMap: {}
|
|
172
176
|
},
|
|
173
177
|
setup(e) {
|
|
174
|
-
const
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
+
const r = e, m = E(null), t = R(() => typeof r.gap == "number" ? `${r.gap}px` : String(r.gap));
|
|
179
|
+
R(() => r.labelPosition);
|
|
180
|
+
const y = R(() => {
|
|
181
|
+
const h = typeof r.column == "string" ? Number.parseInt(r.column, 10) : r.column ?? 1;
|
|
182
|
+
return !Number.isNaN(h) && h > 0 ? h : 1;
|
|
183
|
+
}), _ = E("100%"), v = E("100%");
|
|
178
184
|
Vt(() => {
|
|
179
|
-
const
|
|
180
|
-
if (
|
|
181
|
-
|
|
185
|
+
const h = y.value;
|
|
186
|
+
if (h <= 1)
|
|
187
|
+
_.value = "100%", v.value = "100%";
|
|
182
188
|
else {
|
|
183
|
-
const
|
|
184
|
-
v.value =
|
|
189
|
+
const F = typeof r.gap == "number" ? r.gap : parseFloat(String(r.gap)) || 0, g = `calc((100% - ${(h - 1) * F}px) / ${h})`;
|
|
190
|
+
v.value = g, _.value = g;
|
|
185
191
|
}
|
|
186
|
-
}),
|
|
187
|
-
const d = R(() =>
|
|
188
|
-
|
|
189
|
-
const
|
|
190
|
-
var
|
|
191
|
-
const
|
|
192
|
-
return (
|
|
193
|
-
label: A == null ? void 0 : A[
|
|
194
|
-
value: A == null ? void 0 : A[
|
|
192
|
+
}), Re("rcDescItemWidth", _), Re("rcDescSingleWidth", v), Re("rcDescColCount", y), Re("rcDescGapPx", R(() => typeof r.gap == "number" ? r.gap : parseFloat(String(r.gap)) || 0));
|
|
193
|
+
const d = R(() => r.labelWidth === "" || r.labelWidth === void 0 ? "" : typeof r.labelWidth == "number" ? `${r.labelWidth}px` : String(r.labelWidth));
|
|
194
|
+
Re("rcDescLabelWidth", d), Re("rcDescGap", R(() => typeof r.gap == "number" ? `${r.gap}px` : String(r.gap))), Re("rcDescLabelPosition", R(() => r.labelPosition));
|
|
195
|
+
const u = R(() => {
|
|
196
|
+
var b, g, I;
|
|
197
|
+
const h = ((b = r.keyMap) == null ? void 0 : b.key) ?? "label", F = ((g = r.keyMap) == null ? void 0 : g.value) ?? "value";
|
|
198
|
+
return (I = r.data) != null && I.length ? r.data.map((A) => ({
|
|
199
|
+
label: A == null ? void 0 : A[h],
|
|
200
|
+
value: A == null ? void 0 : A[F]
|
|
195
201
|
})) : [];
|
|
196
202
|
});
|
|
197
|
-
return (
|
|
198
|
-
|
|
199
|
-
q(
|
|
200
|
-
_e(
|
|
203
|
+
return (h, F) => (s(), f("div", Kt, [
|
|
204
|
+
h.$slots.title || e.title ? (s(), f("div", Gt, [
|
|
205
|
+
q(h.$slots, "title", {}, () => [
|
|
206
|
+
_e(N(e.title), 1)
|
|
201
207
|
], !0)
|
|
202
208
|
])) : D("", !0),
|
|
203
|
-
|
|
209
|
+
M("div", {
|
|
204
210
|
class: "rc-descriptions__body",
|
|
205
211
|
style: le({ gap: t.value }),
|
|
206
212
|
ref_key: "wrapEl",
|
|
207
213
|
ref: m
|
|
208
214
|
}, [
|
|
209
|
-
|
|
210
|
-
key:
|
|
211
|
-
label:
|
|
212
|
-
value:
|
|
215
|
+
u.value.length ? (s(!0), f(oe, { key: 0 }, ve(u.value, (b, g) => (s(), ne(Le, {
|
|
216
|
+
key: g,
|
|
217
|
+
label: b.label,
|
|
218
|
+
value: b.value,
|
|
213
219
|
"label-width": e.labelWidth
|
|
214
|
-
}, null, 8, ["label", "value", "label-width"]))), 128)) : q(
|
|
220
|
+
}, null, 8, ["label", "value", "label-width"]))), 128)) : q(h.$slots, "default", { key: 1 }, void 0, !0)
|
|
215
221
|
], 4)
|
|
216
222
|
]));
|
|
217
223
|
}
|
|
218
|
-
}), We = /* @__PURE__ */ ue(qt, [["__scopeId", "data-v-
|
|
224
|
+
}), We = /* @__PURE__ */ ue(qt, [["__scopeId", "data-v-8da66092"]]);
|
|
219
225
|
We.name = "rc-descriptions";
|
|
220
226
|
Le.name = "rc-descriptions-item";
|
|
221
227
|
function pt(e) {
|
|
@@ -248,52 +254,52 @@ const za = We, Ya = Le, Jt = { class: "rc-card__title" }, Qt = { class: "rc-card
|
|
|
248
254
|
height: { default: "" }
|
|
249
255
|
},
|
|
250
256
|
setup(e) {
|
|
251
|
-
const
|
|
252
|
-
const d = typeof
|
|
257
|
+
const r = e, m = R(() => {
|
|
258
|
+
const d = typeof r.round == "boolean" ? r.round ? "12px" : "0" : typeof r.round == "number" ? `${r.round}px` : String(r.round);
|
|
253
259
|
return {
|
|
254
|
-
backgroundColor:
|
|
260
|
+
backgroundColor: r.color || "var(--rc-white)",
|
|
255
261
|
borderRadius: d,
|
|
256
|
-
boxShadow: v(
|
|
257
|
-
width:
|
|
258
|
-
height:
|
|
262
|
+
boxShadow: v(r.elevation),
|
|
263
|
+
width: _(r.width),
|
|
264
|
+
height: _(r.height)
|
|
259
265
|
};
|
|
260
|
-
}), t = R(() =>
|
|
261
|
-
() => typeof
|
|
266
|
+
}), t = R(() => r.padding || "16px"), y = R(
|
|
267
|
+
() => typeof r.gap == "number" ? `${r.gap}px` : String(r.gap)
|
|
262
268
|
);
|
|
263
|
-
function
|
|
269
|
+
function _(d) {
|
|
264
270
|
return d == null || d === "" ? "" : typeof d == "number" ? `${d}px` : String(d);
|
|
265
271
|
}
|
|
266
272
|
function v(d) {
|
|
267
273
|
if (!d || d <= 0) return "none";
|
|
268
|
-
const
|
|
269
|
-
return `0 ${Math.round(
|
|
270
|
-
|
|
271
|
-
)}px ${Math.round(
|
|
274
|
+
const u = 4 * d;
|
|
275
|
+
return `0 ${Math.round(u / 2)}px ${u}px rgba(0,0,0,0.06), 0 ${Math.round(
|
|
276
|
+
u / 4
|
|
277
|
+
)}px ${Math.round(u / 2)}px rgba(0,0,0,0.04)`;
|
|
272
278
|
}
|
|
273
|
-
return (d,
|
|
279
|
+
return (d, u) => (s(), f("div", {
|
|
274
280
|
class: G(["rc-card", [{ "rc-card--bordered": e.bordered }]]),
|
|
275
281
|
style: le(m.value)
|
|
276
282
|
}, [
|
|
277
|
-
d.$slots.title || e.title || d.$slots.status || e.status ? (
|
|
283
|
+
d.$slots.title || e.title || d.$slots.status || e.status ? (s(), f("div", {
|
|
278
284
|
key: 0,
|
|
279
285
|
class: "rc-card__top",
|
|
280
286
|
style: le({ backgroundColor: e.topBgColor || "rgba(29, 133, 252, 0.05)" })
|
|
281
287
|
}, [
|
|
282
|
-
|
|
288
|
+
M("div", Jt, [
|
|
283
289
|
q(d.$slots, "title", {}, () => [
|
|
284
|
-
|
|
290
|
+
M("span", Qt, N(e.title), 1)
|
|
285
291
|
], !0)
|
|
286
292
|
]),
|
|
287
|
-
d.$slots.status || e.status ? (
|
|
293
|
+
d.$slots.status || e.status ? (s(), f("div", Xt, [
|
|
288
294
|
q(d.$slots, "status", {}, () => [
|
|
289
|
-
|
|
295
|
+
M("span", {
|
|
290
296
|
class: "rc-card__status-text",
|
|
291
297
|
style: le({ color: e.statusColor || "var(--rc-primary)" })
|
|
292
|
-
},
|
|
298
|
+
}, N(e.status), 5)
|
|
293
299
|
], !0)
|
|
294
300
|
])) : D("", !0)
|
|
295
301
|
], 4)) : D("", !0),
|
|
296
|
-
|
|
302
|
+
M("div", {
|
|
297
303
|
class: "rc-card__body",
|
|
298
304
|
style: le({ padding: t.value, gap: y.value })
|
|
299
305
|
}, [
|
|
@@ -301,8 +307,8 @@ const za = We, Ya = Le, Jt = { class: "rc-card__title" }, Qt = { class: "rc-card
|
|
|
301
307
|
q(d.$slots, "default", {}, void 0, !0)
|
|
302
308
|
], !0)
|
|
303
309
|
], 4),
|
|
304
|
-
d.$slots.action ? (
|
|
305
|
-
d.$slots.action ? (
|
|
310
|
+
d.$slots.action ? (s(), f("div", Zt)) : D("", !0),
|
|
311
|
+
d.$slots.action ? (s(), f("div", en, [
|
|
306
312
|
q(d.$slots, "action", {}, void 0, !0)
|
|
307
313
|
])) : D("", !0)
|
|
308
314
|
], 6));
|
|
@@ -334,36 +340,36 @@ const an = {
|
|
|
334
340
|
mask: { type: Boolean, default: !1 },
|
|
335
341
|
onAfterLeave: {}
|
|
336
342
|
},
|
|
337
|
-
setup(e, { expose:
|
|
343
|
+
setup(e, { expose: r }) {
|
|
338
344
|
const m = e, t = E(!0);
|
|
339
345
|
let y;
|
|
340
|
-
function
|
|
346
|
+
function _() {
|
|
341
347
|
y && (clearTimeout(y), y = null);
|
|
342
348
|
}
|
|
343
349
|
function v() {
|
|
344
|
-
|
|
350
|
+
_(), t.value = !1;
|
|
345
351
|
}
|
|
346
|
-
return
|
|
352
|
+
return r({ close: v }), at(() => {
|
|
347
353
|
m.duration && m.duration > 0 && (y = setTimeout(() => {
|
|
348
354
|
v();
|
|
349
355
|
}, m.duration));
|
|
350
356
|
}), lt(() => {
|
|
351
|
-
|
|
352
|
-
}), (d,
|
|
353
|
-
(
|
|
357
|
+
_();
|
|
358
|
+
}), (d, u) => (s(), f(oe, null, [
|
|
359
|
+
(s(), ne(it, { to: "body" }, [
|
|
354
360
|
K(Be, {
|
|
355
361
|
name: "rc-toast-fade",
|
|
356
362
|
onAfterLeave: e.onAfterLeave
|
|
357
363
|
}, {
|
|
358
364
|
default: ae(() => [
|
|
359
|
-
t.value ? (
|
|
365
|
+
t.value ? (s(), f("div", {
|
|
360
366
|
key: 0,
|
|
361
367
|
class: G(["rc-toast", [`rc-toast--${e.type}`]])
|
|
362
368
|
}, [
|
|
363
|
-
e.mask ? (
|
|
364
|
-
|
|
365
|
-
e.type === "loading" ? (
|
|
366
|
-
|
|
369
|
+
e.mask ? (s(), f("div", an)) : D("", !0),
|
|
370
|
+
M("div", ln, [
|
|
371
|
+
e.type === "loading" ? (s(), f("div", on)) : e.type === "success" ? (s(), f("div", rn)) : e.type === "fail" ? (s(), f("div", sn)) : D("", !0),
|
|
372
|
+
M("div", un, N(e.message), 1)
|
|
367
373
|
])
|
|
368
374
|
], 2)) : D("", !0)
|
|
369
375
|
]),
|
|
@@ -374,30 +380,30 @@ const an = {
|
|
|
374
380
|
], 64));
|
|
375
381
|
}
|
|
376
382
|
}), et = /* @__PURE__ */ ue(cn, [["__scopeId", "data-v-d234c9c5"]]);
|
|
377
|
-
let Ee = null,
|
|
383
|
+
let Ee = null, Pe = null;
|
|
378
384
|
function yt() {
|
|
379
|
-
Ee && (Ee.unmount(), Ee = null),
|
|
385
|
+
Ee && (Ee.unmount(), Ee = null), Pe && (document.body.removeChild(Pe), Pe = null);
|
|
380
386
|
}
|
|
381
387
|
function La(e) {
|
|
382
|
-
const
|
|
383
|
-
yt(),
|
|
388
|
+
const r = typeof e == "string" ? { message: e } : e || {};
|
|
389
|
+
yt(), Pe = document.createElement("div"), document.body.appendChild(Pe);
|
|
384
390
|
const m = {
|
|
385
|
-
message:
|
|
386
|
-
type:
|
|
387
|
-
duration:
|
|
388
|
-
mask:
|
|
391
|
+
message: r.message,
|
|
392
|
+
type: r.type ?? "text",
|
|
393
|
+
duration: r.duration ?? 2e3,
|
|
394
|
+
mask: r.mask ?? !1,
|
|
389
395
|
onAfterLeave: () => {
|
|
390
396
|
var t;
|
|
391
|
-
yt(), (t =
|
|
397
|
+
yt(), (t = r.onClose) == null || t.call(r);
|
|
392
398
|
}
|
|
393
399
|
};
|
|
394
|
-
return Ee = Tt(et, m), Ee.mount(
|
|
400
|
+
return Ee = Tt(et, m), Ee.mount(Pe), {
|
|
395
401
|
close: dn
|
|
396
402
|
};
|
|
397
403
|
}
|
|
398
404
|
function dn() {
|
|
399
|
-
var e,
|
|
400
|
-
Ee && ((m = (
|
|
405
|
+
var e, r, m;
|
|
406
|
+
Ee && ((m = (r = (e = Ee._instance) == null ? void 0 : e.exposed) == null ? void 0 : r.close) == null || m.call(r));
|
|
401
407
|
}
|
|
402
408
|
et.name = "rc-toast";
|
|
403
409
|
function gt(e) {
|
|
@@ -409,28 +415,28 @@ const fn = {
|
|
|
409
415
|
"aria-live": "polite"
|
|
410
416
|
}, vn = { class: "rc-message__content" }, mn = /* @__PURE__ */ se({
|
|
411
417
|
__name: "index",
|
|
412
|
-
setup(e, { expose:
|
|
418
|
+
setup(e, { expose: r }) {
|
|
413
419
|
const m = Et([]);
|
|
414
420
|
let t = 1;
|
|
415
421
|
function y(v) {
|
|
416
|
-
const d = m.findIndex((
|
|
422
|
+
const d = m.findIndex((u) => u.id === v);
|
|
417
423
|
d >= 0 && m.splice(d, 1);
|
|
418
424
|
}
|
|
419
|
-
function
|
|
420
|
-
const
|
|
421
|
-
return m.push({ id:
|
|
425
|
+
function _(v, d, u) {
|
|
426
|
+
const h = t++;
|
|
427
|
+
return m.push({ id: h, type: v, content: d, duration: u }), u > 0 && window.setTimeout(() => y(h), u), h;
|
|
422
428
|
}
|
|
423
|
-
return
|
|
429
|
+
return r({ add: _, remove: y }), (v, d) => (s(), f("div", fn, [
|
|
424
430
|
K(Bt, {
|
|
425
431
|
name: "rc-message-fade",
|
|
426
432
|
tag: "div"
|
|
427
433
|
}, {
|
|
428
434
|
default: ae(() => [
|
|
429
|
-
(
|
|
430
|
-
key:
|
|
431
|
-
class: G(["rc-message__item", `rc-message--${
|
|
435
|
+
(s(!0), f(oe, null, ve(m, (u) => (s(), f("div", {
|
|
436
|
+
key: u.id,
|
|
437
|
+
class: G(["rc-message__item", `rc-message--${u.type}`])
|
|
432
438
|
}, [
|
|
433
|
-
|
|
439
|
+
M("span", vn, N(u.content), 1)
|
|
434
440
|
], 2))), 128))
|
|
435
441
|
]),
|
|
436
442
|
_: 1
|
|
@@ -438,51 +444,51 @@ const fn = {
|
|
|
438
444
|
]));
|
|
439
445
|
}
|
|
440
446
|
}), pn = /* @__PURE__ */ ue(mn, [["__scopeId", "data-v-87811df0"]]);
|
|
441
|
-
let
|
|
447
|
+
let Te = null, Ve = null;
|
|
442
448
|
function hn() {
|
|
443
|
-
var
|
|
444
|
-
if (
|
|
445
|
-
|
|
449
|
+
var r;
|
|
450
|
+
if (Te && Ve) return;
|
|
451
|
+
Te = document.createElement("div"), document.body.appendChild(Te);
|
|
446
452
|
const e = K(pn, {});
|
|
447
|
-
Mt(e,
|
|
453
|
+
Mt(e, Te), Ve = (r = e.component) == null ? void 0 : r.exposed;
|
|
448
454
|
}
|
|
449
|
-
function ze(e,
|
|
455
|
+
function ze(e, r, m) {
|
|
450
456
|
var y;
|
|
451
457
|
hn();
|
|
452
458
|
const t = typeof m == "number" ? m : e === "loading" ? 0 : 2e3;
|
|
453
|
-
return (y =
|
|
459
|
+
return (y = Ve == null ? void 0 : Ve.add) == null ? void 0 : y.call(Ve, e, r, t);
|
|
454
460
|
}
|
|
455
461
|
const yn = {
|
|
456
462
|
open(e) {
|
|
457
463
|
return ze(e.type || "info", e.content, e.duration);
|
|
458
464
|
},
|
|
459
|
-
info(e,
|
|
460
|
-
return ze("info", e,
|
|
465
|
+
info(e, r) {
|
|
466
|
+
return ze("info", e, r);
|
|
461
467
|
},
|
|
462
|
-
success(e,
|
|
463
|
-
return ze("success", e,
|
|
468
|
+
success(e, r) {
|
|
469
|
+
return ze("success", e, r);
|
|
464
470
|
},
|
|
465
|
-
warning(e,
|
|
466
|
-
return ze("warning", e,
|
|
471
|
+
warning(e, r) {
|
|
472
|
+
return ze("warning", e, r);
|
|
467
473
|
},
|
|
468
|
-
error(e,
|
|
469
|
-
return ze("error", e,
|
|
474
|
+
error(e, r) {
|
|
475
|
+
return ze("error", e, r);
|
|
470
476
|
},
|
|
471
|
-
loading(e,
|
|
472
|
-
return ze("loading", e,
|
|
477
|
+
loading(e, r) {
|
|
478
|
+
return ze("loading", e, r);
|
|
473
479
|
},
|
|
474
480
|
destroy() {
|
|
475
|
-
|
|
481
|
+
Te && (Mt(null, Te), Te.remove(), Te = null, Ve = null);
|
|
476
482
|
}
|
|
477
483
|
};
|
|
478
|
-
function
|
|
484
|
+
function bt(e) {
|
|
479
485
|
return e.config.globalProperties.$message = yn, e;
|
|
480
486
|
}
|
|
481
487
|
X.name = "rc-icon";
|
|
482
|
-
function
|
|
488
|
+
function kt(e) {
|
|
483
489
|
return e.component(X.name, X), e.component("RcIcon", X), e;
|
|
484
490
|
}
|
|
485
|
-
const gn = { class: "rc-popup__content" },
|
|
491
|
+
const gn = { class: "rc-popup__content" }, bn = /* @__PURE__ */ se({
|
|
486
492
|
name: "rc-popup",
|
|
487
493
|
__name: "index",
|
|
488
494
|
props: {
|
|
@@ -500,80 +506,80 @@ const gn = { class: "rc-popup__content" }, kn = /* @__PURE__ */ se({
|
|
|
500
506
|
lockScroll: { type: Boolean, default: !0 }
|
|
501
507
|
},
|
|
502
508
|
emits: ["update:modelValue", "open", "close", "click-overlay"],
|
|
503
|
-
setup(e, { expose:
|
|
504
|
-
const t = e, y = m,
|
|
509
|
+
setup(e, { expose: r, emit: m }) {
|
|
510
|
+
const t = e, y = m, _ = E(), v = E(t.modelValue);
|
|
505
511
|
Ie(
|
|
506
512
|
() => t.modelValue,
|
|
507
513
|
(i) => {
|
|
508
|
-
v.value = i, i ? (y("open"), t.lockScroll &&
|
|
514
|
+
v.value = i, i ? (y("open"), t.lockScroll && F()) : (y("close"), t.lockScroll && b());
|
|
509
515
|
},
|
|
510
516
|
{ immediate: !0 }
|
|
511
517
|
), Ie(v, (i) => {
|
|
512
518
|
i !== t.modelValue && y("update:modelValue", i);
|
|
513
519
|
});
|
|
514
|
-
const d = R(() => `rc-popup-slide-${t.position}`),
|
|
515
|
-
let
|
|
516
|
-
function
|
|
517
|
-
|
|
518
|
-
}
|
|
519
|
-
function x() {
|
|
520
|
-
p && (p = !1, document.body.style.overflow = "");
|
|
520
|
+
const d = R(() => `rc-popup-slide-${t.position}`), u = R(() => ({ ...t.popupStyle || {} }));
|
|
521
|
+
let h = !1;
|
|
522
|
+
function F() {
|
|
523
|
+
h || (h = !0, document.body.style.overflow = "hidden");
|
|
521
524
|
}
|
|
522
525
|
function b() {
|
|
526
|
+
h && (h = !1, document.body.style.overflow = "");
|
|
527
|
+
}
|
|
528
|
+
function g() {
|
|
523
529
|
y("click-overlay"), t.closeOnClickOverlay && A();
|
|
524
530
|
}
|
|
525
|
-
function
|
|
531
|
+
function I() {
|
|
526
532
|
A();
|
|
527
533
|
}
|
|
528
534
|
function A() {
|
|
529
535
|
v.value = !1;
|
|
530
536
|
}
|
|
531
|
-
function
|
|
537
|
+
function C() {
|
|
532
538
|
v.value = !0;
|
|
533
539
|
}
|
|
534
540
|
return lt(() => {
|
|
535
|
-
|
|
536
|
-
}),
|
|
537
|
-
open:
|
|
541
|
+
b();
|
|
542
|
+
}), r({
|
|
543
|
+
open: C,
|
|
538
544
|
close: A,
|
|
539
545
|
visible: v
|
|
540
|
-
}), (i, pe) => (
|
|
546
|
+
}), (i, pe) => (s(), ne(it, { to: "body" }, [
|
|
541
547
|
K(Be, { name: "rc-popup-fade" }, {
|
|
542
548
|
default: ae(() => [
|
|
543
|
-
v.value && t.overlay ? (
|
|
549
|
+
v.value && t.overlay ? (s(), f("div", {
|
|
544
550
|
key: 0,
|
|
545
551
|
class: G(["rc-popup__overlay", { "rc-popup__overlay--transparent": t.overlayClass === "transparent" }]),
|
|
546
552
|
style: le(t.overlayStyle),
|
|
547
|
-
onClick:
|
|
553
|
+
onClick: g
|
|
548
554
|
}, null, 6)) : D("", !0)
|
|
549
555
|
]),
|
|
550
556
|
_: 1
|
|
551
557
|
}),
|
|
552
558
|
K(Be, { name: d.value }, {
|
|
553
559
|
default: ae(() => [
|
|
554
|
-
v.value ? (
|
|
560
|
+
v.value ? (s(), f("div", {
|
|
555
561
|
key: 0,
|
|
556
562
|
ref_key: "popupRef",
|
|
557
|
-
ref:
|
|
563
|
+
ref: _,
|
|
558
564
|
class: G(["rc-popup", [
|
|
559
565
|
`rc-popup--${e.position}`,
|
|
560
566
|
{ "rc-popup--round": e.round }
|
|
561
567
|
]]),
|
|
562
|
-
style: le(
|
|
568
|
+
style: le(u.value),
|
|
563
569
|
onClick: pe[0] || (pe[0] = Ye(() => {
|
|
564
570
|
}, ["stop"]))
|
|
565
571
|
}, [
|
|
566
|
-
e.closeable ? (
|
|
572
|
+
e.closeable ? (s(), f("div", {
|
|
567
573
|
key: 0,
|
|
568
574
|
class: G(["rc-popup__close", `rc-popup__close--${e.closeIconPosition}`]),
|
|
569
|
-
onClick:
|
|
575
|
+
onClick: I
|
|
570
576
|
}, [
|
|
571
577
|
K(X, {
|
|
572
578
|
name: e.closeIcon,
|
|
573
579
|
class: "rc-popup__close-icon"
|
|
574
580
|
}, null, 8, ["name"])
|
|
575
581
|
], 2)) : D("", !0),
|
|
576
|
-
|
|
582
|
+
M("div", gn, [
|
|
577
583
|
q(i.$slots, "default", {}, void 0, !0)
|
|
578
584
|
])
|
|
579
585
|
], 6)) : D("", !0)
|
|
@@ -582,11 +588,11 @@ const gn = { class: "rc-popup__content" }, kn = /* @__PURE__ */ se({
|
|
|
582
588
|
}, 8, ["name"])
|
|
583
589
|
]));
|
|
584
590
|
}
|
|
585
|
-
}), He = /* @__PURE__ */ ue(
|
|
591
|
+
}), He = /* @__PURE__ */ ue(bn, [["__scopeId", "data-v-f1696784"]]);
|
|
586
592
|
He.name = "rc-popup";
|
|
587
|
-
const
|
|
593
|
+
const kn = "RcPopup";
|
|
588
594
|
function _t(e) {
|
|
589
|
-
return e.component(He.name, He), e.component(
|
|
595
|
+
return e.component(He.name, He), e.component(kn, He), e;
|
|
590
596
|
}
|
|
591
597
|
const _n = {
|
|
592
598
|
key: 0,
|
|
@@ -606,7 +612,7 @@ const _n = {
|
|
|
606
612
|
}, Fn = { class: "rc-calendar__month-picker" }, An = { class: "rc-calendar__month-picker-header" }, zn = { class: "rc-calendar__month-picker-title" }, Yn = { key: 0 }, Ln = {
|
|
607
613
|
key: 0,
|
|
608
614
|
class: "rc-calendar__year-picker-content"
|
|
609
|
-
},
|
|
615
|
+
}, Pn = { class: "rc-calendar__year-picker-grid" }, Nn = ["onClick"], Wn = {
|
|
610
616
|
key: 1,
|
|
611
617
|
class: "rc-calendar__month-picker-content"
|
|
612
618
|
}, Hn = ["onClick"], Xe = 48, fe = 3, rt = 7, On = /* @__PURE__ */ se({
|
|
@@ -626,48 +632,48 @@ const _n = {
|
|
|
626
632
|
maxRangeDays: {}
|
|
627
633
|
},
|
|
628
634
|
emits: ["select-day", "clear", "confirm", "shortcut-select"],
|
|
629
|
-
setup(e, { expose:
|
|
630
|
-
const t = e, y = m,
|
|
635
|
+
setup(e, { expose: r, emit: m }) {
|
|
636
|
+
const t = e, y = m, _ = ["日", "一", "二", "三", "四", "五", "六"];
|
|
631
637
|
function v(a) {
|
|
632
638
|
if (!a) return null;
|
|
633
639
|
const o = new Date(a);
|
|
634
640
|
return isNaN(o.getTime()) ? null : o;
|
|
635
641
|
}
|
|
636
642
|
function d(a) {
|
|
637
|
-
const o = a.getFullYear(),
|
|
638
|
-
return `${o}-${
|
|
643
|
+
const o = a.getFullYear(), k = String(a.getMonth() + 1).padStart(2, "0"), B = String(a.getDate()).padStart(2, "0");
|
|
644
|
+
return `${o}-${k}-${B}`;
|
|
639
645
|
}
|
|
640
|
-
const
|
|
646
|
+
const u = E(/* @__PURE__ */ new Date());
|
|
641
647
|
Ie(
|
|
642
648
|
() => [t.selectedDate, t.rangeStart],
|
|
643
649
|
() => {
|
|
644
650
|
if (t.range && t.rangeStart) {
|
|
645
651
|
const a = v(t.rangeStart);
|
|
646
|
-
a && (
|
|
652
|
+
a && (u.value = a);
|
|
647
653
|
} else if (!t.range && t.selectedDate) {
|
|
648
654
|
const a = v(t.selectedDate);
|
|
649
|
-
a && (
|
|
655
|
+
a && (u.value = a);
|
|
650
656
|
}
|
|
651
657
|
},
|
|
652
658
|
{ immediate: !0 }
|
|
653
659
|
);
|
|
654
|
-
function
|
|
660
|
+
function h(a) {
|
|
655
661
|
const o = /* @__PURE__ */ new Date();
|
|
656
662
|
return a.getFullYear() === o.getFullYear() && a.getMonth() === o.getMonth() && a.getDate() === o.getDate();
|
|
657
663
|
}
|
|
658
|
-
function
|
|
664
|
+
function F(a) {
|
|
659
665
|
if (!t.rangeStart || !t.rangeEnd) return !1;
|
|
660
|
-
const o = d(a),
|
|
661
|
-
return o >
|
|
666
|
+
const o = d(a), k = t.rangeStart, B = t.rangeEnd;
|
|
667
|
+
return o > k && o < B;
|
|
662
668
|
}
|
|
663
|
-
function
|
|
669
|
+
function b(a) {
|
|
664
670
|
if (t.disabledDate && t.disabledDate(a))
|
|
665
671
|
return !0;
|
|
666
672
|
const o = d(a);
|
|
667
673
|
return !!(t.minDate && o < t.minDate || t.maxDate && o > t.maxDate);
|
|
668
674
|
}
|
|
669
|
-
function
|
|
670
|
-
const
|
|
675
|
+
function g(a, o) {
|
|
676
|
+
const k = new Date(a, o, 1), B = new Date(a, o + 1, 0), Q = k.getDay(), Se = B.getDate(), Me = [], dt = new Date(a, o, 0).getDate();
|
|
671
677
|
for (let ie = Q - 1; ie >= 0; ie--) {
|
|
672
678
|
const ce = {
|
|
673
679
|
date: new Date(a, o - 1, dt - ie),
|
|
@@ -678,9 +684,9 @@ const _n = {
|
|
|
678
684
|
const de = t.formatter(ce);
|
|
679
685
|
de.text && (ce.text = de.text), de.bottomInfo && (ce.bottomInfo = de.bottomInfo);
|
|
680
686
|
}
|
|
681
|
-
|
|
687
|
+
Me.push(ce);
|
|
682
688
|
}
|
|
683
|
-
for (let ie = 1; ie <=
|
|
689
|
+
for (let ie = 1; ie <= Se; ie++) {
|
|
684
690
|
const ce = {
|
|
685
691
|
date: new Date(a, o, ie),
|
|
686
692
|
type: "current-month",
|
|
@@ -690,9 +696,9 @@ const _n = {
|
|
|
690
696
|
const de = t.formatter(ce);
|
|
691
697
|
de.text && (ce.text = de.text), de.bottomInfo && (ce.bottomInfo = de.bottomInfo);
|
|
692
698
|
}
|
|
693
|
-
|
|
699
|
+
Me.push(ce);
|
|
694
700
|
}
|
|
695
|
-
const Rt = 42 -
|
|
701
|
+
const Rt = 42 - Me.length;
|
|
696
702
|
for (let ie = 1; ie <= Rt; ie++) {
|
|
697
703
|
const ce = {
|
|
698
704
|
date: new Date(a, o + 1, ie),
|
|
@@ -703,94 +709,94 @@ const _n = {
|
|
|
703
709
|
const de = t.formatter(ce);
|
|
704
710
|
de.text && (ce.text = de.text), de.bottomInfo && (ce.bottomInfo = de.bottomInfo);
|
|
705
711
|
}
|
|
706
|
-
|
|
712
|
+
Me.push(ce);
|
|
707
713
|
}
|
|
708
|
-
return
|
|
714
|
+
return Me;
|
|
709
715
|
}
|
|
710
|
-
const
|
|
711
|
-
const a =
|
|
712
|
-
return
|
|
716
|
+
const I = R(() => {
|
|
717
|
+
const a = u.value.getFullYear(), o = u.value.getMonth();
|
|
718
|
+
return g(a, o);
|
|
713
719
|
}), A = R(() => {
|
|
714
|
-
const a =
|
|
720
|
+
const a = u.value.getFullYear(), o = u.value.getMonth() + 1;
|
|
715
721
|
return `${a}年${o}月`;
|
|
716
722
|
});
|
|
717
|
-
function
|
|
723
|
+
function C(a) {
|
|
718
724
|
const o = [];
|
|
719
|
-
if (a.type !== "current-month" && o.push("is-other-month"),
|
|
725
|
+
if (a.type !== "current-month" && o.push("is-other-month"), h(a.date) && o.push("is-today"), b(a.date))
|
|
720
726
|
return o.push("is-disabled"), o;
|
|
721
|
-
const
|
|
722
|
-
return t.range ? (t.rangeStart ===
|
|
727
|
+
const k = d(a.date);
|
|
728
|
+
return t.range ? (t.rangeStart === k && o.push("is-start"), t.rangeEnd === k && o.push("is-end"), F(a.date) && o.push("is-in-range")) : t.selectedDate === k && o.push("is-selected"), o;
|
|
723
729
|
}
|
|
724
730
|
const i = R(() => !!(t.rangeStart && t.rangeEnd)), pe = R(() => t.rangeStart && t.rangeEnd ? 2 : t.rangeStart || t.rangeEnd ? 1 : 0);
|
|
725
731
|
function he(a) {
|
|
726
732
|
if (!t.minDate && !t.maxDate)
|
|
727
733
|
return !1;
|
|
728
|
-
const o = t.minDate ? v(t.minDate) : null,
|
|
729
|
-
return !!(o && a < o.getFullYear() ||
|
|
734
|
+
const o = t.minDate ? v(t.minDate) : null, k = t.maxDate ? v(t.maxDate) : null;
|
|
735
|
+
return !!(o && a < o.getFullYear() || k && a > k.getFullYear());
|
|
730
736
|
}
|
|
731
737
|
function ye(a, o) {
|
|
732
|
-
const
|
|
733
|
-
if (
|
|
734
|
-
const Q =
|
|
735
|
-
if (a < Q || a === Q && o <
|
|
738
|
+
const k = t.minDate ? v(t.minDate) : null, B = t.maxDate ? v(t.maxDate) : null;
|
|
739
|
+
if (k) {
|
|
740
|
+
const Q = k.getFullYear(), Se = k.getMonth() + 1;
|
|
741
|
+
if (a < Q || a === Q && o < Se)
|
|
736
742
|
return !0;
|
|
737
743
|
}
|
|
738
|
-
if (
|
|
739
|
-
const Q =
|
|
740
|
-
if (a > Q || a === Q && o >
|
|
744
|
+
if (B) {
|
|
745
|
+
const Q = B.getFullYear(), Se = B.getMonth() + 1;
|
|
746
|
+
if (a > Q || a === Q && o > Se)
|
|
741
747
|
return !0;
|
|
742
748
|
}
|
|
743
749
|
return !1;
|
|
744
750
|
}
|
|
745
|
-
const O = E(!1), H = E("year"), U = E(
|
|
746
|
-
const a = [],
|
|
747
|
-
for (let
|
|
748
|
-
a.push(
|
|
751
|
+
const O = E(!1), H = E("year"), U = E(u.value.getFullYear()), z = E(u.value.getMonth() + 1), j = E(), S = E(1900), T = E(1920), V = E(1900), Y = E(2100), ge = R(() => {
|
|
752
|
+
const a = [], k = Math.floor((S.value - V.value) / fe) - 3, B = Math.ceil((T.value - V.value) / fe) + 3, Q = V.value + Math.max(0, k) * fe, Se = V.value + B * fe - 1;
|
|
753
|
+
for (let Me = Q; Me <= Se; Me++)
|
|
754
|
+
a.push(Me);
|
|
749
755
|
return a;
|
|
750
756
|
});
|
|
751
|
-
Ie(() =>
|
|
757
|
+
Ie(() => u.value, (a) => {
|
|
752
758
|
U.value = a.getFullYear(), z.value = a.getMonth() + 1;
|
|
753
759
|
}, { immediate: !0 });
|
|
754
|
-
function
|
|
760
|
+
function be() {
|
|
755
761
|
if (!j.value) return;
|
|
756
|
-
const a = j.value.scrollTop,
|
|
757
|
-
|
|
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);
|
|
758
764
|
}
|
|
759
|
-
function
|
|
760
|
-
U.value =
|
|
765
|
+
function ke() {
|
|
766
|
+
U.value = u.value.getFullYear(), z.value = u.value.getMonth() + 1, H.value = "year", O.value = !0;
|
|
761
767
|
const a = U.value;
|
|
762
|
-
a <
|
|
768
|
+
a < V.value ? V.value = Math.floor(a / 100) * 100 : a > Y.value && (Y.value = Math.ceil(a / 100) * 100 + 99), Fe(() => {
|
|
763
769
|
if (j.value) {
|
|
764
|
-
const o = Math.floor((a -
|
|
765
|
-
|
|
770
|
+
const o = Math.floor((a - V.value) / fe), k = Math.max(0, o - 2);
|
|
771
|
+
S.value = V.value + k * fe, T.value = S.value + rt * fe - 1, we(a);
|
|
766
772
|
}
|
|
767
773
|
});
|
|
768
774
|
}
|
|
769
775
|
function we(a) {
|
|
770
776
|
if (!j.value) return;
|
|
771
|
-
a <
|
|
772
|
-
const o = Math.floor((a -
|
|
773
|
-
j.value.scrollTop =
|
|
774
|
-
const
|
|
775
|
-
|
|
776
|
-
}
|
|
777
|
-
function w() {
|
|
778
|
-
const a = new Date(r.value);
|
|
779
|
-
a.setMonth(a.getMonth() - 1), r.value = a;
|
|
777
|
+
a < V.value ? V.value = Math.floor(a / 100) * 100 : a > Y.value && (Y.value = Math.ceil(a / 100) * 100 + 99);
|
|
778
|
+
const o = Math.floor((a - V.value) / fe), k = o * Xe;
|
|
779
|
+
j.value.scrollTop = k;
|
|
780
|
+
const B = Math.max(0, o - 2);
|
|
781
|
+
S.value = V.value + B * fe, T.value = S.value + rt * fe - 1;
|
|
780
782
|
}
|
|
781
783
|
function $() {
|
|
782
|
-
const a = new Date(
|
|
783
|
-
a.setMonth(a.getMonth()
|
|
784
|
+
const a = new Date(u.value);
|
|
785
|
+
a.setMonth(a.getMonth() - 1), u.value = a;
|
|
786
|
+
}
|
|
787
|
+
function x() {
|
|
788
|
+
const a = new Date(u.value);
|
|
789
|
+
a.setMonth(a.getMonth() + 1), u.value = a;
|
|
784
790
|
}
|
|
785
791
|
function L(a) {
|
|
786
792
|
he(a) || (U.value = a, H.value = "month");
|
|
787
793
|
}
|
|
788
794
|
function te(a) {
|
|
789
|
-
ye(U.value, a) || (z.value = a,
|
|
795
|
+
ye(U.value, a) || (z.value = a, p());
|
|
790
796
|
}
|
|
791
|
-
function
|
|
792
|
-
const a = new Date(
|
|
793
|
-
a.setFullYear(U.value), a.setMonth(z.value - 1),
|
|
797
|
+
function p() {
|
|
798
|
+
const a = new Date(u.value);
|
|
799
|
+
a.setFullYear(U.value), a.setMonth(z.value - 1), u.value = a, O.value = !1, H.value = "year";
|
|
794
800
|
}
|
|
795
801
|
function Z(a) {
|
|
796
802
|
y("select-day", a);
|
|
@@ -804,33 +810,33 @@ const _n = {
|
|
|
804
810
|
function c() {
|
|
805
811
|
y("confirm");
|
|
806
812
|
}
|
|
807
|
-
function
|
|
813
|
+
function w() {
|
|
808
814
|
O.value = !1;
|
|
809
815
|
}
|
|
810
816
|
function W(a) {
|
|
811
817
|
H.value = a;
|
|
812
818
|
}
|
|
813
|
-
function
|
|
819
|
+
function P() {
|
|
814
820
|
const o = (/* @__PURE__ */ new Date()).getFullYear();
|
|
815
821
|
he(o) || (U.value = o, H.value = "month");
|
|
816
822
|
}
|
|
817
823
|
function ee() {
|
|
818
824
|
const o = (/* @__PURE__ */ new Date()).getMonth() + 1;
|
|
819
|
-
ye(U.value, o) || (z.value = o,
|
|
825
|
+
ye(U.value, o) || (z.value = o, p());
|
|
820
826
|
}
|
|
821
827
|
const re = R(() => t.range ? !!(t.rangeStart || t.rangeEnd) : !!t.selectedDate);
|
|
822
828
|
function me(a, o) {
|
|
823
|
-
const
|
|
824
|
-
if (!
|
|
825
|
-
const Q = Math.abs(
|
|
829
|
+
const k = v(a), B = v(o);
|
|
830
|
+
if (!k || !B) return 0;
|
|
831
|
+
const Q = Math.abs(B.getTime() - k.getTime());
|
|
826
832
|
return Math.ceil(Q / (1e3 * 60 * 60 * 24)) + 1;
|
|
827
833
|
}
|
|
828
834
|
function $e() {
|
|
829
835
|
return d(/* @__PURE__ */ new Date());
|
|
830
836
|
}
|
|
831
837
|
function Ae() {
|
|
832
|
-
const a = /* @__PURE__ */ new Date(), o = a.getDay(),
|
|
833
|
-
return new Date(a.getFullYear(), a.getMonth(),
|
|
838
|
+
const a = /* @__PURE__ */ new Date(), o = a.getDay(), k = a.getDate() - o + (o === 0 ? -6 : 1);
|
|
839
|
+
return new Date(a.getFullYear(), a.getMonth(), k);
|
|
834
840
|
}
|
|
835
841
|
function xe() {
|
|
836
842
|
const a = Ae(), o = new Date(a);
|
|
@@ -840,7 +846,7 @@ const _n = {
|
|
|
840
846
|
const a = /* @__PURE__ */ new Date();
|
|
841
847
|
return new Date(a.getFullYear(), a.getMonth(), 1);
|
|
842
848
|
}
|
|
843
|
-
function
|
|
849
|
+
function Ne() {
|
|
844
850
|
const a = /* @__PURE__ */ new Date();
|
|
845
851
|
return new Date(a.getFullYear(), a.getMonth() + 1, 0);
|
|
846
852
|
}
|
|
@@ -879,7 +885,7 @@ const _n = {
|
|
|
879
885
|
key: "month",
|
|
880
886
|
label: "本月",
|
|
881
887
|
getRange: () => {
|
|
882
|
-
const a = d(Ue()), o = d(
|
|
888
|
+
const a = d(Ue()), o = d(Ne());
|
|
883
889
|
return [a, o];
|
|
884
890
|
}
|
|
885
891
|
},
|
|
@@ -887,7 +893,7 @@ const _n = {
|
|
|
887
893
|
key: "threeMonths",
|
|
888
894
|
label: "近三月",
|
|
889
895
|
getRange: () => {
|
|
890
|
-
const a = d(je()), o = d(
|
|
896
|
+
const a = d(je()), o = d(Ne());
|
|
891
897
|
return [a, o];
|
|
892
898
|
}
|
|
893
899
|
},
|
|
@@ -937,42 +943,42 @@ const _n = {
|
|
|
937
943
|
y("shortcut-select", o);
|
|
938
944
|
}
|
|
939
945
|
}
|
|
940
|
-
return
|
|
946
|
+
return r({
|
|
941
947
|
yearScrollRef: j
|
|
942
|
-
}), (a, o) => (
|
|
943
|
-
e.showTitle ? (
|
|
944
|
-
|
|
945
|
-
|
|
948
|
+
}), (a, o) => (s(), f("div", null, [
|
|
949
|
+
e.showTitle ? (s(), f("div", _n, [
|
|
950
|
+
M("div", wn, N(e.title), 1),
|
|
951
|
+
M("span", {
|
|
946
952
|
class: G(["rc-calendar__header-clear", { "is-disabled": !re.value }]),
|
|
947
953
|
onClick: l
|
|
948
954
|
}, " 清空 ", 2)
|
|
949
955
|
])) : D("", !0),
|
|
950
|
-
e.range ? (
|
|
951
|
-
|
|
952
|
-
(
|
|
953
|
-
key:
|
|
956
|
+
e.range ? (s(), f("div", $n, [
|
|
957
|
+
M("div", xn, [
|
|
958
|
+
(s(!0), f(oe, null, ve(Je.value, (k) => (s(), f("div", {
|
|
959
|
+
key: k.key,
|
|
954
960
|
class: "rc-calendar__shortcut-item",
|
|
955
|
-
onClick: (
|
|
956
|
-
},
|
|
961
|
+
onClick: (B) => Qe(k)
|
|
962
|
+
}, N(k.label), 9, Dn))), 128))
|
|
957
963
|
])
|
|
958
964
|
])) : D("", !0),
|
|
959
|
-
|
|
960
|
-
|
|
965
|
+
M("div", Cn, [
|
|
966
|
+
M("div", {
|
|
961
967
|
class: "rc-calendar__nav-button",
|
|
962
|
-
onClick:
|
|
968
|
+
onClick: $
|
|
963
969
|
}, [
|
|
964
970
|
K(J(X), {
|
|
965
971
|
name: "icon_caret-left",
|
|
966
972
|
class: "rc-calendar__nav-icon"
|
|
967
973
|
})
|
|
968
974
|
]),
|
|
969
|
-
|
|
975
|
+
M("div", {
|
|
970
976
|
class: "rc-calendar__month-text",
|
|
971
|
-
onClick:
|
|
972
|
-
},
|
|
973
|
-
|
|
977
|
+
onClick: ke
|
|
978
|
+
}, N(A.value), 1),
|
|
979
|
+
M("div", {
|
|
974
980
|
class: "rc-calendar__nav-button",
|
|
975
|
-
onClick:
|
|
981
|
+
onClick: x
|
|
976
982
|
}, [
|
|
977
983
|
K(J(X), {
|
|
978
984
|
name: "icon_caret-right",
|
|
@@ -980,26 +986,26 @@ const _n = {
|
|
|
980
986
|
})
|
|
981
987
|
])
|
|
982
988
|
]),
|
|
983
|
-
|
|
984
|
-
(
|
|
985
|
-
key:
|
|
989
|
+
M("div", Sn, [
|
|
990
|
+
(s(), f(oe, null, ve(_, (k) => M("div", {
|
|
991
|
+
key: k,
|
|
986
992
|
class: "rc-calendar__weekday"
|
|
987
|
-
},
|
|
993
|
+
}, N(k), 1)), 64))
|
|
988
994
|
]),
|
|
989
|
-
|
|
990
|
-
(
|
|
991
|
-
key:
|
|
992
|
-
class: G(["rc-calendar__day",
|
|
993
|
-
onClick: (Q) => Z(
|
|
995
|
+
M("div", Mn, [
|
|
996
|
+
(s(!0), f(oe, null, ve(I.value, (k, B) => (s(), f("div", {
|
|
997
|
+
key: B,
|
|
998
|
+
class: G(["rc-calendar__day", C(k)]),
|
|
999
|
+
onClick: (Q) => Z(k)
|
|
994
1000
|
}, [
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
1001
|
+
M("div", Rn, [
|
|
1002
|
+
M("span", Vn, N(k.text), 1),
|
|
1003
|
+
k.bottomInfo ? (s(), f("span", Tn, N(k.bottomInfo), 1)) : D("", !0)
|
|
998
1004
|
])
|
|
999
1005
|
], 10, In))), 128))
|
|
1000
1006
|
]),
|
|
1001
|
-
e.range && e.showFooter ? (
|
|
1002
|
-
K(J(
|
|
1007
|
+
e.range && e.showFooter ? (s(), f("div", En, [
|
|
1008
|
+
K(J(Ce), {
|
|
1003
1009
|
type: "default",
|
|
1004
1010
|
class: "rc-calendar__footer-reset",
|
|
1005
1011
|
onClick: n
|
|
@@ -1009,57 +1015,57 @@ const _n = {
|
|
|
1009
1015
|
])]),
|
|
1010
1016
|
_: 1
|
|
1011
1017
|
}),
|
|
1012
|
-
K(J(
|
|
1018
|
+
K(J(Ce), {
|
|
1013
1019
|
type: "primary",
|
|
1014
1020
|
class: "rc-calendar__footer-confirm",
|
|
1015
1021
|
disabled: !i.value,
|
|
1016
1022
|
onClick: c
|
|
1017
1023
|
}, {
|
|
1018
1024
|
default: ae(() => [
|
|
1019
|
-
_e(
|
|
1025
|
+
_e(N(i.value ? `确定(${pe.value}项)` : "确定"), 1)
|
|
1020
1026
|
]),
|
|
1021
1027
|
_: 1
|
|
1022
1028
|
}, 8, ["disabled"])
|
|
1023
1029
|
])) : D("", !0),
|
|
1024
1030
|
K(Be, { name: "rc-calendar-fade" }, {
|
|
1025
1031
|
default: ae(() => [
|
|
1026
|
-
O.value ? (
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
K(J(
|
|
1032
|
+
O.value ? (s(), f("div", Bn, [
|
|
1033
|
+
M("div", Fn, [
|
|
1034
|
+
M("div", An, [
|
|
1035
|
+
K(J(Ce), {
|
|
1030
1036
|
type: "default",
|
|
1031
1037
|
mode: "text",
|
|
1032
1038
|
size: "small",
|
|
1033
|
-
onClick:
|
|
1039
|
+
onClick: w
|
|
1034
1040
|
}, {
|
|
1035
1041
|
default: ae(() => [...o[3] || (o[3] = [
|
|
1036
1042
|
_e("取消", -1)
|
|
1037
1043
|
])]),
|
|
1038
1044
|
_: 1
|
|
1039
1045
|
}),
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
onClick: o[0] || (o[0] = (
|
|
1043
|
-
},
|
|
1044
|
-
H.value === "month" ? (
|
|
1045
|
-
H.value === "month" ? (
|
|
1046
|
+
M("div", zn, [
|
|
1047
|
+
M("span", {
|
|
1048
|
+
onClick: o[0] || (o[0] = (k) => W("year"))
|
|
1049
|
+
}, N(U.value) + "年", 1),
|
|
1050
|
+
H.value === "month" ? (s(), f("span", Yn, " - ")) : D("", !0),
|
|
1051
|
+
H.value === "month" ? (s(), f("span", {
|
|
1046
1052
|
key: 1,
|
|
1047
|
-
onClick: o[1] || (o[1] = (
|
|
1048
|
-
},
|
|
1053
|
+
onClick: o[1] || (o[1] = (k) => W("month"))
|
|
1054
|
+
}, N(z.value) + "月", 1)) : D("", !0)
|
|
1049
1055
|
]),
|
|
1050
|
-
H.value === "year" ? (
|
|
1056
|
+
H.value === "year" ? (s(), ne(J(Ce), {
|
|
1051
1057
|
key: 0,
|
|
1052
1058
|
type: "primary",
|
|
1053
1059
|
mode: "text",
|
|
1054
1060
|
size: "small",
|
|
1055
|
-
onClick:
|
|
1061
|
+
onClick: P
|
|
1056
1062
|
}, {
|
|
1057
1063
|
default: ae(() => [...o[4] || (o[4] = [
|
|
1058
1064
|
_e(" 本年 ", -1)
|
|
1059
1065
|
])]),
|
|
1060
1066
|
_: 1
|
|
1061
1067
|
})) : D("", !0),
|
|
1062
|
-
H.value === "month" ? (
|
|
1068
|
+
H.value === "month" ? (s(), ne(J(Ce), {
|
|
1063
1069
|
key: 1,
|
|
1064
1070
|
type: "primary",
|
|
1065
1071
|
mode: "text",
|
|
@@ -1072,42 +1078,42 @@ const _n = {
|
|
|
1072
1078
|
_: 1
|
|
1073
1079
|
})) : D("", !0)
|
|
1074
1080
|
]),
|
|
1075
|
-
H.value === "year" ? (
|
|
1076
|
-
|
|
1081
|
+
H.value === "year" ? (s(), f("div", Ln, [
|
|
1082
|
+
M("div", {
|
|
1077
1083
|
class: "rc-calendar__year-picker-scroll",
|
|
1078
1084
|
ref_key: "yearScrollRef",
|
|
1079
1085
|
ref: j,
|
|
1080
|
-
onScroll:
|
|
1086
|
+
onScroll: be
|
|
1081
1087
|
}, [
|
|
1082
|
-
|
|
1088
|
+
M("div", {
|
|
1083
1089
|
class: "rc-calendar__year-picker-spacer",
|
|
1084
|
-
style: le({ height: `${Math.floor((
|
|
1090
|
+
style: le({ height: `${Math.floor((S.value - V.value) / fe) * Xe}px` })
|
|
1085
1091
|
}, null, 4),
|
|
1086
|
-
|
|
1087
|
-
(
|
|
1088
|
-
key:
|
|
1092
|
+
M("div", Pn, [
|
|
1093
|
+
(s(!0), f(oe, null, ve(ge.value, (k) => (s(), f("div", {
|
|
1094
|
+
key: k,
|
|
1089
1095
|
class: G(["rc-calendar__year-picker-item", {
|
|
1090
|
-
"is-selected": U.value ===
|
|
1091
|
-
"is-disabled": he(
|
|
1096
|
+
"is-selected": U.value === k,
|
|
1097
|
+
"is-disabled": he(k)
|
|
1092
1098
|
}]),
|
|
1093
|
-
onClick: (
|
|
1094
|
-
},
|
|
1099
|
+
onClick: (B) => L(k)
|
|
1100
|
+
}, N(k), 11, Nn))), 128))
|
|
1095
1101
|
]),
|
|
1096
|
-
|
|
1102
|
+
M("div", {
|
|
1097
1103
|
class: "rc-calendar__year-picker-spacer",
|
|
1098
1104
|
style: le({ height: `${Math.ceil((Y.value - T.value) / fe) * Xe}px` })
|
|
1099
1105
|
}, null, 4)
|
|
1100
1106
|
], 544)
|
|
1101
1107
|
])) : D("", !0),
|
|
1102
|
-
H.value === "month" ? (
|
|
1103
|
-
(
|
|
1104
|
-
key:
|
|
1108
|
+
H.value === "month" ? (s(), f("div", Wn, [
|
|
1109
|
+
(s(), f(oe, null, ve(12, (k) => M("div", {
|
|
1110
|
+
key: k,
|
|
1105
1111
|
class: G(["rc-calendar__month-picker-item", {
|
|
1106
|
-
"is-selected": z.value ===
|
|
1107
|
-
"is-disabled": ye(U.value,
|
|
1112
|
+
"is-selected": z.value === k,
|
|
1113
|
+
"is-disabled": ye(U.value, k)
|
|
1108
1114
|
}]),
|
|
1109
|
-
onClick: (
|
|
1110
|
-
},
|
|
1115
|
+
onClick: (B) => te(k)
|
|
1116
|
+
}, N(k) + "月 ", 11, Hn)), 64))
|
|
1111
1117
|
])) : D("", !0)
|
|
1112
1118
|
])
|
|
1113
1119
|
])) : D("", !0)
|
|
@@ -1137,189 +1143,189 @@ const _n = {
|
|
|
1137
1143
|
endDateOffset: { type: Boolean, default: !1 }
|
|
1138
1144
|
},
|
|
1139
1145
|
emits: ["update:modelValue", "change", "confirm"],
|
|
1140
|
-
setup(e, { emit:
|
|
1141
|
-
const m = e, t =
|
|
1142
|
-
if (m.disabledDate && m.disabledDate(
|
|
1146
|
+
setup(e, { emit: r }) {
|
|
1147
|
+
const m = e, t = r, y = E(), _ = E(), v = E(!1), d = E(""), u = R(() => m.range === !0 || typeof m.range == "number"), h = R(() => typeof m.range == "number" ? m.range : void 0), F = R(() => ($) => {
|
|
1148
|
+
if (m.disabledDate && m.disabledDate($))
|
|
1143
1149
|
return !0;
|
|
1144
|
-
if (
|
|
1145
|
-
const
|
|
1146
|
-
if (
|
|
1150
|
+
if (h.value !== void 0 && g.value && !I.value) {
|
|
1151
|
+
const x = i($);
|
|
1152
|
+
if (C(g.value) && pe(g.value, x) > h.value)
|
|
1147
1153
|
return !0;
|
|
1148
1154
|
}
|
|
1149
1155
|
return !1;
|
|
1150
|
-
}),
|
|
1156
|
+
}), b = E(null), g = E(null), I = E(null);
|
|
1151
1157
|
Ie(
|
|
1152
1158
|
() => m.modelValue,
|
|
1153
|
-
(
|
|
1154
|
-
|
|
1159
|
+
($) => {
|
|
1160
|
+
u.value ? Array.isArray($) && $.length === 2 ? (g.value = $[0], I.value = H($[1])) : (g.value = null, I.value = null) : b.value = typeof $ == "string" ? $ : null, A();
|
|
1155
1161
|
},
|
|
1156
1162
|
{ immediate: !0 }
|
|
1157
1163
|
);
|
|
1158
1164
|
function A() {
|
|
1159
|
-
m.mode === "popup" && (
|
|
1165
|
+
m.mode === "popup" && (u.value ? g.value && I.value ? d.value = `${g.value} ~ ${I.value}` : g.value ? d.value = `${g.value} ~ ` : d.value = "" : d.value = b.value || "");
|
|
1160
1166
|
}
|
|
1161
|
-
function
|
|
1162
|
-
if (
|
|
1163
|
-
const
|
|
1164
|
-
return isNaN(
|
|
1167
|
+
function C($) {
|
|
1168
|
+
if (!$) return null;
|
|
1169
|
+
const x = new Date($);
|
|
1170
|
+
return isNaN(x.getTime()) ? null : x;
|
|
1165
1171
|
}
|
|
1166
|
-
function i(
|
|
1167
|
-
const
|
|
1168
|
-
return `${
|
|
1172
|
+
function i($) {
|
|
1173
|
+
const x = $.getFullYear(), L = String($.getMonth() + 1).padStart(2, "0"), te = String($.getDate()).padStart(2, "0");
|
|
1174
|
+
return `${x}-${L}-${te}`;
|
|
1169
1175
|
}
|
|
1170
|
-
function pe(
|
|
1171
|
-
const L =
|
|
1176
|
+
function pe($, x) {
|
|
1177
|
+
const L = C($), te = C(x);
|
|
1172
1178
|
if (!L || !te) return 0;
|
|
1173
|
-
const
|
|
1174
|
-
return Math.ceil(
|
|
1179
|
+
const p = Math.abs(te.getTime() - L.getTime());
|
|
1180
|
+
return Math.ceil(p / (1e3 * 60 * 60 * 24));
|
|
1175
1181
|
}
|
|
1176
|
-
function he(
|
|
1177
|
-
const
|
|
1178
|
-
return
|
|
1182
|
+
function he($) {
|
|
1183
|
+
const x = C($);
|
|
1184
|
+
return x ? (x.setDate(x.getDate() + 1), i(x)) : $;
|
|
1179
1185
|
}
|
|
1180
|
-
function ye(
|
|
1181
|
-
const
|
|
1182
|
-
return
|
|
1186
|
+
function ye($) {
|
|
1187
|
+
const x = C($);
|
|
1188
|
+
return x ? (x.setDate(x.getDate() - 1), i(x)) : $;
|
|
1183
1189
|
}
|
|
1184
|
-
function O(
|
|
1185
|
-
return m.endDateOffset &&
|
|
1190
|
+
function O($) {
|
|
1191
|
+
return m.endDateOffset && u.value ? he($) : $;
|
|
1186
1192
|
}
|
|
1187
|
-
function H(
|
|
1188
|
-
return m.endDateOffset &&
|
|
1193
|
+
function H($) {
|
|
1194
|
+
return m.endDateOffset && u.value ? ye($) : $;
|
|
1189
1195
|
}
|
|
1190
|
-
function U(
|
|
1191
|
-
if (
|
|
1196
|
+
function U($) {
|
|
1197
|
+
if ($.type !== "current-month" || m.disabledDate && m.disabledDate($.date))
|
|
1192
1198
|
return;
|
|
1193
|
-
const
|
|
1194
|
-
if (!(m.minDate &&
|
|
1195
|
-
if (
|
|
1196
|
-
if (!
|
|
1197
|
-
|
|
1199
|
+
const x = i($.date);
|
|
1200
|
+
if (!(m.minDate && x < m.minDate) && !(m.maxDate && x > m.maxDate)) {
|
|
1201
|
+
if (u.value)
|
|
1202
|
+
if (!g.value || g.value && I.value)
|
|
1203
|
+
g.value = x, I.value = null;
|
|
1198
1204
|
else {
|
|
1199
|
-
let L =
|
|
1200
|
-
if (
|
|
1201
|
-
const
|
|
1205
|
+
let L = g.value, te = x;
|
|
1206
|
+
if (x < g.value && (te = g.value, L = x), g.value = L, I.value = te, g.value && I.value) {
|
|
1207
|
+
const p = O(I.value), Z = [g.value, p];
|
|
1202
1208
|
t("update:modelValue", Z), t("change", Z), m.showFooter || z();
|
|
1203
1209
|
}
|
|
1204
1210
|
}
|
|
1205
1211
|
else {
|
|
1206
|
-
|
|
1207
|
-
const L =
|
|
1208
|
-
t("update:modelValue", L), t("change", L), m.mode &&
|
|
1212
|
+
b.value = x;
|
|
1213
|
+
const L = x;
|
|
1214
|
+
t("update:modelValue", L), t("change", L), m.mode && V();
|
|
1209
1215
|
}
|
|
1210
1216
|
A();
|
|
1211
1217
|
}
|
|
1212
1218
|
}
|
|
1213
1219
|
function z() {
|
|
1214
|
-
if (
|
|
1215
|
-
const
|
|
1216
|
-
t("update:modelValue",
|
|
1220
|
+
if (g.value && I.value) {
|
|
1221
|
+
const $ = O(I.value), x = [g.value, $];
|
|
1222
|
+
t("update:modelValue", x), t("change", x), t("confirm", x), V();
|
|
1217
1223
|
}
|
|
1218
1224
|
}
|
|
1219
1225
|
function j() {
|
|
1220
|
-
|
|
1221
|
-
const
|
|
1222
|
-
t("update:modelValue",
|
|
1226
|
+
u.value ? (g.value = null, I.value = null) : b.value = null;
|
|
1227
|
+
const $ = null;
|
|
1228
|
+
t("update:modelValue", $), t("change", $), A();
|
|
1223
1229
|
}
|
|
1224
|
-
function
|
|
1225
|
-
|
|
1226
|
-
const
|
|
1230
|
+
function S($) {
|
|
1231
|
+
g.value = $[0], I.value = $[1];
|
|
1232
|
+
const x = O($[1]), L = [$[0], x];
|
|
1227
1233
|
t("update:modelValue", L), t("change", L), m.showFooter ? A() : z();
|
|
1228
1234
|
}
|
|
1229
1235
|
function T() {
|
|
1230
1236
|
v.value = !0;
|
|
1231
1237
|
}
|
|
1232
|
-
function
|
|
1238
|
+
function V() {
|
|
1233
1239
|
v.value = !1;
|
|
1234
1240
|
}
|
|
1235
|
-
function Y(
|
|
1236
|
-
v.value =
|
|
1241
|
+
function Y($) {
|
|
1242
|
+
v.value = $;
|
|
1237
1243
|
}
|
|
1238
1244
|
function ge() {
|
|
1239
1245
|
T();
|
|
1240
1246
|
}
|
|
1241
|
-
function
|
|
1247
|
+
function be() {
|
|
1242
1248
|
m.mode === "popup" && we();
|
|
1243
1249
|
}
|
|
1244
|
-
function
|
|
1250
|
+
function ke() {
|
|
1245
1251
|
v.value || T();
|
|
1246
1252
|
}
|
|
1247
1253
|
function we() {
|
|
1248
|
-
const
|
|
1249
|
-
if (
|
|
1250
|
-
const
|
|
1251
|
-
if (
|
|
1252
|
-
const L =
|
|
1254
|
+
const $ = d.value.trim();
|
|
1255
|
+
if (u.value) {
|
|
1256
|
+
const x = $.split("~").map((L) => L.trim());
|
|
1257
|
+
if (x.length === 2 && x[0] && x[1]) {
|
|
1258
|
+
const L = C(x[0]), te = C(x[1]);
|
|
1253
1259
|
if (L && te && !isNaN(L.getTime()) && !isNaN(te.getTime())) {
|
|
1254
|
-
|
|
1255
|
-
const
|
|
1256
|
-
|
|
1257
|
-
const Z = O(
|
|
1260
|
+
g.value = i(L);
|
|
1261
|
+
const p = i(te);
|
|
1262
|
+
I.value = H(p);
|
|
1263
|
+
const Z = O(I.value), n = [g.value, Z];
|
|
1258
1264
|
t("update:modelValue", n), t("change", n);
|
|
1259
1265
|
return;
|
|
1260
1266
|
}
|
|
1261
1267
|
}
|
|
1262
1268
|
} else {
|
|
1263
|
-
const
|
|
1264
|
-
if (
|
|
1265
|
-
|
|
1269
|
+
const x = C($);
|
|
1270
|
+
if (x && !isNaN(x.getTime())) {
|
|
1271
|
+
b.value = i(x), t("update:modelValue", b.value), t("change", b.value);
|
|
1266
1272
|
return;
|
|
1267
1273
|
}
|
|
1268
1274
|
}
|
|
1269
1275
|
A();
|
|
1270
1276
|
}
|
|
1271
|
-
return (
|
|
1272
|
-
e.mode === "popup" ? (
|
|
1277
|
+
return ($, x) => (s(), f("div", Un, [
|
|
1278
|
+
e.mode === "popup" ? (s(), f("div", {
|
|
1273
1279
|
key: 0,
|
|
1274
1280
|
class: "rc-calendar__input",
|
|
1275
1281
|
onClick: T
|
|
1276
1282
|
}, [
|
|
1277
|
-
Ft(
|
|
1283
|
+
Ft(M("input", {
|
|
1278
1284
|
ref_key: "inputRef",
|
|
1279
1285
|
ref: y,
|
|
1280
|
-
"onUpdate:modelValue":
|
|
1286
|
+
"onUpdate:modelValue": x[0] || (x[0] = (L) => d.value = L),
|
|
1281
1287
|
type: "text",
|
|
1282
1288
|
class: "rc-calendar__input-field",
|
|
1283
1289
|
placeholder: e.placeholder,
|
|
1284
1290
|
readonly: "",
|
|
1285
1291
|
onFocus: ge,
|
|
1286
|
-
onBlur:
|
|
1287
|
-
onInput:
|
|
1292
|
+
onBlur: be,
|
|
1293
|
+
onInput: ke
|
|
1288
1294
|
}, null, 40, jn), [
|
|
1289
1295
|
[At, d.value]
|
|
1290
1296
|
]),
|
|
1291
|
-
|
|
1297
|
+
M("div", Kn, [
|
|
1292
1298
|
K(J(X), {
|
|
1293
1299
|
name: "icon_a-rili",
|
|
1294
1300
|
class: "rc-calendar__input-icon"
|
|
1295
1301
|
})
|
|
1296
1302
|
])
|
|
1297
1303
|
])) : D("", !0),
|
|
1298
|
-
e.mode === "default" ? (
|
|
1304
|
+
e.mode === "default" ? (s(), f("div", Gn, [
|
|
1299
1305
|
K(wt, {
|
|
1300
1306
|
"show-title": e.showTitle,
|
|
1301
1307
|
title: e.title,
|
|
1302
|
-
range:
|
|
1303
|
-
"selected-date":
|
|
1304
|
-
"range-start":
|
|
1305
|
-
"range-end":
|
|
1308
|
+
range: u.value,
|
|
1309
|
+
"selected-date": b.value,
|
|
1310
|
+
"range-start": g.value,
|
|
1311
|
+
"range-end": I.value,
|
|
1306
1312
|
"min-date": e.minDate,
|
|
1307
1313
|
"max-date": e.maxDate,
|
|
1308
|
-
"disabled-date":
|
|
1314
|
+
"disabled-date": F.value,
|
|
1309
1315
|
formatter: e.formatter,
|
|
1310
1316
|
"show-footer": !1,
|
|
1311
|
-
"max-range-days":
|
|
1317
|
+
"max-range-days": h.value,
|
|
1312
1318
|
onSelectDay: U,
|
|
1313
1319
|
onClear: j,
|
|
1314
1320
|
onConfirm: z,
|
|
1315
|
-
onShortcutSelect:
|
|
1321
|
+
onShortcutSelect: S
|
|
1316
1322
|
}, null, 8, ["show-title", "title", "range", "selected-date", "range-start", "range-end", "min-date", "max-date", "disabled-date", "formatter", "max-range-days"])
|
|
1317
1323
|
])) : D("", !0),
|
|
1318
|
-
e.mode === "popup" ? (
|
|
1324
|
+
e.mode === "popup" ? (s(), ne(J(He), {
|
|
1319
1325
|
key: 2,
|
|
1320
1326
|
modelValue: v.value,
|
|
1321
1327
|
"onUpdate:modelValue": [
|
|
1322
|
-
|
|
1328
|
+
x[1] || (x[1] = (L) => v.value = L),
|
|
1323
1329
|
Y
|
|
1324
1330
|
],
|
|
1325
1331
|
position: "bottom",
|
|
@@ -1329,28 +1335,28 @@ const _n = {
|
|
|
1329
1335
|
"lock-scroll": !0
|
|
1330
1336
|
}, {
|
|
1331
1337
|
default: ae(() => [
|
|
1332
|
-
|
|
1338
|
+
M("div", {
|
|
1333
1339
|
ref_key: "popupPanelRef",
|
|
1334
|
-
ref:
|
|
1340
|
+
ref: _,
|
|
1335
1341
|
class: "rc-calendar__panel"
|
|
1336
1342
|
}, [
|
|
1337
1343
|
K(wt, {
|
|
1338
1344
|
"show-title": e.showTitle,
|
|
1339
1345
|
title: e.title,
|
|
1340
|
-
range:
|
|
1341
|
-
"selected-date":
|
|
1342
|
-
"range-start":
|
|
1343
|
-
"range-end":
|
|
1346
|
+
range: u.value,
|
|
1347
|
+
"selected-date": b.value,
|
|
1348
|
+
"range-start": g.value,
|
|
1349
|
+
"range-end": I.value,
|
|
1344
1350
|
"min-date": e.minDate,
|
|
1345
1351
|
"max-date": e.maxDate,
|
|
1346
|
-
"disabled-date":
|
|
1352
|
+
"disabled-date": F.value,
|
|
1347
1353
|
formatter: e.formatter,
|
|
1348
1354
|
"show-footer": e.showFooter,
|
|
1349
|
-
"max-range-days":
|
|
1355
|
+
"max-range-days": h.value,
|
|
1350
1356
|
onSelectDay: U,
|
|
1351
1357
|
onClear: j,
|
|
1352
1358
|
onConfirm: z,
|
|
1353
|
-
onShortcutSelect:
|
|
1359
|
+
onShortcutSelect: S
|
|
1354
1360
|
}, null, 8, ["show-title", "title", "range", "selected-date", "range-start", "range-end", "min-date", "max-date", "disabled-date", "formatter", "show-footer", "max-range-days"])
|
|
1355
1361
|
], 512)
|
|
1356
1362
|
]),
|
|
@@ -1414,95 +1420,95 @@ const Qn = {
|
|
|
1414
1420
|
deviceType: { default: void 0 }
|
|
1415
1421
|
},
|
|
1416
1422
|
emits: ["update:modelValue", "input", "change", "focus", "blur", "clear", "keydown", "mouseenter", "mouseleave", "compositionstart", "compositionupdate", "compositionend"],
|
|
1417
|
-
setup(e, { expose:
|
|
1418
|
-
const t = e, y =
|
|
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);
|
|
1419
1425
|
Ie(
|
|
1420
1426
|
() => t.modelValue,
|
|
1421
|
-
(
|
|
1422
|
-
|
|
1427
|
+
(p) => {
|
|
1428
|
+
u.value = p ?? "";
|
|
1423
1429
|
}
|
|
1424
1430
|
);
|
|
1425
|
-
const
|
|
1426
|
-
const
|
|
1427
|
-
return t.formatter && !
|
|
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;
|
|
1428
1434
|
}), A = R(() => {
|
|
1429
|
-
const
|
|
1430
|
-
return
|
|
1431
|
-
}),
|
|
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(() => {
|
|
1432
1438
|
if (t.type !== "textarea") return {};
|
|
1433
|
-
const
|
|
1434
|
-
return t.autosize ?
|
|
1439
|
+
const p = {};
|
|
1440
|
+
return t.autosize ? p.resize = "none" : t.resize !== void 0 ? p.resize = t.resize : p.resize = "vertical", p;
|
|
1435
1441
|
});
|
|
1436
|
-
function O(
|
|
1437
|
-
let n =
|
|
1438
|
-
t.parser && !
|
|
1442
|
+
function O(p) {
|
|
1443
|
+
let n = p.target.value;
|
|
1444
|
+
t.parser && !b.value && (n = t.parser(n));
|
|
1439
1445
|
const l = n === "" ? void 0 : n;
|
|
1440
|
-
|
|
1446
|
+
u.value = l, v("update:modelValue", l), v("input", l), t.type === "textarea" && t.autosize && Fe(() => {
|
|
1441
1447
|
we();
|
|
1442
1448
|
});
|
|
1443
1449
|
}
|
|
1444
|
-
function H(
|
|
1445
|
-
|
|
1450
|
+
function H(p) {
|
|
1451
|
+
h.value = !0, v("focus", p);
|
|
1446
1452
|
}
|
|
1447
|
-
function U(
|
|
1448
|
-
|
|
1449
|
-
const Z =
|
|
1450
|
-
v("blur",
|
|
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);
|
|
1451
1457
|
}
|
|
1452
1458
|
function z() {
|
|
1453
|
-
|
|
1454
|
-
var
|
|
1455
|
-
(
|
|
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();
|
|
1456
1462
|
});
|
|
1457
1463
|
}
|
|
1458
1464
|
function j() {
|
|
1459
|
-
|
|
1465
|
+
F.value = !F.value;
|
|
1460
1466
|
}
|
|
1461
|
-
function
|
|
1462
|
-
if (v("keydown",
|
|
1463
|
-
const Z =
|
|
1467
|
+
function S(p) {
|
|
1468
|
+
if (v("keydown", p), p.key === "Enter" && t.type !== "textarea") {
|
|
1469
|
+
const Z = u.value;
|
|
1464
1470
|
v("change", Z === "" ? void 0 : Z);
|
|
1465
1471
|
}
|
|
1466
1472
|
}
|
|
1467
|
-
function T(
|
|
1468
|
-
v("mouseenter",
|
|
1473
|
+
function T(p) {
|
|
1474
|
+
v("mouseenter", p);
|
|
1469
1475
|
}
|
|
1470
|
-
function
|
|
1471
|
-
v("mouseleave",
|
|
1476
|
+
function V(p) {
|
|
1477
|
+
v("mouseleave", p);
|
|
1472
1478
|
}
|
|
1473
|
-
function Y(
|
|
1474
|
-
|
|
1479
|
+
function Y(p) {
|
|
1480
|
+
b.value = !0, v("compositionstart", p);
|
|
1475
1481
|
}
|
|
1476
|
-
function ge(
|
|
1477
|
-
v("compositionupdate",
|
|
1482
|
+
function ge(p) {
|
|
1483
|
+
v("compositionupdate", p);
|
|
1478
1484
|
}
|
|
1479
|
-
function
|
|
1480
|
-
|
|
1485
|
+
function be(p) {
|
|
1486
|
+
b.value = !1, v("compositionend", p), p.target && O(p);
|
|
1481
1487
|
}
|
|
1482
|
-
function
|
|
1483
|
-
var
|
|
1484
|
-
t.disabled || t.readonly || (
|
|
1488
|
+
function ke() {
|
|
1489
|
+
var p;
|
|
1490
|
+
t.disabled || t.readonly || (p = d.value) == null || p.focus();
|
|
1485
1491
|
}
|
|
1486
1492
|
function we() {
|
|
1487
1493
|
if (t.type !== "textarea" || !d.value) return;
|
|
1488
|
-
const
|
|
1494
|
+
const p = d.value;
|
|
1489
1495
|
if (t.autosize) {
|
|
1490
|
-
|
|
1491
|
-
const Z =
|
|
1496
|
+
p.style.height = "auto";
|
|
1497
|
+
const Z = p.scrollHeight;
|
|
1492
1498
|
if (typeof t.autosize == "object") {
|
|
1493
|
-
const { minRows: n = 2, maxRows: l } = t.autosize, c = parseInt(getComputedStyle(
|
|
1494
|
-
|
|
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`;
|
|
1495
1501
|
} else
|
|
1496
|
-
|
|
1502
|
+
p.style.height = `${Z}px`;
|
|
1497
1503
|
}
|
|
1498
1504
|
}
|
|
1499
|
-
function w() {
|
|
1500
|
-
var h;
|
|
1501
|
-
(h = d.value) == null || h.focus();
|
|
1502
|
-
}
|
|
1503
1505
|
function $() {
|
|
1504
|
-
var
|
|
1505
|
-
(
|
|
1506
|
+
var p;
|
|
1507
|
+
(p = d.value) == null || p.focus();
|
|
1508
|
+
}
|
|
1509
|
+
function x() {
|
|
1510
|
+
var p;
|
|
1511
|
+
(p = d.value) == null || p.blur();
|
|
1506
1512
|
}
|
|
1507
1513
|
function L() {
|
|
1508
1514
|
d.value && "select" in d.value && d.value.select();
|
|
@@ -1512,52 +1518,52 @@ const Qn = {
|
|
|
1512
1518
|
}
|
|
1513
1519
|
return at(() => {
|
|
1514
1520
|
t.type === "textarea" && t.autosize && we();
|
|
1515
|
-
}),
|
|
1516
|
-
focus:
|
|
1517
|
-
blur:
|
|
1521
|
+
}), r({
|
|
1522
|
+
focus: $,
|
|
1523
|
+
blur: x,
|
|
1518
1524
|
select: L,
|
|
1519
1525
|
clear: te,
|
|
1520
1526
|
resizeTextarea: we,
|
|
1521
1527
|
inputRef: d
|
|
1522
|
-
}), (
|
|
1528
|
+
}), (p, Z) => (s(), f("div", {
|
|
1523
1529
|
class: G(["rc-input", [
|
|
1524
1530
|
`rc-input--${e.size}`,
|
|
1525
1531
|
{
|
|
1526
1532
|
"is-disabled": e.disabled,
|
|
1527
|
-
"is-focused":
|
|
1533
|
+
"is-focused": h.value,
|
|
1528
1534
|
"is-readonly": e.readonly,
|
|
1529
1535
|
"rc-input--textarea": e.type === "textarea",
|
|
1530
|
-
"has-prepend":
|
|
1531
|
-
"has-append":
|
|
1536
|
+
"has-prepend": p.$slots.prepend,
|
|
1537
|
+
"has-append": p.$slots.append
|
|
1532
1538
|
}
|
|
1533
1539
|
]]),
|
|
1534
|
-
onClick:
|
|
1540
|
+
onClick: ke
|
|
1535
1541
|
}, [
|
|
1536
|
-
|
|
1537
|
-
q(
|
|
1542
|
+
p.$slots.prepend ? (s(), f("div", Qn, [
|
|
1543
|
+
q(p.$slots, "prepend", {}, void 0, !0)
|
|
1538
1544
|
])) : D("", !0),
|
|
1539
|
-
|
|
1545
|
+
M("div", {
|
|
1540
1546
|
class: G(["rc-input__wrapper", {
|
|
1541
1547
|
"has-clear": i.value && e.type !== "textarea",
|
|
1542
1548
|
"has-clear-textarea": i.value && e.type === "textarea",
|
|
1543
|
-
"has-clear-mobile": i.value &&
|
|
1544
|
-
"has-clear-textarea-mobile": i.value &&
|
|
1549
|
+
"has-clear-mobile": i.value && _.value === "mobile" && e.type !== "textarea",
|
|
1550
|
+
"has-clear-textarea-mobile": i.value && _.value === "mobile" && e.type === "textarea"
|
|
1545
1551
|
}])
|
|
1546
1552
|
}, [
|
|
1547
|
-
e.prefixIcon ||
|
|
1548
|
-
q(
|
|
1549
|
-
e.prefixIcon ? (
|
|
1553
|
+
e.prefixIcon || p.$slots.prefix ? (s(), f("div", Xn, [
|
|
1554
|
+
q(p.$slots, "prefix", {}, () => [
|
|
1555
|
+
e.prefixIcon ? (s(), ne(J(X), {
|
|
1550
1556
|
key: 0,
|
|
1551
1557
|
name: e.prefixIcon,
|
|
1552
1558
|
class: "rc-input__prefix-icon"
|
|
1553
1559
|
}, null, 8, ["name"])) : D("", !0)
|
|
1554
1560
|
], !0)
|
|
1555
1561
|
])) : D("", !0),
|
|
1556
|
-
e.type === "textarea" ? (
|
|
1557
|
-
(
|
|
1562
|
+
e.type === "textarea" ? (s(), f("div", Zn, [
|
|
1563
|
+
(s(), ne(vt("textarea"), {
|
|
1558
1564
|
ref_key: "inputRef",
|
|
1559
1565
|
ref: d,
|
|
1560
|
-
value:
|
|
1566
|
+
value: I.value,
|
|
1561
1567
|
class: "rc-input__field rc-input__field--textarea",
|
|
1562
1568
|
placeholder: e.placeholder,
|
|
1563
1569
|
disabled: e.disabled,
|
|
@@ -1574,17 +1580,17 @@ const Qn = {
|
|
|
1574
1580
|
onInput: O,
|
|
1575
1581
|
onFocus: H,
|
|
1576
1582
|
onBlur: U,
|
|
1577
|
-
onKeydown:
|
|
1583
|
+
onKeydown: S,
|
|
1578
1584
|
onMouseenter: T,
|
|
1579
|
-
onMouseleave:
|
|
1585
|
+
onMouseleave: V,
|
|
1580
1586
|
onCompositionstart: Y,
|
|
1581
1587
|
onCompositionupdate: ge,
|
|
1582
|
-
onCompositionend:
|
|
1588
|
+
onCompositionend: be
|
|
1583
1589
|
}, null, 40, ["value", "placeholder", "disabled", "readonly", "maxlength", "minlength", "rows", "autocomplete", "name", "autofocus", "form", "tabindex", "style"])),
|
|
1584
|
-
i.value && e.type === "textarea" ? (
|
|
1590
|
+
i.value && e.type === "textarea" ? (s(), f("button", {
|
|
1585
1591
|
key: 0,
|
|
1586
1592
|
type: "button",
|
|
1587
|
-
class: G(["rc-input__clear rc-input__clear--textarea", { "rc-input__clear--mobile":
|
|
1593
|
+
class: G(["rc-input__clear rc-input__clear--textarea", { "rc-input__clear--mobile": _.value === "mobile" }]),
|
|
1588
1594
|
onClick: Ye(z, ["stop"])
|
|
1589
1595
|
}, [
|
|
1590
1596
|
K(J(X), {
|
|
@@ -1592,12 +1598,12 @@ const Qn = {
|
|
|
1592
1598
|
class: "rc-input__clear-icon"
|
|
1593
1599
|
})
|
|
1594
1600
|
], 2)) : D("", !0)
|
|
1595
|
-
])) : (
|
|
1601
|
+
])) : (s(), ne(vt("input"), {
|
|
1596
1602
|
key: 2,
|
|
1597
1603
|
ref_key: "inputRef",
|
|
1598
1604
|
ref: d,
|
|
1599
|
-
value:
|
|
1600
|
-
type:
|
|
1605
|
+
value: I.value,
|
|
1606
|
+
type: g.value,
|
|
1601
1607
|
class: "rc-input__field",
|
|
1602
1608
|
placeholder: e.placeholder,
|
|
1603
1609
|
disabled: e.disabled,
|
|
@@ -1612,32 +1618,32 @@ const Qn = {
|
|
|
1612
1618
|
onInput: O,
|
|
1613
1619
|
onFocus: H,
|
|
1614
1620
|
onBlur: U,
|
|
1615
|
-
onKeydown:
|
|
1621
|
+
onKeydown: S,
|
|
1616
1622
|
onMouseenter: T,
|
|
1617
|
-
onMouseleave:
|
|
1623
|
+
onMouseleave: V,
|
|
1618
1624
|
onCompositionstart: Y,
|
|
1619
1625
|
onCompositionupdate: ge,
|
|
1620
|
-
onCompositionend:
|
|
1626
|
+
onCompositionend: be
|
|
1621
1627
|
}, null, 40, ["value", "type", "placeholder", "disabled", "readonly", "maxlength", "minlength", "autocomplete", "name", "autofocus", "form", "tabindex"])),
|
|
1622
|
-
he.value ? (
|
|
1623
|
-
|
|
1624
|
-
q(
|
|
1628
|
+
he.value ? (s(), f("div", ea, [
|
|
1629
|
+
p.$slots.suffix ? (s(), f("div", ta, [
|
|
1630
|
+
q(p.$slots, "suffix", {}, void 0, !0)
|
|
1625
1631
|
])) : D("", !0),
|
|
1626
|
-
e.showPassword && e.type === "password" && A.value ? (
|
|
1632
|
+
e.showPassword && e.type === "password" && A.value ? (s(), f("button", {
|
|
1627
1633
|
key: 1,
|
|
1628
1634
|
type: "button",
|
|
1629
1635
|
class: "rc-input__password-toggle",
|
|
1630
1636
|
onClick: Ye(j, ["stop"])
|
|
1631
1637
|
}, [
|
|
1632
1638
|
K(J(X), {
|
|
1633
|
-
color:
|
|
1634
|
-
name:
|
|
1639
|
+
color: F.value ? "#1677ff" : "#999",
|
|
1640
|
+
name: F.value ? "icon_view" : "icon_view-off"
|
|
1635
1641
|
}, null, 8, ["color", "name"])
|
|
1636
1642
|
])) : D("", !0),
|
|
1637
|
-
i.value && e.type !== "textarea" ? (
|
|
1643
|
+
i.value && e.type !== "textarea" ? (s(), f("button", {
|
|
1638
1644
|
key: 2,
|
|
1639
1645
|
type: "button",
|
|
1640
|
-
class: G(["rc-input__clear", { "rc-input__clear--mobile":
|
|
1646
|
+
class: G(["rc-input__clear", { "rc-input__clear--mobile": _.value === "mobile" }]),
|
|
1641
1647
|
onClick: Ye(z, ["stop"])
|
|
1642
1648
|
}, [
|
|
1643
1649
|
K(J(X), {
|
|
@@ -1645,20 +1651,20 @@ const Qn = {
|
|
|
1645
1651
|
class: "rc-input__clear-icon"
|
|
1646
1652
|
})
|
|
1647
1653
|
], 2)) : D("", !0),
|
|
1648
|
-
e.suffixIcon && !e.clearable && !e.showPassword ? (
|
|
1654
|
+
e.suffixIcon && !e.clearable && !e.showPassword ? (s(), ne(J(X), {
|
|
1649
1655
|
key: 3,
|
|
1650
1656
|
name: e.suffixIcon,
|
|
1651
1657
|
class: "rc-input__suffix-icon"
|
|
1652
1658
|
}, null, 8, ["name"])) : D("", !0)
|
|
1653
1659
|
])) : D("", !0),
|
|
1654
|
-
e.showWordLimit && e.maxlength ? (
|
|
1660
|
+
e.showWordLimit && e.maxlength ? (s(), f("span", na, N(C.value) + " / " + N(e.maxlength), 1)) : D("", !0)
|
|
1655
1661
|
], 2),
|
|
1656
|
-
|
|
1657
|
-
q(
|
|
1662
|
+
p.$slots.append ? (s(), f("div", aa, [
|
|
1663
|
+
q(p.$slots, "append", {}, void 0, !0)
|
|
1658
1664
|
])) : D("", !0)
|
|
1659
1665
|
], 2));
|
|
1660
1666
|
}
|
|
1661
|
-
}), tt = /* @__PURE__ */ ue(la, [["__scopeId", "data-v-
|
|
1667
|
+
}), tt = /* @__PURE__ */ ue(la, [["__scopeId", "data-v-5e757433"]]);
|
|
1662
1668
|
tt.name = "rc-input";
|
|
1663
1669
|
function xt(e) {
|
|
1664
1670
|
return e.component(tt.name, tt), e;
|
|
@@ -1675,7 +1681,7 @@ const oa = { class: "rc-search-area" }, ra = { class: "rc-search-area__bar" }, s
|
|
|
1675
1681
|
}, va = { class: "rc-search-area__tree-group-title" }, ma = { class: "rc-search-area__tree-group-options" }, pa = ["onClick"], ha = { class: "rc-search-area__option-label" }, ya = {
|
|
1676
1682
|
key: 4,
|
|
1677
1683
|
class: "rc-search-area__tree-container"
|
|
1678
|
-
}, ga = { class: "rc-search-area__tree-group-title" },
|
|
1684
|
+
}, ga = { class: "rc-search-area__tree-group-title" }, ba = { class: "rc-search-area__tree-group-options" }, ka = ["onClick"], _a = { class: "rc-search-area__option-label" }, wa = {
|
|
1679
1685
|
key: 5,
|
|
1680
1686
|
class: "rc-search-area__options-grid"
|
|
1681
1687
|
}, $a = ["onClick"], xa = { class: "rc-search-area__option-label" }, Da = {
|
|
@@ -1697,42 +1703,42 @@ const oa = { class: "rc-search-area" }, ra = { class: "rc-search-area__bar" }, s
|
|
|
1697
1703
|
autoConfirm: { type: Boolean, default: !1 }
|
|
1698
1704
|
},
|
|
1699
1705
|
emits: ["update:modelValue", "change"],
|
|
1700
|
-
setup(e, { expose:
|
|
1701
|
-
const t = e, y = m,
|
|
1702
|
-
if (
|
|
1706
|
+
setup(e, { expose: r, emit: m }) {
|
|
1707
|
+
const t = e, y = m, _ = E(null), v = E(null), d = E(null), u = E({ top: "0px" }), h = async () => {
|
|
1708
|
+
if (_.value === null || !v.value)
|
|
1703
1709
|
return;
|
|
1704
1710
|
await Fe();
|
|
1705
1711
|
const l = v.value.getBoundingClientRect().top;
|
|
1706
|
-
|
|
1707
|
-
},
|
|
1708
|
-
if (
|
|
1712
|
+
u.value = { top: `${l}px` };
|
|
1713
|
+
}, F = (n) => {
|
|
1714
|
+
if (_.value === null || !v.value)
|
|
1709
1715
|
return;
|
|
1710
1716
|
const l = n.target;
|
|
1711
1717
|
if (v.value.contains(l))
|
|
1712
1718
|
return;
|
|
1713
1719
|
const c = v.value.closest(".rc-search-area");
|
|
1714
1720
|
if (c) {
|
|
1715
|
-
const
|
|
1716
|
-
if (
|
|
1721
|
+
const w = c.querySelector(".rc-search-area__bar");
|
|
1722
|
+
if (w && w.contains(l))
|
|
1717
1723
|
return;
|
|
1718
1724
|
}
|
|
1719
1725
|
O();
|
|
1720
1726
|
};
|
|
1721
|
-
Ie(
|
|
1722
|
-
n !== null ? (await Fe(),
|
|
1727
|
+
Ie(_, async (n) => {
|
|
1728
|
+
n !== null ? (await Fe(), h(), window.addEventListener("resize", h), window.addEventListener("scroll", h, !0), document.addEventListener("click", F, !0)) : (window.removeEventListener("resize", h), window.removeEventListener("scroll", h, !0), document.removeEventListener("click", F, !0));
|
|
1723
1729
|
}), lt(() => {
|
|
1724
|
-
window.removeEventListener("resize",
|
|
1730
|
+
window.removeEventListener("resize", h), window.removeEventListener("scroll", h, !0), document.removeEventListener("click", F, !0);
|
|
1725
1731
|
});
|
|
1726
|
-
const
|
|
1732
|
+
const b = E({}), g = E(""), I = E(null), A = E({}), C = E({ ...t.modelValue });
|
|
1727
1733
|
Ie(() => t.modelValue, (n) => {
|
|
1728
|
-
|
|
1734
|
+
C.value = { ...n || {} };
|
|
1729
1735
|
}, { deep: !0, immediate: !0 });
|
|
1730
|
-
const i = R(() =>
|
|
1736
|
+
const i = R(() => _.value === null ? null : t.items[_.value]), pe = R(() => {
|
|
1731
1737
|
if (!i.value) return "";
|
|
1732
1738
|
const n = Z(i.value);
|
|
1733
1739
|
return n > 0 ? `(${n}项)` : "";
|
|
1734
1740
|
}), he = (n) => {
|
|
1735
|
-
const l =
|
|
1741
|
+
const l = C.value[n.key];
|
|
1736
1742
|
if (l == null || l === "" || n.slot)
|
|
1737
1743
|
return n.label;
|
|
1738
1744
|
if (n.type === "input") {
|
|
@@ -1752,26 +1758,26 @@ const oa = { class: "rc-search-area" }, ra = { class: "rc-search-area__bar" }, s
|
|
|
1752
1758
|
} else {
|
|
1753
1759
|
const c = Array.isArray(l) ? l : [l];
|
|
1754
1760
|
if (c.length > 0) {
|
|
1755
|
-
const
|
|
1756
|
-
const
|
|
1757
|
-
return
|
|
1761
|
+
const w = c.map((W) => {
|
|
1762
|
+
const P = j(n, W);
|
|
1763
|
+
return P ? z(P, n) : null;
|
|
1758
1764
|
}).filter((W) => W !== null);
|
|
1759
|
-
if (
|
|
1760
|
-
return `${n.label}: ${
|
|
1765
|
+
if (w.length > 0)
|
|
1766
|
+
return `${n.label}: ${w.join("、")}`;
|
|
1761
1767
|
}
|
|
1762
1768
|
}
|
|
1763
1769
|
return n.label;
|
|
1764
1770
|
}, ye = (n) => {
|
|
1765
1771
|
const l = t.items[n];
|
|
1766
1772
|
if (!l) return;
|
|
1767
|
-
if (
|
|
1768
|
-
|
|
1773
|
+
if (_.value === n) {
|
|
1774
|
+
_.value = null;
|
|
1769
1775
|
return;
|
|
1770
1776
|
}
|
|
1771
|
-
const c =
|
|
1772
|
-
l.slot ? c != null ? Array.isArray(c) ? A.value[l.key] = [...c] : typeof c == "object" ? A.value[l.key] = { ...c } : A.value[l.key] = c : A.value[l.key] = void 0 : l.type === "input" ?
|
|
1777
|
+
const c = C.value[l.key];
|
|
1778
|
+
l.slot ? c != null ? Array.isArray(c) ? A.value[l.key] = [...c] : typeof c == "object" ? A.value[l.key] = { ...c } : A.value[l.key] = c : A.value[l.key] = void 0 : l.type === "input" ? g.value = c != null && c !== "" ? String(c) : void 0 : l.type === "calendar" ? I.value = c ?? null : l.type === "single" || l.type === "tree-single" ? b.value[l.key] = c !== void 0 ? c : null : b.value[l.key] = c !== void 0 ? Array.isArray(c) ? [...c] : [c] : [], _.value = n;
|
|
1773
1779
|
}, O = () => {
|
|
1774
|
-
|
|
1780
|
+
_.value = null;
|
|
1775
1781
|
}, H = (n, l) => {
|
|
1776
1782
|
if (!l)
|
|
1777
1783
|
return typeof n == "string" ? n : n.label || String(n.value);
|
|
@@ -1780,8 +1786,8 @@ const oa = { class: "rc-search-area" }, ra = { class: "rc-search-area__bar" }, s
|
|
|
1780
1786
|
if (typeof l.renderItem == "string")
|
|
1781
1787
|
return String(typeof c == "object" && c !== null ? c[l.renderItem] ?? "" : c);
|
|
1782
1788
|
{
|
|
1783
|
-
const
|
|
1784
|
-
return
|
|
1789
|
+
const w = l.renderItem(c);
|
|
1790
|
+
return w != null ? String(w) : "";
|
|
1785
1791
|
}
|
|
1786
1792
|
}
|
|
1787
1793
|
return typeof n == "string" ? n : n.label || String(n.value);
|
|
@@ -1791,26 +1797,26 @@ const oa = { class: "rc-search-area" }, ra = { class: "rc-search-area__bar" }, s
|
|
|
1791
1797
|
const c = n;
|
|
1792
1798
|
return l.format ? typeof l.format == "string" ? typeof c == "object" && c !== null ? c[l.format] : c : l.format(c) : typeof n == "string" ? n : n.value !== void 0 ? n.value : n;
|
|
1793
1799
|
}, z = (n, l) => {
|
|
1794
|
-
const c = n,
|
|
1795
|
-
if (
|
|
1796
|
-
if (typeof
|
|
1797
|
-
return String(typeof c == "object" && c !== null ? c[
|
|
1800
|
+
const c = n, w = l.renderResult || l.renderItem;
|
|
1801
|
+
if (w) {
|
|
1802
|
+
if (typeof w == "string")
|
|
1803
|
+
return String(typeof c == "object" && c !== null ? c[w] ?? "" : c);
|
|
1798
1804
|
{
|
|
1799
|
-
const W =
|
|
1805
|
+
const W = w(c);
|
|
1800
1806
|
return W != null ? String(W) : "";
|
|
1801
1807
|
}
|
|
1802
1808
|
}
|
|
1803
1809
|
return H(n, l);
|
|
1804
1810
|
}, j = (n, l, c) => {
|
|
1805
|
-
const
|
|
1806
|
-
if (!
|
|
1811
|
+
const w = c || n.options;
|
|
1812
|
+
if (!w) return null;
|
|
1807
1813
|
const W = n.childrenKey || "children";
|
|
1808
|
-
for (const
|
|
1809
|
-
const ee = U(
|
|
1814
|
+
for (const P of w) {
|
|
1815
|
+
const ee = U(P, n);
|
|
1810
1816
|
if (ee === l || String(ee) === String(l))
|
|
1811
|
-
return
|
|
1812
|
-
if (typeof
|
|
1813
|
-
const re =
|
|
1817
|
+
return P;
|
|
1818
|
+
if (typeof P == "object" && P !== null) {
|
|
1819
|
+
const re = P[W];
|
|
1814
1820
|
if (Array.isArray(re) && re.length > 0) {
|
|
1815
1821
|
const me = j(n, l, re);
|
|
1816
1822
|
if (me) return me;
|
|
@@ -1818,27 +1824,27 @@ const oa = { class: "rc-search-area" }, ra = { class: "rc-search-area__bar" }, s
|
|
|
1818
1824
|
}
|
|
1819
1825
|
}
|
|
1820
1826
|
return null;
|
|
1821
|
-
},
|
|
1827
|
+
}, S = (n, l) => {
|
|
1822
1828
|
const c = l || n.options;
|
|
1823
1829
|
if (!c) return [];
|
|
1824
|
-
const
|
|
1825
|
-
for (const
|
|
1826
|
-
if (W.push(
|
|
1827
|
-
const ee =
|
|
1828
|
-
Array.isArray(ee) && ee.length > 0 && W.push(...
|
|
1830
|
+
const w = n.childrenKey || "children", W = [];
|
|
1831
|
+
for (const P of c)
|
|
1832
|
+
if (W.push(P), typeof P == "object" && P !== null) {
|
|
1833
|
+
const ee = P[w];
|
|
1834
|
+
Array.isArray(ee) && ee.length > 0 && W.push(...S(n, ee));
|
|
1829
1835
|
}
|
|
1830
1836
|
return W;
|
|
1831
1837
|
}, T = (n) => {
|
|
1832
1838
|
if (!i.value) return !1;
|
|
1833
|
-
const l = i.value.key, c =
|
|
1834
|
-
return i.value.type === "single" || i.value.type === "tree-single" ? c != null && c ===
|
|
1835
|
-
},
|
|
1839
|
+
const l = i.value.key, c = b.value[l], w = U(n, i.value);
|
|
1840
|
+
return i.value.type === "single" || i.value.type === "tree-single" ? c != null && c === w : (Array.isArray(c) ? c : []).some((P) => P === w || String(P) === String(w));
|
|
1841
|
+
}, V = (n) => n ? n.childrenKey ? S(n) : n.options || [] : [], Y = (n) => {
|
|
1836
1842
|
if (!n || !n.options || n.options.length === 0) return [];
|
|
1837
|
-
const l = n.childrenKey || "children", c = [],
|
|
1838
|
-
for (const re of
|
|
1843
|
+
const l = n.childrenKey || "children", c = [], w = /* @__PURE__ */ new Map(), W = (P, ee = []) => {
|
|
1844
|
+
for (const re of P)
|
|
1839
1845
|
if (typeof re == "string") {
|
|
1840
1846
|
const me = ee.length > 0 ? ee.join("-") : "";
|
|
1841
|
-
|
|
1847
|
+
w.has(me) || w.set(me, []), w.get(me).push(re);
|
|
1842
1848
|
} else {
|
|
1843
1849
|
const me = H(re, n), $e = re[l];
|
|
1844
1850
|
if (Array.isArray($e) && $e.length > 0) {
|
|
@@ -1846,75 +1852,75 @@ const oa = { class: "rc-search-area" }, ra = { class: "rc-search-area__bar" }, s
|
|
|
1846
1852
|
W($e, xe);
|
|
1847
1853
|
} else {
|
|
1848
1854
|
const xe = ee.length > 0 ? ee.join("-") : "";
|
|
1849
|
-
|
|
1855
|
+
w.has(xe) || w.set(xe, []), w.get(xe).push(re);
|
|
1850
1856
|
}
|
|
1851
1857
|
}
|
|
1852
1858
|
};
|
|
1853
1859
|
W(n.options);
|
|
1854
|
-
for (const [
|
|
1860
|
+
for (const [P, ee] of w.entries())
|
|
1855
1861
|
c.push({
|
|
1856
|
-
title:
|
|
1862
|
+
title: P || "全部",
|
|
1857
1863
|
children: ee
|
|
1858
1864
|
});
|
|
1859
1865
|
return c;
|
|
1860
1866
|
}, ge = (n) => {
|
|
1861
1867
|
if (n)
|
|
1862
|
-
return A.value[n.key] !== void 0 ? A.value[n.key] :
|
|
1863
|
-
},
|
|
1868
|
+
return A.value[n.key] !== void 0 ? A.value[n.key] : C.value[n.key];
|
|
1869
|
+
}, be = (n, l) => {
|
|
1864
1870
|
if (n && (A.value[n.key] = l, t.autoConfirm)) {
|
|
1865
1871
|
const c = n.key;
|
|
1866
|
-
|
|
1872
|
+
C.value[c] = l, y("update:modelValue", { ...C.value }), y("change", { ...C.value }, n), O();
|
|
1867
1873
|
}
|
|
1868
|
-
},
|
|
1874
|
+
}, ke = (n) => {
|
|
1869
1875
|
if (!i.value) return;
|
|
1870
1876
|
const l = i.value.key, c = U(n, i.value);
|
|
1871
|
-
|
|
1872
|
-
let
|
|
1873
|
-
|
|
1877
|
+
C.value[l];
|
|
1878
|
+
let w;
|
|
1879
|
+
b.value[l] === c ? w = void 0 : w = c, C.value[l] = w, y("update:modelValue", { ...C.value }), y("change", { ...C.value }, i.value), O();
|
|
1874
1880
|
}, we = (n) => {
|
|
1875
1881
|
if (!i.value) return;
|
|
1876
|
-
const l = i.value.key, c = U(n, i.value),
|
|
1877
|
-
(
|
|
1882
|
+
const l = i.value.key, c = U(n, i.value), w = Array.isArray(b.value[l]) ? [...b.value[l]] : [], W = w.findIndex(
|
|
1883
|
+
(P) => P === c || String(P) === String(c)
|
|
1878
1884
|
);
|
|
1879
|
-
if (W >= 0 ?
|
|
1880
|
-
const
|
|
1881
|
-
|
|
1885
|
+
if (W >= 0 ? w.splice(W, 1) : w.push(c), b.value[l] = w, t.autoConfirm) {
|
|
1886
|
+
const P = w.length > 0 ? w : void 0;
|
|
1887
|
+
C.value[l] = P, y("update:modelValue", { ...C.value }), y("change", { ...C.value }, i.value), O();
|
|
1882
1888
|
}
|
|
1883
|
-
},
|
|
1889
|
+
}, $ = () => {
|
|
1884
1890
|
if (!i.value) return;
|
|
1885
1891
|
const n = i.value.key;
|
|
1886
|
-
i.value.slot ? A.value[n] = void 0 : i.value.type === "input" ?
|
|
1887
|
-
},
|
|
1892
|
+
i.value.slot ? A.value[n] = void 0 : i.value.type === "input" ? g.value = void 0 : i.value.type === "calendar" ? I.value = null : i.value.type === "single" || i.value.type === "tree-single" ? b.value[n] = null : b.value[n] = [];
|
|
1893
|
+
}, x = (n) => {
|
|
1888
1894
|
if (t.autoConfirm && i.value) {
|
|
1889
|
-
const l = i.value.key, c = n != null ? String(n) : "",
|
|
1890
|
-
|
|
1895
|
+
const l = i.value.key, c = n != null ? String(n) : "", w = c.trim() ? c.trim() : void 0;
|
|
1896
|
+
C.value[l] = w, y("update:modelValue", { ...C.value }), y("change", { ...C.value }, i.value), O();
|
|
1891
1897
|
}
|
|
1892
1898
|
}, L = (n) => {
|
|
1893
|
-
if (
|
|
1899
|
+
if (I.value = n, t.autoConfirm && i.value) {
|
|
1894
1900
|
const l = i.value.key, c = n ?? void 0;
|
|
1895
|
-
|
|
1901
|
+
C.value[l] = c, y("update:modelValue", { ...C.value }), y("change", { ...C.value }, i.value), O();
|
|
1896
1902
|
}
|
|
1897
1903
|
}, te = () => {
|
|
1898
1904
|
if (!i.value) return;
|
|
1899
1905
|
const n = i.value.key;
|
|
1900
|
-
|
|
1906
|
+
C.value[n];
|
|
1901
1907
|
let l;
|
|
1902
1908
|
if (i.value.slot)
|
|
1903
|
-
l = A.value[n],
|
|
1909
|
+
l = A.value[n], C.value[n] = l;
|
|
1904
1910
|
else if (i.value.type === "input")
|
|
1905
|
-
l =
|
|
1911
|
+
l = g.value && g.value.trim() ? g.value.trim() : void 0, C.value[n] = l;
|
|
1906
1912
|
else if (i.value.type === "calendar")
|
|
1907
|
-
l =
|
|
1913
|
+
l = I.value !== null && I.value !== void 0 ? I.value : void 0, C.value[n] = l;
|
|
1908
1914
|
else if (i.value.type === "single" || i.value.type === "tree-single") {
|
|
1909
|
-
const c =
|
|
1910
|
-
l = c ?? void 0,
|
|
1915
|
+
const c = b.value[n];
|
|
1916
|
+
l = c ?? void 0, C.value[n] = l;
|
|
1911
1917
|
} else {
|
|
1912
|
-
const c =
|
|
1913
|
-
l = Array.isArray(c) && c.length > 0 ? c : void 0,
|
|
1918
|
+
const c = b.value[n];
|
|
1919
|
+
l = Array.isArray(c) && c.length > 0 ? c : void 0, C.value[n] = l;
|
|
1914
1920
|
}
|
|
1915
|
-
y("update:modelValue", { ...
|
|
1916
|
-
},
|
|
1917
|
-
const l =
|
|
1921
|
+
y("update:modelValue", { ...C.value }), y("change", { ...C.value }, i.value), O();
|
|
1922
|
+
}, p = (n) => {
|
|
1923
|
+
const l = C.value[n.key];
|
|
1918
1924
|
return l == null || l === "" ? 0 : n.slot ? 1 : n.type === "input" ? String(l).trim() ? 1 : 0 : n.type === "single" || n.type === "tree-single" ? 1 : Array.isArray(l) ? l.length : l ? 1 : 0;
|
|
1919
1925
|
}, Z = (n) => {
|
|
1920
1926
|
if (n.slot) {
|
|
@@ -1922,46 +1928,46 @@ const oa = { class: "rc-search-area" }, ra = { class: "rc-search-area__bar" }, s
|
|
|
1922
1928
|
return c != null && c !== "" ? 1 : 0;
|
|
1923
1929
|
} else {
|
|
1924
1930
|
if (n.type === "input")
|
|
1925
|
-
return
|
|
1931
|
+
return g.value && g.value.trim() ? 1 : 0;
|
|
1926
1932
|
if (n.type === "calendar")
|
|
1927
|
-
return
|
|
1933
|
+
return I.value !== null && I.value !== void 0 ? 1 : 0;
|
|
1928
1934
|
}
|
|
1929
|
-
const l =
|
|
1935
|
+
const l = b.value[n.key];
|
|
1930
1936
|
return l == null || l === "" ? 0 : n.type === "single" || n.type === "tree-single" ? 1 : Array.isArray(l) ? l.length : 0;
|
|
1931
1937
|
};
|
|
1932
|
-
return
|
|
1938
|
+
return r({
|
|
1933
1939
|
/** 获取当前筛选值 */
|
|
1934
|
-
getValues: () => ({ ...
|
|
1940
|
+
getValues: () => ({ ...C.value }),
|
|
1935
1941
|
/** 重置所有筛选 */
|
|
1936
1942
|
reset: () => {
|
|
1937
|
-
|
|
1943
|
+
C.value = {}, b.value = {}, A.value = {}, y("update:modelValue", {});
|
|
1938
1944
|
}
|
|
1939
|
-
}), (n, l) => (
|
|
1940
|
-
|
|
1941
|
-
(
|
|
1942
|
-
key:
|
|
1945
|
+
}), (n, l) => (s(), f("div", oa, [
|
|
1946
|
+
M("div", ra, [
|
|
1947
|
+
(s(!0), f(oe, null, ve(t.items, (c, w) => (s(), f("div", {
|
|
1948
|
+
key: w,
|
|
1943
1949
|
class: G(["rc-search-area__item", {
|
|
1944
|
-
"is-active":
|
|
1945
|
-
"has-value":
|
|
1950
|
+
"is-active": _.value === w,
|
|
1951
|
+
"has-value": p(c) > 0
|
|
1946
1952
|
}]),
|
|
1947
|
-
onClick: (W) => ye(
|
|
1953
|
+
onClick: (W) => ye(w)
|
|
1948
1954
|
}, [
|
|
1949
|
-
|
|
1955
|
+
M("span", ua, N(he(c)), 1),
|
|
1950
1956
|
K(J(X), {
|
|
1951
1957
|
name: "icon_a-xiala2",
|
|
1952
|
-
color:
|
|
1953
|
-
class: G(["rc-search-area__item-arrow", { "is-up":
|
|
1958
|
+
color: _.value !== w && p(c) > 0 ? "#1677ff" : "#969799",
|
|
1959
|
+
class: G(["rc-search-area__item-arrow", { "is-up": _.value === w }])
|
|
1954
1960
|
}, null, 8, ["color", "class"])
|
|
1955
1961
|
], 10, sa))), 128))
|
|
1956
1962
|
]),
|
|
1957
1963
|
K(Be, { name: "rc-search-area-fade" }, {
|
|
1958
1964
|
default: ae(() => [
|
|
1959
|
-
|
|
1965
|
+
_.value !== null && t.showMask ? (s(), f("div", {
|
|
1960
1966
|
key: 0,
|
|
1961
1967
|
ref_key: "maskRef",
|
|
1962
1968
|
ref: d,
|
|
1963
1969
|
class: "rc-search-area__mask",
|
|
1964
|
-
style: le(
|
|
1970
|
+
style: le(u.value),
|
|
1965
1971
|
onClick: O
|
|
1966
1972
|
}, null, 4)) : D("", !0)
|
|
1967
1973
|
]),
|
|
@@ -1969,31 +1975,31 @@ const oa = { class: "rc-search-area" }, ra = { class: "rc-search-area__bar" }, s
|
|
|
1969
1975
|
}),
|
|
1970
1976
|
K(Be, { name: "rc-search-area-slide" }, {
|
|
1971
1977
|
default: ae(() => {
|
|
1972
|
-
var c,
|
|
1978
|
+
var c, w, W, P, ee, re, me, $e, Ae, xe, Ue, Ne, je, Ke, Ge, qe, Je, Qe, a;
|
|
1973
1979
|
return [
|
|
1974
|
-
|
|
1980
|
+
_.value !== null ? (s(), f("div", {
|
|
1975
1981
|
key: 0,
|
|
1976
1982
|
ref_key: "panelRef",
|
|
1977
1983
|
ref: v,
|
|
1978
1984
|
class: "rc-search-area__panel"
|
|
1979
1985
|
}, [
|
|
1980
|
-
|
|
1986
|
+
M("div", ia, [
|
|
1981
1987
|
(c = i.value) != null && c.slot && n.$slots[i.value.key] ? q(n.$slots, i.value.key, {
|
|
1982
1988
|
key: 0,
|
|
1983
1989
|
value: ge(i.value),
|
|
1984
|
-
"update:value": (o) =>
|
|
1985
|
-
}, void 0, !0) : ((
|
|
1990
|
+
"update:value": (o) => be(i.value, o)
|
|
1991
|
+
}, void 0, !0) : ((w = i.value) == null ? void 0 : w.type) === "input" ? (s(), f("div", ca, [
|
|
1986
1992
|
K(J(tt), {
|
|
1987
|
-
modelValue:
|
|
1988
|
-
"onUpdate:modelValue": l[0] || (l[0] = (o) =>
|
|
1993
|
+
modelValue: g.value,
|
|
1994
|
+
"onUpdate:modelValue": l[0] || (l[0] = (o) => g.value = o),
|
|
1989
1995
|
placeholder: i.value.placeholder || "请输入",
|
|
1990
|
-
onChange:
|
|
1996
|
+
onChange: x
|
|
1991
1997
|
}, null, 8, ["modelValue", "placeholder"])
|
|
1992
|
-
])) : ((W = i.value) == null ? void 0 : W.type) === "calendar" ? (
|
|
1998
|
+
])) : ((W = i.value) == null ? void 0 : W.type) === "calendar" ? (s(), f("div", da, [
|
|
1993
1999
|
K(J(Oe), {
|
|
1994
|
-
modelValue:
|
|
1995
|
-
"onUpdate:modelValue": l[1] || (l[1] = (o) =>
|
|
1996
|
-
range: ((
|
|
2000
|
+
modelValue: I.value,
|
|
2001
|
+
"onUpdate:modelValue": l[1] || (l[1] = (o) => I.value = o),
|
|
2002
|
+
range: ((P = i.value.calendarConfig) == null ? void 0 : P.range) || !1,
|
|
1997
2003
|
mode: "default",
|
|
1998
2004
|
"min-date": (ee = i.value.calendarConfig) == null ? void 0 : ee.minDate,
|
|
1999
2005
|
"max-date": (re = i.value.calendarConfig) == null ? void 0 : re.maxDate,
|
|
@@ -2002,20 +2008,20 @@ const oa = { class: "rc-search-area" }, ra = { class: "rc-search-area__bar" }, s
|
|
|
2002
2008
|
"end-date-offset": ((Ae = i.value.calendarConfig) == null ? void 0 : Ae.endDateOffset) || !1,
|
|
2003
2009
|
onChange: L
|
|
2004
2010
|
}, null, 8, ["modelValue", "range", "min-date", "max-date", "disabled-date", "formatter", "end-date-offset"])
|
|
2005
|
-
])) : ((xe = i.value) == null ? void 0 : xe.type) === "tree-single" ? (
|
|
2006
|
-
(
|
|
2007
|
-
key:
|
|
2011
|
+
])) : ((xe = i.value) == null ? void 0 : xe.type) === "tree-single" ? (s(), f("div", fa, [
|
|
2012
|
+
(s(!0), f(oe, null, ve(Y(i.value), (o, k) => (s(), f("div", {
|
|
2013
|
+
key: k,
|
|
2008
2014
|
class: "rc-search-area__tree-group"
|
|
2009
2015
|
}, [
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
(
|
|
2016
|
+
M("div", va, N(o.title), 1),
|
|
2017
|
+
M("div", ma, [
|
|
2018
|
+
(s(!0), f(oe, null, ve(o.children, (B, Q) => (s(), f("div", {
|
|
2013
2019
|
key: Q,
|
|
2014
|
-
class: G(["rc-search-area__option", { "is-selected": T(
|
|
2015
|
-
onClick: (
|
|
2020
|
+
class: G(["rc-search-area__option", { "is-selected": T(B) }]),
|
|
2021
|
+
onClick: (Se) => ke(B)
|
|
2016
2022
|
}, [
|
|
2017
|
-
|
|
2018
|
-
T(
|
|
2023
|
+
M("span", ha, N(H(B, i.value || void 0)), 1),
|
|
2024
|
+
T(B) ? (s(), ne(J(X), {
|
|
2019
2025
|
key: 0,
|
|
2020
2026
|
name: "icon_check",
|
|
2021
2027
|
class: "rc-search-area__option-check"
|
|
@@ -2023,75 +2029,75 @@ const oa = { class: "rc-search-area" }, ra = { class: "rc-search-area__bar" }, s
|
|
|
2023
2029
|
], 10, pa))), 128))
|
|
2024
2030
|
])
|
|
2025
2031
|
]))), 128))
|
|
2026
|
-
])) : ((Ue = i.value) == null ? void 0 : Ue.type) === "tree-multiple" ? (
|
|
2027
|
-
(
|
|
2028
|
-
key:
|
|
2032
|
+
])) : ((Ue = i.value) == null ? void 0 : Ue.type) === "tree-multiple" ? (s(), f("div", ya, [
|
|
2033
|
+
(s(!0), f(oe, null, ve(Y(i.value), (o, k) => (s(), f("div", {
|
|
2034
|
+
key: k,
|
|
2029
2035
|
class: "rc-search-area__tree-group"
|
|
2030
2036
|
}, [
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
(
|
|
2037
|
+
M("div", ga, N(o.title), 1),
|
|
2038
|
+
M("div", ba, [
|
|
2039
|
+
(s(!0), f(oe, null, ve(o.children, (B, Q) => (s(), f("div", {
|
|
2034
2040
|
key: Q,
|
|
2035
|
-
class: G(["rc-search-area__option", { "is-selected": T(
|
|
2036
|
-
onClick: (
|
|
2041
|
+
class: G(["rc-search-area__option", { "is-selected": T(B) }]),
|
|
2042
|
+
onClick: (Se) => we(B)
|
|
2037
2043
|
}, [
|
|
2038
|
-
|
|
2039
|
-
T(
|
|
2044
|
+
M("span", _a, N(H(B, i.value || void 0)), 1),
|
|
2045
|
+
T(B) ? (s(), ne(J(X), {
|
|
2040
2046
|
key: 0,
|
|
2041
2047
|
name: "icon_check",
|
|
2042
2048
|
class: "rc-search-area__option-check"
|
|
2043
2049
|
})) : D("", !0)
|
|
2044
|
-
], 10,
|
|
2050
|
+
], 10, ka))), 128))
|
|
2045
2051
|
])
|
|
2046
2052
|
]))), 128))
|
|
2047
|
-
])) : ((
|
|
2048
|
-
(
|
|
2049
|
-
key:
|
|
2053
|
+
])) : ((Ne = i.value) == null ? void 0 : Ne.type) === "single" ? (s(), f("div", wa, [
|
|
2054
|
+
(s(!0), f(oe, null, ve(V(i.value), (o, k) => (s(), f("div", {
|
|
2055
|
+
key: k,
|
|
2050
2056
|
class: G(["rc-search-area__option", { "is-selected": T(o) }]),
|
|
2051
|
-
onClick: (
|
|
2057
|
+
onClick: (B) => ke(o)
|
|
2052
2058
|
}, [
|
|
2053
|
-
|
|
2054
|
-
T(o) ? (
|
|
2059
|
+
M("span", xa, N(H(o, i.value || void 0)), 1),
|
|
2060
|
+
T(o) ? (s(), ne(J(X), {
|
|
2055
2061
|
key: 0,
|
|
2056
2062
|
name: "icon_check",
|
|
2057
2063
|
class: "rc-search-area__option-check"
|
|
2058
2064
|
})) : D("", !0)
|
|
2059
2065
|
], 10, $a))), 128))
|
|
2060
|
-
])) : (
|
|
2061
|
-
(
|
|
2062
|
-
key:
|
|
2066
|
+
])) : (s(), f("div", Da, [
|
|
2067
|
+
(s(!0), f(oe, null, ve(V(i.value), (o, k) => (s(), f("div", {
|
|
2068
|
+
key: k,
|
|
2063
2069
|
class: G(["rc-search-area__option", { "is-selected": T(o) }]),
|
|
2064
|
-
onClick: (
|
|
2070
|
+
onClick: (B) => we(o)
|
|
2065
2071
|
}, [
|
|
2066
|
-
|
|
2067
|
-
T(o) ? (
|
|
2072
|
+
M("span", Sa, N(H(o, i.value || void 0)), 1),
|
|
2073
|
+
T(o) ? (s(), ne(J(X), {
|
|
2068
2074
|
key: 0,
|
|
2069
2075
|
name: "icon_check",
|
|
2070
2076
|
class: "rc-search-area__option-check"
|
|
2071
2077
|
})) : D("", !0)
|
|
2072
2078
|
], 10, Ca))), 128))
|
|
2073
2079
|
])),
|
|
2074
|
-
((je = i.value) == null ? void 0 : je.type) !== "input" && ((Ke = i.value) == null ? void 0 : Ke.type) !== "calendar" && !((Ge = i.value) != null && Ge.slot) && ((Je = (qe = i.value) == null ? void 0 : qe.options) == null ? void 0 : Je.length) === 0 ? (
|
|
2075
|
-
|
|
2080
|
+
((je = i.value) == null ? void 0 : je.type) !== "input" && ((Ke = i.value) == null ? void 0 : Ke.type) !== "calendar" && !((Ge = i.value) != null && Ge.slot) && ((Je = (qe = i.value) == null ? void 0 : qe.options) == null ? void 0 : Je.length) === 0 ? (s(), f("div", Ma, [...l[2] || (l[2] = [
|
|
2081
|
+
M("p", null, "暂无选项", -1)
|
|
2076
2082
|
])])) : D("", !0)
|
|
2077
2083
|
]),
|
|
2078
|
-
!t.autoConfirm && ((Qe = i.value) == null ? void 0 : Qe.type) !== "single" && ((a = i.value) == null ? void 0 : a.type) !== "tree-single" ? (
|
|
2079
|
-
K(J(
|
|
2084
|
+
!t.autoConfirm && ((Qe = i.value) == null ? void 0 : Qe.type) !== "single" && ((a = i.value) == null ? void 0 : a.type) !== "tree-single" ? (s(), f("div", Ia, [
|
|
2085
|
+
K(J(Ce), {
|
|
2080
2086
|
block: "",
|
|
2081
|
-
onClick:
|
|
2087
|
+
onClick: $
|
|
2082
2088
|
}, {
|
|
2083
2089
|
default: ae(() => [...l[3] || (l[3] = [
|
|
2084
2090
|
_e(" 重置 ", -1)
|
|
2085
2091
|
])]),
|
|
2086
2092
|
_: 1
|
|
2087
2093
|
}),
|
|
2088
|
-
K(J(
|
|
2094
|
+
K(J(Ce), {
|
|
2089
2095
|
type: "primary",
|
|
2090
2096
|
block: "",
|
|
2091
2097
|
onClick: te
|
|
2092
2098
|
}, {
|
|
2093
2099
|
default: ae(() => [
|
|
2094
|
-
_e(" 确定" +
|
|
2100
|
+
_e(" 确定" + N(pe.value), 1)
|
|
2095
2101
|
]),
|
|
2096
2102
|
_: 1
|
|
2097
2103
|
})
|
|
@@ -2114,47 +2120,47 @@ const oa = { class: "rc-search-area" }, ra = { class: "rc-search-area__bar" }, s
|
|
|
2114
2120
|
maxHeight: { default: "" }
|
|
2115
2121
|
},
|
|
2116
2122
|
emits: ["mouseenter", "mouseleave"],
|
|
2117
|
-
setup(e, { expose:
|
|
2118
|
-
const t = e, y = E(),
|
|
2119
|
-
const
|
|
2120
|
-
return t.maxHeight && (
|
|
2123
|
+
setup(e, { expose: r, emit: m }) {
|
|
2124
|
+
const t = e, y = E(), _ = R(() => t.visible === void 0 ? !0 : t.visible), v = R(() => t.visible !== void 0), d = R(() => {
|
|
2125
|
+
const u = {};
|
|
2126
|
+
return t.maxHeight && (u.maxHeight = typeof t.maxHeight == "number" ? `${t.maxHeight}px` : t.maxHeight, u.overflowY = "auto"), u;
|
|
2121
2127
|
});
|
|
2122
|
-
return
|
|
2128
|
+
return r({
|
|
2123
2129
|
menuRef: y
|
|
2124
|
-
}), (
|
|
2130
|
+
}), (u, h) => v.value ? (s(), ne(it, {
|
|
2125
2131
|
key: 0,
|
|
2126
2132
|
to: "body"
|
|
2127
2133
|
}, [
|
|
2128
2134
|
K(Be, { name: "rc-dropdown-fade" }, {
|
|
2129
2135
|
default: ae(() => [
|
|
2130
|
-
|
|
2136
|
+
_.value ? (s(), f("ul", {
|
|
2131
2137
|
key: 0,
|
|
2132
2138
|
ref_key: "menuRef",
|
|
2133
2139
|
ref: y,
|
|
2134
2140
|
class: G(["rc-dropdown-menu", [`rc-dropdown-menu--${e.effect}`]]),
|
|
2135
2141
|
style: le(d.value),
|
|
2136
|
-
onClick:
|
|
2142
|
+
onClick: h[0] || (h[0] = Ye(() => {
|
|
2137
2143
|
}, ["stop"])),
|
|
2138
|
-
onMouseenter:
|
|
2139
|
-
onMouseleave:
|
|
2144
|
+
onMouseenter: h[1] || (h[1] = (F) => u.$emit("mouseenter", F)),
|
|
2145
|
+
onMouseleave: h[2] || (h[2] = (F) => u.$emit("mouseleave", F))
|
|
2140
2146
|
}, [
|
|
2141
|
-
q(
|
|
2147
|
+
q(u.$slots, "default", {}, void 0, !0)
|
|
2142
2148
|
], 38)) : D("", !0)
|
|
2143
2149
|
]),
|
|
2144
2150
|
_: 3
|
|
2145
2151
|
})
|
|
2146
|
-
])) : (
|
|
2152
|
+
])) : (s(), f("ul", {
|
|
2147
2153
|
key: 1,
|
|
2148
2154
|
ref_key: "menuRef",
|
|
2149
2155
|
ref: y,
|
|
2150
2156
|
class: G(["rc-dropdown-menu rc-dropdown-menu--nested", [`rc-dropdown-menu--${e.effect}`]]),
|
|
2151
2157
|
style: le(d.value),
|
|
2152
|
-
onClick:
|
|
2158
|
+
onClick: h[3] || (h[3] = Ye(() => {
|
|
2153
2159
|
}, ["stop"])),
|
|
2154
|
-
onMouseenter:
|
|
2155
|
-
onMouseleave:
|
|
2160
|
+
onMouseenter: h[4] || (h[4] = (F) => u.$emit("mouseenter", F)),
|
|
2161
|
+
onMouseleave: h[5] || (h[5] = (F) => u.$emit("mouseleave", F))
|
|
2156
2162
|
}, [
|
|
2157
|
-
q(
|
|
2163
|
+
q(u.$slots, "default", {}, void 0, !0)
|
|
2158
2164
|
], 38));
|
|
2159
2165
|
}
|
|
2160
2166
|
}), nt = /* @__PURE__ */ ue(Va, [["__scopeId", "data-v-288e2690"]]), Ta = /* @__PURE__ */ se({
|
|
@@ -2171,15 +2177,15 @@ const oa = { class: "rc-search-area" }, ra = { class: "rc-search-area__bar" }, s
|
|
|
2171
2177
|
hideTimeout: { default: 150 }
|
|
2172
2178
|
},
|
|
2173
2179
|
emits: ["command", "visible-change"],
|
|
2174
|
-
setup(e, { expose:
|
|
2175
|
-
const t = e, y = m,
|
|
2176
|
-
let
|
|
2177
|
-
function
|
|
2180
|
+
setup(e, { expose: r, emit: m }) {
|
|
2181
|
+
const t = e, y = m, _ = E(), v = E(), d = E(!1);
|
|
2182
|
+
let u = null, h = null;
|
|
2183
|
+
function F(z) {
|
|
2178
2184
|
t.hideOnClick && (d.value = !1), z !== void 0 && y("command", z);
|
|
2179
2185
|
}
|
|
2180
|
-
|
|
2181
|
-
function
|
|
2182
|
-
t.disabled || (
|
|
2186
|
+
Re("handleItemClick", F);
|
|
2187
|
+
function b() {
|
|
2188
|
+
t.disabled || (u && (clearTimeout(u), u = null), h && (clearTimeout(h), h = null), u = setTimeout(() => {
|
|
2183
2189
|
d.value = !0, requestAnimationFrame(() => {
|
|
2184
2190
|
Fe(() => {
|
|
2185
2191
|
O();
|
|
@@ -2187,85 +2193,85 @@ const oa = { class: "rc-search-area" }, ra = { class: "rc-search-area__bar" }, s
|
|
|
2187
2193
|
});
|
|
2188
2194
|
}, t.showTimeout));
|
|
2189
2195
|
}
|
|
2190
|
-
function
|
|
2191
|
-
t.trigger === "hover" && i.value || (
|
|
2196
|
+
function g() {
|
|
2197
|
+
t.trigger === "hover" && i.value || (h && (clearTimeout(h), h = null), u && (clearTimeout(u), u = null), h = setTimeout(() => {
|
|
2192
2198
|
d.value = !1, i.value = !1;
|
|
2193
2199
|
}, t.hideTimeout));
|
|
2194
2200
|
}
|
|
2195
|
-
function
|
|
2196
|
-
t.disabled || (d.value ?
|
|
2201
|
+
function I() {
|
|
2202
|
+
t.disabled || (d.value ? g() : b());
|
|
2197
2203
|
}
|
|
2198
2204
|
function A() {
|
|
2199
|
-
t.trigger === "hover" && !t.disabled &&
|
|
2205
|
+
t.trigger === "hover" && !t.disabled && b();
|
|
2200
2206
|
}
|
|
2201
|
-
function
|
|
2207
|
+
function C() {
|
|
2202
2208
|
t.trigger === "hover" && setTimeout(() => {
|
|
2203
|
-
i.value ||
|
|
2209
|
+
i.value || g();
|
|
2204
2210
|
}, 50);
|
|
2205
2211
|
}
|
|
2206
2212
|
const i = E(!1);
|
|
2207
2213
|
function pe() {
|
|
2208
|
-
t.trigger === "hover" && (i.value = !0,
|
|
2214
|
+
t.trigger === "hover" && (i.value = !0, u && (clearTimeout(u), u = null), h && (clearTimeout(h), h = null));
|
|
2209
2215
|
}
|
|
2210
2216
|
function he() {
|
|
2211
|
-
t.trigger === "hover" && (i.value = !1,
|
|
2217
|
+
t.trigger === "hover" && (i.value = !1, g());
|
|
2212
2218
|
}
|
|
2213
2219
|
function ye(z) {
|
|
2214
|
-
t.trigger === "click" && !t.disabled && (z.stopPropagation(),
|
|
2220
|
+
t.trigger === "click" && !t.disabled && (z.stopPropagation(), I());
|
|
2215
2221
|
}
|
|
2216
2222
|
function O() {
|
|
2217
|
-
var
|
|
2218
|
-
if (!
|
|
2219
|
-
const z =
|
|
2223
|
+
var ke;
|
|
2224
|
+
if (!_.value || !((ke = v.value) != null && ke.menuRef)) return;
|
|
2225
|
+
const z = _.value, j = v.value.menuRef;
|
|
2220
2226
|
if (!z || !j) return;
|
|
2221
|
-
const
|
|
2227
|
+
const S = z.getBoundingClientRect(), T = j.getBoundingClientRect();
|
|
2222
2228
|
if (T.width === 0 || T.height === 0) {
|
|
2223
2229
|
setTimeout(() => {
|
|
2224
2230
|
d.value && O();
|
|
2225
2231
|
}, 10);
|
|
2226
2232
|
return;
|
|
2227
2233
|
}
|
|
2228
|
-
let
|
|
2234
|
+
let V = 0, Y = 0;
|
|
2229
2235
|
switch (t.placement) {
|
|
2230
2236
|
case "top":
|
|
2231
|
-
|
|
2237
|
+
V = S.top - T.height, Y = S.left;
|
|
2232
2238
|
break;
|
|
2233
2239
|
case "top-start":
|
|
2234
|
-
|
|
2240
|
+
V = S.top - T.height, Y = S.left;
|
|
2235
2241
|
break;
|
|
2236
2242
|
case "top-end":
|
|
2237
|
-
|
|
2243
|
+
V = S.top - T.height, Y = S.left + S.width - T.width;
|
|
2238
2244
|
break;
|
|
2239
2245
|
case "bottom":
|
|
2240
|
-
|
|
2246
|
+
V = S.bottom, Y = S.left + (S.width - T.width) / 2;
|
|
2241
2247
|
break;
|
|
2242
2248
|
case "bottom-start":
|
|
2243
|
-
|
|
2249
|
+
V = S.bottom, Y = S.left;
|
|
2244
2250
|
break;
|
|
2245
2251
|
case "bottom-end":
|
|
2246
|
-
|
|
2252
|
+
V = S.bottom, Y = S.left + S.width - T.width;
|
|
2247
2253
|
break;
|
|
2248
2254
|
case "left":
|
|
2249
|
-
|
|
2255
|
+
V = S.top + (S.height - T.height) / 2, Y = S.left - T.width;
|
|
2250
2256
|
break;
|
|
2251
2257
|
case "left-start":
|
|
2252
|
-
|
|
2258
|
+
V = S.top, Y = S.left - T.width;
|
|
2253
2259
|
break;
|
|
2254
2260
|
case "left-end":
|
|
2255
|
-
|
|
2261
|
+
V = S.top + S.height - T.height, Y = S.left - T.width;
|
|
2256
2262
|
break;
|
|
2257
2263
|
case "right":
|
|
2258
|
-
|
|
2264
|
+
V = S.top + (S.height - T.height) / 2, Y = S.right;
|
|
2259
2265
|
break;
|
|
2260
2266
|
case "right-start":
|
|
2261
|
-
|
|
2267
|
+
V = S.top, Y = S.right;
|
|
2262
2268
|
break;
|
|
2263
2269
|
case "right-end":
|
|
2264
|
-
|
|
2270
|
+
V = S.top + S.height - T.height, Y = S.right;
|
|
2265
2271
|
break;
|
|
2266
2272
|
}
|
|
2267
|
-
const ge = window.innerWidth,
|
|
2268
|
-
Y < 0 && (Y = 8), Y + T.width > ge && (Y = ge - T.width - 8),
|
|
2273
|
+
const ge = window.innerWidth, be = window.innerHeight;
|
|
2274
|
+
Y < 0 && (Y = 8), Y + T.width > ge && (Y = ge - T.width - 8), V < 0 && (V = 8), V + T.height > be && (V = be - T.height - 8), j.style.top = `${V}px`, j.style.left = `${Y}px`, j.style.position = "fixed", j.style.visibility = "visible", j.style.display = "block";
|
|
2269
2275
|
}
|
|
2270
2276
|
Ie(d, (z) => {
|
|
2271
2277
|
y("visible-change", z), z ? (requestAnimationFrame(() => {
|
|
@@ -2277,7 +2283,7 @@ const oa = { class: "rc-search-area" }, ra = { class: "rc-search-area__bar" }, s
|
|
|
2277
2283
|
function H(z) {
|
|
2278
2284
|
if (t.trigger === "click" && !t.disabled) {
|
|
2279
2285
|
const j = z.target;
|
|
2280
|
-
|
|
2286
|
+
_.value && !_.value.contains(j) && g();
|
|
2281
2287
|
}
|
|
2282
2288
|
}
|
|
2283
2289
|
function U() {
|
|
@@ -2286,18 +2292,18 @@ const oa = { class: "rc-search-area" }, ra = { class: "rc-search-area__bar" }, s
|
|
|
2286
2292
|
return at(() => {
|
|
2287
2293
|
window.addEventListener("resize", U), window.addEventListener("scroll", U, !0);
|
|
2288
2294
|
}), lt(() => {
|
|
2289
|
-
|
|
2290
|
-
}),
|
|
2291
|
-
show:
|
|
2292
|
-
hide:
|
|
2293
|
-
toggle:
|
|
2295
|
+
u && clearTimeout(u), h && clearTimeout(h), document.removeEventListener("click", H), window.removeEventListener("resize", U), window.removeEventListener("scroll", U, !0);
|
|
2296
|
+
}), r({
|
|
2297
|
+
show: b,
|
|
2298
|
+
hide: g,
|
|
2299
|
+
toggle: I,
|
|
2294
2300
|
visible: d
|
|
2295
|
-
}), (z, j) => (
|
|
2301
|
+
}), (z, j) => (s(), f("div", {
|
|
2296
2302
|
ref_key: "dropdownRef",
|
|
2297
|
-
ref:
|
|
2303
|
+
ref: _,
|
|
2298
2304
|
class: G(["rc-dropdown", { "is-disabled": e.disabled }]),
|
|
2299
2305
|
onMouseenter: A,
|
|
2300
|
-
onMouseleave:
|
|
2306
|
+
onMouseleave: C,
|
|
2301
2307
|
onClick: ye
|
|
2302
2308
|
}, [
|
|
2303
2309
|
q(z.$slots, "default", {}, void 0, !0),
|
|
@@ -2317,7 +2323,7 @@ const oa = { class: "rc-search-area" }, ra = { class: "rc-search-area__bar" }, s
|
|
|
2317
2323
|
}, 8, ["visible", "effect", "max-height"])
|
|
2318
2324
|
], 34));
|
|
2319
2325
|
}
|
|
2320
|
-
}), st = /* @__PURE__ */ ue(Ta, [["__scopeId", "data-v-
|
|
2326
|
+
}), st = /* @__PURE__ */ ue(Ta, [["__scopeId", "data-v-39434407"]]), Ea = { class: "rc-dropdown-item__text" }, Ba = /* @__PURE__ */ se({
|
|
2321
2327
|
name: "rc-dropdown-item",
|
|
2322
2328
|
__name: "item",
|
|
2323
2329
|
props: {
|
|
@@ -2327,28 +2333,28 @@ const oa = { class: "rc-search-area" }, ra = { class: "rc-search-area__bar" }, s
|
|
|
2327
2333
|
icon: { default: "" }
|
|
2328
2334
|
},
|
|
2329
2335
|
setup(e) {
|
|
2330
|
-
const
|
|
2336
|
+
const r = e, m = De("handleItemClick", () => {
|
|
2331
2337
|
});
|
|
2332
2338
|
function t(y) {
|
|
2333
|
-
if (
|
|
2339
|
+
if (r.disabled) {
|
|
2334
2340
|
y.stopPropagation();
|
|
2335
2341
|
return;
|
|
2336
2342
|
}
|
|
2337
|
-
m(
|
|
2343
|
+
m(r.command);
|
|
2338
2344
|
}
|
|
2339
|
-
return (y,
|
|
2345
|
+
return (y, _) => (s(), f("li", {
|
|
2340
2346
|
class: G(["rc-dropdown-item", {
|
|
2341
2347
|
"is-disabled": e.disabled,
|
|
2342
2348
|
"is-divided": e.divided
|
|
2343
2349
|
}]),
|
|
2344
2350
|
onClick: t
|
|
2345
2351
|
}, [
|
|
2346
|
-
e.icon ? (
|
|
2352
|
+
e.icon ? (s(), ne(X, {
|
|
2347
2353
|
key: 0,
|
|
2348
2354
|
name: e.icon,
|
|
2349
2355
|
class: "rc-dropdown-item__icon"
|
|
2350
2356
|
}, null, 8, ["name"])) : D("", !0),
|
|
2351
|
-
|
|
2357
|
+
M("span", Ea, [
|
|
2352
2358
|
q(y.$slots, "default", {}, void 0, !0)
|
|
2353
2359
|
])
|
|
2354
2360
|
], 2));
|
|
@@ -2372,30 +2378,30 @@ const ot = Symbol("RECYCLE_UI_CONFIG"), ct = {
|
|
|
2372
2378
|
// 输入框设备类型默认配置
|
|
2373
2379
|
inputDeviceType: "pc"
|
|
2374
2380
|
};
|
|
2375
|
-
function Fa(e,
|
|
2376
|
-
|
|
2381
|
+
function Fa(e, r) {
|
|
2382
|
+
r.autoRegister !== !1 && (typeof mt == "function" && mt(e), typeof pt == "function" && pt(e), typeof ht == "function" && ht(e), typeof gt == "function" && gt(e), typeof kt == "function" && kt(e), typeof bt == "function" && bt(e), typeof Ct == "function" && Ct(e), typeof $t == "function" && $t(e), typeof _t == "function" && _t(e), typeof xt == "function" && xt(e), typeof St == "function" && St(e));
|
|
2377
2383
|
}
|
|
2378
|
-
const It = (e,
|
|
2379
|
-
const m = { ...ct, ...
|
|
2384
|
+
const It = (e, r) => {
|
|
2385
|
+
const m = { ...ct, ...r || {} };
|
|
2380
2386
|
if (e.provide(m.provideKey ?? ot, m), e.config.globalProperties.$recycleUI = m, typeof window < "u" && m.iconCssUrl) {
|
|
2381
2387
|
const t = `link[rel="stylesheet"][data-rcui-icon="true"][href="${m.iconCssUrl}"]`;
|
|
2382
2388
|
if (!document.head.querySelector(t)) {
|
|
2383
|
-
const
|
|
2384
|
-
|
|
2389
|
+
const _ = document.createElement("link");
|
|
2390
|
+
_.rel = "stylesheet", _.href = m.iconCssUrl, _.setAttribute("data-rcui-icon", "true"), document.head.appendChild(_);
|
|
2385
2391
|
}
|
|
2386
2392
|
}
|
|
2387
2393
|
return Fa(e, m), e;
|
|
2388
|
-
},
|
|
2389
|
-
function
|
|
2394
|
+
}, Pa = { install: It };
|
|
2395
|
+
function Na(e) {
|
|
2390
2396
|
return {
|
|
2391
|
-
install(
|
|
2392
|
-
It(
|
|
2397
|
+
install(r) {
|
|
2398
|
+
It(r, e);
|
|
2393
2399
|
}
|
|
2394
2400
|
};
|
|
2395
2401
|
}
|
|
2396
2402
|
export {
|
|
2397
2403
|
ot as RECYCLE_UI_SYMBOL,
|
|
2398
|
-
|
|
2404
|
+
Ce as RcButton,
|
|
2399
2405
|
Oe as RcCalendar,
|
|
2400
2406
|
Ze as RcCard,
|
|
2401
2407
|
za as RcDescriptions,
|
|
@@ -2408,8 +2414,8 @@ export {
|
|
|
2408
2414
|
He as RcPopup,
|
|
2409
2415
|
Dt as RcSearchArea,
|
|
2410
2416
|
et as RcToast,
|
|
2411
|
-
|
|
2412
|
-
|
|
2417
|
+
Na as createRecycleUI,
|
|
2418
|
+
Pa as default,
|
|
2413
2419
|
ct as defaultRecycleUIConfig,
|
|
2414
2420
|
dn as hideToast,
|
|
2415
2421
|
It as install,
|
|
@@ -2418,9 +2424,9 @@ export {
|
|
|
2418
2424
|
ht as installCard,
|
|
2419
2425
|
pt as installDescriptions,
|
|
2420
2426
|
St as installDropdown,
|
|
2421
|
-
|
|
2427
|
+
kt as installIcon,
|
|
2422
2428
|
xt as installInput,
|
|
2423
|
-
|
|
2429
|
+
bt as installMessage,
|
|
2424
2430
|
_t as installPopup,
|
|
2425
2431
|
Ct as installSearchArea,
|
|
2426
2432
|
yn as message,
|