@webx-ui/core 0.0.2 → 0.2.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 (75) hide show
  1. package/dist/components/Card/Card.d.ts +3 -1
  2. package/dist/components/Card/types.d.ts +2 -2
  3. package/dist/components/Checkbox/Checkbox.d.ts +41 -0
  4. package/dist/components/Checkbox/index.d.ts +2 -0
  5. package/dist/components/Checkbox/types.d.ts +18 -0
  6. package/dist/components/CheckboxGroup/CheckboxGroup.d.ts +37 -0
  7. package/dist/components/CheckboxGroup/index.d.ts +2 -0
  8. package/dist/components/CheckboxGroup/types.d.ts +23 -0
  9. package/dist/components/ColorPicker/ColorPicker.d.ts +25 -0
  10. package/dist/components/ColorPicker/index.d.ts +2 -0
  11. package/dist/components/ColorPicker/types.d.ts +21 -0
  12. package/dist/components/DatePicker/DatePicker.d.ts +54 -0
  13. package/dist/components/DatePicker/index.d.ts +2 -0
  14. package/dist/components/DatePicker/types.d.ts +47 -0
  15. package/dist/components/DateRangePicker/DateRangePicker.d.ts +51 -0
  16. package/dist/components/DateRangePicker/index.d.ts +2 -0
  17. package/dist/components/DateRangePicker/types.d.ts +37 -0
  18. package/dist/components/DateTimePicker/DateTimePicker.d.ts +52 -0
  19. package/dist/components/DateTimePicker/index.d.ts +1 -0
  20. package/dist/components/Form/Form.d.ts +32 -0
  21. package/dist/components/Form/index.d.ts +2 -0
  22. package/dist/components/Form/types.d.ts +22 -0
  23. package/dist/components/FormItem/FormItem.d.ts +33 -0
  24. package/dist/components/FormItem/index.d.ts +2 -0
  25. package/dist/components/FormItem/types.d.ts +24 -0
  26. package/dist/components/Input/Input.d.ts +11 -10
  27. package/dist/components/Input/types.d.ts +2 -0
  28. package/dist/components/InputNumber/InputNumber.d.ts +41 -0
  29. package/dist/components/InputNumber/index.d.ts +2 -0
  30. package/dist/components/InputNumber/types.d.ts +34 -0
  31. package/dist/components/Pagination/Pagination.d.ts +45 -0
  32. package/dist/components/Pagination/index.d.ts +2 -0
  33. package/dist/components/Pagination/types.d.ts +29 -0
  34. package/dist/components/Radio/Radio.d.ts +36 -0
  35. package/dist/components/Radio/index.d.ts +2 -0
  36. package/dist/components/Radio/types.d.ts +16 -0
  37. package/dist/components/RadioGroup/RadioGroup.d.ts +35 -0
  38. package/dist/components/RadioGroup/index.d.ts +2 -0
  39. package/dist/components/RadioGroup/types.d.ts +19 -0
  40. package/dist/components/Rate/Rate.d.ts +24 -0
  41. package/dist/components/Rate/index.d.ts +2 -0
  42. package/dist/components/Rate/types.d.ts +22 -0
  43. package/dist/components/RichText/RichText.d.ts +38 -0
  44. package/dist/components/RichText/ToolbarButton.d.ts +20 -0
  45. package/dist/components/RichText/icons.d.ts +6 -0
  46. package/dist/components/RichText/index.d.ts +2 -0
  47. package/dist/components/RichText/tools.d.ts +48 -0
  48. package/dist/components/RichText/types.d.ts +42 -0
  49. package/dist/components/Select/Select.d.ts +50 -0
  50. package/dist/components/Select/index.d.ts +2 -0
  51. package/dist/components/Select/types.d.ts +41 -0
  52. package/dist/components/Slider/Slider.d.ts +26 -0
  53. package/dist/components/Slider/index.d.ts +2 -0
  54. package/dist/components/Slider/types.d.ts +24 -0
  55. package/dist/components/Switch/Switch.d.ts +38 -0
  56. package/dist/components/Switch/index.d.ts +2 -0
  57. package/dist/components/Switch/types.d.ts +18 -0
  58. package/dist/components/Table/Table.d.ts +34 -0
  59. package/dist/components/Table/index.d.ts +2 -0
  60. package/dist/components/Table/types.d.ts +142 -0
  61. package/dist/components/TagsInput/TagsInput.d.ts +32 -0
  62. package/dist/components/TagsInput/index.d.ts +2 -0
  63. package/dist/components/TagsInput/types.d.ts +26 -0
  64. package/dist/components/Textarea/Textarea.d.ts +39 -0
  65. package/dist/components/Textarea/index.d.ts +2 -0
  66. package/dist/components/Textarea/types.d.ts +31 -0
  67. package/dist/components/TimePicker/TimePicker.d.ts +52 -0
  68. package/dist/components/TimePicker/index.d.ts +1 -0
  69. package/dist/components/index.d.ts +22 -1
  70. package/dist/composables/useFormField.d.ts +64 -0
  71. package/dist/index.d.ts +1 -0
  72. package/dist/index.js +3061 -151
  73. package/dist/index.js.map +1 -1
  74. package/dist/style.css +1 -1
  75. package/package.json +12 -2
package/dist/index.js CHANGED
@@ -1,15 +1,23 @@
1
- import { defineComponent as _, computed as r, openBlock as n, createBlock as D, resolveDynamicComponent as M, mergeProps as $, withCtx as N, createElementBlock as d, renderSlot as p, createCommentVNode as f, useModel as O, ref as g, normalizeClass as k, createElementVNode as m, toDisplayString as B, mergeModels as w, useSlots as T, createTextVNode as j } from "vue";
2
- const A = {
1
+ import { defineComponent as J, computed as d, openBlock as l, createBlock as ie, resolveDynamicComponent as Ge, mergeProps as te, withCtx as Y, createElementBlock as u, renderSlot as N, createCommentVNode as C, useSlots as qe, normalizeClass as F, createElementVNode as x, createTextVNode as ae, toDisplayString as D, inject as ce, provide as xe, useModel as G, ref as q, onMounted as Ce, watch as ne, unref as b, mergeModels as R, Fragment as K, renderList as X, createVNode as O, normalizeStyle as ee, withModifiers as de, createSlots as ge, normalizeProps as ke, guardReactiveProps as we, toRef as me, withDirectives as ma, withKeys as pa, vModelText as ha, onBeforeUnmount as ya, nextTick as Ue } from "vue";
2
+ import { VueDatePicker as Ye } from "@vuepic/vue-datepicker";
3
+ import { colorToHex as Ee, getAreaBackgroundStyle as xa, getSliderBackgroundStyle as ga, PopoverRoot as ka, PopoverAnchor as wa, PopoverPortal as $a, PopoverContent as _a, ColorAreaRoot as Ba, ColorAreaArea as Ma, ColorAreaThumb as Ca, ColorSliderRoot as Sa, ColorSliderTrack as Ta, ColorSliderThumb as Ia, convertToHsb as Oe, parseColor as Va, ComboboxRoot as za, ComboboxAnchor as Pa, ComboboxInput as Wa, ComboboxTrigger as Aa, ComboboxPortal as La, ComboboxContent as Ra, ComboboxViewport as Fa, ComboboxEmpty as Ha, ComboboxItem as Da, ComboboxItemIndicator as Na, SliderRoot as Ua, SliderTrack as Ea, SliderRange as Oa, SliderThumb as ja } from "reka-ui";
4
+ import { useEditor as Ka, EditorContent as Ga } from "@tiptap/vue-3";
5
+ import qa from "@tiptap/starter-kit";
6
+ import { TableKit as Ya } from "@tiptap/extension-table";
7
+ import Xa from "@tiptap/extension-image";
8
+ import Ja from "@tiptap/extension-youtube";
9
+ import Za from "@tiptap/extension-file-handler";
10
+ const Qa = {
3
11
  key: 0,
4
12
  class: "wx-button__spinner",
5
13
  "aria-hidden": "true"
6
- }, P = {
14
+ }, et = {
7
15
  key: 1,
8
16
  class: "wx-button__icon"
9
- }, E = {
17
+ }, at = {
10
18
  key: 2,
11
19
  class: "wx-button__label"
12
- }, L = /* @__PURE__ */ _({
20
+ }, tt = /* @__PURE__ */ J({
13
21
  name: "WxButton",
14
22
  inheritAttrs: !1,
15
23
  __name: "Button",
@@ -26,77 +34,844 @@ const A = {
26
34
  nativeType: { default: "button" }
27
35
  },
28
36
  emits: ["click"],
29
- setup(t, { emit: u }) {
30
- const e = t, a = u, o = r(() => e.disabled || e.loading), l = r(() => e.href ? "a" : "button"), c = r(() => [
37
+ setup(e, { emit: _ }) {
38
+ const a = e, n = _, s = d(() => a.disabled || a.loading), t = d(() => a.href ? "a" : "button"), o = d(() => [
31
39
  "wx-button",
32
- `wx-button--${e.type}`,
33
- `wx-button--${e.variant}`,
34
- `wx-button--${e.size}`,
40
+ `wx-button--${a.type}`,
41
+ `wx-button--${a.variant}`,
42
+ `wx-button--${a.size}`,
35
43
  {
36
- "wx-button--block": e.block,
37
- "wx-button--round": e.round,
38
- "wx-button--loading": e.loading,
39
- "is-disabled": o.value
40
- }
41
- ]), v = r(
42
- () => e.href ? {
43
- href: o.value ? void 0 : e.href,
44
- target: e.target,
44
+ "wx-button--block": a.block,
45
+ "wx-button--round": a.round,
46
+ "wx-button--loading": a.loading,
47
+ "is-disabled": s.value
48
+ }
49
+ ]), c = d(
50
+ () => a.href ? {
51
+ href: s.value ? void 0 : a.href,
52
+ target: a.target,
45
53
  role: "button",
46
- "aria-disabled": o.value ? "true" : void 0,
47
- tabindex: o.value ? -1 : void 0
54
+ "aria-disabled": s.value ? "true" : void 0,
55
+ tabindex: s.value ? -1 : void 0
48
56
  } : {
49
- type: e.nativeType,
50
- disabled: o.value
57
+ type: a.nativeType,
58
+ disabled: s.value
51
59
  }
52
60
  );
53
- function x(i) {
54
- if (o.value) {
55
- i.preventDefault(), i.stopPropagation();
61
+ function p(h) {
62
+ if (s.value) {
63
+ h.preventDefault(), h.stopPropagation();
56
64
  return;
57
65
  }
58
- a("click", i);
66
+ n("click", h);
59
67
  }
60
- return (i, b) => (n(), D(M(l.value), $({ ...v.value, ...i.$attrs }, {
61
- class: c.value,
62
- "aria-busy": t.loading || void 0,
63
- onClick: x
68
+ return (h, f) => (l(), ie(Ge(t.value), te({ ...c.value, ...h.$attrs }, {
69
+ class: o.value,
70
+ "aria-busy": e.loading || void 0,
71
+ onClick: p
64
72
  }), {
65
- default: N(() => [
66
- t.loading ? (n(), d("span", A)) : i.$slots.icon ? (n(), d("span", P, [
67
- p(i.$slots, "icon", {}, void 0, !0)
68
- ])) : f("", !0),
69
- i.$slots.default ? (n(), d("span", E, [
70
- p(i.$slots, "default", {}, void 0, !0)
71
- ])) : f("", !0)
73
+ default: Y(() => [
74
+ e.loading ? (l(), u("span", Qa)) : h.$slots.icon ? (l(), u("span", et, [
75
+ N(h.$slots, "icon", {}, void 0, !0)
76
+ ])) : C("", !0),
77
+ h.$slots.default ? (l(), u("span", at, [
78
+ N(h.$slots, "default", {}, void 0, !0)
79
+ ])) : C("", !0)
72
80
  ]),
73
81
  _: 3
74
82
  }, 16, ["class", "aria-busy"]));
75
83
  }
76
- }), y = (t, u) => {
77
- const e = t.__vccOpts || t;
78
- for (const [a, o] of u)
79
- e[a] = o;
80
- return e;
81
- }, R = /* @__PURE__ */ y(L, [["__scopeId", "data-v-ab949d1e"]]), F = {
84
+ }), Q = (e, _) => {
85
+ const a = e.__vccOpts || e;
86
+ for (const [n, s] of _)
87
+ a[n] = s;
88
+ return a;
89
+ }, lt = /* @__PURE__ */ Q(tt, [["__scopeId", "data-v-11c2b24d"]]), ot = {
90
+ key: 0,
91
+ class: "wx-card__header"
92
+ }, it = { class: "wx-card__title" }, nt = {
93
+ key: 0,
94
+ class: "wx-card__extra"
95
+ }, st = { class: "wx-card__body" }, ut = {
96
+ key: 0,
97
+ class: "wx-card__layout"
98
+ }, dt = { class: "wx-card__sidebar" }, rt = { class: "wx-card__content" }, ct = {
99
+ key: 1,
100
+ class: "wx-card__footer"
101
+ }, vt = /* @__PURE__ */ J({
102
+ name: "WxCard",
103
+ __name: "Card",
104
+ props: {
105
+ title: { default: void 0 },
106
+ shadow: { default: "always" },
107
+ padding: { default: "md" },
108
+ bordered: { type: Boolean, default: !1 }
109
+ },
110
+ setup(e) {
111
+ const _ = e, a = qe(), n = d(() => !!(_.title || a.header || a.extra)), s = d(() => !!a.sidebar), t = d(() => [
112
+ "wx-card",
113
+ `wx-card--shadow-${_.shadow}`,
114
+ `wx-card--padding-${_.padding}`,
115
+ {
116
+ "wx-card--bordered": _.bordered,
117
+ "wx-card--with-sidebar": s.value
118
+ }
119
+ ]);
120
+ return (o, c) => (l(), u("section", {
121
+ class: F(t.value)
122
+ }, [
123
+ n.value ? (l(), u("header", ot, [
124
+ x("div", it, [
125
+ N(o.$slots, "header", {}, () => [
126
+ ae(D(e.title), 1)
127
+ ], !0)
128
+ ]),
129
+ o.$slots.extra ? (l(), u("div", nt, [
130
+ N(o.$slots, "extra", {}, void 0, !0)
131
+ ])) : C("", !0)
132
+ ])) : C("", !0),
133
+ x("div", st, [
134
+ s.value ? (l(), u("div", ut, [
135
+ x("aside", dt, [
136
+ N(o.$slots, "sidebar", {}, void 0, !0)
137
+ ]),
138
+ x("div", rt, [
139
+ N(o.$slots, "default", {}, void 0, !0)
140
+ ])
141
+ ])) : N(o.$slots, "default", {}, void 0, !0, 1)
142
+ ]),
143
+ o.$slots.footer ? (l(), u("footer", ct, [
144
+ N(o.$slots, "footer", {}, void 0, !0)
145
+ ])) : C("", !0)
146
+ ], 2));
147
+ }
148
+ }), ft = /* @__PURE__ */ Q(vt, [["__scopeId", "data-v-604cd918"]]), Se = /* @__PURE__ */ Symbol("wx-form"), Xe = /* @__PURE__ */ Symbol("wx-form-item");
149
+ let je = 0;
150
+ function Te(e = "wx") {
151
+ return je += 1, `${e}-${je}`;
152
+ }
153
+ function le(e) {
154
+ const _ = ce(Se, null), a = ce(Xe, null), n = Te("wx-control"), s = d(() => e.id ?? a?.id.value ?? n), t = d(
155
+ () => e.disabled || a?.disabled.value || _?.disabled.value || !1
156
+ ), o = d(
157
+ () => e.size ?? a?.size.value ?? _?.size.value ?? "md"
158
+ ), c = d(() => e.status && e.status !== "default" ? e.status : a?.status.value ?? "default"), p = d(() => a?.describedBy.value);
159
+ return { id: s, disabled: t, size: o, status: c, describedBy: p, form: _, item: a };
160
+ }
161
+ const Je = /* @__PURE__ */ Symbol("wx-checkbox-group"), Ze = /* @__PURE__ */ Symbol("wx-radio-group");
162
+ function bt(e) {
163
+ xe(Xe, e);
164
+ }
165
+ const mt = ["id", "name", "checked", "disabled", "aria-label", "aria-describedby"], pt = {
166
+ class: "wx-checkbox__box",
167
+ "aria-hidden": "true"
168
+ }, ht = {
169
+ class: "wx-checkbox__mark",
170
+ viewBox: "0 0 16 16",
171
+ fill: "none"
172
+ }, yt = {
173
+ key: 0,
174
+ d: "M4 8h8",
175
+ stroke: "currentColor",
176
+ "stroke-width": "2",
177
+ "stroke-linecap": "round"
178
+ }, xt = {
179
+ key: 1,
180
+ d: "M3.5 8.5l3 3 6-6",
181
+ stroke: "currentColor",
182
+ "stroke-width": "2",
183
+ "stroke-linecap": "round",
184
+ "stroke-linejoin": "round"
185
+ }, gt = {
186
+ key: 0,
187
+ class: "wx-checkbox__label"
188
+ }, kt = /* @__PURE__ */ J({
189
+ name: "WxCheckbox",
190
+ inheritAttrs: !1,
191
+ __name: "Checkbox",
192
+ props: /* @__PURE__ */ R({
193
+ value: { type: [String, Number, Boolean, null], default: void 0 },
194
+ label: { default: void 0 },
195
+ indeterminate: { type: Boolean, default: !1 },
196
+ disabled: { type: Boolean, default: void 0 },
197
+ size: { default: void 0 },
198
+ id: { default: void 0 },
199
+ name: { default: void 0 },
200
+ ariaLabel: { default: void 0 }
201
+ }, {
202
+ modelValue: { type: Boolean, default: !1 },
203
+ modelModifiers: {}
204
+ }),
205
+ emits: /* @__PURE__ */ R(["change"], ["update:modelValue"]),
206
+ setup(e, { emit: _ }) {
207
+ const a = e, n = _, s = G(e, "modelValue"), t = ce(Je, null), o = le(a), c = q(null), p = d(
208
+ () => t ? t.modelValue.value.includes(a.value ?? null) : s.value === !0
209
+ ), h = d(() => a.disabled || t?.disabled.value || o.disabled.value), f = d(() => a.size ?? t?.size.value ?? o.size.value), m = d(() => [
210
+ "wx-checkbox",
211
+ `wx-checkbox--${f.value}`,
212
+ {
213
+ "is-checked": p.value,
214
+ "is-indeterminate": a.indeterminate && !p.value,
215
+ "is-disabled": h.value
216
+ }
217
+ ]);
218
+ function g() {
219
+ c.value && (c.value.indeterminate = a.indeterminate && !p.value);
220
+ }
221
+ Ce(g), ne([() => a.indeterminate, p], g);
222
+ function y(P) {
223
+ const V = P.target.checked;
224
+ t ? t.toggle(a.value ?? null, V) : s.value = V, n("change", V);
225
+ }
226
+ return (P, V) => (l(), u("label", {
227
+ class: F(m.value)
228
+ }, [
229
+ x("input", te({
230
+ id: b(o).id.value,
231
+ ref_key: "inputRef",
232
+ ref: c
233
+ }, P.$attrs, {
234
+ class: "wx-checkbox__native",
235
+ type: "checkbox",
236
+ name: e.name ?? b(t)?.name.value,
237
+ checked: p.value,
238
+ disabled: h.value,
239
+ "aria-label": e.ariaLabel,
240
+ "aria-describedby": b(o).describedBy.value,
241
+ onChange: y
242
+ }), null, 16, mt),
243
+ x("span", pt, [
244
+ (l(), u("svg", ht, [
245
+ e.indeterminate && !p.value ? (l(), u("path", yt)) : (l(), u("path", xt))
246
+ ]))
247
+ ]),
248
+ e.label || P.$slots.default ? (l(), u("span", gt, [
249
+ N(P.$slots, "default", {}, () => [
250
+ ae(D(e.label), 1)
251
+ ], !0)
252
+ ])) : C("", !0)
253
+ ], 2));
254
+ }
255
+ }), ye = /* @__PURE__ */ Q(kt, [["__scopeId", "data-v-c35cc837"]]), wt = ["aria-labelledby", "aria-describedby"], $t = /* @__PURE__ */ J({
256
+ name: "WxCheckboxGroup",
257
+ __name: "CheckboxGroup",
258
+ props: /* @__PURE__ */ R({
259
+ options: { default: void 0 },
260
+ disabled: { type: Boolean, default: void 0 },
261
+ size: { default: void 0 },
262
+ name: { default: void 0 },
263
+ inline: { type: Boolean, default: !1 },
264
+ min: { default: void 0 },
265
+ max: { default: void 0 }
266
+ }, {
267
+ modelValue: { default: () => [] },
268
+ modelModifiers: {}
269
+ }),
270
+ emits: /* @__PURE__ */ R(["change"], ["update:modelValue"]),
271
+ setup(e, { emit: _ }) {
272
+ const a = e, n = _, s = G(e, "modelValue"), t = le(a);
273
+ t.item?.registerLabelTarget(void 0);
274
+ const o = d(() => a.disabled ?? t.disabled.value), c = d(() => a.size ?? t.size.value);
275
+ function p(h, f) {
276
+ const m = s.value ?? [];
277
+ if (f) {
278
+ if (m.includes(h) || a.max !== void 0 && m.length >= a.max) return;
279
+ s.value = [...m, h];
280
+ } else {
281
+ if (a.min !== void 0 && m.length <= a.min) return;
282
+ s.value = m.filter((g) => g !== h);
283
+ }
284
+ n("change", s.value);
285
+ }
286
+ return xe(Je, {
287
+ name: d(() => a.name),
288
+ modelValue: d(() => s.value ?? []),
289
+ disabled: o,
290
+ size: c,
291
+ toggle: p
292
+ }), (h, f) => (l(), u("div", {
293
+ class: F(["wx-checkbox-group", { "wx-checkbox-group--inline": e.inline }]),
294
+ role: "group",
295
+ "aria-labelledby": b(t).item ? `${b(t).item.id.value}-label` : void 0,
296
+ "aria-describedby": b(t).describedBy.value
297
+ }, [
298
+ N(h.$slots, "default", {}, () => [
299
+ (l(!0), u(K, null, X(e.options, (m) => (l(), ie(ye, {
300
+ key: String(m.value),
301
+ value: m.value,
302
+ label: m.label,
303
+ disabled: m.disabled
304
+ }, null, 8, ["value", "label", "disabled"]))), 128))
305
+ ], !0)
306
+ ], 10, wt));
307
+ }
308
+ }), _t = /* @__PURE__ */ Q($t, [["__scopeId", "data-v-8a0c916b"]]), Bt = ["disabled", "aria-label"], Mt = ["id", "value", "name", "placeholder", "disabled", "readonly", "aria-label", "aria-describedby", "aria-invalid"], Ct = {
309
+ key: 0,
310
+ class: "wx-color-picker__presets"
311
+ }, St = ["aria-label", "aria-pressed", "onClick"], Tt = /* @__PURE__ */ J({
312
+ name: "WxColorPicker",
313
+ inheritAttrs: !1,
314
+ __name: "ColorPicker",
315
+ props: /* @__PURE__ */ R({
316
+ presets: { default: () => [] },
317
+ clearable: { type: Boolean, default: !1 },
318
+ placeholder: { default: "#000000" },
319
+ teleport: { type: Boolean, default: !0 },
320
+ disabled: { type: Boolean, default: void 0 },
321
+ readonly: { type: Boolean, default: !1 },
322
+ size: { default: void 0 },
323
+ status: { default: void 0 },
324
+ id: { default: void 0 },
325
+ name: { default: void 0 },
326
+ ariaLabel: { default: void 0 }
327
+ }, {
328
+ modelValue: { default: null },
329
+ modelModifiers: {}
330
+ }),
331
+ emits: /* @__PURE__ */ R(["change"], ["update:modelValue"]),
332
+ setup(e, { emit: _ }) {
333
+ const a = /^#([0-9a-f]{3}|[0-9a-f]{6})$/i, n = e, s = _, t = G(e, "modelValue"), o = le(n), c = q(!1), p = q(t.value ?? "");
334
+ ne(t, (M) => {
335
+ p.value = M ?? "";
336
+ });
337
+ function h(M) {
338
+ return Oe(Va(M));
339
+ }
340
+ const f = q(
341
+ h(t.value && a.test(t.value) ? t.value : "#427edd")
342
+ );
343
+ ne(t, (M) => {
344
+ const w = M && a.test(M) ? M : null;
345
+ !w || w === Ee(f.value).toLowerCase() || (f.value = h(w));
346
+ });
347
+ const m = d(
348
+ () => xa(f.value, "saturation", "brightness", "hsb")
349
+ ), g = d(() => ga(f.value, "hue", "hsb")), y = d(() => t.value && a.test(t.value) ? t.value : null), P = d(() => [
350
+ "wx-color-picker",
351
+ `wx-color-picker--${o.size.value}`,
352
+ {
353
+ [`wx-color-picker--${o.status.value}`]: o.status.value !== "default",
354
+ "is-open": c.value,
355
+ "is-disabled": o.disabled.value
356
+ }
357
+ ]);
358
+ function V(M) {
359
+ t.value !== M && (t.value = M, s("change", M));
360
+ }
361
+ function B(M) {
362
+ const w = M.target.value;
363
+ p.value = w, a.test(w) ? V(w.toLowerCase()) : w === "" && V(null);
364
+ }
365
+ function $() {
366
+ if (p.value === "") {
367
+ V(null);
368
+ return;
369
+ }
370
+ const M = p.value.startsWith("#") ? p.value : `#${p.value}`;
371
+ a.test(M) ? (V(M.toLowerCase()), p.value = M.toLowerCase()) : p.value = t.value ?? "";
372
+ }
373
+ function r(M) {
374
+ f.value = Oe(M), V(Ee(M).toLowerCase());
375
+ }
376
+ function S(M) {
377
+ const w = M.toLowerCase();
378
+ f.value = h(w), V(w);
379
+ }
380
+ function z() {
381
+ V(null), p.value = "";
382
+ }
383
+ function H() {
384
+ !o.disabled.value && !n.readonly && (c.value = !0);
385
+ }
386
+ return (M, w) => (l(), ie(b(ka), {
387
+ open: c.value,
388
+ "onUpdate:open": w[0] || (w[0] = (E) => c.value = E)
389
+ }, {
390
+ default: Y(() => [
391
+ x("div", {
392
+ class: F(P.value)
393
+ }, [
394
+ O(b(wa), { "as-child": "" }, {
395
+ default: Y(() => [
396
+ x("div", {
397
+ class: "wx-color-picker__field",
398
+ onClick: H
399
+ }, [
400
+ x("button", {
401
+ class: F(["wx-color-picker__swatch", { "is-empty": !y.value }]),
402
+ type: "button",
403
+ disabled: b(o).disabled.value,
404
+ "aria-label": e.ariaLabel ?? "Pick a colour",
405
+ style: ee(y.value ? { background: y.value } : void 0)
406
+ }, null, 14, Bt),
407
+ x("input", te({
408
+ id: b(o).id.value
409
+ }, M.$attrs, {
410
+ class: "wx-color-picker__input",
411
+ type: "text",
412
+ autocomplete: "off",
413
+ spellcheck: "false",
414
+ value: p.value,
415
+ name: e.name,
416
+ placeholder: e.placeholder,
417
+ disabled: b(o).disabled.value,
418
+ readonly: e.readonly,
419
+ "aria-label": e.ariaLabel,
420
+ "aria-describedby": b(o).describedBy.value,
421
+ "aria-invalid": b(o).status.value === "error" || void 0,
422
+ onInput: B,
423
+ onBlur: $
424
+ }), null, 16, Mt),
425
+ e.clearable && y.value && !b(o).disabled.value ? (l(), u("button", {
426
+ key: 0,
427
+ class: "wx-color-picker__clear",
428
+ type: "button",
429
+ tabindex: "-1",
430
+ "aria-label": "Clear",
431
+ onClick: de(z, ["stop"])
432
+ }, " ✕ ")) : C("", !0)
433
+ ])
434
+ ]),
435
+ _: 1
436
+ }),
437
+ O(b($a), {
438
+ disabled: !e.teleport
439
+ }, {
440
+ default: Y(() => [
441
+ O(b(_a), {
442
+ class: "wx-color-picker__panel",
443
+ "side-offset": 4,
444
+ align: "start"
445
+ }, {
446
+ default: Y(() => [
447
+ O(b(Ba), {
448
+ class: "wx-color-picker__area",
449
+ "color-space": "hsb",
450
+ "x-channel": "saturation",
451
+ "y-channel": "brightness",
452
+ "model-value": f.value,
453
+ "onUpdate:color": r
454
+ }, {
455
+ default: Y(() => [
456
+ O(b(Ma), {
457
+ class: "wx-color-picker__area-surface",
458
+ style: ee(m.value)
459
+ }, {
460
+ default: Y(() => [
461
+ O(b(Ca), { class: "wx-color-picker__thumb" })
462
+ ]),
463
+ _: 1
464
+ }, 8, ["style"])
465
+ ]),
466
+ _: 1
467
+ }, 8, ["model-value"]),
468
+ O(b(Sa), {
469
+ class: "wx-color-picker__hue",
470
+ "color-space": "hsb",
471
+ channel: "hue",
472
+ "model-value": f.value,
473
+ "onUpdate:color": r
474
+ }, {
475
+ default: Y(() => [
476
+ O(b(Ta), {
477
+ class: "wx-color-picker__hue-track",
478
+ style: ee(g.value)
479
+ }, {
480
+ default: Y(() => [
481
+ O(b(Ia), { class: "wx-color-picker__thumb" })
482
+ ]),
483
+ _: 1
484
+ }, 8, ["style"])
485
+ ]),
486
+ _: 1
487
+ }, 8, ["model-value"]),
488
+ e.presets.length ? (l(), u("div", Ct, [
489
+ (l(!0), u(K, null, X(e.presets, (E) => (l(), u("button", {
490
+ key: E,
491
+ class: "wx-color-picker__preset",
492
+ type: "button",
493
+ style: ee({ background: E }),
494
+ "aria-label": E,
495
+ "aria-pressed": t.value === E,
496
+ onClick: (Z) => S(E)
497
+ }, null, 12, St))), 128))
498
+ ])) : C("", !0)
499
+ ]),
500
+ _: 1
501
+ })
502
+ ]),
503
+ _: 1
504
+ }, 8, ["disabled"])
505
+ ], 2)
506
+ ]),
507
+ _: 1
508
+ }, 8, ["open"]));
509
+ }
510
+ }), It = /* @__PURE__ */ Q(Tt, [["__scopeId", "data-v-aab2d65f"]]), Ie = /* @__PURE__ */ J({
511
+ name: "WxDatePicker",
512
+ inheritAttrs: !1,
513
+ __name: "DatePicker",
514
+ props: /* @__PURE__ */ R({
515
+ type: { default: "date" },
516
+ valueFormat: { default: void 0 },
517
+ format: { default: void 0 },
518
+ placeholder: { default: void 0 },
519
+ clearable: { type: Boolean, default: !0 },
520
+ minDate: { default: void 0 },
521
+ maxDate: { default: void 0 },
522
+ seconds: { type: Boolean, default: !1 },
523
+ minutesIncrement: { default: 1 },
524
+ is24: { type: Boolean, default: !0 },
525
+ weekStart: { default: 1 },
526
+ autoApply: { type: Boolean, default: !0 },
527
+ textInput: { type: Boolean, default: !1 },
528
+ teleport: { type: [Boolean, String], default: !0 },
529
+ disabled: { type: Boolean, default: void 0 },
530
+ readonly: { type: Boolean, default: !1 },
531
+ size: { default: void 0 },
532
+ status: { default: void 0 },
533
+ id: { default: void 0 },
534
+ name: { default: void 0 },
535
+ ariaLabel: { default: void 0 }
536
+ }, {
537
+ modelValue: { default: null },
538
+ modelModifiers: {}
539
+ }),
540
+ emits: /* @__PURE__ */ R(["change", "clear", "open", "close"], ["update:modelValue"]),
541
+ setup(e, { emit: _ }) {
542
+ const a = e, n = _, s = G(e, "modelValue"), t = le(a), o = d(() => a.type !== "date"), c = d(() => {
543
+ if (a.valueFormat !== "date")
544
+ return a.valueFormat ? a.valueFormat : a.type === "time" ? a.seconds ? "HH:mm:ss" : "HH:mm" : a.type === "datetime" ? a.seconds ? "yyyy-MM-dd HH:mm:ss" : "yyyy-MM-dd HH:mm" : "yyyy-MM-dd";
545
+ }), p = d(() => {
546
+ if (a.format) return a.format;
547
+ const V = a.seconds ? "HH:mm:ss" : "HH:mm";
548
+ return a.type === "time" ? V : a.type === "datetime" ? `dd.MM.yyyy ${V}` : "dd.MM.yyyy";
549
+ }), h = d(() => a.type === "time" ? { modeHeight: 125 } : void 0), f = d(() => ({
550
+ enableTimePicker: o.value,
551
+ enableSeconds: a.seconds,
552
+ is24: a.is24,
553
+ minutesIncrement: a.minutesIncrement
554
+ })), m = d(() => ({
555
+ id: t.id.value,
556
+ name: a.name,
557
+ clearable: a.clearable,
558
+ // The library reads `state: false` as invalid; leaving it undefined means neutral.
559
+ state: t.status.value === "error" ? !1 : void 0,
560
+ "aria-label": a.ariaLabel,
561
+ "aria-describedby": t.describedBy.value
562
+ })), g = d(() => [
563
+ "wx-datepicker",
564
+ `wx-datepicker--${t.size.value}`,
565
+ {
566
+ [`wx-datepicker--${t.status.value}`]: t.status.value !== "default",
567
+ "is-disabled": t.disabled.value
568
+ }
569
+ ]);
570
+ function y(V) {
571
+ s.value = V, n("change", V);
572
+ }
573
+ function P() {
574
+ s.value = null, n("change", null), n("clear");
575
+ }
576
+ return (V, B) => (l(), u("div", {
577
+ class: F(g.value)
578
+ }, [
579
+ O(b(Ye), te({
580
+ "model-value": s.value,
581
+ "model-type": c.value,
582
+ formats: { input: p.value },
583
+ "time-picker": e.type === "time",
584
+ "time-config": f.value,
585
+ config: h.value,
586
+ "input-attrs": m.value,
587
+ ui: { input: "wx-datepicker__input", menu: "wx-datepicker__menu" },
588
+ placeholder: e.placeholder,
589
+ "min-date": e.minDate,
590
+ "max-date": e.maxDate,
591
+ "week-start": e.weekStart,
592
+ "auto-apply": e.autoApply,
593
+ "text-input": e.textInput,
594
+ teleport: e.teleport,
595
+ disabled: b(t).disabled.value,
596
+ readonly: e.readonly
597
+ }, V.$attrs, {
598
+ "onUpdate:modelValue": y,
599
+ onCleared: P,
600
+ onOpen: B[0] || (B[0] = ($) => n("open")),
601
+ onClosed: B[1] || (B[1] = ($) => n("close"))
602
+ }), ge({ _: 2 }, [
603
+ X(V.$slots, ($, r) => ({
604
+ name: r,
605
+ fn: Y((S) => [
606
+ N(V.$slots, r, ke(we(S ?? {})))
607
+ ])
608
+ }))
609
+ ]), 1040, ["model-value", "model-type", "formats", "time-picker", "time-config", "config", "input-attrs", "placeholder", "min-date", "max-date", "week-start", "auto-apply", "text-input", "teleport", "disabled", "readonly"])
610
+ ], 2));
611
+ }
612
+ }), Vt = /* @__PURE__ */ J({
613
+ name: "WxDateRangePicker",
614
+ inheritAttrs: !1,
615
+ __name: "DateRangePicker",
616
+ props: /* @__PURE__ */ R({
617
+ valueFormat: { default: void 0 },
618
+ format: { default: void 0 },
619
+ placeholder: { default: void 0 },
620
+ clearable: { type: Boolean, default: !0 },
621
+ minDate: { default: void 0 },
622
+ maxDate: { default: void 0 },
623
+ months: { default: 2 },
624
+ weekStart: { default: 1 },
625
+ autoApply: { type: Boolean, default: !0 },
626
+ textInput: { type: Boolean, default: !1 },
627
+ teleport: { type: Boolean, default: !0 },
628
+ disabled: { type: Boolean, default: void 0 },
629
+ readonly: { type: Boolean, default: !1 },
630
+ size: { default: void 0 },
631
+ status: { default: void 0 },
632
+ id: { default: void 0 },
633
+ name: { default: void 0 },
634
+ ariaLabel: { default: void 0 }
635
+ }, {
636
+ modelValue: { default: null },
637
+ modelModifiers: {}
638
+ }),
639
+ emits: /* @__PURE__ */ R(["change", "clear", "open", "close"], ["update:modelValue"]),
640
+ setup(e, { emit: _ }) {
641
+ const a = e, n = _, s = G(e, "modelValue"), t = le(a), o = d(
642
+ () => a.valueFormat === "date" ? void 0 : a.valueFormat ?? "yyyy-MM-dd"
643
+ ), c = d(() => a.format ?? "dd.MM.yyyy"), p = d(() => ({
644
+ id: t.id.value,
645
+ name: a.name,
646
+ clearable: a.clearable,
647
+ state: t.status.value === "error" ? !1 : void 0,
648
+ "aria-label": a.ariaLabel,
649
+ "aria-describedby": t.describedBy.value
650
+ })), h = d(() => [
651
+ "wx-datepicker",
652
+ "wx-datepicker--range",
653
+ `wx-datepicker--${t.size.value}`,
654
+ {
655
+ [`wx-datepicker--${t.status.value}`]: t.status.value !== "default",
656
+ "is-disabled": t.disabled.value
657
+ }
658
+ ]);
659
+ function f(g) {
660
+ s.value = g, n("change", g);
661
+ }
662
+ function m() {
663
+ s.value = null, n("change", null), n("clear");
664
+ }
665
+ return (g, y) => (l(), u("div", {
666
+ class: F(h.value)
667
+ }, [
668
+ O(b(Ye), te({
669
+ range: "",
670
+ "model-value": s.value,
671
+ "model-type": o.value,
672
+ formats: { input: c.value },
673
+ "multi-calendars": e.months,
674
+ "input-attrs": p.value,
675
+ ui: { input: "wx-datepicker__input", menu: "wx-datepicker__menu" },
676
+ placeholder: e.placeholder,
677
+ "min-date": e.minDate,
678
+ "max-date": e.maxDate,
679
+ "week-start": e.weekStart,
680
+ "auto-apply": e.autoApply,
681
+ "text-input": e.textInput,
682
+ teleport: e.teleport,
683
+ disabled: b(t).disabled.value,
684
+ readonly: e.readonly
685
+ }, g.$attrs, {
686
+ "onUpdate:modelValue": f,
687
+ onCleared: m,
688
+ onOpen: y[0] || (y[0] = (P) => n("open")),
689
+ onClosed: y[1] || (y[1] = (P) => n("close"))
690
+ }), ge({ _: 2 }, [
691
+ X(g.$slots, (P, V) => ({
692
+ name: V,
693
+ fn: Y((B) => [
694
+ N(g.$slots, V, ke(we(B ?? {})))
695
+ ])
696
+ }))
697
+ ]), 1040, ["model-value", "model-type", "formats", "multi-calendars", "input-attrs", "placeholder", "min-date", "max-date", "week-start", "auto-apply", "text-input", "teleport", "disabled", "readonly"])
698
+ ], 2));
699
+ }
700
+ }), zt = /* @__PURE__ */ J({
701
+ name: "WxDateTimePicker",
702
+ __name: "DateTimePicker",
703
+ props: /* @__PURE__ */ R({
704
+ valueFormat: { default: void 0 },
705
+ format: { default: void 0 },
706
+ placeholder: { default: void 0 },
707
+ clearable: { type: Boolean, default: void 0 },
708
+ minDate: { default: void 0 },
709
+ maxDate: { default: void 0 },
710
+ seconds: { type: Boolean, default: void 0 },
711
+ minutesIncrement: { default: void 0 },
712
+ is24: { type: Boolean, default: void 0 },
713
+ weekStart: { default: void 0 },
714
+ autoApply: { type: Boolean, default: void 0 },
715
+ textInput: { type: Boolean, default: void 0 },
716
+ teleport: { type: [Boolean, String], default: void 0 },
717
+ disabled: { type: Boolean, default: void 0 },
718
+ readonly: { type: Boolean, default: void 0 },
719
+ size: { default: void 0 },
720
+ status: { default: void 0 },
721
+ id: { default: void 0 },
722
+ name: { default: void 0 },
723
+ ariaLabel: { default: void 0 }
724
+ }, {
725
+ modelValue: { default: null },
726
+ modelModifiers: {}
727
+ }),
728
+ emits: ["update:modelValue"],
729
+ setup(e) {
730
+ const _ = G(e, "modelValue");
731
+ return (a, n) => (l(), ie(Ie, te({
732
+ modelValue: _.value,
733
+ "onUpdate:modelValue": n[0] || (n[0] = (s) => _.value = s),
734
+ type: "datetime"
735
+ }, a.$props), ge({ _: 2 }, [
736
+ X(a.$slots, (s, t) => ({
737
+ name: t,
738
+ fn: Y((o) => [
739
+ N(a.$slots, t, ke(we(o ?? {})))
740
+ ])
741
+ }))
742
+ ]), 1040, ["modelValue"]));
743
+ }
744
+ }), Pt = /* @__PURE__ */ J({
745
+ name: "WxForm",
746
+ __name: "Form",
747
+ props: {
748
+ errors: { default: void 0 },
749
+ disabled: { type: Boolean, default: !1 },
750
+ size: { default: "md" },
751
+ labelPosition: { default: "top" },
752
+ labelWidth: { default: void 0 },
753
+ gap: { default: "md" }
754
+ },
755
+ emits: ["submit", "reset"],
756
+ setup(e, { emit: _ }) {
757
+ const a = e, n = _, s = d(() => a.errors ?? {});
758
+ xe(Se, {
759
+ errors: s,
760
+ disabled: me(a, "disabled"),
761
+ size: me(a, "size"),
762
+ labelPosition: me(a, "labelPosition"),
763
+ labelWidth: me(a, "labelWidth")
764
+ });
765
+ function t(c) {
766
+ c.preventDefault(), n("submit", c);
767
+ }
768
+ function o(c) {
769
+ n("reset", c);
770
+ }
771
+ return (c, p) => (l(), u("form", {
772
+ class: F(["wx-form", `wx-form--gap-${e.gap}`, `wx-form--label-${e.labelPosition}`]),
773
+ novalidate: "",
774
+ onSubmit: t,
775
+ onReset: o
776
+ }, [
777
+ N(c.$slots, "default", {}, void 0, !0)
778
+ ], 34));
779
+ }
780
+ }), Wt = /* @__PURE__ */ Q(Pt, [["__scopeId", "data-v-bfab857f"]]), At = {
781
+ key: 0,
782
+ class: "wx-form-item__required",
783
+ "aria-hidden": "true"
784
+ }, Lt = { class: "wx-form-item__control" }, Rt = {
785
+ key: 2,
786
+ class: "wx-form-item__error",
787
+ "aria-hidden": "true"
788
+ }, Ft = /* @__PURE__ */ J({
789
+ name: "WxFormItem",
790
+ __name: "FormItem",
791
+ props: {
792
+ label: { default: void 0 },
793
+ name: { default: void 0 },
794
+ required: { type: Boolean, default: !1 },
795
+ error: { default: void 0 },
796
+ help: { default: void 0 },
797
+ disabled: { type: Boolean, default: !1 },
798
+ size: { default: void 0 },
799
+ labelWidth: { default: void 0 },
800
+ reserveErrorSpace: { type: Boolean, default: !1 }
801
+ },
802
+ setup(e, { expose: _ }) {
803
+ const a = e, n = ce(Se, null), s = Te("wx-field"), t = `${s}-error`, o = `${s}-help`, c = q("control"), p = q(s);
804
+ function h(r) {
805
+ if (r === void 0) {
806
+ c.value = "group";
807
+ return;
808
+ }
809
+ c.value = "control", p.value = r;
810
+ }
811
+ const f = d(() => a.error !== void 0 ? Array.isArray(a.error) ? a.error : [a.error] : a.name && n ? n.errors.value[a.name] ?? [] : []), m = d(() => f.value.length > 0), g = d(() => m.value ? "error" : "default"), y = d(() => m.value ? t : a.help ? o : void 0), P = d(() => a.size), V = d(() => a.disabled), B = d(() => a.labelWidth ?? n?.labelWidth.value), $ = d(() => n?.labelPosition.value === "left");
812
+ return bt({
813
+ id: d(() => s),
814
+ describedBy: y,
815
+ status: g,
816
+ disabled: V,
817
+ size: P,
818
+ registerLabelTarget: h
819
+ }), _({ messages: f, hasError: m }), (r, S) => (l(), u("div", {
820
+ class: F([
821
+ "wx-form-item",
822
+ { "wx-form-item--inline": $.value, "is-error": m.value, "is-required": e.required }
823
+ ]),
824
+ style: ee($.value && B.value ? { "--wx-form-item-label-width": B.value } : void 0)
825
+ }, [
826
+ e.label || r.$slots.label ? (l(), ie(Ge(c.value === "group" ? "span" : "label"), {
827
+ key: 0,
828
+ id: `${b(s)}-label`,
829
+ class: "wx-form-item__label",
830
+ for: c.value === "group" ? void 0 : p.value
831
+ }, {
832
+ default: Y(() => [
833
+ N(r.$slots, "label", {}, () => [
834
+ ae(D(e.label), 1)
835
+ ], !0),
836
+ e.required ? (l(), u("span", At, "*")) : C("", !0)
837
+ ]),
838
+ _: 3
839
+ }, 8, ["id", "for"])) : C("", !0),
840
+ x("div", Lt, [
841
+ N(r.$slots, "default", {}, void 0, !0),
842
+ m.value ? (l(), u("p", {
843
+ key: 0,
844
+ id: t,
845
+ class: "wx-form-item__error",
846
+ role: "alert"
847
+ }, D(f.value[0]), 1)) : e.help ? (l(), u("p", {
848
+ key: 1,
849
+ id: o,
850
+ class: "wx-form-item__help"
851
+ }, D(e.help), 1)) : e.reserveErrorSpace ? (l(), u("p", Rt, " ")) : C("", !0)
852
+ ])
853
+ ], 6));
854
+ }
855
+ }), Ht = /* @__PURE__ */ Q(Ft, [["__scopeId", "data-v-0b8142de"]]), Dt = {
82
856
  key: 0,
83
857
  class: "wx-input__affix wx-input__affix--prefix"
84
- }, H = ["type", "value", "placeholder", "disabled", "readonly", "maxlength", "autocomplete", "aria-label", "aria-invalid"], U = {
858
+ }, Nt = ["id", "type", "value", "placeholder", "disabled", "readonly", "maxlength", "autocomplete", "aria-label", "aria-describedby", "aria-invalid"], Ut = {
85
859
  key: 2,
86
860
  class: "wx-input__count"
87
- }, q = {
861
+ }, Et = {
88
862
  key: 3,
89
863
  class: "wx-input__affix wx-input__affix--suffix"
90
- }, G = /* @__PURE__ */ _({
864
+ }, Ot = /* @__PURE__ */ J({
91
865
  name: "WxInput",
92
866
  inheritAttrs: !1,
93
867
  __name: "Input",
94
- props: /* @__PURE__ */ w({
868
+ props: /* @__PURE__ */ R({
869
+ id: { default: void 0 },
95
870
  type: { default: "text" },
96
- size: { default: "md" },
97
- status: { default: "default" },
871
+ size: { default: void 0 },
872
+ status: { default: void 0 },
98
873
  placeholder: { default: void 0 },
99
- disabled: { type: Boolean, default: !1 },
874
+ disabled: { type: Boolean, default: void 0 },
100
875
  readonly: { type: Boolean, default: !1 },
101
876
  clearable: { type: Boolean, default: !1 },
102
877
  maxlength: { default: void 0 },
@@ -107,147 +882,2282 @@ const A = {
107
882
  modelValue: { default: "" },
108
883
  modelModifiers: {}
109
884
  }),
110
- emits: /* @__PURE__ */ w(["input", "change", "focus", "blur", "clear"], ["update:modelValue"]),
111
- setup(t, { expose: u, emit: e }) {
112
- const a = t, o = e, l = O(t, "modelValue"), c = g(null), v = g(!1), x = r(() => l.value == null ? "" : String(l.value)), i = r(
113
- () => a.clearable && !a.disabled && !a.readonly && x.value.length > 0
114
- ), b = r(
115
- () => a.showCount && a.maxlength ? `${x.value.length}/${a.maxlength}` : null
116
- ), C = r(() => [
885
+ emits: /* @__PURE__ */ R(["input", "change", "focus", "blur", "clear"], ["update:modelValue"]),
886
+ setup(e, { expose: _, emit: a }) {
887
+ const n = e, s = a, t = G(e, "modelValue"), o = le(n), c = q(null), p = q(!1), h = d(() => t.value == null ? "" : String(t.value)), f = d(
888
+ () => n.clearable && !o.disabled.value && !n.readonly && h.value.length > 0
889
+ ), m = d(
890
+ () => n.showCount && n.maxlength ? `${h.value.length}/${n.maxlength}` : null
891
+ ), g = d(() => [
117
892
  "wx-input",
118
- `wx-input--${a.size}`,
893
+ `wx-input--${o.size.value}`,
119
894
  {
120
- [`wx-input--${a.status}`]: a.status !== "default",
121
- "is-focused": v.value,
122
- "is-disabled": a.disabled,
123
- "is-readonly": a.readonly
895
+ [`wx-input--${o.status.value}`]: o.status.value !== "default",
896
+ "is-focused": p.value,
897
+ "is-disabled": o.disabled.value,
898
+ "is-readonly": n.readonly
124
899
  }
125
900
  ]);
126
- function W(s) {
127
- const h = s.target.value;
128
- l.value = h, o("input", h);
901
+ function y(r) {
902
+ const S = r.target.value;
903
+ t.value = S, s("input", S);
129
904
  }
130
- function I(s) {
131
- o("change", s.target.value);
905
+ function P(r) {
906
+ s("change", r.target.value);
132
907
  }
133
- function V(s) {
134
- v.value = !0, o("focus", s);
908
+ function V(r) {
909
+ p.value = !0, s("focus", r);
135
910
  }
136
- function z(s) {
137
- v.value = !1, o("blur", s);
911
+ function B(r) {
912
+ p.value = !1, s("blur", r);
138
913
  }
139
- function S() {
140
- l.value = "", o("input", ""), o("change", ""), o("clear"), c.value?.focus();
914
+ function $() {
915
+ t.value = "", s("input", ""), s("change", ""), s("clear"), c.value?.focus();
141
916
  }
142
- return u({
917
+ return _({
143
918
  focus: () => c.value?.focus(),
144
919
  blur: () => c.value?.blur(),
145
920
  select: () => c.value?.select(),
146
921
  input: c
147
- }), (s, h) => (n(), d("div", {
148
- class: k(C.value)
922
+ }), (r, S) => (l(), u("div", {
923
+ class: F(g.value)
149
924
  }, [
150
- s.$slots.prefix ? (n(), d("span", F, [
151
- p(s.$slots, "prefix", {}, void 0, !0)
152
- ])) : f("", !0),
153
- m("input", $({
925
+ r.$slots.prefix ? (l(), u("span", Dt, [
926
+ N(r.$slots, "prefix", {}, void 0, !0)
927
+ ])) : C("", !0),
928
+ x("input", te({
929
+ id: b(o).id.value,
154
930
  ref_key: "inputRef",
155
931
  ref: c
156
- }, s.$attrs, {
932
+ }, r.$attrs, {
157
933
  class: "wx-input__inner",
158
- type: t.type,
159
- value: x.value,
160
- placeholder: t.placeholder,
161
- disabled: t.disabled,
162
- readonly: t.readonly,
163
- maxlength: t.maxlength,
164
- autocomplete: t.autocomplete,
165
- "aria-label": t.ariaLabel,
166
- "aria-invalid": t.status === "error" || void 0,
167
- onInput: W,
168
- onChange: I,
934
+ type: e.type,
935
+ value: h.value,
936
+ placeholder: e.placeholder,
937
+ disabled: b(o).disabled.value,
938
+ readonly: e.readonly,
939
+ maxlength: e.maxlength,
940
+ autocomplete: e.autocomplete,
941
+ "aria-label": e.ariaLabel,
942
+ "aria-describedby": b(o).describedBy.value,
943
+ "aria-invalid": b(o).status.value === "error" || void 0,
944
+ onInput: y,
945
+ onChange: P,
169
946
  onFocus: V,
170
- onBlur: z
171
- }), null, 16, H),
172
- i.value ? (n(), d("button", {
947
+ onBlur: B
948
+ }), null, 16, Nt),
949
+ f.value ? (l(), u("button", {
173
950
  key: 1,
174
951
  class: "wx-input__clear",
175
952
  type: "button",
176
953
  tabindex: "-1",
177
954
  "aria-label": "Clear",
178
- onClick: S
179
- }, " ✕ ")) : f("", !0),
180
- b.value ? (n(), d("span", U, B(b.value), 1)) : f("", !0),
181
- s.$slots.suffix ? (n(), d("span", q, [
182
- p(s.$slots, "suffix", {}, void 0, !0)
183
- ])) : f("", !0)
955
+ onClick: $
956
+ }, " ✕ ")) : C("", !0),
957
+ m.value ? (l(), u("span", Ut, D(m.value), 1)) : C("", !0),
958
+ r.$slots.suffix ? (l(), u("span", Et, [
959
+ N(r.$slots, "suffix", {}, void 0, !0)
960
+ ])) : C("", !0)
961
+ ], 2));
962
+ }
963
+ }), Qe = /* @__PURE__ */ Q(Ot, [["__scopeId", "data-v-82a546ac"]]), jt = ["disabled"], Kt = ["id", "name", "value", "placeholder", "disabled", "readonly", "aria-label", "aria-describedby", "aria-invalid", "aria-valuenow", "aria-valuemin", "aria-valuemax"], Gt = ["disabled"], qt = /* @__PURE__ */ J({
964
+ name: "WxInputNumber",
965
+ inheritAttrs: !1,
966
+ __name: "InputNumber",
967
+ props: /* @__PURE__ */ R({
968
+ min: { default: void 0 },
969
+ max: { default: void 0 },
970
+ step: { default: 1 },
971
+ precision: { default: void 0 },
972
+ controls: { type: Boolean, default: !0 },
973
+ controlsPosition: { default: "sides" },
974
+ wheel: { type: Boolean, default: !1 },
975
+ size: { default: void 0 },
976
+ status: { default: void 0 },
977
+ id: { default: void 0 },
978
+ name: { default: void 0 },
979
+ placeholder: { default: void 0 },
980
+ disabled: { type: Boolean, default: void 0 },
981
+ readonly: { type: Boolean, default: !1 },
982
+ ariaLabel: { default: void 0 }
983
+ }, {
984
+ modelValue: { default: null },
985
+ modelModifiers: {}
986
+ }),
987
+ emits: /* @__PURE__ */ R(["change", "focus", "blur"], ["update:modelValue"]),
988
+ setup(e, { expose: _, emit: a }) {
989
+ const n = e, s = a, t = G(e, "modelValue"), o = le(n), c = q(null), p = q(!1), h = d(() => {
990
+ if (n.precision !== void 0) return n.precision;
991
+ const [, W = ""] = String(n.step).split(".");
992
+ return W.length;
993
+ });
994
+ function f(W) {
995
+ const U = 10 ** h.value;
996
+ return Math.round((W + Number.EPSILON) * U) / U;
997
+ }
998
+ function m(W) {
999
+ let U = W;
1000
+ return n.min !== void 0 && (U = Math.max(U, n.min)), n.max !== void 0 && (U = Math.min(U, n.max)), f(U);
1001
+ }
1002
+ const g = d(
1003
+ () => typeof t.value == "number" && Number.isFinite(t.value) ? t.value : null
1004
+ ), y = q(g.value === null ? "" : g.value.toFixed(h.value));
1005
+ ne(g, (W) => {
1006
+ p.value || (y.value = W === null ? "" : W.toFixed(h.value));
1007
+ });
1008
+ const P = d(() => o.disabled.value), V = d(
1009
+ () => !P.value && !n.readonly && (n.min === void 0 || (g.value ?? 0) > n.min)
1010
+ ), B = d(
1011
+ () => !P.value && !n.readonly && (n.max === void 0 || (g.value ?? 0) < n.max)
1012
+ ), $ = d(() => [
1013
+ "wx-input-number",
1014
+ `wx-input-number--${o.size.value}`,
1015
+ `wx-input-number--controls-${n.controls ? n.controlsPosition : "none"}`,
1016
+ {
1017
+ [`wx-input-number--${o.status.value}`]: o.status.value !== "default",
1018
+ "is-focused": p.value,
1019
+ "is-disabled": P.value
1020
+ }
1021
+ ]);
1022
+ function r(W) {
1023
+ t.value !== W && (t.value = W, s("change", W));
1024
+ }
1025
+ function S(W) {
1026
+ if (P.value || n.readonly) return;
1027
+ const U = g.value ?? m(0), T = m(U + W * n.step);
1028
+ r(T), y.value = T.toFixed(h.value);
1029
+ }
1030
+ function z(W) {
1031
+ y.value = W.target.value;
1032
+ const U = Number.parseFloat(y.value);
1033
+ y.value === "" ? r(null) : Number.isFinite(U) && r(f(U));
1034
+ }
1035
+ function H() {
1036
+ if (y.value.trim() === "") {
1037
+ r(null), y.value = "";
1038
+ return;
1039
+ }
1040
+ const W = Number.parseFloat(y.value);
1041
+ if (!Number.isFinite(W)) {
1042
+ y.value = g.value === null ? "" : g.value.toFixed(h.value);
1043
+ return;
1044
+ }
1045
+ const U = m(W);
1046
+ r(U), y.value = U.toFixed(h.value);
1047
+ }
1048
+ function M(W) {
1049
+ p.value = !0, s("focus", W);
1050
+ }
1051
+ function w(W) {
1052
+ p.value = !1, H(), s("blur", W);
1053
+ }
1054
+ function E(W) {
1055
+ !n.wheel || !p.value || P.value || n.readonly || (W.preventDefault(), S(W.deltaY < 0 ? 1 : -1));
1056
+ }
1057
+ function Z(W) {
1058
+ W.key === "ArrowUp" ? (W.preventDefault(), S(1)) : W.key === "ArrowDown" ? (W.preventDefault(), S(-1)) : W.key === "Enter" && H();
1059
+ }
1060
+ return _({
1061
+ focus: () => c.value?.focus(),
1062
+ blur: () => c.value?.blur(),
1063
+ increase: () => S(1),
1064
+ decrease: () => S(-1),
1065
+ input: c
1066
+ }), (W, U) => (l(), u("div", {
1067
+ class: F($.value)
1068
+ }, [
1069
+ e.controls ? (l(), u("button", {
1070
+ key: 0,
1071
+ class: "wx-input-number__button wx-input-number__button--decrease",
1072
+ type: "button",
1073
+ tabindex: "-1",
1074
+ "aria-label": "Decrease",
1075
+ disabled: !V.value,
1076
+ onClick: U[0] || (U[0] = (T) => S(-1))
1077
+ }, [...U[2] || (U[2] = [
1078
+ x("svg", {
1079
+ viewBox: "0 0 16 16",
1080
+ fill: "none",
1081
+ "aria-hidden": "true"
1082
+ }, [
1083
+ x("path", {
1084
+ d: "M3.5 8h9",
1085
+ stroke: "currentColor",
1086
+ "stroke-width": "1.5",
1087
+ "stroke-linecap": "round"
1088
+ })
1089
+ ], -1)
1090
+ ])], 8, jt)) : C("", !0),
1091
+ x("input", te({
1092
+ id: b(o).id.value,
1093
+ ref_key: "inputRef",
1094
+ ref: c
1095
+ }, W.$attrs, {
1096
+ class: "wx-input-number__inner",
1097
+ type: "text",
1098
+ inputmode: "decimal",
1099
+ autocomplete: "off",
1100
+ name: e.name,
1101
+ value: y.value,
1102
+ placeholder: e.placeholder,
1103
+ disabled: P.value,
1104
+ readonly: e.readonly,
1105
+ "aria-label": e.ariaLabel,
1106
+ "aria-describedby": b(o).describedBy.value,
1107
+ "aria-invalid": b(o).status.value === "error" || void 0,
1108
+ role: "spinbutton",
1109
+ "aria-valuenow": g.value ?? void 0,
1110
+ "aria-valuemin": e.min,
1111
+ "aria-valuemax": e.max,
1112
+ onInput: z,
1113
+ onFocus: M,
1114
+ onBlur: w,
1115
+ onKeydown: Z,
1116
+ onWheel: E
1117
+ }), null, 16, Kt),
1118
+ e.controls ? (l(), u("button", {
1119
+ key: 1,
1120
+ class: "wx-input-number__button wx-input-number__button--increase",
1121
+ type: "button",
1122
+ tabindex: "-1",
1123
+ "aria-label": "Increase",
1124
+ disabled: !B.value,
1125
+ onClick: U[1] || (U[1] = (T) => S(1))
1126
+ }, [...U[3] || (U[3] = [
1127
+ x("svg", {
1128
+ viewBox: "0 0 16 16",
1129
+ fill: "none",
1130
+ "aria-hidden": "true"
1131
+ }, [
1132
+ x("path", {
1133
+ d: "M8 3.5v9M3.5 8h9",
1134
+ stroke: "currentColor",
1135
+ "stroke-width": "1.5",
1136
+ "stroke-linecap": "round"
1137
+ })
1138
+ ], -1)
1139
+ ])], 8, Gt)) : C("", !0)
184
1140
  ], 2));
185
1141
  }
186
- }), J = /* @__PURE__ */ y(G, [["__scopeId", "data-v-962ec44e"]]), K = {
1142
+ }), Yt = /* @__PURE__ */ Q(qt, [["__scopeId", "data-v-1dcbf297"]]), Xt = ["aria-label"], Jt = {
187
1143
  key: 0,
188
- class: "wx-card__header"
189
- }, Q = { class: "wx-card__title" }, X = {
1144
+ class: "wx-pagination__total"
1145
+ }, Zt = { class: "wx-pagination__controls" }, Qt = {
190
1146
  key: 0,
191
- class: "wx-card__extra"
192
- }, Y = { class: "wx-card__body" }, Z = {
1147
+ class: "wx-pagination__per-page"
1148
+ }, el = ["value", "disabled"], al = ["value"], tl = { class: "wx-pagination__list" }, ll = ["disabled"], ol = {
1149
+ key: 0,
1150
+ class: "wx-pagination__gap",
1151
+ "aria-hidden": "true"
1152
+ }, il = ["disabled", "aria-current", "aria-label", "onClick"], nl = ["disabled"], sl = /* @__PURE__ */ J({
1153
+ name: "WxPagination",
1154
+ __name: "Pagination",
1155
+ props: /* @__PURE__ */ R({
1156
+ paginator: { default: null },
1157
+ total: { default: void 0 },
1158
+ lastPage: { default: void 0 },
1159
+ siblings: { default: 1 },
1160
+ perPageOptions: { default: () => [] },
1161
+ showTotal: { type: Boolean, default: !0 },
1162
+ disabled: { type: Boolean, default: !1 },
1163
+ size: { default: "md" },
1164
+ ariaLabel: { default: "Pagination" }
1165
+ }, {
1166
+ page: { default: void 0 },
1167
+ pageModifiers: {},
1168
+ perPage: { default: void 0 },
1169
+ perPageModifiers: {}
1170
+ }),
1171
+ emits: /* @__PURE__ */ R(["change"], ["update:page", "update:perPage"]),
1172
+ setup(e, { emit: _ }) {
1173
+ const a = e, n = _, s = G(e, "page"), t = G(e, "perPage"), o = d(() => t.value ?? a.paginator?.per_page ?? 15), c = d(() => a.total ?? a.paginator?.total ?? 0), p = d(() => a.lastPage !== void 0 ? Math.max(1, a.lastPage) : a.paginator ? Math.max(1, a.paginator.last_page) : Math.max(1, Math.ceil(c.value / o.value))), h = d(() => {
1174
+ const B = s.value ?? a.paginator?.current_page ?? 1;
1175
+ return Math.min(Math.max(1, B), p.value);
1176
+ }), f = d(() => a.paginator ? a.paginator.from : c.value === 0 ? null : (h.value - 1) * o.value + 1), m = d(() => a.paginator ? a.paginator.to : c.value === 0 ? null : Math.min(c.value, h.value * o.value)), g = d(() => {
1177
+ const B = p.value, $ = h.value, r = a.siblings, S = /* @__PURE__ */ new Set([1, B]);
1178
+ for (let w = $ - r; w <= $ + r; w++)
1179
+ w >= 1 && w <= B && S.add(w);
1180
+ const z = [...S].sort((w, E) => w - E), H = [];
1181
+ let M = 0;
1182
+ for (const w of z) {
1183
+ const E = w - M;
1184
+ M && E === 2 ? H.push({ type: "page", value: w - 1 }) : M && E > 2 && H.push({ type: "gap", value: `gap-${w}` }), H.push({ type: "page", value: w }), M = w;
1185
+ }
1186
+ return H;
1187
+ }), y = d(() => [
1188
+ "wx-pagination",
1189
+ `wx-pagination--${a.size}`,
1190
+ { "is-disabled": a.disabled }
1191
+ ]);
1192
+ function P(B) {
1193
+ const $ = Math.min(Math.max(1, B), p.value);
1194
+ a.disabled || $ === h.value || (s.value = $, n("change", { page: $, perPage: o.value }));
1195
+ }
1196
+ function V(B) {
1197
+ const $ = Number(B.target.value);
1198
+ !Number.isFinite($) || $ === o.value || (t.value = $, s.value = 1, n("change", { page: 1, perPage: $ }));
1199
+ }
1200
+ return (B, $) => (l(), u("nav", {
1201
+ class: F(y.value),
1202
+ "aria-label": e.ariaLabel
1203
+ }, [
1204
+ e.showTotal ? (l(), u("p", Jt, [
1205
+ N(B.$slots, "total", {
1206
+ from: f.value,
1207
+ to: m.value,
1208
+ total: c.value
1209
+ }, () => [
1210
+ f.value === null ? (l(), u(K, { key: 0 }, [
1211
+ ae("Nothing to show")
1212
+ ], 64)) : (l(), u(K, { key: 1 }, [
1213
+ ae(D(f.value) + "–" + D(m.value) + " of " + D(c.value), 1)
1214
+ ], 64))
1215
+ ], !0)
1216
+ ])) : C("", !0),
1217
+ x("div", Zt, [
1218
+ e.perPageOptions.length ? (l(), u("label", Qt, [
1219
+ $[2] || ($[2] = x("span", { class: "wx-pagination__per-page-label" }, "Per page", -1)),
1220
+ x("select", {
1221
+ class: "wx-pagination__select",
1222
+ value: o.value,
1223
+ disabled: e.disabled,
1224
+ onChange: V
1225
+ }, [
1226
+ (l(!0), u(K, null, X(e.perPageOptions, (r) => (l(), u("option", {
1227
+ key: r,
1228
+ value: r
1229
+ }, D(r), 9, al))), 128))
1230
+ ], 40, el)
1231
+ ])) : C("", !0),
1232
+ x("ul", tl, [
1233
+ x("li", null, [
1234
+ x("button", {
1235
+ class: "wx-pagination__button wx-pagination__button--arrow",
1236
+ type: "button",
1237
+ disabled: e.disabled || h.value <= 1,
1238
+ "aria-label": "Previous page",
1239
+ onClick: $[0] || ($[0] = (r) => P(h.value - 1))
1240
+ }, [...$[3] || ($[3] = [
1241
+ x("svg", {
1242
+ viewBox: "0 0 8 12",
1243
+ "aria-hidden": "true"
1244
+ }, [
1245
+ x("path", { d: "M6.5 1 1.5 6l5 5" })
1246
+ ], -1)
1247
+ ])], 8, ll)
1248
+ ]),
1249
+ (l(!0), u(K, null, X(g.value, (r) => (l(), u("li", {
1250
+ key: r.value
1251
+ }, [
1252
+ r.type === "gap" ? (l(), u("span", ol, "…")) : (l(), u("button", {
1253
+ key: 1,
1254
+ class: F(["wx-pagination__button", { "is-current": r.value === h.value }]),
1255
+ type: "button",
1256
+ disabled: e.disabled,
1257
+ "aria-current": r.value === h.value ? "page" : void 0,
1258
+ "aria-label": `Page ${r.value}`,
1259
+ onClick: (S) => P(r.value)
1260
+ }, D(r.value), 11, il))
1261
+ ]))), 128)),
1262
+ x("li", null, [
1263
+ x("button", {
1264
+ class: "wx-pagination__button wx-pagination__button--arrow",
1265
+ type: "button",
1266
+ disabled: e.disabled || h.value >= p.value,
1267
+ "aria-label": "Next page",
1268
+ onClick: $[1] || ($[1] = (r) => P(h.value + 1))
1269
+ }, [...$[4] || ($[4] = [
1270
+ x("svg", {
1271
+ viewBox: "0 0 8 12",
1272
+ "aria-hidden": "true"
1273
+ }, [
1274
+ x("path", { d: "M1.5 1 6.5 6l-5 5" })
1275
+ ], -1)
1276
+ ])], 8, nl)
1277
+ ])
1278
+ ])
1279
+ ])
1280
+ ], 10, Xt));
1281
+ }
1282
+ }), ea = /* @__PURE__ */ Q(sl, [["__scopeId", "data-v-5371c9ef"]]), ul = ["id", "name", "checked", "disabled", "aria-label", "aria-describedby"], dl = {
1283
+ key: 0,
1284
+ class: "wx-radio__label"
1285
+ }, rl = /* @__PURE__ */ J({
1286
+ name: "WxRadio",
1287
+ inheritAttrs: !1,
1288
+ __name: "Radio",
1289
+ props: /* @__PURE__ */ R({
1290
+ value: { type: [String, Number, Boolean, null] },
1291
+ label: { default: void 0 },
1292
+ disabled: { type: Boolean, default: void 0 },
1293
+ size: { default: void 0 },
1294
+ id: { default: void 0 },
1295
+ name: { default: void 0 },
1296
+ ariaLabel: { default: void 0 }
1297
+ }, {
1298
+ modelValue: { type: [String, Number, Boolean, null], default: null },
1299
+ modelModifiers: {}
1300
+ }),
1301
+ emits: /* @__PURE__ */ R(["change"], ["update:modelValue"]),
1302
+ setup(e, { emit: _ }) {
1303
+ const a = e, n = _, s = G(e, "modelValue"), t = ce(Ze, null), o = le(a), c = d(
1304
+ () => t ? t.modelValue.value === a.value : s.value === a.value
1305
+ ), p = d(() => a.disabled || t?.disabled.value || o.disabled.value), h = d(() => a.size ?? t?.size.value ?? o.size.value), f = d(() => [
1306
+ "wx-radio",
1307
+ `wx-radio--${h.value}`,
1308
+ { "is-checked": c.value, "is-disabled": p.value }
1309
+ ]);
1310
+ function m() {
1311
+ t ? t.toggle(a.value, !0) : s.value = a.value, n("change", a.value);
1312
+ }
1313
+ return (g, y) => (l(), u("label", {
1314
+ class: F(f.value)
1315
+ }, [
1316
+ x("input", te({
1317
+ id: b(o).id.value
1318
+ }, g.$attrs, {
1319
+ class: "wx-radio__native",
1320
+ type: "radio",
1321
+ name: e.name ?? b(t)?.name.value,
1322
+ checked: c.value,
1323
+ disabled: p.value,
1324
+ "aria-label": e.ariaLabel,
1325
+ "aria-describedby": b(o).describedBy.value,
1326
+ onChange: m
1327
+ }), null, 16, ul),
1328
+ y[0] || (y[0] = x("span", {
1329
+ class: "wx-radio__box",
1330
+ "aria-hidden": "true"
1331
+ }, [
1332
+ x("span", { class: "wx-radio__dot" })
1333
+ ], -1)),
1334
+ e.label || g.$slots.default ? (l(), u("span", dl, [
1335
+ N(g.$slots, "default", {}, () => [
1336
+ ae(D(e.label), 1)
1337
+ ], !0)
1338
+ ])) : C("", !0)
1339
+ ], 2));
1340
+ }
1341
+ }), aa = /* @__PURE__ */ Q(rl, [["__scopeId", "data-v-a22bec4a"]]), cl = ["aria-labelledby", "aria-describedby"], vl = /* @__PURE__ */ J({
1342
+ name: "WxRadioGroup",
1343
+ __name: "RadioGroup",
1344
+ props: /* @__PURE__ */ R({
1345
+ options: { default: void 0 },
1346
+ disabled: { type: Boolean, default: void 0 },
1347
+ size: { default: void 0 },
1348
+ name: { default: void 0 },
1349
+ inline: { type: Boolean, default: !1 }
1350
+ }, {
1351
+ modelValue: { type: [String, Number, Boolean, null], default: null },
1352
+ modelModifiers: {}
1353
+ }),
1354
+ emits: /* @__PURE__ */ R(["change"], ["update:modelValue"]),
1355
+ setup(e, { emit: _ }) {
1356
+ const a = e, n = _, s = G(e, "modelValue"), t = le(a), o = Te("wx-radio-group");
1357
+ t.item?.registerLabelTarget(void 0);
1358
+ const c = d(() => a.disabled ?? t.disabled.value), p = d(() => a.size ?? t.size.value), h = d(() => a.name ?? o);
1359
+ function f(m) {
1360
+ s.value !== m && (s.value = m, n("change", m));
1361
+ }
1362
+ return xe(Ze, {
1363
+ name: h,
1364
+ modelValue: d(() => s.value),
1365
+ disabled: c,
1366
+ size: p,
1367
+ toggle: f
1368
+ }), (m, g) => (l(), u("div", {
1369
+ class: F(["wx-radio-group", { "wx-radio-group--inline": e.inline }]),
1370
+ role: "radiogroup",
1371
+ "aria-labelledby": b(t).item ? `${b(t).item.id.value}-label` : void 0,
1372
+ "aria-describedby": b(t).describedBy.value
1373
+ }, [
1374
+ N(m.$slots, "default", {}, () => [
1375
+ (l(!0), u(K, null, X(e.options, (y) => (l(), ie(aa, {
1376
+ key: String(y.value),
1377
+ value: y.value,
1378
+ label: y.label,
1379
+ disabled: y.disabled
1380
+ }, null, 8, ["value", "label", "disabled"]))), 128))
1381
+ ], !0)
1382
+ ], 10, cl));
1383
+ }
1384
+ }), fl = /* @__PURE__ */ Q(vl, [["__scopeId", "data-v-dcd2686e"]]), bl = ["id", "tabindex", "aria-label", "aria-describedby", "aria-valuemax", "aria-valuenow", "aria-readonly", "aria-disabled"], ml = ["onClick", "onMousemove"], pl = {
1385
+ key: 0,
1386
+ class: "wx-rate__value"
1387
+ }, hl = ["name", "value"], yl = /* @__PURE__ */ J({
1388
+ name: "WxRate",
1389
+ inheritAttrs: !1,
1390
+ __name: "Rate",
1391
+ props: /* @__PURE__ */ R({
1392
+ max: { default: 5 },
1393
+ allowHalf: { type: Boolean, default: !1 },
1394
+ clearable: { type: Boolean, default: !0 },
1395
+ showValue: { type: Boolean, default: !1 },
1396
+ readonly: { type: Boolean, default: !1 },
1397
+ disabled: { type: Boolean, default: void 0 },
1398
+ size: { default: void 0 },
1399
+ id: { default: void 0 },
1400
+ name: { default: void 0 },
1401
+ ariaLabel: { default: void 0 }
1402
+ }, {
1403
+ modelValue: { default: 0 },
1404
+ modelModifiers: {}
1405
+ }),
1406
+ emits: /* @__PURE__ */ R(["change"], ["update:modelValue"]),
1407
+ setup(e, { emit: _ }) {
1408
+ const a = e, n = _, s = G(e, "modelValue"), t = le(a), o = q(null), c = d(() => !t.disabled.value && !a.readonly), p = d(() => o.value ?? s.value ?? 0), h = d(
1409
+ () => Array.from({ length: a.max }, (B, $) => {
1410
+ const r = $ + 1, S = Math.min(Math.max(p.value - $, 0), 1);
1411
+ return { position: r, full: S >= 1, half: S > 0 && S < 1 };
1412
+ })
1413
+ ), f = d(() => [
1414
+ "wx-rate",
1415
+ `wx-rate--${t.size.value}`,
1416
+ { "is-disabled": t.disabled.value, "is-readonly": a.readonly }
1417
+ ]);
1418
+ function m(B, $) {
1419
+ if (!a.allowHalf) return B;
1420
+ const r = $.currentTarget, { left: S, width: z } = r.getBoundingClientRect();
1421
+ return $.clientX - S < z / 2 ? B - 0.5 : B;
1422
+ }
1423
+ function g(B, $ = !1) {
1424
+ const r = $ && a.clearable && s.value === B ? 0 : B;
1425
+ r !== s.value && (s.value = r, n("change", r));
1426
+ }
1427
+ function y(B, $) {
1428
+ c.value && g(m(B, $), !0);
1429
+ }
1430
+ function P(B, $) {
1431
+ c.value && (o.value = m(B, $));
1432
+ }
1433
+ function V(B) {
1434
+ if (!c.value) return;
1435
+ const $ = a.allowHalf ? 0.5 : 1, r = s.value ?? 0;
1436
+ B.key === "ArrowRight" || B.key === "ArrowUp" ? (B.preventDefault(), g(Math.min(r + $, a.max))) : B.key === "ArrowLeft" || B.key === "ArrowDown" ? (B.preventDefault(), g(Math.max(r - $, 0))) : B.key === "Home" ? (B.preventDefault(), g(0)) : B.key === "End" && (B.preventDefault(), g(a.max));
1437
+ }
1438
+ return (B, $) => (l(), u("div", te({
1439
+ id: b(t).id.value
1440
+ }, B.$attrs, {
1441
+ class: f.value,
1442
+ role: "slider",
1443
+ tabindex: c.value ? 0 : -1,
1444
+ "aria-label": e.ariaLabel,
1445
+ "aria-describedby": b(t).describedBy.value,
1446
+ "aria-valuemin": 0,
1447
+ "aria-valuemax": e.max,
1448
+ "aria-valuenow": s.value ?? 0,
1449
+ "aria-readonly": e.readonly || void 0,
1450
+ "aria-disabled": b(t).disabled.value || void 0,
1451
+ onKeydown: V,
1452
+ onMouseleave: $[0] || ($[0] = (r) => o.value = null)
1453
+ }), [
1454
+ (l(!0), u(K, null, X(h.value, (r) => (l(), u("span", {
1455
+ key: r.position,
1456
+ class: F(["wx-rate__star", { "is-full": r.full, "is-half": r.half }]),
1457
+ onClick: (S) => y(r.position, S),
1458
+ onMousemove: (S) => P(r.position, S)
1459
+ }, [...$[1] || ($[1] = [
1460
+ x("svg", {
1461
+ viewBox: "0 0 24 24",
1462
+ "aria-hidden": "true"
1463
+ }, [
1464
+ x("path", {
1465
+ class: "wx-rate__outline",
1466
+ d: "M12 3.5l2.6 5.3 5.9.9-4.2 4.1 1 5.8-5.3-2.8-5.3 2.8 1-5.8-4.2-4.1 5.9-.9z",
1467
+ fill: "none",
1468
+ stroke: "currentColor",
1469
+ "stroke-width": "1.5",
1470
+ "stroke-linejoin": "round"
1471
+ }),
1472
+ x("path", {
1473
+ class: "wx-rate__fill",
1474
+ d: "M12 3.5l2.6 5.3 5.9.9-4.2 4.1 1 5.8-5.3-2.8-5.3 2.8 1-5.8-4.2-4.1 5.9-.9z",
1475
+ fill: "currentColor"
1476
+ })
1477
+ ], -1)
1478
+ ])], 42, ml))), 128)),
1479
+ e.showValue ? (l(), u("span", pl, D(s.value ?? 0), 1)) : C("", !0),
1480
+ e.name ? (l(), u("input", {
1481
+ key: 1,
1482
+ type: "hidden",
1483
+ name: e.name,
1484
+ value: s.value ?? 0
1485
+ }, null, 8, hl)) : C("", !0)
1486
+ ], 16, bl));
1487
+ }
1488
+ }), xl = /* @__PURE__ */ Q(yl, [["__scopeId", "data-v-7cbc0034"]]), gl = {
1489
+ bold: "M7 5h6a3.5 3.5 0 0 1 0 7H7zm0 7h7a3.5 3.5 0 0 1 0 7H7z",
1490
+ italic: "M15 5h-5M14 19H9M13.5 5 10.5 19",
1491
+ strike: "M5 12h14M8 8.5A3 3 0 0 1 11 6h2a3 3 0 0 1 3 2.5M16 15.5A3 3 0 0 1 13 18h-2a3 3 0 0 1-3-2.5",
1492
+ code: "m9 8-5 4 5 4M15 8l5 4-5 4",
1493
+ bulletList: "M9 6h11M9 12h11M9 18h11M4.5 6h.01M4.5 12h.01M4.5 18h.01",
1494
+ orderedList: "M10 6h10M10 12h10M10 18h10M4 6h1v4M4 10h2M4 14h2v2H4v2h2",
1495
+ blockquote: "M7 15V9h4v6H7l-2 3M15 15V9h4v6h-4l-2 3",
1496
+ hr: "M4 12h16",
1497
+ link: "M10 13a4 4 0 0 0 5.7.4l2.6-2.6a4 4 0 0 0-5.7-5.7l-1.5 1.5M14 11a4 4 0 0 0-5.7-.4l-2.6 2.6a4 4 0 0 0 5.7 5.7l1.5-1.5",
1498
+ table: "M4 6h16v12H4zM4 10h16M10 10v8M4 14h16",
1499
+ image: "M4 6h16v12H4zM4 15l4-4 4 4 3-3 5 5M9 9.5h.01",
1500
+ youtube: "M3 8.5A2.5 2.5 0 0 1 5.5 6h13A2.5 2.5 0 0 1 21 8.5v7a2.5 2.5 0 0 1-2.5 2.5h-13A2.5 2.5 0 0 1 3 15.5zM10.5 9.5l4 2.5-4 2.5z",
1501
+ undo: "M4 9h11a4.5 4.5 0 0 1 0 9h-4M4 9l4-4M4 9l4 4",
1502
+ redo: "M20 9H9a4.5 4.5 0 0 0 0 9h4M20 9l-4-4M20 9l-4 4",
1503
+ rowAfter: "M4 5h16M4 11h16M8 15v6M5 18h6",
1504
+ rowBefore: "M4 19h16M4 13h16M8 3v6M5 6h6",
1505
+ columnAfter: "M5 4v16M11 4v16M15 8h6M18 5v6",
1506
+ columnBefore: "M19 4v16M13 4v16M3 8h6M6 5v6",
1507
+ deleteRow: "M4 8h16M4 16h16M9 12h6",
1508
+ deleteColumn: "M8 4v16M16 4v16M12 9v6",
1509
+ deleteTable: "M5 7h14M9 7V5h6v2M7 7l1 12h8l1-12M10 11v4M14 11v4",
1510
+ mergeCells: "M4 6h16v12H4zM12 6v3M12 15v3M9 12h6M9 12l2-2M9 12l2 2",
1511
+ check: "m5 13 4 4L19 7",
1512
+ close: "M6 6l12 12M18 6 6 18"
1513
+ }, kl = ["title", "aria-label", "aria-pressed", "disabled"], wl = {
1514
+ key: 0,
1515
+ viewBox: "0 0 24 24",
1516
+ fill: "none",
1517
+ "aria-hidden": "true"
1518
+ }, $l = ["d"], _l = {
193
1519
  key: 1,
194
- class: "wx-card__footer"
195
- }, ee = /* @__PURE__ */ _({
196
- name: "WxCard",
197
- __name: "Card",
1520
+ class: "wx-rich-text__tool-text"
1521
+ }, Bl = /* @__PURE__ */ J({
1522
+ name: "WxRichTextToolbarButton",
1523
+ __name: "ToolbarButton",
198
1524
  props: {
199
- title: { default: void 0 },
200
- shadow: { default: "never" },
201
- padding: { default: "md" },
202
- borderless: { type: Boolean, default: !1 }
1525
+ icon: { default: void 0 },
1526
+ text: { default: void 0 },
1527
+ label: {},
1528
+ active: { type: Boolean, default: !1 },
1529
+ disabled: { type: Boolean, default: !1 }
203
1530
  },
204
- setup(t) {
205
- const u = t, e = T(), a = r(() => !!(u.title || e.header || e.extra)), o = r(() => [
206
- "wx-card",
207
- `wx-card--shadow-${u.shadow}`,
208
- `wx-card--padding-${u.padding}`,
209
- { "wx-card--borderless": u.borderless }
1531
+ emits: ["click"],
1532
+ setup(e) {
1533
+ return (_, a) => (l(), u("button", {
1534
+ type: "button",
1535
+ class: F(["wx-rich-text__tool", { "is-active": e.active }]),
1536
+ title: e.label,
1537
+ "aria-label": e.label,
1538
+ "aria-pressed": e.active,
1539
+ disabled: e.disabled,
1540
+ onClick: a[0] || (a[0] = (n) => _.$emit("click"))
1541
+ }, [
1542
+ e.icon ? (l(), u("svg", wl, [
1543
+ x("path", {
1544
+ d: b(gl)[e.icon],
1545
+ stroke: "currentColor",
1546
+ "stroke-width": "1.7",
1547
+ "stroke-linecap": "round",
1548
+ "stroke-linejoin": "round"
1549
+ }, null, 8, $l)
1550
+ ])) : (l(), u("span", _l, D(e.text), 1))
1551
+ ], 10, kl));
1552
+ }
1553
+ }), pe = /* @__PURE__ */ Q(Bl, [["__scopeId", "data-v-c8c7e143"]]), Ml = [
1554
+ "bold",
1555
+ "italic",
1556
+ "strike",
1557
+ "code",
1558
+ "divider",
1559
+ "h2",
1560
+ "h3",
1561
+ "h4",
1562
+ "divider",
1563
+ "bulletList",
1564
+ "orderedList",
1565
+ "blockquote",
1566
+ "hr",
1567
+ "divider",
1568
+ "link",
1569
+ "table",
1570
+ "image",
1571
+ "youtube",
1572
+ "divider",
1573
+ "undo",
1574
+ "redo"
1575
+ ], Cl = [
1576
+ "image/png",
1577
+ "image/jpeg",
1578
+ "image/gif",
1579
+ "image/webp",
1580
+ "image/svg+xml"
1581
+ ], Me = {
1582
+ bold: { label: "Bold", icon: "bold" },
1583
+ italic: { label: "Italic", icon: "italic" },
1584
+ strike: { label: "Strikethrough", icon: "strike" },
1585
+ code: { label: "Inline code", icon: "code" },
1586
+ h2: { label: "Heading 2", text: "H2" },
1587
+ h3: { label: "Heading 3", text: "H3" },
1588
+ h4: { label: "Heading 4", text: "H4" },
1589
+ bulletList: { label: "Bulleted list", icon: "bulletList" },
1590
+ orderedList: { label: "Numbered list", icon: "orderedList" },
1591
+ blockquote: { label: "Quote", icon: "blockquote" },
1592
+ hr: { label: "Divider", icon: "hr" },
1593
+ link: { label: "Link", icon: "link" },
1594
+ table: { label: "Table", icon: "table" },
1595
+ image: { label: "Image", icon: "image" },
1596
+ youtube: { label: "YouTube video", icon: "youtube" },
1597
+ undo: { label: "Undo", icon: "undo" },
1598
+ redo: { label: "Redo", icon: "redo" }
1599
+ }, Sl = [
1600
+ { key: "addRowAfter", label: "Row below", icon: "rowAfter" },
1601
+ { key: "addRowBefore", label: "Row above", icon: "rowBefore" },
1602
+ { key: "addColumnAfter", label: "Column after", icon: "columnAfter" },
1603
+ { key: "addColumnBefore", label: "Column before", icon: "columnBefore" },
1604
+ { key: "deleteRow", label: "Delete row", icon: "deleteRow" },
1605
+ { key: "deleteColumn", label: "Delete column", icon: "deleteColumn" },
1606
+ { key: "mergeOrSplit", label: "Merge or split cells", icon: "mergeCells" },
1607
+ { key: "deleteTable", label: "Delete table", icon: "deleteTable" }
1608
+ ], Tl = ["aria-label"], Il = {
1609
+ key: 0,
1610
+ class: "wx-rich-text__divider",
1611
+ "aria-hidden": "true"
1612
+ }, Vl = {
1613
+ key: 0,
1614
+ class: "wx-rich-text__uploading"
1615
+ }, zl = {
1616
+ key: 0,
1617
+ class: "wx-rich-text__toolbar wx-rich-text__toolbar--table"
1618
+ }, Pl = ["for"], Wl = ["id", "placeholder"], Al = {
1619
+ key: 0,
1620
+ class: "wx-rich-text__placeholder"
1621
+ }, Ll = ["accept"], Rl = /* @__PURE__ */ J({
1622
+ name: "WxRichText",
1623
+ inheritAttrs: !1,
1624
+ __name: "RichText",
1625
+ props: /* @__PURE__ */ R({
1626
+ placeholder: { default: void 0 },
1627
+ disabled: { type: Boolean, default: void 0 },
1628
+ readonly: { type: Boolean, default: !1 },
1629
+ size: { default: void 0 },
1630
+ status: { default: void 0 },
1631
+ id: { default: void 0 },
1632
+ ariaLabel: { default: void 0 },
1633
+ minHeight: { default: "220px" },
1634
+ tools: { default: () => Ml },
1635
+ upload: { type: Function, default: void 0 },
1636
+ pickImage: { type: Function, default: void 0 },
1637
+ accept: { default: () => Cl }
1638
+ }, {
1639
+ modelValue: { default: "" },
1640
+ modelModifiers: {}
1641
+ }),
1642
+ emits: /* @__PURE__ */ R(["change", "focus", "blur", "uploadError"], ["update:modelValue"]),
1643
+ setup(e, { expose: _, emit: a }) {
1644
+ const n = e, s = a, t = G(e, "modelValue"), o = le(n), c = q(!1), p = q(0), h = q(null), f = q(null), m = d(() => !o.disabled.value && !n.readonly);
1645
+ function g() {
1646
+ const T = y.value;
1647
+ return !T || T.isEmpty ? "" : T.getHTML();
1648
+ }
1649
+ const y = Ka({
1650
+ content: t.value ?? "",
1651
+ editable: m.value,
1652
+ extensions: [
1653
+ qa.configure({
1654
+ link: {
1655
+ openOnClick: !1,
1656
+ autolink: !0,
1657
+ HTMLAttributes: { rel: "noopener noreferrer nofollow", target: "_blank" }
1658
+ }
1659
+ }),
1660
+ Ya.configure({ table: { resizable: !0 } }),
1661
+ Xa.configure({ HTMLAttributes: { class: "wx-rich-text__image" } }),
1662
+ Ja.configure({ nocookie: !0, width: 640, height: 360 }),
1663
+ Za.configure({
1664
+ allowedMimeTypes: n.accept,
1665
+ onDrop: (T, A, I) => {
1666
+ r(A, I);
1667
+ },
1668
+ onPaste: (T, A) => {
1669
+ r(A);
1670
+ }
1671
+ })
1672
+ ],
1673
+ onUpdate: () => {
1674
+ const T = g();
1675
+ t.value = T, s("change", T);
1676
+ },
1677
+ onFocus: () => {
1678
+ c.value = !0, s("focus");
1679
+ },
1680
+ onBlur: () => {
1681
+ c.value = !1, s("blur");
1682
+ }
1683
+ });
1684
+ ne(t, (T) => {
1685
+ const A = y.value;
1686
+ A && (T ?? "") !== g() && A.commands.setContent(T ?? "", { emitUpdate: !1 });
1687
+ }), ne(m, (T) => y.value?.setEditable(T));
1688
+ const P = d(() => y.value?.isEmpty ?? !0), V = d(() => y.value?.isActive("table") ?? !1), B = d(() => [
1689
+ "wx-rich-text",
1690
+ `wx-rich-text--${o.size.value}`,
1691
+ {
1692
+ [`wx-rich-text--${o.status.value}`]: o.status.value !== "default",
1693
+ "is-focused": c.value,
1694
+ "is-disabled": o.disabled.value,
1695
+ "is-readonly": n.readonly
1696
+ }
210
1697
  ]);
211
- return (l, c) => (n(), d("section", {
212
- class: k(o.value)
1698
+ function $(T, A, I) {
1699
+ const oe = y.value;
1700
+ if (!oe) return;
1701
+ const ue = I ?? oe.state.selection.anchor;
1702
+ oe.chain().focus().insertContentAt(ue, { type: "image", attrs: { src: T, alt: A } }).run();
1703
+ }
1704
+ async function r(T, A) {
1705
+ if (n.upload)
1706
+ for (const I of T) {
1707
+ p.value += 1;
1708
+ try {
1709
+ const oe = await n.upload(I);
1710
+ $(oe.url, oe.alt, A);
1711
+ } catch (oe) {
1712
+ s("uploadError", oe, I);
1713
+ } finally {
1714
+ p.value -= 1;
1715
+ }
1716
+ }
1717
+ }
1718
+ async function S() {
1719
+ if (n.pickImage) {
1720
+ const T = await n.pickImage();
1721
+ T && $(T);
1722
+ return;
1723
+ }
1724
+ h.value?.click();
1725
+ }
1726
+ function z(T) {
1727
+ const A = T.target, I = Array.from(A.files ?? []);
1728
+ A.value = "", r(I);
1729
+ }
1730
+ function H(T) {
1731
+ const A = T === "link" ? y.value?.getAttributes("link").href ?? "" : "";
1732
+ f.value = { kind: T, value: String(A) };
1733
+ }
1734
+ function M() {
1735
+ const T = y.value, A = f.value;
1736
+ if (!T || !A) return;
1737
+ const I = A.value.trim();
1738
+ A.kind === "link" ? I ? T.chain().focus().extendMarkRange("link").setLink({ href: I }).run() : T.chain().focus().extendMarkRange("link").unsetLink().run() : I && T.commands.setYoutubeVideo({ src: I }), f.value = null;
1739
+ }
1740
+ function w(T) {
1741
+ return T === "image" ? !!(n.upload || n.pickImage) : !0;
1742
+ }
1743
+ const E = d(() => n.tools.filter(w));
1744
+ function Z(T) {
1745
+ const A = y.value;
1746
+ if (!A) return !1;
1747
+ switch (T) {
1748
+ case "h2":
1749
+ return A.isActive("heading", { level: 2 });
1750
+ case "h3":
1751
+ return A.isActive("heading", { level: 3 });
1752
+ case "h4":
1753
+ return A.isActive("heading", { level: 4 });
1754
+ default:
1755
+ return A.isActive(T);
1756
+ }
1757
+ }
1758
+ function W(T) {
1759
+ const A = y.value;
1760
+ if (!A) return;
1761
+ const I = A.chain().focus();
1762
+ switch (T) {
1763
+ case "bold":
1764
+ I.toggleBold().run();
1765
+ break;
1766
+ case "italic":
1767
+ I.toggleItalic().run();
1768
+ break;
1769
+ case "strike":
1770
+ I.toggleStrike().run();
1771
+ break;
1772
+ case "code":
1773
+ I.toggleCode().run();
1774
+ break;
1775
+ case "h2":
1776
+ I.toggleHeading({ level: 2 }).run();
1777
+ break;
1778
+ case "h3":
1779
+ I.toggleHeading({ level: 3 }).run();
1780
+ break;
1781
+ case "h4":
1782
+ I.toggleHeading({ level: 4 }).run();
1783
+ break;
1784
+ case "bulletList":
1785
+ I.toggleBulletList().run();
1786
+ break;
1787
+ case "orderedList":
1788
+ I.toggleOrderedList().run();
1789
+ break;
1790
+ case "blockquote":
1791
+ I.toggleBlockquote().run();
1792
+ break;
1793
+ case "hr":
1794
+ I.setHorizontalRule().run();
1795
+ break;
1796
+ case "undo":
1797
+ I.undo().run();
1798
+ break;
1799
+ case "redo":
1800
+ I.redo().run();
1801
+ break;
1802
+ case "table":
1803
+ I.insertTable({ rows: 3, cols: 3, withHeaderRow: !0 }).run();
1804
+ break;
1805
+ case "link":
1806
+ H("link");
1807
+ break;
1808
+ case "youtube":
1809
+ H("youtube");
1810
+ break;
1811
+ case "image":
1812
+ S();
1813
+ break;
1814
+ }
1815
+ }
1816
+ function U(T) {
1817
+ const A = y.value;
1818
+ if (!A) return;
1819
+ A.chain().focus()[T]().run();
1820
+ }
1821
+ return _({
1822
+ editor: y,
1823
+ focus: () => y.value?.commands.focus(),
1824
+ clear: () => y.value?.commands.clearContent(!0)
1825
+ }), (T, A) => (l(), u("div", {
1826
+ class: F(B.value)
213
1827
  }, [
214
- a.value ? (n(), d("header", K, [
215
- m("div", Q, [
216
- p(l.$slots, "header", {}, () => [
217
- j(B(t.title), 1)
1828
+ x("div", {
1829
+ class: "wx-rich-text__toolbar",
1830
+ role: "toolbar",
1831
+ "aria-label": e.ariaLabel ?? "Text formatting"
1832
+ }, [
1833
+ (l(!0), u(K, null, X(E.value, (I, oe) => (l(), u(K, {
1834
+ key: `${I}-${oe}`
1835
+ }, [
1836
+ I === "divider" ? (l(), u("span", Il)) : (l(), ie(pe, {
1837
+ key: 1,
1838
+ icon: b(Me)[I].icon,
1839
+ text: b(Me)[I].text,
1840
+ label: b(Me)[I].label,
1841
+ active: Z(I),
1842
+ disabled: !m.value,
1843
+ onClick: (ue) => W(I)
1844
+ }, null, 8, ["icon", "text", "label", "active", "disabled", "onClick"]))
1845
+ ], 64))), 128)),
1846
+ p.value > 0 ? (l(), u("span", Vl, "Uploading…")) : C("", !0)
1847
+ ], 8, Tl),
1848
+ V.value && m.value ? (l(), u("div", zl, [
1849
+ (l(!0), u(K, null, X(b(Sl), (I) => (l(), ie(pe, {
1850
+ key: I.key,
1851
+ icon: I.icon,
1852
+ label: I.label,
1853
+ onClick: (oe) => U(I.key)
1854
+ }, null, 8, ["icon", "label", "onClick"]))), 128))
1855
+ ])) : C("", !0),
1856
+ f.value ? (l(), u("form", {
1857
+ key: 1,
1858
+ class: "wx-rich-text__prompt",
1859
+ onSubmit: de(M, ["prevent"])
1860
+ }, [
1861
+ x("label", {
1862
+ class: "wx-rich-text__prompt-label",
1863
+ for: `${b(o).id.value}-prompt`
1864
+ }, D(f.value.kind === "link" ? "Link address" : "YouTube URL"), 9, Pl),
1865
+ ma(x("input", {
1866
+ id: `${b(o).id.value}-prompt`,
1867
+ "onUpdate:modelValue": A[0] || (A[0] = (I) => f.value.value = I),
1868
+ class: "wx-rich-text__prompt-input",
1869
+ type: "url",
1870
+ placeholder: f.value.kind === "link" ? "https://example.com" : "https://youtu.be/…",
1871
+ onKeydown: A[1] || (A[1] = pa((I) => f.value = null, ["esc"]))
1872
+ }, null, 40, Wl), [
1873
+ [ha, f.value.value]
1874
+ ]),
1875
+ O(pe, {
1876
+ icon: "check",
1877
+ label: "Apply",
1878
+ onClick: M
1879
+ }),
1880
+ O(pe, {
1881
+ icon: "close",
1882
+ label: "Cancel",
1883
+ onClick: A[2] || (A[2] = (I) => f.value = null)
1884
+ })
1885
+ ], 32)) : C("", !0),
1886
+ x("div", {
1887
+ class: "wx-rich-text__body",
1888
+ style: ee({ minHeight: e.minHeight })
1889
+ }, [
1890
+ e.placeholder && P.value ? (l(), u("span", Al, D(e.placeholder), 1)) : C("", !0),
1891
+ O(b(Ga), {
1892
+ editor: b(y),
1893
+ class: "wx-rich-text__content",
1894
+ "aria-describedby": b(o).describedBy.value
1895
+ }, null, 8, ["editor", "aria-describedby"])
1896
+ ], 4),
1897
+ e.upload && !e.pickImage ? (l(), u("input", {
1898
+ key: 2,
1899
+ ref_key: "fileInput",
1900
+ ref: h,
1901
+ class: "wx-rich-text__file",
1902
+ type: "file",
1903
+ accept: e.accept.join(","),
1904
+ multiple: "",
1905
+ onChange: z
1906
+ }, null, 40, Ll)) : C("", !0)
1907
+ ], 2));
1908
+ }
1909
+ }), Fl = /* @__PURE__ */ Q(Rl, [["__scopeId", "data-v-80be39db"]]), Hl = { class: "wx-select__value" }, Dl = ["aria-label", "onClick"], Nl = {
1910
+ key: 0,
1911
+ class: "wx-select__single"
1912
+ }, Ul = {
1913
+ key: 1,
1914
+ class: "wx-select__placeholder"
1915
+ }, El = { class: "wx-select__option-label" }, Ol = /* @__PURE__ */ J({
1916
+ name: "WxSelect",
1917
+ inheritAttrs: !1,
1918
+ __name: "Select",
1919
+ props: /* @__PURE__ */ R({
1920
+ options: { default: () => [] },
1921
+ multiple: { type: Boolean, default: !1 },
1922
+ filterable: { type: Boolean, default: !1 },
1923
+ clearable: { type: Boolean, default: !1 },
1924
+ placeholder: { default: void 0 },
1925
+ emptyText: { default: "Nothing found" },
1926
+ teleport: { type: Boolean, default: !0 },
1927
+ disabled: { type: Boolean, default: void 0 },
1928
+ size: { default: void 0 },
1929
+ status: { default: void 0 },
1930
+ id: { default: void 0 },
1931
+ name: { default: void 0 },
1932
+ ariaLabel: { default: void 0 }
1933
+ }, {
1934
+ modelValue: { default: null },
1935
+ modelModifiers: {}
1936
+ }),
1937
+ emits: /* @__PURE__ */ R(["change", "clear", "open", "close", "search"], ["update:modelValue"]),
1938
+ setup(e, { emit: _ }) {
1939
+ const a = e, n = _, s = G(e, "modelValue"), t = le(a), o = q(!1), c = q(""), p = d({
1940
+ get: () => a.multiple ? s.value ?? [] : s.value ?? null,
1941
+ set: (z) => {
1942
+ s.value = z, n("change", z);
1943
+ }
1944
+ }), h = (z) => a.options.find((H) => H.value === z)?.label ?? String(z), f = d(() => a.multiple ? (s.value ?? []).map((z) => ({ value: z, label: h(z) })) : []), m = d(() => {
1945
+ if (a.multiple) return "";
1946
+ const z = s.value;
1947
+ return z == null ? "" : h(z);
1948
+ }), g = d(
1949
+ () => a.multiple ? f.value.length > 0 : s.value !== null && s.value !== void 0 && s.value !== ""
1950
+ ), y = d(() => a.clearable && !t.disabled.value && g.value), P = d(() => [
1951
+ "wx-select",
1952
+ `wx-select--${t.size.value}`,
1953
+ {
1954
+ [`wx-select--${t.status.value}`]: t.status.value !== "default",
1955
+ "is-open": o.value,
1956
+ "is-disabled": t.disabled.value,
1957
+ "is-multiple": a.multiple
1958
+ }
1959
+ ]);
1960
+ ne(
1961
+ () => s.value,
1962
+ () => {
1963
+ c.value = a.multiple ? "" : m.value;
1964
+ },
1965
+ { immediate: !0 }
1966
+ ), ne(o, (z) => {
1967
+ if (z) {
1968
+ n("open");
1969
+ return;
1970
+ }
1971
+ c.value = a.multiple ? "" : m.value, n("close");
1972
+ });
1973
+ function V() {
1974
+ t.disabled.value || (o.value = !0);
1975
+ }
1976
+ function B(z) {
1977
+ return z == null ? "" : h(z);
1978
+ }
1979
+ function $(z) {
1980
+ n("search", z.target.value);
1981
+ }
1982
+ function r() {
1983
+ s.value = a.multiple ? [] : null, n("change", s.value), n("clear");
1984
+ }
1985
+ function S(z) {
1986
+ const H = (s.value ?? []).filter((M) => M !== z);
1987
+ s.value = H, n("change", H);
1988
+ }
1989
+ return (z, H) => (l(), ie(b(za), {
1990
+ modelValue: p.value,
1991
+ "onUpdate:modelValue": H[1] || (H[1] = (M) => p.value = M),
1992
+ open: o.value,
1993
+ "onUpdate:open": H[2] || (H[2] = (M) => o.value = M),
1994
+ multiple: e.multiple,
1995
+ disabled: b(t).disabled.value,
1996
+ name: e.name,
1997
+ "ignore-filter": !e.filterable,
1998
+ "open-on-click": !0,
1999
+ class: F(P.value),
2000
+ as: "div"
2001
+ }, {
2002
+ default: Y(() => [
2003
+ O(b(Pa), {
2004
+ class: "wx-select__anchor",
2005
+ as: "div",
2006
+ onClick: V
2007
+ }, {
2008
+ default: Y(() => [
2009
+ x("div", Hl, [
2010
+ e.multiple ? (l(!0), u(K, { key: 0 }, X(f.value, (M) => (l(), u("span", {
2011
+ key: String(M.value),
2012
+ class: "wx-select__tag"
2013
+ }, [
2014
+ ae(D(M.label) + " ", 1),
2015
+ b(t).disabled.value ? C("", !0) : (l(), u("button", {
2016
+ key: 0,
2017
+ class: "wx-select__tag-remove",
2018
+ type: "button",
2019
+ tabindex: "-1",
2020
+ "aria-label": `Remove ${M.label}`,
2021
+ onClick: de((w) => S(M.value), ["stop"])
2022
+ }, " ✕ ", 8, Dl))
2023
+ ]))), 128)) : C("", !0),
2024
+ e.filterable ? (l(), ie(b(Wa), te({
2025
+ key: 1,
2026
+ id: b(t).id.value
2027
+ }, z.$attrs, {
2028
+ modelValue: c.value,
2029
+ "onUpdate:modelValue": H[0] || (H[0] = (M) => c.value = M),
2030
+ class: "wx-select__input",
2031
+ placeholder: e.placeholder,
2032
+ "aria-label": e.ariaLabel,
2033
+ "aria-describedby": b(t).describedBy.value,
2034
+ "aria-invalid": b(t).status.value === "error" || void 0,
2035
+ "display-value": e.multiple ? void 0 : B,
2036
+ "auto-focus": "",
2037
+ onInput: $
2038
+ }), null, 16, ["id", "modelValue", "placeholder", "aria-label", "aria-describedby", "aria-invalid", "display-value"])) : (l(), u(K, { key: 2 }, [
2039
+ !e.multiple && g.value ? (l(), u("span", Nl, D(m.value), 1)) : g.value ? C("", !0) : (l(), u("span", Ul, D(e.placeholder), 1))
2040
+ ], 64))
2041
+ ]),
2042
+ y.value ? (l(), u("button", {
2043
+ key: 0,
2044
+ class: "wx-select__clear",
2045
+ type: "button",
2046
+ tabindex: "-1",
2047
+ "aria-label": "Clear",
2048
+ onClick: de(r, ["stop"])
2049
+ }, " ✕ ")) : C("", !0),
2050
+ O(b(Aa), {
2051
+ id: e.filterable ? void 0 : b(t).id.value,
2052
+ class: "wx-select__toggle",
2053
+ "aria-label": e.ariaLabel,
2054
+ "aria-describedby": b(t).describedBy.value
2055
+ }, {
2056
+ default: Y(() => [...H[3] || (H[3] = [
2057
+ x("svg", {
2058
+ viewBox: "0 0 16 16",
2059
+ fill: "none",
2060
+ "aria-hidden": "true"
2061
+ }, [
2062
+ x("path", {
2063
+ d: "m4 6 4 4 4-4",
2064
+ stroke: "currentColor",
2065
+ "stroke-width": "1.6",
2066
+ "stroke-linecap": "round",
2067
+ "stroke-linejoin": "round"
2068
+ })
2069
+ ], -1)
2070
+ ])]),
2071
+ _: 1
2072
+ }, 8, ["id", "aria-label", "aria-describedby"])
2073
+ ]),
2074
+ _: 1
2075
+ }),
2076
+ O(b(La), {
2077
+ disabled: !e.teleport
2078
+ }, {
2079
+ default: Y(() => [
2080
+ O(b(Ra), {
2081
+ class: "wx-select__content",
2082
+ position: "popper",
2083
+ "side-offset": 4
2084
+ }, {
2085
+ default: Y(() => [
2086
+ O(b(Fa), { class: "wx-select__viewport" }, {
2087
+ default: Y(() => [
2088
+ O(b(Ha), { class: "wx-select__empty" }, {
2089
+ default: Y(() => [
2090
+ ae(D(e.emptyText), 1)
2091
+ ]),
2092
+ _: 1
2093
+ }),
2094
+ N(z.$slots, "default", {}, () => [
2095
+ (l(!0), u(K, null, X(e.options, (M) => (l(), ie(b(Da), {
2096
+ key: String(M.value),
2097
+ class: "wx-select__option",
2098
+ value: M.value,
2099
+ disabled: M.disabled
2100
+ }, {
2101
+ default: Y(() => [
2102
+ x("span", El, D(M.label), 1),
2103
+ O(b(Na), { class: "wx-select__check" }, {
2104
+ default: Y(() => [...H[4] || (H[4] = [
2105
+ x("svg", {
2106
+ viewBox: "0 0 16 16",
2107
+ fill: "none",
2108
+ "aria-hidden": "true"
2109
+ }, [
2110
+ x("path", {
2111
+ d: "m3.5 8.5 3 3 6-6",
2112
+ stroke: "currentColor",
2113
+ "stroke-width": "2",
2114
+ "stroke-linecap": "round",
2115
+ "stroke-linejoin": "round"
2116
+ })
2117
+ ], -1)
2118
+ ])]),
2119
+ _: 1
2120
+ })
2121
+ ]),
2122
+ _: 2
2123
+ }, 1032, ["value", "disabled"]))), 128))
2124
+ ], !0)
2125
+ ]),
2126
+ _: 3
2127
+ })
2128
+ ]),
2129
+ _: 3
2130
+ })
2131
+ ]),
2132
+ _: 3
2133
+ }, 8, ["disabled"])
2134
+ ]),
2135
+ _: 3
2136
+ }, 8, ["modelValue", "open", "multiple", "disabled", "name", "ignore-filter", "class"]));
2137
+ }
2138
+ }), jl = /* @__PURE__ */ Q(Ol, [["__scopeId", "data-v-c4893d5b"]]), Kl = { class: "wx-slider__row" }, Gl = {
2139
+ key: 0,
2140
+ class: "wx-slider__value"
2141
+ }, ql = {
2142
+ key: 0,
2143
+ class: "wx-slider__marks",
2144
+ "aria-hidden": "true"
2145
+ }, Yl = /* @__PURE__ */ J({
2146
+ name: "WxSlider",
2147
+ inheritAttrs: !1,
2148
+ __name: "Slider",
2149
+ props: /* @__PURE__ */ R({
2150
+ min: { default: 0 },
2151
+ max: { default: 100 },
2152
+ step: { default: 1 },
2153
+ range: { type: Boolean, default: !1 },
2154
+ minStepsBetweenThumbs: { default: 0 },
2155
+ showValue: { type: Boolean, default: !1 },
2156
+ marks: { default: void 0 },
2157
+ disabled: { type: Boolean, default: void 0 },
2158
+ size: { default: void 0 },
2159
+ id: { default: void 0 },
2160
+ name: { default: void 0 },
2161
+ ariaLabel: { default: void 0 }
2162
+ }, {
2163
+ modelValue: { default: null },
2164
+ modelModifiers: {}
2165
+ }),
2166
+ emits: /* @__PURE__ */ R(["change"], ["update:modelValue"]),
2167
+ setup(e, { emit: _ }) {
2168
+ const a = e, n = _, s = G(e, "modelValue"), t = le(a), o = d(() => {
2169
+ if (a.range) {
2170
+ const m = Array.isArray(s.value) ? s.value : [];
2171
+ return [m[0] ?? a.min, m[1] ?? a.max];
2172
+ }
2173
+ return [(Array.isArray(s.value) ? s.value[0] : s.value) ?? a.min];
2174
+ });
2175
+ function c(f) {
2176
+ if (!f) return;
2177
+ const m = a.range ? [...f] : f[0];
2178
+ s.value = m, n("change", m);
2179
+ }
2180
+ const p = d(
2181
+ () => Object.entries(a.marks ?? {}).map(([f, m]) => ({
2182
+ value: Number(f),
2183
+ label: m,
2184
+ offset: (Number(f) - a.min) / (a.max - a.min) * 100
2185
+ }))
2186
+ ), h = d(() => [
2187
+ "wx-slider",
2188
+ `wx-slider--${t.size.value}`,
2189
+ { "is-disabled": t.disabled.value, "is-range": a.range }
2190
+ ]);
2191
+ return (f, m) => (l(), u("div", {
2192
+ class: F(h.value)
2193
+ }, [
2194
+ x("div", Kl, [
2195
+ O(b(Ua), te({
2196
+ id: b(t).id.value
2197
+ }, f.$attrs, {
2198
+ class: "wx-slider__root",
2199
+ "model-value": o.value,
2200
+ min: e.min,
2201
+ max: e.max,
2202
+ step: e.step,
2203
+ disabled: b(t).disabled.value,
2204
+ "min-steps-between-thumbs": e.minStepsBetweenThumbs,
2205
+ name: e.name,
2206
+ "onUpdate:modelValue": c
2207
+ }), {
2208
+ default: Y(() => [
2209
+ O(b(Ea), { class: "wx-slider__track" }, {
2210
+ default: Y(() => [
2211
+ O(b(Oa), { class: "wx-slider__range" })
2212
+ ]),
2213
+ _: 1
2214
+ }),
2215
+ (l(!0), u(K, null, X(o.value.length, (g) => (l(), ie(b(ja), {
2216
+ key: g,
2217
+ class: "wx-slider__thumb",
2218
+ "aria-label": e.ariaLabel,
2219
+ "aria-describedby": b(t).describedBy.value
2220
+ }, null, 8, ["aria-label", "aria-describedby"]))), 128))
2221
+ ]),
2222
+ _: 1
2223
+ }, 16, ["id", "model-value", "min", "max", "step", "disabled", "min-steps-between-thumbs", "name"]),
2224
+ e.showValue ? (l(), u("span", Gl, D(e.range ? `${o.value[0]} — ${o.value[1]}` : o.value[0]), 1)) : C("", !0)
2225
+ ]),
2226
+ p.value.length ? (l(), u("div", ql, [
2227
+ (l(!0), u(K, null, X(p.value, (g) => (l(), u("span", {
2228
+ key: g.value,
2229
+ class: "wx-slider__mark",
2230
+ style: ee({ left: `${g.offset}%` })
2231
+ }, D(g.label), 5))), 128))
2232
+ ])) : C("", !0)
2233
+ ], 2));
2234
+ }
2235
+ }), Xl = /* @__PURE__ */ Q(Yl, [["__scopeId", "data-v-49653b8d"]]), Jl = ["id", "name", "checked", "disabled", "aria-label", "aria-describedby"], Zl = {
2236
+ key: 0,
2237
+ class: "wx-switch__label"
2238
+ }, Ql = /* @__PURE__ */ J({
2239
+ name: "WxSwitch",
2240
+ inheritAttrs: !1,
2241
+ __name: "Switch",
2242
+ props: /* @__PURE__ */ R({
2243
+ activeValue: { type: [String, Number, Boolean, null], default: !0 },
2244
+ inactiveValue: { type: [String, Number, Boolean, null], default: !1 },
2245
+ label: { default: void 0 },
2246
+ disabled: { type: Boolean, default: void 0 },
2247
+ size: { default: void 0 },
2248
+ id: { default: void 0 },
2249
+ name: { default: void 0 },
2250
+ ariaLabel: { default: void 0 }
2251
+ }, {
2252
+ modelValue: { type: [String, Number, Boolean, null], default: !1 },
2253
+ modelModifiers: {}
2254
+ }),
2255
+ emits: /* @__PURE__ */ R(["change"], ["update:modelValue"]),
2256
+ setup(e, { emit: _ }) {
2257
+ const a = e, n = _, s = G(e, "modelValue"), t = le(a), o = d(() => s.value === a.activeValue), c = d(() => a.size ?? t.size.value), p = d(() => [
2258
+ "wx-switch",
2259
+ `wx-switch--${c.value}`,
2260
+ { "is-checked": o.value, "is-disabled": t.disabled.value }
2261
+ ]);
2262
+ function h(f) {
2263
+ const m = f.target.checked ? a.activeValue : a.inactiveValue;
2264
+ s.value = m, n("change", m);
2265
+ }
2266
+ return (f, m) => (l(), u("label", {
2267
+ class: F(p.value)
2268
+ }, [
2269
+ x("input", te({
2270
+ id: b(t).id.value
2271
+ }, f.$attrs, {
2272
+ class: "wx-switch__native",
2273
+ type: "checkbox",
2274
+ role: "switch",
2275
+ name: e.name,
2276
+ checked: o.value,
2277
+ disabled: b(t).disabled.value,
2278
+ "aria-label": e.ariaLabel,
2279
+ "aria-describedby": b(t).describedBy.value,
2280
+ onChange: h
2281
+ }), null, 16, Jl),
2282
+ m[0] || (m[0] = x("span", {
2283
+ class: "wx-switch__track",
2284
+ "aria-hidden": "true"
2285
+ }, [
2286
+ x("span", { class: "wx-switch__thumb" })
2287
+ ], -1)),
2288
+ e.label || f.$slots.default ? (l(), u("span", Zl, [
2289
+ N(f.$slots, "default", {}, () => [
2290
+ ae(D(e.label), 1)
2291
+ ], !0)
2292
+ ])) : C("", !0)
2293
+ ], 2));
2294
+ }
2295
+ }), eo = /* @__PURE__ */ Q(Ql, [["__scopeId", "data-v-b9a90e4d"]]), ao = {
2296
+ key: 0,
2297
+ class: "wx-table__header"
2298
+ }, to = { class: "wx-table__title" }, lo = { class: "wx-table__tools" }, oo = {
2299
+ key: 0,
2300
+ class: "wx-table__search"
2301
+ }, io = ["aria-label", "aria-busy"], no = { class: "wx-table__head" }, so = ["aria-sort"], uo = ["onClick"], ro = { class: "wx-table__body" }, co = ["onClick"], vo = ["aria-expanded", "aria-label", "onClick"], fo = {
2302
+ key: 0,
2303
+ class: "wx-table__row--expansion"
2304
+ }, bo = ["colspan"], mo = {
2305
+ key: 0,
2306
+ class: "wx-table__row wx-table__row--empty"
2307
+ }, po = ["colspan"], ho = {
2308
+ key: 0,
2309
+ class: "wx-table__foot"
2310
+ }, yo = ["colspan"], xo = {
2311
+ key: 0,
2312
+ class: "wx-table__footer-row"
2313
+ }, go = ["colspan"], ko = {
2314
+ key: 1,
2315
+ class: "wx-table__loading"
2316
+ }, he = 44, Ke = "wx-table:", wo = /* @__PURE__ */ J({
2317
+ name: "WxTable",
2318
+ __name: "Table",
2319
+ props: /* @__PURE__ */ R({
2320
+ data: { default: null },
2321
+ columns: {},
2322
+ rowKey: { type: [String, Function], default: "id" },
2323
+ title: { default: void 0 },
2324
+ searchable: { type: Boolean, default: !1 },
2325
+ searchPlaceholder: { default: "Search" },
2326
+ searchDebounce: { default: 300 },
2327
+ loading: { type: Boolean, default: !1 },
2328
+ emptyText: { default: "Nothing to show" },
2329
+ stripe: { type: Boolean, default: !1 },
2330
+ bordered: { type: Boolean, default: !1 },
2331
+ hover: { type: Boolean, default: !0 },
2332
+ size: { default: "md" },
2333
+ selectable: { type: Boolean, default: !1 },
2334
+ selectableIf: { type: Function, default: void 0 },
2335
+ expandable: { type: Boolean, default: !1 },
2336
+ expandableIf: { type: Function, default: void 0 },
2337
+ summary: { default: () => [] },
2338
+ pagination: { type: Boolean, default: void 0 },
2339
+ perPageOptions: { default: () => [] },
2340
+ persist: { default: void 0 },
2341
+ maxHeight: { default: void 0 },
2342
+ rowClass: { type: Function, default: void 0 },
2343
+ layout: { default: "auto" },
2344
+ ariaLabel: { default: void 0 }
2345
+ }, {
2346
+ selected: { default: () => [] },
2347
+ selectedModifiers: {},
2348
+ expanded: { default: () => [] },
2349
+ expandedModifiers: {},
2350
+ sort: { default: null },
2351
+ sortModifiers: {},
2352
+ search: { default: "" },
2353
+ searchModifiers: {},
2354
+ page: { default: 1 },
2355
+ pageModifiers: {},
2356
+ perPage: { default: 15 },
2357
+ perPageModifiers: {}
2358
+ }),
2359
+ emits: /* @__PURE__ */ R(["row-click", "sort-change", "selection-change", "expand-change", "search", "state-change"], ["update:selected", "update:expanded", "update:sort", "update:search", "update:page", "update:perPage"]),
2360
+ setup(e, { emit: _ }) {
2361
+ const a = e, n = _, s = G(e, "selected"), t = G(e, "expanded"), o = G(e, "sort"), c = G(e, "search"), p = G(e, "page"), h = G(e, "perPage"), f = d(() => {
2362
+ const i = a.data;
2363
+ return i ? Array.isArray(i) ? i : i.data ?? [] : [];
2364
+ }), m = d(() => a.data && !Array.isArray(a.data) ? a.data : null), g = d(() => a.pagination ?? !!m.value), y = d(() => a.columns.filter((i) => !i.hidden)), P = d(() => (a.expandable ? 1 : 0) + (a.selectable ? 1 : 0)), V = d(() => y.value.length + P.value), B = qe(), $ = d(
2365
+ () => !!(a.title || a.searchable || B.title || B.actions)
2366
+ ), r = d(() => [
2367
+ "wx-table",
2368
+ `wx-table--${a.size}`,
2369
+ {
2370
+ "wx-table--stripe": a.stripe,
2371
+ "wx-table--bordered": a.bordered,
2372
+ "wx-table--hover": a.hover,
2373
+ "wx-table--sticky": a.maxHeight !== void 0,
2374
+ "is-loading": a.loading
2375
+ }
2376
+ ]), S = d(
2377
+ () => a.maxHeight === void 0 ? void 0 : { maxHeight: z(a.maxHeight) }
2378
+ );
2379
+ function z(i) {
2380
+ return typeof i == "number" ? `${i}px` : i;
2381
+ }
2382
+ function H(i) {
2383
+ if (typeof i.width == "number") return i.width;
2384
+ if (typeof i.width == "string") {
2385
+ const k = Number.parseFloat(i.width);
2386
+ return Number.isFinite(k) ? k : 0;
2387
+ }
2388
+ return 0;
2389
+ }
2390
+ function M(i) {
2391
+ return {
2392
+ width: i.width === void 0 ? void 0 : z(i.width),
2393
+ minWidth: i.minWidth === void 0 ? void 0 : z(i.minWidth)
2394
+ };
2395
+ }
2396
+ const w = d(() => {
2397
+ const i = /* @__PURE__ */ new Map();
2398
+ let k = P.value * he;
2399
+ const v = y.value.filter((se) => se.fixed === "left");
2400
+ v.forEach((se, be) => {
2401
+ i.set(se.key, { side: "left", offset: k, edge: be === v.length - 1 }), k += H(se);
2402
+ });
2403
+ let L = 0;
2404
+ const j = y.value.filter((se) => se.fixed === "right");
2405
+ for (let se = j.length - 1; se >= 0; se--) {
2406
+ const be = j[se];
2407
+ i.set(be.key, { side: "right", offset: L, edge: se === 0 }), L += H(be);
2408
+ }
2409
+ return i;
2410
+ }), E = d(() => y.value.some((i) => i.fixed === "left")), Z = d(() => w.value.size > 0);
2411
+ function W(i) {
2412
+ const k = w.value.get(i.key);
2413
+ if (k)
2414
+ return { [`--wx-pin-${k.side}`]: `${k.offset}px` };
2415
+ }
2416
+ function U(i) {
2417
+ const k = w.value.get(i.key);
2418
+ if (k)
2419
+ return [`is-fixed-${k.side}`, { "is-fixed-edge": k.edge }];
2420
+ }
2421
+ function T(i) {
2422
+ return Z.value ? { "--wx-pin-left": `${i === "select" && a.expandable ? he : 0}px` } : void 0;
2423
+ }
2424
+ const A = d(
2425
+ () => Z.value ? ["is-fixed-left", { "is-fixed-edge": !E.value }] : void 0
2426
+ );
2427
+ function I(i, k) {
2428
+ return k.includes(".") ? k.split(".").reduce((v, L) => {
2429
+ if (!(v === null || typeof v != "object"))
2430
+ return v[L];
2431
+ }, i) : i[k];
2432
+ }
2433
+ function oe(i, k, v) {
2434
+ const L = I(k, i.key);
2435
+ return i.formatter ? i.formatter(L, k, v) : L == null ? "" : String(L);
2436
+ }
2437
+ function ue(i, k) {
2438
+ if (typeof a.rowKey == "function") return a.rowKey(i, k);
2439
+ const v = I(i, a.rowKey);
2440
+ return typeof v == "string" || typeof v == "number" ? v : k;
2441
+ }
2442
+ function Ve(i) {
2443
+ return a.selectableIf ? a.selectableIf(i) : !0;
2444
+ }
2445
+ function ze(i) {
2446
+ return a.expandableIf ? a.expandableIf(i) : !0;
2447
+ }
2448
+ const ta = d(() => f.value.filter(Ve)), re = d(
2449
+ () => ta.value.map((i) => ue(i, f.value.indexOf(i)))
2450
+ ), Pe = d(
2451
+ () => re.value.filter((i) => s.value.includes(i)).length
2452
+ ), We = d(
2453
+ () => re.value.length > 0 && Pe.value === re.value.length
2454
+ ), la = d(() => Pe.value > 0 && !We.value);
2455
+ function Ae(i) {
2456
+ return f.value.filter((k, v) => i.includes(ue(k, v)));
2457
+ }
2458
+ function ve(i) {
2459
+ s.value = i, n("selection-change", i, Ae(i));
2460
+ }
2461
+ function oa(i) {
2462
+ const k = re.value;
2463
+ ve(i ? [...s.value, ...k.filter((v) => !s.value.includes(v))] : s.value.filter((v) => !k.includes(v)));
2464
+ }
2465
+ function ia(i, k, v) {
2466
+ const L = ue(i, k);
2467
+ v ? s.value.includes(L) || ve([...s.value, L]) : ve(s.value.filter((j) => j !== L));
2468
+ }
2469
+ function Le(i, k) {
2470
+ return s.value.includes(ue(i, k));
2471
+ }
2472
+ function fe(i, k) {
2473
+ return t.value.includes(ue(i, k));
2474
+ }
2475
+ function na(i, k) {
2476
+ if (!ze(i)) return;
2477
+ const v = ue(i, k), L = t.value.includes(v) ? t.value.filter((j) => j !== v) : [...t.value, v];
2478
+ t.value = L, n("expand-change", L, Ae(L));
2479
+ }
2480
+ function sa(i) {
2481
+ if (!i.sortable) return;
2482
+ const k = o.value;
2483
+ let v;
2484
+ k?.key !== i.key ? v = { key: i.key, order: "asc" } : k.order === "asc" ? v = { key: i.key, order: "desc" } : v = null, o.value = v, p.value = 1, n("sort-change", v);
2485
+ }
2486
+ function ua(i) {
2487
+ if (i.sortable)
2488
+ return o.value?.key !== i.key ? "none" : o.value.order === "asc" ? "ascending" : "descending";
2489
+ }
2490
+ function Re(i) {
2491
+ return o.value?.key === i.key ? o.value.order : null;
2492
+ }
2493
+ function $e(i) {
2494
+ return i.align && i.align !== "left" ? `wx-table__cell--${i.align}` : void 0;
2495
+ }
2496
+ let _e;
2497
+ const Be = q(c.value);
2498
+ function da(i) {
2499
+ c.value = i === void 0 ? "" : String(i);
2500
+ }
2501
+ function ra(i) {
2502
+ clearTimeout(_e);
2503
+ const k = () => {
2504
+ Be.value = i, p.value = 1, n("search", i);
2505
+ };
2506
+ a.searchDebounce ? _e = setTimeout(k, a.searchDebounce) : k();
2507
+ }
2508
+ ya(() => clearTimeout(_e));
2509
+ const Fe = d(() => ({
2510
+ page: p.value,
2511
+ perPage: h.value,
2512
+ sort: o.value,
2513
+ search: Be.value
2514
+ }));
2515
+ function ca() {
2516
+ if (!a.persist) return;
2517
+ let i = null;
2518
+ try {
2519
+ const k = window.localStorage.getItem(Ke + a.persist);
2520
+ i = k ? JSON.parse(k) : null;
2521
+ } catch {
2522
+ return;
2523
+ }
2524
+ i && (typeof i.page == "number" && i.page > 0 && (p.value = i.page), typeof i.perPage == "number" && i.perPage > 0 && (h.value = i.perPage), typeof i.search == "string" && (c.value = i.search), i.sort === null ? o.value = null : i.sort && typeof i.sort.key == "string" && (o.value = { key: i.sort.key, order: i.sort.order === "desc" ? "desc" : "asc" }));
2525
+ }
2526
+ function va(i) {
2527
+ if (a.persist)
2528
+ try {
2529
+ window.localStorage.setItem(Ke + a.persist, JSON.stringify(i));
2530
+ } catch {
2531
+ }
2532
+ }
2533
+ Ce(() => {
2534
+ ca(), Be.value = c.value, n("state-change", Fe.value), ne(c, ra), ne(Fe, (i) => {
2535
+ va(i), n("state-change", i);
2536
+ });
2537
+ });
2538
+ function He(i) {
2539
+ const k = i.cells ?? {}, v = y.value.findIndex((L) => L.key in k);
2540
+ return v === -1 ? y.value.length : v;
2541
+ }
2542
+ function De(i) {
2543
+ return P.value + He(i);
2544
+ }
2545
+ function fa(i) {
2546
+ return y.value.slice(He(i));
2547
+ }
2548
+ function Ne(i, k) {
2549
+ return i.cells?.[k.key];
2550
+ }
2551
+ function ba(i, k) {
2552
+ const v = Ne(i, k);
2553
+ return v == null ? "" : String(v);
2554
+ }
2555
+ return (i, k) => (l(), u("div", {
2556
+ class: F(r.value)
2557
+ }, [
2558
+ $.value ? (l(), u("header", ao, [
2559
+ x("div", to, [
2560
+ N(i.$slots, "title", {}, () => [
2561
+ ae(D(e.title), 1)
218
2562
  ], !0)
219
2563
  ]),
220
- l.$slots.extra ? (n(), d("div", X, [
221
- p(l.$slots, "extra", {}, void 0, !0)
222
- ])) : f("", !0)
223
- ])) : f("", !0),
224
- m("div", Y, [
225
- p(l.$slots, "default", {}, void 0, !0)
2564
+ x("div", lo, [
2565
+ N(i.$slots, "actions", {}, void 0, !0),
2566
+ e.searchable ? (l(), u("div", oo, [
2567
+ O(Qe, {
2568
+ type: "search",
2569
+ "model-value": c.value,
2570
+ placeholder: e.searchPlaceholder,
2571
+ size: e.size,
2572
+ clearable: "",
2573
+ "aria-label": e.searchPlaceholder,
2574
+ "onUpdate:modelValue": da
2575
+ }, null, 8, ["model-value", "placeholder", "size", "aria-label"])
2576
+ ])) : C("", !0)
2577
+ ])
2578
+ ])) : C("", !0),
2579
+ x("div", {
2580
+ class: "wx-table__scroll",
2581
+ style: ee(S.value)
2582
+ }, [
2583
+ x("table", {
2584
+ class: F(["wx-table__table", { "wx-table__table--fixed": e.layout === "fixed" }]),
2585
+ "aria-label": e.ariaLabel,
2586
+ "aria-busy": e.loading || void 0
2587
+ }, [
2588
+ x("colgroup", null, [
2589
+ e.expandable ? (l(), u("col", {
2590
+ key: 0,
2591
+ style: ee({ width: `${he}px` })
2592
+ }, null, 4)) : C("", !0),
2593
+ e.selectable ? (l(), u("col", {
2594
+ key: 1,
2595
+ style: ee({ width: `${he}px` })
2596
+ }, null, 4)) : C("", !0),
2597
+ (l(!0), u(K, null, X(y.value, (v) => (l(), u("col", {
2598
+ key: v.key,
2599
+ style: ee(M(v))
2600
+ }, null, 4))), 128))
2601
+ ]),
2602
+ x("thead", no, [
2603
+ x("tr", null, [
2604
+ e.expandable ? (l(), u("th", {
2605
+ key: 0,
2606
+ scope: "col",
2607
+ class: F(["wx-table__cell wx-table__cell--utility", A.value]),
2608
+ style: ee(T("expand"))
2609
+ }, [...k[4] || (k[4] = [
2610
+ x("span", { class: "wx-table__sr-only" }, "Expand", -1)
2611
+ ])], 6)) : C("", !0),
2612
+ e.selectable ? (l(), u("th", {
2613
+ key: 1,
2614
+ scope: "col",
2615
+ class: F(["wx-table__cell wx-table__cell--utility", A.value]),
2616
+ style: ee(T("select"))
2617
+ }, [
2618
+ O(ye, {
2619
+ "model-value": We.value,
2620
+ indeterminate: la.value,
2621
+ disabled: !re.value.length,
2622
+ "aria-label": "Select every row on this page",
2623
+ "onUpdate:modelValue": oa
2624
+ }, null, 8, ["model-value", "indeterminate", "disabled"])
2625
+ ], 6)) : C("", !0),
2626
+ (l(!0), u(K, null, X(y.value, (v) => (l(), u("th", {
2627
+ key: v.key,
2628
+ scope: "col",
2629
+ class: F(["wx-table__cell", [$e(v), U(v), v.headerClass]]),
2630
+ style: ee(W(v)),
2631
+ "aria-sort": ua(v)
2632
+ }, [
2633
+ v.sortable ? (l(), u("button", {
2634
+ key: 0,
2635
+ class: "wx-table__sort",
2636
+ type: "button",
2637
+ onClick: (L) => sa(v)
2638
+ }, [
2639
+ N(i.$slots, `header-${v.key}`, { column: v }, () => [
2640
+ ae(D(v.label ?? v.key), 1)
2641
+ ], !0),
2642
+ (l(), u("svg", {
2643
+ class: F(["wx-table__sort-icon", Re(v) ? `is-${Re(v)}` : void 0]),
2644
+ viewBox: "0 0 8 12",
2645
+ "aria-hidden": "true"
2646
+ }, [...k[5] || (k[5] = [
2647
+ x("path", {
2648
+ class: "wx-table__sort-up",
2649
+ d: "M4 1 7 5 1 5Z"
2650
+ }, null, -1),
2651
+ x("path", {
2652
+ class: "wx-table__sort-down",
2653
+ d: "M4 11 1 7 7 7Z"
2654
+ }, null, -1)
2655
+ ])], 2))
2656
+ ], 8, uo)) : N(i.$slots, `header-${v.key}`, { column: v }, () => [
2657
+ ae(D(v.label ?? v.key), 1)
2658
+ ], !0, 1)
2659
+ ], 14, so))), 128))
2660
+ ])
2661
+ ]),
2662
+ x("tbody", ro, [
2663
+ (l(!0), u(K, null, X(f.value, (v, L) => (l(), u(K, {
2664
+ key: ue(v, L)
2665
+ }, [
2666
+ x("tr", {
2667
+ class: F(["wx-table__row", [
2668
+ e.rowClass?.(v, L),
2669
+ {
2670
+ "is-striped": L % 2 === 1,
2671
+ "is-selected": e.selectable && Le(v, L),
2672
+ "is-expanded": e.expandable && fe(v, L)
2673
+ }
2674
+ ]]),
2675
+ onClick: (j) => n("row-click", v, L, j)
2676
+ }, [
2677
+ e.expandable ? (l(), u("td", {
2678
+ key: 0,
2679
+ class: F(["wx-table__cell wx-table__cell--utility", A.value]),
2680
+ style: ee(T("expand")),
2681
+ onClick: k[0] || (k[0] = de(() => {
2682
+ }, ["stop"]))
2683
+ }, [
2684
+ ze(v) ? (l(), u("button", {
2685
+ key: 0,
2686
+ class: "wx-table__expander",
2687
+ type: "button",
2688
+ "aria-expanded": fe(v, L),
2689
+ "aria-label": fe(v, L) ? "Collapse row" : "Expand row",
2690
+ onClick: (j) => na(v, L)
2691
+ }, [...k[6] || (k[6] = [
2692
+ x("svg", {
2693
+ viewBox: "0 0 12 12",
2694
+ "aria-hidden": "true"
2695
+ }, [
2696
+ x("path", { d: "M4.5 2 8.5 6l-4 4" })
2697
+ ], -1)
2698
+ ])], 8, vo)) : C("", !0)
2699
+ ], 6)) : C("", !0),
2700
+ e.selectable ? (l(), u("td", {
2701
+ key: 1,
2702
+ class: F(["wx-table__cell wx-table__cell--utility", A.value]),
2703
+ style: ee(T("select")),
2704
+ onClick: k[1] || (k[1] = de(() => {
2705
+ }, ["stop"]))
2706
+ }, [
2707
+ O(ye, {
2708
+ "model-value": Le(v, L),
2709
+ disabled: !Ve(v),
2710
+ "aria-label": "Select row",
2711
+ "onUpdate:modelValue": (j) => ia(v, L, j)
2712
+ }, null, 8, ["model-value", "disabled", "onUpdate:modelValue"])
2713
+ ], 6)) : C("", !0),
2714
+ (l(!0), u(K, null, X(y.value, (j) => (l(), u("td", {
2715
+ key: j.key,
2716
+ class: F(["wx-table__cell", [$e(j), U(j), j.cellClass]]),
2717
+ style: ee(W(j))
2718
+ }, [
2719
+ N(i.$slots, `cell-${j.key}`, {
2720
+ row: v,
2721
+ value: I(v, j.key),
2722
+ index: L,
2723
+ column: j
2724
+ }, () => [
2725
+ ae(D(oe(j, v, L)), 1)
2726
+ ], !0)
2727
+ ], 6))), 128))
2728
+ ], 10, co),
2729
+ e.expandable && fe(v, L) ? (l(), u("tr", fo, [
2730
+ x("td", {
2731
+ class: "wx-table__cell wx-table__expansion",
2732
+ colspan: V.value
2733
+ }, [
2734
+ N(i.$slots, "expanded", {
2735
+ row: v,
2736
+ index: L
2737
+ }, void 0, !0)
2738
+ ], 8, bo)
2739
+ ])) : C("", !0)
2740
+ ], 64))), 128)),
2741
+ !f.value.length && !e.loading ? (l(), u("tr", mo, [
2742
+ x("td", {
2743
+ class: "wx-table__cell wx-table__empty",
2744
+ colspan: V.value
2745
+ }, [
2746
+ N(i.$slots, "empty", {}, () => [
2747
+ ae(D(e.emptyText), 1)
2748
+ ], !0)
2749
+ ], 8, po)
2750
+ ])) : C("", !0)
2751
+ ]),
2752
+ e.summary.length || i.$slots.footer || g.value ? (l(), u("tfoot", ho, [
2753
+ (l(!0), u(K, null, X(e.summary, (v, L) => (l(), u("tr", {
2754
+ key: L,
2755
+ class: F(["wx-table__summary", [v.class, { "is-strong": v.strong }]])
2756
+ }, [
2757
+ De(v) > 0 ? (l(), u("td", {
2758
+ key: 0,
2759
+ class: "wx-table__cell wx-table__summary-label",
2760
+ colspan: De(v)
2761
+ }, D(v.label), 9, yo)) : C("", !0),
2762
+ (l(!0), u(K, null, X(fa(v), (j) => (l(), u("td", {
2763
+ key: j.key,
2764
+ class: F(["wx-table__cell", $e(j)])
2765
+ }, [
2766
+ N(i.$slots, `summary-${j.key}`, {
2767
+ row: v,
2768
+ value: Ne(v, j)
2769
+ }, () => [
2770
+ ae(D(ba(v, j)), 1)
2771
+ ], !0)
2772
+ ], 2))), 128))
2773
+ ], 2))), 128)),
2774
+ i.$slots.footer || g.value ? (l(), u("tr", xo, [
2775
+ x("td", {
2776
+ class: "wx-table__cell",
2777
+ colspan: V.value
2778
+ }, [
2779
+ N(i.$slots, "footer", {}, () => [
2780
+ O(ea, {
2781
+ page: p.value,
2782
+ "onUpdate:page": k[2] || (k[2] = (v) => p.value = v),
2783
+ "per-page": h.value,
2784
+ "onUpdate:perPage": k[3] || (k[3] = (v) => h.value = v),
2785
+ paginator: m.value,
2786
+ "per-page-options": e.perPageOptions,
2787
+ size: e.size,
2788
+ disabled: e.loading
2789
+ }, null, 8, ["page", "per-page", "paginator", "per-page-options", "size", "disabled"])
2790
+ ], !0)
2791
+ ], 8, go)
2792
+ ])) : C("", !0)
2793
+ ])) : C("", !0)
2794
+ ], 10, io)
2795
+ ], 4),
2796
+ e.loading ? (l(), u("div", ko, [
2797
+ N(i.$slots, "loading", {}, () => [
2798
+ k[7] || (k[7] = x("span", {
2799
+ class: "wx-table__spinner",
2800
+ "aria-hidden": "true"
2801
+ }, null, -1)),
2802
+ k[8] || (k[8] = x("span", { class: "wx-table__loading-text" }, "Loading", -1))
2803
+ ], !0)
2804
+ ])) : C("", !0)
2805
+ ], 2));
2806
+ }
2807
+ }), $o = /* @__PURE__ */ Q(wo, [["__scopeId", "data-v-8fdfcfc9"]]), _o = ["aria-label", "onClick"], Bo = ["id", "value", "placeholder", "disabled", "aria-label", "aria-describedby", "aria-invalid", "aria-expanded"], Mo = {
2808
+ key: 0,
2809
+ class: "wx-tags-input__list",
2810
+ role: "listbox"
2811
+ }, Co = ["aria-selected", "onMousedown", "onMousemove"], So = ["name"], To = ["value"], Io = /* @__PURE__ */ J({
2812
+ name: "WxTagsInput",
2813
+ inheritAttrs: !1,
2814
+ __name: "TagsInput",
2815
+ props: /* @__PURE__ */ R({
2816
+ suggestions: { default: () => [] },
2817
+ placeholder: { default: void 0 },
2818
+ emptyText: { default: "Nothing found" },
2819
+ max: { default: void 0 },
2820
+ duplicates: { type: Boolean, default: !1 },
2821
+ allowCreate: { type: Boolean, default: !0 },
2822
+ disabled: { type: Boolean, default: void 0 },
2823
+ size: { default: void 0 },
2824
+ status: { default: void 0 },
2825
+ id: { default: void 0 },
2826
+ name: { default: void 0 },
2827
+ ariaLabel: { default: void 0 }
2828
+ }, {
2829
+ modelValue: { default: () => [] },
2830
+ modelModifiers: {}
2831
+ }),
2832
+ emits: /* @__PURE__ */ R(["change", "search"], ["update:modelValue"]),
2833
+ setup(e, { expose: _, emit: a }) {
2834
+ const n = e, s = a, t = G(e, "modelValue"), o = le(n), c = q(null), p = q(""), h = q(!1), f = q(-1), m = q(-1), g = d(() => t.value ?? []), y = d(
2835
+ () => n.suggestions.filter((w) => !g.value.includes(w))
2836
+ ), P = d(() => h.value && y.value.length > 0), V = d(() => n.max !== void 0 && g.value.length >= n.max), B = d(() => [
2837
+ "wx-tags-input",
2838
+ `wx-tags-input--${o.size.value}`,
2839
+ {
2840
+ [`wx-tags-input--${o.status.value}`]: o.status.value !== "default",
2841
+ "is-open": P.value,
2842
+ "is-disabled": o.disabled.value
2843
+ }
2844
+ ]);
2845
+ ne(y, () => {
2846
+ f.value = -1;
2847
+ });
2848
+ function $(w) {
2849
+ t.value = w, s("change", w);
2850
+ }
2851
+ function r(w) {
2852
+ const E = w.trim();
2853
+ if (!(!E || V.value)) {
2854
+ if (!n.duplicates && g.value.includes(E)) {
2855
+ p.value = "";
2856
+ return;
2857
+ }
2858
+ $([...g.value, E]), p.value = "", h.value = !1, m.value = -1;
2859
+ }
2860
+ }
2861
+ function S(w) {
2862
+ $(g.value.filter((E, Z) => Z !== w)), m.value = -1;
2863
+ }
2864
+ function z(w) {
2865
+ const E = w.target.value;
2866
+ p.value = E, m.value = -1, f.value = -1, E && (h.value = !0), s("search", E);
2867
+ }
2868
+ function H(w) {
2869
+ if (w.key === "Escape") {
2870
+ h.value = !1, m.value = -1;
2871
+ return;
2872
+ }
2873
+ if (w.key === "Backspace" && p.value === "" && g.value.length > 0) {
2874
+ w.preventDefault(), m.value === g.value.length - 1 ? S(m.value) : m.value = g.value.length - 1;
2875
+ return;
2876
+ }
2877
+ if (w.key === "ArrowDown" && P.value) {
2878
+ w.preventDefault(), f.value = (f.value + 1) % y.value.length;
2879
+ return;
2880
+ }
2881
+ if (w.key === "ArrowUp" && P.value) {
2882
+ w.preventDefault(), f.value = f.value <= 0 ? y.value.length - 1 : f.value - 1;
2883
+ return;
2884
+ }
2885
+ w.key === "Enter" && (w.preventDefault(), P.value && f.value >= 0 ? r(y.value[f.value]) : n.allowCreate && r(p.value));
2886
+ }
2887
+ function M() {
2888
+ m.value = -1, window.setTimeout(() => {
2889
+ h.value = !1;
2890
+ }, 120);
2891
+ }
2892
+ return _({ focus: () => c.value?.focus() }), (w, E) => (l(), u("div", {
2893
+ class: F(B.value)
2894
+ }, [
2895
+ x("div", {
2896
+ class: "wx-tags-input__anchor",
2897
+ onClick: E[1] || (E[1] = (Z) => c.value?.focus())
2898
+ }, [
2899
+ (l(!0), u(K, null, X(g.value, (Z, W) => (l(), u("span", {
2900
+ key: Z,
2901
+ class: F(["wx-tags-input__tag", { "is-armed": W === m.value }])
2902
+ }, [
2903
+ ae(D(Z) + " ", 1),
2904
+ b(o).disabled.value ? C("", !0) : (l(), u("button", {
2905
+ key: 0,
2906
+ class: "wx-tags-input__remove",
2907
+ type: "button",
2908
+ tabindex: "-1",
2909
+ "aria-label": `Remove ${Z}`,
2910
+ onClick: de((U) => S(W), ["stop"])
2911
+ }, " ✕ ", 8, _o))
2912
+ ], 2))), 128)),
2913
+ x("input", te({
2914
+ id: b(o).id.value,
2915
+ ref_key: "inputRef",
2916
+ ref: c
2917
+ }, w.$attrs, {
2918
+ class: "wx-tags-input__field",
2919
+ type: "text",
2920
+ role: "combobox",
2921
+ autocomplete: "off",
2922
+ value: p.value,
2923
+ placeholder: e.placeholder,
2924
+ disabled: b(o).disabled.value,
2925
+ "aria-label": e.ariaLabel,
2926
+ "aria-describedby": b(o).describedBy.value,
2927
+ "aria-invalid": b(o).status.value === "error" || void 0,
2928
+ "aria-expanded": P.value,
2929
+ onInput: z,
2930
+ onKeydown: H,
2931
+ onFocus: E[0] || (E[0] = (Z) => h.value = !0),
2932
+ onBlur: M
2933
+ }), null, 16, Bo),
2934
+ P.value ? (l(), u("ul", Mo, [
2935
+ (l(!0), u(K, null, X(y.value, (Z, W) => (l(), u("li", {
2936
+ key: Z,
2937
+ class: F(["wx-tags-input__option", { "is-highlighted": W === f.value }]),
2938
+ role: "option",
2939
+ "aria-selected": W === f.value,
2940
+ onMousedown: de((U) => r(Z), ["prevent"]),
2941
+ onMousemove: (U) => f.value = W
2942
+ }, D(Z), 43, Co))), 128))
2943
+ ])) : C("", !0)
226
2944
  ]),
227
- l.$slots.footer ? (n(), d("footer", Z, [
228
- p(l.$slots, "footer", {}, void 0, !0)
229
- ])) : f("", !0)
2945
+ e.name ? (l(), u("select", {
2946
+ key: 0,
2947
+ class: "wx-sr-only",
2948
+ name: e.name,
2949
+ multiple: "",
2950
+ tabindex: "-1",
2951
+ "aria-hidden": "true"
2952
+ }, [
2953
+ (l(!0), u(K, null, X(g.value, (Z) => (l(), u("option", {
2954
+ key: Z,
2955
+ value: Z,
2956
+ selected: ""
2957
+ }, D(Z), 9, To))), 128))
2958
+ ], 8, So)) : C("", !0)
230
2959
  ], 2));
231
2960
  }
232
- }), te = /* @__PURE__ */ y(ee, [["__scopeId", "data-v-5d02af6e"]]), ae = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2961
+ }), Vo = /* @__PURE__ */ Q(Io, [["__scopeId", "data-v-fcf7fe37"]]), zo = ["id", "value", "rows", "placeholder", "disabled", "readonly", "maxlength", "aria-label", "aria-describedby", "aria-invalid"], Po = {
2962
+ key: 0,
2963
+ class: "wx-textarea__count"
2964
+ }, Wo = /* @__PURE__ */ J({
2965
+ name: "WxTextarea",
2966
+ inheritAttrs: !1,
2967
+ __name: "Textarea",
2968
+ props: /* @__PURE__ */ R({
2969
+ size: { default: void 0 },
2970
+ status: { default: void 0 },
2971
+ id: { default: void 0 },
2972
+ placeholder: { default: void 0 },
2973
+ disabled: { type: Boolean, default: void 0 },
2974
+ readonly: { type: Boolean, default: !1 },
2975
+ rows: { default: 3 },
2976
+ autosize: { type: [Boolean, Object], default: !1 },
2977
+ maxlength: { default: void 0 },
2978
+ showCount: { type: Boolean, default: !1 },
2979
+ resize: { default: "vertical" },
2980
+ ariaLabel: { default: void 0 }
2981
+ }, {
2982
+ modelValue: { default: "" },
2983
+ modelModifiers: {}
2984
+ }),
2985
+ emits: /* @__PURE__ */ R(["input", "change", "focus", "blur"], ["update:modelValue"]),
2986
+ setup(e, { expose: _, emit: a }) {
2987
+ const n = e, s = a, t = G(e, "modelValue"), o = le(n), c = q(null), p = q(!1), h = d(() => t.value ?? ""), f = d(
2988
+ () => n.showCount && n.maxlength ? `${h.value.length}/${n.maxlength}` : null
2989
+ ), m = d(
2990
+ () => n.autosize === !0 ? {} : n.autosize === !1 ? null : n.autosize
2991
+ ), g = d(() => [
2992
+ "wx-textarea",
2993
+ `wx-textarea--${o.size.value}`,
2994
+ {
2995
+ [`wx-textarea--${o.status.value}`]: o.status.value !== "default",
2996
+ "is-focused": p.value,
2997
+ "is-disabled": o.disabled.value,
2998
+ "is-readonly": n.readonly,
2999
+ "is-autosize": !!m.value
3000
+ }
3001
+ ]);
3002
+ function y() {
3003
+ const r = m.value, S = c.value;
3004
+ if (!r || !S) return;
3005
+ S.style.height = "auto";
3006
+ const z = getComputedStyle(S), H = Number.parseFloat(z.lineHeight) || 20, M = Number.parseFloat(z.paddingTop) + Number.parseFloat(z.paddingBottom) + Number.parseFloat(z.borderTopWidth) + Number.parseFloat(z.borderBottomWidth);
3007
+ let w = S.scrollHeight;
3008
+ r.minRows && (w = Math.max(w, r.minRows * H + M)), r.maxRows && (w = Math.min(w, r.maxRows * H + M)), S.style.height = `${w}px`, S.style.overflowY = r.maxRows && S.scrollHeight > w ? "auto" : "hidden";
3009
+ }
3010
+ Ce(() => Ue(y)), ne([h, m], () => Ue(y));
3011
+ function P(r) {
3012
+ const S = r.target.value;
3013
+ t.value = S, s("input", S);
3014
+ }
3015
+ function V(r) {
3016
+ s("change", r.target.value);
3017
+ }
3018
+ function B(r) {
3019
+ p.value = !0, s("focus", r);
3020
+ }
3021
+ function $(r) {
3022
+ p.value = !1, s("blur", r);
3023
+ }
3024
+ return _({
3025
+ focus: () => c.value?.focus(),
3026
+ blur: () => c.value?.blur(),
3027
+ select: () => c.value?.select(),
3028
+ textarea: c
3029
+ }), (r, S) => (l(), u("div", {
3030
+ class: F(g.value)
3031
+ }, [
3032
+ x("textarea", te({
3033
+ id: b(o).id.value,
3034
+ ref_key: "textareaRef",
3035
+ ref: c
3036
+ }, r.$attrs, {
3037
+ class: "wx-textarea__inner",
3038
+ value: h.value,
3039
+ rows: e.rows,
3040
+ placeholder: e.placeholder,
3041
+ disabled: b(o).disabled.value,
3042
+ readonly: e.readonly,
3043
+ maxlength: e.maxlength,
3044
+ "aria-label": e.ariaLabel,
3045
+ "aria-describedby": b(o).describedBy.value,
3046
+ "aria-invalid": b(o).status.value === "error" || void 0,
3047
+ style: { resize: e.resize },
3048
+ onInput: P,
3049
+ onChange: V,
3050
+ onFocus: B,
3051
+ onBlur: $
3052
+ }), null, 16, zo),
3053
+ f.value ? (l(), u("span", Po, D(f.value), 1)) : C("", !0)
3054
+ ], 2));
3055
+ }
3056
+ }), Ao = /* @__PURE__ */ Q(Wo, [["__scopeId", "data-v-bbca9693"]]), Lo = /* @__PURE__ */ J({
3057
+ name: "WxTimePicker",
3058
+ __name: "TimePicker",
3059
+ props: /* @__PURE__ */ R({
3060
+ valueFormat: { default: void 0 },
3061
+ format: { default: void 0 },
3062
+ placeholder: { default: void 0 },
3063
+ clearable: { type: Boolean, default: void 0 },
3064
+ minDate: { default: void 0 },
3065
+ maxDate: { default: void 0 },
3066
+ seconds: { type: Boolean, default: void 0 },
3067
+ minutesIncrement: { default: void 0 },
3068
+ is24: { type: Boolean, default: void 0 },
3069
+ weekStart: { default: void 0 },
3070
+ autoApply: { type: Boolean, default: void 0 },
3071
+ textInput: { type: Boolean, default: void 0 },
3072
+ teleport: { type: [Boolean, String], default: void 0 },
3073
+ disabled: { type: Boolean, default: void 0 },
3074
+ readonly: { type: Boolean, default: void 0 },
3075
+ size: { default: void 0 },
3076
+ status: { default: void 0 },
3077
+ id: { default: void 0 },
3078
+ name: { default: void 0 },
3079
+ ariaLabel: { default: void 0 }
3080
+ }, {
3081
+ modelValue: { default: null },
3082
+ modelModifiers: {}
3083
+ }),
3084
+ emits: ["update:modelValue"],
3085
+ setup(e) {
3086
+ const _ = G(e, "modelValue");
3087
+ return (a, n) => (l(), ie(Ie, te({
3088
+ modelValue: _.value,
3089
+ "onUpdate:modelValue": n[0] || (n[0] = (s) => _.value = s),
3090
+ type: "time"
3091
+ }, a.$props), ge({ _: 2 }, [
3092
+ X(a.$slots, (s, t) => ({
3093
+ name: t,
3094
+ fn: Y((o) => [
3095
+ N(a.$slots, t, ke(we(o ?? {})))
3096
+ ])
3097
+ }))
3098
+ ]), 1040, ["modelValue"]));
3099
+ }
3100
+ }), Ro = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
233
3101
  __proto__: null,
234
- WxButton: R,
235
- WxCard: te,
236
- WxInput: J
237
- }, Symbol.toStringTag, { value: "Module" })), le = {
238
- install(t, u = {}) {
239
- const { prefix: e = "Wx" } = u;
240
- for (const [a, o] of Object.entries(ae)) {
241
- if (!a.startsWith("Wx")) continue;
242
- const l = e === "Wx" ? a : `${e}${a.slice(2)}`;
243
- t.component(l, o);
3102
+ WxButton: lt,
3103
+ WxCard: ft,
3104
+ WxCheckbox: ye,
3105
+ WxCheckboxGroup: _t,
3106
+ WxColorPicker: It,
3107
+ WxDatePicker: Ie,
3108
+ WxDateRangePicker: Vt,
3109
+ WxDateTimePicker: zt,
3110
+ WxForm: Wt,
3111
+ WxFormItem: Ht,
3112
+ WxInput: Qe,
3113
+ WxInputNumber: Yt,
3114
+ WxPagination: ea,
3115
+ WxRadio: aa,
3116
+ WxRadioGroup: fl,
3117
+ WxRate: xl,
3118
+ WxRichText: Fl,
3119
+ WxSelect: jl,
3120
+ WxSlider: Xl,
3121
+ WxSwitch: eo,
3122
+ WxTable: $o,
3123
+ WxTagsInput: Vo,
3124
+ WxTextarea: Ao,
3125
+ WxTimePicker: Lo
3126
+ }, Symbol.toStringTag, { value: "Module" })), Go = {
3127
+ install(e, _ = {}) {
3128
+ const { prefix: a = "Wx" } = _;
3129
+ for (const [n, s] of Object.entries(Ro)) {
3130
+ if (!n.startsWith("Wx")) continue;
3131
+ const t = a === "Wx" ? n : `${a}${n.slice(2)}`;
3132
+ e.component(t, s);
244
3133
  }
245
3134
  }
246
3135
  };
247
3136
  export {
248
- le as WebxUI,
249
- R as WxButton,
250
- te as WxCard,
251
- J as WxInput
3137
+ Go as WebxUI,
3138
+ lt as WxButton,
3139
+ ft as WxCard,
3140
+ ye as WxCheckbox,
3141
+ _t as WxCheckboxGroup,
3142
+ It as WxColorPicker,
3143
+ Ie as WxDatePicker,
3144
+ Vt as WxDateRangePicker,
3145
+ zt as WxDateTimePicker,
3146
+ Wt as WxForm,
3147
+ Ht as WxFormItem,
3148
+ Qe as WxInput,
3149
+ Yt as WxInputNumber,
3150
+ ea as WxPagination,
3151
+ aa as WxRadio,
3152
+ fl as WxRadioGroup,
3153
+ xl as WxRate,
3154
+ Fl as WxRichText,
3155
+ jl as WxSelect,
3156
+ Xl as WxSlider,
3157
+ eo as WxSwitch,
3158
+ $o as WxTable,
3159
+ Vo as WxTagsInput,
3160
+ Ao as WxTextarea,
3161
+ Lo as WxTimePicker
252
3162
  };
253
3163
  //# sourceMappingURL=index.js.map