@datametria/vue-components 1.1.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/ACCESSIBILITY.md +78 -0
- package/DESIGN-SYSTEM.md +70 -0
- package/LICENSE +21 -0
- package/PROGRESS.md +327 -0
- package/README.md +473 -0
- package/dist/index.es.js +1405 -0
- package/dist/index.umd.js +1 -0
- package/dist/vue-components.css +1 -0
- package/package.json +98 -0
- package/src/components/DatametriaAlert.vue +123 -0
- package/src/components/DatametriaAutocomplete.vue +292 -0
- package/src/components/DatametriaAvatar.vue +99 -0
- package/src/components/DatametriaBadge.vue +90 -0
- package/src/components/DatametriaBreadcrumb.vue +144 -0
- package/src/components/DatametriaButton.vue +157 -0
- package/src/components/DatametriaCard.vue +72 -0
- package/src/components/DatametriaCheckbox.vue +82 -0
- package/src/components/DatametriaChip.vue +149 -0
- package/src/components/DatametriaContainer.vue +57 -0
- package/src/components/DatametriaDatePicker.vue +140 -0
- package/src/components/DatametriaDivider.vue +100 -0
- package/src/components/DatametriaFileUpload.vue +268 -0
- package/src/components/DatametriaGrid.vue +44 -0
- package/src/components/DatametriaInput.vue +102 -0
- package/src/components/DatametriaModal.vue +135 -0
- package/src/components/DatametriaNavbar.vue +227 -0
- package/src/components/DatametriaProgress.vue +113 -0
- package/src/components/DatametriaRadio.vue +138 -0
- package/src/components/DatametriaSelect.vue +112 -0
- package/src/components/DatametriaSpinner.vue +112 -0
- package/src/components/DatametriaSwitch.vue +137 -0
- package/src/components/DatametriaTable.vue +105 -0
- package/src/components/DatametriaTabs.vue +180 -0
- package/src/components/DatametriaTextarea.vue +159 -0
- package/src/components/DatametriaToast.vue +163 -0
- package/src/composables/useAPI.ts +78 -0
- package/src/composables/useClipboard.ts +42 -0
- package/src/composables/useDebounce.ts +16 -0
- package/src/composables/useLocalStorage.ts +26 -0
- package/src/composables/useTheme.ts +66 -0
- package/src/composables/useValidation.ts +39 -0
- package/src/index.ts +52 -0
- package/src/styles/design-tokens.css +31 -0
- package/src/types/index.ts +34 -0
package/dist/index.es.js
ADDED
|
@@ -0,0 +1,1405 @@
|
|
|
1
|
+
import { defineComponent as f, computed as C, createElementBlock as t, openBlock as a, normalizeClass as y, createCommentVNode as c, renderSlot as p, createElementVNode as i, createTextVNode as w, toDisplayString as m, Fragment as B, renderList as L, ref as k, watch as T, withDirectives as N, vModelText as R, withModifiers as S, onMounted as P, onUnmounted as X, createBlock as K, Teleport as j, createVNode as G, Transition as H, withCtx as J, normalizeStyle as A, withKeys as U } from "vue";
|
|
2
|
+
var W = /* @__PURE__ */ ((e) => (e.PRIMARY = "primary", e.SECONDARY = "secondary", e.OUTLINE = "outline", e.GHOST = "ghost", e))(W || {}), Y = /* @__PURE__ */ ((e) => (e.SM = "sm", e.MD = "md", e.LG = "lg", e))(Y || {});
|
|
3
|
+
const Z = ["disabled", "type", "aria-busy", "aria-disabled"], ee = {
|
|
4
|
+
key: 0,
|
|
5
|
+
class: "spinner",
|
|
6
|
+
role: "status",
|
|
7
|
+
"aria-label": "Carregando"
|
|
8
|
+
}, ae = /* @__PURE__ */ f({
|
|
9
|
+
__name: "DatametriaButton",
|
|
10
|
+
props: {
|
|
11
|
+
variant: { default: W.PRIMARY },
|
|
12
|
+
size: { default: Y.MD },
|
|
13
|
+
disabled: { type: Boolean, default: !1 },
|
|
14
|
+
loading: { type: Boolean, default: !1 },
|
|
15
|
+
fullWidth: { type: Boolean, default: !1 },
|
|
16
|
+
type: { default: "button" }
|
|
17
|
+
},
|
|
18
|
+
emits: ["click"],
|
|
19
|
+
setup(e) {
|
|
20
|
+
const l = e, s = C(() => [
|
|
21
|
+
"datametria-button",
|
|
22
|
+
`datametria-button--${l.variant}`,
|
|
23
|
+
`datametria-button--${l.size}`,
|
|
24
|
+
{
|
|
25
|
+
"datametria-button--full-width": l.fullWidth,
|
|
26
|
+
"datametria-button--loading": l.loading,
|
|
27
|
+
"datametria-button--disabled": l.disabled
|
|
28
|
+
}
|
|
29
|
+
]);
|
|
30
|
+
return (o, r) => (a(), t("button", {
|
|
31
|
+
class: y(s.value),
|
|
32
|
+
disabled: e.disabled || e.loading,
|
|
33
|
+
type: e.type,
|
|
34
|
+
"aria-busy": e.loading,
|
|
35
|
+
"aria-disabled": e.disabled,
|
|
36
|
+
onClick: r[0] || (r[0] = (d) => o.$emit("click", d))
|
|
37
|
+
}, [
|
|
38
|
+
e.loading ? (a(), t("span", ee)) : c("", !0),
|
|
39
|
+
p(o.$slots, "default", {}, void 0, !0)
|
|
40
|
+
], 10, Z));
|
|
41
|
+
}
|
|
42
|
+
}), _ = (e, l) => {
|
|
43
|
+
const s = e.__vccOpts || e;
|
|
44
|
+
for (const [o, r] of l)
|
|
45
|
+
s[o] = r;
|
|
46
|
+
return s;
|
|
47
|
+
}, Et = /* @__PURE__ */ _(ae, [["__scopeId", "data-v-e9850b65"]]), te = { class: "datametria-input" }, le = ["for"], se = {
|
|
48
|
+
key: 0,
|
|
49
|
+
class: "datametria-input__required"
|
|
50
|
+
}, re = ["id", "value", "placeholder", "disabled", "required"], de = {
|
|
51
|
+
key: 1,
|
|
52
|
+
class: "datametria-input__error"
|
|
53
|
+
}, oe = /* @__PURE__ */ f({
|
|
54
|
+
__name: "DatametriaInput",
|
|
55
|
+
props: {
|
|
56
|
+
modelValue: { default: "" },
|
|
57
|
+
label: {},
|
|
58
|
+
placeholder: {},
|
|
59
|
+
errorMessage: {},
|
|
60
|
+
disabled: { type: Boolean, default: !1 },
|
|
61
|
+
required: { type: Boolean, default: !1 }
|
|
62
|
+
},
|
|
63
|
+
emits: ["update:modelValue"],
|
|
64
|
+
setup(e) {
|
|
65
|
+
const l = e, s = C(() => `input-${Math.random().toString(36).substr(2, 9)}`), o = C(() => [
|
|
66
|
+
"datametria-input__field",
|
|
67
|
+
{
|
|
68
|
+
"datametria-input__field--error": l.errorMessage,
|
|
69
|
+
"datametria-input__field--disabled": l.disabled
|
|
70
|
+
}
|
|
71
|
+
]);
|
|
72
|
+
return (r, d) => (a(), t("div", te, [
|
|
73
|
+
e.label ? (a(), t("label", {
|
|
74
|
+
key: 0,
|
|
75
|
+
for: s.value,
|
|
76
|
+
class: "datametria-input__label"
|
|
77
|
+
}, [
|
|
78
|
+
w(m(e.label) + " ", 1),
|
|
79
|
+
e.required ? (a(), t("span", se, "*")) : c("", !0)
|
|
80
|
+
], 8, le)) : c("", !0),
|
|
81
|
+
i("input", {
|
|
82
|
+
id: s.value,
|
|
83
|
+
value: e.modelValue,
|
|
84
|
+
placeholder: e.placeholder,
|
|
85
|
+
disabled: e.disabled,
|
|
86
|
+
required: e.required,
|
|
87
|
+
class: y(o.value),
|
|
88
|
+
onInput: d[0] || (d[0] = (n) => r.$emit("update:modelValue", n.target.value))
|
|
89
|
+
}, null, 42, re),
|
|
90
|
+
e.errorMessage ? (a(), t("p", de, m(e.errorMessage), 1)) : c("", !0)
|
|
91
|
+
]));
|
|
92
|
+
}
|
|
93
|
+
}), At = /* @__PURE__ */ _(oe, [["__scopeId", "data-v-cae54108"]]), ie = { class: "datametria-select" }, ne = ["for"], ce = {
|
|
94
|
+
key: 0,
|
|
95
|
+
class: "datametria-select__required"
|
|
96
|
+
}, ue = ["id", "value", "disabled", "required"], me = {
|
|
97
|
+
key: 0,
|
|
98
|
+
value: "",
|
|
99
|
+
disabled: ""
|
|
100
|
+
}, be = ["value"], ve = {
|
|
101
|
+
key: 1,
|
|
102
|
+
class: "datametria-select__error"
|
|
103
|
+
}, he = /* @__PURE__ */ f({
|
|
104
|
+
__name: "DatametriaSelect",
|
|
105
|
+
props: {
|
|
106
|
+
modelValue: { default: "" },
|
|
107
|
+
options: {},
|
|
108
|
+
label: {},
|
|
109
|
+
placeholder: {},
|
|
110
|
+
errorMessage: {},
|
|
111
|
+
disabled: { type: Boolean, default: !1 },
|
|
112
|
+
required: { type: Boolean, default: !1 }
|
|
113
|
+
},
|
|
114
|
+
emits: ["update:modelValue"],
|
|
115
|
+
setup(e) {
|
|
116
|
+
const l = e, s = C(() => `select-${Math.random().toString(36).substr(2, 9)}`), o = C(() => [
|
|
117
|
+
"datametria-select__field",
|
|
118
|
+
{
|
|
119
|
+
"datametria-select__field--error": l.errorMessage,
|
|
120
|
+
"datametria-select__field--disabled": l.disabled
|
|
121
|
+
}
|
|
122
|
+
]);
|
|
123
|
+
return (r, d) => (a(), t("div", ie, [
|
|
124
|
+
e.label ? (a(), t("label", {
|
|
125
|
+
key: 0,
|
|
126
|
+
for: s.value,
|
|
127
|
+
class: "datametria-select__label"
|
|
128
|
+
}, [
|
|
129
|
+
w(m(e.label) + " ", 1),
|
|
130
|
+
e.required ? (a(), t("span", ce, "*")) : c("", !0)
|
|
131
|
+
], 8, ne)) : c("", !0),
|
|
132
|
+
i("select", {
|
|
133
|
+
id: s.value,
|
|
134
|
+
value: e.modelValue,
|
|
135
|
+
disabled: e.disabled,
|
|
136
|
+
required: e.required,
|
|
137
|
+
class: y(o.value),
|
|
138
|
+
onChange: d[0] || (d[0] = (n) => r.$emit("update:modelValue", n.target.value))
|
|
139
|
+
}, [
|
|
140
|
+
e.placeholder ? (a(), t("option", me, m(e.placeholder), 1)) : c("", !0),
|
|
141
|
+
(a(!0), t(B, null, L(e.options, (n) => (a(), t("option", {
|
|
142
|
+
key: n.value,
|
|
143
|
+
value: n.value
|
|
144
|
+
}, m(n.label), 9, be))), 128))
|
|
145
|
+
], 42, ue),
|
|
146
|
+
e.errorMessage ? (a(), t("p", ve, m(e.errorMessage), 1)) : c("", !0)
|
|
147
|
+
]));
|
|
148
|
+
}
|
|
149
|
+
}), Ot = /* @__PURE__ */ _(he, [["__scopeId", "data-v-96f4e8ce"]]), fe = { class: "datametria-checkbox" }, _e = ["checked", "disabled"], $e = {
|
|
150
|
+
key: 0,
|
|
151
|
+
class: "datametria-checkbox__label"
|
|
152
|
+
}, ye = /* @__PURE__ */ f({
|
|
153
|
+
__name: "DatametriaCheckbox",
|
|
154
|
+
props: {
|
|
155
|
+
modelValue: { type: Boolean, default: !1 },
|
|
156
|
+
label: {},
|
|
157
|
+
disabled: { type: Boolean, default: !1 }
|
|
158
|
+
},
|
|
159
|
+
emits: ["update:modelValue"],
|
|
160
|
+
setup(e) {
|
|
161
|
+
return (l, s) => (a(), t("label", fe, [
|
|
162
|
+
i("input", {
|
|
163
|
+
type: "checkbox",
|
|
164
|
+
checked: e.modelValue,
|
|
165
|
+
disabled: e.disabled,
|
|
166
|
+
class: "datametria-checkbox__input",
|
|
167
|
+
onChange: s[0] || (s[0] = (o) => l.$emit("update:modelValue", o.target.checked))
|
|
168
|
+
}, null, 40, _e),
|
|
169
|
+
s[1] || (s[1] = i("span", { class: "datametria-checkbox__checkmark" }, null, -1)),
|
|
170
|
+
e.label ? (a(), t("span", $e, m(e.label), 1)) : c("", !0)
|
|
171
|
+
]));
|
|
172
|
+
}
|
|
173
|
+
}), Nt = /* @__PURE__ */ _(ye, [["__scopeId", "data-v-3226ffd6"]]), ke = { class: "dm-radio" }, pe = { class: "dm-radio__label" }, ge = ["value", "checked", "disabled", "name", "aria-label", "aria-describedby"], De = {
|
|
174
|
+
key: 0,
|
|
175
|
+
class: "dm-radio__text"
|
|
176
|
+
}, Ve = ["id"], we = /* @__PURE__ */ f({
|
|
177
|
+
__name: "DatametriaRadio",
|
|
178
|
+
props: {
|
|
179
|
+
modelValue: { type: [String, Number, Boolean] },
|
|
180
|
+
value: { type: [String, Number, Boolean] },
|
|
181
|
+
label: {},
|
|
182
|
+
name: {},
|
|
183
|
+
disabled: { type: Boolean, default: !1 },
|
|
184
|
+
error: {},
|
|
185
|
+
ariaLabel: {}
|
|
186
|
+
},
|
|
187
|
+
emits: ["update:modelValue"],
|
|
188
|
+
setup(e, { emit: l }) {
|
|
189
|
+
const s = e, o = l, r = () => {
|
|
190
|
+
s.disabled || o("update:modelValue", s.value);
|
|
191
|
+
};
|
|
192
|
+
return (d, n) => (a(), t("div", ke, [
|
|
193
|
+
i("label", pe, [
|
|
194
|
+
i("input", {
|
|
195
|
+
type: "radio",
|
|
196
|
+
class: "dm-radio__input",
|
|
197
|
+
value: e.value,
|
|
198
|
+
checked: e.modelValue === e.value,
|
|
199
|
+
disabled: e.disabled,
|
|
200
|
+
name: e.name,
|
|
201
|
+
"aria-label": e.ariaLabel,
|
|
202
|
+
"aria-describedby": e.error ? `${e.name}-error` : void 0,
|
|
203
|
+
onChange: r
|
|
204
|
+
}, null, 40, ge),
|
|
205
|
+
n[0] || (n[0] = i("span", { class: "dm-radio__checkmark" }, null, -1)),
|
|
206
|
+
e.label ? (a(), t("span", De, m(e.label), 1)) : c("", !0)
|
|
207
|
+
]),
|
|
208
|
+
e.error ? (a(), t("p", {
|
|
209
|
+
key: 0,
|
|
210
|
+
id: `${e.name}-error`,
|
|
211
|
+
class: "dm-radio__error"
|
|
212
|
+
}, m(e.error), 9, Ve)) : c("", !0)
|
|
213
|
+
]));
|
|
214
|
+
}
|
|
215
|
+
}), Rt = /* @__PURE__ */ _(we, [["__scopeId", "data-v-4fb0fa6f"]]), Ce = { class: "dm-switch" }, Ie = { class: "dm-switch__label" }, Be = ["checked", "disabled", "aria-label", "aria-checked"], Le = {
|
|
216
|
+
key: 0,
|
|
217
|
+
class: "dm-switch__text"
|
|
218
|
+
}, Me = {
|
|
219
|
+
key: 0,
|
|
220
|
+
class: "dm-switch__error"
|
|
221
|
+
}, qe = /* @__PURE__ */ f({
|
|
222
|
+
__name: "DatametriaSwitch",
|
|
223
|
+
props: {
|
|
224
|
+
modelValue: { type: Boolean, default: !1 },
|
|
225
|
+
label: {},
|
|
226
|
+
disabled: { type: Boolean, default: !1 },
|
|
227
|
+
error: {},
|
|
228
|
+
ariaLabel: {}
|
|
229
|
+
},
|
|
230
|
+
emits: ["update:modelValue"],
|
|
231
|
+
setup(e, { emit: l }) {
|
|
232
|
+
const s = e, o = l, r = (d) => {
|
|
233
|
+
s.disabled || o("update:modelValue", d.target.checked);
|
|
234
|
+
};
|
|
235
|
+
return (d, n) => (a(), t("div", Ce, [
|
|
236
|
+
i("label", Ie, [
|
|
237
|
+
i("input", {
|
|
238
|
+
type: "checkbox",
|
|
239
|
+
class: "dm-switch__input",
|
|
240
|
+
checked: e.modelValue,
|
|
241
|
+
disabled: e.disabled,
|
|
242
|
+
"aria-label": e.ariaLabel,
|
|
243
|
+
"aria-checked": e.modelValue,
|
|
244
|
+
role: "switch",
|
|
245
|
+
onChange: r
|
|
246
|
+
}, null, 40, Be),
|
|
247
|
+
n[0] || (n[0] = i("span", { class: "dm-switch__track" }, [
|
|
248
|
+
i("span", { class: "dm-switch__thumb" })
|
|
249
|
+
], -1)),
|
|
250
|
+
e.label ? (a(), t("span", Le, m(e.label), 1)) : c("", !0)
|
|
251
|
+
]),
|
|
252
|
+
e.error ? (a(), t("p", Me, m(e.error), 1)) : c("", !0)
|
|
253
|
+
]));
|
|
254
|
+
}
|
|
255
|
+
}), Ut = /* @__PURE__ */ _(qe, [["__scopeId", "data-v-f57b4d9a"]]), Te = { class: "dm-textarea" }, xe = {
|
|
256
|
+
key: 0,
|
|
257
|
+
class: "dm-textarea__required"
|
|
258
|
+
}, Se = ["placeholder", "disabled", "required", "rows", "maxlength", "aria-label", "aria-describedby", "aria-invalid"], ze = {
|
|
259
|
+
key: 1,
|
|
260
|
+
class: "dm-textarea__footer"
|
|
261
|
+
}, Ee = ["id"], Ae = {
|
|
262
|
+
key: 1,
|
|
263
|
+
class: "dm-textarea__counter"
|
|
264
|
+
}, Oe = /* @__PURE__ */ f({
|
|
265
|
+
__name: "DatametriaTextarea",
|
|
266
|
+
props: {
|
|
267
|
+
modelValue: { default: "" },
|
|
268
|
+
label: {},
|
|
269
|
+
placeholder: {},
|
|
270
|
+
disabled: { type: Boolean, default: !1 },
|
|
271
|
+
required: { type: Boolean, default: !1 },
|
|
272
|
+
error: {},
|
|
273
|
+
rows: { default: 4 },
|
|
274
|
+
maxLength: {},
|
|
275
|
+
ariaLabel: {}
|
|
276
|
+
},
|
|
277
|
+
emits: ["update:modelValue"],
|
|
278
|
+
setup(e, { emit: l }) {
|
|
279
|
+
const s = e, o = l, r = `dm-textarea-${Math.random().toString(36).substr(2, 9)}`, d = k(s.modelValue);
|
|
280
|
+
T(() => s.modelValue, (u) => {
|
|
281
|
+
d.value = u;
|
|
282
|
+
});
|
|
283
|
+
const n = () => {
|
|
284
|
+
o("update:modelValue", d.value || "");
|
|
285
|
+
};
|
|
286
|
+
return (u, b) => {
|
|
287
|
+
var h;
|
|
288
|
+
return a(), t("div", Te, [
|
|
289
|
+
e.label ? (a(), t("label", {
|
|
290
|
+
key: 0,
|
|
291
|
+
for: r,
|
|
292
|
+
class: "dm-textarea__label"
|
|
293
|
+
}, [
|
|
294
|
+
w(m(e.label) + " ", 1),
|
|
295
|
+
e.required ? (a(), t("span", xe, "*")) : c("", !0)
|
|
296
|
+
])) : c("", !0),
|
|
297
|
+
N(i("textarea", {
|
|
298
|
+
id: r,
|
|
299
|
+
"onUpdate:modelValue": b[0] || (b[0] = (v) => d.value = v),
|
|
300
|
+
class: y(["dm-textarea__input", { "dm-textarea__input--error": e.error }]),
|
|
301
|
+
placeholder: e.placeholder,
|
|
302
|
+
disabled: e.disabled,
|
|
303
|
+
required: e.required,
|
|
304
|
+
rows: e.rows,
|
|
305
|
+
maxlength: e.maxLength,
|
|
306
|
+
"aria-label": e.ariaLabel,
|
|
307
|
+
"aria-describedby": e.error ? `${r}-error` : void 0,
|
|
308
|
+
"aria-invalid": !!e.error,
|
|
309
|
+
onInput: n
|
|
310
|
+
}, null, 42, Se), [
|
|
311
|
+
[R, d.value]
|
|
312
|
+
]),
|
|
313
|
+
e.maxLength || e.error ? (a(), t("div", ze, [
|
|
314
|
+
e.error ? (a(), t("p", {
|
|
315
|
+
key: 0,
|
|
316
|
+
id: `${r}-error`,
|
|
317
|
+
class: "dm-textarea__error"
|
|
318
|
+
}, m(e.error), 9, Ee)) : c("", !0),
|
|
319
|
+
e.maxLength ? (a(), t("span", Ae, m(((h = d.value) == null ? void 0 : h.length) || 0) + "/" + m(e.maxLength), 1)) : c("", !0)
|
|
320
|
+
])) : c("", !0)
|
|
321
|
+
]);
|
|
322
|
+
};
|
|
323
|
+
}
|
|
324
|
+
}), Ft = /* @__PURE__ */ _(Oe, [["__scopeId", "data-v-e9253798"]]), Ne = { class: "dm-datepicker" }, Re = {
|
|
325
|
+
key: 0,
|
|
326
|
+
class: "dm-datepicker__required"
|
|
327
|
+
}, Ue = { class: "dm-datepicker__wrapper" }, Fe = ["disabled", "required", "min", "max", "aria-label", "aria-describedby", "aria-invalid"], Pe = ["id"], Ke = /* @__PURE__ */ f({
|
|
328
|
+
__name: "DatametriaDatePicker",
|
|
329
|
+
props: {
|
|
330
|
+
modelValue: { default: "" },
|
|
331
|
+
label: {},
|
|
332
|
+
disabled: { type: Boolean, default: !1 },
|
|
333
|
+
required: { type: Boolean, default: !1 },
|
|
334
|
+
error: {},
|
|
335
|
+
min: {},
|
|
336
|
+
max: {},
|
|
337
|
+
ariaLabel: {}
|
|
338
|
+
},
|
|
339
|
+
emits: ["update:modelValue"],
|
|
340
|
+
setup(e, { emit: l }) {
|
|
341
|
+
const s = e, o = l, r = `dm-datepicker-${Math.random().toString(36).substr(2, 9)}`, d = k(s.modelValue);
|
|
342
|
+
T(() => s.modelValue, (u) => {
|
|
343
|
+
d.value = u;
|
|
344
|
+
});
|
|
345
|
+
const n = () => {
|
|
346
|
+
o("update:modelValue", d.value);
|
|
347
|
+
};
|
|
348
|
+
return (u, b) => (a(), t("div", Ne, [
|
|
349
|
+
e.label ? (a(), t("label", {
|
|
350
|
+
key: 0,
|
|
351
|
+
for: r,
|
|
352
|
+
class: "dm-datepicker__label"
|
|
353
|
+
}, [
|
|
354
|
+
w(m(e.label) + " ", 1),
|
|
355
|
+
e.required ? (a(), t("span", Re, "*")) : c("", !0)
|
|
356
|
+
])) : c("", !0),
|
|
357
|
+
i("div", Ue, [
|
|
358
|
+
N(i("input", {
|
|
359
|
+
id: r,
|
|
360
|
+
type: "date",
|
|
361
|
+
"onUpdate:modelValue": b[0] || (b[0] = (h) => d.value = h),
|
|
362
|
+
class: y(["dm-datepicker__input", { "dm-datepicker__input--error": e.error }]),
|
|
363
|
+
disabled: e.disabled,
|
|
364
|
+
required: e.required,
|
|
365
|
+
min: e.min,
|
|
366
|
+
max: e.max,
|
|
367
|
+
"aria-label": e.ariaLabel,
|
|
368
|
+
"aria-describedby": e.error ? `${r}-error` : void 0,
|
|
369
|
+
"aria-invalid": !!e.error,
|
|
370
|
+
onChange: n
|
|
371
|
+
}, null, 42, Fe), [
|
|
372
|
+
[R, d.value]
|
|
373
|
+
])
|
|
374
|
+
]),
|
|
375
|
+
e.error ? (a(), t("p", {
|
|
376
|
+
key: 1,
|
|
377
|
+
id: `${r}-error`,
|
|
378
|
+
class: "dm-datepicker__error"
|
|
379
|
+
}, m(e.error), 9, Pe)) : c("", !0)
|
|
380
|
+
]));
|
|
381
|
+
}
|
|
382
|
+
}), Pt = /* @__PURE__ */ _(Ke, [["__scopeId", "data-v-8bf1e9ec"]]), je = { class: "dm-file-upload" }, Ge = {
|
|
383
|
+
key: 0,
|
|
384
|
+
class: "dm-file-upload__label"
|
|
385
|
+
}, He = {
|
|
386
|
+
key: 0,
|
|
387
|
+
class: "dm-file-upload__required"
|
|
388
|
+
}, Je = ["accept", "multiple", "disabled", "required"], We = { class: "dm-file-upload__content" }, Ye = {
|
|
389
|
+
key: 0,
|
|
390
|
+
class: "dm-file-upload__hint"
|
|
391
|
+
}, Qe = {
|
|
392
|
+
key: 1,
|
|
393
|
+
class: "dm-file-upload__files"
|
|
394
|
+
}, Xe = { class: "dm-file-upload__filename" }, Ze = { class: "dm-file-upload__filesize" }, ea = ["onClick"], aa = {
|
|
395
|
+
key: 2,
|
|
396
|
+
class: "dm-file-upload__error"
|
|
397
|
+
}, ta = /* @__PURE__ */ f({
|
|
398
|
+
__name: "DatametriaFileUpload",
|
|
399
|
+
props: {
|
|
400
|
+
modelValue: { default: () => [] },
|
|
401
|
+
label: {},
|
|
402
|
+
accept: {},
|
|
403
|
+
multiple: { type: Boolean, default: !1 },
|
|
404
|
+
disabled: { type: Boolean, default: !1 },
|
|
405
|
+
required: { type: Boolean, default: !1 },
|
|
406
|
+
error: {}
|
|
407
|
+
},
|
|
408
|
+
emits: ["update:modelValue"],
|
|
409
|
+
setup(e, { emit: l }) {
|
|
410
|
+
const s = e, o = l, r = k(), d = k(s.modelValue), n = k(!1), u = () => {
|
|
411
|
+
var g;
|
|
412
|
+
s.disabled || (g = r.value) == null || g.click();
|
|
413
|
+
}, b = (g) => {
|
|
414
|
+
const V = Array.from(g.target.files || []);
|
|
415
|
+
I(V);
|
|
416
|
+
}, h = () => {
|
|
417
|
+
s.disabled || (n.value = !0);
|
|
418
|
+
}, v = () => {
|
|
419
|
+
n.value = !1;
|
|
420
|
+
}, D = (g) => {
|
|
421
|
+
var V;
|
|
422
|
+
if (n.value = !1, !s.disabled) {
|
|
423
|
+
const $ = Array.from(((V = g.dataTransfer) == null ? void 0 : V.files) || []);
|
|
424
|
+
I($);
|
|
425
|
+
}
|
|
426
|
+
}, I = (g) => {
|
|
427
|
+
d.value = s.multiple ? [...d.value, ...g] : g, o("update:modelValue", d.value);
|
|
428
|
+
}, x = (g) => {
|
|
429
|
+
d.value.splice(g, 1), o("update:modelValue", d.value);
|
|
430
|
+
}, O = (g) => {
|
|
431
|
+
if (g === 0) return "0 B";
|
|
432
|
+
const V = 1024, $ = ["B", "KB", "MB", "GB"], M = Math.floor(Math.log(g) / Math.log(V));
|
|
433
|
+
return `${(g / Math.pow(V, M)).toFixed(1)} ${$[M]}`;
|
|
434
|
+
};
|
|
435
|
+
return (g, V) => (a(), t("div", je, [
|
|
436
|
+
e.label ? (a(), t("label", Ge, [
|
|
437
|
+
w(m(e.label) + " ", 1),
|
|
438
|
+
e.required ? (a(), t("span", He, "*")) : c("", !0)
|
|
439
|
+
])) : c("", !0),
|
|
440
|
+
i("div", {
|
|
441
|
+
class: y(["dm-file-upload__dropzone", { "dm-file-upload--dragging": n.value, "dm-file-upload__dropzone--dragover": n.value, "dm-file-upload__dropzone--error": e.error }]),
|
|
442
|
+
onDragover: S(h, ["prevent"]),
|
|
443
|
+
onDragleave: S(v, ["prevent"]),
|
|
444
|
+
onDrop: S(D, ["prevent"]),
|
|
445
|
+
onClick: u
|
|
446
|
+
}, [
|
|
447
|
+
i("input", {
|
|
448
|
+
ref_key: "fileInput",
|
|
449
|
+
ref: r,
|
|
450
|
+
type: "file",
|
|
451
|
+
class: "dm-file-upload__input",
|
|
452
|
+
accept: e.accept,
|
|
453
|
+
multiple: e.multiple,
|
|
454
|
+
disabled: e.disabled,
|
|
455
|
+
required: e.required,
|
|
456
|
+
onChange: b
|
|
457
|
+
}, null, 40, Je),
|
|
458
|
+
i("div", We, [
|
|
459
|
+
V[0] || (V[0] = i("svg", {
|
|
460
|
+
class: "dm-file-upload__icon",
|
|
461
|
+
viewBox: "0 0 24 24",
|
|
462
|
+
fill: "none",
|
|
463
|
+
stroke: "currentColor"
|
|
464
|
+
}, [
|
|
465
|
+
i("path", {
|
|
466
|
+
d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M17 8l-5-5-5 5M12 3v12",
|
|
467
|
+
"stroke-width": "2",
|
|
468
|
+
"stroke-linecap": "round",
|
|
469
|
+
"stroke-linejoin": "round"
|
|
470
|
+
})
|
|
471
|
+
], -1)),
|
|
472
|
+
V[1] || (V[1] = i("p", { class: "dm-file-upload__text" }, [
|
|
473
|
+
i("span", { class: "dm-file-upload__text--primary" }, "Clique para selecionar"),
|
|
474
|
+
w(" ou arraste arquivos aqui ")
|
|
475
|
+
], -1)),
|
|
476
|
+
e.accept ? (a(), t("p", Ye, m(e.accept), 1)) : c("", !0)
|
|
477
|
+
])
|
|
478
|
+
], 34),
|
|
479
|
+
d.value.length ? (a(), t("div", Qe, [
|
|
480
|
+
(a(!0), t(B, null, L(d.value, ($, M) => (a(), t("div", {
|
|
481
|
+
key: M,
|
|
482
|
+
class: "dm-file-upload__file"
|
|
483
|
+
}, [
|
|
484
|
+
i("span", Xe, m($.name), 1),
|
|
485
|
+
i("span", Ze, m(O($.size)), 1),
|
|
486
|
+
i("button", {
|
|
487
|
+
type: "button",
|
|
488
|
+
class: "dm-file-upload__remove",
|
|
489
|
+
onClick: (z) => x(M),
|
|
490
|
+
"aria-label": "Remover arquivo"
|
|
491
|
+
}, "×", 8, ea)
|
|
492
|
+
]))), 128))
|
|
493
|
+
])) : c("", !0),
|
|
494
|
+
e.error ? (a(), t("p", aa, m(e.error), 1)) : c("", !0)
|
|
495
|
+
]));
|
|
496
|
+
}
|
|
497
|
+
}), Kt = /* @__PURE__ */ _(ta, [["__scopeId", "data-v-da137679"]]), la = {
|
|
498
|
+
key: 0,
|
|
499
|
+
class: "dm-autocomplete__required"
|
|
500
|
+
}, sa = { class: "dm-autocomplete__wrapper" }, ra = ["placeholder", "disabled", "required", "aria-label", "aria-expanded", "aria-controls", "aria-activedescendant"], da = ["id"], oa = ["id", "aria-selected", "onClick", "onMouseenter"], ia = {
|
|
501
|
+
key: 1,
|
|
502
|
+
class: "dm-autocomplete__no-results"
|
|
503
|
+
}, na = {
|
|
504
|
+
key: 1,
|
|
505
|
+
class: "dm-autocomplete__error"
|
|
506
|
+
}, ca = /* @__PURE__ */ f({
|
|
507
|
+
__name: "DatametriaAutocomplete",
|
|
508
|
+
props: {
|
|
509
|
+
modelValue: { default: "" },
|
|
510
|
+
options: { default: () => [] },
|
|
511
|
+
label: {},
|
|
512
|
+
placeholder: {},
|
|
513
|
+
disabled: { type: Boolean, default: !1 },
|
|
514
|
+
required: { type: Boolean, default: !1 },
|
|
515
|
+
error: {},
|
|
516
|
+
ariaLabel: {}
|
|
517
|
+
},
|
|
518
|
+
emits: ["update:modelValue"],
|
|
519
|
+
setup(e, { emit: l }) {
|
|
520
|
+
const s = e, o = l, r = `dm-autocomplete-${Math.random().toString(36).substr(2, 9)}`, d = k(), n = k(s.modelValue), u = k(!1), b = k(-1), h = C(() => n.value ? s.options.filter(
|
|
521
|
+
($) => $.toLowerCase().includes(n.value.toLowerCase())
|
|
522
|
+
) : s.options), v = C(
|
|
523
|
+
() => b.value >= 0 ? `${r}-option-${b.value}` : void 0
|
|
524
|
+
);
|
|
525
|
+
T(() => s.modelValue, ($) => {
|
|
526
|
+
n.value = $;
|
|
527
|
+
});
|
|
528
|
+
const D = () => {
|
|
529
|
+
u.value = !0, b.value = -1, o("update:modelValue", n.value);
|
|
530
|
+
}, I = () => {
|
|
531
|
+
s.disabled || (u.value = !0);
|
|
532
|
+
}, x = () => {
|
|
533
|
+
setTimeout(() => {
|
|
534
|
+
u.value = !1;
|
|
535
|
+
}, 200);
|
|
536
|
+
}, O = ($) => {
|
|
537
|
+
n.value = $, o("update:modelValue", $), u.value = !1, b.value = -1;
|
|
538
|
+
}, g = ($) => {
|
|
539
|
+
if (!u.value && $.key !== "Escape") {
|
|
540
|
+
u.value = !0;
|
|
541
|
+
return;
|
|
542
|
+
}
|
|
543
|
+
switch ($.key) {
|
|
544
|
+
case "ArrowDown":
|
|
545
|
+
$.preventDefault(), b.value = Math.min(b.value + 1, h.value.length - 1);
|
|
546
|
+
break;
|
|
547
|
+
case "ArrowUp":
|
|
548
|
+
$.preventDefault(), b.value = Math.max(b.value - 1, 0);
|
|
549
|
+
break;
|
|
550
|
+
case "Enter":
|
|
551
|
+
$.preventDefault(), b.value >= 0 && O(h.value[b.value]);
|
|
552
|
+
break;
|
|
553
|
+
case "Escape":
|
|
554
|
+
u.value = !1, b.value = -1;
|
|
555
|
+
break;
|
|
556
|
+
}
|
|
557
|
+
}, V = ($) => {
|
|
558
|
+
d.value && !d.value.contains($.target) && (u.value = !1);
|
|
559
|
+
};
|
|
560
|
+
return P(() => {
|
|
561
|
+
document.addEventListener("click", V);
|
|
562
|
+
}), X(() => {
|
|
563
|
+
document.removeEventListener("click", V);
|
|
564
|
+
}), ($, M) => (a(), t("div", {
|
|
565
|
+
class: "dm-autocomplete",
|
|
566
|
+
ref_key: "autocompleteRef",
|
|
567
|
+
ref: d
|
|
568
|
+
}, [
|
|
569
|
+
e.label ? (a(), t("label", {
|
|
570
|
+
key: 0,
|
|
571
|
+
for: r,
|
|
572
|
+
class: "dm-autocomplete__label"
|
|
573
|
+
}, [
|
|
574
|
+
w(m(e.label) + " ", 1),
|
|
575
|
+
e.required ? (a(), t("span", la, "*")) : c("", !0)
|
|
576
|
+
])) : c("", !0),
|
|
577
|
+
i("div", sa, [
|
|
578
|
+
N(i("input", {
|
|
579
|
+
id: r,
|
|
580
|
+
"onUpdate:modelValue": M[0] || (M[0] = (z) => n.value = z),
|
|
581
|
+
type: "text",
|
|
582
|
+
class: y(["dm-autocomplete__input", { "dm-autocomplete__input--error": e.error }]),
|
|
583
|
+
placeholder: e.placeholder,
|
|
584
|
+
disabled: e.disabled,
|
|
585
|
+
required: e.required,
|
|
586
|
+
"aria-label": e.ariaLabel,
|
|
587
|
+
"aria-expanded": u.value,
|
|
588
|
+
"aria-controls": `${r}-listbox`,
|
|
589
|
+
"aria-activedescendant": v.value,
|
|
590
|
+
role: "combobox",
|
|
591
|
+
autocomplete: "off",
|
|
592
|
+
onInput: D,
|
|
593
|
+
onFocus: I,
|
|
594
|
+
onBlur: x,
|
|
595
|
+
onKeydown: g
|
|
596
|
+
}, null, 42, ra), [
|
|
597
|
+
[R, n.value]
|
|
598
|
+
]),
|
|
599
|
+
u.value && h.value.length ? (a(), t("ul", {
|
|
600
|
+
key: 0,
|
|
601
|
+
id: `${r}-listbox`,
|
|
602
|
+
class: "dm-autocomplete__dropdown",
|
|
603
|
+
role: "listbox"
|
|
604
|
+
}, [
|
|
605
|
+
(a(!0), t(B, null, L(h.value, (z, E) => (a(), t("li", {
|
|
606
|
+
key: E,
|
|
607
|
+
id: `${r}-option-${E}`,
|
|
608
|
+
class: y(["dm-autocomplete__option", { "dm-autocomplete__option--active": E === b.value }]),
|
|
609
|
+
role: "option",
|
|
610
|
+
"aria-selected": E === b.value,
|
|
611
|
+
onClick: (Q) => O(z),
|
|
612
|
+
onMouseenter: (Q) => b.value = E
|
|
613
|
+
}, m(z), 43, oa))), 128))
|
|
614
|
+
], 8, da)) : u.value && !h.value.length ? (a(), t("div", ia, " No results ")) : c("", !0)
|
|
615
|
+
]),
|
|
616
|
+
e.error ? (a(), t("p", na, m(e.error), 1)) : c("", !0)
|
|
617
|
+
], 512));
|
|
618
|
+
}
|
|
619
|
+
}), jt = /* @__PURE__ */ _(ca, [["__scopeId", "data-v-782dacde"]]), ua = {
|
|
620
|
+
key: 0,
|
|
621
|
+
class: "datametria-card__header"
|
|
622
|
+
}, ma = { class: "datametria-card__title" }, ba = { class: "datametria-card__content" }, va = {
|
|
623
|
+
key: 1,
|
|
624
|
+
class: "datametria-card__footer"
|
|
625
|
+
}, ha = /* @__PURE__ */ f({
|
|
626
|
+
__name: "DatametriaCard",
|
|
627
|
+
props: {
|
|
628
|
+
title: {},
|
|
629
|
+
padding: { type: Boolean, default: !0 }
|
|
630
|
+
},
|
|
631
|
+
setup(e) {
|
|
632
|
+
const l = e, s = C(() => [
|
|
633
|
+
"datametria-card",
|
|
634
|
+
{
|
|
635
|
+
"datametria-card--no-padding": !l.padding
|
|
636
|
+
}
|
|
637
|
+
]);
|
|
638
|
+
return (o, r) => (a(), t("div", {
|
|
639
|
+
class: y(s.value)
|
|
640
|
+
}, [
|
|
641
|
+
e.title || o.$slots.header ? (a(), t("div", ua, [
|
|
642
|
+
p(o.$slots, "header", {}, () => [
|
|
643
|
+
i("h3", ma, m(e.title), 1)
|
|
644
|
+
], !0)
|
|
645
|
+
])) : c("", !0),
|
|
646
|
+
i("div", ba, [
|
|
647
|
+
p(o.$slots, "default", {}, void 0, !0)
|
|
648
|
+
]),
|
|
649
|
+
o.$slots.footer ? (a(), t("div", va, [
|
|
650
|
+
p(o.$slots, "footer", {}, void 0, !0)
|
|
651
|
+
])) : c("", !0)
|
|
652
|
+
], 2));
|
|
653
|
+
}
|
|
654
|
+
}), Gt = /* @__PURE__ */ _(ha, [["__scopeId", "data-v-539a1b0c"]]), fa = {
|
|
655
|
+
key: 0,
|
|
656
|
+
class: "datametria-modal__header"
|
|
657
|
+
}, _a = { class: "datametria-modal__title" }, $a = { class: "datametria-modal__body" }, ya = {
|
|
658
|
+
key: 1,
|
|
659
|
+
class: "datametria-modal__footer"
|
|
660
|
+
}, ka = /* @__PURE__ */ f({
|
|
661
|
+
__name: "DatametriaModal",
|
|
662
|
+
props: {
|
|
663
|
+
modelValue: { type: Boolean },
|
|
664
|
+
title: {},
|
|
665
|
+
size: { default: "32rem" },
|
|
666
|
+
closable: { type: Boolean, default: !0 }
|
|
667
|
+
},
|
|
668
|
+
emits: ["update:modelValue", "close"],
|
|
669
|
+
setup(e, { emit: l }) {
|
|
670
|
+
const s = e, o = l, r = () => {
|
|
671
|
+
s.closable && (o("update:modelValue", !1), o("close"));
|
|
672
|
+
};
|
|
673
|
+
return (d, n) => (a(), K(j, { to: "body" }, [
|
|
674
|
+
G(H, { name: "modal" }, {
|
|
675
|
+
default: J(() => [
|
|
676
|
+
e.modelValue ? (a(), t("div", {
|
|
677
|
+
key: 0,
|
|
678
|
+
class: "datametria-modal",
|
|
679
|
+
onClick: S(r, ["self"])
|
|
680
|
+
}, [
|
|
681
|
+
i("div", {
|
|
682
|
+
class: "datametria-modal__content",
|
|
683
|
+
style: A({ maxWidth: e.size })
|
|
684
|
+
}, [
|
|
685
|
+
e.title || d.$slots.header ? (a(), t("div", fa, [
|
|
686
|
+
p(d.$slots, "header", {}, () => [
|
|
687
|
+
i("h3", _a, m(e.title), 1)
|
|
688
|
+
], !0),
|
|
689
|
+
e.closable ? (a(), t("button", {
|
|
690
|
+
key: 0,
|
|
691
|
+
class: "datametria-modal__close",
|
|
692
|
+
onClick: r
|
|
693
|
+
}, " × ")) : c("", !0)
|
|
694
|
+
])) : c("", !0),
|
|
695
|
+
i("div", $a, [
|
|
696
|
+
p(d.$slots, "default", {}, void 0, !0)
|
|
697
|
+
]),
|
|
698
|
+
d.$slots.footer ? (a(), t("div", ya, [
|
|
699
|
+
p(d.$slots, "footer", {}, void 0, !0)
|
|
700
|
+
])) : c("", !0)
|
|
701
|
+
], 4)
|
|
702
|
+
])) : c("", !0)
|
|
703
|
+
]),
|
|
704
|
+
_: 3
|
|
705
|
+
})
|
|
706
|
+
]));
|
|
707
|
+
}
|
|
708
|
+
}), Ht = /* @__PURE__ */ _(ka, [["__scopeId", "data-v-8aa80965"]]), pa = /* @__PURE__ */ f({
|
|
709
|
+
__name: "DatametriaContainer",
|
|
710
|
+
props: {
|
|
711
|
+
size: { default: "lg" },
|
|
712
|
+
fluid: { type: Boolean, default: !1 }
|
|
713
|
+
},
|
|
714
|
+
setup(e) {
|
|
715
|
+
return (l, s) => (a(), t("div", {
|
|
716
|
+
class: y(["dm-container", [`dm-container--${e.size}`, { "dm-container--fluid": e.fluid }]])
|
|
717
|
+
}, [
|
|
718
|
+
p(l.$slots, "default", {}, void 0, !0)
|
|
719
|
+
], 2));
|
|
720
|
+
}
|
|
721
|
+
}), Jt = /* @__PURE__ */ _(pa, [["__scopeId", "data-v-4cc8678e"]]), ga = /* @__PURE__ */ f({
|
|
722
|
+
__name: "DatametriaGrid",
|
|
723
|
+
props: {
|
|
724
|
+
cols: { default: 12 },
|
|
725
|
+
gap: { default: "var(--dm-space-4)" }
|
|
726
|
+
},
|
|
727
|
+
setup(e) {
|
|
728
|
+
return (l, s) => (a(), t("div", {
|
|
729
|
+
class: "dm-grid",
|
|
730
|
+
style: A({
|
|
731
|
+
"--dm-grid-cols": e.cols,
|
|
732
|
+
"--dm-grid-gap": e.gap
|
|
733
|
+
})
|
|
734
|
+
}, [
|
|
735
|
+
p(l.$slots, "default", {}, void 0, !0)
|
|
736
|
+
], 4));
|
|
737
|
+
}
|
|
738
|
+
}), Wt = /* @__PURE__ */ _(ga, [["__scopeId", "data-v-9e2c1279"]]), Da = ["role", "aria-orientation"], Va = {
|
|
739
|
+
key: 0,
|
|
740
|
+
class: "dm-divider__label"
|
|
741
|
+
}, wa = /* @__PURE__ */ f({
|
|
742
|
+
__name: "DatametriaDivider",
|
|
743
|
+
props: {
|
|
744
|
+
orientation: { default: "horizontal" },
|
|
745
|
+
dashed: { type: Boolean, default: !1 },
|
|
746
|
+
label: {}
|
|
747
|
+
},
|
|
748
|
+
setup(e) {
|
|
749
|
+
return (l, s) => (a(), t("div", {
|
|
750
|
+
class: y(["dm-divider", [`dm-divider--${e.orientation}`, { "dm-divider--dashed": e.dashed }]]),
|
|
751
|
+
role: e.orientation === "horizontal" ? "separator" : void 0,
|
|
752
|
+
"aria-orientation": e.orientation
|
|
753
|
+
}, [
|
|
754
|
+
l.$slots.default || e.label ? (a(), t("span", Va, [
|
|
755
|
+
p(l.$slots, "default", {}, () => [
|
|
756
|
+
w(m(e.label), 1)
|
|
757
|
+
], !0)
|
|
758
|
+
])) : c("", !0)
|
|
759
|
+
], 10, Da));
|
|
760
|
+
}
|
|
761
|
+
}), Yt = /* @__PURE__ */ _(wa, [["__scopeId", "data-v-b0655e4c"]]), Ca = { class: "datametria-alert__icon" }, Ia = { key: 0 }, Ba = { key: 1 }, La = { key: 2 }, Ma = { key: 3 }, qa = { class: "datametria-alert__content" }, Ta = {
|
|
762
|
+
key: 0,
|
|
763
|
+
class: "datametria-alert__title"
|
|
764
|
+
}, xa = { class: "datametria-alert__message" }, Sa = /* @__PURE__ */ f({
|
|
765
|
+
__name: "DatametriaAlert",
|
|
766
|
+
props: {
|
|
767
|
+
modelValue: { type: Boolean, default: !0 },
|
|
768
|
+
variant: { default: "info" },
|
|
769
|
+
title: {},
|
|
770
|
+
message: {},
|
|
771
|
+
closable: { type: Boolean, default: !0 }
|
|
772
|
+
},
|
|
773
|
+
emits: ["update:modelValue"],
|
|
774
|
+
setup(e) {
|
|
775
|
+
const l = e, s = C(() => [
|
|
776
|
+
"datametria-alert",
|
|
777
|
+
`datametria-alert--${l.variant}`
|
|
778
|
+
]);
|
|
779
|
+
return (o, r) => e.modelValue ? (a(), t("div", {
|
|
780
|
+
key: 0,
|
|
781
|
+
class: y(s.value)
|
|
782
|
+
}, [
|
|
783
|
+
i("div", Ca, [
|
|
784
|
+
e.variant === "success" ? (a(), t("span", Ia, "✓")) : e.variant === "error" ? (a(), t("span", Ba, "✕")) : e.variant === "warning" ? (a(), t("span", La, "⚠")) : (a(), t("span", Ma, "ℹ"))
|
|
785
|
+
]),
|
|
786
|
+
i("div", qa, [
|
|
787
|
+
e.title ? (a(), t("h4", Ta, m(e.title), 1)) : c("", !0),
|
|
788
|
+
i("p", xa, [
|
|
789
|
+
p(o.$slots, "default", {}, () => [
|
|
790
|
+
w(m(e.message), 1)
|
|
791
|
+
], !0)
|
|
792
|
+
])
|
|
793
|
+
]),
|
|
794
|
+
e.closable ? (a(), t("button", {
|
|
795
|
+
key: 0,
|
|
796
|
+
class: "datametria-alert__close",
|
|
797
|
+
onClick: r[0] || (r[0] = (d) => o.$emit("update:modelValue", !1))
|
|
798
|
+
}, " × ")) : c("", !0)
|
|
799
|
+
], 2)) : c("", !0);
|
|
800
|
+
}
|
|
801
|
+
}), Qt = /* @__PURE__ */ _(Sa, [["__scopeId", "data-v-a27dad03"]]), za = ["aria-live"], Ea = { class: "dm-toast__content" }, Aa = { class: "dm-toast__message" }, Oa = /* @__PURE__ */ f({
|
|
802
|
+
__name: "DatametriaToast",
|
|
803
|
+
props: {
|
|
804
|
+
message: {},
|
|
805
|
+
variant: { default: "info" },
|
|
806
|
+
duration: { default: 3e3 },
|
|
807
|
+
closable: { type: Boolean, default: !0 },
|
|
808
|
+
modelValue: { type: Boolean, default: !1 }
|
|
809
|
+
},
|
|
810
|
+
emits: ["update:modelValue", "close"],
|
|
811
|
+
setup(e, { emit: l }) {
|
|
812
|
+
const s = e, o = l, r = k(s.modelValue);
|
|
813
|
+
let d = null;
|
|
814
|
+
T(() => s.modelValue, (b) => {
|
|
815
|
+
r.value = b, b && s.duration > 0 && n();
|
|
816
|
+
});
|
|
817
|
+
const n = () => {
|
|
818
|
+
d && clearTimeout(d), d = setTimeout(() => {
|
|
819
|
+
u();
|
|
820
|
+
}, s.duration);
|
|
821
|
+
}, u = () => {
|
|
822
|
+
r.value = !1, o("update:modelValue", !1), o("close"), d && clearTimeout(d);
|
|
823
|
+
};
|
|
824
|
+
return P(() => {
|
|
825
|
+
r.value && s.duration > 0 && n();
|
|
826
|
+
}), (b, h) => (a(), K(j, { to: "body" }, [
|
|
827
|
+
G(H, { name: "dm-toast" }, {
|
|
828
|
+
default: J(() => [
|
|
829
|
+
r.value ? (a(), t("div", {
|
|
830
|
+
key: 0,
|
|
831
|
+
class: y(["dm-toast", `dm-toast--${e.variant}`]),
|
|
832
|
+
role: "alert",
|
|
833
|
+
"aria-live": e.variant === "error" ? "assertive" : "polite"
|
|
834
|
+
}, [
|
|
835
|
+
i("div", Ea, [
|
|
836
|
+
i("span", Aa, m(e.message), 1),
|
|
837
|
+
e.closable ? (a(), t("button", {
|
|
838
|
+
key: 0,
|
|
839
|
+
class: "dm-toast__close",
|
|
840
|
+
onClick: u,
|
|
841
|
+
"aria-label": "Fechar"
|
|
842
|
+
}, "×")) : c("", !0)
|
|
843
|
+
])
|
|
844
|
+
], 10, za)) : c("", !0)
|
|
845
|
+
]),
|
|
846
|
+
_: 1
|
|
847
|
+
})
|
|
848
|
+
]));
|
|
849
|
+
}
|
|
850
|
+
}), Xt = /* @__PURE__ */ _(Oa, [["__scopeId", "data-v-f6096907"]]), Na = { class: "dm-progress" }, Ra = {
|
|
851
|
+
key: 0,
|
|
852
|
+
class: "dm-progress__header"
|
|
853
|
+
}, Ua = { class: "dm-progress__label" }, Fa = {
|
|
854
|
+
key: 0,
|
|
855
|
+
class: "dm-progress__value"
|
|
856
|
+
}, Pa = ["aria-valuenow", "aria-label"], Ka = /* @__PURE__ */ f({
|
|
857
|
+
__name: "DatametriaProgress",
|
|
858
|
+
props: {
|
|
859
|
+
value: {},
|
|
860
|
+
label: {},
|
|
861
|
+
variant: { default: "primary" },
|
|
862
|
+
showValue: { type: Boolean, default: !0 },
|
|
863
|
+
ariaLabel: {}
|
|
864
|
+
},
|
|
865
|
+
setup(e) {
|
|
866
|
+
const l = e, s = C(() => Math.min(Math.max(l.value, 0), 100));
|
|
867
|
+
return (o, r) => (a(), t("div", Na, [
|
|
868
|
+
e.label ? (a(), t("div", Ra, [
|
|
869
|
+
i("span", Ua, m(e.label), 1),
|
|
870
|
+
e.showValue ? (a(), t("span", Fa, m(e.value) + "%", 1)) : c("", !0)
|
|
871
|
+
])) : c("", !0),
|
|
872
|
+
i("div", {
|
|
873
|
+
class: "dm-progress__track",
|
|
874
|
+
role: "progressbar",
|
|
875
|
+
"aria-valuenow": e.value,
|
|
876
|
+
"aria-valuemin": 0,
|
|
877
|
+
"aria-valuemax": 100,
|
|
878
|
+
"aria-label": e.ariaLabel || e.label
|
|
879
|
+
}, [
|
|
880
|
+
i("div", {
|
|
881
|
+
class: y(["dm-progress__bar", `dm-progress__bar--${e.variant}`]),
|
|
882
|
+
style: A({ width: `${s.value}%` })
|
|
883
|
+
}, null, 6)
|
|
884
|
+
], 8, Pa)
|
|
885
|
+
]));
|
|
886
|
+
}
|
|
887
|
+
}), Zt = /* @__PURE__ */ _(Ka, [["__scopeId", "data-v-6c9ef263"]]), ja = ["aria-label"], Ga = {
|
|
888
|
+
key: 0,
|
|
889
|
+
class: "dm-spinner__label"
|
|
890
|
+
}, Ha = /* @__PURE__ */ f({
|
|
891
|
+
__name: "DatametriaSpinner",
|
|
892
|
+
props: {
|
|
893
|
+
size: { default: "md" },
|
|
894
|
+
variant: { default: "primary" },
|
|
895
|
+
label: {},
|
|
896
|
+
ariaLabel: { default: "Carregando" }
|
|
897
|
+
},
|
|
898
|
+
setup(e) {
|
|
899
|
+
return (l, s) => (a(), t("div", {
|
|
900
|
+
class: y(["dm-spinner", [`dm-spinner--${e.size}`, `dm-spinner--${e.variant}`]]),
|
|
901
|
+
role: "status",
|
|
902
|
+
"aria-label": e.ariaLabel
|
|
903
|
+
}, [
|
|
904
|
+
s[0] || (s[0] = i("svg", {
|
|
905
|
+
class: "dm-spinner__svg",
|
|
906
|
+
viewBox: "0 0 50 50"
|
|
907
|
+
}, [
|
|
908
|
+
i("circle", {
|
|
909
|
+
class: "dm-spinner__circle",
|
|
910
|
+
cx: "25",
|
|
911
|
+
cy: "25",
|
|
912
|
+
r: "20",
|
|
913
|
+
fill: "none",
|
|
914
|
+
"stroke-width": "4"
|
|
915
|
+
})
|
|
916
|
+
], -1)),
|
|
917
|
+
e.label ? (a(), t("span", Ga, m(e.label), 1)) : c("", !0)
|
|
918
|
+
], 10, ja));
|
|
919
|
+
}
|
|
920
|
+
}), el = /* @__PURE__ */ _(Ha, [["__scopeId", "data-v-013214f1"]]), Ja = { class: "datametria-table" }, Wa = { class: "datametria-table__table" }, Ya = { class: "datametria-table__thead" }, Qa = { class: "datametria-table__tbody" }, Xa = {
|
|
921
|
+
key: 0,
|
|
922
|
+
class: "datametria-table__empty"
|
|
923
|
+
}, Za = /* @__PURE__ */ f({
|
|
924
|
+
__name: "DatametriaTable",
|
|
925
|
+
props: {
|
|
926
|
+
columns: {},
|
|
927
|
+
data: {}
|
|
928
|
+
},
|
|
929
|
+
setup(e) {
|
|
930
|
+
return (l, s) => (a(), t("div", Ja, [
|
|
931
|
+
i("table", Wa, [
|
|
932
|
+
i("thead", Ya, [
|
|
933
|
+
i("tr", null, [
|
|
934
|
+
(a(!0), t(B, null, L(e.columns, (o) => (a(), t("th", {
|
|
935
|
+
key: o.key,
|
|
936
|
+
class: "datametria-table__th",
|
|
937
|
+
style: A({ width: o.width })
|
|
938
|
+
}, m(o.label), 5))), 128))
|
|
939
|
+
])
|
|
940
|
+
]),
|
|
941
|
+
i("tbody", Qa, [
|
|
942
|
+
(a(!0), t(B, null, L(e.data, (o, r) => (a(), t("tr", {
|
|
943
|
+
key: r,
|
|
944
|
+
class: "datametria-table__tr"
|
|
945
|
+
}, [
|
|
946
|
+
(a(!0), t(B, null, L(e.columns, (d) => (a(), t("td", {
|
|
947
|
+
key: d.key,
|
|
948
|
+
class: "datametria-table__td"
|
|
949
|
+
}, [
|
|
950
|
+
p(l.$slots, `cell-${d.key}`, {
|
|
951
|
+
row: o,
|
|
952
|
+
value: o[d.key]
|
|
953
|
+
}, () => [
|
|
954
|
+
w(m(o[d.key]), 1)
|
|
955
|
+
], !0)
|
|
956
|
+
]))), 128))
|
|
957
|
+
]))), 128))
|
|
958
|
+
])
|
|
959
|
+
]),
|
|
960
|
+
e.data.length === 0 ? (a(), t("div", Xa, [
|
|
961
|
+
p(l.$slots, "empty", {}, () => [
|
|
962
|
+
s[0] || (s[0] = w("Nenhum dado disponível", -1))
|
|
963
|
+
], !0)
|
|
964
|
+
])) : c("", !0)
|
|
965
|
+
]));
|
|
966
|
+
}
|
|
967
|
+
}), al = /* @__PURE__ */ _(Za, [["__scopeId", "data-v-7700c903"]]), et = ["aria-label"], at = ["src", "alt"], tt = {
|
|
968
|
+
key: 1,
|
|
969
|
+
class: "dm-avatar__initials"
|
|
970
|
+
}, lt = /* @__PURE__ */ f({
|
|
971
|
+
__name: "DatametriaAvatar",
|
|
972
|
+
props: {
|
|
973
|
+
src: {},
|
|
974
|
+
name: {},
|
|
975
|
+
alt: {},
|
|
976
|
+
size: { default: "md" },
|
|
977
|
+
rounded: { type: Boolean, default: !1 },
|
|
978
|
+
ariaLabel: {}
|
|
979
|
+
},
|
|
980
|
+
setup(e) {
|
|
981
|
+
const l = e, s = k(!1), o = C(() => {
|
|
982
|
+
if (!l.name) return "?";
|
|
983
|
+
const d = l.name.trim().split(" ");
|
|
984
|
+
return d.length === 1 ? d[0].charAt(0).toUpperCase() : (d[0].charAt(0) + d[d.length - 1].charAt(0)).toUpperCase();
|
|
985
|
+
}), r = () => {
|
|
986
|
+
s.value = !0;
|
|
987
|
+
};
|
|
988
|
+
return (d, n) => (a(), t("div", {
|
|
989
|
+
class: y(["dm-avatar", [`dm-avatar--${e.size}`, { "dm-avatar--rounded": e.rounded }]]),
|
|
990
|
+
"aria-label": e.ariaLabel || e.name
|
|
991
|
+
}, [
|
|
992
|
+
e.src ? (a(), t("img", {
|
|
993
|
+
key: 0,
|
|
994
|
+
src: e.src,
|
|
995
|
+
alt: e.alt || e.name,
|
|
996
|
+
class: "dm-avatar__image",
|
|
997
|
+
onError: r
|
|
998
|
+
}, null, 40, at)) : (a(), t("span", tt, m(o.value), 1))
|
|
999
|
+
], 10, et));
|
|
1000
|
+
}
|
|
1001
|
+
}), tl = /* @__PURE__ */ _(lt, [["__scopeId", "data-v-898cb5d7"]]), st = ["aria-label"], rt = /* @__PURE__ */ f({
|
|
1002
|
+
__name: "DatametriaBadge",
|
|
1003
|
+
props: {
|
|
1004
|
+
label: {},
|
|
1005
|
+
variant: { default: "primary" },
|
|
1006
|
+
size: { default: "md" },
|
|
1007
|
+
ariaLabel: {}
|
|
1008
|
+
},
|
|
1009
|
+
setup(e) {
|
|
1010
|
+
return (l, s) => (a(), t("span", {
|
|
1011
|
+
class: y(["dm-badge", [`dm-badge--${e.variant}`, `dm-badge--${e.size}`]]),
|
|
1012
|
+
"aria-label": e.ariaLabel
|
|
1013
|
+
}, [
|
|
1014
|
+
p(l.$slots, "default", {}, () => [
|
|
1015
|
+
w(m(e.label), 1)
|
|
1016
|
+
], !0)
|
|
1017
|
+
], 10, st));
|
|
1018
|
+
}
|
|
1019
|
+
}), ll = /* @__PURE__ */ _(rt, [["__scopeId", "data-v-843741c5"]]), dt = ["role", "tabindex", "onKeydown"], ot = {
|
|
1020
|
+
key: 0,
|
|
1021
|
+
class: "dm-chip__icon"
|
|
1022
|
+
}, it = { class: "dm-chip__label" }, nt = /* @__PURE__ */ f({
|
|
1023
|
+
__name: "DatametriaChip",
|
|
1024
|
+
props: {
|
|
1025
|
+
label: {},
|
|
1026
|
+
variant: { default: "default" },
|
|
1027
|
+
closable: { type: Boolean, default: !1 },
|
|
1028
|
+
clickable: { type: Boolean, default: !1 }
|
|
1029
|
+
},
|
|
1030
|
+
emits: ["click", "close"],
|
|
1031
|
+
setup(e, { emit: l }) {
|
|
1032
|
+
const s = l, o = () => {
|
|
1033
|
+
s("click");
|
|
1034
|
+
}, r = () => {
|
|
1035
|
+
s("close");
|
|
1036
|
+
};
|
|
1037
|
+
return (d, n) => (a(), t("div", {
|
|
1038
|
+
class: y(["dm-chip", [`dm-chip--${e.variant}`, { "dm-chip--clickable": e.clickable }]]),
|
|
1039
|
+
role: e.clickable ? "button" : void 0,
|
|
1040
|
+
tabindex: e.clickable ? 0 : void 0,
|
|
1041
|
+
onClick: o,
|
|
1042
|
+
onKeydown: [
|
|
1043
|
+
U(o, ["enter"]),
|
|
1044
|
+
U(S(o, ["prevent"]), ["space"])
|
|
1045
|
+
]
|
|
1046
|
+
}, [
|
|
1047
|
+
d.$slots.icon ? (a(), t("span", ot, [
|
|
1048
|
+
p(d.$slots, "icon", {}, void 0, !0)
|
|
1049
|
+
])) : c("", !0),
|
|
1050
|
+
i("span", it, [
|
|
1051
|
+
p(d.$slots, "default", {}, () => [
|
|
1052
|
+
w(m(e.label), 1)
|
|
1053
|
+
], !0)
|
|
1054
|
+
]),
|
|
1055
|
+
e.closable ? (a(), t("button", {
|
|
1056
|
+
key: 1,
|
|
1057
|
+
class: "dm-chip__close",
|
|
1058
|
+
onClick: S(r, ["stop"]),
|
|
1059
|
+
"aria-label": "Remover",
|
|
1060
|
+
type: "button"
|
|
1061
|
+
}, "×")) : c("", !0)
|
|
1062
|
+
], 42, dt));
|
|
1063
|
+
}
|
|
1064
|
+
}), sl = /* @__PURE__ */ _(nt, [["__scopeId", "data-v-0d7ae680"]]), ct = ["aria-label"], ut = { class: "dm-navbar__container" }, mt = { class: "dm-navbar__brand" }, bt = {
|
|
1065
|
+
href: "/",
|
|
1066
|
+
class: "dm-navbar__logo"
|
|
1067
|
+
}, vt = ["aria-expanded"], ht = {
|
|
1068
|
+
key: 1,
|
|
1069
|
+
class: "dm-navbar__actions"
|
|
1070
|
+
}, ft = /* @__PURE__ */ f({
|
|
1071
|
+
__name: "DatametriaNavbar",
|
|
1072
|
+
props: {
|
|
1073
|
+
brand: { default: "" },
|
|
1074
|
+
variant: { default: "light" },
|
|
1075
|
+
sticky: { type: Boolean, default: !1 },
|
|
1076
|
+
transparent: { type: Boolean, default: !1 },
|
|
1077
|
+
bordered: { type: Boolean, default: !1 },
|
|
1078
|
+
ariaLabel: { default: "Main navigation" }
|
|
1079
|
+
},
|
|
1080
|
+
setup(e) {
|
|
1081
|
+
const l = e, s = k(!1), o = () => {
|
|
1082
|
+
s.value = !s.value;
|
|
1083
|
+
};
|
|
1084
|
+
return (r, d) => (a(), t("nav", {
|
|
1085
|
+
class: y(["dm-navbar", [
|
|
1086
|
+
`dm-navbar--${l.variant}`,
|
|
1087
|
+
{ "dm-navbar--sticky": l.sticky },
|
|
1088
|
+
{ "dm-navbar--transparent": l.transparent },
|
|
1089
|
+
{ "dm-navbar--bordered": l.bordered }
|
|
1090
|
+
]]),
|
|
1091
|
+
role: "navigation",
|
|
1092
|
+
"aria-label": l.ariaLabel
|
|
1093
|
+
}, [
|
|
1094
|
+
i("div", ut, [
|
|
1095
|
+
i("div", mt, [
|
|
1096
|
+
p(r.$slots, "brand", {}, () => [
|
|
1097
|
+
i("a", bt, m(e.brand), 1)
|
|
1098
|
+
], !0)
|
|
1099
|
+
]),
|
|
1100
|
+
r.$slots.menu ? (a(), t("button", {
|
|
1101
|
+
key: 0,
|
|
1102
|
+
class: "dm-navbar__toggle",
|
|
1103
|
+
"aria-expanded": s.value,
|
|
1104
|
+
"aria-controls": "navbar-menu",
|
|
1105
|
+
onClick: o
|
|
1106
|
+
}, [...d[0] || (d[0] = [
|
|
1107
|
+
i("span", { class: "dm-navbar__toggle-icon" }, null, -1)
|
|
1108
|
+
])], 8, vt)) : c("", !0),
|
|
1109
|
+
i("div", {
|
|
1110
|
+
id: "navbar-menu",
|
|
1111
|
+
class: y(["dm-navbar__menu", { "dm-navbar__menu--open": s.value }])
|
|
1112
|
+
}, [
|
|
1113
|
+
p(r.$slots, "menu", {}, void 0, !0)
|
|
1114
|
+
], 2),
|
|
1115
|
+
r.$slots.actions ? (a(), t("div", ht, [
|
|
1116
|
+
p(r.$slots, "actions", {}, void 0, !0)
|
|
1117
|
+
])) : c("", !0)
|
|
1118
|
+
])
|
|
1119
|
+
], 10, ct));
|
|
1120
|
+
}
|
|
1121
|
+
}), rl = /* @__PURE__ */ _(ft, [["__scopeId", "data-v-adcb6d0c"]]), _t = {
|
|
1122
|
+
class: "dm-breadcrumb",
|
|
1123
|
+
"aria-label": "Breadcrumb"
|
|
1124
|
+
}, $t = { class: "dm-breadcrumb__list" }, yt = ["href", "onClick"], kt = ["aria-current"], pt = {
|
|
1125
|
+
key: 2,
|
|
1126
|
+
class: "dm-breadcrumb__separator",
|
|
1127
|
+
"aria-hidden": "true"
|
|
1128
|
+
}, gt = /* @__PURE__ */ f({
|
|
1129
|
+
__name: "DatametriaBreadcrumb",
|
|
1130
|
+
props: {
|
|
1131
|
+
items: {},
|
|
1132
|
+
separator: { default: "/" }
|
|
1133
|
+
},
|
|
1134
|
+
emits: ["click"],
|
|
1135
|
+
setup(e, { emit: l }) {
|
|
1136
|
+
const s = l, o = (r, d, n) => {
|
|
1137
|
+
s("click", d, n);
|
|
1138
|
+
};
|
|
1139
|
+
return (r, d) => (a(), t("nav", _t, [
|
|
1140
|
+
i("ol", $t, [
|
|
1141
|
+
(a(!0), t(B, null, L(e.items, (n, u) => (a(), t("li", {
|
|
1142
|
+
key: u,
|
|
1143
|
+
class: "dm-breadcrumb__item"
|
|
1144
|
+
}, [
|
|
1145
|
+
n.href && u < e.items.length - 1 ? (a(), t("a", {
|
|
1146
|
+
key: 0,
|
|
1147
|
+
href: n.href,
|
|
1148
|
+
class: "dm-breadcrumb__link",
|
|
1149
|
+
onClick: (b) => o(b, n, u)
|
|
1150
|
+
}, m(n.label), 9, yt)) : (a(), t("span", {
|
|
1151
|
+
key: 1,
|
|
1152
|
+
class: "dm-breadcrumb__current",
|
|
1153
|
+
"aria-current": u === e.items.length - 1 ? "page" : void 0
|
|
1154
|
+
}, m(n.label), 9, kt)),
|
|
1155
|
+
u < e.items.length - 1 ? (a(), t("span", pt, m(e.separator), 1)) : c("", !0)
|
|
1156
|
+
]))), 128))
|
|
1157
|
+
])
|
|
1158
|
+
]));
|
|
1159
|
+
}
|
|
1160
|
+
}), dl = /* @__PURE__ */ _(gt, [["__scopeId", "data-v-17c32ee3"]]), Dt = { class: "dm-tabs" }, Vt = ["aria-label"], wt = ["id", "aria-selected", "aria-controls", "tabindex", "onClick", "onKeydown"], Ct = { class: "dm-tabs__panels" }, It = ["id", "aria-labelledby", "hidden"], Bt = /* @__PURE__ */ f({
|
|
1161
|
+
__name: "DatametriaTabs",
|
|
1162
|
+
props: {
|
|
1163
|
+
tabs: {},
|
|
1164
|
+
modelValue: { default: 0 },
|
|
1165
|
+
ariaLabel: { default: "Tabs" }
|
|
1166
|
+
},
|
|
1167
|
+
emits: ["update:modelValue"],
|
|
1168
|
+
setup(e, { emit: l }) {
|
|
1169
|
+
const s = e, o = l, r = k(s.modelValue);
|
|
1170
|
+
T(() => s.modelValue, (u) => {
|
|
1171
|
+
r.value = u;
|
|
1172
|
+
});
|
|
1173
|
+
const d = (u) => {
|
|
1174
|
+
r.value = u, o("update:modelValue", u);
|
|
1175
|
+
}, n = (u, b) => {
|
|
1176
|
+
var v;
|
|
1177
|
+
let h = b;
|
|
1178
|
+
switch (u.key) {
|
|
1179
|
+
case "ArrowLeft":
|
|
1180
|
+
u.preventDefault(), h = b > 0 ? b - 1 : s.tabs.length - 1;
|
|
1181
|
+
break;
|
|
1182
|
+
case "ArrowRight":
|
|
1183
|
+
u.preventDefault(), h = b < s.tabs.length - 1 ? b + 1 : 0;
|
|
1184
|
+
break;
|
|
1185
|
+
case "Home":
|
|
1186
|
+
u.preventDefault(), h = 0;
|
|
1187
|
+
break;
|
|
1188
|
+
case "End":
|
|
1189
|
+
u.preventDefault(), h = s.tabs.length - 1;
|
|
1190
|
+
break;
|
|
1191
|
+
default:
|
|
1192
|
+
return;
|
|
1193
|
+
}
|
|
1194
|
+
d(h), (v = document.getElementById(`tab-${h}`)) == null || v.focus();
|
|
1195
|
+
};
|
|
1196
|
+
return (u, b) => (a(), t("div", Dt, [
|
|
1197
|
+
i("div", {
|
|
1198
|
+
class: "dm-tabs__header",
|
|
1199
|
+
role: "tablist",
|
|
1200
|
+
"aria-label": e.ariaLabel
|
|
1201
|
+
}, [
|
|
1202
|
+
(a(!0), t(B, null, L(e.tabs, (h, v) => (a(), t("button", {
|
|
1203
|
+
key: v,
|
|
1204
|
+
id: `tab-${v}`,
|
|
1205
|
+
class: y(["dm-tabs__tab", { "dm-tabs__tab--active": r.value === v }]),
|
|
1206
|
+
role: "tab",
|
|
1207
|
+
"aria-selected": r.value === v,
|
|
1208
|
+
"aria-controls": `panel-${v}`,
|
|
1209
|
+
tabindex: r.value === v ? 0 : -1,
|
|
1210
|
+
onClick: (D) => d(v),
|
|
1211
|
+
onKeydown: (D) => n(D, v)
|
|
1212
|
+
}, m(h), 43, wt))), 128)),
|
|
1213
|
+
i("div", {
|
|
1214
|
+
class: "dm-tabs__indicator",
|
|
1215
|
+
style: A({ transform: `translateX(${r.value * 100}%)` })
|
|
1216
|
+
}, null, 4)
|
|
1217
|
+
], 8, Vt),
|
|
1218
|
+
i("div", Ct, [
|
|
1219
|
+
(a(!0), t(B, null, L(e.tabs, (h, v) => (a(), t("div", {
|
|
1220
|
+
key: v,
|
|
1221
|
+
id: `panel-${v}`,
|
|
1222
|
+
class: y(["dm-tabs__panel", { "dm-tabs__panel--active": r.value === v }]),
|
|
1223
|
+
role: "tabpanel",
|
|
1224
|
+
"aria-labelledby": `tab-${v}`,
|
|
1225
|
+
hidden: r.value !== v
|
|
1226
|
+
}, [
|
|
1227
|
+
p(u.$slots, `panel-${v}`, {}, void 0, !0)
|
|
1228
|
+
], 10, It))), 128))
|
|
1229
|
+
])
|
|
1230
|
+
]));
|
|
1231
|
+
}
|
|
1232
|
+
}), ol = /* @__PURE__ */ _(Bt, [["__scopeId", "data-v-6d59d320"]]);
|
|
1233
|
+
let q = k(!1), F = !1;
|
|
1234
|
+
function il() {
|
|
1235
|
+
const e = () => {
|
|
1236
|
+
q.value = !q.value, document.documentElement.classList.toggle("dark", q.value), localStorage.setItem("theme", q.value ? "dark" : "light");
|
|
1237
|
+
}, l = (n) => {
|
|
1238
|
+
q.value = n === "dark", document.documentElement.classList.toggle("dark", q.value), localStorage.setItem("theme", n);
|
|
1239
|
+
}, s = () => {
|
|
1240
|
+
F = !0;
|
|
1241
|
+
const n = localStorage.getItem("theme");
|
|
1242
|
+
if (n)
|
|
1243
|
+
l(n);
|
|
1244
|
+
else if (typeof window < "u" && window.matchMedia) {
|
|
1245
|
+
const u = window.matchMedia("(prefers-color-scheme: dark)").matches;
|
|
1246
|
+
l(u ? "dark" : "light");
|
|
1247
|
+
}
|
|
1248
|
+
typeof window < "u" && window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change", (u) => {
|
|
1249
|
+
localStorage.getItem("theme") || l(u.matches ? "dark" : "light");
|
|
1250
|
+
});
|
|
1251
|
+
};
|
|
1252
|
+
F || s();
|
|
1253
|
+
const o = C(() => q.value ? "dark" : "light");
|
|
1254
|
+
return {
|
|
1255
|
+
isDark: q,
|
|
1256
|
+
currentTheme: o,
|
|
1257
|
+
toggle: e,
|
|
1258
|
+
setTheme: l,
|
|
1259
|
+
setDark: () => l("dark"),
|
|
1260
|
+
setLight: () => l("light"),
|
|
1261
|
+
initTheme: s
|
|
1262
|
+
};
|
|
1263
|
+
}
|
|
1264
|
+
const Lt = (e) => !!e, Mt = (e) => e ? /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e) : !0, qt = (e) => (l) => l ? l.length >= e : !0, Tt = (e) => (l) => l ? l.length <= e : !0, xt = (e) => (l) => l ? e.test(l) : !0, St = (e) => (l) => e(l);
|
|
1265
|
+
function nl() {
|
|
1266
|
+
return {
|
|
1267
|
+
required: Lt,
|
|
1268
|
+
email: Mt,
|
|
1269
|
+
minLength: qt,
|
|
1270
|
+
maxLength: Tt,
|
|
1271
|
+
pattern: xt,
|
|
1272
|
+
custom: St
|
|
1273
|
+
};
|
|
1274
|
+
}
|
|
1275
|
+
function cl(e = {}) {
|
|
1276
|
+
const l = k(!1), s = k(null), o = k(null), r = async (h, v = {}) => {
|
|
1277
|
+
l.value = !0, s.value = null;
|
|
1278
|
+
try {
|
|
1279
|
+
const D = e.baseURL ? `${e.baseURL}${h}` : h, I = await fetch(D, {
|
|
1280
|
+
...v,
|
|
1281
|
+
headers: {
|
|
1282
|
+
"Content-Type": "application/json",
|
|
1283
|
+
...e.headers,
|
|
1284
|
+
...v.headers
|
|
1285
|
+
}
|
|
1286
|
+
});
|
|
1287
|
+
if (!I.ok)
|
|
1288
|
+
throw new Error(`HTTP ${I.status}: ${I.statusText}`);
|
|
1289
|
+
const x = await I.json();
|
|
1290
|
+
return o.value = x, x;
|
|
1291
|
+
} catch (D) {
|
|
1292
|
+
throw s.value = D.message || "Request failed", D;
|
|
1293
|
+
} finally {
|
|
1294
|
+
l.value = !1;
|
|
1295
|
+
}
|
|
1296
|
+
};
|
|
1297
|
+
return {
|
|
1298
|
+
loading: l,
|
|
1299
|
+
error: s,
|
|
1300
|
+
data: o,
|
|
1301
|
+
get: (h, v) => r(h, { ...v, method: "GET" }),
|
|
1302
|
+
post: (h, v, D) => r(h, {
|
|
1303
|
+
...D,
|
|
1304
|
+
method: "POST",
|
|
1305
|
+
body: JSON.stringify(v)
|
|
1306
|
+
}),
|
|
1307
|
+
put: (h, v, D) => r(h, {
|
|
1308
|
+
...D,
|
|
1309
|
+
method: "PUT",
|
|
1310
|
+
body: JSON.stringify(v)
|
|
1311
|
+
}),
|
|
1312
|
+
delete: (h, v) => r(h, { ...v, method: "DELETE" })
|
|
1313
|
+
};
|
|
1314
|
+
}
|
|
1315
|
+
function ul(e, l) {
|
|
1316
|
+
const s = localStorage.getItem(e);
|
|
1317
|
+
let o = l;
|
|
1318
|
+
if (s)
|
|
1319
|
+
try {
|
|
1320
|
+
o = JSON.parse(s);
|
|
1321
|
+
} catch {
|
|
1322
|
+
o = l;
|
|
1323
|
+
}
|
|
1324
|
+
const r = k(o);
|
|
1325
|
+
return T(
|
|
1326
|
+
r,
|
|
1327
|
+
(d) => {
|
|
1328
|
+
localStorage.setItem(e, JSON.stringify(d));
|
|
1329
|
+
},
|
|
1330
|
+
{ deep: !0 }
|
|
1331
|
+
), r;
|
|
1332
|
+
}
|
|
1333
|
+
function ml(e, l = 300) {
|
|
1334
|
+
const s = k(e.value);
|
|
1335
|
+
let o = null;
|
|
1336
|
+
return T(e, (r) => {
|
|
1337
|
+
o && clearTimeout(o), o = setTimeout(() => {
|
|
1338
|
+
s.value = r;
|
|
1339
|
+
}, l);
|
|
1340
|
+
}), s;
|
|
1341
|
+
}
|
|
1342
|
+
function bl() {
|
|
1343
|
+
const e = k(!1), l = k(null);
|
|
1344
|
+
return {
|
|
1345
|
+
copied: e,
|
|
1346
|
+
error: l,
|
|
1347
|
+
copy: async (r) => {
|
|
1348
|
+
try {
|
|
1349
|
+
return await navigator.clipboard.writeText(r), e.value = !0, l.value = null, setTimeout(() => {
|
|
1350
|
+
e.value = !1;
|
|
1351
|
+
}, 2e3), !0;
|
|
1352
|
+
} catch (d) {
|
|
1353
|
+
return l.value = d.message || "Copy failed", e.value = !1, !1;
|
|
1354
|
+
}
|
|
1355
|
+
},
|
|
1356
|
+
read: async () => {
|
|
1357
|
+
try {
|
|
1358
|
+
const r = await navigator.clipboard.readText();
|
|
1359
|
+
return l.value = null, r;
|
|
1360
|
+
} catch (r) {
|
|
1361
|
+
return l.value = r.message || "Read failed", "";
|
|
1362
|
+
}
|
|
1363
|
+
}
|
|
1364
|
+
};
|
|
1365
|
+
}
|
|
1366
|
+
export {
|
|
1367
|
+
Qt as DatametriaAlert,
|
|
1368
|
+
jt as DatametriaAutocomplete,
|
|
1369
|
+
tl as DatametriaAvatar,
|
|
1370
|
+
ll as DatametriaBadge,
|
|
1371
|
+
dl as DatametriaBreadcrumb,
|
|
1372
|
+
Et as DatametriaButton,
|
|
1373
|
+
Gt as DatametriaCard,
|
|
1374
|
+
Nt as DatametriaCheckbox,
|
|
1375
|
+
sl as DatametriaChip,
|
|
1376
|
+
Jt as DatametriaContainer,
|
|
1377
|
+
Pt as DatametriaDatePicker,
|
|
1378
|
+
Yt as DatametriaDivider,
|
|
1379
|
+
Kt as DatametriaFileUpload,
|
|
1380
|
+
Wt as DatametriaGrid,
|
|
1381
|
+
At as DatametriaInput,
|
|
1382
|
+
Ht as DatametriaModal,
|
|
1383
|
+
rl as DatametriaNavbar,
|
|
1384
|
+
Zt as DatametriaProgress,
|
|
1385
|
+
Rt as DatametriaRadio,
|
|
1386
|
+
Ot as DatametriaSelect,
|
|
1387
|
+
el as DatametriaSpinner,
|
|
1388
|
+
Ut as DatametriaSwitch,
|
|
1389
|
+
al as DatametriaTable,
|
|
1390
|
+
ol as DatametriaTabs,
|
|
1391
|
+
Ft as DatametriaTextarea,
|
|
1392
|
+
Xt as DatametriaToast,
|
|
1393
|
+
St as custom,
|
|
1394
|
+
Mt as email,
|
|
1395
|
+
Tt as maxLength,
|
|
1396
|
+
qt as minLength,
|
|
1397
|
+
xt as pattern,
|
|
1398
|
+
Lt as required,
|
|
1399
|
+
cl as useAPI,
|
|
1400
|
+
bl as useClipboard,
|
|
1401
|
+
ml as useDebounce,
|
|
1402
|
+
ul as useLocalStorage,
|
|
1403
|
+
il as useTheme,
|
|
1404
|
+
nl as useValidation
|
|
1405
|
+
};
|