energy-components 2.0.0-beta.1 → 2.0.0-beta.3
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 +66 -50
- package/dist/components/accordionGroup.es.js +13 -12
- package/dist/components/avatar.es.js +7 -7
- package/dist/components/button.es.js +55 -58
- package/dist/components/checkbox.es.js +59 -60
- package/dist/components/collapsable.es.js +1 -1
- package/dist/components/{collapsable.scss_vue_type_style_index_0_src_true_lang-BERfoghR.js → collapsable.scss_vue_type_style_index_0_src_true_lang-CwEWYCf1.js} +10 -10
- package/dist/components/collapsable.scss_vue_type_style_index_0_src_true_lang-DGVMcmcy.js +86 -0
- package/dist/components/datepicker.es.js +2384 -2326
- package/dist/components/directAccess.es.js +7 -7
- package/dist/components/dragAndDrop.es.js +14 -14
- package/dist/components/dropdown.es.js +281 -261
- package/dist/components/fileUploadItem.es.js +18 -18
- package/dist/components/filterChip.es.js +9 -9
- package/dist/components/filterTag.es.js +7 -7
- package/dist/components/{icon-svg-DxlNo61Q.js → icon-svg-9fQGq_1_.js} +1 -1
- package/dist/components/icon-svg-CTR8GnC2.js +895 -0
- package/dist/components/iconList.es.js +7 -7
- package/dist/components/iconSvg.es.js +1 -1
- package/dist/components/index.es.js +25 -25
- package/dist/components/infoBox.es.js +17 -17
- package/dist/components/link.es.js +73 -72
- package/dist/components/modal.es.js +247 -88
- package/dist/components/multiselect.es.js +39 -28
- package/dist/components/overlay.es.js +23 -20
- package/dist/components/persistentToast.es.js +11 -11
- package/dist/components/popover.es.js +17 -17
- package/dist/components/popoverMenu.es.js +21 -21
- package/dist/components/progressBar.es.js +8 -8
- package/dist/components/quantitySelector.es.js +12 -12
- package/dist/components/radioButton.es.js +14 -14
- package/dist/components/selectionChip.es.js +5 -5
- package/dist/components/sidedrawer.es.js +19 -19
- package/dist/components/style/accordion.css +1 -1
- package/dist/components/style/accordionGroup.css +1 -1
- package/dist/components/style/button.css +1 -1
- package/dist/components/style/checkbox.css +1 -1
- package/dist/components/style/datepicker.css +1 -1
- package/dist/components/style/dropdown.css +1 -1
- package/dist/components/style/icon-svg.css +1 -1
- package/dist/components/style/link.css +1 -1
- package/dist/components/style/modal.css +1 -1
- package/dist/components/style/multiselect.css +1 -1
- package/dist/components/style/overlay.css +1 -1
- package/dist/components/style/{tablepaginatedcomponent.css → table.css} +1 -1
- package/dist/components/style/tableRenderer.css +1 -0
- package/dist/components/style/textArea.css +1 -1
- package/dist/components/style/textField.css +1 -1
- package/dist/components/style/tooltip.css +1 -1
- package/dist/components/switch.es.js +9 -9
- package/dist/components/tabBar.es.js +14 -14
- package/dist/components/table.es.js +235 -0
- package/dist/components/tableRenderer.es.js +229 -0
- package/dist/components/tag.es.js +6 -6
- package/dist/components/textArea.es.js +107 -110
- package/dist/components/textField.es.js +247 -170
- package/dist/components/tooltip.es.js +182 -107
- package/dist/components/types-CFEN6-OM.js +5 -0
- package/dist/composables/index.es.js +144 -0
- package/dist/energy-components.css +1 -1
- package/dist/energy-components.es.js +7181 -6722
- 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 +3 -3
- package/dist/types/src/components/buttons/button/button.vue.d.ts +20 -5
- package/dist/types/src/components/buttons/floating-action-button/floating-action-button.vue.d.ts +3 -3
- package/dist/types/src/components/content/accordion-group/types.d.ts +8 -0
- package/dist/types/src/components/content/avatar/avatar.vue.d.ts +1 -1
- package/dist/types/src/components/content/collapsable/collapsable.vue.d.ts +1 -1
- package/dist/types/src/components/content/table/table-renderer.vue.d.ts +56 -0
- package/dist/types/src/components/content/table/table.vue.d.ts +168 -0
- package/dist/types/src/components/content/tag/tag.vue.d.ts +3 -3
- package/dist/types/src/components/feedback/badge/badge.vue.d.ts +1 -1
- package/dist/types/src/components/icon-svg/icon-svg.vue.d.ts +23 -0
- package/dist/types/src/components/index.d.ts +2 -2
- package/dist/types/src/components/input/checkbox/checkbox.vue.d.ts +3 -20
- package/dist/types/src/components/input/datepicker/datepicker.vue.d.ts +57 -10
- package/dist/types/src/components/input/drag-and-drop/drag-and-drop.vue.d.ts +1 -1
- package/dist/types/src/components/input/dropdown/dropdown.vue.d.ts +31 -39
- package/dist/types/src/components/input/file-upload-item/file-upload-item.vue.d.ts +2 -2
- package/dist/types/src/components/input/filter-chip/filter-chip.vue.d.ts +4 -4
- package/dist/types/src/components/input/quantity-selector/quantity-selector.vue.d.ts +3 -3
- package/dist/types/src/components/input/radio-button/radio-button.vue.d.ts +1 -1
- package/dist/types/src/components/input/selection-chip/selection-chip.vue.d.ts +4 -4
- package/dist/types/src/components/input/switch/switch.vue.d.ts +1 -1
- package/dist/types/src/components/input/text-area/text-area.vue.d.ts +17 -13
- package/dist/types/src/components/input/text-field/text-field.vue.d.ts +128 -6
- package/dist/types/src/components/navigation/direct-access/direct-access.vue.d.ts +5 -5
- package/dist/types/src/components/navigation/link/link.vue.d.ts +4 -4
- package/dist/types/src/components/navigation/pagination/pagination.vue.d.ts +2 -2
- package/dist/types/src/components/navigation/tab-bar/tab-bar.vue.d.ts +2 -2
- package/dist/types/src/components/overlay/modal/modal.vue.d.ts +65 -5
- package/dist/types/src/components/overlay/overlay/overlay.vue.d.ts +8 -5
- package/dist/types/src/components/overlay/popover/popover.vue.d.ts +7 -7
- package/dist/types/src/components/overlay/popover-menu/popover-menu.vue.d.ts +5 -5
- package/dist/types/src/components/overlay/tooltip/tooltip.vue.d.ts +84 -4
- package/dist/types/src/composables/index.d.ts +4 -0
- package/dist/types/src/composables/useAriaDialog.d.ts +23 -0
- package/dist/types/src/composables/useBodyScrollLock.d.ts +14 -0
- package/dist/types/src/composables/useEscapeToClose.d.ts +14 -0
- package/dist/types/src/composables/useFocusTrap.d.ts +16 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/llms/00-installation.md +165 -0
- package/llms/01-migration-v2.md +364 -0
- package/llms/llms.txt +54 -0
- package/llms/rdsaccordion-group.md +7 -0
- package/llms/rdsaccordion.md +24 -0
- package/llms/rdsaction-button.md +15 -0
- package/llms/rdsavatar.md +20 -0
- package/llms/rdsbadge.md +17 -0
- package/llms/rdsbreadcrumbs.md +18 -0
- package/llms/rdsbutton.md +24 -0
- package/llms/rdscard.md +13 -0
- package/llms/rdscheckbox.md +30 -0
- package/llms/rdscollapsable.md +23 -0
- package/llms/rdsdate-picker.md +64 -0
- package/llms/rdsdirect-access.md +27 -0
- package/llms/rdsdivider.md +8 -0
- package/llms/rdsdrag-and-drop.md +30 -0
- package/llms/rdsdropdown.md +48 -0
- package/llms/rdsfile-upload-item.md +29 -0
- package/llms/rdsfilter-chip.md +21 -0
- package/llms/rdsfilter-tag.md +15 -0
- package/llms/rdsfloatin-action-button.md +15 -0
- package/llms/rdsicon-svg.md +13 -0
- package/llms/rdsindicator.md +13 -0
- package/llms/rdsinfo-box.md +17 -0
- package/llms/rdslink.md +32 -0
- package/llms/rdsloader.md +12 -0
- package/llms/rdsmodal.md +32 -0
- package/llms/rdsoverlay.md +18 -0
- package/llms/rdspagination.md +24 -0
- package/llms/rdspersistent-toast.md +23 -0
- package/llms/rdspopover-menu.md +29 -0
- package/llms/rdspopover.md +29 -0
- package/llms/rdsprogress-bar.md +25 -0
- package/llms/rdsquantity-selector.md +19 -0
- package/llms/rdsradio-button.md +12 -0
- package/llms/rdsradio-group.md +12 -0
- package/llms/rdsselection-chip.md +19 -0
- package/llms/rdssidebar.md +25 -0
- package/llms/rdssidedrawer.md +23 -0
- package/llms/rdssnack-bar.md +24 -0
- package/llms/rdsswitch.md +23 -0
- package/llms/rdstab-bar.md +26 -0
- package/llms/rdstable.md +49 -0
- package/llms/rdstag.md +15 -0
- package/llms/rdstext-area.md +35 -0
- package/llms/rdstext-field.md +52 -0
- package/llms/rdstoggle.md +20 -0
- package/llms/rdstooltip.md +37 -0
- package/package.json +5 -3
- package/dist/components/style/tableslotedcomponent.css +0 -1
- package/dist/components/tablepaginatedcomponent.es.js +0 -141
- package/dist/components/tableslotedcomponent.es.js +0 -297
- package/dist/types/src/components/content/table/table-paginated/TablePaginatedComponent.vue.d.ts +0 -88
- package/dist/types/src/components/content/table/table-sloted/TableSlotedComponent.vue.d.ts +0 -81
- /package/dist/types/src/components/content/{acordion-group → accordion-group}/accordion-group.d.ts +0 -0
- /package/dist/types/src/components/content/{acordion-group → accordion-group}/accordion-group.vue.d.ts +0 -0
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
1
|
+
import { defineComponent as B, toRefs as D, ref as p, watch as K, nextTick as T, inject as k, onMounted as $, onBeforeUnmount as A, createElementBlock as R, openBlock as f, createElementVNode as i, mergeProps as x, withKeys as z, toDisplayString as v, createBlock as N, createCommentVNode as V, createVNode as H, unref as m, normalizeClass as S, renderSlot as P, createTextVNode as U } from "vue";
|
|
2
|
+
import { R as j } from "./icon-svg-CTR8GnC2.js";
|
|
3
3
|
import E from "./tag.es.js";
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
4
|
+
import { R as F, U as I } from "./types-CFEN6-OM.js";
|
|
5
|
+
import { _ as M } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
6
|
+
import './style/accordion.css';const L = ["id"], G = ["aria-expanded", "aria-controls"], J = { class: "rds-e-accordion-title" }, Q = { class: "rds-e-accordion-title_right" }, W = {
|
|
6
7
|
key: 1,
|
|
7
8
|
class: "rds-e-accordion-title_label"
|
|
8
|
-
},
|
|
9
|
+
}, X = ["id", "aria-hidden"], Y = /* @__PURE__ */ B({
|
|
9
10
|
__name: "accordion",
|
|
10
11
|
props: {
|
|
11
12
|
/**
|
|
@@ -61,91 +62,106 @@ import './style/accordion.css';const M = ["id"], $ = { class: "rds-e-accordion-t
|
|
|
61
62
|
}
|
|
62
63
|
},
|
|
63
64
|
emits: ["update:open", "resized"],
|
|
64
|
-
setup(
|
|
65
|
-
const
|
|
66
|
-
let
|
|
65
|
+
setup(n, { expose: w, emit: O }) {
|
|
66
|
+
const a = n, g = O, { tag: c } = D(a), e = p(a.open), d = p(null), o = p(null);
|
|
67
|
+
let l = null, s = null;
|
|
67
68
|
const u = () => {
|
|
68
|
-
if (!d.value || !
|
|
69
|
-
const t =
|
|
69
|
+
if (!d.value || !o.value) return;
|
|
70
|
+
const t = o.value.scrollHeight;
|
|
70
71
|
d.value.style.maxHeight = e.value ? `${t}px` : "0px", e.value && g("resized", t);
|
|
71
|
-
},
|
|
72
|
+
}, r = (t) => {
|
|
72
73
|
t === void 0 ? e.value = !e.value : e.value = t, g("update:open", e.value), u();
|
|
73
|
-
},
|
|
74
|
-
|
|
75
|
-
},
|
|
76
|
-
|
|
74
|
+
}, h = () => {
|
|
75
|
+
r(!0);
|
|
76
|
+
}, y = () => {
|
|
77
|
+
r(!1);
|
|
78
|
+
}, _ = (t) => {
|
|
79
|
+
t.preventDefault(), r();
|
|
80
|
+
}, q = () => {
|
|
81
|
+
r();
|
|
77
82
|
};
|
|
78
|
-
|
|
79
|
-
() =>
|
|
80
|
-
(t) =>
|
|
81
|
-
|
|
83
|
+
K(
|
|
84
|
+
() => a.open,
|
|
85
|
+
(t) => T(() => {
|
|
86
|
+
r(t);
|
|
82
87
|
}),
|
|
83
88
|
{ immediate: !0 }
|
|
84
89
|
);
|
|
85
|
-
const
|
|
86
|
-
return
|
|
87
|
-
|
|
88
|
-
id:
|
|
89
|
-
open:
|
|
90
|
-
close:
|
|
91
|
-
}),
|
|
90
|
+
const b = k(F), C = k(I);
|
|
91
|
+
return $(() => {
|
|
92
|
+
b && b({
|
|
93
|
+
id: a.id,
|
|
94
|
+
open: h,
|
|
95
|
+
close: y
|
|
96
|
+
}), a.autoResize && o.value && (typeof ResizeObserver < "u" ? (l = new ResizeObserver(() => {
|
|
92
97
|
e.value && requestAnimationFrame(() => u());
|
|
93
|
-
}),
|
|
98
|
+
}), l.observe(o.value)) : (s = new MutationObserver(() => {
|
|
94
99
|
e.value && requestAnimationFrame(() => u());
|
|
95
|
-
}),
|
|
100
|
+
}), s.observe(o.value, {
|
|
96
101
|
childList: !0,
|
|
97
102
|
subtree: !0,
|
|
98
103
|
characterData: !0
|
|
99
104
|
})));
|
|
100
105
|
}), A(() => {
|
|
101
|
-
|
|
102
|
-
}),
|
|
106
|
+
C && C(a.id), l && o.value && l.unobserve(o.value), s && s.disconnect();
|
|
107
|
+
}), w({
|
|
103
108
|
/**
|
|
104
109
|
* Abre el panel.
|
|
105
110
|
*/
|
|
106
|
-
openPanel:
|
|
111
|
+
openPanel: h,
|
|
107
112
|
/**
|
|
108
113
|
* Cierra el panel.
|
|
109
114
|
*/
|
|
110
|
-
closePanel:
|
|
111
|
-
}), (t,
|
|
112
|
-
id:
|
|
115
|
+
closePanel: y
|
|
116
|
+
}), (t, Z) => (f(), R("div", {
|
|
117
|
+
id: n.id,
|
|
113
118
|
class: "rds-e-accordion"
|
|
114
119
|
}, [
|
|
115
|
-
i("
|
|
120
|
+
i("button", x({
|
|
116
121
|
class: "rds-e-accordion-title_container",
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
+
type: "button",
|
|
123
|
+
"aria-expanded": e.value,
|
|
124
|
+
"aria-controls": `${n.id}-panel`
|
|
125
|
+
}, t.$attrs, {
|
|
126
|
+
onClick: q,
|
|
127
|
+
onKeydown: [
|
|
128
|
+
z(_, ["enter"]),
|
|
129
|
+
z(_, ["space"])
|
|
130
|
+
]
|
|
131
|
+
}), [
|
|
132
|
+
i("span", J, v(n.title), 1),
|
|
133
|
+
i("div", Q, [
|
|
134
|
+
m(c) && m(c).icon ? (f(), N(E, x({
|
|
122
135
|
key: 0,
|
|
123
136
|
class: "rds-e-accordion-title_tag"
|
|
124
|
-
}, m(c), { small: "" }), null, 16)) :
|
|
137
|
+
}, m(c), { small: "" }), null, 16)) : n.label ? (f(), R("span", W, v(n.label), 1)) : V("", !0),
|
|
125
138
|
H(j, {
|
|
126
|
-
class:
|
|
139
|
+
class: S(["rds-e-accordion-title_icon", { "rds-e-accordion-title_icon--open": e.value }]),
|
|
127
140
|
name: "arrow_down"
|
|
128
141
|
}, null, 8, ["class"])
|
|
129
142
|
])
|
|
130
|
-
]),
|
|
143
|
+
], 16, G),
|
|
131
144
|
i("div", {
|
|
145
|
+
id: `${n.id}-panel`,
|
|
132
146
|
ref_key: "panel",
|
|
133
147
|
ref: d,
|
|
134
|
-
class:
|
|
148
|
+
class: S(["rds-e-accordion-panel", { "rds-e-accordion-panel--open": e.value }]),
|
|
149
|
+
role: "region",
|
|
150
|
+
"aria-hidden": !e.value
|
|
135
151
|
}, [
|
|
136
152
|
i("div", {
|
|
137
153
|
ref_key: "panelContent",
|
|
138
|
-
ref:
|
|
154
|
+
ref: o,
|
|
139
155
|
class: "rds-e-accordion-panel_content"
|
|
140
156
|
}, [
|
|
141
157
|
P(t.$slots, "default", {}, () => [
|
|
142
|
-
|
|
158
|
+
U(v(n.content), 1)
|
|
143
159
|
], !0)
|
|
144
160
|
], 512)
|
|
145
|
-
],
|
|
146
|
-
], 8,
|
|
161
|
+
], 10, X)
|
|
162
|
+
], 8, L));
|
|
147
163
|
}
|
|
148
|
-
}),
|
|
164
|
+
}), re = /* @__PURE__ */ M(Y, [["__scopeId", "data-v-31602dae"]]);
|
|
149
165
|
export {
|
|
150
|
-
|
|
166
|
+
re as default
|
|
151
167
|
};
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
1
|
+
import { defineComponent as l, ref as t, provide as c, createElementBlock as i, openBlock as a, renderSlot as d } from "vue";
|
|
2
|
+
import { R as p, U as u } from "./types-CFEN6-OM.js";
|
|
3
|
+
import { _ } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
4
|
+
import './style/accordionGroup.css';const f = { class: "rds-e-accordion-group" }, m = /* @__PURE__ */ l({
|
|
4
5
|
__name: "accordion-group",
|
|
5
|
-
setup(
|
|
6
|
+
setup(v, { expose: n }) {
|
|
6
7
|
const o = t([]);
|
|
7
|
-
return
|
|
8
|
+
return c(p, (e) => {
|
|
8
9
|
o.value.push(e);
|
|
9
|
-
}),
|
|
10
|
-
const
|
|
11
|
-
|
|
10
|
+
}), c(u, (e) => {
|
|
11
|
+
const r = o.value.findIndex((s) => s.id === e);
|
|
12
|
+
r > -1 && o.value.splice(r, 1);
|
|
12
13
|
}), n({
|
|
13
14
|
/**
|
|
14
15
|
* Abre todos los paneles del acordeón
|
|
@@ -22,11 +23,11 @@ import './style/accordionGroup.css';const u = { class: "rds-e-accordion-group" }
|
|
|
22
23
|
closeAll: () => {
|
|
23
24
|
o.value.forEach((e) => e.close());
|
|
24
25
|
}
|
|
25
|
-
}), (e,
|
|
26
|
-
|
|
26
|
+
}), (e, r) => (a(), i("div", f, [
|
|
27
|
+
d(e.$slots, "default", {}, void 0, !0)
|
|
27
28
|
]));
|
|
28
29
|
}
|
|
29
|
-
}),
|
|
30
|
+
}), E = /* @__PURE__ */ _(m, [["__scopeId", "data-v-bbe22857"]]);
|
|
30
31
|
export {
|
|
31
|
-
|
|
32
|
+
E as default
|
|
32
33
|
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { defineComponent as h, computed as a, createElementBlock as s, openBlock as n, withKeys as o, normalizeStyle as u, normalizeClass as k, createBlock as _, createCommentVNode as b, toDisplayString as z } from "vue";
|
|
2
|
-
import {
|
|
2
|
+
import { R as C } from "./icon-svg-CTR8GnC2.js";
|
|
3
3
|
import { _ as w } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
4
|
-
import './style/avatar.css';const A = ["id", "aria-label"], B = ["src", "alt"],
|
|
4
|
+
import './style/avatar.css';const A = ["id", "aria-label"], B = ["src", "alt"], D = {
|
|
5
5
|
key: 1,
|
|
6
6
|
class: "rds-e-avatar__initials"
|
|
7
7
|
}, N = {
|
|
8
8
|
key: 3,
|
|
9
9
|
class: "rds-e-avatar__badge",
|
|
10
10
|
"aria-hidden": "true"
|
|
11
|
-
},
|
|
11
|
+
}, E = /* @__PURE__ */ h({
|
|
12
12
|
__name: "avatar",
|
|
13
13
|
props: {
|
|
14
14
|
/**
|
|
@@ -135,7 +135,7 @@ import './style/avatar.css';const A = ["id", "aria-label"], B = ["src", "alt"],
|
|
|
135
135
|
})), S = a(() => e.alt && e.type === "image" ? e.alt : e.type === "initials" && r.value ? `Avatar con iniciales ${r.value}` : e.type === "icon" ? `Avatar con icono ${c.value}` : e.badge ? "Avatar de usuario con notificación" : "Avatar de usuario"), l = (i) => {
|
|
136
136
|
p("click", i);
|
|
137
137
|
};
|
|
138
|
-
return (i,
|
|
138
|
+
return (i, I) => (n(), s("div", {
|
|
139
139
|
id: t.id,
|
|
140
140
|
class: k(["rds-e-avatar", [v.value]]),
|
|
141
141
|
style: u(f.value),
|
|
@@ -153,7 +153,7 @@ import './style/avatar.css';const A = ["id", "aria-label"], B = ["src", "alt"],
|
|
|
153
153
|
src: t.src,
|
|
154
154
|
alt: t.alt,
|
|
155
155
|
class: "rds-e-avatar__image"
|
|
156
|
-
}, null, 8, B)) : t.type === "initials" && r.value ? (n(), s("span",
|
|
156
|
+
}, null, 8, B)) : t.type === "initials" && r.value ? (n(), s("span", D, z(r.value), 1)) : (n(), _(C, {
|
|
157
157
|
key: 2,
|
|
158
158
|
name: c.value,
|
|
159
159
|
class: "rds-e-avatar__icon",
|
|
@@ -163,7 +163,7 @@ import './style/avatar.css';const A = ["id", "aria-label"], B = ["src", "alt"],
|
|
|
163
163
|
t.badge ? (n(), s("span", N)) : b("", !0)
|
|
164
164
|
], 46, A));
|
|
165
165
|
}
|
|
166
|
-
}),
|
|
166
|
+
}), R = /* @__PURE__ */ w(E, [["__scopeId", "data-v-11470780"]]);
|
|
167
167
|
export {
|
|
168
|
-
|
|
168
|
+
R as default
|
|
169
169
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import { _
|
|
4
|
-
import './style/button.css';const
|
|
1
|
+
import { defineComponent as b, computed as s, createElementBlock as f, openBlock as r, mergeProps as p, createBlock as v, createCommentVNode as m, createElementVNode as y, normalizeClass as h, renderSlot as g, createTextVNode as x, toDisplayString as B } from "vue";
|
|
2
|
+
import { R as S } from "./icon-svg-CTR8GnC2.js";
|
|
3
|
+
import { _ } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
4
|
+
import './style/button.css';const $ = ["id", "type", "disabled", "aria-disabled", "aria-busy", "aria-label"], L = { class: "rds-e-btn__text" }, I = /* @__PURE__ */ b({
|
|
5
5
|
__name: "button",
|
|
6
6
|
props: {
|
|
7
7
|
/**
|
|
@@ -10,8 +10,8 @@ import './style/button.css';const R = ["id", "type", "disabled"], W = { class: "
|
|
|
10
10
|
text: {
|
|
11
11
|
type: String,
|
|
12
12
|
default: "",
|
|
13
|
-
validator(
|
|
14
|
-
return !
|
|
13
|
+
validator(a, e) {
|
|
14
|
+
return !a && !e.icon ? (console.info("No se han pasado ni texto ni icono al botón"), !1) : !0;
|
|
15
15
|
}
|
|
16
16
|
},
|
|
17
17
|
/**
|
|
@@ -20,8 +20,8 @@ import './style/button.css';const R = ["id", "type", "disabled"], W = { class: "
|
|
|
20
20
|
icon: {
|
|
21
21
|
type: String,
|
|
22
22
|
default: "",
|
|
23
|
-
validator(
|
|
24
|
-
return !
|
|
23
|
+
validator(a, e) {
|
|
24
|
+
return !a && !e.text ? (console.info("No se han pasado ni texto ni icono al botón"), !1) : !0;
|
|
25
25
|
}
|
|
26
26
|
},
|
|
27
27
|
/**
|
|
@@ -32,11 +32,11 @@ import './style/button.css';const R = ["id", "type", "disabled"], W = { class: "
|
|
|
32
32
|
type: {
|
|
33
33
|
type: String,
|
|
34
34
|
default: "button",
|
|
35
|
-
validator(
|
|
36
|
-
const
|
|
37
|
-
return
|
|
38
|
-
`El tipo ${
|
|
39
|
-
),
|
|
35
|
+
validator(a) {
|
|
36
|
+
const e = ["button", "submit", "reset"].includes(a);
|
|
37
|
+
return e || console.info(
|
|
38
|
+
`El tipo ${a} no es válido. Los tipos válidos son: button, submit, reset`
|
|
39
|
+
), e;
|
|
40
40
|
}
|
|
41
41
|
},
|
|
42
42
|
/**
|
|
@@ -47,11 +47,11 @@ import './style/button.css';const R = ["id", "type", "disabled"], W = { class: "
|
|
|
47
47
|
variant: {
|
|
48
48
|
type: String,
|
|
49
49
|
default: "primary",
|
|
50
|
-
validator(
|
|
51
|
-
const
|
|
52
|
-
return
|
|
53
|
-
`La variante ${
|
|
54
|
-
),
|
|
50
|
+
validator(a) {
|
|
51
|
+
const e = ["primary", "secondary", "ghost", "commercial"].includes(a);
|
|
52
|
+
return e || console.info(
|
|
53
|
+
`La variante ${a} no es válida. Las variantes válidas son: primary, secondary, ghost, commercial`
|
|
54
|
+
), e;
|
|
55
55
|
}
|
|
56
56
|
},
|
|
57
57
|
/**
|
|
@@ -109,52 +109,49 @@ import './style/button.css';const R = ["id", "type", "disabled"], W = { class: "
|
|
|
109
109
|
id: {
|
|
110
110
|
type: String,
|
|
111
111
|
default: void 0
|
|
112
|
+
},
|
|
113
|
+
/**
|
|
114
|
+
* <span>Etiqueta accesible para botones sin texto visible</span>
|
|
115
|
+
*/
|
|
116
|
+
ariaLabel: {
|
|
117
|
+
type: String,
|
|
118
|
+
default: ""
|
|
112
119
|
}
|
|
113
120
|
},
|
|
114
|
-
setup(
|
|
115
|
-
const a =
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
return (e, z) => (b(), $("button", {
|
|
135
|
-
id: n(g),
|
|
136
|
-
type: B.value,
|
|
137
|
-
disabled: n(i),
|
|
138
|
-
class: m(x.value)
|
|
139
|
-
}, [
|
|
140
|
-
d.value ? (b(), k(w, {
|
|
121
|
+
setup(a) {
|
|
122
|
+
const e = a, i = s(() => e.loading ? "loading" : e.icon ? e.icon : ""), l = s(() => e.type && ["button", "submit", "reset"].includes(e.type) ? e.type : "button"), n = s(() => ["primary", "secondary", "ghost", "commercial"].includes(e.variant) ? e.variant : "primary"), d = s(() => {
|
|
123
|
+
const t = ["rds-e-btn"];
|
|
124
|
+
return e.variant && t.push(`rds-e-btn--${n.value}`), e.inverse && t.push(`rds-e-btn--${n.value}-inverse`), i.value && t.push(
|
|
125
|
+
e.text ? "rds-e-btn--with-icon" : "rds-e-btn--icon"
|
|
126
|
+
), e.small && t.push("rds-e-btn--small"), e.revertIcon && t.push("rds-e-btn--revert"), e.disabled && t.push("rds-e-style-state-disabled"), e.loading && t.push("rds-e-btn--loading"), e.mobileWidth && t.push("rds-e-btn--mobile-width"), e.destructive && (n.value === "secondary" || n.value === "ghost") && t.push(`rds-e-btn--${n.value}-destructive`), t.join(" ");
|
|
127
|
+
}), u = s(() => {
|
|
128
|
+
const t = [], o = n.value;
|
|
129
|
+
return e.inverse ? t.push(`rds-e-btn__icon--${o}-inverse`) : t.push(`rds-e-btn__icon--${o}`), e.disabled && t.push("rds-e-btn__icon--disabled"), t;
|
|
130
|
+
}), c = s(() => e.text ? e.ariaLabel || void 0 : i.value ? e.ariaLabel || i.value : e.ariaLabel || void 0);
|
|
131
|
+
return (t, o) => (r(), f("button", p({
|
|
132
|
+
id: a.id,
|
|
133
|
+
type: l.value,
|
|
134
|
+
disabled: a.disabled,
|
|
135
|
+
"aria-disabled": a.disabled || a.loading,
|
|
136
|
+
"aria-busy": a.loading,
|
|
137
|
+
"aria-label": c.value,
|
|
138
|
+
class: d.value
|
|
139
|
+
}, t.$attrs), [
|
|
140
|
+
i.value ? (r(), v(S, {
|
|
141
141
|
key: 0,
|
|
142
|
-
name:
|
|
143
|
-
small:
|
|
144
|
-
class:
|
|
145
|
-
n(u) ? `rds-e-btn__icon--${n(u)}` : "",
|
|
146
|
-
n(i) ? "rds-e-btn__icon--disabled" : ""
|
|
147
|
-
]]),
|
|
142
|
+
name: i.value,
|
|
143
|
+
small: a.small,
|
|
144
|
+
class: h(["rds-e-btn__icon", u.value]),
|
|
148
145
|
"aria-hidden": "true"
|
|
149
|
-
}, null, 8, ["name", "small", "class"])) :
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
146
|
+
}, null, 8, ["name", "small", "class"])) : m("", !0),
|
|
147
|
+
y("span", L, [
|
|
148
|
+
g(t.$slots, "default", {}, () => [
|
|
149
|
+
x(B(a.text), 1)
|
|
153
150
|
], !0)
|
|
154
151
|
])
|
|
155
|
-
],
|
|
152
|
+
], 16, $));
|
|
156
153
|
}
|
|
157
|
-
}),
|
|
154
|
+
}), V = /* @__PURE__ */ _(I, [["__scopeId", "data-v-87b2596c"]]);
|
|
158
155
|
export {
|
|
159
|
-
|
|
156
|
+
V as default
|
|
160
157
|
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import { g as
|
|
5
|
-
import { _ as
|
|
6
|
-
import './style/checkbox.css';const
|
|
1
|
+
import { defineComponent as D, computed as c, ref as d, watch as N, onMounted as E, onBeforeUnmount as L, createElementBlock as R, openBlock as s, normalizeClass as u, createElementVNode as b, mergeProps as T, renderSlot as U, createTextVNode as z, createBlock as x, createCommentVNode as I, toDisplayString as $, withCtx as F, createVNode as K } from "vue";
|
|
2
|
+
import { R as g } from "./icon-svg-CTR8GnC2.js";
|
|
3
|
+
import M from "./tooltip.es.js";
|
|
4
|
+
import { g as p } from "./getInstance-GhoEcxLF.js";
|
|
5
|
+
import { _ as A } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
6
|
+
import './style/checkbox.css';const P = ["id", "checked", "aria-label", "aria-invalid", "aria-required", "aria-describedby", "aria-readonly", "aria-checked", "required", "disabled", "readonly", "name", "value"], j = ["for"], G = /* @__PURE__ */ D({
|
|
7
|
+
inheritAttrs: !1,
|
|
7
8
|
__name: "checkbox",
|
|
8
9
|
props: {
|
|
9
10
|
/**
|
|
@@ -41,14 +42,6 @@ import './style/checkbox.css';const $ = ["id", "checked", "aria-label", "aria-in
|
|
|
41
42
|
type: String,
|
|
42
43
|
default: ""
|
|
43
44
|
},
|
|
44
|
-
/**
|
|
45
|
-
* @deprecated Usar `v-model` o la prop `modelValue` en su lugar.
|
|
46
|
-
* <span>Estado del checkbox</span>
|
|
47
|
-
*/
|
|
48
|
-
isChecked: {
|
|
49
|
-
type: Boolean,
|
|
50
|
-
default: void 0
|
|
51
|
-
},
|
|
52
45
|
/**
|
|
53
46
|
* <span>Valor del checkbox, para uso con v-model.</span>
|
|
54
47
|
*/
|
|
@@ -115,68 +108,70 @@ import './style/checkbox.css';const $ = ["id", "checked", "aria-label", "aria-in
|
|
|
115
108
|
},
|
|
116
109
|
emits: ["update:modelValue"],
|
|
117
110
|
setup(e, { emit: w }) {
|
|
118
|
-
const
|
|
119
|
-
|
|
120
|
-
() => [
|
|
121
|
-
([a,
|
|
122
|
-
|
|
111
|
+
const t = e, S = w, f = c(() => t.modelValue !== void 0), m = d(!1), i = d(!1), r = d(!1), o = d(null), B = d(`rds-e-checkbox-${p()}`), v = c(() => t.id?.toString() || B.value), l = c(() => f.value ? t.modelValue ?? !1 : m.value);
|
|
112
|
+
N(
|
|
113
|
+
() => [t.indeterminate, l.value],
|
|
114
|
+
([a, n]) => {
|
|
115
|
+
o.value && (o.value.indeterminate = a && n);
|
|
123
116
|
},
|
|
124
117
|
{ immediate: !0 }
|
|
125
118
|
);
|
|
126
|
-
const
|
|
127
|
-
const
|
|
128
|
-
|
|
119
|
+
const C = (a) => {
|
|
120
|
+
const n = a.target;
|
|
121
|
+
if (t.readonly) {
|
|
122
|
+
n.checked = l.value, a.preventDefault();
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
const k = n.checked;
|
|
126
|
+
f.value || (m.value = k), S("update:modelValue", k);
|
|
129
127
|
}, h = (a) => {
|
|
130
|
-
a.key === "Tab" && (
|
|
131
|
-
},
|
|
132
|
-
|
|
128
|
+
a.key === "Tab" && (r.value = !0);
|
|
129
|
+
}, y = () => {
|
|
130
|
+
r.value = !1;
|
|
133
131
|
}, V = () => {
|
|
134
|
-
|
|
135
|
-
}, q = () =>
|
|
136
|
-
return
|
|
137
|
-
|
|
138
|
-
}),
|
|
139
|
-
window.removeEventListener("keydown", h), window.removeEventListener("mousedown",
|
|
140
|
-
}),
|
|
141
|
-
(
|
|
142
|
-
(a) => {
|
|
143
|
-
!c.value && a !== void 0 && (r.value = !!a);
|
|
144
|
-
}
|
|
145
|
-
), (a, d) => (m(), E("div", {
|
|
146
|
-
class: n(["rds-e-checkbox__container", { "rds-e-checkbox__container--focused": s.value }])
|
|
132
|
+
r.value && (i.value = !0);
|
|
133
|
+
}, q = () => i.value = !1;
|
|
134
|
+
return E(() => {
|
|
135
|
+
o.value && (o.value.indeterminate = !!(t.indeterminate && l.value)), window.addEventListener("keydown", h), window.addEventListener("mousedown", y);
|
|
136
|
+
}), L(() => {
|
|
137
|
+
window.removeEventListener("keydown", h), window.removeEventListener("mousedown", y);
|
|
138
|
+
}), (a, n) => (s(), R("div", {
|
|
139
|
+
class: u(["rds-e-checkbox__container", { "rds-e-checkbox__container--focused": i.value }])
|
|
147
140
|
}, [
|
|
148
|
-
|
|
141
|
+
b("input", T({
|
|
149
142
|
id: v.value,
|
|
150
143
|
ref_key: "inputRef",
|
|
151
|
-
ref:
|
|
152
|
-
|
|
144
|
+
ref: o
|
|
145
|
+
}, a.$attrs, {
|
|
146
|
+
checked: l.value,
|
|
153
147
|
"aria-label": e.accessibilityLabel,
|
|
154
148
|
"aria-invalid": e.error || void 0,
|
|
155
149
|
"aria-required": e.required || void 0,
|
|
156
150
|
"aria-describedby": e.describedBy || void 0,
|
|
157
|
-
"aria-
|
|
151
|
+
"aria-readonly": e.readonly || void 0,
|
|
152
|
+
"aria-checked": e.indeterminate && l.value ? "mixed" : void 0,
|
|
158
153
|
type: "checkbox",
|
|
159
|
-
class:
|
|
154
|
+
class: ["rds-e-checkbox", { "rds-e-checkbox--error": e.error }],
|
|
160
155
|
required: e.required,
|
|
161
156
|
disabled: e.disabled,
|
|
162
157
|
readonly: e.readonly,
|
|
163
158
|
name: e.name || void 0,
|
|
164
159
|
value: e.value,
|
|
165
|
-
onChange:
|
|
160
|
+
onChange: C,
|
|
166
161
|
onFocus: V,
|
|
167
162
|
onBlur: q
|
|
168
|
-
}, null,
|
|
169
|
-
|
|
163
|
+
}), null, 16, P),
|
|
164
|
+
b("label", {
|
|
170
165
|
for: v.value,
|
|
171
|
-
class:
|
|
166
|
+
class: u(["rds-e-checkbox__label", {
|
|
172
167
|
"rds-e-checkbox__label--disabled": e.disabled,
|
|
173
|
-
"rds-e-checkbox__label--checked":
|
|
174
|
-
"rds-e-checkbox__label--indeterminate": e.indeterminate &&
|
|
168
|
+
"rds-e-checkbox__label--checked": l.value,
|
|
169
|
+
"rds-e-checkbox__label--indeterminate": e.indeterminate && l.value
|
|
175
170
|
}])
|
|
176
171
|
}, [
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
class:
|
|
172
|
+
U(a.$slots, "label-text", {}, () => [
|
|
173
|
+
b("span", {
|
|
174
|
+
class: u([
|
|
180
175
|
"rds-e-checkbox__label-box",
|
|
181
176
|
{
|
|
182
177
|
"rds-e-checkbox__label-box--disabled": e.disabled,
|
|
@@ -184,33 +179,37 @@ import './style/checkbox.css';const $ = ["id", "checked", "aria-label", "aria-in
|
|
|
184
179
|
}
|
|
185
180
|
])
|
|
186
181
|
}, [
|
|
187
|
-
|
|
188
|
-
e.icon && e.iconTooltip ? (
|
|
182
|
+
z($(e.label) + " ", 1),
|
|
183
|
+
e.icon && e.iconTooltip ? (s(), x(M, {
|
|
189
184
|
key: 0,
|
|
190
185
|
content: e.iconTooltip,
|
|
191
186
|
placement: "top",
|
|
192
187
|
"offset-space": 8
|
|
193
188
|
}, {
|
|
194
|
-
default:
|
|
195
|
-
|
|
189
|
+
default: F(() => [
|
|
190
|
+
K(g, {
|
|
196
191
|
class: "rds-e-checkbox__label-box--icon",
|
|
197
192
|
name: e.icon,
|
|
193
|
+
"aria-hidden": "true",
|
|
194
|
+
focusable: "false",
|
|
198
195
|
size: "sm"
|
|
199
196
|
}, null, 8, ["name"])
|
|
200
197
|
]),
|
|
201
198
|
_: 1
|
|
202
|
-
}, 8, ["content"])) : e.icon ? (
|
|
199
|
+
}, 8, ["content"])) : e.icon ? (s(), x(g, {
|
|
203
200
|
key: 1,
|
|
204
201
|
class: "rds-e-checkbox__label-box--icon",
|
|
205
202
|
name: e.icon,
|
|
203
|
+
"aria-hidden": "true",
|
|
204
|
+
focusable: "false",
|
|
206
205
|
size: "sm"
|
|
207
|
-
}, null, 8, ["name"])) :
|
|
206
|
+
}, null, 8, ["name"])) : I("", !0)
|
|
208
207
|
], 2)
|
|
209
208
|
], !0)
|
|
210
209
|
], 10, j)
|
|
211
210
|
], 2));
|
|
212
211
|
}
|
|
213
|
-
}),
|
|
212
|
+
}), X = /* @__PURE__ */ A(G, [["__scopeId", "data-v-366abbf5"]]);
|
|
214
213
|
export {
|
|
215
|
-
|
|
214
|
+
X as default
|
|
216
215
|
};
|