@solfacil/girassol 0.1.3 → 0.1.7
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.
- package/.vscode/extensions.json +4 -2
- package/.vscode/settings.json +9 -0
- package/README.md +1 -1
- package/cli/package.json +2 -12
- package/cli/src/commands/create:component.ts +91 -0
- package/cli/src/commands/generate:plugin.ts +1 -1
- package/cli/src/commands/generate:types.ts +1 -1
- package/cli/src/commands/girassol.ts +1 -1
- package/cli/src/extensions/cli-extension.ts +1 -1
- package/cli/src/templates/components/component.spec.ts.ejs +20 -0
- package/cli/src/templates/components/component.stories.mdx.ejs +74 -0
- package/cli/src/templates/components/component.vue.ejs +23 -0
- package/cli/src/templates/components/index.ts.ejs +10 -0
- package/cli/yarn.lock +31 -2860
- package/dist/girassol.es.js +1119 -136
- package/dist/girassol.umd.js +5 -5
- package/dist/style.css +1 -1
- package/dist/theme/solfacil/colors.d.ts +2 -2
- package/dist/theme/solfacil/index.d.ts +3 -0
- package/dist/theme/solfacil/utilities.d.ts +3 -0
- package/dist/types/components/dropdown/Dropdown.vue.d.ts +77 -0
- package/dist/types/components/dropdown/dropdown.spec.d.ts +1 -0
- package/dist/types/components/dropdown/index.d.ts +2 -0
- package/dist/types/components/forms/button/Button.vue.d.ts +4 -4
- package/dist/types/components/forms/checkbox/CheckboxGroup.vue.d.ts +2 -2
- package/dist/types/components/forms/checkbox/checkbox-type.d.ts +2 -2
- package/dist/types/components/forms/checkbox/index.d.ts +1 -1
- package/dist/types/components/forms/input/Input.vue.d.ts +3 -1
- package/dist/types/components/forms/input/index.d.ts +1 -1
- package/dist/types/components/forms/radio/RadioGroup.vue.d.ts +2 -2
- package/dist/types/components/forms/radio/index.d.ts +1 -1
- package/dist/types/components/forms/radio/radio-type.d.ts +2 -2
- package/dist/types/components/forms/select/Select.vue.d.ts +53 -0
- package/dist/types/components/forms/select/index.d.ts +2 -0
- package/dist/types/components/forms/select/select.spec.d.ts +1 -0
- package/dist/types/components/forms/switch/index.d.ts +1 -1
- package/dist/types/components/forms/textarea/Textarea.vue.d.ts +50 -0
- package/dist/types/components/forms/textarea/index.d.ts +2 -0
- package/dist/types/components/forms/textarea/textarea.spec.d.ts +1 -0
- package/dist/types/components/forms/textfield/Textfield.vue.d.ts +5 -5
- package/dist/types/components/forms/textfield/index.d.ts +1 -1
- package/dist/types/composables/use-toast/Toast.vue.d.ts +66 -0
- package/dist/types/composables/use-toast/index.d.ts +9 -0
- package/dist/types/composables/use-toast/types.d.ts +23 -0
- package/dist/types/composables/use-toast/use-toast.spec.d.ts +1 -0
- package/dist/types/composables/use-toast/useTimer.d.ts +9 -0
- package/dist/types/composables/use-toast/useTransition.d.ts +57 -0
- package/dist/types/index.d.ts +5 -1
- package/dist/vite.config.d.ts +1 -1
- package/dist/windi.config.d.ts +1 -1
- package/package.json +67 -35
- package/theme/solfacil/borders.ts +2 -2
- package/theme/solfacil/colors.ts +4 -4
- package/theme/solfacil/effects.ts +3 -3
- package/theme/solfacil/index.ts +5 -2
- package/theme/solfacil/miscs.ts +2 -2
- package/theme/solfacil/spacing.ts +1 -1
- package/theme/solfacil/typography.ts +2 -2
- package/theme/solfacil/utilities.ts +88 -3
- package/vite.config.ts +16 -4
- package/windi.config.ts +7 -4
- package/cli/__tests__/cli-integration.test.ts +0 -29
package/dist/girassol.es.js
CHANGED
|
@@ -1,9 +1,29 @@
|
|
|
1
|
-
|
|
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";
|
|
2
21
|
var Button_vue_vue_type_style_index_0_lang = "";
|
|
3
|
-
const _hoisted_1$
|
|
4
|
-
const _hoisted_2$
|
|
5
|
-
const _hoisted_3$
|
|
6
|
-
const _sfc_main$
|
|
22
|
+
const _hoisted_1$k = ["data-testid"];
|
|
23
|
+
const _hoisted_2$i = { class: "icon -left" };
|
|
24
|
+
const _hoisted_3$g = { class: "icon -right" };
|
|
25
|
+
const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
26
|
+
name: "Button",
|
|
7
27
|
props: {
|
|
8
28
|
variant: { default: "primary" },
|
|
9
29
|
dense: { type: Boolean, default: false },
|
|
@@ -27,23 +47,24 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
27
47
|
`]),
|
|
28
48
|
type: "button"
|
|
29
49
|
}, [
|
|
30
|
-
createElementVNode("div", _hoisted_2$
|
|
50
|
+
createElementVNode("div", _hoisted_2$i, [
|
|
31
51
|
renderSlot(_ctx.$slots, "icon-left")
|
|
32
52
|
]),
|
|
33
53
|
renderSlot(_ctx.$slots, "default"),
|
|
34
|
-
createElementVNode("div", _hoisted_3$
|
|
54
|
+
createElementVNode("div", _hoisted_3$g, [
|
|
35
55
|
renderSlot(_ctx.$slots, "icon-right")
|
|
36
56
|
])
|
|
37
|
-
], 10, _hoisted_1$
|
|
57
|
+
], 10, _hoisted_1$k);
|
|
38
58
|
};
|
|
39
59
|
}
|
|
40
60
|
});
|
|
41
|
-
_sfc_main$
|
|
42
|
-
app.component("SolButton", _sfc_main$
|
|
61
|
+
_sfc_main$c.install = (app) => {
|
|
62
|
+
app.component("SolButton", _sfc_main$c);
|
|
43
63
|
};
|
|
44
64
|
var Input_vue_vue_type_style_index_0_lang = "";
|
|
45
|
-
const _hoisted_1$
|
|
46
|
-
const _sfc_main$
|
|
65
|
+
const _hoisted_1$j = ["id", "data-testid", "value"];
|
|
66
|
+
const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
67
|
+
name: "Input",
|
|
47
68
|
props: {
|
|
48
69
|
id: null,
|
|
49
70
|
modelValue: null,
|
|
@@ -51,32 +72,39 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
51
72
|
error: { type: Boolean }
|
|
52
73
|
},
|
|
53
74
|
emits: ["update:modelValue"],
|
|
54
|
-
setup(__props, { emit }) {
|
|
75
|
+
setup(__props, { expose, emit }) {
|
|
55
76
|
function emitInput({ target }) {
|
|
56
|
-
|
|
57
|
-
emit("update:modelValue", value);
|
|
77
|
+
var _a2;
|
|
78
|
+
emit("update:modelValue", (_a2 = target == null ? void 0 : target.value) != null ? _a2 : "");
|
|
58
79
|
}
|
|
80
|
+
const input = ref("");
|
|
81
|
+
expose({
|
|
82
|
+
input
|
|
83
|
+
});
|
|
59
84
|
return (_ctx, _cache) => {
|
|
60
85
|
return openBlock(), createElementBlock("input", {
|
|
61
86
|
id: `input-${__props.id}`,
|
|
87
|
+
ref_key: "input",
|
|
88
|
+
ref: input,
|
|
62
89
|
"data-testid": `input-${__props.id}`,
|
|
63
90
|
value: __props.modelValue,
|
|
64
91
|
class: normalizeClass(["sol-input-core", { "-invert": __props.invert, "-error": __props.error }]),
|
|
65
92
|
onInput: emitInput
|
|
66
|
-
}, null, 42, _hoisted_1$
|
|
93
|
+
}, null, 42, _hoisted_1$j);
|
|
67
94
|
};
|
|
68
95
|
}
|
|
69
96
|
});
|
|
70
|
-
_sfc_main$
|
|
71
|
-
app.component("SolInput", _sfc_main$
|
|
97
|
+
_sfc_main$b.install = (app) => {
|
|
98
|
+
app.component("SolInput", _sfc_main$b);
|
|
72
99
|
};
|
|
73
100
|
var Textfield_vue_vue_type_style_index_0_lang = "";
|
|
74
|
-
const _hoisted_1$
|
|
75
|
-
const _hoisted_2$
|
|
76
|
-
const _hoisted_3$
|
|
77
|
-
const _hoisted_4$
|
|
78
|
-
const _hoisted_5 = ["id"];
|
|
79
|
-
const _sfc_main$
|
|
101
|
+
const _hoisted_1$i = ["id", "data-testid"];
|
|
102
|
+
const _hoisted_2$h = ["for"];
|
|
103
|
+
const _hoisted_3$f = { class: "container-input" };
|
|
104
|
+
const _hoisted_4$6 = ["id"];
|
|
105
|
+
const _hoisted_5$3 = ["id"];
|
|
106
|
+
const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
107
|
+
name: "Textfield",
|
|
80
108
|
props: {
|
|
81
109
|
id: null,
|
|
82
110
|
class: null,
|
|
@@ -106,11 +134,11 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
106
134
|
return null;
|
|
107
135
|
}
|
|
108
136
|
return (_ctx, _cache) => {
|
|
109
|
-
var
|
|
137
|
+
var _a2;
|
|
110
138
|
return openBlock(), createElementBlock("div", {
|
|
111
139
|
id: `textfield-${__props.id}`,
|
|
112
140
|
"data-testid": `textfield-${__props.id}`,
|
|
113
|
-
class: normalizeClass([[`${(
|
|
141
|
+
class: normalizeClass([[`${(_a2 = _ctx.$props.class) != null ? _a2 : ""}`, { "-invert": __props.invert }], "sol-textfield-core"])
|
|
114
142
|
}, [
|
|
115
143
|
renderSlot(_ctx.$slots, "label", {}, () => [
|
|
116
144
|
__props.label ? (openBlock(), createElementBlock("label", {
|
|
@@ -119,20 +147,20 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
119
147
|
class: "label"
|
|
120
148
|
}, [
|
|
121
149
|
createElementVNode("span", null, toDisplayString(__props.label), 1)
|
|
122
|
-
], 8, _hoisted_2$
|
|
150
|
+
], 8, _hoisted_2$h)) : createCommentVNode("", true)
|
|
123
151
|
]),
|
|
124
|
-
createElementVNode("div", _hoisted_3$
|
|
152
|
+
createElementVNode("div", _hoisted_3$f, [
|
|
125
153
|
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
126
|
-
createVNode(_sfc_main$
|
|
154
|
+
createVNode(_sfc_main$b, mergeProps(_ctx.$attrs, {
|
|
155
|
+
id: __props.id,
|
|
127
156
|
modelValue: unref(model),
|
|
128
157
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(model) ? model.value = $event : null),
|
|
129
|
-
id: __props.id,
|
|
130
158
|
"data-testid": `input-${__props.id}`,
|
|
131
159
|
class: [__props.error && "-error", "input"],
|
|
132
160
|
invert: __props.invert,
|
|
133
161
|
"aria-invalid": !!__props.error,
|
|
134
162
|
"aria-describedby": ariaDescribedby(__props.hint, __props.error)
|
|
135
|
-
}), null, 16, ["
|
|
163
|
+
}), null, 16, ["id", "modelValue", "data-testid", "class", "invert", "aria-invalid", "aria-describedby"])
|
|
136
164
|
]),
|
|
137
165
|
renderSlot(_ctx.$slots, "icon")
|
|
138
166
|
]),
|
|
@@ -140,51 +168,52 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
140
168
|
key: 0,
|
|
141
169
|
id: `hint-${__props.id}`,
|
|
142
170
|
class: "hint"
|
|
143
|
-
}, toDisplayString(__props.hint), 9, _hoisted_4$
|
|
171
|
+
}, toDisplayString(__props.hint), 9, _hoisted_4$6)) : __props.error ? (openBlock(), createElementBlock("span", {
|
|
144
172
|
key: 1,
|
|
145
173
|
id: `error-${__props.id}`,
|
|
146
174
|
class: "error"
|
|
147
|
-
}, toDisplayString(__props.error), 9, _hoisted_5)) : createCommentVNode("", true)
|
|
148
|
-
], 10, _hoisted_1$
|
|
175
|
+
}, toDisplayString(__props.error), 9, _hoisted_5$3)) : createCommentVNode("", true)
|
|
176
|
+
], 10, _hoisted_1$i);
|
|
149
177
|
};
|
|
150
178
|
}
|
|
151
179
|
});
|
|
152
|
-
const _hoisted_1$
|
|
180
|
+
const _hoisted_1$h = {
|
|
153
181
|
preserveAspectRatio: "xMidYMid meet",
|
|
154
182
|
viewBox: "0 0 24 24",
|
|
155
183
|
width: "1.2em",
|
|
156
184
|
height: "1.2em"
|
|
157
185
|
};
|
|
158
|
-
const _hoisted_2$
|
|
186
|
+
const _hoisted_2$g = /* @__PURE__ */ createElementVNode("g", { fill: "currentColor" }, [
|
|
159
187
|
/* @__PURE__ */ createElementVNode("path", { d: "M15 12a3 3 0 1 1-6 0a3 3 0 0 1 6 0z" }),
|
|
160
188
|
/* @__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" })
|
|
161
189
|
], -1);
|
|
162
|
-
const _hoisted_3$
|
|
163
|
-
_hoisted_2$
|
|
190
|
+
const _hoisted_3$e = [
|
|
191
|
+
_hoisted_2$g
|
|
164
192
|
];
|
|
165
|
-
function render$
|
|
166
|
-
return openBlock(), createElementBlock("svg", _hoisted_1$
|
|
193
|
+
function render$7(_ctx, _cache) {
|
|
194
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$h, _hoisted_3$e);
|
|
167
195
|
}
|
|
168
|
-
var EyeOn = { name: "mi-eye", render: render$
|
|
169
|
-
const _hoisted_1$
|
|
196
|
+
var EyeOn = { name: "mi-eye", render: render$7 };
|
|
197
|
+
const _hoisted_1$g = {
|
|
170
198
|
preserveAspectRatio: "xMidYMid meet",
|
|
171
199
|
viewBox: "0 0 24 24",
|
|
172
200
|
width: "1.2em",
|
|
173
201
|
height: "1.2em"
|
|
174
202
|
};
|
|
175
|
-
const _hoisted_2$
|
|
203
|
+
const _hoisted_2$f = /* @__PURE__ */ createElementVNode("path", {
|
|
176
204
|
fill: "currentColor",
|
|
177
205
|
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"
|
|
178
206
|
}, null, -1);
|
|
179
|
-
const _hoisted_3$
|
|
180
|
-
_hoisted_2$
|
|
207
|
+
const _hoisted_3$d = [
|
|
208
|
+
_hoisted_2$f
|
|
181
209
|
];
|
|
182
|
-
function render(_ctx, _cache) {
|
|
183
|
-
return openBlock(), createElementBlock("svg", _hoisted_1$
|
|
210
|
+
function render$6(_ctx, _cache) {
|
|
211
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$g, _hoisted_3$d);
|
|
184
212
|
}
|
|
185
|
-
var EyeOff = { name: "mi-eye-off", render };
|
|
186
|
-
const _hoisted_1$
|
|
187
|
-
const _sfc_main$
|
|
213
|
+
var EyeOff = { name: "mi-eye-off", render: render$6 };
|
|
214
|
+
const _hoisted_1$f = ["aria-label"];
|
|
215
|
+
const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
216
|
+
name: "TextfieldPassword",
|
|
188
217
|
props: {
|
|
189
218
|
id: { default: "" },
|
|
190
219
|
label: { default: "Sua senha" }
|
|
@@ -193,7 +222,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
193
222
|
const passwordIsVisible = ref(false);
|
|
194
223
|
const inputType = computed(() => passwordIsVisible.value ? "text" : "password");
|
|
195
224
|
return (_ctx, _cache) => {
|
|
196
|
-
return openBlock(), createBlock(_sfc_main$
|
|
225
|
+
return openBlock(), createBlock(_sfc_main$a, {
|
|
197
226
|
id: __props.id,
|
|
198
227
|
required: "",
|
|
199
228
|
type: unref(inputType),
|
|
@@ -213,23 +242,110 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
213
242
|
withDirectives(createVNode(unref(EyeOff), { "aria-hidden": "true" }, null, 512), [
|
|
214
243
|
[vShow, !passwordIsVisible.value]
|
|
215
244
|
])
|
|
216
|
-
], 8, _hoisted_1$
|
|
245
|
+
], 8, _hoisted_1$f)
|
|
217
246
|
]),
|
|
218
247
|
_: 1
|
|
219
248
|
}, 8, ["id", "type", "label"]);
|
|
220
249
|
};
|
|
221
250
|
}
|
|
222
251
|
});
|
|
223
|
-
_sfc_main$
|
|
224
|
-
app.component("SolTextfield", _sfc_main$
|
|
252
|
+
_sfc_main$a.install = (app) => {
|
|
253
|
+
app.component("SolTextfield", _sfc_main$a);
|
|
225
254
|
};
|
|
226
|
-
_sfc_main$
|
|
227
|
-
app.component("SolTextfieldPassword", _sfc_main$
|
|
255
|
+
_sfc_main$9.install = (app) => {
|
|
256
|
+
app.component("SolTextfieldPassword", _sfc_main$9);
|
|
257
|
+
};
|
|
258
|
+
var Textarea_vue_vue_type_style_index_0_lang = "";
|
|
259
|
+
const _hoisted_1$e = ["id", "data-testid"];
|
|
260
|
+
const _hoisted_2$e = ["for"];
|
|
261
|
+
const _hoisted_3$c = { class: "container-textarea" };
|
|
262
|
+
const _hoisted_4$5 = ["id", "data-testid", "invert", "aria-invalid", "aria-describedby"];
|
|
263
|
+
const _hoisted_5$2 = ["id"];
|
|
264
|
+
const _hoisted_6$2 = ["id"];
|
|
265
|
+
const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
266
|
+
name: "Textarea",
|
|
267
|
+
props: {
|
|
268
|
+
id: null,
|
|
269
|
+
class: null,
|
|
270
|
+
modelValue: { default: "" },
|
|
271
|
+
label: { default: "label" },
|
|
272
|
+
hint: null,
|
|
273
|
+
invert: { type: Boolean },
|
|
274
|
+
resize: { default: "both" },
|
|
275
|
+
error: null
|
|
276
|
+
},
|
|
277
|
+
emits: ["update:modelValue"],
|
|
278
|
+
setup(__props, { emit }) {
|
|
279
|
+
const props = __props;
|
|
280
|
+
const model = computed({
|
|
281
|
+
get: () => props.modelValue,
|
|
282
|
+
set: (inputValue) => {
|
|
283
|
+
emit("update:modelValue", inputValue);
|
|
284
|
+
}
|
|
285
|
+
});
|
|
286
|
+
function showHint(hint, error) {
|
|
287
|
+
return !!hint && !error;
|
|
288
|
+
}
|
|
289
|
+
function ariaDescribedby(hint, error) {
|
|
290
|
+
if (error)
|
|
291
|
+
return `error-${props.id}`;
|
|
292
|
+
if (showHint(hint, error))
|
|
293
|
+
return `hint-${props.id}`;
|
|
294
|
+
return null;
|
|
295
|
+
}
|
|
296
|
+
return (_ctx, _cache) => {
|
|
297
|
+
var _a2;
|
|
298
|
+
return openBlock(), createElementBlock("div", {
|
|
299
|
+
id: `textarea-${__props.id}`,
|
|
300
|
+
"data-testid": `textarea-${__props.id}`,
|
|
301
|
+
class: normalizeClass([[`${(_a2 = _ctx.$props.class) != null ? _a2 : ""}`, { "-invert": __props.invert }], "sol-textarea-core"])
|
|
302
|
+
}, [
|
|
303
|
+
renderSlot(_ctx.$slots, "label", {}, () => [
|
|
304
|
+
__props.label ? (openBlock(), createElementBlock("label", {
|
|
305
|
+
key: 0,
|
|
306
|
+
for: `input-${__props.id}`,
|
|
307
|
+
class: "label"
|
|
308
|
+
}, [
|
|
309
|
+
createElementVNode("span", null, toDisplayString(__props.label), 1)
|
|
310
|
+
], 8, _hoisted_2$e)) : createCommentVNode("", true)
|
|
311
|
+
]),
|
|
312
|
+
createElementVNode("div", _hoisted_3$c, [
|
|
313
|
+
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
314
|
+
withDirectives(createElementVNode("textarea", mergeProps(_ctx.$attrs, {
|
|
315
|
+
id: `input-${__props.id}`,
|
|
316
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(model) ? model.value = $event : null),
|
|
317
|
+
"data-testid": `input-${__props.id}`,
|
|
318
|
+
class: [__props.error && "-error", "textarea"],
|
|
319
|
+
invert: __props.invert,
|
|
320
|
+
style: { resize: __props.resize },
|
|
321
|
+
"aria-invalid": !!__props.error,
|
|
322
|
+
"aria-describedby": ariaDescribedby(__props.hint, __props.error)
|
|
323
|
+
}), null, 16, _hoisted_4$5), [
|
|
324
|
+
[vModelText, unref(model)]
|
|
325
|
+
])
|
|
326
|
+
])
|
|
327
|
+
]),
|
|
328
|
+
showHint(__props.hint, __props.error) ? (openBlock(), createElementBlock("span", {
|
|
329
|
+
key: 0,
|
|
330
|
+
id: `hint-${__props.id}`,
|
|
331
|
+
class: "hint"
|
|
332
|
+
}, toDisplayString(__props.hint), 9, _hoisted_5$2)) : __props.error ? (openBlock(), createElementBlock("span", {
|
|
333
|
+
key: 1,
|
|
334
|
+
id: `error-${__props.id}`,
|
|
335
|
+
class: "error"
|
|
336
|
+
}, toDisplayString(__props.error), 9, _hoisted_6$2)) : createCommentVNode("", true)
|
|
337
|
+
], 10, _hoisted_1$e);
|
|
338
|
+
};
|
|
339
|
+
}
|
|
340
|
+
});
|
|
341
|
+
_sfc_main$8.install = (app) => {
|
|
342
|
+
app.component("SolTextarea", _sfc_main$8);
|
|
228
343
|
};
|
|
229
344
|
var Radio_vue_vue_type_style_index_0_lang = "";
|
|
230
|
-
const _hoisted_1$
|
|
231
|
-
const _hoisted_2$
|
|
232
|
-
const _sfc_main$
|
|
345
|
+
const _hoisted_1$d = ["id", "data-testid", "checked", "value", "name"];
|
|
346
|
+
const _hoisted_2$d = ["for"];
|
|
347
|
+
const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
348
|
+
name: "Radio",
|
|
233
349
|
props: {
|
|
234
350
|
id: null,
|
|
235
351
|
name: null,
|
|
@@ -242,32 +358,33 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
242
358
|
setup(__props, { emit }) {
|
|
243
359
|
return (_ctx, _cache) => {
|
|
244
360
|
return openBlock(), createElementBlock("div", {
|
|
245
|
-
class: normalizeClass(["sol-radio-core",
|
|
361
|
+
class: normalizeClass(["sol-radio-core", _ctx.$props.class])
|
|
246
362
|
}, [
|
|
247
363
|
createElementVNode("input", mergeProps(_ctx.$attrs, {
|
|
364
|
+
id: `radio-${__props.name}-${__props.id}`,
|
|
248
365
|
type: "radio",
|
|
249
366
|
class: "radio",
|
|
250
|
-
id: `radio-${__props.name}-${__props.id}`,
|
|
251
367
|
"data-testid": `radio-${__props.name}-${__props.id}`,
|
|
252
368
|
checked: __props.checked,
|
|
253
369
|
value: __props.value,
|
|
254
370
|
name: __props.name,
|
|
255
371
|
onChange: _cache[0] || (_cache[0] = ($event) => emit("change", __props.value))
|
|
256
|
-
}), null, 16, _hoisted_1$
|
|
372
|
+
}), null, 16, _hoisted_1$d),
|
|
257
373
|
createElementVNode("label", {
|
|
258
374
|
class: "label",
|
|
259
375
|
for: `radio-${__props.name}-${__props.id}`
|
|
260
|
-
}, toDisplayString(__props.label), 9, _hoisted_2$
|
|
376
|
+
}, toDisplayString(__props.label), 9, _hoisted_2$d)
|
|
261
377
|
], 2);
|
|
262
378
|
};
|
|
263
379
|
}
|
|
264
380
|
});
|
|
265
381
|
var RadioGroup_vue_vue_type_style_index_0_lang = "";
|
|
266
|
-
const _hoisted_1$
|
|
267
|
-
const _hoisted_2$
|
|
268
|
-
const _hoisted_3$
|
|
269
|
-
const _hoisted_4$
|
|
270
|
-
const _sfc_main$
|
|
382
|
+
const _hoisted_1$c = ["aria-labelledby"];
|
|
383
|
+
const _hoisted_2$c = ["id", "data-testid"];
|
|
384
|
+
const _hoisted_3$b = ["id"];
|
|
385
|
+
const _hoisted_4$4 = ["id"];
|
|
386
|
+
const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
387
|
+
name: "RadioGroup",
|
|
271
388
|
props: {
|
|
272
389
|
id: null,
|
|
273
390
|
title: null,
|
|
@@ -307,10 +424,10 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
307
424
|
id: `radio-group-title-${__props.id}`
|
|
308
425
|
}, () => [
|
|
309
426
|
createElementVNode("legend", {
|
|
310
|
-
class: normalizeClass(["title", { "sr-only": __props.hideTitle }]),
|
|
311
427
|
id: `radio-group-title-${__props.id}`,
|
|
428
|
+
class: normalizeClass(["title", { "sr-only": __props.hideTitle }]),
|
|
312
429
|
"data-testid": `radio-group-title-${__props.id}`
|
|
313
|
-
}, toDisplayString(__props.title), 11, _hoisted_2$
|
|
430
|
+
}, toDisplayString(__props.title), 11, _hoisted_2$c)
|
|
314
431
|
]),
|
|
315
432
|
createElementVNode("ul", {
|
|
316
433
|
class: normalizeClass(["container-radios", { "flex-col": __props.direction === "column" }])
|
|
@@ -320,11 +437,11 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
320
437
|
direction: __props.direction
|
|
321
438
|
}, () => [
|
|
322
439
|
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.radios, (radio, index) => {
|
|
323
|
-
var
|
|
440
|
+
var _a2;
|
|
324
441
|
return openBlock(), createElementBlock("li", { key: index }, [
|
|
325
|
-
createVNode(_sfc_main$
|
|
442
|
+
createVNode(_sfc_main$7, mergeProps(_ctx.$attrs, {
|
|
443
|
+
id: (_a2 = radio == null ? void 0 : radio.id) != null ? _a2 : `${radio.value}`,
|
|
326
444
|
class: ["radio", { "mb-micro": __props.direction === "column", "mr-micro": __props.direction === "row" }],
|
|
327
|
-
id: (_a = radio == null ? void 0 : radio.id) != null ? _a : `${radio.value}`,
|
|
328
445
|
name: radio.name,
|
|
329
446
|
value: radio.value,
|
|
330
447
|
label: radio.label,
|
|
@@ -332,7 +449,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
332
449
|
"aria-invalid": !!__props.error,
|
|
333
450
|
"aria-describedby": ariaDescribedby(__props.hint, __props.error),
|
|
334
451
|
onChange: ($event) => emitUpdatedValue(radio)
|
|
335
|
-
}), null, 16, ["
|
|
452
|
+
}), null, 16, ["id", "class", "name", "value", "label", "checked", "aria-invalid", "aria-describedby", "onChange"])
|
|
336
453
|
]);
|
|
337
454
|
}), 128))
|
|
338
455
|
])
|
|
@@ -341,25 +458,26 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
341
458
|
key: 0,
|
|
342
459
|
id: `hint-${__props.id}`,
|
|
343
460
|
class: "hint"
|
|
344
|
-
}, toDisplayString(__props.hint), 9, _hoisted_3$
|
|
461
|
+
}, toDisplayString(__props.hint), 9, _hoisted_3$b)) : __props.error ? (openBlock(), createElementBlock("p", {
|
|
345
462
|
key: 1,
|
|
346
463
|
id: `error-${__props.id}`,
|
|
347
464
|
class: "error"
|
|
348
|
-
}, toDisplayString(__props.error), 9, _hoisted_4$
|
|
349
|
-
], 8, _hoisted_1$
|
|
465
|
+
}, toDisplayString(__props.error), 9, _hoisted_4$4)) : createCommentVNode("", true)
|
|
466
|
+
], 8, _hoisted_1$c);
|
|
350
467
|
};
|
|
351
468
|
}
|
|
352
469
|
});
|
|
353
|
-
_sfc_main$
|
|
354
|
-
app.component("SolRadio", _sfc_main$
|
|
470
|
+
_sfc_main$7.install = (app) => {
|
|
471
|
+
app.component("SolRadio", _sfc_main$7);
|
|
355
472
|
};
|
|
356
|
-
_sfc_main$
|
|
357
|
-
app.component("SolRadioGroup", _sfc_main$
|
|
473
|
+
_sfc_main$6.install = (app) => {
|
|
474
|
+
app.component("SolRadioGroup", _sfc_main$6);
|
|
358
475
|
};
|
|
359
476
|
var Checkbox_vue_vue_type_style_index_0_lang = "";
|
|
360
|
-
const _hoisted_1$
|
|
361
|
-
const _hoisted_2$
|
|
362
|
-
const _sfc_main$
|
|
477
|
+
const _hoisted_1$b = ["id", "data-testid", "checked", "value", "name"];
|
|
478
|
+
const _hoisted_2$b = ["for"];
|
|
479
|
+
const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
480
|
+
name: "Checkbox",
|
|
363
481
|
props: {
|
|
364
482
|
id: null,
|
|
365
483
|
name: null,
|
|
@@ -372,32 +490,33 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
372
490
|
setup(__props, { emit }) {
|
|
373
491
|
return (_ctx, _cache) => {
|
|
374
492
|
return openBlock(), createElementBlock("div", {
|
|
375
|
-
class: normalizeClass(["sol-checkbox-core",
|
|
493
|
+
class: normalizeClass(["sol-checkbox-core", _ctx.$props.class])
|
|
376
494
|
}, [
|
|
377
495
|
createElementVNode("input", mergeProps(_ctx.$attrs, {
|
|
496
|
+
id: `checkbox-${__props.name}-${__props.id}`,
|
|
378
497
|
type: "checkbox",
|
|
379
498
|
class: "checkbox",
|
|
380
|
-
id: `checkbox-${__props.name}-${__props.id}`,
|
|
381
499
|
"data-testid": `checkbox-${__props.name}-${__props.id}`,
|
|
382
500
|
checked: __props.checked,
|
|
383
501
|
value: __props.value,
|
|
384
502
|
name: __props.name,
|
|
385
503
|
onChange: _cache[0] || (_cache[0] = ($event) => emit("change", __props.value))
|
|
386
|
-
}), null, 16, _hoisted_1$
|
|
504
|
+
}), null, 16, _hoisted_1$b),
|
|
387
505
|
createElementVNode("label", {
|
|
388
506
|
class: "label",
|
|
389
507
|
for: `checkbox-${__props.name}-${__props.id}`
|
|
390
|
-
}, toDisplayString(__props.label), 9, _hoisted_2$
|
|
508
|
+
}, toDisplayString(__props.label), 9, _hoisted_2$b)
|
|
391
509
|
], 2);
|
|
392
510
|
};
|
|
393
511
|
}
|
|
394
512
|
});
|
|
395
513
|
var CheckboxGroup_vue_vue_type_style_index_0_lang = "";
|
|
396
|
-
const _hoisted_1$
|
|
397
|
-
const _hoisted_2$
|
|
398
|
-
const _hoisted_3$
|
|
399
|
-
const _hoisted_4$
|
|
400
|
-
const _sfc_main$
|
|
514
|
+
const _hoisted_1$a = ["aria-labelledby"];
|
|
515
|
+
const _hoisted_2$a = ["id", "data-testid"];
|
|
516
|
+
const _hoisted_3$a = ["id"];
|
|
517
|
+
const _hoisted_4$3 = ["id"];
|
|
518
|
+
const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
519
|
+
name: "CheckboxGroup",
|
|
401
520
|
props: {
|
|
402
521
|
id: null,
|
|
403
522
|
title: null,
|
|
@@ -422,21 +541,20 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
422
541
|
return null;
|
|
423
542
|
}
|
|
424
543
|
function isChecked(value) {
|
|
425
|
-
var
|
|
426
|
-
return (
|
|
544
|
+
var _a2;
|
|
545
|
+
return (_a2 = props == null ? void 0 : props.modelValue) == null ? void 0 : _a2.includes(value);
|
|
427
546
|
}
|
|
428
547
|
function sanitizeNewModelValue(value) {
|
|
429
548
|
return Array.isArray(props == null ? void 0 : props.modelValue) ? [...props.modelValue, value] : [value];
|
|
430
549
|
}
|
|
431
550
|
function emitUpdatedValue(checkbox) {
|
|
432
|
-
var
|
|
551
|
+
var _a2;
|
|
433
552
|
emit("change", checkbox.value);
|
|
434
|
-
const checked = isChecked(checkbox.value) ? (
|
|
553
|
+
const checked = isChecked(checkbox.value) ? (_a2 = props.modelValue) == null ? void 0 : _a2.filter((value) => value !== checkbox.value) : sanitizeNewModelValue(checkbox.value);
|
|
435
554
|
emit("update:modelValue", checked);
|
|
436
555
|
}
|
|
437
556
|
return (_ctx, _cache) => {
|
|
438
557
|
return openBlock(), createElementBlock("fieldset", {
|
|
439
|
-
role: "group",
|
|
440
558
|
class: "sol-checkbox-group-core",
|
|
441
559
|
"aria-labelledby": `checkbox-group-title-${__props.id}`
|
|
442
560
|
}, [
|
|
@@ -444,10 +562,10 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
444
562
|
id: `checkbox-group-title-${__props.id}`
|
|
445
563
|
}, () => [
|
|
446
564
|
createElementVNode("legend", {
|
|
447
|
-
class: normalizeClass(["title", { "sr-only": __props.hideTitle }]),
|
|
448
565
|
id: `checkbox-group-title-${__props.id}`,
|
|
566
|
+
class: normalizeClass(["title", { "sr-only": __props.hideTitle }]),
|
|
449
567
|
"data-testid": `checkbox-group-title-${__props.id}`
|
|
450
|
-
}, toDisplayString(__props.title), 11, _hoisted_2$
|
|
568
|
+
}, toDisplayString(__props.title), 11, _hoisted_2$a)
|
|
451
569
|
]),
|
|
452
570
|
createElementVNode("ul", {
|
|
453
571
|
class: normalizeClass(["container-checkboxes", { "flex-col": __props.direction === "column" }])
|
|
@@ -457,11 +575,11 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
457
575
|
direction: __props.direction
|
|
458
576
|
}, () => [
|
|
459
577
|
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.checkboxes, (checkbox, index) => {
|
|
460
|
-
var
|
|
578
|
+
var _a2;
|
|
461
579
|
return openBlock(), createElementBlock("li", { key: index }, [
|
|
462
|
-
createVNode(_sfc_main$
|
|
580
|
+
createVNode(_sfc_main$5, mergeProps(_ctx.$attrs, {
|
|
581
|
+
id: (_a2 = checkbox == null ? void 0 : checkbox.id) != null ? _a2 : `${checkbox.value}`,
|
|
463
582
|
class: ["checkbox", { "mb-micro": __props.direction === "column", "mr-micro": __props.direction === "row" }],
|
|
464
|
-
id: (_a = checkbox == null ? void 0 : checkbox.id) != null ? _a : `${checkbox.value}`,
|
|
465
583
|
label: checkbox.label,
|
|
466
584
|
name: checkbox.name,
|
|
467
585
|
value: checkbox.value,
|
|
@@ -469,7 +587,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
469
587
|
"aria-invalid": !!__props.error,
|
|
470
588
|
"aria-describedby": ariaDescribedby(__props.hint, __props.error),
|
|
471
589
|
onChange: ($event) => emitUpdatedValue(checkbox)
|
|
472
|
-
}), null, 16, ["
|
|
590
|
+
}), null, 16, ["id", "class", "label", "name", "value", "checked", "aria-invalid", "aria-describedby", "onChange"])
|
|
473
591
|
]);
|
|
474
592
|
}), 128))
|
|
475
593
|
])
|
|
@@ -478,27 +596,28 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
478
596
|
key: 0,
|
|
479
597
|
id: `hint-${__props.id}`,
|
|
480
598
|
class: "hint"
|
|
481
|
-
}, toDisplayString(__props.hint), 9, _hoisted_3$
|
|
599
|
+
}, toDisplayString(__props.hint), 9, _hoisted_3$a)) : __props.error ? (openBlock(), createElementBlock("p", {
|
|
482
600
|
key: 1,
|
|
483
601
|
id: `error-${__props.id}`,
|
|
484
602
|
class: "error"
|
|
485
|
-
}, toDisplayString(__props.error), 9, _hoisted_4$
|
|
486
|
-
], 8, _hoisted_1$
|
|
603
|
+
}, toDisplayString(__props.error), 9, _hoisted_4$3)) : createCommentVNode("", true)
|
|
604
|
+
], 8, _hoisted_1$a);
|
|
487
605
|
};
|
|
488
606
|
}
|
|
489
607
|
});
|
|
490
|
-
_sfc_main$
|
|
491
|
-
app.component("SolCheckbox", _sfc_main$
|
|
608
|
+
_sfc_main$5.install = (app) => {
|
|
609
|
+
app.component("SolCheckbox", _sfc_main$5);
|
|
492
610
|
};
|
|
493
|
-
_sfc_main$
|
|
494
|
-
app.component("SolCheckboxGroup", _sfc_main$
|
|
611
|
+
_sfc_main$4.install = (app) => {
|
|
612
|
+
app.component("SolCheckboxGroup", _sfc_main$4);
|
|
495
613
|
};
|
|
496
614
|
var Switch_vue_vue_type_style_index_0_lang = "";
|
|
497
|
-
const _hoisted_1 = ["
|
|
498
|
-
const _hoisted_2 = { class: "switch-container" };
|
|
499
|
-
const _hoisted_3 = ["id", "aria-labelledby", "data-testid", "checked", "value", "name"];
|
|
500
|
-
const _hoisted_4 = /* @__PURE__ */ createElementVNode("span", { class: "ellipse" }, null, -1);
|
|
501
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
615
|
+
const _hoisted_1$9 = ["id", "for", "data-testid"];
|
|
616
|
+
const _hoisted_2$9 = { class: "switch-container" };
|
|
617
|
+
const _hoisted_3$9 = ["id", "aria-checked", "aria-labelledby", "data-testid", "checked", "value", "name"];
|
|
618
|
+
const _hoisted_4$2 = /* @__PURE__ */ createElementVNode("span", { class: "ellipse" }, null, -1);
|
|
619
|
+
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
620
|
+
name: "Switch",
|
|
502
621
|
props: {
|
|
503
622
|
id: null,
|
|
504
623
|
name: null,
|
|
@@ -516,48 +635,913 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
516
635
|
class: normalizeClass(["sol-switch-core", [_ctx.$props.class, { "-horizontal": __props.horizontalLabel }]])
|
|
517
636
|
}, [
|
|
518
637
|
createElementVNode("label", {
|
|
638
|
+
id: `switch-label-${__props.name}-${__props.id}`,
|
|
519
639
|
class: normalizeClass(["label", { "mb-1": !__props.horizontalLabel, "sr-only": __props.hideLabel }]),
|
|
520
640
|
for: `switch-${__props.name}-${__props.id}`,
|
|
521
|
-
id: `switch-label-${__props.name}-${__props.id}`,
|
|
522
641
|
"data-testid": `switch-label-${__props.name}-${__props.id}`
|
|
523
|
-
}, toDisplayString(__props.label), 11, _hoisted_1),
|
|
524
|
-
createElementVNode("div", _hoisted_2, [
|
|
642
|
+
}, toDisplayString(__props.label), 11, _hoisted_1$9),
|
|
643
|
+
createElementVNode("div", _hoisted_2$9, [
|
|
525
644
|
createElementVNode("input", mergeProps(_ctx.$attrs, {
|
|
645
|
+
id: `switch-${__props.name}-${__props.id}`,
|
|
526
646
|
type: "checkbox",
|
|
527
647
|
class: "switch",
|
|
528
648
|
role: "switch",
|
|
529
|
-
|
|
649
|
+
"aria-checked": __props.checked,
|
|
530
650
|
"aria-labelledby": `switch-label-${__props.name}-${__props.id}`,
|
|
531
651
|
"data-testid": `switch-${__props.name}-${__props.id}`,
|
|
532
652
|
checked: __props.checked,
|
|
533
653
|
value: __props.value,
|
|
534
654
|
name: __props.name,
|
|
535
655
|
onChange: _cache[0] || (_cache[0] = ($event) => emit("change", __props.value))
|
|
536
|
-
}), null, 16, _hoisted_3),
|
|
537
|
-
_hoisted_4
|
|
656
|
+
}), null, 16, _hoisted_3$9),
|
|
657
|
+
_hoisted_4$2
|
|
538
658
|
])
|
|
539
659
|
], 2);
|
|
540
660
|
};
|
|
541
661
|
}
|
|
542
662
|
});
|
|
543
|
-
_sfc_main.install = (app) => {
|
|
544
|
-
app.component("SolSwitch", _sfc_main);
|
|
663
|
+
_sfc_main$3.install = (app) => {
|
|
664
|
+
app.component("SolSwitch", _sfc_main$3);
|
|
665
|
+
};
|
|
666
|
+
function tryOnScopeDispose(fn) {
|
|
667
|
+
if (getCurrentScope()) {
|
|
668
|
+
onScopeDispose(fn);
|
|
669
|
+
return true;
|
|
670
|
+
}
|
|
671
|
+
return false;
|
|
672
|
+
}
|
|
673
|
+
var _a;
|
|
674
|
+
const isClient = typeof window !== "undefined";
|
|
675
|
+
const isString = (val) => typeof val === "string";
|
|
676
|
+
const noop = () => {
|
|
677
|
+
};
|
|
678
|
+
isClient && ((_a = window == null ? void 0 : window.navigator) == null ? void 0 : _a.userAgent) && /iP(ad|hone|od)/.test(window.navigator.userAgent);
|
|
679
|
+
function unrefElement(elRef) {
|
|
680
|
+
var _a2;
|
|
681
|
+
const plain = unref(elRef);
|
|
682
|
+
return (_a2 = plain == null ? void 0 : plain.$el) != null ? _a2 : plain;
|
|
683
|
+
}
|
|
684
|
+
const defaultWindow = isClient ? window : void 0;
|
|
685
|
+
isClient ? window.document : void 0;
|
|
686
|
+
isClient ? window.navigator : void 0;
|
|
687
|
+
isClient ? window.location : void 0;
|
|
688
|
+
function useEventListener(...args) {
|
|
689
|
+
let target;
|
|
690
|
+
let event;
|
|
691
|
+
let listener;
|
|
692
|
+
let options;
|
|
693
|
+
if (isString(args[0])) {
|
|
694
|
+
[event, listener, options] = args;
|
|
695
|
+
target = defaultWindow;
|
|
696
|
+
} else {
|
|
697
|
+
[target, event, listener, options] = args;
|
|
698
|
+
}
|
|
699
|
+
if (!target)
|
|
700
|
+
return noop;
|
|
701
|
+
let cleanup = noop;
|
|
702
|
+
const stopWatch = watch(() => unrefElement(target), (el) => {
|
|
703
|
+
cleanup();
|
|
704
|
+
if (!el)
|
|
705
|
+
return;
|
|
706
|
+
el.addEventListener(event, listener, options);
|
|
707
|
+
cleanup = () => {
|
|
708
|
+
el.removeEventListener(event, listener, options);
|
|
709
|
+
cleanup = noop;
|
|
710
|
+
};
|
|
711
|
+
}, { immediate: true, flush: "post" });
|
|
712
|
+
const stop = () => {
|
|
713
|
+
stopWatch();
|
|
714
|
+
cleanup();
|
|
715
|
+
};
|
|
716
|
+
tryOnScopeDispose(stop);
|
|
717
|
+
return stop;
|
|
718
|
+
}
|
|
719
|
+
function onClickOutside(target, handler, options = {}) {
|
|
720
|
+
const { window: window2 = defaultWindow, ignore, capture = true } = options;
|
|
721
|
+
if (!window2)
|
|
722
|
+
return;
|
|
723
|
+
const shouldListen = ref(true);
|
|
724
|
+
let fallback;
|
|
725
|
+
const listener = (event) => {
|
|
726
|
+
window2.clearTimeout(fallback);
|
|
727
|
+
const el = unrefElement(target);
|
|
728
|
+
const composedPath = event.composedPath();
|
|
729
|
+
if (!el || el === event.target || composedPath.includes(el) || !shouldListen.value)
|
|
730
|
+
return;
|
|
731
|
+
if (ignore && ignore.length > 0) {
|
|
732
|
+
if (ignore.some((target2) => {
|
|
733
|
+
const el2 = unrefElement(target2);
|
|
734
|
+
return el2 && (event.target === el2 || composedPath.includes(el2));
|
|
735
|
+
}))
|
|
736
|
+
return;
|
|
737
|
+
}
|
|
738
|
+
handler(event);
|
|
739
|
+
};
|
|
740
|
+
const cleanup = [
|
|
741
|
+
useEventListener(window2, "click", listener, { passive: true, capture }),
|
|
742
|
+
useEventListener(window2, "pointerdown", (e) => {
|
|
743
|
+
const el = unrefElement(target);
|
|
744
|
+
shouldListen.value = !!el && !e.composedPath().includes(el);
|
|
745
|
+
}, { passive: true }),
|
|
746
|
+
useEventListener(window2, "pointerup", (e) => {
|
|
747
|
+
fallback = window2.setTimeout(() => listener(e), 50);
|
|
748
|
+
}, { passive: true })
|
|
749
|
+
];
|
|
750
|
+
const stop = () => cleanup.forEach((fn) => fn());
|
|
751
|
+
return stop;
|
|
752
|
+
}
|
|
753
|
+
const _global = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
754
|
+
const globalKey = "__vueuse_ssr_handlers__";
|
|
755
|
+
_global[globalKey] = _global[globalKey] || {};
|
|
756
|
+
_global[globalKey];
|
|
757
|
+
const _hoisted_1$8 = {
|
|
758
|
+
preserveAspectRatio: "xMidYMid meet",
|
|
759
|
+
viewBox: "0 0 24 24",
|
|
760
|
+
width: "1.2em",
|
|
761
|
+
height: "1.2em"
|
|
762
|
+
};
|
|
763
|
+
const _hoisted_2$8 = /* @__PURE__ */ createElementVNode("path", {
|
|
764
|
+
fill: "currentColor",
|
|
765
|
+
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"
|
|
766
|
+
}, null, -1);
|
|
767
|
+
const _hoisted_3$8 = [
|
|
768
|
+
_hoisted_2$8
|
|
769
|
+
];
|
|
770
|
+
function render$5(_ctx, _cache) {
|
|
771
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$8, _hoisted_3$8);
|
|
772
|
+
}
|
|
773
|
+
var IconSearch = { name: "mi-search", render: render$5 };
|
|
774
|
+
var Dropdown_vue_vue_type_style_index_0_lang = "";
|
|
775
|
+
const _hoisted_1$7 = ["data-testid"];
|
|
776
|
+
const _hoisted_2$7 = ["id", "for"];
|
|
777
|
+
const _hoisted_3$7 = ["id", "disabled", "data-testid", "aria-expanded", "aria-labelledby", "aria-controls", "onClick"];
|
|
778
|
+
const _hoisted_4$1 = { class: "dropdown-container" };
|
|
779
|
+
const _hoisted_5$1 = ["id", "data-testid", "aria-multiselectable", "aria-labelledby"];
|
|
780
|
+
const _hoisted_6$1 = ["id", "data-testid", "selected", "aria-selected", "onClick", "onKeyup"];
|
|
781
|
+
const _hoisted_7 = {
|
|
782
|
+
key: 0,
|
|
783
|
+
class: "no-data"
|
|
784
|
+
};
|
|
785
|
+
const _hoisted_8 = /* @__PURE__ */ createTextVNode(" Sem dados ");
|
|
786
|
+
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
787
|
+
name: "Dropdown",
|
|
788
|
+
props: {
|
|
789
|
+
id: null,
|
|
790
|
+
label: null,
|
|
791
|
+
disabled: { type: Boolean },
|
|
792
|
+
loading: { type: Boolean, default: false },
|
|
793
|
+
searchable: { type: Boolean, default: false },
|
|
794
|
+
closeOnSelect: { type: Boolean, default: true },
|
|
795
|
+
fetchOnSearch: { type: Boolean, default: false },
|
|
796
|
+
isMultipleSelect: { type: Boolean },
|
|
797
|
+
searchPlaceholder: null,
|
|
798
|
+
selected: null,
|
|
799
|
+
options: { default: () => [] }
|
|
800
|
+
},
|
|
801
|
+
emits: ["closeDropdown", "search", "update:selected"],
|
|
802
|
+
setup(__props, { emit }) {
|
|
803
|
+
const props = __props;
|
|
804
|
+
const el = ref();
|
|
805
|
+
const isDropdownOpen = ref(false);
|
|
806
|
+
const filter = ref("");
|
|
807
|
+
const filtered = computed(() => {
|
|
808
|
+
var _a2;
|
|
809
|
+
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));
|
|
810
|
+
});
|
|
811
|
+
const selectedSanitize = computed(() => Array.isArray(props.selected) ? props.selected.join(", ").trim() : props.selected);
|
|
812
|
+
onClickOutside(el, () => {
|
|
813
|
+
if (isDropdownOpen.value)
|
|
814
|
+
close2();
|
|
815
|
+
});
|
|
816
|
+
function toggleDropdown() {
|
|
817
|
+
if (!props.disabled)
|
|
818
|
+
isDropdownOpen.value ? close2() : open();
|
|
819
|
+
}
|
|
820
|
+
function open() {
|
|
821
|
+
isDropdownOpen.value = true;
|
|
822
|
+
}
|
|
823
|
+
function close2() {
|
|
824
|
+
resetStates();
|
|
825
|
+
emit("closeDropdown");
|
|
826
|
+
}
|
|
827
|
+
function sanitizeMultipleSelection(selectedValue) {
|
|
828
|
+
const selected = new Set(props.selected);
|
|
829
|
+
selected.has(selectedValue) ? selected.delete(selectedValue) : selected.add(selectedValue);
|
|
830
|
+
return [...selected];
|
|
831
|
+
}
|
|
832
|
+
function select(selected) {
|
|
833
|
+
const value = typeof selected === "string" ? selected : selected.value;
|
|
834
|
+
const sanitize = props.isMultipleSelect ? sanitizeMultipleSelection(value) : value;
|
|
835
|
+
emit("update:selected", sanitize);
|
|
836
|
+
if (props.closeOnSelect && !props.isMultipleSelect)
|
|
837
|
+
close2();
|
|
838
|
+
}
|
|
839
|
+
function isSelected(option) {
|
|
840
|
+
if (Array.isArray(props.selected)) {
|
|
841
|
+
return typeof option === "string" ? props.selected.includes(option) : props.selected.includes(option.value);
|
|
842
|
+
}
|
|
843
|
+
return typeof option === "string" ? option === props.selected : option.value === props.selected;
|
|
844
|
+
}
|
|
845
|
+
const elements = reactive({
|
|
846
|
+
list: void 0,
|
|
847
|
+
search: void 0
|
|
848
|
+
});
|
|
849
|
+
const elementFocus = reactive({
|
|
850
|
+
id: "",
|
|
851
|
+
index: 0
|
|
852
|
+
});
|
|
853
|
+
function navigation({ code }) {
|
|
854
|
+
const focusListItem = (index) => {
|
|
855
|
+
const indexItem = index != null ? index : elementFocus.index;
|
|
856
|
+
if (index !== void 0)
|
|
857
|
+
elementFocus.index = index;
|
|
858
|
+
setTimeout(() => {
|
|
859
|
+
var _a2, _b;
|
|
860
|
+
const item = (_a2 = elements.list) == null ? void 0 : _a2.children[indexItem];
|
|
861
|
+
elementFocus.id = (_b = item == null ? void 0 : item.id) != null ? _b : "";
|
|
862
|
+
item == null ? void 0 : item.focus();
|
|
863
|
+
}, 0);
|
|
864
|
+
};
|
|
865
|
+
const focusSearch = () => {
|
|
866
|
+
var _a2;
|
|
867
|
+
if (props.searchable) {
|
|
868
|
+
elementFocus.index = 0;
|
|
869
|
+
(_a2 = elements == null ? void 0 : elements.search) == null ? void 0 : _a2.focus();
|
|
870
|
+
}
|
|
871
|
+
};
|
|
872
|
+
switch (code) {
|
|
873
|
+
case "ArrowUp":
|
|
874
|
+
elementFocus.index > 0 && (elementFocus.index -= 1);
|
|
875
|
+
return focusListItem();
|
|
876
|
+
case "ArrowDown":
|
|
877
|
+
if (!isDropdownOpen.value) {
|
|
878
|
+
open();
|
|
879
|
+
return focusListItem(0);
|
|
880
|
+
}
|
|
881
|
+
elementFocus.index < filtered.value.length - 1 && (elementFocus.index += 1);
|
|
882
|
+
return focusListItem();
|
|
883
|
+
case "Home":
|
|
884
|
+
return focusListItem(0);
|
|
885
|
+
case "End":
|
|
886
|
+
return focusListItem(props.options.length - 1);
|
|
887
|
+
case "Escape":
|
|
888
|
+
return close2();
|
|
889
|
+
default:
|
|
890
|
+
!["Enter", "NumpadEnter", "Space"].includes(code) && focusSearch();
|
|
891
|
+
}
|
|
892
|
+
}
|
|
893
|
+
function resetStates() {
|
|
894
|
+
isDropdownOpen.value = false;
|
|
895
|
+
elementFocus.index = 0;
|
|
896
|
+
filter.value = "";
|
|
897
|
+
}
|
|
898
|
+
function getOption(option, key) {
|
|
899
|
+
return typeof option === "string" ? option : option[key != null ? key : "value"];
|
|
900
|
+
}
|
|
901
|
+
return (_ctx, _cache) => {
|
|
902
|
+
return openBlock(), createElementBlock("div", {
|
|
903
|
+
ref_key: "el",
|
|
904
|
+
ref: el,
|
|
905
|
+
class: "sol-dropdown-core",
|
|
906
|
+
"data-testid": `dropdown-${__props.id}`,
|
|
907
|
+
onKeydownPassive: navigation
|
|
908
|
+
}, [
|
|
909
|
+
renderSlot(_ctx.$slots, "label", {}, () => [
|
|
910
|
+
__props.label ? (openBlock(), createElementBlock("label", {
|
|
911
|
+
key: 0,
|
|
912
|
+
id: `label-dropdown-${__props.id}`,
|
|
913
|
+
class: normalizeClass(["label", { "-disabled": __props.disabled }]),
|
|
914
|
+
for: `toggle-dropdown-${__props.id}`
|
|
915
|
+
}, toDisplayString(__props.label), 11, _hoisted_2$7)) : createCommentVNode("", true)
|
|
916
|
+
]),
|
|
917
|
+
createElementVNode("button", {
|
|
918
|
+
id: `toggle-dropdown-${__props.id}`,
|
|
919
|
+
disabled: __props.disabled,
|
|
920
|
+
"data-testid": `toggle-dropdown-${__props.id}`,
|
|
921
|
+
class: "button-toggle-dropdown toggle-dropdown",
|
|
922
|
+
"aria-haspopup": "listbox",
|
|
923
|
+
"aria-expanded": isDropdownOpen.value,
|
|
924
|
+
"aria-labelledby": `label-dropdown-${__props.id}`,
|
|
925
|
+
"aria-controls": `dropdown-list-${__props.id}`,
|
|
926
|
+
onClick: withModifiers(toggleDropdown, ["stop"])
|
|
927
|
+
}, [
|
|
928
|
+
renderSlot(_ctx.$slots, "toggle-dropdown", {
|
|
929
|
+
toggle: { open, close: close2, toggleDropdown },
|
|
930
|
+
isOpen: isDropdownOpen.value,
|
|
931
|
+
selectedSanitized: unref(selectedSanitize),
|
|
932
|
+
selected: __props.selected
|
|
933
|
+
}, () => [
|
|
934
|
+
createTextVNode(toDisplayString(unref(selectedSanitize) || "Selecione"), 1)
|
|
935
|
+
])
|
|
936
|
+
], 8, _hoisted_3$7),
|
|
937
|
+
createVNode(Transition$1, {
|
|
938
|
+
mode: "out-in",
|
|
939
|
+
name: "dropdown"
|
|
940
|
+
}, {
|
|
941
|
+
default: withCtx(() => [
|
|
942
|
+
withDirectives(createElementVNode("div", _hoisted_4$1, [
|
|
943
|
+
__props.searchable ? (openBlock(), createElementBlock("div", {
|
|
944
|
+
key: 0,
|
|
945
|
+
class: normalizeClass(["search-container", { "-loading": __props.loading }])
|
|
946
|
+
}, [
|
|
947
|
+
renderSlot(_ctx.$slots, "search", { filter: filter.value }, () => [
|
|
948
|
+
createVNode(_sfc_main$b, {
|
|
949
|
+
id: `search-dropdown-${__props.id}`,
|
|
950
|
+
ref: (target) => elements.search = target == null ? void 0 : target.input,
|
|
951
|
+
modelValue: filter.value,
|
|
952
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => filter.value = $event),
|
|
953
|
+
"data-testid": `search-dropdown-${__props.id}`,
|
|
954
|
+
role: "combobox",
|
|
955
|
+
class: "search",
|
|
956
|
+
"aria-autocomplete": "list",
|
|
957
|
+
placeholder: __props.searchPlaceholder,
|
|
958
|
+
"aria-expanded": isDropdownOpen.value,
|
|
959
|
+
"aria-haspopup": "listbox",
|
|
960
|
+
"aria-owns": `dropdown-list-${__props.id}`,
|
|
961
|
+
"aria-controls": `dropdown-list-${__props.id}`,
|
|
962
|
+
"aria-activedescendant": elementFocus.id,
|
|
963
|
+
"aria-labelledby": `label-dropdown-${__props.id}`,
|
|
964
|
+
onClick: _cache[1] || (_cache[1] = withModifiers(() => {
|
|
965
|
+
}, ["stop"])),
|
|
966
|
+
onInput: _cache[2] || (_cache[2] = ($event) => {
|
|
967
|
+
var _a2;
|
|
968
|
+
return emit("search", (_a2 = $event.target) == null ? void 0 : _a2.value);
|
|
969
|
+
})
|
|
970
|
+
}, null, 8, ["id", "modelValue", "data-testid", "placeholder", "aria-expanded", "aria-owns", "aria-controls", "aria-activedescendant", "aria-labelledby"]),
|
|
971
|
+
createVNode(unref(IconSearch), {
|
|
972
|
+
"aria-hidden": "true",
|
|
973
|
+
class: "icon"
|
|
974
|
+
})
|
|
975
|
+
])
|
|
976
|
+
], 2)) : createCommentVNode("", true),
|
|
977
|
+
createElementVNode("ul", {
|
|
978
|
+
id: `dropdown-list-${__props.id}`,
|
|
979
|
+
ref: (target) => elements.list = target,
|
|
980
|
+
"data-testid": `dropdown-list-${__props.id}`,
|
|
981
|
+
role: "listbox",
|
|
982
|
+
tabindex: "-1",
|
|
983
|
+
"aria-multiselectable": __props.isMultipleSelect,
|
|
984
|
+
"aria-labelledby": `label-dropdown-${__props.id}`,
|
|
985
|
+
class: "dropdown-list-core"
|
|
986
|
+
}, [
|
|
987
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(filtered), (option, index) => {
|
|
988
|
+
return openBlock(), createElementBlock("li", {
|
|
989
|
+
id: `option-${__props.id}-${getOption(option, "value")}`,
|
|
990
|
+
key: index,
|
|
991
|
+
"data-testid": `option-${__props.id}-${getOption(option, "value")}`,
|
|
992
|
+
role: "option",
|
|
993
|
+
tabindex: "-1",
|
|
994
|
+
class: "dropdown-item",
|
|
995
|
+
style: normalizeStyle(`--item: ${index + 1}`),
|
|
996
|
+
selected: isSelected(option),
|
|
997
|
+
"aria-selected": isSelected(option),
|
|
998
|
+
onClick: ($event) => select(option),
|
|
999
|
+
onKeyup: [
|
|
1000
|
+
withKeys(($event) => select(option), ["enter"]),
|
|
1001
|
+
withKeys(($event) => select(option), ["space"])
|
|
1002
|
+
]
|
|
1003
|
+
}, [
|
|
1004
|
+
renderSlot(_ctx.$slots, "default", {
|
|
1005
|
+
text: getOption(option, "name"),
|
|
1006
|
+
option,
|
|
1007
|
+
isSelect: isSelected
|
|
1008
|
+
}, () => [
|
|
1009
|
+
createTextVNode(toDisplayString(getOption(option, "name")), 1)
|
|
1010
|
+
])
|
|
1011
|
+
], 44, _hoisted_6$1);
|
|
1012
|
+
}), 128)),
|
|
1013
|
+
!unref(filtered).length ? (openBlock(), createElementBlock("li", _hoisted_7, [
|
|
1014
|
+
renderSlot(_ctx.$slots, "no-data", {}, () => [
|
|
1015
|
+
_hoisted_8
|
|
1016
|
+
])
|
|
1017
|
+
])) : createCommentVNode("", true)
|
|
1018
|
+
], 8, _hoisted_5$1)
|
|
1019
|
+
], 512), [
|
|
1020
|
+
[vShow, isDropdownOpen.value]
|
|
1021
|
+
])
|
|
1022
|
+
]),
|
|
1023
|
+
_: 3
|
|
1024
|
+
})
|
|
1025
|
+
], 40, _hoisted_1$7);
|
|
1026
|
+
};
|
|
1027
|
+
}
|
|
1028
|
+
});
|
|
1029
|
+
_sfc_main$2.install = (app) => {
|
|
1030
|
+
app.component("SolDropdown", _sfc_main$2);
|
|
1031
|
+
};
|
|
1032
|
+
const _hoisted_1$6 = {
|
|
1033
|
+
preserveAspectRatio: "xMidYMid meet",
|
|
1034
|
+
viewBox: "0 0 24 24",
|
|
1035
|
+
width: "1.2em",
|
|
1036
|
+
height: "1.2em"
|
|
1037
|
+
};
|
|
1038
|
+
const _hoisted_2$6 = /* @__PURE__ */ createElementVNode("path", {
|
|
1039
|
+
fill: "currentColor",
|
|
1040
|
+
d: "m17 10l-5 6l-5-6h10z"
|
|
1041
|
+
}, null, -1);
|
|
1042
|
+
const _hoisted_3$6 = [
|
|
1043
|
+
_hoisted_2$6
|
|
1044
|
+
];
|
|
1045
|
+
function render$4(_ctx, _cache) {
|
|
1046
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$6, _hoisted_3$6);
|
|
1047
|
+
}
|
|
1048
|
+
var IconArrow = { name: "mi-caret-down", render: render$4 };
|
|
1049
|
+
var Select_vue_vue_type_style_index_0_lang = "";
|
|
1050
|
+
const _hoisted_1$5 = { class: "select" };
|
|
1051
|
+
const _hoisted_2$5 = {
|
|
1052
|
+
key: 2,
|
|
1053
|
+
class: "placeholder-inline"
|
|
1054
|
+
};
|
|
1055
|
+
const _hoisted_3$5 = { class: "error" };
|
|
1056
|
+
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
1057
|
+
name: "Select",
|
|
1058
|
+
props: {
|
|
1059
|
+
id: null,
|
|
1060
|
+
options: null,
|
|
1061
|
+
label: { default: "Label" },
|
|
1062
|
+
disabled: { type: Boolean },
|
|
1063
|
+
multiple: { type: Boolean },
|
|
1064
|
+
modelValue: null,
|
|
1065
|
+
error: null,
|
|
1066
|
+
fetchOnApi: { type: Boolean },
|
|
1067
|
+
placeholder: { default: "Selecione" },
|
|
1068
|
+
searchPlaceholder: null,
|
|
1069
|
+
searchable: { type: Boolean }
|
|
1070
|
+
},
|
|
1071
|
+
emits: ["update:modelValue"],
|
|
1072
|
+
setup(__props, { emit }) {
|
|
1073
|
+
return (_ctx, _cache) => {
|
|
1074
|
+
return openBlock(), createBlock(_sfc_main$2, {
|
|
1075
|
+
id: `select-${__props.id}`,
|
|
1076
|
+
selected: __props.modelValue,
|
|
1077
|
+
label: __props.label,
|
|
1078
|
+
disabled: __props.disabled,
|
|
1079
|
+
"fetch-on-search": __props.fetchOnApi,
|
|
1080
|
+
"is-multiple-select": __props.multiple,
|
|
1081
|
+
class: "sol-select-core",
|
|
1082
|
+
"search-placeholder": __props.searchPlaceholder,
|
|
1083
|
+
searchable: __props.searchable,
|
|
1084
|
+
options: __props.options,
|
|
1085
|
+
"onUpdate:selected": _cache[1] || (_cache[1] = ($event) => emit("update:modelValue", $event))
|
|
1086
|
+
}, {
|
|
1087
|
+
"toggle-dropdown": withCtx(({ selected, isOpen }) => [
|
|
1088
|
+
createElementVNode("div", {
|
|
1089
|
+
class: normalizeClass(["select-container", { "-disabled": __props.disabled, "-error": __props.error }])
|
|
1090
|
+
}, [
|
|
1091
|
+
createElementVNode("div", _hoisted_1$5, [
|
|
1092
|
+
__props.multiple && selected.length ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(selected, (item, index) => {
|
|
1093
|
+
return openBlock(), createElementBlock("span", {
|
|
1094
|
+
key: index,
|
|
1095
|
+
class: "tag",
|
|
1096
|
+
onClick: _cache[0] || (_cache[0] = withModifiers(() => {
|
|
1097
|
+
}, ["stop"]))
|
|
1098
|
+
}, toDisplayString(item), 1);
|
|
1099
|
+
}), 128)) : selected.length ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
1100
|
+
createTextVNode(toDisplayString(selected), 1)
|
|
1101
|
+
], 64)) : (openBlock(), createElementBlock("span", _hoisted_2$5, toDisplayString(__props.placeholder), 1))
|
|
1102
|
+
]),
|
|
1103
|
+
createVNode(unref(IconArrow), {
|
|
1104
|
+
class: normalizeClass(["icon", { "-open": isOpen }])
|
|
1105
|
+
}, null, 8, ["class"])
|
|
1106
|
+
], 2),
|
|
1107
|
+
createElementVNode("span", _hoisted_3$5, toDisplayString(__props.error), 1)
|
|
1108
|
+
]),
|
|
1109
|
+
_: 1
|
|
1110
|
+
}, 8, ["id", "selected", "label", "disabled", "fetch-on-search", "is-multiple-select", "search-placeholder", "searchable", "options"]);
|
|
1111
|
+
};
|
|
1112
|
+
}
|
|
1113
|
+
});
|
|
1114
|
+
_sfc_main$1.install = (app) => {
|
|
1115
|
+
app.component("SolSelect", _sfc_main$1);
|
|
545
1116
|
};
|
|
546
1117
|
var windiBase = "";
|
|
547
1118
|
var windiComponents = "";
|
|
548
1119
|
var windiUtilities = "";
|
|
549
1120
|
var style = "";
|
|
1121
|
+
const TOAST_GAP = 12;
|
|
1122
|
+
const DEFAULT_OPTIONS = {
|
|
1123
|
+
type: "success",
|
|
1124
|
+
timeout: 5e3,
|
|
1125
|
+
showIcon: true,
|
|
1126
|
+
showCloseButton: true,
|
|
1127
|
+
position: "top-right",
|
|
1128
|
+
hideProgressBar: false
|
|
1129
|
+
};
|
|
1130
|
+
function useTimer(callback, delay) {
|
|
1131
|
+
const timer = reactive({
|
|
1132
|
+
id: null,
|
|
1133
|
+
intervalId: null,
|
|
1134
|
+
startTime: 0,
|
|
1135
|
+
remaining: delay
|
|
1136
|
+
});
|
|
1137
|
+
const progress = ref(100);
|
|
1138
|
+
function stop() {
|
|
1139
|
+
clearInterval(timer.intervalId);
|
|
1140
|
+
clearTimeout(timer.id);
|
|
1141
|
+
timer.remaining -= Date.now() - timer.startTime;
|
|
1142
|
+
}
|
|
1143
|
+
function start() {
|
|
1144
|
+
timer.startTime = Date.now();
|
|
1145
|
+
clearTimeout(timer.id);
|
|
1146
|
+
timer.intervalId = setInterval(() => {
|
|
1147
|
+
progress.value--;
|
|
1148
|
+
}, delay / 100 - 5);
|
|
1149
|
+
timer.id = setTimeout(callback, timer.remaining);
|
|
1150
|
+
}
|
|
1151
|
+
function clear() {
|
|
1152
|
+
clearInterval(timer.intervalId);
|
|
1153
|
+
clearTimeout(timer.id);
|
|
1154
|
+
progress.value = 100;
|
|
1155
|
+
}
|
|
1156
|
+
onMounted(() => {
|
|
1157
|
+
if (delay <= 0)
|
|
1158
|
+
return false;
|
|
1159
|
+
});
|
|
1160
|
+
onUnmounted(() => {
|
|
1161
|
+
clear();
|
|
1162
|
+
});
|
|
1163
|
+
return {
|
|
1164
|
+
start,
|
|
1165
|
+
stop,
|
|
1166
|
+
clear,
|
|
1167
|
+
progress
|
|
1168
|
+
};
|
|
1169
|
+
}
|
|
1170
|
+
function usePosition(fn) {
|
|
1171
|
+
const stylePosition = computed(() => {
|
|
1172
|
+
const { position, offset } = fn();
|
|
1173
|
+
switch (position) {
|
|
1174
|
+
case "top-left":
|
|
1175
|
+
return {
|
|
1176
|
+
left: "0",
|
|
1177
|
+
top: `${offset}px`
|
|
1178
|
+
};
|
|
1179
|
+
case "bottom-left":
|
|
1180
|
+
return {
|
|
1181
|
+
left: "0",
|
|
1182
|
+
bottom: `${offset}px`
|
|
1183
|
+
};
|
|
1184
|
+
case "bottom-right":
|
|
1185
|
+
return {
|
|
1186
|
+
right: "0",
|
|
1187
|
+
bottom: `${offset}px`
|
|
1188
|
+
};
|
|
1189
|
+
case "top-center":
|
|
1190
|
+
return {
|
|
1191
|
+
top: `${offset}px`,
|
|
1192
|
+
left: "0",
|
|
1193
|
+
right: "0",
|
|
1194
|
+
marginRight: "auto",
|
|
1195
|
+
marginLeft: "auto"
|
|
1196
|
+
};
|
|
1197
|
+
case "bottom-center":
|
|
1198
|
+
return {
|
|
1199
|
+
bottom: `${offset}px`,
|
|
1200
|
+
left: "0",
|
|
1201
|
+
right: "0",
|
|
1202
|
+
marginRight: "auto",
|
|
1203
|
+
marginLeft: "auto"
|
|
1204
|
+
};
|
|
1205
|
+
default:
|
|
1206
|
+
return {
|
|
1207
|
+
right: "0",
|
|
1208
|
+
top: `${offset}px`
|
|
1209
|
+
};
|
|
1210
|
+
}
|
|
1211
|
+
});
|
|
1212
|
+
return {
|
|
1213
|
+
stylePosition
|
|
1214
|
+
};
|
|
1215
|
+
}
|
|
1216
|
+
var Transition = /* @__PURE__ */ ((Transition2) => {
|
|
1217
|
+
Transition2["top-left"] = "bounce-left";
|
|
1218
|
+
Transition2["top-right"] = "bounce-right";
|
|
1219
|
+
Transition2["top-center"] = "bounce-down";
|
|
1220
|
+
Transition2["bottom-left"] = "bounce-left";
|
|
1221
|
+
Transition2["bottom-center"] = "bounce-up";
|
|
1222
|
+
Transition2["bottom-right"] = "bounce-right";
|
|
1223
|
+
return Transition2;
|
|
1224
|
+
})(Transition || {});
|
|
1225
|
+
const _hoisted_1$4 = {
|
|
1226
|
+
preserveAspectRatio: "xMidYMid meet",
|
|
1227
|
+
viewBox: "0 0 24 24",
|
|
1228
|
+
width: "1.2em",
|
|
1229
|
+
height: "1.2em"
|
|
1230
|
+
};
|
|
1231
|
+
const _hoisted_2$4 = /* @__PURE__ */ createElementVNode("path", {
|
|
1232
|
+
fill: "currentColor",
|
|
1233
|
+
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"
|
|
1234
|
+
}, null, -1);
|
|
1235
|
+
const _hoisted_3$4 = [
|
|
1236
|
+
_hoisted_2$4
|
|
1237
|
+
];
|
|
1238
|
+
function render$3(_ctx, _cache) {
|
|
1239
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$4, _hoisted_3$4);
|
|
1240
|
+
}
|
|
1241
|
+
var Success = { name: "mi-circle-check", render: render$3 };
|
|
1242
|
+
const _hoisted_1$3 = {
|
|
1243
|
+
preserveAspectRatio: "xMidYMid meet",
|
|
1244
|
+
viewBox: "0 0 24 24",
|
|
1245
|
+
width: "1.2em",
|
|
1246
|
+
height: "1.2em"
|
|
1247
|
+
};
|
|
1248
|
+
const _hoisted_2$3 = /* @__PURE__ */ createElementVNode("path", {
|
|
1249
|
+
fill: "currentColor",
|
|
1250
|
+
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"
|
|
1251
|
+
}, null, -1);
|
|
1252
|
+
const _hoisted_3$3 = [
|
|
1253
|
+
_hoisted_2$3
|
|
1254
|
+
];
|
|
1255
|
+
function render$2(_ctx, _cache) {
|
|
1256
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$3, _hoisted_3$3);
|
|
1257
|
+
}
|
|
1258
|
+
var Error$1 = { name: "mi-circle-error", render: render$2 };
|
|
1259
|
+
const _hoisted_1$2 = {
|
|
1260
|
+
preserveAspectRatio: "xMidYMid meet",
|
|
1261
|
+
viewBox: "0 0 24 24",
|
|
1262
|
+
width: "1.2em",
|
|
1263
|
+
height: "1.2em"
|
|
1264
|
+
};
|
|
1265
|
+
const _hoisted_2$2 = /* @__PURE__ */ createElementVNode("g", { fill: "currentColor" }, [
|
|
1266
|
+
/* @__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" }),
|
|
1267
|
+
/* @__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" })
|
|
1268
|
+
], -1);
|
|
1269
|
+
const _hoisted_3$2 = [
|
|
1270
|
+
_hoisted_2$2
|
|
1271
|
+
];
|
|
1272
|
+
function render$1(_ctx, _cache) {
|
|
1273
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$2, _hoisted_3$2);
|
|
1274
|
+
}
|
|
1275
|
+
var Info = { name: "mi-circle-warning", render: render$1 };
|
|
1276
|
+
const _hoisted_1$1 = {
|
|
1277
|
+
preserveAspectRatio: "xMidYMid meet",
|
|
1278
|
+
viewBox: "0 0 24 24",
|
|
1279
|
+
width: "1.2em",
|
|
1280
|
+
height: "1.2em"
|
|
1281
|
+
};
|
|
1282
|
+
const _hoisted_2$1 = /* @__PURE__ */ createElementVNode("path", {
|
|
1283
|
+
fill: "currentColor",
|
|
1284
|
+
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"
|
|
1285
|
+
}, null, -1);
|
|
1286
|
+
const _hoisted_3$1 = [
|
|
1287
|
+
_hoisted_2$1
|
|
1288
|
+
];
|
|
1289
|
+
function render(_ctx, _cache) {
|
|
1290
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$1, _hoisted_3$1);
|
|
1291
|
+
}
|
|
1292
|
+
var Close = { name: "mi-close", render };
|
|
1293
|
+
var Toast_vue_vue_type_style_index_0_lang = "";
|
|
1294
|
+
const _hoisted_1 = ["id", "data-testid"];
|
|
1295
|
+
const _hoisted_2 = { class: "content-wrapper" };
|
|
1296
|
+
const _hoisted_3 = {
|
|
1297
|
+
key: 0,
|
|
1298
|
+
class: "icon-container",
|
|
1299
|
+
"aria-hidden": "true"
|
|
1300
|
+
};
|
|
1301
|
+
const _hoisted_4 = { class: "content" };
|
|
1302
|
+
const _hoisted_5 = {
|
|
1303
|
+
key: 0,
|
|
1304
|
+
class: "description"
|
|
1305
|
+
};
|
|
1306
|
+
const _hoisted_6 = ["data-testid"];
|
|
1307
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
1308
|
+
name: "Toast",
|
|
1309
|
+
props: {
|
|
1310
|
+
id: null,
|
|
1311
|
+
type: { default: DEFAULT_OPTIONS.type },
|
|
1312
|
+
visible: { type: Boolean, default: false },
|
|
1313
|
+
title: null,
|
|
1314
|
+
description: null,
|
|
1315
|
+
timeout: null,
|
|
1316
|
+
hideProgressBar: { type: Boolean, default: DEFAULT_OPTIONS.hideProgressBar },
|
|
1317
|
+
showIcon: { type: Boolean, default: DEFAULT_OPTIONS.showIcon },
|
|
1318
|
+
offset: { default: 0 },
|
|
1319
|
+
onClose: null,
|
|
1320
|
+
onCloseHandler: null,
|
|
1321
|
+
position: { default: DEFAULT_OPTIONS.position }
|
|
1322
|
+
},
|
|
1323
|
+
setup(__props) {
|
|
1324
|
+
const props = __props;
|
|
1325
|
+
const { start, stop, progress } = useTimer(() => {
|
|
1326
|
+
var _a2;
|
|
1327
|
+
(_a2 = props.onCloseHandler) == null ? void 0 : _a2.call(props);
|
|
1328
|
+
}, props.timeout);
|
|
1329
|
+
const { stylePosition } = usePosition(() => ({
|
|
1330
|
+
offset: props.offset,
|
|
1331
|
+
position: props.position
|
|
1332
|
+
}));
|
|
1333
|
+
const isMultiline = computed(() => props.title && props.description);
|
|
1334
|
+
function onMouseEnter() {
|
|
1335
|
+
if (props.timeout > 0) {
|
|
1336
|
+
stop();
|
|
1337
|
+
}
|
|
1338
|
+
}
|
|
1339
|
+
function onMouseLeave() {
|
|
1340
|
+
start();
|
|
1341
|
+
}
|
|
1342
|
+
onMounted(() => {
|
|
1343
|
+
start();
|
|
1344
|
+
});
|
|
1345
|
+
return (_ctx, _cache) => {
|
|
1346
|
+
return openBlock(), createBlock(Transition$1, {
|
|
1347
|
+
name: unref(Transition)[__props.position],
|
|
1348
|
+
type: "animation"
|
|
1349
|
+
}, {
|
|
1350
|
+
default: withCtx(() => [
|
|
1351
|
+
__props.visible ? (openBlock(), createElementBlock("div", {
|
|
1352
|
+
key: 0,
|
|
1353
|
+
id: `toast-${__props.type}-${__props.id}`,
|
|
1354
|
+
role: "status",
|
|
1355
|
+
"data-testid": `toast-${__props.type}-${__props.id}`,
|
|
1356
|
+
style: normalizeStyle(unref(stylePosition)),
|
|
1357
|
+
class: normalizeClass(["sol-toast-core", [`-${__props.type}`, { "-multiline": unref(isMultiline) }]]),
|
|
1358
|
+
onKeyup: _cache[1] || (_cache[1] = withKeys((...args) => __props.onCloseHandler && __props.onCloseHandler(...args), ["esc"])),
|
|
1359
|
+
onMouseenter: onMouseEnter,
|
|
1360
|
+
onMouseleave: onMouseLeave,
|
|
1361
|
+
onFocusin: onMouseEnter,
|
|
1362
|
+
onFocusout: onMouseLeave
|
|
1363
|
+
}, [
|
|
1364
|
+
createElementVNode("section", _hoisted_2, [
|
|
1365
|
+
__props.showIcon ? (openBlock(), createElementBlock("div", _hoisted_3, [
|
|
1366
|
+
renderSlot(_ctx.$slots, "icon-status", { type: __props.type }, () => [
|
|
1367
|
+
__props.type === "success" ? (openBlock(), createBlock(unref(Success), {
|
|
1368
|
+
key: 0,
|
|
1369
|
+
class: "icon"
|
|
1370
|
+
})) : createCommentVNode("", true),
|
|
1371
|
+
__props.type === "info" ? (openBlock(), createBlock(unref(Info), {
|
|
1372
|
+
key: 1,
|
|
1373
|
+
class: "icon"
|
|
1374
|
+
})) : createCommentVNode("", true),
|
|
1375
|
+
__props.type === "danger" ? (openBlock(), createBlock(unref(Error$1), {
|
|
1376
|
+
key: 2,
|
|
1377
|
+
class: "icon"
|
|
1378
|
+
})) : createCommentVNode("", true)
|
|
1379
|
+
])
|
|
1380
|
+
])) : createCommentVNode("", true),
|
|
1381
|
+
createElementVNode("div", _hoisted_4, [
|
|
1382
|
+
createElementVNode("p", {
|
|
1383
|
+
class: normalizeClass(["title", { "-multiline": unref(isMultiline) }])
|
|
1384
|
+
}, [
|
|
1385
|
+
renderSlot(_ctx.$slots, "title", {}, () => [
|
|
1386
|
+
createTextVNode(toDisplayString(__props.title), 1)
|
|
1387
|
+
])
|
|
1388
|
+
], 2),
|
|
1389
|
+
__props.description ? (openBlock(), createElementBlock("p", _hoisted_5, [
|
|
1390
|
+
renderSlot(_ctx.$slots, "description", {}, () => [
|
|
1391
|
+
createTextVNode(toDisplayString(__props.description), 1)
|
|
1392
|
+
])
|
|
1393
|
+
])) : createCommentVNode("", true)
|
|
1394
|
+
])
|
|
1395
|
+
]),
|
|
1396
|
+
createElementVNode("button", {
|
|
1397
|
+
type: "button",
|
|
1398
|
+
class: normalizeClass(["close", { "-multiline": unref(isMultiline) }]),
|
|
1399
|
+
"data-testid": `toast-close-button-${__props.type}-${__props.id}`,
|
|
1400
|
+
"aria-label": "close notification",
|
|
1401
|
+
onClick: _cache[0] || (_cache[0] = (...args) => __props.onCloseHandler && __props.onCloseHandler(...args))
|
|
1402
|
+
}, [
|
|
1403
|
+
createVNode(unref(Close), { class: "icon" })
|
|
1404
|
+
], 10, _hoisted_6),
|
|
1405
|
+
!__props.hideProgressBar ? (openBlock(), createElementBlock("div", {
|
|
1406
|
+
key: 0,
|
|
1407
|
+
class: "progressbar",
|
|
1408
|
+
"aria-hidden": "true",
|
|
1409
|
+
style: normalizeStyle({ width: `${unref(progress)}%` })
|
|
1410
|
+
}, null, 4)) : createCommentVNode("", true)
|
|
1411
|
+
], 46, _hoisted_1)) : createCommentVNode("", true)
|
|
1412
|
+
]),
|
|
1413
|
+
_: 3
|
|
1414
|
+
}, 8, ["name"]);
|
|
1415
|
+
};
|
|
1416
|
+
}
|
|
1417
|
+
});
|
|
1418
|
+
const toasts = {
|
|
1419
|
+
"top-left": [],
|
|
1420
|
+
"top-right": [],
|
|
1421
|
+
"top-center": [],
|
|
1422
|
+
"bottom-left": [],
|
|
1423
|
+
"bottom-right": [],
|
|
1424
|
+
"bottom-center": []
|
|
1425
|
+
};
|
|
1426
|
+
function useToast() {
|
|
1427
|
+
let toastId = 0;
|
|
1428
|
+
function clearAllToasts() {
|
|
1429
|
+
Object.entries(toasts).forEach(([position, toastsInAPosition]) => {
|
|
1430
|
+
if (toastsInAPosition.length) {
|
|
1431
|
+
toastsInAPosition.forEach((toast) => {
|
|
1432
|
+
var _a2;
|
|
1433
|
+
const id = (_a2 = toast.toastVNode.props) == null ? void 0 : _a2.id;
|
|
1434
|
+
close(id, position);
|
|
1435
|
+
});
|
|
1436
|
+
}
|
|
1437
|
+
});
|
|
1438
|
+
}
|
|
1439
|
+
const createToast = (content, options) => {
|
|
1440
|
+
const id = toastId++;
|
|
1441
|
+
const initializedOptions = options ? initializeOptions(options) : DEFAULT_OPTIONS;
|
|
1442
|
+
if (options == null ? void 0 : options.showOneToast)
|
|
1443
|
+
clearAllToasts();
|
|
1444
|
+
const transformContent = typeof content === "string" ? { title: content } : content;
|
|
1445
|
+
setupVNode(id, initializedOptions, transformContent);
|
|
1446
|
+
return {
|
|
1447
|
+
close: () => close(id, initializedOptions.position)
|
|
1448
|
+
};
|
|
1449
|
+
};
|
|
1450
|
+
return {
|
|
1451
|
+
createToast,
|
|
1452
|
+
clearAllToasts
|
|
1453
|
+
};
|
|
1454
|
+
}
|
|
1455
|
+
function initializeOptions(options) {
|
|
1456
|
+
const processedOptions = __spreadProps(__spreadValues(__spreadValues({}, DEFAULT_OPTIONS), options), {
|
|
1457
|
+
showIcon: options.showIcon
|
|
1458
|
+
});
|
|
1459
|
+
processedOptions.hideProgressBar = !!(processedOptions.timeout && (processedOptions == null ? void 0 : processedOptions.timeout) <= 0);
|
|
1460
|
+
if (options.hideProgressBar) {
|
|
1461
|
+
processedOptions.hideProgressBar = options.hideProgressBar;
|
|
1462
|
+
}
|
|
1463
|
+
return processedOptions;
|
|
1464
|
+
}
|
|
1465
|
+
function setupVNode(id, options, content) {
|
|
1466
|
+
setTimeout(() => {
|
|
1467
|
+
const verticalOffset = moveToastsOnAdd(options, toasts, TOAST_GAP);
|
|
1468
|
+
const container = document.createElement("div");
|
|
1469
|
+
document.body.appendChild(container);
|
|
1470
|
+
const toastVNode = createVNode(_sfc_main, setupVNodeProps(options, id, verticalOffset, close, content));
|
|
1471
|
+
render$8(toastVNode, container);
|
|
1472
|
+
toasts[options.position].push({ toastVNode, container });
|
|
1473
|
+
if (toastVNode.component)
|
|
1474
|
+
toastVNode.component.props.visible = true;
|
|
1475
|
+
}, 1);
|
|
1476
|
+
}
|
|
1477
|
+
function setupVNodeProps(options, id, offset, closeFn, content) {
|
|
1478
|
+
return __spreadProps(__spreadValues(__spreadValues({}, options), content), {
|
|
1479
|
+
id,
|
|
1480
|
+
offset,
|
|
1481
|
+
visible: false,
|
|
1482
|
+
onCloseHandler() {
|
|
1483
|
+
closeFn(id, options.position ? options.position : "top-right");
|
|
1484
|
+
}
|
|
1485
|
+
});
|
|
1486
|
+
}
|
|
1487
|
+
function moveToastsOnAdd(options, toasts2, toastGap) {
|
|
1488
|
+
if (!options.position)
|
|
1489
|
+
throw new Error("no position");
|
|
1490
|
+
return toasts2[options.position].reduce((acc, { toastVNode }) => {
|
|
1491
|
+
const offsetHeight = toastVNode.el.offsetHeight + toastGap;
|
|
1492
|
+
acc += offsetHeight || 0;
|
|
1493
|
+
return acc;
|
|
1494
|
+
}, toastGap);
|
|
1495
|
+
}
|
|
1496
|
+
function moveToastsOnClose(index, toastArr, position, toastHeight) {
|
|
1497
|
+
for (let i = index; i < toastArr.length; i++) {
|
|
1498
|
+
const { toastVNode } = toastArr[i];
|
|
1499
|
+
if (!toastVNode.el)
|
|
1500
|
+
return;
|
|
1501
|
+
const verticalPosition = position.split("-")[0] || "top";
|
|
1502
|
+
const positionLessOneToast = parseInt(toastVNode.el.style[verticalPosition], 10) - toastHeight - TOAST_GAP;
|
|
1503
|
+
if (!toastVNode.component)
|
|
1504
|
+
return;
|
|
1505
|
+
toastVNode.component.props.offset = positionLessOneToast;
|
|
1506
|
+
}
|
|
1507
|
+
}
|
|
1508
|
+
function close(id, position) {
|
|
1509
|
+
var _a2;
|
|
1510
|
+
const toastArr = toasts[position];
|
|
1511
|
+
const index = toastArr.findIndex(({ toastVNode: toastVNode2 }) => {
|
|
1512
|
+
var _a3;
|
|
1513
|
+
return id === ((_a3 = toastVNode2 == null ? void 0 : toastVNode2.props) == null ? void 0 : _a3.id);
|
|
1514
|
+
});
|
|
1515
|
+
if (index === -1)
|
|
1516
|
+
return;
|
|
1517
|
+
const { container, toastVNode } = toastArr[index];
|
|
1518
|
+
const height = (_a2 = toastVNode == null ? void 0 : toastVNode.el) == null ? void 0 : _a2.offsetHeight;
|
|
1519
|
+
toasts[position].splice(index, 1);
|
|
1520
|
+
moveToastsOnClose(index, toastArr, position, height);
|
|
1521
|
+
if (!toastVNode.component)
|
|
1522
|
+
return;
|
|
1523
|
+
const componentProps = toastVNode.component.props;
|
|
1524
|
+
componentProps.visible = false;
|
|
1525
|
+
componentProps.onClose && componentProps.onClose();
|
|
1526
|
+
setTimeout(() => {
|
|
1527
|
+
render$8(null, container);
|
|
1528
|
+
document.body.removeChild(container);
|
|
1529
|
+
}, 1e3);
|
|
1530
|
+
}
|
|
550
1531
|
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");
|
|
551
1532
|
const components = {
|
|
552
|
-
SolButton: _sfc_main$
|
|
553
|
-
SolInput: _sfc_main$
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
1533
|
+
SolButton: _sfc_main$c,
|
|
1534
|
+
SolInput: _sfc_main$b,
|
|
1535
|
+
SolTextarea: _sfc_main$8,
|
|
1536
|
+
SolTextfield: _sfc_main$a,
|
|
1537
|
+
SolTextfieldPassword: _sfc_main$9,
|
|
1538
|
+
SolRadio: _sfc_main$7,
|
|
1539
|
+
SolRadioGroup: _sfc_main$6,
|
|
1540
|
+
SolCheckbox: _sfc_main$5,
|
|
1541
|
+
SolCheckboxGroup: _sfc_main$4,
|
|
1542
|
+
SolSwitch: _sfc_main$3,
|
|
1543
|
+
SolDropdown: _sfc_main$2,
|
|
1544
|
+
SolSelect: _sfc_main$1
|
|
561
1545
|
};
|
|
562
1546
|
function install(App) {
|
|
563
1547
|
for (const component in components) {
|
|
@@ -565,7 +1549,6 @@ function install(App) {
|
|
|
565
1549
|
}
|
|
566
1550
|
}
|
|
567
1551
|
const componentsNames = [];
|
|
568
|
-
for (const component in components)
|
|
1552
|
+
for (const component in components)
|
|
569
1553
|
componentsNames.push(component);
|
|
570
|
-
}
|
|
571
|
-
export { _sfc_main$8 as SolButton, _sfc_main$2 as SolCheckbox, _sfc_main$1 as SolCheckboxGroup, _sfc_main$7 as SolInput, _sfc_main$4 as SolRadio, _sfc_main$3 as SolRadioGroup, _sfc_main as SolSwitch, _sfc_main$6 as SolTextfield, _sfc_main$5 as SolTextfieldPassword, componentsNames, install };
|
|
1554
|
+
export { _sfc_main$c as SolButton, _sfc_main$5 as SolCheckbox, _sfc_main$4 as SolCheckboxGroup, _sfc_main$2 as SolDropdown, _sfc_main$b as SolInput, _sfc_main$7 as SolRadio, _sfc_main$6 as SolRadioGroup, _sfc_main$1 as SolSelect, _sfc_main$3 as SolSwitch, _sfc_main$8 as SolTextarea, _sfc_main$a as SolTextfield, _sfc_main$9 as SolTextfieldPassword, componentsNames, install, useToast };
|