energy-components 1.18.0 → 1.19.0-beta.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.
@@ -1,7 +1,7 @@
1
- import { defineComponent as h, toRefs as y, ref as C, watchEffect as L, onMounted as T, createElementBlock as i, openBlock as u, Fragment as I, renderList as w, normalizeClass as x, unref as B, createVNode as j, mergeProps as E, toHandlers as P, withCtx as S, createCommentVNode as D } from "vue";
1
+ import { defineComponent as C, toRefs as h, ref as y, watchEffect as I, onMounted as L, createElementBlock as u, openBlock as d, Fragment as T, renderList as w, normalizeClass as x, unref as B, createVNode as E, mergeProps as j, toHandlers as P, withCtx as S, createCommentVNode as D } from "vue";
2
2
  import N from "./link.es.js";
3
3
  import { _ as O } from "./_plugin-vue_export-helper-CHgC5LLL.js";
4
- import './style/breadcrumbs.css';const R = ["id"], V = { key: 0 }, $ = /* @__PURE__ */ h({
4
+ import './style/breadcrumbs.css';const R = ["id"], V = { key: 0 }, q = /* @__PURE__ */ C({
5
5
  __name: "breadcrumbs",
6
6
  props: {
7
7
  /**
@@ -40,15 +40,15 @@ import './style/breadcrumbs.css';const R = ["id"], V = { key: 0 }, $ = /* @__PUR
40
40
  default: void 0
41
41
  }
42
42
  },
43
- emits: ["onClickTrimmedList"],
44
- setup(a, { emit: v }) {
45
- const s = a, d = v, {
43
+ emits: ["onClickTrimmedList", "onClickItem", "onClickEllipsis"],
44
+ setup(c, { emit: m }) {
45
+ const s = c, n = m, {
46
46
  items: r,
47
- inverse: n
48
- } = y(s), l = C(), m = () => {
49
- s.leftTrim ? d("onClickTrimmedList", r.value.slice(0, -2)) : d("onClickTrimmedList", r.value.slice(1, -1));
47
+ inverse: i
48
+ } = h(s), a = y(), v = () => {
49
+ s.leftTrim ? n("onClickTrimmedList", r.value.slice(0, -2)) : n("onClickTrimmedList", r.value.slice(1, -1));
50
50
  }, p = () => {
51
- l.value = [
51
+ a.value = [
52
52
  r.value[0],
53
53
  {
54
54
  text: "...",
@@ -59,8 +59,8 @@ import './style/breadcrumbs.css';const R = ["id"], V = { key: 0 }, $ = /* @__PUR
59
59
  },
60
60
  r.value[r.value.length - 1]
61
61
  ];
62
- }, b = () => {
63
- l.value = [
62
+ }, k = () => {
63
+ a.value = [
64
64
  {
65
65
  text: "...",
66
66
  active: !1,
@@ -72,47 +72,50 @@ import './style/breadcrumbs.css';const R = ["id"], V = { key: 0 }, $ = /* @__PUR
72
72
  r.value[r.value.length - 1]
73
73
  ];
74
74
  }, f = () => {
75
- s.trimItems && r.value.length >= 3 ? p() : s.leftTrim && r.value.length >= 3 ? b() : typeof s.items == "object" ? l.value = s.items : console.error("energy-components: The prop is not an Object");
76
- }, k = (e, o) => {
75
+ s.trimItems && r.value.length >= 3 ? p() : s.leftTrim && r.value.length >= 3 ? k() : typeof s.items == "object" ? a.value = s.items : console.error("energy-components: The prop is not an Object");
76
+ }, b = (e, o) => {
77
77
  const t = {
78
78
  ...e,
79
- inverse: n.value,
79
+ inverse: i.value,
80
80
  customClass: "rds-e-breadcrumbs__link--text"
81
81
  };
82
- return o !== l.value.length - 1 && Object.assign(t, {
82
+ return o !== a.value.length - 1 && Object.assign(t, {
83
83
  arrow: !0,
84
84
  right: !0,
85
85
  arrowSmall: !0
86
86
  }), t;
87
- }, _ = (e) => ({
87
+ }, _ = (e, o) => ({
88
88
  click: (t) => {
89
- t.preventDefault(), t.stopPropagation(), e != null && e.clickable && m();
89
+ if (n("onClickItem", { item: e, index: o ?? -1, event: t }), e != null && e.clickable) {
90
+ const l = s.leftTrim ? r.value.slice(0, -2) : r.value.slice(1, -1);
91
+ n("onClickEllipsis", { trimmed: l, event: t }), v(), t.preventDefault(), t.stopPropagation();
92
+ }
90
93
  }
91
94
  }), g = (e) => [
92
95
  "rds-e-breadcrumbs__link",
93
96
  e != null && e.active ? "rds-e-breadcrumbs__link--active" : "",
94
- n.value && (e != null && e.active) ? "rds-e-breadcrumbs__link--inverse-active" : ""
97
+ i.value && (e != null && e.active) ? "rds-e-breadcrumbs__link--inverse-active" : ""
95
98
  ];
96
- return L(() => {
99
+ return I(() => {
97
100
  f();
98
- }), T(() => {
101
+ }), L(() => {
99
102
  f();
100
- }), (e, o) => (u(!0), i(I, null, w(l.value, (t, c) => (u(), i("ul", {
101
- id: a.id ? `${a.id}-${c}` : void 0,
102
- key: c,
103
- class: x(["rds-e-breadcrumbs", `${B(n) ? "rds-e-breadcrumbs--inverse" : ""}`])
103
+ }), (e, o) => (d(!0), u(T, null, w(a.value, (t, l) => (d(), u("ul", {
104
+ id: c.id ? `${c.id}-${l}` : void 0,
105
+ key: l,
106
+ class: x(["rds-e-breadcrumbs", `${B(i) ? "rds-e-breadcrumbs--inverse" : ""}`])
104
107
  }, [
105
- j(N, E({
108
+ E(N, j({
106
109
  class: g(t)
107
- }, { ref_for: !0 }, k(t, c), P(_(t))), {
110
+ }, { ref_for: !0 }, b(t, l), P(_(t, l))), {
108
111
  default: S(() => [
109
- t != null && t.clickable ? (u(), i("span", V, "...")) : D("", !0)
112
+ t != null && t.clickable ? (d(), u("span", V, "...")) : D("", !0)
110
113
  ]),
111
114
  _: 2
112
115
  }, 1040, ["class"])
113
116
  ], 10, R))), 128));
114
117
  }
115
- }), F = /* @__PURE__ */ O($, [["__scopeId", "data-v-dfc178d7"]]);
118
+ }), H = /* @__PURE__ */ O(q, [["__scopeId", "data-v-1a87a370"]]);
116
119
  export {
117
- F as default
120
+ H as default
118
121
  };