@caipira/tamandua 0.0.101 → 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.
@@ -1,5 +1,5 @@
1
- import { _ as i } from "./DialogProvider.vue_vue_type_script_setup_true_lang-ejMXvlRv.js";
2
- import { p as e } from "./plugin-DXPPWWyR.js";
1
+ import { _ as i } from "./DialogProvider.vue_vue_type_script_setup_true_lang-DdpepOBn.js";
2
+ import { p as e } from "./plugin-NlTwzbQb.js";
3
3
  export {
4
4
  i as DialogProvider,
5
5
  e as DialogProviderPlugin
@@ -0,0 +1,24 @@
1
+ import { defineComponent as p, resolveComponent as t, openBlock as e, createElementBlock as n, Fragment as r, renderList as l, unref as s, createBlock as m, mergeProps as i } from "vue";
2
+ import { u as d } from "./useDialog-BOJPIAnz.js";
3
+ const B = /* @__PURE__ */ p({
4
+ name: "TDialogProvider",
5
+ __name: "DialogProvider",
6
+ setup(C) {
7
+ const { modals: a, alerts: c } = d();
8
+ return (f, v) => {
9
+ const u = t("t-modal"), _ = t("t-alert");
10
+ return e(), n("div", null, [
11
+ (e(!0), n(r, null, l(s(a), (o) => (e(), m(u, i(o.options, {
12
+ onClosed: o.events.onClose
13
+ }), null, 16, ["onClosed"]))), 256)),
14
+ (e(!0), n(r, null, l(s(c), (o) => (e(), m(_, i(o.options, {
15
+ onClosed: o.events.onClose,
16
+ onConfirmed: o.events.onConfirm
17
+ }), null, 16, ["onClosed", "onConfirmed"]))), 256))
18
+ ]);
19
+ };
20
+ }
21
+ });
22
+ export {
23
+ B as _
24
+ };
package/dist/Modal.js CHANGED
@@ -1,5 +1,5 @@
1
- import { _ as r } from "./Modal.vue_vue_type_script_setup_true_lang-gKqoL70h.js";
2
- import { p } from "./plugin-Cy5TXn1Y.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
@@ -0,0 +1,90 @@
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
+ key: 1,
5
+ class: "p-4 border-b border-color"
6
+ }, g = {
7
+ key: 0,
8
+ class: "block font-semibold uppercase"
9
+ }, z = ["id"];
10
+ let H = 0;
11
+ const F = /* @__PURE__ */ b({
12
+ name: "TModal",
13
+ __name: "Modal",
14
+ props: {
15
+ is: { default: void 0 },
16
+ on: { default: () => ({}) },
17
+ props: { default: () => ({}) },
18
+ title: { default: "" },
19
+ canClose: { type: Boolean, default: !0 },
20
+ showHeader: { type: Boolean, default: !0 },
21
+ showFooter: { type: Boolean, default: !1 },
22
+ injectStyle: { default: () => ({ wrapper: "", body: "", container: "" }) },
23
+ hasBackdrop: { type: Boolean, default: !0 },
24
+ disableStyle: { type: Boolean, default: !1 }
25
+ },
26
+ emits: ["closed"],
27
+ setup(p, { emit: f }) {
28
+ const e = p, m = f, i = h(null), c = `tamandua-modal-${++H}`, s = (o) => {
29
+ o?.stopPropagation(), m("closed");
30
+ };
31
+ return k(() => {
32
+ i.value?.focus();
33
+ }), v("tamandua-modal-id", c), (o, M) => {
34
+ const y = _("t-button");
35
+ return t(), a("div", {
36
+ class: r(["fixed inset-0 focus-visible:outline-hidden z-10", {
37
+ "flex items-center": !e.disableStyle,
38
+ [e.injectStyle.wrapper]: !0
39
+ }]),
40
+ tabindex: "-1",
41
+ ref_key: "modal",
42
+ ref: i,
43
+ onKeyup: w(s, ["esc"])
44
+ }, [
45
+ e.hasBackdrop ? (t(), n(x, {
46
+ key: 0,
47
+ class: "z-10",
48
+ onClick: s
49
+ })) : l("", !0),
50
+ u("div", {
51
+ class: r(["z-10 w-full md:w-[36rem] mx-auto", {
52
+ "relative floatable": !e.disableStyle,
53
+ [e.injectStyle.container]: !0
54
+ }])
55
+ }, [
56
+ e.canClose ? (t(), n(y, {
57
+ key: 0,
58
+ variant: "transparent",
59
+ icon: "close",
60
+ size: "",
61
+ class: "absolute justify-center top-0 right-0 h-14 w-14",
62
+ onClick: s
63
+ })) : 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)
67
+ ])) : l("", !0),
68
+ u("div", {
69
+ class: r(["flex flex-col flex-1 overflow-y-auto scrollbar", {
70
+ [e.injectStyle.body]: !0
71
+ }]),
72
+ style: { "max-height": "80vh" }
73
+ }, [
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 })
75
+ ], 2),
76
+ e.showFooter || o.$slots.footer ? (t(), a("div", {
77
+ key: 2,
78
+ class: "flex flex-row items-center justify-between p-4 border-t border-color",
79
+ id: `${c}-footer`
80
+ }, [
81
+ d(o.$slots, "footer")
82
+ ], 8, z)) : l("", !0)
83
+ ], 2)
84
+ ], 34);
85
+ };
86
+ }
87
+ });
88
+ export {
89
+ F as _
90
+ };
@@ -4,7 +4,7 @@ import { _ as s } from "./Backdrop.vue_vue_type_script_setup_true_lang-Dyo6_-EM.
4
4
  import { _ as f } from "./Button.vue_vue_type_script_setup_true_lang-zvMC7Ucn.js";
5
5
  import { _ as n } from "./ChartLine.vue_vue_type_style_index_0_lang-DO_gKCe4.js";
6
6
  import { _ as u } from "./ChartTreemap.vue_vue_type_script_setup_true_lang-CLi_IXfP.js";
7
- import { _ as l } from "./DialogProvider.vue_vue_type_script_setup_true_lang-ejMXvlRv.js";
7
+ import { _ as l } from "./DialogProvider.vue_vue_type_script_setup_true_lang-DdpepOBn.js";
8
8
  import { D as c } from "./Drawer-y5xBARd2.js";
9
9
  import { _ as T } from "./Dropdown.vue_vue_type_script_setup_true_lang-BSnpkGOU.js";
10
10
  import { _ as d } from "./FileDrop.vue_vue_type_script_setup_true_lang-Bq0lAgZ7.js";
@@ -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-gKqoL70h.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,6 +1,6 @@
1
1
  import { ref as o, getCurrentInstance as l } from "vue";
2
2
  import { u as O } from "./useClipboard-BHFD0Jvv.js";
3
- import { u as R } from "./useDialog-Cl-wVLea.js";
3
+ import { u as R } from "./useDialog-BOJPIAnz.js";
4
4
  const f = 640, d = 768, c = 1024, n = o(window.innerWidth), s = o(!1), i = o(!1), a = o(!1), u = (e) => {
5
5
  n.value = e ? e.target.innerWidth : window.innerWidth, s.value = n.value >= f, i.value = n.value >= d, a.value = n.value >= c;
6
6
  };
@@ -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-gKqoL70h.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);
@@ -1,5 +1,5 @@
1
1
  import { r } from "./register-component-B-fdqewb.js";
2
- import { _ as s } from "./DialogProvider.vue_vue_type_script_setup_true_lang-ejMXvlRv.js";
2
+ import { _ as s } from "./DialogProvider.vue_vue_type_script_setup_true_lang-DdpepOBn.js";
3
3
  const m = {
4
4
  install(o) {
5
5
  r(o, s);
@@ -9,8 +9,8 @@ import "./transform-DSaNEFMr.js";
9
9
  import "./ChartLine.vue_vue_type_style_index_0_lang-DO_gKCe4.js";
10
10
  import { p as n } from "./plugin-DDXOF4cU.js";
11
11
  import { p as m } from "./plugin-CyDnzy2n.js";
12
- import "./useDialog-Cl-wVLea.js";
13
- import { p as t } from "./plugin-DXPPWWyR.js";
12
+ import "./useDialog-BOJPIAnz.js";
13
+ import { p as t } from "./plugin-NlTwzbQb.js";
14
14
  import "./Drawer-y5xBARd2.js";
15
15
  import { p as u } from "./plugin-JMSzJgz5.js";
16
16
  import "./Dropdown.vue_vue_type_script_setup_true_lang-BSnpkGOU.js";
@@ -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-Cy5TXn1Y.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
@@ -9,8 +9,8 @@ import "./transform-DSaNEFMr.js";
9
9
  import "./ChartLine.vue_vue_type_style_index_0_lang-DO_gKCe4.js";
10
10
  import { p as M } from "./plugin-DDXOF4cU.js";
11
11
  import { p as E } from "./plugin-CyDnzy2n.js";
12
- import "./useDialog-Cl-wVLea.js";
13
- import { p as j } from "./plugin-DXPPWWyR.js";
12
+ import "./useDialog-BOJPIAnz.js";
13
+ import { p as j } from "./plugin-NlTwzbQb.js";
14
14
  import "./Drawer-y5xBARd2.js";
15
15
  import { p as z } from "./plugin-JMSzJgz5.js";
16
16
  import "./Dropdown.vue_vue_type_script_setup_true_lang-BSnpkGOU.js";
@@ -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-Cy5TXn1Y.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-C-OK-RIJ.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)
@@ -9,11 +9,11 @@ export declare const Alert: (args: any) => {
9
9
  open: import('vue').Ref<boolean>;
10
10
  title: import('vue').Ref<string>;
11
11
  message: import('vue').Ref<string>;
12
+ confirm: import('vue').Ref<boolean>;
12
13
  alert: (options: import('./types.js').AlertProps & {
13
14
  onConfirm?: () => void;
14
15
  onClose?: () => void;
15
16
  }) => void;
16
- confirm: import('vue').Ref<boolean>;
17
17
  };
18
18
  template: string;
19
19
  };
@@ -63,8 +63,8 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_WithDefaults<
63
63
  wrapperRoundnessClass: string;
64
64
  }>>> & {
65
65
  onChange?: ((val: import("./types.js").SelectEvent) => any) | undefined;
66
- "onEnd-reached"?: (() => any) | undefined;
67
66
  onCreated?: ((val: import("vue").ComponentInternalInstance | null) => any) | undefined;
67
+ "onEnd-reached"?: (() => any) | undefined;
68
68
  }, {
69
69
  loading: boolean;
70
70
  size: `${FormControlSize}`;
@@ -55,6 +55,12 @@ declare const __VLS_component: import('vue').DefineComponent<{
55
55
  type: import("vue").PropType<InputSelectOption[]>;
56
56
  default: () => never[];
57
57
  };
58
+ resource: {
59
+ type: import("vue").PropType<(filters?: APISearchFilters | undefined) => Promise<{
60
+ items: unknown[];
61
+ pagination: Pagination;
62
+ }>>;
63
+ };
58
64
  initialValue: {
59
65
  type: import("vue").PropType<any>;
60
66
  };
@@ -62,12 +68,6 @@ declare const __VLS_component: import('vue').DefineComponent<{
62
68
  type: import("vue").PropType<string>;
63
69
  default: string;
64
70
  };
65
- resource: {
66
- type: import("vue").PropType<(filters?: APISearchFilters | undefined) => Promise<{
67
- items: unknown[];
68
- pagination: Pagination;
69
- }>>;
70
- };
71
71
  mapper: {
72
72
  type: import("vue").PropType<(i: any) => InputSelectOption>;
73
73
  default: (i: any) => InputSelectOption;
@@ -122,6 +122,12 @@ declare const __VLS_component: import('vue').DefineComponent<{
122
122
  type: import("vue").PropType<InputSelectOption[]>;
123
123
  default: () => never[];
124
124
  };
125
+ resource: {
126
+ type: import("vue").PropType<(filters?: APISearchFilters | undefined) => Promise<{
127
+ items: unknown[];
128
+ pagination: Pagination;
129
+ }>>;
130
+ };
125
131
  initialValue: {
126
132
  type: import("vue").PropType<any>;
127
133
  };
@@ -129,12 +135,6 @@ declare const __VLS_component: import('vue').DefineComponent<{
129
135
  type: import("vue").PropType<string>;
130
136
  default: string;
131
137
  };
132
- resource: {
133
- type: import("vue").PropType<(filters?: APISearchFilters | undefined) => Promise<{
134
- items: unknown[];
135
- pagination: Pagination;
136
- }>>;
137
- };
138
138
  mapper: {
139
139
  type: import("vue").PropType<(i: any) => InputSelectOption>;
140
140
  default: (i: any) => InputSelectOption;
@@ -0,0 +1,21 @@
1
+ declare const _default: {
2
+ title: string;
3
+ args: {};
4
+ };
5
+ export default _default;
6
+ export declare const Modal: (args: any) => {
7
+ setup(): {
8
+ args: any;
9
+ open: import('vue').Ref<boolean>;
10
+ title: import('vue').Ref<string>;
11
+ canClose: import('vue').Ref<boolean>;
12
+ modal: (options: import('./types.js').ModalProps & {
13
+ onClose?: () => void;
14
+ }) => void;
15
+ CustomModalBody: import('vue').Raw<import("vue").DefineComponent<{}, {
16
+ props: import("@vue/shared").LooseRequired<{} & {}>;
17
+ emit: (event: string, ...args: any[]) => void;
18
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>>;
19
+ };
20
+ template: string;
21
+ };
@@ -1,14 +1,13 @@
1
1
  import { ModalProps } from './types.js';
2
2
 
3
- declare function __VLS_template(): {
4
- header?(_: {}): any;
5
- default?(_: {}): any;
6
- footer?(_: {}): any;
7
- };
8
- declare const __VLS_component: import('vue').DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ModalProps>, {
3
+ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ModalProps>, {
4
+ is: undefined;
5
+ on: () => {};
6
+ props: () => {};
9
7
  title: string;
10
8
  canClose: boolean;
11
9
  showHeader: boolean;
10
+ showFooter: boolean;
12
11
  injectStyle: () => {
13
12
  wrapper: string;
14
13
  body: string;
@@ -19,9 +18,13 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_WithDefaults<
19
18
  }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
20
19
  closed: () => void;
21
20
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ModalProps>, {
21
+ is: undefined;
22
+ on: () => {};
23
+ props: () => {};
22
24
  title: string;
23
25
  canClose: boolean;
24
26
  showHeader: boolean;
27
+ showFooter: boolean;
25
28
  injectStyle: () => {
26
29
  wrapper: string;
27
30
  body: string;
@@ -33,13 +36,20 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_WithDefaults<
33
36
  onClosed?: (() => any) | undefined;
34
37
  }, {
35
38
  title: string;
36
- showHeader: boolean;
37
- disableStyle: boolean;
39
+ props: Record<string, any>;
40
+ is: import("vue").Component;
41
+ on: Record<string, (...args: any[]) => void>;
38
42
  canClose: boolean;
43
+ showHeader: boolean;
44
+ showFooter: boolean;
39
45
  injectStyle: any;
40
46
  hasBackdrop: boolean;
41
- }, {}>;
42
- declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
47
+ disableStyle: boolean;
48
+ }, {}>, {
49
+ header?(_: {}): any;
50
+ default?(_: {}): any;
51
+ footer?(_: {}): any;
52
+ }>;
43
53
  export default _default;
44
54
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
45
55
  type __VLS_TypePropsToRuntimeProps<T> = {
@@ -1,7 +1,34 @@
1
+ import { Component } from 'vue';
2
+
1
3
  export type ModalProps = {
4
+ /**
5
+ * Component to be rendered inside the modal body
6
+ */
7
+ is?: Component;
8
+ /**
9
+ * Events to be bound to the body component
10
+ */
11
+ on?: Record<string, (...args: any[]) => void>;
12
+ /**
13
+ * Body component props
14
+ */
15
+ props?: Record<string, any>;
16
+ /**
17
+ * Modal title
18
+ */
2
19
  title?: string;
20
+ /**
21
+ * Whether the modal can be closed by the user
22
+ */
3
23
  canClose?: boolean;
24
+ /**
25
+ * Whether to show the header section
26
+ */
4
27
  showHeader?: boolean;
28
+ /**
29
+ * Whether to show the footer section
30
+ */
31
+ showFooter?: boolean;
5
32
  injectStyle?: any;
6
33
  hasBackdrop?: boolean;
7
34
  disableStyle?: boolean;
@@ -1,10 +1,449 @@
1
1
  import { AlertProps } from '../components/Alert/types.js';
2
+ import { ModalProps } from '../components/Modal/types.js';
2
3
 
4
+ type ModalOptions = ModalProps & {
5
+ onClose?: () => void;
6
+ };
3
7
  type AlertOptions = AlertProps & {
4
8
  onConfirm?: () => void;
5
9
  onClose?: () => void;
6
10
  };
7
11
  export default function useDialog(): {
12
+ modals: import('vue').Ref<{
13
+ id: string;
14
+ events: {
15
+ is?: import("vue").FunctionalComponent<any, {}, any, {}> | {
16
+ new (...args: any[]): any;
17
+ __isFragment?: never;
18
+ __isTeleport?: never;
19
+ __isSuspense?: never;
20
+ } | {
21
+ [x: string]: any;
22
+ setup?: ((this: void, props: import("@vue/shared").LooseRequired<any>, ctx: {
23
+ attrs: {
24
+ [x: string]: unknown;
25
+ };
26
+ slots: Readonly<{
27
+ [name: string]: import("vue").Slot<any> | undefined;
28
+ }>;
29
+ emit: ((event: unknown, ...args: any[]) => void) | ((event: string, ...args: any[]) => void);
30
+ expose: (exposed?: Record<string, any>) => void;
31
+ }) => any) | undefined;
32
+ name?: string | undefined;
33
+ template?: string | object | undefined;
34
+ render?: Function | undefined;
35
+ components?: Record<string, import("vue").Component> | undefined;
36
+ directives?: Record<string, import("vue").Directive> | undefined;
37
+ inheritAttrs?: boolean | undefined;
38
+ emits?: any;
39
+ slots?: {} | undefined;
40
+ expose?: string[] | undefined;
41
+ serverPrefetch?: (() => void | Promise<any>) | undefined;
42
+ compilerOptions?: {
43
+ isCustomElement?: ((tag: string) => boolean) | undefined;
44
+ whitespace?: "preserve" | "condense" | undefined;
45
+ comments?: boolean | undefined;
46
+ delimiters?: [string, string] | undefined;
47
+ } | undefined;
48
+ call?: ((this: unknown, ...args: unknown[]) => never) | undefined;
49
+ __isFragment?: never | undefined;
50
+ __isTeleport?: never | undefined;
51
+ __isSuspense?: never | undefined;
52
+ __defaults?: any;
53
+ compatConfig?: {
54
+ GLOBAL_MOUNT?: boolean | "suppress-warning" | undefined;
55
+ GLOBAL_MOUNT_CONTAINER?: boolean | "suppress-warning" | undefined;
56
+ GLOBAL_EXTEND?: boolean | "suppress-warning" | undefined;
57
+ GLOBAL_PROTOTYPE?: boolean | "suppress-warning" | undefined;
58
+ GLOBAL_SET?: boolean | "suppress-warning" | undefined;
59
+ GLOBAL_DELETE?: boolean | "suppress-warning" | undefined;
60
+ GLOBAL_OBSERVABLE?: boolean | "suppress-warning" | undefined;
61
+ GLOBAL_PRIVATE_UTIL?: boolean | "suppress-warning" | undefined;
62
+ CONFIG_SILENT?: boolean | "suppress-warning" | undefined;
63
+ CONFIG_DEVTOOLS?: boolean | "suppress-warning" | undefined;
64
+ CONFIG_KEY_CODES?: boolean | "suppress-warning" | undefined;
65
+ CONFIG_PRODUCTION_TIP?: boolean | "suppress-warning" | undefined;
66
+ CONFIG_IGNORED_ELEMENTS?: boolean | "suppress-warning" | undefined;
67
+ CONFIG_WHITESPACE?: boolean | "suppress-warning" | undefined;
68
+ CONFIG_OPTION_MERGE_STRATS?: boolean | "suppress-warning" | undefined;
69
+ INSTANCE_SET?: boolean | "suppress-warning" | undefined;
70
+ INSTANCE_DELETE?: boolean | "suppress-warning" | undefined;
71
+ INSTANCE_DESTROY?: boolean | "suppress-warning" | undefined;
72
+ INSTANCE_EVENT_EMITTER?: boolean | "suppress-warning" | undefined;
73
+ INSTANCE_EVENT_HOOKS?: boolean | "suppress-warning" | undefined;
74
+ INSTANCE_CHILDREN?: boolean | "suppress-warning" | undefined;
75
+ INSTANCE_LISTENERS?: boolean | "suppress-warning" | undefined;
76
+ INSTANCE_SCOPED_SLOTS?: boolean | "suppress-warning" | undefined;
77
+ INSTANCE_ATTRS_CLASS_STYLE?: boolean | "suppress-warning" | undefined;
78
+ OPTIONS_DATA_FN?: boolean | "suppress-warning" | undefined;
79
+ OPTIONS_DATA_MERGE?: boolean | "suppress-warning" | undefined;
80
+ OPTIONS_BEFORE_DESTROY?: boolean | "suppress-warning" | undefined;
81
+ OPTIONS_DESTROYED?: boolean | "suppress-warning" | undefined;
82
+ WATCH_ARRAY?: boolean | "suppress-warning" | undefined;
83
+ PROPS_DEFAULT_THIS?: boolean | "suppress-warning" | undefined;
84
+ V_ON_KEYCODE_MODIFIER?: boolean | "suppress-warning" | undefined;
85
+ CUSTOM_DIR?: boolean | "suppress-warning" | undefined;
86
+ ATTR_FALSE_VALUE?: boolean | "suppress-warning" | undefined;
87
+ ATTR_ENUMERATED_COERCION?: boolean | "suppress-warning" | undefined;
88
+ TRANSITION_CLASSES?: boolean | "suppress-warning" | undefined;
89
+ TRANSITION_GROUP_ROOT?: boolean | "suppress-warning" | undefined;
90
+ COMPONENT_ASYNC?: boolean | "suppress-warning" | undefined;
91
+ COMPONENT_FUNCTIONAL?: boolean | "suppress-warning" | undefined;
92
+ COMPONENT_V_MODEL?: boolean | "suppress-warning" | undefined;
93
+ RENDER_FUNCTION?: boolean | "suppress-warning" | undefined;
94
+ FILTERS?: boolean | "suppress-warning" | undefined;
95
+ PRIVATE_APIS?: boolean | "suppress-warning" | undefined;
96
+ MODE?: 2 | 3 | ((comp: import("vue").Component | null) => 2 | 3) | undefined;
97
+ } | undefined;
98
+ data?: ((this: any, vm: any) => any) | undefined;
99
+ computed?: import("vue").ComputedOptions | undefined;
100
+ methods?: import("vue").MethodOptions | undefined;
101
+ watch?: {
102
+ [x: string]: (string | import("vue").WatchCallback<any, any> | ({
103
+ handler: import("vue").WatchCallback | string;
104
+ } & import("vue").WatchOptions<boolean>)) | (string | import("vue").WatchCallback<any, any> | ({
105
+ handler: import("vue").WatchCallback | string;
106
+ } & import("vue").WatchOptions<boolean>))[];
107
+ } | undefined;
108
+ provide?: import("vue").ComponentProvideOptions | undefined;
109
+ inject?: {} | string[] | undefined;
110
+ filters?: Record<string, Function> | undefined;
111
+ mixins?: any[] | undefined;
112
+ extends?: any;
113
+ beforeCreate?: (() => void) | undefined;
114
+ created?: (() => void) | undefined;
115
+ beforeMount?: (() => void) | undefined;
116
+ mounted?: (() => void) | undefined;
117
+ beforeUpdate?: (() => void) | undefined;
118
+ updated?: (() => void) | undefined;
119
+ activated?: (() => void) | undefined;
120
+ deactivated?: (() => void) | undefined;
121
+ beforeDestroy?: (() => void) | undefined;
122
+ beforeUnmount?: (() => void) | undefined;
123
+ destroyed?: (() => void) | undefined;
124
+ unmounted?: (() => void) | undefined;
125
+ renderTracked?: ((e: import("vue").DebuggerEvent) => void) | undefined;
126
+ renderTriggered?: ((e: import("vue").DebuggerEvent) => void) | undefined;
127
+ errorCaptured?: ((err: unknown, instance: import("vue").ComponentPublicInstance | null, info: string) => boolean | void) | undefined;
128
+ delimiters?: [string, string] | undefined;
129
+ __differentiator?: string | number | symbol | undefined;
130
+ __isBuiltIn?: boolean | undefined;
131
+ __file?: string | undefined;
132
+ __name?: string | undefined;
133
+ i18n?: {
134
+ locale?: string | undefined;
135
+ fallbackLocale?: string | false | string[] | {
136
+ [x: string]: string[];
137
+ } | undefined;
138
+ messages?: {
139
+ [x: string]: import("@intlify/core-base").LocaleMessage<import("vue-i18n").VueMessageType>;
140
+ } | undefined;
141
+ flatJson?: boolean | undefined;
142
+ datetimeFormats?: {
143
+ [x: string]: import("vue-i18n").IntlDateTimeFormat;
144
+ } | undefined;
145
+ numberFormats?: {
146
+ [x: string]: import("vue-i18n").IntlNumberFormat;
147
+ } | undefined;
148
+ availableLocales?: import("vue-i18n").Locale[] | undefined;
149
+ modifiers?: import("vue-i18n").LinkedModifiers<import("vue-i18n").VueMessageType> | undefined;
150
+ formatter?: {
151
+ interpolate: (message: string, values: any, path: string) => Array<any> | null;
152
+ } | undefined;
153
+ missing?: import("vue-i18n").MissingHandler | undefined;
154
+ fallbackRoot?: boolean | undefined;
155
+ silentTranslationWarn?: boolean | {
156
+ exec: (string: string) => RegExpExecArray | null;
157
+ test: (string: string) => boolean;
158
+ readonly source: string;
159
+ readonly global: boolean;
160
+ readonly ignoreCase: boolean;
161
+ readonly multiline: boolean;
162
+ lastIndex: number;
163
+ compile: (pattern: string, flags?: string) => RegExp;
164
+ readonly flags: string;
165
+ readonly sticky: boolean;
166
+ readonly unicode: boolean;
167
+ readonly dotAll: boolean;
168
+ readonly hasIndices: boolean;
169
+ readonly unicodeSets: boolean;
170
+ [Symbol.match]: (string: string) => RegExpMatchArray | null;
171
+ [Symbol.replace]: {
172
+ (string: string, replaceValue: string): string;
173
+ (string: string, replacer: (substring: string, ...args: any[]) => string): string;
174
+ };
175
+ [Symbol.search]: (string: string) => number;
176
+ [Symbol.split]: (string: string, limit?: number) => string[];
177
+ [Symbol.matchAll]: (str: string) => RegExpStringIterator<RegExpMatchArray>;
178
+ } | undefined;
179
+ silentFallbackWarn?: boolean | {
180
+ exec: (string: string) => RegExpExecArray | null;
181
+ test: (string: string) => boolean;
182
+ readonly source: string;
183
+ readonly global: boolean;
184
+ readonly ignoreCase: boolean;
185
+ readonly multiline: boolean;
186
+ lastIndex: number;
187
+ compile: (pattern: string, flags?: string) => RegExp;
188
+ readonly flags: string;
189
+ readonly sticky: boolean;
190
+ readonly unicode: boolean;
191
+ readonly dotAll: boolean;
192
+ readonly hasIndices: boolean;
193
+ readonly unicodeSets: boolean;
194
+ [Symbol.match]: (string: string) => RegExpMatchArray | null;
195
+ [Symbol.replace]: {
196
+ (string: string, replaceValue: string): string;
197
+ (string: string, replacer: (substring: string, ...args: any[]) => string): string;
198
+ };
199
+ [Symbol.search]: (string: string) => number;
200
+ [Symbol.split]: (string: string, limit?: number) => string[];
201
+ [Symbol.matchAll]: (str: string) => RegExpStringIterator<RegExpMatchArray>;
202
+ } | undefined;
203
+ formatFallbackMessages?: boolean | undefined;
204
+ preserveDirectiveContent?: boolean | undefined;
205
+ warnHtmlInMessage?: import("vue-i18n").WarnHtmlInMessageLevel | undefined;
206
+ escapeParameterHtml?: boolean | undefined;
207
+ sharedMessages?: import("vue-i18n").LocaleMessages<import("vue-i18n").VueMessageType> | undefined;
208
+ pluralizationRules?: import("@intlify/core-base").PluralizationRules | undefined;
209
+ postTranslation?: import("vue-i18n").PostTranslationHandler<import("vue-i18n").VueMessageType> | undefined;
210
+ sync?: boolean | undefined;
211
+ messageResolver?: import("vue-i18n").MessageResolver | undefined;
212
+ } | undefined;
213
+ __i18n?: {
214
+ locale: import("vue-i18n").Locale;
215
+ resource: import("vue-i18n").LocaleMessages<import("vue-i18n").VueMessageType>;
216
+ }[] | undefined;
217
+ __INTLIFY_META__?: string | undefined;
218
+ } | undefined;
219
+ on?: Record<string, (...args: any[]) => void> | undefined;
220
+ props?: Record<string, any> | undefined;
221
+ title?: string | undefined;
222
+ canClose?: boolean | undefined;
223
+ showHeader?: boolean | undefined;
224
+ showFooter?: boolean | undefined;
225
+ injectStyle?: any;
226
+ hasBackdrop?: boolean | undefined;
227
+ disableStyle?: boolean | undefined;
228
+ onClose?: (() => void) | undefined;
229
+ };
230
+ options: {
231
+ is?: import("vue").FunctionalComponent<any, {}, any, {}> | {
232
+ new (...args: any[]): any;
233
+ __isFragment?: never;
234
+ __isTeleport?: never;
235
+ __isSuspense?: never;
236
+ } | {
237
+ [x: string]: any;
238
+ setup?: ((this: void, props: import("@vue/shared").LooseRequired<any>, ctx: {
239
+ attrs: {
240
+ [x: string]: unknown;
241
+ };
242
+ slots: Readonly<{
243
+ [name: string]: import("vue").Slot<any> | undefined;
244
+ }>;
245
+ emit: ((event: unknown, ...args: any[]) => void) | ((event: string, ...args: any[]) => void);
246
+ expose: (exposed?: Record<string, any>) => void;
247
+ }) => any) | undefined;
248
+ name?: string | undefined;
249
+ template?: string | object | undefined;
250
+ render?: Function | undefined;
251
+ components?: Record<string, import("vue").Component> | undefined;
252
+ directives?: Record<string, import("vue").Directive> | undefined;
253
+ inheritAttrs?: boolean | undefined;
254
+ emits?: any;
255
+ slots?: {} | undefined;
256
+ expose?: string[] | undefined;
257
+ serverPrefetch?: (() => void | Promise<any>) | undefined;
258
+ compilerOptions?: {
259
+ isCustomElement?: ((tag: string) => boolean) | undefined;
260
+ whitespace?: "preserve" | "condense" | undefined;
261
+ comments?: boolean | undefined;
262
+ delimiters?: [string, string] | undefined;
263
+ } | undefined;
264
+ call?: ((this: unknown, ...args: unknown[]) => never) | undefined;
265
+ __isFragment?: never | undefined;
266
+ __isTeleport?: never | undefined;
267
+ __isSuspense?: never | undefined;
268
+ __defaults?: any;
269
+ compatConfig?: {
270
+ GLOBAL_MOUNT?: boolean | "suppress-warning" | undefined;
271
+ GLOBAL_MOUNT_CONTAINER?: boolean | "suppress-warning" | undefined;
272
+ GLOBAL_EXTEND?: boolean | "suppress-warning" | undefined;
273
+ GLOBAL_PROTOTYPE?: boolean | "suppress-warning" | undefined;
274
+ GLOBAL_SET?: boolean | "suppress-warning" | undefined;
275
+ GLOBAL_DELETE?: boolean | "suppress-warning" | undefined;
276
+ GLOBAL_OBSERVABLE?: boolean | "suppress-warning" | undefined;
277
+ GLOBAL_PRIVATE_UTIL?: boolean | "suppress-warning" | undefined;
278
+ CONFIG_SILENT?: boolean | "suppress-warning" | undefined;
279
+ CONFIG_DEVTOOLS?: boolean | "suppress-warning" | undefined;
280
+ CONFIG_KEY_CODES?: boolean | "suppress-warning" | undefined;
281
+ CONFIG_PRODUCTION_TIP?: boolean | "suppress-warning" | undefined;
282
+ CONFIG_IGNORED_ELEMENTS?: boolean | "suppress-warning" | undefined;
283
+ CONFIG_WHITESPACE?: boolean | "suppress-warning" | undefined;
284
+ CONFIG_OPTION_MERGE_STRATS?: boolean | "suppress-warning" | undefined;
285
+ INSTANCE_SET?: boolean | "suppress-warning" | undefined;
286
+ INSTANCE_DELETE?: boolean | "suppress-warning" | undefined;
287
+ INSTANCE_DESTROY?: boolean | "suppress-warning" | undefined;
288
+ INSTANCE_EVENT_EMITTER?: boolean | "suppress-warning" | undefined;
289
+ INSTANCE_EVENT_HOOKS?: boolean | "suppress-warning" | undefined;
290
+ INSTANCE_CHILDREN?: boolean | "suppress-warning" | undefined;
291
+ INSTANCE_LISTENERS?: boolean | "suppress-warning" | undefined;
292
+ INSTANCE_SCOPED_SLOTS?: boolean | "suppress-warning" | undefined;
293
+ INSTANCE_ATTRS_CLASS_STYLE?: boolean | "suppress-warning" | undefined;
294
+ OPTIONS_DATA_FN?: boolean | "suppress-warning" | undefined;
295
+ OPTIONS_DATA_MERGE?: boolean | "suppress-warning" | undefined;
296
+ OPTIONS_BEFORE_DESTROY?: boolean | "suppress-warning" | undefined;
297
+ OPTIONS_DESTROYED?: boolean | "suppress-warning" | undefined;
298
+ WATCH_ARRAY?: boolean | "suppress-warning" | undefined;
299
+ PROPS_DEFAULT_THIS?: boolean | "suppress-warning" | undefined;
300
+ V_ON_KEYCODE_MODIFIER?: boolean | "suppress-warning" | undefined;
301
+ CUSTOM_DIR?: boolean | "suppress-warning" | undefined;
302
+ ATTR_FALSE_VALUE?: boolean | "suppress-warning" | undefined;
303
+ ATTR_ENUMERATED_COERCION?: boolean | "suppress-warning" | undefined;
304
+ TRANSITION_CLASSES?: boolean | "suppress-warning" | undefined;
305
+ TRANSITION_GROUP_ROOT?: boolean | "suppress-warning" | undefined;
306
+ COMPONENT_ASYNC?: boolean | "suppress-warning" | undefined;
307
+ COMPONENT_FUNCTIONAL?: boolean | "suppress-warning" | undefined;
308
+ COMPONENT_V_MODEL?: boolean | "suppress-warning" | undefined;
309
+ RENDER_FUNCTION?: boolean | "suppress-warning" | undefined;
310
+ FILTERS?: boolean | "suppress-warning" | undefined;
311
+ PRIVATE_APIS?: boolean | "suppress-warning" | undefined;
312
+ MODE?: 2 | 3 | ((comp: import("vue").Component | null) => 2 | 3) | undefined;
313
+ } | undefined;
314
+ data?: ((this: any, vm: any) => any) | undefined;
315
+ computed?: import("vue").ComputedOptions | undefined;
316
+ methods?: import("vue").MethodOptions | undefined;
317
+ watch?: {
318
+ [x: string]: (string | import("vue").WatchCallback<any, any> | ({
319
+ handler: import("vue").WatchCallback | string;
320
+ } & import("vue").WatchOptions<boolean>)) | (string | import("vue").WatchCallback<any, any> | ({
321
+ handler: import("vue").WatchCallback | string;
322
+ } & import("vue").WatchOptions<boolean>))[];
323
+ } | undefined;
324
+ provide?: import("vue").ComponentProvideOptions | undefined;
325
+ inject?: {} | string[] | undefined;
326
+ filters?: Record<string, Function> | undefined;
327
+ mixins?: any[] | undefined;
328
+ extends?: any;
329
+ beforeCreate?: (() => void) | undefined;
330
+ created?: (() => void) | undefined;
331
+ beforeMount?: (() => void) | undefined;
332
+ mounted?: (() => void) | undefined;
333
+ beforeUpdate?: (() => void) | undefined;
334
+ updated?: (() => void) | undefined;
335
+ activated?: (() => void) | undefined;
336
+ deactivated?: (() => void) | undefined;
337
+ beforeDestroy?: (() => void) | undefined;
338
+ beforeUnmount?: (() => void) | undefined;
339
+ destroyed?: (() => void) | undefined;
340
+ unmounted?: (() => void) | undefined;
341
+ renderTracked?: ((e: import("vue").DebuggerEvent) => void) | undefined;
342
+ renderTriggered?: ((e: import("vue").DebuggerEvent) => void) | undefined;
343
+ errorCaptured?: ((err: unknown, instance: import("vue").ComponentPublicInstance | null, info: string) => boolean | void) | undefined;
344
+ delimiters?: [string, string] | undefined;
345
+ __differentiator?: string | number | symbol | undefined;
346
+ __isBuiltIn?: boolean | undefined;
347
+ __file?: string | undefined;
348
+ __name?: string | undefined;
349
+ i18n?: {
350
+ locale?: string | undefined;
351
+ fallbackLocale?: string | false | string[] | {
352
+ [x: string]: string[];
353
+ } | undefined;
354
+ messages?: {
355
+ [x: string]: import("@intlify/core-base").LocaleMessage<import("vue-i18n").VueMessageType>;
356
+ } | undefined;
357
+ flatJson?: boolean | undefined;
358
+ datetimeFormats?: {
359
+ [x: string]: import("vue-i18n").IntlDateTimeFormat;
360
+ } | undefined;
361
+ numberFormats?: {
362
+ [x: string]: import("vue-i18n").IntlNumberFormat;
363
+ } | undefined;
364
+ availableLocales?: import("vue-i18n").Locale[] | undefined;
365
+ modifiers?: import("vue-i18n").LinkedModifiers<import("vue-i18n").VueMessageType> | undefined;
366
+ formatter?: {
367
+ interpolate: (message: string, values: any, path: string) => Array<any> | null;
368
+ } | undefined;
369
+ missing?: import("vue-i18n").MissingHandler | undefined;
370
+ fallbackRoot?: boolean | undefined;
371
+ silentTranslationWarn?: boolean | {
372
+ exec: (string: string) => RegExpExecArray | null;
373
+ test: (string: string) => boolean;
374
+ readonly source: string;
375
+ readonly global: boolean;
376
+ readonly ignoreCase: boolean;
377
+ readonly multiline: boolean;
378
+ lastIndex: number;
379
+ compile: (pattern: string, flags?: string) => RegExp;
380
+ readonly flags: string;
381
+ readonly sticky: boolean;
382
+ readonly unicode: boolean;
383
+ readonly dotAll: boolean;
384
+ readonly hasIndices: boolean;
385
+ readonly unicodeSets: boolean;
386
+ [Symbol.match]: (string: string) => RegExpMatchArray | null;
387
+ [Symbol.replace]: {
388
+ (string: string, replaceValue: string): string;
389
+ (string: string, replacer: (substring: string, ...args: any[]) => string): string;
390
+ };
391
+ [Symbol.search]: (string: string) => number;
392
+ [Symbol.split]: (string: string, limit?: number) => string[];
393
+ [Symbol.matchAll]: (str: string) => RegExpStringIterator<RegExpMatchArray>;
394
+ } | undefined;
395
+ silentFallbackWarn?: boolean | {
396
+ exec: (string: string) => RegExpExecArray | null;
397
+ test: (string: string) => boolean;
398
+ readonly source: string;
399
+ readonly global: boolean;
400
+ readonly ignoreCase: boolean;
401
+ readonly multiline: boolean;
402
+ lastIndex: number;
403
+ compile: (pattern: string, flags?: string) => RegExp;
404
+ readonly flags: string;
405
+ readonly sticky: boolean;
406
+ readonly unicode: boolean;
407
+ readonly dotAll: boolean;
408
+ readonly hasIndices: boolean;
409
+ readonly unicodeSets: boolean;
410
+ [Symbol.match]: (string: string) => RegExpMatchArray | null;
411
+ [Symbol.replace]: {
412
+ (string: string, replaceValue: string): string;
413
+ (string: string, replacer: (substring: string, ...args: any[]) => string): string;
414
+ };
415
+ [Symbol.search]: (string: string) => number;
416
+ [Symbol.split]: (string: string, limit?: number) => string[];
417
+ [Symbol.matchAll]: (str: string) => RegExpStringIterator<RegExpMatchArray>;
418
+ } | undefined;
419
+ formatFallbackMessages?: boolean | undefined;
420
+ preserveDirectiveContent?: boolean | undefined;
421
+ warnHtmlInMessage?: import("vue-i18n").WarnHtmlInMessageLevel | undefined;
422
+ escapeParameterHtml?: boolean | undefined;
423
+ sharedMessages?: import("vue-i18n").LocaleMessages<import("vue-i18n").VueMessageType> | undefined;
424
+ pluralizationRules?: import("@intlify/core-base").PluralizationRules | undefined;
425
+ postTranslation?: import("vue-i18n").PostTranslationHandler<import("vue-i18n").VueMessageType> | undefined;
426
+ sync?: boolean | undefined;
427
+ messageResolver?: import("vue-i18n").MessageResolver | undefined;
428
+ } | undefined;
429
+ __i18n?: {
430
+ locale: import("vue-i18n").Locale;
431
+ resource: import("vue-i18n").LocaleMessages<import("vue-i18n").VueMessageType>;
432
+ }[] | undefined;
433
+ __INTLIFY_META__?: string | undefined;
434
+ } | undefined;
435
+ on?: Record<string, (...args: any[]) => void> | undefined;
436
+ props?: Record<string, any> | undefined;
437
+ title?: string | undefined;
438
+ canClose?: boolean | undefined;
439
+ showHeader?: boolean | undefined;
440
+ showFooter?: boolean | undefined;
441
+ injectStyle?: any;
442
+ hasBackdrop?: boolean | undefined;
443
+ disableStyle?: boolean | undefined;
444
+ onClose?: (() => void) | undefined;
445
+ };
446
+ }[]>;
8
447
  alerts: import('vue').Ref<{
9
448
  id: string;
10
449
  events: {
@@ -28,6 +467,7 @@ export default function useDialog(): {
28
467
  onClose?: (() => void) | undefined;
29
468
  };
30
469
  }[]>;
470
+ modal: (options: ModalOptions) => void;
31
471
  alert: (options: AlertOptions) => void;
32
472
  };
33
473
  export {};
@@ -0,0 +1,42 @@
1
+ import { ref as c, markRaw as r } from "vue";
2
+ const i = c([]), t = c([]);
3
+ function u() {
4
+ const a = () => Date.now().toString(), l = (e, n) => {
5
+ const s = e.findIndex((o) => o.id === n);
6
+ s !== -1 && e.splice(s, 1);
7
+ };
8
+ return {
9
+ modals: i,
10
+ alerts: t,
11
+ modal: (e) => {
12
+ const n = a(), s = {
13
+ onClose: () => {
14
+ e?.onClose && e.onClose(), l(i.value, n);
15
+ }
16
+ }, o = { ...e };
17
+ delete o?.onClose, "is" in o && o.is && (o.is = r(o.is)), i.value.push({
18
+ id: n,
19
+ events: s,
20
+ options: o
21
+ });
22
+ },
23
+ alert: (e) => {
24
+ const n = a(), s = {
25
+ onClose: () => {
26
+ e?.onClose && e.onClose(), l(t.value, n);
27
+ },
28
+ onConfirm: () => {
29
+ e?.onConfirm && e.onConfirm(), l(t.value, n);
30
+ }
31
+ }, o = { ...e };
32
+ delete o?.onClose, delete o?.onConfirm, t.value.push({
33
+ id: n,
34
+ events: s,
35
+ options: o
36
+ });
37
+ }
38
+ };
39
+ }
40
+ export {
41
+ u
42
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@caipira/tamandua",
3
- "version": "0.0.101",
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",
@@ -1,21 +0,0 @@
1
- import { defineComponent as s, resolveComponent as l, openBlock as o, createElementBlock as n, Fragment as m, renderList as i, unref as a, createBlock as c, mergeProps as p } from "vue";
2
- import { u as _ } from "./useDialog-Cl-wVLea.js";
3
- const g = /* @__PURE__ */ s({
4
- name: "TDialogProvider",
5
- __name: "DialogProvider",
6
- setup(u) {
7
- const { alerts: r } = _();
8
- return (d, f) => {
9
- const t = l("t-alert");
10
- return o(), n("div", null, [
11
- (o(!0), n(m, null, i(a(r), (e) => (o(), c(t, p(e.options, {
12
- onClosed: e.events.onClose,
13
- onConfirmed: e.events.onConfirm
14
- }), null, 16, ["onClosed", "onConfirmed"]))), 256))
15
- ]);
16
- };
17
- }
18
- });
19
- export {
20
- g as _
21
- };
@@ -1,83 +0,0 @@
1
- import { defineComponent as y, ref as b, onMounted as h, resolveComponent as k, openBlock as o, createElementBlock as s, normalizeClass as a, withKeys as _, createBlock as i, createCommentVNode as l, createElementVNode as d, toDisplayString as v, renderSlot as n } from "vue";
2
- import { _ as w } from "./Backdrop.vue_vue_type_script_setup_true_lang-Dyo6_-EM.js";
3
- const B = {
4
- key: 1,
5
- class: "p-4 border-b border-color"
6
- }, C = {
7
- key: 0,
8
- class: "block font-semibold uppercase"
9
- }, S = {
10
- key: 2,
11
- class: "flex flex-row items-center justify-between p-4 border-t border-color"
12
- }, z = /* @__PURE__ */ y({
13
- name: "TModal",
14
- __name: "Modal",
15
- props: {
16
- title: { default: "" },
17
- canClose: { type: Boolean, default: !0 },
18
- showHeader: { type: Boolean, default: !0 },
19
- injectStyle: { default: () => ({ wrapper: "", body: "", container: "" }) },
20
- hasBackdrop: { type: Boolean, default: !0 },
21
- disableStyle: { type: Boolean, default: !1 }
22
- },
23
- emits: ["closed"],
24
- setup(u, { emit: f }) {
25
- const e = u, p = f, c = b(null), r = (t) => {
26
- t.stopPropagation(), p("closed");
27
- };
28
- return h(() => {
29
- c.value?.focus();
30
- }), (t, x) => {
31
- const m = k("t-button");
32
- return o(), s("div", {
33
- class: a(["fixed inset-0 focus-visible:outline-hidden z-10", {
34
- "flex items-center": !e.disableStyle,
35
- [e.injectStyle.wrapper]: !0
36
- }]),
37
- tabindex: "-1",
38
- ref_key: "modal",
39
- ref: c,
40
- onKeyup: _(r, ["esc"])
41
- }, [
42
- e.hasBackdrop ? (o(), i(w, {
43
- key: 0,
44
- class: "z-10",
45
- onClick: r
46
- })) : l("", !0),
47
- d("div", {
48
- class: a(["z-10 w-full md:w-[36rem] mx-auto", {
49
- "relative floatable": !e.disableStyle,
50
- [e.injectStyle.container]: !0
51
- }])
52
- }, [
53
- e.canClose ? (o(), i(m, {
54
- key: 0,
55
- variant: "transparent",
56
- icon: "close",
57
- size: "",
58
- class: "absolute justify-center top-0 right-0 h-14 w-14",
59
- onClick: r
60
- })) : l("", !0),
61
- e.showHeader ? (o(), s("div", B, [
62
- e.title ? (o(), s("span", C, v(e.title), 1)) : l("", !0),
63
- t.$slots.header ? n(t.$slots, "header", { key: 1 }) : l("", !0)
64
- ])) : l("", !0),
65
- d("div", {
66
- class: a(["flex flex-col flex-1 overflow-y-auto scrollbar", {
67
- [e.injectStyle.body]: !0
68
- }]),
69
- style: { "max-height": "80vh" }
70
- }, [
71
- n(t.$slots, "default")
72
- ], 2),
73
- t.$slots.footer ? (o(), s("div", S, [
74
- n(t.$slots, "footer")
75
- ])) : l("", !0)
76
- ], 2)
77
- ], 34);
78
- };
79
- }
80
- });
81
- export {
82
- z as _
83
- };
@@ -1,28 +0,0 @@
1
- import { ref as f } from "vue";
2
- const n = f([]);
3
- function u() {
4
- return {
5
- alerts: n,
6
- alert: (e) => {
7
- const t = Date.now().toString(), s = () => {
8
- const l = n.value.findIndex((r) => r.id === t);
9
- l !== -1 && n.value.splice(l, 1);
10
- }, i = {
11
- onClose: () => {
12
- e?.onClose && e.onClose(), s();
13
- },
14
- onConfirm: () => {
15
- e?.onConfirm && e.onConfirm(), s();
16
- }
17
- }, o = { ...e };
18
- delete o?.onClose, delete o?.onConfirm, n.value.push({
19
- id: t,
20
- events: i,
21
- options: o
22
- });
23
- }
24
- };
25
- }
26
- export {
27
- u
28
- };