@caipira/tamandua 0.0.21 → 0.0.23

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.
@@ -1,5 +1,5 @@
1
- import { _ as s } from "./InputPassword.vue_vue_type_script_setup_true_lang-B-MOg3_z.js";
2
- import { p as a } from "./plugin-Oe_WP1sP.js";
1
+ import { _ as s } from "./InputPassword.vue_vue_type_script_setup_true_lang-BHg-9NIu.js";
2
+ import { p as a } from "./plugin-DLuMqhC7.js";
3
3
  export {
4
4
  s as InputPassword,
5
5
  a as InputPasswordPlugin
@@ -0,0 +1,174 @@
1
+ import { defineComponent as te, mergeModels as O, useModel as ne, ref as R, inject as le, watch as se, resolveComponent as j, openBlock as x, createElementBlock as A, normalizeClass as z, unref as B, createElementVNode as U, createVNode as k, createCommentVNode as _, withKeys as oe, createBlock as ae, toDisplayString as re } from "vue";
2
+ import { u as ie } from "./useClipboard-BHFD0Jvv.js";
3
+ import { f as ue } from "./index-CjvqeRf7.js";
4
+ const ce = (s = 18) => {
5
+ const e = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890", a = "!?@#-+<%$>[]{}";
6
+ let l = "";
7
+ const n = [
8
+ Math.floor(Math.random() * s),
9
+ Math.floor(Math.random() * s)
10
+ ];
11
+ for (let r = 0; r < s; r++)
12
+ n.includes(r) ? l += a.charAt(
13
+ Math.floor(Math.random() * a.length)
14
+ ) : l += e.charAt(
15
+ Math.floor(Math.random() * e.length)
16
+ );
17
+ return l;
18
+ }, pe = (s) => {
19
+ let e = 0, a = 0, l = 0, n = 0, r = 0, u = 0, c = 0, b = 0, f = 0, C = 0, d = 0, M = 0, S = 0, y = 0, o = 0, m = 0, I = 0, L = 0, v = 2, T = 2, F = 2, E = 2, D = 3, K = 3, W = 3, Z = 4, G = 4, H = 6, q = "", N = "", P = "", g = "Too Short";
20
+ const J = "abcdefghijklmnopqrstuvwxyz", Q = "01234567890", X = ")!@#$%^&*()", Y = 8, h = s.replace(/\s+/g, "").split(/\s*/), w = h.length;
21
+ e = s.length * Z, a = s.length;
22
+ for (let t = 0; t < w; t++) {
23
+ h[t].match(/[A-Z]/g) ? (q !== "" && q + 1 == t && M++, q = t, l++) : h[t].match(/[a-z]/g) ? (N !== "" && N + 1 == t && S++, N = t, n++) : h[t].match(/[0-9]/g) ? (t > 0 && t < w - 1 && c++, P !== "" && P + 1 == t && y++, P = t, r++) : h[t].match(/[^a-zA-Z0-9_]/g) && (t > 0 && t < w - 1 && c++, u++);
24
+ let i = !1;
25
+ for (let p = 0; p < w; p++)
26
+ h[t] == h[p] && t != p && (i = !0, d += Math.abs(w / (p - t)));
27
+ i && (C++, f = w - C, d = Math.ceil(f ? d / f : d));
28
+ }
29
+ for (let t = 0; t < 23; t++) {
30
+ let i = J.substring(t, parseInt(t + 3)), p = i.split("").reverse().join("");
31
+ (s.toLowerCase().indexOf(i) != -1 || s.toLowerCase().indexOf(p) != -1) && o++;
32
+ }
33
+ for (let t = 0; t < 8; t++) {
34
+ let i = Q.substring(t, parseInt(t + 3));
35
+ var ee = i.split("").reverse().join("");
36
+ (s.toLowerCase().indexOf(i) != -1 || s.toLowerCase().indexOf(ee) != -1) && m++;
37
+ }
38
+ for (let t = 0; t < 8; t++) {
39
+ let i = X.substring(t, parseInt(t + 3)), p = i.split("").reverse().join("");
40
+ (s.toLowerCase().indexOf(i) != -1 || s.toLowerCase().indexOf(p) != -1) && I++;
41
+ }
42
+ l > 0 && l < a && (e = parseInt(e + (a - l) * 2)), n > 0 && n < a && (e = parseInt(e + (a - n) * 2)), r > 0 && r < a && (e = parseInt(e + r * G)), u > 0 && (e = parseInt(e + u * H)), c > 0 && (e = parseInt(e + c * v)), (n > 0 || l > 0) && u === 0 && r === 0 && (e = parseInt(e - a)), n === 0 && l === 0 && u === 0 && r > 0 && (e = parseInt(e - a)), C > 0 && (e = parseInt(e - d)), M > 0 && (e = parseInt(e - M * T)), S > 0 && (e = parseInt(e - S * F)), y > 0 && (e = parseInt(e - y * E)), o > 0 && (e = parseInt(e - o * D)), m > 0 && (e = parseInt(e - m * K)), I > 0 && (e = parseInt(e - I * W)), b = L;
43
+ let V = 0;
44
+ return s.length >= Y ? V = 3 : V = 4, b > V && (e = parseInt(e + b * 2)), e > 100 ? e = 100 : e < 0 && (e = 0), e >= 0 && e < 20 ? g = "Very Weak" : e >= 20 && e < 40 ? g = "Weak" : e >= 40 && e < 60 ? g = "Good" : e >= 60 && e < 80 ? g = "Strong" : e >= 80 && e <= 100 && (g = "Very Strong"), {
45
+ score: e,
46
+ complexity: g
47
+ };
48
+ }, $ = {
49
+ generatePassword: ce,
50
+ getPasswordStrength: pe
51
+ }, fe = { class: "flex border h-9 relative input-roundness input-border" }, de = { class: "border-l select-none input-border input-control" }, me = {
52
+ key: 1,
53
+ class: "inline-block float-right select-none"
54
+ }, ge = /* @__PURE__ */ te({
55
+ name: "TInputPassword",
56
+ __name: "InputPassword",
57
+ props: /* @__PURE__ */ O({
58
+ autocomplete: { default: "current-password" },
59
+ encryptor: { type: Function, default: void 0 },
60
+ showCopy: { type: Boolean, default: !0 },
61
+ showRefresh: { type: Boolean, default: !1 },
62
+ showStrength: { type: Boolean, default: !1 }
63
+ }, {
64
+ modelValue: {
65
+ default: {
66
+ raw: "",
67
+ strength: 0,
68
+ hash: "",
69
+ updatedAt: void 0
70
+ }
71
+ },
72
+ modelModifiers: {}
73
+ }),
74
+ emits: /* @__PURE__ */ O(["generate", "enter"], ["update:modelValue"]),
75
+ setup(s, { expose: e, emit: a }) {
76
+ const l = s, n = ne(s, "modelValue"), r = a, u = R("password"), c = R(null), { copy: b } = ie(), f = R(!1), C = le("formStyle", { input: "w-full" }), d = async (y, o) => {
77
+ if (o === void 0 && !y) {
78
+ n.value = { ...n.value };
79
+ return;
80
+ }
81
+ n.value.strength = $.getPasswordStrength(
82
+ n.value.raw
83
+ ).score, l.encryptor && (n.value.hash = await l.encryptor(n.value.raw));
84
+ }, M = () => {
85
+ c.value && c.value.$el && c.value.$el.focus();
86
+ }, S = async () => {
87
+ n.value.raw = $.generatePassword();
88
+ };
89
+ return se(() => n.value.raw, d, { immediate: !0 }), e({ focus: M }), (y, o) => {
90
+ const m = j("t-button"), I = j("t-input-text"), L = j("t-progress-line");
91
+ return x(), A("div", {
92
+ class: z({ [B(C).input]: !0 })
93
+ }, [
94
+ U("div", fe, [
95
+ l.showCopy ? (x(), A("div", {
96
+ key: 0,
97
+ class: z(["border-r select-none input-border input-control", { "w-12": l.showCopy }])
98
+ }, [
99
+ k(m, {
100
+ variant: "transparent",
101
+ icon: "copy",
102
+ size: "sm",
103
+ class: "h-full w-full justify-center",
104
+ animate: {
105
+ target: "icon",
106
+ trigger: "click",
107
+ animation: {
108
+ scale: 4,
109
+ yoyo: !0,
110
+ opacity: 0
111
+ },
112
+ reset: { opacity: 1, scale: 1 }
113
+ },
114
+ disabled: f.value,
115
+ onClick: o[0] || (o[0] = (v) => B(b)(n.value.raw))
116
+ }, null, 8, ["disabled"])
117
+ ], 2)) : _("", !0),
118
+ l.showRefresh ? (x(), A("div", {
119
+ key: 1,
120
+ class: z(["border-r select-none input-border input-control", { "w-12": l.showRefresh }])
121
+ }, [
122
+ k(m, {
123
+ variant: "transparent",
124
+ icon: "refresh",
125
+ size: "sm",
126
+ class: "h-full w-full justify-center",
127
+ animate: {
128
+ target: "icon",
129
+ trigger: "click",
130
+ animation: { rotation: 360 },
131
+ reset: { rotation: 0 }
132
+ },
133
+ disabled: f.value,
134
+ onClick: S
135
+ }, null, 8, ["disabled"])
136
+ ], 2)) : _("", !0),
137
+ k(I, {
138
+ modelValue: n.value.raw,
139
+ "onUpdate:modelValue": o[1] || (o[1] = (v) => n.value.raw = v),
140
+ type: u.value,
141
+ autocomplete: l.autocomplete,
142
+ disabled: f.value,
143
+ "disable-style": !0,
144
+ ref_key: "input",
145
+ ref: c,
146
+ class: "w-full px-2 input-bg-color input-text-color input-outline input-roundness",
147
+ onKeyup: o[2] || (o[2] = oe((v) => r("enter"), ["enter"]))
148
+ }, null, 8, ["modelValue", "type", "autocomplete", "disabled"]),
149
+ U("div", de, [
150
+ k(m, {
151
+ variant: "transparent",
152
+ size: "sm",
153
+ class: "h-full w-full justify-center",
154
+ icon: u.value === "password" ? "eye" : "eye-off",
155
+ disabled: f.value,
156
+ onClick: o[3] || (o[3] = (v) => u.value = u.value === "password" ? "text" : "password")
157
+ }, null, 8, ["icon", "disabled"])
158
+ ])
159
+ ]),
160
+ l.showStrength ? (x(), ae(L, {
161
+ key: 0,
162
+ value: n.value.strength,
163
+ class: "mt-0.5",
164
+ height: 2.5,
165
+ "show-percentage": !1
166
+ }, null, 8, ["value"])) : _("", !0),
167
+ n.value.updatedAt ? (x(), A("small", me, " Last updated " + re(B(ue)(new Date(n.value.updatedAt), "MMMM do yyyy, hh:mm:ss")), 1)) : _("", !0)
168
+ ], 2);
169
+ };
170
+ }
171
+ });
172
+ export {
173
+ ge as _
174
+ };
package/dist/ModalForm.js CHANGED
@@ -1,5 +1,5 @@
1
- import { _ as a } from "./ModalForm.vue_vue_type_script_setup_true_lang-BaYQDOnJ.js";
2
- import { p as l } from "./plugin-BGWPliCj.js";
1
+ import { _ as a } from "./ModalForm.vue_vue_type_script_setup_true_lang-BSEORivR.js";
2
+ import { p as l } from "./plugin-C3jERS0X.js";
3
3
  export {
4
4
  a as ModalForm,
5
5
  l as ModalFormPlugin
@@ -50,7 +50,7 @@ const $ = {
50
50
  c(D, {
51
51
  icon: "dots-vertical",
52
52
  class: "text-lg mr-6",
53
- size: "xs",
53
+ size: "sm",
54
54
  role: "button",
55
55
  "aria-describedby": "tooltip"
56
56
  })
@@ -19,7 +19,7 @@ import { _ as R } from "./InputCheckbox.vue_vue_type_script_setup_true_lang-B5zo
19
19
  import { _ as q } from "./InputColor.vue_vue_type_script_setup_true_lang-CZ0o-B7I.js";
20
20
  import { _ as H } from "./InputDate.vue_vue_type_script_setup_true_lang-D1H0urIZ.js";
21
21
  import { _ as K } from "./InputMultiplier.vue_vue_type_script_setup_true_lang-DlITLRxb.js";
22
- import { _ as O } from "./InputPassword.vue_vue_type_script_setup_true_lang-B-MOg3_z.js";
22
+ import { _ as O } from "./InputPassword.vue_vue_type_script_setup_true_lang-BHg-9NIu.js";
23
23
  import { _ as U } from "./InputPhone.vue_vue_type_script_setup_true_lang-DvSNQmar.js";
24
24
  import { _ as W } from "./InputPrice.vue_vue_type_script_setup_true_lang-BBi8qKn8.js";
25
25
  import { _ as Y } from "./InputRadio.vue_vue_type_script_setup_true_lang-Dqbov2kN.js";
@@ -30,7 +30,7 @@ import { _ as ar } from "./InputText.vue_vue_type_script_setup_true_lang-BWM3bHK
30
30
  import { _ as pr } from "./InputTextarea.vue_vue_type_script_setup_true_lang-IMz1cgV5.js";
31
31
  import { _ as sr } from "./Link.vue_vue_type_script_setup_true_lang-DeBJ2UGi.js";
32
32
  import { _ as fr } from "./Modal.vue_vue_type_script_setup_true_lang-DLl5shGS.js";
33
- import { _ as nr } from "./ModalForm.vue_vue_type_script_setup_true_lang-BaYQDOnJ.js";
33
+ import { _ as nr } from "./ModalForm.vue_vue_type_script_setup_true_lang-BSEORivR.js";
34
34
  import { _ as ur } from "./Pagination.vue_vue_type_script_setup_true_lang-PLZQJUd0.js";
35
35
  import { _ as lr } from "./Popconfirm.vue_vue_type_script_setup_true_lang-BNpLdXq7.js";
36
36
  import { _ as hr } from "./Popover.vue_vue_type_script_setup_true_lang-B4Polh2y.js";
@@ -1,5 +1,5 @@
1
1
  import { r } from "./register-component-B-fdqewb.js";
2
- import { _ as s } from "./ModalForm.vue_vue_type_script_setup_true_lang-BaYQDOnJ.js";
2
+ import { _ as s } from "./ModalForm.vue_vue_type_script_setup_true_lang-BSEORivR.js";
3
3
  const m = {
4
4
  install(o) {
5
5
  r(o, s);
@@ -1,5 +1,5 @@
1
1
  import { r } from "./register-component-B-fdqewb.js";
2
- import { _ as s } from "./InputPassword.vue_vue_type_script_setup_true_lang-B-MOg3_z.js";
2
+ import { _ as s } from "./InputPassword.vue_vue_type_script_setup_true_lang-BHg-9NIu.js";
3
3
  const m = {
4
4
  install(o) {
5
5
  r(o, s);
@@ -28,7 +28,7 @@ import { p as c } from "./plugin-DaibhM02.js";
28
28
  import { p as h } from "./plugin-DppW8rQi.js";
29
29
  import { p as b } from "./plugin-DkDbha5K.js";
30
30
  import { p as d } from "./plugin-DEybStkj.js";
31
- import { p as y } from "./plugin-Oe_WP1sP.js";
31
+ import { p as y } from "./plugin-DLuMqhC7.js";
32
32
  import { p as T } from "./plugin-hr8-EXeF.js";
33
33
  import { p as v } from "./plugin-C3tFXHbZ.js";
34
34
  import { p as C } from "./plugin-BrwUi1gG.js";
@@ -40,7 +40,7 @@ import { p as D } from "./plugin-CqcxTgW6.js";
40
40
  import "./Link.vue_vue_type_script_setup_true_lang-DeBJ2UGi.js";
41
41
  import { p as F } from "./plugin-dL6oP11N.js";
42
42
  import { p as G } from "./plugin-BZC231Oj.js";
43
- import { p as k } from "./plugin-BGWPliCj.js";
43
+ import { p as k } from "./plugin-C3jERS0X.js";
44
44
  import { p as L } from "./plugin-YUomn9tF.js";
45
45
  import "./Popconfirm.vue_vue_type_script_setup_true_lang-BNpLdXq7.js";
46
46
  import { p as M } from "./plugin-Bt6de9ZA.js";
package/dist/plugins.js CHANGED
@@ -28,7 +28,7 @@ import { p as $ } from "./plugin-DaibhM02.js";
28
28
  import { p as or } from "./plugin-DppW8rQi.js";
29
29
  import { p as tr } from "./plugin-DkDbha5K.js";
30
30
  import { p as ar } from "./plugin-DEybStkj.js";
31
- import { p as nr } from "./plugin-Oe_WP1sP.js";
31
+ import { p as nr } from "./plugin-DLuMqhC7.js";
32
32
  import { p as ur } from "./plugin-hr8-EXeF.js";
33
33
  import { p as Pr } from "./plugin-C3tFXHbZ.js";
34
34
  import { p as gr } from "./plugin-BrwUi1gG.js";
@@ -40,7 +40,7 @@ import { p as yr } from "./plugin-CqcxTgW6.js";
40
40
  import "./Link.vue_vue_type_script_setup_true_lang-DeBJ2UGi.js";
41
41
  import { p as Cr } from "./plugin-dL6oP11N.js";
42
42
  import { p as vr } from "./plugin-BZC231Oj.js";
43
- import { p as Dr } from "./plugin-BGWPliCj.js";
43
+ import { p as Dr } from "./plugin-C3jERS0X.js";
44
44
  import { p as Lr } from "./plugin-YUomn9tF.js";
45
45
  import "./Popconfirm.vue_vue_type_script_setup_true_lang-BNpLdXq7.js";
46
46
  import { p as kr } from "./plugin-Bt6de9ZA.js";
package/dist/tamandua.js CHANGED
@@ -1,4 +1,4 @@
1
- import { p as n } from "./plugins-D_vHRI2V.js";
1
+ import { p as n } from "./plugins-C8UqAO7t.js";
2
2
  const o = {
3
3
  install(s) {
4
4
  for (const i in n)
@@ -1,56 +1,62 @@
1
- import { InputPasswordProps } from './types.ts';
2
1
  import { InputPasswordModel } from '../../types/form.js';
3
2
 
4
- declare const _default: import('vue').DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<InputPasswordProps>, {
5
- autocomplete: string;
6
- canCopy: boolean;
7
- encryptor: undefined;
8
- keyup: () => () => void;
9
- modelValue: undefined;
10
- showRefresh: boolean;
11
- showStrength: boolean;
12
- }>, {
3
+ declare const _default: import('vue').DefineComponent<{
4
+ modelValue: import("vue").PropType<InputPasswordModel>;
5
+ autocomplete: {
6
+ type: import("vue").PropType<string>;
7
+ default: string;
8
+ };
9
+ encryptor: {
10
+ type: import("vue").PropType<(value: string) => Promise<string>>;
11
+ default: undefined;
12
+ };
13
+ showCopy: {
14
+ type: import("vue").PropType<boolean>;
15
+ default: boolean;
16
+ };
17
+ showRefresh: {
18
+ type: import("vue").PropType<boolean>;
19
+ default: boolean;
20
+ };
21
+ showStrength: {
22
+ type: import("vue").PropType<boolean>;
23
+ default: boolean;
24
+ };
25
+ }, {
13
26
  focus: () => void;
14
27
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
15
28
  generate: (val: InputPasswordModel) => void;
16
- "update:model-value": (val: InputPasswordModel) => void;
17
29
  enter: () => void;
18
- }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<InputPasswordProps>, {
19
- autocomplete: string;
20
- canCopy: boolean;
21
- encryptor: undefined;
22
- keyup: () => () => void;
23
- modelValue: undefined;
24
- showRefresh: boolean;
25
- showStrength: boolean;
26
- }>>> & {
27
- "onUpdate:model-value"?: ((val: InputPasswordModel) => any) | undefined;
30
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
31
+ modelValue: import("vue").PropType<InputPasswordModel>;
32
+ autocomplete: {
33
+ type: import("vue").PropType<string>;
34
+ default: string;
35
+ };
36
+ encryptor: {
37
+ type: import("vue").PropType<(value: string) => Promise<string>>;
38
+ default: undefined;
39
+ };
40
+ showCopy: {
41
+ type: import("vue").PropType<boolean>;
42
+ default: boolean;
43
+ };
44
+ showRefresh: {
45
+ type: import("vue").PropType<boolean>;
46
+ default: boolean;
47
+ };
48
+ showStrength: {
49
+ type: import("vue").PropType<boolean>;
50
+ default: boolean;
51
+ };
52
+ }>> & {
28
53
  onEnter?: (() => any) | undefined;
29
54
  onGenerate?: ((val: InputPasswordModel) => any) | undefined;
30
55
  }, {
31
- keyup: any;
32
- modelValue: InputPasswordModel;
33
56
  autocomplete: string;
34
- canCopy: boolean;
35
57
  encryptor: (value: string) => Promise<string>;
58
+ showCopy: boolean;
36
59
  showRefresh: boolean;
37
60
  showStrength: boolean;
38
61
  }, {}>;
39
62
  export default _default;
40
- type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
41
- type __VLS_TypePropsToRuntimeProps<T> = {
42
- [K in keyof T]-?: {} extends Pick<T, K> ? {
43
- type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
44
- } : {
45
- type: import('vue').PropType<T[K]>;
46
- required: true;
47
- };
48
- };
49
- type __VLS_WithDefaults<P, D> = {
50
- [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
51
- default: D[K];
52
- }> : P[K];
53
- };
54
- type __VLS_Prettify<T> = {
55
- [K in keyof T]: T[K];
56
- } & {};
@@ -4,9 +4,7 @@ declare const _default: {
4
4
  encryptor: (value: string) => Promise<string>;
5
5
  showStrength: boolean;
6
6
  showRefresh: boolean;
7
- value: {
8
- raw: string;
9
- };
7
+ value: undefined;
10
8
  };
11
9
  argTypes: {
12
10
  showStrength: {
@@ -17,6 +15,10 @@ declare const _default: {
17
15
  options: boolean[];
18
16
  control: string;
19
17
  };
18
+ showCopy: {
19
+ options: boolean[];
20
+ control: string;
21
+ };
20
22
  };
21
23
  };
22
24
  export default _default;
@@ -2,15 +2,12 @@ import { InputPasswordModel } from '../../types/form.js';
2
2
 
3
3
  export type InputPasswordProps = {
4
4
  autocomplete?: string;
5
- canCopy?: boolean;
6
5
  encryptor?: (value: string) => Promise<string>;
7
- keyup?: any;
8
- modelValue?: InputPasswordModel;
6
+ showCopy?: boolean;
9
7
  showRefresh?: boolean;
10
8
  showStrength?: boolean;
11
9
  };
12
10
  export type InputPasswordEvents = {
13
11
  (e: "generate", val: InputPasswordModel): void;
14
- (e: "update:model-value", val: InputPasswordModel): void;
15
12
  (e: "enter"): void;
16
13
  };
@@ -43,7 +43,7 @@ export interface InputPriceModel {
43
43
  }
44
44
  export interface InputPasswordModel {
45
45
  /** Unencrypted password */
46
- raw?: string;
46
+ raw: string;
47
47
  /** If an encryptor was passed, this prop will hold the encrypted value */
48
48
  hash?: string;
49
49
  /** Strength of the password */
package/package.json CHANGED
@@ -1,116 +1,116 @@
1
1
  {
2
- "name": "@caipira/tamandua",
3
- "version": "0.0.21",
4
- "private": false,
5
- "description": "UI library for the Caipira ecosystem",
6
- "license": "GPL-3.0-only",
7
- "homepage": "https://caipira.io",
8
- "author": {
9
- "name": "Theone Lucas",
10
- "email": "theone@caipira.io"
11
- },
12
- "repository": {
13
- "type": "git",
14
- "url": "https://github.com/caipira-io/tamandua.git"
15
- },
16
- "type": "module",
17
- "typesVersions": {
18
- "*": {
19
- "*": [
20
- "./dist/types/index.d.ts"
21
- ],
22
- "date": [
23
- "./dist/types/services/date.d.ts"
24
- ],
25
- "plugins": [
26
- "./dist/types/components/plugins.d.ts"
27
- ],
28
- "form": [
29
- "./dist/types/form/index.d.ts"
30
- ],
31
- "components": [
32
- "./dist/types/components/index.d.ts"
33
- ],
34
- "composables": [
35
- "./dist/types/composables/index.d.ts"
36
- ],
37
- "enums": [
38
- "./dist/types/enums/index.d.ts"
39
- ]
2
+ "name": "@caipira/tamandua",
3
+ "version": "0.0.23",
4
+ "private": false,
5
+ "description": "UI library for the Caipira ecosystem",
6
+ "license": "GPL-3.0-only",
7
+ "homepage": "https://caipira.io",
8
+ "author": {
9
+ "name": "Theone Lucas",
10
+ "email": "theone@caipira.io"
11
+ },
12
+ "repository": {
13
+ "type": "git",
14
+ "url": "https://github.com/caipira-io/tamandua.git"
15
+ },
16
+ "type": "module",
17
+ "typesVersions": {
18
+ "*": {
19
+ "*": [
20
+ "./dist/types/index.d.ts"
21
+ ],
22
+ "date": [
23
+ "./dist/types/services/date.d.ts"
24
+ ],
25
+ "plugins": [
26
+ "./dist/types/components/plugins.d.ts"
27
+ ],
28
+ "form": [
29
+ "./dist/types/form/index.d.ts"
30
+ ],
31
+ "components": [
32
+ "./dist/types/components/index.d.ts"
33
+ ],
34
+ "composables": [
35
+ "./dist/types/composables/index.d.ts"
36
+ ],
37
+ "enums": [
38
+ "./dist/types/enums/index.d.ts"
39
+ ]
40
+ }
41
+ },
42
+ "exports": {
43
+ ".": "./dist/tamandua.js",
44
+ "./components": "./dist/components.js",
45
+ "./composables": "./dist/composables.js",
46
+ "./form": "./dist/form2.js",
47
+ "./date": "./dist/date.js",
48
+ "./plugins": "./dist/plugins.js",
49
+ "./enums": "./dist/enums.js",
50
+ "./volar": "./volar.d.ts",
51
+ "./style.css": "./dist/index.css"
52
+ },
53
+ "files": [
54
+ "dist/*.js",
55
+ "dist/*.css",
56
+ "dist/types",
57
+ "volar.d.ts",
58
+ "README.md"
59
+ ],
60
+ "scripts": {
61
+ "start": "vite --host",
62
+ "build:dev": "vite build --mode development",
63
+ "build:prod": "vite build --mode production",
64
+ "preview": "vite preview",
65
+ "start:test": "vitest",
66
+ "test": "vitest --run",
67
+ "typecheck": "vue-tsc --noEmit -p tsconfig.json --composite false",
68
+ "start:sb": "storybook dev",
69
+ "build:sb": "storybook build",
70
+ "prepublishOnly": "npm run build:prod"
71
+ },
72
+ "dependencies": {
73
+ "@popperjs/core": "^2.10.1",
74
+ "d3": "^7.9.0",
75
+ "date-fns": "^2.25.0",
76
+ "gsap": "^3.12.2"
77
+ },
78
+ "peerDependencies": {
79
+ "tailwindcss": "^3.4.3",
80
+ "vue": "^3.0.0",
81
+ "vue-i18n": "9"
82
+ },
83
+ "devDependencies": {
84
+ "@storybook/test": "^8.0.8",
85
+ "@faker-js/faker": "^8.4.1",
86
+ "@storybook/addon-actions": "^8.0.8",
87
+ "@storybook/addon-essentials": "^8.0.8",
88
+ "@storybook/addon-interactions": "^8.0.8",
89
+ "@storybook/addon-links": "^8.0.8",
90
+ "@storybook/addon-themes": "^8.0.8",
91
+ "@storybook/blocks": "^8.0.8",
92
+ "@storybook/vue3": "^8.0.8",
93
+ "@storybook/vue3-vite": "^8.0.8",
94
+ "@tailwindcss/forms": "^0.5.6",
95
+ "@types/d3": "^7.4.3",
96
+ "@types/js-cookie": "^2.2.7",
97
+ "@types/jsdom": "^21.1.6",
98
+ "@types/node": "^20.11.30",
99
+ "@vitejs/plugin-vue": "^5.0.4",
100
+ "@vue/test-utils": "^2.4.1",
101
+ "@vue/tsconfig": "^0.5.1",
102
+ "autoprefixer": "^10.4.0",
103
+ "jsdom": "^24.0.0",
104
+ "postcss": "^8.4.5",
105
+ "storybook": "^8.0.8",
106
+ "ts-node": "^10.9.1",
107
+ "typescript": "^5.4.5",
108
+ "vite": "^5.2.6",
109
+ "vite-plugin-dts": "^3.8.1",
110
+ "vite-plugin-lib-inject-css": "^2.0.1",
111
+ "vite-tsconfig-paths": "^4.2.0",
112
+ "vitest": "^1.4.0",
113
+ "vue": "^3.4.21",
114
+ "vue-tsc": "^2.0.13"
40
115
  }
41
- },
42
- "exports": {
43
- ".": "./dist/tamandua.js",
44
- "./components": "./dist/components.js",
45
- "./composables": "./dist/composables.js",
46
- "./form": "./dist/form2.js",
47
- "./date": "./dist/date.js",
48
- "./plugins": "./dist/plugins.js",
49
- "./enums": "./dist/enums.js",
50
- "./volar": "./volar.d.ts",
51
- "./style.css": "./dist/index.css"
52
- },
53
- "files": [
54
- "dist/*.js",
55
- "dist/*.css",
56
- "dist/types",
57
- "volar.d.ts",
58
- "README.md"
59
- ],
60
- "scripts": {
61
- "start": "vite --host",
62
- "build:dev": "vite build --mode development",
63
- "build:prod": "vite build --mode production",
64
- "preview": "vite preview",
65
- "start:test": "vitest",
66
- "test": "vitest --run",
67
- "typecheck": "vue-tsc --noEmit -p tsconfig.json --composite false",
68
- "start:sb": "storybook dev",
69
- "build:sb": "storybook build",
70
- "prepublishOnly": "npm run build:prod"
71
- },
72
- "dependencies": {
73
- "@popperjs/core": "^2.10.1",
74
- "@storybook/test": "^8.0.8",
75
- "d3": "^7.9.0",
76
- "date-fns": "^2.25.0",
77
- "gsap": "^3.12.2"
78
- },
79
- "peerDependencies": {
80
- "tailwindcss": "^3.4.3",
81
- "vue": "^3.0.0",
82
- "vue-i18n": "9"
83
- },
84
- "devDependencies": {
85
- "@faker-js/faker": "^8.4.1",
86
- "@storybook/addon-actions": "^8.0.8",
87
- "@storybook/addon-essentials": "^8.0.8",
88
- "@storybook/addon-interactions": "^8.0.8",
89
- "@storybook/addon-links": "^8.0.8",
90
- "@storybook/addon-themes": "^8.0.8",
91
- "@storybook/blocks": "^8.0.8",
92
- "@storybook/vue3": "^8.0.8",
93
- "@storybook/vue3-vite": "^8.0.8",
94
- "@tailwindcss/forms": "^0.5.6",
95
- "@types/d3": "^7.4.3",
96
- "@types/js-cookie": "^2.2.7",
97
- "@types/jsdom": "^21.1.6",
98
- "@types/node": "^20.11.30",
99
- "@vitejs/plugin-vue": "^5.0.4",
100
- "@vue/test-utils": "^2.4.1",
101
- "@vue/tsconfig": "^0.5.1",
102
- "autoprefixer": "^10.4.0",
103
- "jsdom": "^24.0.0",
104
- "postcss": "^8.4.5",
105
- "storybook": "^8.0.8",
106
- "ts-node": "^10.9.1",
107
- "typescript": "^5.4.5",
108
- "vite": "^5.2.6",
109
- "vite-plugin-dts": "^3.8.1",
110
- "vite-plugin-lib-inject-css": "^2.0.1",
111
- "vite-tsconfig-paths": "^4.2.0",
112
- "vitest": "^1.4.0",
113
- "vue": "^3.4.21",
114
- "vue-tsc": "^2.0.13"
115
- }
116
116
  }
@@ -1,178 +0,0 @@
1
- import { defineComponent as ee, ref as I, inject as te, watch as ne, resolveComponent as T, openBlock as L, createElementBlock as V, normalizeClass as U, unref as F, createElementVNode as K, createVNode as q, createCommentVNode as N, withKeys as le, createBlock as se, toDisplayString as ae } from "vue";
2
- import { u as oe } from "./useClipboard-BHFD0Jvv.js";
3
- import { f as re } from "./index-CjvqeRf7.js";
4
- const ie = (s = 18) => {
5
- const e = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890", r = "!?@#-+<%$>[]{}";
6
- let n = "";
7
- const i = [
8
- Math.floor(Math.random() * s),
9
- Math.floor(Math.random() * s)
10
- ];
11
- for (let o = 0; o < s; o++)
12
- i.includes(o) ? n += r.charAt(
13
- Math.floor(Math.random() * r.length)
14
- ) : n += e.charAt(
15
- Math.floor(Math.random() * e.length)
16
- );
17
- return n;
18
- }, ue = (s) => {
19
- let e = 0, r = 0, n = 0, i = 0, o = 0, p = 0, C = 0, f = 0, c = 0, m = 0, y = 0, h = 0, k = 0, w = 0, v = 0, x = 0, A = 0, l = 0, a = 2, _ = 2, R = 2, j = 2, g = 3, P = 3, D = 3, W = 4, Z = 4, G = 6, z = "", $ = "", B = "", M = "Too Short";
20
- const H = "abcdefghijklmnopqrstuvwxyz", J = "01234567890", Q = ")!@#$%^&*()", X = 8, b = s.replace(/\s+/g, "").split(/\s*/), S = b.length;
21
- e = s.length * W, r = s.length;
22
- for (let t = 0; t < S; t++) {
23
- b[t].match(/[A-Z]/g) ? (z !== "" && z + 1 == t && h++, z = t, n++) : b[t].match(/[a-z]/g) ? ($ !== "" && $ + 1 == t && k++, $ = t, i++) : b[t].match(/[0-9]/g) ? (t > 0 && t < S - 1 && C++, B !== "" && B + 1 == t && w++, B = t, o++) : b[t].match(/[^a-zA-Z0-9_]/g) && (t > 0 && t < S - 1 && C++, p++);
24
- let u = !1;
25
- for (let d = 0; d < S; d++)
26
- b[t] == b[d] && t != d && (u = !0, y += Math.abs(S / (d - t)));
27
- u && (m++, c = S - m, y = Math.ceil(c ? y / c : y));
28
- }
29
- for (let t = 0; t < 23; t++) {
30
- let u = H.substring(t, parseInt(t + 3)), d = u.split("").reverse().join("");
31
- (s.toLowerCase().indexOf(u) != -1 || s.toLowerCase().indexOf(d) != -1) && v++;
32
- }
33
- for (let t = 0; t < 8; t++) {
34
- let u = J.substring(t, parseInt(t + 3));
35
- var Y = u.split("").reverse().join("");
36
- (s.toLowerCase().indexOf(u) != -1 || s.toLowerCase().indexOf(Y) != -1) && x++;
37
- }
38
- for (let t = 0; t < 8; t++) {
39
- let u = Q.substring(t, parseInt(t + 3)), d = u.split("").reverse().join("");
40
- (s.toLowerCase().indexOf(u) != -1 || s.toLowerCase().indexOf(d) != -1) && A++;
41
- }
42
- n > 0 && n < r && (e = parseInt(e + (r - n) * 2)), i > 0 && i < r && (e = parseInt(e + (r - i) * 2)), o > 0 && o < r && (e = parseInt(e + o * Z)), p > 0 && (e = parseInt(e + p * G)), C > 0 && (e = parseInt(e + C * a)), (i > 0 || n > 0) && p === 0 && o === 0 && (e = parseInt(e - r)), i === 0 && n === 0 && p === 0 && o > 0 && (e = parseInt(e - r)), m > 0 && (e = parseInt(e - y)), h > 0 && (e = parseInt(e - h * _)), k > 0 && (e = parseInt(e - k * R)), w > 0 && (e = parseInt(e - w * j)), v > 0 && (e = parseInt(e - v * g)), x > 0 && (e = parseInt(e - x * P)), A > 0 && (e = parseInt(e - A * D)), f = l;
43
- let O = 0;
44
- return s.length >= X ? O = 3 : O = 4, f > O && (e = parseInt(e + f * 2)), e > 100 ? e = 100 : e < 0 && (e = 0), e >= 0 && e < 20 ? M = "Very Weak" : e >= 20 && e < 40 ? M = "Weak" : e >= 40 && e < 60 ? M = "Good" : e >= 60 && e < 80 ? M = "Strong" : e >= 80 && e <= 100 && (M = "Very Strong"), {
45
- score: e,
46
- complexity: M
47
- };
48
- }, E = {
49
- generatePassword: ie,
50
- getPasswordStrength: ue
51
- }, pe = { class: "flex border h-9 relative input-roundness input-border" }, ce = { class: "border-l select-none input-border input-control" }, fe = {
52
- key: 1,
53
- class: "inline-block float-right select-none"
54
- }, ye = /* @__PURE__ */ ee({
55
- name: "TInputPassword",
56
- __name: "InputPassword",
57
- props: {
58
- autocomplete: { default: "current-password" },
59
- canCopy: { type: Boolean, default: !0 },
60
- encryptor: { type: Function, default: void 0 },
61
- keyup: { default: () => () => {
62
- } },
63
- modelValue: { default: void 0 },
64
- showRefresh: { type: Boolean, default: !1 },
65
- showStrength: { type: Boolean, default: !1 }
66
- },
67
- emits: ["generate", "update:model-value", "enter"],
68
- setup(s, { expose: e, emit: r }) {
69
- const n = s, i = r, o = I("password"), p = I(null), { copy: C } = oe(), f = I(0), c = I(""), m = I(!1), y = te("formStyle", { input: "w-full" }), h = I(), k = (l) => {
70
- if (typeof l != "object")
71
- return;
72
- let a = !1;
73
- l.raw && (c.value = l.raw), l.strength ? f.value = l.strength : l.raw && (f.value = E.getPasswordStrength(
74
- l.raw
75
- ).score, a = !0), l.updatedAt && (h.value = l.updatedAt), l.raw && n.encryptor && (!n.modelValue?.hash || n.modelValue?.hash !== l.hash) && (a = !0), a && v(c.value);
76
- }, w = async (l) => (f.value = E.getPasswordStrength(l).score, {
77
- raw: l,
78
- strength: f.value,
79
- hash: n.encryptor ? await n.encryptor(l) : void 0,
80
- updatedAt: h.value
81
- }), v = async (l) => {
82
- i("update:model-value", await w(l));
83
- }, x = () => {
84
- p.value && p.value.$el && p.value.$el.focus();
85
- }, A = async () => {
86
- const l = E.generatePassword();
87
- i("generate", await w(l)), v(l);
88
- };
89
- return ne(() => n.modelValue, k, { immediate: !0 }), e({ focus: x }), (l, a) => {
90
- const _ = T("t-button"), R = T("t-input-text"), j = T("t-progress-line");
91
- return L(), V("div", {
92
- class: U({ [F(y).input]: !0 })
93
- }, [
94
- K("div", pe, [
95
- n.canCopy ? (L(), V("div", {
96
- key: 0,
97
- class: U(["border-r select-none input-border input-control", { "w-12": n.canCopy }])
98
- }, [
99
- q(_, {
100
- variant: "transparent",
101
- icon: "copy",
102
- size: "sm",
103
- class: "h-full w-full justify-center",
104
- animate: {
105
- target: "icon",
106
- trigger: "click",
107
- animation: {
108
- scale: 4,
109
- yoyo: !0,
110
- opacity: 0
111
- },
112
- reset: { opacity: 1, scale: 1 }
113
- },
114
- disabled: m.value,
115
- onClick: a[0] || (a[0] = (g) => F(C)(c.value))
116
- }, null, 8, ["disabled"])
117
- ], 2)) : N("", !0),
118
- n.showRefresh ? (L(), V("div", {
119
- key: 1,
120
- class: U(["border-r select-none input-border input-control", { "w-12": n.showRefresh }])
121
- }, [
122
- q(_, {
123
- variant: "transparent",
124
- icon: "refresh",
125
- size: "sm",
126
- class: "h-full w-full justify-center",
127
- animate: {
128
- target: "icon",
129
- trigger: "click",
130
- animation: { rotation: 360 },
131
- reset: { rotation: 0 }
132
- },
133
- disabled: m.value,
134
- onClick: A
135
- }, null, 8, ["disabled"])
136
- ], 2)) : N("", !0),
137
- q(R, {
138
- modelValue: c.value,
139
- "onUpdate:modelValue": a[1] || (a[1] = (g) => c.value = g),
140
- type: o.value,
141
- autocomplete: n.autocomplete,
142
- disabled: m.value,
143
- "disable-style": !0,
144
- ref_key: "input",
145
- ref: p,
146
- class: "w-full px-2 input-bg-color input-text-color input-outline input-roundness",
147
- onKeyup: [
148
- a[2] || (a[2] = le((g) => i("enter"), ["enter"])),
149
- n.keyup
150
- ],
151
- onInput: a[3] || (a[3] = (g) => v(c.value))
152
- }, null, 8, ["modelValue", "type", "autocomplete", "disabled", "onKeyup"]),
153
- K("div", ce, [
154
- q(_, {
155
- variant: "transparent",
156
- size: "sm",
157
- class: "h-full w-full justify-center",
158
- icon: o.value === "password" ? "eye" : "eye-off",
159
- disabled: m.value,
160
- onClick: a[4] || (a[4] = (g) => o.value = o.value === "password" ? "text" : "password")
161
- }, null, 8, ["icon", "disabled"])
162
- ])
163
- ]),
164
- n.showStrength ? (L(), se(j, {
165
- key: 0,
166
- value: f.value,
167
- class: "mt-0.5",
168
- height: 2.5,
169
- "show-percentage": !1
170
- }, null, 8, ["value"])) : N("", !0),
171
- h.value ? (L(), V("small", fe, " Last updated " + ae(F(re)(new Date(h.value), "MMMM do yyyy, hh:mm:ss")), 1)) : N("", !0)
172
- ], 2);
173
- };
174
- }
175
- });
176
- export {
177
- ye as _
178
- };