@agrotools1/at-components 2.0.19 → 2.0.21

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.
Files changed (29) hide show
  1. package/dist/changelog/versions/components/index.d.ts.map +1 -1
  2. package/dist/changelog/versions/components/v2.0.21.d.ts +4 -0
  3. package/dist/changelog/versions/components/v2.0.21.d.ts.map +1 -0
  4. package/dist/document-input/DocumentInput.vue.d.ts +57 -0
  5. package/dist/document-input/DocumentInput.vue.d.ts.map +1 -0
  6. package/dist/document-input/DocumentInput.vue.js +139 -0
  7. package/dist/document-input/DocumentInput.vue2.js +4 -0
  8. package/dist/document-input/index.d.ts +2 -0
  9. package/dist/document-input/index.d.ts.map +1 -0
  10. package/dist/document-input/index.js +4 -0
  11. package/dist/document-input/utils.d.ts +3 -0
  12. package/dist/document-input/utils.d.ts.map +1 -0
  13. package/dist/document-input/utils.js +33 -0
  14. package/dist/index.d.ts +1 -0
  15. package/dist/index.d.ts.map +1 -1
  16. package/dist/index.js +311 -309
  17. package/dist/multi-select/MultiSelectTrigger.vue.js +1 -1
  18. package/dist/packages/at-icons/dist/AtCheckCircleRegularIcon/AtCheckCircleRegularIcon.vue.js +46 -0
  19. package/dist/packages/at-icons/dist/AtCheckCircleRegularIcon/index.js +5 -0
  20. package/dist/packages/at-icons/dist/AtCirclePlusSolidIcon/AtCirclePlusSolidIcon.vue.js +4 -4
  21. package/dist/packages/at-icons/dist/AtCircleXMarkRegularIcon/AtCircleXMarkRegularIcon.vue.js +46 -0
  22. package/dist/packages/at-icons/dist/AtCircleXMarkRegularIcon/index.js +5 -0
  23. package/dist/packages/at-icons/dist/AtCircleXMarkSolidIcon/AtCircleXMarkSolidIcon.vue.js +46 -0
  24. package/dist/packages/at-icons/dist/AtCircleXMarkSolidIcon/index.js +5 -0
  25. package/dist/packages/at-icons/dist/AtOrdenacaoRegularIcon/AtOrdenacaoRegularIcon.vue.js +4 -4
  26. package/dist/packages/at-icons/dist/components/IconWrapper/IconWrapper.vue.js +2 -2
  27. package/dist/packages/at-icons/dist/components/IconWrapper/IconWrapper.vue2.js +10 -8
  28. package/dist/select/SelectTrigger.vue.js +1 -1
  29. package/package.json +13 -12
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/changelog/versions/components/index.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAE9C,4EAA4E;AAC5E,eAAO,MAAM,kBAAkB,EAAE,WAAW,EAS3C,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/changelog/versions/components/index.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAE9C,4EAA4E;AAC5E,eAAO,MAAM,kBAAkB,EAAE,WAAW,EAU3C,CAAA"}
@@ -0,0 +1,4 @@
1
+ import { VersionData } from '../../types';
2
+ declare const v2_0_21: VersionData;
3
+ export default v2_0_21;
4
+ //# sourceMappingURL=v2.0.21.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"v2.0.21.d.ts","sourceRoot":"","sources":["../../../../src/changelog/versions/components/v2.0.21.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAE9C,QAAA,MAAM,OAAO,EAAE,WAed,CAAA;AAED,eAAe,OAAO,CAAA"}
@@ -0,0 +1,57 @@
1
+ export interface DocumentInputProps {
2
+ id?: string;
3
+ modelValue?: string;
4
+ documentType?: 'cnpj';
5
+ label?: string;
6
+ description?: string;
7
+ required?: boolean;
8
+ disabled?: boolean;
9
+ error?: boolean | string;
10
+ success?: boolean;
11
+ allowAlpha?: boolean;
12
+ placeholder?: string;
13
+ class?: any;
14
+ inputClass?: any;
15
+ }
16
+ declare const _default: import('vue').DefineComponent<DocumentInputProps, {
17
+ input: import('vue').Ref<any, any>;
18
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
19
+ "update:modelValue": (payload: string) => any;
20
+ change: (payload: string) => any;
21
+ blur: (payload: FocusEvent) => any;
22
+ focus: (payload: FocusEvent) => any;
23
+ validate: (isValid: boolean) => any;
24
+ }, string, import('vue').PublicProps, Readonly<DocumentInputProps> & Readonly<{
25
+ "onUpdate:modelValue"?: ((payload: string) => any) | undefined;
26
+ onChange?: ((payload: string) => any) | undefined;
27
+ onBlur?: ((payload: FocusEvent) => any) | undefined;
28
+ onFocus?: ((payload: FocusEvent) => any) | undefined;
29
+ onValidate?: ((isValid: boolean) => any) | undefined;
30
+ }>, {
31
+ disabled: boolean;
32
+ success: boolean;
33
+ error: boolean | string;
34
+ documentType: "cnpj";
35
+ allowAlpha: boolean;
36
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
37
+ inputRef: import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('../input/Input.vue').InputProps> & Readonly<{
38
+ "onUpdate:modelValue"?: ((payload: string | number) => any) | undefined;
39
+ }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
40
+ "update:modelValue": (payload: string | number) => any;
41
+ }, import('vue').PublicProps, {
42
+ as: import('reka-ui').AsTag | import('vue').Component;
43
+ }, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
44
+ P: {};
45
+ B: {};
46
+ D: {};
47
+ C: {};
48
+ M: {};
49
+ Defaults: {};
50
+ }, Readonly<import('../input/Input.vue').InputProps> & Readonly<{
51
+ "onUpdate:modelValue"?: ((payload: string | number) => any) | undefined;
52
+ }>, {}, {}, {}, {}, {
53
+ as: import('reka-ui').AsTag | import('vue').Component;
54
+ }> | null;
55
+ }, any>;
56
+ export default _default;
57
+ //# sourceMappingURL=DocumentInput.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DocumentInput.vue.d.ts","sourceRoot":"","sources":["../../src/document-input/DocumentInput.vue"],"names":[],"mappings":"AAqPA,MAAM,WAAW,kBAAkB;IACjC,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,CAAA;IACxB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,KAAK,CAAC,EAAE,GAAG,CAAA;IACX,UAAU,CAAC,EAAE,GAAG,CAAA;CACjB;;;;;;;;;;;;;;;;cAPY,OAAO;aAER,OAAO;WADT,OAAO,GAAG,MAAM;kBALT,MAAM;gBAOR,OAAO;;;;;;;;;;;;;;;;;;;;;AAoXtB,wBAUG"}
@@ -0,0 +1,139 @@
1
+ import { defineComponent as X, useId as H, ref as h, computed as g, watch as O, createElementBlock as u, openBlock as i, normalizeClass as j, unref as r, createBlock as y, createCommentVNode as d, createElementVNode as w, withCtx as G, createTextVNode as J, toDisplayString as A, createVNode as S, mergeProps as K } from "vue";
2
+ import { cn as k } from "../lib/utils.js";
3
+ import { AtCheckCircleRegularIcon as L } from "../packages/at-icons/dist/AtCheckCircleRegularIcon/index.js";
4
+ import { AtCircleXMarkRegularIcon as Q } from "../packages/at-icons/dist/AtCircleXMarkRegularIcon/index.js";
5
+ import { AtCircleXMarkSolidIcon as U } from "../packages/at-icons/dist/AtCircleXMarkSolidIcon/index.js";
6
+ import W from "../input/Input.vue.js";
7
+ import Y from "../label/Label.vue.js";
8
+ import { isValidCnpj as x, applyCnpjMask as E } from "./utils.js";
9
+ const ee = { key: 0 }, te = { class: "relative flex items-center" }, ae = {
10
+ key: 0,
11
+ class: "absolute right-2.5 flex items-center justify-center pointer-events-none"
12
+ }, ue = /* @__PURE__ */ X({
13
+ inheritAttrs: !1,
14
+ __name: "DocumentInput",
15
+ props: {
16
+ id: {},
17
+ modelValue: {},
18
+ documentType: { default: "cnpj" },
19
+ label: {},
20
+ description: {},
21
+ required: { type: Boolean },
22
+ disabled: { type: Boolean, default: !1 },
23
+ error: { type: [Boolean, String], default: !1 },
24
+ success: { type: Boolean, default: !1 },
25
+ allowAlpha: { type: Boolean, default: !1 },
26
+ placeholder: {},
27
+ class: {},
28
+ inputClass: {}
29
+ },
30
+ emits: ["update:modelValue", "change", "blur", "focus", "validate"],
31
+ setup(R, { expose: T, emit: $ }) {
32
+ const e = R, o = $, p = e.id || H(), b = `error-${p}`, _ = `desc-${p}`, l = h(e.modelValue || ""), f = h(!1), z = g(() => e.allowAlpha ? "AA.AAA.AAA/AAAA-DV" : "00.000.000/0000-00"), n = g(() => !!e.error && !f.value), C = g(() => e.success && !n.value && l.value.length === 18 && x(l.value));
33
+ O(
34
+ () => e.modelValue,
35
+ (t) => {
36
+ t !== void 0 && t !== l.value && (e.documentType === "cnpj" ? l.value = E(t, e.allowAlpha) : l.value = t);
37
+ }
38
+ );
39
+ const M = (t) => {
40
+ f.value = !1;
41
+ const s = t.target, v = s.value, Z = s.selectionStart || 0;
42
+ let a = v;
43
+ e.documentType === "cnpj" && (a = E(v, e.allowAlpha));
44
+ const q = e.allowAlpha ? /[A-Z0-9]/gi : /[0-9]/g, B = (v.slice(0, Z).match(q) || []).length;
45
+ let c = 0, I = 0;
46
+ if (B > 0) {
47
+ for (let m = 0; m < a.length; m++) {
48
+ const F = a[m];
49
+ if (/[A-Z0-9]/.test(F) && I++, c = m + 1, I >= B) break;
50
+ }
51
+ for (; c < a.length && !/[A-Z0-9]/.test(a[c]); )
52
+ c++;
53
+ }
54
+ s.value !== a && (s.value = a, s.setSelectionRange(c, c)), l.value !== a && (l.value = a, o("update:modelValue", a), o("change", a), e.documentType === "cnpj" && o("validate", x(a)));
55
+ }, N = (t) => {
56
+ o("focus", t);
57
+ }, D = (t) => {
58
+ if (o("blur", t), e.documentType === "cnpj") {
59
+ const s = x(l.value);
60
+ o("validate", s);
61
+ }
62
+ }, P = () => {
63
+ l.value = "", f.value = !0, o("update:modelValue", ""), o("change", ""), o("validate", !1);
64
+ }, V = h(null);
65
+ return T({
66
+ input: V
67
+ }), (t, s) => (i(), u("div", {
68
+ class: j(r(k)("space-y-1.5 w-full", e.class))
69
+ }, [
70
+ e.label ? (i(), y(r(Y), {
71
+ key: 0,
72
+ for: r(p),
73
+ class: j(
74
+ r(k)(
75
+ "text-[#101011] font-normal text-[10px] leading-[10px]",
76
+ n.value ? "text-[var(--alert-red-dark,#831511)]" : ""
77
+ )
78
+ )
79
+ }, {
80
+ default: G(() => [
81
+ J(A(e.label), 1),
82
+ e.required ? (i(), u("span", ee, " (Obrigatório)")) : d("", !0)
83
+ ]),
84
+ _: 1
85
+ }, 8, ["for", "class"])) : d("", !0),
86
+ w("div", te, [
87
+ S(r(W), K({
88
+ id: r(p),
89
+ ref_key: "inputRef",
90
+ ref: V,
91
+ "model-value": l.value,
92
+ disabled: e.disabled,
93
+ class: r(k)("pr-10", n.value || e.success ? "border-[#3E2E46]" : "", e.inputClass),
94
+ placeholder: e.placeholder || z.value,
95
+ "aria-invalid": n.value,
96
+ "aria-describedby": [
97
+ e.error && !f.value ? b : void 0,
98
+ e.description ? _ : void 0
99
+ ].filter(Boolean).join(" ") || void 0
100
+ }, t.$attrs, {
101
+ onInput: M,
102
+ onBlur: D,
103
+ onFocus: N
104
+ }), null, 16, ["id", "model-value", "disabled", "class", "placeholder", "aria-invalid", "aria-describedby"]),
105
+ C.value || n.value ? (i(), u("div", ae, [
106
+ C.value ? (i(), y(r(L), {
107
+ key: 0,
108
+ size: "20",
109
+ class: "text-[#4b715c]"
110
+ })) : n.value ? (i(), y(r(Q), {
111
+ key: 1,
112
+ size: "20",
113
+ class: "text-[var(--alert-red-dark,#831511)] cursor-pointer pointer-events-auto",
114
+ onClick: P
115
+ })) : d("", !0)
116
+ ])) : d("", !0)
117
+ ]),
118
+ e.description && !e.error ? (i(), u("div", {
119
+ key: 1,
120
+ id: _,
121
+ class: "text-gray-500 text-[11px] leading-tight"
122
+ }, A(e.description), 1)) : d("", !0),
123
+ typeof e.error == "string" && n.value ? (i(), u("div", {
124
+ key: 2,
125
+ id: b,
126
+ class: "text-[var(--alert-red-dark,#831511)] flex items-center gap-1 text-[11px] font-medium leading-tight pt-0.5"
127
+ }, [
128
+ S(r(U), {
129
+ size: "14",
130
+ class: "text-[var(--alert-red-dark,#831511)] shrink-0"
131
+ }),
132
+ w("span", null, A(e.error), 1)
133
+ ])) : d("", !0)
134
+ ], 2));
135
+ }
136
+ });
137
+ export {
138
+ ue as default
139
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./DocumentInput.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,2 @@
1
+ export { default as AgtDocumentInput } from './DocumentInput.vue';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/document-input/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,qBAAqB,CAAA"}
@@ -0,0 +1,4 @@
1
+ import { default as o } from "./DocumentInput.vue.js";
2
+ export {
3
+ o as AgtDocumentInput
4
+ };
@@ -0,0 +1,3 @@
1
+ export declare function applyCnpjMask(val: string, allowAlpha?: boolean): string;
2
+ export declare function isValidCnpj(cnpj: string): boolean;
3
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/document-input/utils.ts"],"names":[],"mappings":"AAAA,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,UAAU,GAAE,OAAe,GAAG,MAAM,CAkC9E;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAwCjD"}
@@ -0,0 +1,33 @@
1
+ function u(s, r = !1) {
2
+ let l = s.toUpperCase().replace(/[^A-Z0-9]/g, "");
3
+ r || (l = l.replace(/[A-Z]/g, ""));
4
+ let t = "";
5
+ for (let e = 0; e < l.length && t.length < 14; e++) {
6
+ const i = l[e];
7
+ (t.length < 12 || /[0-9]/.test(i)) && (t += i);
8
+ }
9
+ let n = "";
10
+ for (let e = 0; e < t.length; e++)
11
+ e === 2 && (n += "."), e === 5 && (n += "."), e === 8 && (n += "/"), e === 12 && (n += "-"), n += t[e];
12
+ return n;
13
+ }
14
+ function p(s) {
15
+ if (!s) return !1;
16
+ const r = s.toUpperCase().replace(/[^A-Z0-9]/g, "");
17
+ if (r.length !== 14 || /^([A-Z0-9])\1{13}$/.test(r) || !/^[0-9]{2}$/.test(r.slice(12, 14))) return !1;
18
+ const l = (i) => {
19
+ const f = i.charCodeAt(0);
20
+ return f >= 48 && f <= 57, f - 48;
21
+ }, t = (i) => {
22
+ let f = 0, a = i - 7;
23
+ for (let c = 0; c < i; c++)
24
+ f += l(r[c]) * a, a--, a < 2 && (a = 9);
25
+ const o = f % 11;
26
+ return o < 2 ? 0 : 11 - o;
27
+ }, n = t(12), e = t(13);
28
+ return l(r[12]) === n && l(r[13]) === e;
29
+ }
30
+ export {
31
+ u as applyCnpjMask,
32
+ p as isValidCnpj
33
+ };
package/dist/index.d.ts CHANGED
@@ -14,6 +14,7 @@ export * from './data-table';
14
14
  export * from './date-picker';
15
15
  export * from './date-range-picker';
16
16
  export * from './dialog';
17
+ export * from './document-input';
17
18
  export * from './dropdown-menu';
18
19
  export * from './illustration';
19
20
  export * from './input';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,cAAc,aAAa,CAAA;AAC3B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,UAAU,C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