@caipira/tamandua 0.0.38 → 0.0.40

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/Modal.js CHANGED
@@ -1,5 +1,5 @@
1
- import { _ as r } from "./Modal.vue_vue_type_script_setup_true_lang-DLl5shGS.js";
2
- import { p } from "./plugin-BZC231Oj.js";
1
+ import { _ as r } from "./Modal.vue_vue_type_script_setup_true_lang-aQ-G7tuI.js";
2
+ import { p } from "./plugin-GUvrG7aO.js";
3
3
  export {
4
4
  r as Modal,
5
5
  p as ModalPlugin
@@ -0,0 +1,81 @@
1
+ import { defineComponent as m, ref as y, onMounted as b, resolveComponent as h, openBlock as o, createElementBlock as s, normalizeClass as a, withKeys as _, createBlock as k, createCommentVNode as l, createElementVNode as c, createVNode as v, toDisplayString as w, renderSlot as n } from "vue";
2
+ import { _ as S } from "./Backdrop.vue_vue_type_script_setup_true_lang-OaEBTmYK.js";
3
+ const x = {
4
+ key: 0,
5
+ class: "p-4 border-b border-color"
6
+ }, B = {
7
+ key: 0,
8
+ class: "inline-block font-semibold uppercase mr-8"
9
+ }, C = {
10
+ key: 1,
11
+ class: "flex flex-row items-center justify-between p-4 border-t border-color"
12
+ }, z = /* @__PURE__ */ m({
13
+ name: "TModal",
14
+ __name: "Modal",
15
+ props: {
16
+ title: { default: "" },
17
+ showHeader: { type: Boolean, default: !0 },
18
+ injectStyle: { default: () => ({ wrapper: "", body: "", container: "" }) },
19
+ hasBackdrop: { type: Boolean, default: !0 },
20
+ disableStyle: { type: Boolean, default: !1 }
21
+ },
22
+ emits: ["closed"],
23
+ setup(d, { emit: u }) {
24
+ const e = d, p = u, i = y(null), r = (t) => {
25
+ t.stopPropagation(), p("closed");
26
+ };
27
+ return b(() => {
28
+ i.value?.focus();
29
+ }), (t, g) => {
30
+ const f = h("t-button");
31
+ return o(), s("div", {
32
+ class: a(["fixed inset-0 focus-visible:outline-none z-10", {
33
+ "flex items-center": !e.disableStyle,
34
+ [e.injectStyle.wrapper]: !0
35
+ }]),
36
+ tabindex: "-1",
37
+ ref_key: "modal",
38
+ ref: i,
39
+ onKeyup: _(r, ["esc"])
40
+ }, [
41
+ e.hasBackdrop ? (o(), k(S, {
42
+ key: 0,
43
+ class: "z-10",
44
+ onClick: r
45
+ })) : l("", !0),
46
+ c("div", {
47
+ class: a(["z-10 w-full md:w-[36rem] mx-auto", {
48
+ "bg-caipira-primary input-roundness shadow-2xl relative": !e.disableStyle,
49
+ [e.injectStyle.container]: !0
50
+ }])
51
+ }, [
52
+ v(f, {
53
+ variant: "transparent",
54
+ size: "lg",
55
+ icon: "close",
56
+ class: "absolute top-0 right-0",
57
+ onClick: r
58
+ }),
59
+ e.showHeader ? (o(), s("div", x, [
60
+ e.title ? (o(), s("span", B, w(e.title), 1)) : l("", !0),
61
+ t.$slots.header ? n(t.$slots, "header", { key: 1 }) : l("", !0)
62
+ ])) : l("", !0),
63
+ c("div", {
64
+ class: a(["flex flex-col flex-1 overflow-y-auto scrollbar", {
65
+ [e.injectStyle.body]: !0
66
+ }]),
67
+ style: { "max-height": "80vh" }
68
+ }, [
69
+ n(t.$slots, "default")
70
+ ], 2),
71
+ t.$slots.footer ? (o(), s("div", C, [
72
+ n(t.$slots, "footer")
73
+ ])) : l("", !0)
74
+ ], 2)
75
+ ], 34);
76
+ };
77
+ }
78
+ });
79
+ export {
80
+ z as _
81
+ };
package/dist/ModalForm.js CHANGED
@@ -1,5 +1,5 @@
1
- import { _ as a } from "./ModalForm.vue_vue_type_script_setup_true_lang-CwaPQhNa.js";
2
- import { p as l } from "./plugin-COZFGFVQ.js";
1
+ import { _ as a } from "./ModalForm.vue_vue_type_script_setup_true_lang-B4dU1AzJ.js";
2
+ import { p as l } from "./plugin-DmPqmScT.js";
3
3
  export {
4
4
  a as ModalForm,
5
5
  l as ModalFormPlugin
@@ -1,9 +1,9 @@
1
- import { defineComponent as K, ref as u, computed as L, resolveComponent as o, openBlock as l, createBlock as i, withCtx as s, createCommentVNode as d, renderSlot as M, createElementBlock as N, createVNode as m, normalizeClass as R, resolveDynamicComponent as I, mergeProps as O } from "vue";
1
+ import { defineComponent as F, ref as d, computed as K, resolveComponent as o, openBlock as n, createBlock as i, withCtx as s, createElementVNode as L, createCommentVNode as u, renderSlot as M, createElementBlock as R, createVNode as m, normalizeClass as j, resolveDynamicComponent as H, mergeProps as I, toHandlers as O } from "vue";
2
2
  import { C as P } from "./crud-n73o4CzO.js";
3
- const T = {
3
+ const T = { class: "flex items-baseline justify-between w-full" }, U = {
4
4
  key: 0,
5
5
  class: "inline-flex"
6
- }, q = /* @__PURE__ */ K({
6
+ }, J = /* @__PURE__ */ F({
7
7
  name: "TModalForm",
8
8
  __name: "ModalForm",
9
9
  props: {
@@ -12,42 +12,44 @@ const T = {
12
12
  formClass: { default: "" }
13
13
  },
14
14
  emits: ["saved", "deleted", "closed"],
15
- setup(k, { expose: y, emit: g }) {
16
- const r = k, v = g, e = u(), p = u(!1), f = u(""), c = u(), n = L(() => r.forms.find((a) => a.key === f.value)), w = (a, t) => {
17
- f.value = a, e.value = new P(n.value?.title, c), t ? e.value?.edit(t) : e.value?.show();
15
+ setup(y, { expose: k, emit: g }) {
16
+ const r = y, v = g, e = d(), p = d(!1), _ = d(""), c = d(), l = K(() => r.forms.find((a) => a.key === _.value)), w = (a, t) => {
17
+ _.value = a, e.value = new P(l.value?.title, c), t ? e.value?.edit(t) : e.value?.show();
18
18
  }, h = () => {
19
19
  e.value?.onSave(!p.value), v("saved");
20
- }, S = () => {
20
+ }, x = () => {
21
21
  v("deleted"), e.value?.onDelete();
22
22
  }, b = () => {
23
23
  e.value?.delete();
24
- }, x = async () => await c.value?.submit(), D = () => {
24
+ }, S = async () => await c.value?.submit(), V = () => {
25
25
  c.value?.reset();
26
- }, V = () => {
26
+ }, D = () => {
27
27
  e.value?.close(), v("closed");
28
28
  };
29
- return y({ open: w, delete: b, submit: x, reset: D }), (a, t) => {
30
- const E = o("t-input-switch"), B = o("t-icon"), $ = o("t-dropdown"), z = o("t-popover"), C = o("t-button"), A = o("t-popconfirm"), F = o("t-modal");
31
- return e.value?.visible ? (l(), i(F, {
29
+ return k({ open: w, delete: b, submit: S, reset: V }), (a, t) => {
30
+ const E = o("t-input-switch"), B = o("t-icon"), N = o("t-dropdown"), $ = o("t-popover"), C = o("t-button"), z = o("t-popconfirm"), A = o("t-modal");
31
+ return e.value?.visible ? (n(), i(A, {
32
32
  key: 0,
33
33
  title: e.value?.title,
34
- onClosed: V
34
+ onClosed: D
35
35
  }, {
36
36
  header: s(() => [
37
- n.value?.pinnable && !e.value?.isEditing ? (l(), i(E, {
38
- key: 0,
39
- modelValue: p.value,
40
- "onUpdate:modelValue": t[0] || (t[0] = (_) => p.value = _),
41
- label: "Keep open",
42
- class: "mt-4"
43
- }, null, 8, ["modelValue"])) : d("", !0),
44
- M(a.$slots, "header")
37
+ L("div", T, [
38
+ l.value?.pinnable && !e.value?.isEditing ? (n(), i(E, {
39
+ key: 0,
40
+ modelValue: p.value,
41
+ "onUpdate:modelValue": t[0] || (t[0] = (f) => p.value = f),
42
+ label: "Keep open",
43
+ class: "mt-4"
44
+ }, null, 8, ["modelValue"])) : u("", !0),
45
+ M(a.$slots, "header")
46
+ ])
45
47
  ]),
46
48
  footer: s(() => [
47
- r.options.length ? (l(), N("div", T, [
48
- m(z, { placement: "bottom-start" }, {
49
+ r.options.length ? (n(), R("div", U, [
50
+ m($, { placement: "bottom-start" }, {
49
51
  content: s(() => [
50
- m($, {
52
+ m(N, {
51
53
  items: r.options
52
54
  }, null, 8, ["items"])
53
55
  ]),
@@ -62,21 +64,21 @@ const T = {
62
64
  ]),
63
65
  _: 1
64
66
  })
65
- ])) : (l(), i(A, {
67
+ ])) : (n(), i(z, {
66
68
  key: 1,
67
- message: `Are you sure you want to delete this ${n.value?.title}?`,
69
+ message: `Are you sure you want to delete this ${l.value?.title}?`,
68
70
  onConfirm: b
69
71
  }, {
70
- default: s(({ onTogglePopover: _ }) => [
71
- e.value?.isEditing ? (l(), i(C, {
72
+ default: s(({ onTogglePopover: f }) => [
73
+ e.value?.isEditing ? (n(), i(C, {
72
74
  key: 0,
73
75
  variant: "danger",
74
76
  icon: "trash-can-outline",
75
77
  label: "Delete",
76
78
  "aria-describedby": "tooltip",
77
79
  "is-disabled": e.value?.isLoading,
78
- onClick: _
79
- }, null, 8, ["is-disabled", "onClick"])) : d("", !0)
80
+ onClick: f
81
+ }, null, 8, ["is-disabled", "onClick"])) : u("", !0)
80
82
  ]),
81
83
  _: 1
82
84
  }, 8, ["message"])),
@@ -85,29 +87,29 @@ const T = {
85
87
  icon: "save",
86
88
  label: e.value.isCreating ? "Add" : "Save",
87
89
  "is-disabled": e.value?.isLoading,
88
- class: R({
90
+ class: j({
89
91
  "ml-auto": !e.value?.isEditing
90
92
  }),
91
93
  onClick: t[1] || (t[1] = () => e.value?.save())
92
94
  }, null, 8, ["label", "is-disabled", "class"])
93
95
  ]),
94
96
  default: s(() => [
95
- n.value ? (l(), i(I(n.value.component), O({
97
+ l.value ? (n(), i(H(l.value.component), I({
96
98
  key: 0,
97
99
  id: `${e.value?.id}`,
98
100
  class: [r.formClass],
99
101
  ref_key: "formReference",
100
102
  ref: c
101
- }, n.value?.events, {
102
- onDeleted: S,
103
+ }, O(l.value?.events), {
104
+ onDeleted: x,
103
105
  onSaved: h
104
- }), null, 16, ["id", "class"])) : d("", !0)
106
+ }), null, 16, ["id", "class"])) : u("", !0)
105
107
  ]),
106
108
  _: 3
107
- }, 8, ["title"])) : d("", !0);
109
+ }, 8, ["title"])) : u("", !0);
108
110
  };
109
111
  }
110
112
  });
111
113
  export {
112
- q as _
114
+ J as _
113
115
  };
package/dist/Tag.js CHANGED
@@ -1,5 +1,5 @@
1
- import { _ as r } from "./Tag.vue_vue_type_script_setup_true_lang-DMigzW22.js";
2
- import { p } from "./plugin-DgCa2m12.js";
1
+ import { _ as r } from "./Tag.vue_vue_type_script_setup_true_lang-DatNytmx.js";
2
+ import { p } from "./plugin-DXjluPIV.js";
3
3
  export {
4
4
  r as Tag,
5
5
  p as TagPlugin
@@ -0,0 +1,73 @@
1
+ import { defineComponent as _, resolveComponent as m, openBlock as l, createElementBlock as r, normalizeStyle as k, normalizeClass as p, createElementVNode as v, renderSlot as z, unref as s, toDisplayString as g, createBlock as u, withCtx as h, createVNode as B, createCommentVNode as S } from "vue";
2
+ import { a as o } from "./ui-BC6H9E93.js";
3
+ const b = ["role"], E = { class: "px-2" }, $ = { key: 0 }, N = /* @__PURE__ */ _({
4
+ name: "TTag",
5
+ __name: "Tag",
6
+ props: {
7
+ text: { default: "" },
8
+ size: { default: o.Default },
9
+ role: { default: "" },
10
+ color: { default: "" },
11
+ confirmClose: { type: Boolean, default: !1 },
12
+ hasCloseButton: { type: Boolean, default: !1 }
13
+ },
14
+ emits: ["close"],
15
+ setup(f, { emit: d }) {
16
+ const e = f, i = d, x = (n, t) => {
17
+ n.stopPropagation(), t();
18
+ };
19
+ return (n, t) => {
20
+ const c = m("t-button"), C = m("t-popconfirm");
21
+ return l(), r("div", {
22
+ style: k(`background-color:${e.color}`),
23
+ class: p([{
24
+ "bg-caipira-primary-inverted": !e.color
25
+ }, "w-max inline-flex items-stretch rounded-sm select-none color-caipira-primary"]),
26
+ role: e.role
27
+ }, [
28
+ v("div", E, [
29
+ n.$slots.default ? z(n.$slots, "default", { key: 0 }) : (l(), r("span", {
30
+ key: 1,
31
+ class: p({
32
+ "text-xs": e.size === s(o).ExtraSmall,
33
+ "text-sm": e.size === s(o).Small,
34
+ "text-base": e.size === s(o).Default,
35
+ "text-lg": e.size === s(o).Large,
36
+ "text-xl": e.size === s(o).ExtraLarge
37
+ })
38
+ }, g(e.text), 3))
39
+ ]),
40
+ e.hasCloseButton ? (l(), r("div", $, [
41
+ e.confirmClose ? (l(), u(C, {
42
+ key: 0,
43
+ message: "Are you sure you want to remove it?",
44
+ class: "h-full",
45
+ onConfirm: t[0] || (t[0] = (a) => i("close"))
46
+ }, {
47
+ default: h(({ onTogglePopover: a }) => [
48
+ B(c, {
49
+ variant: "transparent",
50
+ hover: !0,
51
+ icon: "close",
52
+ size: "",
53
+ class: "px-1.5 h-full",
54
+ onClick: (y) => x(y, a)
55
+ }, null, 8, ["onClick"])
56
+ ]),
57
+ _: 1
58
+ })) : (l(), u(c, {
59
+ key: 1,
60
+ variant: "transparent",
61
+ icon: "close",
62
+ size: "sm",
63
+ class: "px-1.5 h-full",
64
+ onClick: t[1] || (t[1] = (a) => i("close"))
65
+ }))
66
+ ])) : S("", !0)
67
+ ], 14, b);
68
+ };
69
+ }
70
+ });
71
+ export {
72
+ N as _
73
+ };
@@ -29,8 +29,8 @@ import { _ as or } from "./InputSwitch.vue_vue_type_script_setup_true_lang-Dq_U-
29
29
  import { _ as er } from "./InputText.vue_vue_type_script_setup_true_lang-Dyvx9Ob-.js";
30
30
  import { _ as pr } from "./InputTextarea.vue_vue_type_script_setup_true_lang-DRo5eIw4.js";
31
31
  import { _ as sr } from "./Link.vue_vue_type_script_setup_true_lang-DeBJ2UGi.js";
32
- import { _ as fr } from "./Modal.vue_vue_type_script_setup_true_lang-DLl5shGS.js";
33
- import { _ as nr } from "./ModalForm.vue_vue_type_script_setup_true_lang-CwaPQhNa.js";
32
+ import { _ as fr } from "./Modal.vue_vue_type_script_setup_true_lang-aQ-G7tuI.js";
33
+ import { _ as nr } from "./ModalForm.vue_vue_type_script_setup_true_lang-B4dU1AzJ.js";
34
34
  import { _ as ur } from "./Pagination.vue_vue_type_script_setup_true_lang-PLZQJUd0.js";
35
35
  import { _ as lr } from "./Popconfirm.vue_vue_type_script_setup_true_lang-XyjBUx0p.js";
36
36
  import { _ as hr } from "./Popover.vue_vue_type_script_setup_true_lang-dnL75W40.js";
@@ -40,7 +40,7 @@ import { _ as Cr } from "./SensitiveInfo.vue_vue_type_script_setup_true_lang-lCd
40
40
  import { _ as Gr } from "./Skeleton.vue_vue_type_script_setup_true_lang-BZItfVoN.js";
41
41
  import { _ as gr } from "./Tab.vue_vue_type_script_setup_true_lang-VzvYvoqa.js";
42
42
  import { T as vr } from "./Table-C0Sr_Lfm.js";
43
- import { _ as Fr } from "./Tag.vue_vue_type_script_setup_true_lang-DMigzW22.js";
43
+ import { _ as Fr } from "./Tag.vue_vue_type_script_setup_true_lang-DatNytmx.js";
44
44
  import { _ as Br } from "./Toast.vue_vue_type_script_setup_true_lang-Dezwl4qF.js";
45
45
  export {
46
46
  e as Avatar,
@@ -1,5 +1,5 @@
1
1
  import { r } from "./register-component-B-fdqewb.js";
2
- import { _ as s } from "./Tag.vue_vue_type_script_setup_true_lang-DMigzW22.js";
2
+ import { _ as s } from "./Tag.vue_vue_type_script_setup_true_lang-DatNytmx.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 "./ModalForm.vue_vue_type_script_setup_true_lang-CwaPQhNa.js";
2
+ import { _ as s } from "./ModalForm.vue_vue_type_script_setup_true_lang-B4dU1AzJ.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 "./Modal.vue_vue_type_script_setup_true_lang-DLl5shGS.js";
2
+ import { _ as s } from "./Modal.vue_vue_type_script_setup_true_lang-aQ-G7tuI.js";
3
3
  const m = {
4
4
  install(o) {
5
5
  r(o, s);
@@ -39,8 +39,8 @@ import { p as k } from "./plugin-Bbt6pP0l.js";
39
39
  import { p as w } from "./plugin-BQFwx3d5.js";
40
40
  import "./Link.vue_vue_type_script_setup_true_lang-DeBJ2UGi.js";
41
41
  import { p as x } from "./plugin-dL6oP11N.js";
42
- import { p as D } from "./plugin-BZC231Oj.js";
43
- import { p as F } from "./plugin-COZFGFVQ.js";
42
+ import { p as D } from "./plugin-GUvrG7aO.js";
43
+ import { p as F } from "./plugin-DmPqmScT.js";
44
44
  import { p as L } from "./plugin-YUomn9tF.js";
45
45
  import "./Popconfirm.vue_vue_type_script_setup_true_lang-XyjBUx0p.js";
46
46
  import { p as M } from "./plugin-Ee4Z5Rtp.js";
@@ -55,8 +55,8 @@ import { p as z } from "./plugin-B9wG8DUw.js";
55
55
  import { p as E } from "./plugin-5vn4G57V.js";
56
56
  import "./Table-C0Sr_Lfm.js";
57
57
  import { p as O } from "./plugin-CTMcmMdr.js";
58
- import "./Tag.vue_vue_type_script_setup_true_lang-DMigzW22.js";
59
- import { p as q } from "./plugin-DgCa2m12.js";
58
+ import "./Tag.vue_vue_type_script_setup_true_lang-DatNytmx.js";
59
+ import { p as q } from "./plugin-DXjluPIV.js";
60
60
  import { p as R } from "./plugin-Dn96hI0e.js";
61
61
  const Vp = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
62
62
  __proto__: null,
package/dist/plugins.js CHANGED
@@ -39,8 +39,8 @@ import { p as Tr } from "./plugin-Bbt6pP0l.js";
39
39
  import { p as yr } from "./plugin-BQFwx3d5.js";
40
40
  import "./Link.vue_vue_type_script_setup_true_lang-DeBJ2UGi.js";
41
41
  import { p as Cr } from "./plugin-dL6oP11N.js";
42
- import { p as Sr } from "./plugin-BZC231Oj.js";
43
- import { p as vr } from "./plugin-COZFGFVQ.js";
42
+ import { p as Sr } from "./plugin-GUvrG7aO.js";
43
+ import { p as vr } from "./plugin-DmPqmScT.js";
44
44
  import { p as Dr } from "./plugin-YUomn9tF.js";
45
45
  import "./Popconfirm.vue_vue_type_script_setup_true_lang-XyjBUx0p.js";
46
46
  import { p as Lr } from "./plugin-Ee4Z5Rtp.js";
@@ -55,8 +55,8 @@ import { p as Jr } from "./plugin-B9wG8DUw.js";
55
55
  import { p as Nr } from "./plugin-5vn4G57V.js";
56
56
  import "./Table-C0Sr_Lfm.js";
57
57
  import { p as Qr } from "./plugin-CTMcmMdr.js";
58
- import "./Tag.vue_vue_type_script_setup_true_lang-DMigzW22.js";
59
- import { p as Vr } from "./plugin-DgCa2m12.js";
58
+ import "./Tag.vue_vue_type_script_setup_true_lang-DatNytmx.js";
59
+ import { p as Vr } from "./plugin-DXjluPIV.js";
60
60
  import { p as Xr } from "./plugin-Dn96hI0e.js";
61
61
  export {
62
62
  T as AvatarPlugin,
package/dist/tamandua.js CHANGED
@@ -1,4 +1,4 @@
1
- import { p as n } from "./plugins-B36hg2A7.js";
1
+ import { p as n } from "./plugins-B14K99ho.js";
2
2
  const o = {
3
3
  install(s) {
4
4
  for (const i in n)
@@ -5,6 +5,9 @@ export type Node = {
5
5
  children?: Node[];
6
6
  };
7
7
  export type ChartTreemapProps = {
8
- data: Node[];
8
+ data: {
9
+ name: string;
10
+ children: Node[];
11
+ };
9
12
  options: never;
10
13
  };
@@ -0,0 +1,35 @@
1
+ import { FormSchema } from '../../types/form.js';
2
+
3
+ declare const _default: {
4
+ title: string;
5
+ args: {};
6
+ argTypes: {};
7
+ };
8
+ export default _default;
9
+ export declare const ModalForm: (args: any) => {
10
+ components: {
11
+ Form: {
12
+ setup(): {
13
+ schema: FormSchema;
14
+ };
15
+ emits: string[];
16
+ name: string;
17
+ template: string;
18
+ };
19
+ };
20
+ setup(): {
21
+ args: any;
22
+ modalForm: import('vue').Ref<any>;
23
+ onChange: () => void;
24
+ openForm: () => void;
25
+ Form: {
26
+ setup(): {
27
+ schema: FormSchema;
28
+ };
29
+ emits: string[];
30
+ name: string;
31
+ template: string;
32
+ };
33
+ };
34
+ template: string;
35
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@caipira/tamandua",
3
- "version": "0.0.38",
3
+ "version": "0.0.40",
4
4
  "private": false,
5
5
  "description": "UI library for the Caipira ecosystem",
6
6
  "license": "GPL-3.0-only",
@@ -1,82 +0,0 @@
1
- import { defineComponent as m, ref as y, onMounted as b, resolveComponent as _, openBlock as o, createElementBlock as l, normalizeClass as n, withKeys as h, createBlock as k, createCommentVNode as s, createElementVNode as a, toDisplayString as w, renderSlot as i, createVNode as v } from "vue";
2
- import { _ as x } from "./Backdrop.vue_vue_type_script_setup_true_lang-OaEBTmYK.js";
3
- const S = {
4
- key: 0,
5
- class: "flex justify-between items-center p-4 border-b border-color"
6
- }, B = { class: "" }, C = {
7
- key: 0,
8
- class: "inline-block font-semibold uppercase mr-8"
9
- }, j = {
10
- key: 1,
11
- class: "flex flex-row items-center justify-between p-4 border-t border-color"
12
- }, M = /* @__PURE__ */ m({
13
- name: "TModal",
14
- __name: "Modal",
15
- props: {
16
- title: { default: "" },
17
- showHeader: { type: Boolean, default: !0 },
18
- injectStyle: { default: () => ({ wrapper: "", body: "", container: "" }) },
19
- hasBackdrop: { type: Boolean, default: !0 },
20
- disableStyle: { type: Boolean, default: !1 }
21
- },
22
- emits: ["closed"],
23
- setup(d, { emit: u }) {
24
- const e = d, p = u, c = y(null), r = (t) => {
25
- t.stopPropagation(), p("closed");
26
- };
27
- return b(() => {
28
- c.value?.focus();
29
- }), (t, $) => {
30
- const f = _("t-icon");
31
- return o(), l("div", {
32
- class: n(["fixed inset-0 focus-visible:outline-none z-10", {
33
- "flex items-center": !e.disableStyle,
34
- [e.injectStyle.wrapper]: !0
35
- }]),
36
- tabindex: "-1",
37
- ref_key: "modal",
38
- ref: c,
39
- onKeyup: h(r, ["esc"])
40
- }, [
41
- e.hasBackdrop ? (o(), k(x, {
42
- key: 0,
43
- class: "z-10",
44
- onClick: r
45
- })) : s("", !0),
46
- a("div", {
47
- class: n(["z-10 w-full md:w-[36rem] mx-auto", {
48
- "bg-caipira-primary input-roundness shadow-2xl": !e.disableStyle,
49
- [e.injectStyle.container]: !0
50
- }])
51
- }, [
52
- e.showHeader ? (o(), l("div", S, [
53
- a("div", B, [
54
- e.title ? (o(), l("span", C, w(e.title), 1)) : s("", !0),
55
- t.$slots.header ? i(t.$slots, "header", { key: 1 }) : s("", !0)
56
- ]),
57
- v(f, {
58
- icon: "close",
59
- role: "button",
60
- class: "text-neutral-600",
61
- onClick: r
62
- })
63
- ])) : s("", !0),
64
- a("div", {
65
- class: n(["flex flex-col flex-1 overflow-y-auto scrollbar", {
66
- [e.injectStyle.body]: !0
67
- }]),
68
- style: { "max-height": "80vh" }
69
- }, [
70
- i(t.$slots, "default")
71
- ], 2),
72
- t.$slots.footer ? (o(), l("div", j, [
73
- i(t.$slots, "footer")
74
- ])) : s("", !0)
75
- ], 2)
76
- ], 34);
77
- };
78
- }
79
- });
80
- export {
81
- M as _
82
- };
@@ -1,71 +0,0 @@
1
- import { defineComponent as y, resolveComponent as m, openBlock as o, createElementBlock as a, normalizeStyle as _, normalizeClass as p, createElementVNode as C, renderSlot as k, unref as l, toDisplayString as v, createBlock as u, withCtx as z, createVNode as g, createCommentVNode as h } from "vue";
2
- import { a as t } from "./ui-BC6H9E93.js";
3
- const B = ["role"], S = { class: "px-2" }, b = { key: 0 }, w = /* @__PURE__ */ y({
4
- name: "TTag",
5
- __name: "Tag",
6
- props: {
7
- text: { default: "" },
8
- size: { default: t.Default },
9
- role: { default: "" },
10
- color: { default: "" },
11
- confirmClose: { type: Boolean, default: !1 },
12
- hasCloseButton: { type: Boolean, default: !1 }
13
- },
14
- emits: ["close"],
15
- setup(f, { emit: d }) {
16
- const e = f, r = d;
17
- return (i, s) => {
18
- const c = m("t-button"), x = m("t-popconfirm");
19
- return o(), a("div", {
20
- style: _(`background-color:${e.color}`),
21
- class: p([{
22
- "bg-caipira-primary-inverted": !e.color
23
- }, "w-max inline-flex items-stretch rounded-sm select-none color-caipira-primary"]),
24
- role: e.role
25
- }, [
26
- C("div", S, [
27
- i.$slots.default ? k(i.$slots, "default", { key: 0 }) : (o(), a("span", {
28
- key: 1,
29
- class: p({
30
- "text-xs": e.size === l(t).ExtraSmall,
31
- "text-sm": e.size === l(t).Small,
32
- "text-base": e.size === l(t).Default,
33
- "text-lg": e.size === l(t).Large,
34
- "text-xl": e.size === l(t).ExtraLarge
35
- })
36
- }, v(e.text), 3))
37
- ]),
38
- e.hasCloseButton ? (o(), a("div", b, [
39
- e.confirmClose ? (o(), u(x, {
40
- key: 0,
41
- message: "Are you sure you want to remove it?",
42
- class: "h-full",
43
- onConfirm: s[0] || (s[0] = (n) => r("close"))
44
- }, {
45
- default: z(({ onTogglePopover: n }) => [
46
- g(c, {
47
- variant: "transparent",
48
- hover: !0,
49
- icon: "close",
50
- size: "",
51
- class: "px-1.5 h-full",
52
- onClick: n
53
- }, null, 8, ["onClick"])
54
- ]),
55
- _: 1
56
- })) : (o(), u(c, {
57
- key: 1,
58
- variant: "transparent",
59
- icon: "close",
60
- size: "sm",
61
- class: "px-1.5 h-full",
62
- onClick: s[1] || (s[1] = (n) => r("close"))
63
- }))
64
- ])) : h("", !0)
65
- ], 14, B);
66
- };
67
- }
68
- });
69
- export {
70
- w as _
71
- };