@caipira/tamandua 0.0.32 → 0.0.34
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 +12 -4
- package/dist/ChartTreemap.js +2 -2
- package/dist/{ChartTreemap.vue_vue_type_script_setup_true_lang-CG5aK3KH.js → ChartTreemap.vue_vue_type_script_setup_true_lang-DzIPutlk.js} +3 -1
- package/dist/Form.js +2 -2
- package/dist/Form.vue_vue_type_script_setup_true_lang-O6nqLPyU.js +205 -0
- package/dist/InputPassword.js +2 -2
- package/dist/InputPassword.vue_vue_type_script_setup_true_lang-DtP-Tv-2.js +167 -0
- package/dist/ModalForm.js +2 -2
- package/dist/{ModalForm.vue_vue_type_script_setup_true_lang-BSEORivR.js → ModalForm.vue_vue_type_script_setup_true_lang-BpkPebgZ.js} +34 -32
- package/dist/Tag.js +2 -2
- package/dist/{Tag.vue_vue_type_script_setup_true_lang-CgX-nT8V.js → Tag.vue_vue_type_script_setup_true_lang-DMigzW22.js} +16 -19
- package/dist/components.js +5 -5
- package/dist/{crud-lKm5HfM4.js → crud-TcRx_r8S.js} +4 -4
- package/dist/form2.js +1 -1
- package/dist/{plugin-DOiXH9p9.js → plugin-BN2jubTY.js} +1 -1
- package/dist/{plugin-DF8iyfN5.js → plugin-BkoyYU7S.js} +1 -1
- package/dist/{plugin-BibUAa04.js → plugin-D4x3uASg.js} +1 -1
- package/dist/{plugin-D8CsjFdw.js → plugin-DgCa2m12.js} +1 -1
- package/dist/{plugin-C3jERS0X.js → plugin-JFEZqDsu.js} +1 -1
- package/dist/{plugins-ChB184ip.js → plugins-Bc8aBhAD.js} +7 -7
- package/dist/plugins.js +7 -7
- package/dist/tamandua.js +1 -1
- package/dist/types/components/Dropdown/types.d.ts +1 -1
- package/dist/types/components/Form/Form.vue.d.ts +42 -24
- package/dist/types/components/Form/types.d.ts +8 -4
- package/dist/types/components/InputPassword/InputPassword.vue.d.ts +1 -1
- package/dist/types/components/InputPassword/types.d.ts +10 -2
- package/dist/types/components/InputPrice/InputPrice.vue.d.ts +19 -3
- package/dist/types/components/InputPrice/types.d.ts +4 -0
- package/dist/types/components/InputSelect/InputSelect.story.d.ts +1 -1
- package/dist/types/components/InputSelect/InputSelect.vue.d.ts +69 -2
- package/dist/types/components/InputSelect/types.d.ts +33 -2
- package/dist/types/components/ModalForm/ModalForm.vue.d.ts +6 -1
- package/dist/types/components/ModalForm/types.d.ts +6 -4
- package/dist/types/composables/useForm.d.ts +20 -0
- package/dist/types/enums/form.d.ts +3 -3
- package/dist/types/enums/ui.d.ts +10 -10
- package/dist/types/form/crud.d.ts +5 -4
- package/dist/types/form/form-transformer.d.ts +2 -2
- package/dist/types/form/form-transformer.test.d.ts +1 -0
- package/dist/types/form/form-value-transformers.d.ts +2 -1
- package/dist/types/services/password.d.ts +1 -4
- package/dist/types/services/password.test.d.ts +1 -0
- package/dist/types/types/address.d.ts +8 -8
- package/dist/types/types/common.d.ts +1 -0
- package/dist/types/types/form.d.ts +14 -59
- package/package.json +6 -4
- package/dist/Form.vue_vue_type_script_setup_true_lang-CbuLc6sr.js +0 -186
- package/dist/InputPassword.vue_vue_type_script_setup_true_lang-Do7d1Qfe.js +0 -172
- /package/dist/types/components/Form/{Form.spec.d.ts → Form.test.d.ts} +0 -0
- /package/dist/types/{form/form.test.d.ts → composables/useForm.test.d.ts} +0 -0
package/README.md
CHANGED
|
@@ -20,7 +20,15 @@ npx vite-bundle-visualizer
|
|
|
20
20
|
|
|
21
21
|
## Reference
|
|
22
22
|
|
|
23
|
-
[
|
|
24
|
-
[
|
|
25
|
-
[
|
|
26
|
-
[
|
|
23
|
+
[typescript](https://www.typescriptlang.org/docs)
|
|
24
|
+
[vuejs](https://v3.vuejs.org)
|
|
25
|
+
[vite](https://vitejs.dev)
|
|
26
|
+
[tailwind-css](https://tailwindcss.com)
|
|
27
|
+
[tamanduá](https://github.com/caipira-io/tamandua)
|
|
28
|
+
[storybook](https://storybook.js.org/docs/get-started/vue3-vite)
|
|
29
|
+
[floating-ui](https://floating-ui.com/docs/vue)
|
|
30
|
+
[gsap](https://gsap.com/docs/v3/GSAP)
|
|
31
|
+
[d3](https://d3js.org/getting-started)
|
|
32
|
+
[vue-i18n](https://kazupon.github.io/vue-i18n)
|
|
33
|
+
[date-fns](https://date-fns.org/v2.24.0/docs)
|
|
34
|
+
[fakerjs](https://next.fakerjs.dev/api)
|
package/dist/ChartTreemap.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { _ as e } from "./ChartTreemap.vue_vue_type_script_setup_true_lang-
|
|
2
|
-
import { p as m } from "./plugin-
|
|
1
|
+
import { _ as e } from "./ChartTreemap.vue_vue_type_script_setup_true_lang-DzIPutlk.js";
|
|
2
|
+
import { p as m } from "./plugin-D4x3uASg.js";
|
|
3
3
|
export {
|
|
4
4
|
e as ChartTreemap,
|
|
5
5
|
m as ChartTreemapPlugin
|
|
@@ -256,7 +256,9 @@ const vt = /* @__PURE__ */ T({
|
|
|
256
256
|
const a = parseInt(
|
|
257
257
|
C(`div#${n}`).style("width"),
|
|
258
258
|
10
|
|
259
|
-
), o = { top: 0, right: 0, bottom: 0, left: 0 }, f = a, d = 350, s = f - o.left - o.right, m = d - o.top - o.bottom, u = C(`div#${n} svg`).attr("width", f).attr("height", d).append("g").attr("transform", `translate(${o.left},${o.top})`), v = M(e.data).sum((c) => c?.value ?? 0).sort(
|
|
259
|
+
), o = { top: 0, right: 0, bottom: 0, left: 0 }, f = a, d = 350, s = f - o.left - o.right, m = d - o.top - o.bottom, u = C(`div#${n} svg`).attr("width", f).attr("height", d).append("g").attr("transform", `translate(${o.left},${o.top})`), v = M(e.data).sum((c) => c?.value ?? 0).sort(
|
|
260
|
+
(c, h) => (h.value ?? 0) - (c.value ?? 0)
|
|
261
|
+
), l = ft().size([s, m]).padding(1)(v), g = ht;
|
|
260
262
|
u.selectAll("rect").data(l.leaves()).enter().append("rect").attr("x", (c) => c.x0).attr("y", (c) => c.y0).attr("width", (c) => c.x1 - c.x0).attr("height", (c) => c.y1 - c.y0).attr("fill", (c, h) => {
|
|
261
263
|
const p = c.parent?.data?.color;
|
|
262
264
|
if (p)
|
package/dist/Form.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { _ as m } from "./Form.vue_vue_type_script_setup_true_lang-
|
|
2
|
-
import { p as a } from "./plugin-
|
|
1
|
+
import { _ as m } from "./Form.vue_vue_type_script_setup_true_lang-O6nqLPyU.js";
|
|
2
|
+
import { p as a } from "./plugin-BkoyYU7S.js";
|
|
3
3
|
export {
|
|
4
4
|
m as Form,
|
|
5
5
|
a as FormPlugin
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
import { reactive as C, defineComponent as A, ref as y, watch as P, provide as _, resolveComponent as T, openBlock as N, createElementBlock as O, renderSlot as B, unref as J, createElementVNode as E, normalizeClass as R, withDirectives as W, createVNode as j, mergeProps as K, vShow as M } from "vue";
|
|
2
|
+
import { B as z } from "./ui-BC6H9E93.js";
|
|
3
|
+
import { F as s, a as p } from "./form-BkXpIJ0e.js";
|
|
4
|
+
import { f as L } from "./index-CjvqeRf7.js";
|
|
5
|
+
const w = (t) => t ? L(t, "yyyy-MM-dd") : "", F = (t) => [`${t?.iso}`, `${t?.value}`], h = (t) => t?.iso2 ?? "", S = async (t) => t?.hash ? t.hash : t?.raw ?? "", i = {
|
|
6
|
+
default: (t, e, r) => (e[r] = t, e),
|
|
7
|
+
price: (t, e, r, n = ["Currency", "Value"]) => {
|
|
8
|
+
const [u, a] = F(t);
|
|
9
|
+
return e[`${r}${n[0]}`] = u, e[`${r}${n[1]}`] = a, e;
|
|
10
|
+
},
|
|
11
|
+
password: async (t, e, r) => (e[r] = await S(t), e),
|
|
12
|
+
stringArray: (t, e, r) => (e[r] = t, e)
|
|
13
|
+
}, I = async (t, e, r, n) => {
|
|
14
|
+
switch (t) {
|
|
15
|
+
case s.Country:
|
|
16
|
+
return i.default(
|
|
17
|
+
h(r),
|
|
18
|
+
e,
|
|
19
|
+
n
|
|
20
|
+
);
|
|
21
|
+
case s.Documents:
|
|
22
|
+
return i.default(r, e, n);
|
|
23
|
+
case s.Date:
|
|
24
|
+
return i.default(
|
|
25
|
+
w(r),
|
|
26
|
+
e,
|
|
27
|
+
n
|
|
28
|
+
);
|
|
29
|
+
case s.Address:
|
|
30
|
+
return i.default(r, e, n);
|
|
31
|
+
case s.Price:
|
|
32
|
+
return i.price(r, e, n);
|
|
33
|
+
case s.Password:
|
|
34
|
+
return await i.password(r, e, n);
|
|
35
|
+
case s.StringArray:
|
|
36
|
+
return i.stringArray(r, e, n);
|
|
37
|
+
default:
|
|
38
|
+
return i.default(r, e, n);
|
|
39
|
+
}
|
|
40
|
+
}, f = (t) => (t == null ? t = "" : typeof t == "object" ? t = JSON.stringify(t) : typeof t == "number" ? t = t.toString() : typeof t == "boolean" && (t = t ? "1" : "0"), t), c = {
|
|
41
|
+
default: (t, e, r) => {
|
|
42
|
+
const n = f(t);
|
|
43
|
+
return t && e.append(r, n), e;
|
|
44
|
+
},
|
|
45
|
+
price: (t, e, r, n = ["Currency", "Value"]) => {
|
|
46
|
+
const [u, a] = F(t);
|
|
47
|
+
return e.append(`${r}${n[0]}`, f(u)), e.append(`${r}${n[1]}`, f(a)), e;
|
|
48
|
+
},
|
|
49
|
+
address: (t, e, r) => (e.append(
|
|
50
|
+
r,
|
|
51
|
+
JSON.stringify({
|
|
52
|
+
...t,
|
|
53
|
+
country: h(t?.country)
|
|
54
|
+
})
|
|
55
|
+
), e),
|
|
56
|
+
documents: (t, e, r) => (r.endsWith("[]") || (r = `${r}[]`), Array.from(t).forEach((n) => e.append(r, n)), e),
|
|
57
|
+
document: (t, e, r) => (e.append(r, t), e),
|
|
58
|
+
stringArray: (t, e, r) => (r.endsWith("[]") || (r = `${r}[]`), t.forEach((n) => e.append(r, f(n))), e)
|
|
59
|
+
}, Y = async (t, e, r, n) => {
|
|
60
|
+
switch (t) {
|
|
61
|
+
case s.Country:
|
|
62
|
+
return c.default(
|
|
63
|
+
h(r),
|
|
64
|
+
e,
|
|
65
|
+
n
|
|
66
|
+
);
|
|
67
|
+
case s.Document:
|
|
68
|
+
return c.document(r, e, n);
|
|
69
|
+
case s.Documents:
|
|
70
|
+
return c.documents(r, e, n);
|
|
71
|
+
case s.Date:
|
|
72
|
+
return c.default(
|
|
73
|
+
w(r),
|
|
74
|
+
e,
|
|
75
|
+
n
|
|
76
|
+
);
|
|
77
|
+
case s.Address:
|
|
78
|
+
return c.address(r, e, n);
|
|
79
|
+
case s.Price:
|
|
80
|
+
return c.price(r, e, n);
|
|
81
|
+
case s.Password:
|
|
82
|
+
return c.default(
|
|
83
|
+
await S(r),
|
|
84
|
+
e,
|
|
85
|
+
n
|
|
86
|
+
);
|
|
87
|
+
case s.StringArray:
|
|
88
|
+
return c.stringArray(r, e, n);
|
|
89
|
+
default:
|
|
90
|
+
return c.default(r, e, n);
|
|
91
|
+
}
|
|
92
|
+
}, q = async (t, e, r) => {
|
|
93
|
+
switch (r) {
|
|
94
|
+
case p.JSON:
|
|
95
|
+
let n = {};
|
|
96
|
+
for (const a in t)
|
|
97
|
+
n = await I(
|
|
98
|
+
e[a],
|
|
99
|
+
n,
|
|
100
|
+
t[a],
|
|
101
|
+
a
|
|
102
|
+
);
|
|
103
|
+
return n;
|
|
104
|
+
case p.FormData:
|
|
105
|
+
default:
|
|
106
|
+
let u = new FormData();
|
|
107
|
+
for (const a in t)
|
|
108
|
+
u = await Y(
|
|
109
|
+
e[a],
|
|
110
|
+
u,
|
|
111
|
+
t[a],
|
|
112
|
+
a
|
|
113
|
+
);
|
|
114
|
+
return u;
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
function x(t) {
|
|
118
|
+
const e = C(
|
|
119
|
+
{}
|
|
120
|
+
);
|
|
121
|
+
return { form: e, setValue: (o, d) => {
|
|
122
|
+
e[o] = d;
|
|
123
|
+
}, setValues: (o) => {
|
|
124
|
+
for (const [d, b] of Object.entries(o))
|
|
125
|
+
e[d] = b;
|
|
126
|
+
}, getValue: (o) => e[o], reset: () => {
|
|
127
|
+
for (const o in e)
|
|
128
|
+
delete e[o];
|
|
129
|
+
}, submit: async () => {
|
|
130
|
+
const o = {
|
|
131
|
+
...e
|
|
132
|
+
};
|
|
133
|
+
return t?.id?.value && (o.id = t.id.value), {
|
|
134
|
+
isValid: !0,
|
|
135
|
+
form: await q(
|
|
136
|
+
o,
|
|
137
|
+
t.schema,
|
|
138
|
+
t.format ?? p.JSON
|
|
139
|
+
)
|
|
140
|
+
};
|
|
141
|
+
} };
|
|
142
|
+
}
|
|
143
|
+
const Z = /* @__PURE__ */ A({
|
|
144
|
+
name: "TForm",
|
|
145
|
+
__name: "Form",
|
|
146
|
+
props: {
|
|
147
|
+
id: { default: "" },
|
|
148
|
+
idKey: { default: "id" },
|
|
149
|
+
schema: { default: () => ({}) },
|
|
150
|
+
formStyle: { default: () => ({}) },
|
|
151
|
+
showSubmit: { type: Boolean, default: !1 },
|
|
152
|
+
submitLabel: { default: "Submit" },
|
|
153
|
+
buttonProps: {},
|
|
154
|
+
buttonVariant: { default: z.PRIMARY },
|
|
155
|
+
submissionFormat: { default: p.FormData },
|
|
156
|
+
buttonWrapperClasses: { default: "" }
|
|
157
|
+
},
|
|
158
|
+
emits: ["submit", "change"],
|
|
159
|
+
setup(t, { expose: e, emit: r }) {
|
|
160
|
+
const n = t, u = r, a = y(), { form: l, getValue: o, setValue: d, setValues: b, reset: g, submit: $ } = x({
|
|
161
|
+
id: y(n.id),
|
|
162
|
+
idKey: n.idKey,
|
|
163
|
+
schema: n.schema,
|
|
164
|
+
format: n.submissionFormat
|
|
165
|
+
}), V = async () => {
|
|
166
|
+
const m = await $();
|
|
167
|
+
return u("submit", m), m;
|
|
168
|
+
};
|
|
169
|
+
return P(l, (m) => {
|
|
170
|
+
u("change", m);
|
|
171
|
+
}), _("formStyle", n.formStyle), e({
|
|
172
|
+
submit: V,
|
|
173
|
+
reset: g,
|
|
174
|
+
setValues: b,
|
|
175
|
+
form: l,
|
|
176
|
+
setValue: d,
|
|
177
|
+
getValue: o
|
|
178
|
+
}), (m, G) => {
|
|
179
|
+
const D = T("t-button");
|
|
180
|
+
return N(), O("form", {
|
|
181
|
+
onSubmit: V,
|
|
182
|
+
ref_key: "formReference",
|
|
183
|
+
ref: a
|
|
184
|
+
}, [
|
|
185
|
+
B(m.$slots, "default", { form: J(l) }),
|
|
186
|
+
E("div", {
|
|
187
|
+
class: R([n.buttonWrapperClasses])
|
|
188
|
+
}, [
|
|
189
|
+
W(j(D, K(n.buttonProps, {
|
|
190
|
+
type: "submit",
|
|
191
|
+
class: "mt-4",
|
|
192
|
+
variant: n.buttonVariant,
|
|
193
|
+
label: n.submitLabel,
|
|
194
|
+
onClick: V
|
|
195
|
+
}), null, 16, ["variant", "label"]), [
|
|
196
|
+
[M, n.showSubmit]
|
|
197
|
+
])
|
|
198
|
+
], 2)
|
|
199
|
+
], 544);
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
});
|
|
203
|
+
export {
|
|
204
|
+
Z as _
|
|
205
|
+
};
|
package/dist/InputPassword.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { _ as s } from "./InputPassword.vue_vue_type_script_setup_true_lang-
|
|
2
|
-
import { p as a } from "./plugin-
|
|
1
|
+
import { _ as s } from "./InputPassword.vue_vue_type_script_setup_true_lang-DtP-Tv-2.js";
|
|
2
|
+
import { p as a } from "./plugin-BN2jubTY.js";
|
|
3
3
|
export {
|
|
4
4
|
s as InputPassword,
|
|
5
5
|
a as InputPasswordPlugin
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import { defineComponent as ee, mergeModels as z, useModel as te, ref as R, watch as le, resolveComponent as V, openBlock as S, createElementBlock as x, Fragment as ne, createElementVNode as j, normalizeClass as B, createVNode as k, unref as U, createCommentVNode as _, withKeys as oe, createBlock as se, toDisplayString as ae } from "vue";
|
|
2
|
+
import { u as re } from "./useClipboard-BHFD0Jvv.js";
|
|
3
|
+
import { f as ie } from "./index-CjvqeRf7.js";
|
|
4
|
+
const ue = (o = 18) => {
|
|
5
|
+
const e = "abcdefghkmnpqrstuvwxyzABCDEFGHKMNPQRSTUVWXYZ23456789", a = "!?@#-+<%$>[]{}";
|
|
6
|
+
let n = "";
|
|
7
|
+
const l = [
|
|
8
|
+
Math.floor(Math.random() * o),
|
|
9
|
+
Math.floor(Math.random() * o)
|
|
10
|
+
];
|
|
11
|
+
for (let r = 0; r < o; r++)
|
|
12
|
+
l.includes(r) ? n += a.charAt(
|
|
13
|
+
Math.floor(Math.random() * a.length)
|
|
14
|
+
) : n += e.charAt(
|
|
15
|
+
Math.floor(Math.random() * e.length)
|
|
16
|
+
);
|
|
17
|
+
return n;
|
|
18
|
+
}, ce = (o) => {
|
|
19
|
+
let e = 0, a = 0, n = 0, l = 0, r = 0, u = 0, c = 0, w = 0, d = 0, b = 0, p = 0, C = 0, v = 0, s = 0, m = 0, M = 0, A = 0, y = 0, F = 2, O = 2, T = 2, E = 2, I = 3, D = 3, K = 3, Z = 4, G = 4, H = 6, L = 0, q = 0, N = 0;
|
|
20
|
+
const Q = "abcdefghijklmnopqrstuvwxyz", W = "01234567890", X = ")!@#$%^&*()", Y = 8, h = o.replace(/\s+/g, "").split(/\s*/), g = h.length;
|
|
21
|
+
e = o.length * Z, a = o.length;
|
|
22
|
+
for (let t = 0; t < g; t++) {
|
|
23
|
+
h[t].match(/[A-Z]/g) ? (L !== 0 && L + 1 === t && C++, L = t, n++) : h[t].match(/[a-z]/g) ? (q !== 0 && q + 1 === t && v++, q = t, l++) : h[t].match(/[0-9]/g) ? (t > 0 && t < g - 1 && c++, N !== 0 && N + 1 === t && s++, N = t, r++) : h[t].match(/[^a-zA-Z0-9_]/g) && (t > 0 && t < g - 1 && c++, u++);
|
|
24
|
+
let i = !1;
|
|
25
|
+
for (let f = 0; f < g; f++)
|
|
26
|
+
h[t] == h[f] && t != f && (i = !0, p += Math.abs(g / (f - t)));
|
|
27
|
+
i && (b++, d = g - b, p = Math.ceil(d ? p / d : p));
|
|
28
|
+
}
|
|
29
|
+
for (let t = 0; t < 23; t++) {
|
|
30
|
+
let i = Q.substring(t, t + 3), f = i.split("").reverse().join("");
|
|
31
|
+
(o.toLowerCase().indexOf(i) != -1 || o.toLowerCase().indexOf(f) != -1) && m++;
|
|
32
|
+
}
|
|
33
|
+
for (let t = 0; t < 8; t++) {
|
|
34
|
+
let i = W.substring(t, t + 3);
|
|
35
|
+
var J = i.split("").reverse().join("");
|
|
36
|
+
(o.toLowerCase().indexOf(i) != -1 || o.toLowerCase().indexOf(J) != -1) && M++;
|
|
37
|
+
}
|
|
38
|
+
for (let t = 0; t < 8; t++) {
|
|
39
|
+
let i = X.substring(t, t + 3), f = i.split("").reverse().join("");
|
|
40
|
+
(o.toLowerCase().indexOf(i) != -1 || o.toLowerCase().indexOf(f) != -1) && A++;
|
|
41
|
+
}
|
|
42
|
+
n > 0 && n < a && (e = e + (a - n) * 2), l > 0 && l < a && (e = e + (a - l) * 2), r > 0 && r < a && (e = e + r * G), u > 0 && (e = e + u * H), c > 0 && (e = e + c * F), (l > 0 || n > 0) && u === 0 && r === 0 && (e = e - a), l === 0 && n === 0 && u === 0 && r > 0 && (e = e - a), b > 0 && (e = e - p), C > 0 && (e = e - C * O), v > 0 && (e = e - v * T), s > 0 && (e = e - s * E), m > 0 && (e = e - m * I), M > 0 && (e = e - M * D), A > 0 && (e = e - A * K), w = y;
|
|
43
|
+
let P = 0;
|
|
44
|
+
return o.length >= Y ? P = 3 : P = 4, w > P && (e = e + w * 2), e > 100 ? e = 100 : e < 0 && (e = 0), e;
|
|
45
|
+
}, $ = {
|
|
46
|
+
generatePassword: ue,
|
|
47
|
+
getPasswordStrength: ce
|
|
48
|
+
}, fe = { class: "flex border h-9 relative input-roundness input-border w-full" }, de = { class: "border-l select-none input-border input-control" }, pe = {
|
|
49
|
+
key: 1,
|
|
50
|
+
class: "inline-block float-right select-none"
|
|
51
|
+
}, ye = /* @__PURE__ */ ee({
|
|
52
|
+
name: "TInputPassword",
|
|
53
|
+
__name: "InputPassword",
|
|
54
|
+
props: /* @__PURE__ */ z({
|
|
55
|
+
autocomplete: { default: "current-password" },
|
|
56
|
+
encryptor: { type: Function, default: void 0 },
|
|
57
|
+
showCopy: { type: Boolean, default: !0 },
|
|
58
|
+
showRefresh: { type: Boolean, default: !1 },
|
|
59
|
+
showStrength: { type: Boolean, default: !1 }
|
|
60
|
+
}, {
|
|
61
|
+
modelValue: {
|
|
62
|
+
default: {
|
|
63
|
+
raw: "",
|
|
64
|
+
strength: 0,
|
|
65
|
+
hash: "",
|
|
66
|
+
updatedAt: void 0
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
modelModifiers: {}
|
|
70
|
+
}),
|
|
71
|
+
emits: /* @__PURE__ */ z(["generate", "enter"], ["update:modelValue"]),
|
|
72
|
+
setup(o, { expose: e, emit: a }) {
|
|
73
|
+
const n = o, l = te(o, "modelValue"), r = a, u = R("password"), c = R(null), { copy: w } = re(), d = R(!1), b = async (v, s) => {
|
|
74
|
+
if (s === void 0 && !v) {
|
|
75
|
+
l.value = { ...l.value };
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
l.value.strength = $.getPasswordStrength(l.value.raw), n.encryptor && (l.value.hash = await n.encryptor(l.value.raw));
|
|
79
|
+
}, p = () => {
|
|
80
|
+
c.value && c.value.$el && c.value.$el.focus();
|
|
81
|
+
}, C = async () => {
|
|
82
|
+
l.value.raw = $.generatePassword();
|
|
83
|
+
};
|
|
84
|
+
return le(() => l.value.raw, b, { immediate: !0 }), e({ focus: p }), (v, s) => {
|
|
85
|
+
const m = V("t-button"), M = V("t-input-text"), A = V("t-progress-line");
|
|
86
|
+
return S(), x(ne, null, [
|
|
87
|
+
j("div", fe, [
|
|
88
|
+
n.showCopy ? (S(), x("div", {
|
|
89
|
+
key: 0,
|
|
90
|
+
class: B(["border-r select-none input-border input-control", { "w-12": n.showCopy }])
|
|
91
|
+
}, [
|
|
92
|
+
k(m, {
|
|
93
|
+
variant: "transparent",
|
|
94
|
+
icon: "copy",
|
|
95
|
+
size: "sm",
|
|
96
|
+
class: "h-full w-full justify-center",
|
|
97
|
+
animate: {
|
|
98
|
+
target: "icon",
|
|
99
|
+
trigger: "click",
|
|
100
|
+
animation: {
|
|
101
|
+
scale: 4,
|
|
102
|
+
yoyo: !0,
|
|
103
|
+
opacity: 0
|
|
104
|
+
},
|
|
105
|
+
reset: { opacity: 1, scale: 1 }
|
|
106
|
+
},
|
|
107
|
+
disabled: d.value,
|
|
108
|
+
onClick: s[0] || (s[0] = (y) => U(w)(l.value.raw))
|
|
109
|
+
}, null, 8, ["disabled"])
|
|
110
|
+
], 2)) : _("", !0),
|
|
111
|
+
n.showRefresh ? (S(), x("div", {
|
|
112
|
+
key: 1,
|
|
113
|
+
class: B(["border-r select-none input-border input-control", { "w-12": n.showRefresh }])
|
|
114
|
+
}, [
|
|
115
|
+
k(m, {
|
|
116
|
+
variant: "transparent",
|
|
117
|
+
icon: "refresh",
|
|
118
|
+
size: "sm",
|
|
119
|
+
class: "h-full w-full justify-center",
|
|
120
|
+
animate: {
|
|
121
|
+
target: "icon",
|
|
122
|
+
trigger: "click",
|
|
123
|
+
animation: { rotation: 360 },
|
|
124
|
+
reset: { rotation: 0 }
|
|
125
|
+
},
|
|
126
|
+
disabled: d.value,
|
|
127
|
+
onClick: C
|
|
128
|
+
}, null, 8, ["disabled"])
|
|
129
|
+
], 2)) : _("", !0),
|
|
130
|
+
k(M, {
|
|
131
|
+
modelValue: l.value.raw,
|
|
132
|
+
"onUpdate:modelValue": s[1] || (s[1] = (y) => l.value.raw = y),
|
|
133
|
+
type: u.value,
|
|
134
|
+
autocomplete: n.autocomplete,
|
|
135
|
+
disabled: d.value,
|
|
136
|
+
"disable-style": !0,
|
|
137
|
+
ref_key: "input",
|
|
138
|
+
ref: c,
|
|
139
|
+
class: "w-full px-2 input-bg-color input-text-color input-outline input-roundness",
|
|
140
|
+
onKeyup: s[2] || (s[2] = oe((y) => r("enter"), ["enter"]))
|
|
141
|
+
}, null, 8, ["modelValue", "type", "autocomplete", "disabled"]),
|
|
142
|
+
j("div", de, [
|
|
143
|
+
k(m, {
|
|
144
|
+
variant: "transparent",
|
|
145
|
+
size: "sm",
|
|
146
|
+
class: "h-full w-full justify-center",
|
|
147
|
+
icon: u.value === "password" ? "eye" : "eye-off",
|
|
148
|
+
disabled: d.value,
|
|
149
|
+
onClick: s[3] || (s[3] = (y) => u.value = u.value === "password" ? "text" : "password")
|
|
150
|
+
}, null, 8, ["icon", "disabled"])
|
|
151
|
+
])
|
|
152
|
+
]),
|
|
153
|
+
n.showStrength ? (S(), se(A, {
|
|
154
|
+
key: 0,
|
|
155
|
+
value: l.value.strength,
|
|
156
|
+
class: "mt-0.5",
|
|
157
|
+
height: 2.5,
|
|
158
|
+
"show-percentage": !1
|
|
159
|
+
}, null, 8, ["value"])) : _("", !0),
|
|
160
|
+
l.value.updatedAt ? (S(), x("small", pe, " Last updated " + ae(U(ie)(new Date(l.value.updatedAt), "MMMM do yyyy, hh:mm:ss")), 1)) : _("", !0)
|
|
161
|
+
], 64);
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
});
|
|
165
|
+
export {
|
|
166
|
+
ye as _
|
|
167
|
+
};
|
package/dist/ModalForm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { _ as a } from "./ModalForm.vue_vue_type_script_setup_true_lang-
|
|
2
|
-
import { p as l } from "./plugin-
|
|
1
|
+
import { _ as a } from "./ModalForm.vue_vue_type_script_setup_true_lang-BpkPebgZ.js";
|
|
2
|
+
import { p as l } from "./plugin-JFEZqDsu.js";
|
|
3
3
|
export {
|
|
4
4
|
a as ModalForm,
|
|
5
5
|
l as ModalFormPlugin
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { C as
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as M, ref as c, computed as N, resolveComponent as o, openBlock as n, createBlock as a, withCtx as l, createCommentVNode as d, createElementBlock as R, createVNode as m, normalizeClass as b, resolveDynamicComponent as $ } from "vue";
|
|
2
|
+
import { C as A } from "./crud-TcRx_r8S.js";
|
|
3
|
+
const I = {
|
|
4
4
|
key: 0,
|
|
5
5
|
class: "inline-flex"
|
|
6
|
-
},
|
|
6
|
+
}, U = /* @__PURE__ */ M({
|
|
7
7
|
name: "TModalForm",
|
|
8
8
|
__name: "ModalForm",
|
|
9
9
|
props: {
|
|
@@ -13,41 +13,43 @@ const $ = {
|
|
|
13
13
|
},
|
|
14
14
|
emits: ["saved", "closed"],
|
|
15
15
|
setup(y, { expose: C, emit: k }) {
|
|
16
|
-
const i = y,
|
|
17
|
-
|
|
16
|
+
const i = y, v = k, e = c(null), p = c(!1), f = c(""), r = c(), s = N(() => i.forms.find((u) => u.key === f.value)), g = (u, t) => {
|
|
17
|
+
f.value = u, e.value = new A(s.value?.title, r), t ? e.value?.edit(t) : e.value?.show();
|
|
18
18
|
}, w = () => {
|
|
19
|
-
e.value?.onSave(!
|
|
19
|
+
e.value?.onSave(!p.value), v("saved");
|
|
20
20
|
}, x = () => {
|
|
21
21
|
e.value?.delete();
|
|
22
|
-
}, S = () => {
|
|
23
|
-
|
|
22
|
+
}, S = async () => await r.value?.submit(), V = () => {
|
|
23
|
+
r.value?.reset();
|
|
24
|
+
}, D = () => {
|
|
25
|
+
e.value?.close(), v("closed");
|
|
24
26
|
};
|
|
25
|
-
return C({ open: g, delete: x }), (
|
|
26
|
-
const
|
|
27
|
-
return e.value?.visible ? (
|
|
27
|
+
return C({ open: g, delete: x, submit: S, reset: V }), (u, t) => {
|
|
28
|
+
const E = o("t-input-switch"), B = o("t-icon"), h = o("t-dropdown"), z = o("t-popover"), _ = o("t-button"), F = o("t-popconfirm"), K = o("t-modal");
|
|
29
|
+
return e.value?.visible ? (n(), a(K, {
|
|
28
30
|
key: 0,
|
|
29
31
|
title: e.value?.title,
|
|
30
|
-
onClosed:
|
|
32
|
+
onClosed: D
|
|
31
33
|
}, {
|
|
32
|
-
header:
|
|
33
|
-
s.value?.pinnable && !e.value?.isEditing ? (
|
|
34
|
+
header: l(() => [
|
|
35
|
+
s.value?.pinnable && !e.value?.isEditing ? (n(), a(E, {
|
|
34
36
|
key: 0,
|
|
35
|
-
modelValue:
|
|
36
|
-
"onUpdate:modelValue": t[0] || (t[0] = (
|
|
37
|
+
modelValue: p.value,
|
|
38
|
+
"onUpdate:modelValue": t[0] || (t[0] = (L) => p.value = L),
|
|
37
39
|
label: "Keep open",
|
|
38
40
|
class: "mt-4"
|
|
39
41
|
}, null, 8, ["modelValue"])) : d("", !0)
|
|
40
42
|
]),
|
|
41
|
-
footer:
|
|
42
|
-
i.options.length ? (
|
|
43
|
-
|
|
44
|
-
content:
|
|
45
|
-
|
|
43
|
+
footer: l(() => [
|
|
44
|
+
i.options.length ? (n(), R("div", I, [
|
|
45
|
+
m(z, { placement: "bottom-start" }, {
|
|
46
|
+
content: l(() => [
|
|
47
|
+
m(h, {
|
|
46
48
|
items: i.options
|
|
47
49
|
}, null, 8, ["items"])
|
|
48
50
|
]),
|
|
49
|
-
default:
|
|
50
|
-
|
|
51
|
+
default: l(() => [
|
|
52
|
+
m(B, {
|
|
51
53
|
icon: "dots-vertical",
|
|
52
54
|
class: "text-lg mr-6",
|
|
53
55
|
size: "sm",
|
|
@@ -57,13 +59,13 @@ const $ = {
|
|
|
57
59
|
]),
|
|
58
60
|
_: 1
|
|
59
61
|
})
|
|
60
|
-
])) : (
|
|
62
|
+
])) : (n(), a(F, {
|
|
61
63
|
key: 1,
|
|
62
64
|
message: `Are you sure you want to delete this ${s.value?.title}?`,
|
|
63
65
|
onConfirm: t[2] || (t[2] = () => e.value?.delete())
|
|
64
66
|
}, {
|
|
65
|
-
default:
|
|
66
|
-
e.value?.isEditing ? (
|
|
67
|
+
default: l(() => [
|
|
68
|
+
e.value?.isEditing ? (n(), a(_, {
|
|
67
69
|
key: 0,
|
|
68
70
|
variant: "danger",
|
|
69
71
|
icon: "trash-can-outline",
|
|
@@ -74,7 +76,7 @@ const $ = {
|
|
|
74
76
|
]),
|
|
75
77
|
_: 1
|
|
76
78
|
}, 8, ["message"])),
|
|
77
|
-
|
|
79
|
+
m(_, {
|
|
78
80
|
variant: "success",
|
|
79
81
|
icon: "save",
|
|
80
82
|
label: "Save",
|
|
@@ -85,13 +87,13 @@ const $ = {
|
|
|
85
87
|
onClick: t[3] || (t[3] = () => e.value?.save())
|
|
86
88
|
}, null, 8, ["is-disabled", "class"])
|
|
87
89
|
]),
|
|
88
|
-
default:
|
|
89
|
-
s.value ? (
|
|
90
|
+
default: l(() => [
|
|
91
|
+
s.value ? (n(), a($(s.value.component), {
|
|
90
92
|
key: 0,
|
|
91
93
|
id: `${e.value?.id}`,
|
|
92
94
|
class: b([i.formClass]),
|
|
93
95
|
ref_key: "formReference",
|
|
94
|
-
ref:
|
|
96
|
+
ref: r,
|
|
95
97
|
onDeleted: t[1] || (t[1] = () => e.value?.onDelete()),
|
|
96
98
|
onSaved: w
|
|
97
99
|
}, null, 40, ["id", "class"])) : d("", !0)
|
|
@@ -102,5 +104,5 @@ const $ = {
|
|
|
102
104
|
}
|
|
103
105
|
});
|
|
104
106
|
export {
|
|
105
|
-
|
|
107
|
+
U as _
|
|
106
108
|
};
|
package/dist/Tag.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { _ as r } from "./Tag.vue_vue_type_script_setup_true_lang-
|
|
2
|
-
import { p } from "./plugin-
|
|
1
|
+
import { _ as r } from "./Tag.vue_vue_type_script_setup_true_lang-DMigzW22.js";
|
|
2
|
+
import { p } from "./plugin-DgCa2m12.js";
|
|
3
3
|
export {
|
|
4
4
|
r as Tag,
|
|
5
5
|
p as TagPlugin
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as y, resolveComponent as m, openBlock as o, createElementBlock as a, normalizeStyle as _, normalizeClass as p, createElementVNode as C, renderSlot as k, unref as l, toDisplayString as v, createBlock as u, withCtx as z, createVNode as g, createCommentVNode as h } from "vue";
|
|
2
2
|
import { a as t } from "./ui-BC6H9E93.js";
|
|
3
|
-
const B = ["role"],
|
|
4
|
-
key: 0,
|
|
5
|
-
class: "bg-[#00000046]"
|
|
6
|
-
}, w = /* @__PURE__ */ _({
|
|
3
|
+
const B = ["role"], S = { class: "px-2" }, b = { key: 0 }, w = /* @__PURE__ */ y({
|
|
7
4
|
name: "TTag",
|
|
8
5
|
__name: "Tag",
|
|
9
6
|
props: {
|
|
@@ -15,40 +12,40 @@ const B = ["role"], b = { class: "px-2" }, S = {
|
|
|
15
12
|
hasCloseButton: { type: Boolean, default: !1 }
|
|
16
13
|
},
|
|
17
14
|
emits: ["close"],
|
|
18
|
-
setup(
|
|
19
|
-
const e =
|
|
15
|
+
setup(f, { emit: d }) {
|
|
16
|
+
const e = f, r = d;
|
|
20
17
|
return (i, s) => {
|
|
21
18
|
const c = m("t-button"), x = m("t-popconfirm");
|
|
22
19
|
return o(), a("div", {
|
|
23
|
-
style:
|
|
24
|
-
class:
|
|
25
|
-
"bg-
|
|
20
|
+
style: _(`background-color:${e.color}`),
|
|
21
|
+
class: p([{
|
|
22
|
+
"bg-caipira-primary-inverted": !e.color
|
|
26
23
|
}, "w-max inline-flex items-stretch rounded-sm select-none color-caipira-primary"]),
|
|
27
24
|
role: e.role
|
|
28
25
|
}, [
|
|
29
|
-
C("div",
|
|
26
|
+
C("div", S, [
|
|
30
27
|
i.$slots.default ? k(i.$slots, "default", { key: 0 }) : (o(), a("span", {
|
|
31
28
|
key: 1,
|
|
32
|
-
class:
|
|
29
|
+
class: p({
|
|
33
30
|
"text-xs": e.size === l(t).ExtraSmall,
|
|
34
31
|
"text-sm": e.size === l(t).Small,
|
|
35
32
|
"text-base": e.size === l(t).Default,
|
|
36
33
|
"text-lg": e.size === l(t).Large,
|
|
37
34
|
"text-xl": e.size === l(t).ExtraLarge
|
|
38
35
|
})
|
|
39
|
-
},
|
|
36
|
+
}, v(e.text), 3))
|
|
40
37
|
]),
|
|
41
|
-
e.hasCloseButton ? (o(), a("div",
|
|
42
|
-
e.confirmClose ? (o(),
|
|
38
|
+
e.hasCloseButton ? (o(), a("div", b, [
|
|
39
|
+
e.confirmClose ? (o(), u(x, {
|
|
43
40
|
key: 0,
|
|
44
41
|
message: "Are you sure you want to remove it?",
|
|
45
42
|
class: "h-full",
|
|
46
43
|
onConfirm: s[0] || (s[0] = (n) => r("close"))
|
|
47
44
|
}, {
|
|
48
|
-
default:
|
|
49
|
-
|
|
45
|
+
default: z(({ onTogglePopover: n }) => [
|
|
46
|
+
g(c, {
|
|
50
47
|
variant: "transparent",
|
|
51
|
-
hover: !
|
|
48
|
+
hover: !0,
|
|
52
49
|
icon: "close",
|
|
53
50
|
size: "",
|
|
54
51
|
class: "px-1.5 h-full",
|
|
@@ -56,7 +53,7 @@ const B = ["role"], b = { class: "px-2" }, S = {
|
|
|
56
53
|
}, null, 8, ["onClick"])
|
|
57
54
|
]),
|
|
58
55
|
_: 1
|
|
59
|
-
})) : (o(),
|
|
56
|
+
})) : (o(), u(c, {
|
|
60
57
|
key: 1,
|
|
61
58
|
variant: "transparent",
|
|
62
59
|
icon: "close",
|