energy-components 2.3.1 → 2.5.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/actionButton.es.js +31 -18
- package/dist/components/breadcrumbs.es.js +76 -52
- package/dist/components/link.es.js +63 -48
- package/dist/components/pagination.es.js +58 -47
- package/dist/components/persistentToast.es.js +34 -25
- package/dist/components/searchField.es.js +18 -9
- package/dist/components/sidedrawer.es.js +53 -40
- package/dist/components/style/actionButton.css +1 -1
- package/dist/components/style/breadcrumbs.css +1 -1
- package/dist/components/style/link.css +1 -1
- package/dist/components/style/pagination.css +1 -1
- package/dist/components/style/persistentToast.css +1 -1
- package/dist/components/style/searchField.css +1 -1
- package/dist/components/style/sidedrawer.css +1 -1
- package/dist/components/style/table.css +1 -1
- package/dist/components/style/toggle.css +1 -1
- package/dist/components/table.es.js +85 -82
- package/dist/components/toggle.es.js +92 -36
- package/dist/energy-components.css +1 -1
- package/dist/energy-components.es.js +4842 -4690
- 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 +62 -0
- package/dist/types/src/components/content/table/table.vue.d.ts +13 -0
- package/dist/types/src/components/feedback/persistent-toast/persistent-toast.vue.d.ts +15 -0
- package/dist/types/src/components/input/search-field/search-field.vue.d.ts +15 -0
- package/dist/types/src/components/input/toggle/toggle.vue.d.ts +20 -0
- package/dist/types/src/components/layout/sidedrawer/sidedrawer.vue.d.ts +18 -3
- package/dist/types/src/components/navigation/breadcrumbs/breadcrumbs.vue.d.ts +30 -0
- package/dist/types/src/components/navigation/link/link.vue.d.ts +5 -5
- package/dist/types/src/components/navigation/pagination/pagination.vue.d.ts +21 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/llms/rdsaccordion-group.md +6 -0
- package/llms/rdsaccordion.md +6 -0
- package/llms/rdsaction-button.md +1 -0
- package/llms/rdsbadge.md +5 -0
- package/llms/rdsbreadcrumbs.md +2 -0
- package/llms/rdsdate-picker.md +6 -0
- package/llms/rdsdropdown.md +6 -0
- package/llms/rdslink.md +1 -1
- package/llms/rdsmodal.md +9 -0
- package/llms/rdspagination.md +6 -0
- package/llms/rdspersistent-toast.md +1 -0
- package/llms/rdspopover-menu.md +7 -0
- package/llms/rdspopover.md +7 -0
- package/llms/rdssearch-field.md +7 -0
- package/llms/rdssidebar.md +9 -0
- package/llms/rdssidedrawer.md +9 -0
- package/llms/rdstable.md +8 -1
- package/llms/rdstext-field.md +6 -0
- package/llms/rdstoggle.md +5 -0
- package/llms/rdstooltip.md +7 -0
- package/package.json +1 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
1
|
+
import { defineComponent as V, toRefs as D, ref as b, computed as h, onMounted as A, openBlock as c, createElementBlock as L, normalizeClass as m, createElementVNode as E, createBlock as I, createCommentVNode as u, toDisplayString as F, nextTick as C } from "vue";
|
|
2
|
+
import { R as x } from "./icon-svg-CW3eQRcp.js";
|
|
3
|
+
import { _ as W } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
4
|
+
import './style/toggle.css';const $ = ["id", "aria-label"], N = ["id", "aria-checked", "aria-label", "tabindex"], K = { key: 1 }, M = ["id", "aria-checked", "aria-label", "tabindex"], j = { key: 1 }, q = /* @__PURE__ */ V({
|
|
4
5
|
__name: "toggle",
|
|
5
6
|
props: {
|
|
6
7
|
small: { type: Boolean },
|
|
@@ -11,53 +12,108 @@ import './style/toggle.css';const C = ["id"], G = ["id"], H = ["id"], W = /* @__
|
|
|
11
12
|
valueRight: {},
|
|
12
13
|
labelLeft: {},
|
|
13
14
|
labelRight: {},
|
|
15
|
+
iconLeft: {},
|
|
16
|
+
iconRight: {},
|
|
17
|
+
ariaLabelLeft: {},
|
|
18
|
+
ariaLabelRight: {},
|
|
19
|
+
ariaLabel: {},
|
|
14
20
|
id: {},
|
|
15
21
|
variant: {}
|
|
16
22
|
},
|
|
17
23
|
emits: ["update:modelValue"],
|
|
18
|
-
setup(
|
|
19
|
-
const
|
|
24
|
+
setup(a, { emit: B }) {
|
|
25
|
+
const t = a, s = B, { modelValue: d, switchType: g, valueLeft: R, valueRight: f, variant: G } = D(t), e = {
|
|
20
26
|
LEFT: "left",
|
|
21
27
|
RIGHT: "right"
|
|
22
|
-
},
|
|
23
|
-
const
|
|
24
|
-
return
|
|
25
|
-
}),
|
|
26
|
-
|
|
28
|
+
}, i = b(e.LEFT), T = b(null), y = b(null), H = h(() => {
|
|
29
|
+
const l = G?.value ?? "default";
|
|
30
|
+
return l === "navy" ? "rds-e-toggle--navy" : l === "floating" ? "rds-e-toggle--floating" : "";
|
|
31
|
+
}), n = h(() => !(t.iconLeft || t.iconRight) ? "label" : !!(t.labelLeft || t.labelRight) ? "icon-label" : "icon"), k = h(() => t.small ? 16 : 20), z = (l) => {
|
|
32
|
+
s("update:modelValue", l);
|
|
33
|
+
}, r = async (l) => {
|
|
34
|
+
i.value = l, z(
|
|
35
|
+
l === e.LEFT ? g?.value ? !0 : R?.value : g?.value ? !1 : f?.value
|
|
36
|
+
), await C(), l === e.LEFT ? T.value?.focus() : y.value?.focus();
|
|
37
|
+
}, S = (l) => {
|
|
38
|
+
if (["ArrowLeft", "ArrowRight", "Enter", " "].includes(l.key))
|
|
39
|
+
if (l.preventDefault(), l.key === "ArrowRight") {
|
|
40
|
+
const o = i.value === e.LEFT ? e.RIGHT : e.LEFT;
|
|
41
|
+
r(o);
|
|
42
|
+
} else if (l.key === "ArrowLeft") {
|
|
43
|
+
const o = i.value === e.RIGHT ? e.LEFT : e.RIGHT;
|
|
44
|
+
r(o);
|
|
45
|
+
} else {
|
|
46
|
+
const o = l.target, v = l.currentTarget.querySelectorAll(".rds-e-toggle__tab"), w = Array.from(v).indexOf(o);
|
|
47
|
+
r(w === 0 ? e.LEFT : w === 1 ? e.RIGHT : i.value);
|
|
48
|
+
}
|
|
27
49
|
};
|
|
28
|
-
return
|
|
29
|
-
n?.value ? (
|
|
30
|
-
}), (
|
|
31
|
-
id:
|
|
32
|
-
class:
|
|
50
|
+
return A(() => {
|
|
51
|
+
!!t.iconLeft != !!t.iconRight && console.warn("[RDSToggle] iconLeft e iconRight deben proporcionarse juntos para una visualización consistente."), n.value === "icon" && !t.ariaLabel && console.warn("[RDSToggle] ariaLabel es obligatorio en modo icon-only para garantizar accesibilidad."), n.value === "icon" && !t.ariaLabelLeft && console.warn("[RDSToggle] ariaLabelLeft es obligatorio en modo icon-only para garantizar accesibilidad."), n.value === "icon" && !t.ariaLabelRight && console.warn("[RDSToggle] ariaLabelRight es obligatorio en modo icon-only para garantizar accesibilidad."), g?.value ? (s("update:modelValue", d?.value), i.value = d?.value ? e.RIGHT : e.LEFT) : d?.value === f?.value ? (s("update:modelValue", f?.value), i.value = e.RIGHT) : (s("update:modelValue", R?.value), i.value = e.LEFT);
|
|
52
|
+
}), (l, o) => (c(), L("div", {
|
|
53
|
+
id: a.id,
|
|
54
|
+
class: m(["rds-e-toggle", [
|
|
33
55
|
{
|
|
34
|
-
"rds-e-toggle--small-full-width":
|
|
35
|
-
"rds-e-toggle--full-width":
|
|
36
|
-
"rds-e-toggle--small":
|
|
37
|
-
"rds-e-toggle--width": !
|
|
56
|
+
"rds-e-toggle--small-full-width": a.small && a.fullWidth,
|
|
57
|
+
"rds-e-toggle--full-width": a.fullWidth && !a.small,
|
|
58
|
+
"rds-e-toggle--small": a.small && !a.fullWidth,
|
|
59
|
+
"rds-e-toggle--width": !a.small && !a.fullWidth,
|
|
60
|
+
"rds-e-toggle--icon-mode": n.value === "icon"
|
|
38
61
|
},
|
|
39
|
-
|
|
40
|
-
]])
|
|
62
|
+
H.value
|
|
63
|
+
]]),
|
|
64
|
+
role: "radiogroup",
|
|
65
|
+
"aria-label": a.ariaLabel,
|
|
66
|
+
onKeydown: S
|
|
41
67
|
}, [
|
|
42
|
-
|
|
43
|
-
id:
|
|
44
|
-
|
|
45
|
-
|
|
68
|
+
E("button", {
|
|
69
|
+
id: a.id ? `${a.id}-left` : void 0,
|
|
70
|
+
ref_key: "leftBtnRef",
|
|
71
|
+
ref: T,
|
|
72
|
+
class: m(["rds-e-toggle__tab", {
|
|
73
|
+
"rds-e-toggle__tab--active": i.value === e.LEFT,
|
|
74
|
+
"rds-e-toggle__tab--icon-only": n.value === "icon"
|
|
46
75
|
}]),
|
|
47
76
|
type: "button",
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
77
|
+
role: "radio",
|
|
78
|
+
"aria-checked": i.value === e.LEFT,
|
|
79
|
+
"aria-label": n.value === "icon" ? a.ariaLabelLeft : void 0,
|
|
80
|
+
tabindex: i.value === e.LEFT ? 0 : -1,
|
|
81
|
+
onClick: o[0] || (o[0] = (v) => r(e.LEFT))
|
|
82
|
+
}, [
|
|
83
|
+
n.value !== "label" ? (c(), I(x, {
|
|
84
|
+
key: 0,
|
|
85
|
+
class: "rds-e-toggle__tab-icon",
|
|
86
|
+
name: t.iconLeft ?? "replace_this_icon",
|
|
87
|
+
size: k.value
|
|
88
|
+
}, null, 8, ["name", "size"])) : u("", !0),
|
|
89
|
+
a.labelLeft ? (c(), L("span", K, F(a.labelLeft), 1)) : u("", !0)
|
|
90
|
+
], 10, N),
|
|
91
|
+
E("button", {
|
|
92
|
+
id: a.id ? `${a.id}-right` : void 0,
|
|
93
|
+
ref_key: "rightBtnRef",
|
|
94
|
+
ref: y,
|
|
95
|
+
class: m(["rds-e-toggle__tab", {
|
|
96
|
+
"rds-e-toggle__tab--active": i.value === e.RIGHT,
|
|
97
|
+
"rds-e-toggle__tab--icon-only": n.value === "icon"
|
|
54
98
|
}]),
|
|
55
99
|
type: "button",
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
100
|
+
role: "radio",
|
|
101
|
+
"aria-checked": i.value === e.RIGHT,
|
|
102
|
+
"aria-label": n.value === "icon" ? a.ariaLabelRight : void 0,
|
|
103
|
+
tabindex: i.value === e.RIGHT ? 0 : -1,
|
|
104
|
+
onClick: o[1] || (o[1] = (v) => r(e.RIGHT))
|
|
105
|
+
}, [
|
|
106
|
+
n.value !== "label" ? (c(), I(x, {
|
|
107
|
+
key: 0,
|
|
108
|
+
class: "rds-e-toggle__tab-icon",
|
|
109
|
+
name: t.iconRight ?? "replace_this_icon",
|
|
110
|
+
size: k.value
|
|
111
|
+
}, null, 8, ["name", "size"])) : u("", !0),
|
|
112
|
+
a.labelRight ? (c(), L("span", j, F(a.labelRight), 1)) : u("", !0)
|
|
113
|
+
], 10, M)
|
|
114
|
+
], 42, $));
|
|
59
115
|
}
|
|
60
|
-
}),
|
|
116
|
+
}), p = /* @__PURE__ */ W(q, [["__scopeId", "data-v-4dc4c0be"]]);
|
|
61
117
|
export {
|
|
62
|
-
|
|
118
|
+
p as default
|
|
63
119
|
};
|