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