energy-components 1.10.0-beta.0 → 1.10.1

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 (62) hide show
  1. package/dist/components/accordion.es.js +1 -1
  2. package/dist/components/avatar.es.js +1 -1
  3. package/dist/components/breadcrumbs.es.js +22 -21
  4. package/dist/components/button.es.js +56 -48
  5. package/dist/components/checkbox.es.js +1 -1
  6. package/dist/components/directAccess.es.js +1 -1
  7. package/dist/components/dragAndDrop.es.js +1 -1
  8. package/dist/components/dropdown.es.js +19 -18
  9. package/dist/components/fileUploadItem.es.js +1 -1
  10. package/dist/components/filterChip.es.js +1 -1
  11. package/dist/components/{icon-svg-YXBqzlJN.js → icon-svg-DuzOdbk1.js} +4360 -2853
  12. package/dist/components/iconList.es.js +1 -1
  13. package/dist/components/iconSvg.es.js +1 -1
  14. package/dist/components/index.es.js +1 -1
  15. package/dist/components/infoBox.es.js +1 -1
  16. package/dist/components/link.es.js +60 -48
  17. package/dist/components/modal.es.js +1 -1
  18. package/dist/components/multiselectcontentwrapper.es.js +25 -22
  19. package/dist/components/pagination.es.js +129 -80
  20. package/dist/components/persistentToast.es.js +1 -1
  21. package/dist/components/progressBar.es.js +1 -1
  22. package/dist/components/quantitySelector.es.js +1 -1
  23. package/dist/components/radioButton.es.js +1 -1
  24. package/dist/components/selectionChip.es.js +1 -1
  25. package/dist/components/sidedrawer.es.js +48 -43
  26. package/dist/components/style/actionButton.css +1 -1
  27. package/dist/components/style/breadcrumbs.css +1 -1
  28. package/dist/components/style/button.css +1 -1
  29. package/dist/components/style/dropdown.css +1 -1
  30. package/dist/components/style/floatingActionButton.css +1 -1
  31. package/dist/components/style/link.css +1 -1
  32. package/dist/components/style/multiselect.css +1 -1
  33. package/dist/components/style/multiselectcontentwrapper.css +1 -1
  34. package/dist/components/style/pagination.css +1 -1
  35. package/dist/components/style/selectionChip.css +1 -1
  36. package/dist/components/style/sidedrawer.css +1 -1
  37. package/dist/components/style/tabBar.css +1 -1
  38. package/dist/components/style/tag.css +1 -1
  39. package/dist/components/style/textField.css +1 -1
  40. package/dist/components/switch.es.js +1 -1
  41. package/dist/components/tabBar.es.js +95 -84
  42. package/dist/components/tableslotedcomponent.es.js +1 -1
  43. package/dist/components/tag.es.js +15 -15
  44. package/dist/components/textArea.es.js +1 -1
  45. package/dist/components/textField.es.js +64 -53
  46. package/dist/components/tooltip.es.js +293 -295
  47. package/dist/energy-components.es.js +8274 -6668
  48. package/dist/energy-components.umd.js +2 -2
  49. package/dist/style.css +1 -1
  50. package/dist/types/src/components/buttons/button/button.vue.d.ts +15 -0
  51. package/dist/types/src/components/feedback/indicator/indicator.vue.d.ts +1 -1
  52. package/dist/types/src/components/input/drag-and-drop/drag-and-drop.vue.d.ts +1 -1
  53. package/dist/types/src/components/input/dropdown/Multiselect/MultiselectContentWrapper.vue.d.ts +9 -2
  54. package/dist/types/src/components/input/dropdown/dropdown.vue.d.ts +4 -4
  55. package/dist/types/src/components/input/quantity-selector/quantity-selector.vue.d.ts +1 -1
  56. package/dist/types/src/components/input/text-field/text-field.vue.d.ts +17 -0
  57. package/dist/types/src/components/layout/sidedrawer/sidedrawer.vue.d.ts +7 -5
  58. package/dist/types/src/components/navigation/link/link.vue.d.ts +15 -0
  59. package/dist/types/src/components/navigation/pagination/pagination.vue.d.ts +29 -0
  60. package/dist/types/src/setupTests.d.ts +1 -0
  61. package/dist/types/tsconfig.tsbuildinfo +1 -1
  62. package/package.json +5 -3
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as p, ref as a, computed as v, createElementBlock as s, openBlock as i, Fragment as u, withDirectives as f, createElementVNode as r, vModelText as C, renderList as L, normalizeClass as x, createVNode as g, toDisplayString as h } from "vue";
2
- import { i as m, R as k } from "./icon-svg-YXBqzlJN.js";
2
+ import { i as m, R as k } from "./icon-svg-DuzOdbk1.js";
3
3
  import { _ as w } from "./_plugin-vue_export-helper-CHgC5LLL.js";
4
4
  import './style/iconList.css';const y = { class: "rds-e-icon-list" }, D = ["onClick"], N = /* @__PURE__ */ p({
5
5
  __name: "icon-list",
@@ -1,4 +1,4 @@
1
- import { R as a } from "./icon-svg-YXBqzlJN.js";
1
+ import { R as a } from "./icon-svg-DuzOdbk1.js";
2
2
  import "./_plugin-vue_export-helper-CHgC5LLL.js";
3
3
  export {
4
4
  a as default
@@ -1,4 +1,4 @@
1
- import { R as i } from "./icon-svg-YXBqzlJN.js";
1
+ import { R as i } from "./icon-svg-DuzOdbk1.js";
2
2
  import a from "./button.es.js";
3
3
  import e from "./floatingActionButton.es.js";
4
4
  import m from "./actionButton.es.js";
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as k, ref as u, toRefs as h, computed as $, watch as w, nextTick as S, createElementBlock as t, openBlock as s, normalizeClass as m, createElementVNode as a, createCommentVNode as o, createVNode as b, toDisplayString as r, renderSlot as v } from "vue";
2
- import { R as _ } from "./icon-svg-YXBqzlJN.js";
2
+ import { R as _ } from "./icon-svg-DuzOdbk1.js";
3
3
  import { _ as C } from "./_plugin-vue_export-helper-CHgC5LLL.js";
4
4
  import './style/infoBox.css';const q = { class: "alert" }, B = {
5
5
  key: 0,
@@ -1,7 +1,7 @@
1
- import { defineComponent as E, toRefs as L, computed as c, createBlock as p, openBlock as o, resolveDynamicComponent as N, unref as e, normalizeStyle as V, normalizeClass as _, withCtx as $, createCommentVNode as i, createElementBlock as b, mergeProps as k, renderSlot as B, createTextVNode as I, toDisplayString as D } from "vue";
2
- import { R as v } from "./icon-svg-YXBqzlJN.js";
3
- import { _ as M } from "./_plugin-vue_export-helper-CHgC5LLL.js";
4
- import './style/link.css';const O = /* @__PURE__ */ E({
1
+ import { defineComponent as L, toRefs as N, computed as f, createBlock as p, openBlock as s, resolveDynamicComponent as V, unref as e, normalizeStyle as $, normalizeClass as _, withCtx as M, createCommentVNode as d, createElementBlock as I, mergeProps as k, renderSlot as D, createTextVNode as R, toDisplayString as j } from "vue";
2
+ import { R as v } from "./icon-svg-DuzOdbk1.js";
3
+ import { _ as O } from "./_plugin-vue_export-helper-CHgC5LLL.js";
4
+ import './style/link.css';const P = /* @__PURE__ */ L({
5
5
  __name: "link",
6
6
  props: {
7
7
  /**
@@ -23,7 +23,7 @@ import './style/link.css';const O = /* @__PURE__ */ E({
23
23
  icon: {
24
24
  type: Object,
25
25
  default: () => ({ name: "", modifier: "" }),
26
- validator: (s) => typeof s.name == "string" && (s.modifier === void 0 || typeof s.modifier == "string") ? !0 : (console.error("El icono debe tener una propiedad name de tipo string y una propiedad modifier opcional de tipo string"), !1)
26
+ validator: (o) => typeof o.name == "string" && (o.modifier === void 0 || typeof o.modifier == "string") ? !0 : (console.error("El icono debe tener una propiedad name de tipo string y una propiedad modifier opcional de tipo string"), !1)
27
27
  },
28
28
  /**
29
29
  * <span>Tag del link</span>
@@ -60,6 +60,13 @@ import './style/link.css';const O = /* @__PURE__ */ E({
60
60
  type: Boolean,
61
61
  default: !1
62
62
  },
63
+ /**
64
+ * <span>Indica si la flecha del link debe ser pequeña</span>
65
+ */
66
+ arrowSmall: {
67
+ type: Boolean,
68
+ default: !1
69
+ },
63
70
  /**
64
71
  * <span>Indica si el icono esta a la derecha</span>
65
72
  */
@@ -82,42 +89,45 @@ import './style/link.css';const O = /* @__PURE__ */ E({
82
89
  default: ""
83
90
  }
84
91
  },
85
- setup(s) {
86
- const y = s, {
87
- text: g,
88
- to: w,
92
+ setup(o) {
93
+ const y = o, {
94
+ text: w,
95
+ to: g,
89
96
  icon: r,
90
97
  tag: u,
91
- disabled: f,
98
+ disabled: i,
92
99
  inverse: m,
93
- arrow: d,
100
+ arrow: c,
94
101
  right: t,
95
102
  underline: h,
96
- customClass: R,
97
- color: l
98
- } = L(y), j = c(() => l.value ? { color: l.value } : void 0), z = c(() => {
99
- var n, C;
103
+ customClass: b,
104
+ color: l,
105
+ arrowSmall: x
106
+ } = N(y), z = f(() => l.value ? { color: l.value } : void 0), E = f(() => {
107
+ var n, B;
100
108
  const a = ["rds-e-link"];
101
- return m.value && a.push("rds-e-link--inverse"), h.value && a.push("rds-e-link--underline"), f.value && a.push("rds-e-style-state-disabled"), ((n = r == null ? void 0 : r.value) == null ? void 0 : n.name) !== "arrow" && a.push("rds-e-arrow-link"), ((C = r == null ? void 0 : r.value) == null ? void 0 : C.name) !== "arrow" && m.value && a.push("rds-e-arrow-link__icon--inverse"), a.join(" ");
102
- }), S = c(() => {
109
+ return m.value && a.push("rds-e-link--inverse"), h.value && a.push("rds-e-link--underline"), i.value && a.push("rds-e-style-state-disabled"), ((n = r == null ? void 0 : r.value) == null ? void 0 : n.name) !== "arrow" && a.push("rds-e-arrow-link"), ((B = r == null ? void 0 : r.value) == null ? void 0 : B.name) !== "arrow" && m.value && a.push("rds-e-arrow-link__icon--inverse"), b.value === "rds-e-breadcrumbs__link--text" && a.push("rds-e-link__breadcrumbs"), a.join(" ");
110
+ }), S = f(() => {
103
111
  var n;
104
112
  const a = ["rds-e-arrow-link__icon--arrow"];
105
- return r != null && r.value && (a.push("rds-e-arrow-link__icon"), f.value && a.push("rds-e-arrow-link__icon--disabled")), ((n = r == null ? void 0 : r.value) == null ? void 0 : n.name) !== "arrow" && m.value && a.push("rds-e-arrow-link__icon--inverse"), a.push(
113
+ return r != null && r.value && (a.push("rds-e-arrow-link__icon"), i.value && a.push("rds-e-arrow-link__icon--disabled")), ((n = r == null ? void 0 : r.value) == null ? void 0 : n.name) !== "arrow" && m.value && a.push("rds-e-arrow-link__icon--inverse"), a.push(
106
114
  t.value ? "rds-e-arrow-link__icon--animation-right" : "rds-e-arrow-link__icon--animation-left"
107
115
  ), a.join(" ");
108
- }), x = c(() => {
116
+ }), C = f(() => {
109
117
  var a;
110
- return d.value || ((a = r == null ? void 0 : r.value) == null ? void 0 : a.name);
118
+ return c.value || ((a = r == null ? void 0 : r.value) == null ? void 0 : a.name);
111
119
  });
112
- return (a, n) => (o(), p(N(e(u) === "a" ? e(u) : "router-link"), {
113
- class: _(z.value),
114
- to: e(u) === "router-link" ? e(w) : null,
115
- href: e(u) === "a" ? e(w) : null,
116
- disable: e(f),
117
- style: V(j.value)
120
+ return (a, n) => (s(), p(V(e(u) === "a" ? e(u) : "router-link"), {
121
+ class: _(E.value),
122
+ to: e(u) === "router-link" ? e(g) : null,
123
+ href: e(u) === "a" ? e(g) : null,
124
+ disable: e(i),
125
+ style: $(z.value),
126
+ tabindex: e(i) ? -1 : void 0,
127
+ "aria-disabled": e(i)
118
128
  }, {
119
- default: $(() => [
120
- e(r).name && !e(t) && !e(d) ? (o(), p(v, k({
129
+ default: M(() => [
130
+ e(r).name && !e(t) && !e(c) ? (s(), p(v, k({
121
131
  key: 0,
122
132
  name: e(r).name
123
133
  }, {
@@ -125,46 +135,48 @@ import './style/link.css';const O = /* @__PURE__ */ E({
125
135
  }, {
126
136
  class: ["rds-e-link__icon-left", S.value],
127
137
  style: e(l) ? { color: e(l) } : void 0
128
- }), null, 16, ["name", "class", "style"])) : i("", !0),
129
- e(t) ? (o(), b("span", {
138
+ }), null, 16, ["name", "class", "style"])) : d("", !0),
139
+ e(t) ? (s(), I("span", {
130
140
  key: 1,
131
- class: _(["rds-e-link__text", [e(R), {
132
- "rds-e-mr-xs": x.value,
141
+ class: _(["rds-e-link__text", [e(b), {
142
+ "rds-e-mr-xs": C.value,
133
143
  "rds-e-link__text--underline": e(h)
134
144
  }]])
135
145
  }, [
136
- B(a.$slots, "default", {}, () => [
137
- I(D(e(g)), 1)
146
+ D(a.$slots, "default", {}, () => [
147
+ R(j(e(w)), 1)
138
148
  ], !0)
139
- ], 2)) : i("", !0),
140
- e(d) ? (o(), p(v, k({ key: 2 }, {
141
- name: e(t) ? "arrow_right" : "arrow_left"
149
+ ], 2)) : d("", !0),
150
+ e(c) ? (s(), p(v, k({ key: 2 }, {
151
+ name: e(t) ? "arrow_right" : "arrow_left",
152
+ size: e(x) ? 16 : void 0
142
153
  }, {
143
154
  class: ["rds-e-arrow-link__icon--arrow", [
144
- e(t) ? "rds-e-arrow-link__icon--animation-right" : "rds-e-arrow-link__icon--animation-left"
155
+ e(t) ? "rds-e-arrow-link__icon--animation-right" : "rds-e-arrow-link__icon--animation-left",
156
+ { "rds-flex rds-flex-center-center": e(x) }
145
157
  ]],
146
158
  style: e(l) ? { color: e(l) } : void 0
147
- }), null, 16, ["class", "style"])) : i("", !0),
148
- e(t) ? i("", !0) : (o(), b("span", {
159
+ }), null, 16, ["class", "style"])) : d("", !0),
160
+ e(t) ? d("", !0) : (s(), I("span", {
149
161
  key: 3,
150
- class: _(["rds-e-link__text", { "rds-e-ml-xs": x.value }])
162
+ class: _(["rds-e-link__text", { "rds-e-ml-xs": C.value }])
151
163
  }, [
152
- B(a.$slots, "default", {}, () => [
153
- I(D(e(g)), 1)
164
+ D(a.$slots, "default", {}, () => [
165
+ R(j(e(w)), 1)
154
166
  ], !0)
155
167
  ], 2)),
156
- e(r).name && e(t) && !e(d) ? (o(), p(v, k({
168
+ e(r).name && e(t) && !e(c) ? (s(), p(v, k({
157
169
  key: 4,
158
170
  name: e(r).name
159
171
  }, e(r), {
160
172
  class: ["rds-e-link__icon-right", S.value],
161
173
  style: e(l) ? { color: e(l) } : void 0
162
- }), null, 16, ["name", "class", "style"])) : i("", !0)
174
+ }), null, 16, ["name", "class", "style"])) : d("", !0)
163
175
  ]),
164
176
  _: 3
165
- }, 8, ["class", "to", "href", "disable", "style"]));
177
+ }, 8, ["class", "to", "href", "disable", "style", "tabindex", "aria-disabled"]));
166
178
  }
167
- }), A = /* @__PURE__ */ M(O, [["__scopeId", "data-v-49b40e60"]]);
179
+ }), F = /* @__PURE__ */ O(P, [["__scopeId", "data-v-377c1eda"]]);
168
180
  export {
169
- A as default
181
+ F as default
170
182
  };
@@ -1,7 +1,7 @@
1
1
  import { defineComponent as C, ref as v, computed as R, createBlock as u, createCommentVNode as d, openBlock as l, unref as n, withCtx as p, createVNode as k, withModifiers as b, normalizeStyle as g, createElementVNode as a, createElementBlock as c, renderSlot as i } from "vue";
2
2
  import w from "./overlay.es.js";
3
3
  import S from "./card.es.js";
4
- import { R as q } from "./icon-svg-YXBqzlJN.js";
4
+ import { R as q } from "./icon-svg-DuzOdbk1.js";
5
5
  import { _ as x } from "./_plugin-vue_export-helper-CHgC5LLL.js";
6
6
  import './style/modal.css';const $ = { class: "rds-e-modal__container" }, B = { class: "rds-e-modal__header" }, O = {
7
7
  key: 0,
@@ -1,4 +1,4 @@
1
- import { createElementBlock as o, openBlock as c, normalizeStyle as b, withModifiers as u, normalizeClass as m, createElementVNode as a, renderSlot as i, createCommentVNode as r, withDirectives as _, createTextVNode as g, toDisplayString as h, Fragment as S, renderList as y, vShow as f } from "vue";
1
+ import { createElementBlock as o, openBlock as c, normalizeStyle as _, withModifiers as u, normalizeClass as m, createElementVNode as s, renderSlot as i, createCommentVNode as r, withDirectives as b, createTextVNode as g, toDisplayString as h, Fragment as S, renderList as y, vShow as f } from "vue";
2
2
  import { _ as L } from "./_plugin-vue_export-helper-CHgC5LLL.js";
3
3
  import './style/multiselectcontentwrapper.css';const w = {
4
4
  name: "MultiselectContentWrapper",
@@ -37,7 +37,10 @@ import './style/multiselectcontentwrapper.css';const w = {
37
37
  showNoResults: Boolean,
38
38
  showNoOptions: Boolean,
39
39
  small: Boolean,
40
- contentStyle: Object,
40
+ contentStyle: {
41
+ type: Object,
42
+ default: () => ({})
43
+ },
41
44
  customStyle: Object
42
45
  },
43
46
  emits: ["focus"]
@@ -53,36 +56,36 @@ function k(l, n, e, G, C, D) {
53
56
  tabindex: "-1",
54
57
  onMousedown: n[1] || (n[1] = u(() => {
55
58
  }, ["prevent"])),
56
- style: b(e.customStyle),
59
+ style: _(e.customStyle),
57
60
  ref: "wrapper"
58
61
  }, [
59
- a("ul", {
62
+ s("ul", {
60
63
  class: "multiselect__content",
61
- style: b(e.contentStyle),
64
+ style: _(e.contentStyle),
62
65
  role: "listbox",
63
66
  id: "listbox-" + (e.teleported ? "teleported-" : "") + e.id,
64
67
  "aria-multiselectable": e.multiple
65
68
  }, [
66
69
  i(l.$slots, "beforeList", {}, void 0, !0),
67
70
  e.multiple && e.max === e.internalValue.length ? (c(), o("li", M, [
68
- a("span", v, [
71
+ s("span", v, [
69
72
  i(l.$slots, "maxElements", {}, () => [
70
73
  g("Maximum of " + h(e.max) + " options selected. First remove a selected option to select another.", 1)
71
74
  ], !0)
72
75
  ])
73
76
  ])) : r("", !0),
74
- !e.max || e.internalValue.length < e.max ? (c(!0), o(S, { key: 1 }, y(e.filteredOptions, (t, s) => (c(), o("li", {
77
+ !e.max || e.internalValue.length < e.max ? (c(!0), o(S, { key: 1 }, y(e.filteredOptions, (t, a) => (c(), o("li", {
75
78
  class: "multiselect__element",
76
- key: s,
79
+ key: a,
77
80
  "aria-selected": e.isSelected(t),
78
- id: e.id + "-" + s,
81
+ id: e.id + "-" + a,
79
82
  role: t && (t.$isLabel || t.$isDisabled) ? null : "option"
80
83
  }, [
81
84
  t && (t.$isLabel || t.$isDisabled) ? r("", !0) : (c(), o("span", {
82
85
  key: 0,
83
- class: m([e.optionHighlight(s, t), "multiselect__option"]),
86
+ class: m([e.optionHighlight(a, t), "multiselect__option"]),
84
87
  onClick: u((d) => e.select(t), ["stop"]),
85
- onMouseenter: u((d) => e.pointerSet(s), ["self"]),
88
+ onMouseenter: u((d) => e.pointerSet(a), ["self"]),
86
89
  "data-select": t && t.isTag ? e.tagPlaceholder : e.selectLabelText,
87
90
  "data-selected": e.selectedLabelText,
88
91
  "data-deselect": e.deselectLabelText
@@ -90,30 +93,30 @@ function k(l, n, e, G, C, D) {
90
93
  i(l.$slots, "option", {
91
94
  option: t,
92
95
  search: e.search,
93
- index: s
96
+ index: a
94
97
  }, () => [
95
- a("span", null, h(e.getOptionLabel(t)), 1)
98
+ s("span", null, h(e.getOptionLabel(t)), 1)
96
99
  ], !0)
97
100
  ], 42, x)),
98
101
  t && (t.$isLabel || t.$isDisabled) ? (c(), o("span", {
99
102
  key: 1,
100
103
  "data-select": e.groupSelect && e.selectGroupLabelText,
101
104
  "data-deselect": e.groupSelect && e.deselectGroupLabelText,
102
- class: m([e.groupHighlight(s, t), "multiselect__option"]),
103
- onMouseenter: u((d) => e.groupSelect && e.pointerSet(s), ["self"]),
105
+ class: m([e.groupHighlight(a, t), "multiselect__option"]),
106
+ onMouseenter: u((d) => e.groupSelect && e.pointerSet(a), ["self"]),
104
107
  onMousedown: u((d) => e.selectGroup(t), ["prevent"])
105
108
  }, [
106
109
  i(l.$slots, "option", {
107
110
  option: t,
108
111
  search: e.search,
109
- index: s
112
+ index: a
110
113
  }, () => [
111
- a("span", null, h(e.getOptionLabel(t)), 1)
114
+ s("span", null, h(e.getOptionLabel(t)), 1)
112
115
  ], !0)
113
116
  ], 42, B)) : r("", !0)
114
117
  ], 8, T))), 128)) : r("", !0),
115
- _(a("li", null, [
116
- a("span", F, [
118
+ b(s("li", null, [
119
+ s("span", F, [
117
120
  i(l.$slots, "noResult", { search: e.search }, () => [
118
121
  n[2] || (n[2] = g("No elements found. Consider changing the search query."))
119
122
  ], !0)
@@ -121,8 +124,8 @@ function k(l, n, e, G, C, D) {
121
124
  ], 512), [
122
125
  [f, e.showNoResults && e.filteredOptions.length === 0 && e.search && !e.loading]
123
126
  ]),
124
- _(a("li", null, [
125
- a("span", N, [
127
+ b(s("li", null, [
128
+ s("span", N, [
126
129
  i(l.$slots, "noOptions", {}, () => [
127
130
  n[3] || (n[3] = g("List is empty."))
128
131
  ], !0)
@@ -134,7 +137,7 @@ function k(l, n, e, G, C, D) {
134
137
  ], 12, O)
135
138
  ], 38);
136
139
  }
137
- const A = /* @__PURE__ */ L(w, [["render", k], ["__scopeId", "data-v-b87add6b"]]);
140
+ const A = /* @__PURE__ */ L(w, [["render", k], ["__scopeId", "data-v-58844ad4"]]);
138
141
  export {
139
142
  A as default
140
143
  };
@@ -1,10 +1,13 @@
1
- import { defineComponent as j, toRefs as V, ref as A, computed as u, onBeforeMount as T, createElementBlock as g, openBlock as o, createElementVNode as f, createCommentVNode as h, createBlock as C, createVNode as P, Fragment as U, renderList as z, toDisplayString as k, unref as G } from "vue";
2
- import c from "./actionButton.es.js";
3
- import { _ as H } from "./_plugin-vue_export-helper-CHgC5LLL.js";
4
- import './style/pagination.css';const J = { class: "rds-e-pagination-container rds-flex" }, K = { class: "rds-e-pagination" }, O = {
1
+ import { defineComponent as H, toRefs as O, ref as U, computed as u, watch as z, onBeforeMount as G, createElementBlock as g, openBlock as o, createElementVNode as m, createCommentVNode as _, createBlock as k, createVNode as P, Fragment as J, renderList as K, toDisplayString as C, unref as Q } from "vue";
2
+ import f from "./actionButton.es.js";
3
+ import { _ as W } from "./_plugin-vue_export-helper-CHgC5LLL.js";
4
+ import './style/pagination.css';const X = { class: "rds-e-pagination-container rds-flex" }, Y = { class: "rds-e-pagination" }, Z = {
5
+ key: 0,
6
+ class: "rds-e-pagination__item rds-e-pagination__item-elipsis"
7
+ }, T = {
5
8
  key: 0,
6
9
  class: "rds-e-pagination-leyend"
7
- }, Q = /* @__PURE__ */ j({
10
+ }, I = /* @__PURE__ */ H({
8
11
  __name: "pagination",
9
12
  props: {
10
13
  /**
@@ -70,134 +73,180 @@ import './style/pagination.css';const J = { class: "rds-e-pagination-container r
70
73
  disableFirstLoad: {
71
74
  type: Boolean,
72
75
  default: !1
76
+ },
77
+ /**
78
+ * Habilita la funcionalidad de elipsis (...) para mostrar páginas ocultas.
79
+ * Cuando se hace click en las elipsis, se emite un evento con las páginas ocultas.
80
+ */
81
+ enableEllipsis: {
82
+ type: Boolean,
83
+ default: !1
73
84
  }
74
85
  },
75
- emits: ["pageChanged"],
76
- setup(p, { expose: N, emit: w }) {
77
- const m = p, L = w, {
78
- itemsPerPage: v,
79
- totalItems: e,
86
+ emits: ["pageChanged", "ellipsisClicked"],
87
+ setup(y, { expose: M, emit: E }) {
88
+ const b = y, B = E, {
89
+ itemsPerPage: p,
90
+ totalItems: t,
80
91
  totalPages: r,
81
- hideLeyend: M,
82
- disableFirstLoad: S
83
- } = V(m), l = A(m.currentPage), d = u(() => typeof (e == null ? void 0 : e.value) == "number" && e.value >= 0), b = u(() => d.value && typeof (e == null ? void 0 : e.value) == "number" ? e.value <= 0 || v.value <= 0 ? 1 : Math.ceil(e.value / v.value) : typeof (r == null ? void 0 : r.value) == "number" && r.value > 0 ? r.value : (typeof (r == null ? void 0 : r.value) > "u" && typeof (e == null ? void 0 : e.value) > "u" && console.warn("[RDSPagination] Props `totalItems` o `totalPages` son requeridas."), 1)), $ = u(() => d.value && !M.value && typeof (e == null ? void 0 : e.value) == "number" && e.value > 0), F = u(() => !d.value || typeof (e == null ? void 0 : e.value) != "number" || e.value === 0 ? 0 : (l.value - 1) * v.value + 1), q = u(() => {
84
- if (!d.value || typeof (e == null ? void 0 : e.value) != "number") return 0;
85
- const t = l.value * v.value;
86
- return Math.min(t, e.value);
87
- }), _ = u(() => l.value === 1), B = u(() => l.value === b.value), D = u(() => {
88
- const t = [], a = b.value, n = l.value;
89
- if (a <= 3)
90
- for (let i = 1; i <= a; i++)
91
- t.push(i);
92
- else n === 1 ? t.push(1, 2, Math.min(3, a)) : n === a ? t.push(Math.max(1, a - 2), a - 1, a) : t.push(n - 1, n, n + 1);
93
- return [...new Set(t)].filter((i) => i >= 1 && i <= a);
94
- }), E = (t) => {
95
- let a = l.value;
96
- const n = b.value;
97
- if ("navigator" in t)
98
- switch (t.navigator) {
92
+ hideLeyend: L,
93
+ disableFirstLoad: $,
94
+ enableEllipsis: S
95
+ } = O(b), i = U(b.currentPage), c = u(() => typeof (t == null ? void 0 : t.value) == "number" && t.value >= 0), d = u(() => c.value && typeof (t == null ? void 0 : t.value) == "number" ? t.value <= 0 || p.value <= 0 ? 1 : Math.ceil(t.value / p.value) : typeof (r == null ? void 0 : r.value) == "number" && r.value > 0 ? r.value : (typeof (r == null ? void 0 : r.value) > "u" && typeof (t == null ? void 0 : t.value) > "u" && console.warn("[RDSPagination] Props `totalItems` o `totalPages` son requeridas."), 1)), w = u(() => c.value && !L.value && typeof (t == null ? void 0 : t.value) == "number" && t.value > 0), F = u(() => !c.value || typeof (t == null ? void 0 : t.value) != "number" || t.value === 0 ? 0 : (i.value - 1) * p.value + 1), q = u(() => {
96
+ if (!c.value || typeof (t == null ? void 0 : t.value) != "number") return 0;
97
+ const e = i.value * p.value;
98
+ return Math.min(e, t.value);
99
+ }), x = u(() => i.value === 1), N = u(() => i.value === d.value), D = u(() => {
100
+ const e = [], a = d.value, l = i.value;
101
+ if (!S.value) {
102
+ if (a <= 3)
103
+ for (let n = 1; n <= a; n++)
104
+ e.push(n);
105
+ else l === 1 ? e.push(1, 2, Math.min(3, a)) : l === a ? e.push(Math.max(1, a - 2), a - 1, a) : e.push(l - 1, l, l + 1);
106
+ return [...new Set(e)].filter((n) => typeof n == "number" && n >= 1 && n <= a);
107
+ }
108
+ if (a <= 5) {
109
+ for (let n = 1; n <= a; n++)
110
+ e.push(n);
111
+ return e;
112
+ }
113
+ return e.push(1), l <= 3 ? (e.push(2, 3), a > 4 && e.push("ellipsis_end"), e.push(a)) : l >= a - 2 ? (a > 4 && e.push("ellipsis_start"), e.push(a - 2, a - 1, a)) : (e.push("ellipsis_start"), e.push(l - 1, l, l + 1), e.push("ellipsis_end"), e.push(a)), e.filter((n, s, h) => h.indexOf(n) === s);
114
+ }), R = (e) => {
115
+ const a = d.value, l = i.value, n = [];
116
+ if (e === "ellipsis_start")
117
+ for (let s = 2; s < l - 1; s++)
118
+ n.push(s);
119
+ else if (e === "ellipsis_end")
120
+ for (let s = l + 2; s < a; s++)
121
+ n.push(s);
122
+ return n;
123
+ }, j = (e) => {
124
+ const a = R(e);
125
+ B("ellipsisClicked", {
126
+ hiddenPages: a,
127
+ ellipsisType: e,
128
+ currentPage: i.value,
129
+ totalPages: d.value
130
+ });
131
+ }, V = (e) => {
132
+ let a = i.value;
133
+ const l = d.value;
134
+ if ("navigator" in e)
135
+ switch (e.navigator) {
99
136
  case "next":
100
- l.value < n && (a = l.value + 1);
137
+ i.value < l && (a = i.value + 1);
101
138
  break;
102
139
  case "prev":
103
- l.value > 1 && (a = l.value - 1);
140
+ i.value > 1 && (a = i.value - 1);
104
141
  break;
105
142
  case "first":
106
- l.value !== 1 && (a = 1);
143
+ i.value !== 1 && (a = 1);
107
144
  break;
108
145
  case "last":
109
- l.value !== n && (a = n);
146
+ i.value !== l && (a = l);
110
147
  break;
111
148
  }
112
- else "page" in t && typeof t.page == "number" && t.page >= 1 && t.page <= n && t.page !== l.value && (a = t.page);
113
- return a !== l.value ? (l.value = a, !0) : !1;
114
- }, s = (t, a = !1) => {
115
- if (E(t) || a) {
116
- const i = v.value, y = (l.value - 1) * i;
117
- let x = y + i;
118
- d.value && typeof (e == null ? void 0 : e.value) == "number" && (x = Math.min(y + i, e.value));
119
- const R = {
120
- ...t,
121
- page: l.value,
122
- offset: y,
123
- limit: i,
124
- end: x,
149
+ else "page" in e && typeof e.page == "number" && e.page >= 1 && e.page <= l && e.page !== i.value && (a = e.page);
150
+ return a !== i.value ? (i.value = a, !0) : !1;
151
+ }, v = (e, a = !1) => {
152
+ if (V(e) || a) {
153
+ const n = p.value, s = (i.value - 1) * n;
154
+ let h = s + n;
155
+ c.value && typeof (t == null ? void 0 : t.value) == "number" && (h = Math.min(s + n, t.value));
156
+ const A = {
157
+ ...e,
158
+ page: i.value,
159
+ offset: s,
160
+ limit: n,
161
+ end: h,
125
162
  reset: a || void 0
126
163
  };
127
- L("pageChanged", R);
164
+ B("pageChanged", A);
128
165
  }
129
166
  };
130
- return T(() => {
131
- S.value || s({ navigator: "first", page: 1 });
132
- }), N({
167
+ return z(() => b.currentPage, (e) => {
168
+ e !== i.value && e >= 1 && e <= d.value && (i.value = e);
169
+ }), G(() => {
170
+ $.value || v({ navigator: "first", page: 1 });
171
+ }), M({
133
172
  /** Resetea la paginación a la primera página y emite el evento pageChanged. */
134
173
  resetPagination: () => {
135
- l.value !== 1 && s({ page: 1 }, !0);
174
+ i.value !== 1 && v({ page: 1 }, !0);
136
175
  }
137
- }), (t, a) => (o(), g("div", J, [
138
- f("ul", K, [
139
- f("li", null, [
140
- p.jumpTo ? (o(), C(c, {
176
+ }), (e, a) => (o(), g("div", X, [
177
+ m("ul", Y, [
178
+ m("li", null, [
179
+ y.jumpTo ? (o(), k(f, {
141
180
  key: 0,
142
181
  class: "rds-e-pagination__actionBtn",
143
182
  variant: "ghost",
144
183
  small: "",
145
184
  icon: "back",
146
185
  "aria-label": "First Page",
147
- disabled: _.value,
148
- onClick: a[0] || (a[0] = (n) => s({ navigator: "first" }))
149
- }, null, 8, ["disabled"])) : h("", !0)
186
+ disabled: x.value,
187
+ onClick: a[0] || (a[0] = (l) => v({ navigator: "first" }))
188
+ }, null, 8, ["disabled"])) : _("", !0)
150
189
  ]),
151
- f("li", null, [
152
- P(c, {
190
+ m("li", null, [
191
+ P(f, {
153
192
  class: "rds-e-pagination__actionBtn",
154
193
  variant: "ghost",
155
194
  small: "",
156
195
  icon: "arrow_left",
157
196
  "aria-label": "Prev page",
158
- disabled: _.value,
159
- onClick: a[1] || (a[1] = (n) => s({ navigator: "prev" }))
197
+ disabled: x.value,
198
+ onClick: a[1] || (a[1] = (l) => v({ navigator: "prev" }))
160
199
  }, null, 8, ["disabled"])
161
200
  ]),
162
- (o(!0), g(U, null, z(D.value, (n) => (o(), g("li", { key: n }, [
163
- P(c, {
201
+ (o(!0), g(J, null, K(D.value, (l) => (o(), g("li", { key: l }, [
202
+ typeof l == "string" && l.includes("ellipsis") ? (o(), g("div", Z, [
203
+ P(f, {
204
+ variant: "ghost",
205
+ small: "",
206
+ text: "...",
207
+ icon: "",
208
+ "aria-label": "Más páginas",
209
+ onClick: (n) => j(l)
210
+ }, null, 8, ["onClick"])
211
+ ])) : (o(), k(f, {
212
+ key: 1,
164
213
  class: "rds-e-pagination__item",
165
- variant: n === l.value && m.selected ? "primary" : "ghost",
214
+ variant: l === i.value && b.selected ? "primary" : "ghost",
166
215
  small: "",
167
- text: String(n),
216
+ text: String(l),
168
217
  icon: "",
169
- "aria-label": `page number ${n}`,
170
- onClick: (i) => s({ page: n })
171
- }, null, 8, ["variant", "text", "aria-label", "onClick"])
218
+ "aria-label": `page number ${l}`,
219
+ onClick: (n) => v({ page: l })
220
+ }, null, 8, ["variant", "text", "aria-label", "onClick"]))
172
221
  ]))), 128)),
173
- f("li", null, [
174
- P(c, {
222
+ m("li", null, [
223
+ P(f, {
175
224
  class: "rds-e-pagination__actionBtn",
176
225
  variant: "ghost",
177
226
  icon: "arrow_right",
178
227
  small: "",
179
228
  "aria-label": "next page",
180
- disabled: B.value,
181
- onClick: a[2] || (a[2] = (n) => s({ navigator: "next" }))
229
+ disabled: N.value,
230
+ onClick: a[2] || (a[2] = (l) => v({ navigator: "next" }))
182
231
  }, null, 8, ["disabled"])
183
232
  ]),
184
- f("li", null, [
185
- p.jumpTo ? (o(), C(c, {
233
+ m("li", null, [
234
+ y.jumpTo ? (o(), k(f, {
186
235
  key: 0,
187
236
  class: "rds-e-pagination__actionBtn",
188
237
  variant: "ghost",
189
238
  small: "",
190
239
  icon: "last",
191
240
  "aria-label": "last page",
192
- disabled: B.value,
193
- onClick: a[3] || (a[3] = (n) => s({ navigator: "last" }))
194
- }, null, 8, ["disabled"])) : h("", !0)
241
+ disabled: N.value,
242
+ onClick: a[3] || (a[3] = (l) => v({ navigator: "last" }))
243
+ }, null, 8, ["disabled"])) : _("", !0)
195
244
  ])
196
245
  ]),
197
- $.value ? (o(), g("p", O, " Mostrando resultados " + k(F.value) + "-" + k(q.value) + " de " + k(G(e)), 1)) : h("", !0)
246
+ w.value ? (o(), g("p", T, " Mostrando resultados " + C(F.value) + "-" + C(q.value) + " de " + C(Q(t)), 1)) : _("", !0)
198
247
  ]));
199
248
  }
200
- }), Z = /* @__PURE__ */ H(Q, [["__scopeId", "data-v-78eeeb8a"]]);
249
+ }), te = /* @__PURE__ */ W(I, [["__scopeId", "data-v-7bb8233b"]]);
201
250
  export {
202
- Z as default
251
+ te as default
203
252
  };
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as f, toRefs as y, computed as g, createElementBlock as t, openBlock as s, normalizeClass as h, createElementVNode as i, createCommentVNode as o, createVNode as a, toDisplayString as c, renderSlot as l } from "vue";
2
- import { R as d } from "./icon-svg-YXBqzlJN.js";
2
+ import { R as d } from "./icon-svg-DuzOdbk1.js";
3
3
  import { _ as k } from "./_plugin-vue_export-helper-CHgC5LLL.js";
4
4
  import './style/persistentToast.css';const $ = { class: "alert" }, S = {
5
5
  key: 0,
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as y, computed as r, createElementBlock as o, openBlock as a, normalizeClass as i, createCommentVNode as n, createElementVNode as t, renderSlot as m, normalizeProps as g, mergeProps as B, createVNode as S, createTextVNode as k, guardReactiveProps as h, toDisplayString as p, normalizeStyle as x } from "vue";
2
- import { R as C } from "./icon-svg-YXBqzlJN.js";
2
+ import { R as C } from "./icon-svg-DuzOdbk1.js";
3
3
  import { _ as N } from "./_plugin-vue_export-helper-CHgC5LLL.js";
4
4
  import './style/progressBar.css';const w = {
5
5
  key: 0,