@caipira/tamandua 0.0.48 → 0.0.50
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/README.md +7 -0
- package/dist/InputCheckbox.js +2 -2
- package/dist/{InputCheckbox.vue_vue_type_style_index_0_lang-D5J-rPuH.js → InputCheckbox.vue_vue_type_style_index_0_lang-DnRqQiOj.js} +20 -19
- package/dist/InputPrice.js +2 -2
- package/dist/InputPrice.vue_vue_type_script_setup_true_lang-C2wDVwnm.js +80 -0
- package/dist/InputSelect.js +2 -2
- package/dist/InputSelect.vue_vue_type_script_setup_true_lang-B89uyzj-.js +226 -0
- package/dist/Pagination.js +2 -2
- package/dist/Pagination.vue_vue_type_script_setup_true_lang-CrsaPQHf.js +106 -0
- package/dist/components.js +4 -4
- package/dist/{plugin-YUomn9tF.js → plugin-43qPVkHg.js} +1 -1
- package/dist/{plugin-DPCk5fFS.js → plugin-4XhHBTQc.js} +1 -1
- package/dist/{plugin-XDIORJya.js → plugin-C77cnZuW.js} +1 -1
- package/dist/{plugin-z8Hr_T_O.js → plugin-CQ-FpZui.js} +1 -1
- package/dist/{plugins-CfuHgVBl.js → plugins-D9rFe9qY.js} +6 -6
- package/dist/plugins.js +6 -6
- package/dist/tamandua.js +1 -1
- package/dist/types/components/InputPrice/InputPrice.story.d.ts +13 -0
- package/dist/types/components/InputPrice/InputPrice.vue.d.ts +8 -2
- package/dist/types/components/InputPrice/types.d.ts +4 -1
- package/dist/types/components/InputSelect/InputSelect.vue.d.ts +127 -52
- package/dist/types/components/InputSelect/types.d.ts +0 -1
- package/dist/types/components/Pagination/Pagination.story.d.ts +8 -0
- package/dist/types/components/Pagination/Pagination.vue.d.ts +3 -0
- package/dist/types/components/Pagination/types.d.ts +1 -0
- package/dist/types/types/ui.d.ts +6 -6
- package/package.json +1 -1
- package/dist/InputPrice.vue_vue_type_script_setup_true_lang-BX4rsYIr.js +0 -67
- package/dist/InputSelect.vue_vue_type_script_setup_true_lang-BDqMGvuy.js +0 -227
- package/dist/Pagination.vue_vue_type_script_setup_true_lang-PLZQJUd0.js +0 -89
package/README.md
CHANGED
package/dist/InputCheckbox.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { _ as e } from "./InputCheckbox.vue_vue_type_style_index_0_lang-
|
|
2
|
-
import { p as t } from "./plugin-
|
|
1
|
+
import { _ as e } from "./InputCheckbox.vue_vue_type_style_index_0_lang-DnRqQiOj.js";
|
|
2
|
+
import { p as t } from "./plugin-4XhHBTQc.js";
|
|
3
3
|
export {
|
|
4
4
|
e as InputCheckbox,
|
|
5
5
|
t as InputCheckboxPlugin
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import './InputCheckbox.css';
|
|
2
|
-
import { defineComponent as
|
|
3
|
-
const
|
|
4
|
-
let
|
|
5
|
-
const
|
|
2
|
+
import { defineComponent as c, ref as m, watch as b, openBlock as o, createElementBlock as r, withDirectives as f, createElementVNode as h, mergeProps as v, vModelCheckbox as k, toDisplayString as y, createCommentVNode as x } from "vue";
|
|
3
|
+
const _ = { class: "h-9 inline-flex items-center" }, B = ["indeterminate", "disabled"];
|
|
4
|
+
let V = 0;
|
|
5
|
+
const I = /* @__PURE__ */ c({
|
|
6
6
|
name: "TInputCheckbox",
|
|
7
7
|
__name: "InputCheckbox",
|
|
8
8
|
props: {
|
|
@@ -13,37 +13,38 @@ const V = /* @__PURE__ */ u({
|
|
|
13
13
|
initializeValue: { type: Boolean, default: !1 }
|
|
14
14
|
},
|
|
15
15
|
emits: ["update:model-value", "input"],
|
|
16
|
-
setup(
|
|
17
|
-
const t =
|
|
16
|
+
setup(d, { emit: s }) {
|
|
17
|
+
const t = d, l = s, i = `checkbox_${++V}`, a = m(!1), p = () => {
|
|
18
18
|
const e = !a.value;
|
|
19
|
-
|
|
19
|
+
l("update:model-value", e), l("input", e);
|
|
20
20
|
};
|
|
21
|
-
return
|
|
21
|
+
return b(
|
|
22
22
|
() => t.modelValue,
|
|
23
23
|
(e) => {
|
|
24
|
-
t.initializeValue && typeof e > "u" &&
|
|
24
|
+
t.initializeValue && typeof e > "u" && l("update:model-value", !1), a.value = e;
|
|
25
25
|
},
|
|
26
26
|
{ immediate: !0 }
|
|
27
|
-
), (e, n) => (
|
|
28
|
-
h(
|
|
29
|
-
"onUpdate:modelValue": n[0] || (n[0] = (
|
|
27
|
+
), (e, n) => (o(), r("div", _, [
|
|
28
|
+
f(h("input", v({
|
|
29
|
+
"onUpdate:modelValue": n[0] || (n[0] = (u) => a.value = u)
|
|
30
30
|
}, e.$attrs, {
|
|
31
31
|
type: "checkbox",
|
|
32
32
|
class: "form-checkbox w-5 h-5 border input-border input-roundness color-caipira-primary-inverted bg-caipira-primary checked:bg-caipira-primary-inverted input-outline",
|
|
33
33
|
indeterminate: t.isIndeterminate,
|
|
34
|
-
id:
|
|
34
|
+
id: i,
|
|
35
35
|
disabled: e.disabled,
|
|
36
|
-
onInput:
|
|
37
|
-
}), null, 16,
|
|
36
|
+
onInput: p
|
|
37
|
+
}), null, 16, B), [
|
|
38
38
|
[k, a.value]
|
|
39
39
|
]),
|
|
40
|
-
o("label", {
|
|
40
|
+
t.label ? (o(), r("label", {
|
|
41
|
+
key: 0,
|
|
41
42
|
class: "cursor-pointer pl-2 mr-3 input-label",
|
|
42
|
-
for:
|
|
43
|
-
}, y(t.label), 1)
|
|
43
|
+
for: i
|
|
44
|
+
}, y(t.label), 1)) : x("", !0)
|
|
44
45
|
]));
|
|
45
46
|
}
|
|
46
47
|
});
|
|
47
48
|
export {
|
|
48
|
-
|
|
49
|
+
I as _
|
|
49
50
|
};
|
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-C2wDVwnm.js";
|
|
2
|
+
import { p as t } from "./plugin-CQ-FpZui.js";
|
|
3
3
|
export {
|
|
4
4
|
e as InputPrice,
|
|
5
5
|
t as InputPricePlugin
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { defineComponent as v, mergeModels as a, useModel as b, watch as f, resolveComponent as g, openBlock as x, createElementBlock as y, createVNode as I, withDirectives as N, createElementVNode as M, vModelText as P } from "vue";
|
|
2
|
+
const _ = {
|
|
3
|
+
options: {
|
|
4
|
+
precision: 2
|
|
5
|
+
},
|
|
6
|
+
inputToPriceNumber(l) {
|
|
7
|
+
return l = l.replace(/[^0-9]/g, "").trim(), l ? parseFloat(l) / Math.pow(10, this.options.precision) : void 0;
|
|
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({
|
|
10
|
+
name: "TInputPrice",
|
|
11
|
+
inheritAttrs: !1,
|
|
12
|
+
__name: "InputPrice",
|
|
13
|
+
props: /* @__PURE__ */ a({
|
|
14
|
+
resource: { type: Function },
|
|
15
|
+
disabled: { type: Boolean }
|
|
16
|
+
}, {
|
|
17
|
+
modelValue: {
|
|
18
|
+
default: {
|
|
19
|
+
iso: "",
|
|
20
|
+
value: void 0
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
modelModifiers: {}
|
|
24
|
+
}),
|
|
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) => ({
|
|
28
|
+
label: o.symbol,
|
|
29
|
+
value: o.iso
|
|
30
|
+
}), p = (o, t) => {
|
|
31
|
+
if (t === void 0) {
|
|
32
|
+
e.value = { ...e.value };
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
o?.value && o.value !== t?.value && (e.value.value = o.value), o?.iso && o.iso !== t?.iso && (e.value.iso = o.iso);
|
|
36
|
+
}, c = (o) => {
|
|
37
|
+
e.value = {
|
|
38
|
+
...e.value,
|
|
39
|
+
iso: o
|
|
40
|
+
};
|
|
41
|
+
}, m = (o) => {
|
|
42
|
+
const u = o.target.value;
|
|
43
|
+
e.value = {
|
|
44
|
+
...e.value,
|
|
45
|
+
value: _.inputToPriceNumber(u)
|
|
46
|
+
};
|
|
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, {
|
|
52
|
+
modelValue: e.value.iso,
|
|
53
|
+
"onUpdate:modelValue": [
|
|
54
|
+
t[0] || (t[0] = (r) => e.value.iso = r),
|
|
55
|
+
c
|
|
56
|
+
],
|
|
57
|
+
resource: i.resource,
|
|
58
|
+
mapper: d,
|
|
59
|
+
"width-class": "w-20",
|
|
60
|
+
"border-class": "border-t border-r border-b input-border",
|
|
61
|
+
"roundness-class": ""
|
|
62
|
+
}, null, 8, ["modelValue", "resource"]),
|
|
63
|
+
N(M("input", {
|
|
64
|
+
"onUpdate:modelValue": t[1] || (t[1] = (r) => e.value.value = r),
|
|
65
|
+
type: "text",
|
|
66
|
+
class: "w-full h-full input-bg-color input-text-color input-outline input-roundness input-padding",
|
|
67
|
+
disabled: i.disabled,
|
|
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), [
|
|
72
|
+
[P, e.value.value]
|
|
73
|
+
])
|
|
74
|
+
]);
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
export {
|
|
79
|
+
h as _
|
|
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-B89uyzj-.js";
|
|
2
|
+
import { p as r } from "./plugin-C77cnZuW.js";
|
|
3
3
|
export {
|
|
4
4
|
p as InputSelect,
|
|
5
5
|
r as InputSelectPlugin
|
|
@@ -0,0 +1,226 @@
|
|
|
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";
|
|
2
|
+
import { a as fe, E as ve } from "./ui-BC6H9E93.js";
|
|
3
|
+
const me = { key: 1 }, ye = ["placeholder", "disabled", "readonly"], he = {
|
|
4
|
+
key: 0,
|
|
5
|
+
class: "inline-flex w-full justify-between items-center"
|
|
6
|
+
}, be = {
|
|
7
|
+
key: 1,
|
|
8
|
+
class: "inline-flex items-center"
|
|
9
|
+
}, ke = /* @__PURE__ */ oe({
|
|
10
|
+
name: "TInputSelect",
|
|
11
|
+
__name: "InputSelect",
|
|
12
|
+
props: /* @__PURE__ */ O({
|
|
13
|
+
size: { default: fe.Default },
|
|
14
|
+
options: { default: () => [] },
|
|
15
|
+
mapper: { type: Function, default: (f) => ({
|
|
16
|
+
value: f.id ?? f.uuid,
|
|
17
|
+
label: f
|
|
18
|
+
}) },
|
|
19
|
+
filter: { type: Function, default: (f, T) => T.label.toLowerCase().indexOf(f.toLowerCase()) >= 0 },
|
|
20
|
+
tooltip: { default: "" },
|
|
21
|
+
disabled: { type: Boolean },
|
|
22
|
+
resource: {},
|
|
23
|
+
multiple: { type: Boolean, default: !1 },
|
|
24
|
+
placeholder: { default: "" },
|
|
25
|
+
initialValue: {},
|
|
26
|
+
isSearchable: { type: Boolean, default: !1 },
|
|
27
|
+
dropdownPlacement: { default: ve.BOTTOM_START },
|
|
28
|
+
widthClass: { default: "w-full" },
|
|
29
|
+
borderClass: { default: "border input-border" },
|
|
30
|
+
roundnessClass: { default: "input-roundness" }
|
|
31
|
+
}, {
|
|
32
|
+
modelValue: {},
|
|
33
|
+
modelModifiers: {}
|
|
34
|
+
}),
|
|
35
|
+
emits: /* @__PURE__ */ O(["update:model-value"], ["update:modelValue"]),
|
|
36
|
+
setup(f, { emit: T }) {
|
|
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))
|
|
43
|
+
if (l.multiple)
|
|
44
|
+
Array.isArray(e) && (a.value = e.map(
|
|
45
|
+
(t) => A(t)
|
|
46
|
+
).filter((t) => t > -1));
|
|
47
|
+
else {
|
|
48
|
+
const t = A(e);
|
|
49
|
+
~t && (a.value = [t]);
|
|
50
|
+
}
|
|
51
|
+
}, X = (e) => {
|
|
52
|
+
s.value = !s.value, s.value && h.value && de(() => {
|
|
53
|
+
P.value?.focus();
|
|
54
|
+
});
|
|
55
|
+
}, A = (e) => n.value.findIndex(
|
|
56
|
+
(t) => t.value === e
|
|
57
|
+
), S = async (e = !1) => {
|
|
58
|
+
if (!l.resource)
|
|
59
|
+
return;
|
|
60
|
+
$.value = !0;
|
|
61
|
+
const t = {
|
|
62
|
+
t: c.value,
|
|
63
|
+
r: "option"
|
|
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);
|
|
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 = () => {
|
|
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(
|
|
71
|
+
(e) => l.filter(c.value, e)
|
|
72
|
+
));
|
|
73
|
+
}, 500));
|
|
74
|
+
}, Z = ({
|
|
75
|
+
index: e,
|
|
76
|
+
hold: t
|
|
77
|
+
}) => {
|
|
78
|
+
if (B = !0, l.multiple) {
|
|
79
|
+
const r = a.value.findIndex(
|
|
80
|
+
(w) => w === e
|
|
81
|
+
);
|
|
82
|
+
~r ? a.value.splice(r, 1) : a.value.push(e);
|
|
83
|
+
} else
|
|
84
|
+
a.value = [e];
|
|
85
|
+
(!l.multiple || !t) && (s.value = !1);
|
|
86
|
+
}, ee = () => {
|
|
87
|
+
b.value && v.value && v.value.pages > v.value.page && S(!0);
|
|
88
|
+
}, le = async (e) => {
|
|
89
|
+
switch (e.key) {
|
|
90
|
+
case "ArrowDown":
|
|
91
|
+
L.value?.move(e);
|
|
92
|
+
break;
|
|
93
|
+
case "Escape":
|
|
94
|
+
s.value = !1;
|
|
95
|
+
break;
|
|
96
|
+
}
|
|
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,
|
|
102
|
+
async (e) => {
|
|
103
|
+
e && (A(e) < 0 && b.value && await S(), m(e));
|
|
104
|
+
}
|
|
105
|
+
), I(
|
|
106
|
+
a,
|
|
107
|
+
(e) => {
|
|
108
|
+
const t = l.multiple ? n.value.filter(
|
|
109
|
+
(r, w) => a.value.includes(w)
|
|
110
|
+
).map((r) => r.value) : n.value[a.value[0]].value;
|
|
111
|
+
B && (B = !1, W(t));
|
|
112
|
+
},
|
|
113
|
+
{ deep: !0 }
|
|
114
|
+
), I(
|
|
115
|
+
() => l.options,
|
|
116
|
+
(e) => {
|
|
117
|
+
e.length > 0 && (n.value = e, u.value && a.value.length === 0 && m(u.value));
|
|
118
|
+
}
|
|
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),
|
|
124
|
+
placement: l.dropdownPlacement,
|
|
125
|
+
class: x([l.widthClass]),
|
|
126
|
+
ref_key: "popoverRef",
|
|
127
|
+
ref: F
|
|
128
|
+
}, {
|
|
129
|
+
default: R(() => [
|
|
130
|
+
K("div", {
|
|
131
|
+
class: x([{
|
|
132
|
+
"h-9": !l.multiple,
|
|
133
|
+
"h-full *:min-h-9": l.multiple,
|
|
134
|
+
[l.borderClass]: !0,
|
|
135
|
+
[l.roundnessClass]: !0
|
|
136
|
+
}, "flex justify-between items-center w-full max-w-96 input-text-color select-none input-bg-color"])
|
|
137
|
+
}, [
|
|
138
|
+
N(w, {
|
|
139
|
+
variant: "transparent",
|
|
140
|
+
size: "",
|
|
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
|
|
145
|
+
}]),
|
|
146
|
+
"aria-describedby": F.value?.name,
|
|
147
|
+
icon: s.value === !0 ? "chevron-up" : "chevron-down",
|
|
148
|
+
onClick: X
|
|
149
|
+
}, {
|
|
150
|
+
default: R(() => [
|
|
151
|
+
K("div", {
|
|
152
|
+
class: x(["inline-flex items-center ml-2 max-w-[calc(100%-2.5rem)]", {
|
|
153
|
+
"overflow-hidden whitespace-nowrap": !l.multiple,
|
|
154
|
+
"flex-wrap gap-2 py-1": l.multiple
|
|
155
|
+
}])
|
|
156
|
+
}, [
|
|
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,
|
|
163
|
+
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)
|
|
167
|
+
]),
|
|
168
|
+
_: 3
|
|
169
|
+
}, 8, ["aria-describedby", "class", "icon"]),
|
|
170
|
+
h.value ? ie((i(), d("input", {
|
|
171
|
+
key: 0,
|
|
172
|
+
"onUpdate:modelValue": t[0] || (t[0] = (o) => c.value = o),
|
|
173
|
+
type: "text",
|
|
174
|
+
ref_key: "inputRef",
|
|
175
|
+
ref: P,
|
|
176
|
+
placeholder: l.placeholder,
|
|
177
|
+
disabled: l.disabled,
|
|
178
|
+
readonly: !l.isSearchable,
|
|
179
|
+
class: "h-9 bg-transparent input-padding input-roundness input-outline",
|
|
180
|
+
onInput: Y,
|
|
181
|
+
onKeydown: le
|
|
182
|
+
}, null, 40, ye)), [
|
|
183
|
+
[re, c.value]
|
|
184
|
+
]) : M("", !0)
|
|
185
|
+
], 2)
|
|
186
|
+
]),
|
|
187
|
+
content: R(() => [
|
|
188
|
+
N(ae, {
|
|
189
|
+
ref_key: "dropdownRef",
|
|
190
|
+
ref: L,
|
|
191
|
+
items: n.value,
|
|
192
|
+
"is-visible": s.value,
|
|
193
|
+
multiple: l.multiple,
|
|
194
|
+
loading: $.value,
|
|
195
|
+
onChange: Z,
|
|
196
|
+
onEndReached: ee
|
|
197
|
+
}, ce({ _: 2 }, [
|
|
198
|
+
e.$slots.default || l.multiple ? {
|
|
199
|
+
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)
|
|
204
|
+
], 64)),
|
|
205
|
+
J(o) ? (i(), D(te, {
|
|
206
|
+
key: 2,
|
|
207
|
+
icon: "check",
|
|
208
|
+
size: "sm",
|
|
209
|
+
class: "float-right ml-2"
|
|
210
|
+
})) : M("", !0)
|
|
211
|
+
])) : (i(), d("div", be, [
|
|
212
|
+
k(e.$slots, "default", _(q(o)))
|
|
213
|
+
]))
|
|
214
|
+
]),
|
|
215
|
+
key: "0"
|
|
216
|
+
} : void 0
|
|
217
|
+
]), 1032, ["items", "is-visible", "multiple", "loading"])
|
|
218
|
+
]),
|
|
219
|
+
_: 3
|
|
220
|
+
}, 8, ["open", "placement", "class"]);
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
});
|
|
224
|
+
export {
|
|
225
|
+
ke as _
|
|
226
|
+
};
|
package/dist/Pagination.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { _ as i } from "./Pagination.vue_vue_type_script_setup_true_lang-
|
|
2
|
-
import { p as r } from "./plugin-
|
|
1
|
+
import { _ as i } from "./Pagination.vue_vue_type_script_setup_true_lang-CrsaPQHf.js";
|
|
2
|
+
import { p as r } from "./plugin-43qPVkHg.js";
|
|
3
3
|
export {
|
|
4
4
|
i as Pagination,
|
|
5
5
|
r as PaginationPlugin
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { defineComponent as B, computed as s, watch as V, resolveComponent as h, openBlock as p, createElementBlock as g, toDisplayString as _, createCommentVNode as v, createElementVNode as L, createVNode as b, normalizeClass as d, Fragment as S, renderList as D, createBlock as P } from "vue";
|
|
2
|
+
const I = { class: "flex gap-2 items-center flex-wrap" }, N = {
|
|
3
|
+
key: 0,
|
|
4
|
+
class: "md:block hidden"
|
|
5
|
+
}, O = { class: "h-9 flex" }, E = /* @__PURE__ */ B({
|
|
6
|
+
name: "TPagination",
|
|
7
|
+
__name: "Pagination",
|
|
8
|
+
props: {
|
|
9
|
+
disabled: { type: Boolean, default: !1 },
|
|
10
|
+
pagination: { default: () => ({}) },
|
|
11
|
+
hasPageSize: { type: Boolean, default: !0 },
|
|
12
|
+
pageLengths: { default: () => [12, 18, 24, 30, 36, 42] },
|
|
13
|
+
showDescription: { type: Boolean, default: !1 }
|
|
14
|
+
},
|
|
15
|
+
emits: ["updated"],
|
|
16
|
+
setup(k, { emit: y }) {
|
|
17
|
+
const e = k, u = y, c = s(() => e.pagination.page === 1), m = s(
|
|
18
|
+
() => e.pagination.page === e.pagination.pages
|
|
19
|
+
), w = s(() => {
|
|
20
|
+
const a = e.pagination.pages || 1, n = e.pagination.page || 1, t = [], r = Math.max(2, n - 2), i = Math.min(a - 1, n + 2);
|
|
21
|
+
a > 1 && t.push(1);
|
|
22
|
+
for (let o = r; o <= i; o++)
|
|
23
|
+
o > 1 && o < a && t.push(o);
|
|
24
|
+
return a > 1 && t.push(a), t;
|
|
25
|
+
}), $ = s(() => e.pageLengths.map((a) => ({
|
|
26
|
+
label: `${a} / page`,
|
|
27
|
+
value: a
|
|
28
|
+
}))), C = s(() => {
|
|
29
|
+
if (e.pagination.items && e.pagination.skip && e.pagination.items) {
|
|
30
|
+
const a = e.pagination.skip + 1, n = e.pagination.skip + e.pagination.items, t = e.pagination.totalItems;
|
|
31
|
+
return `Showing ${a} to ${n} of ${t} entries`;
|
|
32
|
+
}
|
|
33
|
+
return `Page ${e.pagination.page} of ${e.pagination.pages}`;
|
|
34
|
+
}), f = (a = e.pagination.page) => {
|
|
35
|
+
const n = {
|
|
36
|
+
...e.pagination,
|
|
37
|
+
page: a
|
|
38
|
+
};
|
|
39
|
+
"perPage" in e.pagination && "skip" in e.pagination && "totalItems" in e.pagination && (n.skip = a > 1 ? (a - 1) * e.pagination.perPage : 0, n.items = e.pagination.perPage ? e.pagination.perPage : e.pagination.totalItems - n.skip), Object.assign(e.pagination, n), u("updated", e.pagination);
|
|
40
|
+
}, l = (a) => {
|
|
41
|
+
a === e.pagination.page || a < 1 || a > e.pagination.pages || f(a);
|
|
42
|
+
}, z = (a) => {
|
|
43
|
+
Object.assign(e.pagination, {
|
|
44
|
+
...e.pagination,
|
|
45
|
+
perPage: a,
|
|
46
|
+
page: 1
|
|
47
|
+
}), u("updated", e.pagination);
|
|
48
|
+
};
|
|
49
|
+
return V(
|
|
50
|
+
() => e.pagination,
|
|
51
|
+
() => f(),
|
|
52
|
+
{ deep: !0, immediate: !0 }
|
|
53
|
+
), (a, n) => {
|
|
54
|
+
const t = h("t-button"), r = h("t-input-select");
|
|
55
|
+
return p(), g("div", I, [
|
|
56
|
+
a.showDescription ? (p(), g("div", N, _(C.value), 1)) : v("", !0),
|
|
57
|
+
L("div", O, [
|
|
58
|
+
b(t, {
|
|
59
|
+
size: "sm",
|
|
60
|
+
variant: "primary",
|
|
61
|
+
"disable-style": !0,
|
|
62
|
+
class: d(["h-9 px-2 input-roundness rounded-r-none", { "opacity-50 cursor-not-allowed": c.value }]),
|
|
63
|
+
icon: "chevron-left",
|
|
64
|
+
disabled: c.value,
|
|
65
|
+
onClick: n[0] || (n[0] = (i) => l(a.pagination.page - 1))
|
|
66
|
+
}, null, 8, ["class", "disabled"]),
|
|
67
|
+
(p(!0), g(S, null, D(w.value, (i) => (p(), P(t, {
|
|
68
|
+
"disable-style": !0,
|
|
69
|
+
label: `${i}`,
|
|
70
|
+
disabled: i === a.pagination.page,
|
|
71
|
+
class: d([{
|
|
72
|
+
"opacity-50 cursor-not-allowed": i === a.pagination.page
|
|
73
|
+
}, "h-9 px-2 rounded-none"]),
|
|
74
|
+
size: "sm",
|
|
75
|
+
variant: "primary",
|
|
76
|
+
onClick: (o) => l(i)
|
|
77
|
+
}, null, 8, ["label", "disabled", "class", "onClick"]))), 256)),
|
|
78
|
+
b(t, {
|
|
79
|
+
size: "sm",
|
|
80
|
+
variant: "primary",
|
|
81
|
+
"disable-style": !0,
|
|
82
|
+
class: d(["h-9 px-2 input-roundness rounded-l-none", { "opacity-50 cursor-not-allowed": m.value }]),
|
|
83
|
+
icon: "chevron-right",
|
|
84
|
+
disabled: m.value,
|
|
85
|
+
onClick: n[1] || (n[1] = (i) => l(a.pagination.page + 1))
|
|
86
|
+
}, null, 8, ["class", "disabled"])
|
|
87
|
+
]),
|
|
88
|
+
e.hasPageSize ? (p(), P(r, {
|
|
89
|
+
key: 1,
|
|
90
|
+
modelValue: a.pagination.perPage,
|
|
91
|
+
"onUpdate:modelValue": [
|
|
92
|
+
n[2] || (n[2] = (i) => a.pagination.perPage = i),
|
|
93
|
+
z
|
|
94
|
+
],
|
|
95
|
+
disabled: a.disabled,
|
|
96
|
+
options: $.value,
|
|
97
|
+
"dropdown-placement": "top",
|
|
98
|
+
class: "w-fit min-w-32"
|
|
99
|
+
}, null, 8, ["modelValue", "disabled", "options"])) : v("", !0)
|
|
100
|
+
]);
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
export {
|
|
105
|
+
E as _
|
|
106
|
+
};
|
package/dist/components.js
CHANGED
|
@@ -15,24 +15,24 @@ import { _ as v } from "./GraphySubtitle.vue_vue_type_script_setup_true_lang-DsB
|
|
|
15
15
|
import { _ as F } from "./GraphyTitle.vue_vue_type_script_setup_true_lang-DXnrZHV2.js";
|
|
16
16
|
import { _ as B } from "./Icon.vue_vue_type_script_setup_true_lang-DXUyEtqW.js";
|
|
17
17
|
import { _ as A } from "./InputAvatar.vue_vue_type_script_setup_true_lang-coNpUH5g.js";
|
|
18
|
-
import { _ as R } from "./InputCheckbox.vue_vue_type_style_index_0_lang-
|
|
18
|
+
import { _ as R } from "./InputCheckbox.vue_vue_type_style_index_0_lang-DnRqQiOj.js";
|
|
19
19
|
import { _ as q } from "./InputCryptoCurrency.vue_vue_type_script_setup_true_lang-BIUT5eCh.js";
|
|
20
20
|
import { _ as H } from "./InputColor.vue_vue_type_script_setup_true_lang-DT-MAgI2.js";
|
|
21
21
|
import { _ as K } from "./InputDate.vue_vue_type_script_setup_true_lang-BAgG9zPV.js";
|
|
22
22
|
import { _ as O } from "./InputMultiplier.vue_vue_type_script_setup_true_lang-BguqKGGe.js";
|
|
23
23
|
import { _ as U } from "./InputPassword.vue_vue_type_script_setup_true_lang-BghMiF8B.js";
|
|
24
24
|
import { _ as W } from "./InputPhone.vue_vue_type_script_setup_true_lang-B4TULqLW.js";
|
|
25
|
-
import { _ as Y } from "./InputPrice.vue_vue_type_script_setup_true_lang-
|
|
25
|
+
import { _ as Y } from "./InputPrice.vue_vue_type_script_setup_true_lang-C2wDVwnm.js";
|
|
26
26
|
import { _ as $ } from "./InputRadio.vue_vue_type_style_index_0_lang-DusKEybQ.js";
|
|
27
27
|
import "vue";
|
|
28
|
-
import { _ as or } from "./InputSelect.vue_vue_type_script_setup_true_lang-
|
|
28
|
+
import { _ as or } from "./InputSelect.vue_vue_type_script_setup_true_lang-B89uyzj-.js";
|
|
29
29
|
import { _ as er } from "./InputSwitch.vue_vue_type_script_setup_true_lang-Q3wQlqfk.js";
|
|
30
30
|
import { _ as ar } from "./InputText.vue_vue_type_script_setup_true_lang-JLAlUE_2.js";
|
|
31
31
|
import { _ as sr } from "./InputTextarea.vue_vue_type_script_setup_true_lang-DRo5eIw4.js";
|
|
32
32
|
import { _ as fr } from "./Link.vue_vue_type_script_setup_true_lang-gTf77Jvd.js";
|
|
33
33
|
import { _ as nr } from "./Modal.vue_vue_type_script_setup_true_lang-CEaX1svl.js";
|
|
34
34
|
import { _ as ur } from "./ModalForm.vue_vue_type_script_setup_true_lang-RfK0Mn81.js";
|
|
35
|
-
import { _ as lr } from "./Pagination.vue_vue_type_script_setup_true_lang-
|
|
35
|
+
import { _ as lr } from "./Pagination.vue_vue_type_script_setup_true_lang-CrsaPQHf.js";
|
|
36
36
|
import { _ as cr } from "./Popconfirm.vue_vue_type_script_setup_true_lang-XyjBUx0p.js";
|
|
37
37
|
import { _ as Tr } from "./Popover.vue_vue_type_script_setup_true_lang-dnL75W40.js";
|
|
38
38
|
import { P as Cr } from "./ProgressCircle-Cpmi2CpO.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r } from "./register-component-B-fdqewb.js";
|
|
2
|
-
import { _ as s } from "./Pagination.vue_vue_type_script_setup_true_lang-
|
|
2
|
+
import { _ as s } from "./Pagination.vue_vue_type_script_setup_true_lang-CrsaPQHf.js";
|
|
3
3
|
const m = {
|
|
4
4
|
install(o) {
|
|
5
5
|
r(o, s);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r } from "./register-component-B-fdqewb.js";
|
|
2
|
-
import { _ as s } from "./InputSelect.vue_vue_type_script_setup_true_lang-
|
|
2
|
+
import { _ as s } from "./InputSelect.vue_vue_type_script_setup_true_lang-B89uyzj-.js";
|
|
3
3
|
const m = {
|
|
4
4
|
install(o) {
|
|
5
5
|
r(o, s);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r } from "./register-component-B-fdqewb.js";
|
|
2
|
-
import { _ as s } from "./InputPrice.vue_vue_type_script_setup_true_lang-
|
|
2
|
+
import { _ as s } from "./InputPrice.vue_vue_type_script_setup_true_lang-C2wDVwnm.js";
|
|
3
3
|
const m = {
|
|
4
4
|
install(o) {
|
|
5
5
|
r(o, s);
|
|
@@ -24,19 +24,19 @@ import { p as e } from "./plugin-DOeDaXWj.js";
|
|
|
24
24
|
import "./Icon.vue_vue_type_script_setup_true_lang-DXUyEtqW.js";
|
|
25
25
|
import { p as $ } from "./plugin-Dk3KBChD.js";
|
|
26
26
|
import { p as I } from "./plugin--F5QK2vy.js";
|
|
27
|
-
import "./InputCheckbox.vue_vue_type_style_index_0_lang-
|
|
28
|
-
import { p as c } from "./plugin-
|
|
27
|
+
import "./InputCheckbox.vue_vue_type_style_index_0_lang-DnRqQiOj.js";
|
|
28
|
+
import { p as c } from "./plugin-4XhHBTQc.js";
|
|
29
29
|
import { p as h } from "./plugin-Bq4nQPd4.js";
|
|
30
30
|
import { p as y } from "./plugin-D9KHvOM3.js";
|
|
31
31
|
import { p as b } from "./plugin-BtF6kCcf.js";
|
|
32
32
|
import { p as d } from "./plugin-Br-QOjhk.js";
|
|
33
33
|
import { p as T } from "./plugin-BT2ef1QG.js";
|
|
34
34
|
import { p as C } from "./plugin-CrHDShgh.js";
|
|
35
|
-
import { p as S } from "./plugin-
|
|
35
|
+
import { p as S } from "./plugin-CQ-FpZui.js";
|
|
36
36
|
import "./InputRadio.vue_vue_type_style_index_0_lang-DusKEybQ.js";
|
|
37
37
|
import { p as v } from "./plugin-Y4yYnlO3.js";
|
|
38
|
-
import "./InputSelect.vue_vue_type_script_setup_true_lang-
|
|
39
|
-
import { p as G } from "./plugin-
|
|
38
|
+
import "./InputSelect.vue_vue_type_script_setup_true_lang-B89uyzj-.js";
|
|
39
|
+
import { p as G } from "./plugin-C77cnZuW.js";
|
|
40
40
|
import { p as k } from "./plugin-BZOU6h10.js";
|
|
41
41
|
import { p as w } from "./plugin-lYDlOt8p.js";
|
|
42
42
|
import { p as x } from "./plugin-BQFwx3d5.js";
|
|
@@ -44,7 +44,7 @@ import "./Link.vue_vue_type_script_setup_true_lang-gTf77Jvd.js";
|
|
|
44
44
|
import { p as D } from "./plugin-DHstqRmE.js";
|
|
45
45
|
import { p as F } from "./plugin-DKjcKBPg.js";
|
|
46
46
|
import { p as L } from "./plugin-DNXazWwT.js";
|
|
47
|
-
import { p as M } from "./plugin-
|
|
47
|
+
import { p as M } from "./plugin-43qPVkHg.js";
|
|
48
48
|
import "./Popconfirm.vue_vue_type_script_setup_true_lang-XyjBUx0p.js";
|
|
49
49
|
import { p as _ } from "./plugin-Ee4Z5Rtp.js";
|
|
50
50
|
import "./Popover.vue_vue_type_script_setup_true_lang-dnL75W40.js";
|