@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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/changelog/versions/components/index.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAE9C,4EAA4E;AAC5E,eAAO,MAAM,kBAAkB,EAAE,WAAW,EAgB3C,CAAA"}
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,4 @@
1
+ import { VersionData } from '../../types';
2
+ declare const v2_0_33: VersionData;
3
+ export default v2_0_33;
4
+ //# sourceMappingURL=v2.0.33.d.ts.map
@@ -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":"AAmnBA,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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AC,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 U, createElementBlock as h, openBlock as n, normalizeClass as S, unref as r, createBlock as A, createCommentVNode as v, createVNode as f, withCtx as m, createTextVNode as z, toDisplayString as k, mergeProps as pe, createElementVNode as _, renderSlot as w, withModifiers as q, withDirectives as de, Fragment as fe, renderList as me, vShow as ge, nextTick as E } from "vue";
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 he } from "../packages/at-icons/dist/AtCheckCircleRegularIcon/index.js";
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 Ae } from "@vueuse/core";
8
- import { useForwardPropsEmits as ke } from "reka-ui";
9
- import we from "../combobox/Combobox.vue.js";
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 Te from "../combobox/ComboboxEmpty.vue.js";
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 T, applyCpfMask as O, applyCnpjMask as X } from "./utils.js";
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, s = J, C = e.id || ue(), G = `error-${C}`, K = `desc-${C}`, Q = Ae(
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 = ke(Q, s), i = y(""), V = y(!1), I = y(!1), L = y(!1), $ = y(null), M = y(e.modelValue);
80
- function Y(t, a) {
81
- if (!a) return t;
82
- const l = t.replace(/[^0-9A-Za-z]/g, "");
83
- if (!l) return "";
84
- let c = "", o = 0;
85
- for (let p = 0; p < a.length && o < l.length; p++) {
86
- const u = a[p], d = l[o];
87
- u === "9" ? /[0-9]/.test(d) ? (c += d, o++) : (o++, p--) : u === "A" ? /[A-Za-z]/.test(d) ? (c += e.toUpperCase ? d.toUpperCase() : d, o++) : (o++, p--) : u === "X" ? /[0-9A-Za-z]/.test(d) ? (c += e.toUpperCase ? d.toUpperCase() : d, o++) : (o++, p--) : (c += u, d === u && o++);
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 c;
89
+ return f;
90
90
  }
91
- function j(t) {
91
+ function L(t) {
92
92
  if (e.customMask && e.documentType === "generic")
93
93
  return Y(t, e.customMask);
94
- const a = /[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 && a || t.length > 11 ? X(t, e.allowAlpha) : O(t) : t;
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 c = t.replace(
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 j(c);
104
+ return L(l);
105
105
  }
106
- const l = (t.identifier || t.value || t.text || "").replace(
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 a = P(t);
120
- i.value !== a && (i.value = a);
115
+ const l = P(t);
116
+ i.value !== l && (i.value = l);
121
117
  },
122
118
  { immediate: !0 }
123
119
  );
124
- const ee = U(() => e.maxLength ? e.maxLength : e.customMask && e.documentType === "generic" ? e.customMask.length : e.documentType === "cpf" ? 14 : 18), te = U(() => {
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
- }), g = U(() => {
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 l = (typeof t == "string" ? t : t.identifier || t.value || "").replace(/[^A-Z0-9]/gi, "");
141
- if (!l) return !1;
142
- if (l.length === 11 && !x(l) || l.length === 14 && !T(l) || L.value && (e.documentType === "cpf" && l.length !== 11 || e.documentType === "cnpj" && l.length !== 14 || e.documentType === "cpf-cnpj" && l.length !== 11 && l.length !== 14))
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
- }), B = U(() => {
147
- if (g.value) return !1;
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 l = (typeof t == "string" ? t : t.identifier || t.value || "").replace(/[^A-Z0-9]/gi, "");
153
- if (e.documentType === "cpf") return x(l);
154
- if (e.documentType === "cnpj") return T(l);
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 l.length === 11 ? x(l) : T(l);
152
+ return a.length === 11 ? x(a) : w(a);
157
153
  }
158
154
  return !1;
159
155
  });
160
156
  function D(t) {
161
- let a = !1;
162
- e.documentType === "cpf" ? a = x(t) : e.documentType === "cnpj" ? a = T(t) : e.documentType === "cpf-cnpj" && (a = t.length === 11 ? x(t) : T(t)), s("validate", a);
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 a = t.target;
166
- let l = a.value;
167
- const c = a.selectionStart || 0;
168
- I.value = !1, e.toUpperCase && (l = l.toUpperCase());
169
- let o = l.replace(
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
- ), p = e.maxLength;
173
- p || (e.customMask && e.documentType === "generic" ? p = e.customMask.length : p = e.documentType === "cpf" ? 11 : 14), o = o.slice(0, p);
174
- const u = j(o), d = e.allowAlpha ? /[A-Z0-9]/gi : /[0-9]/g, ne = (l.slice(0, c).match(d) || []).length, se = (e.unmask ? o : u) || void 0;
175
- s("update:modelValue", se), D(o), i.value = u, E(() => {
176
- a.value = u;
177
- let Z = 0, N = 0;
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++, Z = b + 1, !(N >= ne)); b++)
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
- a.setSelectionRange(Z, Z);
176
+ l.setSelectionRange(S, S);
181
177
  });
182
178
  }
183
179
  function ae(t) {
184
- i.value = "", M.value = null, s("update:modelValue", null), E(() => {
180
+ i.value = "", o("update:searchTerm", ""), M.value = null, o("update:modelValue", null), z(() => {
185
181
  if (!$.value) return;
186
- const a = $.value.querySelector(`[id="${C}"]`) || $.value.querySelector("input"), l = (a == null ? void 0 : a.tagName) === "INPUT" ? a : a == null ? void 0 : a.querySelector("input");
187
- l && (l.value = "", l.dispatchEvent(new Event("input", { bubbles: !0 }))), E(() => {
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, s("validate", !1), s("clear"), V.value = !1;
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, s("update:modelValue", null);
190
+ i.value = "", o("update:searchTerm", ""), I.value = !0, o("update:modelValue", null);
195
191
  return;
196
192
  }
197
- s("update:modelValue", t), s("select", t);
198
- const l = (t.identifier || t.value || t.text || "").replace(/[^A-Z0-9]/gi, "");
199
- i.value = j(l), D(l), V.value = !1;
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
- L.value = !0, s("blur", t);
203
- const a = i.value.replace(e.allowAlpha ? /[^A-Z0-9]/gi : /[^0-9]/g, "");
204
- let l = !1;
205
- a.length === 11 ? l = x(a) : a.length === 14 && (l = T(a)), l && s("update:modelValue", e.toUpperCase ? a.toUpperCase() : a);
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, a) => (n(), h("div", {
208
- class: S(r(F)("space-y-1.5 w-full", e.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 ? (n(), A(r(Me), {
208
+ e.label ? (s(), k(r(Me), {
213
209
  key: 0,
214
210
  for: r(C),
215
- class: S(
211
+ class: U(
216
212
  r(F)(
217
213
  "text-[#101011] font-normal text-[10px] leading-[10px]",
218
- g.value ? "text-[var(--alert-red-dark,#831511)]" : ""
214
+ h.value ? "text-[var(--alert-red-dark,#831511)]" : ""
219
215
  )
220
216
  )
221
217
  }, {
222
218
  default: m(() => [
223
- z(k(e.label), 1),
224
- e.required && !e.label.includes("(Obrigatório)") ? (n(), h("span", Be, " (Obrigatório)")) : v("", !0)
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
- f(r(we), pe(r(W), {
224
+ d(r(Te), pe(r(W), {
229
225
  "model-value": M.value,
230
226
  searchTerm: i.value,
231
- "onUpdate:searchTerm": a[3] || (a[3] = (l) => i.value = l),
227
+ "onUpdate:searchTerm": l[3] || (l[3] = (a) => i.value = a),
232
228
  open: V.value,
233
- "onUpdate:open": a[4] || (a[4] = (l) => V.value = l),
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
- f(r(xe), { class: "w-full h-full" }, {
236
+ d(r(xe), { class: "w-full h-full" }, {
241
237
  default: m(() => [
242
- w(t.$slots, "input", {}, () => [
243
- f(r(Ve), {
238
+ T(t.$slots, "input", {}, () => [
239
+ d(r(Ve), {
244
240
  id: r(C),
245
241
  "display-value": P,
246
- placeholder: e.placeholder || te.value,
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: g.value,
251
- success: B.value,
252
- class: S(
246
+ error: h.value,
247
+ success: j.value,
248
+ class: U(
253
249
  r(F)(
254
250
  "pr-20",
255
- g.value || B.value ? "border-[#3E2E46]" : "",
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: a[0] || (a[0] = (l) => s("focus", l))
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: S(["absolute right-9 flex items-center justify-center z-10 h-10 w-6", e.disabled ? "pointer-events-none opacity-40" : ""])
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
- (g.value || e.modelValue && !B.value) && !e.disabled && e.withClearIcon ? (n(), h("div", {
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: a[1] || (a[1] = q((l) => !e.disabled && ae(), ["stop", "prevent"])),
275
- onClick: a[2] || (a[2] = q(() => {
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
- g.value ? (n(), A(r(R), {
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
- })) : (n(), A(r(ye), {
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)) : B.value ? (n(), A(r(he), {
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
- w(t.$slots, "list", {}, () => [
295
- f(r(Ie), null, {
290
+ T(t.$slots, "list", {}, () => [
291
+ d(r(Ie), null, {
296
292
  default: m(() => [
297
- e.loading && (e.loadingText || t.$slots.loading) ? (n(), h("div", Se, [
298
- w(t.$slots, "loading", {}, () => [
293
+ e.loading && (e.loadingText || t.$slots.loading) ? (s(), g("div", Se, [
294
+ T(t.$slots, "loading", {}, () => [
299
295
  _("div", Ze, [
300
- f(r(je), { class: "size-4 animate-spin" }),
301
- _("span", null, k(e.loadingText), 1)
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) ? (n(), A(r(Te), { key: 1 }, {
300
+ ])) : !e.loading && (e.notFoundText || t.$slots.empty) ? (s(), k(r(we), { key: 1 }, {
305
301
  default: m(() => [
306
- w(t.$slots, "empty", {}, () => [
307
- z(k(e.notFoundText), 1)
302
+ T(t.$slots, "empty", {}, () => [
303
+ Z(A(e.notFoundText), 1)
308
304
  ])
309
305
  ]),
310
306
  _: 3
311
307
  })) : v("", !0),
312
- de(f(r($e), null, {
308
+ de(d(r($e), null, {
313
309
  default: m(() => [
314
- f(r(Ce), null, {
310
+ d(r(Ce), null, {
315
311
  default: m(() => [
316
- w(t.$slots, "default", {}, () => [
317
- e.options && e.options.length ? (n(!0), h(fe, { key: 0 }, me(e.options, (l, c) => (n(), A(r(be), {
318
- key: l[e.optionId] || c,
319
- value: l
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
- w(t.$slots, "option", { item: l }, () => [
323
- z(k(l.text || l.label || l), 1)
318
+ T(t.$slots, "option", { item: a }, () => [
319
+ Z(A(a.text || a.label || a), 1)
324
320
  ]),
325
- f(r(_e), { class: "ml-auto" }, {
321
+ d(r(_e), { class: "ml-auto" }, {
326
322
  default: m(() => [
327
- f(r(ve), { size: "16" })
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
- [ge, !e.loading]
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 && !g.value ? (n(), h("div", {
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
- }, k(e.description), 1)) : v("", !0),
355
- typeof e.error == "string" && g.value ? (n(), h("div", {
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
- f(r(R), {
356
+ d(r(R), {
361
357
  size: "14",
362
358
  class: "text-[var(--alert-red-dark,#831511)] shrink-0"
363
359
  }),
364
- _("span", null, k(e.error), 1)
360
+ _("span", null, A(e.error), 1)
365
361
  ])) : v("", !0)
366
362
  ], 2));
367
363
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@agrotools1/at-components",
3
3
  "type": "module",
4
- "version": "2.0.32",
4
+ "version": "2.0.33",
5
5
  "private": false,
6
6
  "description": "Componentes da Agrotools - Versão 2 (com re-export da V1)",
7
7
  "author": "Agrotools",