xinwen-design 0.1.0

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 (146) hide show
  1. package/README.md +195 -0
  2. package/dist/style.css +1 -0
  3. package/dist/types/App.vue.d.ts +3 -0
  4. package/dist/types/components/alert/Alert.d.ts +10 -0
  5. package/dist/types/components/alert/Alert.vue.d.ts +22 -0
  6. package/dist/types/components/alert/index.d.ts +2 -0
  7. package/dist/types/components/autocomplete/Autocomplete.d.ts +13 -0
  8. package/dist/types/components/autocomplete/Autocomplete.vue.d.ts +17 -0
  9. package/dist/types/components/autocomplete/index.d.ts +2 -0
  10. package/dist/types/components/avatar/Avatar.d.ts +7 -0
  11. package/dist/types/components/avatar/Avatar.vue.d.ts +17 -0
  12. package/dist/types/components/avatar/index.d.ts +2 -0
  13. package/dist/types/components/backtop/Backtop.d.ts +9 -0
  14. package/dist/types/components/backtop/Backtop.vue.d.ts +23 -0
  15. package/dist/types/components/backtop/index.d.ts +2 -0
  16. package/dist/types/components/badge/Badge.d.ts +13 -0
  17. package/dist/types/components/badge/Badge.vue.d.ts +19 -0
  18. package/dist/types/components/badge/index.d.ts +4 -0
  19. package/dist/types/components/breadcrumb/Breadcrumb.d.ts +17 -0
  20. package/dist/types/components/breadcrumb/Breadcrumb.vue.d.ts +11 -0
  21. package/dist/types/components/breadcrumb/index.d.ts +4 -0
  22. package/dist/types/components/button/Button.d.ts +35 -0
  23. package/dist/types/components/button/Button.vue.d.ts +34 -0
  24. package/dist/types/components/button/button.test.d.ts +1 -0
  25. package/dist/types/components/button/index.d.ts +4 -0
  26. package/dist/types/components/card/Card.d.ts +4 -0
  27. package/dist/types/components/card/Card.vue.d.ts +20 -0
  28. package/dist/types/components/card/index.d.ts +2 -0
  29. package/dist/types/components/carousel/Carousel.d.ts +8 -0
  30. package/dist/types/components/carousel/Carousel.vue.d.ts +22 -0
  31. package/dist/types/components/carousel/index.d.ts +2 -0
  32. package/dist/types/components/cascader/Cascader.d.ts +15 -0
  33. package/dist/types/components/cascader/Cascader.vue.d.ts +14 -0
  34. package/dist/types/components/cascader/index.d.ts +2 -0
  35. package/dist/types/components/checkbox/Checkbox.d.ts +31 -0
  36. package/dist/types/components/checkbox/Checkbox.vue.d.ts +27 -0
  37. package/dist/types/components/checkbox/checkbox.test.d.ts +1 -0
  38. package/dist/types/components/checkbox/index.d.ts +4 -0
  39. package/dist/types/components/collapse/Collapse.d.ts +14 -0
  40. package/dist/types/components/collapse/Collapse.vue.d.ts +24 -0
  41. package/dist/types/components/collapse/index.d.ts +2 -0
  42. package/dist/types/components/color-picker/ColorPicker.vue.d.ts +7 -0
  43. package/dist/types/components/date-picker/DatePicker.d.ts +10 -0
  44. package/dist/types/components/date-picker/DatePicker.vue.d.ts +14 -0
  45. package/dist/types/components/date-picker/index.d.ts +2 -0
  46. package/dist/types/components/demo/DemoSection.vue.d.ts +18 -0
  47. package/dist/types/components/divider/Divider.d.ts +10 -0
  48. package/dist/types/components/divider/Divider.vue.d.ts +18 -0
  49. package/dist/types/components/divider/index.d.ts +4 -0
  50. package/dist/types/components/drawer/Drawer.d.ts +12 -0
  51. package/dist/types/components/drawer/Drawer.vue.d.ts +27 -0
  52. package/dist/types/components/drawer/index.d.ts +2 -0
  53. package/dist/types/components/dropdown/Dropdown.d.ts +11 -0
  54. package/dist/types/components/dropdown/Dropdown.vue.d.ts +20 -0
  55. package/dist/types/components/dropdown/index.d.ts +2 -0
  56. package/dist/types/components/empty/Empty.d.ts +3 -0
  57. package/dist/types/components/empty/Empty.vue.d.ts +18 -0
  58. package/dist/types/components/empty/index.d.ts +2 -0
  59. package/dist/types/components/image/Image.d.ts +9 -0
  60. package/dist/types/components/image/Image.vue.d.ts +24 -0
  61. package/dist/types/components/image/index.d.ts +2 -0
  62. package/dist/types/components/input/Input.d.ts +58 -0
  63. package/dist/types/components/input/Input.vue.d.ts +51 -0
  64. package/dist/types/components/input/index.d.ts +4 -0
  65. package/dist/types/components/input-number/InputNumber.d.ts +25 -0
  66. package/dist/types/components/input-number/InputNumber.vue.d.ts +18 -0
  67. package/dist/types/components/input-number/index.d.ts +4 -0
  68. package/dist/types/components/link/Link.d.ts +18 -0
  69. package/dist/types/components/link/Link.vue.d.ts +24 -0
  70. package/dist/types/components/link/index.d.ts +4 -0
  71. package/dist/types/components/loading/Loading.d.ts +11 -0
  72. package/dist/types/components/loading/Loading.vue.d.ts +8 -0
  73. package/dist/types/components/loading/index.d.ts +4 -0
  74. package/dist/types/components/menu/Menu.d.ts +13 -0
  75. package/dist/types/components/menu/Menu.vue.d.ts +11 -0
  76. package/dist/types/components/menu/index.d.ts +2 -0
  77. package/dist/types/components/modal/Modal.d.ts +31 -0
  78. package/dist/types/components/modal/Modal.vue.d.ts +38 -0
  79. package/dist/types/components/modal/index.d.ts +4 -0
  80. package/dist/types/components/pagination/Pagination.d.ts +25 -0
  81. package/dist/types/components/pagination/Pagination.vue.d.ts +22 -0
  82. package/dist/types/components/pagination/index.d.ts +4 -0
  83. package/dist/types/components/popover/Popover.d.ts +6 -0
  84. package/dist/types/components/popover/Popover.vue.d.ts +19 -0
  85. package/dist/types/components/popover/index.d.ts +2 -0
  86. package/dist/types/components/progress/Progress.d.ts +16 -0
  87. package/dist/types/components/progress/Progress.vue.d.ts +9 -0
  88. package/dist/types/components/progress/index.d.ts +4 -0
  89. package/dist/types/components/radio/Radio.d.ts +25 -0
  90. package/dist/types/components/radio/Radio.vue.d.ts +23 -0
  91. package/dist/types/components/radio/index.d.ts +4 -0
  92. package/dist/types/components/radio/radio.test.d.ts +1 -0
  93. package/dist/types/components/rate/Rate.d.ts +20 -0
  94. package/dist/types/components/rate/Rate.vue.d.ts +18 -0
  95. package/dist/types/components/rate/index.d.ts +4 -0
  96. package/dist/types/components/select/Select.d.ts +31 -0
  97. package/dist/types/components/select/Select.vue.d.ts +20 -0
  98. package/dist/types/components/select/index.d.ts +4 -0
  99. package/dist/types/components/skeleton/Skeleton.d.ts +4 -0
  100. package/dist/types/components/skeleton/Skeleton.vue.d.ts +7 -0
  101. package/dist/types/components/skeleton/index.d.ts +2 -0
  102. package/dist/types/components/slider/Slider.d.ts +27 -0
  103. package/dist/types/components/slider/Slider.vue.d.ts +20 -0
  104. package/dist/types/components/slider/index.d.ts +4 -0
  105. package/dist/types/components/space/Space.d.ts +13 -0
  106. package/dist/types/components/space/Space.vue.d.ts +9 -0
  107. package/dist/types/components/space/index.d.ts +4 -0
  108. package/dist/types/components/steps/Steps.d.ts +9 -0
  109. package/dist/types/components/steps/Steps.vue.d.ts +8 -0
  110. package/dist/types/components/steps/index.d.ts +2 -0
  111. package/dist/types/components/switch/Switch.d.ts +29 -0
  112. package/dist/types/components/switch/Switch.vue.d.ts +16 -0
  113. package/dist/types/components/switch/index.d.ts +4 -0
  114. package/dist/types/components/switch/switch.test.d.ts +1 -0
  115. package/dist/types/components/table/Table.d.ts +11 -0
  116. package/dist/types/components/table/Table.vue.d.ts +22 -0
  117. package/dist/types/components/table/index.d.ts +2 -0
  118. package/dist/types/components/tabs/Tabs.d.ts +22 -0
  119. package/dist/types/components/tabs/Tabs.vue.d.ts +26 -0
  120. package/dist/types/components/tabs/index.d.ts +4 -0
  121. package/dist/types/components/tag/Tag.d.ts +15 -0
  122. package/dist/types/components/tag/Tag.vue.d.ts +23 -0
  123. package/dist/types/components/tag/index.d.ts +4 -0
  124. package/dist/types/components/time-picker/TimePicker.d.ts +9 -0
  125. package/dist/types/components/time-picker/TimePicker.vue.d.ts +13 -0
  126. package/dist/types/components/time-picker/index.d.ts +2 -0
  127. package/dist/types/components/timeline/Timeline.d.ts +9 -0
  128. package/dist/types/components/timeline/Timeline.vue.d.ts +6 -0
  129. package/dist/types/components/timeline/index.d.ts +2 -0
  130. package/dist/types/components/toast/Toast.d.ts +21 -0
  131. package/dist/types/components/toast/Toast.vue.d.ts +15 -0
  132. package/dist/types/components/toast/index.d.ts +4 -0
  133. package/dist/types/components/tooltip/Tooltip.d.ts +16 -0
  134. package/dist/types/components/tooltip/Tooltip.vue.d.ts +22 -0
  135. package/dist/types/components/tooltip/index.d.ts +4 -0
  136. package/dist/types/components/transfer/Transfer.d.ts +14 -0
  137. package/dist/types/components/transfer/Transfer.vue.d.ts +14 -0
  138. package/dist/types/components/transfer/index.d.ts +2 -0
  139. package/dist/types/components/upload/Upload.d.ts +17 -0
  140. package/dist/types/components/upload/Upload.vue.d.ts +24 -0
  141. package/dist/types/components/upload/index.d.ts +2 -0
  142. package/dist/types/index.d.ts +49 -0
  143. package/dist/types/main.d.ts +1 -0
  144. package/dist/xinwen-design.es.js +2929 -0
  145. package/dist/xinwen-design.umd.js +6 -0
  146. package/package.json +85 -0
@@ -0,0 +1,2929 @@
1
+ import { defineComponent as S, ref as k, openBlock as a, createElementBlock as l, normalizeClass as g, createElementVNode as o, createCommentVNode as x, renderSlot as I, createTextVNode as F, toDisplayString as p, computed as R, Fragment as z, withModifiers as X, normalizeStyle as N, renderList as D, watch as O, onMounted as U, onUnmounted as Y, withKeys as P, withDirectives as K, vModelText as q, createVNode as H, Transition as J, withCtx as G, vShow as ne, nextTick as te, createBlock as W, Teleport as Q, TransitionGroup as de, vModelSelect as ue, useSlots as oe, resolveDynamicComponent as re, unref as ee, vModelCheckbox as le } from "vue";
2
+ const _e = ["disabled"], ve = {
3
+ key: 0,
4
+ class: "xd-button__spinner"
5
+ }, fe = {
6
+ key: 1,
7
+ class: "xd-button__icon"
8
+ }, pe = { class: "xd-button__text" }, me = {
9
+ key: 2,
10
+ class: "xd-button__toggle-dot"
11
+ }, we = /* @__PURE__ */ S({
12
+ __name: "Button",
13
+ props: {
14
+ type: { default: "primary" },
15
+ size: { default: "medium" },
16
+ disabled: { type: Boolean, default: !1 },
17
+ loading: { type: Boolean, default: !1 },
18
+ block: { type: Boolean, default: !1 },
19
+ icon: {},
20
+ ghost: { type: Boolean, default: !1 },
21
+ round: { type: Boolean, default: !1 },
22
+ toggle: { type: Boolean, default: !1 },
23
+ modelValue: { type: Boolean, default: !1 }
24
+ },
25
+ emits: ["click", "update:modelValue", "change"],
26
+ setup(e, { emit: r }) {
27
+ const t = e, n = r, s = k(t.modelValue), i = k(), c = (u) => {
28
+ const v = u.currentTarget, m = i.value;
29
+ if (!m)
30
+ return;
31
+ const $ = v.getBoundingClientRect(), y = Math.max($.width, $.height), h = u.clientX - $.left - y / 2, f = u.clientY - $.top - y / 2;
32
+ m.style.cssText = `
33
+ width: ${y}px;
34
+ height: ${y}px;
35
+ left: ${h}px;
36
+ top: ${f}px;
37
+ `, m.classList.remove("animate"), m.offsetWidth, m.classList.add("animate");
38
+ }, d = (u) => {
39
+ t.disabled || t.loading || (c(u), t.toggle && (s.value = !s.value, n("update:modelValue", s.value), n("change", s.value)), n("click", u));
40
+ };
41
+ return (u, v) => (a(), l("button", {
42
+ class: g([
43
+ "xd-button",
44
+ `xd-button--${e.type}`,
45
+ `xd-button--${e.size}`,
46
+ {
47
+ "xd-button--disabled": e.disabled,
48
+ "xd-button--loading": e.loading,
49
+ "xd-button--block": e.block,
50
+ "xd-button--active": s.value,
51
+ "xd-button--toggle": e.toggle,
52
+ "xd-button--ghost": e.ghost,
53
+ "xd-button--round": e.round
54
+ }
55
+ ]),
56
+ disabled: e.disabled || e.loading,
57
+ onClick: d
58
+ }, [
59
+ o("span", {
60
+ class: "xd-button__ripple",
61
+ ref_key: "rippleRef",
62
+ ref: i
63
+ }, null, 512),
64
+ e.loading ? (a(), l("span", ve, [...v[0] || (v[0] = [
65
+ o("svg", { viewBox: "25 25 50 50" }, [
66
+ o("circle", {
67
+ cx: "50",
68
+ cy: "50",
69
+ r: "20",
70
+ fill: "none",
71
+ stroke: "currentColor",
72
+ "stroke-width": "4",
73
+ "stroke-dasharray": "31.415, 31.415",
74
+ "stroke-linecap": "round"
75
+ })
76
+ ], -1)
77
+ ])])) : x("", !0),
78
+ e.icon && !e.loading ? (a(), l("span", fe, [
79
+ I(u.$slots, "icon", {}, () => [
80
+ F(p(e.icon), 1)
81
+ ])
82
+ ])) : x("", !0),
83
+ o("span", pe, [
84
+ I(u.$slots, "default")
85
+ ]),
86
+ e.toggle ? (a(), l("span", me)) : x("", !0)
87
+ ], 10, _e));
88
+ }
89
+ });
90
+ const he = {
91
+ key: 0,
92
+ class: "xw-input__prepend"
93
+ }, xe = {
94
+ key: 0,
95
+ class: "xw-input__prefix"
96
+ }, ye = ["type", "value", "placeholder", "disabled", "readonly", "maxlength", "autofocus"], be = {
97
+ key: 1,
98
+ class: "xw-input__suffix"
99
+ }, ge = {
100
+ key: 0,
101
+ class: "xw-input__count"
102
+ }, ke = {
103
+ key: 1,
104
+ class: "xw-input__append"
105
+ }, $e = /* @__PURE__ */ S({
106
+ __name: "Input",
107
+ props: {
108
+ modelValue: {},
109
+ type: { default: "text" },
110
+ size: { default: "medium" },
111
+ placeholder: {},
112
+ disabled: { type: Boolean, default: !1 },
113
+ readonly: { type: Boolean, default: !1 },
114
+ clearable: { type: Boolean, default: !1 },
115
+ showPassword: { type: Boolean, default: !1 },
116
+ maxlength: {},
117
+ showCount: { type: Boolean, default: !1 },
118
+ prefix: {},
119
+ suffix: {},
120
+ prepend: {},
121
+ append: {},
122
+ status: { default: "default" },
123
+ hint: {},
124
+ autofocus: { type: Boolean, default: !1 },
125
+ block: { type: Boolean, default: !1 }
126
+ },
127
+ emits: ["update:modelValue", "input", "change", "focus", "blur", "clear", "keydown", "keyup", "enter"],
128
+ setup(e, { expose: r, emit: t }) {
129
+ const n = e, s = t, i = k(), c = k(!1), d = k(!1), u = R(() => n.type === "password" ? d.value ? "text" : "password" : n.type), v = R(() => String(n.modelValue ?? "").length), m = R(
130
+ () => n.clearable && !n.disabled && !n.readonly && v.value > 0
131
+ ), $ = R(
132
+ () => n.type === "password" && n.showPassword
133
+ ), y = (w) => {
134
+ const M = w.target.value;
135
+ s("update:modelValue", M), s("input", M, w);
136
+ }, h = (w) => {
137
+ const M = w.target.value;
138
+ s("change", M, w);
139
+ }, f = (w) => {
140
+ c.value = !0, s("focus", w);
141
+ }, _ = (w) => {
142
+ c.value = !1, s("blur", w);
143
+ }, C = (w) => {
144
+ s("keydown", w), w.key === "Enter" && s("enter", w.target.value, w);
145
+ }, b = (w) => {
146
+ s("keyup", w);
147
+ }, V = () => {
148
+ var w;
149
+ s("update:modelValue", ""), s("clear"), (w = i.value) == null || w.focus();
150
+ }, B = () => {
151
+ d.value = !d.value;
152
+ };
153
+ return r({
154
+ focus: () => {
155
+ var w;
156
+ return (w = i.value) == null ? void 0 : w.focus();
157
+ },
158
+ blur: () => {
159
+ var w;
160
+ return (w = i.value) == null ? void 0 : w.blur();
161
+ },
162
+ clear: V,
163
+ select: () => {
164
+ var w;
165
+ return (w = i.value) == null ? void 0 : w.select();
166
+ }
167
+ }), (w, M) => (a(), l("div", {
168
+ class: g([
169
+ "xw-input-wrap",
170
+ `xw-input-wrap--${e.size}`,
171
+ { "xw-input-wrap--block": e.block }
172
+ ])
173
+ }, [
174
+ e.prepend || w.$slots.prepend ? (a(), l("span", he, [
175
+ I(w.$slots, "prepend", {}, () => [
176
+ F(p(e.prepend), 1)
177
+ ], !0)
178
+ ])) : x("", !0),
179
+ o("div", {
180
+ class: g([
181
+ "xw-input",
182
+ `xw-input--${e.size}`,
183
+ `xw-input--${e.status}`,
184
+ {
185
+ "xw-input--disabled": e.disabled,
186
+ "xw-input--readonly": e.readonly,
187
+ "xw-input--focused": c.value,
188
+ "xw-input--has-prefix": e.prefix || w.$slots.prefix,
189
+ "xw-input--has-suffix": e.suffix || w.$slots.suffix || e.clearable || e.showPassword || e.showCount,
190
+ "xw-input--prepend": e.prepend || w.$slots.prepend,
191
+ "xw-input--append": e.append || w.$slots.append
192
+ }
193
+ ])
194
+ }, [
195
+ e.prefix || w.$slots.prefix ? (a(), l("span", xe, [
196
+ I(w.$slots, "prefix", {}, () => [
197
+ F(p(e.prefix), 1)
198
+ ], !0)
199
+ ])) : x("", !0),
200
+ o("input", {
201
+ ref_key: "inputRef",
202
+ ref: i,
203
+ class: "xw-input__inner",
204
+ type: u.value,
205
+ value: e.modelValue,
206
+ placeholder: e.placeholder,
207
+ disabled: e.disabled,
208
+ readonly: e.readonly,
209
+ maxlength: e.maxlength,
210
+ autofocus: e.autofocus,
211
+ onInput: y,
212
+ onChange: h,
213
+ onFocus: f,
214
+ onBlur: _,
215
+ onKeydown: C,
216
+ onKeyup: b
217
+ }, null, 40, ye),
218
+ e.suffix || w.$slots.suffix || m.value || $.value || e.showCount ? (a(), l("span", be, [
219
+ e.showCount ? (a(), l("span", ge, [
220
+ F(p(v.value), 1),
221
+ e.maxlength ? (a(), l(z, { key: 0 }, [
222
+ F(" / " + p(e.maxlength), 1)
223
+ ], 64)) : x("", !0)
224
+ ])) : x("", !0),
225
+ m.value ? (a(), l("button", {
226
+ key: 1,
227
+ class: "xw-input__suffix-btn",
228
+ onClick: X(V, ["prevent"]),
229
+ tabindex: "-1",
230
+ type: "button"
231
+ }, " ✕ ")) : x("", !0),
232
+ $.value ? (a(), l("button", {
233
+ key: 2,
234
+ class: "xw-input__suffix-btn",
235
+ onClick: X(B, ["prevent"]),
236
+ tabindex: "-1",
237
+ type: "button"
238
+ }, p(d.value ? "🙈" : "👁"), 1)) : x("", !0),
239
+ I(w.$slots, "suffix", {}, () => [
240
+ F(p(e.suffix), 1)
241
+ ], !0)
242
+ ])) : x("", !0)
243
+ ], 2),
244
+ e.append || w.$slots.append ? (a(), l("span", ke, [
245
+ I(w.$slots, "append", {}, () => [
246
+ F(p(e.append), 1)
247
+ ], !0)
248
+ ])) : x("", !0),
249
+ e.hint ? (a(), l("div", {
250
+ key: 2,
251
+ class: g(["xw-input__hint", `xw-input__hint--${e.status}`])
252
+ }, p(e.hint), 3)) : x("", !0)
253
+ ], 2));
254
+ }
255
+ });
256
+ const T = (e, r) => {
257
+ const t = e.__vccOpts || e;
258
+ for (const [n, s] of r)
259
+ t[n] = s;
260
+ return t;
261
+ }, Ce = /* @__PURE__ */ T($e, [["__scopeId", "data-v-1752b784"]]), Ve = { class: "xw-checkbox__input-wrap" }, Be = ["checked", "disabled", "name"], Se = { class: "xw-checkbox__box" }, Te = {
262
+ key: 0,
263
+ class: "xw-checkbox__icon",
264
+ viewBox: "0 0 16 16"
265
+ }, Ie = {
266
+ key: 1,
267
+ class: "xw-checkbox__icon",
268
+ viewBox: "0 0 16 16"
269
+ }, ze = {
270
+ key: 0,
271
+ class: "xw-checkbox__label"
272
+ }, Me = /* @__PURE__ */ S({
273
+ __name: "Checkbox",
274
+ props: {
275
+ modelValue: { type: [Boolean, String, Number] },
276
+ trueValue: { type: [Boolean, String, Number], default: !0 },
277
+ falseValue: { type: [Boolean, String, Number], default: !1 },
278
+ size: { default: "medium" },
279
+ disabled: { type: Boolean, default: !1 },
280
+ readonly: { type: Boolean, default: !1 },
281
+ indeterminate: { type: Boolean, default: !1 },
282
+ label: {},
283
+ name: {}
284
+ },
285
+ emits: ["update:modelValue", "change"],
286
+ setup(e, { expose: r, emit: t }) {
287
+ const n = e, s = t, i = k(), c = R(() => n.modelValue === n.trueValue), d = (u) => {
288
+ if (n.disabled || n.readonly)
289
+ return;
290
+ const v = c.value ? n.falseValue : n.trueValue;
291
+ s("update:modelValue", v), s("change", v, u);
292
+ };
293
+ return r({
294
+ focus: () => {
295
+ var u;
296
+ return (u = i.value) == null ? void 0 : u.focus();
297
+ },
298
+ blur: () => {
299
+ var u;
300
+ return (u = i.value) == null ? void 0 : u.blur();
301
+ }
302
+ }), (u, v) => (a(), l("label", {
303
+ class: g([
304
+ "xw-checkbox",
305
+ `xw-checkbox--${e.size}`,
306
+ {
307
+ "xw-checkbox--checked": c.value,
308
+ "xw-checkbox--disabled": e.disabled,
309
+ "xw-checkbox--readonly": e.readonly,
310
+ "xw-checkbox--indeterminate": e.indeterminate
311
+ }
312
+ ])
313
+ }, [
314
+ o("span", Ve, [
315
+ o("input", {
316
+ ref_key: "inputRef",
317
+ ref: i,
318
+ type: "checkbox",
319
+ class: "xw-checkbox__input",
320
+ checked: c.value,
321
+ disabled: e.disabled || e.readonly,
322
+ name: e.name,
323
+ onChange: d
324
+ }, null, 40, Be),
325
+ o("span", Se, [
326
+ e.indeterminate ? (a(), l("svg", Te, [...v[0] || (v[0] = [
327
+ o("path", {
328
+ d: "M4 8h8",
329
+ stroke: "currentColor",
330
+ "stroke-width": "2",
331
+ "stroke-linecap": "round"
332
+ }, null, -1)
333
+ ])])) : (a(), l("svg", Ie, [...v[1] || (v[1] = [
334
+ o("path", {
335
+ d: "M3 8l3 3 7-7",
336
+ stroke: "currentColor",
337
+ "stroke-width": "2",
338
+ "stroke-linecap": "round",
339
+ "stroke-linejoin": "round",
340
+ fill: "none"
341
+ }, null, -1)
342
+ ])]))
343
+ ])
344
+ ]),
345
+ e.label || u.$slots.default ? (a(), l("span", ze, [
346
+ I(u.$slots, "default", {}, () => [
347
+ F(p(e.label), 1)
348
+ ], !0)
349
+ ])) : x("", !0)
350
+ ], 2));
351
+ }
352
+ });
353
+ const Le = /* @__PURE__ */ T(Me, [["__scopeId", "data-v-c0f86f5d"]]), Re = { class: "xw-radio__input-wrap" }, De = ["checked", "disabled", "name", "value"], Xe = {
354
+ key: 0,
355
+ class: "xw-radio__label"
356
+ }, Pe = /* @__PURE__ */ S({
357
+ __name: "Radio",
358
+ props: {
359
+ modelValue: { type: [String, Number, Boolean] },
360
+ value: { type: [String, Number, Boolean] },
361
+ size: { default: "medium" },
362
+ disabled: { type: Boolean, default: !1 },
363
+ label: {},
364
+ name: {}
365
+ },
366
+ emits: ["update:modelValue", "change"],
367
+ setup(e, { expose: r, emit: t }) {
368
+ const n = e, s = t, i = k(), c = R(() => n.modelValue === n.value), d = (u) => {
369
+ n.disabled || (s("update:modelValue", n.value), s("change", n.value, u));
370
+ };
371
+ return r({
372
+ focus: () => {
373
+ var u;
374
+ return (u = i.value) == null ? void 0 : u.focus();
375
+ },
376
+ blur: () => {
377
+ var u;
378
+ return (u = i.value) == null ? void 0 : u.blur();
379
+ }
380
+ }), (u, v) => (a(), l("label", {
381
+ class: g([
382
+ "xw-radio",
383
+ `xw-radio--${e.size}`,
384
+ {
385
+ "xw-radio--checked": c.value,
386
+ "xw-radio--disabled": e.disabled
387
+ }
388
+ ])
389
+ }, [
390
+ o("span", Re, [
391
+ o("input", {
392
+ ref_key: "inputRef",
393
+ ref: i,
394
+ type: "radio",
395
+ class: "xw-radio__input",
396
+ checked: c.value,
397
+ disabled: e.disabled,
398
+ name: e.name,
399
+ value: e.value,
400
+ onChange: d
401
+ }, null, 40, De),
402
+ v[0] || (v[0] = o("span", { class: "xw-radio__circle" }, [
403
+ o("span", { class: "xw-radio__dot" })
404
+ ], -1))
405
+ ]),
406
+ e.label || u.$slots.default ? (a(), l("span", Xe, [
407
+ I(u.$slots, "default", {}, () => [
408
+ F(p(e.label), 1)
409
+ ], !0)
410
+ ])) : x("", !0)
411
+ ], 2));
412
+ }
413
+ });
414
+ const Ee = /* @__PURE__ */ T(Pe, [["__scopeId", "data-v-819af824"]]), Ae = ["disabled"], Fe = { class: "xw-switch__track" }, Ne = {
415
+ key: 0,
416
+ class: "xw-switch__loading"
417
+ }, Ke = {
418
+ key: 1,
419
+ class: "xw-switch__icon"
420
+ }, Oe = {
421
+ key: 0,
422
+ class: "xw-switch__text"
423
+ }, Ue = /* @__PURE__ */ S({
424
+ __name: "Switch",
425
+ props: {
426
+ modelValue: { type: [Boolean, String, Number] },
427
+ activeValue: { type: [Boolean, String, Number], default: !0 },
428
+ inactiveValue: { type: [Boolean, String, Number], default: !1 },
429
+ size: { default: "medium" },
430
+ disabled: { type: Boolean, default: !1 },
431
+ loading: { type: Boolean, default: !1 },
432
+ checkedText: {},
433
+ uncheckedText: {},
434
+ checkedIcon: {},
435
+ uncheckedIcon: {},
436
+ beforeChange: {}
437
+ },
438
+ emits: ["update:modelValue", "change"],
439
+ setup(e, { emit: r }) {
440
+ const t = e, n = r, s = R(() => t.modelValue === t.activeValue), i = async () => {
441
+ if (t.disabled || t.loading)
442
+ return;
443
+ const c = s.value ? t.inactiveValue : t.activeValue;
444
+ t.beforeChange && await t.beforeChange(c) === !1 || (n("update:modelValue", c), n("change", c));
445
+ };
446
+ return (c, d) => (a(), l("button", {
447
+ class: g([
448
+ "xw-switch",
449
+ `xw-switch--${e.size}`,
450
+ {
451
+ "xw-switch--checked": s.value,
452
+ "xw-switch--disabled": e.disabled,
453
+ "xw-switch--loading": e.loading
454
+ }
455
+ ]),
456
+ disabled: e.disabled || e.loading,
457
+ onClick: i
458
+ }, [
459
+ o("span", Fe, [
460
+ e.loading ? (a(), l("span", Ne, [...d[0] || (d[0] = [
461
+ o("svg", { viewBox: "0 0 16 16" }, [
462
+ o("circle", {
463
+ cx: "8",
464
+ cy: "8",
465
+ r: "6",
466
+ fill: "none",
467
+ stroke: "currentColor",
468
+ "stroke-width": "2"
469
+ })
470
+ ], -1)
471
+ ])])) : e.checkedIcon || e.uncheckedIcon ? (a(), l("span", Ke, p(s.value ? e.checkedIcon : e.uncheckedIcon), 1)) : x("", !0),
472
+ d[1] || (d[1] = o("span", { class: "xw-switch__handle" }, null, -1))
473
+ ]),
474
+ e.checkedText || e.uncheckedText ? (a(), l("span", Oe, p(s.value ? e.checkedText : e.uncheckedText), 1)) : x("", !0)
475
+ ], 10, Ae));
476
+ }
477
+ });
478
+ const Ye = /* @__PURE__ */ T(Ue, [["__scopeId", "data-v-6f4c57c6"]]), qe = {
479
+ key: 0,
480
+ class: "xw-slider__tooltip"
481
+ }, We = {
482
+ key: 0,
483
+ class: "xw-slider__stops"
484
+ }, je = {
485
+ key: 0,
486
+ class: "xw-slider__input"
487
+ }, He = ["value", "min", "max", "step", "disabled"], Ge = /* @__PURE__ */ S({
488
+ __name: "Slider",
489
+ props: {
490
+ modelValue: { default: 0 },
491
+ min: { default: 0 },
492
+ max: { default: 100 },
493
+ step: { default: 1 },
494
+ size: { default: "medium" },
495
+ disabled: { type: Boolean, default: !1 },
496
+ showTooltip: { type: Boolean, default: !0 },
497
+ showStops: { type: Boolean, default: !1 },
498
+ showInput: { type: Boolean, default: !1 },
499
+ formatTooltip: {}
500
+ },
501
+ emits: ["update:modelValue", "change"],
502
+ setup(e, { emit: r }) {
503
+ const t = e, n = r, s = k(), i = k(t.modelValue), c = R(() => (i.value - t.min) / (t.max - t.min) * 100), d = R(() => {
504
+ if (!t.step)
505
+ return [];
506
+ const f = [], _ = (t.max - t.min) / t.step;
507
+ for (let C = 1; C < _; C++)
508
+ f.push(C / _ * 100);
509
+ return f;
510
+ }), u = (f) => {
511
+ f = Math.max(t.min, Math.min(t.max, f)), t.step && (f = Math.round((f - t.min) / t.step) * t.step + t.min), i.value = f, n("update:modelValue", f), n("change", f);
512
+ }, v = (f) => {
513
+ if (!s.value)
514
+ return t.min;
515
+ const _ = s.value.getBoundingClientRect(), C = (f - _.left) / _.width;
516
+ return t.min + C * (t.max - t.min);
517
+ }, m = (f) => {
518
+ if (t.disabled)
519
+ return;
520
+ const _ = v(f.clientX);
521
+ u(_);
522
+ }, $ = (f) => {
523
+ if (t.disabled)
524
+ return;
525
+ f.preventDefault();
526
+ const _ = (b) => {
527
+ const V = v(b.clientX);
528
+ u(V);
529
+ }, C = () => {
530
+ document.removeEventListener("mousemove", _), document.removeEventListener("mouseup", C);
531
+ };
532
+ document.addEventListener("mousemove", _), document.addEventListener("mouseup", C);
533
+ }, y = (f) => {
534
+ if (t.disabled)
535
+ return;
536
+ f.preventDefault();
537
+ const _ = (b) => {
538
+ const V = v(b.touches[0].clientX);
539
+ u(V);
540
+ }, C = () => {
541
+ document.removeEventListener("touchmove", _), document.removeEventListener("touchend", C);
542
+ };
543
+ document.addEventListener("touchmove", _), document.addEventListener("touchend", C);
544
+ }, h = (f) => {
545
+ const _ = Number(f.target.value);
546
+ u(_);
547
+ };
548
+ return (f, _) => (a(), l("div", {
549
+ class: g([
550
+ "xw-slider",
551
+ `xw-slider--${e.size}`,
552
+ {
553
+ "xw-slider--disabled": e.disabled
554
+ }
555
+ ])
556
+ }, [
557
+ o("div", {
558
+ ref_key: "sliderRef",
559
+ ref: s,
560
+ class: "xw-slider__rail",
561
+ onClick: m
562
+ }, [
563
+ o("div", {
564
+ class: "xw-slider__track",
565
+ style: N({ width: c.value + "%" })
566
+ }, null, 4),
567
+ o("div", {
568
+ class: "xw-slider__handle",
569
+ style: N({ left: c.value + "%" }),
570
+ onMousedown: $,
571
+ onTouchstart: y
572
+ }, [
573
+ e.showTooltip ? (a(), l("div", qe, p(e.formatTooltip ? e.formatTooltip(i.value) : i.value), 1)) : x("", !0)
574
+ ], 36),
575
+ e.showStops && e.step ? (a(), l("div", We, [
576
+ (a(!0), l(z, null, D(d.value, (C) => (a(), l("div", {
577
+ key: C,
578
+ class: "xw-slider__stop",
579
+ style: N({ left: C + "%" })
580
+ }, null, 4))), 128))
581
+ ])) : x("", !0)
582
+ ], 512),
583
+ e.showInput ? (a(), l("div", je, [
584
+ o("input", {
585
+ type: "number",
586
+ value: i.value,
587
+ min: e.min,
588
+ max: e.max,
589
+ step: e.step,
590
+ disabled: e.disabled,
591
+ onInput: h
592
+ }, null, 40, He)
593
+ ])) : x("", !0)
594
+ ], 2));
595
+ }
596
+ });
597
+ const Qe = /* @__PURE__ */ T(Ge, [["__scopeId", "data-v-53e2354a"]]), Je = ["aria-expanded", "aria-disabled", "aria-label", "onKeydown"], Ze = { class: "xw-select__input" }, et = {
598
+ key: 0,
599
+ class: "xw-select__tags"
600
+ }, tt = ["onClick"], at = ["placeholder", "disabled"], lt = {
601
+ key: 2,
602
+ class: "xw-select__text"
603
+ }, st = { class: "xw-select__suffix" }, nt = {
604
+ key: 0,
605
+ class: "xw-select__empty"
606
+ }, ot = ["aria-selected", "tabindex", "onClick", "onKeydown"], it = {
607
+ key: 0,
608
+ class: "xw-select__option-check"
609
+ }, ct = /* @__PURE__ */ S({
610
+ __name: "Select",
611
+ props: {
612
+ modelValue: {},
613
+ options: { default: () => [] },
614
+ size: { default: "medium" },
615
+ placeholder: { default: "请选择" },
616
+ disabled: { type: Boolean, default: !1 },
617
+ clearable: { type: Boolean, default: !1 },
618
+ filterable: { type: Boolean, default: !1 },
619
+ multiple: { type: Boolean, default: !1 },
620
+ multipleLimit: {}
621
+ },
622
+ emits: ["update:modelValue", "change", "clear"],
623
+ setup(e, { emit: r }) {
624
+ const t = e, n = r, s = k(), i = k(), c = k(), d = k(!1), u = k(""), v = k(0), m = R(() => {
625
+ if (!t.multiple)
626
+ return [];
627
+ const L = Array.isArray(t.modelValue) ? t.modelValue : [];
628
+ return t.options.filter((E) => L.includes(E.value));
629
+ }), $ = R(() => {
630
+ if (t.multiple)
631
+ return m.value.length ? "" : t.placeholder;
632
+ const L = t.options.find((E) => E.value === t.modelValue);
633
+ return (L == null ? void 0 : L.label) || "";
634
+ }), y = R(() => !t.filterable || !u.value ? t.options : t.options.filter(
635
+ (L) => L.label.toLowerCase().includes(u.value.toLowerCase())
636
+ )), h = (L) => t.multiple ? Array.isArray(t.modelValue) && t.modelValue.includes(L) : t.modelValue === L, f = () => {
637
+ t.disabled || (d.value = !d.value, d.value && (v.value = 0, t.filterable && setTimeout(() => {
638
+ var L;
639
+ return (L = i.value) == null ? void 0 : L.focus();
640
+ }, 0)));
641
+ }, _ = () => {
642
+ d.value = !1, u.value = "", v.value = 0;
643
+ }, C = async () => {
644
+ await te();
645
+ const L = c.value;
646
+ if (!L)
647
+ return;
648
+ const E = L.querySelector(".xw-select__option--active");
649
+ E && E.scrollIntoView({ block: "nearest" });
650
+ }, b = () => {
651
+ if (!d.value) {
652
+ d.value = !0;
653
+ return;
654
+ }
655
+ y.value.length && (v.value = (v.value + 1) % y.value.length, C());
656
+ }, V = () => {
657
+ if (!d.value) {
658
+ d.value = !0;
659
+ return;
660
+ }
661
+ y.value.length && (v.value = (v.value - 1 + y.value.length) % y.value.length, C());
662
+ }, B = () => {
663
+ if (!d.value) {
664
+ f();
665
+ return;
666
+ }
667
+ const L = y.value[v.value];
668
+ L && w(L);
669
+ }, w = (L) => {
670
+ if (!L.disabled)
671
+ if (t.multiple) {
672
+ const E = Array.isArray(t.modelValue) ? [...t.modelValue] : [], A = E.indexOf(L.value);
673
+ if (A > -1)
674
+ E.splice(A, 1);
675
+ else {
676
+ if (t.multipleLimit && E.length >= t.multipleLimit)
677
+ return;
678
+ E.push(L.value);
679
+ }
680
+ n("update:modelValue", E), n("change", E);
681
+ } else
682
+ n("update:modelValue", L.value), n("change", L.value), _();
683
+ }, M = (L) => {
684
+ if (!Array.isArray(t.modelValue))
685
+ return;
686
+ const E = t.modelValue.filter((A) => A !== L);
687
+ n("update:modelValue", E), n("change", E);
688
+ }, j = () => {
689
+ n("update:modelValue", t.multiple ? [] : ""), n("clear");
690
+ }, ie = () => {
691
+ d.value || (d.value = !0);
692
+ }, ae = (L) => {
693
+ s.value && !s.value.contains(L.target) && _();
694
+ };
695
+ return O(
696
+ () => d.value,
697
+ (L) => {
698
+ L && C();
699
+ }
700
+ ), U(() => {
701
+ document.addEventListener("click", ae);
702
+ }), Y(() => {
703
+ document.removeEventListener("click", ae);
704
+ }), (L, E) => (a(), l("div", {
705
+ ref_key: "selectRef",
706
+ ref: s,
707
+ class: g([
708
+ "xw-select",
709
+ `xw-select--${e.size}`,
710
+ {
711
+ "xw-select--disabled": e.disabled,
712
+ "xw-select--open": d.value,
713
+ "xw-select--multiple": e.multiple
714
+ }
715
+ ]),
716
+ tabindex: "0",
717
+ role: "combobox",
718
+ "aria-expanded": d.value,
719
+ "aria-disabled": e.disabled,
720
+ "aria-label": e.placeholder || "选择器",
721
+ onClick: f,
722
+ onKeydown: [
723
+ P(X(B, ["prevent"]), ["enter"]),
724
+ P(X(f, ["prevent"]), ["space"]),
725
+ P(_, ["esc"]),
726
+ P(X(b, ["prevent"]), ["down"]),
727
+ P(X(V, ["prevent"]), ["up"])
728
+ ]
729
+ }, [
730
+ o("div", Ze, [
731
+ e.multiple && m.value.length ? (a(), l("div", et, [
732
+ (a(!0), l(z, null, D(m.value, (A) => (a(), l("span", {
733
+ key: A.value,
734
+ class: "xw-select__tag"
735
+ }, [
736
+ F(p(A.label) + " ", 1),
737
+ o("span", {
738
+ class: "xw-select__tag-close",
739
+ onClick: X((Z) => M(A.value), ["stop"])
740
+ }, "✕", 8, tt)
741
+ ]))), 128))
742
+ ])) : x("", !0),
743
+ e.filterable ? K((a(), l("input", {
744
+ key: 1,
745
+ ref_key: "inputRef",
746
+ ref: i,
747
+ "onUpdate:modelValue": E[0] || (E[0] = (A) => u.value = A),
748
+ type: "text",
749
+ class: "xw-select__search",
750
+ placeholder: $.value || e.placeholder,
751
+ disabled: e.disabled,
752
+ onInput: ie,
753
+ onKeydown: P(_, ["esc"])
754
+ }, null, 40, at)), [
755
+ [q, u.value]
756
+ ]) : (a(), l("span", lt, p($.value || e.placeholder), 1)),
757
+ o("span", st, [
758
+ e.clearable && e.modelValue && !e.disabled ? (a(), l("span", {
759
+ key: 0,
760
+ class: "xw-select__clear",
761
+ onClick: X(j, ["stop"])
762
+ }, "✕")) : x("", !0),
763
+ o("span", {
764
+ class: g(["xw-select__arrow", { "xw-select__arrow--open": d.value }])
765
+ }, "▼", 2)
766
+ ])
767
+ ]),
768
+ H(J, { name: "xw-select-dropdown" }, {
769
+ default: G(() => [
770
+ K(o("div", {
771
+ ref_key: "dropdownRef",
772
+ ref: c,
773
+ class: "xw-select__dropdown"
774
+ }, [
775
+ y.value.length === 0 ? (a(), l("div", nt, " 暂无数据 ")) : x("", !0),
776
+ (a(!0), l(z, null, D(y.value, (A, Z) => (a(), l("div", {
777
+ key: A.value,
778
+ class: g([
779
+ "xw-select__option",
780
+ {
781
+ "xw-select__option--selected": h(A.value),
782
+ "xw-select__option--disabled": A.disabled,
783
+ "xw-select__option--active": Z === v.value
784
+ }
785
+ ]),
786
+ role: "option",
787
+ "aria-selected": h(A.value),
788
+ tabindex: Z === v.value ? 0 : -1,
789
+ onClick: X((ce) => w(A), ["stop"]),
790
+ onKeydown: P(X((ce) => w(A), ["prevent"]), ["enter"])
791
+ }, [
792
+ o("span", null, p(A.label), 1),
793
+ h(A.value) ? (a(), l("span", it, "✓")) : x("", !0)
794
+ ], 42, ot))), 128))
795
+ ], 512), [
796
+ [ne, d.value]
797
+ ])
798
+ ]),
799
+ _: 1
800
+ })
801
+ ], 42, Je));
802
+ }
803
+ });
804
+ const dt = /* @__PURE__ */ T(ct, [["__scopeId", "data-v-bcc5b59d"]]), ut = ["aria-label"], rt = {
805
+ key: 0,
806
+ class: "xw-modal__header"
807
+ }, _t = { class: "xw-modal__title" }, vt = { class: "xw-modal__body" }, ft = {
808
+ key: 1,
809
+ class: "xw-modal__footer"
810
+ }, pt = ["disabled"], mt = /* @__PURE__ */ S({
811
+ __name: "Modal",
812
+ props: {
813
+ visible: { type: Boolean, default: !1 },
814
+ title: {},
815
+ content: {},
816
+ size: { default: "medium" },
817
+ width: { default: 520 },
818
+ closable: { type: Boolean, default: !0 },
819
+ maskClosable: { type: Boolean, default: !0 },
820
+ showFooter: { type: Boolean, default: !0 },
821
+ okText: { default: "确定" },
822
+ cancelText: { default: "取消" },
823
+ loading: { type: Boolean, default: !1 }
824
+ },
825
+ emits: ["update:visible", "ok", "cancel", "close"],
826
+ setup(e, { emit: r }) {
827
+ const t = e, n = r, s = k(null), i = k(null), c = () => s.value ? Array.from(
828
+ s.value.querySelectorAll(
829
+ 'button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'
830
+ )
831
+ ) : [], d = () => {
832
+ var f;
833
+ (f = c()[0]) == null || f.focus();
834
+ }, u = () => {
835
+ var f;
836
+ const h = c();
837
+ (f = h[h.length - 1]) == null || f.focus();
838
+ }, v = () => {
839
+ n("update:visible", !1), n("close");
840
+ }, m = () => {
841
+ t.maskClosable && v();
842
+ }, $ = () => {
843
+ n("ok");
844
+ }, y = () => {
845
+ n("cancel"), v();
846
+ };
847
+ return O(
848
+ () => t.visible,
849
+ async (h) => {
850
+ var f, _;
851
+ if (h) {
852
+ i.value = document.activeElement, await te(), d();
853
+ return;
854
+ }
855
+ (_ = (f = i.value) == null ? void 0 : f.focus) == null || _.call(f);
856
+ }
857
+ ), (h, f) => (a(), W(Q, { to: "body" }, [
858
+ H(J, { name: "xw-modal-fade" }, {
859
+ default: G(() => [
860
+ e.visible ? (a(), l("div", {
861
+ key: 0,
862
+ class: "xw-modal-overlay",
863
+ onClick: m
864
+ }, [
865
+ H(J, { name: "xw-modal-zoom" }, {
866
+ default: G(() => [
867
+ e.visible ? (a(), l("div", {
868
+ key: 0,
869
+ ref_key: "modalRef",
870
+ ref: s,
871
+ class: g(["xw-modal", `xw-modal--${e.size}`]),
872
+ style: N({ width: typeof e.width == "number" ? e.width + "px" : e.width }),
873
+ role: "dialog",
874
+ "aria-modal": "true",
875
+ "aria-label": e.title || "弹窗",
876
+ tabindex: "-1",
877
+ onClick: f[0] || (f[0] = X(() => {
878
+ }, ["stop"])),
879
+ onKeydown: P(v, ["esc"])
880
+ }, [
881
+ o("span", {
882
+ tabindex: "0",
883
+ class: "xw-modal__sentinel",
884
+ onFocus: u
885
+ }, null, 32),
886
+ e.title || h.$slots.title ? (a(), l("div", rt, [
887
+ I(h.$slots, "title", {}, () => [
888
+ o("span", _t, p(e.title), 1)
889
+ ], !0),
890
+ e.closable ? (a(), l("button", {
891
+ key: 0,
892
+ type: "button",
893
+ class: "xw-modal__close",
894
+ "aria-label": "关闭弹窗",
895
+ onClick: v
896
+ }, "✕")) : x("", !0)
897
+ ])) : x("", !0),
898
+ o("div", vt, [
899
+ I(h.$slots, "default", {}, () => [
900
+ F(p(e.content), 1)
901
+ ], !0)
902
+ ]),
903
+ e.showFooter ? (a(), l("div", ft, [
904
+ I(h.$slots, "footer", {}, () => [
905
+ o("button", {
906
+ type: "button",
907
+ class: "xw-modal__btn xw-modal__btn--cancel",
908
+ onClick: y
909
+ }, p(e.cancelText), 1),
910
+ o("button", {
911
+ type: "button",
912
+ class: "xw-modal__btn xw-modal__btn--ok",
913
+ disabled: e.loading,
914
+ onClick: $
915
+ }, p(e.loading ? "加载中..." : e.okText), 9, pt)
916
+ ], !0)
917
+ ])) : x("", !0),
918
+ o("span", {
919
+ tabindex: "0",
920
+ class: "xw-modal__sentinel",
921
+ onFocus: d
922
+ }, null, 32)
923
+ ], 46, ut)) : x("", !0)
924
+ ]),
925
+ _: 3
926
+ })
927
+ ])) : x("", !0)
928
+ ]),
929
+ _: 3
930
+ })
931
+ ]));
932
+ }
933
+ });
934
+ const wt = /* @__PURE__ */ T(mt, [["__scopeId", "data-v-4f30207d"]]), ht = { class: "xw-toast__icon" }, xt = { class: "xw-toast__message" }, yt = ["onClick"], bt = /* @__PURE__ */ S({
935
+ __name: "Toast",
936
+ props: {
937
+ message: {},
938
+ type: { default: "info" },
939
+ duration: { default: 3e3 },
940
+ position: { default: "top" },
941
+ closable: { type: Boolean, default: !1 }
942
+ },
943
+ setup(e, { expose: r }) {
944
+ const t = k([]), n = (i) => ({
945
+ success: "✓",
946
+ error: "✕",
947
+ warning: "⚠",
948
+ info: "ℹ"
949
+ })[i], s = (i, c = "info", d = 3e3) => {
950
+ const u = Date.now().toString(), v = {
951
+ id: u,
952
+ message: i,
953
+ type: c,
954
+ visible: !0,
955
+ close: () => {
956
+ const m = t.value.findIndex(($) => $.id === u);
957
+ m > -1 && t.value.splice(m, 1);
958
+ }
959
+ };
960
+ return t.value.push(v), d > 0 && setTimeout(() => {
961
+ v.close();
962
+ }, d), v;
963
+ };
964
+ return r({
965
+ show: s,
966
+ success: (i, c) => s(i, "success", c),
967
+ error: (i, c) => s(i, "error", c),
968
+ warning: (i, c) => s(i, "warning", c),
969
+ info: (i, c) => s(i, "info", c)
970
+ }), (i, c) => (a(), W(Q, { to: "body" }, [
971
+ o("div", {
972
+ class: g(["xw-toast-container", `xw-toast-container--${e.position}`])
973
+ }, [
974
+ H(de, { name: "xw-toast" }, {
975
+ default: G(() => [
976
+ (a(!0), l(z, null, D(t.value, (d) => (a(), l("div", {
977
+ key: d.id,
978
+ class: g(["xw-toast", `xw-toast--${d.type}`])
979
+ }, [
980
+ o("span", ht, p(n(d.type)), 1),
981
+ o("span", xt, p(d.message), 1),
982
+ e.closable ? (a(), l("button", {
983
+ key: 0,
984
+ class: "xw-toast__close",
985
+ onClick: (u) => d.close()
986
+ }, "✕", 8, yt)) : x("", !0)
987
+ ], 2))), 128))
988
+ ]),
989
+ _: 1
990
+ })
991
+ ], 2)
992
+ ]));
993
+ }
994
+ });
995
+ const gt = /* @__PURE__ */ T(bt, [["__scopeId", "data-v-3420930e"]]), kt = ["aria-describedby", "onKeydown"], $t = { class: "xw-tooltip__content" }, Ct = /* @__PURE__ */ S({
996
+ __name: "Tooltip",
997
+ props: {
998
+ content: {},
999
+ placement: { default: "top" },
1000
+ trigger: { default: "hover" },
1001
+ disabled: { type: Boolean, default: !1 },
1002
+ showDelay: { default: 100 },
1003
+ hideDelay: { default: 100 }
1004
+ },
1005
+ setup(e) {
1006
+ const r = e, t = k(), n = k(), s = k(!1), i = `xw-tooltip-${Math.random().toString(36).slice(2, 9)}`;
1007
+ let c = null, d = null;
1008
+ const u = k({
1009
+ top: "0px",
1010
+ left: "0px"
1011
+ }), v = () => {
1012
+ if (!t.value || !n.value)
1013
+ return;
1014
+ const b = t.value.getBoundingClientRect(), V = n.value.getBoundingClientRect();
1015
+ let B = 0, w = 0;
1016
+ switch (r.placement) {
1017
+ case "top":
1018
+ B = b.top - V.height - 8, w = b.left + (b.width - V.width) / 2;
1019
+ break;
1020
+ case "top-start":
1021
+ B = b.top - V.height - 8, w = b.left;
1022
+ break;
1023
+ case "top-end":
1024
+ B = b.top - V.height - 8, w = b.right - V.width;
1025
+ break;
1026
+ case "bottom":
1027
+ B = b.bottom + 8, w = b.left + (b.width - V.width) / 2;
1028
+ break;
1029
+ case "bottom-start":
1030
+ B = b.bottom + 8, w = b.left;
1031
+ break;
1032
+ case "bottom-end":
1033
+ B = b.bottom + 8, w = b.right - V.width;
1034
+ break;
1035
+ case "left":
1036
+ B = b.top + (b.height - V.height) / 2, w = b.left - V.width - 8;
1037
+ break;
1038
+ case "right":
1039
+ B = b.top + (b.height - V.height) / 2, w = b.right + 8;
1040
+ break;
1041
+ }
1042
+ u.value = {
1043
+ top: `${B}px`,
1044
+ left: `${w}px`
1045
+ };
1046
+ }, m = () => {
1047
+ d && (clearTimeout(d), d = null), c = window.setTimeout(() => {
1048
+ s.value = !0, setTimeout(v, 0);
1049
+ }, r.showDelay);
1050
+ }, $ = () => {
1051
+ c && (clearTimeout(c), c = null), d = window.setTimeout(() => {
1052
+ s.value = !1;
1053
+ }, r.hideDelay);
1054
+ }, y = () => {
1055
+ r.trigger === "hover" && m();
1056
+ }, h = () => {
1057
+ r.trigger === "hover" && $();
1058
+ }, f = () => {
1059
+ r.trigger === "click" && (s.value ? $() : m());
1060
+ }, _ = () => {
1061
+ r.trigger === "focus" && m();
1062
+ }, C = () => {
1063
+ r.trigger === "focus" && $();
1064
+ };
1065
+ return U(() => {
1066
+ window.addEventListener("scroll", v, !0), window.addEventListener("resize", v);
1067
+ }), Y(() => {
1068
+ window.removeEventListener("scroll", v, !0), window.removeEventListener("resize", v), c && clearTimeout(c), d && clearTimeout(d);
1069
+ }), (b, V) => (a(), l(z, null, [
1070
+ o("div", {
1071
+ ref_key: "triggerRef",
1072
+ ref: t,
1073
+ class: "xw-tooltip-trigger",
1074
+ role: "button",
1075
+ tabindex: "0",
1076
+ "aria-describedby": s.value ? i : void 0,
1077
+ onMouseenter: y,
1078
+ onMouseleave: h,
1079
+ onClick: f,
1080
+ onFocus: _,
1081
+ onBlur: C,
1082
+ onKeydown: [
1083
+ P(X(f, ["prevent"]), ["enter"]),
1084
+ P(X(f, ["prevent"]), ["space"]),
1085
+ P(X($, ["prevent"]), ["esc"])
1086
+ ]
1087
+ }, [
1088
+ I(b.$slots, "default", {}, void 0, !0)
1089
+ ], 40, kt),
1090
+ (a(), W(Q, { to: "body" }, [
1091
+ H(J, { name: "xw-tooltip-fade" }, {
1092
+ default: G(() => [
1093
+ s.value && !e.disabled ? (a(), l("div", {
1094
+ key: 0,
1095
+ id: i,
1096
+ ref_key: "tooltipRef",
1097
+ ref: n,
1098
+ class: g(["xw-tooltip", `xw-tooltip--${e.placement}`]),
1099
+ style: N(u.value),
1100
+ role: "tooltip"
1101
+ }, [
1102
+ o("div", $t, [
1103
+ I(b.$slots, "content", {}, () => [
1104
+ F(p(e.content), 1)
1105
+ ], !0)
1106
+ ]),
1107
+ V[0] || (V[0] = o("div", { class: "xw-tooltip__arrow" }, null, -1))
1108
+ ], 6)) : x("", !0)
1109
+ ]),
1110
+ _: 3
1111
+ })
1112
+ ]))
1113
+ ], 64));
1114
+ }
1115
+ });
1116
+ const Vt = /* @__PURE__ */ T(Ct, [["__scopeId", "data-v-28fa0e4c"]]), Bt = { class: "xw-loading__spinner" }, St = {
1117
+ key: 0,
1118
+ viewBox: "0 0 50 50",
1119
+ class: "xw-loading__svg"
1120
+ }, Tt = {
1121
+ key: 1,
1122
+ class: "xw-loading__dots"
1123
+ }, It = {
1124
+ key: 2,
1125
+ class: "xw-loading__bars"
1126
+ }, zt = {
1127
+ key: 0,
1128
+ class: "xw-loading__text"
1129
+ }, Mt = /* @__PURE__ */ S({
1130
+ __name: "Loading",
1131
+ props: {
1132
+ visible: { type: Boolean, default: !0 },
1133
+ type: { default: "spinner" },
1134
+ text: {},
1135
+ fullscreen: { type: Boolean, default: !1 }
1136
+ },
1137
+ setup(e) {
1138
+ return (r, t) => e.visible ? (a(), l("div", {
1139
+ key: 0,
1140
+ class: g(["xw-loading", { "xw-loading--fullscreen": e.fullscreen }])
1141
+ }, [
1142
+ o("div", Bt, [
1143
+ e.type === "spinner" ? (a(), l("svg", St, [...t[0] || (t[0] = [
1144
+ o("circle", {
1145
+ cx: "25",
1146
+ cy: "25",
1147
+ r: "20",
1148
+ fill: "none",
1149
+ stroke: "currentColor",
1150
+ "stroke-width": "4"
1151
+ }, null, -1)
1152
+ ])])) : e.type === "dots" ? (a(), l("div", Tt, [...t[1] || (t[1] = [
1153
+ o("span", null, null, -1),
1154
+ o("span", null, null, -1),
1155
+ o("span", null, null, -1)
1156
+ ])])) : e.type === "bars" ? (a(), l("div", It, [...t[2] || (t[2] = [
1157
+ o("span", null, null, -1),
1158
+ o("span", null, null, -1),
1159
+ o("span", null, null, -1),
1160
+ o("span", null, null, -1),
1161
+ o("span", null, null, -1)
1162
+ ])])) : x("", !0)
1163
+ ]),
1164
+ e.text ? (a(), l("div", zt, p(e.text), 1)) : x("", !0)
1165
+ ], 2)) : x("", !0);
1166
+ }
1167
+ });
1168
+ const Lt = /* @__PURE__ */ T(Mt, [["__scopeId", "data-v-6b053ae2"]]), Rt = { class: "xw-tabs__nav" }, Dt = ["onClick"], Xt = { class: "xw-tabs__tab-label" }, Pt = ["onClick"], Et = { class: "xw-tabs__content" }, At = /* @__PURE__ */ S({
1169
+ __name: "Tabs",
1170
+ props: {
1171
+ modelValue: {},
1172
+ items: { default: () => [] },
1173
+ type: { default: "line" },
1174
+ closable: { type: Boolean, default: !1 }
1175
+ },
1176
+ emits: ["update:modelValue", "change", "close"],
1177
+ setup(e, { emit: r }) {
1178
+ const t = e, n = r, s = k({
1179
+ width: "0px",
1180
+ transform: "translateX(0px)"
1181
+ }), i = (u) => {
1182
+ u.disabled || (n("update:modelValue", u.key), n("change", u.key));
1183
+ }, c = (u) => {
1184
+ n("close", u);
1185
+ }, d = () => {
1186
+ t.type === "line" && te(() => {
1187
+ const u = t.items.findIndex(($) => $.key === t.modelValue);
1188
+ if (u === -1)
1189
+ return;
1190
+ const m = document.querySelectorAll(".xw-tabs__tab")[u];
1191
+ m && (s.value = {
1192
+ width: `${m.offsetWidth}px`,
1193
+ transform: `translateX(${m.offsetLeft}px)`
1194
+ });
1195
+ });
1196
+ };
1197
+ return O(() => t.modelValue, d, { immediate: !0 }), O(() => t.items, d, { deep: !0 }), (u, v) => (a(), l("div", {
1198
+ class: g(["xw-tabs", `xw-tabs--${e.type}`])
1199
+ }, [
1200
+ o("div", Rt, [
1201
+ (a(!0), l(z, null, D(e.items, (m) => (a(), l("div", {
1202
+ key: m.key,
1203
+ class: g([
1204
+ "xw-tabs__tab",
1205
+ {
1206
+ "xw-tabs__tab--active": e.modelValue === m.key,
1207
+ "xw-tabs__tab--disabled": m.disabled
1208
+ }
1209
+ ]),
1210
+ onClick: ($) => i(m)
1211
+ }, [
1212
+ o("span", Xt, p(m.label), 1),
1213
+ (e.closable || m.closable) && !m.disabled ? (a(), l("button", {
1214
+ key: 0,
1215
+ class: "xw-tabs__tab-close",
1216
+ onClick: X(($) => c(m.key), ["stop"])
1217
+ }, " ✕ ", 8, Pt)) : x("", !0)
1218
+ ], 10, Dt))), 128)),
1219
+ e.type === "line" ? (a(), l("div", {
1220
+ key: 0,
1221
+ class: "xw-tabs__indicator",
1222
+ style: N(s.value)
1223
+ }, null, 4)) : x("", !0)
1224
+ ]),
1225
+ o("div", Et, [
1226
+ I(u.$slots, "default", {}, void 0, !0)
1227
+ ])
1228
+ ], 2));
1229
+ }
1230
+ });
1231
+ const Ft = /* @__PURE__ */ T(At, [["__scopeId", "data-v-ef13e5f3"]]), Nt = { class: "xw-breadcrumb" }, Kt = ["href", "onClick"], Ot = {
1232
+ key: 2,
1233
+ class: "xw-breadcrumb__separator"
1234
+ }, Ut = /* @__PURE__ */ S({
1235
+ __name: "Breadcrumb",
1236
+ props: {
1237
+ items: { default: () => [] },
1238
+ separator: { default: "/" }
1239
+ },
1240
+ emits: ["click"],
1241
+ setup(e, { emit: r }) {
1242
+ const t = r, n = (s, i, c) => {
1243
+ i.to && (s.preventDefault(), t("click", i, c));
1244
+ };
1245
+ return (s, i) => (a(), l("nav", Nt, [
1246
+ (a(!0), l(z, null, D(e.items, (c, d) => (a(), l("span", {
1247
+ key: d,
1248
+ class: "xw-breadcrumb__item"
1249
+ }, [
1250
+ c.href || c.to ? (a(), l("a", {
1251
+ key: 0,
1252
+ class: g(["xw-breadcrumb__link", { "xw-breadcrumb__link--active": d === e.items.length - 1 }]),
1253
+ href: c.href,
1254
+ onClick: (u) => n(u, c, d)
1255
+ }, p(c.label), 11, Kt)) : (a(), l("span", {
1256
+ key: 1,
1257
+ class: g(["xw-breadcrumb__text", { "xw-breadcrumb__text--active": d === e.items.length - 1 }])
1258
+ }, p(c.label), 3)),
1259
+ d < e.items.length - 1 ? (a(), l("span", Ot, p(e.separator), 1)) : x("", !0)
1260
+ ]))), 128))
1261
+ ]));
1262
+ }
1263
+ });
1264
+ const Yt = /* @__PURE__ */ T(Ut, [["__scopeId", "data-v-558f094d"]]), qt = {
1265
+ key: 0,
1266
+ class: "xw-pagination__total"
1267
+ }, Wt = ["disabled"], jt = { class: "xw-pagination__simple-pager" }, Ht = ["disabled"], Gt = ["disabled"], Qt = ["disabled"], Jt = ["disabled", "onClick"], Zt = ["disabled"], ea = ["disabled"], ta = ["value"], aa = /* @__PURE__ */ S({
1268
+ __name: "Pagination",
1269
+ props: {
1270
+ modelValue: { default: 1 },
1271
+ total: { default: 0 },
1272
+ pageSize: { default: 10 },
1273
+ pagerCount: { default: 7 },
1274
+ showTotal: { type: Boolean, default: !0 },
1275
+ showSizeChanger: { type: Boolean, default: !1 },
1276
+ pageSizes: { default: () => [10, 20, 50, 100] },
1277
+ simple: { type: Boolean, default: !1 },
1278
+ disabled: { type: Boolean, default: !1 }
1279
+ },
1280
+ emits: ["update:modelValue", "change", "update:pageSize"],
1281
+ setup(e, { emit: r }) {
1282
+ const t = e, n = r, s = k(t.modelValue), i = k(t.pageSize), c = k(t.modelValue), d = R(() => Math.ceil(t.total / i.value) || 1), u = R(() => {
1283
+ const _ = [], C = Math.floor(t.pagerCount / 2);
1284
+ let b = Math.max(1, s.value - C), V = Math.min(d.value, b + t.pagerCount - 1);
1285
+ V - b < t.pagerCount - 1 && (b = Math.max(1, V - t.pagerCount + 1)), b > 1 && (_.push(1), b > 2 && _.push(-1));
1286
+ for (let B = b; B <= V; B++)
1287
+ _.push(B);
1288
+ return V < d.value && (V < d.value - 1 && _.push(-1), _.push(d.value)), _;
1289
+ }), v = (_) => {
1290
+ _ === -1 || _ === s.value || t.disabled || y(_);
1291
+ }, m = () => {
1292
+ s.value > 1 && y(s.value - 1);
1293
+ }, $ = () => {
1294
+ s.value < d.value && y(s.value + 1);
1295
+ }, y = (_) => {
1296
+ s.value = _, c.value = _, n("update:modelValue", _), n("change", _, i.value);
1297
+ }, h = () => {
1298
+ let _ = c.value;
1299
+ _ < 1 && (_ = 1), _ > d.value && (_ = d.value), c.value = _, _ !== s.value && y(_);
1300
+ }, f = () => {
1301
+ n("update:pageSize", i.value);
1302
+ const _ = Math.ceil(t.total / i.value);
1303
+ s.value > _ ? y(1) : n("change", s.value, i.value);
1304
+ };
1305
+ return O(() => t.modelValue, (_) => {
1306
+ s.value = _, c.value = _;
1307
+ }), O(() => t.pageSize, (_) => {
1308
+ i.value = _;
1309
+ }), (_, C) => (a(), l("div", {
1310
+ class: g(["xw-pagination", { "xw-pagination--simple": e.simple, "xw-pagination--disabled": e.disabled }])
1311
+ }, [
1312
+ e.showTotal && !e.simple ? (a(), l("span", qt, " 共 " + p(e.total) + " 条 ", 1)) : x("", !0),
1313
+ e.simple ? (a(), l(z, { key: 1 }, [
1314
+ o("button", {
1315
+ class: "xw-pagination__btn",
1316
+ disabled: s.value === 1 || e.disabled,
1317
+ onClick: m
1318
+ }, " ‹ ", 8, Wt),
1319
+ o("span", jt, [
1320
+ K(o("input", {
1321
+ "onUpdate:modelValue": C[0] || (C[0] = (b) => c.value = b),
1322
+ type: "number",
1323
+ class: "xw-pagination__simple-input",
1324
+ disabled: e.disabled,
1325
+ onBlur: h,
1326
+ onKeyup: P(h, ["enter"])
1327
+ }, null, 40, Ht), [
1328
+ [
1329
+ q,
1330
+ c.value,
1331
+ void 0,
1332
+ { number: !0 }
1333
+ ]
1334
+ ]),
1335
+ C[2] || (C[2] = o("span", { class: "xw-pagination__simple-separator" }, "/", -1)),
1336
+ o("span", null, p(d.value), 1)
1337
+ ]),
1338
+ o("button", {
1339
+ class: "xw-pagination__btn",
1340
+ disabled: s.value === d.value || e.disabled,
1341
+ onClick: $
1342
+ }, " › ", 8, Gt)
1343
+ ], 64)) : (a(), l(z, { key: 2 }, [
1344
+ o("button", {
1345
+ class: "xw-pagination__btn",
1346
+ disabled: s.value === 1 || e.disabled,
1347
+ onClick: m
1348
+ }, " ‹ ", 8, Qt),
1349
+ (a(!0), l(z, null, D(u.value, (b) => (a(), l("button", {
1350
+ key: b,
1351
+ class: g(["xw-pagination__pager", { "xw-pagination__pager--active": b === s.value }]),
1352
+ disabled: e.disabled,
1353
+ onClick: (V) => v(b)
1354
+ }, p(b === -1 ? "..." : b), 11, Jt))), 128)),
1355
+ o("button", {
1356
+ class: "xw-pagination__btn",
1357
+ disabled: s.value === d.value || e.disabled,
1358
+ onClick: $
1359
+ }, " › ", 8, Zt)
1360
+ ], 64)),
1361
+ e.showSizeChanger && !e.simple ? K((a(), l("select", {
1362
+ key: 3,
1363
+ "onUpdate:modelValue": C[1] || (C[1] = (b) => i.value = b),
1364
+ class: "xw-pagination__size-select",
1365
+ disabled: e.disabled,
1366
+ onChange: f
1367
+ }, [
1368
+ (a(!0), l(z, null, D(e.pageSizes, (b) => (a(), l("option", {
1369
+ key: b,
1370
+ value: b
1371
+ }, p(b) + " 条/页 ", 9, ta))), 128))
1372
+ ], 40, ea)), [
1373
+ [
1374
+ ue,
1375
+ i.value,
1376
+ void 0,
1377
+ { number: !0 }
1378
+ ]
1379
+ ]) : x("", !0)
1380
+ ], 2));
1381
+ }
1382
+ });
1383
+ const la = /* @__PURE__ */ T(aa, [["__scopeId", "data-v-fdd60bca"]]), sa = ["href", "target"], na = {
1384
+ key: 0,
1385
+ class: "xw-link__icon"
1386
+ }, oa = { class: "xw-link__text" }, ia = /* @__PURE__ */ S({
1387
+ __name: "Link",
1388
+ props: {
1389
+ href: {},
1390
+ type: { default: "default" },
1391
+ disabled: { type: Boolean, default: !1 },
1392
+ underline: { type: Boolean, default: !0 },
1393
+ icon: {},
1394
+ target: {}
1395
+ },
1396
+ emits: ["click"],
1397
+ setup(e, { emit: r }) {
1398
+ const t = e, n = r, s = (i) => {
1399
+ if (t.disabled) {
1400
+ i.preventDefault();
1401
+ return;
1402
+ }
1403
+ n("click", i);
1404
+ };
1405
+ return (i, c) => (a(), l("a", {
1406
+ class: g([
1407
+ "xw-link",
1408
+ `xw-link--${e.type}`,
1409
+ {
1410
+ "xw-link--disabled": e.disabled,
1411
+ "xw-link--underline": e.underline
1412
+ }
1413
+ ]),
1414
+ href: e.disabled ? void 0 : e.href,
1415
+ target: e.target,
1416
+ onClick: s
1417
+ }, [
1418
+ e.icon || i.$slots.icon ? (a(), l("span", na, [
1419
+ I(i.$slots, "icon", {}, () => [
1420
+ F(p(e.icon), 1)
1421
+ ], !0)
1422
+ ])) : x("", !0),
1423
+ o("span", oa, [
1424
+ I(i.$slots, "default", {}, void 0, !0)
1425
+ ])
1426
+ ], 10, sa));
1427
+ }
1428
+ });
1429
+ const ca = /* @__PURE__ */ T(ia, [["__scopeId", "data-v-fe2e0b00"]]), da = /* @__PURE__ */ S({
1430
+ __name: "Space",
1431
+ props: {
1432
+ direction: { default: "horizontal" },
1433
+ size: { default: "small" },
1434
+ align: { default: "start" },
1435
+ wrap: { type: Boolean, default: !1 }
1436
+ },
1437
+ setup(e) {
1438
+ const r = e, t = oe(), n = R(() => {
1439
+ var d;
1440
+ return ((d = t.default) == null ? void 0 : d.call(t)) || [];
1441
+ }), s = {
1442
+ small: "8px",
1443
+ medium: "16px",
1444
+ large: "24px"
1445
+ }, i = R(() => ({
1446
+ gap: typeof r.size == "number" ? `${r.size}px` : s[r.size],
1447
+ flexWrap: r.wrap ? "wrap" : "nowrap"
1448
+ }));
1449
+ return (c, d) => (a(), l("div", {
1450
+ class: g(["xw-space", `xw-space--${e.direction}`, `xw-space--${e.align}`]),
1451
+ style: N(i.value)
1452
+ }, [
1453
+ (a(!0), l(z, null, D(n.value, (u, v) => (a(), l("div", {
1454
+ key: v,
1455
+ class: "xw-space__item"
1456
+ }, [
1457
+ (a(), W(re(() => u)))
1458
+ ]))), 128))
1459
+ ], 6));
1460
+ }
1461
+ });
1462
+ const ua = /* @__PURE__ */ T(da, [["__scopeId", "data-v-013cfe48"]]), ra = /* @__PURE__ */ S({
1463
+ __name: "Divider",
1464
+ props: {
1465
+ direction: { default: "horizontal" },
1466
+ dashed: { type: Boolean, default: !1 },
1467
+ contentPosition: { default: "center" }
1468
+ },
1469
+ setup(e) {
1470
+ return (r, t) => (a(), l("div", {
1471
+ class: g([
1472
+ "xw-divider",
1473
+ `xw-divider--${e.direction}`,
1474
+ {
1475
+ "xw-divider--dashed": e.dashed,
1476
+ "xw-divider--with-text": r.$slots.default
1477
+ }
1478
+ ])
1479
+ }, [
1480
+ r.$slots.default && e.direction === "horizontal" ? (a(), l("span", {
1481
+ key: 0,
1482
+ class: g(["xw-divider__text", `xw-divider__text--${e.contentPosition}`])
1483
+ }, [
1484
+ I(r.$slots, "default", {}, void 0, !0)
1485
+ ], 2)) : x("", !0)
1486
+ ], 2));
1487
+ }
1488
+ });
1489
+ const _a = /* @__PURE__ */ T(ra, [["__scopeId", "data-v-ad30380c"]]), va = { class: "xw-tag__text" }, fa = /* @__PURE__ */ S({
1490
+ __name: "Tag",
1491
+ props: {
1492
+ type: { default: "default" },
1493
+ size: { default: "medium" },
1494
+ closable: { type: Boolean, default: !1 },
1495
+ round: { type: Boolean, default: !1 }
1496
+ },
1497
+ emits: ["close"],
1498
+ setup(e, { emit: r }) {
1499
+ const t = r, n = (s) => {
1500
+ t("close", s);
1501
+ };
1502
+ return (s, i) => (a(), l("span", {
1503
+ class: g([
1504
+ "xw-tag",
1505
+ `xw-tag--${e.type}`,
1506
+ `xw-tag--${e.size}`,
1507
+ {
1508
+ "xw-tag--closable": e.closable,
1509
+ "xw-tag--round": e.round
1510
+ }
1511
+ ])
1512
+ }, [
1513
+ o("span", va, [
1514
+ I(s.$slots, "default", {}, void 0, !0)
1515
+ ]),
1516
+ e.closable ? (a(), l("button", {
1517
+ key: 0,
1518
+ class: "xw-tag__close",
1519
+ onClick: n
1520
+ }, " ✕ ")) : x("", !0)
1521
+ ], 2));
1522
+ }
1523
+ });
1524
+ const pa = /* @__PURE__ */ T(fa, [["__scopeId", "data-v-3238731b"]]), ma = { class: "xw-badge" }, wa = /* @__PURE__ */ S({
1525
+ __name: "Badge",
1526
+ props: {
1527
+ value: {},
1528
+ type: { default: "danger" },
1529
+ dot: { type: Boolean, default: !1 },
1530
+ hidden: { type: Boolean, default: !1 },
1531
+ max: { default: 99 }
1532
+ },
1533
+ setup(e) {
1534
+ const r = e, t = R(() => r.dot ? "" : typeof r.value == "number" && r.value > r.max ? `${r.max}+` : r.value);
1535
+ return (n, s) => (a(), l("span", ma, [
1536
+ I(n.$slots, "default", {}, void 0, !0),
1537
+ !e.hidden && (e.value || e.dot) ? (a(), l("sup", {
1538
+ key: 0,
1539
+ class: g([
1540
+ "xw-badge__content",
1541
+ `xw-badge__content--${e.type}`,
1542
+ {
1543
+ "xw-badge__content--dot": e.dot,
1544
+ "xw-badge__content--fixed": n.$slots.default
1545
+ }
1546
+ ])
1547
+ }, p(t.value), 3)) : x("", !0)
1548
+ ]));
1549
+ }
1550
+ });
1551
+ const ha = /* @__PURE__ */ T(wa, [["__scopeId", "data-v-7a548ac0"]]), xa = ["onClick", "onMouseenter"], ya = { class: "xw-rate__icon" }, ba = {
1552
+ key: 0,
1553
+ class: "xw-rate__text"
1554
+ }, ga = /* @__PURE__ */ S({
1555
+ __name: "Rate",
1556
+ props: {
1557
+ modelValue: { default: 0 },
1558
+ max: { default: 5 },
1559
+ disabled: { type: Boolean, default: !1 },
1560
+ allowHalf: { type: Boolean, default: !1 },
1561
+ showText: { type: Boolean, default: !1 },
1562
+ icon: { default: "★" },
1563
+ texts: { default: () => [] }
1564
+ },
1565
+ emits: ["update:modelValue", "change"],
1566
+ setup(e, { emit: r }) {
1567
+ const t = e, n = r, s = k(t.modelValue), i = k(-1), c = (v) => {
1568
+ if (t.disabled)
1569
+ return;
1570
+ const m = v + 1;
1571
+ s.value = m, n("update:modelValue", m), n("change", m);
1572
+ }, d = (v) => {
1573
+ t.disabled || (i.value = v + 1, s.value = i.value);
1574
+ }, u = () => {
1575
+ t.disabled || (i.value = -1, s.value = t.modelValue);
1576
+ };
1577
+ return O(() => t.modelValue, (v) => {
1578
+ s.value = v;
1579
+ }), (v, m) => (a(), l("div", {
1580
+ class: g(["xw-rate", { "xw-rate--disabled": e.disabled }])
1581
+ }, [
1582
+ (a(!0), l(z, null, D(e.max, ($, y) => (a(), l("span", {
1583
+ key: y,
1584
+ class: g(["xw-rate__item", { "xw-rate__item--active": y < s.value }]),
1585
+ onClick: (h) => c(y),
1586
+ onMouseenter: (h) => d(y),
1587
+ onMouseleave: u
1588
+ }, [
1589
+ o("span", ya, p(e.icon), 1)
1590
+ ], 42, xa))), 128)),
1591
+ e.showText ? (a(), l("span", ba, p(e.texts[s.value] || s.value), 1)) : x("", !0)
1592
+ ], 2));
1593
+ }
1594
+ });
1595
+ const ka = /* @__PURE__ */ T(ga, [["__scopeId", "data-v-51af6294"]]), $a = ["disabled"], Ca = ["placeholder", "disabled", "onKeydown"], Va = ["disabled"], Ba = /* @__PURE__ */ S({
1596
+ __name: "InputNumber",
1597
+ props: {
1598
+ modelValue: {},
1599
+ min: {},
1600
+ max: {},
1601
+ step: { default: 1 },
1602
+ precision: {},
1603
+ size: { default: "medium" },
1604
+ disabled: { type: Boolean, default: !1 },
1605
+ placeholder: {}
1606
+ },
1607
+ emits: ["update:modelValue", "change", "blur", "focus"],
1608
+ setup(e, { emit: r }) {
1609
+ const t = e, n = r, s = k(""), i = R(() => t.min === void 0 ? !1 : (t.modelValue ?? 0) <= t.min), c = R(() => t.max === void 0 ? !1 : (t.modelValue ?? 0) >= t.max), d = (f) => t.precision !== void 0 ? Number(f.toFixed(t.precision)) : f, u = (f) => {
1610
+ if (f === void 0) {
1611
+ n("update:modelValue", void 0), n("change", void 0);
1612
+ return;
1613
+ }
1614
+ let _ = f;
1615
+ t.min !== void 0 && _ < t.min && (_ = t.min), t.max !== void 0 && _ > t.max && (_ = t.max), _ = d(_), n("update:modelValue", _), n("change", _);
1616
+ }, v = () => {
1617
+ if (t.disabled || c.value)
1618
+ return;
1619
+ const f = t.modelValue ?? 0;
1620
+ u(f + t.step);
1621
+ }, m = () => {
1622
+ if (t.disabled || i.value)
1623
+ return;
1624
+ const f = t.modelValue ?? 0;
1625
+ u(f - t.step);
1626
+ }, $ = (f) => {
1627
+ const _ = f.target.value;
1628
+ s.value = _;
1629
+ }, y = (f) => {
1630
+ const _ = s.value;
1631
+ if (_ === "" || _ === "-")
1632
+ u(void 0);
1633
+ else {
1634
+ const C = Number(_);
1635
+ isNaN(C) || u(C);
1636
+ }
1637
+ n("blur", f);
1638
+ }, h = (f) => {
1639
+ n("focus", f);
1640
+ };
1641
+ return O(() => t.modelValue, (f) => {
1642
+ s.value = f === void 0 ? "" : String(f);
1643
+ }, { immediate: !0 }), (f, _) => (a(), l("div", {
1644
+ class: g(["xw-input-number", `xw-input-number--${e.size}`, { "xw-input-number--disabled": e.disabled }])
1645
+ }, [
1646
+ o("button", {
1647
+ class: "xw-input-number__btn xw-input-number__decrease",
1648
+ disabled: e.disabled || i.value,
1649
+ onClick: m
1650
+ }, " − ", 8, $a),
1651
+ K(o("input", {
1652
+ ref: "inputRef",
1653
+ "onUpdate:modelValue": _[0] || (_[0] = (C) => s.value = C),
1654
+ type: "text",
1655
+ class: "xw-input-number__input",
1656
+ placeholder: e.placeholder,
1657
+ disabled: e.disabled,
1658
+ onBlur: y,
1659
+ onFocus: h,
1660
+ onInput: $,
1661
+ onKeydown: [
1662
+ P(X(v, ["prevent"]), ["up"]),
1663
+ P(X(m, ["prevent"]), ["down"])
1664
+ ]
1665
+ }, null, 40, Ca), [
1666
+ [q, s.value]
1667
+ ]),
1668
+ o("button", {
1669
+ class: "xw-input-number__btn xw-input-number__increase",
1670
+ disabled: e.disabled || c.value,
1671
+ onClick: v
1672
+ }, " + ", 8, Va)
1673
+ ], 2));
1674
+ }
1675
+ });
1676
+ const Sa = /* @__PURE__ */ T(Ba, [["__scopeId", "data-v-8c6041cc"]]), Ta = { class: "xw-progress__bar" }, Ia = {
1677
+ key: 0,
1678
+ class: "xw-progress__text"
1679
+ }, za = { viewBox: "0 0 100 100" }, Ma = ["r", "stroke-width"], La = ["r", "stroke-width", "stroke-dasharray", "stroke-dashoffset"], Ra = {
1680
+ key: 0,
1681
+ class: "xw-progress__text"
1682
+ }, se = 120, Da = /* @__PURE__ */ S({
1683
+ __name: "Progress",
1684
+ props: {
1685
+ percentage: { default: 0 },
1686
+ type: { default: "line" },
1687
+ status: {},
1688
+ strokeWidth: { default: 6 },
1689
+ showText: { type: Boolean, default: !0 },
1690
+ format: {}
1691
+ },
1692
+ setup(e) {
1693
+ const r = e, t = R(() => 50 - r.strokeWidth / 2), n = R(() => 2 * Math.PI * t.value), s = R(() => n.value * (1 - r.percentage / 100)), i = R(() => r.format ? r.format(r.percentage) : `${r.percentage}%`);
1694
+ return (c, d) => (a(), l("div", {
1695
+ class: g(["xw-progress", `xw-progress--${e.type}`])
1696
+ }, [
1697
+ e.type === "line" ? (a(), l(z, { key: 0 }, [
1698
+ o("div", Ta, [
1699
+ o("div", {
1700
+ class: "xw-progress__outer",
1701
+ style: N({ height: e.strokeWidth + "px" })
1702
+ }, [
1703
+ o("div", {
1704
+ class: g(["xw-progress__inner", e.status && `xw-progress__inner--${e.status}`]),
1705
+ style: N({ width: e.percentage + "%" })
1706
+ }, null, 6)
1707
+ ], 4)
1708
+ ]),
1709
+ e.showText ? (a(), l("div", Ia, p(i.value), 1)) : x("", !0)
1710
+ ], 64)) : e.type === "circle" ? (a(), l("div", {
1711
+ key: 1,
1712
+ class: "xw-progress__circle",
1713
+ style: N({ width: se + "px", height: se + "px" })
1714
+ }, [
1715
+ (a(), l("svg", za, [
1716
+ o("circle", {
1717
+ class: "xw-progress__circle-track",
1718
+ cx: "50",
1719
+ cy: "50",
1720
+ r: t.value,
1721
+ fill: "none",
1722
+ "stroke-width": e.strokeWidth
1723
+ }, null, 8, Ma),
1724
+ o("circle", {
1725
+ class: g(["xw-progress__circle-path", e.status && `xw-progress__circle-path--${e.status}`]),
1726
+ cx: "50",
1727
+ cy: "50",
1728
+ r: t.value,
1729
+ fill: "none",
1730
+ "stroke-width": e.strokeWidth,
1731
+ "stroke-dasharray": n.value,
1732
+ "stroke-dashoffset": s.value
1733
+ }, null, 10, La)
1734
+ ])),
1735
+ e.showText ? (a(), l("div", Ra, p(i.value), 1)) : x("", !0)
1736
+ ], 4)) : x("", !0)
1737
+ ], 2));
1738
+ }
1739
+ });
1740
+ const Xa = /* @__PURE__ */ T(Da, [["__scopeId", "data-v-0d020ebf"]]), Pa = ["placeholder", "disabled"], Ea = {
1741
+ key: 1,
1742
+ class: "xw-autocomplete__dropdown"
1743
+ }, Aa = ["onMousedown"], Fa = /* @__PURE__ */ S({
1744
+ __name: "Autocomplete",
1745
+ props: {
1746
+ modelValue: {},
1747
+ options: { default: () => [] },
1748
+ placeholder: {},
1749
+ disabled: { type: Boolean, default: !1 },
1750
+ size: { default: "medium" },
1751
+ clearable: { type: Boolean, default: !1 }
1752
+ },
1753
+ emits: ["update:modelValue", "select", "search"],
1754
+ setup(e, { emit: r }) {
1755
+ const t = e, n = r, s = k(), i = k(t.modelValue || ""), c = k(!1), d = R(() => i.value ? t.options.filter(
1756
+ (h) => h.toLowerCase().includes(i.value.toLowerCase())
1757
+ ) : t.options), u = () => {
1758
+ n("update:modelValue", i.value), n("search", i.value), c.value = !0;
1759
+ }, v = () => {
1760
+ c.value = !0;
1761
+ }, m = () => {
1762
+ setTimeout(() => {
1763
+ c.value = !1;
1764
+ }, 200);
1765
+ }, $ = (h) => {
1766
+ i.value = h, n("update:modelValue", h), n("select", h), c.value = !1;
1767
+ }, y = () => {
1768
+ var h;
1769
+ i.value = "", n("update:modelValue", ""), (h = s.value) == null || h.focus();
1770
+ };
1771
+ return O(() => t.modelValue, (h) => {
1772
+ i.value = h || "";
1773
+ }), (h, f) => (a(), l("div", {
1774
+ class: g(["xw-autocomplete", `xw-autocomplete--${e.size}`, { "xw-autocomplete--disabled": e.disabled }])
1775
+ }, [
1776
+ K(o("input", {
1777
+ ref_key: "inputRef",
1778
+ ref: s,
1779
+ "onUpdate:modelValue": f[0] || (f[0] = (_) => i.value = _),
1780
+ type: "text",
1781
+ class: "xw-autocomplete__input",
1782
+ placeholder: e.placeholder,
1783
+ disabled: e.disabled,
1784
+ onInput: u,
1785
+ onFocus: v,
1786
+ onBlur: m
1787
+ }, null, 40, Pa), [
1788
+ [q, i.value]
1789
+ ]),
1790
+ e.clearable && i.value && !e.disabled ? (a(), l("button", {
1791
+ key: 0,
1792
+ class: "xw-autocomplete__clear",
1793
+ onClick: y
1794
+ }, " × ")) : x("", !0),
1795
+ c.value && d.value.length > 0 ? (a(), l("div", Ea, [
1796
+ (a(!0), l(z, null, D(d.value, (_, C) => (a(), l("div", {
1797
+ key: C,
1798
+ class: "xw-autocomplete__option",
1799
+ onMousedown: X((b) => $(_), ["prevent"])
1800
+ }, p(_), 41, Aa))), 128))
1801
+ ])) : x("", !0)
1802
+ ], 2));
1803
+ }
1804
+ });
1805
+ const Na = /* @__PURE__ */ T(Fa, [["__scopeId", "data-v-c07eca93"]]), Ka = {
1806
+ key: 0,
1807
+ class: "xw-cascader__value"
1808
+ }, Oa = {
1809
+ key: 1,
1810
+ class: "xw-cascader__placeholder"
1811
+ }, Ua = {
1812
+ key: 0,
1813
+ class: "xw-cascader__dropdown"
1814
+ }, Ya = { class: "xw-cascader__panel" }, qa = ["onClick"], Wa = {
1815
+ key: 0,
1816
+ class: "xw-cascader__expand"
1817
+ }, ja = /* @__PURE__ */ S({
1818
+ __name: "Cascader",
1819
+ props: {
1820
+ modelValue: {},
1821
+ options: { default: () => [] },
1822
+ placeholder: { default: "请选择" },
1823
+ disabled: { type: Boolean, default: !1 }
1824
+ },
1825
+ emits: ["update:modelValue", "change"],
1826
+ setup(e, { emit: r }) {
1827
+ const t = e, n = r, s = k(), i = k(!1), c = k([]), d = R(() => c.value.length === 0 ? t.options : c.value[c.value.length - 1].children || []), u = R(() => c.value.map((h) => h.label)), v = (h, f) => {
1828
+ var _;
1829
+ return ((_ = c.value[f]) == null ? void 0 : _.value) === h.value;
1830
+ }, m = () => {
1831
+ t.disabled || (i.value = !i.value);
1832
+ }, $ = (h, f) => {
1833
+ if (c.value = [...c.value.slice(0, f), h], !h.children || h.children.length === 0) {
1834
+ const _ = c.value.map((C) => C.value);
1835
+ n("update:modelValue", _), n("change", _), i.value = !1;
1836
+ }
1837
+ }, y = (h) => {
1838
+ s.value && !s.value.contains(h.target) && (i.value = !1);
1839
+ };
1840
+ return U(() => {
1841
+ document.addEventListener("click", y);
1842
+ }), Y(() => {
1843
+ document.removeEventListener("click", y);
1844
+ }), (h, f) => (a(), l("div", {
1845
+ class: g(["xw-cascader", { "xw-cascader--disabled": e.disabled }]),
1846
+ ref_key: "cascaderRef",
1847
+ ref: s
1848
+ }, [
1849
+ o("div", {
1850
+ class: "xw-cascader__input",
1851
+ onClick: m
1852
+ }, [
1853
+ u.value.length ? (a(), l("span", Ka, p(u.value.join(" / ")), 1)) : (a(), l("span", Oa, p(e.placeholder), 1)),
1854
+ f[0] || (f[0] = o("span", { class: "xw-cascader__arrow" }, "▼", -1))
1855
+ ]),
1856
+ i.value ? (a(), l("div", Ua, [
1857
+ o("div", Ya, [
1858
+ (a(!0), l(z, null, D(d.value, (_, C) => (a(), l("div", {
1859
+ key: _.value,
1860
+ class: g(["xw-cascader__option", { "xw-cascader__option--active": v(_, C) }]),
1861
+ onClick: (b) => $(_, C)
1862
+ }, [
1863
+ F(p(_.label) + " ", 1),
1864
+ _.children ? (a(), l("span", Wa, "›")) : x("", !0)
1865
+ ], 10, qa))), 128))
1866
+ ])
1867
+ ])) : x("", !0)
1868
+ ], 2));
1869
+ }
1870
+ });
1871
+ const Ha = /* @__PURE__ */ T(ja, [["__scopeId", "data-v-cb375a56"]]), Ga = ["placeholder", "disabled"], Qa = {
1872
+ key: 0,
1873
+ class: "xw-date-picker__panel"
1874
+ }, Ja = { class: "xw-date-picker__header" }, Za = { class: "xw-date-picker__body" }, el = { class: "xw-date-picker__weekdays" }, tl = { class: "xw-date-picker__days" }, al = ["onClick"], ll = /* @__PURE__ */ S({
1875
+ __name: "DatePicker",
1876
+ props: {
1877
+ modelValue: {},
1878
+ placeholder: { default: "选择日期" },
1879
+ disabled: { type: Boolean, default: !1 },
1880
+ format: { default: "YYYY-MM-DD" }
1881
+ },
1882
+ emits: ["update:modelValue", "change"],
1883
+ setup(e, { emit: r }) {
1884
+ const t = e, n = r, s = k(), i = k(!1), c = k((/* @__PURE__ */ new Date()).getFullYear()), d = k((/* @__PURE__ */ new Date()).getMonth()), u = k(t.modelValue ? new Date(t.modelValue) : null), v = ["日", "一", "二", "三", "四", "五", "六"], m = R(() => {
1885
+ if (!u.value)
1886
+ return "";
1887
+ const V = u.value.getFullYear(), B = String(u.value.getMonth() + 1).padStart(2, "0"), w = String(u.value.getDate()).padStart(2, "0");
1888
+ return `${V}-${B}-${w}`;
1889
+ }), $ = R(() => {
1890
+ const V = new Date(c.value, d.value, 1).getDay(), B = new Date(c.value, d.value + 1, 0).getDate(), w = [];
1891
+ for (let M = 0; M < V; M++)
1892
+ w.push(null);
1893
+ for (let M = 1; M <= B; M++)
1894
+ w.push(M);
1895
+ return w;
1896
+ }), y = (V) => !V || !u.value ? !1 : u.value.getFullYear() === c.value && u.value.getMonth() === d.value && u.value.getDate() === V, h = () => {
1897
+ t.disabled || (i.value = !i.value);
1898
+ }, f = () => {
1899
+ d.value === 0 ? (d.value = 11, c.value--) : d.value--;
1900
+ }, _ = () => {
1901
+ d.value === 11 ? (d.value = 0, c.value++) : d.value++;
1902
+ }, C = (V) => {
1903
+ if (!V)
1904
+ return;
1905
+ const B = new Date(c.value, d.value, V);
1906
+ u.value = B, n("update:modelValue", B.toISOString()), n("change", B.toISOString()), i.value = !1;
1907
+ }, b = (V) => {
1908
+ s.value && !s.value.contains(V.target) && (i.value = !1);
1909
+ };
1910
+ return U(() => {
1911
+ document.addEventListener("click", b);
1912
+ }), Y(() => {
1913
+ document.removeEventListener("click", b);
1914
+ }), (V, B) => (a(), l("div", {
1915
+ class: g(["xw-date-picker", { "xw-date-picker--disabled": e.disabled }]),
1916
+ ref_key: "pickerRef",
1917
+ ref: s
1918
+ }, [
1919
+ K(o("input", {
1920
+ "onUpdate:modelValue": B[0] || (B[0] = (w) => m.value = w),
1921
+ type: "text",
1922
+ class: "xw-date-picker__input",
1923
+ placeholder: e.placeholder,
1924
+ disabled: e.disabled,
1925
+ readonly: "",
1926
+ onClick: h
1927
+ }, null, 8, Ga), [
1928
+ [q, m.value]
1929
+ ]),
1930
+ i.value ? (a(), l("div", Qa, [
1931
+ o("div", Ja, [
1932
+ o("button", { onClick: f }, "‹"),
1933
+ o("span", null, p(c.value) + "年 " + p(d.value + 1) + "月", 1),
1934
+ o("button", { onClick: _ }, "›")
1935
+ ]),
1936
+ o("div", Za, [
1937
+ o("div", el, [
1938
+ (a(), l(z, null, D(v, (w) => o("span", { key: w }, p(w), 1)), 64))
1939
+ ]),
1940
+ o("div", tl, [
1941
+ (a(!0), l(z, null, D($.value, (w, M) => (a(), l("span", {
1942
+ key: M,
1943
+ class: g(["xw-date-picker__day", {
1944
+ "xw-date-picker__day--disabled": !w,
1945
+ "xw-date-picker__day--selected": y(w)
1946
+ }]),
1947
+ onClick: (j) => C(w)
1948
+ }, p(w), 11, al))), 128))
1949
+ ])
1950
+ ])
1951
+ ])) : x("", !0)
1952
+ ], 2));
1953
+ }
1954
+ });
1955
+ const sl = /* @__PURE__ */ T(ll, [["__scopeId", "data-v-b06d1463"]]), nl = ["placeholder", "disabled"], ol = {
1956
+ key: 0,
1957
+ class: "xw-time-picker__panel"
1958
+ }, il = { class: "xw-time-picker__columns" }, cl = { class: "xw-time-picker__column" }, dl = ["onClick"], ul = { class: "xw-time-picker__column" }, rl = ["onClick"], _l = { class: "xw-time-picker__column" }, vl = ["onClick"], fl = /* @__PURE__ */ S({
1959
+ __name: "TimePicker",
1960
+ props: {
1961
+ modelValue: {},
1962
+ placeholder: { default: "选择时间" },
1963
+ disabled: { type: Boolean, default: !1 }
1964
+ },
1965
+ emits: ["update:modelValue", "change"],
1966
+ setup(e, { emit: r }) {
1967
+ const t = e, n = r, s = k(), i = k(!1), c = k(0), d = k(0), u = k(0), v = Array.from({ length: 24 }, (B, w) => w), m = Array.from({ length: 60 }, (B, w) => w), $ = Array.from({ length: 60 }, (B, w) => w), y = R(() => t.modelValue ? t.modelValue : ""), h = () => {
1968
+ t.disabled || (i.value = !i.value);
1969
+ }, f = (B) => {
1970
+ c.value = B;
1971
+ }, _ = (B) => {
1972
+ d.value = B;
1973
+ }, C = (B) => {
1974
+ u.value = B;
1975
+ }, b = () => {
1976
+ const B = `${String(c.value).padStart(2, "0")}:${String(d.value).padStart(2, "0")}:${String(u.value).padStart(2, "0")}`;
1977
+ n("update:modelValue", B), n("change", B), i.value = !1;
1978
+ }, V = (B) => {
1979
+ s.value && !s.value.contains(B.target) && (i.value = !1);
1980
+ };
1981
+ return U(() => {
1982
+ document.addEventListener("click", V);
1983
+ }), Y(() => {
1984
+ document.removeEventListener("click", V);
1985
+ }), (B, w) => (a(), l("div", {
1986
+ class: g(["xw-time-picker", { "xw-time-picker--disabled": e.disabled }]),
1987
+ ref_key: "pickerRef",
1988
+ ref: s
1989
+ }, [
1990
+ K(o("input", {
1991
+ "onUpdate:modelValue": w[0] || (w[0] = (M) => y.value = M),
1992
+ type: "text",
1993
+ class: "xw-time-picker__input",
1994
+ placeholder: e.placeholder,
1995
+ disabled: e.disabled,
1996
+ readonly: "",
1997
+ onClick: h
1998
+ }, null, 8, nl), [
1999
+ [q, y.value]
2000
+ ]),
2001
+ i.value ? (a(), l("div", ol, [
2002
+ o("div", il, [
2003
+ o("div", cl, [
2004
+ (a(!0), l(z, null, D(ee(v), (M) => (a(), l("div", {
2005
+ key: M,
2006
+ class: g(["xw-time-picker__item", { "xw-time-picker__item--selected": M === c.value }]),
2007
+ onClick: (j) => f(M)
2008
+ }, p(String(M).padStart(2, "0")), 11, dl))), 128))
2009
+ ]),
2010
+ o("div", ul, [
2011
+ (a(!0), l(z, null, D(ee(m), (M) => (a(), l("div", {
2012
+ key: M,
2013
+ class: g(["xw-time-picker__item", { "xw-time-picker__item--selected": M === d.value }]),
2014
+ onClick: (j) => _(M)
2015
+ }, p(String(M).padStart(2, "0")), 11, rl))), 128))
2016
+ ]),
2017
+ o("div", _l, [
2018
+ (a(!0), l(z, null, D(ee($), (M) => (a(), l("div", {
2019
+ key: M,
2020
+ class: g(["xw-time-picker__item", { "xw-time-picker__item--selected": M === u.value }]),
2021
+ onClick: (j) => C(M)
2022
+ }, p(String(M).padStart(2, "0")), 11, vl))), 128))
2023
+ ])
2024
+ ]),
2025
+ o("div", { class: "xw-time-picker__footer" }, [
2026
+ o("button", { onClick: b }, "确定")
2027
+ ])
2028
+ ])) : x("", !0)
2029
+ ], 2));
2030
+ }
2031
+ });
2032
+ const pl = /* @__PURE__ */ T(fl, [["__scopeId", "data-v-c6678d42"]]), ml = { class: "xw-transfer" }, wl = { class: "xw-transfer__panel" }, hl = { class: "xw-transfer__header" }, xl = { class: "xw-transfer__body" }, yl = ["value", "disabled"], bl = { class: "xw-transfer__buttons" }, gl = ["disabled"], kl = ["disabled"], $l = { class: "xw-transfer__panel" }, Cl = { class: "xw-transfer__header" }, Vl = { class: "xw-transfer__body" }, Bl = ["value", "disabled"], Sl = /* @__PURE__ */ S({
2033
+ __name: "Transfer",
2034
+ props: {
2035
+ modelValue: { default: () => [] },
2036
+ data: { default: () => [] },
2037
+ titles: { default: () => ["源列表", "目标列表"] }
2038
+ },
2039
+ emits: ["update:modelValue", "change"],
2040
+ setup(e, { emit: r }) {
2041
+ const t = e, n = r, s = k([]), i = k([]), c = R(() => t.data.filter((m) => !t.modelValue.includes(m.key))), d = R(() => t.data.filter((m) => t.modelValue.includes(m.key))), u = () => {
2042
+ const m = [...t.modelValue, ...s.value];
2043
+ n("update:modelValue", m), n("change", m), s.value = [];
2044
+ }, v = () => {
2045
+ const m = t.modelValue.filter(($) => !i.value.includes($));
2046
+ n("update:modelValue", m), n("change", m), i.value = [];
2047
+ };
2048
+ return (m, $) => (a(), l("div", ml, [
2049
+ o("div", wl, [
2050
+ o("div", hl, [
2051
+ o("span", null, p(e.titles[0]), 1),
2052
+ o("span", null, p(s.value.length) + "/" + p(c.value.length), 1)
2053
+ ]),
2054
+ o("div", xl, [
2055
+ (a(!0), l(z, null, D(c.value, (y) => (a(), l("label", {
2056
+ key: y.key,
2057
+ class: g(["xw-transfer__item", { "xw-transfer__item--disabled": y.disabled }])
2058
+ }, [
2059
+ K(o("input", {
2060
+ type: "checkbox",
2061
+ value: y.key,
2062
+ disabled: y.disabled,
2063
+ "onUpdate:modelValue": $[0] || ($[0] = (h) => s.value = h)
2064
+ }, null, 8, yl), [
2065
+ [le, s.value]
2066
+ ]),
2067
+ o("span", null, p(y.label), 1)
2068
+ ], 2))), 128))
2069
+ ])
2070
+ ]),
2071
+ o("div", bl, [
2072
+ o("button", {
2073
+ onClick: u,
2074
+ disabled: s.value.length === 0
2075
+ }, "›", 8, gl),
2076
+ o("button", {
2077
+ onClick: v,
2078
+ disabled: i.value.length === 0
2079
+ }, "‹", 8, kl)
2080
+ ]),
2081
+ o("div", $l, [
2082
+ o("div", Cl, [
2083
+ o("span", null, p(e.titles[1]), 1),
2084
+ o("span", null, p(i.value.length) + "/" + p(d.value.length), 1)
2085
+ ]),
2086
+ o("div", Vl, [
2087
+ (a(!0), l(z, null, D(d.value, (y) => (a(), l("label", {
2088
+ key: y.key,
2089
+ class: g(["xw-transfer__item", { "xw-transfer__item--disabled": y.disabled }])
2090
+ }, [
2091
+ K(o("input", {
2092
+ type: "checkbox",
2093
+ value: y.key,
2094
+ disabled: y.disabled,
2095
+ "onUpdate:modelValue": $[1] || ($[1] = (h) => i.value = h)
2096
+ }, null, 8, Bl), [
2097
+ [le, i.value]
2098
+ ]),
2099
+ o("span", null, p(y.label), 1)
2100
+ ], 2))), 128))
2101
+ ])
2102
+ ])
2103
+ ]));
2104
+ }
2105
+ });
2106
+ const Tl = /* @__PURE__ */ T(Sl, [["__scopeId", "data-v-93f5a299"]]), Il = { class: "xw-upload" }, zl = ["accept", "multiple", "disabled"], Ml = {
2107
+ key: 0,
2108
+ class: "xw-upload__list"
2109
+ }, Ll = { class: "xw-upload__filename" }, Rl = { class: "xw-upload__size" }, Dl = ["onClick"], Xl = /* @__PURE__ */ S({
2110
+ __name: "Upload",
2111
+ props: {
2112
+ accept: {},
2113
+ multiple: { type: Boolean, default: !1 },
2114
+ disabled: { type: Boolean, default: !1 },
2115
+ maxSize: {},
2116
+ fileList: { default: () => [] }
2117
+ },
2118
+ emits: ["change", "remove"],
2119
+ setup(e, { emit: r }) {
2120
+ const t = e, n = r, s = k(), i = () => {
2121
+ var v;
2122
+ t.disabled || (v = s.value) == null || v.click();
2123
+ }, c = (v) => {
2124
+ const m = v.target, $ = Array.from(m.files || []);
2125
+ if (t.maxSize) {
2126
+ const y = $.filter((h) => h.size <= t.maxSize);
2127
+ y.length !== $.length && alert(`文件大小不能超过 ${u(t.maxSize)}`), n("change", y);
2128
+ } else
2129
+ n("change", $);
2130
+ m.value = "";
2131
+ }, d = (v) => {
2132
+ n("remove", v);
2133
+ }, u = (v) => v < 1024 ? v + " B" : v < 1024 * 1024 ? (v / 1024).toFixed(1) + " KB" : (v / (1024 * 1024)).toFixed(1) + " MB";
2134
+ return (v, m) => (a(), l("div", Il, [
2135
+ o("div", {
2136
+ class: g(["xw-upload__trigger", { "xw-upload__trigger--disabled": e.disabled }]),
2137
+ onClick: i
2138
+ }, [
2139
+ o("input", {
2140
+ ref_key: "inputRef",
2141
+ ref: s,
2142
+ type: "file",
2143
+ accept: e.accept,
2144
+ multiple: e.multiple,
2145
+ disabled: e.disabled,
2146
+ onChange: c,
2147
+ style: { display: "none" }
2148
+ }, null, 40, zl),
2149
+ I(v.$slots, "default", {}, () => [
2150
+ m[0] || (m[0] = o("div", { class: "xw-upload__default" }, [
2151
+ o("span", { class: "xw-upload__icon" }, "+"),
2152
+ o("span", { class: "xw-upload__text" }, "点击上传")
2153
+ ], -1))
2154
+ ], !0)
2155
+ ], 2),
2156
+ e.fileList && e.fileList.length > 0 ? (a(), l("div", Ml, [
2157
+ (a(!0), l(z, null, D(e.fileList, ($, y) => (a(), l("div", {
2158
+ key: y,
2159
+ class: "xw-upload__item"
2160
+ }, [
2161
+ o("span", Ll, p($.name), 1),
2162
+ o("span", Rl, p(u($.size)), 1),
2163
+ o("button", {
2164
+ class: "xw-upload__remove",
2165
+ onClick: (h) => d($)
2166
+ }, "×", 8, Dl)
2167
+ ]))), 128))
2168
+ ])) : x("", !0)
2169
+ ]));
2170
+ }
2171
+ });
2172
+ const Pl = /* @__PURE__ */ T(Xl, [["__scopeId", "data-v-d7e7c31c"]]), El = ["src", "alt"], Al = {
2173
+ key: 1,
2174
+ class: "xw-avatar__icon"
2175
+ }, Fl = /* @__PURE__ */ S({
2176
+ __name: "Avatar",
2177
+ props: {
2178
+ src: {},
2179
+ alt: {},
2180
+ size: { default: "medium" },
2181
+ shape: { default: "circle" },
2182
+ icon: {}
2183
+ },
2184
+ setup(e) {
2185
+ return (r, t) => (a(), l("div", {
2186
+ class: g(["xw-avatar", `xw-avatar--${e.shape}`, typeof e.size == "string" ? `xw-avatar--${e.size}` : ""]),
2187
+ style: N(typeof e.size == "number" ? { width: e.size + "px", height: e.size + "px", fontSize: e.size / 2 + "px" } : {})
2188
+ }, [
2189
+ e.src ? (a(), l("img", {
2190
+ key: 0,
2191
+ src: e.src,
2192
+ alt: e.alt,
2193
+ class: "xw-avatar__img"
2194
+ }, null, 8, El)) : e.icon ? (a(), l("span", Al, p(e.icon), 1)) : I(r.$slots, "default", { key: 2 }, void 0, !0)
2195
+ ], 6));
2196
+ }
2197
+ });
2198
+ const Nl = /* @__PURE__ */ T(Fl, [["__scopeId", "data-v-dc424a0d"]]), Kl = {
2199
+ key: 0,
2200
+ class: "xw-card__header"
2201
+ }, Ol = { class: "xw-card__title" }, Ul = { class: "xw-card__body" }, Yl = {
2202
+ key: 1,
2203
+ class: "xw-card__footer"
2204
+ }, ql = /* @__PURE__ */ S({
2205
+ __name: "Card",
2206
+ props: {
2207
+ title: {},
2208
+ shadow: { default: "always" }
2209
+ },
2210
+ setup(e) {
2211
+ return (r, t) => (a(), l("div", {
2212
+ class: g(["xw-card", `xw-card--shadow-${e.shadow}`])
2213
+ }, [
2214
+ e.title || r.$slots.header ? (a(), l("div", Kl, [
2215
+ I(r.$slots, "header", {}, () => [
2216
+ o("span", Ol, p(e.title), 1)
2217
+ ], !0)
2218
+ ])) : x("", !0),
2219
+ o("div", Ul, [
2220
+ I(r.$slots, "default", {}, void 0, !0)
2221
+ ]),
2222
+ r.$slots.footer ? (a(), l("div", Yl, [
2223
+ I(r.$slots, "footer", {}, void 0, !0)
2224
+ ])) : x("", !0)
2225
+ ], 2));
2226
+ }
2227
+ });
2228
+ const Wl = /* @__PURE__ */ T(ql, [["__scopeId", "data-v-6809d29a"]]), jl = { class: "xw-carousel__indicators" }, Hl = ["onClick"], Gl = /* @__PURE__ */ S({
2229
+ __name: "Carousel",
2230
+ props: {
2231
+ autoplay: { type: Boolean, default: !0 },
2232
+ interval: { default: 3e3 },
2233
+ height: { default: "300px" }
2234
+ },
2235
+ emits: ["change"],
2236
+ setup(e, { emit: r }) {
2237
+ const t = e, n = r, s = oe(), i = k(0), c = k(0);
2238
+ let d = null;
2239
+ U(() => {
2240
+ var h;
2241
+ c.value = ((h = s.default) == null ? void 0 : h.call(s).length) || 0, t.autoplay && u();
2242
+ }), Y(() => {
2243
+ v();
2244
+ });
2245
+ const u = () => {
2246
+ d = window.setInterval(() => {
2247
+ m();
2248
+ }, t.interval);
2249
+ }, v = () => {
2250
+ d && (clearInterval(d), d = null);
2251
+ }, m = () => {
2252
+ i.value = (i.value + 1) % c.value, n("change", i.value);
2253
+ }, $ = () => {
2254
+ i.value = (i.value - 1 + c.value) % c.value, n("change", i.value);
2255
+ }, y = (h) => {
2256
+ i.value = h, n("change", i.value);
2257
+ };
2258
+ return (h, f) => (a(), l("div", {
2259
+ class: "xw-carousel",
2260
+ style: N({ height: e.height })
2261
+ }, [
2262
+ o("div", {
2263
+ class: "xw-carousel__container",
2264
+ style: N({ transform: `translateX(-${i.value * 100}%)` })
2265
+ }, [
2266
+ I(h.$slots, "default", {}, void 0, !0)
2267
+ ], 4),
2268
+ o("div", jl, [
2269
+ (a(!0), l(z, null, D(c.value, (_, C) => (a(), l("span", {
2270
+ key: C,
2271
+ class: g(["xw-carousel__indicator", { "xw-carousel__indicator--active": C === i.value }]),
2272
+ onClick: (b) => y(C)
2273
+ }, null, 10, Hl))), 128))
2274
+ ]),
2275
+ o("button", {
2276
+ class: "xw-carousel__arrow xw-carousel__arrow--left",
2277
+ onClick: $
2278
+ }, "‹"),
2279
+ o("button", {
2280
+ class: "xw-carousel__arrow xw-carousel__arrow--right",
2281
+ onClick: m
2282
+ }, "›")
2283
+ ], 4));
2284
+ }
2285
+ });
2286
+ const Ql = /* @__PURE__ */ T(Gl, [["__scopeId", "data-v-06447af9"]]), Jl = { class: "xw-collapse" }, Zl = ["onClick"], es = { class: "xw-collapse__content" }, ts = { class: "xw-collapse__body" }, as = /* @__PURE__ */ S({
2287
+ __name: "Collapse",
2288
+ props: {
2289
+ modelValue: { default: () => [] },
2290
+ items: { default: () => [] },
2291
+ accordion: { type: Boolean, default: !1 }
2292
+ },
2293
+ emits: ["update:modelValue", "change"],
2294
+ setup(e, { emit: r }) {
2295
+ const t = e, n = r, s = (c) => t.modelValue.includes(c), i = (c) => {
2296
+ let d;
2297
+ t.accordion ? d = s(c) ? [] : [c] : s(c) ? d = t.modelValue.filter((u) => u !== c) : d = [...t.modelValue, c], n("update:modelValue", d), n("change", d);
2298
+ };
2299
+ return (c, d) => (a(), l("div", Jl, [
2300
+ (a(!0), l(z, null, D(e.items, (u) => (a(), l("div", {
2301
+ key: u.key,
2302
+ class: "xw-collapse__item"
2303
+ }, [
2304
+ o("div", {
2305
+ class: g(["xw-collapse__header", { "xw-collapse__header--active": s(u.key) }]),
2306
+ onClick: (v) => i(u.key)
2307
+ }, [
2308
+ o("span", null, p(u.title), 1),
2309
+ d[0] || (d[0] = o("span", { class: "xw-collapse__arrow" }, "›", -1))
2310
+ ], 10, Zl),
2311
+ K(o("div", es, [
2312
+ o("div", ts, [
2313
+ I(c.$slots, `content-${u.key}`, {}, () => [
2314
+ F(p(u.content), 1)
2315
+ ], !0)
2316
+ ])
2317
+ ], 512), [
2318
+ [ne, s(u.key)]
2319
+ ])
2320
+ ]))), 128))
2321
+ ]));
2322
+ }
2323
+ });
2324
+ const ls = /* @__PURE__ */ T(as, [["__scopeId", "data-v-0c5d3a9b"]]), ss = { class: "xw-empty" }, ns = { class: "xw-empty__icon" }, os = { class: "xw-empty__description" }, is = /* @__PURE__ */ S({
2325
+ __name: "Empty",
2326
+ props: {
2327
+ description: { default: "暂无数据" }
2328
+ },
2329
+ setup(e) {
2330
+ return (r, t) => (a(), l("div", ss, [
2331
+ o("div", ns, [
2332
+ I(r.$slots, "icon", {}, () => [
2333
+ t[0] || (t[0] = o("span", null, "📭", -1))
2334
+ ], !0)
2335
+ ]),
2336
+ o("div", os, [
2337
+ I(r.$slots, "default", {}, () => [
2338
+ F(p(e.description), 1)
2339
+ ], !0)
2340
+ ])
2341
+ ]));
2342
+ }
2343
+ });
2344
+ const cs = /* @__PURE__ */ T(is, [["__scopeId", "data-v-f947a902"]]), ds = { class: "xw-image" }, us = ["src", "alt"], rs = {
2345
+ key: 1,
2346
+ class: "xw-image__error"
2347
+ }, _s = {
2348
+ key: 2,
2349
+ class: "xw-image__loading"
2350
+ }, vs = /* @__PURE__ */ S({
2351
+ __name: "Image",
2352
+ props: {
2353
+ src: {},
2354
+ alt: {},
2355
+ fit: { default: "cover" }
2356
+ },
2357
+ emits: ["load", "error"],
2358
+ setup(e, { emit: r }) {
2359
+ const t = r, n = k(!0), s = k(!1), i = () => {
2360
+ n.value = !1, t("load");
2361
+ }, c = () => {
2362
+ n.value = !1, s.value = !0, t("error");
2363
+ };
2364
+ return (d, u) => (a(), l("div", ds, [
2365
+ s.value ? (a(), l("div", rs, [
2366
+ I(d.$slots, "error", {}, () => [
2367
+ u[0] || (u[0] = o("span", { class: "xw-image__error-icon" }, "🖼️", -1)),
2368
+ u[1] || (u[1] = o("span", { class: "xw-image__error-text" }, "加载失败", -1))
2369
+ ], !0)
2370
+ ])) : (a(), l("img", {
2371
+ key: 0,
2372
+ src: e.src,
2373
+ alt: e.alt,
2374
+ class: g(["xw-image__inner", `xw-image__inner--${e.fit}`]),
2375
+ onLoad: i,
2376
+ onError: c
2377
+ }, null, 42, us)),
2378
+ n.value && !s.value ? (a(), l("div", _s, [
2379
+ I(d.$slots, "loading", {}, () => [
2380
+ u[2] || (u[2] = o("span", { class: "xw-image__loading-icon" }, "⏳", -1))
2381
+ ], !0)
2382
+ ])) : x("", !0)
2383
+ ]));
2384
+ }
2385
+ });
2386
+ const fs = /* @__PURE__ */ T(vs, [["__scopeId", "data-v-a9a3a9fc"]]), ps = {
2387
+ class: "xw-table",
2388
+ role: "region",
2389
+ "aria-label": "数据表格"
2390
+ }, ms = { class: "xw-table__header" }, ws = { class: "xw-table__body" }, hs = /* @__PURE__ */ S({
2391
+ __name: "Table",
2392
+ props: {
2393
+ columns: { default: () => [] },
2394
+ data: { default: () => [] },
2395
+ stripe: { type: Boolean, default: !1 },
2396
+ border: { type: Boolean, default: !1 }
2397
+ },
2398
+ setup(e) {
2399
+ return (r, t) => (a(), l("div", ps, [
2400
+ o("table", {
2401
+ class: g(["xw-table__inner", { "xw-table__inner--stripe": e.stripe, "xw-table__inner--border": e.border }])
2402
+ }, [
2403
+ o("thead", ms, [
2404
+ o("tr", null, [
2405
+ (a(!0), l(z, null, D(e.columns, (n) => (a(), l("th", {
2406
+ key: n.key,
2407
+ style: N({ width: n.width }),
2408
+ class: "xw-table__cell xw-table__cell--header"
2409
+ }, p(n.label), 5))), 128))
2410
+ ])
2411
+ ]),
2412
+ o("tbody", ws, [
2413
+ (a(!0), l(z, null, D(e.data, (n, s) => (a(), l("tr", {
2414
+ key: s,
2415
+ class: "xw-table__row"
2416
+ }, [
2417
+ (a(!0), l(z, null, D(e.columns, (i) => (a(), l("td", {
2418
+ key: i.key,
2419
+ class: "xw-table__cell"
2420
+ }, [
2421
+ I(r.$slots, `cell-${i.key}`, {
2422
+ row: n,
2423
+ index: s
2424
+ }, () => [
2425
+ F(p(n[i.key]), 1)
2426
+ ], !0)
2427
+ ]))), 128))
2428
+ ]))), 128))
2429
+ ])
2430
+ ], 2)
2431
+ ]));
2432
+ }
2433
+ });
2434
+ const xs = /* @__PURE__ */ T(hs, [["__scopeId", "data-v-b741050d"]]), ys = { class: "xw-timeline" }, bs = { class: "xw-timeline__content" }, gs = { class: "xw-timeline__title" }, ks = {
2435
+ key: 0,
2436
+ class: "xw-timeline__description"
2437
+ }, $s = {
2438
+ key: 1,
2439
+ class: "xw-timeline__timestamp"
2440
+ }, Cs = /* @__PURE__ */ S({
2441
+ __name: "Timeline",
2442
+ props: {
2443
+ items: { default: () => [] }
2444
+ },
2445
+ setup(e) {
2446
+ return (r, t) => (a(), l("div", ys, [
2447
+ (a(!0), l(z, null, D(e.items, (n, s) => (a(), l("div", {
2448
+ key: s,
2449
+ class: "xw-timeline__item"
2450
+ }, [
2451
+ o("div", {
2452
+ class: g(["xw-timeline__dot", `xw-timeline__dot--${n.type || "default"}`])
2453
+ }, null, 2),
2454
+ o("div", bs, [
2455
+ o("div", gs, p(n.title), 1),
2456
+ n.description ? (a(), l("div", ks, p(n.description), 1)) : x("", !0),
2457
+ n.timestamp ? (a(), l("div", $s, p(n.timestamp), 1)) : x("", !0)
2458
+ ])
2459
+ ]))), 128))
2460
+ ]));
2461
+ }
2462
+ });
2463
+ const Vs = /* @__PURE__ */ T(Cs, [["__scopeId", "data-v-6512df04"]]), Bs = { class: "xw-skeleton" }, Ss = {
2464
+ key: 0,
2465
+ class: "xw-skeleton__avatar"
2466
+ }, Ts = { class: "xw-skeleton__content" }, Is = /* @__PURE__ */ S({
2467
+ __name: "Skeleton",
2468
+ props: {
2469
+ rows: { default: 3 },
2470
+ avatar: { type: Boolean, default: !1 }
2471
+ },
2472
+ setup(e) {
2473
+ return (r, t) => (a(), l("div", Bs, [
2474
+ e.avatar ? (a(), l("div", Ss)) : x("", !0),
2475
+ o("div", Ts, [
2476
+ (a(!0), l(z, null, D(e.rows, (n) => (a(), l("div", {
2477
+ key: n,
2478
+ class: "xw-skeleton__row"
2479
+ }))), 128))
2480
+ ])
2481
+ ]));
2482
+ }
2483
+ });
2484
+ const zs = /* @__PURE__ */ T(Is, [["__scopeId", "data-v-24958523"]]), Ms = {
2485
+ key: 0,
2486
+ class: "xw-alert__icon"
2487
+ }, Ls = { class: "xw-alert__content" }, Rs = {
2488
+ key: 0,
2489
+ class: "xw-alert__title"
2490
+ }, Ds = {
2491
+ key: 1,
2492
+ class: "xw-alert__description"
2493
+ }, Xs = /* @__PURE__ */ S({
2494
+ __name: "Alert",
2495
+ props: {
2496
+ type: { default: "info" },
2497
+ title: {},
2498
+ description: {},
2499
+ closable: { type: Boolean, default: !1 },
2500
+ showIcon: { type: Boolean, default: !0 }
2501
+ },
2502
+ emits: ["close"],
2503
+ setup(e, { emit: r }) {
2504
+ const t = r, n = k(!0), s = {
2505
+ success: "✓",
2506
+ info: "ℹ",
2507
+ warning: "⚠",
2508
+ error: "✕"
2509
+ }, i = () => {
2510
+ n.value = !1, t("close");
2511
+ };
2512
+ return (c, d) => n.value ? (a(), l("div", {
2513
+ key: 0,
2514
+ class: g(["xw-alert", `xw-alert--${e.type}`])
2515
+ }, [
2516
+ e.showIcon ? (a(), l("span", Ms, p(s[e.type]), 1)) : x("", !0),
2517
+ o("div", Ls, [
2518
+ e.title ? (a(), l("div", Rs, p(e.title), 1)) : x("", !0),
2519
+ e.description || c.$slots.default ? (a(), l("div", Ds, [
2520
+ I(c.$slots, "default", {}, () => [
2521
+ F(p(e.description), 1)
2522
+ ], !0)
2523
+ ])) : x("", !0)
2524
+ ]),
2525
+ e.closable ? (a(), l("button", {
2526
+ key: 1,
2527
+ class: "xw-alert__close",
2528
+ onClick: i
2529
+ }, "×")) : x("", !0)
2530
+ ], 2)) : x("", !0);
2531
+ }
2532
+ });
2533
+ const Ps = /* @__PURE__ */ T(Xs, [["__scopeId", "data-v-9a4bfc11"]]), Es = {
2534
+ key: 0,
2535
+ class: "xw-drawer"
2536
+ }, As = { class: "xw-drawer__header" }, Fs = { class: "xw-drawer__title" }, Ns = { class: "xw-drawer__body" }, Ks = {
2537
+ key: 0,
2538
+ class: "xw-drawer__footer"
2539
+ }, Os = /* @__PURE__ */ S({
2540
+ __name: "Drawer",
2541
+ props: {
2542
+ visible: { type: Boolean },
2543
+ title: {},
2544
+ placement: { default: "right" },
2545
+ width: { default: "30%" },
2546
+ height: { default: "30%" },
2547
+ maskClosable: { type: Boolean, default: !0 }
2548
+ },
2549
+ emits: ["update:visible", "close"],
2550
+ setup(e, { emit: r }) {
2551
+ const t = e, n = r, s = () => {
2552
+ n("update:visible", !1), n("close");
2553
+ }, i = () => {
2554
+ t.maskClosable && s();
2555
+ };
2556
+ return (c, d) => (a(), W(Q, { to: "body" }, [
2557
+ e.visible ? (a(), l("div", Es, [
2558
+ o("div", {
2559
+ class: "xw-drawer__mask",
2560
+ onClick: i
2561
+ }),
2562
+ o("div", {
2563
+ class: g(["xw-drawer__wrapper", `xw-drawer__wrapper--${e.placement}`]),
2564
+ style: N({ width: e.placement === "left" || e.placement === "right" ? e.width : "100%", height: e.placement === "top" || e.placement === "bottom" ? e.height : "100%" })
2565
+ }, [
2566
+ o("div", As, [
2567
+ o("span", Fs, p(e.title), 1),
2568
+ o("button", {
2569
+ class: "xw-drawer__close",
2570
+ onClick: s
2571
+ }, "×")
2572
+ ]),
2573
+ o("div", Ns, [
2574
+ I(c.$slots, "default", {}, void 0, !0)
2575
+ ]),
2576
+ c.$slots.footer ? (a(), l("div", Ks, [
2577
+ I(c.$slots, "footer", {}, void 0, !0)
2578
+ ])) : x("", !0)
2579
+ ], 6)
2580
+ ])) : x("", !0)
2581
+ ]));
2582
+ }
2583
+ });
2584
+ const Us = /* @__PURE__ */ T(Os, [["__scopeId", "data-v-f1c67999"]]), Ys = ["aria-expanded", "onKeydown"], qs = ["tabindex", "onClick"], Ws = /* @__PURE__ */ S({
2585
+ __name: "Dropdown",
2586
+ props: {
2587
+ items: { default: () => [] }
2588
+ },
2589
+ emits: ["select"],
2590
+ setup(e, { emit: r }) {
2591
+ const t = e, n = r, s = k(), i = k(), c = k(!1), d = k(0), u = () => {
2592
+ if (!i.value)
2593
+ return;
2594
+ const C = i.value.querySelectorAll(".xw-dropdown__item")[d.value];
2595
+ C == null || C.scrollIntoView({ block: "nearest" });
2596
+ }, v = () => {
2597
+ c.value = !c.value, c.value && (d.value = 0, setTimeout(u, 0));
2598
+ }, m = () => {
2599
+ c.value = !1;
2600
+ }, $ = () => {
2601
+ if (!c.value) {
2602
+ v();
2603
+ return;
2604
+ }
2605
+ d.value = (d.value + 1) % t.items.length, setTimeout(u, 0);
2606
+ }, y = () => {
2607
+ if (!c.value) {
2608
+ v();
2609
+ return;
2610
+ }
2611
+ d.value = (d.value - 1 + t.items.length) % t.items.length, setTimeout(u, 0);
2612
+ }, h = (_) => {
2613
+ _.disabled || (n("select", _.key), m());
2614
+ }, f = (_) => {
2615
+ s.value && !s.value.contains(_.target) && m();
2616
+ };
2617
+ return U(() => {
2618
+ document.addEventListener("click", f);
2619
+ }), Y(() => {
2620
+ document.removeEventListener("click", f);
2621
+ }), (_, C) => (a(), l("div", {
2622
+ class: "xw-dropdown",
2623
+ ref_key: "dropdownRef",
2624
+ ref: s
2625
+ }, [
2626
+ o("div", {
2627
+ class: "xw-dropdown__trigger",
2628
+ role: "button",
2629
+ tabindex: "0",
2630
+ "aria-haspopup": "menu",
2631
+ "aria-expanded": c.value,
2632
+ onClick: v,
2633
+ onKeydown: [
2634
+ P(X(v, ["prevent"]), ["enter"]),
2635
+ P(X(v, ["prevent"]), ["space"]),
2636
+ P(X(m, ["prevent"]), ["esc"]),
2637
+ P(X($, ["prevent"]), ["down"]),
2638
+ P(X(y, ["prevent"]), ["up"])
2639
+ ]
2640
+ }, [
2641
+ I(_.$slots, "default", {}, void 0, !0)
2642
+ ], 40, Ys),
2643
+ c.value ? (a(), l("div", {
2644
+ key: 0,
2645
+ ref_key: "menuRef",
2646
+ ref: i,
2647
+ class: "xw-dropdown__menu",
2648
+ role: "menu",
2649
+ "aria-label": "下拉菜单"
2650
+ }, [
2651
+ (a(!0), l(z, null, D(e.items, (b, V) => (a(), l("div", {
2652
+ key: b.key,
2653
+ class: g([
2654
+ "xw-dropdown__item",
2655
+ { "xw-dropdown__item--disabled": b.disabled, "xw-dropdown__item--active": V === d.value }
2656
+ ]),
2657
+ role: "menuitem",
2658
+ tabindex: V === d.value ? 0 : -1,
2659
+ onClick: (B) => h(b)
2660
+ }, p(b.label), 11, qs))), 128))
2661
+ ], 512)) : x("", !0)
2662
+ ], 512));
2663
+ }
2664
+ });
2665
+ const js = /* @__PURE__ */ T(Ws, [["__scopeId", "data-v-2c90a7a8"]]), Hs = { class: "xw-steps__icon" }, Gs = { key: 0 }, Qs = { key: 1 }, Js = { class: "xw-steps__content" }, Zs = { class: "xw-steps__title" }, en = {
2666
+ key: 0,
2667
+ class: "xw-steps__description"
2668
+ }, tn = {
2669
+ key: 0,
2670
+ class: "xw-steps__line"
2671
+ }, an = /* @__PURE__ */ S({
2672
+ __name: "Steps",
2673
+ props: {
2674
+ current: { default: 0 },
2675
+ steps: { default: () => [] },
2676
+ direction: { default: "horizontal" }
2677
+ },
2678
+ setup(e) {
2679
+ return (r, t) => (a(), l("div", {
2680
+ class: g(["xw-steps", `xw-steps--${e.direction}`])
2681
+ }, [
2682
+ (a(!0), l(z, null, D(e.steps, (n, s) => (a(), l("div", {
2683
+ key: s,
2684
+ class: g(["xw-steps__item", {
2685
+ "xw-steps__item--active": s === e.current,
2686
+ "xw-steps__item--finish": s < e.current
2687
+ }])
2688
+ }, [
2689
+ o("div", Hs, [
2690
+ s < e.current ? (a(), l("span", Gs, "✓")) : (a(), l("span", Qs, p(s + 1), 1))
2691
+ ]),
2692
+ o("div", Js, [
2693
+ o("div", Zs, p(n.title), 1),
2694
+ n.description ? (a(), l("div", en, p(n.description), 1)) : x("", !0)
2695
+ ]),
2696
+ s < e.steps.length - 1 ? (a(), l("div", tn)) : x("", !0)
2697
+ ], 2))), 128))
2698
+ ], 2));
2699
+ }
2700
+ });
2701
+ const ln = /* @__PURE__ */ T(an, [["__scopeId", "data-v-de6ad603"]]), sn = /* @__PURE__ */ S({
2702
+ __name: "Backtop",
2703
+ props: {
2704
+ visibilityHeight: { default: 200 },
2705
+ right: { default: 40 },
2706
+ bottom: { default: 40 },
2707
+ position: { default: "fixed" }
2708
+ },
2709
+ emits: ["click"],
2710
+ setup(e, { emit: r }) {
2711
+ const t = e, n = r, s = k(!1), i = () => {
2712
+ s.value = window.scrollY > t.visibilityHeight;
2713
+ }, c = () => {
2714
+ window.scrollTo({
2715
+ top: 0,
2716
+ behavior: "smooth"
2717
+ }), n("click");
2718
+ };
2719
+ return U(() => {
2720
+ window.addEventListener("scroll", i), i();
2721
+ }), Y(() => {
2722
+ window.removeEventListener("scroll", i);
2723
+ }), (d, u) => (a(), W(Q, { to: "body" }, [
2724
+ s.value ? (a(), l("div", {
2725
+ key: 0,
2726
+ class: g(["xw-backtop", `xw-backtop--${e.position}`]),
2727
+ style: N({ bottom: e.bottom + "px", right: e.right + "px" }),
2728
+ onClick: c
2729
+ }, [
2730
+ I(d.$slots, "default", {}, () => [
2731
+ u[0] || (u[0] = o("span", { class: "xw-backtop__icon" }, "↑", -1))
2732
+ ], !0)
2733
+ ], 6)) : x("", !0)
2734
+ ]));
2735
+ }
2736
+ });
2737
+ const nn = /* @__PURE__ */ T(sn, [["__scopeId", "data-v-812247e2"]]), on = ["onClick"], cn = {
2738
+ key: 0,
2739
+ class: "xw-menu__icon"
2740
+ }, dn = { class: "xw-menu__label" }, un = /* @__PURE__ */ S({
2741
+ __name: "Menu",
2742
+ props: {
2743
+ items: { default: () => [] },
2744
+ selectedKey: {},
2745
+ mode: { default: "vertical" }
2746
+ },
2747
+ emits: ["select"],
2748
+ setup(e, { emit: r }) {
2749
+ const t = r, n = (s) => {
2750
+ t("select", s);
2751
+ };
2752
+ return (s, i) => (a(), l("div", {
2753
+ class: g(["xw-menu", `xw-menu--${e.mode}`])
2754
+ }, [
2755
+ (a(!0), l(z, null, D(e.items, (c) => (a(), l("div", {
2756
+ key: c.key,
2757
+ class: g(["xw-menu__item", { "xw-menu__item--active": c.key === e.selectedKey }]),
2758
+ onClick: (d) => n(c.key)
2759
+ }, [
2760
+ c.icon ? (a(), l("span", cn, p(c.icon), 1)) : x("", !0),
2761
+ o("span", dn, p(c.label), 1)
2762
+ ], 10, on))), 128))
2763
+ ], 2));
2764
+ }
2765
+ });
2766
+ const rn = /* @__PURE__ */ T(un, [["__scopeId", "data-v-b0f596a9"]]), _n = ["aria-expanded", "onKeydown"], vn = {
2767
+ key: 0,
2768
+ class: "xw-popover__title"
2769
+ }, fn = { class: "xw-popover__body" }, pn = /* @__PURE__ */ S({
2770
+ __name: "Popover",
2771
+ props: {
2772
+ title: {},
2773
+ content: {},
2774
+ trigger: { default: "click" },
2775
+ placement: { default: "top" }
2776
+ },
2777
+ setup(e) {
2778
+ const r = e, t = k(), n = k(!1), s = () => {
2779
+ r.trigger === "click" && (n.value = !n.value);
2780
+ }, i = () => {
2781
+ n.value = !1;
2782
+ }, c = () => {
2783
+ r.trigger === "hover" && (n.value = !0);
2784
+ }, d = () => {
2785
+ r.trigger === "hover" && (n.value = !1);
2786
+ }, u = (v) => {
2787
+ t.value && !t.value.contains(v.target) && (n.value = !1);
2788
+ };
2789
+ return U(() => {
2790
+ document.addEventListener("click", u);
2791
+ }), Y(() => {
2792
+ document.removeEventListener("click", u);
2793
+ }), (v, m) => (a(), l("div", {
2794
+ class: "xw-popover",
2795
+ ref_key: "popoverRef",
2796
+ ref: t
2797
+ }, [
2798
+ o("div", {
2799
+ class: "xw-popover__trigger",
2800
+ role: "button",
2801
+ tabindex: "0",
2802
+ "aria-haspopup": "dialog",
2803
+ "aria-expanded": n.value,
2804
+ onClick: s,
2805
+ onMouseenter: c,
2806
+ onMouseleave: d,
2807
+ onKeydown: [
2808
+ P(X(s, ["prevent"]), ["enter"]),
2809
+ P(X(s, ["prevent"]), ["space"]),
2810
+ P(X(i, ["prevent"]), ["esc"])
2811
+ ]
2812
+ }, [
2813
+ I(v.$slots, "default", {}, void 0, !0)
2814
+ ], 40, _n),
2815
+ n.value ? (a(), l("div", {
2816
+ key: 0,
2817
+ class: g(["xw-popover__content", `xw-popover__content--${e.placement}`]),
2818
+ role: "dialog",
2819
+ "aria-label": "气泡卡片"
2820
+ }, [
2821
+ e.title ? (a(), l("div", vn, p(e.title), 1)) : x("", !0),
2822
+ o("div", fn, [
2823
+ I(v.$slots, "content", {}, () => [
2824
+ F(p(e.content), 1)
2825
+ ], !0)
2826
+ ])
2827
+ ], 2)) : x("", !0)
2828
+ ], 512));
2829
+ }
2830
+ });
2831
+ const mn = /* @__PURE__ */ T(pn, [["__scopeId", "data-v-fc878ae2"]]), wn = [
2832
+ ["XwButton", "xw-button", we],
2833
+ ["XwInput", "xw-input", Ce],
2834
+ ["XwCheckbox", "xw-checkbox", Le],
2835
+ ["XwRadio", "xw-radio", Ee],
2836
+ ["XwSwitch", "xw-switch", Ye],
2837
+ ["XwSlider", "xw-slider", Qe],
2838
+ ["XwSelect", "xw-select", dt],
2839
+ ["XwModal", "xw-modal", wt],
2840
+ ["XwToast", "xw-toast", gt],
2841
+ ["XwTooltip", "xw-tooltip", Vt],
2842
+ ["XwLoading", "xw-loading", Lt],
2843
+ ["XwTabs", "xw-tabs", Ft],
2844
+ ["XwBreadcrumb", "xw-breadcrumb", Yt],
2845
+ ["XwPagination", "xw-pagination", la],
2846
+ ["XwLink", "xw-link", ca],
2847
+ ["XwSpace", "xw-space", ua],
2848
+ ["XwDivider", "xw-divider", _a],
2849
+ ["XwTag", "xw-tag", pa],
2850
+ ["XwBadge", "xw-badge", ha],
2851
+ ["XwRate", "xw-rate", ka],
2852
+ ["XwInputNumber", "xw-input-number", Sa],
2853
+ ["XwProgress", "xw-progress", Xa],
2854
+ ["XwAutocomplete", "xw-autocomplete", Na],
2855
+ ["XwCascader", "xw-cascader", Ha],
2856
+ ["XwDatePicker", "xw-date-picker", sl],
2857
+ ["XwTimePicker", "xw-time-picker", pl],
2858
+ ["XwTransfer", "xw-transfer", Tl],
2859
+ ["XwUpload", "xw-upload", Pl],
2860
+ ["XwAvatar", "xw-avatar", Nl],
2861
+ ["XwCard", "xw-card", Wl],
2862
+ ["XwCarousel", "xw-carousel", Ql],
2863
+ ["XwCollapse", "xw-collapse", ls],
2864
+ ["XwEmpty", "xw-empty", cs],
2865
+ ["XwImage", "xw-image", fs],
2866
+ ["XwTable", "xw-table", xs],
2867
+ ["XwTimeline", "xw-timeline", Vs],
2868
+ ["XwSkeleton", "xw-skeleton", zs],
2869
+ ["XwAlert", "xw-alert", Ps],
2870
+ ["XwDrawer", "xw-drawer", Us],
2871
+ ["XwDropdown", "xw-dropdown", js],
2872
+ ["XwSteps", "xw-steps", ln],
2873
+ ["XwBacktop", "xw-backtop", nn],
2874
+ ["XwMenu", "xw-menu", rn],
2875
+ ["XwPopover", "xw-popover", mn]
2876
+ ], xn = {
2877
+ install(e) {
2878
+ wn.forEach(([r, t, n]) => {
2879
+ e.component(r, n), e.component(t, n);
2880
+ });
2881
+ }
2882
+ };
2883
+ export {
2884
+ Ps as Alert,
2885
+ Na as Autocomplete,
2886
+ Nl as Avatar,
2887
+ nn as Backtop,
2888
+ ha as Badge,
2889
+ Yt as Breadcrumb,
2890
+ we as Button,
2891
+ Wl as Card,
2892
+ Ql as Carousel,
2893
+ Ha as Cascader,
2894
+ Le as Checkbox,
2895
+ ls as Collapse,
2896
+ sl as DatePicker,
2897
+ _a as Divider,
2898
+ Us as Drawer,
2899
+ js as Dropdown,
2900
+ cs as Empty,
2901
+ fs as Image,
2902
+ Ce as Input,
2903
+ Sa as InputNumber,
2904
+ ca as Link,
2905
+ Lt as Loading,
2906
+ rn as Menu,
2907
+ wt as Modal,
2908
+ la as Pagination,
2909
+ mn as Popover,
2910
+ Xa as Progress,
2911
+ Ee as Radio,
2912
+ ka as Rate,
2913
+ dt as Select,
2914
+ zs as Skeleton,
2915
+ Qe as Slider,
2916
+ ua as Space,
2917
+ ln as Steps,
2918
+ Ye as Switch,
2919
+ xs as Table,
2920
+ Ft as Tabs,
2921
+ pa as Tag,
2922
+ pl as TimePicker,
2923
+ Vs as Timeline,
2924
+ gt as Toast,
2925
+ Vt as Tooltip,
2926
+ Tl as Transfer,
2927
+ Pl as Upload,
2928
+ xn as default
2929
+ };