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.
Files changed (44) hide show
  1. package/dist/components/datepicker.es.js +322 -308
  2. package/dist/components/dropdown.es.js +173 -159
  3. package/dist/components/index.es.js +127 -121
  4. package/dist/components/indicatorDots.es.js +215 -0
  5. package/dist/components/loader.es.js +9 -9
  6. package/dist/components/searchField.es.js +188 -0
  7. package/dist/components/style/datepicker.css +1 -1
  8. package/dist/components/style/dropdown.css +1 -1
  9. package/dist/components/style/indicatorDots.css +1 -0
  10. package/dist/components/style/multiselect.css +1 -1
  11. package/dist/components/style/multiselectcontentwrapper.css +1 -1
  12. package/dist/components/style/searchField.css +1 -0
  13. package/dist/components/style/table.css +1 -1
  14. package/dist/components/style/tableRenderer.css +1 -1
  15. package/dist/components/style/textField.css +1 -1
  16. package/dist/components/style/tooltip.css +1 -1
  17. package/dist/components/table.es.js +76 -71
  18. package/dist/components/tableRenderer.es.js +244 -141
  19. package/dist/components/textField.es.js +204 -145
  20. package/dist/components/tooltip.es.js +129 -113
  21. package/dist/energy-components.css +1 -1
  22. package/dist/energy-components.es.js +6381 -5779
  23. package/dist/energy-components.umd.js +2 -2
  24. package/dist/style.css +1 -1
  25. package/dist/types/src/components/content/table/table-renderer.vue.d.ts +10 -1
  26. package/dist/types/src/components/content/table/table.vue.d.ts +13 -1
  27. package/dist/types/src/components/content/table/use-column-resize.d.ts +9 -0
  28. package/dist/types/src/components/feedback/indicator-dots/indicator-dots.vue.d.ts +181 -0
  29. package/dist/types/src/components/index.d.ts +2 -0
  30. package/dist/types/src/components/input/datepicker/datepicker.vue.d.ts +25 -0
  31. package/dist/types/src/components/input/dropdown/dropdown.vue.d.ts +25 -0
  32. package/dist/types/src/components/input/search-field/search-field.vue.d.ts +137 -0
  33. package/dist/types/src/components/input/text-field/text-field.vue.d.ts +64 -3
  34. package/dist/types/src/components/overlay/tooltip/tooltip.vue.d.ts +2 -2
  35. package/dist/types/tsconfig.tsbuildinfo +1 -1
  36. package/llms/index.md +2 -0
  37. package/llms/rdsdate-picker.md +1 -0
  38. package/llms/rdsdropdown.md +1 -0
  39. package/llms/rdsindicator-dots.md +23 -0
  40. package/llms/rdssearch-field.md +22 -0
  41. package/llms/rdstable.md +2 -0
  42. package/llms/rdstext-field.md +5 -0
  43. package/llms/rdstooltip.md +1 -1
  44. package/package.json +1 -1
@@ -1,11 +1,11 @@
1
- import { defineComponent as ne, computed as i, ref as c, onBeforeUnmount as le, openBlock as _, createElementBlock as R, createElementVNode as O, renderSlot as U, createBlock as ie, Teleport as re, normalizeClass as V, toDisplayString as j, createVNode as ae, createCommentVNode as P, createTextVNode as se, nextTick as ue } from "vue";
2
- import { a as ce, o as de, f as pe, s as fe, b as ve, c as me, d as ge } from "./floating-ui.vue-DMBZhA6d.js";
3
- import { R as he } from "./icon-svg-CW3eQRcp.js";
4
- import { _ as we } from "./_plugin-vue_export-helper-CHgC5LLL.js";
5
- import './style/tooltip.css';const ye = ["id"], _e = ["aria-hidden"], Oe = {
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
- }, ke = { class: "rds-e-tooltip__title" }, Te = { class: "rds-e-tooltip__content" }, Ce = /* @__PURE__ */ ne({
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 establece, el componente se comporta de forma controlada.</span>
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: W, emit: z }) {
155
- const e = n, k = z, D = i(() => {
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
- }), a = c(), s = c(), d = c(), p = c(!0), T = c("");
163
- let r = null, C = !1, x = !1, o = null;
164
- const f = c(null), M = i(() => e.open !== void 0), $ = i(() => e.openOnHover && !e.openOnClick), L = i(() => e.openOnFocus && !e.openOnClick), v = (t) => {
165
- M.value ? k("update:open", t) : (p.value = !t, k(t ? "show" : "hide"));
166
- }, l = i(() => M.value ? !!e.open : !p.value), A = i(() => Math.min(Math.max(e.hideDelay, 0), 3e3)), X = i(() => ({
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": !l.value,
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
- })), H = async () => {
171
+ })), m = async () => {
172
172
  const t = [
173
- de(e.offsetSpace),
173
+ fe(e.offsetSpace),
174
174
  pe(),
175
- fe(),
176
- ve({
177
- apply({ availableHeight: w, availableWidth: y, elements: b }) {
178
- Object.assign(b.floating.style, {
179
- maxWidth: e.fullWidth ? `${Math.max(0, y)}px` : "380px",
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, w)}px`
181
+ maxHeight: `${Math.max(0, y)}px`
182
182
  });
183
183
  }
184
184
  })
185
185
  ];
186
- !e.hideArrow && d.value && t.push(me({
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 && f.value ? {
191
- getBoundingClientRect: () => new DOMRect(f.value.x, f.value.y, 0, 0),
192
- contextElement: a.value
193
- } : a.value, { x: B, y: S, middlewareData: E, placement: I } = await ge(
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
- s.value,
195
+ i.value,
196
196
  {
197
197
  placement: e.placement,
198
198
  middleware: t
199
199
  }
200
200
  );
201
- if (Object.assign(s.value.style, {
202
- left: `${B}px`,
203
- top: `${S}px`
204
- }), !e.hideArrow && d.value && E.arrow) {
205
- const { x: w, y } = E.arrow, b = {
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: w != null ? `${w}px` : "",
213
- top: y != null ? `${y}px` : "",
212
+ left: y != null ? `${y}px` : "",
213
+ top: _ != null ? `${_}px` : "",
214
214
  bottom: "",
215
215
  right: "",
216
- [b[I.split("-")[0]]]: "-4px"
216
+ [M[I.split("-")[0]]]: "-4px"
217
217
  });
218
218
  } else e.hideArrow && (T.value = "");
219
- }, Y = () => {
220
- clearTimeout(r), l.value ? v(!1) : p.value = !0;
221
- }, N = () => {
222
- e.title || (l.value ? v(!1) : p.value = !0, o && (o(), o = null)), clearTimeout(r);
223
- }, m = () => {
224
- e.suppressed || (clearTimeout(r), v(!0), ue(() => {
225
- H(), e.autoUpdate && a.value && s.value && (o?.(), o = ce(
226
- a.value,
227
- s.value,
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
- H();
245
+ m();
230
246
  }
231
- )), e.openOnClick && Z();
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
- L.value && m();
250
+ A.value && (B = !0, g());
243
251
  }, Q = () => {
244
- L.value && Y();
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 g(t) {
262
+ function h(t) {
247
263
  if (!e.openOnClick) return;
248
- const u = t.target, B = a.value, S = s.value;
249
- !!!(u && (B?.contains(u) || S?.contains(u))) && l.value && h();
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.removeEventListener("pointerdown", g, { capture: !0 }), window.removeEventListener("mousedown", g, { capture: !0 }));
268
+ typeof window > "u" || (window.addEventListener("pointerdown", h, { capture: !0 }), window.addEventListener("mousedown", h, { capture: !0 }));
256
269
  }
257
- const ee = () => {
258
- e.openOnClick || (C = !0, clearTimeout(r));
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
- h();
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 W({
271
- show: m,
272
- hide: h,
273
- isOpen: i(() => l.value)
274
- }), le(() => {
275
- clearTimeout(r), o && (o(), o = null), e.openOnClick && F();
276
- }), (t, u) => (_(), R("div", {
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
- O("div", {
296
+ k("div", {
281
297
  ref_key: "referenceRef",
282
- ref: a,
298
+ ref: l,
283
299
  class: "rds-e-tooltip__trigger",
284
- onBlur: Q,
285
- onFocus: K,
286
- onClick: J,
287
- onMouseenter: q,
288
- onMouseleave: G
300
+ onBlur: te,
301
+ onFocus: ee,
302
+ onClick: Z,
303
+ onMouseenter: K,
304
+ onMouseleave: Q
289
305
  }, [
290
- U(t.$slots, "default", {}, void 0, !0)
306
+ j(t.$slots, "default", {}, void 0, !0)
291
307
  ], 544),
292
- (_(), ie(re, {
293
- to: D.value,
294
- disabled: !D.value
308
+ (O(), se(ue, {
309
+ to: L.value,
310
+ disabled: !L.value
295
311
  }, [
296
- O("div", {
312
+ k("div", {
297
313
  ref_key: "floatingRef",
298
- ref: s,
299
- class: V(X.value),
314
+ ref: i,
315
+ class: P(G.value),
300
316
  role: "tooltip",
301
- "aria-hidden": !l.value,
302
- onMouseenter: ee,
303
- onMouseleave: te
317
+ "aria-hidden": !r.value,
318
+ onMouseenter: oe,
319
+ onMouseleave: ne
304
320
  }, [
305
- n.title ? (_(), R("div", Oe, [
306
- O("h3", ke, j(n.title), 1),
307
- ae(he, {
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: oe
327
+ onClick: le
312
328
  })
313
- ])) : P("", !0),
314
- O("div", Te, [
315
- U(t.$slots, "tooltip-content", {}, () => [
316
- se(j(n.content), 1)
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 ? P("", !0) : (_(), R("div", {
335
+ n.hideArrow ? z("", !0) : (O(), $("div", {
320
336
  key: 1,
321
337
  ref_key: "arrowRef",
322
338
  ref: d,
323
- class: V(["rds-e-tooltip__tooltip-arrow", T.value])
339
+ class: P(["rds-e-tooltip__tooltip-arrow", T.value])
324
340
  }, null, 2))
325
- ], 42, _e)
341
+ ], 42, Oe)
326
342
  ], 8, ["to", "disabled"]))
327
- ], 8, ye));
343
+ ], 8, _e));
328
344
  }
329
- }), be = /* @__PURE__ */ we(Ce, [["__scopeId", "data-v-6d36e60d"]]);
345
+ }), Re = /* @__PURE__ */ ye(xe, [["__scopeId", "data-v-faf4bcdb"]]);
330
346
  export {
331
- be as default
347
+ Re as default
332
348
  };