@1doc/1ds-vue 0.0.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.
- package/README.md +32 -0
- package/dist/index.css +1 -0
- package/dist/index.mjs +1905 -0
- package/dist/index.umd.js +1 -0
- package/package.json +30 -0
- package/src/index.ts +24 -0
- package/tsconfig.json +28 -0
- package/vite.config.ts +22 -0
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,1905 @@
|
|
|
1
|
+
import { defineComponent as I, computed as m, openBlock as n, createElementBlock as o, mergeProps as V, createBlock as k, resolveDynamicComponent as ee, createCommentVNode as l, Fragment as T, renderSlot as y, createElementVNode as g, normalizeClass as L, normalizeStyle as U, ref as M, createVNode as N, withCtx as w, createTextVNode as x, toDisplayString as p, renderList as H, onMounted as Z, onUpdated as ae, provide as Y, reactive as J, toRef as Q, inject as X, unref as te, onUnmounted as ne } from "vue";
|
|
2
|
+
const B = /* @__PURE__ */ I({
|
|
3
|
+
__name: "Icon",
|
|
4
|
+
props: {
|
|
5
|
+
name: {},
|
|
6
|
+
component: {},
|
|
7
|
+
size: {},
|
|
8
|
+
customSize: {},
|
|
9
|
+
variant: {},
|
|
10
|
+
className: {}
|
|
11
|
+
},
|
|
12
|
+
setup(a) {
|
|
13
|
+
const e = a, t = m(() => [
|
|
14
|
+
"umds-icon",
|
|
15
|
+
e.name ? `iconoir-${e.name}` : "",
|
|
16
|
+
// Only apply size class if customSize is not provided
|
|
17
|
+
e.customSize ? "" : `umds-icon--${e.size || "md"}`,
|
|
18
|
+
`umds-icon--${e.variant || "inherit"}`,
|
|
19
|
+
e.className
|
|
20
|
+
].filter(Boolean).join(" ")), s = m(() => {
|
|
21
|
+
if (e.customSize)
|
|
22
|
+
return {
|
|
23
|
+
width: e.customSize,
|
|
24
|
+
height: e.customSize,
|
|
25
|
+
fontSize: e.customSize
|
|
26
|
+
};
|
|
27
|
+
});
|
|
28
|
+
return (i, h) => (n(), o("span", V({ style: s.value }, i.$props, { class: t.value }), [
|
|
29
|
+
a.component ? (n(), k(ee(a.component), { key: 0 })) : l("", !0)
|
|
30
|
+
], 16));
|
|
31
|
+
}
|
|
32
|
+
}), se = ["type", "disabled"], G = /* @__PURE__ */ I({
|
|
33
|
+
__name: "Button",
|
|
34
|
+
props: {
|
|
35
|
+
variant: {},
|
|
36
|
+
size: {},
|
|
37
|
+
disabled: { type: Boolean },
|
|
38
|
+
type: {},
|
|
39
|
+
children: {},
|
|
40
|
+
onClick: { type: Function },
|
|
41
|
+
className: {},
|
|
42
|
+
startIcon: {},
|
|
43
|
+
endIcon: {},
|
|
44
|
+
loading: { type: Boolean },
|
|
45
|
+
loadingIcon: {},
|
|
46
|
+
loadingPosition: {},
|
|
47
|
+
fullWidth: { type: Boolean }
|
|
48
|
+
},
|
|
49
|
+
setup(a) {
|
|
50
|
+
const e = a, t = m(() => [
|
|
51
|
+
"umds-button",
|
|
52
|
+
`umds-button--${e.variant || "primary"}`,
|
|
53
|
+
`umds-button--${e.size || "md"}`,
|
|
54
|
+
e.fullWidth ? "umds-button--full-width" : "",
|
|
55
|
+
e.className
|
|
56
|
+
].filter(Boolean).join(" ")), s = m(() => {
|
|
57
|
+
const u = e.loading, c = e.loadingPosition || "center";
|
|
58
|
+
return !u || u && c === "end";
|
|
59
|
+
}), i = m(() => {
|
|
60
|
+
const u = e.loading, c = e.loadingPosition || "center";
|
|
61
|
+
return !u || u && c === "start";
|
|
62
|
+
}), h = m(() => e.loading && e.loadingPosition === "start"), r = m(() => e.loading && e.loadingPosition === "end"), d = m(() => e.loading && (e.loadingPosition === "center" || !e.loadingPosition)), v = m(() => {
|
|
63
|
+
const u = e.loading, c = e.loadingPosition || "center";
|
|
64
|
+
return !u || u && c !== "center";
|
|
65
|
+
});
|
|
66
|
+
return (u, c) => (n(), o("button", V({
|
|
67
|
+
type: a.type || "button",
|
|
68
|
+
disabled: a.disabled,
|
|
69
|
+
onClick: c[0] || (c[0] = async (z) => a.onClick?.(z))
|
|
70
|
+
}, u.$props, { class: t.value }), [
|
|
71
|
+
h.value ? (n(), k(B, {
|
|
72
|
+
key: 0,
|
|
73
|
+
className: "umds-button__loading",
|
|
74
|
+
variant: "inherit",
|
|
75
|
+
name: typeof a.loadingIcon == "string" ? a.loadingIcon : a.loadingIcon ? void 0 : "refresh",
|
|
76
|
+
component: typeof a.loadingIcon != "string" ? a.loadingIcon : void 0,
|
|
77
|
+
size: a.size
|
|
78
|
+
}, null, 8, ["name", "component", "size"])) : l("", !0),
|
|
79
|
+
s.value ? (n(), o(T, { key: 1 }, [
|
|
80
|
+
typeof a.startIcon == "string" ? (n(), k(B, {
|
|
81
|
+
key: 0,
|
|
82
|
+
variant: "inherit",
|
|
83
|
+
name: a.startIcon,
|
|
84
|
+
size: a.size
|
|
85
|
+
}, null, 8, ["name", "size"])) : y(u.$slots, "start-icon", { key: 1 })
|
|
86
|
+
], 64)) : l("", !0),
|
|
87
|
+
d.value ? (n(), k(B, {
|
|
88
|
+
key: 2,
|
|
89
|
+
className: "umds-button__loading",
|
|
90
|
+
variant: "inherit",
|
|
91
|
+
name: typeof a.loadingIcon == "string" ? a.loadingIcon : a.loadingIcon ? void 0 : "refresh",
|
|
92
|
+
component: typeof a.loadingIcon != "string" ? a.loadingIcon : void 0,
|
|
93
|
+
size: a.size
|
|
94
|
+
}, null, 8, ["name", "component", "size"])) : l("", !0),
|
|
95
|
+
v.value ? y(u.$slots, "default", { key: 3 }) : l("", !0),
|
|
96
|
+
i.value ? (n(), o(T, { key: 4 }, [
|
|
97
|
+
typeof a.endIcon == "string" ? (n(), k(B, {
|
|
98
|
+
key: 0,
|
|
99
|
+
variant: "inherit",
|
|
100
|
+
name: a.endIcon,
|
|
101
|
+
size: a.size
|
|
102
|
+
}, null, 8, ["name", "size"])) : y(u.$slots, "end-icon", { key: 1 })
|
|
103
|
+
], 64)) : l("", !0),
|
|
104
|
+
r.value ? (n(), k(B, {
|
|
105
|
+
key: 5,
|
|
106
|
+
className: "umds-button__loading",
|
|
107
|
+
variant: "inherit",
|
|
108
|
+
name: typeof a.loadingIcon == "string" ? a.loadingIcon : a.loadingIcon ? void 0 : "refresh",
|
|
109
|
+
component: typeof a.loadingIcon != "string" ? a.loadingIcon : void 0,
|
|
110
|
+
size: a.size
|
|
111
|
+
}, null, 8, ["name", "component", "size"])) : l("", !0)
|
|
112
|
+
], 16, se));
|
|
113
|
+
}
|
|
114
|
+
}), le = ["aria-label"], K = /* @__PURE__ */ I({
|
|
115
|
+
__name: "Spinner",
|
|
116
|
+
props: {
|
|
117
|
+
size: {},
|
|
118
|
+
variant: {},
|
|
119
|
+
label: {},
|
|
120
|
+
className: {}
|
|
121
|
+
},
|
|
122
|
+
setup(a) {
|
|
123
|
+
const e = a, t = m(() => [
|
|
124
|
+
"umds-spinner",
|
|
125
|
+
`umds-spinner--${e.size || "md"}`,
|
|
126
|
+
`umds-spinner--${e.variant || "primary"}`,
|
|
127
|
+
e.className
|
|
128
|
+
].filter(Boolean).join(" "));
|
|
129
|
+
return (s, i) => (n(), o("span", V({
|
|
130
|
+
role: "status",
|
|
131
|
+
"aria-label": a.label || "Carregando"
|
|
132
|
+
}, s.$props, { class: t.value }), [...i[0] || (i[0] = [
|
|
133
|
+
g("span", { class: "umds-spinner__circle" }, null, -1)
|
|
134
|
+
])], 16, le));
|
|
135
|
+
}
|
|
136
|
+
}), ie = ["aria-orientation"], Ca = /* @__PURE__ */ I({
|
|
137
|
+
__name: "Divider",
|
|
138
|
+
props: {
|
|
139
|
+
orientation: {},
|
|
140
|
+
variant: {},
|
|
141
|
+
spacing: {},
|
|
142
|
+
thickness: {},
|
|
143
|
+
className: {}
|
|
144
|
+
},
|
|
145
|
+
setup(a) {
|
|
146
|
+
const e = a, t = m(() => [
|
|
147
|
+
"umds-divider",
|
|
148
|
+
`umds-divider--${e.orientation || "horizontal"}`,
|
|
149
|
+
`umds-divider--${e.variant || "solid"}`,
|
|
150
|
+
e.spacing ? `umds-divider--spacing-${e.spacing}` : "",
|
|
151
|
+
e.className
|
|
152
|
+
].filter(Boolean).join(" ")), s = m(() => {
|
|
153
|
+
const i = e.thickness;
|
|
154
|
+
return i ? {
|
|
155
|
+
"--divider-size": typeof i == "number" ? `${i}px` : i
|
|
156
|
+
} : {};
|
|
157
|
+
});
|
|
158
|
+
return (i, h) => (n(), o("hr", {
|
|
159
|
+
style: U(s.value),
|
|
160
|
+
"aria-orientation": a.orientation || "horizontal",
|
|
161
|
+
class: L(t.value)
|
|
162
|
+
}, null, 14, ie));
|
|
163
|
+
}
|
|
164
|
+
}), oe = { class: "umds-badge__icon" }, re = { class: "umds-badge__icon" }, pa = /* @__PURE__ */ I({
|
|
165
|
+
__name: "Badge",
|
|
166
|
+
props: {
|
|
167
|
+
variant: {},
|
|
168
|
+
size: {},
|
|
169
|
+
type: {},
|
|
170
|
+
iconLeft: {},
|
|
171
|
+
iconRight: {},
|
|
172
|
+
className: {},
|
|
173
|
+
children: {}
|
|
174
|
+
},
|
|
175
|
+
setup(a) {
|
|
176
|
+
const e = a, t = m(() => [
|
|
177
|
+
"umds-badge",
|
|
178
|
+
`umds-badge--${e.variant || "neutral"}`,
|
|
179
|
+
`umds-badge--${e.size || "md"}`,
|
|
180
|
+
`umds-badge--${e.type || "soft"}`,
|
|
181
|
+
e.className
|
|
182
|
+
].filter(Boolean).join(" "));
|
|
183
|
+
return (s, i) => (n(), o("span", V(s.$props, { class: t.value }), [
|
|
184
|
+
g("span", oe, [
|
|
185
|
+
y(s.$slots, "icon-left")
|
|
186
|
+
]),
|
|
187
|
+
y(s.$slots, "default", {}, () => [
|
|
188
|
+
y(s.$slots, "default")
|
|
189
|
+
]),
|
|
190
|
+
g("span", re, [
|
|
191
|
+
y(s.$slots, "icon-right")
|
|
192
|
+
])
|
|
193
|
+
], 16));
|
|
194
|
+
}
|
|
195
|
+
}), ue = ["src", "alt"], $a = /* @__PURE__ */ I({
|
|
196
|
+
__name: "Avatar",
|
|
197
|
+
props: {
|
|
198
|
+
src: {},
|
|
199
|
+
alt: {},
|
|
200
|
+
size: {},
|
|
201
|
+
type: {},
|
|
202
|
+
children: {},
|
|
203
|
+
className: {}
|
|
204
|
+
},
|
|
205
|
+
setup(a) {
|
|
206
|
+
const e = a, t = m(() => [
|
|
207
|
+
"umds-avatar",
|
|
208
|
+
`umds-avatar--${e.size || "md"}`,
|
|
209
|
+
`umds-avatar--${e.type || (e.src ? "photo" : "letter")}`,
|
|
210
|
+
e.className
|
|
211
|
+
].filter(Boolean).join(" "));
|
|
212
|
+
return (s, i) => (n(), o("div", {
|
|
213
|
+
class: L(t.value)
|
|
214
|
+
}, [
|
|
215
|
+
a.src ? (n(), o("img", {
|
|
216
|
+
key: 0,
|
|
217
|
+
class: "umds-avatar__image",
|
|
218
|
+
src: a.src,
|
|
219
|
+
alt: a.alt || ""
|
|
220
|
+
}, null, 8, ue)) : l("", !0),
|
|
221
|
+
a.src ? l("", !0) : y(s.$slots, "default", { key: 1 })
|
|
222
|
+
], 2));
|
|
223
|
+
}
|
|
224
|
+
}), xa = /* @__PURE__ */ I({
|
|
225
|
+
__name: "AvatarGroup",
|
|
226
|
+
props: {
|
|
227
|
+
children: {},
|
|
228
|
+
className: {}
|
|
229
|
+
},
|
|
230
|
+
setup(a) {
|
|
231
|
+
const e = a, t = m(() => ["umds-avatar-group", e.className].filter(Boolean).join(" "));
|
|
232
|
+
return (s, i) => (n(), o("div", {
|
|
233
|
+
class: L(t.value)
|
|
234
|
+
}, [
|
|
235
|
+
y(s.$slots, "default")
|
|
236
|
+
], 2));
|
|
237
|
+
}
|
|
238
|
+
}), de = {
|
|
239
|
+
key: 0,
|
|
240
|
+
viewBox: "0 0 15 13.4473",
|
|
241
|
+
fill: "none",
|
|
242
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
243
|
+
width: "100%",
|
|
244
|
+
height: "100%",
|
|
245
|
+
preserveAspectRatio: "xMidYMid meet"
|
|
246
|
+
}, ce = {
|
|
247
|
+
key: 1,
|
|
248
|
+
viewBox: "0 0 40 13.6035",
|
|
249
|
+
fill: "none",
|
|
250
|
+
width: "100%",
|
|
251
|
+
height: "100%",
|
|
252
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
253
|
+
preserveAspectRatio: "xMidYMid meet"
|
|
254
|
+
}, za = /* @__PURE__ */ I({
|
|
255
|
+
__name: "Logo",
|
|
256
|
+
props: {
|
|
257
|
+
size: {},
|
|
258
|
+
variant: {},
|
|
259
|
+
className: {},
|
|
260
|
+
style: {}
|
|
261
|
+
},
|
|
262
|
+
setup(a) {
|
|
263
|
+
const e = a, t = m(() => [
|
|
264
|
+
"umds-logo",
|
|
265
|
+
`umds-logo--${e.size || "regular"}`,
|
|
266
|
+
`umds-logo--${e.variant || "default"}`,
|
|
267
|
+
e.className
|
|
268
|
+
].filter(Boolean).join(" "));
|
|
269
|
+
return (s, i) => (n(), o("span", V({
|
|
270
|
+
role: "img",
|
|
271
|
+
"aria-label": "1Doc Logo"
|
|
272
|
+
}, s.$props, { class: t.value }), [
|
|
273
|
+
a.size === "small" ? (n(), o("svg", de, [...i[0] || (i[0] = [
|
|
274
|
+
g("path", {
|
|
275
|
+
d: "M5.0791 13.4473H5.06738C4.08896 13.0445 3.20078 12.4671 2.44043 11.7539V3.56641H0C0.748609 1.48759 2.73898 6.32788e-05 5.0791 0V13.4473ZM8.52344 0C10.5432 0 12.1269 0.601294 13.2744 1.81934H13.2705C14.4179 3.01981 14.9999 4.69588 15 6.75098C15 8.80618 14.4181 10.445 13.2354 11.6455C12.0722 12.846 10.4692 13.4472 8.41406 13.4473H5.95801V10.8643H8.54102C9.7062 10.8643 10.5987 10.4627 11.2354 9.68066C11.8718 8.89867 12.2002 7.87902 12.2002 6.69629C12.2002 5.51345 11.872 4.54861 11.2354 3.7666C10.5987 2.98458 9.70619 2.58398 8.54102 2.58398H5.95801V0H8.52344Z",
|
|
276
|
+
fill: "currentColor"
|
|
277
|
+
}, null, -1)
|
|
278
|
+
])])) : (n(), o("svg", ce, [...i[1] || (i[1] = [
|
|
279
|
+
g("path", {
|
|
280
|
+
d: "M24.373 3.2334C25.9082 3.23349 27.1729 3.73988 28.166 4.75098C29.1592 5.7454 29.6475 6.95544 29.6475 8.41895C29.6474 9.88232 29.1592 11.1113 28.166 12.1045C27.1729 13.0976 25.9081 13.6034 24.373 13.6035C22.8377 13.6035 21.5723 13.0977 20.5791 12.1045C19.5859 11.1101 19.0977 9.86438 19.0977 8.41895C19.0977 6.97343 19.586 5.74419 20.5791 4.75098C21.5723 3.73979 22.8377 3.2334 24.373 3.2334ZM35.5986 3.28613C37.4642 3.28613 39.1248 4.14657 40.002 5.67578L38.1455 7.15234C37.5496 6.15918 36.6997 5.65339 35.6348 5.65332C34.821 5.65332 34.153 5.92471 33.6289 6.4668C33.1048 6.99086 32.8331 7.64174 32.833 8.4541C32.833 9.26647 33.0855 9.93573 33.6094 10.4766C34.1334 11.0006 34.8026 11.2724 35.5791 11.2725L35.5811 11.2715C36.6113 11.2713 37.6584 10.6575 38.0928 9.79004L39.9805 11.293C39.0817 12.7145 37.423 13.6025 35.5264 13.6025C33.9902 13.6024 32.7437 13.1142 31.7686 12.1572C30.7933 11.1999 30.3047 9.95256 30.3047 8.45312C30.3047 6.95385 30.793 5.70728 31.7861 4.75C32.7794 3.77471 34.0442 3.28613 35.5986 3.28613ZM5.04297 13.3516H5.03125C4.05955 12.9507 3.17578 12.3784 2.42188 11.6699V3.54102H0C0.743134 1.47675 2.72045 0 5.04199 0H5.04297V13.3516ZM12.0107 0C14.0164 0 15.5883 0.595607 16.7275 1.80664C17.8655 2.99844 18.4433 4.66084 18.4434 6.70215C18.4434 8.74367 17.8653 10.3706 16.6914 11.5625C15.5342 12.7556 13.9448 13.3516 11.9033 13.3516H6.79004V0H12.0107ZM24.373 5.61816C23.5953 5.61816 22.945 5.88867 22.4209 6.43066C21.8968 6.97276 21.6445 7.6423 21.6445 8.41895C21.6446 9.19535 21.897 9.86391 22.4209 10.4238C22.945 10.9659 23.5964 11.2363 24.373 11.2363C25.1495 11.2362 25.7816 10.9658 26.3057 10.4238C26.8295 9.86395 27.0995 9.19525 27.0996 8.41895C27.0996 7.64233 26.8298 6.97275 26.3057 6.43066C25.7828 5.88866 25.1507 5.61826 24.373 5.61816ZM9.46484 10.7852H12.0303C13.1862 10.7851 14.0713 10.3879 14.7031 9.61133C15.335 8.83469 15.6611 7.82356 15.6611 6.64844C15.6611 5.47343 15.3349 4.51584 14.7031 3.73926C14.0713 2.96291 13.186 2.56546 12.0303 2.56543H9.46484V10.7852Z",
|
|
281
|
+
fill: "currentColor"
|
|
282
|
+
}, null, -1)
|
|
283
|
+
])]))
|
|
284
|
+
], 16));
|
|
285
|
+
}
|
|
286
|
+
}), me = ["href", "target"], ve = ["disabled"], Ba = /* @__PURE__ */ I({
|
|
287
|
+
__name: "Link",
|
|
288
|
+
props: {
|
|
289
|
+
href: {},
|
|
290
|
+
target: {},
|
|
291
|
+
size: {},
|
|
292
|
+
variant: {},
|
|
293
|
+
outlined: { type: Boolean },
|
|
294
|
+
disabled: { type: Boolean },
|
|
295
|
+
className: {},
|
|
296
|
+
children: {},
|
|
297
|
+
onClick: { type: Function }
|
|
298
|
+
},
|
|
299
|
+
setup(a) {
|
|
300
|
+
const e = a, t = m(() => [
|
|
301
|
+
"umds-link",
|
|
302
|
+
`umds-link--${e.size || "default"}`,
|
|
303
|
+
`umds-link--${e.variant || "neutral"}`,
|
|
304
|
+
e.outlined ? "umds-link--outlined" : "",
|
|
305
|
+
e.disabled ? "umds-link--disabled" : "",
|
|
306
|
+
e.className
|
|
307
|
+
].filter(Boolean).join(" "));
|
|
308
|
+
return (s, i) => a.href && !a.disabled ? (n(), o("a", V({
|
|
309
|
+
key: 0,
|
|
310
|
+
href: a.href,
|
|
311
|
+
target: a.target,
|
|
312
|
+
onClick: i[0] || (i[0] = async (h) => a.onClick?.(h))
|
|
313
|
+
}, s.$props, { class: t.value }), [
|
|
314
|
+
y(s.$slots, "icon-left"),
|
|
315
|
+
y(s.$slots, "default", {}, () => [
|
|
316
|
+
y(s.$slots, "default")
|
|
317
|
+
]),
|
|
318
|
+
y(s.$slots, "icon-right")
|
|
319
|
+
], 16, me)) : (n(), o("button", V({
|
|
320
|
+
key: 1,
|
|
321
|
+
type: "button",
|
|
322
|
+
disabled: a.disabled,
|
|
323
|
+
onClick: i[1] || (i[1] = async (h) => a.onClick?.(h))
|
|
324
|
+
}, s.$props, { class: t.value }), [
|
|
325
|
+
y(s.$slots, "icon-left"),
|
|
326
|
+
y(s.$slots, "default", {}, () => [
|
|
327
|
+
y(s.$slots, "default")
|
|
328
|
+
]),
|
|
329
|
+
y(s.$slots, "icon-right")
|
|
330
|
+
], 16, ve));
|
|
331
|
+
}
|
|
332
|
+
}), S = /* @__PURE__ */ I({
|
|
333
|
+
__name: "Text",
|
|
334
|
+
props: {
|
|
335
|
+
variant: {},
|
|
336
|
+
visual: {},
|
|
337
|
+
xs: {},
|
|
338
|
+
sm: {},
|
|
339
|
+
md: {},
|
|
340
|
+
lg: {},
|
|
341
|
+
xl: {},
|
|
342
|
+
xxl: {},
|
|
343
|
+
as: {},
|
|
344
|
+
align: {},
|
|
345
|
+
color: {},
|
|
346
|
+
weight: {},
|
|
347
|
+
noWrap: { type: Boolean },
|
|
348
|
+
maxLines: {},
|
|
349
|
+
transform: {},
|
|
350
|
+
gutterBottom: { type: Boolean },
|
|
351
|
+
className: {},
|
|
352
|
+
children: {}
|
|
353
|
+
},
|
|
354
|
+
setup(a) {
|
|
355
|
+
const e = {
|
|
356
|
+
display: "h1",
|
|
357
|
+
h1: "h1",
|
|
358
|
+
h2: "h2",
|
|
359
|
+
h3: "h3",
|
|
360
|
+
h4: "h4",
|
|
361
|
+
h5: "h5",
|
|
362
|
+
h6: "h6",
|
|
363
|
+
subtitle1: "h6",
|
|
364
|
+
subtitle2: "h6",
|
|
365
|
+
body1: "p",
|
|
366
|
+
body2: "p",
|
|
367
|
+
caption: "span",
|
|
368
|
+
overline: "span",
|
|
369
|
+
label: "label"
|
|
370
|
+
}, t = a, s = m(() => {
|
|
371
|
+
if (t.as) return t.as;
|
|
372
|
+
const r = t.variant || t.xs || "body1";
|
|
373
|
+
return e[r] || "p";
|
|
374
|
+
}), i = m(() => {
|
|
375
|
+
const r = [], d = t.variant || t.xs || "body1";
|
|
376
|
+
return r.push(`umds-text--${d}`), t.sm && r.push(`umds-text--sm-${t.sm}`), t.md && r.push(`umds-text--md-${t.md}`), t.lg && r.push(`umds-text--lg-${t.lg}`), t.xl && r.push(`umds-text--xl-${t.xl}`), t.xxl && r.push(`umds-text--xxl-${t.xxl}`), t.visual && (typeof t.visual == "string" ? r.push(`umds-text--visual-${t.visual}`) : (t.visual.xs && r.push(`umds-text--visual-${t.visual.xs}`), t.visual.sm && r.push(`umds-text--visual-sm-${t.visual.sm}`), t.visual.md && r.push(`umds-text--visual-md-${t.visual.md}`), t.visual.lg && r.push(`umds-text--visual-lg-${t.visual.lg}`), t.visual.xl && r.push(`umds-text--visual-xl-${t.visual.xl}`), t.visual.xxl && r.push(`umds-text--visual-xxl-${t.visual.xxl}`))), [
|
|
377
|
+
"umds-text",
|
|
378
|
+
...r,
|
|
379
|
+
t.align ? `umds-text--align-${t.align}` : "",
|
|
380
|
+
t.color ? `umds-text--color-${t.color}` : "",
|
|
381
|
+
t.weight ? `umds-text--weight-${t.weight}` : "",
|
|
382
|
+
t.noWrap ? "umds-text--nowrap" : "",
|
|
383
|
+
t.maxLines ? "umds-text--clamp" : "",
|
|
384
|
+
t.transform ? `umds-text--transform-${t.transform}` : "",
|
|
385
|
+
t.gutterBottom ? "umds-text--gutter-bottom" : "",
|
|
386
|
+
t.className
|
|
387
|
+
].filter(Boolean).join(" ");
|
|
388
|
+
}), h = m(() => {
|
|
389
|
+
const r = {};
|
|
390
|
+
return t.maxLines && (r["--umds-text-max-lines"] = String(t.maxLines)), r;
|
|
391
|
+
});
|
|
392
|
+
return (r, d) => (n(), o(T, null, [
|
|
393
|
+
s.value === "h1" ? (n(), o("h1", V({
|
|
394
|
+
key: 0,
|
|
395
|
+
style: h.value
|
|
396
|
+
}, r.$props, { class: i.value }), [
|
|
397
|
+
y(r.$slots, "default")
|
|
398
|
+
], 16)) : l("", !0),
|
|
399
|
+
s.value === "h2" ? (n(), o("h2", V({
|
|
400
|
+
key: 1,
|
|
401
|
+
style: h.value
|
|
402
|
+
}, r.$props, { class: i.value }), [
|
|
403
|
+
y(r.$slots, "default")
|
|
404
|
+
], 16)) : l("", !0),
|
|
405
|
+
s.value === "h3" ? (n(), o("h3", V({
|
|
406
|
+
key: 2,
|
|
407
|
+
style: h.value
|
|
408
|
+
}, r.$props, { class: i.value }), [
|
|
409
|
+
y(r.$slots, "default")
|
|
410
|
+
], 16)) : l("", !0),
|
|
411
|
+
s.value === "h4" ? (n(), o("h4", V({
|
|
412
|
+
key: 3,
|
|
413
|
+
style: h.value
|
|
414
|
+
}, r.$props, { class: i.value }), [
|
|
415
|
+
y(r.$slots, "default")
|
|
416
|
+
], 16)) : l("", !0),
|
|
417
|
+
s.value === "h5" ? (n(), o("h5", V({
|
|
418
|
+
key: 4,
|
|
419
|
+
style: h.value
|
|
420
|
+
}, r.$props, { class: i.value }), [
|
|
421
|
+
y(r.$slots, "default")
|
|
422
|
+
], 16)) : l("", !0),
|
|
423
|
+
s.value === "h6" ? (n(), o("h6", V({
|
|
424
|
+
key: 5,
|
|
425
|
+
style: h.value
|
|
426
|
+
}, r.$props, { class: i.value }), [
|
|
427
|
+
y(r.$slots, "default")
|
|
428
|
+
], 16)) : l("", !0),
|
|
429
|
+
s.value === "p" ? (n(), o("p", V({
|
|
430
|
+
key: 6,
|
|
431
|
+
style: h.value
|
|
432
|
+
}, r.$props, { class: i.value }), [
|
|
433
|
+
y(r.$slots, "default")
|
|
434
|
+
], 16)) : l("", !0),
|
|
435
|
+
s.value === "span" ? (n(), o("span", V({
|
|
436
|
+
key: 7,
|
|
437
|
+
style: h.value
|
|
438
|
+
}, r.$props, { class: i.value }), [
|
|
439
|
+
y(r.$slots, "default")
|
|
440
|
+
], 16)) : l("", !0),
|
|
441
|
+
s.value === "label" ? (n(), o("label", V({
|
|
442
|
+
key: 8,
|
|
443
|
+
style: h.value
|
|
444
|
+
}, r.$props, { class: i.value }), [
|
|
445
|
+
y(r.$slots, "default")
|
|
446
|
+
], 16)) : l("", !0),
|
|
447
|
+
s.value === "div" ? (n(), o("div", V({
|
|
448
|
+
key: 9,
|
|
449
|
+
style: h.value
|
|
450
|
+
}, r.$props, { class: i.value }), [
|
|
451
|
+
y(r.$slots, "default")
|
|
452
|
+
], 16)) : l("", !0)
|
|
453
|
+
], 64));
|
|
454
|
+
}
|
|
455
|
+
}), he = ["aria-checked", "disabled", "name", "value", "id"], fe = { class: "umds-switch__thumb" }, ye = { className: "umds-switch-text" }, ge = ["aria-checked", "disabled"], be = { class: "umds-switch__thumb" }, wa = /* @__PURE__ */ I({
|
|
456
|
+
__name: "Switch",
|
|
457
|
+
props: {
|
|
458
|
+
checked: {},
|
|
459
|
+
defaultChecked: { type: Boolean },
|
|
460
|
+
disabled: { type: Boolean },
|
|
461
|
+
size: {},
|
|
462
|
+
name: {},
|
|
463
|
+
value: {},
|
|
464
|
+
id: {},
|
|
465
|
+
label: {},
|
|
466
|
+
description: {},
|
|
467
|
+
background: { type: Boolean },
|
|
468
|
+
className: {},
|
|
469
|
+
onChange: { type: Function }
|
|
470
|
+
},
|
|
471
|
+
setup(a) {
|
|
472
|
+
const e = a, t = M(e.defaultChecked || !1), s = m(() => e.checked !== void 0 ? e.checked : t.value), i = m(() => [
|
|
473
|
+
"umds-switch",
|
|
474
|
+
`umds-switch--${e.size || "large"}`,
|
|
475
|
+
e.disabled ? "umds-switch--disabled" : "",
|
|
476
|
+
r.value ? "" : e.className
|
|
477
|
+
].filter(Boolean).join(" ")), h = m(() => [
|
|
478
|
+
"umds-switch-wrapper",
|
|
479
|
+
e.background ? "umds-switch-wrapper--background" : "",
|
|
480
|
+
e.className
|
|
481
|
+
].filter(Boolean).join(" ")), r = m(() => !!(e.background || e.label || e.description)), d = m(() => e.size === "small" || e.size === "medium" ? "sm" : "lg");
|
|
482
|
+
function v() {
|
|
483
|
+
if (e.disabled) return;
|
|
484
|
+
const c = !(e.checked !== void 0 ? e.checked : t.value);
|
|
485
|
+
t.value = c, e.onChange?.(c);
|
|
486
|
+
}
|
|
487
|
+
return (u, c) => (n(), o(T, null, [
|
|
488
|
+
r.value ? (n(), o("div", V({ key: 0 }, u.$props, { class: h.value }), [
|
|
489
|
+
g("button", {
|
|
490
|
+
type: "button",
|
|
491
|
+
role: "switch",
|
|
492
|
+
"aria-checked": s.value,
|
|
493
|
+
disabled: a.disabled,
|
|
494
|
+
onClick: c[0] || (c[0] = async (z) => {
|
|
495
|
+
z.preventDefault(), v();
|
|
496
|
+
}),
|
|
497
|
+
name: a.name,
|
|
498
|
+
value: a.value,
|
|
499
|
+
id: a.id,
|
|
500
|
+
class: L(i.value)
|
|
501
|
+
}, [
|
|
502
|
+
g("span", fe, [
|
|
503
|
+
s.value ? y(u.$slots, "icon-checked", { key: 0 }, () => [
|
|
504
|
+
N(B, {
|
|
505
|
+
name: "check",
|
|
506
|
+
size: d.value
|
|
507
|
+
}, null, 8, ["size"])
|
|
508
|
+
]) : l("", !0),
|
|
509
|
+
s.value ? l("", !0) : y(u.$slots, "icon-not-checked", { key: 1 }, () => [
|
|
510
|
+
N(B, {
|
|
511
|
+
name: "xmark",
|
|
512
|
+
size: d.value
|
|
513
|
+
}, null, 8, ["size"])
|
|
514
|
+
])
|
|
515
|
+
])
|
|
516
|
+
], 10, he),
|
|
517
|
+
g("div", ye, [
|
|
518
|
+
a.label ? (n(), k(S, {
|
|
519
|
+
key: 0,
|
|
520
|
+
as: "span",
|
|
521
|
+
weight: "semibold",
|
|
522
|
+
variant: a.size === "small" ? "body2" : "body1"
|
|
523
|
+
}, {
|
|
524
|
+
default: w(() => [
|
|
525
|
+
x(p(a.label), 1)
|
|
526
|
+
]),
|
|
527
|
+
_: 1
|
|
528
|
+
}, 8, ["variant"])) : l("", !0),
|
|
529
|
+
a.description ? (n(), k(S, {
|
|
530
|
+
key: 1,
|
|
531
|
+
as: "span",
|
|
532
|
+
variant: "caption",
|
|
533
|
+
color: "secondary"
|
|
534
|
+
}, {
|
|
535
|
+
default: w(() => [
|
|
536
|
+
x(p(a.description), 1)
|
|
537
|
+
]),
|
|
538
|
+
_: 1
|
|
539
|
+
})) : l("", !0)
|
|
540
|
+
])
|
|
541
|
+
], 16)) : l("", !0),
|
|
542
|
+
r.value ? l("", !0) : (n(), o("button", V({
|
|
543
|
+
key: 1,
|
|
544
|
+
type: "button",
|
|
545
|
+
role: "switch",
|
|
546
|
+
"aria-checked": s.value,
|
|
547
|
+
disabled: a.disabled,
|
|
548
|
+
onClick: c[1] || (c[1] = async (z) => {
|
|
549
|
+
z.preventDefault(), v();
|
|
550
|
+
})
|
|
551
|
+
}, u.$props, { class: i.value }), [
|
|
552
|
+
g("span", be, [
|
|
553
|
+
s.value ? y(u.$slots, "icon-checked", { key: 0 }, () => [
|
|
554
|
+
N(B, {
|
|
555
|
+
name: "check",
|
|
556
|
+
size: d.value
|
|
557
|
+
}, null, 8, ["size"])
|
|
558
|
+
]) : l("", !0),
|
|
559
|
+
s.value ? l("", !0) : y(u.$slots, "icon-not-checked", { key: 1 }, () => [
|
|
560
|
+
N(B, {
|
|
561
|
+
name: "xmark",
|
|
562
|
+
size: d.value
|
|
563
|
+
}, null, 8, ["size"])
|
|
564
|
+
])
|
|
565
|
+
])
|
|
566
|
+
], 16, ge))
|
|
567
|
+
], 64));
|
|
568
|
+
}
|
|
569
|
+
}), ke = ["checked", "disabled", "required", "name", "value", "id"], Ce = { class: "umds-checkbox__control" }, pe = {
|
|
570
|
+
key: 0,
|
|
571
|
+
className: "umds-checkbox__content"
|
|
572
|
+
}, $e = /* @__PURE__ */ I({
|
|
573
|
+
__name: "Checkbox",
|
|
574
|
+
props: {
|
|
575
|
+
checked: {},
|
|
576
|
+
defaultChecked: { type: Boolean },
|
|
577
|
+
disabled: { type: Boolean },
|
|
578
|
+
required: { type: Boolean },
|
|
579
|
+
indeterminate: { type: Boolean },
|
|
580
|
+
invalid: { type: Boolean },
|
|
581
|
+
size: {},
|
|
582
|
+
variant: {},
|
|
583
|
+
name: {},
|
|
584
|
+
value: {},
|
|
585
|
+
id: {},
|
|
586
|
+
label: {},
|
|
587
|
+
description: {},
|
|
588
|
+
className: {},
|
|
589
|
+
onChange: { type: Function }
|
|
590
|
+
},
|
|
591
|
+
setup(a) {
|
|
592
|
+
const e = a, t = M(e.defaultChecked || !1), s = m(() => e.checked !== void 0 ? e.checked : t.value), i = m(() => {
|
|
593
|
+
const d = e.checked !== void 0 ? e.checked : t.value;
|
|
594
|
+
return [
|
|
595
|
+
"umds-checkbox",
|
|
596
|
+
`umds-checkbox--${e.size || "medium"}`,
|
|
597
|
+
e.variant === "button" ? "umds-checkbox--button" : "",
|
|
598
|
+
e.disabled ? "umds-checkbox--disabled" : "",
|
|
599
|
+
e.invalid ? "umds-checkbox--invalid" : "",
|
|
600
|
+
d ? "umds-checkbox--checked" : "",
|
|
601
|
+
e.indeterminate ? "umds-checkbox--indeterminate" : "",
|
|
602
|
+
e.className
|
|
603
|
+
].filter(Boolean).join(" ");
|
|
604
|
+
}), h = m(() => e.size === "small" ? "sm" : e.size === "large" ? "lg" : "md");
|
|
605
|
+
function r(d) {
|
|
606
|
+
if (e.disabled) return;
|
|
607
|
+
const v = d.target.checked;
|
|
608
|
+
t.value = v, typeof e.onChange == "function" && e.onChange(v);
|
|
609
|
+
}
|
|
610
|
+
return (d, v) => (n(), o("label", {
|
|
611
|
+
class: L(i.value)
|
|
612
|
+
}, [
|
|
613
|
+
g("input", {
|
|
614
|
+
type: "checkbox",
|
|
615
|
+
class: "umds-checkbox__input",
|
|
616
|
+
checked: s.value,
|
|
617
|
+
disabled: a.disabled,
|
|
618
|
+
required: a.required,
|
|
619
|
+
name: a.name,
|
|
620
|
+
value: a.value,
|
|
621
|
+
id: a.id,
|
|
622
|
+
onChange: v[0] || (v[0] = async (u) => r(u))
|
|
623
|
+
}, null, 40, ke),
|
|
624
|
+
g("span", Ce, [
|
|
625
|
+
s.value && !a.indeterminate ? (n(), k(B, {
|
|
626
|
+
key: 0,
|
|
627
|
+
name: "check",
|
|
628
|
+
size: h.value
|
|
629
|
+
}, null, 8, ["size"])) : l("", !0),
|
|
630
|
+
a.indeterminate ? (n(), k(B, {
|
|
631
|
+
key: 1,
|
|
632
|
+
name: "minus",
|
|
633
|
+
size: h.value
|
|
634
|
+
}, null, 8, ["size"])) : l("", !0)
|
|
635
|
+
]),
|
|
636
|
+
(a.label || a.description) && a.variant !== "button" ? (n(), o("span", pe, [
|
|
637
|
+
a.label ? (n(), k(S, {
|
|
638
|
+
key: 0,
|
|
639
|
+
as: "span",
|
|
640
|
+
variant: a.size === "small" ? "caption" : a.size === "large" ? "body1" : "body2"
|
|
641
|
+
}, {
|
|
642
|
+
default: w(() => [
|
|
643
|
+
x(p(a.label), 1)
|
|
644
|
+
]),
|
|
645
|
+
_: 1
|
|
646
|
+
}, 8, ["variant"])) : l("", !0),
|
|
647
|
+
a.description ? (n(), k(S, {
|
|
648
|
+
key: 1,
|
|
649
|
+
as: "span",
|
|
650
|
+
variant: "caption",
|
|
651
|
+
color: "secondary"
|
|
652
|
+
}, {
|
|
653
|
+
default: w(() => [
|
|
654
|
+
x(p(a.description), 1)
|
|
655
|
+
]),
|
|
656
|
+
_: 1
|
|
657
|
+
})) : l("", !0)
|
|
658
|
+
])) : l("", !0)
|
|
659
|
+
], 2));
|
|
660
|
+
}
|
|
661
|
+
}), xe = ["checked", "disabled", "required", "name", "value", "id"], ze = { class: "umds-radio__control" }, Be = {
|
|
662
|
+
key: 0,
|
|
663
|
+
class: "umds-radio__indicator"
|
|
664
|
+
}, we = {
|
|
665
|
+
key: 0,
|
|
666
|
+
class: "umds-radio__content"
|
|
667
|
+
}, Na = /* @__PURE__ */ I({
|
|
668
|
+
__name: "Radio",
|
|
669
|
+
props: {
|
|
670
|
+
checked: {},
|
|
671
|
+
defaultChecked: { type: Boolean },
|
|
672
|
+
disabled: { type: Boolean },
|
|
673
|
+
required: { type: Boolean },
|
|
674
|
+
invalid: { type: Boolean },
|
|
675
|
+
size: {},
|
|
676
|
+
name: {},
|
|
677
|
+
value: {},
|
|
678
|
+
id: {},
|
|
679
|
+
label: {},
|
|
680
|
+
description: {},
|
|
681
|
+
className: {},
|
|
682
|
+
onChange: { type: Function }
|
|
683
|
+
},
|
|
684
|
+
setup(a) {
|
|
685
|
+
const e = a, t = M(e.defaultChecked || !1), s = m(() => e.checked !== void 0 ? e.checked : t.value), i = m(() => {
|
|
686
|
+
const r = e.checked !== void 0 ? e.checked : t.value;
|
|
687
|
+
return [
|
|
688
|
+
"umds-radio",
|
|
689
|
+
`umds-radio--${e.size || "medium"}`,
|
|
690
|
+
e.disabled ? "umds-radio--disabled" : "",
|
|
691
|
+
e.invalid ? "umds-radio--invalid" : "",
|
|
692
|
+
r ? "umds-radio--checked" : "",
|
|
693
|
+
e.className
|
|
694
|
+
].filter(Boolean).join(" ");
|
|
695
|
+
});
|
|
696
|
+
function h(r) {
|
|
697
|
+
if (e.disabled) return;
|
|
698
|
+
const d = r.target.checked;
|
|
699
|
+
t.value = d, typeof e.onChange == "function" && e.onChange(d);
|
|
700
|
+
}
|
|
701
|
+
return (r, d) => (n(), o("label", {
|
|
702
|
+
class: L(i.value)
|
|
703
|
+
}, [
|
|
704
|
+
g("input", {
|
|
705
|
+
type: "radio",
|
|
706
|
+
class: "umds-radio__input",
|
|
707
|
+
checked: s.value,
|
|
708
|
+
disabled: a.disabled,
|
|
709
|
+
required: a.required,
|
|
710
|
+
name: a.name,
|
|
711
|
+
value: a.value,
|
|
712
|
+
id: a.id,
|
|
713
|
+
onChange: d[0] || (d[0] = async (v) => h(v))
|
|
714
|
+
}, null, 40, xe),
|
|
715
|
+
g("span", ze, [
|
|
716
|
+
s.value ? (n(), o("span", Be)) : l("", !0)
|
|
717
|
+
]),
|
|
718
|
+
a.label || a.description ? (n(), o("span", we, [
|
|
719
|
+
a.label ? (n(), k(S, {
|
|
720
|
+
key: 0,
|
|
721
|
+
as: "span",
|
|
722
|
+
variant: a.size === "small" ? "caption" : a.size === "large" ? "body1" : "body2"
|
|
723
|
+
}, {
|
|
724
|
+
default: w(() => [
|
|
725
|
+
x(p(a.label), 1)
|
|
726
|
+
]),
|
|
727
|
+
_: 1
|
|
728
|
+
}, 8, ["variant"])) : l("", !0),
|
|
729
|
+
a.description ? (n(), k(S, {
|
|
730
|
+
key: 1,
|
|
731
|
+
as: "span",
|
|
732
|
+
variant: "caption",
|
|
733
|
+
color: "secondary"
|
|
734
|
+
}, {
|
|
735
|
+
default: w(() => [
|
|
736
|
+
x(p(a.description), 1)
|
|
737
|
+
]),
|
|
738
|
+
_: 1
|
|
739
|
+
})) : l("", !0)
|
|
740
|
+
])) : l("", !0)
|
|
741
|
+
], 2));
|
|
742
|
+
}
|
|
743
|
+
}), Ne = {
|
|
744
|
+
key: 0,
|
|
745
|
+
class: "umds-input__required"
|
|
746
|
+
}, Se = {
|
|
747
|
+
key: 0,
|
|
748
|
+
class: "umds-input__icon-left"
|
|
749
|
+
}, Ie = ["type", "name", "disabled", "readOnly", "placeholder", "value", "defaultValue", "aria-invalid", "required"], Ve = { class: "umds-input__actions-right" }, Le = ["aria-label"], Me = ["onClick", "title", "aria-label"], Sa = /* @__PURE__ */ I({
|
|
750
|
+
__name: "Input",
|
|
751
|
+
props: {
|
|
752
|
+
label: {},
|
|
753
|
+
type: {},
|
|
754
|
+
name: {},
|
|
755
|
+
value: {},
|
|
756
|
+
defaultValue: {},
|
|
757
|
+
placeholder: {},
|
|
758
|
+
helperText: {},
|
|
759
|
+
errorMessage: {},
|
|
760
|
+
disabled: { type: Boolean },
|
|
761
|
+
readOnly: { type: Boolean },
|
|
762
|
+
required: { type: Boolean },
|
|
763
|
+
size: {},
|
|
764
|
+
fullWidth: { type: Boolean },
|
|
765
|
+
className: {},
|
|
766
|
+
iconLeft: {},
|
|
767
|
+
iconsRight: {},
|
|
768
|
+
onChange: { type: Function },
|
|
769
|
+
onFocus: { type: Function },
|
|
770
|
+
onBlur: { type: Function },
|
|
771
|
+
mask: {}
|
|
772
|
+
},
|
|
773
|
+
setup(a) {
|
|
774
|
+
const e = a, t = M(!1), s = M(e.defaultValue), i = m(() => e.type === "password" && t.value ? "text" : e.type || "text"), h = m(() => {
|
|
775
|
+
const c = e.errorMessage && e.errorMessage.length > 0;
|
|
776
|
+
return [
|
|
777
|
+
"umds-input",
|
|
778
|
+
e.fullWidth ? "umds-input--full-width" : "",
|
|
779
|
+
c ? "umds-input--error" : "",
|
|
780
|
+
e.disabled ? "umds-input--disabled" : "",
|
|
781
|
+
e.readOnly ? "umds-input--readonly" : "",
|
|
782
|
+
`umds-input--${e.size || "md"}`,
|
|
783
|
+
e.className
|
|
784
|
+
].filter(Boolean).join(" ");
|
|
785
|
+
}), r = m(() => [
|
|
786
|
+
"umds-input__container",
|
|
787
|
+
e.errorMessage && e.errorMessage.length > 0 ? "umds-input__container--error" : "",
|
|
788
|
+
e.disabled ? "umds-input__container--disabled" : "",
|
|
789
|
+
e.readOnly ? "umds-input__container--readonly" : ""
|
|
790
|
+
].filter(Boolean).join(" ")), d = m(() => e.size === "sm" || e.size === "xs" ? "sm" : "md");
|
|
791
|
+
function v() {
|
|
792
|
+
t.value = !t.value;
|
|
793
|
+
}
|
|
794
|
+
function u(c) {
|
|
795
|
+
s.value = c.target.value, e.onChange && e.onChange(c);
|
|
796
|
+
}
|
|
797
|
+
return (c, z) => (n(), o("div", {
|
|
798
|
+
class: L(h.value)
|
|
799
|
+
}, [
|
|
800
|
+
a.label ? (n(), k(S, {
|
|
801
|
+
key: 0,
|
|
802
|
+
as: "label",
|
|
803
|
+
variant: "label"
|
|
804
|
+
}, {
|
|
805
|
+
default: w(() => [
|
|
806
|
+
y(c.$slots, "label", {}, () => [
|
|
807
|
+
x(p(a.label), 1)
|
|
808
|
+
]),
|
|
809
|
+
a.required ? (n(), o("span", Ne, "*")) : l("", !0)
|
|
810
|
+
]),
|
|
811
|
+
_: 3
|
|
812
|
+
})) : l("", !0),
|
|
813
|
+
g("div", {
|
|
814
|
+
class: L(r.value)
|
|
815
|
+
}, [
|
|
816
|
+
a.iconLeft ? (n(), o("div", Se, [
|
|
817
|
+
typeof a.iconLeft == "string" ? (n(), k(B, {
|
|
818
|
+
key: 0,
|
|
819
|
+
name: a.iconLeft,
|
|
820
|
+
size: d.value
|
|
821
|
+
}, null, 8, ["name", "size"])) : y(c.$slots, "icon-left", { key: 1 }, () => [
|
|
822
|
+
x(p(a.iconLeft), 1)
|
|
823
|
+
])
|
|
824
|
+
])) : l("", !0),
|
|
825
|
+
g("input", {
|
|
826
|
+
className: "umds-input__control",
|
|
827
|
+
type: i.value,
|
|
828
|
+
name: a.name,
|
|
829
|
+
disabled: a.disabled,
|
|
830
|
+
readOnly: a.readOnly,
|
|
831
|
+
placeholder: a.placeholder,
|
|
832
|
+
value: a.value !== void 0 ? a.value : s.value,
|
|
833
|
+
defaultValue: a.defaultValue,
|
|
834
|
+
onChange: z[0] || (z[0] = async ($) => u($)),
|
|
835
|
+
onFocus: z[1] || (z[1] = async ($) => a.onFocus?.($)),
|
|
836
|
+
onBlur: z[2] || (z[2] = async ($) => a.onBlur?.($)),
|
|
837
|
+
"aria-invalid": !!(a.errorMessage && a.errorMessage.length > 0),
|
|
838
|
+
required: a.required
|
|
839
|
+
}, null, 40, Ie),
|
|
840
|
+
g("div", Ve, [
|
|
841
|
+
a.type === "password" ? (n(), o("button", {
|
|
842
|
+
key: 0,
|
|
843
|
+
type: "button",
|
|
844
|
+
class: "umds-input__action-btn",
|
|
845
|
+
onClick: z[3] || (z[3] = async ($) => v()),
|
|
846
|
+
"aria-label": t.value ? "Ocultar senha" : "Mostrar senha"
|
|
847
|
+
}, [
|
|
848
|
+
N(B, {
|
|
849
|
+
name: t.value ? "eye-closed" : "eye-solid",
|
|
850
|
+
size: d.value
|
|
851
|
+
}, null, 8, ["name", "size"])
|
|
852
|
+
], 8, Le)) : l("", !0),
|
|
853
|
+
a.iconsRight?.length ? (n(!0), o(T, { key: 1 }, H(a.iconsRight, ($, F) => (n(), o("button", {
|
|
854
|
+
key: F,
|
|
855
|
+
type: "button",
|
|
856
|
+
className: "umds-input__action-btn",
|
|
857
|
+
onClick: async (A) => {
|
|
858
|
+
A.stopPropagation(), $.onClick?.(A);
|
|
859
|
+
},
|
|
860
|
+
title: $.tooltip,
|
|
861
|
+
"aria-label": $.label || $.tooltip
|
|
862
|
+
}, [
|
|
863
|
+
typeof $.icon == "string" ? (n(), k(B, {
|
|
864
|
+
key: 0,
|
|
865
|
+
name: $.icon,
|
|
866
|
+
size: d.value
|
|
867
|
+
}, null, 8, ["name", "size"])) : l("", !0),
|
|
868
|
+
typeof $.icon != "string" ? (n(), o(T, { key: 1 }, [
|
|
869
|
+
x(p($.icon), 1)
|
|
870
|
+
], 64)) : l("", !0)
|
|
871
|
+
], 8, Me))), 128)) : l("", !0)
|
|
872
|
+
])
|
|
873
|
+
], 2),
|
|
874
|
+
a.errorMessage ? (n(), k(S, {
|
|
875
|
+
key: 1,
|
|
876
|
+
as: "span",
|
|
877
|
+
variant: "caption",
|
|
878
|
+
color: "error"
|
|
879
|
+
}, {
|
|
880
|
+
default: w(() => [
|
|
881
|
+
x(p(a.errorMessage), 1)
|
|
882
|
+
]),
|
|
883
|
+
_: 1
|
|
884
|
+
})) : l("", !0),
|
|
885
|
+
a.helperText ? (n(), k(S, {
|
|
886
|
+
key: 2,
|
|
887
|
+
as: "span",
|
|
888
|
+
variant: "caption",
|
|
889
|
+
color: "secondary"
|
|
890
|
+
}, {
|
|
891
|
+
default: w(() => [
|
|
892
|
+
y(c.$slots, "helper-text", {}, () => [
|
|
893
|
+
x(p(a.helperText), 1)
|
|
894
|
+
])
|
|
895
|
+
]),
|
|
896
|
+
_: 3
|
|
897
|
+
})) : l("", !0)
|
|
898
|
+
], 2));
|
|
899
|
+
}
|
|
900
|
+
}), Ia = /* @__PURE__ */ I({
|
|
901
|
+
__name: "Grid",
|
|
902
|
+
props: {
|
|
903
|
+
alignItems: {},
|
|
904
|
+
children: {},
|
|
905
|
+
container: { type: Boolean },
|
|
906
|
+
direction: {},
|
|
907
|
+
item: { type: Boolean },
|
|
908
|
+
justifyContent: {},
|
|
909
|
+
lg: { type: [Boolean, Number, String] },
|
|
910
|
+
md: { type: [Boolean, Number, String] },
|
|
911
|
+
sm: { type: [Boolean, Number, String] },
|
|
912
|
+
spacing: {},
|
|
913
|
+
wrap: {},
|
|
914
|
+
xl: { type: [Boolean, Number, String] },
|
|
915
|
+
xxl: { type: [Boolean, Number, String] },
|
|
916
|
+
xs: { type: [Boolean, Number, String] },
|
|
917
|
+
className: {}
|
|
918
|
+
},
|
|
919
|
+
setup(a) {
|
|
920
|
+
const e = a, t = m(() => {
|
|
921
|
+
const i = ["umds-grid"];
|
|
922
|
+
if (e.container && (i.value.push("umds-grid--container"), e.spacing && i.value.push(`umds-grid--spacing-${e.spacing}`), e.wrap && i.value.push(`umds-grid--wrap-${e.wrap}`), e.direction && i.value.push(`umds-grid--direction-${e.direction}`), e.justifyContent && i.value.push(`umds-grid--justify-${e.justifyContent}`), e.alignItems && i.value.push(`umds-grid--align-${e.alignItems}`)), e.item) {
|
|
923
|
+
i.value.push("umds-grid--item");
|
|
924
|
+
const h = {
|
|
925
|
+
xs: e.xs,
|
|
926
|
+
sm: e.sm,
|
|
927
|
+
md: e.md,
|
|
928
|
+
lg: e.lg,
|
|
929
|
+
xl: e.xl,
|
|
930
|
+
xxl: e.xxl
|
|
931
|
+
};
|
|
932
|
+
Object.entries(h).forEach(([r, d]) => {
|
|
933
|
+
if (d !== void 0) {
|
|
934
|
+
const v = d === !0 ? "grow" : d;
|
|
935
|
+
i.value.push(`umds-grid--${r}-${v}`);
|
|
936
|
+
}
|
|
937
|
+
});
|
|
938
|
+
}
|
|
939
|
+
return e.className && i.value.push(e.className), i.value.filter(Boolean).join(" ");
|
|
940
|
+
}), s = m(() => {
|
|
941
|
+
const i = {};
|
|
942
|
+
if (e.container && e.spacing) {
|
|
943
|
+
const h = `var(--umds-primitive-spacing-${e.spacing})`;
|
|
944
|
+
i.value.gap = h, i.value["--umds-grid-gap"] = h;
|
|
945
|
+
}
|
|
946
|
+
return i.value;
|
|
947
|
+
});
|
|
948
|
+
return (i, h) => (n(), o("div", V({ style: s.value }, i.$props, { class: t.value }), [
|
|
949
|
+
y(i.$slots, "default")
|
|
950
|
+
], 16));
|
|
951
|
+
}
|
|
952
|
+
}), je = {
|
|
953
|
+
key: 0,
|
|
954
|
+
class: "umds-textarea__required"
|
|
955
|
+
}, Te = ["name", "disabled", "readOnly", "placeholder", "value", "defaultValue", "rows", "maxLength", "aria-invalid", "required"], Fe = { class: "umds-textarea__footer" }, Ae = { class: "umds-textarea__messages" }, Ee = {
|
|
956
|
+
key: 0,
|
|
957
|
+
class: "umds-textarea__counter"
|
|
958
|
+
}, Va = /* @__PURE__ */ I({
|
|
959
|
+
__name: "Textarea",
|
|
960
|
+
props: {
|
|
961
|
+
label: {},
|
|
962
|
+
name: {},
|
|
963
|
+
value: {},
|
|
964
|
+
defaultValue: {},
|
|
965
|
+
placeholder: {},
|
|
966
|
+
helperText: {},
|
|
967
|
+
errorMessage: {},
|
|
968
|
+
disabled: { type: Boolean },
|
|
969
|
+
readOnly: { type: Boolean },
|
|
970
|
+
required: { type: Boolean },
|
|
971
|
+
rows: {},
|
|
972
|
+
minRows: {},
|
|
973
|
+
maxRows: {},
|
|
974
|
+
maxLength: {},
|
|
975
|
+
showCounter: { type: Boolean },
|
|
976
|
+
autoSize: { type: Boolean },
|
|
977
|
+
fullWidth: { type: Boolean },
|
|
978
|
+
className: {},
|
|
979
|
+
onChange: { type: Function },
|
|
980
|
+
onInput: { type: Function },
|
|
981
|
+
onFocus: { type: Function },
|
|
982
|
+
onBlur: { type: Function }
|
|
983
|
+
},
|
|
984
|
+
setup(a) {
|
|
985
|
+
const e = a, t = M(e.defaultValue || ""), s = M(null);
|
|
986
|
+
Z(() => {
|
|
987
|
+
e.autoSize && d();
|
|
988
|
+
});
|
|
989
|
+
const i = m(() => {
|
|
990
|
+
const u = e.value !== void 0 ? e.value : t.value;
|
|
991
|
+
return u ? u.length : 0;
|
|
992
|
+
}), h = m(() => {
|
|
993
|
+
const u = e.errorMessage && e.errorMessage.length > 0;
|
|
994
|
+
return [
|
|
995
|
+
"umds-textarea",
|
|
996
|
+
e.fullWidth ? "umds-textarea--full-width" : "",
|
|
997
|
+
u ? "umds-textarea--error" : "",
|
|
998
|
+
e.disabled ? "umds-textarea--disabled" : "",
|
|
999
|
+
e.readOnly ? "umds-textarea--readonly" : "",
|
|
1000
|
+
e.autoSize ? "umds-textarea--autosize" : "",
|
|
1001
|
+
e.className
|
|
1002
|
+
].filter(Boolean).join(" ");
|
|
1003
|
+
}), r = m(() => [
|
|
1004
|
+
"umds-textarea__container",
|
|
1005
|
+
e.errorMessage && e.errorMessage.length > 0 ? "umds-textarea__container--error" : "",
|
|
1006
|
+
e.disabled ? "umds-textarea__container--disabled" : "",
|
|
1007
|
+
e.readOnly ? "umds-textarea__container--readonly" : ""
|
|
1008
|
+
].filter(Boolean).join(" "));
|
|
1009
|
+
function d() {
|
|
1010
|
+
if (e.autoSize && s.value) {
|
|
1011
|
+
const u = s.value;
|
|
1012
|
+
u.style.height = "auto";
|
|
1013
|
+
const c = u.scrollHeight, z = parseInt(getComputedStyle(u).lineHeight) || 24, $ = parseInt(getComputedStyle(u).paddingTop) || 12, F = parseInt(getComputedStyle(u).paddingBottom) || 12, A = e.minRows || 2, q = e.maxRows || 10, P = z * A + $ + F, D = z * q + $ + F, O = Math.min(Math.max(c, P), D);
|
|
1014
|
+
u.style.height = O + "px";
|
|
1015
|
+
}
|
|
1016
|
+
}
|
|
1017
|
+
function v(u) {
|
|
1018
|
+
t.value = u.target.value, d(), e.onInput && e.onInput(u), e.onChange && e.onChange(u);
|
|
1019
|
+
}
|
|
1020
|
+
return (u, c) => (n(), o("div", {
|
|
1021
|
+
class: L(h.value)
|
|
1022
|
+
}, [
|
|
1023
|
+
a.label ? (n(), k(S, {
|
|
1024
|
+
key: 0,
|
|
1025
|
+
as: "label",
|
|
1026
|
+
variant: "label",
|
|
1027
|
+
weight: "semibold"
|
|
1028
|
+
}, {
|
|
1029
|
+
default: w(() => [
|
|
1030
|
+
y(u.$slots, "label", {}, () => [
|
|
1031
|
+
x(p(a.label), 1)
|
|
1032
|
+
]),
|
|
1033
|
+
a.required ? (n(), o("span", je, "*")) : l("", !0)
|
|
1034
|
+
]),
|
|
1035
|
+
_: 3
|
|
1036
|
+
})) : l("", !0),
|
|
1037
|
+
g("div", {
|
|
1038
|
+
class: L(r.value)
|
|
1039
|
+
}, [
|
|
1040
|
+
g("textarea", {
|
|
1041
|
+
class: "umds-textarea__control",
|
|
1042
|
+
ref_key: "textareaRef",
|
|
1043
|
+
ref: s,
|
|
1044
|
+
name: a.name,
|
|
1045
|
+
disabled: a.disabled,
|
|
1046
|
+
readOnly: a.readOnly,
|
|
1047
|
+
placeholder: a.placeholder,
|
|
1048
|
+
value: a.value !== void 0 ? a.value : t.value,
|
|
1049
|
+
defaultValue: a.defaultValue,
|
|
1050
|
+
rows: a.autoSize ? a.minRows || 2 : a.rows || 4,
|
|
1051
|
+
maxLength: a.maxLength,
|
|
1052
|
+
onInput: c[0] || (c[0] = async (z) => v(z)),
|
|
1053
|
+
onFocus: c[1] || (c[1] = async (z) => a.onFocus?.(z)),
|
|
1054
|
+
onBlur: c[2] || (c[2] = async (z) => a.onBlur?.(z)),
|
|
1055
|
+
"aria-invalid": !!(a.errorMessage && a.errorMessage.length > 0),
|
|
1056
|
+
required: a.required
|
|
1057
|
+
}, null, 40, Te)
|
|
1058
|
+
], 2),
|
|
1059
|
+
g("div", Fe, [
|
|
1060
|
+
g("div", Ae, [
|
|
1061
|
+
a.errorMessage ? (n(), k(S, {
|
|
1062
|
+
key: 0,
|
|
1063
|
+
as: "span",
|
|
1064
|
+
variant: "caption",
|
|
1065
|
+
color: "error"
|
|
1066
|
+
}, {
|
|
1067
|
+
default: w(() => [
|
|
1068
|
+
x(p(a.errorMessage), 1)
|
|
1069
|
+
]),
|
|
1070
|
+
_: 1
|
|
1071
|
+
})) : l("", !0),
|
|
1072
|
+
a.helperText && !a.errorMessage ? (n(), k(S, {
|
|
1073
|
+
key: 1,
|
|
1074
|
+
as: "span",
|
|
1075
|
+
variant: "caption",
|
|
1076
|
+
color: "secondary"
|
|
1077
|
+
}, {
|
|
1078
|
+
default: w(() => [
|
|
1079
|
+
y(u.$slots, "helper-text", {}, () => [
|
|
1080
|
+
x(p(a.helperText), 1)
|
|
1081
|
+
])
|
|
1082
|
+
]),
|
|
1083
|
+
_: 3
|
|
1084
|
+
})) : l("", !0)
|
|
1085
|
+
]),
|
|
1086
|
+
a.showCounter ? (n(), o("span", Ee, p(i.value) + "/" + p(a.maxLength || 150), 1)) : l("", !0)
|
|
1087
|
+
])
|
|
1088
|
+
], 2));
|
|
1089
|
+
}
|
|
1090
|
+
}), Oe = ["role", "tabIndex", "aria-label"], He = { className: "umds-tag__label" }, Re = ["role", "tabIndex", "aria-label"], qe = /* @__PURE__ */ I({
|
|
1091
|
+
__name: "Tag",
|
|
1092
|
+
props: {
|
|
1093
|
+
label: {},
|
|
1094
|
+
variant: {},
|
|
1095
|
+
size: {},
|
|
1096
|
+
iconStart: {},
|
|
1097
|
+
iconEnd: {},
|
|
1098
|
+
closable: { type: Boolean },
|
|
1099
|
+
onClose: { type: Function },
|
|
1100
|
+
onIconStartClick: { type: Function },
|
|
1101
|
+
onIconEndClick: { type: Function },
|
|
1102
|
+
disabled: { type: Boolean },
|
|
1103
|
+
className: {},
|
|
1104
|
+
children: {}
|
|
1105
|
+
},
|
|
1106
|
+
setup(a) {
|
|
1107
|
+
const e = a, t = m(() => [
|
|
1108
|
+
"umds-tag",
|
|
1109
|
+
`umds-tag--${e.variant || "outlined"}`,
|
|
1110
|
+
`umds-tag--${e.size || "md"}`,
|
|
1111
|
+
e.disabled ? "umds-tag--disabled" : "",
|
|
1112
|
+
e.className
|
|
1113
|
+
].filter(Boolean).join(" ")), s = m(() => (e.size || "md") === "lg" ? "md" : "sm");
|
|
1114
|
+
function i(d) {
|
|
1115
|
+
d.stopPropagation(), !e.disabled && e.onClose && e.onClose(d);
|
|
1116
|
+
}
|
|
1117
|
+
function h(d) {
|
|
1118
|
+
d.stopPropagation(), !e.disabled && e.onIconStartClick && e.onIconStartClick(d);
|
|
1119
|
+
}
|
|
1120
|
+
function r(d) {
|
|
1121
|
+
d.stopPropagation(), !e.disabled && e.onIconEndClick && e.onIconEndClick(d);
|
|
1122
|
+
}
|
|
1123
|
+
return (d, v) => (n(), o("span", V({ role: "status" }, d.$props, { class: t.value }), [
|
|
1124
|
+
a.iconStart ? (n(), o("span", {
|
|
1125
|
+
key: 0,
|
|
1126
|
+
onClick: v[0] || (v[0] = async (u) => h(u)),
|
|
1127
|
+
role: a.onIconStartClick ? "button" : void 0,
|
|
1128
|
+
tabIndex: a.onIconStartClick ? 0 : void 0,
|
|
1129
|
+
"aria-label": a.onIconStartClick ? a.iconStart : void 0,
|
|
1130
|
+
class: L(
|
|
1131
|
+
a.onIconStartClick ? "umds-tag__icon umds-tag__icon--clickable" : "umds-tag__icon"
|
|
1132
|
+
)
|
|
1133
|
+
}, [
|
|
1134
|
+
N(B, {
|
|
1135
|
+
variant: "inherit",
|
|
1136
|
+
name: a.iconStart,
|
|
1137
|
+
size: s.value
|
|
1138
|
+
}, null, 8, ["name", "size"])
|
|
1139
|
+
], 10, Oe)) : l("", !0),
|
|
1140
|
+
g("span", He, p(a.label || d.$slots.default), 1),
|
|
1141
|
+
a.iconEnd ? (n(), o("span", {
|
|
1142
|
+
key: 1,
|
|
1143
|
+
onClick: v[1] || (v[1] = async (u) => r(u)),
|
|
1144
|
+
role: a.onIconEndClick ? "button" : void 0,
|
|
1145
|
+
tabIndex: a.onIconEndClick ? 0 : void 0,
|
|
1146
|
+
"aria-label": a.onIconEndClick ? a.iconEnd : void 0,
|
|
1147
|
+
class: L(
|
|
1148
|
+
a.onIconEndClick ? "umds-tag__icon umds-tag__icon--clickable" : "umds-tag__icon"
|
|
1149
|
+
)
|
|
1150
|
+
}, [
|
|
1151
|
+
N(B, {
|
|
1152
|
+
variant: "inherit",
|
|
1153
|
+
name: a.iconEnd,
|
|
1154
|
+
size: s.value
|
|
1155
|
+
}, null, 8, ["name", "size"])
|
|
1156
|
+
], 10, Re)) : l("", !0),
|
|
1157
|
+
a.closable ? (n(), o("span", {
|
|
1158
|
+
key: 2,
|
|
1159
|
+
role: "button",
|
|
1160
|
+
"aria-label": "Remover",
|
|
1161
|
+
className: "umds-tag__close",
|
|
1162
|
+
onClick: v[2] || (v[2] = async (u) => i(u)),
|
|
1163
|
+
tabIndex: 0
|
|
1164
|
+
}, [
|
|
1165
|
+
N(B, {
|
|
1166
|
+
name: "xmark",
|
|
1167
|
+
variant: "inherit",
|
|
1168
|
+
size: s.value
|
|
1169
|
+
}, null, 8, ["size"])
|
|
1170
|
+
])) : l("", !0)
|
|
1171
|
+
], 16));
|
|
1172
|
+
}
|
|
1173
|
+
}), Pe = {
|
|
1174
|
+
key: 0,
|
|
1175
|
+
class: "umds-select__required"
|
|
1176
|
+
}, De = { class: "umds-select__container" }, We = ["aria-expanded", "tabIndex"], Ze = { class: "umds-select__values" }, Ge = {
|
|
1177
|
+
key: 1,
|
|
1178
|
+
class: "umds-select__tags"
|
|
1179
|
+
}, Ke = { class: "umds-select__actions" }, Ue = { class: "umds-select__arrow" }, Ye = {
|
|
1180
|
+
key: 0,
|
|
1181
|
+
class: "umds-select__search-container"
|
|
1182
|
+
}, Je = { class: "umds-select__search-icon" }, Qe = ["value"], Xe = {
|
|
1183
|
+
key: 0,
|
|
1184
|
+
class: "umds-select__no-options"
|
|
1185
|
+
}, _e = ["onClick"], ea = {
|
|
1186
|
+
key: 0,
|
|
1187
|
+
class: "umds-select__option-checkbox"
|
|
1188
|
+
}, aa = { class: "umds-select__option-content" }, ta = {
|
|
1189
|
+
key: 1,
|
|
1190
|
+
class: "umds-select__option-check"
|
|
1191
|
+
}, na = {
|
|
1192
|
+
key: 1,
|
|
1193
|
+
className: "umds-select__loading-more"
|
|
1194
|
+
}, sa = {
|
|
1195
|
+
key: 3,
|
|
1196
|
+
class: "umds-select__selected-list"
|
|
1197
|
+
}, la = ["onClick"], La = /* @__PURE__ */ I({
|
|
1198
|
+
__name: "Select",
|
|
1199
|
+
props: {
|
|
1200
|
+
label: {},
|
|
1201
|
+
description: {},
|
|
1202
|
+
placeholder: {},
|
|
1203
|
+
options: {},
|
|
1204
|
+
value: {},
|
|
1205
|
+
multiple: { type: Boolean },
|
|
1206
|
+
searchable: { type: Boolean },
|
|
1207
|
+
autoFocusSearch: { type: Boolean },
|
|
1208
|
+
disabled: { type: Boolean },
|
|
1209
|
+
invalid: { type: Boolean },
|
|
1210
|
+
loading: { type: Boolean },
|
|
1211
|
+
errorMessage: {},
|
|
1212
|
+
fullWidth: { type: Boolean },
|
|
1213
|
+
size: {},
|
|
1214
|
+
pagination: { type: Boolean },
|
|
1215
|
+
hasMore: { type: Boolean },
|
|
1216
|
+
onLoadMore: { type: Function },
|
|
1217
|
+
onSearchChange: { type: Function },
|
|
1218
|
+
searchVariant: {},
|
|
1219
|
+
searchDebounce: {},
|
|
1220
|
+
cache: { type: Boolean },
|
|
1221
|
+
cacheKey: {},
|
|
1222
|
+
cacheTime: {},
|
|
1223
|
+
selectionDisplay: {},
|
|
1224
|
+
onChange: { type: Function },
|
|
1225
|
+
item: {},
|
|
1226
|
+
className: {}
|
|
1227
|
+
},
|
|
1228
|
+
setup(a) {
|
|
1229
|
+
const e = a, t = M(!1), s = M(""), i = M(Array()), h = M(null), r = M(!1), d = M(null), v = M(null);
|
|
1230
|
+
Z(() => {
|
|
1231
|
+
const C = (f) => {
|
|
1232
|
+
d.value && !d.value.contains(f.target) && (t.value = !1);
|
|
1233
|
+
};
|
|
1234
|
+
document.addEventListener("mousedown", C);
|
|
1235
|
+
});
|
|
1236
|
+
const u = m(() => {
|
|
1237
|
+
const C = e.value !== void 0 ? Array.isArray(e.value) ? e.value : e.value === null ? [] : [e.value] : i.value || [];
|
|
1238
|
+
return e.options && e.options.length > 0 ? C.map((f) => e.options?.find((j) => j.value === f) || {
|
|
1239
|
+
label: String(f),
|
|
1240
|
+
value: f
|
|
1241
|
+
}) : (C || []).map((f) => ({
|
|
1242
|
+
label: String(f),
|
|
1243
|
+
value: f
|
|
1244
|
+
}));
|
|
1245
|
+
}), c = m(() => {
|
|
1246
|
+
const C = e.value !== void 0 ? Array.isArray(e.value) ? e.value : e.value === null ? [] : [e.value] : i.value || [];
|
|
1247
|
+
if (C.length === 0) return e.placeholder || "Selecione...";
|
|
1248
|
+
if (e.multiple) {
|
|
1249
|
+
if (e.selectionDisplay === "tags") return "";
|
|
1250
|
+
if (C.length === 1) {
|
|
1251
|
+
const f = e.options?.find((b) => b.value === C[0]);
|
|
1252
|
+
return f ? f.label : String(C[0]);
|
|
1253
|
+
}
|
|
1254
|
+
return `${C.length} selecionado(s)`;
|
|
1255
|
+
}
|
|
1256
|
+
if (e.options) {
|
|
1257
|
+
const f = e.options.find((b) => b.value === C[0]);
|
|
1258
|
+
if (f) return f.label;
|
|
1259
|
+
}
|
|
1260
|
+
return String(C[0]);
|
|
1261
|
+
}), z = m(() => (e.value !== void 0 ? Array.isArray(e.value) ? e.value : e.value === null ? [] : [e.value] : i.value || []).length === 0), $ = m(() => {
|
|
1262
|
+
if (!e.options) return [];
|
|
1263
|
+
if (!e.searchable || !s.value || e.onSearchChange)
|
|
1264
|
+
return e.options;
|
|
1265
|
+
const C = s.value.toLowerCase();
|
|
1266
|
+
return e.options.filter((f) => f.label.toLowerCase().includes(C));
|
|
1267
|
+
}), F = m(() => [
|
|
1268
|
+
"umds-select",
|
|
1269
|
+
`umds-select--${e.size || "medium"}`,
|
|
1270
|
+
e.fullWidth ? "umds-select--full-width" : "",
|
|
1271
|
+
e.disabled ? "umds-select--disabled" : "",
|
|
1272
|
+
e.invalid ? "umds-select--invalid" : "",
|
|
1273
|
+
t.value ? "umds-select--open" : "",
|
|
1274
|
+
e.searchVariant === "inline" ? "umds-select--search-inline" : "",
|
|
1275
|
+
e.multiple && e.selectionDisplay === "tags" && u.value.length > 0 ? "umds-select--has-tags" : "",
|
|
1276
|
+
e.className
|
|
1277
|
+
].filter(Boolean).join(" "));
|
|
1278
|
+
ae(() => {
|
|
1279
|
+
t.value && r.value && v.value && (v.value.focus(), r.value = !1);
|
|
1280
|
+
});
|
|
1281
|
+
function A() {
|
|
1282
|
+
e.disabled || (t.value = !t.value, t.value && e.searchable && (e.autoFocusSearch || e.searchVariant === "inline") && (r.value = !0));
|
|
1283
|
+
}
|
|
1284
|
+
function q(C) {
|
|
1285
|
+
const f = C.target.value;
|
|
1286
|
+
if (s.value = f, e.onSearchChange) {
|
|
1287
|
+
h.value && clearTimeout(h.value);
|
|
1288
|
+
const b = e.searchDebounce ?? 300;
|
|
1289
|
+
h.value = setTimeout(() => {
|
|
1290
|
+
e.onSearchChange(f);
|
|
1291
|
+
}, b);
|
|
1292
|
+
}
|
|
1293
|
+
}
|
|
1294
|
+
function P() {
|
|
1295
|
+
t.value = !1, s.value = "", e.onSearchChange && e.onSearchChange("");
|
|
1296
|
+
}
|
|
1297
|
+
function D(C) {
|
|
1298
|
+
if (e.disabled) return;
|
|
1299
|
+
let f;
|
|
1300
|
+
if (e.multiple) {
|
|
1301
|
+
const b = e.value !== void 0 ? Array.isArray(e.value) ? e.value : e.value === null ? [] : [e.value] : i.value || [];
|
|
1302
|
+
b.includes(C.value) ? f = b.filter((j) => j !== C.value) : f = [...b, C.value], i.value = f;
|
|
1303
|
+
} else
|
|
1304
|
+
f = C.value, i.value = [f], t.value = !1;
|
|
1305
|
+
e.onChange && e.onChange(f);
|
|
1306
|
+
}
|
|
1307
|
+
function O(C, f) {
|
|
1308
|
+
if (f && f.stopPropagation(), e.disabled) return;
|
|
1309
|
+
const j = (e.value !== void 0 ? Array.isArray(e.value) ? e.value : [e.value] : i.value || []).filter((E) => E !== C);
|
|
1310
|
+
i.value = j, e.onChange && e.onChange(j);
|
|
1311
|
+
}
|
|
1312
|
+
function _(C) {
|
|
1313
|
+
if (!e.pagination || !e.onLoadMore || e.loading || !e.hasMore)
|
|
1314
|
+
return;
|
|
1315
|
+
const { scrollTop: f, scrollHeight: b, clientHeight: j } = C.target;
|
|
1316
|
+
b - f <= j + 10 && e.onLoadMore();
|
|
1317
|
+
}
|
|
1318
|
+
function W(C) {
|
|
1319
|
+
return (e.value !== void 0 ? Array.isArray(e.value) ? e.value : e.value === null ? [] : [e.value] : i.value || []).includes(C);
|
|
1320
|
+
}
|
|
1321
|
+
return (C, f) => (n(), o("div", {
|
|
1322
|
+
ref_key: "selectRef",
|
|
1323
|
+
ref: d,
|
|
1324
|
+
class: L(F.value)
|
|
1325
|
+
}, [
|
|
1326
|
+
a.label ? (n(), k(S, {
|
|
1327
|
+
key: 0,
|
|
1328
|
+
as: "label",
|
|
1329
|
+
variant: "label",
|
|
1330
|
+
weight: "semibold"
|
|
1331
|
+
}, {
|
|
1332
|
+
default: w(() => [
|
|
1333
|
+
x(p(a.label) + " ", 1),
|
|
1334
|
+
C.required ? (n(), o("span", Pe, " *")) : l("", !0)
|
|
1335
|
+
]),
|
|
1336
|
+
_: 1
|
|
1337
|
+
})) : l("", !0),
|
|
1338
|
+
g("div", De, [
|
|
1339
|
+
t.value && a.searchVariant === "inline" ? l("", !0) : (n(), o("div", {
|
|
1340
|
+
key: 0,
|
|
1341
|
+
role: "combobox",
|
|
1342
|
+
class: "umds-select__trigger",
|
|
1343
|
+
onClick: f[0] || (f[0] = async (b) => A()),
|
|
1344
|
+
"aria-expanded": t.value,
|
|
1345
|
+
tabIndex: a.disabled ? -1 : 0
|
|
1346
|
+
}, [
|
|
1347
|
+
g("div", Ze, [
|
|
1348
|
+
c.value ? (n(), k(S, {
|
|
1349
|
+
key: 0,
|
|
1350
|
+
as: "span",
|
|
1351
|
+
variant: "body2",
|
|
1352
|
+
className: z.value ? "umds-select__placeholder" : ""
|
|
1353
|
+
}, {
|
|
1354
|
+
default: w(() => [
|
|
1355
|
+
x(p(c.value), 1)
|
|
1356
|
+
]),
|
|
1357
|
+
_: 1
|
|
1358
|
+
}, 8, ["className"])) : l("", !0),
|
|
1359
|
+
a.multiple && a.selectionDisplay === "tags" && u.value.length > 0 ? (n(), o("div", Ge, [
|
|
1360
|
+
(n(!0), o(T, null, H(u.value, (b, j) => (n(), k(qe, {
|
|
1361
|
+
key: b.value,
|
|
1362
|
+
variant: "outlined",
|
|
1363
|
+
size: "sm",
|
|
1364
|
+
label: b.label,
|
|
1365
|
+
closable: !0,
|
|
1366
|
+
disabled: a.disabled,
|
|
1367
|
+
onClose: (E) => O(b.value, E)
|
|
1368
|
+
}, null, 8, ["label", "disabled", "onClose"]))), 128))
|
|
1369
|
+
])) : l("", !0)
|
|
1370
|
+
]),
|
|
1371
|
+
g("div", Ke, [
|
|
1372
|
+
a.loading ? (n(), k(K, {
|
|
1373
|
+
key: 0,
|
|
1374
|
+
size: "sm",
|
|
1375
|
+
variant: "secondary"
|
|
1376
|
+
})) : l("", !0),
|
|
1377
|
+
g("div", Ue, [
|
|
1378
|
+
N(B, {
|
|
1379
|
+
size: "sm",
|
|
1380
|
+
name: t.value ? "nav-arrow-up" : "nav-arrow-down"
|
|
1381
|
+
}, null, 8, ["name"])
|
|
1382
|
+
])
|
|
1383
|
+
])
|
|
1384
|
+
], 8, We)),
|
|
1385
|
+
t.value ? (n(), o("div", {
|
|
1386
|
+
key: 1,
|
|
1387
|
+
className: "umds-select__dropdown",
|
|
1388
|
+
style: U(
|
|
1389
|
+
a.searchVariant === "inline" ? {
|
|
1390
|
+
top: "0"
|
|
1391
|
+
} : {}
|
|
1392
|
+
)
|
|
1393
|
+
}, [
|
|
1394
|
+
a.searchable ? (n(), o("div", Ye, [
|
|
1395
|
+
g("div", Je, [
|
|
1396
|
+
N(B, {
|
|
1397
|
+
name: "search",
|
|
1398
|
+
size: "sm"
|
|
1399
|
+
})
|
|
1400
|
+
]),
|
|
1401
|
+
g("input", {
|
|
1402
|
+
type: "text",
|
|
1403
|
+
placeholder: "Buscar...",
|
|
1404
|
+
className: "umds-select__search-input",
|
|
1405
|
+
ref_key: "searchInputRef",
|
|
1406
|
+
ref: v,
|
|
1407
|
+
value: s.value,
|
|
1408
|
+
onInput: f[1] || (f[1] = async (b) => q(b))
|
|
1409
|
+
}, null, 40, Qe),
|
|
1410
|
+
a.searchVariant === "inline" ? (n(), o("div", {
|
|
1411
|
+
key: 0,
|
|
1412
|
+
class: "umds-select__search-close",
|
|
1413
|
+
onClick: f[2] || (f[2] = async (b) => P())
|
|
1414
|
+
}, [
|
|
1415
|
+
N(B, {
|
|
1416
|
+
name: "xmark",
|
|
1417
|
+
size: "sm"
|
|
1418
|
+
})
|
|
1419
|
+
])) : l("", !0)
|
|
1420
|
+
])) : l("", !0),
|
|
1421
|
+
g("div", {
|
|
1422
|
+
className: "umds-select__options",
|
|
1423
|
+
onScroll: f[3] || (f[3] = async (b) => _(b))
|
|
1424
|
+
}, [
|
|
1425
|
+
$.value.length === 0 && !a.loading ? (n(), o("div", Xe, [
|
|
1426
|
+
N(S, {
|
|
1427
|
+
variant: "body2",
|
|
1428
|
+
color: "secondary"
|
|
1429
|
+
}, {
|
|
1430
|
+
default: w(() => [...f[4] || (f[4] = [
|
|
1431
|
+
x(" Nenhum item encontrado ", -1)
|
|
1432
|
+
])]),
|
|
1433
|
+
_: 1
|
|
1434
|
+
})
|
|
1435
|
+
])) : l("", !0),
|
|
1436
|
+
(n(!0), o(T, null, H($.value, (b, j) => (n(), o("div", {
|
|
1437
|
+
key: b.value,
|
|
1438
|
+
onClick: async (E) => D(b),
|
|
1439
|
+
class: L(
|
|
1440
|
+
[
|
|
1441
|
+
"umds-select__option",
|
|
1442
|
+
W(b.value) ? "umds-select__option--selected" : ""
|
|
1443
|
+
].filter(Boolean).join(" ")
|
|
1444
|
+
)
|
|
1445
|
+
}, [
|
|
1446
|
+
a.multiple ? (n(), o("div", ea, [
|
|
1447
|
+
N($e, {
|
|
1448
|
+
checked: W(b.value),
|
|
1449
|
+
readOnly: !0
|
|
1450
|
+
}, null, 8, ["checked"])
|
|
1451
|
+
])) : l("", !0),
|
|
1452
|
+
g("div", aa, [
|
|
1453
|
+
y(C.$slots, "item", {}, () => [
|
|
1454
|
+
N(S, { variant: "body2" }, {
|
|
1455
|
+
default: w(() => [
|
|
1456
|
+
x(p(b.label), 1)
|
|
1457
|
+
]),
|
|
1458
|
+
_: 2
|
|
1459
|
+
}, 1024)
|
|
1460
|
+
])
|
|
1461
|
+
]),
|
|
1462
|
+
!a.multiple && W(b.value) ? (n(), o("div", ta, [
|
|
1463
|
+
N(B, {
|
|
1464
|
+
name: "check",
|
|
1465
|
+
size: "sm"
|
|
1466
|
+
})
|
|
1467
|
+
])) : l("", !0)
|
|
1468
|
+
], 10, _e))), 128)),
|
|
1469
|
+
a.loading && a.pagination ? (n(), o("div", na, [
|
|
1470
|
+
N(K, { size: "sm" }),
|
|
1471
|
+
N(S, { variant: "caption" }, {
|
|
1472
|
+
default: w(() => [...f[5] || (f[5] = [
|
|
1473
|
+
x("Carregando mais...", -1)
|
|
1474
|
+
])]),
|
|
1475
|
+
_: 1
|
|
1476
|
+
})
|
|
1477
|
+
])) : l("", !0)
|
|
1478
|
+
], 32)
|
|
1479
|
+
], 4)) : l("", !0)
|
|
1480
|
+
]),
|
|
1481
|
+
a.errorMessage ? (n(), k(S, {
|
|
1482
|
+
key: 1,
|
|
1483
|
+
variant: "caption",
|
|
1484
|
+
color: "error"
|
|
1485
|
+
}, {
|
|
1486
|
+
default: w(() => [
|
|
1487
|
+
x(p(a.errorMessage), 1)
|
|
1488
|
+
]),
|
|
1489
|
+
_: 1
|
|
1490
|
+
})) : l("", !0),
|
|
1491
|
+
a.description && !a.errorMessage ? (n(), k(S, {
|
|
1492
|
+
key: 2,
|
|
1493
|
+
variant: "caption",
|
|
1494
|
+
color: "secondary"
|
|
1495
|
+
}, {
|
|
1496
|
+
default: w(() => [
|
|
1497
|
+
x(p(a.description), 1)
|
|
1498
|
+
]),
|
|
1499
|
+
_: 1
|
|
1500
|
+
})) : l("", !0),
|
|
1501
|
+
a.multiple && a.selectionDisplay === "list" && u.value.length > 0 ? (n(), o("div", sa, [
|
|
1502
|
+
(n(!0), o(T, null, H(u.value, (b, j) => (n(), o("div", {
|
|
1503
|
+
key: b.value,
|
|
1504
|
+
class: "umds-select__selected-list-item"
|
|
1505
|
+
}, [
|
|
1506
|
+
N(S, { variant: "body2" }, {
|
|
1507
|
+
default: w(() => [
|
|
1508
|
+
x(p(b.label), 1)
|
|
1509
|
+
]),
|
|
1510
|
+
_: 2
|
|
1511
|
+
}, 1024),
|
|
1512
|
+
g("span", {
|
|
1513
|
+
class: "umds-select__list-remove",
|
|
1514
|
+
onClick: async (E) => O(b.value, E)
|
|
1515
|
+
}, [
|
|
1516
|
+
N(B, {
|
|
1517
|
+
name: "trash",
|
|
1518
|
+
size: "sm"
|
|
1519
|
+
})
|
|
1520
|
+
], 8, la)
|
|
1521
|
+
]))), 128))
|
|
1522
|
+
])) : l("", !0)
|
|
1523
|
+
], 2));
|
|
1524
|
+
}
|
|
1525
|
+
}), ia = /* @__PURE__ */ Symbol(), R = {
|
|
1526
|
+
key: ia
|
|
1527
|
+
}, oa = ["aria-label"], Ma = /* @__PURE__ */ I({
|
|
1528
|
+
__name: "Tabs",
|
|
1529
|
+
props: {
|
|
1530
|
+
value: {},
|
|
1531
|
+
onChange: { type: Function },
|
|
1532
|
+
ariaLabel: {},
|
|
1533
|
+
className: {},
|
|
1534
|
+
children: {}
|
|
1535
|
+
},
|
|
1536
|
+
setup(a) {
|
|
1537
|
+
const e = a;
|
|
1538
|
+
Y(R.key, J({ value: Q(e, "value"), onChange: e.onChange }));
|
|
1539
|
+
const t = m(() => ["umds-tabs", e.className].filter(Boolean).join(" "));
|
|
1540
|
+
return (s, i) => (n(), o("div", {
|
|
1541
|
+
class: L(t.value)
|
|
1542
|
+
}, [
|
|
1543
|
+
g("div", {
|
|
1544
|
+
role: "tablist",
|
|
1545
|
+
class: "umds-tabs__list",
|
|
1546
|
+
"aria-label": a.ariaLabel
|
|
1547
|
+
}, [
|
|
1548
|
+
y(s.$slots, "default")
|
|
1549
|
+
], 8, oa)
|
|
1550
|
+
], 2));
|
|
1551
|
+
}
|
|
1552
|
+
}), ra = ["data-tab-index", "aria-selected", "aria-disabled", "tabIndex", "disabled"], ja = /* @__PURE__ */ I({
|
|
1553
|
+
__name: "Tab",
|
|
1554
|
+
props: {
|
|
1555
|
+
label: {},
|
|
1556
|
+
index: {},
|
|
1557
|
+
icon: {},
|
|
1558
|
+
disabled: { type: Boolean },
|
|
1559
|
+
className: {}
|
|
1560
|
+
},
|
|
1561
|
+
setup(a) {
|
|
1562
|
+
const e = a, t = X(R.key), s = m(() => t.value === e.index), i = m(() => [
|
|
1563
|
+
"umds-tabs__tab",
|
|
1564
|
+
s.value ? "umds-tabs__tab--selected" : "",
|
|
1565
|
+
e.disabled ? "umds-tabs__tab--disabled" : "",
|
|
1566
|
+
e.className
|
|
1567
|
+
].filter(Boolean).join(" ")), h = m(() => ["umds-tabs__label", s.value ? "umds-tabs__label--selected" : ""].filter(Boolean).join(" "));
|
|
1568
|
+
function r() {
|
|
1569
|
+
e.disabled || typeof t.onChange == "function" && t.onChange(e.index);
|
|
1570
|
+
}
|
|
1571
|
+
function d(v) {
|
|
1572
|
+
if (e.disabled) return;
|
|
1573
|
+
if (v.key === "Enter" || v.key === " ") {
|
|
1574
|
+
v.preventDefault(), r();
|
|
1575
|
+
return;
|
|
1576
|
+
}
|
|
1577
|
+
const u = v.target.closest('[role="tablist"]');
|
|
1578
|
+
if (!u) return;
|
|
1579
|
+
const c = u.querySelectorAll('[role="tab"]:not([disabled])'), z = Array.from(c).indexOf(v.target);
|
|
1580
|
+
let $ = -1;
|
|
1581
|
+
if (v.key === "ArrowRight" && (v.preventDefault(), $ = (z + 1) % c.length), v.key === "ArrowLeft" && (v.preventDefault(), $ = (z - 1 + c.length) % c.length), v.key === "Home" && (v.preventDefault(), $ = 0), v.key === "End" && (v.preventDefault(), $ = c.length - 1), $ >= 0 && c[$]) {
|
|
1582
|
+
c[$].focus();
|
|
1583
|
+
const F = c[$].getAttribute("data-tab-index");
|
|
1584
|
+
F && typeof t.onChange == "function" && t.onChange(F);
|
|
1585
|
+
}
|
|
1586
|
+
}
|
|
1587
|
+
return (v, u) => (n(), o("button", {
|
|
1588
|
+
role: "tab",
|
|
1589
|
+
"data-tab-index": a.index,
|
|
1590
|
+
"aria-selected": s.value,
|
|
1591
|
+
"aria-disabled": a.disabled,
|
|
1592
|
+
tabIndex: s.value ? 0 : -1,
|
|
1593
|
+
disabled: a.disabled,
|
|
1594
|
+
onClick: u[0] || (u[0] = async (c) => r()),
|
|
1595
|
+
onKeydown: u[1] || (u[1] = async (c) => d(c)),
|
|
1596
|
+
class: L(i.value)
|
|
1597
|
+
}, [
|
|
1598
|
+
a.icon ? (n(), k(B, {
|
|
1599
|
+
key: 0,
|
|
1600
|
+
size: "md",
|
|
1601
|
+
variant: "inherit",
|
|
1602
|
+
name: a.icon
|
|
1603
|
+
}, null, 8, ["name"])) : l("", !0),
|
|
1604
|
+
g("span", {
|
|
1605
|
+
class: L(h.value)
|
|
1606
|
+
}, p(a.label), 3)
|
|
1607
|
+
], 42, ra));
|
|
1608
|
+
}
|
|
1609
|
+
}), Ta = /* @__PURE__ */ I({
|
|
1610
|
+
__name: "TabsContent",
|
|
1611
|
+
props: {
|
|
1612
|
+
value: {},
|
|
1613
|
+
className: {},
|
|
1614
|
+
children: {}
|
|
1615
|
+
},
|
|
1616
|
+
setup(a) {
|
|
1617
|
+
const e = a;
|
|
1618
|
+
return Y(R.key, J({ value: Q(e, "value"), onChange() {
|
|
1619
|
+
} })), (t, s) => (n(), o("div", {
|
|
1620
|
+
class: L(["umds-tabs-content", a.className].filter(Boolean).join(" "))
|
|
1621
|
+
}, [
|
|
1622
|
+
y(t.$slots, "default")
|
|
1623
|
+
], 2));
|
|
1624
|
+
}
|
|
1625
|
+
}), ua = ["data-tab-index"], Fa = /* @__PURE__ */ I({
|
|
1626
|
+
__name: "TabContent",
|
|
1627
|
+
props: {
|
|
1628
|
+
index: {},
|
|
1629
|
+
className: {},
|
|
1630
|
+
children: {}
|
|
1631
|
+
},
|
|
1632
|
+
setup(a) {
|
|
1633
|
+
const e = X(R.key);
|
|
1634
|
+
return (t, s) => te(e).value === a.index ? (n(), o("div", {
|
|
1635
|
+
key: 0,
|
|
1636
|
+
role: "tabpanel",
|
|
1637
|
+
"data-tab-index": a.index,
|
|
1638
|
+
class: L(["umds-tabs__content", a.className].filter(Boolean).join(" "))
|
|
1639
|
+
}, [
|
|
1640
|
+
y(t.$slots, "default")
|
|
1641
|
+
], 10, ua)) : l("", !0);
|
|
1642
|
+
}
|
|
1643
|
+
}), da = {
|
|
1644
|
+
key: 0,
|
|
1645
|
+
class: "umds-modal__close-wrapper"
|
|
1646
|
+
}, ca = { className: "umds-modal__content" }, ma = { class: "umds-modal__header" }, va = { className: "umds-modal__text-group" }, ha = { class: "umds-modal__footer" }, Aa = /* @__PURE__ */ I({
|
|
1647
|
+
__name: "Modal",
|
|
1648
|
+
props: {
|
|
1649
|
+
open: { type: Boolean },
|
|
1650
|
+
variant: {},
|
|
1651
|
+
title: {},
|
|
1652
|
+
description: {},
|
|
1653
|
+
confirmLabel: {},
|
|
1654
|
+
cancelLabel: {},
|
|
1655
|
+
onConfirm: { type: Function },
|
|
1656
|
+
onCancel: { type: Function },
|
|
1657
|
+
onClose: { type: Function },
|
|
1658
|
+
hideCloseButton: { type: Boolean },
|
|
1659
|
+
closeOnOverlayClick: { type: Boolean },
|
|
1660
|
+
className: {},
|
|
1661
|
+
inline: { type: Boolean },
|
|
1662
|
+
footerSlot: {},
|
|
1663
|
+
children: {}
|
|
1664
|
+
},
|
|
1665
|
+
setup(a) {
|
|
1666
|
+
const e = a, t = m(() => [
|
|
1667
|
+
e.inline ? "umds-modal-root--inline" : "umds-modal-root",
|
|
1668
|
+
e.open ? "umds-modal-root--open" : "umds-modal-root--closed"
|
|
1669
|
+
].filter(Boolean).join(" ")), s = m(() => [
|
|
1670
|
+
"umds-modal",
|
|
1671
|
+
`umds-modal--${e.variant || "default"}`,
|
|
1672
|
+
e.className
|
|
1673
|
+
].filter(Boolean).join(" ")), i = m(() => {
|
|
1674
|
+
switch (e.variant) {
|
|
1675
|
+
case "success":
|
|
1676
|
+
return "check-circle";
|
|
1677
|
+
case "error":
|
|
1678
|
+
return "warning-circle";
|
|
1679
|
+
case "warning":
|
|
1680
|
+
return "warning-triangle";
|
|
1681
|
+
default:
|
|
1682
|
+
return "";
|
|
1683
|
+
}
|
|
1684
|
+
}), h = m(() => e.variant ? `umds-modal__icon--${e.variant}` : "");
|
|
1685
|
+
function r(v) {
|
|
1686
|
+
e.onClose ? e.onClose(v) : e.onCancel && e.onCancel(v);
|
|
1687
|
+
}
|
|
1688
|
+
function d(v) {
|
|
1689
|
+
e.closeOnOverlayClick !== !1 && r(v);
|
|
1690
|
+
}
|
|
1691
|
+
return (v, u) => a.open ? (n(), o("div", {
|
|
1692
|
+
key: 0,
|
|
1693
|
+
class: L(t.value)
|
|
1694
|
+
}, [
|
|
1695
|
+
g("div", {
|
|
1696
|
+
class: "umds-modal-overlay",
|
|
1697
|
+
onClick: u[0] || (u[0] = async (c) => d(c))
|
|
1698
|
+
}),
|
|
1699
|
+
g("div", {
|
|
1700
|
+
role: "dialog",
|
|
1701
|
+
"aria-modal": "true",
|
|
1702
|
+
class: L(s.value)
|
|
1703
|
+
}, [
|
|
1704
|
+
a.hideCloseButton ? l("", !0) : (n(), o("div", da, [
|
|
1705
|
+
g("button", {
|
|
1706
|
+
"aria-label": "Fechar",
|
|
1707
|
+
class: "umds-modal__close-button",
|
|
1708
|
+
onClick: u[1] || (u[1] = async (c) => r(c))
|
|
1709
|
+
}, [
|
|
1710
|
+
N(B, {
|
|
1711
|
+
name: "xmark",
|
|
1712
|
+
size: "sm"
|
|
1713
|
+
})
|
|
1714
|
+
])
|
|
1715
|
+
])),
|
|
1716
|
+
g("div", ca, [
|
|
1717
|
+
g("div", ma, [
|
|
1718
|
+
a.variant && a.variant !== "default" ? (n(), o("div", {
|
|
1719
|
+
key: 0,
|
|
1720
|
+
class: L(`umds-modal__icon ${h.value}`)
|
|
1721
|
+
}, [
|
|
1722
|
+
N(B, {
|
|
1723
|
+
customSize: "80px",
|
|
1724
|
+
name: i.value
|
|
1725
|
+
}, null, 8, ["name"])
|
|
1726
|
+
], 2)) : l("", !0),
|
|
1727
|
+
g("div", va, [
|
|
1728
|
+
a.title ? (n(), k(S, {
|
|
1729
|
+
key: 0,
|
|
1730
|
+
variant: "h5",
|
|
1731
|
+
weight: "bold"
|
|
1732
|
+
}, {
|
|
1733
|
+
default: w(() => [
|
|
1734
|
+
x(p(a.title), 1)
|
|
1735
|
+
]),
|
|
1736
|
+
_: 1
|
|
1737
|
+
})) : l("", !0),
|
|
1738
|
+
a.description ? (n(), k(S, {
|
|
1739
|
+
key: 1,
|
|
1740
|
+
variant: "body2",
|
|
1741
|
+
color: "secondary"
|
|
1742
|
+
}, {
|
|
1743
|
+
default: w(() => [
|
|
1744
|
+
x(p(a.description), 1)
|
|
1745
|
+
]),
|
|
1746
|
+
_: 1
|
|
1747
|
+
})) : l("", !0)
|
|
1748
|
+
])
|
|
1749
|
+
]),
|
|
1750
|
+
y(v.$slots, "default"),
|
|
1751
|
+
g("div", ha, [
|
|
1752
|
+
a.footerSlot ? y(v.$slots, "footer-slot", { key: 0 }) : l("", !0),
|
|
1753
|
+
a.footerSlot ? l("", !0) : (n(), o(T, { key: 1 }, [
|
|
1754
|
+
a.cancelLabel ? (n(), k(G, {
|
|
1755
|
+
key: 0,
|
|
1756
|
+
variant: "text",
|
|
1757
|
+
onClick: (c) => a.onCancel?.(c)
|
|
1758
|
+
}, {
|
|
1759
|
+
default: w(() => [
|
|
1760
|
+
x(p(a.cancelLabel), 1)
|
|
1761
|
+
]),
|
|
1762
|
+
_: 1
|
|
1763
|
+
}, 8, ["onClick"])) : l("", !0),
|
|
1764
|
+
a.confirmLabel ? (n(), k(G, {
|
|
1765
|
+
key: 1,
|
|
1766
|
+
variant: "primary",
|
|
1767
|
+
onClick: (c) => a.onConfirm?.(c)
|
|
1768
|
+
}, {
|
|
1769
|
+
default: w(() => [
|
|
1770
|
+
x(p(a.confirmLabel), 1)
|
|
1771
|
+
]),
|
|
1772
|
+
_: 1
|
|
1773
|
+
}, 8, ["onClick"])) : l("", !0)
|
|
1774
|
+
], 64))
|
|
1775
|
+
])
|
|
1776
|
+
])
|
|
1777
|
+
], 2)
|
|
1778
|
+
], 2)) : l("", !0);
|
|
1779
|
+
}
|
|
1780
|
+
}), fa = { class: "umds-alert__icon-wrapper" }, ya = { className: "umds-alert__content" }, ga = {
|
|
1781
|
+
key: 0,
|
|
1782
|
+
class: "umds-alert__title-container"
|
|
1783
|
+
}, ba = {
|
|
1784
|
+
key: 2,
|
|
1785
|
+
class: "umds-alert__actions"
|
|
1786
|
+
}, Ea = /* @__PURE__ */ I({
|
|
1787
|
+
__name: "Alert",
|
|
1788
|
+
props: {
|
|
1789
|
+
title: {},
|
|
1790
|
+
description: {},
|
|
1791
|
+
type: {},
|
|
1792
|
+
variant: {},
|
|
1793
|
+
verticalPosition: {},
|
|
1794
|
+
horizontalPosition: {},
|
|
1795
|
+
time: {},
|
|
1796
|
+
dismissable: { type: Boolean },
|
|
1797
|
+
content: {},
|
|
1798
|
+
children: {},
|
|
1799
|
+
className: {},
|
|
1800
|
+
onClose: { type: Function }
|
|
1801
|
+
},
|
|
1802
|
+
setup(a) {
|
|
1803
|
+
const e = a, t = M(!0), s = M(0);
|
|
1804
|
+
Z(() => {
|
|
1805
|
+
const d = typeof e.time == "number" ? e.time : 0;
|
|
1806
|
+
d > 0 && (s.value = setTimeout(() => {
|
|
1807
|
+
r(null);
|
|
1808
|
+
}, d));
|
|
1809
|
+
}), ne(() => {
|
|
1810
|
+
s.value && clearTimeout(s.value);
|
|
1811
|
+
});
|
|
1812
|
+
const i = m(() => [
|
|
1813
|
+
"umds-alert",
|
|
1814
|
+
`umds-alert--${e.type || "neutral"}`,
|
|
1815
|
+
`umds-alert--${e.variant || "soft"}`,
|
|
1816
|
+
`umds-alert--${e.verticalPosition || "top"}-${e.horizontalPosition || "right"}`,
|
|
1817
|
+
e.className
|
|
1818
|
+
].filter(Boolean).join(" ")), h = m(() => {
|
|
1819
|
+
const d = e.type || "neutral";
|
|
1820
|
+
return d === "success" ? "check-circle" : d === "error" ? "xmark-circle" : d === "warning" ? "warning-triangle" : "info-circle";
|
|
1821
|
+
});
|
|
1822
|
+
function r(d) {
|
|
1823
|
+
d && d.stopPropagation(), t.value = !1, e.onClose && e.onClose(d);
|
|
1824
|
+
}
|
|
1825
|
+
return (d, v) => t.value ? (n(), o("div", V({
|
|
1826
|
+
key: 0,
|
|
1827
|
+
role: "alert"
|
|
1828
|
+
}, d.$props, { class: i.value }), [
|
|
1829
|
+
g("div", fa, [
|
|
1830
|
+
N(B, {
|
|
1831
|
+
variant: "inherit",
|
|
1832
|
+
size: "md",
|
|
1833
|
+
name: h.value
|
|
1834
|
+
}, null, 8, ["name"])
|
|
1835
|
+
]),
|
|
1836
|
+
g("div", ya, [
|
|
1837
|
+
a.title ? (n(), o("div", ga, [
|
|
1838
|
+
N(S, {
|
|
1839
|
+
variant: "body2",
|
|
1840
|
+
as: "p"
|
|
1841
|
+
}, {
|
|
1842
|
+
default: w(() => [
|
|
1843
|
+
x(p(a.title), 1)
|
|
1844
|
+
]),
|
|
1845
|
+
_: 1
|
|
1846
|
+
})
|
|
1847
|
+
])) : l("", !0),
|
|
1848
|
+
a.description ? (n(), k(S, {
|
|
1849
|
+
key: 1,
|
|
1850
|
+
variant: "caption",
|
|
1851
|
+
as: "p"
|
|
1852
|
+
}, {
|
|
1853
|
+
default: w(() => [
|
|
1854
|
+
x(p(a.description), 1)
|
|
1855
|
+
]),
|
|
1856
|
+
_: 1
|
|
1857
|
+
})) : l("", !0),
|
|
1858
|
+
a.content || d.$slots.default ? (n(), o("div", ba, [
|
|
1859
|
+
y(d.$slots, "content", {}, () => [
|
|
1860
|
+
x(p(a.content || d.$slots.default), 1)
|
|
1861
|
+
])
|
|
1862
|
+
])) : l("", !0)
|
|
1863
|
+
]),
|
|
1864
|
+
a.dismissable ? (n(), o("button", {
|
|
1865
|
+
key: 0,
|
|
1866
|
+
type: "button",
|
|
1867
|
+
"aria-label": "Dispensar alerta",
|
|
1868
|
+
class: "umds-alert__close",
|
|
1869
|
+
onClick: v[0] || (v[0] = async (u) => r(u))
|
|
1870
|
+
}, [
|
|
1871
|
+
N(B, {
|
|
1872
|
+
name: "nav-arrow-up",
|
|
1873
|
+
variant: "inherit",
|
|
1874
|
+
size: "md"
|
|
1875
|
+
})
|
|
1876
|
+
])) : l("", !0)
|
|
1877
|
+
], 16)) : l("", !0);
|
|
1878
|
+
}
|
|
1879
|
+
});
|
|
1880
|
+
export {
|
|
1881
|
+
Ea as Alert,
|
|
1882
|
+
$a as Avatar,
|
|
1883
|
+
xa as AvatarGroup,
|
|
1884
|
+
pa as Badge,
|
|
1885
|
+
G as Button,
|
|
1886
|
+
$e as Checkbox,
|
|
1887
|
+
Ca as Divider,
|
|
1888
|
+
Ia as Grid,
|
|
1889
|
+
B as Icon,
|
|
1890
|
+
Sa as Input,
|
|
1891
|
+
Ba as Link,
|
|
1892
|
+
za as Logo,
|
|
1893
|
+
Aa as Modal,
|
|
1894
|
+
Na as Radio,
|
|
1895
|
+
La as Select,
|
|
1896
|
+
K as Spinner,
|
|
1897
|
+
wa as Switch,
|
|
1898
|
+
ja as Tab,
|
|
1899
|
+
Fa as TabContent,
|
|
1900
|
+
Ma as Tabs,
|
|
1901
|
+
Ta as TabsContent,
|
|
1902
|
+
qe as Tag,
|
|
1903
|
+
S as Text,
|
|
1904
|
+
Va as Textarea
|
|
1905
|
+
};
|