energy-components 2.7.0 → 2.8.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.
Files changed (65) hide show
  1. package/dist/components/accordion.es.js +1 -1
  2. package/dist/components/avatar.es.js +1 -1
  3. package/dist/components/button.es.js +1 -1
  4. package/dist/components/checkbox.es.js +1 -1
  5. package/dist/components/collapsable.es.js +1 -1
  6. package/dist/components/{collapsable.scss_vue_type_style_index_0_src_true_lang-BfTKaP_f.js → collapsable.scss_vue_type_style_index_0_src_true_lang-CBOSJyvR.js} +1 -1
  7. package/dist/components/datepicker.es.js +1 -1
  8. package/dist/components/directAccess.es.js +1 -1
  9. package/dist/components/dragAndDrop.es.js +1 -1
  10. package/dist/components/dropdown.es.js +68 -67
  11. package/dist/components/fileUploadItem.es.js +1 -1
  12. package/dist/components/filterChip.es.js +1 -1
  13. package/dist/components/filterTag.es.js +1 -1
  14. package/dist/components/{icon-svg-CW3eQRcp.js → icon-svg-BWxX0W6p.js} +15 -3
  15. package/dist/components/iconList.es.js +1 -1
  16. package/dist/components/iconSvg.es.js +1 -1
  17. package/dist/components/index.es.js +2 -2
  18. package/dist/components/indicator.es.js +1 -1
  19. package/dist/components/indicatorDots.es.js +1 -1
  20. package/dist/components/infoBox.es.js +1 -1
  21. package/dist/components/link.es.js +1 -1
  22. package/dist/components/modal.es.js +1 -1
  23. package/dist/components/multiselect.es.js +14 -8
  24. package/dist/components/multiselectcontentwrapper.es.js +42 -36
  25. package/dist/components/persistentToast.es.js +1 -1
  26. package/dist/components/popover.es.js +90 -71
  27. package/dist/components/popoverMenu.es.js +67 -60
  28. package/dist/components/progressBar.es.js +1 -1
  29. package/dist/components/quantitySelector.es.js +1 -1
  30. package/dist/components/radioButton.es.js +1 -1
  31. package/dist/components/searchField.es.js +1 -1
  32. package/dist/components/selectionChip.es.js +1 -1
  33. package/dist/components/sidedrawer.es.js +1 -1
  34. package/dist/components/style/dropdown.css +1 -1
  35. package/dist/components/style/multiselect.css +1 -1
  36. package/dist/components/style/multiselectcontentwrapper.css +1 -1
  37. package/dist/components/style/popover.css +1 -1
  38. package/dist/components/style/popoverMenu.css +1 -1
  39. package/dist/components/style/table.css +1 -1
  40. package/dist/components/style/tableRenderer.css +1 -1
  41. package/dist/components/switch.es.js +1 -1
  42. package/dist/components/tabBar.es.js +1 -1
  43. package/dist/components/table.es.js +74 -69
  44. package/dist/components/tableRenderer.es.js +358 -214
  45. package/dist/components/tag.es.js +1 -1
  46. package/dist/components/textArea.es.js +1 -1
  47. package/dist/components/textField.es.js +1 -1
  48. package/dist/components/toggle.es.js +1 -1
  49. package/dist/components/tooltip.es.js +1 -1
  50. package/dist/energy-components.css +1 -1
  51. package/dist/energy-components.es.js +5905 -5705
  52. package/dist/energy-components.umd.js +2 -2
  53. package/dist/style.css +1 -1
  54. package/dist/types/src/components/content/table/table-renderer.vue.d.ts +5 -2
  55. package/dist/types/src/components/content/table/table.vue.d.ts +18 -1
  56. package/dist/types/src/components/content/table/use-column-reorder.d.ts +29 -0
  57. package/dist/types/src/components/input/dropdown/Multiselect/MultiselectContentWrapper.vue.d.ts +9 -0
  58. package/dist/types/src/components/overlay/popover/popover.vue.d.ts +4 -0
  59. package/dist/types/src/components/overlay/popover-menu/popover-menu.vue.d.ts +10 -4
  60. package/dist/types/tsconfig.tsbuildinfo +1 -1
  61. package/llms/rdsdropdown.md +2 -2
  62. package/llms/rdspopover-menu.md +2 -0
  63. package/llms/rdspopover.md +2 -0
  64. package/llms/rdstable.md +2 -0
  65. package/package.json +2 -2
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as O, useAttrs as T, computed as t, openBlock as i, createBlock as l, resolveDynamicComponent as E, mergeProps as d, withCtx as L, createCommentVNode as s, createElementBlock as g, normalizeClass as v, renderSlot as b, createTextVNode as h, toDisplayString as w } from "vue";
2
2
  import { s as R } from "./functions-D3GA3OzJ.js";
3
- import { R as c } from "./icon-svg-CW3eQRcp.js";
3
+ import { R as c } from "./icon-svg-BWxX0W6p.js";
4
4
  import { _ as $ } from "./_plugin-vue_export-helper-CHgC5LLL.js";
5
5
  import './style/link.css';const K = /* @__PURE__ */ O({
6
6
  __name: "link",
@@ -1,7 +1,7 @@
1
1
  import { watch as O, nextTick as M, onBeforeUnmount as E, computed as c, defineComponent as N, ref as x, onMounted as z, openBlock as C, createBlock as A, unref as u, withCtx as D, createVNode as I, withModifiers as P, normalizeStyle as W, createElementVNode as $, normalizeClass as T, renderSlot as q, createElementBlock as R, createCommentVNode as F } from "vue";
2
2
  import V from "./overlay.es.js";
3
3
  import K from "./card.es.js";
4
- import { R as j } from "./icon-svg-CW3eQRcp.js";
4
+ import { R as j } from "./icon-svg-BWxX0W6p.js";
5
5
  import { _ as U } from "./_plugin-vue_export-helper-CHgC5LLL.js";
6
6
  import './style/modal.css';function G(t, a) {
7
7
  const l = a.returnFocus ?? !0;
@@ -1,5 +1,5 @@
1
1
  import A from "./multiselectcontentwrapper.es.js";
2
- import { resolveComponent as F, openBlock as c, createElementBlock as g, withKeys as a, withModifiers as o, normalizeClass as H, renderSlot as u, createElementVNode as d, withDirectives as w, Fragment as K, renderList as v, toDisplayString as O, vShow as L, createCommentVNode as m, createVNode as b, Transition as T, withCtx as y, normalizeStyle as $, createTextVNode as P, createSlots as B, normalizeProps as D, guardReactiveProps as E, createBlock as R, Teleport as x } from "vue";
2
+ import { resolveComponent as F, openBlock as c, createElementBlock as g, withKeys as a, withModifiers as o, normalizeClass as x, renderSlot as u, createElementVNode as d, withDirectives as w, Fragment as H, renderList as v, toDisplayString as O, vShow as L, createCommentVNode as m, createVNode as b, Transition as T, withCtx as y, normalizeStyle as K, createTextVNode as P, createSlots as B, normalizeProps as D, guardReactiveProps as E, createBlock as R, Teleport as $ } from "vue";
3
3
  import { _ as N } from "./_plugin-vue_export-helper-CHgC5LLL.js";
4
4
  import './style/multiselect.css';function S(e) {
5
5
  return e === 0 ? !1 : Array.isArray(e) && e.length === 0 ? !0 : !e;
@@ -891,6 +891,10 @@ const G = (...e) => (t) => e.reduce((i, n) => n(i), t), I = {
891
891
  textOnly: {
892
892
  type: Boolean,
893
893
  default: !1
894
+ },
895
+ externalSearch: {
896
+ type: String,
897
+ default: ""
894
898
  }
895
899
  },
896
900
  computed: {
@@ -962,7 +966,7 @@ function te(e, t, i, n, r, s) {
962
966
  const p = F("MultiselectContentWrapper");
963
967
  return c(), g("div", {
964
968
  tabindex: e.searchable ? -1 : i.tabindex,
965
- class: H([{ "multiselect--active": e.isOpen, "multiselect--disabled": i.disabled, "multiselect--above": s.isAbove, "multiselect--has-options-group": s.hasOptionGroup, "multiselect--kbd": r.isKeyboardFocus }, "multiselect"]),
969
+ class: x([{ "multiselect--active": e.isOpen, "multiselect--disabled": i.disabled, "multiselect--above": s.isAbove, "multiselect--has-options-group": s.hasOptionGroup, "multiselect--kbd": r.isKeyboardFocus }, "multiselect"]),
966
970
  onFocus: t[11] || (t[11] = (...l) => s.onRootFocus && s.onRootFocus(...l)),
967
971
  onBlur: t[12] || (t[12] = (...l) => s.onBlur && s.onBlur(...l)),
968
972
  onKeydown: [
@@ -992,7 +996,7 @@ function te(e, t, i, n, r, s) {
992
996
  isOpen: e.isOpen
993
997
  }, () => [
994
998
  w(d("div", Q, [
995
- (c(!0), g(K, null, v(s.visibleValues, (l, h) => u(e.$slots, "tag", {
999
+ (c(!0), g(H, null, v(s.visibleValues, (l, h) => u(e.$slots, "tag", {
996
1000
  option: l,
997
1001
  search: e.search,
998
1002
  remove: e.removeElement
@@ -1042,7 +1046,7 @@ function te(e, t, i, n, r, s) {
1042
1046
  spellcheck: i.spellcheck,
1043
1047
  placeholder: e.placeholder,
1044
1048
  required: i.required,
1045
- style: $({
1049
+ style: K({
1046
1050
  ...s.inputStyle
1047
1051
  }),
1048
1052
  value: e.search,
@@ -1097,6 +1101,7 @@ function te(e, t, i, n, r, s) {
1097
1101
  options: e.options,
1098
1102
  hasOptionGroup: s.hasOptionGroup,
1099
1103
  search: e.search,
1104
+ externalSearch: i.externalSearch,
1100
1105
  loading: i.loading,
1101
1106
  showNoResults: i.showNoResults,
1102
1107
  showNoOptions: i.showNoOptions,
@@ -1112,13 +1117,13 @@ function te(e, t, i, n, r, s) {
1112
1117
  u(e.$slots, h, D(E(f)), void 0, !0)
1113
1118
  ])
1114
1119
  }))
1115
- ]), 1032, ["id", "multiple", "max", "internalValue", "filteredOptions", "isSelected", "optionHighlight", "select", "pointerSet", "selectLabelText", "selectedLabelText", "deselectLabelText", "tagPlaceholder", "groupSelect", "selectGroupLabelText", "deselectGroupLabelText", "getOptionLabel", "groupHighlight", "selectGroup", "options", "hasOptionGroup", "search", "loading", "showNoResults", "showNoOptions", "small", "contentStyle", "customStyle", "onFocus"]), [
1120
+ ]), 1032, ["id", "multiple", "max", "internalValue", "filteredOptions", "isSelected", "optionHighlight", "select", "pointerSet", "selectLabelText", "selectedLabelText", "deselectLabelText", "tagPlaceholder", "groupSelect", "selectGroupLabelText", "deselectGroupLabelText", "getOptionLabel", "groupHighlight", "selectGroup", "options", "hasOptionGroup", "search", "externalSearch", "loading", "showNoResults", "showNoOptions", "small", "contentStyle", "customStyle", "onFocus"]), [
1116
1121
  [L, e.isOpen && !i.appendToBody]
1117
1122
  ])
1118
1123
  ]),
1119
1124
  _: 3
1120
1125
  }),
1121
- i.appendToBody && e.isOpen ? (c(), R(x, {
1126
+ i.appendToBody && e.isOpen ? (c(), R($, {
1122
1127
  key: 0,
1123
1128
  to: "body"
1124
1129
  }, [
@@ -1146,6 +1151,7 @@ function te(e, t, i, n, r, s) {
1146
1151
  options: e.options,
1147
1152
  hasOptionGroup: s.hasOptionGroup,
1148
1153
  search: e.search,
1154
+ externalSearch: i.externalSearch,
1149
1155
  loading: i.loading,
1150
1156
  showNoResults: i.showNoResults,
1151
1157
  showNoOptions: i.showNoOptions,
@@ -1162,11 +1168,11 @@ function te(e, t, i, n, r, s) {
1162
1168
  u(e.$slots, h, D(E(f)), void 0, !0)
1163
1169
  ])
1164
1170
  }))
1165
- ]), 1032, ["id", "multiple", "max", "internalValue", "filteredOptions", "isSelected", "optionHighlight", "select", "pointerSet", "selectLabelText", "selectedLabelText", "deselectLabelText", "tagPlaceholder", "groupSelect", "selectGroupLabelText", "deselectGroupLabelText", "getOptionLabel", "groupHighlight", "selectGroup", "options", "hasOptionGroup", "search", "loading", "showNoResults", "showNoOptions", "small", "contentStyle", "customStyle", "onFocus"])
1171
+ ]), 1032, ["id", "multiple", "max", "internalValue", "filteredOptions", "isSelected", "optionHighlight", "select", "pointerSet", "selectLabelText", "selectedLabelText", "deselectLabelText", "tagPlaceholder", "groupSelect", "selectGroupLabelText", "deselectGroupLabelText", "getOptionLabel", "groupHighlight", "selectGroup", "options", "hasOptionGroup", "search", "externalSearch", "loading", "showNoResults", "showNoOptions", "small", "contentStyle", "customStyle", "onFocus"])
1166
1172
  ])) : m("", !0)
1167
1173
  ], 42, U);
1168
1174
  }
1169
- const ne = /* @__PURE__ */ N(q, [["render", te], ["__scopeId", "data-v-dae3dc31"]]);
1175
+ const ne = /* @__PURE__ */ N(q, [["render", te], ["__scopeId", "data-v-f49bc73a"]]);
1170
1176
  export {
1171
1177
  ne as default
1172
1178
  };
@@ -1,4 +1,4 @@
1
- import { openBlock as o, createElementBlock as c, normalizeStyle as _, withModifiers as u, normalizeClass as m, createElementVNode as s, renderSlot as i, createTextVNode as g, toDisplayString as h, createCommentVNode as r, Fragment as S, renderList as y, withDirectives as b, vShow as f } from "vue";
1
+ import { openBlock as o, createElementBlock as c, normalizeStyle as b, withModifiers as r, normalizeClass as m, createElementVNode as s, renderSlot as i, createTextVNode as h, toDisplayString as g, createCommentVNode as u, Fragment as f, renderList as y, withDirectives as _, vShow as S } from "vue";
2
2
  import { _ as L } from "./_plugin-vue_export-helper-CHgC5LLL.js";
3
3
  import './style/multiselectcontentwrapper.css';const w = {
4
4
  name: "MultiselectContentWrapper",
@@ -33,6 +33,10 @@ import './style/multiselectcontentwrapper.css';const w = {
33
33
  options: Array,
34
34
  hasOptionGroup: Boolean,
35
35
  search: String,
36
+ externalSearch: {
37
+ type: String,
38
+ default: ""
39
+ },
36
40
  loading: Boolean,
37
41
  showNoResults: Boolean,
38
42
  showNoOptions: Boolean,
@@ -44,48 +48,48 @@ import './style/multiselectcontentwrapper.css';const w = {
44
48
  customStyle: Object
45
49
  },
46
50
  emits: ["focus"]
47
- }, O = ["id", "aria-multiselectable"], M = { key: 0 }, v = { class: "multiselect__option" }, T = ["aria-selected", "id", "role"], x = ["onClick", "onMouseenter", "data-select", "data-selected", "data-deselect"], B = ["data-select", "data-deselect", "onMouseenter", "onMousedown"], F = { class: "multiselect__option" }, N = { class: "multiselect__option" };
48
- function k(l, n, e, G, C, D) {
51
+ }, x = ["id", "aria-multiselectable"], O = { key: 0 }, v = { class: "multiselect__option" }, M = ["aria-selected", "id", "role"], T = ["onClick", "onMouseenter", "data-select", "data-selected", "data-deselect"], B = ["data-select", "data-deselect", "onMouseenter", "onMousedown"], F = { class: "multiselect__option" }, N = { class: "multiselect__option" };
52
+ function k(l, a, e, G, C, D) {
49
53
  return o(), c("div", {
50
54
  class: m([
51
55
  "multiselect__content-wrapper",
52
56
  { "multiselect__content-wrapper--small": e.small },
53
57
  e.teleported ? "multiselect__content-wrapper--teleported" : ""
54
58
  ]),
55
- onFocus: n[0] || (n[0] = (t) => l.$emit("focus")),
59
+ onFocus: a[0] || (a[0] = (t) => l.$emit("focus")),
56
60
  tabindex: "-1",
57
- onMousedown: n[1] || (n[1] = u(() => {
61
+ onMousedown: a[1] || (a[1] = r(() => {
58
62
  }, ["prevent"])),
59
- style: _(e.customStyle),
63
+ style: b(e.customStyle),
60
64
  ref: "wrapper"
61
65
  }, [
62
66
  s("ul", {
63
67
  class: "multiselect__content",
64
- style: _(e.contentStyle),
68
+ style: b(e.contentStyle),
65
69
  role: "listbox",
66
70
  id: "listbox-" + (e.teleported ? "teleported-" : "") + e.id,
67
71
  "aria-multiselectable": e.multiple
68
72
  }, [
69
73
  i(l.$slots, "beforeList", {}, void 0, !0),
70
- e.multiple && e.max === e.internalValue.length ? (o(), c("li", M, [
74
+ e.multiple && e.max === e.internalValue.length ? (o(), c("li", O, [
71
75
  s("span", v, [
72
76
  i(l.$slots, "maxElements", {}, () => [
73
- g("Maximum of " + h(e.max) + " options selected. First remove a selected option to select another.", 1)
77
+ h("Maximum of " + g(e.max) + " options selected. First remove a selected option to select another.", 1)
74
78
  ], !0)
75
79
  ])
76
- ])) : r("", !0),
77
- !e.max || e.internalValue.length < e.max ? (o(!0), c(S, { key: 1 }, y(e.filteredOptions, (t, a) => (o(), c("li", {
80
+ ])) : u("", !0),
81
+ !e.max || e.internalValue.length < e.max ? (o(!0), c(f, { key: 1 }, y(e.filteredOptions, (t, n) => (o(), c("li", {
78
82
  class: "multiselect__element",
79
- key: a,
83
+ key: n,
80
84
  "aria-selected": e.isSelected(t),
81
- id: e.id + "-" + a,
85
+ id: e.id + "-" + n,
82
86
  role: t && (t.$isLabel || t.$isDisabled) ? null : "option"
83
87
  }, [
84
- t && (t.$isLabel || t.$isDisabled) ? r("", !0) : (o(), c("span", {
88
+ t && (t.$isLabel || t.$isDisabled) ? u("", !0) : (o(), c("span", {
85
89
  key: 0,
86
- class: m([e.optionHighlight(a, t), "multiselect__option"]),
87
- onClick: u((d) => e.select(t), ["stop"]),
88
- onMouseenter: u((d) => e.pointerSet(a), ["self"]),
90
+ class: m([e.optionHighlight(n, t), "multiselect__option"]),
91
+ onClick: r((d) => e.select(t), ["stop"]),
92
+ onMouseenter: r((d) => e.pointerSet(n), ["self"]),
89
93
  "data-select": t && t.isTag ? e.tagPlaceholder : e.selectLabelText,
90
94
  "data-selected": e.selectedLabelText,
91
95
  "data-deselect": e.deselectLabelText
@@ -93,51 +97,53 @@ function k(l, n, e, G, C, D) {
93
97
  i(l.$slots, "option", {
94
98
  option: t,
95
99
  search: e.search,
96
- index: a
100
+ index: n
97
101
  }, () => [
98
- s("span", null, h(e.getOptionLabel(t)), 1)
102
+ s("span", null, g(e.getOptionLabel(t)), 1)
99
103
  ], !0)
100
- ], 42, x)),
104
+ ], 42, T)),
101
105
  t && (t.$isLabel || t.$isDisabled) ? (o(), c("span", {
102
106
  key: 1,
103
107
  "data-select": e.groupSelect && e.selectGroupLabelText,
104
108
  "data-deselect": e.groupSelect && e.deselectGroupLabelText,
105
- class: m([e.groupHighlight(a, t), "multiselect__option"]),
106
- onMouseenter: u((d) => e.groupSelect && e.pointerSet(a), ["self"]),
107
- onMousedown: u((d) => e.selectGroup(t), ["prevent"])
109
+ class: m([e.groupHighlight(n, t), "multiselect__option"]),
110
+ onMouseenter: r((d) => e.groupSelect && e.pointerSet(n), ["self"]),
111
+ onMousedown: r((d) => e.selectGroup(t), ["prevent"])
108
112
  }, [
109
113
  i(l.$slots, "option", {
110
114
  option: t,
111
115
  search: e.search,
112
- index: a
116
+ index: n
113
117
  }, () => [
114
- s("span", null, h(e.getOptionLabel(t)), 1)
118
+ s("span", null, g(e.getOptionLabel(t)), 1)
115
119
  ], !0)
116
- ], 42, B)) : r("", !0)
117
- ], 8, T))), 128)) : r("", !0),
118
- b(s("li", null, [
120
+ ], 42, B)) : u("", !0)
121
+ ], 8, M))), 128)) : u("", !0),
122
+ _(s("li", null, [
119
123
  s("span", F, [
120
- i(l.$slots, "noResult", { search: e.search }, () => [
121
- n[2] || (n[2] = g("No elements found. Consider changing the search query.", -1))
124
+ i(l.$slots, "noResult", {
125
+ search: e.search || e.externalSearch
126
+ }, () => [
127
+ a[2] || (a[2] = h("No se han encontrado resultados. Prueba a cambiar el criterio de búsqueda.", -1))
122
128
  ], !0)
123
129
  ])
124
130
  ], 512), [
125
- [f, e.showNoResults && e.filteredOptions.length === 0 && e.search && !e.loading]
131
+ [S, e.showNoResults && e.filteredOptions.length === 0 && (e.search || e.externalSearch) && !e.loading]
126
132
  ]),
127
- b(s("li", null, [
133
+ _(s("li", null, [
128
134
  s("span", N, [
129
135
  i(l.$slots, "noOptions", {}, () => [
130
- n[3] || (n[3] = g("List is empty.", -1))
136
+ a[3] || (a[3] = h("La lista está vacía.", -1))
131
137
  ], !0)
132
138
  ])
133
139
  ], 512), [
134
- [f, e.showNoOptions && (e.options.length === 0 || e.hasOptionGroup === !0 && e.filteredOptions.length === 0) && !e.search && !e.loading]
140
+ [S, e.showNoOptions && (e.options.length === 0 || e.hasOptionGroup === !0 && e.filteredOptions.length === 0) && !(e.search || e.externalSearch) && !e.loading]
135
141
  ]),
136
142
  i(l.$slots, "afterList", {}, void 0, !0)
137
- ], 12, O)
143
+ ], 12, x)
138
144
  ], 38);
139
145
  }
140
- const A = /* @__PURE__ */ L(w, [["render", k], ["__scopeId", "data-v-58844ad4"]]);
146
+ const A = /* @__PURE__ */ L(w, [["render", k], ["__scopeId", "data-v-7b479642"]]);
141
147
  export {
142
148
  A as default
143
149
  };
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as v, toRefs as y, computed as g, openBlock as t, createElementBlock as s, normalizeClass as h, createElementVNode as r, createVNode as a, createCommentVNode as o, toDisplayString as c, renderSlot as l } from "vue";
2
- import { R as d } from "./icon-svg-CW3eQRcp.js";
2
+ import { R as d } from "./icon-svg-BWxX0W6p.js";
3
3
  import { _ as k } from "./_plugin-vue_export-helper-CHgC5LLL.js";
4
4
  import './style/persistentToast.css';const S = ["id"], b = { class: "alert" }, $ = {
5
5
  key: 0,
@@ -1,11 +1,11 @@
1
- import { useSlots as V, computed as y, ref as _, watch as A, nextTick as L, onBeforeUnmount as U, openBlock as a, createElementBlock as c, createElementVNode as B, renderSlot as h, createBlock as H, Teleport as j, normalizeStyle as G, unref as W, normalizeClass as C, Fragment as q, renderList as J, createCommentVNode as R, toDisplayString as K } from "vue";
2
- import { o as Q, f as X, s as Y, b as Z, u as ee, a as te } from "./floating-ui.vue-DMBZhA6d.js";
3
- import { R as oe } from "./icon-svg-CW3eQRcp.js";
4
- import { _ as ne } from "./_plugin-vue_export-helper-CHgC5LLL.js";
5
- import './style/popover.css';const le = { class: "rds-e-popover" }, se = {
1
+ import { useSlots as z, computed as y, ref as _, watch as I, nextTick as C, onBeforeUnmount as V, openBlock as a, createElementBlock as c, createBlock as h, resolveDynamicComponent as U, withCtx as j, renderSlot as b, Teleport as G, normalizeStyle as W, unref as q, normalizeClass as B, Fragment as J, renderList as K, createCommentVNode as H, createElementVNode as Q, toDisplayString as X } from "vue";
2
+ import { o as Y, f as Z, s as ee, b as te, u as oe, a as ne } from "./floating-ui.vue-DMBZhA6d.js";
3
+ import { R as le } from "./icon-svg-BWxX0W6p.js";
4
+ import { _ as re } from "./_plugin-vue_export-helper-CHgC5LLL.js";
5
+ import './style/popover.css';const ae = { class: "rds-e-popover" }, se = {
6
6
  key: 1,
7
7
  class: "rds-e-popover__list"
8
- }, re = ["onClick"], ae = { class: "rds-e-popover__item-label" }, ie = {
8
+ }, ie = ["onClick"], ce = { class: "rds-e-popover__item-label" }, ue = {
9
9
  __name: "popover",
10
10
  props: {
11
11
  /**
@@ -71,6 +71,20 @@ import './style/popover.css';const le = { class: "rds-e-popover" }, se = {
71
71
  triggerOnHover: {
72
72
  type: Boolean,
73
73
  default: !1
74
+ },
75
+ /**
76
+ * <span>Tag HTML para el contenedor del trigger</span>
77
+ */
78
+ triggerTag: {
79
+ type: String,
80
+ default: "button"
81
+ },
82
+ /**
83
+ * <span>Aria-label del contenedor del trigger</span>
84
+ */
85
+ triggerAriaLabel: {
86
+ type: String,
87
+ default: void 0
74
88
  }
75
89
  },
76
90
  emits: [
@@ -87,97 +101,102 @@ import './style/popover.css';const le = { class: "rds-e-popover" }, se = {
87
101
  */
88
102
  "close"
89
103
  ],
90
- setup(u, { expose: F, emit: P }) {
91
- const t = u, p = P, x = V(), k = y(() => !!x.default), n = _(!1), i = _(null), l = _(null), D = y(() => {
104
+ setup(u, { expose: R, emit: x }) {
105
+ const t = u, p = x, D = z(), k = y(() => !!D.default), n = _(!1), i = _(null), l = _(null), F = y(() => {
92
106
  const e = [
93
- Q(t.offsetSpace)
107
+ Y(t.offsetSpace)
94
108
  ];
95
109
  return t.autoFlip && e.push(
96
- X({
110
+ Z({
97
111
  fallbackPlacements: t.fallbackPlacements.length ? t.fallbackPlacements : void 0
98
112
  })
99
113
  ), e.push(
100
- Y({ padding: 8 }),
101
- Z({
102
- apply({ availableWidth: S, elements: s }) {
103
- const f = Math.min(t.width, S - 32);
104
- Object.assign(s.floating.style, {
114
+ ee({ padding: 8 }),
115
+ te({
116
+ apply({ availableWidth: L, elements: r }) {
117
+ const f = Math.min(t.width, L - 32);
118
+ Object.assign(r.floating.style, {
105
119
  width: `${f}px`
106
120
  });
107
121
  }
108
122
  })
109
123
  ), e;
110
- }), { floatingStyles: M, update: $ } = ee(
124
+ }), { floatingStyles: P, update: M } = oe(
111
125
  i,
112
126
  l,
113
127
  {
114
128
  placement: y(() => t.placement),
115
- middleware: D,
116
- whileElementsMounted: te
129
+ middleware: F,
130
+ whileElementsMounted: ne
117
131
  }
118
132
  );
119
- let v, m, g, o = null;
120
- const b = () => {
121
- document.removeEventListener("click", v), document.removeEventListener("keydown", m), document.removeEventListener("scroll", g, !0);
122
- }, r = () => {
123
- n.value && (n.value = !1, p("close"), b());
133
+ let v, g, m, o = null;
134
+ const T = () => {
135
+ document.removeEventListener("click", v), document.removeEventListener("keydown", g), document.removeEventListener("scroll", m, !0);
136
+ }, s = () => {
137
+ n.value && (n.value = !1, p("close"), T());
124
138
  };
125
139
  v = (e) => {
126
- l.value && !l.value.contains(e.target) && i.value && !i.value.contains(e.target) && r();
127
- }, m = (e) => {
128
- e.key === "Escape" && r();
129
- }, g = () => {
140
+ l.value && !l.value.contains(e.target) && i.value && !i.value.contains(e.target) && s();
141
+ }, g = (e) => {
142
+ e.key === "Escape" && s();
143
+ }, m = () => {
130
144
  if (!i.value) return;
131
145
  const e = i.value.getBoundingClientRect();
132
- (e.bottom < 0 || e.top > window.innerHeight) && r();
146
+ (e.bottom < 0 || e.top > window.innerHeight) && s();
133
147
  };
134
148
  const d = async () => {
135
- n.value ? r() : (n.value = !0, p("open"), await L(), $(), setTimeout(() => {
136
- document.addEventListener("click", v), document.addEventListener("keydown", m), t.closeOnTriggerHidden && document.addEventListener("scroll", g, !0);
149
+ n.value ? s() : (n.value = !0, p("open"), await C(), M(), setTimeout(() => {
150
+ document.addEventListener("click", v), document.addEventListener("keydown", g), t.closeOnTriggerHidden && document.addEventListener("scroll", m, !0);
137
151
  }));
138
- }, N = () => {
152
+ }, $ = () => {
139
153
  t.triggerOnHover && (o && (clearTimeout(o), o = null), n.value || d());
140
- }, T = () => {
154
+ }, S = () => {
141
155
  t.triggerOnHover && (o && (clearTimeout(o), o = null), o = setTimeout(() => {
142
- l.value && l.value.matches(":hover, :focus-within") || r();
156
+ l.value && l.value.matches(":hover, :focus-within") || s();
143
157
  }, 120));
144
- }, z = (e) => {
158
+ }, A = (e) => {
145
159
  t.triggerOnHover ? (e.preventDefault(), e.stopPropagation(), n.value || d()) : d();
146
- }, E = () => {
147
- N();
148
160
  }, w = () => {
149
- T();
150
- }, I = () => {
161
+ $();
162
+ }, E = () => {
163
+ S();
164
+ }, N = () => {
151
165
  l.value && (l.value.addEventListener("mouseenter", () => {
152
166
  o && (clearTimeout(o), o = null);
153
167
  }), l.value.addEventListener("mouseleave", () => {
154
- T();
168
+ S();
155
169
  }));
156
170
  };
157
- A(n, (e) => {
158
- e && t.triggerOnHover && L(() => I());
171
+ I(n, (e) => {
172
+ e && t.triggerOnHover && C(() => N());
159
173
  });
160
174
  const O = (e) => {
161
- p("select", e), r();
175
+ p("select", e), s();
162
176
  };
163
- return U(b), F({
177
+ return V(T), R({
164
178
  toggle: d,
165
- close: r,
179
+ close: s,
166
180
  isOpen: n
167
- }), (e, S) => (a(), c("div", le, [
168
- B("button", {
181
+ }), (e, L) => (a(), c("div", ae, [
182
+ (a(), h(U(t.triggerTag), {
169
183
  ref_key: "referenceRef",
170
184
  ref: i,
171
185
  class: "rds-e-popover__trigger-btn",
172
- onClick: z,
173
- onMouseenter: E,
174
- onMouseleave: w,
175
- onFocus: E,
176
- onBlur: w
177
- }, [
178
- h(e.$slots, "trigger", {}, void 0, !0)
179
- ], 544),
180
- (a(), H(j, {
186
+ "aria-label": t.triggerAriaLabel,
187
+ type: t.triggerTag === "button" ? "button" : null,
188
+ onClick: A,
189
+ onMouseenter: w,
190
+ onMouseleave: E,
191
+ onFocus: w,
192
+ onBlur: E
193
+ }, {
194
+ default: j(() => [
195
+ b(e.$slots, "trigger", {}, void 0, !0)
196
+ ]),
197
+ _: 3
198
+ }, 40, ["aria-label", "type"])),
199
+ (a(), h(G, {
181
200
  to: u.teleportTo,
182
201
  disabled: !u.teleportTo
183
202
  }, [
@@ -185,34 +204,34 @@ import './style/popover.css';const le = { class: "rds-e-popover" }, se = {
185
204
  key: 0,
186
205
  ref_key: "floatingRef",
187
206
  ref: l,
188
- class: C(["rds-e-popover__content", { "rds-e-popover__content--no-styles": k.value }]),
189
- style: G(W(M))
207
+ class: B(["rds-e-popover__content", { "rds-e-popover__content--no-styles": k.value }]),
208
+ style: W(q(P))
190
209
  }, [
191
- k.value ? h(e.$slots, "default", { key: 0 }, void 0, !0) : (a(), c("ul", se, [
192
- (a(!0), c(q, null, J(u.items, (s, f) => h(e.$slots, "item", {
193
- item: s,
210
+ k.value ? b(e.$slots, "default", { key: 0 }, void 0, !0) : (a(), c("ul", se, [
211
+ (a(!0), c(J, null, K(u.items, (r, f) => b(e.$slots, "item", {
212
+ item: r,
194
213
  index: f,
195
- onSelect: () => O(s)
214
+ onSelect: () => O(r)
196
215
  }, () => [
197
216
  (a(), c("li", {
198
217
  key: f,
199
- class: C(["rds-e-popover__item rds-body-02-bold", { "rds-e-popover__item--destructive": s.isDestructive }]),
200
- onClick: (ce) => O(s)
218
+ class: B(["rds-e-popover__item rds-body-02-bold", { "rds-e-popover__item--destructive": r.isDestructive }]),
219
+ onClick: (de) => O(r)
201
220
  }, [
202
- s.icon ? (a(), H(oe, {
221
+ r.icon ? (a(), h(le, {
203
222
  key: 0,
204
223
  class: "rds-e-popover__item-icon",
205
- name: s.icon
206
- }, null, 8, ["name"])) : R("", !0),
207
- B("span", ae, K(s.label), 1)
208
- ], 10, re))
224
+ name: r.icon
225
+ }, null, 8, ["name"])) : H("", !0),
226
+ Q("span", ce, X(r.label), 1)
227
+ ], 10, ie))
209
228
  ], !0)), 256))
210
229
  ]))
211
- ], 6)) : R("", !0)
230
+ ], 6)) : H("", !0)
212
231
  ], 8, ["to", "disabled"]))
213
232
  ]));
214
233
  }
215
- }, ve = /* @__PURE__ */ ne(ie, [["__scopeId", "data-v-97579838"]]);
234
+ }, me = /* @__PURE__ */ re(ue, [["__scopeId", "data-v-522cc1ab"]]);
216
235
  export {
217
- ve as default
236
+ me as default
218
237
  };