@topjoao/top-design-system 0.1.0-beta.8 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +662 -63
- package/dist/TopToast-BFY94BWZ.js +2534 -0
- package/dist/TopToast-BFY94BWZ.js.map +1 -0
- package/dist/TopToast-CC6iBs5S.cjs +2 -0
- package/dist/TopToast-CC6iBs5S.cjs.map +1 -0
- package/dist/components/TopButton.vue.d.ts +4 -1
- package/dist/components/TopConfirmDialog.vue.d.ts +1 -1
- package/dist/components/TopDatePicker.vue.d.ts +81 -0
- package/dist/components/TopFileUpload.vue.d.ts +88 -0
- package/dist/components/TopNavBar.vue.d.ts +287 -0
- package/dist/components/TopSelect.vue.d.ts +4 -4
- package/dist/components/TopTabs.vue.d.ts +34 -0
- package/dist/components/TopToast.vue.d.ts +2 -10
- package/dist/components/internal/TopNavMobileTree.vue.d.ts +20 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +10 -1
- package/dist/index.js +10 -10
- package/dist/nuxt.cjs +1 -1
- package/dist/nuxt.cjs.map +1 -1
- package/dist/nuxt.js +20 -0
- package/dist/nuxt.js.map +1 -1
- package/dist/plugin.cjs +1 -1
- package/dist/plugin.cjs.map +1 -1
- package/dist/plugin.d.ts +8 -0
- package/dist/plugin.js +4 -4
- package/dist/plugin.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/toast.d.ts +17 -0
- package/package.json +4 -2
- package/dist/TopToast-BoaGrI3X.js +0 -673
- package/dist/TopToast-BoaGrI3X.js.map +0 -1
- package/dist/TopToast-CMAykvmB.cjs +0 -2
- package/dist/TopToast-CMAykvmB.cjs.map +0 -1
|
@@ -1,673 +0,0 @@
|
|
|
1
|
-
import { Fragment as e, computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createSlots as o, createTextVNode as s, createVNode as c, defineComponent as l, guardReactiveProps as u, mergeProps as d, nextTick as f, normalizeClass as p, normalizeProps as m, normalizeStyle as h, onBeforeUnmount as g, onMounted as _, openBlock as v, ref as y, renderList as b, renderSlot as x, toDisplayString as S, unref as C, useAttrs as w, useId as T, useSlots as E, watch as D, withCtx as O, withDirectives as k } from "vue";
|
|
2
|
-
import A from "primevue/button";
|
|
3
|
-
import j from "primevue/tooltip";
|
|
4
|
-
import { twMerge as M } from "tailwind-merge";
|
|
5
|
-
import N from "primevue/dialog";
|
|
6
|
-
import P from "primevue/inputtext";
|
|
7
|
-
import ee from "primevue/autocomplete";
|
|
8
|
-
import F from "primevue/toast";
|
|
9
|
-
//#region src/components/TopButton.vue?vue&type=script&setup=true&lang.ts
|
|
10
|
-
var I = { class: "top-button top-solutions-component h-fit w-fit rounded-[12px] bg-transparent" }, L = /* @__PURE__ */ l({
|
|
11
|
-
__name: "TopButton",
|
|
12
|
-
props: {
|
|
13
|
-
tooltip: { default: "" },
|
|
14
|
-
tooltipClass: { default: "text-xs" },
|
|
15
|
-
label: { default: "" },
|
|
16
|
-
icon: { default: "" },
|
|
17
|
-
loading: {
|
|
18
|
-
type: Boolean,
|
|
19
|
-
default: !1
|
|
20
|
-
},
|
|
21
|
-
class: { default: "" },
|
|
22
|
-
outlined: {
|
|
23
|
-
type: Boolean,
|
|
24
|
-
default: !1
|
|
25
|
-
},
|
|
26
|
-
secondary: {
|
|
27
|
-
type: Boolean,
|
|
28
|
-
default: !1
|
|
29
|
-
},
|
|
30
|
-
disabled: {
|
|
31
|
-
type: Boolean,
|
|
32
|
-
default: !1
|
|
33
|
-
},
|
|
34
|
-
unstyled: {
|
|
35
|
-
type: Boolean,
|
|
36
|
-
default: !1
|
|
37
|
-
},
|
|
38
|
-
type: { default: "button" }
|
|
39
|
-
},
|
|
40
|
-
emits: ["click"],
|
|
41
|
-
setup(e, { emit: r }) {
|
|
42
|
-
let a = E(), s = t(() => !!a.icon), c = e, l = r, u = t(() => {
|
|
43
|
-
let e = c.unstyled ? "" : c.secondary ? "rounded-[10px] border px-3 py-2 font-bold dark:!border-zinc-500 dark:!bg-zinc-700 dark:!text-zinc-100 dark:hover:!bg-zinc-600" : c.outlined ? "shrink-0 rounded-[10px] border-primary-800 px-3 py-2 text-primary-800 hover:bg-primary-50 dark:border-primary-200 dark:bg-transparent dark:text-primary-100 dark:hover:bg-primary-900" : "rounded-[10px] !border-primary-900 bg-primary-900 px-3 py-2 font-bold text-white hover:!border-primary-800 hover:bg-primary-800 dark:!text-white";
|
|
44
|
-
return M(e, c.class);
|
|
45
|
-
});
|
|
46
|
-
return (t, r) => (v(), i("span", I, [k((v(), n(C(A), {
|
|
47
|
-
type: e.type,
|
|
48
|
-
label: e.label,
|
|
49
|
-
disabled: e.disabled || e.loading,
|
|
50
|
-
icon: s.value ? void 0 : e.icon || void 0,
|
|
51
|
-
loading: e.loading,
|
|
52
|
-
outlined: e.outlined || e.secondary,
|
|
53
|
-
severity: e.secondary ? "secondary" : void 0,
|
|
54
|
-
class: p(u.value),
|
|
55
|
-
pt: { root: { class: u.value } },
|
|
56
|
-
onClick: r[0] ||= (e) => l("click")
|
|
57
|
-
}, o({ _: 2 }, [s.value ? {
|
|
58
|
-
name: "icon",
|
|
59
|
-
fn: O(() => [x(t.$slots, "icon")]),
|
|
60
|
-
key: "0"
|
|
61
|
-
} : void 0]), 1032, [
|
|
62
|
-
"type",
|
|
63
|
-
"label",
|
|
64
|
-
"disabled",
|
|
65
|
-
"icon",
|
|
66
|
-
"loading",
|
|
67
|
-
"outlined",
|
|
68
|
-
"severity",
|
|
69
|
-
"class",
|
|
70
|
-
"pt"
|
|
71
|
-
])), [[
|
|
72
|
-
C(j),
|
|
73
|
-
{
|
|
74
|
-
value: e.tooltip,
|
|
75
|
-
class: e.tooltipClass
|
|
76
|
-
},
|
|
77
|
-
void 0,
|
|
78
|
-
{ top: !0 }
|
|
79
|
-
]])]));
|
|
80
|
-
}
|
|
81
|
-
}), R = {
|
|
82
|
-
primary: {
|
|
83
|
-
50: "#EEF9FF",
|
|
84
|
-
100: "#DFF4FF",
|
|
85
|
-
200: "#C5E6F8",
|
|
86
|
-
300: "#8EC4DF",
|
|
87
|
-
400: "#66ACD1",
|
|
88
|
-
500: "#2488BC",
|
|
89
|
-
600: "#036DA3",
|
|
90
|
-
700: "#1B5783",
|
|
91
|
-
800: "#02466B",
|
|
92
|
-
900: "#052F4A",
|
|
93
|
-
950: "#0C192D"
|
|
94
|
-
},
|
|
95
|
-
secondary: {
|
|
96
|
-
50: "#FAFAFA",
|
|
97
|
-
100: "#F4F4F5",
|
|
98
|
-
200: "#E9E9E9",
|
|
99
|
-
300: "#D8D8D8",
|
|
100
|
-
400: "#B8B8B8",
|
|
101
|
-
500: "#8E8E8E",
|
|
102
|
-
600: "#676767",
|
|
103
|
-
700: "#4B4B4B",
|
|
104
|
-
800: "#343434",
|
|
105
|
-
900: "#1C1917",
|
|
106
|
-
950: "#0C0A09"
|
|
107
|
-
},
|
|
108
|
-
success: {
|
|
109
|
-
50: "#FAFFFA",
|
|
110
|
-
100: "#F4FBF6",
|
|
111
|
-
200: "#DFF6DE",
|
|
112
|
-
300: "#CBE3CA",
|
|
113
|
-
400: "#A3CCA1",
|
|
114
|
-
500: "#6BA968",
|
|
115
|
-
600: "#358F30",
|
|
116
|
-
700: "#2C7B27",
|
|
117
|
-
800: "#1E631A",
|
|
118
|
-
900: "#10430D",
|
|
119
|
-
950: "#062804"
|
|
120
|
-
},
|
|
121
|
-
warn: {
|
|
122
|
-
50: "#FFF7ED",
|
|
123
|
-
100: "#FDF3D8",
|
|
124
|
-
200: "#FDE9B2",
|
|
125
|
-
300: "#FDD566",
|
|
126
|
-
400: "#FFB900",
|
|
127
|
-
500: "#FFA515",
|
|
128
|
-
600: "#FD9024",
|
|
129
|
-
700: "#DD781F",
|
|
130
|
-
800: "#BC4E00",
|
|
131
|
-
900: "#A42D02",
|
|
132
|
-
950: "#792202"
|
|
133
|
-
},
|
|
134
|
-
danger: {
|
|
135
|
-
50: "#F8E6E4",
|
|
136
|
-
100: "#FFDDD9",
|
|
137
|
-
200: "#EEC1BC",
|
|
138
|
-
300: "#E3938C",
|
|
139
|
-
400: "#E3675C",
|
|
140
|
-
500: "#DC3F32",
|
|
141
|
-
600: "#CF150E",
|
|
142
|
-
700: "#B10404",
|
|
143
|
-
800: "#820907",
|
|
144
|
-
900: "#5D0803",
|
|
145
|
-
950: "#450501"
|
|
146
|
-
}
|
|
147
|
-
}, z = ["aria-label", "disabled"], B = { class: "flex flex-col items-center gap-2 pt-2" }, V = { class: "text-base font-bold text-secondary-900 dark:text-zinc-100" }, H = { class: "text-sm leading-5 text-secondary-700 dark:text-zinc-300" }, U = { class: "mt-2 flex w-full items-center justify-center gap-3" }, W = /* @__PURE__ */ l({
|
|
148
|
-
__name: "TopConfirmDialog",
|
|
149
|
-
props: {
|
|
150
|
-
modelValue: {
|
|
151
|
-
type: Boolean,
|
|
152
|
-
default: !1
|
|
153
|
-
},
|
|
154
|
-
title: { default: "Confirmar" },
|
|
155
|
-
message: { default: "" },
|
|
156
|
-
confirmText: { default: "Confirmar" },
|
|
157
|
-
cancelText: { default: "Cancelar" },
|
|
158
|
-
loading: {
|
|
159
|
-
type: Boolean,
|
|
160
|
-
default: !1
|
|
161
|
-
},
|
|
162
|
-
loadingText: { default: "Processando..." },
|
|
163
|
-
severity: { default: "danger" },
|
|
164
|
-
icon: { default: "pi pi-exclamation-triangle" }
|
|
165
|
-
},
|
|
166
|
-
emits: [
|
|
167
|
-
"update:modelValue",
|
|
168
|
-
"confirm",
|
|
169
|
-
"cancel",
|
|
170
|
-
"close"
|
|
171
|
-
],
|
|
172
|
-
setup(e, { emit: r }) {
|
|
173
|
-
let i = e, o = r, l = t({
|
|
174
|
-
get: () => i.modelValue,
|
|
175
|
-
set: (e) => {
|
|
176
|
-
!e && i.loading || o("update:modelValue", e);
|
|
177
|
-
}
|
|
178
|
-
}), u = t(() => ({
|
|
179
|
-
"--top-confirm-dialog-accent": i.severity === "danger" ? R.danger[600] : R.primary[800],
|
|
180
|
-
"--top-confirm-dialog-accent-hover": i.severity === "danger" ? R.danger[700] : R.primary[700]
|
|
181
|
-
})), d = t(() => ["px-3 py-2 text-sm", i.severity === "danger" ? "!border-red-600 !bg-red-600 hover:!border-red-700 hover:!bg-red-700" : ""].filter(Boolean).join(" "));
|
|
182
|
-
function f() {
|
|
183
|
-
i.loading || o("confirm");
|
|
184
|
-
}
|
|
185
|
-
function m() {
|
|
186
|
-
i.loading || (o("cancel"), l.value = !1);
|
|
187
|
-
}
|
|
188
|
-
function g() {
|
|
189
|
-
i.loading || (l.value = !1);
|
|
190
|
-
}
|
|
191
|
-
return (t, r) => (v(), n(C(N), {
|
|
192
|
-
visible: l.value,
|
|
193
|
-
"onUpdate:visible": r[0] ||= (e) => l.value = e,
|
|
194
|
-
modal: "",
|
|
195
|
-
closable: !1,
|
|
196
|
-
"close-on-escape": !e.loading,
|
|
197
|
-
"dismissable-mask": !1,
|
|
198
|
-
draggable: !1,
|
|
199
|
-
"show-header": !1,
|
|
200
|
-
style: {
|
|
201
|
-
width: "500px",
|
|
202
|
-
maxWidth: "calc(100vw - 2rem)"
|
|
203
|
-
},
|
|
204
|
-
"aria-label": e.title,
|
|
205
|
-
pt: {
|
|
206
|
-
root: { class: "top-confirm-dialog top-solutions-component" },
|
|
207
|
-
content: { class: "p-6" },
|
|
208
|
-
footer: { class: "hidden" }
|
|
209
|
-
},
|
|
210
|
-
onHide: r[1] ||= (e) => o("close")
|
|
211
|
-
}, {
|
|
212
|
-
default: O(() => [a("div", {
|
|
213
|
-
class: "relative flex flex-col items-center gap-4 text-center",
|
|
214
|
-
style: h(u.value)
|
|
215
|
-
}, [
|
|
216
|
-
a("button", {
|
|
217
|
-
type: "button",
|
|
218
|
-
class: "absolute right-[-0.25rem] top-[-0.5rem] flex size-8 items-center justify-center rounded-full border-0 bg-transparent p-0 text-secondary-700 outline-none transition-colors hover:bg-secondary-200 focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 dark:text-zinc-200 dark:hover:bg-zinc-700",
|
|
219
|
-
"aria-label": e.cancelText,
|
|
220
|
-
disabled: e.loading,
|
|
221
|
-
onClick: g
|
|
222
|
-
}, [...r[2] ||= [a("i", {
|
|
223
|
-
class: "pi pi-times text-lg",
|
|
224
|
-
"aria-hidden": "true"
|
|
225
|
-
}, null, -1)]], 8, z),
|
|
226
|
-
a("div", B, [a("i", {
|
|
227
|
-
class: p([e.icon, "top-confirm-dialog__icon text-[40px]"]),
|
|
228
|
-
"aria-hidden": "true"
|
|
229
|
-
}, null, 2), a("p", V, S(e.title), 1)]),
|
|
230
|
-
a("div", H, [x(t.$slots, "message", {}, () => [x(t.$slots, "default", {}, () => [s(S(e.message), 1)])])]),
|
|
231
|
-
a("div", U, [c(L, {
|
|
232
|
-
label: e.cancelText,
|
|
233
|
-
secondary: "",
|
|
234
|
-
disabled: e.loading,
|
|
235
|
-
class: "px-3 py-2 text-sm",
|
|
236
|
-
onClick: m
|
|
237
|
-
}, null, 8, ["label", "disabled"]), c(L, {
|
|
238
|
-
label: e.loading ? e.loadingText : e.confirmText,
|
|
239
|
-
loading: e.loading,
|
|
240
|
-
class: p(d.value),
|
|
241
|
-
onClick: f
|
|
242
|
-
}, null, 8, [
|
|
243
|
-
"label",
|
|
244
|
-
"loading",
|
|
245
|
-
"class"
|
|
246
|
-
])])
|
|
247
|
-
], 4)]),
|
|
248
|
-
_: 3
|
|
249
|
-
}, 8, [
|
|
250
|
-
"visible",
|
|
251
|
-
"close-on-escape",
|
|
252
|
-
"aria-label"
|
|
253
|
-
]));
|
|
254
|
-
}
|
|
255
|
-
}), G = { class: "top-input-text top-solutions-component flex w-full flex-col gap-1" }, K = ["for"], q = {
|
|
256
|
-
key: 0,
|
|
257
|
-
"aria-hidden": "true",
|
|
258
|
-
class: "text-red-600 dark:text-red-400"
|
|
259
|
-
}, J = ["id"], Y = /* @__PURE__ */ l({
|
|
260
|
-
inheritAttrs: !1,
|
|
261
|
-
__name: "TopInputText",
|
|
262
|
-
props: {
|
|
263
|
-
modelValue: { default: "" },
|
|
264
|
-
label: { default: "" },
|
|
265
|
-
placeholder: { default: "" },
|
|
266
|
-
required: {
|
|
267
|
-
type: Boolean,
|
|
268
|
-
default: !1
|
|
269
|
-
},
|
|
270
|
-
error: { default: "" },
|
|
271
|
-
disabled: {
|
|
272
|
-
type: Boolean,
|
|
273
|
-
default: !1
|
|
274
|
-
},
|
|
275
|
-
readonly: {
|
|
276
|
-
type: Boolean,
|
|
277
|
-
default: !1
|
|
278
|
-
}
|
|
279
|
-
},
|
|
280
|
-
emits: ["update:modelValue"],
|
|
281
|
-
setup(e, { emit: n }) {
|
|
282
|
-
let a = e, o = n, l = w(), u = T(), f = t(() => l.id === void 0 || l.id === null || l.id === "" ? u : String(l.id)), p = t(() => `${f.value}-error`), m = t(() => {
|
|
283
|
-
if (a.error) return !0;
|
|
284
|
-
let e = l["aria-invalid"];
|
|
285
|
-
return typeof e == "boolean" || e === "true" || e === "false" || e === "grammar" || e === "spelling" ? e : void 0;
|
|
286
|
-
}), h = t(() => {
|
|
287
|
-
let e = l["aria-describedby"], t = [typeof e == "string" ? e : "", a.error ? p.value : ""].filter(Boolean);
|
|
288
|
-
return t.length ? t.join(" ") : void 0;
|
|
289
|
-
});
|
|
290
|
-
function g(e) {
|
|
291
|
-
o("update:modelValue", e ?? "");
|
|
292
|
-
}
|
|
293
|
-
return (t, n) => (v(), i("div", G, [
|
|
294
|
-
e.label ? (v(), i("label", {
|
|
295
|
-
key: 0,
|
|
296
|
-
for: f.value,
|
|
297
|
-
class: "text-xs font-bold text-secondary-800 dark:text-zinc-200"
|
|
298
|
-
}, [s(S(e.label) + " ", 1), e.required ? (v(), i("span", q, "*")) : r("", !0)], 8, K)) : r("", !0),
|
|
299
|
-
c(C(P), d(t.$attrs, {
|
|
300
|
-
id: f.value,
|
|
301
|
-
"model-value": e.modelValue,
|
|
302
|
-
type: "text",
|
|
303
|
-
placeholder: e.placeholder,
|
|
304
|
-
required: e.required,
|
|
305
|
-
disabled: e.disabled,
|
|
306
|
-
readonly: e.readonly,
|
|
307
|
-
invalid: !!e.error,
|
|
308
|
-
"aria-invalid": m.value,
|
|
309
|
-
"aria-describedby": h.value,
|
|
310
|
-
fluid: "",
|
|
311
|
-
class: "top-input-text__control h-[40px] w-full rounded-[10px] border border-secondary-600 px-3 py-2 text-xs text-secondary-900 enabled:hover:border-secondary-700 read-only:cursor-default read-only:bg-secondary-50 disabled:cursor-not-allowed dark:border-zinc-600 dark:bg-zinc-800 dark:text-zinc-100 dark:placeholder:text-zinc-400 dark:enabled:hover:border-zinc-500 dark:read-only:bg-zinc-800",
|
|
312
|
-
"onUpdate:modelValue": g
|
|
313
|
-
}), null, 16, [
|
|
314
|
-
"id",
|
|
315
|
-
"model-value",
|
|
316
|
-
"placeholder",
|
|
317
|
-
"required",
|
|
318
|
-
"disabled",
|
|
319
|
-
"readonly",
|
|
320
|
-
"invalid",
|
|
321
|
-
"aria-invalid",
|
|
322
|
-
"aria-describedby"
|
|
323
|
-
]),
|
|
324
|
-
e.error ? (v(), i("span", {
|
|
325
|
-
key: 1,
|
|
326
|
-
id: p.value,
|
|
327
|
-
class: "text-[11px] text-red-600 dark:text-red-400",
|
|
328
|
-
role: "alert"
|
|
329
|
-
}, S(e.error), 9, J)) : r("", !0)
|
|
330
|
-
]));
|
|
331
|
-
}
|
|
332
|
-
}), X = { class: "pointer-events-none absolute left-3 top-2 iconetop z-10 text-primary-800 dark:text-primary-500" }, Z = {
|
|
333
|
-
key: 0,
|
|
334
|
-
class: "pi pi-spin pi-spinner"
|
|
335
|
-
}, Q = {
|
|
336
|
-
key: 1,
|
|
337
|
-
class: "pi pi-search"
|
|
338
|
-
}, te = {
|
|
339
|
-
key: 1,
|
|
340
|
-
class: "flex items-center gap-1 !text-sm"
|
|
341
|
-
}, ne = { class: "flex items-center gap-2 rounded-[9px] bg-primary-500 px-2 py-1 text-white" }, re = ["onClick"], ie = { class: "line-clamp-1 max-w-[300px] overflow-hidden text-ellipsis" }, ae = {
|
|
342
|
-
key: 1,
|
|
343
|
-
class: "flex min-h-[100px] flex-col items-center justify-center gap-2 py-2"
|
|
344
|
-
}, oe = {
|
|
345
|
-
key: 0,
|
|
346
|
-
class: "text-xs font-medium text-primary-600"
|
|
347
|
-
}, se = {
|
|
348
|
-
key: 2,
|
|
349
|
-
class: "text-xs text-secondary-500"
|
|
350
|
-
}, ce = { key: 1 }, le = {
|
|
351
|
-
key: 1,
|
|
352
|
-
class: "flex items-center gap-2 font-semibold"
|
|
353
|
-
}, ue = {
|
|
354
|
-
key: 1,
|
|
355
|
-
class: "flex w-full min-w-0 items-start gap-2 overflow-hidden px-2 py-3 text-sm",
|
|
356
|
-
style: { "white-space": "normal" }
|
|
357
|
-
}, de = ["title"], fe = {
|
|
358
|
-
key: 0,
|
|
359
|
-
class: "top-select-option-prefix whitespace-nowrap font-bold text-primary-800 dark:text-primary-100"
|
|
360
|
-
}, pe = {
|
|
361
|
-
key: 0,
|
|
362
|
-
class: "rounded-sm bg-primary-200 p-0 font-bold text-black dark:bg-cyan-700 dark:text-white"
|
|
363
|
-
}, $ = {
|
|
364
|
-
key: 0,
|
|
365
|
-
class: "rounded-sm bg-primary-200 p-0 font-bold text-black dark:bg-cyan-700 dark:text-white"
|
|
366
|
-
}, me = /* @__PURE__ */ l({
|
|
367
|
-
__name: "TopSelect",
|
|
368
|
-
props: {
|
|
369
|
-
modelValue: { default: null },
|
|
370
|
-
options: { default: () => [] },
|
|
371
|
-
loading: {
|
|
372
|
-
type: Boolean,
|
|
373
|
-
default: !1
|
|
374
|
-
},
|
|
375
|
-
disabled: {
|
|
376
|
-
type: Boolean,
|
|
377
|
-
default: !1
|
|
378
|
-
},
|
|
379
|
-
placeholder: { default: "Pesquisar..." },
|
|
380
|
-
optionLabel: {
|
|
381
|
-
type: [String, Function],
|
|
382
|
-
default: "label"
|
|
383
|
-
},
|
|
384
|
-
optionKey: { default: "id" },
|
|
385
|
-
optionPrefix: { default: "" },
|
|
386
|
-
showOptionPrefix: {
|
|
387
|
-
type: Boolean,
|
|
388
|
-
default: !1
|
|
389
|
-
},
|
|
390
|
-
showSelectedPrefix: {
|
|
391
|
-
type: Boolean,
|
|
392
|
-
default: !1
|
|
393
|
-
},
|
|
394
|
-
panelWidth: { default: null },
|
|
395
|
-
scrollHeight: { default: "250px" },
|
|
396
|
-
invalid: {
|
|
397
|
-
type: Boolean,
|
|
398
|
-
default: !1
|
|
399
|
-
},
|
|
400
|
-
showTooltip: {
|
|
401
|
-
type: Boolean,
|
|
402
|
-
default: !0
|
|
403
|
-
},
|
|
404
|
-
optionGroupLabel: { default: null },
|
|
405
|
-
optionGroupChildren: { default: null },
|
|
406
|
-
minQueryLength: { default: 1 },
|
|
407
|
-
emptyMessage: { default: "Nenhum resultado encontrado." },
|
|
408
|
-
loadingMessage: { default: "Carregando..." },
|
|
409
|
-
showLoadingMessage: {
|
|
410
|
-
type: Boolean,
|
|
411
|
-
default: !0
|
|
412
|
-
},
|
|
413
|
-
multiple: {
|
|
414
|
-
type: Boolean,
|
|
415
|
-
default: !1
|
|
416
|
-
},
|
|
417
|
-
forceSelection: {
|
|
418
|
-
type: Boolean,
|
|
419
|
-
default: !0
|
|
420
|
-
},
|
|
421
|
-
closeOnSelect: {
|
|
422
|
-
type: Boolean,
|
|
423
|
-
default: !1
|
|
424
|
-
}
|
|
425
|
-
},
|
|
426
|
-
emits: [
|
|
427
|
-
"update:modelValue",
|
|
428
|
-
"search",
|
|
429
|
-
"loadMore",
|
|
430
|
-
"clear",
|
|
431
|
-
"select",
|
|
432
|
-
"change"
|
|
433
|
-
],
|
|
434
|
-
setup(n, { expose: l, emit: h }) {
|
|
435
|
-
let w = n, T = h, A = E(), M = ee, N = y(""), P = y(!1), F = y(null), I = `top-select-${Math.random().toString(36).slice(2)}`, L = null, R = t({
|
|
436
|
-
get: () => w.modelValue,
|
|
437
|
-
set: (e) => T("update:modelValue", e)
|
|
438
|
-
});
|
|
439
|
-
function z(e, t) {
|
|
440
|
-
return e == null ? "" : String(typeof e == "object" ? e[t] ?? "" : e);
|
|
441
|
-
}
|
|
442
|
-
function B(e) {
|
|
443
|
-
return e == null ? "" : typeof w.optionLabel == "function" ? w.optionLabel(e) : z(e, w.optionLabel);
|
|
444
|
-
}
|
|
445
|
-
function V(e) {
|
|
446
|
-
return w.optionPrefix ? z(e, w.optionPrefix) : "";
|
|
447
|
-
}
|
|
448
|
-
function H(e, t = w.showSelectedPrefix) {
|
|
449
|
-
let n = B(e), r = V(e);
|
|
450
|
-
return t && r ? `${r} - ${n}` : n;
|
|
451
|
-
}
|
|
452
|
-
function U(e) {
|
|
453
|
-
let t = N.value;
|
|
454
|
-
if (!t) return [{
|
|
455
|
-
text: e,
|
|
456
|
-
highlighted: !1
|
|
457
|
-
}];
|
|
458
|
-
let n = t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), r = RegExp(`(${n})`, "gi");
|
|
459
|
-
return e.split(r).filter(Boolean).map((e) => ({
|
|
460
|
-
text: e,
|
|
461
|
-
highlighted: e.toLowerCase() === t.toLowerCase()
|
|
462
|
-
}));
|
|
463
|
-
}
|
|
464
|
-
function W() {
|
|
465
|
-
F.value?.hide?.();
|
|
466
|
-
}
|
|
467
|
-
function G() {
|
|
468
|
-
typeof window > "u" || window.dispatchEvent(new CustomEvent("top-select:close-others", { detail: { instanceId: I } }));
|
|
469
|
-
}
|
|
470
|
-
function K(e) {
|
|
471
|
-
e.detail?.instanceId !== I && W();
|
|
472
|
-
}
|
|
473
|
-
function q() {
|
|
474
|
-
if (w.disabled || L) {
|
|
475
|
-
W();
|
|
476
|
-
return;
|
|
477
|
-
}
|
|
478
|
-
P.value = !0, G();
|
|
479
|
-
}
|
|
480
|
-
function J() {
|
|
481
|
-
w.closeOnSelect && (P.value = !1, W(), f(W), L && clearTimeout(L), L = setTimeout(() => {
|
|
482
|
-
W(), L = null;
|
|
483
|
-
}, 200));
|
|
484
|
-
}
|
|
485
|
-
return l({ hideDropdown: W }), _(() => window.addEventListener("top-select:close-others", K)), g(() => {
|
|
486
|
-
window.removeEventListener("top-select:close-others", K), L && clearTimeout(L);
|
|
487
|
-
}), D(() => w.disabled, (e) => {
|
|
488
|
-
e && (P.value = !1, W());
|
|
489
|
-
}), D(() => w.options, () => {
|
|
490
|
-
P.value || W();
|
|
491
|
-
}), (t, l) => (v(), i("div", {
|
|
492
|
-
class: p(["top-select top-solutions-component relative w-full", { "pointer-events-none": n.disabled }]),
|
|
493
|
-
onFocusin: q
|
|
494
|
-
}, [a("span", X, [x(t.$slots, "icon", { loading: n.loading }, () => [n.loading ? (v(), i("i", Z)) : (v(), i("i", Q))])]), c(C(M), {
|
|
495
|
-
ref_key: "autocompleteRef",
|
|
496
|
-
ref: F,
|
|
497
|
-
modelValue: R.value,
|
|
498
|
-
"onUpdate:modelValue": l[0] ||= (e) => R.value = e,
|
|
499
|
-
"option-group-label": n.optionGroupLabel ?? void 0,
|
|
500
|
-
"option-group-children": n.optionGroupChildren ?? void 0,
|
|
501
|
-
suggestions: n.options,
|
|
502
|
-
"data-key": n.optionKey,
|
|
503
|
-
"option-label": (e) => H(e),
|
|
504
|
-
placeholder: n.placeholder,
|
|
505
|
-
multiple: n.multiple,
|
|
506
|
-
"min-length": n.minQueryLength,
|
|
507
|
-
disabled: n.disabled,
|
|
508
|
-
delay: 500,
|
|
509
|
-
"show-clear": !n.multiple && !n.disabled,
|
|
510
|
-
dropdown: "",
|
|
511
|
-
"dropdown-mode": "current",
|
|
512
|
-
"complete-on-focus": !1,
|
|
513
|
-
invalid: n.invalid,
|
|
514
|
-
fluid: "",
|
|
515
|
-
"force-selection": n.forceSelection,
|
|
516
|
-
"input-class": "text-xs",
|
|
517
|
-
"virtual-scroller-options": {
|
|
518
|
-
lazy: !0,
|
|
519
|
-
onLazyLoad: (e) => T("loadMore", e),
|
|
520
|
-
itemSize: 84,
|
|
521
|
-
showLoader: !0,
|
|
522
|
-
scrollHeight: n.scrollHeight
|
|
523
|
-
},
|
|
524
|
-
pt: {
|
|
525
|
-
root: { class: ["w-full text-xs", n.multiple ? "h-auto" : "h-[40px]"].join(" ") },
|
|
526
|
-
pcInputText: { root: { class: "w-full h-auto text-xs dark:text-zinc-100 border border-secondary-600 rounded-[10px] !pl-9 min-h-[36px] dark:border-zinc-600 dark:!bg-zinc-800" } },
|
|
527
|
-
input: { class: ["w-full h-auto text-xs dark:text-zinc-100", n.multiple ? "border-0 bg-transparent py-1 !shadow-none outline-none ring-0 dark:!bg-transparent" : "border border-secondary-600 rounded-[10px] !pl-9 min-h-[36px] dark:border-zinc-600 dark:!bg-zinc-600"].join(" ") },
|
|
528
|
-
inputMultiple: { class: ["rounded-[10px] pl-9 min-h-[40px] dark:border-zinc-600 dark:text-zinc-100", n.disabled ? "dark:!bg-zinc-700 dark:!text-zinc-400" : "dark:!bg-zinc-800"].join(" ") },
|
|
529
|
-
inputChip: { class: "py-0" },
|
|
530
|
-
token: { class: "bg-primary-100 text-primary-900 rounded-md gap-2 px-2 my-1 dark:bg-primary-900 dark:text-primary-100" },
|
|
531
|
-
removeTokenIcon: { class: "text-primary-900 w-3 h-3 cursor-pointer dark:text-primary-100" },
|
|
532
|
-
panel: { class: "top-select-panel top-solutions-component max-w-[85vw] overflow-hidden h-fit shadow-xl" },
|
|
533
|
-
listContainer: {
|
|
534
|
-
class: "max-w-full overflow-x-hidden",
|
|
535
|
-
style: {
|
|
536
|
-
overflowX: "hidden",
|
|
537
|
-
maxWidth: n.panelWidth ?? "85vw",
|
|
538
|
-
...n.panelWidth ? { width: n.panelWidth } : {}
|
|
539
|
-
}
|
|
540
|
-
},
|
|
541
|
-
list: { class: "max-w-full overflow-x-hidden" },
|
|
542
|
-
option: { class: "max-w-full overflow-hidden min-h-[84px]" },
|
|
543
|
-
placeholder: { class: "!text-xs" }
|
|
544
|
-
},
|
|
545
|
-
"search-message": " ",
|
|
546
|
-
onClear: l[1] ||= (e) => {
|
|
547
|
-
N.value = "", T("clear");
|
|
548
|
-
},
|
|
549
|
-
onItemSelect: l[2] ||= (e) => {
|
|
550
|
-
N.value = "", T("select", e), J();
|
|
551
|
-
},
|
|
552
|
-
onComplete: l[3] ||= (e) => {
|
|
553
|
-
if (n.disabled) {
|
|
554
|
-
W();
|
|
555
|
-
return;
|
|
556
|
-
}
|
|
557
|
-
N.value = e.query ?? "", G(), T("search", {
|
|
558
|
-
...e,
|
|
559
|
-
query: N.value
|
|
560
|
-
});
|
|
561
|
-
},
|
|
562
|
-
onChange: l[4] ||= (e) => T("change", e)
|
|
563
|
-
}, o({
|
|
564
|
-
chip: O((e) => [C(A).chip ? x(t.$slots, "chip", m(u(e)), void 0, void 0, 0) : (v(), i("div", te, [a("div", ne, [a("i", {
|
|
565
|
-
class: "pi pi-times-circle shrink-0 cursor-pointer rounded-full hover:bg-primary-800",
|
|
566
|
-
onClick: (t) => e.removeCallback(t)
|
|
567
|
-
}, null, 8, re), k((v(), i("span", ie, [s(S(H(e.value)), 1)])), [[
|
|
568
|
-
C(j),
|
|
569
|
-
H(e.value),
|
|
570
|
-
void 0,
|
|
571
|
-
{ top: !0 }
|
|
572
|
-
]])])]))]),
|
|
573
|
-
empty: O(() => [C(A).empty ? x(t.$slots, "empty", {}, void 0, void 0, 0) : n.loading ? (v(), i("div", ae, [l[5] ||= a("span", { class: "pi pi-spin pi-spinner text-2xl text-primary-600" }, null, -1), n.showLoadingMessage ? (v(), i("span", oe, S(n.loadingMessage), 1)) : r("", !0)])) : (v(), i("span", se, S(n.emptyMessage), 1))]),
|
|
574
|
-
"selected-item": O((e) => [C(A)["selected-item"] ? x(t.$slots, "selected-item", m(u(e)), void 0, void 0, 0) : e.item ? (v(), i("span", ce, S(H(e.item)), 1)) : r("", !0)]),
|
|
575
|
-
optiongroup: O((e) => [C(A)["option-group"] ? x(t.$slots, "option-group", m(u(e)), void 0, void 0, 0) : (v(), i("div", le, [e.option.icon ? (v(), i("i", {
|
|
576
|
-
key: 0,
|
|
577
|
-
class: p(e.option.icon)
|
|
578
|
-
}, null, 2)) : r("", !0), a("span", null, S(e.option[n.optionGroupLabel ?? "label"]), 1)]))]),
|
|
579
|
-
option: O((o) => [C(A).option ? x(t.$slots, "option", d(o, {
|
|
580
|
-
label: B(o.option),
|
|
581
|
-
prefix: V(o.option),
|
|
582
|
-
query: N.value
|
|
583
|
-
}), void 0, void 0, 0) : k((v(), i("div", ue, [a("span", {
|
|
584
|
-
class: "top-select-option-label line-clamp-2 min-w-0 flex-1 text-secondary-700 dark:text-zinc-200",
|
|
585
|
-
title: B(o.option)
|
|
586
|
-
}, [n.showOptionPrefix && V(o.option) ? (v(), i("span", fe, [(v(!0), i(e, null, b(U(V(o.option)), (t, n) => (v(), i(e, { key: n }, [t.highlighted ? (v(), i("mark", pe, S(t.text), 1)) : (v(), i(e, { key: 1 }, [s(S(t.text), 1)], 64))], 64))), 128)), l[6] ||= a("span", { class: "font-bold text-secondary-500 dark:text-zinc-400" }, "\xA0-\xA0", -1)])) : r("", !0), (v(!0), i(e, null, b(U(B(o.option)), (t, n) => (v(), i(e, { key: n }, [t.highlighted ? (v(), i("mark", $, S(t.text), 1)) : (v(), i(e, { key: 1 }, [s(S(t.text), 1)], 64))], 64))), 128))], 8, de)])), [[
|
|
587
|
-
C(j),
|
|
588
|
-
n.showTooltip ? B(o.option) : null,
|
|
589
|
-
void 0,
|
|
590
|
-
{ top: !0 }
|
|
591
|
-
]])]),
|
|
592
|
-
_: 2
|
|
593
|
-
}, [C(A).footer ? {
|
|
594
|
-
name: "footer",
|
|
595
|
-
fn: O((e) => [x(t.$slots, "footer", m(u(e)))]),
|
|
596
|
-
key: "0"
|
|
597
|
-
} : void 0]), 1032, [
|
|
598
|
-
"modelValue",
|
|
599
|
-
"option-group-label",
|
|
600
|
-
"option-group-children",
|
|
601
|
-
"suggestions",
|
|
602
|
-
"data-key",
|
|
603
|
-
"option-label",
|
|
604
|
-
"placeholder",
|
|
605
|
-
"multiple",
|
|
606
|
-
"min-length",
|
|
607
|
-
"disabled",
|
|
608
|
-
"show-clear",
|
|
609
|
-
"invalid",
|
|
610
|
-
"force-selection",
|
|
611
|
-
"virtual-scroller-options",
|
|
612
|
-
"pt"
|
|
613
|
-
])], 34));
|
|
614
|
-
}
|
|
615
|
-
}), he = { class: "top-toast__content" }, ge = { class: "top-toast__detail" }, _e = ["onClick"], ve = {
|
|
616
|
-
key: 0,
|
|
617
|
-
class: "top-toast__footer"
|
|
618
|
-
}, ye = /* @__PURE__ */ l({
|
|
619
|
-
__name: "TopToast",
|
|
620
|
-
props: { baseZIndex: { default: 3e4 } },
|
|
621
|
-
setup(e) {
|
|
622
|
-
function t(e) {
|
|
623
|
-
return e.data?.footer;
|
|
624
|
-
}
|
|
625
|
-
function o(e) {
|
|
626
|
-
return e.data?.action;
|
|
627
|
-
}
|
|
628
|
-
function c(e) {
|
|
629
|
-
o(e)?.onClick?.();
|
|
630
|
-
}
|
|
631
|
-
function l(e) {
|
|
632
|
-
return t(e) !== void 0;
|
|
633
|
-
}
|
|
634
|
-
function u(e) {
|
|
635
|
-
return !!o(e);
|
|
636
|
-
}
|
|
637
|
-
function d(e, t) {
|
|
638
|
-
return `top-toast__${t}--${e.severity ?? "info"}`;
|
|
639
|
-
}
|
|
640
|
-
return (f, m) => (v(), n(C(F), {
|
|
641
|
-
position: "top-right",
|
|
642
|
-
"base-z-index": e.baseZIndex
|
|
643
|
-
}, {
|
|
644
|
-
message: O((e) => [a("div", he, [
|
|
645
|
-
a("div", { class: p(["top-toast__summary", d(e.message, "summary")]) }, S(e.message.summary), 3),
|
|
646
|
-
a("div", ge, S(e.message.detail), 1),
|
|
647
|
-
u(e.message) ? x(f.$slots, "action", {
|
|
648
|
-
action: o(e.message),
|
|
649
|
-
message: e.message,
|
|
650
|
-
run: () => c(e.message)
|
|
651
|
-
}, () => [o(e.message) ? (v(), i("button", {
|
|
652
|
-
key: 0,
|
|
653
|
-
class: p(["top-toast__action", d(e.message, "action")]),
|
|
654
|
-
type: "button",
|
|
655
|
-
onClick: (t) => c(e.message)
|
|
656
|
-
}, [o(e.message)?.icon ? (v(), i("i", {
|
|
657
|
-
key: 0,
|
|
658
|
-
class: p(o(e.message)?.icon),
|
|
659
|
-
"aria-hidden": "true"
|
|
660
|
-
}, null, 2)) : r("", !0), s(" " + S(o(e.message)?.label), 1)], 10, _e)) : r("", !0)], void 0, 0) : r("", !0),
|
|
661
|
-
l(e.message) ? x(f.$slots, "footer", {
|
|
662
|
-
message: e.message,
|
|
663
|
-
footer: t(e.message)
|
|
664
|
-
}, () => [t(e.message) === void 0 ? r("", !0) : (v(), i("div", ve, S(t(e.message)), 1))], void 0, 1) : r("", !0)
|
|
665
|
-
])]),
|
|
666
|
-
_: 3
|
|
667
|
-
}, 8, ["base-z-index"]));
|
|
668
|
-
}
|
|
669
|
-
});
|
|
670
|
-
//#endregion
|
|
671
|
-
export { R as a, W as i, me as n, L as o, Y as r, ye as t };
|
|
672
|
-
|
|
673
|
-
//# sourceMappingURL=TopToast-BoaGrI3X.js.map
|