energy-components 1.12.0 → 1.14.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 (51) hide show
  1. package/dist/components/breadcrumbs.es.js +59 -40
  2. package/dist/components/checkbox.es.js +67 -45
  3. package/dist/components/datepicker.es.js +2276 -2251
  4. package/dist/components/dropdown.es.js +232 -176
  5. package/dist/components/index.es.js +15 -15
  6. package/dist/components/indicator.es.js +8 -8
  7. package/dist/components/multiselect.es.js +15 -11
  8. package/dist/components/style/accordion.css +1 -1
  9. package/dist/components/style/actionButton.css +1 -1
  10. package/dist/components/style/breadcrumbs.css +1 -1
  11. package/dist/components/style/button.css +1 -1
  12. package/dist/components/style/checkbox.css +1 -1
  13. package/dist/components/style/collapsable.css +1 -1
  14. package/dist/components/style/datepicker.css +1 -1
  15. package/dist/components/style/directAccess.css +1 -1
  16. package/dist/components/style/dragAndDrop.css +1 -1
  17. package/dist/components/style/dropdown.css +1 -1
  18. package/dist/components/style/filterChip.css +1 -1
  19. package/dist/components/style/filterTag.css +1 -1
  20. package/dist/components/style/indicator.css +1 -1
  21. package/dist/components/style/infoBox.css +1 -1
  22. package/dist/components/style/link.css +1 -1
  23. package/dist/components/style/multiselect.css +1 -1
  24. package/dist/components/style/persistentToast.css +1 -1
  25. package/dist/components/style/progressBar.css +1 -1
  26. package/dist/components/style/quantitySelector.css +1 -1
  27. package/dist/components/style/radioButton.css +1 -1
  28. package/dist/components/style/selectionChip.css +1 -1
  29. package/dist/components/style/switch.css +1 -1
  30. package/dist/components/style/tableslotedcomponent.css +1 -1
  31. package/dist/components/style/tag.css +1 -1
  32. package/dist/components/style/textArea.css +1 -1
  33. package/dist/components/style/textField.css +1 -1
  34. package/dist/components/style/tooltip.css +1 -1
  35. package/dist/components/textField.es.js +25 -25
  36. package/dist/components/tooltip.es.js +334 -315
  37. package/dist/energy-components.es.js +14716 -14572
  38. package/dist/energy-components.umd.js +2 -2
  39. package/dist/style.css +1 -1
  40. package/dist/types/src/components/content/avatar/avatar.vue.d.ts +2 -2
  41. package/dist/types/src/components/content/collapsable/collapsable.vue.d.ts +2 -2
  42. package/dist/types/src/components/input/checkbox/checkbox.vue.d.ts +15 -0
  43. package/dist/types/src/components/input/datepicker/datepicker.vue.d.ts +4 -2
  44. package/dist/types/src/components/input/drag-and-drop/drag-and-drop.vue.d.ts +1 -1
  45. package/dist/types/src/components/input/dropdown/dropdown.vue.d.ts +58 -13
  46. package/dist/types/src/components/input/filter-tag/filter-tag.vue.d.ts +2 -2
  47. package/dist/types/src/components/input/text-field/text-field.vue.d.ts +1 -1
  48. package/dist/types/src/components/navigation/breadcrumbs/breadcrumbs.vue.d.ts +15 -0
  49. package/dist/types/src/components/overlay/tooltip/tooltip.vue.d.ts +17 -2
  50. package/dist/types/tsconfig.tsbuildinfo +1 -1
  51. package/package.json +2 -2
@@ -1,7 +1,7 @@
1
- import { defineComponent as g, toRefs as h, ref as C, watchEffect as y, onMounted as L, createElementBlock as c, openBlock as l, Fragment as I, renderList as w, normalizeClass as x, unref as B, createVNode as j, mergeProps as E, toHandlers as P, withCtx as T, createCommentVNode as D } from "vue";
2
- import N from "./link.es.js";
3
- import { _ as O } from "./_plugin-vue_export-helper-CHgC5LLL.js";
4
- import './style/breadcrumbs.css';const R = { key: 0 }, S = /* @__PURE__ */ g({
1
+ import { defineComponent as h, toRefs as C, ref as y, watchEffect as L, onMounted as T, createElementBlock as o, openBlock as c, Fragment as I, renderList as x, normalizeClass as w, unref as B, createVNode as j, mergeProps as E, toHandlers as P, withCtx as D, createCommentVNode as N } from "vue";
2
+ import O from "./link.es.js";
3
+ import { _ as R } from "./_plugin-vue_export-helper-CHgC5LLL.js";
4
+ import './style/breadcrumbs.css';const S = { key: 0 }, V = /* @__PURE__ */ h({
5
5
  __name: "breadcrumbs",
6
6
  props: {
7
7
  /**
@@ -24,18 +24,36 @@ import './style/breadcrumbs.css';const R = { key: 0 }, S = /* @__PURE__ */ g({
24
24
  trimItems: {
25
25
  type: Boolean,
26
26
  default: !1
27
+ },
28
+ /**
29
+ * <span>Indica si el breadcrumb debe ser recortado por la izquierda, mostrando solo los dos últimos niveles.</span>
30
+ */
31
+ leftTrim: {
32
+ type: Boolean,
33
+ default: !1
27
34
  }
28
35
  },
29
36
  emits: ["onClickTrimmedList"],
30
- setup(d, { emit: p }) {
31
- const t = d, f = p, {
32
- items: s,
33
- inverse: o
34
- } = h(t), n = C(), m = () => {
35
- f("onClickTrimmedList", s.value.slice(1, -1));
36
- }, v = () => {
37
- n.value = [
38
- s.value[0],
37
+ setup(v, { emit: m }) {
38
+ const s = v, u = m, {
39
+ items: r,
40
+ inverse: l
41
+ } = C(s), a = y(), d = () => {
42
+ s.leftTrim ? u("onClickTrimmedList", r.value.slice(0, -2)) : u("onClickTrimmedList", r.value.slice(1, -1));
43
+ }, p = () => {
44
+ a.value = [
45
+ r.value[0],
46
+ {
47
+ text: "...",
48
+ active: !1,
49
+ tag: "router-link",
50
+ to: "",
51
+ clickable: !0
52
+ },
53
+ r.value[r.value.length - 1]
54
+ ];
55
+ }, b = () => {
56
+ a.value = [
39
57
  {
40
58
  text: "...",
41
59
  active: !1,
@@ -43,49 +61,50 @@ import './style/breadcrumbs.css';const R = { key: 0 }, S = /* @__PURE__ */ g({
43
61
  to: "",
44
62
  clickable: !0
45
63
  },
46
- s.value[s.value.length - 1]
64
+ r.value[r.value.length - 2],
65
+ r.value[r.value.length - 1]
47
66
  ];
48
- }, u = () => {
49
- t.trimItems && s.value.length > 3 ? v() : typeof t.items == "object" ? n.value = t.items : console.error("energy-components: The prop is not an Object");
50
- }, _ = (e, a) => {
51
- const r = {
67
+ }, i = () => {
68
+ s.trimItems && r.value.length >= 3 ? p() : s.leftTrim && r.value.length >= 3 ? b() : typeof s.items == "object" ? a.value = s.items : console.error("energy-components: The prop is not an Object");
69
+ }, k = (e, n) => {
70
+ const t = {
52
71
  ...e,
53
- inverse: o.value,
72
+ inverse: l.value,
54
73
  customClass: "rds-e-breadcrumbs__link--text"
55
74
  };
56
- return a !== n.value.length - 1 && Object.assign(r, {
75
+ return n !== a.value.length - 1 && Object.assign(t, {
57
76
  arrow: !0,
58
77
  right: !0,
59
78
  arrowSmall: !0
60
- }), r;
61
- }, b = (e) => ({
62
- click: (r) => {
63
- r.preventDefault(), r.stopPropagation(), e != null && e.clickable && m();
79
+ }), t;
80
+ }, _ = (e) => ({
81
+ click: (t) => {
82
+ t.preventDefault(), t.stopPropagation(), e != null && e.clickable && d();
64
83
  }
65
- }), k = (e) => [
84
+ }), g = (e) => [
66
85
  "rds-e-breadcrumbs__link",
67
86
  e != null && e.active ? "rds-e-breadcrumbs__link--active" : "",
68
- o.value && (e != null && e.active) ? "rds-e-breadcrumbs__link--inverse-active" : ""
87
+ l.value && (e != null && e.active) ? "rds-e-breadcrumbs__link--inverse-active" : ""
69
88
  ];
70
- return y(() => {
71
- u();
72
- }), L(() => {
73
- u();
74
- }), (e, a) => (l(!0), c(I, null, w(n.value, (r, i) => (l(), c("ul", {
75
- key: i,
76
- class: x(["rds-e-breadcrumbs", `${B(o) ? "rds-e-breadcrumbs--inverse" : ""}`])
89
+ return L(() => {
90
+ i();
91
+ }), T(() => {
92
+ i();
93
+ }), (e, n) => (c(!0), o(I, null, x(a.value, (t, f) => (c(), o("ul", {
94
+ key: f,
95
+ class: w(["rds-e-breadcrumbs", `${B(l) ? "rds-e-breadcrumbs--inverse" : ""}`])
77
96
  }, [
78
- j(N, E({
79
- class: k(r)
80
- }, { ref_for: !0 }, _(r, i), P(b(r))), {
81
- default: T(() => [
82
- r != null && r.clickable ? (l(), c("span", R, "...")) : D("", !0)
97
+ j(O, E({
98
+ class: g(t)
99
+ }, { ref_for: !0 }, k(t, f), P(_(t))), {
100
+ default: D(() => [
101
+ t != null && t.clickable ? (c(), o("span", S, "...")) : N("", !0)
83
102
  ]),
84
103
  _: 2
85
104
  }, 1040, ["class"])
86
105
  ], 2))), 128));
87
106
  }
88
- }), A = /* @__PURE__ */ O(S, [["__scopeId", "data-v-696e4937"]]);
107
+ }), F = /* @__PURE__ */ R(V, [["__scopeId", "data-v-ea69b47a"]]);
89
108
  export {
90
- A as default
109
+ F as default
91
110
  };
@@ -1,7 +1,8 @@
1
- import { defineComponent as y, ref as n, watch as b, onMounted as w, onBeforeUnmount as g, createElementBlock as S, openBlock as f, normalizeClass as d, createElementVNode as r, renderSlot as B, createTextVNode as C, createBlock as _, createCommentVNode as E, toDisplayString as L } from "vue";
2
- import { R as V } from "./icon-svg-DuzOdbk1.js";
3
- import { _ as D } from "./_plugin-vue_export-helper-CHgC5LLL.js";
4
- import './style/checkbox.css';const N = ["id", "checked", "aria-label", "required", "disabled"], R = ["for"], q = /* @__PURE__ */ y({
1
+ import { defineComponent as g, ref as n, watch as f, onMounted as S, onBeforeUnmount as B, createElementBlock as C, openBlock as r, normalizeClass as c, createElementVNode as s, renderSlot as V, createTextVNode as D, createBlock as m, createCommentVNode as E, toDisplayString as L, withCtx as N, createVNode as R } from "vue";
2
+ import { R as k } from "./icon-svg-DuzOdbk1.js";
3
+ import T from "./tooltip.es.js";
4
+ import { _ as q } from "./_plugin-vue_export-helper-CHgC5LLL.js";
5
+ import './style/checkbox.css';const p = ["id", "checked", "aria-label", "required", "disabled"], z = ["for"], F = /* @__PURE__ */ g({
5
6
  __name: "checkbox",
6
7
  props: {
7
8
  /**
@@ -32,6 +33,13 @@ import './style/checkbox.css';const N = ["id", "checked", "aria-label", "require
32
33
  type: String,
33
34
  default: ""
34
35
  },
36
+ /**
37
+ * <span>Texto del tooltip para el icono. Si se proporciona, el icono mostrará un tooltip.</span>
38
+ */
39
+ iconTooltip: {
40
+ type: String,
41
+ default: ""
42
+ },
35
43
  /**
36
44
  * <span>Estado del checkbox</span>
37
45
  */
@@ -69,58 +77,58 @@ import './style/checkbox.css';const N = ["id", "checked", "aria-label", "require
69
77
  }
70
78
  },
71
79
  emits: ["update:modelValue"],
72
- setup(e, { emit: m }) {
73
- const o = e, k = m, t = n(o.isChecked), c = n(!1), i = n(!1), l = n(null);
74
- b(() => o.isChecked, (a) => {
75
- t.value = a;
76
- }), b(
77
- () => o.indeterminate,
78
- (a) => {
79
- l.value && (l.value.indeterminate = !!(a && t.value));
80
+ setup(e, { emit: h }) {
81
+ const l = e, x = h, a = n(l.isChecked), i = n(!1), d = n(!1), o = n(null);
82
+ f(() => l.isChecked, (t) => {
83
+ a.value = t;
84
+ }), f(
85
+ () => l.indeterminate,
86
+ (t) => {
87
+ o.value && (o.value.indeterminate = !!(t && a.value));
80
88
  },
81
89
  { immediate: !0 }
82
90
  );
83
- const h = () => {
84
- i.value && (c.value = !0);
85
- }, v = () => c.value = !1, x = (a) => {
86
- t.value = a.target.checked, k("update:modelValue", a.target.checked);
87
- }, s = (a) => {
88
- a.key === "Tab" && (i.value = !0);
89
- }, u = () => {
90
- i.value = !1;
91
+ const v = () => {
92
+ d.value && (i.value = !0);
93
+ }, y = () => i.value = !1, w = (t) => {
94
+ a.value = t.target.checked, x("update:modelValue", t.target.checked);
95
+ }, u = (t) => {
96
+ t.key === "Tab" && (d.value = !0);
97
+ }, b = () => {
98
+ d.value = !1;
91
99
  };
92
- return w(() => {
93
- l.value && (l.value.indeterminate = !!(o.indeterminate && t.value)), window.addEventListener("keydown", s), window.addEventListener("mousedown", u);
94
- }), g(() => {
95
- window.removeEventListener("keydown", s), window.removeEventListener("mousedown", u);
96
- }), (a, p) => (f(), S("div", {
97
- class: d(["rds-e-checkbox__container", { "rds-e-checkbox__container--focused": c.value }])
100
+ return S(() => {
101
+ o.value && (o.value.indeterminate = !!(l.indeterminate && a.value)), window.addEventListener("keydown", u), window.addEventListener("mousedown", b);
102
+ }), B(() => {
103
+ window.removeEventListener("keydown", u), window.removeEventListener("mousedown", b);
104
+ }), (t, I) => (r(), C("div", {
105
+ class: c(["rds-e-checkbox__container", { "rds-e-checkbox__container--focused": i.value }])
98
106
  }, [
99
- r("input", {
107
+ s("input", {
100
108
  id: e.id.toString(),
101
109
  ref_key: "inputRef",
102
- ref: l,
110
+ ref: o,
103
111
  checked: e.isChecked,
104
112
  "aria-label": e.accessibilityLabel,
105
113
  type: "checkbox",
106
- class: d(["rds-e-checkbox", { "rds-e-checkbox--error": e.error }]),
114
+ class: c(["rds-e-checkbox", { "rds-e-checkbox--error": e.error }]),
107
115
  required: e.required,
108
116
  disabled: e.disabled,
109
- onChange: x,
110
- onFocus: h,
111
- onBlur: v
112
- }, null, 42, N),
113
- r("label", {
117
+ onChange: w,
118
+ onFocus: v,
119
+ onBlur: y
120
+ }, null, 42, p),
121
+ s("label", {
114
122
  for: e.id.toString(),
115
- class: d(["rds-e-checkbox__label", {
123
+ class: c(["rds-e-checkbox__label", {
116
124
  "rds-e-checkbox__label--disabled": e.disabled,
117
- "rds-e-checkbox__label--checked": t.value,
118
- "rds-e-checkbox__label--indeterminate": e.indeterminate && t.value
125
+ "rds-e-checkbox__label--checked": a.value,
126
+ "rds-e-checkbox__label--indeterminate": e.indeterminate && a.value
119
127
  }])
120
128
  }, [
121
- B(a.$slots, "label-text", {}, () => [
122
- r("span", {
123
- class: d([
129
+ V(t.$slots, "label-text", {}, () => [
130
+ s("span", {
131
+ class: c([
124
132
  "rds-e-checkbox__label-box",
125
133
  {
126
134
  "rds-e-checkbox__label-box--disabled": e.disabled,
@@ -128,19 +136,33 @@ import './style/checkbox.css';const N = ["id", "checked", "aria-label", "require
128
136
  }
129
137
  ])
130
138
  }, [
131
- C(L(e.label) + " ", 1),
132
- e.icon ? (f(), _(V, {
139
+ D(L(e.label) + " ", 1),
140
+ e.icon && e.iconTooltip ? (r(), m(T, {
133
141
  key: 0,
142
+ content: e.iconTooltip,
143
+ placement: "top",
144
+ "offset-space": 8
145
+ }, {
146
+ default: N(() => [
147
+ R(k, {
148
+ class: "rds-e-checkbox__label-box--icon",
149
+ name: e.icon,
150
+ size: "sm"
151
+ }, null, 8, ["name"])
152
+ ]),
153
+ _: 1
154
+ }, 8, ["content"])) : e.icon ? (r(), m(k, {
155
+ key: 1,
134
156
  class: "rds-e-checkbox__label-box--icon",
135
157
  name: e.icon,
136
158
  size: "sm"
137
159
  }, null, 8, ["name"])) : E("", !0)
138
160
  ], 2)
139
161
  ], !0)
140
- ], 10, R)
162
+ ], 10, z)
141
163
  ], 2));
142
164
  }
143
- }), K = /* @__PURE__ */ D(q, [["__scopeId", "data-v-1f3c3114"]]);
165
+ }), $ = /* @__PURE__ */ q(F, [["__scopeId", "data-v-472a518b"]]);
144
166
  export {
145
- K as default
167
+ $ as default
146
168
  };