energy-components 1.15.0 → 1.16.0
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/README.md +1 -1
- package/dist/components/modal.es.js +54 -47
- package/dist/components/popover.es.js +86 -67
- package/dist/components/style/button.css +1 -1
- package/dist/components/style/icon-svg.css +1 -1
- package/dist/components/style/modal.css +1 -1
- package/dist/components/style/popover.css +1 -1
- package/dist/components/style/tooltip.css +1 -1
- package/dist/components/tooltip.es.js +99 -62
- package/dist/energy-components.es.js +3037 -2974
- package/dist/energy-components.umd.js +2 -2
- package/dist/style.css +1 -1
- package/dist/types/src/components/overlay/modal/modal.vue.d.ts +19 -0
- package/dist/types/src/components/overlay/popover/popover.vue.d.ts +6 -1
- package/dist/types/src/components/overlay/tooltip/tooltip.vue.d.ts +42 -2
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { c as
|
|
3
|
-
import { R as
|
|
4
|
-
import { _ as
|
|
5
|
-
import './style/tooltip.css';const
|
|
1
|
+
import { defineComponent as E, toRefs as I, ref as o, computed as S, createElementBlock as p, openBlock as f, createElementVNode as i, renderSlot as k, normalizeClass as R, createCommentVNode as $, unref as b, createVNode as P, toDisplayString as B, createTextVNode as F, nextTick as X } from "vue";
|
|
2
|
+
import { c as Y, o as q, f as G, s as J, a as K, b as L } from "./floating-ui.vue-7LKzPqHI.js";
|
|
3
|
+
import { R as Q } from "./icon-svg-BU0OQFKH.js";
|
|
4
|
+
import { _ as U } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
5
|
+
import './style/tooltip.css';const Z = ["id"], ee = {
|
|
6
6
|
key: 0,
|
|
7
7
|
class: "rds-e-tooltip__header"
|
|
8
|
-
},
|
|
8
|
+
}, te = { class: "rds-e-tooltip__title" }, oe = { class: "rds-e-tooltip__content" }, le = /* @__PURE__ */ E({
|
|
9
9
|
__name: "tooltip",
|
|
10
10
|
props: {
|
|
11
11
|
/**
|
|
@@ -63,105 +63,142 @@ import './style/tooltip.css';const G = ["id"], J = {
|
|
|
63
63
|
id: {
|
|
64
64
|
type: String,
|
|
65
65
|
default: void 0
|
|
66
|
+
},
|
|
67
|
+
/**
|
|
68
|
+
* <span>Suprime el tooltip para que no se muestre</span>
|
|
69
|
+
*/
|
|
70
|
+
suppressed: {
|
|
71
|
+
type: Boolean,
|
|
72
|
+
default: !1
|
|
73
|
+
},
|
|
74
|
+
/**
|
|
75
|
+
* <span>Oculta la flecha del tooltip</span>
|
|
76
|
+
*/
|
|
77
|
+
hideArrow: {
|
|
78
|
+
type: Boolean,
|
|
79
|
+
default: !1
|
|
66
80
|
}
|
|
67
81
|
},
|
|
68
|
-
|
|
69
|
-
|
|
82
|
+
emits: [
|
|
83
|
+
/**
|
|
84
|
+
* Se emite cuando el tooltip se activa para mostrarse.
|
|
85
|
+
* @event show
|
|
86
|
+
*/
|
|
87
|
+
"show",
|
|
88
|
+
/**
|
|
89
|
+
* Se emite cuando el tooltip se oculta.
|
|
90
|
+
* @event hide
|
|
91
|
+
*/
|
|
92
|
+
"hide"
|
|
93
|
+
],
|
|
94
|
+
setup(l, { expose: C, emit: N }) {
|
|
95
|
+
const s = l, r = N, { large: u, fullWidth: D, title: t, inverse: M } = I(s), m = o(), n = o(), d = o(), e = o(!0), _ = o(""), O = S(() => ({
|
|
70
96
|
"rds-e-tooltip__tooltip": !0,
|
|
71
|
-
"rds-e-tooltip__tooltip-hidden":
|
|
72
|
-
"rds-e-tooltip__tooltip--large":
|
|
73
|
-
"rds-e-tooltip__tooltip--inverse":
|
|
74
|
-
})),
|
|
75
|
-
const { x: a, y
|
|
76
|
-
|
|
97
|
+
"rds-e-tooltip__tooltip-hidden": e.value,
|
|
98
|
+
"rds-e-tooltip__tooltip--large": u.value,
|
|
99
|
+
"rds-e-tooltip__tooltip--inverse": M.value
|
|
100
|
+
})), V = async () => {
|
|
101
|
+
const { x: a, y, middlewareData: A, placement: g } = await Y(
|
|
102
|
+
m.value,
|
|
77
103
|
n.value,
|
|
78
104
|
{
|
|
79
|
-
placement:
|
|
105
|
+
placement: s.placement,
|
|
80
106
|
middleware: [
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
apply({ availableHeight:
|
|
86
|
-
Object.assign(
|
|
87
|
-
maxWidth:
|
|
107
|
+
q(s.offsetSpace),
|
|
108
|
+
G(),
|
|
109
|
+
J(),
|
|
110
|
+
K({
|
|
111
|
+
apply({ availableHeight: T, availableWidth: W, elements: z }) {
|
|
112
|
+
Object.assign(z.floating.style, {
|
|
113
|
+
maxWidth: D.value ? `${Math.max(0, W)}px` : "380px",
|
|
88
114
|
width: "max-content",
|
|
89
|
-
maxHeight: `${Math.max(0,
|
|
115
|
+
maxHeight: `${Math.max(0, T)}px`
|
|
90
116
|
});
|
|
91
117
|
}
|
|
92
118
|
}),
|
|
93
|
-
|
|
94
|
-
element:
|
|
95
|
-
padding:
|
|
119
|
+
L({
|
|
120
|
+
element: d.value,
|
|
121
|
+
padding: u.value ? 16 : 8
|
|
96
122
|
})
|
|
97
123
|
]
|
|
98
124
|
}
|
|
99
125
|
);
|
|
100
126
|
Object.assign(n.value.style, {
|
|
101
127
|
left: `${a}px`,
|
|
102
|
-
top: `${
|
|
128
|
+
top: `${y}px`
|
|
103
129
|
});
|
|
104
|
-
const { x
|
|
130
|
+
const { x, y: w } = A.arrow, H = {
|
|
105
131
|
left: "right",
|
|
106
132
|
right: "left",
|
|
107
133
|
bottom: "top",
|
|
108
134
|
top: "bottom"
|
|
109
135
|
};
|
|
110
|
-
|
|
111
|
-
left:
|
|
112
|
-
top:
|
|
136
|
+
_.value = `rds-e-tooltip__tooltip-arrow--${g}`, Object.assign(d.value.style, {
|
|
137
|
+
left: x != null ? `${x}px` : "",
|
|
138
|
+
top: w != null ? `${w}px` : "",
|
|
113
139
|
bottom: "",
|
|
114
140
|
right: "",
|
|
115
|
-
[
|
|
141
|
+
[H[g.split("-")[0]]]: "-4px"
|
|
116
142
|
});
|
|
117
|
-
},
|
|
118
|
-
|
|
119
|
-
},
|
|
120
|
-
|
|
143
|
+
}, v = () => {
|
|
144
|
+
t != null && t.value || (e.value = !0, r("hide"));
|
|
145
|
+
}, c = () => {
|
|
146
|
+
s.suppressed || (e.value = !1, r("show"), X(() => {
|
|
147
|
+
V();
|
|
148
|
+
}));
|
|
149
|
+
}, h = () => {
|
|
150
|
+
e.value || (e.value = !0, r("hide"));
|
|
151
|
+
}, j = () => {
|
|
152
|
+
h();
|
|
121
153
|
};
|
|
122
|
-
return (
|
|
123
|
-
|
|
154
|
+
return C({
|
|
155
|
+
show: c,
|
|
156
|
+
hide: h,
|
|
157
|
+
isOpen: S(() => !e.value)
|
|
158
|
+
}), (a, y) => (f(), p("div", {
|
|
159
|
+
id: l.id,
|
|
124
160
|
class: "rds-e-tooltip"
|
|
125
161
|
}, [
|
|
126
|
-
|
|
162
|
+
i("div", {
|
|
127
163
|
ref_key: "referenceRef",
|
|
128
|
-
ref:
|
|
164
|
+
ref: m,
|
|
129
165
|
class: "rds-e-tooltip__trigger",
|
|
130
|
-
onBlur:
|
|
131
|
-
onFocus:
|
|
132
|
-
onMouseenter:
|
|
133
|
-
onMouseleave:
|
|
166
|
+
onBlur: v,
|
|
167
|
+
onFocus: c,
|
|
168
|
+
onMouseenter: c,
|
|
169
|
+
onMouseleave: v
|
|
134
170
|
}, [
|
|
135
|
-
|
|
171
|
+
k(a.$slots, "default", {}, void 0, !0)
|
|
136
172
|
], 544),
|
|
137
|
-
|
|
173
|
+
i("div", {
|
|
138
174
|
ref_key: "floatingRef",
|
|
139
175
|
ref: n,
|
|
140
|
-
class:
|
|
176
|
+
class: R(O.value)
|
|
141
177
|
}, [
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
178
|
+
b(t) ? (f(), p("div", ee, [
|
|
179
|
+
i("h3", te, B(b(t)), 1),
|
|
180
|
+
P(Q, {
|
|
145
181
|
name: "close",
|
|
146
182
|
"aria-hidden": "true",
|
|
147
183
|
class: "rds-e-tooltip__icon",
|
|
148
|
-
onClick:
|
|
184
|
+
onClick: j
|
|
149
185
|
})
|
|
150
|
-
])) :
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
186
|
+
])) : $("", !0),
|
|
187
|
+
i("div", oe, [
|
|
188
|
+
k(a.$slots, "tooltip-content", {}, () => [
|
|
189
|
+
F(B(l.content), 1)
|
|
154
190
|
], !0)
|
|
155
191
|
]),
|
|
156
|
-
l("div", {
|
|
192
|
+
l.hideArrow ? $("", !0) : (f(), p("div", {
|
|
193
|
+
key: 1,
|
|
157
194
|
ref_key: "arrowRef",
|
|
158
|
-
ref:
|
|
159
|
-
class:
|
|
160
|
-
}, null, 2)
|
|
195
|
+
ref: d,
|
|
196
|
+
class: R(["rds-e-tooltip__tooltip-arrow", _.value])
|
|
197
|
+
}, null, 2))
|
|
161
198
|
], 2)
|
|
162
|
-
], 8,
|
|
199
|
+
], 8, Z));
|
|
163
200
|
}
|
|
164
|
-
}),
|
|
201
|
+
}), ne = /* @__PURE__ */ U(le, [["__scopeId", "data-v-41d4edc5"]]);
|
|
165
202
|
export {
|
|
166
|
-
|
|
203
|
+
ne as default
|
|
167
204
|
};
|