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.
- package/dist/components/breadcrumbs.es.js +21 -19
- package/dist/components/button.es.js +56 -48
- package/dist/components/collapsable.es.js +4 -0
- package/dist/components/collapsable.scss_vue_type_style_index_0_src_true_lang-DfOWp1XD.js +86 -0
- package/dist/components/datepicker.es.js +717 -708
- package/dist/components/index.es.js +73 -70
- package/dist/components/link.es.js +59 -47
- package/dist/components/pagination.es.js +129 -80
- package/dist/components/sidedrawer.es.js +48 -43
- package/dist/components/style/actionButton.css +1 -1
- package/dist/components/style/breadcrumbs.css +1 -1
- package/dist/components/style/button.css +1 -1
- package/dist/components/style/collapsable.css +1 -0
- package/dist/components/style/datepicker.css +1 -1
- package/dist/components/style/floatingActionButton.css +1 -1
- package/dist/components/style/link.css +1 -1
- package/dist/components/style/modal.css +1 -1
- package/dist/components/style/pagination.css +1 -1
- package/dist/components/style/selectionChip.css +1 -1
- package/dist/components/style/sidedrawer.css +1 -1
- package/dist/components/style/tabBar.css +1 -1
- package/dist/components/style/textField.css +1 -1
- package/dist/components/tabBar.es.js +95 -84
- package/dist/components/textField.es.js +122 -108
- package/dist/energy-components.es.js +4468 -4276
- package/dist/energy-components.umd.js +2 -2
- package/dist/style.css +1 -1
- package/dist/types/src/components/buttons/button/button.vue.d.ts +15 -0
- package/dist/types/src/components/content/collapsable/collapsable.vue.d.ts +53 -0
- package/dist/types/src/components/feedback/indicator/indicator.vue.d.ts +1 -1
- package/dist/types/src/components/index.d.ts +1 -0
- package/dist/types/src/components/input/datepicker/datepicker.vue.d.ts +15 -0
- package/dist/types/src/components/layout/sidedrawer/sidedrawer.vue.d.ts +7 -5
- package/dist/types/src/components/navigation/link/link.vue.d.ts +15 -0
- package/dist/types/src/components/navigation/pagination/pagination.vue.d.ts +29 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- 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
|
|
17
|
-
import
|
|
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
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
import
|
|
26
|
-
import
|
|
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
|
|
29
|
-
import
|
|
30
|
-
import
|
|
31
|
-
import
|
|
32
|
-
import
|
|
33
|
-
import
|
|
34
|
-
import
|
|
35
|
-
import
|
|
36
|
-
import
|
|
37
|
-
import
|
|
38
|
-
import
|
|
39
|
-
import
|
|
40
|
-
import
|
|
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:
|
|
44
|
+
RDSAccordion: C,
|
|
44
45
|
RDSAccordionGroup: B,
|
|
45
46
|
RDSActionButton: m,
|
|
46
|
-
RDSAvatar:
|
|
47
|
+
RDSAvatar: I,
|
|
47
48
|
RDSBreadcrumbs: P,
|
|
48
49
|
RDSButton: a,
|
|
49
|
-
RDSCard:
|
|
50
|
+
RDSCard: h,
|
|
50
51
|
RDSCheckbox: S,
|
|
52
|
+
RDSCollapsable: v,
|
|
51
53
|
RDSDatePicker: d,
|
|
52
|
-
RDSDirectAccess:
|
|
53
|
-
RDSDivider:
|
|
54
|
-
RDSDragAndDrop:
|
|
54
|
+
RDSDirectAccess: k,
|
|
55
|
+
RDSDivider: _,
|
|
56
|
+
RDSDragAndDrop: A,
|
|
55
57
|
RDSDropdown: c,
|
|
56
58
|
RDSFileUploadItem: g,
|
|
57
|
-
RDSFilterChip:
|
|
59
|
+
RDSFilterChip: b,
|
|
58
60
|
RDSFloatinActionButton: e,
|
|
59
61
|
RDSIconSvg: i,
|
|
60
|
-
RDSIndicator:
|
|
61
|
-
RDSInfoBox:
|
|
62
|
-
RDSLink:
|
|
63
|
-
RDSLoader:
|
|
64
|
-
RDSModal:
|
|
65
|
-
RDSOverlay:
|
|
66
|
-
RDSPagination:
|
|
67
|
-
RDSPersistentToast:
|
|
68
|
-
RDSProgressBar:
|
|
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:
|
|
74
|
-
RDSSidedrawer:
|
|
75
|
+
RDSSidebar: q,
|
|
76
|
+
RDSSidedrawer: z,
|
|
75
77
|
RDSSwitch: R,
|
|
76
|
-
RDSTabBar:
|
|
77
|
-
RDSTable:
|
|
78
|
+
RDSTabBar: y,
|
|
79
|
+
RDSTable: x,
|
|
78
80
|
RDSTag: T,
|
|
79
81
|
RDSTextArea: p,
|
|
80
82
|
RDSTextField: D,
|
|
81
83
|
RDSToggle: l,
|
|
82
|
-
RDSTooltip:
|
|
84
|
+
RDSTooltip: V
|
|
83
85
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
84
|
-
let
|
|
85
|
-
function
|
|
86
|
-
|
|
86
|
+
let K;
|
|
87
|
+
function ko(o) {
|
|
88
|
+
K = o;
|
|
87
89
|
}
|
|
88
|
-
const
|
|
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
|
-
|
|
100
|
+
C as RDSAccordion,
|
|
99
101
|
B as RDSAccordionGroup,
|
|
100
102
|
m as RDSActionButton,
|
|
101
|
-
|
|
103
|
+
I as RDSAvatar,
|
|
102
104
|
P as RDSBreadcrumbs,
|
|
103
105
|
a as RDSButton,
|
|
104
|
-
|
|
106
|
+
h as RDSCard,
|
|
105
107
|
S as RDSCheckbox,
|
|
108
|
+
v as RDSCollapsable,
|
|
106
109
|
d as RDSDatePicker,
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
+
k as RDSDirectAccess,
|
|
111
|
+
_ as RDSDivider,
|
|
112
|
+
A as RDSDragAndDrop,
|
|
110
113
|
c as RDSDropdown,
|
|
111
114
|
g as RDSFileUploadItem,
|
|
112
|
-
|
|
115
|
+
b as RDSFilterChip,
|
|
113
116
|
e as RDSFloatinActionButton,
|
|
114
117
|
i as RDSIconSvg,
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
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
|
-
|
|
129
|
-
|
|
131
|
+
q as RDSSidebar,
|
|
132
|
+
z as RDSSidedrawer,
|
|
130
133
|
R as RDSSwitch,
|
|
131
|
-
|
|
132
|
-
|
|
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
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
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
|
|
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
|
|
4
|
-
import './style/link.css';const
|
|
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: (
|
|
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(
|
|
86
|
-
const y =
|
|
87
|
-
text:
|
|
88
|
-
to:
|
|
92
|
+
setup(o) {
|
|
93
|
+
const y = o, {
|
|
94
|
+
text: w,
|
|
95
|
+
to: g,
|
|
89
96
|
icon: r,
|
|
90
97
|
tag: u,
|
|
91
|
-
disabled:
|
|
98
|
+
disabled: i,
|
|
92
99
|
inverse: m,
|
|
93
|
-
arrow:
|
|
100
|
+
arrow: c,
|
|
94
101
|
right: t,
|
|
95
102
|
underline: h,
|
|
96
|
-
customClass:
|
|
97
|
-
color: l
|
|
98
|
-
|
|
99
|
-
|
|
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"),
|
|
102
|
-
}), S =
|
|
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"),
|
|
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
|
-
}),
|
|
116
|
+
}), C = f(() => {
|
|
109
117
|
var a;
|
|
110
|
-
return
|
|
118
|
+
return c.value || ((a = r == null ? void 0 : r.value) == null ? void 0 : a.name);
|
|
111
119
|
});
|
|
112
|
-
return (a, n) => (
|
|
113
|
-
class: _(
|
|
114
|
-
to: e(u) === "router-link" ? e(
|
|
115
|
-
href: e(u) === "a" ? e(
|
|
116
|
-
disable: e(
|
|
117
|
-
style:
|
|
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(
|
|
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"])) :
|
|
129
|
-
e(t) ? (
|
|
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(
|
|
132
|
-
"rds-e-mr-xs":
|
|
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
|
-
|
|
137
|
-
|
|
146
|
+
D(a.$slots, "default", {}, () => [
|
|
147
|
+
R(j(e(w)), 1)
|
|
138
148
|
], !0)
|
|
139
|
-
], 2)) :
|
|
140
|
-
e(
|
|
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"])) :
|
|
148
|
-
e(t) ?
|
|
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":
|
|
162
|
+
class: _(["rds-e-link__text", { "rds-e-ml-xs": C.value }])
|
|
151
163
|
}, [
|
|
152
|
-
|
|
153
|
-
|
|
164
|
+
D(a.$slots, "default", {}, () => [
|
|
165
|
+
R(j(e(w)), 1)
|
|
154
166
|
], !0)
|
|
155
167
|
], 2)),
|
|
156
|
-
e(r).name && e(t) && !e(
|
|
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"])) :
|
|
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
|
-
}),
|
|
179
|
+
}), F = /* @__PURE__ */ O(P, [["__scopeId", "data-v-377c1eda"]]);
|
|
168
180
|
export {
|
|
169
|
-
|
|
181
|
+
F as default
|
|
170
182
|
};
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import { _ as
|
|
4
|
-
import './style/pagination.css';const
|
|
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
|
-
},
|
|
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(
|
|
77
|
-
const
|
|
78
|
-
itemsPerPage:
|
|
79
|
-
totalItems:
|
|
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:
|
|
82
|
-
disableFirstLoad:
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
if (
|
|
98
|
-
|
|
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
|
-
|
|
137
|
+
i.value < l && (a = i.value + 1);
|
|
101
138
|
break;
|
|
102
139
|
case "prev":
|
|
103
|
-
|
|
140
|
+
i.value > 1 && (a = i.value - 1);
|
|
104
141
|
break;
|
|
105
142
|
case "first":
|
|
106
|
-
|
|
143
|
+
i.value !== 1 && (a = 1);
|
|
107
144
|
break;
|
|
108
145
|
case "last":
|
|
109
|
-
|
|
146
|
+
i.value !== l && (a = l);
|
|
110
147
|
break;
|
|
111
148
|
}
|
|
112
|
-
else "page" in
|
|
113
|
-
return a !==
|
|
114
|
-
},
|
|
115
|
-
if (
|
|
116
|
-
const
|
|
117
|
-
let
|
|
118
|
-
|
|
119
|
-
const
|
|
120
|
-
...
|
|
121
|
-
page:
|
|
122
|
-
offset:
|
|
123
|
-
limit:
|
|
124
|
-
end:
|
|
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
|
-
|
|
164
|
+
B("pageChanged", A);
|
|
128
165
|
}
|
|
129
166
|
};
|
|
130
|
-
return
|
|
131
|
-
|
|
132
|
-
}),
|
|
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
|
-
|
|
174
|
+
i.value !== 1 && v({ page: 1 }, !0);
|
|
136
175
|
}
|
|
137
|
-
}), (
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
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:
|
|
148
|
-
onClick: a[0] || (a[0] = (
|
|
149
|
-
}, null, 8, ["disabled"])) :
|
|
186
|
+
disabled: x.value,
|
|
187
|
+
onClick: a[0] || (a[0] = (l) => v({ navigator: "first" }))
|
|
188
|
+
}, null, 8, ["disabled"])) : _("", !0)
|
|
150
189
|
]),
|
|
151
|
-
|
|
152
|
-
P(
|
|
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:
|
|
159
|
-
onClick: a[1] || (a[1] = (
|
|
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(
|
|
163
|
-
|
|
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:
|
|
214
|
+
variant: l === i.value && b.selected ? "primary" : "ghost",
|
|
166
215
|
small: "",
|
|
167
|
-
text: String(
|
|
216
|
+
text: String(l),
|
|
168
217
|
icon: "",
|
|
169
|
-
"aria-label": `page number ${
|
|
170
|
-
onClick: (
|
|
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
|
-
|
|
174
|
-
P(
|
|
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:
|
|
181
|
-
onClick: a[2] || (a[2] = (
|
|
229
|
+
disabled: N.value,
|
|
230
|
+
onClick: a[2] || (a[2] = (l) => v({ navigator: "next" }))
|
|
182
231
|
}, null, 8, ["disabled"])
|
|
183
232
|
]),
|
|
184
|
-
|
|
185
|
-
|
|
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:
|
|
193
|
-
onClick: a[3] || (a[3] = (
|
|
194
|
-
}, null, 8, ["disabled"])) :
|
|
241
|
+
disabled: N.value,
|
|
242
|
+
onClick: a[3] || (a[3] = (l) => v({ navigator: "last" }))
|
|
243
|
+
}, null, 8, ["disabled"])) : _("", !0)
|
|
195
244
|
])
|
|
196
245
|
]),
|
|
197
|
-
|
|
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
|
-
}),
|
|
249
|
+
}), te = /* @__PURE__ */ W(I, [["__scopeId", "data-v-7bb8233b"]]);
|
|
201
250
|
export {
|
|
202
|
-
|
|
251
|
+
te as default
|
|
203
252
|
};
|