@agrotools1/at-components 2.0.33 → 2.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/dist/changelog/versions/components/index.d.ts.map +1 -1
- package/dist/changelog/versions/components/v2.0.34.d.ts +4 -0
- package/dist/changelog/versions/components/v2.0.34.d.ts.map +1 -0
- package/dist/document-input/DocumentAutoComplete.vue.d.ts +2 -2
- package/dist/document-input/DocumentAutoComplete.vue.d.ts.map +1 -1
- package/dist/document-input/DocumentAutoComplete.vue.js +122 -103
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/changelog/versions/components/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/changelog/versions/components/index.ts"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAE9C,4EAA4E;AAC5E,eAAO,MAAM,kBAAkB,EAAE,WAAW,EAmB3C,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"v2.0.34.d.ts","sourceRoot":"","sources":["../../../../src/changelog/versions/components/v2.0.34.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAE9C,QAAA,MAAM,OAAO,EAAE,WA2Bd,CAAA;AAED,eAAe,OAAO,CAAA"}
|
|
@@ -7,7 +7,7 @@ interface Props {
|
|
|
7
7
|
* Tipo de documento. Define máscara e validação.
|
|
8
8
|
* @default 'cpf-cnpj'
|
|
9
9
|
*/
|
|
10
|
-
documentType?: 'cpf' | 'cnpj' | 'cpf-cnpj' | 'generic';
|
|
10
|
+
documentType?: 'cpf' | 'cnpj' | 'cpf-cnpj' | 'generic' | 'custom';
|
|
11
11
|
/** Texto do rótulo (label) acima do campo. */
|
|
12
12
|
label?: string;
|
|
13
13
|
/** Texto de ajuda ou descrição abaixo do campo. */
|
|
@@ -106,7 +106,7 @@ declare const __VLS_component: import('vue').DefineComponent<Props, {}, {}, {},
|
|
|
106
106
|
error: boolean | string;
|
|
107
107
|
withIcon: boolean;
|
|
108
108
|
allowAlpha: boolean;
|
|
109
|
-
documentType: "cpf" | "cnpj" | "cpf-cnpj" | "generic";
|
|
109
|
+
documentType: "cpf" | "cnpj" | "cpf-cnpj" | "generic" | "custom";
|
|
110
110
|
withInternalValidation: boolean;
|
|
111
111
|
unmask: boolean;
|
|
112
112
|
withClearIcon: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DocumentAutoComplete.vue.d.ts","sourceRoot":"","sources":["../../src/document-input/DocumentAutoComplete.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DocumentAutoComplete.vue.d.ts","sourceRoot":"","sources":["../../src/document-input/DocumentAutoComplete.vue"],"names":[],"mappings":"AAspBA,UAAU,KAAK;IACb,8BAA8B;IAC9B,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,+CAA+C;IAC/C,UAAU,CAAC,EAAE,GAAG,CAAA;IAChB;;;OAGG;IACH,YAAY,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,UAAU,GAAG,SAAS,GAAG,QAAQ,CAAA;IACjE,8CAA8C;IAC9C,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,mDAAmD;IACnD,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,uCAAuC;IACvC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,2DAA2D;IAC3D,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,CAAA;IACxB,oEAAoE;IACpE,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,uEAAuE;IACvE,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,+BAA+B;IAC/B,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,kDAAkD;IAClD,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,2DAA2D;IAC3D,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,+CAA+C;IAC/C,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,oCAAoC;IACpC,KAAK,CAAC,EAAE,GAAG,CAAA;IACX,wCAAwC;IACxC,UAAU,CAAC,EAAE,GAAG,CAAA;IAChB,iDAAiD;IACjD,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,kDAAkD;IAClD,sBAAsB,CAAC,EAAE,OAAO,CAAA;IAChC,2CAA2C;IAC3C,OAAO,CAAC,EAAE,GAAG,EAAE,CAAA;IACf,qCAAqC;IACrC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,0DAA0D;IAC1D,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,uDAAuD;IACvD,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;CACxB;AA6ZD,iBAAS,cAAc;WAiWT,OAAO,IAA6B;;uBAhBtB,GAAG;sBACJ,GAAG;yBACA,GAAG;uBACL,GAAG;yBACD,GAAG;;;YACJ,GAAG;;;;;;EAgB/B;AA4CD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;;;;;;;;;;;;;;cAj2BR,OAAO;iBAeJ,OAAO;aARX,OAAO;WAFT,OAAO,GAAG,MAAM;cAuBb,OAAO;gBAnBL,OAAO;kBAjBL,KAAK,GAAG,MAAM,GAAG,UAAU,GAAG,SAAS,GAAG,QAAQ;4BAsCxC,OAAO;YAVvB,OAAO;mBA4BA,OAAO;cALZ,MAAM;;;kBAg0BjB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAapG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { defineComponent as ie, useId as ue, ref as
|
|
1
|
+
import { defineComponent as ie, useId as ue, ref as v, watch as ce, computed as U, createElementBlock as g, openBlock as i, normalizeClass as S, unref as a, createBlock as T, createCommentVNode as y, createVNode as d, withCtx as m, createTextVNode as Z, toDisplayString as k, mergeProps as pe, createElementVNode as _, renderSlot as A, withModifiers as q, withDirectives as de, Fragment as fe, renderList as me, vShow as he, nextTick as z } from "vue";
|
|
2
2
|
import { cn as F } from "../lib/utils.js";
|
|
3
3
|
import { AtCheckCircleRegularIcon as ge } from "../packages/at-icons/dist/AtCheckCircleRegularIcon/index.js";
|
|
4
|
-
import { AtCheckSolidIcon as
|
|
5
|
-
import { AtCircleXMarkRegularIcon as
|
|
4
|
+
import { AtCheckSolidIcon as ye } from "../packages/at-icons/dist/AtCheckSolidIcon/index.js";
|
|
5
|
+
import { AtCircleXMarkRegularIcon as ve } from "../packages/at-icons/dist/AtCircleXMarkRegularIcon/index.js";
|
|
6
6
|
import { AtCircleXMarkSolidIcon as R } from "../packages/at-icons/dist/AtCircleXMarkSolidIcon/index.js";
|
|
7
|
-
import { reactiveOmit as
|
|
8
|
-
import { useForwardPropsEmits as
|
|
9
|
-
import
|
|
7
|
+
import { reactiveOmit as Te } from "@vueuse/core";
|
|
8
|
+
import { useForwardPropsEmits as ke } from "reka-ui";
|
|
9
|
+
import Ae from "../combobox/Combobox.vue.js";
|
|
10
10
|
import xe from "../combobox/ComboboxAnchor.vue.js";
|
|
11
11
|
import we from "../combobox/ComboboxEmpty.vue.js";
|
|
12
12
|
import Ce from "../combobox/ComboboxGroup.vue.js";
|
|
@@ -21,7 +21,7 @@ import je from "../node_modules/.pnpm/lucide-vue-next@0.542.0_vue@3.5.19_typescr
|
|
|
21
21
|
const Be = { key: 0 }, Ue = { class: "relative flex items-center" }, Se = {
|
|
22
22
|
key: 0,
|
|
23
23
|
class: "py-6 flex items-center justify-center text-sm text-gray-500"
|
|
24
|
-
}, Ze = { class: "flex items-center gap-2" },
|
|
24
|
+
}, Ze = { class: "flex items-center gap-2" }, rt = /* @__PURE__ */ ie({
|
|
25
25
|
__name: "DocumentAutoComplete",
|
|
26
26
|
props: {
|
|
27
27
|
id: {},
|
|
@@ -52,7 +52,7 @@ const Be = { key: 0 }, Ue = { class: "relative flex items-center" }, Se = {
|
|
|
52
52
|
},
|
|
53
53
|
emits: ["update:modelValue", "update:searchTerm", "select", "validate", "blur", "focus", "clear"],
|
|
54
54
|
setup(H, { emit: J }) {
|
|
55
|
-
const e = H, o = J, C = e.id || ue(), G = `error-${C}`, K = `desc-${C}`, Q =
|
|
55
|
+
const e = H, o = J, C = e.id || ue(), G = `error-${C}`, K = `desc-${C}`, Q = Te(
|
|
56
56
|
e,
|
|
57
57
|
"modelValue",
|
|
58
58
|
"documentType",
|
|
@@ -76,14 +76,14 @@ const Be = { key: 0 }, Ue = { class: "relative flex items-center" }, Se = {
|
|
|
76
76
|
"loadingText",
|
|
77
77
|
"optionId",
|
|
78
78
|
"modelValue"
|
|
79
|
-
), W =
|
|
79
|
+
), W = ke(Q, o), s = v(""), V = v(!1), I = v(!1), E = v(!1), $ = v(null), M = v(e.modelValue);
|
|
80
80
|
function Y(t, l) {
|
|
81
81
|
if (!l) return t;
|
|
82
|
-
const
|
|
83
|
-
if (!
|
|
82
|
+
const r = t.replace(/[^0-9A-Za-z]/g, "");
|
|
83
|
+
if (!r) return "";
|
|
84
84
|
let f = "", n = 0;
|
|
85
|
-
for (let c = 0; c < l.length && n <
|
|
86
|
-
const u = l[c], p =
|
|
85
|
+
for (let c = 0; c < l.length && n < r.length; c++) {
|
|
86
|
+
const u = l[c], p = r[n];
|
|
87
87
|
u === "9" ? /[0-9]/.test(p) ? (f += p, n++) : (n++, c--) : u === "A" ? /[A-Za-z]/.test(p) ? (f += e.toUpperCase ? p.toUpperCase() : p, n++) : (n++, c--) : u === "X" ? /[0-9A-Za-z]/.test(p) ? (f += e.toUpperCase ? p.toUpperCase() : p, n++) : (n++, c--) : (f += u, p === u && n++);
|
|
88
88
|
}
|
|
89
89
|
return f;
|
|
@@ -95,7 +95,9 @@ const Be = { key: 0 }, Ue = { class: "relative flex items-center" }, Se = {
|
|
|
95
95
|
return e.documentType === "cpf" ? O(t) : e.documentType === "cnpj" ? X(t, e.allowAlpha) : e.documentType === "cpf-cnpj" ? e.allowAlpha && l || t.length > 11 ? X(t, e.allowAlpha) : O(t) : t;
|
|
96
96
|
}
|
|
97
97
|
const P = (t) => {
|
|
98
|
-
if (!t) return
|
|
98
|
+
if (!t) return s.value || "";
|
|
99
|
+
if (e.documentType === "custom")
|
|
100
|
+
return typeof t == "string" ? t : t.text || t.label || t.identifier || t.value || "";
|
|
99
101
|
if (typeof t == "string") {
|
|
100
102
|
const l = t.replace(
|
|
101
103
|
e.documentType === "generic" && e.customMask || e.allowAlpha ? /[^A-Z0-9]/gi : /[^0-9]/g,
|
|
@@ -109,15 +111,19 @@ const Be = { key: 0 }, Ue = { class: "relative flex items-center" }, Se = {
|
|
|
109
111
|
() => e.modelValue,
|
|
110
112
|
(t) => {
|
|
111
113
|
if (M.value = t, t == null || t === "") {
|
|
112
|
-
|
|
114
|
+
s.value !== "" && (s.value = ""), M.value = void 0;
|
|
113
115
|
return;
|
|
114
116
|
}
|
|
115
117
|
const l = P(t);
|
|
116
|
-
|
|
118
|
+
s.value !== l && (s.value = l);
|
|
117
119
|
},
|
|
118
120
|
{ immediate: !0 }
|
|
119
121
|
);
|
|
120
|
-
const ee =
|
|
122
|
+
const ee = U(() => {
|
|
123
|
+
if (e.maxLength) return e.maxLength;
|
|
124
|
+
if (e.documentType !== "custom")
|
|
125
|
+
return e.customMask && e.documentType === "generic" ? e.customMask.length : e.documentType === "cpf" ? 14 : 18;
|
|
126
|
+
}), te = U(() => {
|
|
121
127
|
switch (e.documentType) {
|
|
122
128
|
case "cnpj":
|
|
123
129
|
return e.allowAlpha ? "AA.AAA.AAA/AAAA-DV" : "00.000.000/0000-00";
|
|
@@ -128,116 +134,129 @@ const Be = { key: 0 }, Ue = { class: "relative flex items-center" }, Se = {
|
|
|
128
134
|
default:
|
|
129
135
|
return;
|
|
130
136
|
}
|
|
131
|
-
}), h =
|
|
137
|
+
}), h = U(() => {
|
|
132
138
|
if (e.error) return !0;
|
|
139
|
+
if (e.documentType === "custom") return !1;
|
|
133
140
|
if (e.withInternalValidation) {
|
|
134
141
|
const t = e.modelValue;
|
|
135
142
|
if (!t || I.value) return !1;
|
|
136
|
-
const
|
|
137
|
-
if (!
|
|
138
|
-
if (
|
|
143
|
+
const r = (typeof t == "string" ? t : t.identifier || t.value || "").replace(/[^A-Z0-9]/gi, "");
|
|
144
|
+
if (!r) return !1;
|
|
145
|
+
if (r.length === 11 && !x(r) || r.length === 14 && !w(r) || E.value && (e.documentType === "cpf" && r.length !== 11 || e.documentType === "cnpj" && r.length !== 14 || e.documentType === "cpf-cnpj" && r.length !== 11 && r.length !== 14))
|
|
139
146
|
return !0;
|
|
140
147
|
}
|
|
141
148
|
return !1;
|
|
142
|
-
}), j =
|
|
149
|
+
}), j = U(() => {
|
|
143
150
|
if (h.value) return !1;
|
|
144
151
|
if (e.success) return !0;
|
|
152
|
+
if (e.documentType === "custom") return !1;
|
|
145
153
|
if (e.withInternalValidation) {
|
|
146
154
|
const t = e.modelValue;
|
|
147
155
|
if (!t) return !1;
|
|
148
|
-
const
|
|
149
|
-
if (e.documentType === "cpf") return x(
|
|
150
|
-
if (e.documentType === "cnpj") return w(
|
|
156
|
+
const r = (typeof t == "string" ? t : t.identifier || t.value || "").replace(/[^A-Z0-9]/gi, "");
|
|
157
|
+
if (e.documentType === "cpf") return x(r);
|
|
158
|
+
if (e.documentType === "cnpj") return w(r);
|
|
151
159
|
if (e.documentType === "cpf-cnpj")
|
|
152
|
-
return
|
|
160
|
+
return r.length === 11 ? x(r) : w(r);
|
|
153
161
|
}
|
|
154
162
|
return !1;
|
|
155
163
|
});
|
|
156
164
|
function D(t) {
|
|
165
|
+
if (e.documentType === "custom") {
|
|
166
|
+
o("validate", !!t);
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
157
169
|
let l = !1;
|
|
158
170
|
e.documentType === "cpf" ? l = x(t) : e.documentType === "cnpj" ? l = w(t) : e.documentType === "cpf-cnpj" && (l = t.length === 11 ? x(t) : w(t)), o("validate", l);
|
|
159
171
|
}
|
|
160
172
|
function le(t) {
|
|
161
173
|
const l = t.target;
|
|
162
|
-
let
|
|
174
|
+
let r = l.value;
|
|
163
175
|
const f = l.selectionStart || 0;
|
|
164
|
-
I.value = !1, e.toUpperCase && (
|
|
165
|
-
|
|
176
|
+
if (I.value = !1, e.toUpperCase && (r = r.toUpperCase()), e.documentType === "custom") {
|
|
177
|
+
o("update:modelValue", r || void 0), o("update:searchTerm", r), s.value = r;
|
|
178
|
+
return;
|
|
179
|
+
}
|
|
180
|
+
let n = r.replace(
|
|
166
181
|
e.documentType === "generic" && e.customMask || e.allowAlpha ? /[^A-Z0-9]/gi : /[^0-9]/g,
|
|
167
182
|
""
|
|
168
183
|
), c = e.maxLength;
|
|
169
184
|
c || (e.customMask && e.documentType === "generic" ? c = e.customMask.length : c = e.documentType === "cpf" ? 11 : 14), n = n.slice(0, c);
|
|
170
|
-
const u = L(n), p = e.allowAlpha ? /[A-Z0-9]/gi : /[0-9]/g, ne = (
|
|
171
|
-
o("update:modelValue", se), o("update:searchTerm", n), D(n),
|
|
185
|
+
const u = L(n), p = e.allowAlpha ? /[A-Z0-9]/gi : /[0-9]/g, ne = (r.slice(0, f).match(p) || []).length, se = (e.unmask ? n : u) || void 0;
|
|
186
|
+
o("update:modelValue", se), o("update:searchTerm", n), D(n), s.value = u, z(() => {
|
|
172
187
|
l.value = u;
|
|
173
|
-
let
|
|
174
|
-
for (let b = 0; b < u.length && ((e.documentType === "generic" && e.customMask || e.allowAlpha ? /[A-Z0-9]/i.test(u[b]) : /[0-9]/.test(u[b])) && N++,
|
|
188
|
+
let B = 0, N = 0;
|
|
189
|
+
for (let b = 0; b < u.length && ((e.documentType === "generic" && e.customMask || e.allowAlpha ? /[A-Z0-9]/i.test(u[b]) : /[0-9]/.test(u[b])) && N++, B = b + 1, !(N >= ne)); b++)
|
|
175
190
|
;
|
|
176
|
-
l.setSelectionRange(
|
|
191
|
+
l.setSelectionRange(B, B);
|
|
177
192
|
});
|
|
178
193
|
}
|
|
179
|
-
function
|
|
180
|
-
|
|
194
|
+
function re(t) {
|
|
195
|
+
s.value = "", o("update:searchTerm", ""), M.value = null, o("update:modelValue", null), z(() => {
|
|
181
196
|
if (!$.value) return;
|
|
182
|
-
const l = $.value.querySelector(`[id="${C}"]`) || $.value.querySelector("input"),
|
|
183
|
-
|
|
197
|
+
const l = $.value.querySelector(`[id="${C}"]`) || $.value.querySelector("input"), r = (l == null ? void 0 : l.tagName) === "INPUT" ? l : l == null ? void 0 : l.querySelector("input");
|
|
198
|
+
r && (r.value = "", r.dispatchEvent(new Event("input", { bubbles: !0 }))), z(() => {
|
|
184
199
|
V.value = !1;
|
|
185
200
|
});
|
|
186
201
|
}), I.value = !0, o("validate", !1), o("clear"), V.value = !1;
|
|
187
202
|
}
|
|
188
|
-
function
|
|
203
|
+
function ae(t) {
|
|
189
204
|
if (!t) {
|
|
190
|
-
|
|
205
|
+
s.value = "", o("update:searchTerm", ""), I.value = !0, o("update:modelValue", null);
|
|
191
206
|
return;
|
|
192
207
|
}
|
|
193
|
-
o("update:modelValue", t), o("select", t),
|
|
194
|
-
|
|
195
|
-
|
|
208
|
+
if (o("update:modelValue", t), o("select", t), s.value = t.text || t.label || t.identifier || t.value || "", e.documentType === "custom")
|
|
209
|
+
o("update:searchTerm", s.value), o("validate", !0);
|
|
210
|
+
else {
|
|
211
|
+
const l = (t.identifier || t.value || "").replace(/[^A-Z0-9]/gi, "");
|
|
212
|
+
o("update:searchTerm", l), D(l);
|
|
213
|
+
}
|
|
214
|
+
V.value = !1;
|
|
196
215
|
}
|
|
197
216
|
function oe(t) {
|
|
198
|
-
E.value = !0, o("blur", t);
|
|
199
|
-
const l =
|
|
200
|
-
let
|
|
201
|
-
l.length === 11 ?
|
|
217
|
+
if (E.value = !0, o("blur", t), e.documentType === "custom") return;
|
|
218
|
+
const l = s.value.replace(e.allowAlpha ? /[^A-Z0-9]/gi : /[^0-9]/g, "");
|
|
219
|
+
let r = !1;
|
|
220
|
+
l.length === 11 ? r = x(l) : l.length === 14 && (r = w(l)), r && o("update:modelValue", e.toUpperCase ? l.toUpperCase() : l);
|
|
202
221
|
}
|
|
203
|
-
return (t, l) => (
|
|
204
|
-
class:
|
|
222
|
+
return (t, l) => (i(), g("div", {
|
|
223
|
+
class: S(a(F)("space-y-1.5 w-full", e.class)),
|
|
205
224
|
ref_key: "wrapperRef",
|
|
206
225
|
ref: $
|
|
207
226
|
}, [
|
|
208
|
-
e.label ? (
|
|
227
|
+
e.label ? (i(), T(a(Me), {
|
|
209
228
|
key: 0,
|
|
210
|
-
for:
|
|
211
|
-
class:
|
|
212
|
-
|
|
229
|
+
for: a(C),
|
|
230
|
+
class: S(
|
|
231
|
+
a(F)(
|
|
213
232
|
"text-[#101011] font-normal text-[10px] leading-[10px]",
|
|
214
233
|
h.value ? "text-[var(--alert-red-dark,#831511)]" : ""
|
|
215
234
|
)
|
|
216
235
|
)
|
|
217
236
|
}, {
|
|
218
237
|
default: m(() => [
|
|
219
|
-
Z(
|
|
220
|
-
e.required && !e.label.includes("(Obrigatório)") ? (
|
|
238
|
+
Z(k(e.label), 1),
|
|
239
|
+
e.required && !e.label.includes("(Obrigatório)") ? (i(), g("span", Be, " (Obrigatório)")) : y("", !0)
|
|
221
240
|
]),
|
|
222
241
|
_: 1
|
|
223
|
-
}, 8, ["for", "class"])) :
|
|
224
|
-
d(
|
|
242
|
+
}, 8, ["for", "class"])) : y("", !0),
|
|
243
|
+
d(a(Ae), pe(a(W), {
|
|
225
244
|
"model-value": M.value,
|
|
226
|
-
searchTerm:
|
|
227
|
-
"onUpdate:searchTerm": l[3] || (l[3] = (
|
|
245
|
+
searchTerm: s.value,
|
|
246
|
+
"onUpdate:searchTerm": l[3] || (l[3] = (r) => s.value = r),
|
|
228
247
|
open: V.value,
|
|
229
|
-
"onUpdate:open": l[4] || (l[4] = (
|
|
248
|
+
"onUpdate:open": l[4] || (l[4] = (r) => V.value = r),
|
|
230
249
|
"reset-search-term-on-select": !1,
|
|
231
250
|
"filter-function": () => !0,
|
|
232
|
-
"onUpdate:modelValue":
|
|
251
|
+
"onUpdate:modelValue": ae
|
|
233
252
|
}), {
|
|
234
253
|
default: m(() => [
|
|
235
254
|
_("div", Ue, [
|
|
236
|
-
d(
|
|
255
|
+
d(a(xe), { class: "w-full h-full" }, {
|
|
237
256
|
default: m(() => [
|
|
238
|
-
|
|
239
|
-
d(
|
|
240
|
-
id:
|
|
257
|
+
A(t.$slots, "input", {}, () => [
|
|
258
|
+
d(a(Ve), {
|
|
259
|
+
id: a(C),
|
|
241
260
|
"display-value": P,
|
|
242
261
|
placeholder: e.placeholder ?? te.value,
|
|
243
262
|
"with-icon": e.withIcon,
|
|
@@ -245,8 +264,8 @@ const Be = { key: 0 }, Ue = { class: "relative flex items-center" }, Se = {
|
|
|
245
264
|
disabled: e.disabled,
|
|
246
265
|
error: h.value,
|
|
247
266
|
success: j.value,
|
|
248
|
-
class:
|
|
249
|
-
|
|
267
|
+
class: S(
|
|
268
|
+
a(F)(
|
|
250
269
|
"pr-20",
|
|
251
270
|
h.value || j.value ? "border-[#3E2E46]" : "",
|
|
252
271
|
e.inputClass
|
|
@@ -255,78 +274,78 @@ const Be = { key: 0 }, Ue = { class: "relative flex items-center" }, Se = {
|
|
|
255
274
|
maxlength: ee.value,
|
|
256
275
|
onInput: le,
|
|
257
276
|
onBlur: oe,
|
|
258
|
-
onFocus: l[0] || (l[0] = (
|
|
277
|
+
onFocus: l[0] || (l[0] = (r) => o("focus", r))
|
|
259
278
|
}, null, 8, ["id", "placeholder", "with-icon", "disabled", "error", "success", "class", "maxlength"])
|
|
260
279
|
])
|
|
261
280
|
]),
|
|
262
281
|
_: 3
|
|
263
282
|
}),
|
|
264
283
|
_("div", {
|
|
265
|
-
class:
|
|
284
|
+
class: S(["absolute right-9 flex items-center justify-center z-10 h-10 w-6", e.disabled ? "pointer-events-none opacity-40" : ""])
|
|
266
285
|
}, [
|
|
267
|
-
(h.value || e.modelValue && !j.value) && !e.disabled && e.withClearIcon ? (
|
|
286
|
+
(h.value || e.modelValue && !j.value) && !e.disabled && e.withClearIcon ? (i(), g("div", {
|
|
268
287
|
key: 0,
|
|
269
288
|
class: "flex items-center justify-center w-full h-full cursor-pointer",
|
|
270
|
-
onMousedown: l[1] || (l[1] = q((
|
|
289
|
+
onMousedown: l[1] || (l[1] = q((r) => !e.disabled && re(), ["stop", "prevent"])),
|
|
271
290
|
onClick: l[2] || (l[2] = q(() => {
|
|
272
291
|
}, ["stop", "prevent"]))
|
|
273
292
|
}, [
|
|
274
|
-
h.value ? (
|
|
293
|
+
h.value ? (i(), T(a(R), {
|
|
275
294
|
key: 0,
|
|
276
295
|
size: "20",
|
|
277
296
|
class: "text-[var(--alert-red-dark,#831511)] transition-opacity hover:opacity-80"
|
|
278
|
-
})) : (
|
|
297
|
+
})) : (i(), T(a(ve), {
|
|
279
298
|
key: 1,
|
|
280
299
|
size: "20",
|
|
281
300
|
class: "text-gray-400 transition-colors hover:text-[#831511]"
|
|
282
301
|
}))
|
|
283
|
-
], 32)) : j.value ? (
|
|
302
|
+
], 32)) : j.value ? (i(), T(a(ge), {
|
|
284
303
|
key: 1,
|
|
285
304
|
size: "20",
|
|
286
305
|
class: "text-[#4b715c] pointer-events-none"
|
|
287
|
-
})) :
|
|
306
|
+
})) : y("", !0)
|
|
288
307
|
], 2)
|
|
289
308
|
]),
|
|
290
|
-
|
|
291
|
-
d(
|
|
309
|
+
A(t.$slots, "list", {}, () => [
|
|
310
|
+
d(a(Ie), null, {
|
|
292
311
|
default: m(() => [
|
|
293
|
-
e.loading && (e.loadingText || t.$slots.loading) ? (
|
|
294
|
-
|
|
312
|
+
e.loading && (e.loadingText || t.$slots.loading) ? (i(), g("div", Se, [
|
|
313
|
+
A(t.$slots, "loading", {}, () => [
|
|
295
314
|
_("div", Ze, [
|
|
296
|
-
d(
|
|
297
|
-
_("span", null,
|
|
315
|
+
d(a(je), { class: "size-4 animate-spin" }),
|
|
316
|
+
_("span", null, k(e.loadingText), 1)
|
|
298
317
|
])
|
|
299
318
|
])
|
|
300
|
-
])) : !e.loading && (e.notFoundText || t.$slots.empty) ? (
|
|
319
|
+
])) : !e.loading && (e.notFoundText || t.$slots.empty) ? (i(), T(a(we), { key: 1 }, {
|
|
301
320
|
default: m(() => [
|
|
302
|
-
|
|
303
|
-
Z(
|
|
321
|
+
A(t.$slots, "empty", {}, () => [
|
|
322
|
+
Z(k(e.notFoundText), 1)
|
|
304
323
|
])
|
|
305
324
|
]),
|
|
306
325
|
_: 3
|
|
307
|
-
})) :
|
|
308
|
-
de(d(
|
|
326
|
+
})) : y("", !0),
|
|
327
|
+
de(d(a($e), null, {
|
|
309
328
|
default: m(() => [
|
|
310
|
-
d(
|
|
329
|
+
d(a(Ce), null, {
|
|
311
330
|
default: m(() => [
|
|
312
|
-
|
|
313
|
-
e.options && e.options.length ? (
|
|
314
|
-
key:
|
|
315
|
-
value:
|
|
331
|
+
A(t.$slots, "default", {}, () => [
|
|
332
|
+
e.options && e.options.length ? (i(!0), g(fe, { key: 0 }, me(e.options, (r, f) => (i(), T(a(be), {
|
|
333
|
+
key: r[e.optionId] || f,
|
|
334
|
+
value: r
|
|
316
335
|
}, {
|
|
317
336
|
default: m(() => [
|
|
318
|
-
|
|
319
|
-
Z(
|
|
337
|
+
A(t.$slots, "option", { item: r }, () => [
|
|
338
|
+
Z(k(r.text || r.label || r), 1)
|
|
320
339
|
]),
|
|
321
|
-
d(
|
|
340
|
+
d(a(_e), { class: "ml-auto" }, {
|
|
322
341
|
default: m(() => [
|
|
323
|
-
d(
|
|
342
|
+
d(a(ye), { size: "16" })
|
|
324
343
|
]),
|
|
325
344
|
_: 1
|
|
326
345
|
})
|
|
327
346
|
]),
|
|
328
347
|
_: 2
|
|
329
|
-
}, 1032, ["value"]))), 128)) :
|
|
348
|
+
}, 1032, ["value"]))), 128)) : y("", !0)
|
|
330
349
|
])
|
|
331
350
|
]),
|
|
332
351
|
_: 3
|
|
@@ -343,25 +362,25 @@ const Be = { key: 0 }, Ue = { class: "relative flex items-center" }, Se = {
|
|
|
343
362
|
]),
|
|
344
363
|
_: 3
|
|
345
364
|
}, 16, ["model-value", "searchTerm", "open"]),
|
|
346
|
-
e.description && !h.value ? (
|
|
365
|
+
e.description && !h.value ? (i(), g("div", {
|
|
347
366
|
key: 1,
|
|
348
367
|
id: K,
|
|
349
368
|
class: "text-gray-500 text-[11px] leading-tight"
|
|
350
|
-
},
|
|
351
|
-
typeof e.error == "string" && h.value ? (
|
|
369
|
+
}, k(e.description), 1)) : y("", !0),
|
|
370
|
+
typeof e.error == "string" && h.value ? (i(), g("div", {
|
|
352
371
|
key: 2,
|
|
353
372
|
id: G,
|
|
354
373
|
class: "text-[var(--alert-red-dark,#831511)] flex items-center gap-1 text-[11px] font-medium leading-tight pt-0.5"
|
|
355
374
|
}, [
|
|
356
|
-
d(
|
|
375
|
+
d(a(R), {
|
|
357
376
|
size: "14",
|
|
358
377
|
class: "text-[var(--alert-red-dark,#831511)] shrink-0"
|
|
359
378
|
}),
|
|
360
|
-
_("span", null,
|
|
361
|
-
])) :
|
|
379
|
+
_("span", null, k(e.error), 1)
|
|
380
|
+
])) : y("", !0)
|
|
362
381
|
], 2));
|
|
363
382
|
}
|
|
364
383
|
});
|
|
365
384
|
export {
|
|
366
|
-
|
|
385
|
+
rt as default
|
|
367
386
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agrotools1/at-components",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.0.
|
|
4
|
+
"version": "2.0.34",
|
|
5
5
|
"private": false,
|
|
6
6
|
"description": "Componentes da Agrotools - Versão 2 (com re-export da V1)",
|
|
7
7
|
"author": "Agrotools",
|
|
@@ -57,8 +57,8 @@
|
|
|
57
57
|
"tw-animate-css": "^1.3.4",
|
|
58
58
|
"vue-component-type-helpers": "^2.2.0",
|
|
59
59
|
"vue-sonner": "^2.0.8",
|
|
60
|
-
"@agrotools1/at-
|
|
61
|
-
"@agrotools1/at-
|
|
60
|
+
"@agrotools1/at-tailwind-config": "0.2.0",
|
|
61
|
+
"@agrotools1/at-icons": "1.0.13"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
64
|
"@internationalized/date": "^3.8.2",
|