@solfacil/girassol 0.1.10 → 0.2.1

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 (47) hide show
  1. package/cli/build/templates/components.d.ts.ejs +1 -1
  2. package/dist/README.md.d.ts +2 -0
  3. package/dist/cli/readme.md.d.ts +2 -0
  4. package/dist/components.d.ts +1 -0
  5. package/dist/components.json +1 -1
  6. package/dist/girassol.es.js +1330 -1274
  7. package/dist/girassol.umd.js +3 -3
  8. package/dist/style.css +1 -1
  9. package/dist/theme/safelist.d.ts +14 -0
  10. package/dist/theme/solfacil/colors.d.ts +28 -4
  11. package/dist/theme/solfacil/effects.d.ts +8 -6
  12. package/dist/theme/solfacil/index.d.ts +1 -0
  13. package/dist/theme/solfacil/spacing.d.ts +3 -0
  14. package/dist/theme/solfacil/typography.d.ts +1 -1
  15. package/dist/theme/solfacil/utilities.d.ts +1 -0
  16. package/dist/types/components/accordion/Accordion.vue.d.ts +97 -0
  17. package/dist/types/components/accordion/accordion.spec.d.ts +1 -0
  18. package/dist/types/components/accordion/index.d.ts +2 -0
  19. package/dist/types/components/dropdown/Dropdown.vue.d.ts +188 -31
  20. package/dist/types/components/forms/button/Button.vue.d.ts +98 -20
  21. package/dist/types/components/forms/checkbox/Checkbox.vue.d.ts +77 -11
  22. package/dist/types/components/forms/checkbox/CheckboxGroup.vue.d.ts +114 -19
  23. package/dist/types/components/forms/input/Input.vue.d.ts +76 -10
  24. package/dist/types/components/forms/radio/Radio.vue.d.ts +77 -11
  25. package/dist/types/components/forms/radio/RadioGroup.vue.d.ts +114 -19
  26. package/dist/types/components/forms/select/ListOption.vue.d.ts +149 -0
  27. package/dist/types/components/forms/select/Select.vue.d.ts +298 -27
  28. package/dist/types/components/forms/switch/Switch.vue.d.ts +83 -13
  29. package/dist/types/components/forms/textarea/Textarea.vue.d.ts +108 -19
  30. package/dist/types/components/forms/textfield/Textfield.vue.d.ts +101 -17
  31. package/dist/types/components/forms/textfield/TextfieldPassword.vue.d.ts +71 -9
  32. package/dist/types/components/informations/chip/Chip.vue.d.ts +94 -15
  33. package/dist/types/composables/use-toast/Toast.vue.d.ts +130 -24
  34. package/dist/types/composables/use-toast/index.d.ts +1 -1
  35. package/dist/types/index.d.ts +2343 -448
  36. package/dist/windi.config.d.ts +1 -1
  37. package/package.json +36 -36
  38. package/theme/safelist.ts +104 -0
  39. package/theme/solfacil/borders.ts +2 -1
  40. package/theme/solfacil/colors.ts +44 -22
  41. package/theme/solfacil/effects.ts +9 -7
  42. package/theme/solfacil/index.ts +2 -1
  43. package/theme/solfacil/spacing.ts +3 -0
  44. package/theme/solfacil/typography.ts +8 -9
  45. package/theme/solfacil/utilities.ts +239 -3
  46. package/vite.config.ts +1 -0
  47. package/windi.config.ts +14 -1
@@ -1,69 +1,45 @@
1
- var __defProp = Object.defineProperty;
2
- var __defProps = Object.defineProperties;
3
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
- var __spreadValues = (a, b) => {
9
- for (var prop in b || (b = {}))
10
- if (__hasOwnProp.call(b, prop))
11
- __defNormalProp(a, prop, b[prop]);
12
- if (__getOwnPropSymbols)
13
- for (var prop of __getOwnPropSymbols(b)) {
14
- if (__propIsEnum.call(b, prop))
15
- __defNormalProp(a, prop, b[prop]);
16
- }
17
- return a;
18
- };
19
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
- import { defineComponent, useSlots, computed, openBlock, createElementBlock, normalizeClass, unref, createElementVNode, renderSlot, ref, toDisplayString, createCommentVNode, createVNode, mergeProps, isRef, createBlock, withCtx, withDirectives, vShow, vModelText, Fragment, renderList, getCurrentScope, onScopeDispose, watch, reactive, withModifiers, createTextVNode, Transition as Transition$1, normalizeStyle, withKeys, onMounted, onUnmounted, render as render$8 } from "vue";
21
- var Button_vue_vue_type_style_index_0_lang = "";
22
- const _hoisted_1$l = ["data-testid"];
23
- const _hoisted_2$j = { class: "icon -left" };
24
- const _hoisted_3$h = { class: "icon -right" };
25
- const _sfc_main$d = /* @__PURE__ */ defineComponent({
1
+ import { defineComponent as V, useSlots as Pe, computed as E, openBlock as d, createElementBlock as r, normalizeClass as x, unref as g, createElementVNode as m, renderSlot as y, ref as L, toDisplayString as S, createCommentVNode as T, createVNode as z, mergeProps as p, isRef as Be, createBlock as N, withCtx as G, withDirectives as Y, vShow as te, vModelText as Oe, Fragment as Q, renderList as X, getCurrentScope as De, onScopeDispose as Re, watch as pe, reactive as j, withModifiers as R, createTextVNode as O, Transition as we, normalizeStyle as le, withKeys as q, onMounted as Te, onUnmounted as He, render as Me } from "vue";
2
+ const Ne = ["data-testid"], Ue = { class: "icon -left" }, Ge = { class: "icon -right" }, de = /* @__PURE__ */ V({
26
3
  __name: "Button",
27
4
  props: {
28
- variant: { default: "primary" },
29
- dense: { type: Boolean, default: false },
30
- invert: { type: Boolean, default: false },
31
- id: null
5
+ id: null,
6
+ loading: { type: Boolean },
7
+ onColor: { type: Boolean, default: !1 },
8
+ size: { default: "large" },
9
+ variant: { default: "primary" }
32
10
  },
33
- setup(__props) {
34
- function hasVariant(variant, variantClass) {
35
- return variant ? variantClass : "";
11
+ setup(e) {
12
+ function l(a, o) {
13
+ return a ? o : "";
36
14
  }
37
- const slots = useSlots();
38
- const hasContentWithIcon = computed(() => !!(slots == null ? void 0 : slots.default) && (!!(slots == null ? void 0 : slots["icon-right"]) || !!(slots == null ? void 0 : slots["icon-left"])));
39
- const onlyIcon = computed(() => !(slots == null ? void 0 : slots.default) && (!!(slots == null ? void 0 : slots["icon-right"]) || !!(slots == null ? void 0 : slots["icon-left"])));
40
- return (_ctx, _cache) => {
41
- return openBlock(), createElementBlock("button", {
42
- "data-testid": `button-${__props.id}`,
43
- class: normalizeClass(["sol-button-core", `-${__props.variant}
44
- ${hasVariant(__props.dense, "-dense")} ${hasVariant(__props.invert, "-invert")}
45
- ${hasVariant(unref(hasContentWithIcon), "-has-icon")}
46
- ${hasVariant(unref(onlyIcon), "-only-icon")}
15
+ const t = Pe(), i = E(
16
+ () => !!(t != null && t.default) && (!!(t != null && t["icon-right"]) || !!(t != null && t["icon-left"]))
17
+ ), n = E(
18
+ () => !(t != null && t.default) && (!!(t != null && t["icon-right"]) || !!(t != null && t["icon-left"]))
19
+ );
20
+ return (a, o) => (d(), r("button", {
21
+ "data-testid": `button-${e.id}`,
22
+ class: x(["sol-button-core", `-${e.variant} -${e.size}
23
+ ${l(e.onColor, "-on-color")}
24
+ ${l(g(i), "-has-icon")}
25
+ ${l(g(n), "-only-icon")}
47
26
  `]),
48
- type: "button"
49
- }, [
50
- createElementVNode("div", _hoisted_2$j, [
51
- renderSlot(_ctx.$slots, "icon-left")
52
- ]),
53
- renderSlot(_ctx.$slots, "default"),
54
- createElementVNode("div", _hoisted_3$h, [
55
- renderSlot(_ctx.$slots, "icon-right")
56
- ])
57
- ], 10, _hoisted_1$l);
58
- };
27
+ type: "button"
28
+ }, [
29
+ m("div", Ue, [
30
+ y(a.$slots, "icon-left")
31
+ ]),
32
+ y(a.$slots, "default"),
33
+ m("div", Ge, [
34
+ y(a.$slots, "icon-right")
35
+ ])
36
+ ], 10, Ne));
59
37
  }
60
38
  });
61
- _sfc_main$d.install = (app) => {
62
- app.component("SolButton", _sfc_main$d);
39
+ de.install = (e) => {
40
+ e.component("SolButton", de);
63
41
  };
64
- var Input_vue_vue_type_style_index_0_lang = "";
65
- const _hoisted_1$k = ["id", "data-testid", "value"];
66
- const _sfc_main$c = /* @__PURE__ */ defineComponent({
42
+ const Fe = ["id", "data-testid", "value"], F = /* @__PURE__ */ V({
67
43
  __name: "Input",
68
44
  props: {
69
45
  id: null,
@@ -72,37 +48,28 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
72
48
  error: { type: Boolean }
73
49
  },
74
50
  emits: ["update:modelValue"],
75
- setup(__props, { expose, emit }) {
76
- function emitInput({ target }) {
77
- emit("update:modelValue", target == null ? void 0 : target.value);
51
+ setup(e, { expose: l, emit: t }) {
52
+ function i({ target: a }) {
53
+ t("update:modelValue", a == null ? void 0 : a.value);
78
54
  }
79
- const input = ref("");
80
- expose({
81
- input
82
- });
83
- return (_ctx, _cache) => {
84
- return openBlock(), createElementBlock("input", {
85
- id: `input-${__props.id}`,
86
- ref_key: "input",
87
- ref: input,
88
- "data-testid": `input-${__props.id}`,
89
- value: __props.modelValue,
90
- class: normalizeClass(["sol-input-core", { "-invert": __props.invert, "-error": __props.error }]),
91
- onInput: emitInput
92
- }, null, 42, _hoisted_1$k);
93
- };
55
+ const n = L("");
56
+ return l({
57
+ input: n
58
+ }), (a, o) => (d(), r("input", {
59
+ id: `input-${e.id}`,
60
+ ref_key: "input",
61
+ ref: n,
62
+ "data-testid": `input-${e.id}`,
63
+ value: e.modelValue,
64
+ class: x(["sol-input-core", { "-invert": e.invert, "-error": e.error }]),
65
+ onInput: i
66
+ }, null, 42, Fe));
94
67
  }
95
68
  });
96
- _sfc_main$c.install = (app) => {
97
- app.component("SolInput", _sfc_main$c);
69
+ F.install = (e) => {
70
+ e.component("SolInput", F);
98
71
  };
99
- var Textfield_vue_vue_type_style_index_0_lang = "";
100
- const _hoisted_1$j = ["id", "data-testid"];
101
- const _hoisted_2$i = ["for"];
102
- const _hoisted_3$g = { class: "container-input" };
103
- const _hoisted_4$6 = ["id"];
104
- const _hoisted_5$3 = ["id"];
105
- const _sfc_main$b = /* @__PURE__ */ defineComponent({
72
+ const Ke = ["id", "data-testid"], We = ["for"], Ye = { class: "container-input" }, je = ["id"], qe = ["id"], ne = /* @__PURE__ */ V({
106
73
  __name: "Textfield",
107
74
  props: {
108
75
  id: null,
@@ -114,154 +81,134 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
114
81
  error: null
115
82
  },
116
83
  emits: ["update:modelValue"],
117
- setup(__props, { emit }) {
118
- const props = __props;
119
- const model = computed({
120
- get: () => props.modelValue,
121
- set: (inputValue) => {
122
- emit("update:modelValue", inputValue);
84
+ setup(e, { emit: l }) {
85
+ const t = e, i = E({
86
+ get: () => t.modelValue,
87
+ set: (o) => {
88
+ l("update:modelValue", o);
123
89
  }
124
90
  });
125
- function showHint(hint, error) {
126
- return !!hint && !error;
91
+ function n(o, c) {
92
+ return !!o && !c;
127
93
  }
128
- function ariaDescribedby(hint, error) {
129
- if (error)
130
- return `error-${props.id}`;
131
- if (showHint(hint, error))
132
- return `hint-${props.id}`;
133
- return null;
94
+ function a(o, c) {
95
+ return c ? `error-${t.id}` : n(o, c) ? `hint-${t.id}` : null;
134
96
  }
135
- return (_ctx, _cache) => {
136
- var _a2;
137
- return openBlock(), createElementBlock("div", {
138
- id: `textfield-${__props.id}`,
139
- "data-testid": `textfield-${__props.id}`,
140
- class: normalizeClass([[`${(_a2 = _ctx.$props.class) != null ? _a2 : ""}`, { "-invert": __props.invert }], "sol-textfield-core"])
97
+ return (o, c) => {
98
+ var u;
99
+ return d(), r("div", {
100
+ id: `textfield-${e.id}`,
101
+ "data-testid": `textfield-${e.id}`,
102
+ class: x([[`${(u = o.$props.class) != null ? u : ""}`, { "-invert": e.invert }], "sol-textfield-core"])
141
103
  }, [
142
- renderSlot(_ctx.$slots, "label", {}, () => [
143
- __props.label ? (openBlock(), createElementBlock("label", {
104
+ y(o.$slots, "label", {}, () => [
105
+ e.label ? (d(), r("label", {
144
106
  key: 0,
145
- for: `input-${__props.id}`,
107
+ for: `input-${e.id}`,
146
108
  class: "label"
147
109
  }, [
148
- createElementVNode("span", null, toDisplayString(__props.label), 1)
149
- ], 8, _hoisted_2$i)) : createCommentVNode("", true)
110
+ m("span", null, S(e.label), 1)
111
+ ], 8, We)) : T("", !0)
150
112
  ]),
151
- createElementVNode("div", _hoisted_3$g, [
152
- renderSlot(_ctx.$slots, "default", {}, () => [
153
- createVNode(_sfc_main$c, mergeProps(_ctx.$attrs, {
154
- id: __props.id,
155
- modelValue: unref(model),
156
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(model) ? model.value = $event : null),
157
- "data-testid": `input-${__props.id}`,
158
- class: [__props.error && "-error", "input"],
159
- invert: __props.invert,
160
- "aria-invalid": !!__props.error,
161
- "aria-describedby": ariaDescribedby(__props.hint, __props.error)
113
+ m("div", Ye, [
114
+ y(o.$slots, "default", {}, () => [
115
+ z(F, p(o.$attrs, {
116
+ id: e.id,
117
+ modelValue: g(i),
118
+ "onUpdate:modelValue": c[0] || (c[0] = (h) => Be(i) ? i.value = h : null),
119
+ "data-testid": `input-${e.id}`,
120
+ class: [e.error && "-error", "input"],
121
+ invert: e.invert,
122
+ "aria-invalid": !!e.error,
123
+ "aria-describedby": a(e.hint, e.error)
162
124
  }), null, 16, ["id", "modelValue", "data-testid", "class", "invert", "aria-invalid", "aria-describedby"])
163
125
  ]),
164
- renderSlot(_ctx.$slots, "icon")
126
+ y(o.$slots, "icon")
165
127
  ]),
166
- showHint(__props.hint, __props.error) ? (openBlock(), createElementBlock("span", {
128
+ n(e.hint, e.error) ? (d(), r("span", {
167
129
  key: 0,
168
- id: `hint-${__props.id}`,
130
+ id: `hint-${e.id}`,
169
131
  class: "hint"
170
- }, toDisplayString(__props.hint), 9, _hoisted_4$6)) : __props.error ? (openBlock(), createElementBlock("span", {
132
+ }, S(e.hint), 9, je)) : e.error ? (d(), r("span", {
171
133
  key: 1,
172
- id: `error-${__props.id}`,
134
+ id: `error-${e.id}`,
173
135
  class: "error"
174
- }, toDisplayString(__props.error), 9, _hoisted_5$3)) : createCommentVNode("", true)
175
- ], 10, _hoisted_1$j);
136
+ }, S(e.error), 9, qe)) : T("", !0)
137
+ ], 10, Ke);
176
138
  };
177
139
  }
178
140
  });
179
- const _hoisted_1$i = {
141
+ const Je = {
180
142
  preserveAspectRatio: "xMidYMid meet",
181
143
  viewBox: "0 0 24 24",
182
- width: "1.2em",
183
- height: "1.2em"
184
- };
185
- const _hoisted_2$h = /* @__PURE__ */ createElementVNode("g", { fill: "currentColor" }, [
186
- /* @__PURE__ */ createElementVNode("path", { d: "M15 12a3 3 0 1 1-6 0a3 3 0 0 1 6 0z" }),
187
- /* @__PURE__ */ createElementVNode("path", { d: "M21.894 11.553C19.736 7.236 15.904 5 12 5c-3.903 0-7.736 2.236-9.894 6.553a1 1 0 0 0 0 .894C4.264 16.764 8.096 19 12 19c3.903 0 7.736-2.236 9.894-6.553a1 1 0 0 0 0-.894zM12 17c-2.969 0-6.002-1.62-7.87-5C5.998 8.62 9.03 7 12 7c2.969 0 6.002 1.62 7.87 5c-1.868 3.38-4.901 5-7.87 5z" })
188
- ], -1);
189
- const _hoisted_3$f = [
190
- _hoisted_2$h
144
+ width: "1em",
145
+ height: "1em"
146
+ }, Qe = /* @__PURE__ */ m("g", { fill: "currentColor" }, [
147
+ /* @__PURE__ */ m("path", { d: "M15 12a3 3 0 1 1-6 0a3 3 0 0 1 6 0z" }),
148
+ /* @__PURE__ */ m("path", { d: "M21.894 11.553C19.736 7.236 15.904 5 12 5c-3.903 0-7.736 2.236-9.894 6.553a1 1 0 0 0 0 .894C4.264 16.764 8.096 19 12 19c3.903 0 7.736-2.236 9.894-6.553a1 1 0 0 0 0-.894zM12 17c-2.969 0-6.002-1.62-7.87-5C5.998 8.62 9.03 7 12 7c2.969 0 6.002 1.62 7.87 5c-1.868 3.38-4.901 5-7.87 5z" })
149
+ ], -1), Xe = [
150
+ Qe
191
151
  ];
192
- function render$7(_ctx, _cache) {
193
- return openBlock(), createElementBlock("svg", _hoisted_1$i, _hoisted_3$f);
152
+ function Ze(e, l) {
153
+ return d(), r("svg", Je, Xe);
194
154
  }
195
- var EyeOn = { name: "mi-eye", render: render$7 };
196
- const _hoisted_1$h = {
155
+ const _e = { name: "mi-eye", render: Ze }, et = {
197
156
  preserveAspectRatio: "xMidYMid meet",
198
157
  viewBox: "0 0 24 24",
199
- width: "1.2em",
200
- height: "1.2em"
201
- };
202
- const _hoisted_2$g = /* @__PURE__ */ createElementVNode("path", {
158
+ width: "1em",
159
+ height: "1em"
160
+ }, tt = /* @__PURE__ */ m("path", {
203
161
  fill: "currentColor",
204
162
  d: "M4.707 3.293a1 1 0 0 0-1.414 1.414l2.424 2.424c-1.43 1.076-2.678 2.554-3.611 4.422a1 1 0 0 0 0 .894C4.264 16.764 8.096 19 12 19c1.555 0 3.1-.355 4.53-1.055l2.763 2.762a1 1 0 0 0 1.414-1.414l-16-16zm10.307 13.135c-.98.383-2 .572-3.014.572c-2.969 0-6.002-1.62-7.87-5c.817-1.479 1.858-2.62 3.018-3.437l2.144 2.144a3 3 0 0 0 4.001 4.001l1.72 1.72zm3.538-2.532c.483-.556.926-1.187 1.318-1.896c-1.868-3.38-4.9-5-7.87-5c-.112 0-.224.002-.336.007L9.879 5.223A10.215 10.215 0 0 1 12 5c3.903 0 7.736 2.236 9.894 6.553a1 1 0 0 1 0 .894a13.106 13.106 0 0 1-1.925 2.865l-1.417-1.416z"
205
- }, null, -1);
206
- const _hoisted_3$e = [
207
- _hoisted_2$g
163
+ }, null, -1), lt = [
164
+ tt
208
165
  ];
209
- function render$6(_ctx, _cache) {
210
- return openBlock(), createElementBlock("svg", _hoisted_1$h, _hoisted_3$e);
166
+ function nt(e, l) {
167
+ return d(), r("svg", et, lt);
211
168
  }
212
- var EyeOff = { name: "mi-eye-off", render: render$6 };
213
- const _hoisted_1$g = ["aria-label"];
214
- const _sfc_main$a = /* @__PURE__ */ defineComponent({
169
+ const it = { name: "mi-eye-off", render: nt }, at = ["aria-label"], ce = /* @__PURE__ */ V({
215
170
  __name: "TextfieldPassword",
216
171
  props: {
217
172
  id: { default: "" },
218
173
  label: { default: "Sua senha" }
219
174
  },
220
- setup(__props) {
221
- const passwordIsVisible = ref(false);
222
- const inputType = computed(() => passwordIsVisible.value ? "text" : "password");
223
- return (_ctx, _cache) => {
224
- return openBlock(), createBlock(_sfc_main$b, {
225
- id: __props.id,
226
- required: "",
227
- type: unref(inputType),
228
- label: __props.label,
229
- placeholder: "Insira sua senha"
230
- }, {
231
- icon: withCtx(() => [
232
- createElementVNode("button", {
233
- type: "button",
234
- "data-testid": "toggle-type-password",
235
- "aria-label": passwordIsVisible.value ? "Hide password" : "Show password",
236
- onClick: _cache[0] || (_cache[0] = ($event) => passwordIsVisible.value = !passwordIsVisible.value)
237
- }, [
238
- withDirectives(createVNode(unref(EyeOn), { "aria-hidden": "true" }, null, 512), [
239
- [vShow, passwordIsVisible.value]
240
- ]),
241
- withDirectives(createVNode(unref(EyeOff), { "aria-hidden": "true" }, null, 512), [
242
- [vShow, !passwordIsVisible.value]
243
- ])
244
- ], 8, _hoisted_1$g)
245
- ]),
246
- _: 1
247
- }, 8, ["id", "type", "label"]);
248
- };
175
+ setup(e) {
176
+ const l = L(!1), t = E(
177
+ () => l.value ? "text" : "password"
178
+ );
179
+ return (i, n) => (d(), N(ne, {
180
+ id: e.id,
181
+ required: "",
182
+ type: g(t),
183
+ label: e.label,
184
+ placeholder: "Insira sua senha"
185
+ }, {
186
+ icon: G(() => [
187
+ m("button", {
188
+ type: "button",
189
+ "data-testid": "toggle-type-password",
190
+ "aria-label": l.value ? "Hide password" : "Show password",
191
+ onClick: n[0] || (n[0] = (a) => l.value = !l.value)
192
+ }, [
193
+ Y(z(g(_e), { "aria-hidden": "true" }, null, 512), [
194
+ [te, l.value]
195
+ ]),
196
+ Y(z(g(it), { "aria-hidden": "true" }, null, 512), [
197
+ [te, !l.value]
198
+ ])
199
+ ], 8, at)
200
+ ]),
201
+ _: 1
202
+ }, 8, ["id", "type", "label"]));
249
203
  }
250
204
  });
251
- _sfc_main$b.install = (app) => {
252
- app.component("SolTextfield", _sfc_main$b);
205
+ ne.install = (e) => {
206
+ e.component("SolTextfield", ne);
253
207
  };
254
- _sfc_main$a.install = (app) => {
255
- app.component("SolTextfieldPassword", _sfc_main$a);
208
+ ce.install = (e) => {
209
+ e.component("SolTextfieldPassword", ce);
256
210
  };
257
- var Textarea_vue_vue_type_style_index_0_lang = "";
258
- const _hoisted_1$f = ["id", "data-testid"];
259
- const _hoisted_2$f = ["for"];
260
- const _hoisted_3$d = { class: "container-textarea" };
261
- const _hoisted_4$5 = ["id", "data-testid", "invert", "aria-invalid", "aria-describedby"];
262
- const _hoisted_5$2 = ["id"];
263
- const _hoisted_6$2 = ["id"];
264
- const _sfc_main$9 = /* @__PURE__ */ defineComponent({
211
+ const ot = ["id", "data-testid"], st = ["for"], dt = { class: "container-textarea" }, ct = ["id", "data-testid", "invert", "aria-invalid", "aria-describedby"], rt = ["id"], ut = ["id"], re = /* @__PURE__ */ V({
265
212
  __name: "Textarea",
266
213
  props: {
267
214
  id: null,
@@ -274,76 +221,68 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
274
221
  error: null
275
222
  },
276
223
  emits: ["update:modelValue"],
277
- setup(__props, { emit }) {
278
- const props = __props;
279
- const model = computed({
280
- get: () => props.modelValue,
281
- set: (inputValue) => {
282
- emit("update:modelValue", inputValue);
224
+ setup(e, { emit: l }) {
225
+ const t = e, i = E({
226
+ get: () => t.modelValue,
227
+ set: (o) => {
228
+ l("update:modelValue", o);
283
229
  }
284
230
  });
285
- function showHint(hint, error) {
286
- return !!hint && !error;
231
+ function n(o, c) {
232
+ return !!o && !c;
287
233
  }
288
- function ariaDescribedby(hint, error) {
289
- if (error)
290
- return `error-${props.id}`;
291
- if (showHint(hint, error))
292
- return `hint-${props.id}`;
293
- return null;
234
+ function a(o, c) {
235
+ return c ? `error-${t.id}` : n(o, c) ? `hint-${t.id}` : null;
294
236
  }
295
- return (_ctx, _cache) => {
296
- var _a2;
297
- return openBlock(), createElementBlock("div", {
298
- id: `textarea-${__props.id}`,
299
- "data-testid": `textarea-${__props.id}`,
300
- class: normalizeClass([[`${(_a2 = _ctx.$props.class) != null ? _a2 : ""}`, { "-invert": __props.invert }], "sol-textarea-core"])
237
+ return (o, c) => {
238
+ var u;
239
+ return d(), r("div", {
240
+ id: `textarea-${e.id}`,
241
+ "data-testid": `textarea-${e.id}`,
242
+ class: x([[`${(u = o.$props.class) != null ? u : ""}`, { "-invert": e.invert }], "sol-textarea-core"])
301
243
  }, [
302
- renderSlot(_ctx.$slots, "label", {}, () => [
303
- __props.label ? (openBlock(), createElementBlock("label", {
244
+ y(o.$slots, "label", {}, () => [
245
+ e.label ? (d(), r("label", {
304
246
  key: 0,
305
- for: `input-${__props.id}`,
247
+ for: `input-${e.id}`,
306
248
  class: "label"
307
249
  }, [
308
- createElementVNode("span", null, toDisplayString(__props.label), 1)
309
- ], 8, _hoisted_2$f)) : createCommentVNode("", true)
250
+ m("span", null, S(e.label), 1)
251
+ ], 8, st)) : T("", !0)
310
252
  ]),
311
- createElementVNode("div", _hoisted_3$d, [
312
- renderSlot(_ctx.$slots, "default", {}, () => [
313
- withDirectives(createElementVNode("textarea", mergeProps(_ctx.$attrs, {
314
- id: `input-${__props.id}`,
315
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(model) ? model.value = $event : null),
316
- "data-testid": `input-${__props.id}`,
317
- class: [__props.error && "-error", "textarea"],
318
- invert: __props.invert,
319
- style: { resize: __props.resize },
320
- "aria-invalid": !!__props.error,
321
- "aria-describedby": ariaDescribedby(__props.hint, __props.error)
322
- }), null, 16, _hoisted_4$5), [
323
- [vModelText, unref(model)]
253
+ m("div", dt, [
254
+ y(o.$slots, "default", {}, () => [
255
+ Y(m("textarea", p(o.$attrs, {
256
+ id: `input-${e.id}`,
257
+ "onUpdate:modelValue": c[0] || (c[0] = (h) => Be(i) ? i.value = h : null),
258
+ "data-testid": `input-${e.id}`,
259
+ class: [e.error && "-error", "textarea"],
260
+ invert: e.invert,
261
+ style: { resize: e.resize },
262
+ "aria-invalid": !!e.error,
263
+ "aria-describedby": a(e.hint, e.error)
264
+ }), null, 16, ct), [
265
+ [Oe, g(i)]
324
266
  ])
325
267
  ])
326
268
  ]),
327
- showHint(__props.hint, __props.error) ? (openBlock(), createElementBlock("span", {
269
+ n(e.hint, e.error) ? (d(), r("span", {
328
270
  key: 0,
329
- id: `hint-${__props.id}`,
271
+ id: `hint-${e.id}`,
330
272
  class: "hint"
331
- }, toDisplayString(__props.hint), 9, _hoisted_5$2)) : __props.error ? (openBlock(), createElementBlock("span", {
273
+ }, S(e.hint), 9, rt)) : e.error ? (d(), r("span", {
332
274
  key: 1,
333
- id: `error-${__props.id}`,
275
+ id: `error-${e.id}`,
334
276
  class: "error"
335
- }, toDisplayString(__props.error), 9, _hoisted_6$2)) : createCommentVNode("", true)
336
- ], 10, _hoisted_1$f);
277
+ }, S(e.error), 9, ut)) : T("", !0)
278
+ ], 10, ot);
337
279
  };
338
280
  }
339
281
  });
340
- _sfc_main$9.install = (app) => {
341
- app.component("SolTextarea", _sfc_main$9);
282
+ re.install = (e) => {
283
+ e.component("SolTextarea", re);
342
284
  };
343
- var Radio_vue_vue_type_style_index_0_lang = "";
344
- const _hoisted_1$e = ["id", "data-testid", "checked", "value", "name"];
345
- const _hoisted_2$e = ["for"];
346
- const _sfc_main$8 = /* @__PURE__ */ defineComponent({
285
+ const ht = ["id", "data-testid", "checked", "value", "name"], ft = ["for"], ie = /* @__PURE__ */ V({
347
286
  __name: "Radio",
348
287
  props: {
349
288
  id: null,
@@ -354,40 +293,33 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
354
293
  class: null
355
294
  },
356
295
  emits: ["change"],
357
- setup(__props, { emit }) {
358
- return (_ctx, _cache) => {
359
- return openBlock(), createElementBlock("div", {
360
- class: normalizeClass(["sol-radio-core", _ctx.$props.class])
361
- }, [
362
- createElementVNode("input", mergeProps(_ctx.$attrs, {
363
- id: `radio-${__props.name}-${__props.id}`,
364
- type: "radio",
365
- class: "radio",
366
- "data-testid": `radio-${__props.name}-${__props.id}`,
367
- checked: __props.checked,
368
- value: __props.value,
369
- name: __props.name,
370
- onChange: _cache[0] || (_cache[0] = ($event) => emit("change", __props.value))
371
- }), null, 16, _hoisted_1$e),
372
- createElementVNode("label", {
373
- class: "label",
374
- for: `radio-${__props.name}-${__props.id}`
375
- }, toDisplayString(__props.label), 9, _hoisted_2$e)
376
- ], 2);
377
- };
296
+ setup(e, { emit: l }) {
297
+ return (t, i) => (d(), r("div", {
298
+ class: x(["sol-radio-core", t.$props.class])
299
+ }, [
300
+ m("input", p(t.$attrs, {
301
+ id: `radio-${e.name}-${e.id}`,
302
+ type: "radio",
303
+ class: "radio",
304
+ "data-testid": `radio-${e.name}-${e.id}`,
305
+ checked: e.checked,
306
+ value: e.value,
307
+ name: e.name,
308
+ onChange: i[0] || (i[0] = (n) => l("change", e.value))
309
+ }), null, 16, ht),
310
+ m("label", {
311
+ class: "label",
312
+ for: `radio-${e.name}-${e.id}`
313
+ }, S(e.label), 9, ft)
314
+ ], 2));
378
315
  }
379
316
  });
380
- var RadioGroup_vue_vue_type_style_index_0_lang = "";
381
- const _hoisted_1$d = ["aria-labelledby"];
382
- const _hoisted_2$d = ["id", "data-testid"];
383
- const _hoisted_3$c = ["id"];
384
- const _hoisted_4$4 = ["id"];
385
- const _sfc_main$7 = /* @__PURE__ */ defineComponent({
317
+ const mt = ["aria-labelledby"], $t = ["id", "data-testid"], vt = ["id"], bt = ["id"], ue = /* @__PURE__ */ V({
386
318
  __name: "RadioGroup",
387
319
  props: {
388
320
  id: null,
389
321
  title: null,
390
- hideTitle: { type: Boolean, default: false },
322
+ hideTitle: { type: Boolean, default: !1 },
391
323
  hint: null,
392
324
  error: null,
393
325
  radios: null,
@@ -395,87 +327,77 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
395
327
  direction: { default: "row" }
396
328
  },
397
329
  emits: ["change", "update:modelValue"],
398
- setup(__props, { emit }) {
399
- const props = __props;
400
- function showHint(hint, error) {
401
- return !!hint && !error;
330
+ setup(e, { emit: l }) {
331
+ const t = e;
332
+ function i(c, u) {
333
+ return !!c && !u;
402
334
  }
403
- function ariaDescribedby(hint, error) {
404
- if (error)
405
- return `error-${props.id}`;
406
- if (showHint(hint, error))
407
- return `hint-${props.id}`;
408
- return null;
335
+ function n(c, u) {
336
+ return u ? `error-${t.id}` : i(c, u) ? `hint-${t.id}` : null;
409
337
  }
410
- function isChecked(value) {
411
- return (props == null ? void 0 : props.modelValue) === value;
338
+ function a(c) {
339
+ return (t == null ? void 0 : t.modelValue) === c;
412
340
  }
413
- function emitUpdatedValue(radio) {
414
- emit("change", radio.value);
415
- emit("update:modelValue", radio.value);
341
+ function o(c) {
342
+ l("change", c.value), l("update:modelValue", c.value);
416
343
  }
417
- return (_ctx, _cache) => {
418
- return openBlock(), createElementBlock("fieldset", {
419
- class: "sol-radio-group-core",
420
- "aria-labelledby": `radio-group-title-${__props.id}`
344
+ return (c, u) => (d(), r("fieldset", {
345
+ class: "sol-radio-group-core",
346
+ "aria-labelledby": `radio-group-title-${e.id}`
347
+ }, [
348
+ y(c.$slots, "title", {
349
+ id: `radio-group-title-${e.id}`
350
+ }, () => [
351
+ m("legend", {
352
+ id: `radio-group-title-${e.id}`,
353
+ class: x(["title", { "sr-only": e.hideTitle }]),
354
+ "data-testid": `radio-group-title-${e.id}`
355
+ }, S(e.title), 11, $t)
356
+ ]),
357
+ m("ul", {
358
+ class: x(["container-radios", { "flex-col": e.direction === "column" }])
421
359
  }, [
422
- renderSlot(_ctx.$slots, "title", {
423
- id: `radio-group-title-${__props.id}`
360
+ y(c.$slots, "default", {
361
+ radios: e.radios,
362
+ direction: e.direction
424
363
  }, () => [
425
- createElementVNode("legend", {
426
- id: `radio-group-title-${__props.id}`,
427
- class: normalizeClass(["title", { "sr-only": __props.hideTitle }]),
428
- "data-testid": `radio-group-title-${__props.id}`
429
- }, toDisplayString(__props.title), 11, _hoisted_2$d)
430
- ]),
431
- createElementVNode("ul", {
432
- class: normalizeClass(["container-radios", { "flex-col": __props.direction === "column" }])
433
- }, [
434
- renderSlot(_ctx.$slots, "default", {
435
- radios: __props.radios,
436
- direction: __props.direction
437
- }, () => [
438
- (openBlock(true), createElementBlock(Fragment, null, renderList(__props.radios, (radio, index) => {
439
- var _a2;
440
- return openBlock(), createElementBlock("li", { key: index }, [
441
- createVNode(_sfc_main$8, mergeProps(_ctx.$attrs, {
442
- id: (_a2 = radio == null ? void 0 : radio.id) != null ? _a2 : `${radio.value}`,
443
- class: ["radio", { "mb-micro": __props.direction === "column", "mr-micro": __props.direction === "row" }],
444
- name: radio.name,
445
- value: radio.value,
446
- label: radio.label,
447
- checked: isChecked(radio.value),
448
- "aria-invalid": !!__props.error,
449
- "aria-describedby": ariaDescribedby(__props.hint, __props.error),
450
- onChange: ($event) => emitUpdatedValue(radio)
451
- }), null, 16, ["id", "class", "name", "value", "label", "checked", "aria-invalid", "aria-describedby", "onChange"])
452
- ]);
453
- }), 128))
454
- ])
455
- ], 2),
456
- showHint(__props.hint, __props.error) ? (openBlock(), createElementBlock("p", {
457
- key: 0,
458
- id: `hint-${__props.id}`,
459
- class: "hint"
460
- }, toDisplayString(__props.hint), 9, _hoisted_3$c)) : __props.error ? (openBlock(), createElementBlock("p", {
461
- key: 1,
462
- id: `error-${__props.id}`,
463
- class: "error"
464
- }, toDisplayString(__props.error), 9, _hoisted_4$4)) : createCommentVNode("", true)
465
- ], 8, _hoisted_1$d);
466
- };
364
+ (d(!0), r(Q, null, X(e.radios, (h, v) => {
365
+ var M;
366
+ return d(), r("li", { key: v }, [
367
+ z(ie, p(c.$attrs, {
368
+ id: (M = h == null ? void 0 : h.id) != null ? M : `${h.value}`,
369
+ class: ["radio", { "mb-micro": e.direction === "column", "mr-micro": e.direction === "row" }],
370
+ name: h.name,
371
+ value: h.value,
372
+ label: h.label,
373
+ checked: a(h.value),
374
+ "aria-invalid": !!e.error,
375
+ "aria-describedby": n(e.hint, e.error),
376
+ onChange: (w) => o(h)
377
+ }), null, 16, ["id", "class", "name", "value", "label", "checked", "aria-invalid", "aria-describedby", "onChange"])
378
+ ]);
379
+ }), 128))
380
+ ])
381
+ ], 2),
382
+ i(e.hint, e.error) ? (d(), r("p", {
383
+ key: 0,
384
+ id: `hint-${e.id}`,
385
+ class: "hint"
386
+ }, S(e.hint), 9, vt)) : e.error ? (d(), r("p", {
387
+ key: 1,
388
+ id: `error-${e.id}`,
389
+ class: "error"
390
+ }, S(e.error), 9, bt)) : T("", !0)
391
+ ], 8, mt));
467
392
  }
468
393
  });
469
- _sfc_main$8.install = (app) => {
470
- app.component("SolRadio", _sfc_main$8);
394
+ ie.install = (e) => {
395
+ e.component("SolRadio", ie);
471
396
  };
472
- _sfc_main$7.install = (app) => {
473
- app.component("SolRadioGroup", _sfc_main$7);
397
+ ue.install = (e) => {
398
+ e.component("SolRadioGroup", ue);
474
399
  };
475
- var Checkbox_vue_vue_type_style_index_0_lang = "";
476
- const _hoisted_1$c = ["id", "data-testid", "checked", "value", "name"];
477
- const _hoisted_2$c = ["for"];
478
- const _sfc_main$6 = /* @__PURE__ */ defineComponent({
400
+ const yt = ["id", "data-testid", "checked", "value", "name"], gt = ["for"], ae = /* @__PURE__ */ V({
479
401
  __name: "Checkbox",
480
402
  props: {
481
403
  id: null,
@@ -486,40 +408,33 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
486
408
  class: null
487
409
  },
488
410
  emits: ["change"],
489
- setup(__props, { emit }) {
490
- return (_ctx, _cache) => {
491
- return openBlock(), createElementBlock("div", {
492
- class: normalizeClass(["sol-checkbox-core", _ctx.$props.class])
493
- }, [
494
- createElementVNode("input", mergeProps(_ctx.$attrs, {
495
- id: `checkbox-${__props.name}-${__props.id}`,
496
- type: "checkbox",
497
- class: "checkbox",
498
- "data-testid": `checkbox-${__props.name}-${__props.id}`,
499
- checked: __props.checked,
500
- value: __props.value,
501
- name: __props.name,
502
- onChange: _cache[0] || (_cache[0] = ($event) => emit("change", __props.value))
503
- }), null, 16, _hoisted_1$c),
504
- createElementVNode("label", {
505
- class: "label",
506
- for: `checkbox-${__props.name}-${__props.id}`
507
- }, toDisplayString(__props.label), 9, _hoisted_2$c)
508
- ], 2);
509
- };
411
+ setup(e, { emit: l }) {
412
+ return (t, i) => (d(), r("div", {
413
+ class: x(["sol-checkbox-core", t.$props.class])
414
+ }, [
415
+ m("input", p(t.$attrs, {
416
+ id: `checkbox-${e.name}-${e.id}`,
417
+ type: "checkbox",
418
+ class: "checkbox",
419
+ "data-testid": `checkbox-${e.name}-${e.id}`,
420
+ checked: e.checked,
421
+ value: e.value,
422
+ name: e.name,
423
+ onChange: i[0] || (i[0] = (n) => l("change", e.value))
424
+ }), null, 16, yt),
425
+ m("label", {
426
+ class: "label",
427
+ for: `checkbox-${e.name}-${e.id}`
428
+ }, S(e.label), 9, gt)
429
+ ], 2));
510
430
  }
511
431
  });
512
- var CheckboxGroup_vue_vue_type_style_index_0_lang = "";
513
- const _hoisted_1$b = ["aria-labelledby"];
514
- const _hoisted_2$b = ["id", "data-testid"];
515
- const _hoisted_3$b = ["id"];
516
- const _hoisted_4$3 = ["id"];
517
- const _sfc_main$5 = /* @__PURE__ */ defineComponent({
432
+ const wt = ["aria-labelledby"], St = ["id", "data-testid"], xt = ["id"], kt = ["id"], he = /* @__PURE__ */ V({
518
433
  __name: "CheckboxGroup",
519
434
  props: {
520
435
  id: null,
521
436
  title: null,
522
- hideTitle: { type: Boolean, default: false },
437
+ hideTitle: { type: Boolean, default: !1 },
523
438
  hint: null,
524
439
  error: null,
525
440
  checkboxes: null,
@@ -527,95 +442,84 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
527
442
  direction: { default: "row" }
528
443
  },
529
444
  emits: ["change", "update:modelValue"],
530
- setup(__props, { emit }) {
531
- const props = __props;
532
- function showHint(hint, error) {
533
- return !!hint && !error;
445
+ setup(e, { emit: l }) {
446
+ const t = e;
447
+ function i(u, h) {
448
+ return !!u && !h;
534
449
  }
535
- function ariaDescribedby(hint, error) {
536
- if (error)
537
- return `error-${props.id}`;
538
- if (showHint(hint, error))
539
- return `hint-${props.id}`;
540
- return null;
450
+ function n(u, h) {
451
+ return h ? `error-${t.id}` : i(u, h) ? `hint-${t.id}` : null;
541
452
  }
542
- function isChecked(value) {
543
- var _a2;
544
- return (_a2 = props == null ? void 0 : props.modelValue) == null ? void 0 : _a2.includes(value);
453
+ function a(u) {
454
+ var h;
455
+ return (h = t == null ? void 0 : t.modelValue) == null ? void 0 : h.includes(u);
545
456
  }
546
- function sanitizeNewModelValue(value) {
547
- return Array.isArray(props == null ? void 0 : props.modelValue) ? [...props.modelValue, value] : [value];
457
+ function o(u) {
458
+ return Array.isArray(t == null ? void 0 : t.modelValue) ? [...t.modelValue, u] : [u];
548
459
  }
549
- function emitUpdatedValue(checkbox) {
550
- var _a2;
551
- emit("change", checkbox.value);
552
- const checked = isChecked(checkbox.value) ? (_a2 = props.modelValue) == null ? void 0 : _a2.filter((value) => value !== checkbox.value) : sanitizeNewModelValue(checkbox.value);
553
- emit("update:modelValue", checked);
460
+ function c(u) {
461
+ var v;
462
+ l("change", u.value);
463
+ const h = a(u.value) ? (v = t.modelValue) == null ? void 0 : v.filter((M) => M !== u.value) : o(u.value);
464
+ l("update:modelValue", h);
554
465
  }
555
- return (_ctx, _cache) => {
556
- return openBlock(), createElementBlock("fieldset", {
557
- class: "sol-checkbox-group-core",
558
- "aria-labelledby": `checkbox-group-title-${__props.id}`
466
+ return (u, h) => (d(), r("fieldset", {
467
+ class: "sol-checkbox-group-core",
468
+ "aria-labelledby": `checkbox-group-title-${e.id}`
469
+ }, [
470
+ y(u.$slots, "title", {
471
+ id: `checkbox-group-title-${e.id}`
472
+ }, () => [
473
+ m("legend", {
474
+ id: `checkbox-group-title-${e.id}`,
475
+ class: x(["title", { "sr-only": e.hideTitle }]),
476
+ "data-testid": `checkbox-group-title-${e.id}`
477
+ }, S(e.title), 11, St)
478
+ ]),
479
+ m("ul", {
480
+ class: x(["container-checkboxes", { "flex-col": e.direction === "column" }])
559
481
  }, [
560
- renderSlot(_ctx.$slots, "title", {
561
- id: `checkbox-group-title-${__props.id}`
482
+ y(u.$slots, "default", {
483
+ checkboxes: e.checkboxes,
484
+ direction: e.direction
562
485
  }, () => [
563
- createElementVNode("legend", {
564
- id: `checkbox-group-title-${__props.id}`,
565
- class: normalizeClass(["title", { "sr-only": __props.hideTitle }]),
566
- "data-testid": `checkbox-group-title-${__props.id}`
567
- }, toDisplayString(__props.title), 11, _hoisted_2$b)
568
- ]),
569
- createElementVNode("ul", {
570
- class: normalizeClass(["container-checkboxes", { "flex-col": __props.direction === "column" }])
571
- }, [
572
- renderSlot(_ctx.$slots, "default", {
573
- checkboxes: __props.checkboxes,
574
- direction: __props.direction
575
- }, () => [
576
- (openBlock(true), createElementBlock(Fragment, null, renderList(__props.checkboxes, (checkbox, index) => {
577
- var _a2;
578
- return openBlock(), createElementBlock("li", { key: index }, [
579
- createVNode(_sfc_main$6, mergeProps(_ctx.$attrs, {
580
- id: (_a2 = checkbox == null ? void 0 : checkbox.id) != null ? _a2 : `${checkbox.value}`,
581
- class: ["checkbox", { "mb-micro": __props.direction === "column", "mr-micro": __props.direction === "row" }],
582
- label: checkbox.label,
583
- name: checkbox.name,
584
- value: checkbox.value,
585
- checked: isChecked(checkbox.value),
586
- "aria-invalid": !!__props.error,
587
- "aria-describedby": ariaDescribedby(__props.hint, __props.error),
588
- onChange: ($event) => emitUpdatedValue(checkbox)
589
- }), null, 16, ["id", "class", "label", "name", "value", "checked", "aria-invalid", "aria-describedby", "onChange"])
590
- ]);
591
- }), 128))
592
- ])
593
- ], 2),
594
- showHint(__props.hint, __props.error) ? (openBlock(), createElementBlock("p", {
595
- key: 0,
596
- id: `hint-${__props.id}`,
597
- class: "hint"
598
- }, toDisplayString(__props.hint), 9, _hoisted_3$b)) : __props.error ? (openBlock(), createElementBlock("p", {
599
- key: 1,
600
- id: `error-${__props.id}`,
601
- class: "error"
602
- }, toDisplayString(__props.error), 9, _hoisted_4$3)) : createCommentVNode("", true)
603
- ], 8, _hoisted_1$b);
604
- };
486
+ (d(!0), r(Q, null, X(e.checkboxes, (v, M) => {
487
+ var w;
488
+ return d(), r("li", { key: M }, [
489
+ z(ae, p(u.$attrs, {
490
+ id: (w = v == null ? void 0 : v.id) != null ? w : `${v.value}`,
491
+ class: ["checkbox", { "mb-micro": e.direction === "column", "mr-micro": e.direction === "row" }],
492
+ label: v.label,
493
+ name: v.name,
494
+ value: v.value,
495
+ checked: a(v.value),
496
+ "aria-invalid": !!e.error,
497
+ "aria-describedby": n(e.hint, e.error),
498
+ onChange: (k) => c(v)
499
+ }), null, 16, ["id", "class", "label", "name", "value", "checked", "aria-invalid", "aria-describedby", "onChange"])
500
+ ]);
501
+ }), 128))
502
+ ])
503
+ ], 2),
504
+ i(e.hint, e.error) ? (d(), r("p", {
505
+ key: 0,
506
+ id: `hint-${e.id}`,
507
+ class: "hint"
508
+ }, S(e.hint), 9, xt)) : e.error ? (d(), r("p", {
509
+ key: 1,
510
+ id: `error-${e.id}`,
511
+ class: "error"
512
+ }, S(e.error), 9, kt)) : T("", !0)
513
+ ], 8, wt));
605
514
  }
606
515
  });
607
- _sfc_main$6.install = (app) => {
608
- app.component("SolCheckbox", _sfc_main$6);
516
+ ae.install = (e) => {
517
+ e.component("SolCheckbox", ae);
609
518
  };
610
- _sfc_main$5.install = (app) => {
611
- app.component("SolCheckboxGroup", _sfc_main$5);
519
+ he.install = (e) => {
520
+ e.component("SolCheckboxGroup", he);
612
521
  };
613
- var Switch_vue_vue_type_style_index_0_lang = "";
614
- const _hoisted_1$a = ["id", "for", "data-testid"];
615
- const _hoisted_2$a = { class: "switch-container" };
616
- const _hoisted_3$a = ["id", "aria-checked", "aria-labelledby", "data-testid", "checked", "value", "name"];
617
- const _hoisted_4$2 = /* @__PURE__ */ createElementVNode("span", { class: "ellipse" }, null, -1);
618
- const _sfc_main$4 = /* @__PURE__ */ defineComponent({
522
+ const Ct = ["id", "for", "data-testid"], Bt = { class: "switch-container" }, Tt = ["id", "aria-checked", "aria-labelledby", "data-testid", "checked", "value", "name"], Mt = /* @__PURE__ */ m("span", { class: "ellipse" }, null, -1), fe = /* @__PURE__ */ V({
619
523
  __name: "Switch",
620
524
  props: {
621
525
  id: null,
@@ -628,169 +532,129 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
628
532
  horizontalLabel: { type: Boolean }
629
533
  },
630
534
  emits: ["change"],
631
- setup(__props, { emit }) {
632
- return (_ctx, _cache) => {
633
- return openBlock(), createElementBlock("div", {
634
- class: normalizeClass(["sol-switch-core", [_ctx.$props.class, { "-horizontal": __props.horizontalLabel }]])
635
- }, [
636
- createElementVNode("label", {
637
- id: `switch-label-${__props.name}-${__props.id}`,
638
- class: normalizeClass(["label", { "mb-1": !__props.horizontalLabel, "sr-only": __props.hideLabel }]),
639
- for: `switch-${__props.name}-${__props.id}`,
640
- "data-testid": `switch-label-${__props.name}-${__props.id}`
641
- }, toDisplayString(__props.label), 11, _hoisted_1$a),
642
- createElementVNode("div", _hoisted_2$a, [
643
- createElementVNode("input", mergeProps(_ctx.$attrs, {
644
- id: `switch-${__props.name}-${__props.id}`,
645
- type: "checkbox",
646
- class: "switch",
647
- role: "switch",
648
- "aria-checked": __props.checked,
649
- "aria-labelledby": `switch-label-${__props.name}-${__props.id}`,
650
- "data-testid": `switch-${__props.name}-${__props.id}`,
651
- checked: __props.checked,
652
- value: __props.value,
653
- name: __props.name,
654
- onChange: _cache[0] || (_cache[0] = ($event) => emit("change", __props.value))
655
- }), null, 16, _hoisted_3$a),
656
- _hoisted_4$2
657
- ])
658
- ], 2);
659
- };
535
+ setup(e, { emit: l }) {
536
+ return (t, i) => (d(), r("div", {
537
+ class: x(["sol-switch-core", [t.$props.class, { "-horizontal": e.horizontalLabel }]])
538
+ }, [
539
+ m("label", {
540
+ id: `switch-label-${e.name}-${e.id}`,
541
+ class: x(["label", { "mb-1": !e.horizontalLabel, "sr-only": e.hideLabel }]),
542
+ for: `switch-${e.name}-${e.id}`,
543
+ "data-testid": `switch-label-${e.name}-${e.id}`
544
+ }, S(e.label), 11, Ct),
545
+ m("div", Bt, [
546
+ m("input", p(t.$attrs, {
547
+ id: `switch-${e.name}-${e.id}`,
548
+ type: "checkbox",
549
+ class: "switch",
550
+ role: "switch",
551
+ "aria-checked": e.checked,
552
+ "aria-labelledby": `switch-label-${e.name}-${e.id}`,
553
+ "data-testid": `switch-${e.name}-${e.id}`,
554
+ checked: e.checked,
555
+ value: e.value,
556
+ name: e.name,
557
+ onChange: i[0] || (i[0] = (n) => l("change", e.value))
558
+ }), null, 16, Tt),
559
+ Mt
560
+ ])
561
+ ], 2));
660
562
  }
661
563
  });
662
- _sfc_main$4.install = (app) => {
663
- app.component("SolSwitch", _sfc_main$4);
564
+ fe.install = (e) => {
565
+ e.component("SolSwitch", fe);
664
566
  };
665
- function tryOnScopeDispose(fn) {
666
- if (getCurrentScope()) {
667
- onScopeDispose(fn);
668
- return true;
669
- }
670
- return false;
671
- }
672
- var _a;
673
- const isClient = typeof window !== "undefined";
674
- const isString = (val) => typeof val === "string";
675
- const noop = () => {
567
+ var xe;
568
+ const Z = typeof window < "u", zt = (e) => typeof e == "string", se = () => {
676
569
  };
677
- isClient && ((_a = window == null ? void 0 : window.navigator) == null ? void 0 : _a.userAgent) && /iP(ad|hone|od)/.test(window.navigator.userAgent);
678
- function unrefElement(elRef) {
679
- var _a2;
680
- const plain = unref(elRef);
681
- return (_a2 = plain == null ? void 0 : plain.$el) != null ? _a2 : plain;
570
+ Z && ((xe = window == null ? void 0 : window.navigator) == null ? void 0 : xe.userAgent) && /iP(ad|hone|od)/.test(window.navigator.userAgent);
571
+ function Vt(e) {
572
+ return typeof e == "function" ? e() : g(e);
682
573
  }
683
- const defaultWindow = isClient ? window : void 0;
684
- isClient ? window.document : void 0;
685
- isClient ? window.navigator : void 0;
686
- isClient ? window.location : void 0;
687
- function useEventListener(...args) {
688
- let target;
689
- let event;
690
- let listener;
691
- let options;
692
- if (isString(args[0])) {
693
- [event, listener, options] = args;
694
- target = defaultWindow;
695
- } else {
696
- [target, event, listener, options] = args;
697
- }
698
- if (!target)
699
- return noop;
700
- let cleanup = noop;
701
- const stopWatch = watch(() => unrefElement(target), (el) => {
702
- cleanup();
703
- if (!el)
704
- return;
705
- el.addEventListener(event, listener, options);
706
- cleanup = () => {
707
- el.removeEventListener(event, listener, options);
708
- cleanup = noop;
709
- };
710
- }, { immediate: true, flush: "post" });
711
- const stop = () => {
712
- stopWatch();
713
- cleanup();
574
+ function It(e) {
575
+ return De() ? (Re(e), !0) : !1;
576
+ }
577
+ function W(e) {
578
+ var l;
579
+ const t = Vt(e);
580
+ return (l = t == null ? void 0 : t.$el) != null ? l : t;
581
+ }
582
+ const ze = Z ? window : void 0;
583
+ Z && window.document;
584
+ Z && window.navigator;
585
+ Z && window.location;
586
+ function ee(...e) {
587
+ let l, t, i, n;
588
+ if (zt(e[0]) ? ([t, i, n] = e, l = ze) : [l, t, i, n] = e, !l)
589
+ return se;
590
+ let a = se;
591
+ const o = pe(() => W(l), (u) => {
592
+ a(), u && (u.addEventListener(t, i, n), a = () => {
593
+ u.removeEventListener(t, i, n), a = se;
594
+ });
595
+ }, { immediate: !0, flush: "post" }), c = () => {
596
+ o(), a();
714
597
  };
715
- tryOnScopeDispose(stop);
716
- return stop;
598
+ return It(c), c;
717
599
  }
718
- function onClickOutside(target, handler, options = {}) {
719
- const { window: window2 = defaultWindow, ignore, capture = true } = options;
720
- if (!window2)
600
+ function Ve(e, l, t = {}) {
601
+ const { window: i = ze, ignore: n, capture: a = !0, detectIframe: o = !1 } = t;
602
+ if (!i)
721
603
  return;
722
- const shouldListen = ref(true);
723
- let fallback;
724
- const listener = (event) => {
725
- window2.clearTimeout(fallback);
726
- const el = unrefElement(target);
727
- const composedPath = event.composedPath();
728
- if (!el || el === event.target || composedPath.includes(el) || !shouldListen.value)
729
- return;
730
- if (ignore && ignore.length > 0) {
731
- if (ignore.some((target2) => {
732
- const el2 = unrefElement(target2);
733
- return el2 && (event.target === el2 || composedPath.includes(el2));
734
- }))
735
- return;
736
- }
737
- handler(event);
738
- };
739
- const cleanup = [
740
- useEventListener(window2, "click", listener, { passive: true, capture }),
741
- useEventListener(window2, "pointerdown", (e) => {
742
- const el = unrefElement(target);
743
- shouldListen.value = !!el && !e.composedPath().includes(el);
744
- }, { passive: true }),
745
- useEventListener(window2, "pointerup", (e) => {
746
- fallback = window2.setTimeout(() => listener(e), 50);
747
- }, { passive: true })
748
- ];
749
- const stop = () => cleanup.forEach((fn) => fn());
750
- return stop;
604
+ const c = L(!0);
605
+ let u;
606
+ const h = (w) => {
607
+ i.clearTimeout(u);
608
+ const k = W(e), C = w.composedPath();
609
+ !k || k === w.target || C.includes(k) || !c.value || n && n.length > 0 && n.some((A) => {
610
+ const D = W(A);
611
+ return D && (w.target === D || C.includes(D));
612
+ }) || l(w);
613
+ }, v = [
614
+ ee(i, "click", h, { passive: !0, capture: a }),
615
+ ee(i, "pointerdown", (w) => {
616
+ const k = W(e);
617
+ c.value = !!k && !w.composedPath().includes(k);
618
+ }, { passive: !0 }),
619
+ ee(i, "pointerup", (w) => {
620
+ if (w.button === 0) {
621
+ const k = w.composedPath();
622
+ w.composedPath = () => k, u = i.setTimeout(() => h(w), 50);
623
+ }
624
+ }, { passive: !0 }),
625
+ o && ee(i, "blur", (w) => {
626
+ var k;
627
+ const C = W(e);
628
+ ((k = document.activeElement) == null ? void 0 : k.tagName) === "IFRAME" && !(C != null && C.contains(document.activeElement)) && l(w);
629
+ })
630
+ ].filter(Boolean);
631
+ return () => v.forEach((w) => w());
751
632
  }
752
- const _global = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
753
- const globalKey = "__vueuse_ssr_handlers__";
754
- _global[globalKey] = _global[globalKey] || {};
755
- _global[globalKey];
756
- var SwipeDirection;
757
- (function(SwipeDirection2) {
758
- SwipeDirection2["UP"] = "UP";
759
- SwipeDirection2["RIGHT"] = "RIGHT";
760
- SwipeDirection2["DOWN"] = "DOWN";
761
- SwipeDirection2["LEFT"] = "LEFT";
762
- SwipeDirection2["NONE"] = "NONE";
763
- })(SwipeDirection || (SwipeDirection = {}));
764
- const _hoisted_1$9 = {
633
+ const me = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, $e = "__vueuse_ssr_handlers__";
634
+ me[$e] = me[$e] || {};
635
+ me[$e];
636
+ var ke;
637
+ (function(e) {
638
+ e.UP = "UP", e.RIGHT = "RIGHT", e.DOWN = "DOWN", e.LEFT = "LEFT", e.NONE = "NONE";
639
+ })(ke || (ke = {}));
640
+ const At = {
765
641
  preserveAspectRatio: "xMidYMid meet",
766
642
  viewBox: "0 0 24 24",
767
- width: "1.2em",
768
- height: "1.2em"
769
- };
770
- const _hoisted_2$9 = /* @__PURE__ */ createElementVNode("path", {
643
+ width: "1em",
644
+ height: "1em"
645
+ }, Lt = /* @__PURE__ */ m("path", {
771
646
  fill: "currentColor",
772
647
  d: "M10 4a6 6 0 1 0 0 12a6 6 0 0 0 0-12zm-8 6a8 8 0 1 1 14.32 4.906l5.387 5.387a1 1 0 0 1-1.414 1.414l-5.387-5.387A8 8 0 0 1 2 10z"
773
- }, null, -1);
774
- const _hoisted_3$9 = [
775
- _hoisted_2$9
648
+ }, null, -1), Et = [
649
+ Lt
776
650
  ];
777
- function render$5(_ctx, _cache) {
778
- return openBlock(), createElementBlock("svg", _hoisted_1$9, _hoisted_3$9);
651
+ function Pt(e, l) {
652
+ return d(), r("svg", At, Et);
779
653
  }
780
- var IconSearch = { name: "mi-search", render: render$5 };
781
- var Dropdown_vue_vue_type_style_index_0_lang = "";
782
- const _hoisted_1$8 = ["data-testid"];
783
- const _hoisted_2$8 = ["id", "for"];
784
- const _hoisted_3$8 = ["id", "disabled", "data-testid", "aria-expanded", "aria-labelledby", "aria-label", "aria-controls", "onClick"];
785
- const _hoisted_4$1 = { class: "dropdown-container" };
786
- const _hoisted_5$1 = ["id", "data-testid", "aria-multiselectable", "aria-labelledby"];
787
- const _hoisted_6$1 = ["id", "data-testid", "selected", "aria-selected", "onClick", "onKeyup"];
788
- const _hoisted_7 = {
654
+ const Ie = { name: "mi-search", render: Pt }, Ot = ["data-testid"], Dt = ["id", "for"], Rt = ["id", "disabled", "data-testid", "aria-expanded", "aria-labelledby", "aria-label", "aria-controls", "onClick"], pt = { class: "dropdown-container" }, Ht = ["id", "data-testid", "aria-multiselectable", "aria-labelledby"], Nt = ["id", "data-testid", "selected", "aria-selected", "onClick", "onKeyup"], Ut = {
789
655
  key: 0,
790
656
  class: "no-data"
791
- };
792
- const _hoisted_8 = /* @__PURE__ */ createTextVNode(" Sem dados ");
793
- const _sfc_main$3 = /* @__PURE__ */ defineComponent({
657
+ }, Gt = /* @__PURE__ */ O(" Sem dados "), ve = /* @__PURE__ */ V({
794
658
  __name: "Dropdown",
795
659
  props: {
796
660
  id: null,
@@ -798,711 +662,904 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
798
662
  ariaLabel: null,
799
663
  smallerWidth: { type: Boolean },
800
664
  disabled: { type: Boolean },
801
- loading: { type: Boolean, default: false },
802
- searchable: { type: Boolean, default: false },
803
- closeOnSelect: { type: Boolean, default: true },
804
- fetchOnSearch: { type: Boolean, default: false },
665
+ loading: { type: Boolean, default: !1 },
666
+ searchable: { type: Boolean, default: !1 },
667
+ closeOnSelect: { type: Boolean, default: !0 },
668
+ fetchOnSearch: { type: Boolean, default: !1 },
805
669
  isMultipleSelect: { type: Boolean },
806
670
  searchPlaceholder: null,
807
671
  selected: null,
808
672
  options: { default: () => [] }
809
673
  },
810
674
  emits: ["closeDropdown", "search", "update:selected"],
811
- setup(__props, { emit }) {
812
- const props = __props;
813
- const el = ref();
814
- const isDropdownOpen = ref(false);
815
- const filter = ref("");
816
- const filtered = computed(() => {
817
- var _a2;
818
- return props.fetchOnSearch ? props.options : (_a2 = props.options) == null ? void 0 : _a2.filter((option) => typeof option === "string" ? option.includes(filter.value) : option.name.includes(filter.value));
819
- });
820
- const selectedSanitize = computed(() => Array.isArray(props.selected) ? props.selected.join(", ").trim() : props.selected);
821
- onClickOutside(el, () => {
822
- if (isDropdownOpen.value)
823
- close2();
675
+ setup(e, { emit: l }) {
676
+ const t = e, i = L(), n = L(!1), a = L(""), o = E(
677
+ () => {
678
+ var s;
679
+ return t.fetchOnSearch ? t.options : (s = t.options) == null ? void 0 : s.filter(
680
+ (f) => typeof f == "string" ? f.includes(a.value) : f.name.includes(a.value)
681
+ );
682
+ }
683
+ ), c = E(
684
+ () => Array.isArray(t.selected) ? t.selected.join(", ").trim() : t.selected
685
+ );
686
+ Ve(i, () => {
687
+ n.value && v();
824
688
  });
825
- function toggleDropdown() {
826
- if (!props.disabled)
827
- isDropdownOpen.value ? close2() : open();
689
+ function u() {
690
+ t.disabled || (n.value ? v() : h());
828
691
  }
829
- function open() {
830
- isDropdownOpen.value = true;
692
+ function h() {
693
+ n.value = !0;
831
694
  }
832
- function close2() {
833
- resetStates();
834
- emit("closeDropdown");
695
+ function v() {
696
+ _(), l("closeDropdown");
835
697
  }
836
- function sanitizeMultipleSelection(selectedValue) {
837
- const selected = new Set(props.selected);
838
- selected.has(selectedValue) ? selected.delete(selectedValue) : selected.add(selectedValue);
839
- return [...selected];
698
+ function M(s) {
699
+ const f = new Set(t.selected);
700
+ return f.has(s) ? f.delete(s) : f.add(s), [...f];
840
701
  }
841
- function select(selected) {
842
- const value = typeof selected === "string" ? selected : selected.value;
843
- const sanitize = props.isMultipleSelect ? sanitizeMultipleSelection(value) : value;
844
- emit("update:selected", sanitize);
845
- if (props.closeOnSelect && !props.isMultipleSelect)
846
- close2();
702
+ function w(s) {
703
+ const f = typeof s == "string" ? s : s.value, $ = t.isMultipleSelect ? M(f) : f;
704
+ l("update:selected", $), t.closeOnSelect && !t.isMultipleSelect && v();
847
705
  }
848
- function isSelected(option) {
849
- if (Array.isArray(props.selected)) {
850
- return typeof option === "string" ? props.selected.includes(option) : props.selected.includes(option.value);
851
- }
852
- return typeof option === "string" ? option === props.selected : option.value === props.selected;
706
+ function k(s) {
707
+ return Array.isArray(t.selected) ? typeof s == "string" ? t.selected.includes(s) : t.selected.includes(s.value) : typeof s == "string" ? s === t.selected : s.value === t.selected;
853
708
  }
854
- const elements = reactive({
709
+ const C = j({
855
710
  list: void 0,
856
711
  search: void 0
857
- });
858
- const elementFocus = reactive({
712
+ }), A = j({
859
713
  id: "",
860
714
  index: 0
861
715
  });
862
- function navigation({ code }) {
863
- const focusListItem = (index) => {
864
- const indexItem = index != null ? index : elementFocus.index;
865
- if (index !== void 0)
866
- elementFocus.index = index;
867
- setTimeout(() => {
868
- var _a2, _b;
869
- const item = (_a2 = elements.list) == null ? void 0 : _a2.children[indexItem];
870
- elementFocus.id = (_b = item == null ? void 0 : item.id) != null ? _b : "";
871
- item == null ? void 0 : item.focus();
716
+ function D({ code: s }) {
717
+ const f = (B) => {
718
+ const I = B != null ? B : A.index;
719
+ B !== void 0 && (A.index = B), setTimeout(() => {
720
+ var K, Se;
721
+ const P = (K = C.list) == null ? void 0 : K.children[I];
722
+ A.id = (Se = P == null ? void 0 : P.id) != null ? Se : "", P == null || P.focus();
872
723
  }, 0);
724
+ }, $ = () => {
725
+ var B;
726
+ t.searchable && (A.index = 0, (B = C == null ? void 0 : C.search) == null || B.focus());
873
727
  };
874
- const focusSearch = () => {
875
- var _a2;
876
- if (props.searchable) {
877
- elementFocus.index = 0;
878
- (_a2 = elements == null ? void 0 : elements.search) == null ? void 0 : _a2.focus();
879
- }
880
- };
881
- switch (code) {
728
+ switch (s) {
882
729
  case "ArrowUp":
883
- elementFocus.index > 0 && (elementFocus.index -= 1);
884
- return focusListItem();
730
+ return A.index > 0 && (A.index -= 1), f();
885
731
  case "ArrowDown":
886
- if (!isDropdownOpen.value) {
887
- open();
888
- return focusListItem(0);
889
- }
890
- elementFocus.index < filtered.value.length - 1 && (elementFocus.index += 1);
891
- return focusListItem();
732
+ return n.value ? (A.index < o.value.length - 1 && (A.index += 1), f()) : (h(), f(0));
892
733
  case "Home":
893
- return focusListItem(0);
734
+ return f(0);
894
735
  case "End":
895
- return focusListItem(props.options.length - 1);
736
+ return f(t.options.length - 1);
896
737
  case "Escape":
897
- return close2();
738
+ return v();
898
739
  default:
899
- !["Enter", "NumpadEnter", "Space"].includes(code) && focusSearch();
740
+ !["Enter", "NumpadEnter", "Space"].includes(s) && $();
900
741
  }
901
742
  }
902
- function resetStates() {
903
- isDropdownOpen.value = false;
904
- elementFocus.index = 0;
905
- filter.value = "";
743
+ function _() {
744
+ n.value = !1, A.index = 0, a.value = "";
906
745
  }
907
- function getOption(option, key) {
908
- return typeof option === "string" ? option : option[key != null ? key : "value"];
746
+ function H(s, f) {
747
+ return typeof s == "string" ? s : s[f != null ? f : "value"];
909
748
  }
910
- function addRefElementToElements(key, target) {
911
- elements[key] = target != null ? target : void 0;
749
+ function b(s, f) {
750
+ C[s] = f != null ? f : void 0;
912
751
  }
913
- return (_ctx, _cache) => {
914
- return openBlock(), createElementBlock("div", {
915
- ref_key: "el",
916
- ref: el,
917
- class: normalizeClass(["sol-dropdown-core", { "-smaller": __props.smallerWidth }]),
918
- "data-testid": `dropdown-${__props.id}`,
919
- onKeydownPassive: navigation
752
+ return (s, f) => (d(), r("div", {
753
+ ref_key: "el",
754
+ ref: i,
755
+ class: x(["sol-dropdown-core", { "-smaller": e.smallerWidth }]),
756
+ "data-testid": `dropdown-${e.id}`,
757
+ onKeydownPassive: D
758
+ }, [
759
+ y(s.$slots, "label", {}, () => [
760
+ m("label", {
761
+ id: `label-dropdown-${e.id}`,
762
+ class: x(["label", { "-disabled": e.disabled, "sr-only": e.ariaLabel }]),
763
+ for: `toggle-dropdown-${e.id}`
764
+ }, S(e.label || e.ariaLabel), 11, Dt)
765
+ ]),
766
+ m("button", {
767
+ id: `toggle-dropdown-${e.id}`,
768
+ disabled: e.disabled,
769
+ "data-testid": `toggle-dropdown-${e.id}`,
770
+ class: "button-toggle-dropdown toggle-dropdown",
771
+ "aria-haspopup": "listbox",
772
+ "aria-expanded": n.value,
773
+ "aria-labelledby": `label-dropdown-${e.id}`,
774
+ "aria-label": e.ariaLabel,
775
+ "aria-controls": `dropdown-list-${e.id}`,
776
+ onClick: R(u, ["stop"])
920
777
  }, [
921
- renderSlot(_ctx.$slots, "label", {}, () => [
922
- createElementVNode("label", {
923
- id: `label-dropdown-${__props.id}`,
924
- class: normalizeClass(["label", { "-disabled": __props.disabled, "sr-only": __props.ariaLabel }]),
925
- for: `toggle-dropdown-${__props.id}`
926
- }, toDisplayString(__props.label || __props.ariaLabel), 11, _hoisted_2$8)
927
- ]),
928
- createElementVNode("button", {
929
- id: `toggle-dropdown-${__props.id}`,
930
- disabled: __props.disabled,
931
- "data-testid": `toggle-dropdown-${__props.id}`,
932
- class: "button-toggle-dropdown toggle-dropdown",
933
- "aria-haspopup": "listbox",
934
- "aria-expanded": isDropdownOpen.value,
935
- "aria-labelledby": `label-dropdown-${__props.id}`,
936
- "aria-label": __props.ariaLabel,
937
- "aria-controls": `dropdown-list-${__props.id}`,
938
- onClick: withModifiers(toggleDropdown, ["stop"])
939
- }, [
940
- renderSlot(_ctx.$slots, "toggle-dropdown", {
941
- toggle: { open, close: close2, toggleDropdown },
942
- isOpen: isDropdownOpen.value,
943
- select,
944
- selectedSanitized: unref(selectedSanitize),
945
- selected: __props.selected
946
- }, () => [
947
- createTextVNode(toDisplayString(unref(selectedSanitize) || "Selecione"), 1)
948
- ])
949
- ], 8, _hoisted_3$8),
950
- createVNode(Transition$1, {
951
- mode: "out-in",
952
- name: "dropdown"
953
- }, {
954
- default: withCtx(() => [
955
- withDirectives(createElementVNode("div", _hoisted_4$1, [
956
- __props.searchable ? (openBlock(), createElementBlock("div", {
957
- key: 0,
958
- class: normalizeClass(["search-container", { "-loading": __props.loading }])
959
- }, [
960
- renderSlot(_ctx.$slots, "search", { filter: filter.value }, () => [
961
- createVNode(_sfc_main$c, {
962
- id: `search-dropdown-${__props.id}`,
963
- ref: (target) => addRefElementToElements("search", target == null ? void 0 : target.input),
964
- modelValue: filter.value,
965
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => filter.value = $event),
966
- "data-testid": `search-dropdown-${__props.id}`,
967
- role: "combobox",
968
- class: "search",
969
- "aria-autocomplete": "list",
970
- placeholder: __props.searchPlaceholder,
971
- "aria-expanded": isDropdownOpen.value,
972
- "aria-haspopup": "listbox",
973
- "aria-owns": `dropdown-list-${__props.id}`,
974
- "aria-controls": `dropdown-list-${__props.id}`,
975
- "aria-activedescendant": elementFocus.id,
976
- "aria-labelledby": `label-dropdown-${__props.id}`,
977
- onClick: _cache[1] || (_cache[1] = withModifiers(() => {
978
- }, ["stop"])),
979
- onInput: _cache[2] || (_cache[2] = ($event) => {
980
- var _a2;
981
- return emit("search", (_a2 = $event.target) == null ? void 0 : _a2.value);
982
- })
983
- }, null, 8, ["id", "modelValue", "data-testid", "placeholder", "aria-expanded", "aria-owns", "aria-controls", "aria-activedescendant", "aria-labelledby"]),
984
- createVNode(unref(IconSearch), {
985
- "aria-hidden": "true",
986
- class: "icon"
778
+ y(s.$slots, "toggle-dropdown", {
779
+ toggle: { open: h, close: v, toggleDropdown: u },
780
+ isOpen: n.value,
781
+ select: w,
782
+ selectedSanitized: g(c),
783
+ selected: e.selected
784
+ }, () => [
785
+ O(S(g(c) || "Selecione"), 1)
786
+ ])
787
+ ], 8, Rt),
788
+ z(we, {
789
+ mode: "out-in",
790
+ name: "dropdown"
791
+ }, {
792
+ default: G(() => [
793
+ Y(m("div", pt, [
794
+ e.searchable ? (d(), r("div", {
795
+ key: 0,
796
+ class: x(["search-container", { "-loading": e.loading }])
797
+ }, [
798
+ y(s.$slots, "search", { filter: a.value }, () => [
799
+ z(F, {
800
+ id: `search-dropdown-${e.id}`,
801
+ ref: ($) => b("search", $ == null ? void 0 : $.input),
802
+ modelValue: a.value,
803
+ "onUpdate:modelValue": f[0] || (f[0] = ($) => a.value = $),
804
+ "data-testid": `search-dropdown-${e.id}`,
805
+ role: "combobox",
806
+ class: "search",
807
+ "aria-autocomplete": "list",
808
+ placeholder: e.searchPlaceholder,
809
+ "aria-expanded": n.value,
810
+ "aria-haspopup": "listbox",
811
+ "aria-owns": `dropdown-list-${e.id}`,
812
+ "aria-controls": `dropdown-list-${e.id}`,
813
+ "aria-activedescendant": A.id,
814
+ "aria-labelledby": `label-dropdown-${e.id}`,
815
+ onClick: f[1] || (f[1] = R(() => {
816
+ }, ["stop"])),
817
+ onInput: f[2] || (f[2] = ($) => {
818
+ var B;
819
+ return l("search", (B = $.target) == null ? void 0 : B.value);
987
820
  })
988
- ])
989
- ], 2)) : createCommentVNode("", true),
990
- createElementVNode("ul", {
991
- id: `dropdown-list-${__props.id}`,
992
- ref: (target) => addRefElementToElements("list", target),
993
- "data-testid": `dropdown-list-${__props.id}`,
994
- role: "listbox",
821
+ }, null, 8, ["id", "modelValue", "data-testid", "placeholder", "aria-expanded", "aria-owns", "aria-controls", "aria-activedescendant", "aria-labelledby"]),
822
+ z(g(Ie), {
823
+ "aria-hidden": "true",
824
+ class: "icon"
825
+ })
826
+ ])
827
+ ], 2)) : T("", !0),
828
+ m("ul", {
829
+ id: `dropdown-list-${e.id}`,
830
+ ref: ($) => b("list", $),
831
+ "data-testid": `dropdown-list-${e.id}`,
832
+ role: "listbox",
833
+ tabindex: "-1",
834
+ "aria-multiselectable": e.isMultipleSelect,
835
+ "aria-labelledby": `label-dropdown-${e.id}`,
836
+ class: "dropdown-list-core"
837
+ }, [
838
+ (d(!0), r(Q, null, X(g(o), ($, B) => (d(), r("li", {
839
+ id: `option-${e.id}-${H($, "value")}`,
840
+ key: B,
841
+ "data-testid": `option-${e.id}-${H($, "value")}`,
842
+ role: "option",
995
843
  tabindex: "-1",
996
- "aria-multiselectable": __props.isMultipleSelect,
997
- "aria-labelledby": `label-dropdown-${__props.id}`,
998
- class: "dropdown-list-core"
844
+ class: "dropdown-item",
845
+ style: le(`--item: ${B + 1}`),
846
+ selected: k($),
847
+ "aria-selected": k($),
848
+ onClick: (I) => w($),
849
+ onKeyup: [
850
+ q((I) => w($), ["enter"]),
851
+ q((I) => w($), ["space"])
852
+ ]
999
853
  }, [
1000
- (openBlock(true), createElementBlock(Fragment, null, renderList(unref(filtered), (option, index) => {
1001
- return openBlock(), createElementBlock("li", {
1002
- id: `option-${__props.id}-${getOption(option, "value")}`,
1003
- key: index,
1004
- "data-testid": `option-${__props.id}-${getOption(option, "value")}`,
1005
- role: "option",
1006
- tabindex: "-1",
1007
- class: "dropdown-item",
1008
- style: normalizeStyle(`--item: ${index + 1}`),
1009
- selected: isSelected(option),
1010
- "aria-selected": isSelected(option),
1011
- onClick: ($event) => select(option),
1012
- onKeyup: [
1013
- withKeys(($event) => select(option), ["enter"]),
1014
- withKeys(($event) => select(option), ["space"])
1015
- ]
1016
- }, [
1017
- renderSlot(_ctx.$slots, "default", {
1018
- text: getOption(option, "name"),
1019
- option,
1020
- isSelect: isSelected
1021
- }, () => [
1022
- createTextVNode(toDisplayString(getOption(option, "name")), 1)
1023
- ])
1024
- ], 44, _hoisted_6$1);
1025
- }), 128)),
1026
- !unref(filtered).length ? (openBlock(), createElementBlock("li", _hoisted_7, [
1027
- renderSlot(_ctx.$slots, "no-data", {}, () => [
1028
- _hoisted_8
1029
- ])
1030
- ])) : createCommentVNode("", true)
1031
- ], 8, _hoisted_5$1)
1032
- ], 512), [
1033
- [vShow, isDropdownOpen.value]
1034
- ])
1035
- ]),
1036
- _: 3
1037
- })
1038
- ], 42, _hoisted_1$8);
1039
- };
854
+ y(s.$slots, "default", {
855
+ text: H($, "name"),
856
+ option: $,
857
+ isSelect: k
858
+ }, () => [
859
+ O(S(H($, "name")), 1)
860
+ ])
861
+ ], 44, Nt))), 128)),
862
+ g(o).length ? T("", !0) : (d(), r("li", Ut, [
863
+ y(s.$slots, "no-data", {}, () => [
864
+ Gt
865
+ ])
866
+ ]))
867
+ ], 8, Ht)
868
+ ], 512), [
869
+ [te, n.value]
870
+ ])
871
+ ]),
872
+ _: 3
873
+ })
874
+ ], 42, Ot));
1040
875
  }
1041
876
  });
1042
- _sfc_main$3.install = (app) => {
1043
- app.component("SolDropdown", _sfc_main$3);
877
+ ve.install = (e) => {
878
+ e.component("SolDropdown", ve);
1044
879
  };
1045
- const _hoisted_1$7 = {
880
+ const Ft = {
1046
881
  preserveAspectRatio: "xMidYMid meet",
1047
882
  viewBox: "0 0 24 24",
1048
- width: "1.2em",
1049
- height: "1.2em"
1050
- };
1051
- const _hoisted_2$7 = /* @__PURE__ */ createElementVNode("path", {
883
+ width: "1em",
884
+ height: "1em"
885
+ }, Kt = /* @__PURE__ */ m("path", {
1052
886
  fill: "currentColor",
1053
887
  d: "M5.293 5.293a1 1 0 0 1 1.414 0L12 10.586l5.293-5.293a1 1 0 1 1 1.414 1.414L13.414 12l5.293 5.293a1 1 0 0 1-1.414 1.414L12 13.414l-5.293 5.293a1 1 0 0 1-1.414-1.414L10.586 12L5.293 6.707a1 1 0 0 1 0-1.414z"
1054
- }, null, -1);
1055
- const _hoisted_3$7 = [
1056
- _hoisted_2$7
888
+ }, null, -1), Wt = [
889
+ Kt
1057
890
  ];
1058
- function render$4(_ctx, _cache) {
1059
- return openBlock(), createElementBlock("svg", _hoisted_1$7, _hoisted_3$7);
891
+ function Yt(e, l) {
892
+ return d(), r("svg", Ft, Wt);
1060
893
  }
1061
- var Close = { name: "mi-close", render: render$4 };
1062
- var Chip_vue_vue_type_style_index_0_lang = "";
1063
- const _hoisted_1$6 = ["id", "data-testid", "title", "aria-describedby", "aria-disabled", "onKeydown"];
1064
- const _hoisted_2$6 = ["id"];
1065
- const _hoisted_3$6 = { class: "label" };
1066
- const _sfc_main$2 = /* @__PURE__ */ defineComponent({
894
+ const Ae = { name: "mi-close", render: Yt }, jt = ["id", "data-testid", "title", "aria-describedby", "aria-disabled", "onKeydown"], qt = ["id"], Jt = { class: "label" }, oe = /* @__PURE__ */ V({
1067
895
  __name: "Chip",
1068
896
  props: {
1069
897
  id: null,
1070
898
  label: null,
1071
899
  selected: { type: Boolean },
1072
900
  disabled: { type: Boolean },
1073
- removable: { type: Boolean, default: true }
901
+ removable: { type: Boolean, default: !0 }
1074
902
  },
1075
903
  emits: ["close", "update:selected"],
1076
- setup(__props, { emit }) {
1077
- const props = __props;
1078
- function keyboardTrigger({ code }) {
1079
- if (props.disabled)
1080
- return;
1081
- switch (code) {
1082
- case "Enter":
1083
- case "NumpadEnter":
1084
- case "Space":
1085
- return emit("update:selected");
1086
- case "Delete":
1087
- case "Backspace":
1088
- return props.removable && emit("close");
1089
- default:
1090
- return false;
1091
- }
904
+ setup(e, { emit: l }) {
905
+ const t = e;
906
+ function i({ code: n }) {
907
+ if (!t.disabled)
908
+ switch (n) {
909
+ case "Enter":
910
+ case "NumpadEnter":
911
+ case "Space":
912
+ return l("update:selected");
913
+ case "Delete":
914
+ case "Backspace":
915
+ return t.removable && l("close");
916
+ default:
917
+ return !1;
918
+ }
1092
919
  }
1093
- return (_ctx, _cache) => {
1094
- return openBlock(), createElementBlock("div", {
1095
- id: `chip-${__props.id}`,
1096
- "data-testid": `chip-${__props.id}`,
1097
- class: normalizeClass(["sol-chip-core", { "-selected": __props.selected, "-disabled": __props.disabled }]),
1098
- tabindex: "0",
1099
- title: __props.label,
1100
- "aria-describedby": `chip-description-${__props.id}`,
1101
- "aria-disabled": __props.disabled,
1102
- onClick: _cache[1] || (_cache[1] = ($event) => emit("update:selected")),
1103
- onKeydown: withModifiers(keyboardTrigger, ["self"])
920
+ return (n, a) => (d(), r("div", {
921
+ id: `chip-${e.id}`,
922
+ "data-testid": `chip-${e.id}`,
923
+ class: x(["sol-chip-core", { "-selected": e.selected, "-disabled": e.disabled }]),
924
+ tabindex: "0",
925
+ title: e.label,
926
+ "aria-describedby": `chip-description-${e.id}`,
927
+ "aria-disabled": e.disabled,
928
+ onClick: a[1] || (a[1] = (o) => l("update:selected")),
929
+ onKeydown: R(i, ["self"])
930
+ }, [
931
+ m("span", {
932
+ id: `chip-description-${e.id}`,
933
+ "z-index": "-1",
934
+ class: "sr-only"
935
+ }, "Press Delete or Backspace to remove this Chip", 8, qt),
936
+ m("span", Jt, [
937
+ y(n.$slots, "default", {}, () => [
938
+ O(S(e.label), 1)
939
+ ])
940
+ ]),
941
+ e.removable ? (d(), r("i", {
942
+ key: 0,
943
+ role: "presentation",
944
+ "aira-hidden": "true",
945
+ class: "close",
946
+ onClick: a[0] || (a[0] = R((o) => l("close"), ["stop"]))
1104
947
  }, [
1105
- createElementVNode("span", {
1106
- id: `chip-description-${__props.id}`,
1107
- "z-index": "-1",
1108
- class: "sr-only"
1109
- }, "Press Delete or Backspace to remove this Chip", 8, _hoisted_2$6),
1110
- createElementVNode("span", _hoisted_3$6, [
1111
- renderSlot(_ctx.$slots, "default", {}, () => [
1112
- createTextVNode(toDisplayString(__props.label), 1)
1113
- ])
1114
- ]),
1115
- __props.removable ? (openBlock(), createElementBlock("i", {
1116
- key: 0,
1117
- role: "presentation",
1118
- "aira-hidden": "true",
1119
- class: "close",
1120
- onClick: _cache[0] || (_cache[0] = withModifiers(($event) => emit("close"), ["stop"]))
1121
- }, [
1122
- createVNode(unref(Close), { class: "icon" })
1123
- ])) : createCommentVNode("", true)
1124
- ], 42, _hoisted_1$6);
1125
- };
948
+ z(g(Ae), { class: "icon" })
949
+ ])) : T("", !0)
950
+ ], 42, jt));
1126
951
  }
1127
952
  });
1128
- const _hoisted_1$5 = {
953
+ const Qt = ["id", "data-testid", "aria-multiselectable", "aria-labelledby"], Xt = ["id", "data-testid", "selected", "aria-selected", "onClick", "onKeyup"], Zt = {
954
+ key: 0,
955
+ class: "no-data"
956
+ }, _t = /* @__PURE__ */ O(" Sem dados "), el = /* @__PURE__ */ V({
957
+ __name: "ListOption",
958
+ props: {
959
+ id: null,
960
+ options: null,
961
+ multiple: { type: Boolean },
962
+ isSelected: null
963
+ },
964
+ emits: ["select"],
965
+ setup(e, { expose: l, emit: t }) {
966
+ const i = L("");
967
+ return l({
968
+ list: i
969
+ }), (n, a) => (d(), r("ul", {
970
+ id: `select-list-${e.id}`,
971
+ ref_key: "list",
972
+ ref: i,
973
+ "data-testid": `select-list-${e.id}`,
974
+ role: "listbox",
975
+ tabindex: "-1",
976
+ "aria-multiselectable": e.multiple,
977
+ "aria-labelledby": `select-label-${e.id}`,
978
+ class: "select-list-core"
979
+ }, [
980
+ (d(!0), r(Q, null, X(e.options, (o, c) => (d(), r("li", {
981
+ id: `option-${e.id}-${o.value}`,
982
+ key: c,
983
+ "data-testid": `option-${e.id}-${o.value}`,
984
+ role: "option",
985
+ tabindex: "-1",
986
+ class: "select-option-item",
987
+ style: le(`--item: ${c + 1}`),
988
+ selected: e.isSelected(o),
989
+ "aria-selected": e.isSelected(o),
990
+ onClick: (u) => t("select", o),
991
+ onKeyup: [
992
+ q((u) => t("select", o), ["enter"]),
993
+ q((u) => t("select", o), ["space"])
994
+ ]
995
+ }, [
996
+ y(n.$slots, "item-list", {
997
+ text: o.name,
998
+ value: o.value,
999
+ option: o,
1000
+ isSelected: e.isSelected(o)
1001
+ }, () => [
1002
+ O(S(o.name), 1)
1003
+ ])
1004
+ ], 44, Xt))), 128)),
1005
+ e.options.length ? T("", !0) : (d(), r("li", Zt, [
1006
+ y(n.$slots, "no-data", {}, () => [
1007
+ _t
1008
+ ])
1009
+ ]))
1010
+ ], 8, Qt));
1011
+ }
1012
+ });
1013
+ const tl = {
1129
1014
  preserveAspectRatio: "xMidYMid meet",
1130
1015
  viewBox: "0 0 24 24",
1131
- width: "1.2em",
1132
- height: "1.2em"
1133
- };
1134
- const _hoisted_2$5 = /* @__PURE__ */ createElementVNode("path", {
1016
+ width: "1em",
1017
+ height: "1em"
1018
+ }, ll = /* @__PURE__ */ m("path", {
1135
1019
  fill: "currentColor",
1136
1020
  d: "m17 10l-5 6l-5-6h10z"
1137
- }, null, -1);
1138
- const _hoisted_3$5 = [
1139
- _hoisted_2$5
1021
+ }, null, -1), nl = [
1022
+ ll
1140
1023
  ];
1141
- function render$3(_ctx, _cache) {
1142
- return openBlock(), createElementBlock("svg", _hoisted_1$5, _hoisted_3$5);
1024
+ function il(e, l) {
1025
+ return d(), r("svg", tl, nl);
1143
1026
  }
1144
- var IconArrow = { name: "mi-caret-down", render: render$3 };
1145
- var Select_vue_vue_type_style_index_0_lang = "";
1146
- const _hoisted_1$4 = { class: "select" };
1147
- const _hoisted_2$4 = {
1148
- key: 2,
1149
- class: "placeholder-inline"
1150
- };
1151
- const _hoisted_3$4 = { class: "error" };
1152
- const _sfc_main$1 = /* @__PURE__ */ defineComponent({
1027
+ const al = { name: "mi-caret-down", render: il }, ol = ["data-testid"], sl = ["id"], dl = ["id", "disabled", "data-testid", "aria-expanded", "aria-labelledby", "aria-label", "aria-controls", "onClick"], cl = {
1028
+ key: 0,
1029
+ class: "container-tags"
1030
+ }, rl = {
1031
+ key: 1,
1032
+ class: "mr-micro placeholder-inline",
1033
+ tabindex: "-1"
1034
+ }, ul = { class: "error" }, hl = { class: "select-options-container" }, be = /* @__PURE__ */ V({
1153
1035
  __name: "Select",
1154
1036
  props: {
1155
1037
  id: null,
1156
- options: null,
1157
1038
  label: null,
1158
1039
  ariaLabel: null,
1159
1040
  smallerWidth: { type: Boolean },
1160
1041
  disabled: { type: Boolean },
1042
+ loading: { type: Boolean, default: !1 },
1043
+ searchable: { type: Boolean, default: !1 },
1044
+ closeOnSelect: { type: Boolean, default: !0 },
1045
+ fetchOnSearch: { type: Boolean, default: !1 },
1161
1046
  multiple: { type: Boolean },
1162
- modelValue: null,
1163
- error: null,
1164
- fetchOnApi: { type: Boolean },
1165
- placeholder: { default: "Selecione" },
1166
1047
  searchPlaceholder: null,
1167
- searchable: { type: Boolean }
1048
+ selected: null,
1049
+ options: { default: () => [] },
1050
+ error: null,
1051
+ placeholder: { default: "placeholder" }
1168
1052
  },
1169
- emits: ["update:modelValue"],
1170
- setup(__props, { emit }) {
1171
- return (_ctx, _cache) => {
1172
- return openBlock(), createBlock(_sfc_main$3, {
1173
- id: `select-${__props.id}`,
1174
- selected: __props.modelValue,
1175
- label: __props.label,
1176
- "aria-label": __props.ariaLabel,
1177
- "smaller-width": __props.smallerWidth,
1178
- disabled: __props.disabled,
1179
- "fetch-on-search": __props.fetchOnApi,
1180
- "is-multiple-select": __props.multiple,
1181
- class: "sol-select-core",
1182
- "search-placeholder": __props.searchPlaceholder,
1183
- searchable: __props.searchable,
1184
- options: __props.options,
1185
- "onUpdate:selected": _cache[0] || (_cache[0] = ($event) => emit("update:modelValue", $event))
1186
- }, {
1187
- "toggle-dropdown": withCtx(({ selected, isOpen, select }) => [
1188
- createElementVNode("div", {
1189
- class: normalizeClass(["select-container", { "-disabled": __props.disabled, "-error": __props.error }])
1190
- }, [
1191
- createElementVNode("div", _hoisted_1$4, [
1192
- __props.multiple && (selected == null ? void 0 : selected.length) ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(selected, (item, index) => {
1193
- return openBlock(), createBlock(_sfc_main$2, {
1194
- id: item,
1195
- key: index,
1196
- label: item,
1197
- onClick: withModifiers(($event) => select(item), ["stop"]),
1198
- onClose: ($event) => select(item)
1199
- }, null, 8, ["id", "label", "onClick", "onClose"]);
1200
- }), 128)) : (selected == null ? void 0 : selected.length) ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
1201
- createTextVNode(toDisplayString(selected), 1)
1202
- ], 64)) : (openBlock(), createElementBlock("span", _hoisted_2$4, toDisplayString(__props.placeholder), 1))
1203
- ]),
1204
- createVNode(unref(IconArrow), {
1205
- class: normalizeClass(["icon", { "-open": isOpen }])
1053
+ emits: ["closeDropdown", "search", "update:selected"],
1054
+ setup(e, { emit: l }) {
1055
+ const t = e, i = L(), n = L(!1), a = L(""), o = E(
1056
+ () => {
1057
+ var b;
1058
+ return t.fetchOnSearch ? t.options : (b = t.options) == null ? void 0 : b.filter((s) => s.name.includes(a.value));
1059
+ }
1060
+ );
1061
+ Ve(i, () => {
1062
+ n.value && h();
1063
+ });
1064
+ function c() {
1065
+ t.disabled || (n.value ? h() : u());
1066
+ }
1067
+ function u() {
1068
+ n.value = !0;
1069
+ }
1070
+ function h() {
1071
+ D(), l("closeDropdown");
1072
+ }
1073
+ function v(b) {
1074
+ if (Array.isArray(t.selected)) {
1075
+ const s = t.selected.findIndex(
1076
+ ({ value: f }) => f === b.value
1077
+ );
1078
+ return s === -1 ? [...t.selected, b] : t.selected.filter((f, $) => $ !== s);
1079
+ }
1080
+ return [b];
1081
+ }
1082
+ function M(b) {
1083
+ t.multiple ? l("update:selected", v(b)) : l("update:selected", b), t.closeOnSelect && !t.multiple && h();
1084
+ }
1085
+ function w(b) {
1086
+ var s;
1087
+ return Array.isArray(t.selected) ? t.selected.some(({ value: f }) => f === b.value) : b.value === ((s = t.selected) == null ? void 0 : s.value);
1088
+ }
1089
+ const k = j({
1090
+ list: void 0,
1091
+ search: void 0
1092
+ }), C = j({
1093
+ id: "",
1094
+ index: 0
1095
+ });
1096
+ function A({ code: b }) {
1097
+ const s = ($) => {
1098
+ const B = $ != null ? $ : C.index;
1099
+ $ !== void 0 && (C.index = $), setTimeout(() => {
1100
+ var P, K;
1101
+ const I = (P = k.list) == null ? void 0 : P.children[B];
1102
+ C.id = (K = I == null ? void 0 : I.id) != null ? K : "", I == null || I.focus();
1103
+ }, 0);
1104
+ }, f = () => {
1105
+ var $;
1106
+ t.searchable && (C.index = 0, ($ = k == null ? void 0 : k.search) == null || $.focus());
1107
+ };
1108
+ switch (b) {
1109
+ case "ArrowUp":
1110
+ return C.index > 0 && (C.index -= 1), s();
1111
+ case "ArrowDown":
1112
+ return n.value ? (C.index < t.options.length - 1 && (C.index += 1), s()) : (u(), s(0));
1113
+ case "Home":
1114
+ return s(0);
1115
+ case "End":
1116
+ return s(t.options.length - 1);
1117
+ case "Escape":
1118
+ return h();
1119
+ default:
1120
+ !["Enter", "NumpadEnter", "Space"].includes(b) && f();
1121
+ }
1122
+ }
1123
+ function D() {
1124
+ n.value = !1, C.index = 0, a.value = "";
1125
+ }
1126
+ function _(b) {
1127
+ return (s) => {
1128
+ k[b] = b === "search" ? s == null ? void 0 : s.input : s == null ? void 0 : s.list;
1129
+ };
1130
+ }
1131
+ function H() {
1132
+ var s;
1133
+ const b = t.selected;
1134
+ return (s = b == null ? void 0 : b.name) != null ? s : t.placeholder;
1135
+ }
1136
+ return (b, s) => (d(), r("div", {
1137
+ ref_key: "el",
1138
+ ref: i,
1139
+ class: x(["sol-select-core", { "-smaller": e.smallerWidth }]),
1140
+ "data-testid": `select-${e.id}`,
1141
+ onKeydownPassive: A
1142
+ }, [
1143
+ y(b.$slots, "label", {
1144
+ id: `select-label-${e.id}`,
1145
+ for: `select-toggle-${e.id}`
1146
+ }, () => [
1147
+ e.label ? (d(), r("label", {
1148
+ key: 0,
1149
+ id: `select-label-${e.id}`,
1150
+ class: x(["label", { "-disabled": e.disabled }])
1151
+ }, S(e.label), 11, sl)) : T("", !0)
1152
+ ]),
1153
+ m("button", {
1154
+ id: `select-toggle-${e.id}`,
1155
+ disabled: e.disabled,
1156
+ "data-testid": `select-toggle-${e.id}`,
1157
+ class: "select-button-toggle",
1158
+ "aria-haspopup": "listbox",
1159
+ "aria-expanded": n.value,
1160
+ "aria-labelledby": `select-label-${e.id}`,
1161
+ "aria-label": e.ariaLabel,
1162
+ "aria-controls": `select-list-${e.id}`,
1163
+ onClick: R(c, ["stop"])
1164
+ }, [
1165
+ y(b.$slots, "toggle-dropdown", {
1166
+ toggle: { open: u, close: h, toggleDropdown: c },
1167
+ isOpen: n.value,
1168
+ select: M,
1169
+ selected: e.selected
1170
+ }, () => {
1171
+ var f;
1172
+ return [
1173
+ e.multiple && Array.isArray(e.selected) && ((f = e.selected) == null ? void 0 : f.length) ? (d(), r("div", cl, [
1174
+ (d(!0), r(Q, null, X(e.selected, ($, B) => (d(), N(oe, {
1175
+ id: $.value,
1176
+ key: B,
1177
+ label: $.name,
1178
+ onClick: R((I) => M($), ["stop"]),
1179
+ onClose: (I) => M($)
1180
+ }, null, 8, ["id", "label", "onClick", "onClose"]))), 128))
1181
+ ])) : (d(), r("span", rl, S(H()), 1)),
1182
+ z(g(al), {
1183
+ "aria-hidden": "true",
1184
+ tabindex: "-1",
1185
+ class: x(["icon", { "-open": n.value }])
1206
1186
  }, null, 8, ["class"])
1207
- ], 2),
1208
- createElementVNode("span", _hoisted_3$4, toDisplayString(__props.error), 1)
1187
+ ];
1188
+ })
1189
+ ], 8, dl),
1190
+ m("span", ul, S(e.error), 1),
1191
+ z(we, {
1192
+ mode: "out-in",
1193
+ name: "dropdown"
1194
+ }, {
1195
+ default: G(() => [
1196
+ Y(m("div", hl, [
1197
+ y(b.$slots, "search", {}, () => [
1198
+ e.searchable ? (d(), r("div", {
1199
+ key: 0,
1200
+ class: x(["search-container", { "-loading": e.loading }])
1201
+ }, [
1202
+ y(b.$slots, "search", { filter: a.value }, () => [
1203
+ z(F, {
1204
+ id: `select-search-${e.id}`,
1205
+ ref: _("search"),
1206
+ modelValue: a.value,
1207
+ "onUpdate:modelValue": s[0] || (s[0] = (f) => a.value = f),
1208
+ "data-testid": `select-search-${e.id}`,
1209
+ role: "combobox",
1210
+ class: "search",
1211
+ "aria-autocomplete": "list",
1212
+ placeholder: e.searchPlaceholder,
1213
+ "aria-expanded": n.value,
1214
+ "aria-haspopup": "listbox",
1215
+ "aria-owns": `select-list-${e.id}`,
1216
+ "aria-controls": `select-list-${e.id}`,
1217
+ "aria-activedescendant": C.id,
1218
+ "aria-labelledby": `select-label-${e.id}`,
1219
+ onClick: s[1] || (s[1] = R(() => {
1220
+ }, ["stop"])),
1221
+ onInput: s[2] || (s[2] = (f) => {
1222
+ var $;
1223
+ return l("search", ($ = f.target) == null ? void 0 : $.value);
1224
+ })
1225
+ }, null, 8, ["id", "modelValue", "data-testid", "placeholder", "aria-expanded", "aria-owns", "aria-controls", "aria-activedescendant", "aria-labelledby"]),
1226
+ z(g(Ie), {
1227
+ "aria-hidden": "true",
1228
+ class: "icon"
1229
+ })
1230
+ ])
1231
+ ], 2)) : T("", !0),
1232
+ z(el, {
1233
+ id: e.id,
1234
+ ref: _("list"),
1235
+ options: g(o),
1236
+ multiple: e.multiple,
1237
+ "is-selected": w,
1238
+ onSelect: M
1239
+ }, {
1240
+ "item-list": G(({ text: f, value: $, option: B, isSelected: I }) => [
1241
+ y(b.$slots, "default", {
1242
+ text: f,
1243
+ value: $,
1244
+ option: B,
1245
+ isSelected: I
1246
+ })
1247
+ ]),
1248
+ "no-data": G(() => [
1249
+ y(b.$slots, "no-data")
1250
+ ]),
1251
+ _: 3
1252
+ }, 8, ["id", "options", "multiple"])
1253
+ ])
1254
+ ], 512), [
1255
+ [te, n.value]
1256
+ ])
1209
1257
  ]),
1210
- _: 1
1211
- }, 8, ["id", "selected", "label", "aria-label", "smaller-width", "disabled", "fetch-on-search", "is-multiple-select", "search-placeholder", "searchable", "options"]);
1212
- };
1258
+ _: 3
1259
+ })
1260
+ ], 42, ol));
1213
1261
  }
1214
1262
  });
1215
- _sfc_main$1.install = (app) => {
1216
- app.component("SolSelect", _sfc_main$1);
1263
+ be.install = (e) => {
1264
+ e.component("SolSelect", be);
1217
1265
  };
1218
- _sfc_main$2.install = (app) => {
1219
- app.component("SolChip", _sfc_main$2);
1266
+ oe.install = (e) => {
1267
+ e.component("SolChip", oe);
1220
1268
  };
1221
- var windiBase = "";
1222
- var windiComponents = "";
1223
- var windiUtilities = "";
1224
- var style = "";
1225
- const TOAST_GAP = 12;
1226
- const DEFAULT_OPTIONS = {
1269
+ const fl = {
1270
+ preserveAspectRatio: "xMidYMid meet",
1271
+ viewBox: "0 0 24 24",
1272
+ width: "1em",
1273
+ height: "1em"
1274
+ }, ml = /* @__PURE__ */ m("path", {
1275
+ fill: "currentColor",
1276
+ d: "M11.293 7.293a1 1 0 0 1 1.414 0l6 6a1 1 0 0 1-1.414 1.414L12 9.414l-5.293 5.293a1 1 0 0 1-1.414-1.414l6-6z"
1277
+ }, null, -1), $l = [
1278
+ ml
1279
+ ];
1280
+ function vl(e, l) {
1281
+ return d(), r("svg", fl, $l);
1282
+ }
1283
+ const bl = { name: "mi-chevron-up", render: vl }, yl = ["id", "data-testid", "aria-disabled"], gl = ["data-testid", "tabindex"], wl = ["data-testid"], ye = /* @__PURE__ */ V({
1284
+ __name: "Accordion",
1285
+ props: {
1286
+ id: null,
1287
+ title: { default: "Title" },
1288
+ invert: { type: Boolean },
1289
+ disabled: { type: Boolean }
1290
+ },
1291
+ setup(e) {
1292
+ return (l, t) => (d(), r("details", {
1293
+ id: `accordion-${e.id}`,
1294
+ "data-testid": `accordion-${e.id}`,
1295
+ class: x(["sol-accordion-core", { "-invert": e.invert, "-disabled": e.disabled }]),
1296
+ "aria-disabled": e.disabled
1297
+ }, [
1298
+ m("summary", {
1299
+ "data-testid": `accordion-title-${e.id}`,
1300
+ class: "summary",
1301
+ tabindex: e.disabled ? -1 : 0
1302
+ }, [
1303
+ y(l.$slots, "title", {}, () => [
1304
+ O(S(e.title), 1)
1305
+ ]),
1306
+ z(g(bl), {
1307
+ class: "icon",
1308
+ "aria-hidden": "true"
1309
+ })
1310
+ ], 8, gl),
1311
+ m("div", {
1312
+ "data-testid": `accordion-content-${e.id}`,
1313
+ class: "container"
1314
+ }, [
1315
+ y(l.$slots, "default")
1316
+ ], 8, wl)
1317
+ ], 10, yl));
1318
+ }
1319
+ });
1320
+ ye.install = (e) => {
1321
+ e.component("SolAccordion", ye);
1322
+ };
1323
+ const Le = 12, U = {
1227
1324
  type: "success",
1228
1325
  timeout: 5e3,
1229
- showIcon: true,
1230
- showCloseButton: true,
1326
+ showIcon: !0,
1327
+ showCloseButton: !0,
1231
1328
  position: "top-right",
1232
- hideProgressBar: false
1329
+ hideProgressBar: !1
1233
1330
  };
1234
- function useTimer(callback, delay) {
1235
- const timer = reactive({
1331
+ function Sl(e, l) {
1332
+ const t = j({
1236
1333
  id: null,
1237
1334
  intervalId: null,
1238
1335
  startTime: 0,
1239
- remaining: delay
1240
- });
1241
- const progress = ref(100);
1242
- function stop() {
1243
- clearInterval(timer.intervalId);
1244
- clearTimeout(timer.id);
1245
- timer.remaining -= Date.now() - timer.startTime;
1336
+ remaining: l
1337
+ }), i = L(100);
1338
+ function n() {
1339
+ clearInterval(t.intervalId), clearTimeout(t.id), t.remaining -= Date.now() - t.startTime;
1246
1340
  }
1247
- function start() {
1248
- timer.startTime = Date.now();
1249
- clearTimeout(timer.id);
1250
- timer.intervalId = setInterval(() => {
1251
- progress.value--;
1252
- }, delay / 100 - 5);
1253
- timer.id = setTimeout(callback, timer.remaining);
1341
+ function a() {
1342
+ t.startTime = Date.now(), clearTimeout(t.id), t.intervalId = setInterval(() => {
1343
+ i.value--;
1344
+ }, l / 100 - 5), t.id = setTimeout(e, t.remaining);
1254
1345
  }
1255
- function clear() {
1256
- clearInterval(timer.intervalId);
1257
- clearTimeout(timer.id);
1258
- progress.value = 100;
1346
+ function o() {
1347
+ clearInterval(t.intervalId), clearTimeout(t.id), i.value = 100;
1259
1348
  }
1260
- onMounted(() => {
1261
- if (delay <= 0)
1262
- return false;
1263
- });
1264
- onUnmounted(() => {
1265
- clear();
1266
- });
1267
- return {
1268
- start,
1269
- stop,
1270
- clear,
1271
- progress
1349
+ return Te(() => {
1350
+ if (l <= 0)
1351
+ return !1;
1352
+ }), He(() => {
1353
+ o();
1354
+ }), {
1355
+ start: a,
1356
+ stop: n,
1357
+ clear: o,
1358
+ progress: i
1272
1359
  };
1273
1360
  }
1274
- function usePosition(fn) {
1275
- const stylePosition = computed(() => {
1276
- const { position, offset } = fn();
1277
- switch (position) {
1278
- case "top-left":
1279
- return {
1280
- left: "0",
1281
- top: `${offset}px`
1282
- };
1283
- case "bottom-left":
1284
- return {
1285
- left: "0",
1286
- bottom: `${offset}px`
1287
- };
1288
- case "bottom-right":
1289
- return {
1290
- right: "0",
1291
- bottom: `${offset}px`
1292
- };
1293
- case "top-center":
1294
- return {
1295
- top: `${offset}px`,
1296
- left: "0",
1297
- right: "0",
1298
- marginRight: "auto",
1299
- marginLeft: "auto"
1300
- };
1301
- case "bottom-center":
1302
- return {
1303
- bottom: `${offset}px`,
1304
- left: "0",
1305
- right: "0",
1306
- marginRight: "auto",
1307
- marginLeft: "auto"
1308
- };
1309
- default:
1310
- return {
1311
- right: "0",
1312
- top: `${offset}px`
1313
- };
1314
- }
1315
- });
1361
+ function xl(e) {
1316
1362
  return {
1317
- stylePosition
1363
+ stylePosition: E(() => {
1364
+ const { position: t, offset: i } = e();
1365
+ switch (t) {
1366
+ case "top-left":
1367
+ return {
1368
+ left: "0",
1369
+ top: `${i}px`
1370
+ };
1371
+ case "bottom-left":
1372
+ return {
1373
+ left: "0",
1374
+ bottom: `${i}px`
1375
+ };
1376
+ case "bottom-right":
1377
+ return {
1378
+ right: "0",
1379
+ bottom: `${i}px`
1380
+ };
1381
+ case "top-center":
1382
+ return {
1383
+ top: `${i}px`,
1384
+ left: "0",
1385
+ right: "0",
1386
+ marginRight: "auto",
1387
+ marginLeft: "auto"
1388
+ };
1389
+ case "bottom-center":
1390
+ return {
1391
+ bottom: `${i}px`,
1392
+ left: "0",
1393
+ right: "0",
1394
+ marginRight: "auto",
1395
+ marginLeft: "auto"
1396
+ };
1397
+ default:
1398
+ return {
1399
+ right: "0",
1400
+ top: `${i}px`
1401
+ };
1402
+ }
1403
+ })
1318
1404
  };
1319
1405
  }
1320
- var Transition = /* @__PURE__ */ ((Transition2) => {
1321
- Transition2["top-left"] = "bounce-left";
1322
- Transition2["top-right"] = "bounce-right";
1323
- Transition2["top-center"] = "bounce-down";
1324
- Transition2["bottom-left"] = "bounce-left";
1325
- Transition2["bottom-center"] = "bounce-up";
1326
- Transition2["bottom-right"] = "bounce-right";
1327
- return Transition2;
1328
- })(Transition || {});
1329
- const _hoisted_1$3 = {
1406
+ var Ee = /* @__PURE__ */ ((e) => (e["top-left"] = "bounce-left", e["top-right"] = "bounce-right", e["top-center"] = "bounce-down", e["bottom-left"] = "bounce-left", e["bottom-center"] = "bounce-up", e["bottom-right"] = "bounce-right", e))(Ee || {});
1407
+ const kl = {
1330
1408
  preserveAspectRatio: "xMidYMid meet",
1331
1409
  viewBox: "0 0 24 24",
1332
- width: "1.2em",
1333
- height: "1.2em"
1334
- };
1335
- const _hoisted_2$3 = /* @__PURE__ */ createElementVNode("path", {
1410
+ width: "1em",
1411
+ height: "1em"
1412
+ }, Cl = /* @__PURE__ */ m("path", {
1336
1413
  fill: "currentColor",
1337
1414
  d: "M12 4a8 8 0 1 0 0 16a8 8 0 0 0 0-16zM2 12C2 6.477 6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10S2 17.523 2 12zm14.664-3.247a1 1 0 0 1 .083 1.411l-5.333 6a1 1 0 0 1-1.495 0l-2.666-3a1 1 0 0 1 1.494-1.328l1.92 2.159l4.586-5.16a1 1 0 0 1 1.411-.082z"
1338
- }, null, -1);
1339
- const _hoisted_3$3 = [
1340
- _hoisted_2$3
1415
+ }, null, -1), Bl = [
1416
+ Cl
1341
1417
  ];
1342
- function render$2(_ctx, _cache) {
1343
- return openBlock(), createElementBlock("svg", _hoisted_1$3, _hoisted_3$3);
1418
+ function Tl(e, l) {
1419
+ return d(), r("svg", kl, Bl);
1344
1420
  }
1345
- var Success = { name: "mi-circle-check", render: render$2 };
1346
- const _hoisted_1$2 = {
1421
+ const Ml = { name: "mi-circle-check", render: Tl }, zl = {
1347
1422
  preserveAspectRatio: "xMidYMid meet",
1348
1423
  viewBox: "0 0 24 24",
1349
- width: "1.2em",
1350
- height: "1.2em"
1351
- };
1352
- const _hoisted_2$2 = /* @__PURE__ */ createElementVNode("path", {
1424
+ width: "1em",
1425
+ height: "1em"
1426
+ }, Vl = /* @__PURE__ */ m("path", {
1353
1427
  fill: "currentColor",
1354
1428
  d: "M12 4a8 8 0 1 0 0 16a8 8 0 0 0 0-16zM2 12C2 6.477 6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10S2 17.523 2 12zm5.793-4.207a1 1 0 0 1 1.414 0L12 10.586l2.793-2.793a1 1 0 1 1 1.414 1.414L13.414 12l2.793 2.793a1 1 0 0 1-1.414 1.414L12 13.414l-2.793 2.793a1 1 0 0 1-1.414-1.414L10.586 12L7.793 9.207a1 1 0 0 1 0-1.414z"
1355
- }, null, -1);
1356
- const _hoisted_3$2 = [
1357
- _hoisted_2$2
1429
+ }, null, -1), Il = [
1430
+ Vl
1358
1431
  ];
1359
- function render$1(_ctx, _cache) {
1360
- return openBlock(), createElementBlock("svg", _hoisted_1$2, _hoisted_3$2);
1432
+ function Al(e, l) {
1433
+ return d(), r("svg", zl, Il);
1361
1434
  }
1362
- var Error$1 = { name: "mi-circle-error", render: render$1 };
1363
- const _hoisted_1$1 = {
1435
+ const Ll = { name: "mi-circle-error", render: Al }, El = {
1364
1436
  preserveAspectRatio: "xMidYMid meet",
1365
1437
  viewBox: "0 0 24 24",
1366
- width: "1.2em",
1367
- height: "1.2em"
1368
- };
1369
- const _hoisted_2$1 = /* @__PURE__ */ createElementVNode("g", { fill: "currentColor" }, [
1370
- /* @__PURE__ */ createElementVNode("path", { d: "M12 4a8 8 0 1 0 0 16a8 8 0 0 0 0-16zM2 12C2 6.477 6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10S2 17.523 2 12z" }),
1371
- /* @__PURE__ */ createElementVNode("path", { d: "M12 14a1 1 0 0 1-1-1V7a1 1 0 1 1 2 0v6a1 1 0 0 1-1 1zm-1.5 2.5a1.5 1.5 0 1 1 3 0a1.5 1.5 0 0 1-3 0z" })
1372
- ], -1);
1373
- const _hoisted_3$1 = [
1374
- _hoisted_2$1
1438
+ width: "1em",
1439
+ height: "1em"
1440
+ }, Pl = /* @__PURE__ */ m("g", { fill: "currentColor" }, [
1441
+ /* @__PURE__ */ m("path", { d: "M12 4a8 8 0 1 0 0 16a8 8 0 0 0 0-16zM2 12C2 6.477 6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10S2 17.523 2 12z" }),
1442
+ /* @__PURE__ */ m("path", { d: "M12 14a1 1 0 0 1-1-1V7a1 1 0 1 1 2 0v6a1 1 0 0 1-1 1zm-1.5 2.5a1.5 1.5 0 1 1 3 0a1.5 1.5 0 0 1-3 0z" })
1443
+ ], -1), Ol = [
1444
+ Pl
1375
1445
  ];
1376
- function render(_ctx, _cache) {
1377
- return openBlock(), createElementBlock("svg", _hoisted_1$1, _hoisted_3$1);
1446
+ function Dl(e, l) {
1447
+ return d(), r("svg", El, Ol);
1378
1448
  }
1379
- var Info = { name: "mi-circle-warning", render };
1380
- var Toast_vue_vue_type_style_index_0_lang = "";
1381
- const _hoisted_1 = ["id", "data-testid"];
1382
- const _hoisted_2 = { class: "content-wrapper" };
1383
- const _hoisted_3 = {
1449
+ const Rl = { name: "mi-circle-warning", render: Dl }, pl = ["id", "data-testid"], Hl = { class: "content-wrapper" }, Nl = {
1384
1450
  key: 0,
1385
1451
  class: "icon-container",
1386
1452
  "aria-hidden": "true"
1387
- };
1388
- const _hoisted_4 = { class: "content" };
1389
- const _hoisted_5 = {
1453
+ }, Ul = { class: "content" }, Gl = {
1390
1454
  key: 0,
1391
1455
  class: "description"
1392
- };
1393
- const _hoisted_6 = ["data-testid"];
1394
- const _sfc_main = /* @__PURE__ */ defineComponent({
1456
+ }, Fl = ["data-testid"], Kl = /* @__PURE__ */ V({
1395
1457
  __name: "Toast",
1396
1458
  props: {
1397
1459
  id: null,
1398
- type: { default: DEFAULT_OPTIONS.type },
1399
- visible: { type: Boolean, default: false },
1460
+ type: { default: U.type },
1461
+ visible: { type: Boolean, default: !1 },
1400
1462
  title: null,
1401
1463
  description: null,
1402
1464
  timeout: null,
1403
- hideProgressBar: { type: Boolean, default: DEFAULT_OPTIONS.hideProgressBar },
1404
- showIcon: { type: Boolean, default: DEFAULT_OPTIONS.showIcon },
1465
+ hideProgressBar: { type: Boolean, default: U.hideProgressBar },
1466
+ showIcon: { type: Boolean, default: U.showIcon },
1405
1467
  offset: { default: 0 },
1406
1468
  onClose: null,
1407
1469
  onCloseHandler: null,
1408
- position: { default: DEFAULT_OPTIONS.position }
1470
+ position: { default: U.position }
1409
1471
  },
1410
- setup(__props) {
1411
- const props = __props;
1412
- const { start, stop, progress } = useTimer(() => {
1413
- var _a2;
1414
- (_a2 = props.onCloseHandler) == null ? void 0 : _a2.call(props);
1415
- }, props.timeout);
1416
- const { stylePosition } = usePosition(() => ({
1417
- offset: props.offset,
1418
- position: props.position
1419
- }));
1420
- const isMultiline = computed(() => props.title && props.description);
1421
- function onMouseEnter() {
1422
- if (props.timeout > 0) {
1423
- stop();
1424
- }
1472
+ setup(e) {
1473
+ const l = e, { start: t, stop: i, progress: n } = Sl(() => {
1474
+ var h;
1475
+ (h = l.onCloseHandler) == null || h.call(l);
1476
+ }, l.timeout), { stylePosition: a } = xl(() => ({
1477
+ offset: l.offset,
1478
+ position: l.position
1479
+ })), o = E(() => l.title && l.description);
1480
+ function c() {
1481
+ l.timeout > 0 && i();
1425
1482
  }
1426
- function onMouseLeave() {
1427
- start();
1483
+ function u() {
1484
+ t();
1428
1485
  }
1429
- onMounted(() => {
1430
- start();
1431
- });
1432
- return (_ctx, _cache) => {
1433
- return openBlock(), createBlock(Transition$1, {
1434
- name: unref(Transition)[__props.position],
1435
- type: "animation"
1436
- }, {
1437
- default: withCtx(() => [
1438
- __props.visible ? (openBlock(), createElementBlock("div", {
1439
- key: 0,
1440
- id: `toast-${__props.type}-${__props.id}`,
1441
- role: "status",
1442
- "data-testid": `toast-${__props.type}-${__props.id}`,
1443
- style: normalizeStyle(unref(stylePosition)),
1444
- class: normalizeClass(["sol-toast-core", [`-${__props.type}`, { "-multiline": unref(isMultiline) }]]),
1445
- onKeyup: _cache[1] || (_cache[1] = withKeys((...args) => __props.onCloseHandler && __props.onCloseHandler(...args), ["esc"])),
1446
- onMouseenter: onMouseEnter,
1447
- onMouseleave: onMouseLeave,
1448
- onFocusin: onMouseEnter,
1449
- onFocusout: onMouseLeave
1450
- }, [
1451
- createElementVNode("section", _hoisted_2, [
1452
- __props.showIcon ? (openBlock(), createElementBlock("div", _hoisted_3, [
1453
- renderSlot(_ctx.$slots, "icon-status", { type: __props.type }, () => [
1454
- __props.type === "success" ? (openBlock(), createBlock(unref(Success), {
1455
- key: 0,
1456
- class: "icon"
1457
- })) : createCommentVNode("", true),
1458
- __props.type === "info" ? (openBlock(), createBlock(unref(Info), {
1459
- key: 1,
1460
- class: "icon"
1461
- })) : createCommentVNode("", true),
1462
- __props.type === "danger" ? (openBlock(), createBlock(unref(Error$1), {
1463
- key: 2,
1464
- class: "icon"
1465
- })) : createCommentVNode("", true)
1466
- ])
1467
- ])) : createCommentVNode("", true),
1468
- createElementVNode("div", _hoisted_4, [
1469
- createElementVNode("p", {
1470
- class: normalizeClass(["title", { "-multiline": unref(isMultiline) }])
1471
- }, [
1472
- renderSlot(_ctx.$slots, "title", {}, () => [
1473
- createTextVNode(toDisplayString(__props.title), 1)
1474
- ])
1475
- ], 2),
1476
- __props.description ? (openBlock(), createElementBlock("p", _hoisted_5, [
1477
- renderSlot(_ctx.$slots, "description", {}, () => [
1478
- createTextVNode(toDisplayString(__props.description), 1)
1479
- ])
1480
- ])) : createCommentVNode("", true)
1486
+ return Te(() => {
1487
+ t();
1488
+ }), (h, v) => (d(), N(we, {
1489
+ name: g(Ee)[e.position],
1490
+ type: "animation"
1491
+ }, {
1492
+ default: G(() => [
1493
+ e.visible ? (d(), r("div", {
1494
+ key: 0,
1495
+ id: `toast-${e.type}-${e.id}`,
1496
+ role: "status",
1497
+ "data-testid": `toast-${e.type}-${e.id}`,
1498
+ style: le(g(a)),
1499
+ class: x(["sol-toast-core", [`-${e.type}`, { "-multiline": g(o) }]]),
1500
+ onKeyup: v[1] || (v[1] = q(
1501
+ (...M) => e.onCloseHandler && e.onCloseHandler(...M),
1502
+ ["esc"]
1503
+ )),
1504
+ onMouseenter: c,
1505
+ onMouseleave: u,
1506
+ onFocusin: c,
1507
+ onFocusout: u
1508
+ }, [
1509
+ m("section", Hl, [
1510
+ e.showIcon ? (d(), r("div", Nl, [
1511
+ y(h.$slots, "icon-status", { type: e.type }, () => [
1512
+ e.type === "success" ? (d(), N(g(Ml), {
1513
+ key: 0,
1514
+ class: "icon"
1515
+ })) : T("", !0),
1516
+ e.type === "info" ? (d(), N(g(Rl), {
1517
+ key: 1,
1518
+ class: "icon"
1519
+ })) : T("", !0),
1520
+ e.type === "danger" ? (d(), N(g(Ll), {
1521
+ key: 2,
1522
+ class: "icon"
1523
+ })) : T("", !0)
1481
1524
  ])
1482
- ]),
1483
- createElementVNode("button", {
1484
- type: "button",
1485
- class: normalizeClass(["close", { "-multiline": unref(isMultiline) }]),
1486
- "data-testid": `toast-close-button-${__props.type}-${__props.id}`,
1487
- "aria-label": "close notification",
1488
- onClick: _cache[0] || (_cache[0] = (...args) => __props.onCloseHandler && __props.onCloseHandler(...args))
1489
- }, [
1490
- createVNode(unref(Close), { class: "icon" })
1491
- ], 10, _hoisted_6),
1492
- !__props.hideProgressBar ? (openBlock(), createElementBlock("div", {
1493
- key: 0,
1494
- class: "progressbar",
1495
- "aria-hidden": "true",
1496
- style: normalizeStyle({ width: `${unref(progress)}%` })
1497
- }, null, 4)) : createCommentVNode("", true)
1498
- ], 46, _hoisted_1)) : createCommentVNode("", true)
1499
- ]),
1500
- _: 3
1501
- }, 8, ["name"]);
1502
- };
1525
+ ])) : T("", !0),
1526
+ m("div", Ul, [
1527
+ m("p", {
1528
+ class: x(["title", { "-multiline": g(o) }])
1529
+ }, [
1530
+ y(h.$slots, "title", {}, () => [
1531
+ O(S(e.title), 1)
1532
+ ])
1533
+ ], 2),
1534
+ e.description ? (d(), r("p", Gl, [
1535
+ y(h.$slots, "description", {}, () => [
1536
+ O(S(e.description), 1)
1537
+ ])
1538
+ ])) : T("", !0)
1539
+ ])
1540
+ ]),
1541
+ m("button", {
1542
+ type: "button",
1543
+ class: x(["close", { "-multiline": g(o) }]),
1544
+ "data-testid": `toast-close-button-${e.type}-${e.id}`,
1545
+ "aria-label": "close notification",
1546
+ onClick: v[0] || (v[0] = (...M) => e.onCloseHandler && e.onCloseHandler(...M))
1547
+ }, [
1548
+ z(g(Ae), { class: "icon" })
1549
+ ], 10, Fl),
1550
+ e.hideProgressBar ? T("", !0) : (d(), r("div", {
1551
+ key: 0,
1552
+ class: "progressbar",
1553
+ "aria-hidden": "true",
1554
+ style: le({ width: `${g(n)}%` })
1555
+ }, null, 4))
1556
+ ], 46, pl)) : T("", !0)
1557
+ ]),
1558
+ _: 3
1559
+ }, 8, ["name"]));
1503
1560
  }
1504
1561
  });
1505
- const toasts = {
1562
+ const J = {
1506
1563
  "top-left": [],
1507
1564
  "top-right": [],
1508
1565
  "top-center": [],
@@ -1510,130 +1567,129 @@ const toasts = {
1510
1567
  "bottom-right": [],
1511
1568
  "bottom-center": []
1512
1569
  };
1513
- function useToast() {
1514
- let toastId = 0;
1515
- function clearAllToasts() {
1516
- Object.entries(toasts).forEach(([position, toastsInAPosition]) => {
1517
- if (toastsInAPosition.length) {
1518
- toastsInAPosition.forEach((toast) => {
1519
- var _a2;
1520
- const id = (_a2 = toast.toastVNode.props) == null ? void 0 : _a2.id;
1521
- close(id, position);
1522
- });
1523
- }
1570
+ function Xl() {
1571
+ let e = 0;
1572
+ function l() {
1573
+ Object.entries(J).forEach(([i, n]) => {
1574
+ n.length && n.forEach((a) => {
1575
+ var c;
1576
+ const o = (c = a.toastVNode.props) == null ? void 0 : c.id;
1577
+ ge(o, i);
1578
+ });
1524
1579
  });
1525
1580
  }
1526
- const createToast = (content, options) => {
1527
- const id = toastId++;
1528
- const initializedOptions = options ? initializeOptions(options) : DEFAULT_OPTIONS;
1529
- if (options == null ? void 0 : options.showOneToast)
1530
- clearAllToasts();
1531
- const transformContent = typeof content === "string" ? { title: content } : content;
1532
- setupVNode(id, initializedOptions, transformContent);
1533
- return {
1534
- close: () => close(id, initializedOptions.position)
1535
- };
1536
- };
1537
1581
  return {
1538
- createToast,
1539
- clearAllToasts
1582
+ createToast: (i, n) => {
1583
+ const a = e++, o = n ? Wl(n) : U;
1584
+ return n != null && n.showOneToast && l(), Yl(a, o, typeof i == "string" ? { title: i } : i), {
1585
+ close: () => ge(a, o.position)
1586
+ };
1587
+ },
1588
+ clearAllToasts: l
1540
1589
  };
1541
1590
  }
1542
- function initializeOptions(options) {
1543
- const processedOptions = __spreadProps(__spreadValues(__spreadValues({}, DEFAULT_OPTIONS), options), {
1544
- showIcon: options.showIcon
1545
- });
1546
- processedOptions.hideProgressBar = !!(processedOptions.timeout && (processedOptions == null ? void 0 : processedOptions.timeout) <= 0);
1547
- if (options.hideProgressBar) {
1548
- processedOptions.hideProgressBar = options.hideProgressBar;
1549
- }
1550
- return processedOptions;
1591
+ function Wl(e) {
1592
+ const l = {
1593
+ ...U,
1594
+ ...e,
1595
+ showIcon: e.showIcon
1596
+ };
1597
+ return l.hideProgressBar = !!(l.timeout && (l == null ? void 0 : l.timeout) <= 0), e.hideProgressBar && (l.hideProgressBar = e.hideProgressBar), l;
1551
1598
  }
1552
- function setupVNode(id, options, content) {
1599
+ function Yl(e, l, t) {
1553
1600
  setTimeout(() => {
1554
- const verticalOffset = moveToastsOnAdd(options, toasts, TOAST_GAP);
1555
- const container = document.createElement("div");
1556
- document.body.appendChild(container);
1557
- const toastVNode = createVNode(_sfc_main, setupVNodeProps(options, id, verticalOffset, close, content));
1558
- render$8(toastVNode, container);
1559
- toasts[options.position].push({ toastVNode, container });
1560
- if (toastVNode.component)
1561
- toastVNode.component.props.visible = true;
1601
+ const i = ql(l, J, Le), n = document.createElement("div");
1602
+ document.body.appendChild(n);
1603
+ const a = z(
1604
+ Kl,
1605
+ jl(l, e, i, ge, t)
1606
+ );
1607
+ Me(a, n), J[l.position].push({ toastVNode: a, container: n }), a.component && (a.component.props.visible = !0);
1562
1608
  }, 1);
1563
1609
  }
1564
- function setupVNodeProps(options, id, offset, closeFn, content) {
1565
- return __spreadProps(__spreadValues(__spreadValues({}, options), content), {
1566
- id,
1567
- offset,
1568
- visible: false,
1610
+ function jl(e, l, t, i, n) {
1611
+ return {
1612
+ ...e,
1613
+ ...n,
1614
+ id: l,
1615
+ offset: t,
1616
+ visible: !1,
1569
1617
  onCloseHandler() {
1570
- closeFn(id, options.position ? options.position : "top-right");
1618
+ i(l, e.position ? e.position : "top-right");
1571
1619
  }
1572
- });
1620
+ };
1573
1621
  }
1574
- function moveToastsOnAdd(options, toasts2, toastGap) {
1575
- if (!options.position)
1622
+ function ql(e, l, t) {
1623
+ if (!e.position)
1576
1624
  throw new Error("no position");
1577
- return toasts2[options.position].reduce((acc, { toastVNode }) => {
1578
- const offsetHeight = toastVNode.el.offsetHeight + toastGap;
1579
- acc += offsetHeight || 0;
1580
- return acc;
1581
- }, toastGap);
1625
+ return l[e.position].reduce((i, { toastVNode: n }) => (i += n.el.offsetHeight + t || 0, i), t);
1582
1626
  }
1583
- function moveToastsOnClose(index, toastArr, position, toastHeight) {
1584
- for (let i = index; i < toastArr.length; i++) {
1585
- const { toastVNode } = toastArr[i];
1586
- if (!toastVNode.el)
1627
+ function Jl(e, l, t, i) {
1628
+ for (let n = e; n < l.length; n++) {
1629
+ const { toastVNode: a } = l[n];
1630
+ if (!a.el)
1587
1631
  return;
1588
- const verticalPosition = position.split("-")[0] || "top";
1589
- const positionLessOneToast = parseInt(toastVNode.el.style[verticalPosition], 10) - toastHeight - TOAST_GAP;
1590
- if (!toastVNode.component)
1632
+ const o = t.split("-")[0] || "top", c = parseInt(a.el.style[o], 10) - i - Le;
1633
+ if (!a.component)
1591
1634
  return;
1592
- toastVNode.component.props.offset = positionLessOneToast;
1635
+ a.component.props.offset = c;
1593
1636
  }
1594
1637
  }
1595
- function close(id, position) {
1596
- var _a2;
1597
- const toastArr = toasts[position];
1598
- const index = toastArr.findIndex(({ toastVNode: toastVNode2 }) => {
1599
- var _a3;
1600
- return id === ((_a3 = toastVNode2 == null ? void 0 : toastVNode2.props) == null ? void 0 : _a3.id);
1601
- });
1602
- if (index === -1)
1638
+ function ge(e, l) {
1639
+ var u;
1640
+ const t = J[l], i = t.findIndex(
1641
+ ({ toastVNode: h }) => {
1642
+ var v;
1643
+ return e === ((v = h == null ? void 0 : h.props) == null ? void 0 : v.id);
1644
+ }
1645
+ );
1646
+ if (i === -1)
1603
1647
  return;
1604
- const { container, toastVNode } = toastArr[index];
1605
- const height = (_a2 = toastVNode == null ? void 0 : toastVNode.el) == null ? void 0 : _a2.offsetHeight;
1606
- toasts[position].splice(index, 1);
1607
- moveToastsOnClose(index, toastArr, position, height);
1608
- if (!toastVNode.component)
1648
+ const { container: n, toastVNode: a } = t[i], o = (u = a == null ? void 0 : a.el) == null ? void 0 : u.offsetHeight;
1649
+ if (J[l].splice(i, 1), Jl(i, t, l, o), !a.component)
1609
1650
  return;
1610
- const componentProps = toastVNode.component.props;
1611
- componentProps.visible = false;
1612
- componentProps.onClose && componentProps.onClose();
1613
- setTimeout(() => {
1614
- render$8(null, container);
1615
- document.body.removeChild(container);
1651
+ const c = a.component.props;
1652
+ c.visible = !1, c.onClose && c.onClose(), setTimeout(() => {
1653
+ Me(null, n), document.body.removeChild(n);
1616
1654
  }, 1e3);
1617
1655
  }
1618
1656
  console.log("%c\u{1F33B}[Girassol]\u{1F33B}", "padding: 8px;background: #212121;color: gold; font-family: 'Fira code'; font-weight: bold; font-size: 1.2rem");
1619
- const components = {
1620
- SolButton: _sfc_main$d,
1621
- SolInput: _sfc_main$c,
1622
- SolTextarea: _sfc_main$9,
1623
- SolTextfield: _sfc_main$b,
1624
- SolTextfieldPassword: _sfc_main$a,
1625
- SolRadio: _sfc_main$8,
1626
- SolRadioGroup: _sfc_main$7,
1627
- SolCheckbox: _sfc_main$6,
1628
- SolCheckboxGroup: _sfc_main$5,
1629
- SolSwitch: _sfc_main$4,
1630
- SolDropdown: _sfc_main$3,
1631
- SolSelect: _sfc_main$1,
1632
- SolChip: _sfc_main$2
1657
+ const Ce = {
1658
+ SolButton: de,
1659
+ SolInput: F,
1660
+ SolTextarea: re,
1661
+ SolTextfield: ne,
1662
+ SolTextfieldPassword: ce,
1663
+ SolRadio: ie,
1664
+ SolRadioGroup: ue,
1665
+ SolCheckbox: ae,
1666
+ SolCheckboxGroup: he,
1667
+ SolSwitch: fe,
1668
+ SolDropdown: ve,
1669
+ SolSelect: be,
1670
+ SolChip: oe,
1671
+ SolAccordion: ye
1633
1672
  };
1634
- function install(App) {
1635
- for (const component in components) {
1636
- App.component(component, components[component]);
1637
- }
1673
+ function Zl(e) {
1674
+ for (const l in Ce)
1675
+ e.component(l, Ce[l]);
1638
1676
  }
1639
- export { _sfc_main$d as SolButton, _sfc_main$6 as SolCheckbox, _sfc_main$5 as SolCheckboxGroup, _sfc_main$2 as SolChip, _sfc_main$3 as SolDropdown, _sfc_main$c as SolInput, _sfc_main$8 as SolRadio, _sfc_main$7 as SolRadioGroup, _sfc_main$1 as SolSelect, _sfc_main$4 as SolSwitch, _sfc_main$9 as SolTextarea, _sfc_main$b as SolTextfield, _sfc_main$a as SolTextfieldPassword, components, install, useToast };
1677
+ export {
1678
+ ye as SolAccordion,
1679
+ de as SolButton,
1680
+ ae as SolCheckbox,
1681
+ he as SolCheckboxGroup,
1682
+ oe as SolChip,
1683
+ ve as SolDropdown,
1684
+ F as SolInput,
1685
+ ie as SolRadio,
1686
+ ue as SolRadioGroup,
1687
+ be as SolSelect,
1688
+ fe as SolSwitch,
1689
+ re as SolTextarea,
1690
+ ne as SolTextfield,
1691
+ ce as SolTextfieldPassword,
1692
+ Ce as components,
1693
+ Zl as install,
1694
+ Xl as useToast
1695
+ };