@rft-rc/recycle-ui 0.0.2 → 0.0.3-rc.2

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