@caipira/tamandua 0.0.29 → 0.0.31

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