@caipira/tamandua 0.0.102 → 0.0.103

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-BULzzlLD.js";
2
- import { p } from "./plugin-BbE8ivq1.js";
1
+ import { _ as r } from "./Modal.vue_vue_type_script_setup_true_lang-NiSnflAO.js";
2
+ import { p } from "./plugin-CrSztC5r.js";
3
3
  export {
4
4
  r as Modal,
5
5
  p as ModalPlugin
@@ -1,18 +1,19 @@
1
- import { defineComponent as b, ref as h, onMounted as k, provide as v, resolveComponent as _, openBlock as t, createElementBlock as a, normalizeClass as r, withKeys as w, createBlock as n, createCommentVNode as l, createElementVNode as u, toDisplayString as C, renderSlot as i, resolveDynamicComponent as B, mergeProps as S } from "vue";
2
- import { _ as $ } from "./Backdrop.vue_vue_type_script_setup_true_lang-Dyo6_-EM.js";
3
- const x = {
1
+ import { defineComponent as b, ref as h, onMounted as k, provide as v, resolveComponent as _, openBlock as t, createElementBlock as a, normalizeClass as r, withKeys as w, createBlock as n, createCommentVNode as l, createElementVNode as u, toDisplayString as C, renderSlot as d, resolveDynamicComponent as B, mergeProps as S, toHandlers as $ } from "vue";
2
+ import { _ as x } from "./Backdrop.vue_vue_type_script_setup_true_lang-Dyo6_-EM.js";
3
+ const j = {
4
4
  key: 1,
5
5
  class: "p-4 border-b border-color"
6
- }, j = {
6
+ }, g = {
7
7
  key: 0,
8
8
  class: "block font-semibold uppercase"
9
- }, g = ["id"];
10
- let z = 0;
9
+ }, z = ["id"];
10
+ let H = 0;
11
11
  const F = /* @__PURE__ */ b({
12
12
  name: "TModal",
13
13
  __name: "Modal",
14
14
  props: {
15
15
  is: { default: void 0 },
16
+ on: { default: () => ({}) },
16
17
  props: { default: () => ({}) },
17
18
  title: { default: "" },
18
19
  canClose: { type: Boolean, default: !0 },
@@ -24,11 +25,11 @@ const F = /* @__PURE__ */ b({
24
25
  },
25
26
  emits: ["closed"],
26
27
  setup(p, { emit: f }) {
27
- const e = p, m = f, d = h(null), c = `tamandua-modal-${++z}`, s = (o) => {
28
+ const e = p, m = f, i = h(null), c = `tamandua-modal-${++H}`, s = (o) => {
28
29
  o?.stopPropagation(), m("closed");
29
30
  };
30
31
  return k(() => {
31
- d.value?.focus();
32
+ i.value?.focus();
32
33
  }), v("tamandua-modal-id", c), (o, M) => {
33
34
  const y = _("t-button");
34
35
  return t(), a("div", {
@@ -38,10 +39,10 @@ const F = /* @__PURE__ */ b({
38
39
  }]),
39
40
  tabindex: "-1",
40
41
  ref_key: "modal",
41
- ref: d,
42
+ ref: i,
42
43
  onKeyup: w(s, ["esc"])
43
44
  }, [
44
- e.hasBackdrop ? (t(), n($, {
45
+ e.hasBackdrop ? (t(), n(x, {
45
46
  key: 0,
46
47
  class: "z-10",
47
48
  onClick: s
@@ -60,9 +61,9 @@ const F = /* @__PURE__ */ b({
60
61
  class: "absolute justify-center top-0 right-0 h-14 w-14",
61
62
  onClick: s
62
63
  })) : l("", !0),
63
- e.showHeader ? (t(), a("div", x, [
64
- e.title ? (t(), a("span", j, C(e.title), 1)) : l("", !0),
65
- o.$slots.header ? i(o.$slots, "header", { key: 1 }) : l("", !0)
64
+ e.showHeader ? (t(), a("div", j, [
65
+ e.title ? (t(), a("span", g, C(e.title), 1)) : l("", !0),
66
+ o.$slots.header ? d(o.$slots, "header", { key: 1 }) : l("", !0)
66
67
  ])) : l("", !0),
67
68
  u("div", {
68
69
  class: r(["flex flex-col flex-1 overflow-y-auto scrollbar", {
@@ -70,15 +71,15 @@ const F = /* @__PURE__ */ b({
70
71
  }]),
71
72
  style: { "max-height": "80vh" }
72
73
  }, [
73
- e.is ? (t(), n(B(e.is), S({ key: 0 }, e.props, { onClosed: s }), null, 16)) : i(o.$slots, "default", { key: 1 })
74
+ e.is ? (t(), n(B(e.is), S({ key: 0 }, e.props, $(e.on), { onClosed: s }), null, 16)) : d(o.$slots, "default", { key: 1 })
74
75
  ], 2),
75
76
  e.showFooter || o.$slots.footer ? (t(), a("div", {
76
77
  key: 2,
77
78
  class: "flex flex-row items-center justify-between p-4 border-t border-color",
78
79
  id: `${c}-footer`
79
80
  }, [
80
- i(o.$slots, "footer")
81
- ], 8, g)) : l("", !0)
81
+ d(o.$slots, "footer")
82
+ ], 8, z)) : l("", !0)
82
83
  ], 2)
83
84
  ], 34);
84
85
  };
@@ -32,7 +32,7 @@ import { _ as sr } from "./InputSwitch.vue_vue_type_script_setup_true_lang-BVGfQ
32
32
  import { _ as fr } from "./InputText.vue_vue_type_script_setup_true_lang-D2cGaq7X.js";
33
33
  import { _ as nr } from "./InputTextarea.vue_vue_type_script_setup_true_lang-C8f2hfeZ.js";
34
34
  import { _ as ur } from "./Link.vue_vue_type_script_setup_true_lang-BFFw1dPV.js";
35
- import { _ as lr } from "./Modal.vue_vue_type_script_setup_true_lang-BULzzlLD.js";
35
+ import { _ as lr } from "./Modal.vue_vue_type_script_setup_true_lang-NiSnflAO.js";
36
36
  import { _ as cr } from "./ModalForm.vue_vue_type_script_setup_true_lang-C1Xl4TmQ.js";
37
37
  import { _ as Tr } from "./Pagination.vue_vue_type_script_setup_true_lang-BCQUrEVO.js";
38
38
  import { _ as dr } from "./Popconfirm.vue_vue_type_script_setup_true_lang-CR0OJ8Ao.js";
@@ -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-BULzzlLD.js";
2
+ import { _ as s } from "./Modal.vue_vue_type_script_setup_true_lang-NiSnflAO.js";
3
3
  const m = {
4
4
  install(o) {
5
5
  r(o, s);
@@ -49,7 +49,7 @@ import { p as F } from "./plugin-cOJ_nFaw.js";
49
49
  import "./Link.vue_vue_type_script_setup_true_lang-BFFw1dPV.js";
50
50
  import { p as A } from "./plugin-bSqyo8FU.js";
51
51
  import { p as L } from "./plugin-uxc8N8iO.js";
52
- import { p as M } from "./plugin-BbE8ivq1.js";
52
+ import { p as M } from "./plugin-CrSztC5r.js";
53
53
  import { p as _ } from "./plugin-jyvJNavM.js";
54
54
  import "./Popconfirm.vue_vue_type_script_setup_true_lang-CR0OJ8Ao.js";
55
55
  import { p as j } from "./plugin-Bhokj2iJ.js";
package/dist/plugins.js CHANGED
@@ -49,7 +49,7 @@ import { p as Mr } from "./plugin-cOJ_nFaw.js";
49
49
  import "./Link.vue_vue_type_script_setup_true_lang-BFFw1dPV.js";
50
50
  import { p as Er } from "./plugin-bSqyo8FU.js";
51
51
  import { p as jr } from "./plugin-uxc8N8iO.js";
52
- import { p as zr } from "./plugin-BbE8ivq1.js";
52
+ import { p as zr } from "./plugin-CrSztC5r.js";
53
53
  import { p as Jr } from "./plugin-jyvJNavM.js";
54
54
  import "./Popconfirm.vue_vue_type_script_setup_true_lang-CR0OJ8Ao.js";
55
55
  import { p as Nr } from "./plugin-Bhokj2iJ.js";
package/dist/tamandua.js CHANGED
@@ -1,4 +1,4 @@
1
- import { p as n } from "./plugins-iuR3SgQL.js";
1
+ import { p as n } from "./plugins-CVA2j6EE.js";
2
2
  const o = {
3
3
  install(s) {
4
4
  for (const i in n)
@@ -2,6 +2,7 @@ import { ModalProps } from './types.js';
2
2
 
3
3
  declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ModalProps>, {
4
4
  is: undefined;
5
+ on: () => {};
5
6
  props: () => {};
6
7
  title: string;
7
8
  canClose: boolean;
@@ -18,6 +19,7 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<__
18
19
  closed: () => void;
19
20
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ModalProps>, {
20
21
  is: undefined;
22
+ on: () => {};
21
23
  props: () => {};
22
24
  title: string;
23
25
  canClose: boolean;
@@ -36,6 +38,7 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<__
36
38
  title: string;
37
39
  props: Record<string, any>;
38
40
  is: import("vue").Component;
41
+ on: Record<string, (...args: any[]) => void>;
39
42
  canClose: boolean;
40
43
  showHeader: boolean;
41
44
  showFooter: boolean;
@@ -5,6 +5,10 @@ export type ModalProps = {
5
5
  * Component to be rendered inside the modal body
6
6
  */
7
7
  is?: Component;
8
+ /**
9
+ * Events to be bound to the body component
10
+ */
11
+ on?: Record<string, (...args: any[]) => void>;
8
12
  /**
9
13
  * Body component props
10
14
  */
@@ -216,6 +216,7 @@ export default function useDialog(): {
216
216
  }[] | undefined;
217
217
  __INTLIFY_META__?: string | undefined;
218
218
  } | undefined;
219
+ on?: Record<string, (...args: any[]) => void> | undefined;
219
220
  props?: Record<string, any> | undefined;
220
221
  title?: string | undefined;
221
222
  canClose?: boolean | undefined;
@@ -431,6 +432,7 @@ export default function useDialog(): {
431
432
  }[] | undefined;
432
433
  __INTLIFY_META__?: string | undefined;
433
434
  } | undefined;
435
+ on?: Record<string, (...args: any[]) => void> | undefined;
434
436
  props?: Record<string, any> | undefined;
435
437
  title?: string | undefined;
436
438
  canClose?: boolean | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@caipira/tamandua",
3
- "version": "0.0.102",
3
+ "version": "0.0.103",
4
4
  "private": false,
5
5
  "description": "UI library for the Caipira ecosystem",
6
6
  "license": "GPL-3.0-only",