energy-components 1.10.0 → 1.11.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 (37) hide show
  1. package/dist/components/breadcrumbs.es.js +21 -19
  2. package/dist/components/button.es.js +56 -48
  3. package/dist/components/collapsable.es.js +4 -0
  4. package/dist/components/collapsable.scss_vue_type_style_index_0_src_true_lang-DfOWp1XD.js +86 -0
  5. package/dist/components/datepicker.es.js +717 -708
  6. package/dist/components/index.es.js +73 -70
  7. package/dist/components/link.es.js +59 -47
  8. package/dist/components/pagination.es.js +129 -80
  9. package/dist/components/sidedrawer.es.js +48 -43
  10. package/dist/components/style/actionButton.css +1 -1
  11. package/dist/components/style/breadcrumbs.css +1 -1
  12. package/dist/components/style/button.css +1 -1
  13. package/dist/components/style/collapsable.css +1 -0
  14. package/dist/components/style/datepicker.css +1 -1
  15. package/dist/components/style/floatingActionButton.css +1 -1
  16. package/dist/components/style/link.css +1 -1
  17. package/dist/components/style/modal.css +1 -1
  18. package/dist/components/style/pagination.css +1 -1
  19. package/dist/components/style/selectionChip.css +1 -1
  20. package/dist/components/style/sidedrawer.css +1 -1
  21. package/dist/components/style/tabBar.css +1 -1
  22. package/dist/components/style/textField.css +1 -1
  23. package/dist/components/tabBar.es.js +95 -84
  24. package/dist/components/textField.es.js +122 -108
  25. package/dist/energy-components.es.js +4468 -4276
  26. package/dist/energy-components.umd.js +2 -2
  27. package/dist/style.css +1 -1
  28. package/dist/types/src/components/buttons/button/button.vue.d.ts +15 -0
  29. package/dist/types/src/components/content/collapsable/collapsable.vue.d.ts +53 -0
  30. package/dist/types/src/components/feedback/indicator/indicator.vue.d.ts +1 -1
  31. package/dist/types/src/components/index.d.ts +1 -0
  32. package/dist/types/src/components/input/datepicker/datepicker.vue.d.ts +15 -0
  33. package/dist/types/src/components/layout/sidedrawer/sidedrawer.vue.d.ts +7 -5
  34. package/dist/types/src/components/navigation/link/link.vue.d.ts +15 -0
  35. package/dist/types/src/components/navigation/pagination/pagination.vue.d.ts +29 -0
  36. package/dist/types/tsconfig.tsbuildinfo +1 -1
  37. package/package.json +2 -2
@@ -13,79 +13,81 @@ import d from "./datepicker.es.js";
13
13
  import f from "./quantitySelector.es.js";
14
14
  import l from "./toggle.es.js";
15
15
  import u from "./selectionChip.es.js";
16
- import A from "./filterChip.es.js";
17
- import b from "./dragAndDrop.es.js";
16
+ import b from "./filterChip.es.js";
17
+ import A from "./dragAndDrop.es.js";
18
18
  import g from "./fileUploadItem.es.js";
19
19
  import T from "./tag.es.js";
20
20
  import B from "./accordionGroup.es.js";
21
- import h from "./accordion.es.js";
22
- import x from "./divider.es.js";
23
- import I from "./card.es.js";
24
- import v from "./tablepaginatedcomponent.es.js";
25
- import w from "./avatar.es.js";
26
- import C from "./link.es.js";
21
+ import C from "./accordion.es.js";
22
+ import _ from "./divider.es.js";
23
+ import h from "./card.es.js";
24
+ import x from "./tablepaginatedcomponent.es.js";
25
+ import I from "./avatar.es.js";
26
+ import { _ as v } from "./collapsable.scss_vue_type_style_index_0_src_true_lang-DfOWp1XD.js";
27
+ import w from "./link.es.js";
27
28
  import P from "./breadcrumbs.es.js";
28
- import _ from "./tabBar.es.js";
29
- import y from "./pagination.es.js";
30
- import F from "./directAccess.es.js";
31
- import k from "./indicator.es.js";
32
- import G from "./persistentToast.es.js";
33
- import L from "./infoBox.es.js";
34
- import M from "./progressBar.es.js";
35
- import O from "./loader.es.js";
36
- import U from "./modal.es.js";
37
- import j from "./overlay.es.js";
38
- import Q from "./tooltip.es.js";
39
- import V from "./sidebar.es.js";
40
- import q from "./sidedrawer.es.js";
29
+ import y from "./tabBar.es.js";
30
+ import F from "./pagination.es.js";
31
+ import k from "./directAccess.es.js";
32
+ import G from "./indicator.es.js";
33
+ import L from "./persistentToast.es.js";
34
+ import M from "./infoBox.es.js";
35
+ import O from "./progressBar.es.js";
36
+ import U from "./loader.es.js";
37
+ import j from "./modal.es.js";
38
+ import Q from "./overlay.es.js";
39
+ import V from "./tooltip.es.js";
40
+ import q from "./sidebar.es.js";
41
+ import z from "./sidedrawer.es.js";
41
42
  const t = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
42
43
  __proto__: null,
43
- RDSAccordion: h,
44
+ RDSAccordion: C,
44
45
  RDSAccordionGroup: B,
45
46
  RDSActionButton: m,
46
- RDSAvatar: w,
47
+ RDSAvatar: I,
47
48
  RDSBreadcrumbs: P,
48
49
  RDSButton: a,
49
- RDSCard: I,
50
+ RDSCard: h,
50
51
  RDSCheckbox: S,
52
+ RDSCollapsable: v,
51
53
  RDSDatePicker: d,
52
- RDSDirectAccess: F,
53
- RDSDivider: x,
54
- RDSDragAndDrop: b,
54
+ RDSDirectAccess: k,
55
+ RDSDivider: _,
56
+ RDSDragAndDrop: A,
55
57
  RDSDropdown: c,
56
58
  RDSFileUploadItem: g,
57
- RDSFilterChip: A,
59
+ RDSFilterChip: b,
58
60
  RDSFloatinActionButton: e,
59
61
  RDSIconSvg: i,
60
- RDSIndicator: k,
61
- RDSInfoBox: L,
62
- RDSLink: C,
63
- RDSLoader: O,
64
- RDSModal: U,
65
- RDSOverlay: j,
66
- RDSPagination: y,
67
- RDSPersistentToast: G,
68
- RDSProgressBar: M,
62
+ RDSIndicator: G,
63
+ RDSInfoBox: M,
64
+ RDSLink: w,
65
+ RDSLoader: U,
66
+ RDSModal: j,
67
+ RDSOverlay: Q,
68
+ RDSPagination: F,
69
+ RDSPersistentToast: L,
70
+ RDSProgressBar: O,
69
71
  RDSQuantitySelector: f,
70
72
  RDSRadioButton: n,
71
73
  RDSRadioGroup: s,
72
74
  RDSSelectionChip: u,
73
- RDSSidebar: V,
74
- RDSSidedrawer: q,
75
+ RDSSidebar: q,
76
+ RDSSidedrawer: z,
75
77
  RDSSwitch: R,
76
- RDSTabBar: _,
77
- RDSTable: v,
78
+ RDSTabBar: y,
79
+ RDSTable: x,
78
80
  RDSTag: T,
79
81
  RDSTextArea: p,
80
82
  RDSTextField: D,
81
83
  RDSToggle: l,
82
- RDSTooltip: Q
84
+ RDSTooltip: V
83
85
  }, Symbol.toStringTag, { value: "Module" }));
84
- let z;
85
- function yo(o) {
86
- z = o;
86
+ let K;
87
+ function ko(o) {
88
+ K = o;
87
89
  }
88
- const Fo = {
90
+ const Go = {
89
91
  install: (o) => {
90
92
  for (const r in t)
91
93
  o.component(
@@ -95,47 +97,48 @@ const Fo = {
95
97
  }
96
98
  };
97
99
  export {
98
- h as RDSAccordion,
100
+ C as RDSAccordion,
99
101
  B as RDSAccordionGroup,
100
102
  m as RDSActionButton,
101
- w as RDSAvatar,
103
+ I as RDSAvatar,
102
104
  P as RDSBreadcrumbs,
103
105
  a as RDSButton,
104
- I as RDSCard,
106
+ h as RDSCard,
105
107
  S as RDSCheckbox,
108
+ v as RDSCollapsable,
106
109
  d as RDSDatePicker,
107
- F as RDSDirectAccess,
108
- x as RDSDivider,
109
- b as RDSDragAndDrop,
110
+ k as RDSDirectAccess,
111
+ _ as RDSDivider,
112
+ A as RDSDragAndDrop,
110
113
  c as RDSDropdown,
111
114
  g as RDSFileUploadItem,
112
- A as RDSFilterChip,
115
+ b as RDSFilterChip,
113
116
  e as RDSFloatinActionButton,
114
117
  i as RDSIconSvg,
115
- k as RDSIndicator,
116
- L as RDSInfoBox,
117
- C as RDSLink,
118
- O as RDSLoader,
119
- U as RDSModal,
120
- j as RDSOverlay,
121
- y as RDSPagination,
122
- G as RDSPersistentToast,
123
- M as RDSProgressBar,
118
+ G as RDSIndicator,
119
+ M as RDSInfoBox,
120
+ w as RDSLink,
121
+ U as RDSLoader,
122
+ j as RDSModal,
123
+ Q as RDSOverlay,
124
+ F as RDSPagination,
125
+ L as RDSPersistentToast,
126
+ O as RDSProgressBar,
124
127
  f as RDSQuantitySelector,
125
128
  n as RDSRadioButton,
126
129
  s as RDSRadioGroup,
127
130
  u as RDSSelectionChip,
128
- V as RDSSidebar,
129
- q as RDSSidedrawer,
131
+ q as RDSSidebar,
132
+ z as RDSSidedrawer,
130
133
  R as RDSSwitch,
131
- _ as RDSTabBar,
132
- v as RDSTable,
134
+ y as RDSTabBar,
135
+ x as RDSTable,
133
136
  T as RDSTag,
134
137
  p as RDSTextArea,
135
138
  D as RDSTextField,
136
139
  l as RDSToggle,
137
- Q as RDSTooltip,
138
- z as VueInstance,
139
- Fo as default,
140
- yo as setVueInstance
140
+ V as RDSTooltip,
141
+ K as VueInstance,
142
+ Go as default,
143
+ ko as setVueInstance
141
144
  };
@@ -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";
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
2
  import { R as v } from "./icon-svg-DuzOdbk1.js";
3
- import { _ as M } from "./_plugin-vue_export-helper-CHgC5LLL.js";
4
- import './style/link.css';const O = /* @__PURE__ */ E({
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,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
  };