@caipira/tamandua 0.0.37 → 0.0.39
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 +2 -2
- package/dist/Modal.vue_vue_type_script_setup_true_lang-aQ-G7tuI.js +81 -0
- package/dist/ModalForm.js +2 -2
- package/dist/ModalForm.vue_vue_type_script_setup_true_lang-B4dU1AzJ.js +115 -0
- package/dist/components.js +2 -2
- package/dist/{crud-TcRx_r8S.js → crud-n73o4CzO.js} +1 -1
- package/dist/form2.js +1 -1
- package/dist/{plugin-BqzDqLcd.js → plugin-DmPqmScT.js} +1 -1
- package/dist/{plugin-BZC231Oj.js → plugin-GUvrG7aO.js} +1 -1
- package/dist/{plugins-DLfHiPSG.js → plugins-DfXmQBVL.js} +2 -2
- package/dist/plugins.js +2 -2
- package/dist/tamandua.js +1 -1
- package/dist/types/components/ModalForm/ModalForm.vue.d.ts +11 -2
- package/dist/types/components/ModalForm/model-form.story.d.ts +35 -0
- package/dist/types/components/ModalForm/types.d.ts +2 -0
- package/package.json +1 -1
- package/dist/Modal.vue_vue_type_script_setup_true_lang-DLl5shGS.js +0 -82
- package/dist/ModalForm.vue_vue_type_script_setup_true_lang-Da80UtoI.js +0 -108
package/dist/Modal.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { _ as r } from "./Modal.vue_vue_type_script_setup_true_lang-
|
|
2
|
-
import { p } from "./plugin-
|
|
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-
|
|
2
|
-
import { p as l } from "./plugin-
|
|
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
|
|
@@ -0,0 +1,115 @@
|
|
|
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
|
+
import { C as P } from "./crud-n73o4CzO.js";
|
|
3
|
+
const T = { class: "flex items-baseline justify-between w-full" }, U = {
|
|
4
|
+
key: 0,
|
|
5
|
+
class: "inline-flex"
|
|
6
|
+
}, J = /* @__PURE__ */ F({
|
|
7
|
+
name: "TModalForm",
|
|
8
|
+
__name: "ModalForm",
|
|
9
|
+
props: {
|
|
10
|
+
forms: {},
|
|
11
|
+
options: { default: () => [] },
|
|
12
|
+
formClass: { default: "" }
|
|
13
|
+
},
|
|
14
|
+
emits: ["saved", "deleted", "closed"],
|
|
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
|
+
}, h = () => {
|
|
19
|
+
e.value?.onSave(!p.value), v("saved");
|
|
20
|
+
}, x = () => {
|
|
21
|
+
v("deleted"), e.value?.onDelete();
|
|
22
|
+
}, b = () => {
|
|
23
|
+
e.value?.delete();
|
|
24
|
+
}, S = async () => await c.value?.submit(), V = () => {
|
|
25
|
+
c.value?.reset();
|
|
26
|
+
}, D = () => {
|
|
27
|
+
e.value?.close(), v("closed");
|
|
28
|
+
};
|
|
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
|
+
key: 0,
|
|
33
|
+
title: e.value?.title,
|
|
34
|
+
onClosed: D
|
|
35
|
+
}, {
|
|
36
|
+
header: s(() => [
|
|
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
|
+
])
|
|
47
|
+
]),
|
|
48
|
+
footer: s(() => [
|
|
49
|
+
r.options.length ? (n(), R("div", U, [
|
|
50
|
+
m($, { placement: "bottom-start" }, {
|
|
51
|
+
content: s(() => [
|
|
52
|
+
m(N, {
|
|
53
|
+
items: r.options
|
|
54
|
+
}, null, 8, ["items"])
|
|
55
|
+
]),
|
|
56
|
+
default: s(() => [
|
|
57
|
+
m(B, {
|
|
58
|
+
icon: "dots-vertical",
|
|
59
|
+
class: "text-lg mr-6",
|
|
60
|
+
size: "sm",
|
|
61
|
+
role: "button",
|
|
62
|
+
"aria-describedby": "tooltip"
|
|
63
|
+
})
|
|
64
|
+
]),
|
|
65
|
+
_: 1
|
|
66
|
+
})
|
|
67
|
+
])) : (n(), i(z, {
|
|
68
|
+
key: 1,
|
|
69
|
+
message: `Are you sure you want to delete this ${l.value?.title}?`,
|
|
70
|
+
onConfirm: b
|
|
71
|
+
}, {
|
|
72
|
+
default: s(({ onTogglePopover: f }) => [
|
|
73
|
+
e.value?.isEditing ? (n(), i(C, {
|
|
74
|
+
key: 0,
|
|
75
|
+
variant: "danger",
|
|
76
|
+
icon: "trash-can-outline",
|
|
77
|
+
label: "Delete",
|
|
78
|
+
"aria-describedby": "tooltip",
|
|
79
|
+
"is-disabled": e.value?.isLoading,
|
|
80
|
+
onClick: f
|
|
81
|
+
}, null, 8, ["is-disabled", "onClick"])) : u("", !0)
|
|
82
|
+
]),
|
|
83
|
+
_: 1
|
|
84
|
+
}, 8, ["message"])),
|
|
85
|
+
m(C, {
|
|
86
|
+
variant: "success",
|
|
87
|
+
icon: "save",
|
|
88
|
+
label: e.value.isCreating ? "Add" : "Save",
|
|
89
|
+
"is-disabled": e.value?.isLoading,
|
|
90
|
+
class: j({
|
|
91
|
+
"ml-auto": !e.value?.isEditing
|
|
92
|
+
}),
|
|
93
|
+
onClick: t[1] || (t[1] = () => e.value?.save())
|
|
94
|
+
}, null, 8, ["label", "is-disabled", "class"])
|
|
95
|
+
]),
|
|
96
|
+
default: s(() => [
|
|
97
|
+
l.value ? (n(), i(H(l.value.component), I({
|
|
98
|
+
key: 0,
|
|
99
|
+
id: `${e.value?.id}`,
|
|
100
|
+
class: [r.formClass],
|
|
101
|
+
ref_key: "formReference",
|
|
102
|
+
ref: c
|
|
103
|
+
}, O(l.value?.events), {
|
|
104
|
+
onDeleted: x,
|
|
105
|
+
onSaved: h
|
|
106
|
+
}), null, 16, ["id", "class"])) : u("", !0)
|
|
107
|
+
]),
|
|
108
|
+
_: 3
|
|
109
|
+
}, 8, ["title"])) : u("", !0);
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
export {
|
|
114
|
+
J as _
|
|
115
|
+
};
|
package/dist/components.js
CHANGED
|
@@ -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-
|
|
33
|
-
import { _ as nr } from "./ModalForm.vue_vue_type_script_setup_true_lang-
|
|
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";
|
package/dist/form2.js
CHANGED
|
@@ -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-
|
|
43
|
-
import { p as F } from "./plugin-
|
|
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";
|
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-
|
|
43
|
-
import { p as vr } from "./plugin-
|
|
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";
|
package/dist/tamandua.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ModalFormProps } from './types.js';
|
|
2
2
|
|
|
3
|
-
declare const _default: import('vue').DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ModalFormProps>, {
|
|
3
|
+
declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ModalFormProps>, {
|
|
4
4
|
options: () => never[];
|
|
5
5
|
formClass: string;
|
|
6
6
|
}>, {
|
|
@@ -13,6 +13,7 @@ declare const _default: import('vue').DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
13
13
|
reset: () => void;
|
|
14
14
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
15
15
|
saved: () => void;
|
|
16
|
+
deleted: () => void;
|
|
16
17
|
closed: () => void;
|
|
17
18
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ModalFormProps>, {
|
|
18
19
|
options: () => never[];
|
|
@@ -20,10 +21,13 @@ declare const _default: import('vue').DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
20
21
|
}>>> & {
|
|
21
22
|
onClosed?: (() => any) | undefined;
|
|
22
23
|
onSaved?: (() => any) | undefined;
|
|
24
|
+
onDeleted?: (() => any) | undefined;
|
|
23
25
|
}, {
|
|
24
26
|
options: import("../types.js").InputSelectOption[];
|
|
25
27
|
formClass: string;
|
|
26
|
-
}, {}
|
|
28
|
+
}, {}>, {
|
|
29
|
+
header?(_: {}): any;
|
|
30
|
+
}>;
|
|
27
31
|
export default _default;
|
|
28
32
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
29
33
|
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
@@ -42,3 +46,8 @@ type __VLS_WithDefaults<P, D> = {
|
|
|
42
46
|
type __VLS_Prettify<T> = {
|
|
43
47
|
[K in keyof T]: T[K];
|
|
44
48
|
} & {};
|
|
49
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
50
|
+
new (): {
|
|
51
|
+
$slots: S;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
@@ -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
|
+
};
|
|
@@ -7,6 +7,7 @@ export type FormItem = {
|
|
|
7
7
|
title: string;
|
|
8
8
|
component: ComponentExposed<typeof Form>;
|
|
9
9
|
pinnable?: boolean;
|
|
10
|
+
events?: Record<string, (e: any) => void>;
|
|
10
11
|
};
|
|
11
12
|
export type ModalFormProps = {
|
|
12
13
|
forms: FormItem[];
|
|
@@ -15,5 +16,6 @@ export type ModalFormProps = {
|
|
|
15
16
|
};
|
|
16
17
|
export type ModalFormEvents = {
|
|
17
18
|
(e: "saved"): void;
|
|
19
|
+
(e: "deleted"): void;
|
|
18
20
|
(e: "closed"): void;
|
|
19
21
|
};
|
package/package.json
CHANGED
|
@@ -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,108 +0,0 @@
|
|
|
1
|
-
import { defineComponent as M, ref as c, computed as N, resolveComponent as o, openBlock as n, createBlock as a, withCtx as l, createCommentVNode as d, createElementBlock as R, createVNode as m, normalizeClass as b, resolveDynamicComponent as $ } from "vue";
|
|
2
|
-
import { C as A } from "./crud-TcRx_r8S.js";
|
|
3
|
-
const I = {
|
|
4
|
-
key: 0,
|
|
5
|
-
class: "inline-flex"
|
|
6
|
-
}, U = /* @__PURE__ */ M({
|
|
7
|
-
name: "TModalForm",
|
|
8
|
-
__name: "ModalForm",
|
|
9
|
-
props: {
|
|
10
|
-
forms: {},
|
|
11
|
-
options: { default: () => [] },
|
|
12
|
-
formClass: { default: "" }
|
|
13
|
-
},
|
|
14
|
-
emits: ["saved", "closed"],
|
|
15
|
-
setup(y, { expose: C, emit: k }) {
|
|
16
|
-
const i = y, v = k, e = c(), p = c(!1), f = c(""), r = c(), s = N(() => i.forms.find((u) => u.key === f.value)), g = (u, t) => {
|
|
17
|
-
f.value = u, e.value = new A(s.value?.title, r), t ? e.value?.edit(t) : e.value?.show();
|
|
18
|
-
}, w = () => {
|
|
19
|
-
e.value?.onSave(!p.value), v("saved");
|
|
20
|
-
}, x = () => {
|
|
21
|
-
e.value?.delete();
|
|
22
|
-
}, S = async () => await r.value?.submit(), V = () => {
|
|
23
|
-
r.value?.reset();
|
|
24
|
-
}, D = () => {
|
|
25
|
-
e.value?.close(), v("closed");
|
|
26
|
-
};
|
|
27
|
-
return C({ open: g, delete: x, submit: S, reset: V }), (u, t) => {
|
|
28
|
-
const E = o("t-input-switch"), B = o("t-icon"), h = o("t-dropdown"), z = o("t-popover"), _ = o("t-button"), F = o("t-popconfirm"), K = o("t-modal");
|
|
29
|
-
return e.value?.visible ? (n(), a(K, {
|
|
30
|
-
key: 0,
|
|
31
|
-
title: e.value?.title,
|
|
32
|
-
onClosed: D
|
|
33
|
-
}, {
|
|
34
|
-
header: l(() => [
|
|
35
|
-
s.value?.pinnable && !e.value?.isEditing ? (n(), a(E, {
|
|
36
|
-
key: 0,
|
|
37
|
-
modelValue: p.value,
|
|
38
|
-
"onUpdate:modelValue": t[0] || (t[0] = (L) => p.value = L),
|
|
39
|
-
label: "Keep open",
|
|
40
|
-
class: "mt-4"
|
|
41
|
-
}, null, 8, ["modelValue"])) : d("", !0)
|
|
42
|
-
]),
|
|
43
|
-
footer: l(() => [
|
|
44
|
-
i.options.length ? (n(), R("div", I, [
|
|
45
|
-
m(z, { placement: "bottom-start" }, {
|
|
46
|
-
content: l(() => [
|
|
47
|
-
m(h, {
|
|
48
|
-
items: i.options
|
|
49
|
-
}, null, 8, ["items"])
|
|
50
|
-
]),
|
|
51
|
-
default: l(() => [
|
|
52
|
-
m(B, {
|
|
53
|
-
icon: "dots-vertical",
|
|
54
|
-
class: "text-lg mr-6",
|
|
55
|
-
size: "sm",
|
|
56
|
-
role: "button",
|
|
57
|
-
"aria-describedby": "tooltip"
|
|
58
|
-
})
|
|
59
|
-
]),
|
|
60
|
-
_: 1
|
|
61
|
-
})
|
|
62
|
-
])) : (n(), a(F, {
|
|
63
|
-
key: 1,
|
|
64
|
-
message: `Are you sure you want to delete this ${s.value?.title}?`,
|
|
65
|
-
onConfirm: t[2] || (t[2] = () => e.value?.delete())
|
|
66
|
-
}, {
|
|
67
|
-
default: l(() => [
|
|
68
|
-
e.value?.isEditing ? (n(), a(_, {
|
|
69
|
-
key: 0,
|
|
70
|
-
variant: "danger",
|
|
71
|
-
icon: "trash-can-outline",
|
|
72
|
-
label: "Delete",
|
|
73
|
-
"aria-describedby": "tooltip",
|
|
74
|
-
"is-disabled": e.value?.isLoading
|
|
75
|
-
}, null, 8, ["is-disabled"])) : d("", !0)
|
|
76
|
-
]),
|
|
77
|
-
_: 1
|
|
78
|
-
}, 8, ["message"])),
|
|
79
|
-
m(_, {
|
|
80
|
-
variant: "success",
|
|
81
|
-
icon: "save",
|
|
82
|
-
label: "Save",
|
|
83
|
-
"is-disabled": e.value?.isLoading,
|
|
84
|
-
class: b({
|
|
85
|
-
"ml-auto": !e.value?.isEditing
|
|
86
|
-
}),
|
|
87
|
-
onClick: t[3] || (t[3] = () => e.value?.save())
|
|
88
|
-
}, null, 8, ["is-disabled", "class"])
|
|
89
|
-
]),
|
|
90
|
-
default: l(() => [
|
|
91
|
-
s.value ? (n(), a($(s.value.component), {
|
|
92
|
-
key: 0,
|
|
93
|
-
id: `${e.value?.id}`,
|
|
94
|
-
class: b([i.formClass]),
|
|
95
|
-
ref_key: "formReference",
|
|
96
|
-
ref: r,
|
|
97
|
-
onDeleted: t[1] || (t[1] = () => e.value?.onDelete()),
|
|
98
|
-
onSaved: w
|
|
99
|
-
}, null, 40, ["id", "class"])) : d("", !0)
|
|
100
|
-
]),
|
|
101
|
-
_: 1
|
|
102
|
-
}, 8, ["title"])) : d("", !0);
|
|
103
|
-
};
|
|
104
|
-
}
|
|
105
|
-
});
|
|
106
|
-
export {
|
|
107
|
-
U as _
|
|
108
|
-
};
|