wj-elements 0.4.8 → 0.5.1

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.
@@ -4,7 +4,14 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
4
4
  import WJElement from "./wje-element.js";
5
5
  import { WjElementUtils } from "./element-utils.js";
6
6
  import { event } from "./event.js";
7
- const styles = "/*\n[ WJ Breadcrumb ]\n*/\n\n:host {\n display: flex;\n flex: 0 0 auto;\n align-items: center;\n line-height: 1.5;\n\n .native-breadcrumb {\n display: flex;\n align-items: center;\n width: 100%;\n outline: none;\n background: inherit;\n padding: 0.25rem 0.75rem;\n color: var(--wje-breadcrumb-a);\n text-decoration: none;\n font-size: var(--wje-breadcrumb-font-size);\n &.hidden {\n display: none;\n }\n &.active {\n font-weight: var(--wje-breadcrumb-active-font-weight);\n font-size: var(--wje-breadcrumb-active-font-size);\n }\n &:hover {\n color: var(--wje-breadcrumb-a-hover);\n }\n }\n\n button {\n margin-inline: 0.75rem;\n border: 0 solid transparent;\n border-radius: 3px;\n background-color: transparent;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n }\n\n .separator {\n display: inline-flex;\n align-items: center;\n }\n}\n\n:host(.collapsed) {\n display: none;\n}\n\n::slotted([slot='start']) {\n margin-inline: 0 0.5rem;\n}\n\n::slotted([slot='end']) {\n margin-inline: 0.5rem 0;\n}\n";
7
+ import "./wje-button.js";
8
+ import "./wje-dropdown.js";
9
+ import "./icon-CReYMzAK.js";
10
+ import "./wje-menu.js";
11
+ import "./wje-menu-item.js";
12
+ import "./wje-popup.js";
13
+ import "./wje-tooltip.js";
14
+ const styles = "/*\n[ WJ Breadcrumb ]\n*/\n\n:host {\n display: flex;\n flex: 0 0 auto;\n align-items: center;\n line-height: var(--wje-breadcrumb-line-height, 1.5);\n\n .native-breadcrumb {\n display: flex;\n align-items: center;\n width: 100%;\n outline: none;\n background: inherit;\n margin: var(--wje-breadcrumb-margin, var(--wje-breadcrumb-native-margin, 0));\n padding: var(--wje-breadcrumb-padding, var(--wje-breadcrumb-native-padding, 0.25rem 0.75rem));\n color: var(--wje-breadcrumb-a);\n text-decoration: none;\n font-size: var(--wje-breadcrumb-font-size);\n line-height: var(--wje-breadcrumb-native-line-height, var(--wje-breadcrumb-line-height, 1.5));\n &.hidden {\n display: none;\n }\n &.active {\n font-weight: var(--wje-breadcrumb-active-font-weight);\n font-size: var(--wje-breadcrumb-active-font-size);\n }\n &.disabled {\n cursor: default;\n opacity: 0.6;\n }\n &:hover {\n color: var(--wje-breadcrumb-a-hover);\n }\n }\n\n button {\n margin-inline: 0.75rem;\n border: 0 solid transparent;\n border-radius: 3px;\n background-color: transparent;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n }\n\n .separator {\n display: inline-flex;\n align-items: center;\n }\n}\n\n:host(.collapsed) {\n display: none;\n}\n\n::slotted([slot='start']) {\n margin-inline: 0 0.5rem;\n}\n\n::slotted([slot='end']) {\n margin-inline: 0.5rem 0;\n}\n";
8
15
  class Breadcrumb extends WJElement {
9
16
  /**
10
17
  * Breadcrumb constructor method.
@@ -18,6 +25,40 @@ class Breadcrumb extends WJElement {
18
25
  __publicField(this, "className", "Breadcrumb");
19
26
  this._showSeparator = true;
20
27
  this._showCollapsedIndicator = false;
28
+ this.handleNativeClick = (e) => this.handleDisabledNativeClick(e);
29
+ }
30
+ /**
31
+ * Sets the breadcrumb link URL.
32
+ * @param {string|null} value Link URL.
33
+ */
34
+ set href(value) {
35
+ if (value === null || value === void 0) this.removeAttribute("href");
36
+ else this.setAttribute("href", value);
37
+ }
38
+ /**
39
+ * Gets the breadcrumb link URL.
40
+ * @returns {string|null}
41
+ */
42
+ get href() {
43
+ return this.getAttribute("href");
44
+ }
45
+ /**
46
+ * Sets the disabled state.
47
+ * @param {boolean} value Disabled state.
48
+ */
49
+ set disabled(value) {
50
+ if (value === true || value === "" || value === "true" || value === 1 || value === "1") {
51
+ this.setAttribute("disabled", "");
52
+ } else {
53
+ this.removeAttribute("disabled");
54
+ }
55
+ }
56
+ /**
57
+ * Gets the disabled state.
58
+ * @returns {boolean}
59
+ */
60
+ get disabled() {
61
+ return this.hasAttribute("disabled");
21
62
  }
22
63
  /**
23
64
  * Get show separator flag.
@@ -63,7 +104,7 @@ class Breadcrumb extends WJElement {
63
104
  * @returns {Array<string>} - The observed attributes array for the Breadcrumb element.
64
105
  */
65
106
  static get observedAttributes() {
66
- return ["show-collapsed-indicator", "collapsed", "last"];
107
+ return ["show-collapsed-indicator", "collapsed", "last", "href", "target", "rel", "download", "disabled", "title", "aria-label"];
67
108
  }
68
109
  /**
69
110
  * Handles attribute changes for the custom element and updates its behavior or appearance accordingly.
@@ -72,25 +113,28 @@ class Breadcrumb extends WJElement {
72
113
  * @param {string|null} newValue The new value of the attribute after it was changed. Null if the attribute was removed.
73
114
  */
74
115
  attributeChangedCallback(name, oldValue, newValue) {
75
- var _a;
76
- (_a = super.attributeChangedCallback) == null ? void 0 : _a.call(this, name, oldValue, newValue);
116
+ var _a, _b;
117
+ if (oldValue === newValue) return;
77
118
  if (name === "collapsed") {
78
- const isCollapsed = WjElementUtils.stringToBoolean(newValue);
119
+ const isCollapsed = newValue !== null && WjElementUtils.stringToBoolean(newValue);
79
120
  this.classList.toggle("collapsed", isCollapsed && !this.hasAttribute("show-collapsed-indicator"));
80
121
  } else if (name === "show-collapsed-indicator") {
81
- const isOn = WjElementUtils.stringToBoolean(newValue);
122
+ (_a = super.attributeChangedCallback) == null ? void 0 : _a.call(this, name, oldValue, newValue);
123
+ const isOn = newValue !== null && WjElementUtils.stringToBoolean(newValue);
82
124
  this._showCollapsedIndicator = isOn;
125
+ this.classList.toggle("collapsed", this.hasAttribute("collapsed") && !isOn);
83
126
  this.refresh();
84
127
  } else if (name === "last") {
85
- const isLast = WjElementUtils.stringToBoolean(newValue);
128
+ (_b = super.attributeChangedCallback) == null ? void 0 : _b.call(this, name, oldValue, newValue);
129
+ const isLast = newValue !== null && WjElementUtils.stringToBoolean(newValue);
86
130
  this.active = isLast;
87
131
  this.showSeparator = !isLast;
88
132
  this.syncAria();
89
- if (this.native) {
90
- if (isLast) this.native.setAttribute("aria-current", "page");
91
- else this.native.removeAttribute("aria-current");
92
- }
133
+ this.syncNativeAttributes();
93
134
  this.refresh();
135
+ } else {
136
+ this.syncAria();
137
+ this.syncNativeAttributes();
94
138
  }
95
139
  }
96
140
  /**
@@ -104,6 +148,8 @@ class Breadcrumb extends WJElement {
104
148
  this.setAriaState({ role: "link" });
105
149
  if (this.active) this.setAriaState({ current: "page" });
106
150
  else this.removeAttribute("aria-current");
151
+ if (this.disabled) this.setAriaState({ disabled: true });
152
+ else this.removeAttribute("aria-disabled");
107
153
  }
108
154
  /**
109
155
  * Draw method for the Breadcrumb element.
@@ -114,8 +160,8 @@ class Breadcrumb extends WJElement {
114
160
  let native = document.createElement("a");
115
161
  native.classList.add("native-breadcrumb");
116
162
  native.setAttribute("part", "native");
117
- if (this.active) native.setAttribute("aria-current", "page");
118
- if (this.active) native.classList.add("active");
163
+ this.native = native;
164
+ this.syncNativeAttributes();
119
165
  let slot = document.createElement("slot");
120
166
  let start = document.createElement("slot");
121
167
  start.setAttribute("name", "start");
@@ -127,7 +173,7 @@ class Breadcrumb extends WJElement {
127
173
  fragment.append(this.drawCollapsedIndicator());
128
174
  native.classList.add("hidden");
129
175
  }
130
- if (this.showSeparator) {
176
+ if (this.shouldRenderSeparator()) {
131
177
  let separator = document.createElement("span");
132
178
  separator.classList.add("separator");
133
179
  separator.setAttribute("part", "separator");
@@ -140,9 +186,101 @@ class Breadcrumb extends WJElement {
140
186
  }
141
187
  fragment.append(separator);
142
188
  }
143
- this.native = native;
144
189
  return fragment;
145
190
  }
191
+ /**
192
+ * Returns whether the separator should be visible after this breadcrumb.
193
+ * @returns {boolean}
194
+ */
195
+ shouldRenderSeparator() {
196
+ return this.showSeparator && this.hasVisibleBreadcrumbAfter();
197
+ }
198
+ /**
199
+ * Returns whether any later breadcrumb is still visible in the rendered trail.
200
+ * @returns {boolean}
201
+ */
202
+ hasVisibleBreadcrumbAfter() {
203
+ var _a, _b;
204
+ const breadcrumbs = (_b = (_a = this.parentElement) == null ? void 0 : _a.getBreadcrumbs) == null ? void 0 : _b.call(_a);
205
+ if (!Array.isArray(breadcrumbs)) return true;
206
+ const index = breadcrumbs.indexOf(this);
207
+ if (index === -1) return true;
208
+ return breadcrumbs.slice(index + 1).some((breadcrumb) => this.isBreadcrumbVisibleInTrail(breadcrumb));
209
+ }
210
+ /**
211
+ * Returns whether a breadcrumb is visible in the rendered trail.
212
+ * @param {Element} breadcrumb Breadcrumb element to inspect.
213
+ * @returns {boolean}
214
+ */
215
+ isBreadcrumbVisibleInTrail(breadcrumb) {
216
+ var _a, _b;
217
+ return !(((_a = breadcrumb == null ? void 0 : breadcrumb.hasAttribute) == null ? void 0 : _a.call(breadcrumb, "collapsed")) && !((_b = breadcrumb == null ? void 0 : breadcrumb.hasAttribute) == null ? void 0 : _b.call(breadcrumb, "show-collapsed-indicator")));
218
+ }
219
+ /**
220
+ * Synchronizes host attributes to the internal anchor.
221
+ */
222
+ syncNativeAttributes() {
223
+ var _a;
224
+ const native = this.native || ((_a = this.context) == null ? void 0 : _a.querySelector("a.native-breadcrumb"));
225
+ if (!native) return;
226
+ const isDisabled = this.disabled;
227
+ const href = this.href;
228
+ if (href !== null && href !== void 0 && !isDisabled) {
229
+ native.setAttribute("href", href);
230
+ } else {
231
+ native.removeAttribute("href");
232
+ }
233
+ ["target", "rel", "download"].forEach((attr) => {
234
+ if (this.hasAttribute(attr) && !isDisabled) {
235
+ native.setAttribute(attr, this.getAttribute(attr));
236
+ } else {
237
+ native.removeAttribute(attr);
238
+ }
239
+ });
240
+ ["title", "aria-label"].forEach((attr) => {
241
+ if (this.hasAttribute(attr)) {
242
+ native.setAttribute(attr, this.getAttribute(attr));
243
+ } else {
244
+ native.removeAttribute(attr);
245
+ }
246
+ });
247
+ native.classList.toggle("active", Boolean(this.active));
248
+ native.classList.toggle("disabled", isDisabled);
249
+ if (this.active) native.setAttribute("aria-current", "page");
250
+ else native.removeAttribute("aria-current");
251
+ if (isDisabled) {
252
+ native.setAttribute("aria-disabled", "true");
253
+ native.setAttribute("tabindex", "-1");
254
+ } else {
255
+ native.removeAttribute("aria-disabled");
256
+ native.removeAttribute("tabindex");
257
+ }
258
+ }
259
+ /**
260
+ * Sets up native anchor listeners after render.
261
+ */
262
+ afterDraw() {
263
+ var _a;
264
+ (_a = this.native) == null ? void 0 : _a.addEventListener("click", this.handleNativeClick);
265
+ }
266
+ /**
267
+ * Removes native anchor listeners before redraw/disconnect.
268
+ */
269
+ beforeDisconnect() {
270
+ var _a;
271
+ (_a = this.native) == null ? void 0 : _a.removeEventListener("click", this.handleNativeClick);
272
+ }
273
+ /**
274
+ * Prevents disabled breadcrumbs from navigating or bubbling click handlers.
275
+ * @param {MouseEvent} e Click event.
276
+ */
277
+ handleDisabledNativeClick(e) {
278
+ var _a;
279
+ if (!this.disabled) return;
280
+ e.preventDefault();
281
+ e.stopPropagation();
282
+ (_a = e.stopImmediatePropagation) == null ? void 0 : _a.call(e);
283
+ }
146
284
  /**
147
285
  * Renders the collapsed indicator based on the current collapsed variant.
148
286
  * If the collapsed variant is 'DROPDOWN', it invokes the collapseDropdown method.
@@ -167,15 +305,14 @@ class Breadcrumb extends WJElement {
167
305
  * @returns {HTMLElement} A configured dropdown element containing a button as trigger and a menu with breadcrumb items.
168
306
  */
169
307
  collapseDropdown() {
308
+ const isBreakpointMenuIndicator = this.isBreakpointMenuIndicator();
170
309
  let dropdown = document.createElement("wje-dropdown");
171
- dropdown.setAttribute("placement", "bottom");
310
+ dropdown.setAttribute("placement", isBreakpointMenuIndicator ? "bottom-start" : "bottom");
172
311
  dropdown.setAttribute("offset", "10");
173
- let button = document.createElement("wje-button");
174
- button.setAttribute("slot", "trigger");
175
- button.setAttribute("fill", "link");
176
- button.innerHTML = `<wje-icon name="dots"></wje-icon>`;
312
+ const trigger = this.createCollapsedDropdownTrigger(isBreakpointMenuIndicator);
177
313
  let menu = document.createElement("wje-menu");
178
314
  menu.setAttribute("variant", "context");
315
+ menu.style.setProperty("--wje-menu-item-justify-content", "flex-start");
179
316
  menu.addEventListener("click", (e) => {
180
317
  var _a;
181
318
  e.stopPropagation();
@@ -183,7 +320,7 @@ class Breadcrumb extends WJElement {
183
320
  });
184
321
  this.getBreadcrumbs().getBreadcrumbsCollapsed().forEach((b) => {
185
322
  let menuItem = document.createElement("wje-menu-item");
186
- menuItem.innerHTML = b.innerHTML;
323
+ this.populateCollapsedMenuItem(menuItem, b);
187
324
  menuItem.__breadcrumb = b;
188
325
  menuItem.addEventListener("wje-menu-item:click", (e) => {
189
326
  var _a, _b, _c;
@@ -209,9 +346,93 @@ class Breadcrumb extends WJElement {
209
346
  });
210
347
  menu.append(menuItem);
211
348
  });
212
- dropdown.append(button, menu);
349
+ dropdown.append(trigger, menu);
213
350
  return dropdown;
214
351
  }
352
+ /**
353
+ * Creates the dropdown trigger for collapsed breadcrumbs.
354
+ * @param {boolean} isBreakpointMenuIndicator Whether this trigger controls the full breakpoint menu.
355
+ * @returns {HTMLElement}
356
+ */
357
+ createCollapsedDropdownTrigger(isBreakpointMenuIndicator) {
358
+ var _a, _b;
359
+ if (isBreakpointMenuIndicator) {
360
+ const customTrigger = (_b = (_a = this.getBreadcrumbs()) == null ? void 0 : _a.getBreakpointCollapseTrigger) == null ? void 0 : _b.call(_a);
361
+ if (customTrigger) {
362
+ const trigger = customTrigger.cloneNode(true);
363
+ trigger.setAttribute("slot", "trigger");
364
+ if (!trigger.hasAttribute("aria-label")) {
365
+ trigger.setAttribute("aria-label", "Show breadcrumb menu");
366
+ }
367
+ return trigger;
368
+ }
369
+ }
370
+ let button = document.createElement("wje-button");
371
+ button.setAttribute("slot", "trigger");
372
+ button.setAttribute("fill", "link");
373
+ button.setAttribute("aria-label", "Show more breadcrumbs");
374
+ button.innerHTML = `<wje-icon name="${this.getCollapsedDropdownIcon(isBreakpointMenuIndicator)}"></wje-icon>`;
375
+ return button;
376
+ }
377
+ /**
378
+ * Resolves the icon used by the default dropdown trigger.
379
+ * @param {boolean} isBreakpointMenuIndicator Whether this trigger controls the full breakpoint menu.
380
+ * @returns {string}
381
+ */
382
+ getCollapsedDropdownIcon(isBreakpointMenuIndicator) {
383
+ var _a;
384
+ if (!isBreakpointMenuIndicator) return "dots";
385
+ return ((_a = this.getBreadcrumbs()) == null ? void 0 : _a.breakpointCollapseIcon) || "menu";
386
+ }
387
+ /**
388
+ * Copies breadcrumb content into a collapsed menu item.
389
+ * @param {HTMLElement} menuItem Menu item receiving the content.
390
+ * @param {HTMLElement} breadcrumb Source breadcrumb.
391
+ */
392
+ populateCollapsedMenuItem(menuItem, breadcrumb) {
393
+ const nodes = Array.from(breadcrumb.childNodes).map((node) => node.cloneNode(true));
394
+ menuItem.replaceChildren(...nodes);
395
+ if (menuItem.textContent.trim()) return;
396
+ const label = this.getCollapsedMenuItemLabel(breadcrumb);
397
+ if (label) {
398
+ menuItem.append(document.createTextNode(label));
399
+ }
400
+ }
401
+ /**
402
+ * Resolves a readable label for icon-only collapsed menu items.
403
+ * @param {HTMLElement} breadcrumb Source breadcrumb.
404
+ * @returns {string}
405
+ */
406
+ getCollapsedMenuItemLabel(breadcrumb) {
407
+ var _a;
408
+ const explicitLabel = breadcrumb.getAttribute("aria-label") || breadcrumb.getAttribute("title");
409
+ if (explicitLabel == null ? void 0 : explicitLabel.trim()) return explicitLabel.trim();
410
+ const text = breadcrumb.textContent.trim();
411
+ if (text) return text;
412
+ const iconName = (_a = breadcrumb.querySelector('wje-icon[slot="start"]')) == null ? void 0 : _a.getAttribute("name");
413
+ if (iconName === "home") return "Home";
414
+ const href = breadcrumb.getAttribute("href");
415
+ const path = (href == null ? void 0 : href.split(/[?#]/)[0]) || "";
416
+ const segment = path.split("/").filter(Boolean).pop();
417
+ return segment ? this.humanizeCollapsedMenuItemLabel(segment) : "";
418
+ }
419
+ /**
420
+ * Turns a URL segment into a readable menu label.
421
+ * @param {string} value URL segment.
422
+ * @returns {string}
423
+ */
424
+ humanizeCollapsedMenuItemLabel(value) {
425
+ return decodeURIComponent(value).replace(/[-_]+/g, " ").replace(/\b\w/g, (letter) => letter.toUpperCase());
426
+ }
427
+ /**
428
+ * Returns whether this collapsed indicator represents the full breakpoint menu.
429
+ * @returns {boolean}
430
+ */
431
+ isBreakpointMenuIndicator() {
432
+ var _a;
433
+ const breadcrumbs = this.parentElement;
434
+ return this.hasAttribute("show-collapsed-indicator") && this.hasAttribute("collapsed") && ((_a = breadcrumbs == null ? void 0 : breadcrumbs.isBreakpointMenuCollapseActive) == null ? void 0 : _a.call(breadcrumbs));
435
+ }
215
436
  /**
216
437
  * Creates a button element that expands hidden breadcrumbs when clicked.
217
438
  * The button is set with appropriate attributes and event listeners to handle
@@ -1 +1 @@
1
- {"version":3,"file":"wje-breadcrumb.js","sources":["../packages/wje-breadcrumb/breadcrumb.element.js","../packages/wje-breadcrumb/breadcrumb.js"],"sourcesContent":["import { default as WJElement, event, WjElementUtils } from '../wje-element/element.js';\nimport styles from './styles/styles.css?inline';\n\n/**\n * @summary This class represents a Breadcrumb element, extending the WJElement class. It provides a navigational aid in user interfaces, displaying the current location within a hierarchy.\n * @documentation https://elements.webjet.sk/components/breadcrumb\n * @status stable\n * @augments WJElement\n * @slot - The main content of the breadcrumb.\n * @slot start - Slot for content at the start of the breadcrumb.\n * @slot end - Slot for content at the end of the breadcrumb.\n * @slot separator - Slot for a custom separator between breadcrumb items.\n * @csspart native - The native wrapper of the breadcrumb component.\n * @csspart separator - The separator between breadcrumb items.\n * @cssproperty [--wje-breadcrumb-a=var(--wje-color-contrast-8)] - The color of the breadcrumb text.\n * @cssproperty [--wje-breadcrumb-a-hover=var(--wje-color-contrast-6)] - The color of the breadcrumb separator line.\n * @tag wje-breadcrumb\n */\nexport default class Breadcrumb extends WJElement {\n /**\n * Breadcrumb constructor method.\n */\n constructor() {\n super();\n\n this._showSeparator = true;\n this._showCollapsedIndicator = false;\n }\n\n /**\n * Get show separator flag.\n * @returns {boolean} showSeparator - The show separator flag\n */\n get showSeparator() {\n return this._showSeparator;\n }\n\n /**\n * Set show separator flag.\n * @param {boolean} value The value to set\n */\n set showSeparator(value) {\n this._showSeparator = value;\n }\n\n /**\n * Set collapsed variant.\n * @param {string} value The value to set\n */\n set collapsedVariant(value) {\n this._collapsedVariant = value;\n }\n\n /**\n * Get collapsed variant.\n * @returns {string} The collapsed variant value in uppercase.\n */\n get collapsedVariant() {\n let variant = this.parentElement?.collapsedVariant || this.parentElement?.variant || this._collapsedVariant || 'button';\n return variant.toUpperCase();\n }\n\n /**\n * Class name for the Breadcrumb element.\n * @type {string}\n */\n className = 'Breadcrumb';\n\n /**\n * Get CSS stylesheet for the Breadcrumb element.\n * @static\n * @returns {object} styles - The CSS styles\n */\n static get cssStyleSheet() {\n return styles;\n }\n\n /**\n * Get observed attributes for the Breadcrumb element.\n * @static\n * @returns {Array<string>} - The observed attributes array for the Breadcrumb element.\n */\n static get observedAttributes() {\n return ['show-collapsed-indicator', 'collapsed', 'last'];\n }\n\n /**\n * Handles attribute changes for the custom element and updates its behavior or appearance accordingly.\n * @param {string} name The name of the attribute that was changed.\n * @param {string|null} oldValue The previous value of the attribute before it was changed. Null if the attribute was not previously set.\n * @param {string|null} newValue The new value of the attribute after it was changed. Null if the attribute was removed.\n */\n attributeChangedCallback(name, oldValue, newValue) {\n super.attributeChangedCallback?.(name, oldValue, newValue);\n\n if (name === 'collapsed') {\n const isCollapsed = WjElementUtils.stringToBoolean(newValue);\n\n // toggle class podľa stavu\n this.classList.toggle('collapsed', isCollapsed && !this.hasAttribute('show-collapsed-indicator'));\n\n } else if (name === 'show-collapsed-indicator') {\n const isOn = WjElementUtils.stringToBoolean(newValue);\n this._showCollapsedIndicator = isOn;\n this.refresh();\n\n } else if (name === 'last') {\n const isLast = WjElementUtils.stringToBoolean(newValue);\n this.active = isLast;\n this.showSeparator = !isLast;\n this.syncAria();\n if (this.native) {\n if (isLast) this.native.setAttribute('aria-current', 'page');\n else this.native.removeAttribute('aria-current');\n }\n this.refresh();\n }\n }\n\n /**\n * Setup attributes for the Breadcrumb element.\n */\n setupAttributes() {\n this.isShadowRoot = 'open';\n this.syncAria();\n }\n\n syncAria() {\n this.setAriaState({ role: 'link' });\n if (this.active) this.setAriaState({ current: 'page' });\n else this.removeAttribute('aria-current');\n }\n\n /**\n * Draw method for the Breadcrumb element.\n * @returns {object} fragment - The document fragment\n */\n draw() {\n let fragment = document.createDocumentFragment();\n\n let native = document.createElement('a');\n native.classList.add('native-breadcrumb');\n native.setAttribute('part', 'native');\n if (this.active) native.setAttribute('aria-current', 'page');\n\n if (this.active) native.classList.add('active');\n\n let slot = document.createElement('slot');\n\n let start = document.createElement('slot');\n start.setAttribute('name', 'start');\n\n let end = document.createElement('slot');\n end.setAttribute('name', 'end');\n\n native.append(start, slot, end);\n\n // APPEND\n fragment.append(native);\n\n if (WjElementUtils.stringToBoolean(this._showCollapsedIndicator)) {\n // pridame button za native element\n fragment.append(this.drawCollapsedIndicator());\n\n // skryjeme native element\n native.classList.add('hidden');\n }\n\n if (this.showSeparator) {\n let separator = document.createElement('span');\n separator.classList.add('separator');\n separator.setAttribute('part', 'separator');\n\n if (WjElementUtils.hasSlot(this, 'separator')) {\n let slotSeparator = document.createElement('slot');\n slotSeparator.setAttribute('name', 'separator');\n\n separator.append(slotSeparator);\n } else {\n separator.innerHTML = `<wje-icon name=${this.separator || 'chevron-right'}></wje-icon>`;\n }\n\n fragment.append(separator);\n }\n\n this.native = native;\n\n return fragment;\n }\n\n /**\n * Renders the collapsed indicator based on the current collapsed variant.\n * If the collapsed variant is 'DROPDOWN', it invokes the collapseDropdown method.\n * Otherwise, it invokes the collapseButton method.\n * @returns {any} The rendered collapsed indicator, either as a dropdown or a button.\n */\n drawCollapsedIndicator() {\n let collapsedIndicator = null;\n\n if (this.collapsedVariant === 'DROPDOWN') {\n collapsedIndicator = this.collapseDropdown();\n } else {\n collapsedIndicator = this.collapseButton();\n }\n\n return collapsedIndicator;\n }\n\n /**\n * Creates and returns a dropdown UI component for collapsed breadcrumbs.\n * This method generates a dropdown element with a button trigger and a menu populated with items corresponding\n * to the collapsed breadcrumbs. The dropdown is configured to handle specific interactions and ensure that\n * events are appropriately managed to avoid propagation issues. Menu items are linked to their corresponding\n * breadcrumbs, enabling the same functionality as clicking on the original breadcrumb.\n * @returns {HTMLElement} A configured dropdown element containing a button as trigger and a menu with breadcrumb items.\n */\n collapseDropdown() {\n let dropdown = document.createElement('wje-dropdown');\n dropdown.setAttribute('placement', 'bottom');\n dropdown.setAttribute('offset', '10');\n\n let button = document.createElement('wje-button');\n button.setAttribute('slot', 'trigger');\n button.setAttribute('fill', 'link');\n button.innerHTML = `<wje-icon name=\"dots\"></wje-icon>`;\n\n let menu = document.createElement('wje-menu');\n menu.setAttribute('variant', 'context');\n\n menu.addEventListener('click', (e) => {\n e.stopPropagation();\n e.stopImmediatePropagation?.();\n });\n\n this.getBreadcrumbs().getBreadcrumbsCollapsed().forEach((b) => {\n let menuItem = document.createElement('wje-menu-item');\n menuItem.innerHTML = b.innerHTML;\n\n menuItem.__breadcrumb = b;\n\n menuItem.addEventListener('wje-menu-item:click', (e) => {\n e.preventDefault?.();\n e.stopPropagation();\n e.stopImmediatePropagation?.();\n\n const breadcrumb = e.currentTarget.__breadcrumb;\n if (!breadcrumb) return;\n\n // Prefer clicking the internal anchor (same behavior as real user click), fallback to host click.\n const native = breadcrumb.native || breadcrumb.context?.querySelector('a.native-breadcrumb');\n if (native && typeof native.click === 'function') {\n native.click();\n } else if (typeof breadcrumb.click === 'function') {\n breadcrumb.click();\n } else {\n breadcrumb.dispatchEvent(\n new MouseEvent('click', {\n bubbles: true,\n composed: true,\n cancelable: true\n })\n );\n }\n });\n\n menu.append(menuItem);\n });\n\n dropdown.append(button, menu);\n\n return dropdown;\n }\n\n /**\n * Creates a button element that expands hidden breadcrumbs when clicked.\n * The button is set with appropriate attributes and event listeners to handle\n * the expanding of hidden breadcrumb elements. Clicking the button will remove\n * the button itself, reveal hidden breadcrumbs, and stop the current event\n * propagation.\n * @returns {HTMLButtonElement} The created button configured to expand breadcrumbs.\n */\n collapseButton() {\n let button = document.createElement('button');\n button.setAttribute('aria-label', 'Show more breadcrumbs');\n button.setAttribute('part', 'collapsed-indicator');\n button.innerHTML = `<wje-icon name=\"dots\"></wje-icon>`;\n\n event.addListener(button, 'click', null, (e) => {\n this.native.classList.remove('hidden');\n button.remove();\n this.getBreadcrumbs().getBreadcrumbsCollapsed().forEach((el) => {\n el.classList.remove('collapsed');\n });\n e.stopPropagation();\n });\n\n return button;\n }\n\n /**\n * Retrieves the breadcrumb trail for the current element by returning its parent element.\n * @returns {Element} The parent element representing the breadcrumb trail.\n */\n getBreadcrumbs() {\n return this.parentElement;\n }\n}\n","import Breadcrumb from './breadcrumb.element.js';\n\n// export * from \"./breadcrumb.element.js\";\nexport default Breadcrumb;\n\nBreadcrumb.define('wje-breadcrumb', Breadcrumb);\n"],"names":[],"mappings":";;;;;;;AAkBe,MAAM,mBAAmB,UAAU;AAAA;AAAA;AAAA;AAAA,EAI9C,cAAc;AACV,UAAK;AA2CT;AAAA;AAAA;AAAA;AAAA,qCAAY;AAzCR,SAAK,iBAAiB;AACtB,SAAK,0BAA0B;AAAA,EACnC;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,IAAI,gBAAgB;AAChB,WAAO,KAAK;AAAA,EAChB;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,IAAI,cAAc,OAAO;AACrB,SAAK,iBAAiB;AAAA,EAC1B;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,IAAI,iBAAiB,OAAO;AACxB,SAAK,oBAAoB;AAAA,EAC7B;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,IAAI,mBAAmB;;AACnB,QAAI,YAAU,UAAK,kBAAL,mBAAoB,uBAAoB,UAAK,kBAAL,mBAAoB,YAAW,KAAK,qBAAqB;AAC/G,WAAO,QAA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,cAAc,QAAQ;AAC5C,WAAO,aAAa,cAAc,uBAAuB;AACzD,WAAO,aAAa,QAAQ,qBAAqB;AACjD,WAAO,YAAY;AAEnB,UAAM,YAAY,QAAQ,SAAS,MAAM,CAAC,MAAM;AAC5C,WAAK,OAAO,UAAU,OAAO,QAAQ;AACrC,aAAO,OAAM;AACb,WAAK,eAAc,EAAG,wBAAuB,EAAG,QAAQ,CAAC,OAAO;AAC5D,WAAG,UAAU,OAAO,WAAW;AAAA,MACnC,CAAC;AACD,QAAE,gBAAe;AAAA,IACrB,CAAC;AAED,WAAO;AAAA,EACX;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,iBAAiB;AACb,WAAO,KAAK;AAAA,EAChB;AACJ;AC7SA,WAAW,OAAO,kBAAkB,UAAU;"}
1
+ {"version":3,"file":"wje-breadcrumb.js","sources":["../packages/wje-breadcrumb/breadcrumb.element.js","../packages/wje-breadcrumb/breadcrumb.js"],"sourcesContent":["import { default as WJElement, event, WjElementUtils } from '../wje-element/element.js';\nimport styles from './styles/styles.css?inline';\n\n/**\n * @summary This class represents a Breadcrumb element, extending the WJElement class. It provides a navigational aid in user interfaces, displaying the current location within a hierarchy.\n * @documentation https://elements.webjet.sk/components/breadcrumb\n * @status stable\n * @augments WJElement\n * @slot - The main content of the breadcrumb.\n * @slot start - Slot for content at the start of the breadcrumb.\n * @slot end - Slot for content at the end of the breadcrumb.\n * @slot separator - Slot for a custom separator between breadcrumb items.\n * @csspart native - The native wrapper of the breadcrumb component.\n * @csspart separator - The separator between breadcrumb items.\n * @cssproperty [--wje-breadcrumb-a=var(--wje-color-contrast-8)] - The color of the breadcrumb text.\n * @cssproperty [--wje-breadcrumb-a-hover=var(--wje-color-contrast-6)] - The color of the breadcrumb separator line.\n * @cssproperty [--wje-breadcrumb-line-height=1.5] - Controls the vertical rhythm of breadcrumb text.\n * @cssproperty [--wje-breadcrumb-native-line-height=var(--wje-breadcrumb-line-height)] - Controls the line height of the native breadcrumb wrapper.\n * @cssproperty [--wje-breadcrumb-native-margin=0] - Sets outer spacing around the native breadcrumb wrapper.\n * @cssproperty [--wje-breadcrumb-native-padding=0.25rem 0.75rem] - Sets inner spacing inside the native breadcrumb wrapper.\n * @cssproperty [--wje-breadcrumb-margin=var(--wje-breadcrumb-native-margin)] - Backwards-compatible alias for native breadcrumb margin.\n * @cssproperty [--wje-breadcrumb-padding=var(--wje-breadcrumb-native-padding)] - Backwards-compatible alias for native breadcrumb padding.\n * @tag wje-breadcrumb\n */\nexport default class Breadcrumb extends WJElement {\n /**\n * Breadcrumb constructor method.\n */\n constructor() {\n super();\n\n this._showSeparator = true;\n this._showCollapsedIndicator = false;\n this.handleNativeClick = (e) => this.handleDisabledNativeClick(e);\n }\n\n /**\n * Sets the breadcrumb link URL.\n * @param {string|null} value Link URL.\n */\n set href(value) {\n if (value === null || value === undefined) this.removeAttribute('href');\n else this.setAttribute('href', value);\n }\n\n /**\n * Gets the breadcrumb link URL.\n * @returns {string|null}\n */\n get href() {\n return this.getAttribute('href');\n }\n\n /**\n * Sets the disabled state.\n * @param {boolean} value Disabled state.\n */\n set disabled(value) {\n if (value === true || value === '' || value === 'true' || value === 1 || value === '1') {\n this.setAttribute('disabled', '');\n } else {\n this.removeAttribute('disabled');\n }\n }\n\n /**\n * Gets the disabled state.\n * @returns {boolean}\n */\n get disabled() {\n return this.hasAttribute('disabled');\n }\n\n /**\n * Get show separator flag.\n * @returns {boolean} showSeparator - The show separator flag\n */\n get showSeparator() {\n return this._showSeparator;\n }\n\n /**\n * Set show separator flag.\n * @param {boolean} value The value to set\n */\n set showSeparator(value) {\n this._showSeparator = value;\n }\n\n /**\n * Set collapsed variant.\n * @param {string} value The value to set\n */\n set collapsedVariant(value) {\n this._collapsedVariant = value;\n }\n\n /**\n * Get collapsed variant.\n * @returns {string} The collapsed variant value in uppercase.\n */\n get collapsedVariant() {\n let variant = this.parentElement?.collapsedVariant || this.parentElement?.variant || this._collapsedVariant || 'button';\n return variant.toUpperCase();\n }\n\n /**\n * Class name for the Breadcrumb element.\n * @type {string}\n */\n className = 'Breadcrumb';\n\n /**\n * Get CSS stylesheet for the Breadcrumb element.\n * @static\n * @returns {object} styles - The CSS styles\n */\n static get cssStyleSheet() {\n return styles;\n }\n\n /**\n * Get observed attributes for the Breadcrumb element.\n * @static\n * @returns {Array<string>} - The observed attributes array for the Breadcrumb element.\n */\n static get observedAttributes() {\n return ['show-collapsed-indicator', 'collapsed', 'last', 'href', 'target', 'rel', 'download', 'disabled', 'title', 'aria-label'];\n }\n\n /**\n * Handles attribute changes for the custom element and updates its behavior or appearance accordingly.\n * @param {string} name The name of the attribute that was changed.\n * @param {string|null} oldValue The previous value of the attribute before it was changed. Null if the attribute was not previously set.\n * @param {string|null} newValue The new value of the attribute after it was changed. Null if the attribute was removed.\n */\n attributeChangedCallback(name, oldValue, newValue) {\n if (oldValue === newValue) return;\n\n if (name === 'collapsed') {\n const isCollapsed = newValue !== null && WjElementUtils.stringToBoolean(newValue);\n\n this.classList.toggle('collapsed', isCollapsed && !this.hasAttribute('show-collapsed-indicator'));\n\n } else if (name === 'show-collapsed-indicator') {\n super.attributeChangedCallback?.(name, oldValue, newValue);\n const isOn = newValue !== null && WjElementUtils.stringToBoolean(newValue);\n this._showCollapsedIndicator = isOn;\n this.classList.toggle('collapsed', this.hasAttribute('collapsed') && !isOn);\n this.refresh();\n\n } else if (name === 'last') {\n super.attributeChangedCallback?.(name, oldValue, newValue);\n const isLast = newValue !== null && WjElementUtils.stringToBoolean(newValue);\n this.active = isLast;\n this.showSeparator = !isLast;\n this.syncAria();\n this.syncNativeAttributes();\n this.refresh();\n } else {\n this.syncAria();\n this.syncNativeAttributes();\n }\n }\n\n /**\n * Setup attributes for the Breadcrumb element.\n */\n setupAttributes() {\n this.isShadowRoot = 'open';\n this.syncAria();\n }\n\n syncAria() {\n this.setAriaState({ role: 'link' });\n if (this.active) this.setAriaState({ current: 'page' });\n else this.removeAttribute('aria-current');\n\n if (this.disabled) this.setAriaState({ disabled: true });\n else this.removeAttribute('aria-disabled');\n }\n\n /**\n * Draw method for the Breadcrumb element.\n * @returns {object} fragment - The document fragment\n */\n draw() {\n let fragment = document.createDocumentFragment();\n\n let native = document.createElement('a');\n native.classList.add('native-breadcrumb');\n native.setAttribute('part', 'native');\n\n this.native = native;\n this.syncNativeAttributes();\n\n let slot = document.createElement('slot');\n\n let start = document.createElement('slot');\n start.setAttribute('name', 'start');\n\n let end = document.createElement('slot');\n end.setAttribute('name', 'end');\n\n native.append(start, slot, end);\n\n // APPEND\n fragment.append(native);\n\n if (WjElementUtils.stringToBoolean(this._showCollapsedIndicator)) {\n // pridame button za native element\n fragment.append(this.drawCollapsedIndicator());\n\n // skryjeme native element\n native.classList.add('hidden');\n }\n\n if (this.shouldRenderSeparator()) {\n let separator = document.createElement('span');\n separator.classList.add('separator');\n separator.setAttribute('part', 'separator');\n\n if (WjElementUtils.hasSlot(this, 'separator')) {\n let slotSeparator = document.createElement('slot');\n slotSeparator.setAttribute('name', 'separator');\n\n separator.append(slotSeparator);\n } else {\n separator.innerHTML = `<wje-icon name=${this.separator || 'chevron-right'}></wje-icon>`;\n }\n\n fragment.append(separator);\n }\n\n return fragment;\n }\n\n /**\n * Returns whether the separator should be visible after this breadcrumb.\n * @returns {boolean}\n */\n shouldRenderSeparator() {\n return this.showSeparator && this.hasVisibleBreadcrumbAfter();\n }\n\n /**\n * Returns whether any later breadcrumb is still visible in the rendered trail.\n * @returns {boolean}\n */\n hasVisibleBreadcrumbAfter() {\n const breadcrumbs = this.parentElement?.getBreadcrumbs?.();\n\n if (!Array.isArray(breadcrumbs)) return true;\n\n const index = breadcrumbs.indexOf(this);\n\n if (index === -1) return true;\n\n return breadcrumbs.slice(index + 1).some((breadcrumb) => this.isBreadcrumbVisibleInTrail(breadcrumb));\n }\n\n /**\n * Returns whether a breadcrumb is visible in the rendered trail.\n * @param {Element} breadcrumb Breadcrumb element to inspect.\n * @returns {boolean}\n */\n isBreadcrumbVisibleInTrail(breadcrumb) {\n return !(breadcrumb?.hasAttribute?.('collapsed') && !breadcrumb?.hasAttribute?.('show-collapsed-indicator'));\n }\n\n /**\n * Synchronizes host attributes to the internal anchor.\n */\n syncNativeAttributes() {\n const native = this.native || this.context?.querySelector('a.native-breadcrumb');\n if (!native) return;\n\n const isDisabled = this.disabled;\n const href = this.href;\n\n if (href !== null && href !== undefined && !isDisabled) {\n native.setAttribute('href', href);\n } else {\n native.removeAttribute('href');\n }\n\n ['target', 'rel', 'download'].forEach((attr) => {\n if (this.hasAttribute(attr) && !isDisabled) {\n native.setAttribute(attr, this.getAttribute(attr));\n } else {\n native.removeAttribute(attr);\n }\n });\n\n ['title', 'aria-label'].forEach((attr) => {\n if (this.hasAttribute(attr)) {\n native.setAttribute(attr, this.getAttribute(attr));\n } else {\n native.removeAttribute(attr);\n }\n });\n\n native.classList.toggle('active', Boolean(this.active));\n native.classList.toggle('disabled', isDisabled);\n\n if (this.active) native.setAttribute('aria-current', 'page');\n else native.removeAttribute('aria-current');\n\n if (isDisabled) {\n native.setAttribute('aria-disabled', 'true');\n native.setAttribute('tabindex', '-1');\n } else {\n native.removeAttribute('aria-disabled');\n native.removeAttribute('tabindex');\n }\n }\n\n /**\n * Sets up native anchor listeners after render.\n */\n afterDraw() {\n this.native?.addEventListener('click', this.handleNativeClick);\n }\n\n /**\n * Removes native anchor listeners before redraw/disconnect.\n */\n beforeDisconnect() {\n this.native?.removeEventListener('click', this.handleNativeClick);\n }\n\n /**\n * Prevents disabled breadcrumbs from navigating or bubbling click handlers.\n * @param {MouseEvent} e Click event.\n */\n handleDisabledNativeClick(e) {\n if (!this.disabled) return;\n\n e.preventDefault();\n e.stopPropagation();\n e.stopImmediatePropagation?.();\n }\n\n /**\n * Renders the collapsed indicator based on the current collapsed variant.\n * If the collapsed variant is 'DROPDOWN', it invokes the collapseDropdown method.\n * Otherwise, it invokes the collapseButton method.\n * @returns {any} The rendered collapsed indicator, either as a dropdown or a button.\n */\n drawCollapsedIndicator() {\n let collapsedIndicator = null;\n\n if (this.collapsedVariant === 'DROPDOWN') {\n collapsedIndicator = this.collapseDropdown();\n } else {\n collapsedIndicator = this.collapseButton();\n }\n\n return collapsedIndicator;\n }\n\n /**\n * Creates and returns a dropdown UI component for collapsed breadcrumbs.\n * This method generates a dropdown element with a button trigger and a menu populated with items corresponding\n * to the collapsed breadcrumbs. The dropdown is configured to handle specific interactions and ensure that\n * events are appropriately managed to avoid propagation issues. Menu items are linked to their corresponding\n * breadcrumbs, enabling the same functionality as clicking on the original breadcrumb.\n * @returns {HTMLElement} A configured dropdown element containing a button as trigger and a menu with breadcrumb items.\n */\n collapseDropdown() {\n const isBreakpointMenuIndicator = this.isBreakpointMenuIndicator();\n\n let dropdown = document.createElement('wje-dropdown');\n dropdown.setAttribute('placement', isBreakpointMenuIndicator ? 'bottom-start' : 'bottom');\n dropdown.setAttribute('offset', '10');\n\n const trigger = this.createCollapsedDropdownTrigger(isBreakpointMenuIndicator);\n\n let menu = document.createElement('wje-menu');\n menu.setAttribute('variant', 'context');\n menu.style.setProperty('--wje-menu-item-justify-content', 'flex-start');\n\n menu.addEventListener('click', (e) => {\n e.stopPropagation();\n e.stopImmediatePropagation?.();\n });\n\n this.getBreadcrumbs().getBreadcrumbsCollapsed().forEach((b) => {\n let menuItem = document.createElement('wje-menu-item');\n this.populateCollapsedMenuItem(menuItem, b);\n\n menuItem.__breadcrumb = b;\n\n menuItem.addEventListener('wje-menu-item:click', (e) => {\n e.preventDefault?.();\n e.stopPropagation();\n e.stopImmediatePropagation?.();\n\n const breadcrumb = e.currentTarget.__breadcrumb;\n if (!breadcrumb) return;\n\n // Prefer clicking the internal anchor (same behavior as real user click), fallback to host click.\n const native = breadcrumb.native || breadcrumb.context?.querySelector('a.native-breadcrumb');\n if (native && typeof native.click === 'function') {\n native.click();\n } else if (typeof breadcrumb.click === 'function') {\n breadcrumb.click();\n } else {\n breadcrumb.dispatchEvent(\n new MouseEvent('click', {\n bubbles: true,\n composed: true,\n cancelable: true\n })\n );\n }\n });\n\n menu.append(menuItem);\n });\n\n dropdown.append(trigger, menu);\n\n return dropdown;\n }\n\n /**\n * Creates the dropdown trigger for collapsed breadcrumbs.\n * @param {boolean} isBreakpointMenuIndicator Whether this trigger controls the full breakpoint menu.\n * @returns {HTMLElement}\n */\n createCollapsedDropdownTrigger(isBreakpointMenuIndicator) {\n if (isBreakpointMenuIndicator) {\n const customTrigger = this.getBreadcrumbs()?.getBreakpointCollapseTrigger?.();\n\n if (customTrigger) {\n const trigger = customTrigger.cloneNode(true);\n trigger.setAttribute('slot', 'trigger');\n\n if (!trigger.hasAttribute('aria-label')) {\n trigger.setAttribute('aria-label', 'Show breadcrumb menu');\n }\n\n return trigger;\n }\n }\n\n let button = document.createElement('wje-button');\n button.setAttribute('slot', 'trigger');\n button.setAttribute('fill', 'link');\n button.setAttribute('aria-label', 'Show more breadcrumbs');\n button.innerHTML = `<wje-icon name=\"${this.getCollapsedDropdownIcon(isBreakpointMenuIndicator)}\"></wje-icon>`;\n\n return button;\n }\n\n /**\n * Resolves the icon used by the default dropdown trigger.\n * @param {boolean} isBreakpointMenuIndicator Whether this trigger controls the full breakpoint menu.\n * @returns {string}\n */\n getCollapsedDropdownIcon(isBreakpointMenuIndicator) {\n if (!isBreakpointMenuIndicator) return 'dots';\n\n return this.getBreadcrumbs()?.breakpointCollapseIcon || 'menu';\n }\n\n /**\n * Copies breadcrumb content into a collapsed menu item.\n * @param {HTMLElement} menuItem Menu item receiving the content.\n * @param {HTMLElement} breadcrumb Source breadcrumb.\n */\n populateCollapsedMenuItem(menuItem, breadcrumb) {\n const nodes = Array.from(breadcrumb.childNodes).map((node) => node.cloneNode(true));\n\n menuItem.replaceChildren(...nodes);\n\n if (menuItem.textContent.trim()) return;\n\n const label = this.getCollapsedMenuItemLabel(breadcrumb);\n\n if (label) {\n menuItem.append(document.createTextNode(label));\n }\n }\n\n /**\n * Resolves a readable label for icon-only collapsed menu items.\n * @param {HTMLElement} breadcrumb Source breadcrumb.\n * @returns {string}\n */\n getCollapsedMenuItemLabel(breadcrumb) {\n const explicitLabel = breadcrumb.getAttribute('aria-label') || breadcrumb.getAttribute('title');\n\n if (explicitLabel?.trim()) return explicitLabel.trim();\n\n const text = breadcrumb.textContent.trim();\n\n if (text) return text;\n\n const iconName = breadcrumb.querySelector('wje-icon[slot=\"start\"]')?.getAttribute('name');\n\n if (iconName === 'home') return 'Home';\n\n const href = breadcrumb.getAttribute('href');\n const path = href?.split(/[?#]/)[0] || '';\n const segment = path.split('/').filter(Boolean).pop();\n\n return segment ? this.humanizeCollapsedMenuItemLabel(segment) : '';\n }\n\n /**\n * Turns a URL segment into a readable menu label.\n * @param {string} value URL segment.\n * @returns {string}\n */\n humanizeCollapsedMenuItemLabel(value) {\n return decodeURIComponent(value)\n .replace(/[-_]+/g, ' ')\n .replace(/\\b\\w/g, (letter) => letter.toUpperCase());\n }\n\n /**\n * Returns whether this collapsed indicator represents the full breakpoint menu.\n * @returns {boolean}\n */\n isBreakpointMenuIndicator() {\n const breadcrumbs = this.parentElement;\n\n return (\n this.hasAttribute('show-collapsed-indicator') &&\n this.hasAttribute('collapsed') &&\n breadcrumbs?.isBreakpointMenuCollapseActive?.()\n );\n }\n\n /**\n * Creates a button element that expands hidden breadcrumbs when clicked.\n * The button is set with appropriate attributes and event listeners to handle\n * the expanding of hidden breadcrumb elements. Clicking the button will remove\n * the button itself, reveal hidden breadcrumbs, and stop the current event\n * propagation.\n * @returns {HTMLButtonElement} The created button configured to expand breadcrumbs.\n */\n collapseButton() {\n let button = document.createElement('button');\n button.setAttribute('aria-label', 'Show more breadcrumbs');\n button.setAttribute('part', 'collapsed-indicator');\n button.innerHTML = `<wje-icon name=\"dots\"></wje-icon>`;\n\n event.addListener(button, 'click', null, (e) => {\n this.native.classList.remove('hidden');\n button.remove();\n this.getBreadcrumbs().getBreadcrumbsCollapsed().forEach((el) => {\n el.classList.remove('collapsed');\n });\n e.stopPropagation();\n });\n\n return button;\n }\n\n /**\n * Retrieves the breadcrumb trail for the current element by returning its parent element.\n * @returns {Element} The parent element representing the breadcrumb trail.\n */\n getBreadcrumbs() {\n return this.parentElement;\n }\n}\n","import Breadcrumb from './breadcrumb.element.js';\nimport '../wje-button/button.js';\nimport '../wje-dropdown/dropdown.js';\nimport '../wje-icon/icon.js';\nimport '../wje-menu/menu.js';\nimport '../wje-menu-item/menu-item.js';\nimport '../wje-popup/popup.js';\nimport '../wje-tooltip/tooltip.js';\n\n// export * from \"./breadcrumb.element.js\";\nexport default Breadcrumb;\n\nBreadcrumb.define('wje-breadcrumb', Breadcrumb);\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAwBe,MAAM,mBAAmB,UAAU;AAAA;AAAA;AAAA;AAAA,EAI9C,cAAc;AACV,UAAK;AAiFT;AAAA;AAAA;AAAA;AAAA,qCAAY;AA/ER,SAAK,iBAAiB;AACtB,SAAK,0BAA0B;AAC/B,SAAK,oBAAoB,CAAC,MAAM,KAAK,0BAA0B,CAAC;AAAA,EACpE;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,IAAI,KAAK,OAAO;AACZ,QAAI,UAAU,QAAQ,UAAU,OAAW,MAAK,gBAAgB,MAAM;AAAA,QACjE,MAAK,aAAa,QAAQ,KAAK;AAAA,EACxC;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,IAAI,OAAO;AACP,WAAO,KAAK,aAAa,MAAM;AAAA,EACnC;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,IAAI,SAAS,OAAO;AAChB,QAAI,UAAU,QAAQ,UAAU,MAAM,UAAU,UAAU,UAAU,KAAK,UAAU,KAAK;AACpF,WAAK,aAAa,YAAY,EAAE;AAAA,IACpC,OAAO;AACH,WAAK,gBAAgB,UAAU;AAAA,IACnC;AAAA,EACJ;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,IAAI,WAAW;AACX,WAAO,KAAK,aAAa,UAAU;AAAA,EACvC;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,IAAI,gBAAgB;AAChB,WAAO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