@caipira/tamandua 0.0.99 → 0.0.101
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/Alert.js +6 -0
- package/dist/Alert.vue_vue_type_script_setup_true_lang-CAGHRWvs.js +67 -0
- package/dist/DialogProvider.js +6 -0
- package/dist/DialogProvider.vue_vue_type_script_setup_true_lang-ejMXvlRv.js +21 -0
- package/dist/InputSelect.js +2 -2
- package/dist/{InputSelect.vue_vue_type_script_setup_true_lang-CkW6maZO.js → InputSelect.vue_vue_type_script_setup_true_lang-N2nSmX8r.js} +33 -33
- package/dist/Modal.js +2 -2
- package/dist/{Modal.vue_vue_type_script_setup_true_lang-60BGY-iH.js → Modal.vue_vue_type_script_setup_true_lang-gKqoL70h.js} +25 -23
- package/dist/Popover-Bhp8FUMn.js +98 -0
- package/dist/Popover.css +1 -1
- package/dist/Popover.js +2 -2
- package/dist/components.js +92 -88
- package/dist/composables.js +32 -15
- package/dist/{plugin-TMApjjiI.js → plugin-BeifNbnf.js} +1 -1
- package/dist/{plugin-CPpRqUnI.js → plugin-Cy5TXn1Y.js} +1 -1
- package/dist/{plugin-C3ZZPmkg.js → plugin-D9O3FCPm.js} +1 -1
- package/dist/plugin-DXPPWWyR.js +10 -0
- package/dist/plugin-W9_PLHv4.js +10 -0
- package/dist/plugins-C-OK-RIJ.js +121 -0
- package/dist/plugins.js +96 -91
- package/dist/tamandua.js +1 -1
- package/dist/types/components/Alert/Alert.story.d.ts +19 -0
- package/dist/types/components/Alert/Alert.vue.d.ts +57 -0
- package/dist/types/components/Alert/index.d.ts +5 -0
- package/dist/types/components/Alert/plugin.d.ts +4 -0
- package/dist/types/components/Alert/types.d.ts +12 -0
- package/dist/types/components/Button/Button.vue.d.ts +9 -9
- package/dist/types/components/DialogProvider/DialogProvider.vue.d.ts +2 -0
- package/dist/types/components/DialogProvider/index.d.ts +4 -0
- package/dist/types/components/DialogProvider/plugin.d.ts +4 -0
- package/dist/types/components/Drawer/Drawer.vue.d.ts +1 -1
- package/dist/types/components/InputSelect/InputSelect.vue.d.ts +2 -0
- package/dist/types/components/InputSelect/types.d.ts +1 -0
- package/dist/types/components/InputText/InputText.vue.d.ts +9 -9
- package/dist/types/components/Modal/Modal.vue.d.ts +3 -0
- package/dist/types/components/Modal/types.d.ts +1 -0
- package/dist/types/components/Popconfirm/Popconfirm.vue.d.ts +1 -1
- package/dist/types/components/index.d.ts +4 -2
- package/dist/types/components/plugins.d.ts +8 -6
- package/dist/types/components/types.d.ts +2 -1
- package/dist/types/composables/index.d.ts +2 -1
- package/dist/types/composables/useDialog.d.ts +33 -0
- package/dist/useDialog-Cl-wVLea.js +28 -0
- package/package.json +1 -1
- package/volar.d.ts +46 -44
- package/dist/Popover-P-D1olPy.js +0 -96
- package/dist/plugins-D57bfrRk.js +0 -116
- package/dist/useDomHelpers-CGVrQd35.js +0 -19
package/dist/Alert.js
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { defineComponent as b, computed as h, resolveComponent as i, openBlock as t, createBlock as k, withCtx as m, createElementBlock as n, Fragment as d, createVNode as a, renderSlot as y, createElementVNode as s, toDisplayString as T } from "vue";
|
|
2
|
+
const g = {
|
|
3
|
+
key: 1,
|
|
4
|
+
class: "p-4"
|
|
5
|
+
}, v = { class: "font-semibold" }, w = ["innerHTML"], A = /* @__PURE__ */ s("div", null, null, -1), E = /* @__PURE__ */ b({
|
|
6
|
+
name: "TAlert",
|
|
7
|
+
__name: "Alert",
|
|
8
|
+
props: {
|
|
9
|
+
title: { default: "Confirm action" },
|
|
10
|
+
message: { default: "Do you want to proceed with this action?" },
|
|
11
|
+
confirm: { type: Boolean, default: !1 },
|
|
12
|
+
closeTitle: { default: "Close" },
|
|
13
|
+
cancelTitle: { default: "Cancel" },
|
|
14
|
+
confirmTitle: { default: "Confirm" }
|
|
15
|
+
},
|
|
16
|
+
emits: ["closed", "confirmed"],
|
|
17
|
+
setup(f, { emit: u }) {
|
|
18
|
+
const e = f, c = u, o = () => {
|
|
19
|
+
c("closed");
|
|
20
|
+
}, p = () => {
|
|
21
|
+
c("confirmed");
|
|
22
|
+
}, _ = h(() => Array.isArray(e.message) ? e.message.join("<br /><br />") : e.message || "");
|
|
23
|
+
return (r, B) => {
|
|
24
|
+
const l = i("t-button"), C = i("t-modal");
|
|
25
|
+
return t(), k(C, {
|
|
26
|
+
"show-header": !1,
|
|
27
|
+
"can-close": !1,
|
|
28
|
+
onClosed: o
|
|
29
|
+
}, {
|
|
30
|
+
footer: m(() => [
|
|
31
|
+
e.confirm ? (t(), n(d, { key: 0 }, [
|
|
32
|
+
a(l, {
|
|
33
|
+
variant: "transparent",
|
|
34
|
+
label: e.cancelTitle,
|
|
35
|
+
onClick: o
|
|
36
|
+
}, null, 8, ["label"]),
|
|
37
|
+
a(l, {
|
|
38
|
+
variant: "default",
|
|
39
|
+
label: e.confirmTitle,
|
|
40
|
+
onClick: p
|
|
41
|
+
}, null, 8, ["label"])
|
|
42
|
+
], 64)) : (t(), n(d, { key: 1 }, [
|
|
43
|
+
A,
|
|
44
|
+
a(l, {
|
|
45
|
+
variant: "transparent",
|
|
46
|
+
label: e.closeTitle,
|
|
47
|
+
onClick: o
|
|
48
|
+
}, null, 8, ["label"])
|
|
49
|
+
], 64))
|
|
50
|
+
]),
|
|
51
|
+
default: m(() => [
|
|
52
|
+
r.$slots.default ? y(r.$slots, "default", { key: 0 }) : (t(), n("div", g, [
|
|
53
|
+
s("h3", v, T(e.title), 1),
|
|
54
|
+
s("p", {
|
|
55
|
+
innerHTML: _.value,
|
|
56
|
+
class: "mt-4"
|
|
57
|
+
}, null, 8, w)
|
|
58
|
+
]))
|
|
59
|
+
]),
|
|
60
|
+
_: 3
|
|
61
|
+
});
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
export {
|
|
66
|
+
E as _
|
|
67
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
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
|
+
};
|
package/dist/InputSelect.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { _ as p } from "./InputSelect.vue_vue_type_script_setup_true_lang-
|
|
2
|
-
import { p as r } from "./plugin-
|
|
1
|
+
import { _ as p } from "./InputSelect.vue_vue_type_script_setup_true_lang-N2nSmX8r.js";
|
|
2
|
+
import { p as r } from "./plugin-BeifNbnf.js";
|
|
3
3
|
export {
|
|
4
4
|
p as InputSelect,
|
|
5
5
|
r as InputSelectPlugin
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as ie, mergeModels as
|
|
1
|
+
import { defineComponent as ie, mergeModels as U, useModel as re, ref as d, computed as I, onBeforeMount as pe, watch as P, resolveComponent as _, openBlock as i, createBlock as E, normalizeClass as S, withCtx as R, createElementVNode as q, unref as f, withDirectives as G, createElementBlock as v, vModelText as ce, createCommentVNode as F, createVNode as H, renderSlot as z, normalizeProps as x, mergeProps as M, Fragment as V, renderList as J, guardReactiveProps as Q, toDisplayString as W, vShow as de, createSlots as fe, createTextVNode as ve, nextTick as me } from "vue";
|
|
2
2
|
import { F as c, a as ye } from "./ui-5PiaVzMN.js";
|
|
3
3
|
const he = ["placeholder", "disabled", "readonly"], be = { key: 1 }, we = {
|
|
4
4
|
key: 0,
|
|
@@ -9,7 +9,7 @@ const he = ["placeholder", "disabled", "readonly"], be = { key: 1 }, we = {
|
|
|
9
9
|
}, Se = /* @__PURE__ */ ie({
|
|
10
10
|
name: "TInputSelect",
|
|
11
11
|
__name: "InputSelect",
|
|
12
|
-
props: /* @__PURE__ */
|
|
12
|
+
props: /* @__PURE__ */ U({
|
|
13
13
|
size: { default: c.Default },
|
|
14
14
|
options: { default: () => [] },
|
|
15
15
|
mapper: { type: Function, default: (m) => ({
|
|
@@ -32,12 +32,12 @@ const he = ["placeholder", "disabled", "readonly"], be = { key: 1 }, we = {
|
|
|
32
32
|
modelValue: {},
|
|
33
33
|
modelModifiers: {}
|
|
34
34
|
}),
|
|
35
|
-
emits: /* @__PURE__ */
|
|
35
|
+
emits: /* @__PURE__ */ U(["update:model-value", "initial-hydration"], ["update:modelValue"]),
|
|
36
36
|
setup(m, { emit: T }) {
|
|
37
37
|
const l = m;
|
|
38
38
|
let B = !1, C, j = "";
|
|
39
|
-
const
|
|
40
|
-
|
|
39
|
+
const L = T, n = re(m, "modelValue"), o = d([]), p = d(""), O = d(null), N = d(), u = d(!1), K = d(null), a = d([]), $ = d(!1), y = d(null), w = I(() => a.value.length > 0), h = I(() => l.isSearchable && u.value), g = I(() => typeof l.resource == "function"), X = (e) => !l.multiple || !n.value || !Array.isArray(n.value) ? !1 : n.value.includes(e.value), Y = (e = n.value) => !(e === void 0 || e === "" || Array.isArray(e) && e.length === 0), Z = (e) => {
|
|
40
|
+
L("update:model-value", e);
|
|
41
41
|
}, b = (e = n.value) => {
|
|
42
42
|
if (Y(e))
|
|
43
43
|
if (l.multiple)
|
|
@@ -50,7 +50,7 @@ const he = ["placeholder", "disabled", "readonly"], be = { key: 1 }, we = {
|
|
|
50
50
|
}
|
|
51
51
|
}, ee = async (e) => {
|
|
52
52
|
e.target.nodeName === "svg" && e.stopPropagation(), u.value = !u.value, u.value && h.value && me(() => {
|
|
53
|
-
|
|
53
|
+
O.value?.focus();
|
|
54
54
|
});
|
|
55
55
|
}, A = (e) => o.value.findIndex(
|
|
56
56
|
(t) => t.value === e
|
|
@@ -89,7 +89,7 @@ const he = ["placeholder", "disabled", "readonly"], be = { key: 1 }, we = {
|
|
|
89
89
|
}, oe = async (e) => {
|
|
90
90
|
switch (e.key) {
|
|
91
91
|
case "ArrowDown":
|
|
92
|
-
|
|
92
|
+
K.value?.move(e);
|
|
93
93
|
break;
|
|
94
94
|
case "Escape":
|
|
95
95
|
u.value = !1;
|
|
@@ -97,7 +97,7 @@ const he = ["placeholder", "disabled", "readonly"], be = { key: 1 }, we = {
|
|
|
97
97
|
}
|
|
98
98
|
};
|
|
99
99
|
return pe(async () => {
|
|
100
|
-
g.value ? (await D(), b()) : l.options.length > 0 && (o.value = l.options), !n.value && l.initialValue ? b(l.initialValue) : b(n.value);
|
|
100
|
+
g.value ? (await D(), b(), L("initial-hydration", o.value)) : l.options.length > 0 && (o.value = l.options), !n.value && l.initialValue ? b(l.initialValue) : b(n.value);
|
|
101
101
|
}), P(
|
|
102
102
|
() => n.value,
|
|
103
103
|
async (e) => {
|
|
@@ -125,75 +125,75 @@ const he = ["placeholder", "disabled", "readonly"], be = { key: 1 }, we = {
|
|
|
125
125
|
placement: l.dropdownPlacement,
|
|
126
126
|
class: S([l.widthClass]),
|
|
127
127
|
ref_key: "popoverRef",
|
|
128
|
-
ref:
|
|
128
|
+
ref: N
|
|
129
129
|
}, {
|
|
130
130
|
default: R(() => [
|
|
131
|
-
|
|
131
|
+
q("div", {
|
|
132
132
|
class: S([{
|
|
133
|
-
"h-7": l.size ===
|
|
134
|
-
"h-9": l.size ===
|
|
135
|
-
"h-full *:min-h-7": l.size ===
|
|
136
|
-
"h-full *:min-h-9": l.size ===
|
|
133
|
+
"h-7": l.size === f(c).Small && !l.multiple,
|
|
134
|
+
"h-9": l.size === f(c).Default && !l.multiple,
|
|
135
|
+
"h-full *:min-h-7": l.size === f(c).Small && l.multiple,
|
|
136
|
+
"h-full *:min-h-9": l.size === f(c).Default && l.multiple,
|
|
137
137
|
[l.borderClass]: !0,
|
|
138
138
|
[l.roundnessClass]: !0
|
|
139
139
|
}, "flex justify-between items-center w-full max-w-96 input-text-color select-none input-bg-color"])
|
|
140
140
|
}, [
|
|
141
|
-
h.value ?
|
|
141
|
+
h.value ? G((i(), v("input", {
|
|
142
142
|
key: 0,
|
|
143
143
|
"onUpdate:modelValue": t[0] || (t[0] = (s) => p.value = s),
|
|
144
144
|
type: "text",
|
|
145
145
|
ref_key: "inputRef",
|
|
146
|
-
ref:
|
|
146
|
+
ref: O,
|
|
147
147
|
placeholder: l.placeholder,
|
|
148
148
|
disabled: l.disabled,
|
|
149
149
|
readonly: !l.isSearchable,
|
|
150
150
|
class: S(["bg-transparent input-padding input-roundness input-outline w-full", {
|
|
151
|
-
"h-7 text-sm": l.size ===
|
|
152
|
-
"h-9 text-base": l.size ===
|
|
151
|
+
"h-7 text-sm": l.size === f(c).Small,
|
|
152
|
+
"h-9 text-base": l.size === f(c).Default
|
|
153
153
|
}]),
|
|
154
154
|
onInput: le,
|
|
155
155
|
onKeydown: oe
|
|
156
156
|
}, null, 42, he)), [
|
|
157
157
|
[ce, p.value]
|
|
158
158
|
]) : F("", !0),
|
|
159
|
-
|
|
159
|
+
H(k, {
|
|
160
160
|
variant: "transparent",
|
|
161
161
|
size: "",
|
|
162
162
|
class: S(["h-full", {
|
|
163
163
|
"w-full justify-end pr-2": !h.value && !w.value,
|
|
164
164
|
"w-full justify-between pr-2": !h.value && w.value,
|
|
165
165
|
"w-10 justify-center": h.value,
|
|
166
|
-
"text-sm": l.size ===
|
|
167
|
-
"text-base": l.size ===
|
|
166
|
+
"text-sm": l.size === f(c).Small,
|
|
167
|
+
"text-base": l.size === f(c).Default
|
|
168
168
|
}]),
|
|
169
|
-
"aria-describedby":
|
|
169
|
+
"aria-describedby": N.value?.name,
|
|
170
170
|
icon: u.value === !0 ? "chevron-up" : "chevron-down",
|
|
171
171
|
"icon-position": h.value ? "left" : "right",
|
|
172
172
|
"icon-props": {
|
|
173
|
-
size: l.size ===
|
|
173
|
+
size: l.size === f(c).Default ? 18 : 15,
|
|
174
174
|
class: "text-(--border-color)"
|
|
175
175
|
},
|
|
176
176
|
hover: !1,
|
|
177
177
|
onClick: ee
|
|
178
178
|
}, {
|
|
179
179
|
default: R(() => [
|
|
180
|
-
q(
|
|
180
|
+
G(q("div", {
|
|
181
181
|
class: S(["inline-flex items-center ml-2 max-w-[calc(100%-2.5rem)]", {
|
|
182
182
|
"overflow-hidden whitespace-nowrap": !l.multiple,
|
|
183
183
|
"flex-wrap gap-2 py-1": l.multiple
|
|
184
184
|
}])
|
|
185
185
|
}, [
|
|
186
186
|
e.$slots.selection && w.value ? z(e.$slots, "selection", x(M({ key: 0 }, o.value[a.value[0]]))) : e.$slots.default && w.value ? (i(), v(V, { key: 1 }, [
|
|
187
|
-
l.multiple ? (i(!0), v(V, { key: 0 },
|
|
187
|
+
l.multiple ? (i(!0), v(V, { key: 0 }, J(a.value, (s) => z(e.$slots, "default", x(Q(o.value[s])))), 256)) : z(e.$slots, "default", x(M({ key: 1 }, o.value[a.value[0]])))
|
|
188
188
|
], 64)) : w.value ? (i(), v(V, { key: 2 }, [
|
|
189
|
-
l.multiple ? (i(!0), v(V, { key: 0 },
|
|
189
|
+
l.multiple ? (i(!0), v(V, { key: 0 }, J(a.value, (s) => (i(), E(r, {
|
|
190
190
|
key: s,
|
|
191
191
|
text: o.value[s]?.label,
|
|
192
192
|
color: "#6e6e6e"
|
|
193
|
-
}, null, 8, ["text"]))), 128)) : (i(), v("span", be,
|
|
193
|
+
}, null, 8, ["text"]))), 128)) : (i(), v("span", be, W(o.value[a.value[0]]?.label), 1))
|
|
194
194
|
], 64)) : F("", !0)
|
|
195
195
|
], 2), [
|
|
196
|
-
[
|
|
196
|
+
[de, !h.value]
|
|
197
197
|
])
|
|
198
198
|
]),
|
|
199
199
|
_: 3
|
|
@@ -201,9 +201,9 @@ const he = ["placeholder", "disabled", "readonly"], be = { key: 1 }, we = {
|
|
|
201
201
|
], 2)
|
|
202
202
|
]),
|
|
203
203
|
content: R(() => [
|
|
204
|
-
|
|
204
|
+
H(ne, {
|
|
205
205
|
ref_key: "dropdownRef",
|
|
206
|
-
ref:
|
|
206
|
+
ref: K,
|
|
207
207
|
items: o.value,
|
|
208
208
|
"is-visible": u.value,
|
|
209
209
|
multiple: l.multiple,
|
|
@@ -212,13 +212,13 @@ const he = ["placeholder", "disabled", "readonly"], be = { key: 1 }, we = {
|
|
|
212
212
|
"option-margin-class": "m-1",
|
|
213
213
|
onChange: te,
|
|
214
214
|
onEndReached: ae
|
|
215
|
-
},
|
|
215
|
+
}, fe({ _: 2 }, [
|
|
216
216
|
e.$slots.default || l.multiple ? {
|
|
217
217
|
name: "default",
|
|
218
218
|
fn: R((s) => [
|
|
219
219
|
l.multiple ? (i(), v("div", we, [
|
|
220
220
|
e.$slots.default ? z(e.$slots, "default", x(M({ key: 0 }, s))) : (i(), v(V, { key: 1 }, [
|
|
221
|
-
ve(
|
|
221
|
+
ve(W(s.label), 1)
|
|
222
222
|
], 64)),
|
|
223
223
|
X(s) ? (i(), E(se, {
|
|
224
224
|
key: 2,
|
|
@@ -227,7 +227,7 @@ const he = ["placeholder", "disabled", "readonly"], be = { key: 1 }, we = {
|
|
|
227
227
|
class: "float-right ml-2"
|
|
228
228
|
})) : F("", !0)
|
|
229
229
|
])) : (i(), v("div", ge, [
|
|
230
|
-
z(e.$slots, "default", x(
|
|
230
|
+
z(e.$slots, "default", x(Q(s)))
|
|
231
231
|
]))
|
|
232
232
|
]),
|
|
233
233
|
key: "0"
|
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-gKqoL70h.js";
|
|
2
|
+
import { p } from "./plugin-Cy5TXn1Y.js";
|
|
3
3
|
export {
|
|
4
4
|
r as Modal,
|
|
5
5
|
p as ModalPlugin
|
|
@@ -1,33 +1,34 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { _ as
|
|
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
3
|
const B = {
|
|
4
|
-
key:
|
|
4
|
+
key: 1,
|
|
5
5
|
class: "p-4 border-b border-color"
|
|
6
|
-
},
|
|
6
|
+
}, C = {
|
|
7
7
|
key: 0,
|
|
8
8
|
class: "block font-semibold uppercase"
|
|
9
|
-
},
|
|
10
|
-
key:
|
|
9
|
+
}, S = {
|
|
10
|
+
key: 2,
|
|
11
11
|
class: "flex flex-row items-center justify-between p-4 border-t border-color"
|
|
12
|
-
},
|
|
12
|
+
}, z = /* @__PURE__ */ y({
|
|
13
13
|
name: "TModal",
|
|
14
14
|
__name: "Modal",
|
|
15
15
|
props: {
|
|
16
16
|
title: { default: "" },
|
|
17
|
+
canClose: { type: Boolean, default: !0 },
|
|
17
18
|
showHeader: { type: Boolean, default: !0 },
|
|
18
19
|
injectStyle: { default: () => ({ wrapper: "", body: "", container: "" }) },
|
|
19
20
|
hasBackdrop: { type: Boolean, default: !0 },
|
|
20
21
|
disableStyle: { type: Boolean, default: !1 }
|
|
21
22
|
},
|
|
22
23
|
emits: ["closed"],
|
|
23
|
-
setup(
|
|
24
|
-
const e =
|
|
25
|
-
t.stopPropagation(),
|
|
24
|
+
setup(u, { emit: f }) {
|
|
25
|
+
const e = u, p = f, c = b(null), r = (t) => {
|
|
26
|
+
t.stopPropagation(), p("closed");
|
|
26
27
|
};
|
|
27
|
-
return
|
|
28
|
-
|
|
29
|
-
}), (t,
|
|
30
|
-
const
|
|
28
|
+
return h(() => {
|
|
29
|
+
c.value?.focus();
|
|
30
|
+
}), (t, x) => {
|
|
31
|
+
const m = k("t-button");
|
|
31
32
|
return o(), s("div", {
|
|
32
33
|
class: a(["fixed inset-0 focus-visible:outline-hidden z-10", {
|
|
33
34
|
"flex items-center": !e.disableStyle,
|
|
@@ -35,32 +36,33 @@ const B = {
|
|
|
35
36
|
}]),
|
|
36
37
|
tabindex: "-1",
|
|
37
38
|
ref_key: "modal",
|
|
38
|
-
ref:
|
|
39
|
+
ref: c,
|
|
39
40
|
onKeyup: _(r, ["esc"])
|
|
40
41
|
}, [
|
|
41
|
-
e.hasBackdrop ? (o(),
|
|
42
|
+
e.hasBackdrop ? (o(), i(w, {
|
|
42
43
|
key: 0,
|
|
43
44
|
class: "z-10",
|
|
44
45
|
onClick: r
|
|
45
46
|
})) : l("", !0),
|
|
46
|
-
|
|
47
|
+
d("div", {
|
|
47
48
|
class: a(["z-10 w-full md:w-[36rem] mx-auto", {
|
|
48
49
|
"relative floatable": !e.disableStyle,
|
|
49
50
|
[e.injectStyle.container]: !0
|
|
50
51
|
}])
|
|
51
52
|
}, [
|
|
52
|
-
|
|
53
|
+
e.canClose ? (o(), i(m, {
|
|
54
|
+
key: 0,
|
|
53
55
|
variant: "transparent",
|
|
54
56
|
icon: "close",
|
|
55
57
|
size: "",
|
|
56
58
|
class: "absolute justify-center top-0 right-0 h-14 w-14",
|
|
57
59
|
onClick: r
|
|
58
|
-
}),
|
|
60
|
+
})) : l("", !0),
|
|
59
61
|
e.showHeader ? (o(), s("div", B, [
|
|
60
|
-
e.title ? (o(), s("span",
|
|
62
|
+
e.title ? (o(), s("span", C, v(e.title), 1)) : l("", !0),
|
|
61
63
|
t.$slots.header ? n(t.$slots, "header", { key: 1 }) : l("", !0)
|
|
62
64
|
])) : l("", !0),
|
|
63
|
-
|
|
65
|
+
d("div", {
|
|
64
66
|
class: a(["flex flex-col flex-1 overflow-y-auto scrollbar", {
|
|
65
67
|
[e.injectStyle.body]: !0
|
|
66
68
|
}]),
|
|
@@ -68,7 +70,7 @@ const B = {
|
|
|
68
70
|
}, [
|
|
69
71
|
n(t.$slots, "default")
|
|
70
72
|
], 2),
|
|
71
|
-
t.$slots.footer ? (o(), s("div",
|
|
73
|
+
t.$slots.footer ? (o(), s("div", S, [
|
|
72
74
|
n(t.$slots, "footer")
|
|
73
75
|
])) : l("", !0)
|
|
74
76
|
], 2)
|
|
@@ -77,5 +79,5 @@ const B = {
|
|
|
77
79
|
}
|
|
78
80
|
});
|
|
79
81
|
export {
|
|
80
|
-
|
|
82
|
+
z as _
|
|
81
83
|
};
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import './Popover.css';
|
|
2
|
+
import { defineComponent as x, mergeModels as B, useModel as E, ref as c, computed as u, onBeforeMount as S, onBeforeUnmount as b, openBlock as p, createElementBlock as g, renderSlot as T, normalizeProps as I, guardReactiveProps as O, createBlock as k, Teleport as A, normalizeStyle as N, unref as w, normalizeClass as M, createCommentVNode as R } from "vue";
|
|
3
|
+
import { d as z, a } from "./ui-5PiaVzMN.js";
|
|
4
|
+
import { o as L, s as V, a as $, u as W, b as U } from "./floating-ui.vue-B5QcGNjh.js";
|
|
5
|
+
import { _ as j } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
6
|
+
let F = 0;
|
|
7
|
+
const G = /* @__PURE__ */ x({
|
|
8
|
+
name: "TPopover",
|
|
9
|
+
__name: "Popover",
|
|
10
|
+
props: /* @__PURE__ */ B({
|
|
11
|
+
trigger: { default: z.CLICK },
|
|
12
|
+
disabled: { type: Boolean, default: !1 },
|
|
13
|
+
placement: { default: a.BOTTOM },
|
|
14
|
+
width: { default: "auto" },
|
|
15
|
+
slotWrapperClass: { default: "input-roundness" }
|
|
16
|
+
}, {
|
|
17
|
+
open: { type: Boolean, default: !1 },
|
|
18
|
+
openModifiers: {}
|
|
19
|
+
}),
|
|
20
|
+
emits: ["update:open"],
|
|
21
|
+
setup(d, { expose: C }) {
|
|
22
|
+
const o = E(d, "open"), n = d, f = `popover_${++F}`, i = c(), m = u(() => n.placement), r = c(), l = c(), y = u(() => {
|
|
23
|
+
if (n.placement === a.ACTIVATION_POSITION && l.value) {
|
|
24
|
+
const { x: t, y: e } = l.value;
|
|
25
|
+
return {
|
|
26
|
+
getBoundingClientRect: () => ({
|
|
27
|
+
x: t,
|
|
28
|
+
y: e,
|
|
29
|
+
left: t,
|
|
30
|
+
top: e,
|
|
31
|
+
right: t + 1,
|
|
32
|
+
bottom: e + 1,
|
|
33
|
+
width: 1,
|
|
34
|
+
height: 1,
|
|
35
|
+
toJSON: () => {
|
|
36
|
+
}
|
|
37
|
+
}),
|
|
38
|
+
contextElement: r.value?.firstChild?.nextElementSibling
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
return r.value?.firstChild?.nextElementSibling;
|
|
42
|
+
}), _ = u(() => {
|
|
43
|
+
const t = n.placement === a.ACTIVATION_POSITION && l.value;
|
|
44
|
+
return [
|
|
45
|
+
L(t ? 0 : 5),
|
|
46
|
+
V({
|
|
47
|
+
apply({ elements: e }) {
|
|
48
|
+
if (n.width === "static")
|
|
49
|
+
return;
|
|
50
|
+
const P = e.reference.getBoundingClientRect();
|
|
51
|
+
Object.assign(e.floating.style, {
|
|
52
|
+
minWidth: `${P.width}px`
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
}),
|
|
56
|
+
$({ crossAxis: !0 })
|
|
57
|
+
];
|
|
58
|
+
}), { floatingStyles: h } = W(y, i, {
|
|
59
|
+
open: o,
|
|
60
|
+
placement: m.value === a.ACTIVATION_POSITION ? a.BOTTOM_START : m.value,
|
|
61
|
+
middleware: _,
|
|
62
|
+
whileElementsMounted: U
|
|
63
|
+
}), v = (t, e) => {
|
|
64
|
+
o.value = typeof t == "boolean" ? t : !o.value, o.value ? e && n.placement === a.ACTIVATION_POSITION && (l.value = { x: e.clientX, y: e.clientY }) : l.value = void 0;
|
|
65
|
+
}, s = (t) => {
|
|
66
|
+
const e = t.target;
|
|
67
|
+
return o.value && !r.value?.contains(e) && !i.value?.contains(e) ? (o.value = !1, !1) : !0;
|
|
68
|
+
};
|
|
69
|
+
return S(() => {
|
|
70
|
+
document.addEventListener("click", s), document.addEventListener("contextmenu", s);
|
|
71
|
+
}), b(() => {
|
|
72
|
+
document.removeEventListener("click", s), document.removeEventListener("contextmenu", s);
|
|
73
|
+
}), C({ name: f }), (t, e) => (p(), g("div", {
|
|
74
|
+
ref_key: "wrapperRef",
|
|
75
|
+
ref: r
|
|
76
|
+
}, [
|
|
77
|
+
T(t.$slots, "default", I(O({ onTogglePopover: v })), void 0, !0),
|
|
78
|
+
(p(), k(A, { to: "body" }, [
|
|
79
|
+
o.value ? (p(), g("div", {
|
|
80
|
+
key: 0,
|
|
81
|
+
ref_key: "floating",
|
|
82
|
+
ref: i,
|
|
83
|
+
role: "tooltip",
|
|
84
|
+
id: f,
|
|
85
|
+
style: N(w(h)),
|
|
86
|
+
class: M(["popover-floatable bg-caipira-primary z-10", {
|
|
87
|
+
[n.slotWrapperClass]: !0
|
|
88
|
+
}])
|
|
89
|
+
}, [
|
|
90
|
+
T(t.$slots, "content", I(O({ onTogglePopover: v })), void 0, !0)
|
|
91
|
+
], 6)) : R("", !0)
|
|
92
|
+
]))
|
|
93
|
+
], 512));
|
|
94
|
+
}
|
|
95
|
+
}), q = /* @__PURE__ */ j(G, [["__scopeId", "data-v-6af31a87"]]);
|
|
96
|
+
export {
|
|
97
|
+
q as P
|
|
98
|
+
};
|
package/dist/Popover.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.popover-floatable[data-v-
|
|
1
|
+
.popover-floatable[data-v-6af31a87]{scrollbar-gutter:stable}
|
package/dist/Popover.js
CHANGED