@agrotools1/at-components 2.0.32 → 2.0.33
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.33.d.ts +4 -0
- package/dist/changelog/versions/components/v2.0.33.d.ts.map +1 -0
- package/dist/document-input/DocumentAutoComplete.vue.d.ts +2 -0
- package/dist/document-input/DocumentAutoComplete.vue.d.ts.map +1 -1
- package/dist/document-input/DocumentAutoComplete.vue.js +116 -120
- package/package.json +1 -1
|
@@ -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":"AAwBA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAE9C,4EAA4E;AAC5E,eAAO,MAAM,kBAAkB,EAAE,WAAW,EAkB3C,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"v2.0.33.d.ts","sourceRoot":"","sources":["../../../../src/changelog/versions/components/v2.0.33.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAE9C,QAAA,MAAM,OAAO,EAAE,WA4Bd,CAAA;AAED,eAAe,OAAO,CAAA"}
|
|
@@ -90,6 +90,7 @@ declare const __VLS_component: import('vue').DefineComponent<Props, {}, {}, {},
|
|
|
90
90
|
blur: (event: FocusEvent) => any;
|
|
91
91
|
focus: (event: FocusEvent) => any;
|
|
92
92
|
validate: (isValid: boolean) => any;
|
|
93
|
+
"update:searchTerm": (value: string) => any;
|
|
93
94
|
}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
|
|
94
95
|
onClear?: (() => any) | undefined;
|
|
95
96
|
"onUpdate:modelValue"?: ((value: any) => any) | undefined;
|
|
@@ -97,6 +98,7 @@ declare const __VLS_component: import('vue').DefineComponent<Props, {}, {}, {},
|
|
|
97
98
|
onBlur?: ((event: FocusEvent) => any) | undefined;
|
|
98
99
|
onFocus?: ((event: FocusEvent) => any) | undefined;
|
|
99
100
|
onValidate?: ((isValid: boolean) => any) | undefined;
|
|
101
|
+
"onUpdate:searchTerm"?: ((value: string) => any) | undefined;
|
|
100
102
|
}>, {
|
|
101
103
|
disabled: boolean;
|
|
102
104
|
toUpperCase: 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":"AAknBA,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,CAAA;IACtD,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;AAyXD,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;;;;;;;;;;;;;;;;;cA7zBR,OAAO;iBAeJ,OAAO;aARX,OAAO;WAFT,OAAO,GAAG,MAAM;cAuBb,OAAO;gBAnBL,OAAO;kBAjBL,KAAK,GAAG,MAAM,GAAG,UAAU,GAAG,SAAS;4BAsC7B,OAAO;YAVvB,OAAO;mBA4BA,OAAO;cALZ,MAAM;;;kBA4xBjB,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,14 +1,14 @@
|
|
|
1
|
-
import { defineComponent as ie, useId as ue, ref as y, watch as ce, computed as
|
|
1
|
+
import { defineComponent as ie, useId as ue, ref as y, watch as ce, computed as B, createElementBlock as g, openBlock as s, normalizeClass as U, unref as r, createBlock as k, createCommentVNode as v, createVNode as d, withCtx as m, createTextVNode as Z, toDisplayString as A, mergeProps as pe, createElementVNode as _, renderSlot as T, 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
|
-
import { AtCheckCircleRegularIcon as
|
|
3
|
+
import { AtCheckCircleRegularIcon as ge } from "../packages/at-icons/dist/AtCheckCircleRegularIcon/index.js";
|
|
4
4
|
import { AtCheckSolidIcon as ve } from "../packages/at-icons/dist/AtCheckSolidIcon/index.js";
|
|
5
5
|
import { AtCircleXMarkRegularIcon as ye } 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 ke } from "@vueuse/core";
|
|
8
|
+
import { useForwardPropsEmits as Ae } from "reka-ui";
|
|
9
|
+
import Te from "../combobox/Combobox.vue.js";
|
|
10
10
|
import xe from "../combobox/ComboboxAnchor.vue.js";
|
|
11
|
-
import
|
|
11
|
+
import we from "../combobox/ComboboxEmpty.vue.js";
|
|
12
12
|
import Ce from "../combobox/ComboboxGroup.vue.js";
|
|
13
13
|
import Ve from "../combobox/ComboboxInput.vue.js";
|
|
14
14
|
import be from "../combobox/ComboboxItem.vue.js";
|
|
@@ -16,7 +16,7 @@ import _e from "../combobox/ComboboxItemIndicator.vue.js";
|
|
|
16
16
|
import Ie from "../combobox/ComboboxList.vue.js";
|
|
17
17
|
import $e from "../combobox/ComboboxViewport.vue.js";
|
|
18
18
|
import Me from "../label/Label.vue.js";
|
|
19
|
-
import { isValidCpf as x, isValidCnpj as
|
|
19
|
+
import { isValidCpf as x, isValidCnpj as w, applyCpfMask as O, applyCnpjMask as X } from "./utils.js";
|
|
20
20
|
import je from "../node_modules/.pnpm/lucide-vue-next@0.542.0_vue@3.5.19_typescript@5.8.3_/node_modules/lucide-vue-next/dist/esm/icons/loader-circle.js";
|
|
21
21
|
const Be = { key: 0 }, Ue = { class: "relative flex items-center" }, Se = {
|
|
22
22
|
key: 0,
|
|
@@ -50,9 +50,9 @@ const Be = { key: 0 }, Ue = { class: "relative flex items-center" }, Se = {
|
|
|
50
50
|
optionId: { default: "identifier" },
|
|
51
51
|
withClearIcon: { type: Boolean, default: !0 }
|
|
52
52
|
},
|
|
53
|
-
emits: ["update:modelValue", "select", "validate", "blur", "focus", "clear"],
|
|
53
|
+
emits: ["update:modelValue", "update:searchTerm", "select", "validate", "blur", "focus", "clear"],
|
|
54
54
|
setup(H, { emit: J }) {
|
|
55
|
-
const e = H,
|
|
55
|
+
const e = H, o = J, C = e.id || ue(), G = `error-${C}`, K = `desc-${C}`, Q = ke(
|
|
56
56
|
e,
|
|
57
57
|
"modelValue",
|
|
58
58
|
"documentType",
|
|
@@ -76,38 +76,34 @@ const Be = { key: 0 }, Ue = { class: "relative flex items-center" }, Se = {
|
|
|
76
76
|
"loadingText",
|
|
77
77
|
"optionId",
|
|
78
78
|
"modelValue"
|
|
79
|
-
), W =
|
|
80
|
-
function Y(t,
|
|
81
|
-
if (!
|
|
82
|
-
const
|
|
83
|
-
if (!
|
|
84
|
-
let
|
|
85
|
-
for (let
|
|
86
|
-
const u =
|
|
87
|
-
u === "9" ? /[0-9]/.test(
|
|
79
|
+
), W = Ae(Q, o), i = y(""), V = y(!1), I = y(!1), E = y(!1), $ = y(null), M = y(e.modelValue);
|
|
80
|
+
function Y(t, l) {
|
|
81
|
+
if (!l) return t;
|
|
82
|
+
const a = t.replace(/[^0-9A-Za-z]/g, "");
|
|
83
|
+
if (!a) return "";
|
|
84
|
+
let f = "", n = 0;
|
|
85
|
+
for (let c = 0; c < l.length && n < a.length; c++) {
|
|
86
|
+
const u = l[c], p = a[n];
|
|
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
|
-
return
|
|
89
|
+
return f;
|
|
90
90
|
}
|
|
91
|
-
function
|
|
91
|
+
function L(t) {
|
|
92
92
|
if (e.customMask && e.documentType === "generic")
|
|
93
93
|
return Y(t, e.customMask);
|
|
94
|
-
const
|
|
95
|
-
return e.documentType === "cpf" ? O(t) : e.documentType === "cnpj" ? X(t, e.allowAlpha) : e.documentType === "cpf-cnpj" ? e.allowAlpha &&
|
|
94
|
+
const l = /[A-Z]/i.test(t);
|
|
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
98
|
if (!t) return i.value || "";
|
|
99
99
|
if (typeof t == "string") {
|
|
100
|
-
const
|
|
100
|
+
const l = t.replace(
|
|
101
101
|
e.documentType === "generic" && e.customMask || e.allowAlpha ? /[^A-Z0-9]/gi : /[^0-9]/g,
|
|
102
102
|
""
|
|
103
103
|
);
|
|
104
|
-
return
|
|
104
|
+
return L(l);
|
|
105
105
|
}
|
|
106
|
-
|
|
107
|
-
e.documentType === "generic" && e.customMask || e.allowAlpha ? /[^A-Z0-9]/gi : /[^0-9]/g,
|
|
108
|
-
""
|
|
109
|
-
);
|
|
110
|
-
return j(l);
|
|
106
|
+
return t.text || t.label || t.identifier || t.value || "";
|
|
111
107
|
};
|
|
112
108
|
ce(
|
|
113
109
|
() => e.modelValue,
|
|
@@ -116,12 +112,12 @@ const Be = { key: 0 }, Ue = { class: "relative flex items-center" }, Se = {
|
|
|
116
112
|
i.value !== "" && (i.value = ""), M.value = void 0;
|
|
117
113
|
return;
|
|
118
114
|
}
|
|
119
|
-
const
|
|
120
|
-
i.value !==
|
|
115
|
+
const l = P(t);
|
|
116
|
+
i.value !== l && (i.value = l);
|
|
121
117
|
},
|
|
122
118
|
{ immediate: !0 }
|
|
123
119
|
);
|
|
124
|
-
const ee =
|
|
120
|
+
const ee = B(() => e.maxLength ? e.maxLength : e.customMask && e.documentType === "generic" ? e.customMask.length : e.documentType === "cpf" ? 14 : 18), te = B(() => {
|
|
125
121
|
switch (e.documentType) {
|
|
126
122
|
case "cnpj":
|
|
127
123
|
return e.allowAlpha ? "AA.AAA.AAA/AAAA-DV" : "00.000.000/0000-00";
|
|
@@ -132,199 +128,199 @@ const Be = { key: 0 }, Ue = { class: "relative flex items-center" }, Se = {
|
|
|
132
128
|
default:
|
|
133
129
|
return;
|
|
134
130
|
}
|
|
135
|
-
}),
|
|
131
|
+
}), h = B(() => {
|
|
136
132
|
if (e.error) return !0;
|
|
137
133
|
if (e.withInternalValidation) {
|
|
138
134
|
const t = e.modelValue;
|
|
139
135
|
if (!t || I.value) return !1;
|
|
140
|
-
const
|
|
141
|
-
if (!
|
|
142
|
-
if (
|
|
136
|
+
const a = (typeof t == "string" ? t : t.identifier || t.value || "").replace(/[^A-Z0-9]/gi, "");
|
|
137
|
+
if (!a) return !1;
|
|
138
|
+
if (a.length === 11 && !x(a) || a.length === 14 && !w(a) || E.value && (e.documentType === "cpf" && a.length !== 11 || e.documentType === "cnpj" && a.length !== 14 || e.documentType === "cpf-cnpj" && a.length !== 11 && a.length !== 14))
|
|
143
139
|
return !0;
|
|
144
140
|
}
|
|
145
141
|
return !1;
|
|
146
|
-
}),
|
|
147
|
-
if (
|
|
142
|
+
}), j = B(() => {
|
|
143
|
+
if (h.value) return !1;
|
|
148
144
|
if (e.success) return !0;
|
|
149
145
|
if (e.withInternalValidation) {
|
|
150
146
|
const t = e.modelValue;
|
|
151
147
|
if (!t) return !1;
|
|
152
|
-
const
|
|
153
|
-
if (e.documentType === "cpf") return x(
|
|
154
|
-
if (e.documentType === "cnpj") return
|
|
148
|
+
const a = (typeof t == "string" ? t : t.identifier || t.value || "").replace(/[^A-Z0-9]/gi, "");
|
|
149
|
+
if (e.documentType === "cpf") return x(a);
|
|
150
|
+
if (e.documentType === "cnpj") return w(a);
|
|
155
151
|
if (e.documentType === "cpf-cnpj")
|
|
156
|
-
return
|
|
152
|
+
return a.length === 11 ? x(a) : w(a);
|
|
157
153
|
}
|
|
158
154
|
return !1;
|
|
159
155
|
});
|
|
160
156
|
function D(t) {
|
|
161
|
-
let
|
|
162
|
-
e.documentType === "cpf" ?
|
|
157
|
+
let l = !1;
|
|
158
|
+
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);
|
|
163
159
|
}
|
|
164
160
|
function le(t) {
|
|
165
|
-
const
|
|
166
|
-
let
|
|
167
|
-
const
|
|
168
|
-
I.value = !1, e.toUpperCase && (
|
|
169
|
-
let
|
|
161
|
+
const l = t.target;
|
|
162
|
+
let a = l.value;
|
|
163
|
+
const f = l.selectionStart || 0;
|
|
164
|
+
I.value = !1, e.toUpperCase && (a = a.toUpperCase());
|
|
165
|
+
let n = a.replace(
|
|
170
166
|
e.documentType === "generic" && e.customMask || e.allowAlpha ? /[^A-Z0-9]/gi : /[^0-9]/g,
|
|
171
167
|
""
|
|
172
|
-
),
|
|
173
|
-
|
|
174
|
-
const u =
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
let
|
|
178
|
-
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++,
|
|
168
|
+
), c = e.maxLength;
|
|
169
|
+
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 = (a.slice(0, f).match(p) || []).length, se = (e.unmask ? n : u) || void 0;
|
|
171
|
+
o("update:modelValue", se), o("update:searchTerm", n), D(n), i.value = u, z(() => {
|
|
172
|
+
l.value = u;
|
|
173
|
+
let S = 0, N = 0;
|
|
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++, S = b + 1, !(N >= ne)); b++)
|
|
179
175
|
;
|
|
180
|
-
|
|
176
|
+
l.setSelectionRange(S, S);
|
|
181
177
|
});
|
|
182
178
|
}
|
|
183
179
|
function ae(t) {
|
|
184
|
-
i.value = "", M.value = null,
|
|
180
|
+
i.value = "", o("update:searchTerm", ""), M.value = null, o("update:modelValue", null), z(() => {
|
|
185
181
|
if (!$.value) return;
|
|
186
|
-
const
|
|
187
|
-
|
|
182
|
+
const l = $.value.querySelector(`[id="${C}"]`) || $.value.querySelector("input"), a = (l == null ? void 0 : l.tagName) === "INPUT" ? l : l == null ? void 0 : l.querySelector("input");
|
|
183
|
+
a && (a.value = "", a.dispatchEvent(new Event("input", { bubbles: !0 }))), z(() => {
|
|
188
184
|
V.value = !1;
|
|
189
185
|
});
|
|
190
|
-
}), I.value = !0,
|
|
186
|
+
}), I.value = !0, o("validate", !1), o("clear"), V.value = !1;
|
|
191
187
|
}
|
|
192
188
|
function re(t) {
|
|
193
189
|
if (!t) {
|
|
194
|
-
i.value = "", I.value = !0,
|
|
190
|
+
i.value = "", o("update:searchTerm", ""), I.value = !0, o("update:modelValue", null);
|
|
195
191
|
return;
|
|
196
192
|
}
|
|
197
|
-
|
|
198
|
-
const l = (t.identifier || t.value ||
|
|
199
|
-
|
|
193
|
+
o("update:modelValue", t), o("select", t), i.value = t.text || t.label || t.identifier || t.value || "";
|
|
194
|
+
const l = (t.identifier || t.value || "").replace(/[^A-Z0-9]/gi, "");
|
|
195
|
+
o("update:searchTerm", l), D(l), V.value = !1;
|
|
200
196
|
}
|
|
201
197
|
function oe(t) {
|
|
202
|
-
|
|
203
|
-
const
|
|
204
|
-
let
|
|
205
|
-
|
|
198
|
+
E.value = !0, o("blur", t);
|
|
199
|
+
const l = i.value.replace(e.allowAlpha ? /[^A-Z0-9]/gi : /[^0-9]/g, "");
|
|
200
|
+
let a = !1;
|
|
201
|
+
l.length === 11 ? a = x(l) : l.length === 14 && (a = w(l)), a && o("update:modelValue", e.toUpperCase ? l.toUpperCase() : l);
|
|
206
202
|
}
|
|
207
|
-
return (t,
|
|
208
|
-
class:
|
|
203
|
+
return (t, l) => (s(), g("div", {
|
|
204
|
+
class: U(r(F)("space-y-1.5 w-full", e.class)),
|
|
209
205
|
ref_key: "wrapperRef",
|
|
210
206
|
ref: $
|
|
211
207
|
}, [
|
|
212
|
-
e.label ? (
|
|
208
|
+
e.label ? (s(), k(r(Me), {
|
|
213
209
|
key: 0,
|
|
214
210
|
for: r(C),
|
|
215
|
-
class:
|
|
211
|
+
class: U(
|
|
216
212
|
r(F)(
|
|
217
213
|
"text-[#101011] font-normal text-[10px] leading-[10px]",
|
|
218
|
-
|
|
214
|
+
h.value ? "text-[var(--alert-red-dark,#831511)]" : ""
|
|
219
215
|
)
|
|
220
216
|
)
|
|
221
217
|
}, {
|
|
222
218
|
default: m(() => [
|
|
223
|
-
|
|
224
|
-
e.required && !e.label.includes("(Obrigatório)") ? (
|
|
219
|
+
Z(A(e.label), 1),
|
|
220
|
+
e.required && !e.label.includes("(Obrigatório)") ? (s(), g("span", Be, " (Obrigatório)")) : v("", !0)
|
|
225
221
|
]),
|
|
226
222
|
_: 1
|
|
227
223
|
}, 8, ["for", "class"])) : v("", !0),
|
|
228
|
-
|
|
224
|
+
d(r(Te), pe(r(W), {
|
|
229
225
|
"model-value": M.value,
|
|
230
226
|
searchTerm: i.value,
|
|
231
|
-
"onUpdate:searchTerm":
|
|
227
|
+
"onUpdate:searchTerm": l[3] || (l[3] = (a) => i.value = a),
|
|
232
228
|
open: V.value,
|
|
233
|
-
"onUpdate:open":
|
|
229
|
+
"onUpdate:open": l[4] || (l[4] = (a) => V.value = a),
|
|
234
230
|
"reset-search-term-on-select": !1,
|
|
235
231
|
"filter-function": () => !0,
|
|
236
232
|
"onUpdate:modelValue": re
|
|
237
233
|
}), {
|
|
238
234
|
default: m(() => [
|
|
239
235
|
_("div", Ue, [
|
|
240
|
-
|
|
236
|
+
d(r(xe), { class: "w-full h-full" }, {
|
|
241
237
|
default: m(() => [
|
|
242
|
-
|
|
243
|
-
|
|
238
|
+
T(t.$slots, "input", {}, () => [
|
|
239
|
+
d(r(Ve), {
|
|
244
240
|
id: r(C),
|
|
245
241
|
"display-value": P,
|
|
246
|
-
placeholder: e.placeholder
|
|
242
|
+
placeholder: e.placeholder ?? te.value,
|
|
247
243
|
"with-icon": e.withIcon,
|
|
248
244
|
"with-clear-button": !1,
|
|
249
245
|
disabled: e.disabled,
|
|
250
|
-
error:
|
|
251
|
-
success:
|
|
252
|
-
class:
|
|
246
|
+
error: h.value,
|
|
247
|
+
success: j.value,
|
|
248
|
+
class: U(
|
|
253
249
|
r(F)(
|
|
254
250
|
"pr-20",
|
|
255
|
-
|
|
251
|
+
h.value || j.value ? "border-[#3E2E46]" : "",
|
|
256
252
|
e.inputClass
|
|
257
253
|
)
|
|
258
254
|
),
|
|
259
255
|
maxlength: ee.value,
|
|
260
256
|
onInput: le,
|
|
261
257
|
onBlur: oe,
|
|
262
|
-
onFocus:
|
|
258
|
+
onFocus: l[0] || (l[0] = (a) => o("focus", a))
|
|
263
259
|
}, null, 8, ["id", "placeholder", "with-icon", "disabled", "error", "success", "class", "maxlength"])
|
|
264
260
|
])
|
|
265
261
|
]),
|
|
266
262
|
_: 3
|
|
267
263
|
}),
|
|
268
264
|
_("div", {
|
|
269
|
-
class:
|
|
265
|
+
class: U(["absolute right-9 flex items-center justify-center z-10 h-10 w-6", e.disabled ? "pointer-events-none opacity-40" : ""])
|
|
270
266
|
}, [
|
|
271
|
-
(
|
|
267
|
+
(h.value || e.modelValue && !j.value) && !e.disabled && e.withClearIcon ? (s(), g("div", {
|
|
272
268
|
key: 0,
|
|
273
269
|
class: "flex items-center justify-center w-full h-full cursor-pointer",
|
|
274
|
-
onMousedown:
|
|
275
|
-
onClick:
|
|
270
|
+
onMousedown: l[1] || (l[1] = q((a) => !e.disabled && ae(), ["stop", "prevent"])),
|
|
271
|
+
onClick: l[2] || (l[2] = q(() => {
|
|
276
272
|
}, ["stop", "prevent"]))
|
|
277
273
|
}, [
|
|
278
|
-
|
|
274
|
+
h.value ? (s(), k(r(R), {
|
|
279
275
|
key: 0,
|
|
280
276
|
size: "20",
|
|
281
277
|
class: "text-[var(--alert-red-dark,#831511)] transition-opacity hover:opacity-80"
|
|
282
|
-
})) : (
|
|
278
|
+
})) : (s(), k(r(ye), {
|
|
283
279
|
key: 1,
|
|
284
280
|
size: "20",
|
|
285
281
|
class: "text-gray-400 transition-colors hover:text-[#831511]"
|
|
286
282
|
}))
|
|
287
|
-
], 32)) :
|
|
283
|
+
], 32)) : j.value ? (s(), k(r(ge), {
|
|
288
284
|
key: 1,
|
|
289
285
|
size: "20",
|
|
290
286
|
class: "text-[#4b715c] pointer-events-none"
|
|
291
287
|
})) : v("", !0)
|
|
292
288
|
], 2)
|
|
293
289
|
]),
|
|
294
|
-
|
|
295
|
-
|
|
290
|
+
T(t.$slots, "list", {}, () => [
|
|
291
|
+
d(r(Ie), null, {
|
|
296
292
|
default: m(() => [
|
|
297
|
-
e.loading && (e.loadingText || t.$slots.loading) ? (
|
|
298
|
-
|
|
293
|
+
e.loading && (e.loadingText || t.$slots.loading) ? (s(), g("div", Se, [
|
|
294
|
+
T(t.$slots, "loading", {}, () => [
|
|
299
295
|
_("div", Ze, [
|
|
300
|
-
|
|
301
|
-
_("span", null,
|
|
296
|
+
d(r(je), { class: "size-4 animate-spin" }),
|
|
297
|
+
_("span", null, A(e.loadingText), 1)
|
|
302
298
|
])
|
|
303
299
|
])
|
|
304
|
-
])) : !e.loading && (e.notFoundText || t.$slots.empty) ? (
|
|
300
|
+
])) : !e.loading && (e.notFoundText || t.$slots.empty) ? (s(), k(r(we), { key: 1 }, {
|
|
305
301
|
default: m(() => [
|
|
306
|
-
|
|
307
|
-
|
|
302
|
+
T(t.$slots, "empty", {}, () => [
|
|
303
|
+
Z(A(e.notFoundText), 1)
|
|
308
304
|
])
|
|
309
305
|
]),
|
|
310
306
|
_: 3
|
|
311
307
|
})) : v("", !0),
|
|
312
|
-
de(
|
|
308
|
+
de(d(r($e), null, {
|
|
313
309
|
default: m(() => [
|
|
314
|
-
|
|
310
|
+
d(r(Ce), null, {
|
|
315
311
|
default: m(() => [
|
|
316
|
-
|
|
317
|
-
e.options && e.options.length ? (
|
|
318
|
-
key:
|
|
319
|
-
value:
|
|
312
|
+
T(t.$slots, "default", {}, () => [
|
|
313
|
+
e.options && e.options.length ? (s(!0), g(fe, { key: 0 }, me(e.options, (a, f) => (s(), k(r(be), {
|
|
314
|
+
key: a[e.optionId] || f,
|
|
315
|
+
value: a
|
|
320
316
|
}, {
|
|
321
317
|
default: m(() => [
|
|
322
|
-
|
|
323
|
-
|
|
318
|
+
T(t.$slots, "option", { item: a }, () => [
|
|
319
|
+
Z(A(a.text || a.label || a), 1)
|
|
324
320
|
]),
|
|
325
|
-
|
|
321
|
+
d(r(_e), { class: "ml-auto" }, {
|
|
326
322
|
default: m(() => [
|
|
327
|
-
|
|
323
|
+
d(r(ve), { size: "16" })
|
|
328
324
|
]),
|
|
329
325
|
_: 1
|
|
330
326
|
})
|
|
@@ -338,7 +334,7 @@ const Be = { key: 0 }, Ue = { class: "relative flex items-center" }, Se = {
|
|
|
338
334
|
]),
|
|
339
335
|
_: 3
|
|
340
336
|
}, 512), [
|
|
341
|
-
[
|
|
337
|
+
[he, !e.loading]
|
|
342
338
|
])
|
|
343
339
|
]),
|
|
344
340
|
_: 3
|
|
@@ -347,21 +343,21 @@ const Be = { key: 0 }, Ue = { class: "relative flex items-center" }, Se = {
|
|
|
347
343
|
]),
|
|
348
344
|
_: 3
|
|
349
345
|
}, 16, ["model-value", "searchTerm", "open"]),
|
|
350
|
-
e.description && !
|
|
346
|
+
e.description && !h.value ? (s(), g("div", {
|
|
351
347
|
key: 1,
|
|
352
348
|
id: K,
|
|
353
349
|
class: "text-gray-500 text-[11px] leading-tight"
|
|
354
|
-
},
|
|
355
|
-
typeof e.error == "string" &&
|
|
350
|
+
}, A(e.description), 1)) : v("", !0),
|
|
351
|
+
typeof e.error == "string" && h.value ? (s(), g("div", {
|
|
356
352
|
key: 2,
|
|
357
353
|
id: G,
|
|
358
354
|
class: "text-[var(--alert-red-dark,#831511)] flex items-center gap-1 text-[11px] font-medium leading-tight pt-0.5"
|
|
359
355
|
}, [
|
|
360
|
-
|
|
356
|
+
d(r(R), {
|
|
361
357
|
size: "14",
|
|
362
358
|
class: "text-[var(--alert-red-dark,#831511)] shrink-0"
|
|
363
359
|
}),
|
|
364
|
-
_("span", null,
|
|
360
|
+
_("span", null, A(e.error), 1)
|
|
365
361
|
])) : v("", !0)
|
|
366
362
|
], 2));
|
|
367
363
|
}
|