energy-components 1.14.2 → 1.15.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/accordion.es.js +30 -27
- package/dist/components/actionButton.es.js +56 -11
- package/dist/components/avatar.es.js +24 -16
- package/dist/components/breadcrumbs.es.js +37 -29
- package/dist/components/button.es.js +31 -22
- package/dist/components/card.es.js +17 -9
- package/dist/components/checkbox.es.js +67 -56
- package/dist/components/collapsable.es.js +1 -1
- package/dist/components/{collapsable.scss_vue_type_style_index_0_src_true_lang-DfOWp1XD.js → collapsable.scss_vue_type_style_index_0_src_true_lang-Bi5q6Y3n.js} +1 -1
- package/dist/components/directAccess.es.js +26 -18
- package/dist/components/dragAndDrop.es.js +1 -1
- package/dist/components/dropdown.es.js +27 -27
- package/dist/components/fileUploadItem.es.js +23 -21
- package/dist/components/filterChip.es.js +22 -14
- package/dist/components/filterTag.es.js +27 -19
- package/dist/components/floating-ui.vue-7LKzPqHI.js +1148 -0
- package/dist/components/floatingActionButton.es.js +19 -11
- package/dist/components/{icon-svg-DuzOdbk1.js → icon-svg-BU0OQFKH.js} +990 -742
- package/dist/components/iconList.es.js +1 -1
- package/dist/components/iconSvg.es.js +1 -1
- package/dist/components/index.es.js +83 -77
- package/dist/components/indicator.es.js +37 -29
- package/dist/components/infoBox.es.js +47 -39
- package/dist/components/link.es.js +22 -13
- package/dist/components/loader.es.js +22 -21
- package/dist/components/modal.es.js +37 -28
- package/dist/components/overlay.es.js +21 -11
- package/dist/components/pagination.es.js +164 -109
- package/dist/components/persistentToast.es.js +32 -24
- package/dist/components/popover.es.js +166 -0
- package/dist/components/progressBar.es.js +30 -22
- package/dist/components/quantitySelector.es.js +60 -48
- package/dist/components/radioButton.es.js +1 -1
- package/dist/components/selectionChip.es.js +15 -7
- package/dist/components/sidedrawer.es.js +1 -1
- package/dist/components/snackBar.es.js +131 -0
- package/dist/components/style/accordion.css +1 -1
- package/dist/components/style/actionButton.css +1 -1
- package/dist/components/style/avatar.css +1 -1
- package/dist/components/style/breadcrumbs.css +1 -1
- package/dist/components/style/button.css +1 -1
- package/dist/components/style/card.css +1 -1
- package/dist/components/style/checkbox.css +1 -1
- package/dist/components/style/directAccess.css +1 -1
- package/dist/components/style/fileUploadItem.css +1 -1
- package/dist/components/style/filterChip.css +1 -1
- package/dist/components/style/filterTag.css +1 -1
- package/dist/components/style/floatingActionButton.css +1 -1
- package/dist/components/style/icon-svg.css +1 -1
- package/dist/components/style/indicator.css +1 -1
- package/dist/components/style/infoBox.css +1 -1
- package/dist/components/style/link.css +1 -1
- package/dist/components/style/loader.css +1 -1
- package/dist/components/style/modal.css +1 -1
- package/dist/components/style/overlay.css +1 -1
- package/dist/components/style/pagination.css +1 -1
- package/dist/components/style/persistentToast.css +1 -1
- package/dist/components/style/popover.css +1 -0
- package/dist/components/style/progressBar.css +1 -1
- package/dist/components/style/quantitySelector.css +1 -1
- package/dist/components/style/selectionChip.css +1 -1
- package/dist/components/style/snackBar.css +1 -0
- package/dist/components/style/tabBar.css +1 -1
- package/dist/components/style/tag.css +1 -1
- package/dist/components/style/toggle.css +1 -1
- package/dist/components/style/tooltip.css +1 -1
- package/dist/components/switch.es.js +1 -1
- package/dist/components/tabBar.es.js +23 -15
- package/dist/components/tableslotedcomponent.es.js +1 -1
- package/dist/components/tag.es.js +31 -23
- package/dist/components/textArea.es.js +1 -1
- package/dist/components/textField.es.js +1 -1
- package/dist/components/toggle.es.js +20 -16
- package/dist/components/tooltip.es.js +71 -1019
- package/dist/energy-components.es.js +6845 -5844
- package/dist/energy-components.umd.js +2 -2
- package/dist/style.css +1 -1
- package/dist/types/src/components/buttons/action-button/action-button.vue.d.ts +47 -0
- package/dist/types/src/components/buttons/button/button.vue.d.ts +15 -0
- package/dist/types/src/components/buttons/floating-action-button/floating-action-button.vue.d.ts +15 -0
- package/dist/types/src/components/content/avatar/avatar.vue.d.ts +15 -0
- package/dist/types/src/components/content/card/card.vue.d.ts +15 -0
- package/dist/types/src/components/content/collapsable/collapsable.vue.d.ts +1 -1
- package/dist/types/src/components/content/tag/tag.vue.d.ts +15 -0
- package/dist/types/src/components/feedback/indicator/indicator.vue.d.ts +15 -0
- package/dist/types/src/components/feedback/info-box/info-box.vue.d.ts +15 -0
- package/dist/types/src/components/feedback/loader/loader.vue.d.ts +1 -1
- package/dist/types/src/components/feedback/persistent-toast/persistent-toast.vue.d.ts +15 -0
- package/dist/types/src/components/feedback/progress-bar/progress-bar.vue.d.ts +15 -0
- package/dist/types/src/components/feedback/snack-bar/snack-bar.vue.d.ts +180 -0
- package/dist/types/src/components/icon-svg/icon-svg.vue.d.ts +15 -0
- package/dist/types/src/components/index.d.ts +2 -0
- package/dist/types/src/components/input/checkbox/checkbox.vue.d.ts +24 -7
- package/dist/types/src/components/input/drag-and-drop/drag-and-drop.vue.d.ts +1 -1
- package/dist/types/src/components/input/file-upload-item/file-upload-item.vue.d.ts +1 -1
- package/dist/types/src/components/input/filter-chip/filter-chip.vue.d.ts +15 -0
- package/dist/types/src/components/input/filter-tag/filter-tag.vue.d.ts +15 -0
- package/dist/types/src/components/input/quantity-selector/quantity-selector.vue.d.ts +15 -0
- package/dist/types/src/components/input/selection-chip/selection-chip.vue.d.ts +15 -0
- package/dist/types/src/components/input/switch/switch.vue.d.ts +1 -1
- package/dist/types/src/components/input/toggle/toggle.vue.d.ts +4 -0
- package/dist/types/src/components/navigation/breadcrumbs/breadcrumbs.vue.d.ts +15 -0
- package/dist/types/src/components/navigation/direct-access/direct-access.vue.d.ts +15 -0
- package/dist/types/src/components/navigation/link/link.vue.d.ts +15 -0
- package/dist/types/src/components/navigation/pagination/pagination.vue.d.ts +47 -0
- package/dist/types/src/components/navigation/tab-bar/tab-bar.vue.d.ts +15 -0
- package/dist/types/src/components/overlay/modal/modal.vue.d.ts +15 -0
- package/dist/types/src/components/overlay/overlay/overlay.vue.d.ts +15 -0
- package/dist/types/src/components/overlay/popover/popover.vue.d.ts +35 -0
- package/dist/types/src/components/overlay/tooltip/tooltip.vue.d.ts +15 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as w, toRefs as b, computed as o, createElementBlock as f, openBlock as h, unref as
|
|
1
|
+
import { defineComponent as w, toRefs as b, computed as o, createElementBlock as f, openBlock as h, unref as s, normalizeStyle as S, normalizeClass as C, createElementVNode as a, mergeProps as B } from "vue";
|
|
2
2
|
import { _ as z } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
3
|
-
import './style/loader.css';const F = ["aria-label"], N = ["width", "height", "viewBox"], W = ["id"], E = ["stop-color"], M = ["stop-color"], D = ["stop-color"], I = ["stop-color"], L = ["cx", "cy", "r", "stroke-width"], P = ["cx", "cy", "r", "stroke-width", "stroke"], T = /* @__PURE__ */ w({
|
|
3
|
+
import './style/loader.css';const F = ["id", "aria-label"], N = ["width", "height", "viewBox"], W = ["id"], E = ["stop-color"], M = ["stop-color"], D = ["stop-color"], I = ["stop-color"], L = ["cx", "cy", "r", "stroke-width"], P = ["cx", "cy", "r", "stroke-width", "stroke"], T = /* @__PURE__ */ w({
|
|
4
4
|
__name: "loader",
|
|
5
5
|
props: {
|
|
6
6
|
/**
|
|
@@ -77,11 +77,11 @@ import './style/loader.css';const F = ["aria-label"], N = ["width", "height", "v
|
|
|
77
77
|
setup(r) {
|
|
78
78
|
const _ = r, {
|
|
79
79
|
size: m,
|
|
80
|
-
variant:
|
|
81
|
-
animationType:
|
|
82
|
-
strokeWidth:
|
|
80
|
+
variant: v,
|
|
81
|
+
animationType: n,
|
|
82
|
+
strokeWidth: d,
|
|
83
83
|
ariaLabel: g,
|
|
84
|
-
id:
|
|
84
|
+
id: u
|
|
85
85
|
} = b(_), i = {
|
|
86
86
|
stop000: "#FF9C00",
|
|
87
87
|
stop024: "#FF7E45",
|
|
@@ -90,12 +90,12 @@ import './style/loader.css';const F = ["aria-label"], N = ["width", "height", "v
|
|
|
90
90
|
}, e = o(() => {
|
|
91
91
|
const t = Number(m.value);
|
|
92
92
|
return t < 32 ? 32 : t > 120 ? 120 : t;
|
|
93
|
-
}),
|
|
93
|
+
}), c = o(() => d.value !== void 0 && d.value > 0 ? Number(d.value) : Math.max(2, Math.round(e.value / 8))), p = o(() => (e.value - c.value) / 2), l = o(() => 2 * Math.PI * p.value), y = o(() => [
|
|
94
94
|
"rds-e-loader",
|
|
95
|
-
`rds-e-loader--${
|
|
96
|
-
`rds-e-loader--animation-${
|
|
95
|
+
`rds-e-loader--${v.value}`,
|
|
96
|
+
`rds-e-loader--animation-${n.value}`
|
|
97
97
|
]), x = o(() => {
|
|
98
|
-
if (
|
|
98
|
+
if (v.value === "contained") {
|
|
99
99
|
const t = e.value + 48;
|
|
100
100
|
return {
|
|
101
101
|
width: `${t}px`,
|
|
@@ -107,12 +107,13 @@ import './style/loader.css';const F = ["aria-label"], N = ["width", "height", "v
|
|
|
107
107
|
width: `${e.value}px`,
|
|
108
108
|
height: `${e.value}px`
|
|
109
109
|
};
|
|
110
|
-
}), k = o(() =>
|
|
110
|
+
}), k = o(() => n.value === "normal" ? `${l.value * 0.75} ${l.value * 0.25}` : e.value > 70 ? `${l.value * 0.05} ${l.value * 0.95}` : `${l.value * 0.1} ${l.value * 0.9}`), $ = o(() => (n.value === "normal", 0));
|
|
111
111
|
return (t, j) => (h(), f("div", {
|
|
112
|
+
id: s(u),
|
|
112
113
|
class: C(y.value),
|
|
113
114
|
style: S(x.value),
|
|
114
115
|
role: "progressbar",
|
|
115
|
-
"aria-label":
|
|
116
|
+
"aria-label": s(g),
|
|
116
117
|
"aria-busy": "true"
|
|
117
118
|
}, [
|
|
118
119
|
(h(), f("svg", {
|
|
@@ -124,7 +125,7 @@ import './style/loader.css';const F = ["aria-label"], N = ["width", "height", "v
|
|
|
124
125
|
}, [
|
|
125
126
|
a("defs", null, [
|
|
126
127
|
a("linearGradient", {
|
|
127
|
-
id: `rds-loader-gradient-${
|
|
128
|
+
id: `rds-loader-gradient-${s(u)}`,
|
|
128
129
|
x1: "0.1605",
|
|
129
130
|
y1: "0.133",
|
|
130
131
|
x2: "0.8395",
|
|
@@ -153,26 +154,26 @@ import './style/loader.css';const F = ["aria-label"], N = ["width", "height", "v
|
|
|
153
154
|
class: "rds-e-loader__track",
|
|
154
155
|
cx: e.value / 2,
|
|
155
156
|
cy: e.value / 2,
|
|
156
|
-
r:
|
|
157
|
-
"stroke-width":
|
|
157
|
+
r: p.value,
|
|
158
|
+
"stroke-width": c.value,
|
|
158
159
|
fill: "none"
|
|
159
160
|
}, null, 8, L),
|
|
160
161
|
a("circle", B({
|
|
161
162
|
class: "rds-e-loader__arc",
|
|
162
163
|
cx: e.value / 2,
|
|
163
164
|
cy: e.value / 2,
|
|
164
|
-
r:
|
|
165
|
-
"stroke-width":
|
|
166
|
-
stroke: `url(#rds-loader-gradient-${
|
|
165
|
+
r: p.value,
|
|
166
|
+
"stroke-width": c.value,
|
|
167
|
+
stroke: `url(#rds-loader-gradient-${s(u)})`,
|
|
167
168
|
fill: "none",
|
|
168
169
|
"stroke-linecap": "round"
|
|
169
|
-
}, n
|
|
170
|
-
style: n
|
|
170
|
+
}, s(n) === "normal" ? { "stroke-dasharray": k.value, "stroke-dashoffset": $.value } : {}, {
|
|
171
|
+
style: s(n) === "infinite" ? { "--circumference": `${l.value}px` } : {}
|
|
171
172
|
}), null, 16, P)
|
|
172
173
|
], 8, N))
|
|
173
174
|
], 14, F));
|
|
174
175
|
}
|
|
175
|
-
}), O = /* @__PURE__ */ z(T, [["__scopeId", "data-v-
|
|
176
|
+
}), O = /* @__PURE__ */ z(T, [["__scopeId", "data-v-9f7a590b"]]);
|
|
176
177
|
export {
|
|
177
178
|
O as default
|
|
178
179
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { R as b } from "./icon-svg-
|
|
1
|
+
import { defineComponent as v, ref as C, computed as R, createBlock as u, createCommentVNode as l, openBlock as a, unref as n, withCtx as c, createVNode as k, withModifiers as g, normalizeStyle as S, createElementVNode as r, createElementBlock as p, renderSlot as i } from "vue";
|
|
2
|
+
import w from "./overlay.es.js";
|
|
3
|
+
import x from "./card.es.js";
|
|
4
|
+
import { R as b } from "./icon-svg-BU0OQFKH.js";
|
|
5
5
|
import { _ as q } 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 = { class: "rds-e-modal__header-text" }, M = {
|
|
7
7
|
key: 0,
|
|
@@ -9,7 +9,7 @@ import './style/modal.css';const $ = { class: "rds-e-modal__container" }, B = {
|
|
|
9
9
|
}, N = { class: "rds-e-modal__body" }, W = {
|
|
10
10
|
key: 1,
|
|
11
11
|
class: "rds-e-modal__section-spacer"
|
|
12
|
-
}, D = { class: "rds-e-modal__footer" }, V = /* @__PURE__ */
|
|
12
|
+
}, D = { class: "rds-e-modal__footer" }, V = /* @__PURE__ */ v({
|
|
13
13
|
__name: "modal",
|
|
14
14
|
props: {
|
|
15
15
|
/**
|
|
@@ -48,7 +48,7 @@ import './style/modal.css';const $ = { class: "rds-e-modal__container" }, B = {
|
|
|
48
48
|
maxWidth: {
|
|
49
49
|
type: [String, Number],
|
|
50
50
|
default: 820,
|
|
51
|
-
validator: (
|
|
51
|
+
validator: (e) => typeof e == "number" ? !0 : /^\d+(?:px|em|rem|%)$/.test(e)
|
|
52
52
|
},
|
|
53
53
|
/**
|
|
54
54
|
* Ancho del modal en dispositivos de escritorio.
|
|
@@ -56,21 +56,28 @@ import './style/modal.css';const $ = { class: "rds-e-modal__container" }, B = {
|
|
|
56
56
|
width: {
|
|
57
57
|
type: [String, Number],
|
|
58
58
|
default: 600,
|
|
59
|
-
validator: (
|
|
59
|
+
validator: (e) => typeof e == "number" ? !0 : /^\d+(?:px|em|rem|%)$/.test(e)
|
|
60
|
+
},
|
|
61
|
+
/**
|
|
62
|
+
* ID del modal para testing
|
|
63
|
+
*/
|
|
64
|
+
id: {
|
|
65
|
+
type: String,
|
|
66
|
+
default: void 0
|
|
60
67
|
}
|
|
61
68
|
},
|
|
62
69
|
emits: ["onCloseRequest", "onOpenRequest", "onToggleRequest"],
|
|
63
|
-
setup(
|
|
64
|
-
const
|
|
65
|
-
const o = typeof
|
|
70
|
+
setup(e, { expose: f, emit: _ }) {
|
|
71
|
+
const t = e, s = _, y = C(null), h = R(() => {
|
|
72
|
+
const o = typeof t.maxWidth == "number" ? `${t.maxWidth}px` : t.maxWidth, d = typeof t.width == "number" ? `${t.width}px` : t.width;
|
|
66
73
|
return {
|
|
67
74
|
"--rds-modal-max-width": o,
|
|
68
|
-
"--rds-modal-width":
|
|
75
|
+
"--rds-modal-width": d
|
|
69
76
|
};
|
|
70
77
|
}), m = () => {
|
|
71
|
-
|
|
78
|
+
t.preventClose || s("onCloseRequest");
|
|
72
79
|
};
|
|
73
|
-
return
|
|
80
|
+
return f({
|
|
74
81
|
/**
|
|
75
82
|
* { () => void } Gestiona el clic fuera del modal.
|
|
76
83
|
*/
|
|
@@ -100,52 +107,54 @@ import './style/modal.css';const $ = { class: "rds-e-modal__container" }, B = {
|
|
|
100
107
|
toggleModal: () => {
|
|
101
108
|
s("onToggleRequest");
|
|
102
109
|
}
|
|
103
|
-
}), (o,
|
|
110
|
+
}), (o, d) => e.open ? (a(), u(n(w), {
|
|
104
111
|
key: 0,
|
|
112
|
+
id: e.id,
|
|
105
113
|
ref_key: "overlay",
|
|
106
114
|
ref: y,
|
|
107
115
|
class: "rds-e-modal__overlay",
|
|
108
|
-
teleport:
|
|
116
|
+
teleport: t.teleport,
|
|
109
117
|
onClick: m
|
|
110
118
|
}, {
|
|
111
119
|
default: c(() => [
|
|
112
|
-
k(n(
|
|
120
|
+
k(n(x), {
|
|
121
|
+
id: e.id ? `${e.id}-card` : void 0,
|
|
113
122
|
class: "rds-e-modal__card",
|
|
114
|
-
style:
|
|
115
|
-
onClick:
|
|
123
|
+
style: S(h.value),
|
|
124
|
+
onClick: d[1] || (d[1] = g(() => {
|
|
116
125
|
}, ["stop"]))
|
|
117
126
|
}, {
|
|
118
127
|
default: c(() => [
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
128
|
+
r("div", $, [
|
|
129
|
+
r("div", B, [
|
|
130
|
+
r("div", O, [
|
|
122
131
|
i(o.$slots, "header", {}, void 0, !0)
|
|
123
132
|
]),
|
|
124
|
-
|
|
133
|
+
t.showClose ? (a(), u(n(b), {
|
|
125
134
|
key: 0,
|
|
126
135
|
class: "rds-e-modal__header-close",
|
|
127
136
|
name: "close",
|
|
128
137
|
small: "",
|
|
129
|
-
onClick:
|
|
138
|
+
onClick: d[0] || (d[0] = () => s("onCloseRequest"))
|
|
130
139
|
})) : l("", !0)
|
|
131
140
|
]),
|
|
132
141
|
o.$slots.body ? (a(), p("span", M)) : l("", !0),
|
|
133
|
-
|
|
142
|
+
r("div", N, [
|
|
134
143
|
i(o.$slots, "body", {}, void 0, !0)
|
|
135
144
|
]),
|
|
136
145
|
o.$slots.footer ? (a(), p("span", W)) : l("", !0),
|
|
137
|
-
|
|
146
|
+
r("div", D, [
|
|
138
147
|
i(o.$slots, "footer", {}, void 0, !0)
|
|
139
148
|
])
|
|
140
149
|
])
|
|
141
150
|
]),
|
|
142
151
|
_: 3
|
|
143
|
-
}, 8, ["style"])
|
|
152
|
+
}, 8, ["id", "style"])
|
|
144
153
|
]),
|
|
145
154
|
_: 3
|
|
146
|
-
}, 8, ["teleport"])) : l("", !0);
|
|
155
|
+
}, 8, ["id", "teleport"])) : l("", !0);
|
|
147
156
|
}
|
|
148
|
-
}), A = /* @__PURE__ */ q(V, [["__scopeId", "data-v-
|
|
157
|
+
}), A = /* @__PURE__ */ q(V, [["__scopeId", "data-v-c9a881de"]]);
|
|
149
158
|
export {
|
|
150
159
|
A as default
|
|
151
160
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as d, createBlock as s, openBlock as a, Teleport as n, createElementVNode as o, mergeProps as l, renderSlot as i } from "vue";
|
|
2
2
|
import { _ as c } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
3
|
-
import './style/overlay.css';const _ = { class: "rds-e-overlay__content" },
|
|
3
|
+
import './style/overlay.css';const p = ["id"], _ = { class: "rds-e-overlay__content" }, f = /* @__PURE__ */ d({
|
|
4
4
|
__name: "overlay",
|
|
5
5
|
props: {
|
|
6
6
|
/**
|
|
@@ -11,21 +11,31 @@ import './style/overlay.css';const _ = { class: "rds-e-overlay__content" }, i =
|
|
|
11
11
|
type: String,
|
|
12
12
|
default: "body",
|
|
13
13
|
required: !0
|
|
14
|
+
},
|
|
15
|
+
/**
|
|
16
|
+
* ID para testing
|
|
17
|
+
*/
|
|
18
|
+
id: {
|
|
19
|
+
type: String,
|
|
20
|
+
default: void 0
|
|
14
21
|
}
|
|
15
22
|
},
|
|
16
|
-
setup(
|
|
17
|
-
const r =
|
|
18
|
-
return (
|
|
23
|
+
setup(e) {
|
|
24
|
+
const r = e;
|
|
25
|
+
return (t, u) => (a(), s(n, {
|
|
19
26
|
to: r.teleport
|
|
20
27
|
}, [
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
28
|
+
o("div", l({
|
|
29
|
+
id: e.id,
|
|
30
|
+
class: "rds-e-overlay"
|
|
31
|
+
}, t.$attrs), [
|
|
32
|
+
o("div", _, [
|
|
33
|
+
i(t.$slots, "default", {}, void 0, !0)
|
|
24
34
|
])
|
|
25
|
-
], 16)
|
|
35
|
+
], 16, p)
|
|
26
36
|
], 8, ["to"]));
|
|
27
37
|
}
|
|
28
|
-
}),
|
|
38
|
+
}), y = /* @__PURE__ */ c(f, [["__scopeId", "data-v-f5f6d56b"]]);
|
|
29
39
|
export {
|
|
30
|
-
|
|
40
|
+
y as default
|
|
31
41
|
};
|
|
@@ -1,13 +1,17 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
1
|
+
import { defineComponent as J, toRefs as K, ref as Q, computed as o, watch as W, onBeforeMount as X, createElementBlock as c, openBlock as r, createElementVNode as b, createCommentVNode as k, createBlock as x, createVNode as P, Fragment as Y, renderList as Z, unref as C, toDisplayString as B } from "vue";
|
|
2
|
+
import p from "./actionButton.es.js";
|
|
3
|
+
import T from "./dropdown.es.js";
|
|
4
|
+
import { _ as I } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
5
|
+
import './style/pagination.css';const ee = ["id"], ae = { class: "rds-e-pagination" }, le = {
|
|
5
6
|
key: 0,
|
|
6
7
|
class: "rds-e-pagination__item rds-e-pagination__item-elipsis"
|
|
7
|
-
},
|
|
8
|
+
}, ie = {
|
|
9
|
+
key: 0,
|
|
10
|
+
class: "rds-e-pagination__dropdown"
|
|
11
|
+
}, te = {
|
|
8
12
|
key: 0,
|
|
9
13
|
class: "rds-e-pagination-leyend"
|
|
10
|
-
},
|
|
14
|
+
}, ne = /* @__PURE__ */ J({
|
|
11
15
|
__name: "pagination",
|
|
12
16
|
props: {
|
|
13
17
|
/**
|
|
@@ -81,172 +85,223 @@ import './style/pagination.css';const X = { class: "rds-e-pagination-container r
|
|
|
81
85
|
enableEllipsis: {
|
|
82
86
|
type: Boolean,
|
|
83
87
|
default: !1
|
|
88
|
+
},
|
|
89
|
+
/**
|
|
90
|
+
* Habilita la funcionalidad de selector de paginación.
|
|
91
|
+
* Añade un dropdown para seleccionar la página. Cómo máximo se muestran 3 páginas en la paginación
|
|
92
|
+
*/
|
|
93
|
+
enablePageDropdown: {
|
|
94
|
+
type: Boolean,
|
|
95
|
+
default: !1
|
|
96
|
+
},
|
|
97
|
+
/**
|
|
98
|
+
* Label para el dropdown de selección de página.
|
|
99
|
+
*/
|
|
100
|
+
pageDropdownLabel: {
|
|
101
|
+
type: String,
|
|
102
|
+
default: ""
|
|
103
|
+
},
|
|
104
|
+
/**
|
|
105
|
+
* ID de la paginación para testing
|
|
106
|
+
*/
|
|
107
|
+
id: {
|
|
108
|
+
type: String,
|
|
109
|
+
default: void 0
|
|
84
110
|
}
|
|
85
111
|
},
|
|
86
112
|
emits: ["pageChanged", "ellipsisClicked"],
|
|
87
|
-
setup(
|
|
88
|
-
const
|
|
89
|
-
itemsPerPage:
|
|
90
|
-
totalItems:
|
|
91
|
-
totalPages:
|
|
92
|
-
hideLeyend:
|
|
93
|
-
disableFirstLoad:
|
|
94
|
-
enableEllipsis:
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
113
|
+
setup(s, { expose: L, emit: M }) {
|
|
114
|
+
const h = s, $ = M, {
|
|
115
|
+
itemsPerPage: g,
|
|
116
|
+
totalItems: i,
|
|
117
|
+
totalPages: d,
|
|
118
|
+
hideLeyend: E,
|
|
119
|
+
disableFirstLoad: V,
|
|
120
|
+
enableEllipsis: _,
|
|
121
|
+
enablePageDropdown: w,
|
|
122
|
+
pageDropdownLabel: S
|
|
123
|
+
} = K(h), t = Q(h.currentPage), m = o(() => typeof (i == null ? void 0 : i.value) == "number" && i.value >= 0), v = o(() => m.value && typeof (i == null ? void 0 : i.value) == "number" ? i.value <= 0 || g.value <= 0 ? 1 : Math.ceil(i.value / g.value) : typeof (d == null ? void 0 : d.value) == "number" && d.value > 0 ? d.value : (typeof (d == null ? void 0 : d.value) > "u" && typeof (i == null ? void 0 : i.value) > "u" && console.warn("[RDSPagination] Props `totalItems` o `totalPages` son requeridas."), 1)), F = o(() => m.value && !E.value && typeof (i == null ? void 0 : i.value) == "number" && i.value > 0), R = o(() => !m.value || typeof (i == null ? void 0 : i.value) != "number" || i.value === 0 ? 0 : (t.value - 1) * g.value + 1), q = o(() => {
|
|
124
|
+
if (!m.value || typeof (i == null ? void 0 : i.value) != "number") return 0;
|
|
125
|
+
const a = t.value * g.value;
|
|
126
|
+
return Math.min(a, i.value);
|
|
127
|
+
}), D = o(() => t.value === 1), N = o(() => t.value === v.value), j = o(() => {
|
|
128
|
+
const a = [], e = v.value, l = t.value;
|
|
129
|
+
if (!_.value || w.value) {
|
|
130
|
+
if (e <= 3)
|
|
131
|
+
for (let n = 1; n <= e; n++)
|
|
132
|
+
a.push(n);
|
|
133
|
+
else l === 1 ? a.push(1, 2, Math.min(3, e)) : l === e ? a.push(Math.max(1, e - 2), e - 1, e) : a.push(l - 1, l, l + 1);
|
|
134
|
+
return [...new Set(a)].filter((n) => typeof n == "number" && n >= 1 && n <= e);
|
|
107
135
|
}
|
|
108
|
-
if (
|
|
109
|
-
for (let n = 1; n <=
|
|
110
|
-
|
|
111
|
-
return
|
|
136
|
+
if (e <= 5) {
|
|
137
|
+
for (let n = 1; n <= e; n++)
|
|
138
|
+
a.push(n);
|
|
139
|
+
return a;
|
|
112
140
|
}
|
|
113
|
-
return
|
|
114
|
-
}),
|
|
115
|
-
const a =
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
for (let
|
|
121
|
-
n.push(
|
|
141
|
+
return a.push(1), l <= 3 ? (a.push(2, 3), e > 4 && a.push("ellipsis_end"), a.push(e)) : l >= e - 2 ? (e > 4 && a.push("ellipsis_start"), a.push(e - 2, e - 1, e)) : (a.push("ellipsis_start"), a.push(l - 1, l, l + 1), a.push("ellipsis_end"), a.push(e)), a.filter((n, u, y) => y.indexOf(n) === u);
|
|
142
|
+
}), A = o(() => {
|
|
143
|
+
const a = v.value;
|
|
144
|
+
return Array.from({ length: a }, (e, l) => String(l + 1));
|
|
145
|
+
}), O = (a) => {
|
|
146
|
+
const e = v.value, l = t.value, n = [];
|
|
147
|
+
if (a === "ellipsis_start")
|
|
148
|
+
for (let u = 2; u < l - 1; u++)
|
|
149
|
+
n.push(u);
|
|
150
|
+
else if (a === "ellipsis_end")
|
|
151
|
+
for (let u = l + 2; u < e; u++)
|
|
152
|
+
n.push(u);
|
|
122
153
|
return n;
|
|
123
|
-
},
|
|
124
|
-
const
|
|
125
|
-
|
|
126
|
-
hiddenPages:
|
|
127
|
-
ellipsisType:
|
|
128
|
-
currentPage:
|
|
129
|
-
totalPages:
|
|
154
|
+
}, U = (a) => {
|
|
155
|
+
const e = O(a);
|
|
156
|
+
$("ellipsisClicked", {
|
|
157
|
+
hiddenPages: e,
|
|
158
|
+
ellipsisType: a,
|
|
159
|
+
currentPage: t.value,
|
|
160
|
+
totalPages: v.value
|
|
130
161
|
});
|
|
131
|
-
},
|
|
132
|
-
let
|
|
133
|
-
const l =
|
|
134
|
-
if ("navigator" in
|
|
135
|
-
switch (
|
|
162
|
+
}, H = (a) => {
|
|
163
|
+
let e = t.value;
|
|
164
|
+
const l = v.value;
|
|
165
|
+
if ("navigator" in a)
|
|
166
|
+
switch (a.navigator) {
|
|
136
167
|
case "next":
|
|
137
|
-
|
|
168
|
+
t.value < l && (e = t.value + 1);
|
|
138
169
|
break;
|
|
139
170
|
case "prev":
|
|
140
|
-
|
|
171
|
+
t.value > 1 && (e = t.value - 1);
|
|
141
172
|
break;
|
|
142
173
|
case "first":
|
|
143
|
-
|
|
174
|
+
t.value !== 1 && (e = 1);
|
|
144
175
|
break;
|
|
145
176
|
case "last":
|
|
146
|
-
|
|
177
|
+
t.value !== l && (e = l);
|
|
147
178
|
break;
|
|
148
179
|
}
|
|
149
|
-
else "page" in
|
|
150
|
-
return
|
|
151
|
-
},
|
|
152
|
-
if (
|
|
153
|
-
const n =
|
|
154
|
-
let
|
|
155
|
-
|
|
156
|
-
const
|
|
157
|
-
...
|
|
158
|
-
page:
|
|
159
|
-
offset:
|
|
180
|
+
else "page" in a && typeof a.page == "number" && a.page >= 1 && a.page <= l && a.page !== t.value && (e = a.page);
|
|
181
|
+
return e !== t.value ? (t.value = e, !0) : !1;
|
|
182
|
+
}, f = (a, e = !1) => {
|
|
183
|
+
if (H(a) || e) {
|
|
184
|
+
const n = g.value, u = (t.value - 1) * n;
|
|
185
|
+
let y = u + n;
|
|
186
|
+
m.value && typeof (i == null ? void 0 : i.value) == "number" && (y = Math.min(u + n, i.value));
|
|
187
|
+
const G = {
|
|
188
|
+
...a,
|
|
189
|
+
page: t.value,
|
|
190
|
+
offset: u,
|
|
160
191
|
limit: n,
|
|
161
|
-
end:
|
|
162
|
-
reset:
|
|
192
|
+
end: y,
|
|
193
|
+
reset: e || void 0
|
|
163
194
|
};
|
|
164
|
-
|
|
195
|
+
$("pageChanged", G);
|
|
165
196
|
}
|
|
197
|
+
}, z = (a) => {
|
|
198
|
+
const e = Number(a);
|
|
199
|
+
e !== t.value && e >= 1 && e <= v.value && f({ page: e });
|
|
166
200
|
};
|
|
167
|
-
return
|
|
168
|
-
|
|
169
|
-
}),
|
|
170
|
-
|
|
171
|
-
}),
|
|
201
|
+
return W(() => h.currentPage, (a) => {
|
|
202
|
+
a !== t.value && a >= 1 && a <= v.value && (t.value = a);
|
|
203
|
+
}), X(() => {
|
|
204
|
+
V.value || f({ navigator: "first", page: 1 });
|
|
205
|
+
}), L({
|
|
172
206
|
/** Resetea la paginación a la primera página y emite el evento pageChanged. */
|
|
173
207
|
resetPagination: () => {
|
|
174
|
-
|
|
208
|
+
t.value !== 1 && f({ page: 1 }, !0);
|
|
175
209
|
}
|
|
176
|
-
}), (
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
210
|
+
}), (a, e) => (r(), c("div", {
|
|
211
|
+
id: s.id,
|
|
212
|
+
class: "rds-e-pagination-container rds-flex"
|
|
213
|
+
}, [
|
|
214
|
+
b("ul", ae, [
|
|
215
|
+
b("li", null, [
|
|
216
|
+
s.jumpTo ? (r(), x(p, {
|
|
180
217
|
key: 0,
|
|
218
|
+
id: s.id ? `${s.id}-first` : void 0,
|
|
181
219
|
class: "rds-e-pagination__actionBtn",
|
|
182
220
|
variant: "ghost",
|
|
183
221
|
small: "",
|
|
184
222
|
icon: "back",
|
|
185
223
|
"aria-label": "First Page",
|
|
186
|
-
disabled:
|
|
187
|
-
onClick:
|
|
188
|
-
}, null, 8, ["disabled"])) :
|
|
224
|
+
disabled: D.value,
|
|
225
|
+
onClick: e[0] || (e[0] = (l) => f({ navigator: "first" }))
|
|
226
|
+
}, null, 8, ["id", "disabled"])) : k("", !0)
|
|
189
227
|
]),
|
|
190
|
-
|
|
191
|
-
P(
|
|
228
|
+
b("li", null, [
|
|
229
|
+
P(p, {
|
|
230
|
+
id: s.id ? `${s.id}-prev` : void 0,
|
|
192
231
|
class: "rds-e-pagination__actionBtn",
|
|
193
232
|
variant: "ghost",
|
|
194
233
|
small: "",
|
|
195
234
|
icon: "arrow_left",
|
|
196
235
|
"aria-label": "Prev page",
|
|
197
|
-
disabled:
|
|
198
|
-
onClick:
|
|
199
|
-
}, null, 8, ["disabled"])
|
|
236
|
+
disabled: D.value,
|
|
237
|
+
onClick: e[1] || (e[1] = (l) => f({ navigator: "prev" }))
|
|
238
|
+
}, null, 8, ["id", "disabled"])
|
|
200
239
|
]),
|
|
201
|
-
(
|
|
202
|
-
typeof l == "string" && l.includes("ellipsis") ? (
|
|
203
|
-
P(
|
|
240
|
+
(r(!0), c(Y, null, Z(j.value, (l) => (r(), c("li", { key: l }, [
|
|
241
|
+
typeof l == "string" && l.includes("ellipsis") ? (r(), c("div", le, [
|
|
242
|
+
P(p, {
|
|
243
|
+
id: s.id ? `${s.id}-ellipsis-${l}` : void 0,
|
|
204
244
|
variant: "ghost",
|
|
205
245
|
small: "",
|
|
206
246
|
text: "...",
|
|
207
247
|
icon: "",
|
|
208
248
|
"aria-label": "Más páginas",
|
|
209
|
-
onClick: (n) =>
|
|
210
|
-
}, null, 8, ["onClick"])
|
|
211
|
-
])) : (
|
|
249
|
+
onClick: (n) => U(l)
|
|
250
|
+
}, null, 8, ["id", "onClick"])
|
|
251
|
+
])) : (r(), x(p, {
|
|
212
252
|
key: 1,
|
|
253
|
+
id: s.id ? `${s.id}-page-${l}` : void 0,
|
|
213
254
|
class: "rds-e-pagination__item",
|
|
214
|
-
variant: l ===
|
|
255
|
+
variant: l === t.value && h.selected ? "primary" : "ghost",
|
|
215
256
|
small: "",
|
|
216
257
|
text: String(l),
|
|
217
258
|
icon: "",
|
|
218
259
|
"aria-label": `page number ${l}`,
|
|
219
|
-
onClick: (n) =>
|
|
220
|
-
}, null, 8, ["variant", "text", "aria-label", "onClick"]))
|
|
260
|
+
onClick: (n) => f({ page: l })
|
|
261
|
+
}, null, 8, ["id", "variant", "text", "aria-label", "onClick"]))
|
|
221
262
|
]))), 128)),
|
|
222
|
-
|
|
223
|
-
P(
|
|
263
|
+
b("li", null, [
|
|
264
|
+
P(p, {
|
|
265
|
+
id: s.id ? `${s.id}-next` : void 0,
|
|
224
266
|
class: "rds-e-pagination__actionBtn",
|
|
225
267
|
variant: "ghost",
|
|
226
268
|
icon: "arrow_right",
|
|
227
269
|
small: "",
|
|
228
270
|
"aria-label": "next page",
|
|
229
271
|
disabled: N.value,
|
|
230
|
-
onClick:
|
|
231
|
-
}, null, 8, ["disabled"])
|
|
272
|
+
onClick: e[2] || (e[2] = (l) => f({ navigator: "next" }))
|
|
273
|
+
}, null, 8, ["id", "disabled"])
|
|
232
274
|
]),
|
|
233
|
-
|
|
234
|
-
|
|
275
|
+
b("li", null, [
|
|
276
|
+
s.jumpTo ? (r(), x(p, {
|
|
235
277
|
key: 0,
|
|
278
|
+
id: s.id ? `${s.id}-last` : void 0,
|
|
236
279
|
class: "rds-e-pagination__actionBtn",
|
|
237
280
|
variant: "ghost",
|
|
238
281
|
small: "",
|
|
239
282
|
icon: "last",
|
|
240
283
|
"aria-label": "last page",
|
|
241
284
|
disabled: N.value,
|
|
242
|
-
onClick:
|
|
243
|
-
}, null, 8, ["disabled"])) :
|
|
244
|
-
])
|
|
285
|
+
onClick: e[3] || (e[3] = (l) => f({ navigator: "last" }))
|
|
286
|
+
}, null, 8, ["id", "disabled"])) : k("", !0)
|
|
287
|
+
]),
|
|
288
|
+
C(w) ? (r(), c("li", ie, [
|
|
289
|
+
P(T, {
|
|
290
|
+
id: "rds-dropdown-pagination",
|
|
291
|
+
modelValue: t.value,
|
|
292
|
+
"onUpdate:modelValue": e[4] || (e[4] = (l) => t.value = l),
|
|
293
|
+
label: C(S) ? C(S) : t.value.toString(),
|
|
294
|
+
options: A.value,
|
|
295
|
+
small: "",
|
|
296
|
+
"text-only": "",
|
|
297
|
+
onSelect: z
|
|
298
|
+
}, null, 8, ["modelValue", "label", "options"])
|
|
299
|
+
])) : k("", !0)
|
|
245
300
|
]),
|
|
246
|
-
|
|
247
|
-
]));
|
|
301
|
+
F.value ? (r(), c("p", te, " Mostrando resultados " + B(R.value) + "-" + B(q.value) + " de " + B(C(i)), 1)) : k("", !0)
|
|
302
|
+
], 8, ee));
|
|
248
303
|
}
|
|
249
|
-
}),
|
|
304
|
+
}), de = /* @__PURE__ */ I(ne, [["__scopeId", "data-v-755635ef"]]);
|
|
250
305
|
export {
|
|
251
|
-
|
|
306
|
+
de as default
|
|
252
307
|
};
|