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

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