@caipira/tamandua 0.0.30 → 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 (58) 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/Tag.js +2 -2
  24. package/dist/Tag.vue_vue_type_script_setup_true_lang-CgX-nT8V.js +74 -0
  25. package/dist/components.js +11 -11
  26. package/dist/composables.js +27 -16
  27. package/dist/index.css +1 -1
  28. package/dist/{plugin-Dp-F27SY.js → plugin--NhgQEQ9.js} +1 -1
  29. package/dist/{plugin-Dy14_LJS.js → plugin-CN6om3My.js} +1 -1
  30. package/dist/{plugin-BwRXtPzh.js → plugin-CNqL90UL.js} +1 -1
  31. package/dist/{plugin-CGIfywdY.js → plugin-CrHDShgh.js} +1 -1
  32. package/dist/{plugin-CClGi0co.js → plugin-D8CsjFdw.js} +1 -1
  33. package/dist/{plugin-BOXtmhcZ.js → plugin-DDoM02Fq.js} +1 -1
  34. package/dist/{plugin-BR7RSh1H.js → plugin-Daf_swsz.js} +1 -1
  35. package/dist/{plugin-CBhgqomZ.js → plugin-DcWjzc_X.js} +1 -1
  36. package/dist/{plugin-BriPeDzu.js → plugin-Dk3KBChD.js} +1 -1
  37. package/dist/{plugin-Bt6de9ZA.js → plugin-Ee4Z5Rtp.js} +1 -1
  38. package/dist/{plugin-DgCWOSWh.js → plugin-z8Hr_T_O.js} +1 -1
  39. package/dist/{plugins-CxgvV4Py.js → plugins-ph4w98yE.js} +18 -18
  40. package/dist/plugins.js +18 -18
  41. package/dist/tamandua.js +1 -1
  42. package/dist/types/components/InputSelect/types.d.ts +3 -1
  43. package/dist/types/components/Popconfirm/Popconfirm.vue.d.ts +3 -1
  44. package/dist/types/components/Popover/Popover.vue.d.ts +42 -35
  45. package/dist/types/components/Popover/types.d.ts +0 -1
  46. package/dist/types/composables/useDomHelpers.d.ts +0 -4
  47. package/dist/useDomHelpers-CGVrQd35.js +19 -0
  48. package/package.json +3 -3
  49. package/dist/Avatar.vue_vue_type_script_setup_true_lang-Cjz3Vlw9.js +0 -51
  50. package/dist/Icon.vue_vue_type_script_setup_true_lang-CNUyv7CY.js +0 -49
  51. package/dist/InputPrice.vue_vue_type_script_setup_true_lang-DBMW1AwZ.js +0 -66
  52. package/dist/InputSelect.vue_vue_type_script_setup_true_lang-ukwmeVxc.js +0 -226
  53. package/dist/Popconfirm.vue_vue_type_script_setup_true_lang-BNpLdXq7.js +0 -63
  54. package/dist/Popover.vue_vue_type_script_setup_true_lang-B4Polh2y.js +0 -985
  55. package/dist/Tag.vue_vue_type_script_setup_true_lang-0p-7UEvO.js +0 -72
  56. package/dist/types/components/EventListener/EventListener.vue.d.ts +0 -6
  57. package/dist/useDomHelpers-5CFMo6bx.js +0 -23
  58. package/dist/useRender-D8PeooXE.js +0 -16
@@ -1,51 +0,0 @@
1
- import { defineComponent as f, getCurrentInstance as h, computed as _, resolveComponent as y, openBlock as l, createElementBlock as r, normalizeClass as v, unref as t, createBlock as S, toDisplayString as z, createCommentVNode as b } from "vue";
2
- import { u as g } from "./useDomHelpers-5CFMo6bx.js";
3
- import { a as o, b as i } from "./ui-BC6H9E93.js";
4
- const C = ["role"], k = ["src"], w = { key: 2 }, D = /* @__PURE__ */ f({
5
- name: "TAvatar",
6
- __name: "Avatar",
7
- props: {
8
- icon: {},
9
- text: { default: "" },
10
- role: { default: "" },
11
- size: { default: o.Default },
12
- image: { default: "" },
13
- shape: { default: i.Circle },
14
- disableStyle: { type: Boolean, default: !1 }
15
- },
16
- setup(c) {
17
- const e = c, a = h(), { isPopoverActivator: s, onPopoverActivatorClick: u } = g(), m = _(() => e.role !== "" ? e.role : a && s(a) ? "button" : ""), p = (n) => {
18
- a && s(a) && u(n, a);
19
- };
20
- return (n, x) => {
21
- const d = y("t-icon");
22
- return l(), r("div", {
23
- role: m.value,
24
- class: v([{
25
- "h-5 w-5": !e.disableStyle && e.size === t(o).ExtraSmall,
26
- "h-7 w-7": !e.disableStyle && e.size === t(o).Small,
27
- "h-10 w-10": !e.disableStyle && e.size === t(o).Default,
28
- "h-20 w-20": !e.disableStyle && e.size === t(o).Large,
29
- "h-40 w-40": !e.disableStyle && e.size === t(o).ExtraLarge,
30
- "rounded-full": e.shape === t(i).Circle,
31
- rounded: e.shape === t(i).Square
32
- }, "overflow-hidden inline-flex items-center justify-center bg-caipira-primary-inverted"]),
33
- onClick: p
34
- }, [
35
- e.image ? (l(), r("img", {
36
- key: 0,
37
- class: "w-full h-full object-cover",
38
- src: e.image
39
- }, null, 8, k)) : e.icon ? (l(), S(d, {
40
- key: 1,
41
- class: "color-caipira-primary",
42
- icon: e.icon,
43
- size: e.size
44
- }, null, 8, ["icon", "size"])) : e.text ? (l(), r("span", w, z(e.text), 1)) : b("", !0)
45
- ], 10, C);
46
- };
47
- }
48
- });
49
- export {
50
- D as _
51
- };
@@ -1,49 +0,0 @@
1
- import { defineComponent as k, ref as g, getCurrentInstance as b, computed as v, watch as w, openBlock as y, createElementBlock as x, normalizeClass as z, unref as e, normalizeStyle as _ } from "vue";
2
- import { u as C } from "./useDomHelpers-5CFMo6bx.js";
3
- import { a as t } from "./ui-BC6H9E93.js";
4
- const E = (r, n) => {
5
- const s = r[n];
6
- return s ? typeof s == "function" ? s() : Promise.resolve(s) : new Promise((c, o) => {
7
- (typeof queueMicrotask == "function" ? queueMicrotask : setTimeout)(o.bind(null, new Error("Unknown variable dynamic import: " + n)));
8
- });
9
- }, D = ["innerHTML", "role"], M = /* @__PURE__ */ k({
10
- name: "TIcon",
11
- __name: "Icon",
12
- props: {
13
- icon: {},
14
- role: { default: "" },
15
- size: { default: t.Default }
16
- },
17
- setup(r, { expose: n }) {
18
- const s = r, c = g(""), o = b(), a = g(null), { isPopoverActivator: m, onPopoverActivatorClick: l } = C(), u = v(() => s.role === "button"), f = v(() => s.role !== "" ? s.role : o && m(o) ? "button" : ""), h = (i) => {
19
- o && m(o) && l(i, o);
20
- }, d = async () => (await E(/* @__PURE__ */ Object.assign({ "../../assets/icons/account.svg": () => import("./account-BJGxzbeL.js"), "../../assets/icons/alert-octagon-outline.svg": () => import("./alert-octagon-outline-fM2QVbyq.js"), "../../assets/icons/alert-octagon.svg": () => import("./alert-octagon-BIUtdQBd.js"), "../../assets/icons/archive-outline.svg": () => import("./archive-outline-BT6uCRX5.js"), "../../assets/icons/archive.svg": () => import("./archive-DDuuzVUo.js"), "../../assets/icons/arrow-left.svg": () => import("./arrow-left-CVipcGWo.js"), "../../assets/icons/arrow-right.svg": () => import("./arrow-right-DHFo5L72.js"), "../../assets/icons/bank-outline.svg": () => import("./bank-outline-wy0O9ni0.js"), "../../assets/icons/bank.svg": () => import("./bank-lwoR1P6d.js"), "../../assets/icons/camera.svg": () => import("./camera-BXoPauop.js"), "../../assets/icons/cards-outline.svg": () => import("./cards-outline-B0no8Z63.js"), "../../assets/icons/cards-variant.svg": () => import("./cards-variant-CU6V8mdM.js"), "../../assets/icons/cart-outline.svg": () => import("./cart-outline-C99s8OpS.js"), "../../assets/icons/chart-box-outline.svg": () => import("./chart-box-outline-C9ymwfIH.js"), "../../assets/icons/chart-box.svg": () => import("./chart-box-tyepg_QH.js"), "../../assets/icons/check-circle-outline.svg": () => import("./check-circle-outline-B4zmPfuc.js"), "../../assets/icons/check-circle.svg": () => import("./check-circle-C3Kf7DnE.js"), "../../assets/icons/check.svg": () => import("./check-iUT-FuWa.js"), "../../assets/icons/checkbox-dark.svg": () => import("./checkbox-dark-D_btgwCX.js"), "../../assets/icons/checkbox-indeterminate-dark.svg": () => import("./checkbox-indeterminate-dark-CSrkJBRG.js"), "../../assets/icons/checkbox-indeterminate.svg": () => import("./checkbox-indeterminate-CtbmyFkw.js"), "../../assets/icons/checkbox.svg": () => import("./checkbox-TojXdFTq.js"), "../../assets/icons/chevron-down.svg": () => import("./chevron-down-CJLshITY.js"), "../../assets/icons/chevron-left.svg": () => import("./chevron-left-n_sGCmlG.js"), "../../assets/icons/chevron-right.svg": () => import("./chevron-right-C8uLqjmq.js"), "../../assets/icons/chevron-up.svg": () => import("./chevron-up-b6VdQM8S.js"), "../../assets/icons/circle.svg": () => import("./circle-DhoEDuC5.js"), "../../assets/icons/clock.svg": () => import("./clock-BqMI2OIG.js"), "../../assets/icons/close-circle-outline.svg": () => import("./close-circle-outline-CUXfYV4M.js"), "../../assets/icons/close-circle.svg": () => import("./close-circle-Bvyw4JKW.js"), "../../assets/icons/close.svg": () => import("./close-DemH4JAO.js"), "../../assets/icons/cog.svg": () => import("./cog-Dd9I6z5D.js"), "../../assets/icons/color-fill.svg": () => import("./color-fill-DWx77G0p.js"), "../../assets/icons/copy.svg": () => import("./copy-D-Dqxp8h.js"), "../../assets/icons/credit-card-plus.svg": () => import("./credit-card-plus-TUZq5Zi0.js"), "../../assets/icons/credit-card.svg": () => import("./credit-card-B3VjoUad.js"), "../../assets/icons/currency.svg": () => import("./currency-BuSji4qA.js"), "../../assets/icons/database.svg": () => import("./database-CNG_l2Or.js"), "../../assets/icons/dots-grid.svg": () => import("./dots-grid-BhRGZg1t.js"), "../../assets/icons/dots-vertical.svg": () => import("./dots-vertical-nYIDxlT1.js"), "../../assets/icons/email-open-outline.svg": () => import("./email-open-outline-NlRAK8vu.js"), "../../assets/icons/email-outline.svg": () => import("./email-outline-v-beMKo_.js"), "../../assets/icons/eye-off.svg": () => import("./eye-off-Dq2WOPSG.js"), "../../assets/icons/eye.svg": () => import("./eye-C7_UM0rn.js"), "../../assets/icons/file-document-plus-outline.svg": () => import("./file-document-plus-outline-C_GeG8ak.js"), "../../assets/icons/filmstrip.svg": () => import("./filmstrip-Dg66xHap.js"), "../../assets/icons/filter.svg": () => import("./filter-07gM0IrM.js"), "../../assets/icons/fullscreen-exit.svg": () => import("./fullscreen-exit-DvHy2f8E.js"), "../../assets/icons/fullscreen.svg": () => import("./fullscreen-daZRwm-1.js"), "../../assets/icons/group.svg": () => import("./group-B1HQcmCl.js"), "../../assets/icons/image-album-outline.svg": () => import("./image-album-outline-oiPipPnp.js"), "../../assets/icons/image-album.svg": () => import("./image-album-DVl72ioK.js"), "../../assets/icons/image-outline.svg": () => import("./image-outline-CLpFyr7w.js"), "../../assets/icons/image.svg": () => import("./image-C-DY_SfK.js"), "../../assets/icons/info-outline.svg": () => import("./info-outline-Mn6Hjz_K.js"), "../../assets/icons/key-chain.svg": () => import("./key-chain-D-8-GrU2.js"), "../../assets/icons/key-variant.svg": () => import("./key-variant-DViBRFAJ.js"), "../../assets/icons/key.svg": () => import("./key-B8iEXxGx.js"), "../../assets/icons/listbox-outline.svg": () => import("./listbox-outline-BBriTS-r.js"), "../../assets/icons/loading.svg": () => import("./loading-E4eFmVsP.js"), "../../assets/icons/lock-outline.svg": () => import("./lock-outline-K2LxC2b6.js"), "../../assets/icons/lock.svg": () => import("./lock-Nv-e-b24.js"), "../../assets/icons/logout.svg": () => import("./logout-BHwFpuou.js"), "../../assets/icons/menu-down.svg": () => import("./menu-down-B4Fy5IG1.js"), "../../assets/icons/menu-left.svg": () => import("./menu-left-D8G3frKt.js"), "../../assets/icons/menu-right.svg": () => import("./menu-right-CMt4thJ2.js"), "../../assets/icons/menu.svg": () => import("./menu-pq7WWaJu.js"), "../../assets/icons/minus-circle-outline.svg": () => import("./minus-circle-outline-B-x6EXPD.js"), "../../assets/icons/minus-circle.svg": () => import("./minus-circle-D_N5NZW-.js"), "../../assets/icons/minus.svg": () => import("./minus-CSCkQnOm.js"), "../../assets/icons/moon.svg": () => import("./moon-Bhm_ZTV6.js"), "../../assets/icons/open-in-new.svg": () => import("./open-in-new-C2Btl_1k.js"), "../../assets/icons/pencil.svg": () => import("./pencil-BETebgXX.js"), "../../assets/icons/people.svg": () => import("./people-BUW1DRzH.js"), "../../assets/icons/piggy-bank-outline.svg": () => import("./piggy-bank-outline-5cDQNrSU.js"), "../../assets/icons/plus-circle-outline.svg": () => import("./plus-circle-outline-C-kkX0ke.js"), "../../assets/icons/plus-circle.svg": () => import("./plus-circle-Cl0YprEp.js"), "../../assets/icons/plus.svg": () => import("./plus-sbcOm60H.js"), "../../assets/icons/qrcode-scan.svg": () => import("./qrcode-scan-CpLrVFw_.js"), "../../assets/icons/radio-dark.svg": () => import("./radio-dark-Cr5v17AF.js"), "../../assets/icons/radio.svg": () => import("./radio-DkjVAhsO.js"), "../../assets/icons/refresh.svg": () => import("./refresh-DPlMWd1M.js"), "../../assets/icons/save.svg": () => import("./save-BmMH4S8b.js"), "../../assets/icons/search.svg": () => import("./search-Co2MwWOK.js"), "../../assets/icons/spotlight.svg": () => import("./spotlight-TNyCQzOY.js"), "../../assets/icons/store-outline.svg": () => import("./store-outline-B-fuVZzv.js"), "../../assets/icons/sun.svg": () => import("./sun-BWKjCEHH.js"), "../../assets/icons/swap-horizontal.svg": () => import("./swap-horizontal-DociZUG2.js"), "../../assets/icons/swap-left.svg": () => import("./swap-left-Bd2DOgf3.js"), "../../assets/icons/swap-right.svg": () => import("./swap-right-D0VYxBDb.js"), "../../assets/icons/swap.svg": () => import("./swap-CNbqKTl0.js"), "../../assets/icons/system-theme.svg": () => import("./system-theme-Cez6mSv_.js"), "../../assets/icons/tag-outline.svg": () => import("./tag-outline-Ce_qOxif.js"), "../../assets/icons/trash-can-outline.svg": () => import("./trash-can-outline-DjtqZHOC.js"), "../../assets/icons/trash-can.svg": () => import("./trash-can-CKPtMqSf.js"), "../../assets/icons/upload.svg": () => import("./upload-CKfrBexU.js"), "../../assets/icons/user-circle.svg": () => import("./user-circle-D102n1FB.js"), "../../assets/icons/zip-box.svg": () => import("./zip-box-C10560VY.js") }), `../../assets/icons/${s.icon}.svg`)).default;
21
- return w(
22
- () => s.icon,
23
- async (i, p) => {
24
- i !== p && (c.value = await d());
25
- },
26
- { immediate: !0 }
27
- ), n({ reference: a }), (i, p) => (y(), x("i", {
28
- innerHTML: c.value,
29
- ref_key: "reference",
30
- ref: a,
31
- class: z(["inline-block fill-current", {
32
- "w-3 h-3": s.size === e(t).ExtraSmall,
33
- "w-5 h-5": s.size === e(t).Small,
34
- "w-6 h-6": s.size === e(t).Default,
35
- "w-12 h-12": s.size === e(t).Large,
36
- "w-16 h-16": s.size === e(t).ExtraLarge,
37
- "cursor-pointer": u.value
38
- }]),
39
- style: _(
40
- typeof s.size == "number" ? `width: ${s.size}px; height: ${s.size}px;` : ""
41
- ),
42
- role: f.value,
43
- onClick: h
44
- }, null, 14, D));
45
- }
46
- });
47
- export {
48
- M as _
49
- };
@@ -1,66 +0,0 @@
1
- import { defineComponent as p, mergeModels as c, useModel as m, watch as v, resolveComponent as f, openBlock as b, createElementBlock as _, createVNode as g, withDirectives as x, createElementVNode as N, vModelText as h } from "vue";
2
- const y = {
3
- options: {
4
- precision: 2
5
- },
6
- inputToPriceNumber(i) {
7
- return i = i.replace(/[^0-9]/g, "").trim(), i ? parseFloat(i) / Math.pow(10, this.options.precision) : void 0;
8
- }
9
- }, I = { class: "flex h-9 w-full input-bg-color input-text-color border input-border input-roundness" }, M = ["disabled"], T = /* @__PURE__ */ p({
10
- name: "TInputPrice",
11
- inheritAttrs: !1,
12
- __name: "InputPrice",
13
- props: /* @__PURE__ */ c({
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: ["update:modelValue"],
26
- setup(i, { emit: n }) {
27
- const t = m(i, "modelValue"), r = i, u = (e) => ({
28
- label: e.symbol,
29
- value: e.iso
30
- }), a = (e, o) => {
31
- if (o === void 0) {
32
- t.value = { ...t.value };
33
- return;
34
- }
35
- e?.value && e.value !== o?.value && (t.value.value = e.value), e?.iso && e.iso !== o?.iso && (t.value.iso = e.iso);
36
- }, d = (e) => {
37
- const l = e.target.value;
38
- return t.value.value = y.inputToPriceNumber(l), !1;
39
- };
40
- return v(t, a, { immediate: !0 }), (e, o) => {
41
- const l = f("t-input-select");
42
- return b(), _("div", I, [
43
- g(l, {
44
- modelValue: t.value.iso,
45
- "onUpdate:modelValue": o[0] || (o[0] = (s) => t.value.iso = s),
46
- resource: r.resource,
47
- mapper: u,
48
- "disable-style": !0,
49
- class: "w-20 flex justify-center items-center border-r input-border"
50
- }, null, 8, ["modelValue", "resource"]),
51
- x(N("input", {
52
- "onUpdate:modelValue": o[1] || (o[1] = (s) => t.value.value = s),
53
- type: "text",
54
- class: "w-full input-bg-color input-text-color input-outline input-roundness input-padding",
55
- disabled: r.disabled,
56
- onInput: d
57
- }, null, 40, M), [
58
- [h, t.value.value]
59
- ])
60
- ]);
61
- };
62
- }
63
- });
64
- export {
65
- T as _
66
- };
@@ -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
- };