@caipira/tamandua 0.0.60 → 0.0.62

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 (44) hide show
  1. package/dist/ChartTreemap.js +2 -2
  2. package/dist/{ChartTreemap.vue_vue_type_script_setup_true_lang-B7eDxuIH.js → ChartTreemap.vue_vue_type_script_setup_true_lang-DKaI62CD.js} +48 -49
  3. package/dist/InputPrice.js +2 -2
  4. package/dist/{InputPrice.vue_vue_type_script_setup_true_lang-C2wDVwnm.js → InputPrice.vue_vue_type_script_setup_true_lang-R3kHhxN2.js} +20 -20
  5. package/dist/InputSelect.js +2 -2
  6. package/dist/{InputSelect.vue_vue_type_script_setup_true_lang-DgMRjecc.js → InputSelect.vue_vue_type_script_setup_true_lang-W2S_TcOu.js} +79 -78
  7. package/dist/components.js +3 -3
  8. package/dist/date.js +170 -354
  9. package/dist/{plugin-D8EMKVQ9.js → plugin-B97_3CZA.js} +1 -1
  10. package/dist/{plugin-fGlPPiqA.js → plugin-CZiSoM73.js} +1 -1
  11. package/dist/{plugin-CQ-FpZui.js → plugin-RM2wZuwL.js} +1 -1
  12. package/dist/{plugins-CpDwnGUh.js → plugins-DD6fcgTJ.js} +4 -4
  13. package/dist/plugins.js +4 -4
  14. package/dist/tamandua.js +1 -1
  15. package/dist/types/components/Avatar/Avatar.vue.d.ts +2 -2
  16. package/dist/types/components/Button/Button.vue.d.ts +13 -11
  17. package/dist/types/components/ChartLine/ChartLine.vue.d.ts +2 -2
  18. package/dist/types/components/ChartTreemap/ChartTreemap.story.d.ts +0 -1
  19. package/dist/types/components/ChartTreemap/types.d.ts +4 -7
  20. package/dist/types/components/Drawer/Drawer.vue.d.ts +8 -6
  21. package/dist/types/components/Dropdown/Dropdown.vue.d.ts +33 -31
  22. package/dist/types/components/Form/Form.vue.d.ts +8 -76
  23. package/dist/types/components/FormItem/FormItem.vue.d.ts +4 -2
  24. package/dist/types/components/GraphyLabel/GraphyLabel.vue.d.ts +4 -2
  25. package/dist/types/components/GraphyPrice/GraphyPrice.vue.d.ts +1 -1
  26. package/dist/types/components/Icon/Icon.vue.d.ts +1 -1
  27. package/dist/types/components/InputPrice/service.d.ts +1 -1
  28. package/dist/types/components/InputPrice/types.d.ts +1 -1
  29. package/dist/types/components/InputRadio/InputRadioGroup.vue.d.ts +6 -4
  30. package/dist/types/components/InputSelect/InputSelect.vue.d.ts +35 -33
  31. package/dist/types/components/Link/Link.vue.d.ts +7 -5
  32. package/dist/types/components/Modal/Modal.vue.d.ts +8 -6
  33. package/dist/types/components/ModalForm/ModalForm.vue.d.ts +7 -5
  34. package/dist/types/components/Pagination/Pagination.vue.d.ts +1 -1
  35. package/dist/types/components/Popconfirm/Popconfirm.vue.d.ts +9 -7
  36. package/dist/types/components/Popover/Popover.vue.d.ts +4 -4
  37. package/dist/types/components/ProgressCircle/ProgressCircle.vue.d.ts +6 -4
  38. package/dist/types/components/ProgressLine/ProgressLine.vue.d.ts +6 -4
  39. package/dist/types/components/SensitiveInfo/SensitiveInfo.vue.d.ts +4 -2
  40. package/dist/types/components/Tab/Tab.vue.d.ts +4 -2
  41. package/dist/types/components/Table/Table.vue.d.ts +12 -73
  42. package/dist/types/components/Tag/Tag.vue.d.ts +6 -4
  43. package/dist/types/services/date.d.ts +2 -2
  44. package/package.json +14 -14
@@ -1,5 +1,5 @@
1
- import { _ as e } from "./ChartTreemap.vue_vue_type_script_setup_true_lang-B7eDxuIH.js";
2
- import { p as m } from "./plugin-D8EMKVQ9.js";
1
+ import { _ as e } from "./ChartTreemap.vue_vue_type_script_setup_true_lang-DKaI62CD.js";
2
+ import { p as m } from "./plugin-B97_3CZA.js";
3
3
  export {
4
4
  e as ChartTreemap,
5
5
  m as ChartTreemapPlugin
@@ -20,18 +20,18 @@ function Q(e, t) {
20
20
  return this;
21
21
  }
22
22
  function U(e, t) {
23
- for (var r = this, a = [r], i, o, l = -1; r = a.pop(); )
24
- if (e.call(t, r, ++l, this), i = r.children)
25
- for (o = i.length - 1; o >= 0; --o)
26
- a.push(i[o]);
23
+ for (var r = this, a = [r], o, i, l = -1; r = a.pop(); )
24
+ if (e.call(t, r, ++l, this), o = r.children)
25
+ for (i = o.length - 1; i >= 0; --i)
26
+ a.push(o[i]);
27
27
  return this;
28
28
  }
29
29
  function ee(e, t) {
30
- for (var r = this, a = [r], i = [], o, l, u, d = -1; r = a.pop(); )
31
- if (i.push(r), o = r.children)
32
- for (l = 0, u = o.length; l < u; ++l)
33
- a.push(o[l]);
34
- for (; r = i.pop(); )
30
+ for (var r = this, a = [r], o = [], i, l, u, d = -1; r = a.pop(); )
31
+ if (o.push(r), i = r.children)
32
+ for (l = 0, u = i.length; l < u; ++l)
33
+ a.push(i[l]);
34
+ for (; r = o.pop(); )
35
35
  e.call(t, r, ++d, this);
36
36
  return this;
37
37
  }
@@ -43,8 +43,8 @@ function te(e, t) {
43
43
  }
44
44
  function ne(e) {
45
45
  return this.eachAfter(function(t) {
46
- for (var r = +e(t.data) || 0, a = t.children, i = a && a.length; --i >= 0; )
47
- r += a[i].value;
46
+ for (var r = +e(t.data) || 0, a = t.children, o = a && a.length; --o >= 0; )
47
+ r += a[o].value;
48
48
  t.value = r;
49
49
  });
50
50
  }
@@ -56,17 +56,17 @@ function re(e) {
56
56
  function ae(e) {
57
57
  for (var t = this, r = oe(t, e), a = [t]; t !== r; )
58
58
  t = t.parent, a.push(t);
59
- for (var i = a.length; e !== r; )
60
- a.splice(i, 0, e), e = e.parent;
59
+ for (var o = a.length; e !== r; )
60
+ a.splice(o, 0, e), e = e.parent;
61
61
  return a;
62
62
  }
63
63
  function oe(e, t) {
64
64
  if (e === t)
65
65
  return e;
66
- var r = e.ancestors(), a = t.ancestors(), i = null;
66
+ var r = e.ancestors(), a = t.ancestors(), o = null;
67
67
  for (e = r.pop(), t = a.pop(); e === t; )
68
- i = e, e = r.pop(), t = a.pop();
69
- return i;
68
+ o = e, e = r.pop(), t = a.pop();
69
+ return o;
70
70
  }
71
71
  function ie() {
72
72
  for (var e = this, t = [e]; e = e.parent; )
@@ -89,20 +89,20 @@ function se() {
89
89
  }), t;
90
90
  }
91
91
  function* ce() {
92
- var e = this, t, r = [e], a, i, o;
92
+ var e = this, t, r = [e], a, o, i;
93
93
  do
94
94
  for (t = r.reverse(), r = []; e = t.pop(); )
95
95
  if (yield e, a = e.children)
96
- for (i = 0, o = a.length; i < o; ++i)
97
- r.push(a[i]);
96
+ for (o = 0, i = a.length; o < i; ++o)
97
+ r.push(a[o]);
98
98
  while (r.length);
99
99
  }
100
100
  function $(e, t) {
101
101
  e instanceof Map ? (e = [void 0, e], t === void 0 && (t = he)) : t === void 0 && (t = de);
102
- for (var r = new C(e), a, i = [r], o, l, u, d; a = i.pop(); )
102
+ for (var r = new C(e), a, o = [r], i, l, u, d; a = o.pop(); )
103
103
  if ((l = t(a.data)) && (d = (l = Array.from(l)).length))
104
104
  for (a.children = l, u = d - 1; u >= 0; --u)
105
- i.push(o = l[u] = new C(l[u])), o.parent = a, o.depth = a.depth + 1;
105
+ o.push(i = l[u] = new C(l[u])), i.parent = a, i.depth = a.depth + 1;
106
106
  return r.eachBefore(ge);
107
107
  }
108
108
  function fe() {
@@ -159,18 +159,18 @@ function S(e) {
159
159
  function me(e) {
160
160
  e.x0 = Math.round(e.x0), e.y0 = Math.round(e.y0), e.x1 = Math.round(e.x1), e.y1 = Math.round(e.y1);
161
161
  }
162
- function ye(e, t, r, a, i) {
163
- for (var o = e.children, l, u = -1, d = o.length, m = e.value && (a - t) / e.value; ++u < d; )
164
- l = o[u], l.y0 = r, l.y1 = i, l.x0 = t, l.x1 = t += l.value * m;
162
+ function ye(e, t, r, a, o) {
163
+ for (var i = e.children, l, u = -1, d = i.length, m = e.value && (a - t) / e.value; ++u < d; )
164
+ l = i[u], l.y0 = r, l.y1 = o, l.x0 = t, l.x1 = t += l.value * m;
165
165
  }
166
- function be(e, t, r, a, i) {
167
- for (var o = e.children, l, u = -1, d = o.length, m = e.value && (i - r) / e.value; ++u < d; )
168
- l = o[u], l.x0 = t, l.x1 = a, l.y0 = r, l.y1 = r += l.value * m;
166
+ function be(e, t, r, a, o) {
167
+ for (var i = e.children, l, u = -1, d = i.length, m = e.value && (o - r) / e.value; ++u < d; )
168
+ l = i[u], l.x0 = t, l.x1 = a, l.y0 = r, l.y1 = r += l.value * m;
169
169
  }
170
170
  var we = (1 + Math.sqrt(5)) / 2;
171
- function _e(e, t, r, a, i, o) {
171
+ function _e(e, t, r, a, o, i) {
172
172
  for (var l = [], u = t.children, d, m, s = 0, y = 0, n = u.length, g, v, f = t.value, c, p, w, _, A, k, b; s < n; ) {
173
- g = i - r, v = o - a;
173
+ g = o - r, v = i - a;
174
174
  do
175
175
  c = u[y++].value;
176
176
  while (!c && y < n);
@@ -181,26 +181,26 @@ function _e(e, t, r, a, i, o) {
181
181
  }
182
182
  A = _;
183
183
  }
184
- l.push(d = { value: c, dice: g < v, children: u.slice(s, y) }), d.dice ? ye(d, r, a, i, f ? a += v * c / f : o) : be(d, r, a, f ? r += g * c / f : i, o), f -= c, s = y;
184
+ l.push(d = { value: c, dice: g < v, children: u.slice(s, y) }), d.dice ? ye(d, r, a, o, f ? a += v * c / f : i) : be(d, r, a, f ? r += g * c / f : o, i), f -= c, s = y;
185
185
  }
186
186
  return l;
187
187
  }
188
188
  const ke = function e(t) {
189
- function r(a, i, o, l, u) {
190
- _e(t, a, i, o, l, u);
189
+ function r(a, o, i, l, u) {
190
+ _e(t, a, o, i, l, u);
191
191
  }
192
192
  return r.ratio = function(a) {
193
193
  return e((a = +a) > 1 ? a : 1);
194
194
  }, r;
195
195
  }(we);
196
196
  function Be() {
197
- var e = ke, t = !1, r = 1, a = 1, i = [0], o = x, l = x, u = x, d = x, m = x;
197
+ var e = ke, t = !1, r = 1, a = 1, o = [0], i = x, l = x, u = x, d = x, m = x;
198
198
  function s(n) {
199
- return n.x0 = n.y0 = 0, n.x1 = r, n.y1 = a, n.eachBefore(y), i = [0], t && n.eachBefore(me), n;
199
+ return n.x0 = n.y0 = 0, n.x1 = r, n.y1 = a, n.eachBefore(y), o = [0], t && n.eachBefore(me), n;
200
200
  }
201
201
  function y(n) {
202
- var g = i[n.depth], v = n.x0 + g, f = n.y0 + g, c = n.x1 - g, p = n.y1 - g;
203
- c < v && (v = c = (v + c) / 2), p < f && (f = p = (f + p) / 2), n.x0 = v, n.y0 = f, n.x1 = c, n.y1 = p, n.children && (g = i[n.depth + 1] = o(n) / 2, v += m(n) - g, f += l(n) - g, c -= u(n) - g, p -= d(n) - g, c < v && (v = c = (v + c) / 2), p < f && (f = p = (f + p) / 2), e(n, v, f, c, p));
202
+ var g = o[n.depth], v = n.x0 + g, f = n.y0 + g, c = n.x1 - g, p = n.y1 - g;
203
+ c < v && (v = c = (v + c) / 2), p < f && (f = p = (f + p) / 2), n.x0 = v, n.y0 = f, n.x1 = c, n.y1 = p, n.children && (g = o[n.depth + 1] = i(n) / 2, v += m(n) - g, f += l(n) - g, c -= u(n) - g, p -= d(n) - g, c < v && (v = c = (v + c) / 2), p < f && (f = p = (f + p) / 2), e(n, v, f, c, p));
204
204
  }
205
205
  return s.round = function(n) {
206
206
  return arguments.length ? (t = !!n, s) : t;
@@ -211,7 +211,7 @@ function Be() {
211
211
  }, s.padding = function(n) {
212
212
  return arguments.length ? s.paddingInner(n).paddingOuter(n) : s.paddingInner();
213
213
  }, s.paddingInner = function(n) {
214
- return arguments.length ? (o = typeof n == "function" ? n : S(+n), s) : o;
214
+ return arguments.length ? (i = typeof n == "function" ? n : S(+n), s) : i;
215
215
  }, s.paddingOuter = function(n) {
216
216
  return arguments.length ? s.paddingTop(n).paddingRight(n).paddingBottom(n).paddingLeft(n) : s.paddingTop();
217
217
  }, s.paddingTop = function(n) {
@@ -247,25 +247,24 @@ const Re = /* @__PURE__ */ P({
247
247
  name: "TChartTreemap",
248
248
  __name: "ChartTreemap",
249
249
  props: {
250
- data: {},
251
- options: {}
250
+ data: {}
252
251
  },
253
252
  setup(e) {
254
- const t = e, r = `tamandua-chart-treemap-${++Ce}`, a = M(0), i = M(0), o = M(), l = M(), u = M(), { floatingStyles: d, update: m } = j(l, o, {
253
+ const t = e, r = M(0), a = M(0), o = `tamandua-chart-treemap-${++Ce}`, i = M(), l = M(), u = M(), { floatingStyles: d, update: m } = j(l, i, {
255
254
  middleware: [Z(10), G()]
256
255
  }), s = (f) => {
257
256
  u.value = f;
258
257
  }, y = () => {
259
- !o.value || o.value.style.display === "none" || (o.value.style.display = "none");
258
+ !i.value || i.value.style.display === "none" || (i.value.style.display = "none");
260
259
  }, n = () => {
261
- !o.value || o.value.style.display === "block" || (o.value.style.display = "block");
260
+ !i.value || i.value.style.display === "block" || (i.value.style.display = "block");
262
261
  }, g = (f) => {
263
- a.value = f.pageX, i.value = f.pageY, m();
262
+ r.value = f.pageX, a.value = f.pageY, m();
264
263
  }, v = () => {
265
264
  const c = parseInt(
266
- q(`div#${r}`).style("width"),
265
+ q(`div#${o}`).style("width"),
267
266
  10
268
- ), p = 350, w = q(`div#${r} svg`).attr("width", c).attr("height", p).append("g"), _ = $(t.data).sum((h) => h?.value ?? 0).sort(
267
+ ), p = 350, w = q(`div#${o} svg`).attr("width", c).attr("height", p).append("g"), _ = $(t.data).sum((h) => h?.value ?? 0).sort(
269
268
  (h, B) => (B.value ?? 0) - (h.value ?? 0)
270
269
  ), k = Be().size([c, p]).padding(1)(_), b = Ae;
271
270
  w.selectAll("rect").data(k.leaves()).enter().append("rect").attr("x", (h) => h.x0).attr("y", (h) => h.y0).attr("width", (h) => h.x1 - h.x0).attr("height", (h) => h.y1 - h.y0).attr("fill", (h, B) => h.data.color ? h.data.color : h.parent?.data?.color ? h.parent?.data?.color : b(B / 7)).on("mouseover", (h, B) => s(B.data));
@@ -274,7 +273,7 @@ const Re = /* @__PURE__ */ P({
274
273
  v();
275
274
  }), (f, c) => (N(), I(R, null, [
276
275
  T("div", {
277
- id: r,
276
+ id: o,
278
277
  class: "w-full",
279
278
  onMousemove: g,
280
279
  onMouseenter: n,
@@ -286,14 +285,14 @@ const Re = /* @__PURE__ */ P({
286
285
  ref: l,
287
286
  class: "w-1 h-1 absolute",
288
287
  style: V({
289
- left: `${a.value}px`,
290
- top: `${i.value}px`
288
+ left: `${r.value}px`,
289
+ top: `${a.value}px`
291
290
  })
292
291
  }, null, 4)
293
292
  ], 32),
294
293
  T("div", {
295
294
  ref_key: "tooltip",
296
- ref: o,
295
+ ref: i,
297
296
  style: V(D(d)),
298
297
  class: "hidden absolute select-none bg-caipira-primary border-color text-base px-2 py-1 rounded-sm"
299
298
  }, [
@@ -1,5 +1,5 @@
1
- import { _ as e } from "./InputPrice.vue_vue_type_script_setup_true_lang-C2wDVwnm.js";
2
- import { p as t } from "./plugin-CQ-FpZui.js";
1
+ import { _ as e } from "./InputPrice.vue_vue_type_script_setup_true_lang-R3kHhxN2.js";
2
+ import { p as t } from "./plugin-RM2wZuwL.js";
3
3
  export {
4
4
  e as InputPrice,
5
5
  t as InputPricePlugin
@@ -3,10 +3,10 @@ const _ = {
3
3
  options: {
4
4
  precision: 2
5
5
  },
6
- inputToPriceNumber(l) {
7
- return l = l.replace(/[^0-9]/g, "").trim(), l ? parseFloat(l) / Math.pow(10, this.options.precision) : void 0;
6
+ inputToPriceNumber(r) {
7
+ return r = r.replace(/[^0-9]/g, "").trim(), r ? (parseFloat(r) / Math.pow(10, this.options.precision)).toFixed(this.options.precision) : "";
8
8
  }
9
- }, k = { class: "flex items-center h-9 w-full input-bg-color input-text-color border input-border input-roundness" }, B = ["disabled"], h = /* @__PURE__ */ v({
9
+ }, h = { class: "flex items-center h-9 w-full input-bg-color input-text-color border input-border input-roundness" }, k = ["disabled"], T = /* @__PURE__ */ v({
10
10
  name: "TInputPrice",
11
11
  inheritAttrs: !1,
12
12
  __name: "InputPrice",
@@ -17,17 +17,17 @@ const _ = {
17
17
  modelValue: {
18
18
  default: {
19
19
  iso: "",
20
- value: void 0
20
+ value: ""
21
21
  }
22
22
  },
23
23
  modelModifiers: {}
24
24
  }),
25
25
  emits: /* @__PURE__ */ a(["keyup", "blur"], ["update:modelValue"]),
26
- setup(l, { emit: s }) {
27
- const e = b(l, "modelValue"), n = s, i = l, d = (o) => ({
26
+ setup(r, { emit: n }) {
27
+ const e = b(r, "modelValue"), u = n, i = r, p = (o) => ({
28
28
  label: o.symbol,
29
29
  value: o.iso
30
- }), p = (o, t) => {
30
+ }), d = (o, t) => {
31
31
  if (t === void 0) {
32
32
  e.value = { ...e.value };
33
33
  return;
@@ -39,36 +39,36 @@ const _ = {
39
39
  iso: o
40
40
  };
41
41
  }, m = (o) => {
42
- const u = o.target.value;
42
+ const l = o.target.value;
43
43
  e.value = {
44
44
  ...e.value,
45
- value: _.inputToPriceNumber(u)
45
+ value: _.inputToPriceNumber(l)
46
46
  };
47
47
  };
48
- return f(e, p, { immediate: !0 }), (o, t) => {
49
- const u = g("t-input-select");
50
- return x(), y("div", k, [
51
- I(u, {
48
+ return f(e, d, { immediate: !0 }), (o, t) => {
49
+ const l = g("t-input-select");
50
+ return x(), y("div", h, [
51
+ I(l, {
52
52
  modelValue: e.value.iso,
53
53
  "onUpdate:modelValue": [
54
- t[0] || (t[0] = (r) => e.value.iso = r),
54
+ t[0] || (t[0] = (s) => e.value.iso = s),
55
55
  c
56
56
  ],
57
57
  resource: i.resource,
58
- mapper: d,
58
+ mapper: p,
59
59
  "width-class": "w-20",
60
60
  "border-class": "border-t border-r border-b input-border",
61
61
  "roundness-class": ""
62
62
  }, null, 8, ["modelValue", "resource"]),
63
63
  N(M("input", {
64
- "onUpdate:modelValue": t[1] || (t[1] = (r) => e.value.value = r),
64
+ "onUpdate:modelValue": t[1] || (t[1] = (s) => e.value.value = s),
65
65
  type: "text",
66
66
  class: "w-full h-full input-bg-color input-text-color input-outline input-roundness input-padding",
67
67
  disabled: i.disabled,
68
68
  onInput: m,
69
- onKeyup: t[2] || (t[2] = (r) => n("keyup", r)),
70
- onBlur: t[3] || (t[3] = (r) => n("blur", r))
71
- }, null, 40, B), [
69
+ onKeyup: t[2] || (t[2] = (s) => u("keyup", s)),
70
+ onBlur: t[3] || (t[3] = (s) => u("blur", s))
71
+ }, null, 40, k), [
72
72
  [P, e.value.value]
73
73
  ])
74
74
  ]);
@@ -76,5 +76,5 @@ const _ = {
76
76
  }
77
77
  });
78
78
  export {
79
- h as _
79
+ T as _
80
80
  };
@@ -1,5 +1,5 @@
1
- import { _ as p } from "./InputSelect.vue_vue_type_script_setup_true_lang-DgMRjecc.js";
2
- import { p as r } from "./plugin-fGlPPiqA.js";
1
+ import { _ as p } from "./InputSelect.vue_vue_type_script_setup_true_lang-W2S_TcOu.js";
2
+ import { p as r } from "./plugin-CZiSoM73.js";
3
3
  export {
4
4
  p as InputSelect,
5
5
  r as InputSelectPlugin
@@ -1,4 +1,4 @@
1
- import { defineComponent as oe, mergeModels as O, useModel as ue, ref as p, computed as E, onBeforeMount as se, watch as I, resolveComponent as g, openBlock as i, createBlock as D, normalizeClass as x, withCtx as R, createElementVNode as K, createVNode as N, renderSlot as k, normalizeProps as _, mergeProps as z, createElementBlock as d, Fragment as V, renderList as U, guardReactiveProps as q, toDisplayString as G, createCommentVNode as M, withDirectives as ie, vModelText as re, createSlots as ce, createTextVNode as pe, nextTick as de } from "vue";
1
+ import { defineComponent as ue, mergeModels as O, useModel as ne, ref as d, computed as I, onBeforeMount as oe, watch as D, resolveComponent as k, openBlock as o, createBlock as z, normalizeClass as x, withCtx as R, createElementVNode as se, createVNode as K, createElementBlock as p, renderSlot as g, normalizeProps as _, mergeProps as M, Fragment as V, renderList as N, guardReactiveProps as U, toDisplayString as q, createCommentVNode as T, withDirectives as ie, vModelText as re, createSlots as ce, createTextVNode as pe, nextTick as de } from "vue";
2
2
  import { a as fe, E as ve } from "./ui-BSiRZzeZ.js";
3
3
  const me = { key: 1 }, ye = ["placeholder", "disabled", "readonly"], he = {
4
4
  key: 0,
@@ -6,7 +6,7 @@ const me = { key: 1 }, ye = ["placeholder", "disabled", "readonly"], he = {
6
6
  }, be = {
7
7
  key: 1,
8
8
  class: "inline-flex items-center"
9
- }, ke = /* @__PURE__ */ oe({
9
+ }, ge = /* @__PURE__ */ ue({
10
10
  name: "TInputSelect",
11
11
  __name: "InputSelect",
12
12
  props: /* @__PURE__ */ O({
@@ -16,7 +16,7 @@ const me = { key: 1 }, ye = ["placeholder", "disabled", "readonly"], he = {
16
16
  value: f.id ?? f.uuid,
17
17
  label: f
18
18
  }) },
19
- filter: { type: Function, default: (f, T) => T.label.toLowerCase().indexOf(f.toLowerCase()) >= 0 },
19
+ filter: { type: Function, default: (f, B) => B.label.toLowerCase().indexOf(f.toLowerCase()) >= 0 },
20
20
  tooltip: { default: "" },
21
21
  disabled: { type: Boolean },
22
22
  resource: {},
@@ -33,101 +33,101 @@ const me = { key: 1 }, ye = ["placeholder", "disabled", "readonly"], he = {
33
33
  modelModifiers: {}
34
34
  }),
35
35
  emits: /* @__PURE__ */ O(["update:model-value"], ["update:modelValue"]),
36
- setup(f, { emit: T }) {
36
+ setup(f, { emit: B }) {
37
37
  const l = f;
38
- let B = !1, C, j = "";
39
- const H = T, u = ue(f, "modelValue"), n = p([]), c = p(""), P = p(null), F = p(), s = p(!1), L = p(null), a = p([]), $ = p(!1), v = p(null), y = E(() => a.value.length > 0), h = E(() => l.isSearchable && s.value), b = E(() => typeof l.resource == "function"), J = (e) => !l.multiple || !u.value || !Array.isArray(u.value) ? !1 : u.value.includes(e.value), Q = (e = u.value) => !(e === void 0 || e === "" || Array.isArray(e) && e.length === 0), W = (e) => {
40
- H("update:model-value", e);
41
- }, m = (e = u.value) => {
42
- if (Q(e))
38
+ let $ = !1, C, j = "";
39
+ const G = B, s = ne(f, "modelValue"), u = d([]), c = d(""), P = d(null), F = d(), i = d(!1), L = d(null), a = d([]), A = d(!1), v = d(null), h = I(() => a.value.length > 0), m = I(() => l.isSearchable && i.value), b = I(() => typeof l.resource == "function"), H = (e) => !l.multiple || !s.value || !Array.isArray(s.value) ? !1 : s.value.includes(e.value), J = (e = s.value) => !(e === void 0 || e === "" || Array.isArray(e) && e.length === 0), Q = (e) => {
40
+ G("update:model-value", e);
41
+ }, y = (e = s.value) => {
42
+ if (J(e))
43
43
  if (l.multiple)
44
44
  Array.isArray(e) && (a.value = e.map(
45
- (t) => A(t)
45
+ (t) => E(t)
46
46
  ).filter((t) => t > -1));
47
47
  else {
48
- const t = A(e);
48
+ const t = E(e);
49
49
  ~t && (a.value = [t]);
50
50
  }
51
- }, X = (e) => {
52
- s.value = !s.value, s.value && h.value && de(() => {
51
+ }, W = (e) => {
52
+ i.value = !i.value, i.value && m.value && de(() => {
53
53
  P.value?.focus();
54
54
  });
55
- }, A = (e) => n.value.findIndex(
55
+ }, E = (e) => u.value.findIndex(
56
56
  (t) => t.value === e
57
57
  ), S = async (e = !1) => {
58
58
  if (!l.resource)
59
59
  return;
60
- $.value = !0;
60
+ A.value = !0;
61
61
  const t = {
62
62
  t: c.value,
63
63
  r: "option"
64
64
  };
65
- e && v.value && v.value.pages > v.value.page ? t.page = v.value.page + 1 : e = !1, !c.value && u.value && (t.i = u.value);
65
+ e && v.value && v.value.pages > v.value.page ? t.page = v.value.page + 1 : e = !1, !c.value && s.value && (t.i = s.value);
66
66
  const r = await l.resource(t);
67
- e ? n.value.push(...r.items.map(l.mapper)) : n.value = r.items.map(l.mapper), v.value = r.pagination, !b.value && c.value && m(c.value), $.value = !1;
68
- }, Y = () => {
67
+ e ? u.value.push(...r.items.map(l.mapper)) : u.value = r.items.map(l.mapper), v.value = r.pagination, !b.value && c.value && y(c.value), A.value = !1;
68
+ }, X = () => {
69
69
  !c.value || j === c.value || (C && (clearTimeout(C), C = null), C = setTimeout(() => {
70
- j = c.value, b.value ? (s.value || (s.value = !0), S()) : l.isSearchable && (n.value = l.options.filter(
70
+ j = c.value, b.value ? (i.value || (i.value = !0), S()) : l.isSearchable && (u.value = l.options.filter(
71
71
  (e) => l.filter(c.value, e)
72
72
  ));
73
73
  }, 500));
74
- }, Z = ({
74
+ }, Y = ({
75
75
  index: e,
76
76
  hold: t
77
77
  }) => {
78
- if (B = !0, l.multiple) {
78
+ if ($ = !0, l.multiple) {
79
79
  const r = a.value.findIndex(
80
80
  (w) => w === e
81
81
  );
82
82
  ~r ? a.value.splice(r, 1) : a.value.push(e);
83
83
  } else
84
84
  a.value = [e];
85
- (!l.multiple || !t) && (s.value = !1);
86
- }, ee = () => {
85
+ (!l.multiple || !t) && (i.value = !1);
86
+ }, Z = () => {
87
87
  b.value && v.value && v.value.pages > v.value.page && S(!0);
88
- }, le = async (e) => {
88
+ }, ee = async (e) => {
89
89
  switch (e.key) {
90
90
  case "ArrowDown":
91
91
  L.value?.move(e);
92
92
  break;
93
93
  case "Escape":
94
- s.value = !1;
94
+ i.value = !1;
95
95
  break;
96
96
  }
97
97
  };
98
- return se(async () => {
99
- b.value ? (await S(), m()) : l.options.length > 0 && (n.value = l.options), !u.value && l.initialValue ? m(l.initialValue) : m(u.value);
100
- }), I(
101
- () => u.value,
98
+ return oe(async () => {
99
+ b.value ? (await S(), y()) : l.options.length > 0 && (u.value = l.options), !s.value && l.initialValue ? y(l.initialValue) : y(s.value);
100
+ }), D(
101
+ () => s.value,
102
102
  async (e) => {
103
- e && (A(e) < 0 && b.value && await S(), m(e));
103
+ e && (E(e) < 0 && b.value && await S(), y(e));
104
104
  }
105
- ), I(
105
+ ), D(
106
106
  a,
107
107
  (e) => {
108
- const t = l.multiple ? n.value.filter(
108
+ const t = l.multiple ? u.value.filter(
109
109
  (r, w) => a.value.includes(w)
110
- ).map((r) => r.value) : n.value[a.value[0]].value;
111
- B && (B = !1, W(t));
110
+ ).map((r) => r.value) : u.value[a.value[0]].value;
111
+ $ && ($ = !1, Q(t));
112
112
  },
113
113
  { deep: !0 }
114
- ), I(
114
+ ), D(
115
115
  () => l.options,
116
116
  (e) => {
117
- e.length > 0 && (n.value = e, u.value && a.value.length === 0 && m(u.value));
117
+ e.length > 0 && (u.value = e, s.value && a.value.length === 0 && y(s.value));
118
118
  }
119
119
  ), (e, t) => {
120
- const r = g("t-tag"), w = g("t-button"), te = g("t-icon"), ae = g("t-dropdown"), ne = g("t-popover");
121
- return i(), D(ne, {
122
- open: s.value,
123
- "onUpdate:open": t[1] || (t[1] = (o) => s.value = o),
120
+ const r = k("t-tag"), w = k("t-button"), le = k("t-icon"), te = k("t-dropdown"), ae = k("t-popover");
121
+ return o(), z(ae, {
122
+ open: i.value,
123
+ "onUpdate:open": t[1] || (t[1] = (n) => i.value = n),
124
124
  placement: l.dropdownPlacement,
125
125
  class: x([l.widthClass]),
126
126
  ref_key: "popoverRef",
127
127
  ref: F
128
128
  }, {
129
129
  default: R(() => [
130
- K("div", {
130
+ se("div", {
131
131
  class: x([{
132
132
  "h-9": !l.multiple,
133
133
  "h-full *:min-h-9": l.multiple,
@@ -135,81 +135,82 @@ const me = { key: 1 }, ye = ["placeholder", "disabled", "readonly"], he = {
135
135
  [l.roundnessClass]: !0
136
136
  }, "flex justify-between items-center w-full max-w-96 input-text-color select-none input-bg-color"])
137
137
  }, [
138
- N(w, {
138
+ K(w, {
139
139
  variant: "transparent",
140
140
  size: "",
141
141
  class: x(["h-full", {
142
- "w-full justify-end pr-2": !h.value && !y.value,
143
- "w-full justify-between pr-2": !h.value && y.value,
144
- "w-10 justify-center": h.value
142
+ "w-full justify-end pr-2": !m.value && !h.value,
143
+ "w-full justify-between pr-2": !m.value && h.value,
144
+ "w-10 justify-center": m.value
145
145
  }]),
146
146
  "aria-describedby": F.value?.name,
147
- icon: s.value === !0 ? "chevron-up" : "chevron-down",
148
- onClick: X
147
+ icon: i.value === !0 ? "chevron-up" : "chevron-down",
148
+ onClick: W
149
149
  }, {
150
150
  default: R(() => [
151
- K("div", {
151
+ m.value ? T("", !0) : (o(), p("div", {
152
+ key: 0,
152
153
  class: x(["inline-flex items-center ml-2 max-w-[calc(100%-2.5rem)]", {
153
154
  "overflow-hidden whitespace-nowrap": !l.multiple,
154
155
  "flex-wrap gap-2 py-1": l.multiple
155
156
  }])
156
157
  }, [
157
- e.$slots.selection && y.value ? k(e.$slots, "selection", _(z({ key: 0 }, n.value[a.value[0]]))) : e.$slots.default && y.value ? (i(), d(V, { key: 1 }, [
158
- l.multiple ? (i(!0), d(V, { key: 0 }, U(a.value, (o) => k(e.$slots, "default", _(q(n.value[o])))), 256)) : k(e.$slots, "default", _(z({ key: 1 }, n.value[a.value[0]])))
159
- ], 64)) : y.value ? (i(), d(V, { key: 2 }, [
160
- l.multiple ? (i(!0), d(V, { key: 0 }, U(a.value, (o) => (i(), D(r, {
161
- key: o,
162
- text: n.value[o].label,
158
+ e.$slots.selection && h.value ? g(e.$slots, "selection", _(M({ key: 0 }, u.value[a.value[0]]))) : e.$slots.default && h.value ? (o(), p(V, { key: 1 }, [
159
+ l.multiple ? (o(!0), p(V, { key: 0 }, N(a.value, (n) => g(e.$slots, "default", _(U(u.value[n])))), 256)) : g(e.$slots, "default", _(M({ key: 1 }, u.value[a.value[0]])))
160
+ ], 64)) : h.value ? (o(), p(V, { key: 2 }, [
161
+ l.multiple ? (o(!0), p(V, { key: 0 }, N(a.value, (n) => (o(), z(r, {
162
+ key: n,
163
+ text: u.value[n].label,
163
164
  color: "#6e6e6e"
164
- }, null, 8, ["text"]))), 128)) : (i(), d("span", me, G(n.value[a.value[0]]?.label), 1))
165
- ], 64)) : M("", !0)
166
- ], 2)
165
+ }, null, 8, ["text"]))), 128)) : (o(), p("span", me, q(u.value[a.value[0]]?.label), 1))
166
+ ], 64)) : T("", !0)
167
+ ], 2))
167
168
  ]),
168
169
  _: 3
169
170
  }, 8, ["aria-describedby", "class", "icon"]),
170
- h.value ? ie((i(), d("input", {
171
+ m.value ? ie((o(), p("input", {
171
172
  key: 0,
172
- "onUpdate:modelValue": t[0] || (t[0] = (o) => c.value = o),
173
+ "onUpdate:modelValue": t[0] || (t[0] = (n) => c.value = n),
173
174
  type: "text",
174
175
  ref_key: "inputRef",
175
176
  ref: P,
176
177
  placeholder: l.placeholder,
177
178
  disabled: l.disabled,
178
179
  readonly: !l.isSearchable,
179
- class: "h-9 bg-transparent input-padding input-roundness input-outline",
180
- onInput: Y,
181
- onKeydown: le
180
+ class: "h-9 bg-transparent input-padding input-roundness input-outline w-full",
181
+ onInput: X,
182
+ onKeydown: ee
182
183
  }, null, 40, ye)), [
183
184
  [re, c.value]
184
- ]) : M("", !0)
185
+ ]) : T("", !0)
185
186
  ], 2)
186
187
  ]),
187
188
  content: R(() => [
188
- N(ae, {
189
+ K(te, {
189
190
  ref_key: "dropdownRef",
190
191
  ref: L,
191
- items: n.value,
192
- "is-visible": s.value,
192
+ items: u.value,
193
+ "is-visible": i.value,
193
194
  multiple: l.multiple,
194
- loading: $.value,
195
- onChange: Z,
196
- onEndReached: ee
195
+ loading: A.value,
196
+ onChange: Y,
197
+ onEndReached: Z
197
198
  }, ce({ _: 2 }, [
198
199
  e.$slots.default || l.multiple ? {
199
200
  name: "default",
200
- fn: R((o) => [
201
- l.multiple ? (i(), d("div", he, [
202
- e.$slots.default ? k(e.$slots, "default", _(z({ key: 0 }, o))) : (i(), d(V, { key: 1 }, [
203
- pe(G(o.label), 1)
201
+ fn: R((n) => [
202
+ l.multiple ? (o(), p("div", he, [
203
+ e.$slots.default ? g(e.$slots, "default", _(M({ key: 0 }, n))) : (o(), p(V, { key: 1 }, [
204
+ pe(q(n.label), 1)
204
205
  ], 64)),
205
- J(o) ? (i(), D(te, {
206
+ H(n) ? (o(), z(le, {
206
207
  key: 2,
207
208
  icon: "check",
208
209
  size: "sm",
209
210
  class: "float-right ml-2"
210
- })) : M("", !0)
211
- ])) : (i(), d("div", be, [
212
- k(e.$slots, "default", _(q(o)))
211
+ })) : T("", !0)
212
+ ])) : (o(), p("div", be, [
213
+ g(e.$slots, "default", _(U(n)))
213
214
  ]))
214
215
  ]),
215
216
  key: "0"
@@ -222,5 +223,5 @@ const me = { key: 1 }, ye = ["placeholder", "disabled", "readonly"], he = {
222
223
  }
223
224
  });
224
225
  export {
225
- ke as _
226
+ ge as _
226
227
  };