energy-components 1.6.0-beta.1 → 1.6.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 (50) hide show
  1. package/dist/components/accordion.es.js +13 -13
  2. package/dist/components/button.es.js +11 -11
  3. package/dist/components/checkbox.es.js +7 -7
  4. package/dist/components/dropdown.es.js +278 -148
  5. package/dist/components/filterChip.es.js +4 -4
  6. package/dist/components/{icon-svg-pUb3-FXk.js → icon-svg-DGp2yHJn.js} +1 -1
  7. package/dist/components/iconList.es.js +5 -5
  8. package/dist/components/iconSvg.es.js +1 -1
  9. package/dist/components/index.es.js +62 -59
  10. package/dist/components/infoBox.es.js +17 -17
  11. package/dist/components/link.es.js +15 -15
  12. package/dist/components/modal.es.js +69 -39
  13. package/dist/components/multiselect.es.js +230 -184
  14. package/dist/components/multiselectcontentwrapper.es.js +140 -0
  15. package/dist/components/pagination.es.js +118 -86
  16. package/dist/components/persistentToast.es.js +9 -9
  17. package/dist/components/quantitySelector.es.js +9 -9
  18. package/dist/components/radioButton.es.js +16 -16
  19. package/dist/components/selectionChip.es.js +5 -5
  20. package/dist/components/sidedrawer.es.js +36 -28
  21. package/dist/components/style/datepicker.css +1 -1
  22. package/dist/components/style/dropdown.css +1 -1
  23. package/dist/components/style/modal.css +1 -1
  24. package/dist/components/style/multiselect.css +1 -1
  25. package/dist/components/style/multiselectcontentwrapper.css +1 -0
  26. package/dist/components/style/pagination.css +1 -1
  27. package/dist/components/style/sidedrawer.css +1 -1
  28. package/dist/components/style/tablepaginatedcomponent.css +1 -1
  29. package/dist/components/style/tableslotedcomponent.css +1 -1
  30. package/dist/components/style/textField.css +1 -1
  31. package/dist/components/switch.es.js +10 -10
  32. package/dist/components/tabBar.es.js +12 -12
  33. package/dist/components/tablepaginatedcomponent.es.js +55 -53
  34. package/dist/components/tableslotedcomponent.es.js +155 -148
  35. package/dist/components/tag.es.js +5 -5
  36. package/dist/components/textArea.es.js +22 -22
  37. package/dist/components/textField.es.js +93 -84
  38. package/dist/components/tooltip.es.js +61 -61
  39. package/dist/energy-components.es.js +6576 -6073
  40. package/dist/energy-components.umd.js +1 -1
  41. package/dist/style.css +1 -1
  42. package/dist/types/src/components/index.d.ts +1 -0
  43. package/dist/types/src/components/input/dropdown/Multiselect/MultiselectContentWrapper.vue.d.ts +86 -0
  44. package/dist/types/src/components/input/dropdown/dropdown.vue.d.ts +582 -0
  45. package/dist/types/src/components/input/text-field/text-field.vue.d.ts +10 -3
  46. package/dist/types/src/components/layout/sidedrawer/sidedrawer.vue.d.ts +15 -0
  47. package/dist/types/src/components/navigation/pagination/pagination.vue.d.ts +63 -31
  48. package/dist/types/src/components/overlay/modal/modal.vue.d.ts +27 -1
  49. package/dist/types/tsconfig.tsbuildinfo +1 -1
  50. package/package.json +3 -3
@@ -1,10 +1,10 @@
1
- import { defineComponent as y, mergeModels as c, useModel as g, ref as r, onMounted as B, onBeforeUnmount as S, openBlock as d, createElementBlock as u, normalizeClass as V, createElementVNode as m, renderSlot as p, createTextVNode as x, toDisplayString as E, createBlock as _, createCommentVNode as f } from "vue";
2
- import { I as C } from "./icon-svg-pUb3-FXk.js";
1
+ import { defineComponent as y, mergeModels as c, useModel as g, ref as r, onMounted as S, onBeforeUnmount as B, openBlock as d, createElementBlock as u, normalizeClass as V, createElementVNode as m, renderSlot as p, createTextVNode as x, toDisplayString as E, createBlock as _, createCommentVNode as f } from "vue";
2
+ import { R as C } from "./icon-svg-DGp2yHJn.js";
3
3
  import { _ as M } from "./_plugin-vue_export-helper-CHgC5LLL.js";
4
- import './style/switch.css';const N = ["id", "disabled", "checked"], L = ["for", "aria-label"], D = {
4
+ import './style/switch.css';const N = ["id", "disabled", "checked"], D = ["for", "aria-label"], L = {
5
5
  key: 0,
6
6
  class: "rds-e-switch__label-text"
7
- }, I = /* @__PURE__ */ y({
7
+ }, F = /* @__PURE__ */ y({
8
8
  __name: "switch",
9
9
  props: /* @__PURE__ */ c({
10
10
  /**
@@ -58,9 +58,9 @@ import './style/switch.css';const N = ["id", "disabled", "checked"], L = ["for",
58
58
  const n = t.target.checked;
59
59
  a.value = n, w("update:checked", n);
60
60
  };
61
- return B(() => {
61
+ return S(() => {
62
62
  window.addEventListener("keydown", s), window.addEventListener("mousedown", i);
63
- }), S(() => {
63
+ }), B(() => {
64
64
  window.removeEventListener("keydown", s), window.removeEventListener("mousedown", i);
65
65
  }), (t, n) => (d(), u("div", {
66
66
  class: V(["rds-e-switch", { "rds-e-switch--focused": l.value }])
@@ -80,7 +80,7 @@ import './style/switch.css';const N = ["id", "disabled", "checked"], L = ["for",
80
80
  for: e.id.toString(),
81
81
  "aria-label": e.label
82
82
  }, [
83
- e.label || t.$slots["text-label"] ? (d(), u("span", D, [
83
+ e.label || t.$slots["text-label"] ? (d(), u("span", L, [
84
84
  p(t.$slots, "text-label", {}, () => [
85
85
  x(E(e.label), 1)
86
86
  ], !0),
@@ -91,10 +91,10 @@ import './style/switch.css';const N = ["id", "disabled", "checked"], L = ["for",
91
91
  "aria-hidden": "true"
92
92
  }, null, 8, ["name"])) : f("", !0)
93
93
  ])) : f("", !0)
94
- ], 8, L)
94
+ ], 8, D)
95
95
  ], 2));
96
96
  }
97
- }), $ = /* @__PURE__ */ M(I, [["__scopeId", "data-v-be80169d"]]);
97
+ }), T = /* @__PURE__ */ M(F, [["__scopeId", "data-v-be80169d"]]);
98
98
  export {
99
- $ as default
99
+ T as default
100
100
  };
@@ -1,5 +1,5 @@
1
- import { defineComponent as N, mergeModels as B, toRefs as W, useModel as K, ref as m, computed as h, onMounted as $, nextTick as D, onUnmounted as F, watch as L, openBlock as s, createElementBlock as d, normalizeClass as u, createVNode as S, createCommentVNode as g, createElementVNode as f, Fragment as q, renderList as H, unref as O, withKeys as V, withModifiers as A, createBlock as P, createTextVNode as U, toDisplayString as j, renderSlot as G } from "vue";
2
- import { I as w } from "./icon-svg-pUb3-FXk.js";
1
+ import { defineComponent as N, mergeModels as B, toRefs as W, useModel as D, ref as m, computed as h, onMounted as K, nextTick as $, onUnmounted as F, watch as L, openBlock as s, createElementBlock as d, normalizeClass as u, createVNode as R, createCommentVNode as g, createElementVNode as f, Fragment as q, renderList as H, unref as O, withKeys as S, withModifiers as V, createBlock as P, createTextVNode as U, toDisplayString as j, renderSlot as G } from "vue";
2
+ import { R as w } from "./icon-svg-DGp2yHJn.js";
3
3
  import { d as J } from "./functions-DIHwdgF0.js";
4
4
  import { _ as Q } from "./_plugin-vue_export-helper-CHgC5LLL.js";
5
5
  import './style/tabBar.css';const X = ["aria-selected", "tabindex", "onClick", "onKeydown"], Y = { class: "rds-e-top-bar__item-title" }, Z = {
@@ -62,9 +62,9 @@ import './style/tabBar.css';const X = ["aria-selected", "tabindex", "onClick", "
62
62
  }),
63
63
  emits: /* @__PURE__ */ B(["activeTabChanged"], ["update:activeTab"]),
64
64
  setup(o, { emit: v }) {
65
- const i = o, M = v, {
65
+ const i = o, A = v, {
66
66
  options: r
67
- } = W(i), R = K(o, "activeTab"), a = m(""), b = m(null), l = m(null);
67
+ } = W(i), M = D(o, "activeTab"), a = m(""), b = m(null), l = m(null);
68
68
  let p = [];
69
69
  const y = h(() => l.value ? l.value.scrollWidth > l.value.clientWidth : !1), z = h(() => r.value.findIndex((t) => t.id === a.value) > 0 && y.value), E = h(() => l.value ? r.value.findIndex((t) => t.id === a.value) < i.options.length - 1 && y.value : !1), k = (e) => {
70
70
  const t = i.options.find((n) => n.id === a.value);
@@ -92,15 +92,15 @@ import './style/tabBar.css';const X = ["aria-selected", "tabindex", "onClick", "
92
92
  const C = () => {
93
93
  T(a.value);
94
94
  };
95
- return $(async () => {
96
- await D(), b.value && (p = Array.from(
95
+ return K(async () => {
96
+ await $(), b.value && (p = Array.from(
97
97
  b.value.children
98
98
  )), a.value = i.options[0].id ?? "", window.addEventListener("resize", J(C, 200));
99
99
  }), F(() => {
100
100
  window.removeEventListener("resize", C);
101
101
  }), L(a, (e) => {
102
- T(e), M("activeTabChanged", k(!1));
103
- }), L(R, (e) => c(e)), (e, t) => (s(), d("div", {
102
+ T(e), A("activeTabChanged", k(!1));
103
+ }), L(M, (e) => c(e)), (e, t) => (s(), d("div", {
104
104
  class: u(["rds-e-top-bar", {
105
105
  "rds-e-top-bar--fluid": o.fluid,
106
106
  "rds-e-top-bar--divider": o.divider
@@ -114,7 +114,7 @@ import './style/tabBar.css';const X = ["aria-selected", "tabindex", "onClick", "
114
114
  ]),
115
115
  onClick: x
116
116
  }, [
117
- S(w, {
117
+ R(w, {
118
118
  class: "rds-e-top-bar__icon",
119
119
  name: "arrow_left"
120
120
  })
@@ -140,8 +140,8 @@ import './style/tabBar.css';const X = ["aria-selected", "tabindex", "onClick", "
140
140
  tabindex: a.value === n.id ? 0 : -1,
141
141
  onClick: (te) => c(n.id),
142
142
  onKeydown: [
143
- V(A(x, ["prevent"]), ["left"]),
144
- V(A(I, ["prevent"]), ["right"])
143
+ S(V(x, ["prevent"]), ["left"]),
144
+ S(V(I, ["prevent"]), ["right"])
145
145
  ]
146
146
  }, [
147
147
  f("span", Y, [
@@ -163,7 +163,7 @@ import './style/tabBar.css';const X = ["aria-selected", "tabindex", "onClick", "
163
163
  ]),
164
164
  onClick: I
165
165
  }, [
166
- S(w, {
166
+ R(w, {
167
167
  class: "rds-e-top-bar__icon",
168
168
  name: "arrow_right"
169
169
  })
@@ -1,6 +1,6 @@
1
- import { defineComponent as H, toRefs as $, ref as s, watch as M, watchEffect as N, openBlock as c, createElementBlock as g, Fragment as V, renderList as h, unref as S, renderSlot as v, createBlock as K, mergeProps as z, createSlots as B, withCtx as C, normalizeProps as w, guardReactiveProps as A, withDirectives as F, createVNode as q, vShow as G } from "vue";
2
- import J from "./tableslotedcomponent.es.js";
3
- import Q from "./pagination.es.js";
1
+ import { defineComponent as H, toRefs as M, ref as i, watch as N, watchEffect as V, openBlock as u, createElementBlock as g, Fragment as K, renderList as v, unref as k, renderSlot as h, createBlock as z, mergeProps as F, createSlots as S, withCtx as B, normalizeProps as C, guardReactiveProps as w, withDirectives as q, createVNode as G, vShow as J } from "vue";
2
+ import Q from "./tableslotedcomponent.es.js";
3
+ import U from "./pagination.es.js";
4
4
  import { _ as W } from "./_plugin-vue_export-helper-CHgC5LLL.js";
5
5
  import './style/tablepaginatedcomponent.css';const X = { class: "table_paginated__container" }, Y = /* @__PURE__ */ H({
6
6
  __name: "TablePaginatedComponent",
@@ -28,21 +28,21 @@ import './style/tablepaginatedcomponent.css';const X = { class: "table_paginated
28
28
  asynchrone: { type: Boolean, default: !0 },
29
29
  jumpTo: { type: Boolean, default: !1 }
30
30
  },
31
- emits: ["onUpdate:options", "onUpdate:reset", "onUpdate:selection", "onUpdate:selectedAll", "onUpdate:sort", "onItemExpansion"],
32
- setup(E, { expose: U, emit: _ }) {
33
- const t = E, d = _, {
31
+ emits: ["update:options", "update:reset", "update:selection", "update:selectedAll", "update:sort", "onItemExpansion"],
32
+ setup(A, { expose: E, emit: _ }) {
33
+ const t = A, s = _, {
34
34
  loading: I,
35
- items: o,
36
- selectableKey: D,
37
- header: O,
35
+ items: d,
36
+ selectableKey: $,
37
+ header: D,
38
38
  asynchrone: P
39
- } = $(t), m = s(), r = s([]), l = s([]), y = s({
39
+ } = M(t), c = i(), p = i([]), o = i([]), y = i({
40
40
  item: {
41
- header: O,
42
- items: r
41
+ header: D,
42
+ items: p
43
43
  },
44
- selectableKey: D,
45
- listChecked: l,
44
+ selectableKey: $,
45
+ listChecked: o,
46
46
  checkedAll: t.checkedAll,
47
47
  initChecked: [],
48
48
  variant: t.variant,
@@ -52,65 +52,66 @@ import './style/tablepaginatedcomponent.css';const X = { class: "table_paginated
52
52
  hideSelectAll: t.hideSelectAll,
53
53
  showEmptyState: t.showEmptyState,
54
54
  mockItems: t.itemsPerPage[0]
55
- }), b = s(null), u = s(1), p = s(), T = () => {
56
- o.value = [], r.value = [], u.value = 1, d("onUpdate:reset");
57
- }, k = () => {
58
- p.value && (r.value = o.value);
55
+ }), b = i(null), m = i(1), r = i(), O = () => {
56
+ p.value = [], m.value = 1, r.value = void 0, s("update:reset");
57
+ }, T = () => {
58
+ p.value = d.value;
59
59
  }, j = (e) => {
60
60
  const a = {};
61
61
  if ("pagination" in e) {
62
- e.pagination.reset && T();
63
- let n = !1;
64
- p.value = e.pagination, e.pagination.page > u.value && (u.value = e.pagination.page, n = !0), p.value && (p.value.isNewPage = n), k();
62
+ const n = e.pagination;
63
+ n.reset && O();
64
+ let l = !1;
65
+ r.value = n, (n.page ?? 0) > m.value && (m.value = n.page ?? 0, l = !0), r.value && (r.value.isNewPage = l);
65
66
  }
66
- Object.assign(a, p.value), m.value && m.value.clearVisibleDetails(), d("onUpdate:options", a);
67
+ r.value && Object.assign(a, r.value), c.value && c.value.clearVisibleDetails(), s("update:options", a);
67
68
  }, x = (e) => {
68
- const a = l.value.indexOf(e);
69
- a > -1 ? l.value.splice(a, 1) : l.value.push(e), d("onUpdate:selection", l.value);
69
+ const a = o.value.indexOf(e);
70
+ a > -1 ? o.value.splice(a, 1) : o.value.push(e), s("update:selection", o.value);
70
71
  }, L = () => {
71
72
  var e;
72
73
  (e = b.value) == null || e.resetPagination();
73
74
  }, R = (e) => {
74
- e && (l.value = []), y.value.checkedAll = e, d("onUpdate:selectedAll", e);
75
+ e && (o.value = []), y.value.checkedAll = e, s("update:selectedAll", e);
75
76
  };
76
- return l.value = [...t.initChecked], P.value || (r.value = o.value), M(o, () => {
77
- k();
78
- }), N(() => {
79
- if (!P.value && o.value.length > 0) {
77
+ return o.value = [...t.initChecked], P.value || (p.value = d.value), N(d, () => {
78
+ T();
79
+ }, { deep: !0 }), V(() => {
80
+ if (!P.value && d.value.length >= 0) {
80
81
  const e = (t.activePage - 1) * t.itemsPerPage[0], a = e + t.itemsPerPage[0];
81
- r.value = o.value.slice(e, a);
82
+ p.value = d.value.slice(e, a);
82
83
  }
83
- }), U({
84
+ }), E({
84
85
  /** Fuerza a refrescar la paginacion y la tabla */
85
86
  $reset: L
86
- }), (e, a) => (c(), g("div", X, [
87
- e.$slots.mobile && e.isMobileDevice ? (c(!0), g(V, { key: 0 }, h(S(o), (n, i) => (c(), g("div", {
88
- key: `mobile-${i}`,
87
+ }), (e, a) => (u(), g("div", X, [
88
+ e.$slots.mobile && e.isMobileDevice ? (u(!0), g(K, { key: 0 }, v(k(d), (n, l) => (u(), g("div", {
89
+ key: `mobile-${l}`,
89
90
  class: "table_paginted__mobile_item"
90
91
  }, [
91
- v(e.$slots, "mobile", { item: n }, void 0, !0)
92
- ]))), 128)) : (c(), K(J, z({
92
+ h(e.$slots, "mobile", { item: n }, void 0, !0)
93
+ ]))), 128)) : (u(), z(Q, F({
93
94
  key: 1,
94
95
  ref_key: "tableSloted",
95
- ref: m,
96
+ ref: c,
96
97
  class: "mb-5"
97
98
  }, y.value, {
98
- loading: S(I),
99
+ loading: k(I),
99
100
  "is-mobile-device": e.isMobileDevice,
100
101
  "items-expanded": e.itemsExpanded,
101
102
  onOnClickCheckbox: x,
102
103
  onSelectAll: R,
103
- onOnItemExpansion: a[0] || (a[0] = (n) => d("onItemExpansion", n)),
104
- onOnHeaderSort: a[1] || (a[1] = (n) => d("onUpdate:sort", n))
105
- }), B({ _: 2 }, [
106
- h(e.$slots, (n, i) => ({
107
- name: i,
108
- fn: C((f) => [
109
- v(e.$slots, i, w(A(f || {})), void 0, !0)
104
+ onOnItemExpansion: a[0] || (a[0] = (n) => s("onItemExpansion", n)),
105
+ onOnHeaderSort: a[1] || (a[1] = (n) => s("update:sort", n))
106
+ }), S({ _: 2 }, [
107
+ v(e.$slots, (n, l) => ({
108
+ name: l,
109
+ fn: B((f) => [
110
+ h(e.$slots, l, C(w(f || {})), void 0, !0)
110
111
  ])
111
112
  }))
112
113
  ]), 1040, ["loading", "is-mobile-device", "items-expanded"])),
113
- F(q(Q, {
114
+ q(G(U, {
114
115
  ref_key: "paginationComponentRef",
115
116
  ref: b,
116
117
  class: "rds-mt-16",
@@ -119,20 +120,21 @@ import './style/tablepaginatedcomponent.css';const X = { class: "table_paginated
119
120
  "items-per-page": t.itemsPerPage[0],
120
121
  "hide-leyend": t.hideLeyend,
121
122
  "jump-to": t.jumpTo,
123
+ selected: !0,
122
124
  onPageChanged: a[2] || (a[2] = (n) => j({ pagination: n }))
123
- }, B({ _: 2 }, [
124
- h(e.$slots, (n, i) => ({
125
- name: i,
126
- fn: C((f) => [
127
- v(e.$slots, i, w(A(f || {})), void 0, !0)
125
+ }, S({ _: 2 }, [
126
+ v(e.$slots, (n, l) => ({
127
+ name: l,
128
+ fn: B((f) => [
129
+ h(e.$slots, l, C(w(f || {})), void 0, !0)
128
130
  ])
129
131
  }))
130
132
  ]), 1032, ["total-items", "current-page", "items-per-page", "hide-leyend", "jump-to"]), [
131
- [G, !e.hidePagination]
133
+ [J, !e.hidePagination]
132
134
  ])
133
135
  ]));
134
136
  }
135
- }), ne = /* @__PURE__ */ W(Y, [["__scopeId", "data-v-1f80ff40"]]);
137
+ }), ne = /* @__PURE__ */ W(Y, [["__scopeId", "data-v-4d909f61"]]);
136
138
  export {
137
139
  ne as default
138
140
  };