energy-components 2.1.0 → 2.3.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/dist/components/datepicker.es.js +322 -308
- package/dist/components/dropdown.es.js +173 -159
- package/dist/components/index.es.js +127 -121
- package/dist/components/indicatorDots.es.js +215 -0
- package/dist/components/loader.es.js +9 -9
- package/dist/components/searchField.es.js +188 -0
- package/dist/components/style/datepicker.css +1 -1
- package/dist/components/style/dropdown.css +1 -1
- package/dist/components/style/indicatorDots.css +1 -0
- package/dist/components/style/multiselect.css +1 -1
- package/dist/components/style/multiselectcontentwrapper.css +1 -1
- package/dist/components/style/searchField.css +1 -0
- package/dist/components/style/table.css +1 -1
- package/dist/components/style/tableRenderer.css +1 -1
- package/dist/components/style/textField.css +1 -1
- package/dist/components/style/tooltip.css +1 -1
- package/dist/components/table.es.js +76 -71
- package/dist/components/tableRenderer.es.js +244 -141
- package/dist/components/textField.es.js +204 -145
- package/dist/components/tooltip.es.js +129 -113
- package/dist/energy-components.css +1 -1
- package/dist/energy-components.es.js +6381 -5779
- package/dist/energy-components.umd.js +2 -2
- package/dist/style.css +1 -1
- package/dist/types/src/components/content/table/table-renderer.vue.d.ts +10 -1
- package/dist/types/src/components/content/table/table.vue.d.ts +13 -1
- package/dist/types/src/components/content/table/use-column-resize.d.ts +9 -0
- package/dist/types/src/components/feedback/indicator-dots/indicator-dots.vue.d.ts +181 -0
- package/dist/types/src/components/index.d.ts +2 -0
- package/dist/types/src/components/input/datepicker/datepicker.vue.d.ts +25 -0
- package/dist/types/src/components/input/dropdown/dropdown.vue.d.ts +25 -0
- package/dist/types/src/components/input/search-field/search-field.vue.d.ts +137 -0
- package/dist/types/src/components/input/text-field/text-field.vue.d.ts +64 -3
- package/dist/types/src/components/overlay/tooltip/tooltip.vue.d.ts +2 -2
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/llms/index.md +2 -0
- package/llms/rdsdate-picker.md +1 -0
- package/llms/rdsdropdown.md +1 -0
- package/llms/rdsindicator-dots.md +23 -0
- package/llms/rdssearch-field.md +22 -0
- package/llms/rdstable.md +2 -0
- package/llms/rdstext-field.md +5 -0
- package/llms/rdstooltip.md +1 -1
- package/package.json +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { a as
|
|
3
|
-
import { R as
|
|
4
|
-
import { _ as
|
|
5
|
-
import './style/tooltip.css';const
|
|
1
|
+
import { defineComponent as ie, computed as a, ref as c, watch as re, nextTick as V, onBeforeUnmount as ae, openBlock as O, createElementBlock as $, createElementVNode as k, renderSlot as j, createBlock as se, Teleport as ue, normalizeClass as P, toDisplayString as W, createVNode as ce, createCommentVNode as z, createTextVNode as de } from "vue";
|
|
2
|
+
import { a as X, o as fe, f as pe, s as ve, b as me, c as ge, d as he } from "./floating-ui.vue-DMBZhA6d.js";
|
|
3
|
+
import { R as we } from "./icon-svg-CW3eQRcp.js";
|
|
4
|
+
import { _ as ye } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
5
|
+
import './style/tooltip.css';const _e = ["id"], Oe = ["aria-hidden"], ke = {
|
|
6
6
|
key: 0,
|
|
7
7
|
class: "rds-e-tooltip__header"
|
|
8
|
-
},
|
|
8
|
+
}, Ce = { class: "rds-e-tooltip__title" }, Te = { class: "rds-e-tooltip__content" }, xe = /* @__PURE__ */ ie({
|
|
9
9
|
__name: "tooltip",
|
|
10
10
|
props: {
|
|
11
11
|
/**
|
|
@@ -106,7 +106,7 @@ import './style/tooltip.css';const ye = ["id"], _e = ["aria-hidden"], Oe = {
|
|
|
106
106
|
default: !1
|
|
107
107
|
},
|
|
108
108
|
/**
|
|
109
|
-
* <span>Controla la visibilidad mediante v-model:open. Si se
|
|
109
|
+
* <span>Controla la visibilidad mediante v-model:open. Si se pasa (true o false), el componente entra en modo controlado: los eventos internos (hover/focus/click) solo emiten `update:open` sin cambiar la visibilidad directamente. Para volver al modo no controlado, no pasar la prop (undefined).</span>
|
|
110
110
|
*/
|
|
111
111
|
open: {
|
|
112
112
|
type: Boolean,
|
|
@@ -151,182 +151,198 @@ import './style/tooltip.css';const ye = ["id"], _e = ["aria-hidden"], Oe = {
|
|
|
151
151
|
*/
|
|
152
152
|
"update:open"
|
|
153
153
|
],
|
|
154
|
-
setup(n, { expose:
|
|
155
|
-
const e = n,
|
|
154
|
+
setup(n, { expose: Y, emit: q }) {
|
|
155
|
+
const e = n, C = q, L = a(() => {
|
|
156
156
|
if (!e.teleportTo || typeof window > "u") return null;
|
|
157
157
|
try {
|
|
158
158
|
return document.querySelector(e.teleportTo) || null;
|
|
159
159
|
} catch {
|
|
160
160
|
return null;
|
|
161
161
|
}
|
|
162
|
-
}),
|
|
163
|
-
let
|
|
164
|
-
const
|
|
165
|
-
|
|
166
|
-
},
|
|
162
|
+
}), l = c(), i = c(), d = c(), f = c(!0), T = c("");
|
|
163
|
+
let s = null, x = !1, B = !1, o = null;
|
|
164
|
+
const p = c(null), S = a(() => e.open !== void 0), A = a(() => e.openOnHover && !e.openOnClick), H = a(() => e.openOnFocus && !e.openOnClick), v = (t) => {
|
|
165
|
+
S.value ? C("update:open", t) : (f.value = !t, C(t ? "show" : "hide"));
|
|
166
|
+
}, r = a(() => S.value ? !!e.open : !f.value), N = a(() => Math.min(Math.max(e.hideDelay, 0), 3e3)), G = a(() => ({
|
|
167
167
|
"rds-e-tooltip__tooltip": !0,
|
|
168
|
-
"rds-e-tooltip__tooltip-hidden": !
|
|
168
|
+
"rds-e-tooltip__tooltip-hidden": !r.value,
|
|
169
169
|
"rds-e-tooltip__tooltip--large": e.large,
|
|
170
170
|
"rds-e-tooltip__tooltip--inverse": e.inverse
|
|
171
|
-
})),
|
|
171
|
+
})), m = async () => {
|
|
172
172
|
const t = [
|
|
173
|
-
|
|
173
|
+
fe(e.offsetSpace),
|
|
174
174
|
pe(),
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
apply({ availableHeight:
|
|
178
|
-
Object.assign(
|
|
179
|
-
maxWidth: e.fullWidth ? `${Math.max(0,
|
|
175
|
+
ve(),
|
|
176
|
+
me({
|
|
177
|
+
apply({ availableHeight: y, availableWidth: _, elements: M }) {
|
|
178
|
+
Object.assign(M.floating.style, {
|
|
179
|
+
maxWidth: e.fullWidth ? `${Math.max(0, _)}px` : "380px",
|
|
180
180
|
width: "max-content",
|
|
181
|
-
maxHeight: `${Math.max(0,
|
|
181
|
+
maxHeight: `${Math.max(0, y)}px`
|
|
182
182
|
});
|
|
183
183
|
}
|
|
184
184
|
})
|
|
185
185
|
];
|
|
186
|
-
!e.hideArrow && d.value && t.push(
|
|
186
|
+
!e.hideArrow && d.value && t.push(ge({
|
|
187
187
|
element: d.value,
|
|
188
188
|
padding: e.large ? 16 : 8
|
|
189
189
|
}));
|
|
190
|
-
const u = e.target === "cursor" && e.openOnClick &&
|
|
191
|
-
getBoundingClientRect: () => new DOMRect(
|
|
192
|
-
contextElement:
|
|
193
|
-
} :
|
|
190
|
+
const u = e.target === "cursor" && e.openOnClick && p.value ? {
|
|
191
|
+
getBoundingClientRect: () => new DOMRect(p.value.x, p.value.y, 0, 0),
|
|
192
|
+
contextElement: l.value
|
|
193
|
+
} : l.value, { x: E, y: R, middlewareData: D, placement: I } = await he(
|
|
194
194
|
u,
|
|
195
|
-
|
|
195
|
+
i.value,
|
|
196
196
|
{
|
|
197
197
|
placement: e.placement,
|
|
198
198
|
middleware: t
|
|
199
199
|
}
|
|
200
200
|
);
|
|
201
|
-
if (Object.assign(
|
|
202
|
-
left: `${
|
|
203
|
-
top: `${
|
|
204
|
-
}), !e.hideArrow && d.value &&
|
|
205
|
-
const { x:
|
|
201
|
+
if (Object.assign(i.value.style, {
|
|
202
|
+
left: `${E}px`,
|
|
203
|
+
top: `${R}px`
|
|
204
|
+
}), !e.hideArrow && d.value && D.arrow) {
|
|
205
|
+
const { x: y, y: _ } = D.arrow, M = {
|
|
206
206
|
left: "right",
|
|
207
207
|
right: "left",
|
|
208
208
|
bottom: "top",
|
|
209
209
|
top: "bottom"
|
|
210
210
|
};
|
|
211
211
|
T.value = `rds-e-tooltip__tooltip-arrow--${I}`, Object.assign(d.value.style, {
|
|
212
|
-
left:
|
|
213
|
-
top:
|
|
212
|
+
left: y != null ? `${y}px` : "",
|
|
213
|
+
top: _ != null ? `${_}px` : "",
|
|
214
214
|
bottom: "",
|
|
215
215
|
right: "",
|
|
216
|
-
[
|
|
216
|
+
[M[I.split("-")[0]]]: "-4px"
|
|
217
217
|
});
|
|
218
218
|
} else e.hideArrow && (T.value = "");
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
219
|
+
};
|
|
220
|
+
re(
|
|
221
|
+
() => e.open,
|
|
222
|
+
(t) => {
|
|
223
|
+
S.value && (t ? V(() => {
|
|
224
|
+
!l.value || !i.value || (m(), e.autoUpdate && (o?.(), o = X(
|
|
225
|
+
l.value,
|
|
226
|
+
i.value,
|
|
227
|
+
() => {
|
|
228
|
+
m();
|
|
229
|
+
}
|
|
230
|
+
)), e.openOnClick && F());
|
|
231
|
+
}) : (o && (o(), o = null), e.openOnClick && b()));
|
|
232
|
+
},
|
|
233
|
+
{ immediate: !0 }
|
|
234
|
+
);
|
|
235
|
+
const J = () => {
|
|
236
|
+
clearTimeout(s), r.value ? v(!1) : f.value = !0;
|
|
237
|
+
}, U = () => {
|
|
238
|
+
e.title || (r.value ? v(!1) : f.value = !0, o && (o(), o = null)), clearTimeout(s);
|
|
239
|
+
}, g = () => {
|
|
240
|
+
e.suppressed || (clearTimeout(s), v(!0), V(() => {
|
|
241
|
+
m(), e.autoUpdate && l.value && i.value && (o?.(), o = X(
|
|
242
|
+
l.value,
|
|
243
|
+
i.value,
|
|
228
244
|
() => {
|
|
229
|
-
|
|
245
|
+
m();
|
|
230
246
|
}
|
|
231
|
-
)), e.openOnClick &&
|
|
247
|
+
)), e.openOnClick && F();
|
|
232
248
|
}));
|
|
233
|
-
}, q = () => {
|
|
234
|
-
$.value && (x = !0, m());
|
|
235
|
-
}, G = () => {
|
|
236
|
-
$.value && (x = !1, r = setTimeout(() => {
|
|
237
|
-
C || N();
|
|
238
|
-
}, A.value));
|
|
239
|
-
}, J = (t) => {
|
|
240
|
-
e.openOnClick && (f.value = { x: t.clientX, y: t.clientY }, l.value ? h() : m());
|
|
241
249
|
}, K = () => {
|
|
242
|
-
|
|
250
|
+
A.value && (B = !0, g());
|
|
243
251
|
}, Q = () => {
|
|
244
|
-
|
|
252
|
+
A.value && (B = !1, s = setTimeout(() => {
|
|
253
|
+
x || U();
|
|
254
|
+
}, N.value));
|
|
255
|
+
}, Z = (t) => {
|
|
256
|
+
e.openOnClick && (p.value = { x: t.clientX, y: t.clientY }, r.value ? w() : g());
|
|
257
|
+
}, ee = () => {
|
|
258
|
+
H.value && g();
|
|
259
|
+
}, te = () => {
|
|
260
|
+
H.value && J();
|
|
245
261
|
};
|
|
246
|
-
function
|
|
262
|
+
function h(t) {
|
|
247
263
|
if (!e.openOnClick) return;
|
|
248
|
-
const u = t.target,
|
|
249
|
-
!!!(u && (
|
|
250
|
-
}
|
|
251
|
-
function Z() {
|
|
252
|
-
typeof window > "u" || (window.addEventListener("pointerdown", g, { capture: !0 }), window.addEventListener("mousedown", g, { capture: !0 }));
|
|
264
|
+
const u = t.target, E = l.value, R = i.value;
|
|
265
|
+
!!!(u && (E?.contains(u) || R?.contains(u))) && r.value && w();
|
|
253
266
|
}
|
|
254
267
|
function F() {
|
|
255
|
-
typeof window > "u" || (window.
|
|
268
|
+
typeof window > "u" || (window.addEventListener("pointerdown", h, { capture: !0 }), window.addEventListener("mousedown", h, { capture: !0 }));
|
|
256
269
|
}
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
}, te = () => {
|
|
260
|
-
e.openOnClick || (C = !1, x || (r = setTimeout(() => {
|
|
261
|
-
N();
|
|
262
|
-
}, A.value)));
|
|
263
|
-
};
|
|
264
|
-
function h() {
|
|
265
|
-
l.value && (v(!1), o && (o(), o = null), e.openOnClick && F());
|
|
270
|
+
function b() {
|
|
271
|
+
typeof window > "u" || (window.removeEventListener("pointerdown", h, { capture: !0 }), window.removeEventListener("mousedown", h, { capture: !0 }));
|
|
266
272
|
}
|
|
267
273
|
const oe = () => {
|
|
268
|
-
|
|
274
|
+
e.openOnClick || (x = !0, clearTimeout(s));
|
|
275
|
+
}, ne = () => {
|
|
276
|
+
e.openOnClick || (x = !1, B || (s = setTimeout(() => {
|
|
277
|
+
U();
|
|
278
|
+
}, N.value)));
|
|
279
|
+
};
|
|
280
|
+
function w() {
|
|
281
|
+
r.value && (v(!1), o && (o(), o = null), e.openOnClick && b());
|
|
282
|
+
}
|
|
283
|
+
const le = () => {
|
|
284
|
+
w();
|
|
269
285
|
};
|
|
270
|
-
return
|
|
271
|
-
show:
|
|
272
|
-
hide:
|
|
273
|
-
isOpen:
|
|
274
|
-
}),
|
|
275
|
-
clearTimeout(
|
|
276
|
-
}), (t, u) => (
|
|
286
|
+
return Y({
|
|
287
|
+
show: g,
|
|
288
|
+
hide: w,
|
|
289
|
+
isOpen: a(() => r.value)
|
|
290
|
+
}), ae(() => {
|
|
291
|
+
clearTimeout(s), o && (o(), o = null), e.openOnClick && b();
|
|
292
|
+
}), (t, u) => (O(), $("div", {
|
|
277
293
|
id: n.id,
|
|
278
294
|
class: "rds-e-tooltip"
|
|
279
295
|
}, [
|
|
280
|
-
|
|
296
|
+
k("div", {
|
|
281
297
|
ref_key: "referenceRef",
|
|
282
|
-
ref:
|
|
298
|
+
ref: l,
|
|
283
299
|
class: "rds-e-tooltip__trigger",
|
|
284
|
-
onBlur:
|
|
285
|
-
onFocus:
|
|
286
|
-
onClick:
|
|
287
|
-
onMouseenter:
|
|
288
|
-
onMouseleave:
|
|
300
|
+
onBlur: te,
|
|
301
|
+
onFocus: ee,
|
|
302
|
+
onClick: Z,
|
|
303
|
+
onMouseenter: K,
|
|
304
|
+
onMouseleave: Q
|
|
289
305
|
}, [
|
|
290
|
-
|
|
306
|
+
j(t.$slots, "default", {}, void 0, !0)
|
|
291
307
|
], 544),
|
|
292
|
-
(
|
|
293
|
-
to:
|
|
294
|
-
disabled: !
|
|
308
|
+
(O(), se(ue, {
|
|
309
|
+
to: L.value,
|
|
310
|
+
disabled: !L.value
|
|
295
311
|
}, [
|
|
296
|
-
|
|
312
|
+
k("div", {
|
|
297
313
|
ref_key: "floatingRef",
|
|
298
|
-
ref:
|
|
299
|
-
class:
|
|
314
|
+
ref: i,
|
|
315
|
+
class: P(G.value),
|
|
300
316
|
role: "tooltip",
|
|
301
|
-
"aria-hidden": !
|
|
302
|
-
onMouseenter:
|
|
303
|
-
onMouseleave:
|
|
317
|
+
"aria-hidden": !r.value,
|
|
318
|
+
onMouseenter: oe,
|
|
319
|
+
onMouseleave: ne
|
|
304
320
|
}, [
|
|
305
|
-
n.title ? (
|
|
306
|
-
|
|
307
|
-
|
|
321
|
+
n.title ? (O(), $("div", ke, [
|
|
322
|
+
k("h3", Ce, W(n.title), 1),
|
|
323
|
+
ce(we, {
|
|
308
324
|
name: "close",
|
|
309
325
|
"aria-hidden": "true",
|
|
310
326
|
class: "rds-e-tooltip__icon",
|
|
311
|
-
onClick:
|
|
327
|
+
onClick: le
|
|
312
328
|
})
|
|
313
|
-
])) :
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
329
|
+
])) : z("", !0),
|
|
330
|
+
k("div", Te, [
|
|
331
|
+
j(t.$slots, "tooltip-content", {}, () => [
|
|
332
|
+
de(W(n.content), 1)
|
|
317
333
|
], !0)
|
|
318
334
|
]),
|
|
319
|
-
n.hideArrow ?
|
|
335
|
+
n.hideArrow ? z("", !0) : (O(), $("div", {
|
|
320
336
|
key: 1,
|
|
321
337
|
ref_key: "arrowRef",
|
|
322
338
|
ref: d,
|
|
323
|
-
class:
|
|
339
|
+
class: P(["rds-e-tooltip__tooltip-arrow", T.value])
|
|
324
340
|
}, null, 2))
|
|
325
|
-
], 42,
|
|
341
|
+
], 42, Oe)
|
|
326
342
|
], 8, ["to", "disabled"]))
|
|
327
|
-
], 8,
|
|
343
|
+
], 8, _e));
|
|
328
344
|
}
|
|
329
|
-
}),
|
|
345
|
+
}), Re = /* @__PURE__ */ ye(xe, [["__scopeId", "data-v-faf4bcdb"]]);
|
|
330
346
|
export {
|
|
331
|
-
|
|
347
|
+
Re as default
|
|
332
348
|
};
|