@caipira/tamandua 0.0.30 → 0.0.32
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 +1 -0
- package/dist/Avatar.js +2 -2
- package/dist/Avatar.vue_vue_type_script_setup_true_lang-C8p8_0Uc.js +47 -0
- package/dist/{Button-COkapD0v.js → Button-CAiIEdkK.js} +47 -46
- package/dist/Button.css +1 -1
- package/dist/Button.js +2 -2
- package/dist/Dropdown.js +2 -2
- package/dist/{Dropdown.vue_vue_type_script_setup_true_lang-Bt-imwu7.js → Dropdown.vue_vue_type_script_setup_true_lang-pjG__bX2.js} +1 -1
- package/dist/Icon.js +2 -2
- package/dist/Icon.vue_vue_type_script_setup_true_lang-DXUyEtqW.js +45 -0
- package/dist/InputCheckbox.js +2 -2
- package/dist/{InputCheckbox.vue_vue_type_script_setup_true_lang-DUczNK1m.js → InputCheckbox.vue_vue_type_script_setup_true_lang-Bh8HA3Ay.js} +8 -8
- package/dist/InputDate.js +2 -2
- package/dist/InputDate.vue_vue_type_script_setup_true_lang-BAgG9zPV.js +188 -0
- package/dist/InputPhone.js +2 -2
- package/dist/{InputPhone.vue_vue_type_script_setup_true_lang-DXtliNyv.js → InputPhone.vue_vue_type_script_setup_true_lang-B4TULqLW.js} +24 -23
- package/dist/InputPrice.js +2 -2
- package/dist/InputPrice.vue_vue_type_script_setup_true_lang-BX4rsYIr.js +67 -0
- package/dist/InputRadio.js +2 -2
- package/dist/{InputRadio.vue_vue_type_script_setup_true_lang-Dqbov2kN.js → InputRadio.vue_vue_type_script_setup_true_lang-Cu7lzDAh.js} +7 -7
- package/dist/InputSelect.js +2 -2
- package/dist/InputSelect.vue_vue_type_script_setup_true_lang-BlA3DIYZ.js +232 -0
- package/dist/Popconfirm.js +2 -2
- package/dist/Popconfirm.vue_vue_type_script_setup_true_lang-XyjBUx0p.js +62 -0
- package/dist/Popover.js +2 -2
- package/dist/Popover.vue_vue_type_script_setup_true_lang-dnL75W40.js +987 -0
- package/dist/{Table-COkg498M.js → Table-C0Sr_Lfm.js} +2 -2
- package/dist/Table.css +1 -1
- package/dist/Table.js +2 -2
- package/dist/Tag.js +2 -2
- package/dist/Tag.vue_vue_type_script_setup_true_lang-CgX-nT8V.js +74 -0
- package/dist/components.js +14 -14
- package/dist/composables.js +27 -16
- package/dist/index.css +2 -1
- package/dist/{plugin-VtriDxZB.js → plugin-Bog7k3Qf.js} +1 -1
- package/dist/{plugin-Dy14_LJS.js → plugin-BtF6kCcf.js} +1 -1
- package/dist/{plugin-BwRXtPzh.js → plugin-CNqL90UL.js} +1 -1
- package/dist/{plugin-B2fe1hFi.js → plugin-CTMcmMdr.js} +1 -1
- package/dist/{plugin-Dp-F27SY.js → plugin-CdJ1wBq2.js} +1 -1
- package/dist/{plugin-CGIfywdY.js → plugin-CrHDShgh.js} +1 -1
- package/dist/{plugin-CClGi0co.js → plugin-D8CsjFdw.js} +1 -1
- package/dist/{plugin-BOXtmhcZ.js → plugin-DDoM02Fq.js} +1 -1
- package/dist/{plugin-B97SpnhW.js → plugin-DLkeyKDM.js} +1 -1
- package/dist/{plugin-BR7RSh1H.js → plugin-Daf_swsz.js} +1 -1
- package/dist/{plugin-CBhgqomZ.js → plugin-DcWjzc_X.js} +1 -1
- package/dist/{plugin-BriPeDzu.js → plugin-Dk3KBChD.js} +1 -1
- package/dist/{plugin-Bt6de9ZA.js → plugin-Ee4Z5Rtp.js} +1 -1
- package/dist/{plugin-DgCWOSWh.js → plugin-z8Hr_T_O.js} +1 -1
- package/dist/{plugins-CxgvV4Py.js → plugins-ChB184ip.js} +22 -22
- package/dist/plugins.js +22 -22
- package/dist/tamandua.js +1 -1
- package/dist/types/components/InputSelect/types.d.ts +3 -1
- package/dist/types/components/Popconfirm/Popconfirm.vue.d.ts +3 -1
- package/dist/types/components/Popover/Popover.vue.d.ts +51 -35
- package/dist/types/components/Popover/types.d.ts +7 -1
- package/dist/types/composables/useDomHelpers.d.ts +0 -4
- package/dist/useDomHelpers-CGVrQd35.js +19 -0
- package/package.json +3 -3
- package/dist/Avatar.vue_vue_type_script_setup_true_lang-Cjz3Vlw9.js +0 -51
- package/dist/Icon.vue_vue_type_script_setup_true_lang-CNUyv7CY.js +0 -49
- package/dist/InputDate.vue_vue_type_script_setup_true_lang-Do47MTJJ.js +0 -188
- package/dist/InputPrice.vue_vue_type_script_setup_true_lang-DBMW1AwZ.js +0 -66
- package/dist/InputSelect.vue_vue_type_script_setup_true_lang-ukwmeVxc.js +0 -226
- package/dist/Popconfirm.vue_vue_type_script_setup_true_lang-BNpLdXq7.js +0 -63
- package/dist/Popover.vue_vue_type_script_setup_true_lang-B4Polh2y.js +0 -985
- package/dist/Tag.vue_vue_type_script_setup_true_lang-0p-7UEvO.js +0 -72
- package/dist/types/components/EventListener/EventListener.vue.d.ts +0 -6
- package/dist/useDomHelpers-5CFMo6bx.js +0 -23
- package/dist/useRender-D8PeooXE.js +0 -16
|
@@ -1,226 +0,0 @@
|
|
|
1
|
-
import { defineComponent as se, ref as p, computed as R, onBeforeMount as ie, onBeforeUnmount as ue, watch as $, resolveComponent as b, openBlock as i, createElementBlock as c, createElementVNode as re, normalizeClass as D, withKeys as ce, renderSlot as h, normalizeProps as k, mergeProps as I, Fragment as V, renderList as M, guardReactiveProps as j, createBlock as P, toDisplayString as pe, createCommentVNode as U, withDirectives as de, vModelText as fe, createVNode as A, withCtx as H, createSlots as ve, nextTick as me } from "vue";
|
|
2
|
-
import { u as ye } from "./useDomHelpers-5CFMo6bx.js";
|
|
3
|
-
import { a as be, E as he } from "./ui-BC6H9E93.js";
|
|
4
|
-
const ke = { key: 1 }, we = ["placeholder", "disabled", "readonly"], ge = {
|
|
5
|
-
key: 0,
|
|
6
|
-
class: "inline-flex w-full justify-between items-center"
|
|
7
|
-
}, Ve = {
|
|
8
|
-
key: 1,
|
|
9
|
-
class: "inline-flex items-center"
|
|
10
|
-
};
|
|
11
|
-
let _e = 0;
|
|
12
|
-
const Be = /* @__PURE__ */ se({
|
|
13
|
-
name: "TInputSelect",
|
|
14
|
-
__name: "InputSelect",
|
|
15
|
-
props: {
|
|
16
|
-
size: { default: be.Default },
|
|
17
|
-
options: { default: () => [] },
|
|
18
|
-
mapper: { type: Function, default: (f) => ({ value: f.id ?? f.uuid, label: f }) },
|
|
19
|
-
filter: { type: Function, default: (f, _) => _.label.toLowerCase().indexOf(f.toLowerCase()) >= 0 },
|
|
20
|
-
tooltip: { default: "" },
|
|
21
|
-
disabled: { type: Boolean },
|
|
22
|
-
resource: {},
|
|
23
|
-
multiple: { type: Boolean, default: !1 },
|
|
24
|
-
modelValue: {},
|
|
25
|
-
placeholder: { default: "" },
|
|
26
|
-
initialValue: {},
|
|
27
|
-
disableStyle: { type: Boolean, default: !1 },
|
|
28
|
-
isSearchable: { type: Boolean, default: !1 },
|
|
29
|
-
dropdownPlacement: { default: he.BOTTOM }
|
|
30
|
-
},
|
|
31
|
-
emits: ["update:model-value"],
|
|
32
|
-
setup(f, { emit: _ }) {
|
|
33
|
-
const l = f;
|
|
34
|
-
let S = !1, w, T = "";
|
|
35
|
-
const N = _, q = `checkbox_${++_e}`, r = p(""), o = p([]), z = p(null), x = p(null), n = p(!1), L = p(null), a = p([]), C = p(!1), { wasClickOutsideOfContainer: G } = ye(), d = p(null), B = R(() => a.value.length > 0), O = R(() => l.isSearchable && n.value), m = R(() => typeof l.resource == "function"), J = (e) => !l.multiple || !l.modelValue || !Array.isArray(l.modelValue) ? !1 : l.modelValue.includes(e.value), Q = (e = l.modelValue) => !(e === void 0 || e === "" || Array.isArray(e) && e.length === 0), W = (e) => {
|
|
36
|
-
N("update:model-value", e);
|
|
37
|
-
}, v = (e = l.modelValue) => {
|
|
38
|
-
if (Q(e))
|
|
39
|
-
if (l.multiple)
|
|
40
|
-
Array.isArray(e) && (a.value = e.map(
|
|
41
|
-
(t) => E(t)
|
|
42
|
-
).filter((t) => t > -1));
|
|
43
|
-
else {
|
|
44
|
-
const t = E(e);
|
|
45
|
-
~t && (a.value = [t]);
|
|
46
|
-
}
|
|
47
|
-
}, F = (e) => {
|
|
48
|
-
n.value = !n.value, n.value && O.value && me(() => {
|
|
49
|
-
z.value?.focus();
|
|
50
|
-
}), e.stopPropagation();
|
|
51
|
-
}, E = (e) => o.value.findIndex(
|
|
52
|
-
(t) => t.value === e
|
|
53
|
-
), K = (e) => {
|
|
54
|
-
x.value && G(e, x.value) && (n.value = !1);
|
|
55
|
-
}, g = async (e = !1) => {
|
|
56
|
-
if (!l.resource)
|
|
57
|
-
return;
|
|
58
|
-
C.value = !0;
|
|
59
|
-
const t = {
|
|
60
|
-
t: r.value,
|
|
61
|
-
r: "option"
|
|
62
|
-
};
|
|
63
|
-
e && d.value && d.value.pages > d.value.page ? t.page = d.value.page + 1 : e = !1, !r.value && l.modelValue && (t.i = l.modelValue);
|
|
64
|
-
const u = await l.resource(t);
|
|
65
|
-
e ? o.value.push(...u.items.map(l.mapper)) : o.value = u.items.map(l.mapper), d.value = u.pagination, !m.value && r.value && v(r.value), C.value = !1;
|
|
66
|
-
}, X = () => {
|
|
67
|
-
!r.value || T === r.value || (w && (clearTimeout(w), w = null), w = setTimeout(() => {
|
|
68
|
-
T = r.value, m.value ? (n.value || (n.value = !0), g()) : l.isSearchable && (o.value = l.options.filter(
|
|
69
|
-
(e) => l.filter(r.value, e)
|
|
70
|
-
));
|
|
71
|
-
}, 500));
|
|
72
|
-
}, Y = () => {
|
|
73
|
-
n.value = !1;
|
|
74
|
-
}, Z = (e) => {
|
|
75
|
-
n.value = !1, e.stopPropagation();
|
|
76
|
-
}, ee = ({
|
|
77
|
-
index: e,
|
|
78
|
-
hold: t
|
|
79
|
-
}) => {
|
|
80
|
-
if (S = !0, l.multiple) {
|
|
81
|
-
const u = a.value.findIndex(
|
|
82
|
-
(y) => y === e
|
|
83
|
-
);
|
|
84
|
-
~u ? a.value.splice(u, 1) : a.value.push(e);
|
|
85
|
-
} else
|
|
86
|
-
a.value = [e];
|
|
87
|
-
(!l.multiple || !t) && (n.value = !1);
|
|
88
|
-
}, le = () => {
|
|
89
|
-
m.value && d.value && d.value.pages > d.value.page && g(!0);
|
|
90
|
-
}, te = async (e) => {
|
|
91
|
-
switch (e.key) {
|
|
92
|
-
case "ArrowDown":
|
|
93
|
-
L.value?.move(e);
|
|
94
|
-
break;
|
|
95
|
-
}
|
|
96
|
-
};
|
|
97
|
-
return ie(async () => {
|
|
98
|
-
m.value ? (await g(), v()) : l.options.length > 0 && (o.value = l.options), !l.modelValue && l.initialValue ? v(l.initialValue) : v(l.modelValue), document.addEventListener("click", K);
|
|
99
|
-
}), ue(() => {
|
|
100
|
-
document.removeEventListener("click", K);
|
|
101
|
-
}), $(
|
|
102
|
-
() => l.modelValue,
|
|
103
|
-
async (e) => {
|
|
104
|
-
e && (E(e) < 0 && m.value && await g(), v(e));
|
|
105
|
-
}
|
|
106
|
-
), $(
|
|
107
|
-
a,
|
|
108
|
-
(e) => {
|
|
109
|
-
const t = l.multiple ? o.value.filter(
|
|
110
|
-
(u, y) => a.value.includes(y)
|
|
111
|
-
).map((u) => u.value) : o.value[a.value[0]].value;
|
|
112
|
-
S && (S = !1, W(t));
|
|
113
|
-
},
|
|
114
|
-
{ deep: !0 }
|
|
115
|
-
), $(
|
|
116
|
-
() => l.options,
|
|
117
|
-
(e) => {
|
|
118
|
-
e.length > 0 && (o.value = e, l.modelValue && a.value.length === 0 && v(l.modelValue));
|
|
119
|
-
}
|
|
120
|
-
), (e, t) => {
|
|
121
|
-
const u = b("t-tag"), y = b("t-button"), ae = b("t-icon"), oe = b("t-dropdown"), ne = b("t-popover");
|
|
122
|
-
return i(), c("div", null, [
|
|
123
|
-
re("div", {
|
|
124
|
-
ref_key: "wrapperRef",
|
|
125
|
-
ref: x,
|
|
126
|
-
class: D([{
|
|
127
|
-
"h-9": !l.disableStyle && !l.multiple,
|
|
128
|
-
"min-h-9": !l.disableStyle && l.multiple,
|
|
129
|
-
"text-left select-none input-bg-color input-text-color border input-border input-roundness": !l.disableStyle
|
|
130
|
-
}, "inline-flex justify-between items-center w-full text-left"]),
|
|
131
|
-
role: "button",
|
|
132
|
-
onClick: F,
|
|
133
|
-
onBlur: Y,
|
|
134
|
-
onKeyup: ce(Z, ["esc"])
|
|
135
|
-
}, [
|
|
136
|
-
O.value ? de((i(), c("input", {
|
|
137
|
-
key: 1,
|
|
138
|
-
"onUpdate:modelValue": t[0] || (t[0] = (s) => r.value = s),
|
|
139
|
-
type: "text",
|
|
140
|
-
ref_key: "inputRef",
|
|
141
|
-
ref: z,
|
|
142
|
-
placeholder: l.placeholder,
|
|
143
|
-
disabled: l.disabled,
|
|
144
|
-
readonly: !l.isSearchable,
|
|
145
|
-
class: D([{ "cursor-pointer": !l.isSearchable }, "w-full h-9 bg-transparent input-padding input-roundness input-outline"]),
|
|
146
|
-
onClick: t[1] || (t[1] = (s) => s.stopPropagation()),
|
|
147
|
-
onInput: X,
|
|
148
|
-
onKeydown: te
|
|
149
|
-
}, null, 42, we)), [
|
|
150
|
-
[fe, r.value]
|
|
151
|
-
]) : (i(), c("div", {
|
|
152
|
-
key: 0,
|
|
153
|
-
class: D(["flex items-center ml-2", {
|
|
154
|
-
"overflow-hidden whitespace-nowrap": !l.multiple,
|
|
155
|
-
"flex-wrap gap-2 py-1": l.multiple
|
|
156
|
-
}])
|
|
157
|
-
}, [
|
|
158
|
-
e.$slots.selection && B.value ? h(e.$slots, "selection", k(I({ key: 0 }, o.value[a.value[0]].label))) : e.$slots.default && B.value ? (i(), c(V, { key: 1 }, [
|
|
159
|
-
l.multiple ? (i(!0), c(V, { key: 0 }, M(a.value, (s) => h(e.$slots, "default", k(j(o.value[s].label)))), 256)) : h(e.$slots, "default", k(I({ key: 1 }, o.value[a.value[0]].label)))
|
|
160
|
-
], 64)) : B.value ? (i(), c(V, { key: 2 }, [
|
|
161
|
-
l.multiple ? (i(!0), c(V, { key: 0 }, M(a.value, (s) => (i(), P(u, {
|
|
162
|
-
key: s,
|
|
163
|
-
text: o.value[s].label,
|
|
164
|
-
color: "#6e6e6e"
|
|
165
|
-
}, null, 8, ["text"]))), 128)) : (i(), c("span", ke, pe(o.value[a.value[0]]?.label), 1))
|
|
166
|
-
], 64)) : U("", !0)
|
|
167
|
-
], 2)),
|
|
168
|
-
A(y, {
|
|
169
|
-
variant: "transparent",
|
|
170
|
-
size: "sm",
|
|
171
|
-
"disable-style": !0,
|
|
172
|
-
class: "h-9",
|
|
173
|
-
icon: n.value === !0 ? "chevron-up" : "chevron-down",
|
|
174
|
-
onClick: F
|
|
175
|
-
}, null, 8, ["icon"])
|
|
176
|
-
], 34),
|
|
177
|
-
A(ne, {
|
|
178
|
-
placement: l.dropdownPlacement,
|
|
179
|
-
"is-visible": n.value
|
|
180
|
-
}, {
|
|
181
|
-
content: H(() => [
|
|
182
|
-
A(oe, {
|
|
183
|
-
ref_key: "dropdownRef",
|
|
184
|
-
ref: L,
|
|
185
|
-
owner: q,
|
|
186
|
-
items: o.value,
|
|
187
|
-
"is-visible": n.value,
|
|
188
|
-
multiple: l.multiple,
|
|
189
|
-
loading: C.value,
|
|
190
|
-
class: "fixed",
|
|
191
|
-
"aria-describedby": "tooltip",
|
|
192
|
-
onChange: ee,
|
|
193
|
-
onEndReached: le
|
|
194
|
-
}, ve({ _: 2 }, [
|
|
195
|
-
e.$slots.default || l.multiple ? {
|
|
196
|
-
name: "default",
|
|
197
|
-
fn: H((s) => [
|
|
198
|
-
l.multiple ? (i(), c("div", ge, [
|
|
199
|
-
e.$slots.default ? h(e.$slots, "default", k(I({ key: 0 }, s.label))) : (i(), P(u, {
|
|
200
|
-
key: 1,
|
|
201
|
-
text: s.label,
|
|
202
|
-
class: "m-1"
|
|
203
|
-
}, null, 8, ["text"])),
|
|
204
|
-
J(s) ? (i(), P(ae, {
|
|
205
|
-
key: 2,
|
|
206
|
-
icon: "check",
|
|
207
|
-
size: "sm",
|
|
208
|
-
class: "float-right ml-2"
|
|
209
|
-
})) : U("", !0)
|
|
210
|
-
])) : (i(), c("div", Ve, [
|
|
211
|
-
h(e.$slots, "default", k(j(s.label)))
|
|
212
|
-
]))
|
|
213
|
-
]),
|
|
214
|
-
key: "0"
|
|
215
|
-
} : void 0
|
|
216
|
-
]), 1032, ["items", "is-visible", "multiple", "loading"])
|
|
217
|
-
]),
|
|
218
|
-
_: 3
|
|
219
|
-
}, 8, ["placement", "is-visible"])
|
|
220
|
-
]);
|
|
221
|
-
};
|
|
222
|
-
}
|
|
223
|
-
});
|
|
224
|
-
export {
|
|
225
|
-
Be as _
|
|
226
|
-
};
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { defineComponent as b, ref as g, resolveComponent as t, openBlock as k, createBlock as y, withCtx as r, createElementVNode as o, createVNode as n, toDisplayString as P, renderSlot as w } from "vue";
|
|
2
|
-
import { E as h } from "./ui-BC6H9E93.js";
|
|
3
|
-
const z = { class: "text-sm mb-6 inline-flex items-center" }, B = { class: "color-text" }, E = { class: "flex justify-end gap-2" }, O = /* @__PURE__ */ b({
|
|
4
|
-
name: "TPopconfirm",
|
|
5
|
-
__name: "Popconfirm",
|
|
6
|
-
props: {
|
|
7
|
-
message: { default: "" },
|
|
8
|
-
placement: { default: h.BOTTOM }
|
|
9
|
-
},
|
|
10
|
-
emits: ["confirm"],
|
|
11
|
-
setup(m, { emit: p }) {
|
|
12
|
-
const s = m, f = p, c = g(), _ = (e) => (c.value = e, e), d = () => {
|
|
13
|
-
c.value.visible = !1;
|
|
14
|
-
}, u = (e) => {
|
|
15
|
-
f("confirm"), e(!1);
|
|
16
|
-
};
|
|
17
|
-
return (e, l) => {
|
|
18
|
-
const v = t("t-icon"), i = t("t-button"), C = t("t-popover");
|
|
19
|
-
return k(), y(C, {
|
|
20
|
-
placement: s.placement,
|
|
21
|
-
"slot-wrapper-classes": "rounded",
|
|
22
|
-
ref: _
|
|
23
|
-
}, {
|
|
24
|
-
content: r(({ onTogglePopover: x }) => [
|
|
25
|
-
o("div", {
|
|
26
|
-
class: "mx-2 my-3 select-none",
|
|
27
|
-
onClick: l[0] || (l[0] = (a) => a.stopPropagation())
|
|
28
|
-
}, [
|
|
29
|
-
o("p", z, [
|
|
30
|
-
n(v, {
|
|
31
|
-
icon: "info-outline",
|
|
32
|
-
class: "color-caipira-yellow mr-1",
|
|
33
|
-
size: "sm"
|
|
34
|
-
}),
|
|
35
|
-
o("span", B, P(s.message), 1)
|
|
36
|
-
]),
|
|
37
|
-
o("div", E, [
|
|
38
|
-
n(i, {
|
|
39
|
-
variant: "warning",
|
|
40
|
-
label: "Cancel",
|
|
41
|
-
size: "sm",
|
|
42
|
-
onClick: d
|
|
43
|
-
}),
|
|
44
|
-
n(i, {
|
|
45
|
-
variant: "primary",
|
|
46
|
-
label: "Confirm",
|
|
47
|
-
size: "sm",
|
|
48
|
-
onClick: (a) => u(x)
|
|
49
|
-
}, null, 8, ["onClick"])
|
|
50
|
-
])
|
|
51
|
-
])
|
|
52
|
-
]),
|
|
53
|
-
default: r(() => [
|
|
54
|
-
w(e.$slots, "default")
|
|
55
|
-
]),
|
|
56
|
-
_: 3
|
|
57
|
-
}, 8, ["placement"]);
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
export {
|
|
62
|
-
O as _
|
|
63
|
-
};
|