energy-components 1.18.0 → 1.19.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 (28) hide show
  1. package/dist/components/breadcrumbs.es.js +32 -29
  2. package/dist/components/datepicker.es.js +1642 -1638
  3. package/dist/components/{floating-ui.vue-7LKzPqHI.js → floating-ui.vue-DWAG1g94.js} +3 -3
  4. package/dist/components/link.es.js +51 -49
  5. package/dist/components/popover.es.js +47 -47
  6. package/dist/components/sidebar.es.js +143 -59
  7. package/dist/components/style/breadcrumbs.css +1 -1
  8. package/dist/components/style/datepicker.css +1 -1
  9. package/dist/components/style/link.css +1 -1
  10. package/dist/components/style/modal.css +1 -1
  11. package/dist/components/style/overlay.css +1 -1
  12. package/dist/components/style/popover.css +1 -1
  13. package/dist/components/style/sidebar.css +1 -1
  14. package/dist/components/style/textField.css +1 -1
  15. package/dist/components/style/tooltip.css +1 -1
  16. package/dist/components/textField.es.js +28 -26
  17. package/dist/components/tooltip.es.js +135 -84
  18. package/dist/energy-components.es.js +4689 -4543
  19. package/dist/energy-components.umd.js +2 -2
  20. package/dist/style.css +1 -1
  21. package/dist/types/src/components/input/text-field/text-field.vue.d.ts +2 -0
  22. package/dist/types/src/components/layout/sidebar/sidebar.vue.d.ts +128 -3
  23. package/dist/types/src/components/navigation/breadcrumbs/breadcrumbs.vue.d.ts +18 -0
  24. package/dist/types/src/components/navigation/link/link.vue.d.ts +10 -6
  25. package/dist/types/src/components/overlay/popover/popover.vue.d.ts +2 -2
  26. package/dist/types/src/components/overlay/tooltip/tooltip.vue.d.ts +47 -2
  27. package/dist/types/tsconfig.tsbuildinfo +1 -1
  28. package/package.json +1 -1
@@ -1,11 +1,11 @@
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-arye8CV8.js";
4
- import { _ as U } from "./_plugin-vue_export-helper-CHgC5LLL.js";
5
- import './style/tooltip.css';const Z = ["id"], ee = {
1
+ import { defineComponent as J, toRefs as K, ref as r, computed as _, onBeforeUnmount as Q, createElementBlock as y, openBlock as c, createElementVNode as p, createBlock as Z, renderSlot as C, Teleport as ee, normalizeClass as M, createCommentVNode as D, unref as N, createVNode as te, toDisplayString as O, createTextVNode as oe, nextTick as le } from "vue";
2
+ import { a as ae, c as se, o as ie, f as re, s as ne, b as de, d as ue } from "./floating-ui.vue-DWAG1g94.js";
3
+ import { R as ce } from "./icon-svg-arye8CV8.js";
4
+ import { _ as pe } from "./_plugin-vue_export-helper-CHgC5LLL.js";
5
+ import './style/tooltip.css';const fe = ["id"], me = {
6
6
  key: 0,
7
7
  class: "rds-e-tooltip__header"
8
- }, te = { class: "rds-e-tooltip__title" }, oe = { class: "rds-e-tooltip__content" }, le = /* @__PURE__ */ E({
8
+ }, ve = { class: "rds-e-tooltip__title" }, he = { class: "rds-e-tooltip__content" }, _e = /* @__PURE__ */ J({
9
9
  __name: "tooltip",
10
10
  props: {
11
11
  /**
@@ -41,7 +41,6 @@ import './style/tooltip.css';const Z = ["id"], ee = {
41
41
  large: {
42
42
  type: Boolean,
43
43
  default: !1
44
- // Aquí se necesita aclaración, ya que en el original se menciona 'size: 'large'', pero no se define un default para 'large'
45
44
  },
46
45
  /**
47
46
  * <span>Especifica si el tooltip debe ocupar el ancho completo</span>
@@ -77,6 +76,27 @@ import './style/tooltip.css';const Z = ["id"], ee = {
77
76
  hideArrow: {
78
77
  type: Boolean,
79
78
  default: !1
79
+ },
80
+ /**
81
+ * <span>Delay (ms) para ocultar el tooltip tras abandonar el trigger o el propio tooltip. Máximo 3000ms.</span>
82
+ */
83
+ hideDelay: {
84
+ type: Number,
85
+ default: 0
86
+ },
87
+ /**
88
+ * <span>Actualiza la posición automáticamente en scroll/resize/mutaciones</span>
89
+ */
90
+ autoUpdate: {
91
+ type: Boolean,
92
+ default: !0
93
+ },
94
+ /**
95
+ * <span>Selector para teleport (ej: 'body', '#modal-container'). Si no se especifica se renderiza inline.</span>
96
+ */
97
+ teleportTo: {
98
+ type: String,
99
+ default: null
80
100
  }
81
101
  },
82
102
  emits: [
@@ -91,114 +111,145 @@ import './style/tooltip.css';const Z = ["id"], ee = {
91
111
  */
92
112
  "hide"
93
113
  ],
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(() => ({
114
+ setup(l, { expose: E, emit: H }) {
115
+ const a = l, n = H, { large: g, fullWidth: V, title: s, inverse: j } = K(a), d = r(), i = r(), f = r(), e = r(!0), T = r("");
116
+ let o = null, m = !1, v = !1, t = null;
117
+ const x = _(() => Math.min(Math.max(a.hideDelay, 0), 3e3)), I = _(() => ({
96
118
  "rds-e-tooltip__tooltip": !0,
97
119
  "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,
103
- n.value,
120
+ "rds-e-tooltip__tooltip--large": g.value,
121
+ "rds-e-tooltip__tooltip--inverse": j.value
122
+ })), w = async () => {
123
+ const { x: u, y: k, middlewareData: F, placement: B } = await se(
124
+ d.value,
125
+ i.value,
104
126
  {
105
- placement: s.placement,
127
+ placement: a.placement,
106
128
  middleware: [
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",
129
+ ie(a.offsetSpace),
130
+ re(),
131
+ ne(),
132
+ de({
133
+ apply({ availableHeight: Y, availableWidth: q, elements: G }) {
134
+ Object.assign(G.floating.style, {
135
+ maxWidth: V.value ? `${Math.max(0, q)}px` : "380px",
114
136
  width: "max-content",
115
- maxHeight: `${Math.max(0, T)}px`
137
+ maxHeight: `${Math.max(0, Y)}px`
116
138
  });
117
139
  }
118
140
  }),
119
- L({
120
- element: d.value,
121
- padding: u.value ? 16 : 8
141
+ ue({
142
+ element: f.value,
143
+ padding: g.value ? 16 : 8
122
144
  })
123
145
  ]
124
146
  }
125
147
  );
126
- Object.assign(n.value.style, {
127
- left: `${a}px`,
128
- top: `${y}px`
148
+ Object.assign(i.value.style, {
149
+ left: `${u}px`,
150
+ top: `${k}px`
129
151
  });
130
- const { x, y: w } = A.arrow, H = {
152
+ const { x: R, y: $ } = F.arrow, X = {
131
153
  left: "right",
132
154
  right: "left",
133
155
  bottom: "top",
134
156
  top: "bottom"
135
157
  };
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` : "",
158
+ T.value = `rds-e-tooltip__tooltip-arrow--${B}`, Object.assign(f.value.style, {
159
+ left: R != null ? `${R}px` : "",
160
+ top: $ != null ? `${$}px` : "",
139
161
  bottom: "",
140
162
  right: "",
141
- [H[g.split("-")[0]]]: "-4px"
163
+ [X[B.split("-")[0]]]: "-4px"
142
164
  });
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
- }));
165
+ }, U = () => {
166
+ clearTimeout(o), e.value ? e.value = !0 : (e.value = !0, n("hide"));
167
+ }, S = () => {
168
+ s != null && s.value || (e.value ? e.value = !0 : (e.value = !0, n("hide"))), clearTimeout(o);
149
169
  }, h = () => {
150
- e.value || (e.value = !0, r("hide"));
151
- }, j = () => {
152
- h();
170
+ a.suppressed || (clearTimeout(o), e.value = !1, n("show"), le(() => {
171
+ w(), a.autoUpdate && d.value && i.value && (t == null || t(), t = ae(
172
+ d.value,
173
+ i.value,
174
+ () => {
175
+ w();
176
+ }
177
+ ));
178
+ }));
179
+ }, W = () => {
180
+ v = !0, h();
181
+ }, z = () => {
182
+ v = !1, o = setTimeout(() => {
183
+ m || S();
184
+ }, x.value);
185
+ }, A = () => {
186
+ m = !0, clearTimeout(o);
187
+ }, L = () => {
188
+ m = !1, v || (o = setTimeout(() => {
189
+ S();
190
+ }, x.value));
191
+ }, b = () => {
192
+ e.value || (e.value = !0, n("hide"), t && (t(), t = null));
193
+ }, P = () => {
194
+ b();
153
195
  };
154
- return C({
155
- show: c,
156
- hide: h,
157
- isOpen: S(() => !e.value)
158
- }), (a, y) => (f(), p("div", {
196
+ return E({
197
+ show: h,
198
+ hide: b,
199
+ isOpen: _(() => !e.value)
200
+ }), Q(() => {
201
+ clearTimeout(o), t && (t(), t = null);
202
+ }), (u, k) => (c(), y("div", {
159
203
  id: l.id,
160
204
  class: "rds-e-tooltip"
161
205
  }, [
162
- i("div", {
206
+ p("div", {
163
207
  ref_key: "referenceRef",
164
- ref: m,
208
+ ref: d,
165
209
  class: "rds-e-tooltip__trigger",
166
- onBlur: v,
167
- onFocus: c,
168
- onMouseenter: c,
169
- onMouseleave: v
210
+ onBlur: U,
211
+ onFocus: h,
212
+ onMouseenter: W,
213
+ onMouseleave: z
170
214
  }, [
171
- k(a.$slots, "default", {}, void 0, !0)
215
+ C(u.$slots, "default", {}, void 0, !0)
172
216
  ], 544),
173
- i("div", {
174
- ref_key: "floatingRef",
175
- ref: n,
176
- class: R(O.value)
217
+ (c(), Z(ee, {
218
+ to: l.teleportTo,
219
+ disabled: !l.teleportTo
177
220
  }, [
178
- b(t) ? (f(), p("div", ee, [
179
- i("h3", te, B(b(t)), 1),
180
- P(Q, {
181
- name: "close",
182
- "aria-hidden": "true",
183
- class: "rds-e-tooltip__icon",
184
- onClick: j
185
- })
186
- ])) : $("", !0),
187
- i("div", oe, [
188
- k(a.$slots, "tooltip-content", {}, () => [
189
- F(B(l.content), 1)
190
- ], !0)
191
- ]),
192
- l.hideArrow ? $("", !0) : (f(), p("div", {
193
- key: 1,
194
- ref_key: "arrowRef",
195
- ref: d,
196
- class: R(["rds-e-tooltip__tooltip-arrow", _.value])
197
- }, null, 2))
198
- ], 2)
199
- ], 8, Z));
221
+ p("div", {
222
+ ref_key: "floatingRef",
223
+ ref: i,
224
+ class: M(I.value),
225
+ onMouseenter: A,
226
+ onMouseleave: L
227
+ }, [
228
+ N(s) ? (c(), y("div", me, [
229
+ p("h3", ve, O(N(s)), 1),
230
+ te(ce, {
231
+ name: "close",
232
+ "aria-hidden": "true",
233
+ class: "rds-e-tooltip__icon",
234
+ onClick: P
235
+ })
236
+ ])) : D("", !0),
237
+ p("div", he, [
238
+ C(u.$slots, "tooltip-content", {}, () => [
239
+ oe(O(l.content), 1)
240
+ ], !0)
241
+ ]),
242
+ l.hideArrow ? D("", !0) : (c(), y("div", {
243
+ key: 1,
244
+ ref_key: "arrowRef",
245
+ ref: f,
246
+ class: M(["rds-e-tooltip__tooltip-arrow", T.value])
247
+ }, null, 2))
248
+ ], 34)
249
+ ], 8, ["to", "disabled"]))
250
+ ], 8, fe));
200
251
  }
201
- }), ne = /* @__PURE__ */ U(le, [["__scopeId", "data-v-41d4edc5"]]);
252
+ }), we = /* @__PURE__ */ pe(_e, [["__scopeId", "data-v-5a12657d"]]);
202
253
  export {
203
- ne as default
254
+ we as default
204
255
  };