@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.
- package/dist/ChartTreemap.js +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
- package/dist/InputPrice.js +2 -2
- package/dist/{InputPrice.vue_vue_type_script_setup_true_lang-C2wDVwnm.js → InputPrice.vue_vue_type_script_setup_true_lang-R3kHhxN2.js} +20 -20
- package/dist/InputSelect.js +2 -2
- 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
- package/dist/components.js +3 -3
- package/dist/date.js +170 -354
- package/dist/{plugin-D8EMKVQ9.js → plugin-B97_3CZA.js} +1 -1
- package/dist/{plugin-fGlPPiqA.js → plugin-CZiSoM73.js} +1 -1
- package/dist/{plugin-CQ-FpZui.js → plugin-RM2wZuwL.js} +1 -1
- package/dist/{plugins-CpDwnGUh.js → plugins-DD6fcgTJ.js} +4 -4
- package/dist/plugins.js +4 -4
- package/dist/tamandua.js +1 -1
- package/dist/types/components/Avatar/Avatar.vue.d.ts +2 -2
- package/dist/types/components/Button/Button.vue.d.ts +13 -11
- package/dist/types/components/ChartLine/ChartLine.vue.d.ts +2 -2
- package/dist/types/components/ChartTreemap/ChartTreemap.story.d.ts +0 -1
- package/dist/types/components/ChartTreemap/types.d.ts +4 -7
- package/dist/types/components/Drawer/Drawer.vue.d.ts +8 -6
- package/dist/types/components/Dropdown/Dropdown.vue.d.ts +33 -31
- package/dist/types/components/Form/Form.vue.d.ts +8 -76
- package/dist/types/components/FormItem/FormItem.vue.d.ts +4 -2
- package/dist/types/components/GraphyLabel/GraphyLabel.vue.d.ts +4 -2
- package/dist/types/components/GraphyPrice/GraphyPrice.vue.d.ts +1 -1
- package/dist/types/components/Icon/Icon.vue.d.ts +1 -1
- package/dist/types/components/InputPrice/service.d.ts +1 -1
- package/dist/types/components/InputPrice/types.d.ts +1 -1
- package/dist/types/components/InputRadio/InputRadioGroup.vue.d.ts +6 -4
- package/dist/types/components/InputSelect/InputSelect.vue.d.ts +35 -33
- package/dist/types/components/Link/Link.vue.d.ts +7 -5
- package/dist/types/components/Modal/Modal.vue.d.ts +8 -6
- package/dist/types/components/ModalForm/ModalForm.vue.d.ts +7 -5
- package/dist/types/components/Pagination/Pagination.vue.d.ts +1 -1
- package/dist/types/components/Popconfirm/Popconfirm.vue.d.ts +9 -7
- package/dist/types/components/Popover/Popover.vue.d.ts +4 -4
- package/dist/types/components/ProgressCircle/ProgressCircle.vue.d.ts +6 -4
- package/dist/types/components/ProgressLine/ProgressLine.vue.d.ts +6 -4
- package/dist/types/components/SensitiveInfo/SensitiveInfo.vue.d.ts +4 -2
- package/dist/types/components/Tab/Tab.vue.d.ts +4 -2
- package/dist/types/components/Table/Table.vue.d.ts +12 -73
- package/dist/types/components/Tag/Tag.vue.d.ts +6 -4
- package/dist/types/services/date.d.ts +2 -2
- package/package.json +14 -14
package/dist/ChartTreemap.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { _ as e } from "./ChartTreemap.vue_vue_type_script_setup_true_lang-
|
|
2
|
-
import { p as m } from "./plugin-
|
|
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],
|
|
24
|
-
if (e.call(t, r, ++l, this),
|
|
25
|
-
for (
|
|
26
|
-
a.push(i
|
|
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],
|
|
31
|
-
if (
|
|
32
|
-
for (l = 0, u =
|
|
33
|
-
a.push(
|
|
34
|
-
for (; r =
|
|
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,
|
|
47
|
-
r += a[
|
|
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
|
|
60
|
-
a.splice(
|
|
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(),
|
|
66
|
+
var r = e.ancestors(), a = t.ancestors(), o = null;
|
|
67
67
|
for (e = r.pop(), t = a.pop(); e === t; )
|
|
68
|
-
|
|
69
|
-
return
|
|
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,
|
|
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 (
|
|
97
|
-
r.push(a[
|
|
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,
|
|
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
|
-
|
|
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,
|
|
163
|
-
for (var
|
|
164
|
-
l =
|
|
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,
|
|
167
|
-
for (var
|
|
168
|
-
l =
|
|
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,
|
|
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 =
|
|
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,
|
|
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,
|
|
190
|
-
_e(t, a,
|
|
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,
|
|
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),
|
|
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 =
|
|
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 =
|
|
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 ? (
|
|
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 =
|
|
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
|
-
!
|
|
258
|
+
!i.value || i.value.style.display === "none" || (i.value.style.display = "none");
|
|
260
259
|
}, n = () => {
|
|
261
|
-
!
|
|
260
|
+
!i.value || i.value.style.display === "block" || (i.value.style.display = "block");
|
|
262
261
|
}, g = (f) => {
|
|
263
|
-
|
|
262
|
+
r.value = f.pageX, a.value = f.pageY, m();
|
|
264
263
|
}, v = () => {
|
|
265
264
|
const c = parseInt(
|
|
266
|
-
q(`div#${
|
|
265
|
+
q(`div#${o}`).style("width"),
|
|
267
266
|
10
|
|
268
|
-
), p = 350, w = q(`div#${
|
|
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:
|
|
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: `${
|
|
290
|
-
top: `${
|
|
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:
|
|
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
|
}, [
|
package/dist/InputPrice.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { _ as e } from "./InputPrice.vue_vue_type_script_setup_true_lang-
|
|
2
|
-
import { p as t } from "./plugin-
|
|
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(
|
|
7
|
-
return
|
|
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
|
-
},
|
|
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:
|
|
20
|
+
value: ""
|
|
21
21
|
}
|
|
22
22
|
},
|
|
23
23
|
modelModifiers: {}
|
|
24
24
|
}),
|
|
25
25
|
emits: /* @__PURE__ */ a(["keyup", "blur"], ["update:modelValue"]),
|
|
26
|
-
setup(
|
|
27
|
-
const e = b(
|
|
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
|
-
}),
|
|
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
|
|
42
|
+
const l = o.target.value;
|
|
43
43
|
e.value = {
|
|
44
44
|
...e.value,
|
|
45
|
-
value: _.inputToPriceNumber(
|
|
45
|
+
value: _.inputToPriceNumber(l)
|
|
46
46
|
};
|
|
47
47
|
};
|
|
48
|
-
return f(e,
|
|
49
|
-
const
|
|
50
|
-
return x(), y("div",
|
|
51
|
-
I(
|
|
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] = (
|
|
54
|
+
t[0] || (t[0] = (s) => e.value.iso = s),
|
|
55
55
|
c
|
|
56
56
|
],
|
|
57
57
|
resource: i.resource,
|
|
58
|
-
mapper:
|
|
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] = (
|
|
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] = (
|
|
70
|
-
onBlur: t[3] || (t[3] = (
|
|
71
|
-
}, null, 40,
|
|
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
|
-
|
|
79
|
+
T as _
|
|
80
80
|
};
|
package/dist/InputSelect.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { _ as p } from "./InputSelect.vue_vue_type_script_setup_true_lang-
|
|
2
|
-
import { p as r } from "./plugin-
|
|
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
|
|
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
|
-
},
|
|
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,
|
|
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:
|
|
36
|
+
setup(f, { emit: B }) {
|
|
37
37
|
const l = f;
|
|
38
|
-
let
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
},
|
|
42
|
-
if (
|
|
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) =>
|
|
45
|
+
(t) => E(t)
|
|
46
46
|
).filter((t) => t > -1));
|
|
47
47
|
else {
|
|
48
|
-
const t =
|
|
48
|
+
const t = E(e);
|
|
49
49
|
~t && (a.value = [t]);
|
|
50
50
|
}
|
|
51
|
-
},
|
|
52
|
-
|
|
51
|
+
}, W = (e) => {
|
|
52
|
+
i.value = !i.value, i.value && m.value && de(() => {
|
|
53
53
|
P.value?.focus();
|
|
54
54
|
});
|
|
55
|
-
},
|
|
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
|
-
|
|
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 &&
|
|
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 ?
|
|
68
|
-
},
|
|
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 ? (
|
|
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
|
-
},
|
|
74
|
+
}, Y = ({
|
|
75
75
|
index: e,
|
|
76
76
|
hold: t
|
|
77
77
|
}) => {
|
|
78
|
-
if (
|
|
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) && (
|
|
86
|
-
},
|
|
85
|
+
(!l.multiple || !t) && (i.value = !1);
|
|
86
|
+
}, Z = () => {
|
|
87
87
|
b.value && v.value && v.value.pages > v.value.page && S(!0);
|
|
88
|
-
},
|
|
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
|
-
|
|
94
|
+
i.value = !1;
|
|
95
95
|
break;
|
|
96
96
|
}
|
|
97
97
|
};
|
|
98
|
-
return
|
|
99
|
-
b.value ? (await S(),
|
|
100
|
-
}),
|
|
101
|
-
() =>
|
|
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 && (
|
|
103
|
+
e && (E(e) < 0 && b.value && await S(), y(e));
|
|
104
104
|
}
|
|
105
|
-
),
|
|
105
|
+
), D(
|
|
106
106
|
a,
|
|
107
107
|
(e) => {
|
|
108
|
-
const t = l.multiple ?
|
|
108
|
+
const t = l.multiple ? u.value.filter(
|
|
109
109
|
(r, w) => a.value.includes(w)
|
|
110
|
-
).map((r) => r.value) :
|
|
111
|
-
|
|
110
|
+
).map((r) => r.value) : u.value[a.value[0]].value;
|
|
111
|
+
$ && ($ = !1, Q(t));
|
|
112
112
|
},
|
|
113
113
|
{ deep: !0 }
|
|
114
|
-
),
|
|
114
|
+
), D(
|
|
115
115
|
() => l.options,
|
|
116
116
|
(e) => {
|
|
117
|
-
e.length > 0 && (
|
|
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 =
|
|
121
|
-
return
|
|
122
|
-
open:
|
|
123
|
-
"onUpdate:open": t[1] || (t[1] = (
|
|
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
|
-
|
|
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
|
-
|
|
138
|
+
K(w, {
|
|
139
139
|
variant: "transparent",
|
|
140
140
|
size: "",
|
|
141
141
|
class: x(["h-full", {
|
|
142
|
-
"w-full justify-end pr-2": !
|
|
143
|
-
"w-full justify-between pr-2": !
|
|
144
|
-
"w-10 justify-center":
|
|
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:
|
|
148
|
-
onClick:
|
|
147
|
+
icon: i.value === !0 ? "chevron-up" : "chevron-down",
|
|
148
|
+
onClick: W
|
|
149
149
|
}, {
|
|
150
150
|
default: R(() => [
|
|
151
|
-
|
|
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 &&
|
|
158
|
-
l.multiple ? (
|
|
159
|
-
], 64)) :
|
|
160
|
-
l.multiple ? (
|
|
161
|
-
key:
|
|
162
|
-
text:
|
|
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)) : (
|
|
165
|
-
], 64)) :
|
|
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
|
-
|
|
171
|
+
m.value ? ie((o(), p("input", {
|
|
171
172
|
key: 0,
|
|
172
|
-
"onUpdate:modelValue": t[0] || (t[0] = (
|
|
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:
|
|
181
|
-
onKeydown:
|
|
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
|
-
]) :
|
|
185
|
+
]) : T("", !0)
|
|
185
186
|
], 2)
|
|
186
187
|
]),
|
|
187
188
|
content: R(() => [
|
|
188
|
-
|
|
189
|
+
K(te, {
|
|
189
190
|
ref_key: "dropdownRef",
|
|
190
191
|
ref: L,
|
|
191
|
-
items:
|
|
192
|
-
"is-visible":
|
|
192
|
+
items: u.value,
|
|
193
|
+
"is-visible": i.value,
|
|
193
194
|
multiple: l.multiple,
|
|
194
|
-
loading:
|
|
195
|
-
onChange:
|
|
196
|
-
onEndReached:
|
|
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((
|
|
201
|
-
l.multiple ? (
|
|
202
|
-
e.$slots.default ?
|
|
203
|
-
pe(
|
|
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
|
-
|
|
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
|
-
})) :
|
|
211
|
-
])) : (
|
|
212
|
-
|
|
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
|
-
|
|
226
|
+
ge as _
|
|
226
227
|
};
|