wj-elements 0.4.8 → 0.5.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.
- package/dist/light.css +2 -0
- package/dist/packages/wje-breadcrumb/breadcrumb.element.d.ts +34 -0
- package/dist/packages/wje-breadcrumbs/breadcrumbs.element.d.ts +104 -0
- package/dist/packages/wje-img/img.element.d.ts +11 -0
- package/dist/packages/wje-select/select.element.d.ts +5 -0
- package/dist/packages/wje-toolbar/toolbar.element.d.ts +2 -0
- package/dist/wje-breadcrumb.js +109 -14
- package/dist/wje-breadcrumb.js.map +1 -1
- package/dist/wje-breadcrumbs.js +291 -0
- package/dist/wje-breadcrumbs.js.map +1 -1
- package/dist/wje-img.js +24 -2
- package/dist/wje-img.js.map +1 -1
- package/dist/wje-input.js +1 -1
- package/dist/wje-option.js +20 -6
- package/dist/wje-option.js.map +1 -1
- package/dist/wje-select.js +18 -3
- package/dist/wje-select.js.map +1 -1
- package/dist/wje-toolbar.js +1 -1
- package/dist/wje-toolbar.js.map +1 -1
- package/package.json +1 -1
package/dist/light.css
CHANGED
|
@@ -671,6 +671,8 @@
|
|
|
671
671
|
--wje-toolbar-min-height: 70px;
|
|
672
672
|
--wje-toolbar-padding-inline: 1.5rem;
|
|
673
673
|
--wje-toolbar-padding-block: 1rem;
|
|
674
|
+
--wje-toolbar-margin-inline: 0;
|
|
675
|
+
--wje-toolbar-margin-block: 0;
|
|
674
676
|
--wje-toolbar-border-color: var(--wje-border-color);
|
|
675
677
|
--wje-toolbar-top: 0;
|
|
676
678
|
--wje-toolbar-shadow: var(--wje-shadow-medium);
|
|
@@ -29,6 +29,27 @@ export default class Breadcrumb extends WJElement {
|
|
|
29
29
|
static get observedAttributes(): Array<string>;
|
|
30
30
|
_showSeparator: boolean;
|
|
31
31
|
_showCollapsedIndicator: boolean;
|
|
32
|
+
handleNativeClick: (e: any) => void;
|
|
33
|
+
/**
|
|
34
|
+
* Sets the breadcrumb link URL.
|
|
35
|
+
* @param {string|null} value Link URL.
|
|
36
|
+
*/
|
|
37
|
+
set href(value: string | null);
|
|
38
|
+
/**
|
|
39
|
+
* Gets the breadcrumb link URL.
|
|
40
|
+
* @returns {string|null}
|
|
41
|
+
*/
|
|
42
|
+
get href(): string | null;
|
|
43
|
+
/**
|
|
44
|
+
* Sets the disabled state.
|
|
45
|
+
* @param {boolean} value Disabled state.
|
|
46
|
+
*/
|
|
47
|
+
set disabled(value: boolean);
|
|
48
|
+
/**
|
|
49
|
+
* Gets the disabled state.
|
|
50
|
+
* @returns {boolean}
|
|
51
|
+
*/
|
|
52
|
+
get disabled(): boolean;
|
|
32
53
|
/**
|
|
33
54
|
* Set show separator flag.
|
|
34
55
|
* @param {boolean} value The value to set
|
|
@@ -65,6 +86,19 @@ export default class Breadcrumb extends WJElement {
|
|
|
65
86
|
*/
|
|
66
87
|
draw(): object;
|
|
67
88
|
native: HTMLAnchorElement;
|
|
89
|
+
/**
|
|
90
|
+
* Synchronizes host attributes to the internal anchor.
|
|
91
|
+
*/
|
|
92
|
+
syncNativeAttributes(): void;
|
|
93
|
+
/**
|
|
94
|
+
* Sets up native anchor listeners after render.
|
|
95
|
+
*/
|
|
96
|
+
afterDraw(): void;
|
|
97
|
+
/**
|
|
98
|
+
* Prevents disabled breadcrumbs from navigating or bubbling click handlers.
|
|
99
|
+
* @param {MouseEvent} e Click event.
|
|
100
|
+
*/
|
|
101
|
+
handleDisabledNativeClick(e: MouseEvent): void;
|
|
68
102
|
/**
|
|
69
103
|
* Renders the collapsed indicator based on the current collapsed variant.
|
|
70
104
|
* If the collapsed variant is 'DROPDOWN', it invokes the collapseDropdown method.
|
|
@@ -6,9 +6,11 @@ import { default as WJElement } from '../wje-element/element.js';
|
|
|
6
6
|
* @augments WJElement
|
|
7
7
|
* @slot - The container for breadcrumb elements.
|
|
8
8
|
* @csspart container - The component's container wrapper.
|
|
9
|
+
* @property {Array<{id: string|number, label: string, href?: string, icon?: string, disabled?: boolean, data?: any}>} items - Data-driven breadcrumb items.
|
|
9
10
|
* @attribute {number} max-items - The maximum number of visible breadcrumbs before collapsing.
|
|
10
11
|
* @attribute {number} items-before-collapse - The number of breadcrumbs to show before the collapsed indicator.
|
|
11
12
|
* @attribute {number} items-after-collapse - The number of breadcrumbs to show after the collapsed indicator.
|
|
13
|
+
* // @fires wje-breadcrumbs:item-click - Dispatched when a data-driven breadcrumb item is clicked.
|
|
12
14
|
* @tag wje-breadcrumbs
|
|
13
15
|
* @example
|
|
14
16
|
* <!-- Example usage -->
|
|
@@ -49,6 +51,20 @@ export default class Breadcrumbs extends WJElement {
|
|
|
49
51
|
*/
|
|
50
52
|
last: boolean;
|
|
51
53
|
_isCollapsedByBreakpoint: boolean;
|
|
54
|
+
_items: any[];
|
|
55
|
+
_itemRecords: any[];
|
|
56
|
+
_hasItemsValue: boolean;
|
|
57
|
+
handleManagedItemClick: (e: any) => void;
|
|
58
|
+
/**
|
|
59
|
+
* Sets data-driven breadcrumb items.
|
|
60
|
+
* @param {Array|string|null|undefined} value Breadcrumb items or a JSON string.
|
|
61
|
+
*/
|
|
62
|
+
set items(value: any[] | string | null | undefined);
|
|
63
|
+
/**
|
|
64
|
+
* Gets data-driven breadcrumb items.
|
|
65
|
+
* @returns {Array}
|
|
66
|
+
*/
|
|
67
|
+
get items(): any[];
|
|
52
68
|
/**
|
|
53
69
|
* Set variant attribute for the Breadcrumbs element.
|
|
54
70
|
* @param value
|
|
@@ -119,6 +135,89 @@ export default class Breadcrumbs extends WJElement {
|
|
|
119
135
|
afterDraw(): void;
|
|
120
136
|
onSlotChange: () => void;
|
|
121
137
|
handleResize: () => void;
|
|
138
|
+
/**
|
|
139
|
+
* Upgrades properties set before the custom element definition was loaded.
|
|
140
|
+
* @param {string} property Property name.
|
|
141
|
+
*/
|
|
142
|
+
upgradeProperty(property: string): void;
|
|
143
|
+
/**
|
|
144
|
+
* Normalizes incoming item data for keyed DOM diffing.
|
|
145
|
+
* @param {Array|string|null|undefined} value Breadcrumb item data.
|
|
146
|
+
* @returns {Array<object>}
|
|
147
|
+
*/
|
|
148
|
+
normalizeItems(value: any[] | string | null | undefined): Array<object>;
|
|
149
|
+
/**
|
|
150
|
+
* Normalizes a single item while preserving the original object for events.
|
|
151
|
+
* @param {object|string|number} item Source value for a breadcrumb entry.
|
|
152
|
+
* @param {number} index Position of the value in the current items array.
|
|
153
|
+
* @param {Set<string>} usedKeys Keys that have already been assigned during this update.
|
|
154
|
+
* @returns {object}
|
|
155
|
+
*/
|
|
156
|
+
normalizeItem(item: object | string | number, index: number, usedKeys: Set<string>): object;
|
|
157
|
+
/**
|
|
158
|
+
* Resolves a stable key for an item.
|
|
159
|
+
* @param {object} item Normalized source object used to resolve the key.
|
|
160
|
+
* @param {number} index Fallback position used when the item has no id.
|
|
161
|
+
* @param {Set<string>} usedKeys Keys that have already been assigned during this update.
|
|
162
|
+
* @returns {string}
|
|
163
|
+
*/
|
|
164
|
+
getItemKey(item: object, index: number, usedKeys: Set<string>): string;
|
|
165
|
+
/**
|
|
166
|
+
* Incrementally synchronizes data-driven items into light DOM breadcrumbs.
|
|
167
|
+
* @param {Array<object>} records Normalized records for the next breadcrumb trail.
|
|
168
|
+
*/
|
|
169
|
+
syncItems(records: Array<object>): void;
|
|
170
|
+
/**
|
|
171
|
+
* Creates a managed breadcrumb element.
|
|
172
|
+
* @param {object} record Normalized data used to create the breadcrumb.
|
|
173
|
+
* @param {number} index Position assigned to the created breadcrumb.
|
|
174
|
+
* @returns {HTMLElement}
|
|
175
|
+
*/
|
|
176
|
+
createItemElement(record: object, index: number): HTMLElement;
|
|
177
|
+
/**
|
|
178
|
+
* Updates a managed breadcrumb element only where values changed.
|
|
179
|
+
* @param {HTMLElement} breadcrumb Existing managed element to update.
|
|
180
|
+
* @param {object} record Normalized data used for the next rendered state.
|
|
181
|
+
* @param {number} index Position assigned to the managed breadcrumb.
|
|
182
|
+
*/
|
|
183
|
+
updateItemElement(breadcrumb: HTMLElement, record: object, index: number): void;
|
|
184
|
+
/**
|
|
185
|
+
* Synchronizes an attribute when its value changed.
|
|
186
|
+
* @param {HTMLElement} element Element receiving the synchronized attribute.
|
|
187
|
+
* @param {string} name Attribute to add, update, or remove.
|
|
188
|
+
* @param {string|null|undefined} value Next serialized value for the attribute.
|
|
189
|
+
*/
|
|
190
|
+
syncItemAttribute(element: HTMLElement, name: string, value: string | null | undefined): void;
|
|
191
|
+
/**
|
|
192
|
+
* Synchronizes a boolean attribute.
|
|
193
|
+
* @param {HTMLElement} element Element receiving the boolean attribute.
|
|
194
|
+
* @param {string} name Boolean attribute to toggle.
|
|
195
|
+
* @param {boolean} isEnabled Whether the attribute should be present.
|
|
196
|
+
*/
|
|
197
|
+
syncBooleanItemAttribute(element: HTMLElement, name: string, isEnabled: boolean): void;
|
|
198
|
+
/**
|
|
199
|
+
* Synchronizes slotted icon and text nodes for a managed breadcrumb.
|
|
200
|
+
* @param {HTMLElement} breadcrumb Breadcrumb element.
|
|
201
|
+
* @param {object} record Normalized item record.
|
|
202
|
+
*/
|
|
203
|
+
syncItemContent(breadcrumb: HTMLElement, record: object): void;
|
|
204
|
+
/**
|
|
205
|
+
* Returns a small signature for structural changes that need item replacement.
|
|
206
|
+
* @param {object} record Normalized item record.
|
|
207
|
+
* @returns {string}
|
|
208
|
+
*/
|
|
209
|
+
getItemStructureSignature(record: object): string;
|
|
210
|
+
/**
|
|
211
|
+
* Dispatches the data-driven item click event.
|
|
212
|
+
* @param {MouseEvent} e Original click event.
|
|
213
|
+
*/
|
|
214
|
+
dispatchManagedItemClick(e: MouseEvent): void;
|
|
215
|
+
/**
|
|
216
|
+
* Finds the managed breadcrumb that originated an event.
|
|
217
|
+
* @param {Event} e Event whose composed path should be inspected.
|
|
218
|
+
* @returns {HTMLElement|null}
|
|
219
|
+
*/
|
|
220
|
+
getManagedBreadcrumbFromEvent(e: Event): HTMLElement | null;
|
|
122
221
|
/**
|
|
123
222
|
* Reacts to viewport resize only when the breakpoint mode actually changes.
|
|
124
223
|
* @returns {void}
|
|
@@ -156,6 +255,11 @@ export default class Breadcrumbs extends WJElement {
|
|
|
156
255
|
* @returns {Array<Element>} An array of breadcrumb elements (`wje-breadcrumb`) found within the instance. Returns an empty array if no breadcrumbs are found.
|
|
157
256
|
*/
|
|
158
257
|
getBreadcrumbs(): Array<Element>;
|
|
258
|
+
/**
|
|
259
|
+
* Retrieves breadcrumbs managed by the items property.
|
|
260
|
+
* @returns {Array<Element>}
|
|
261
|
+
*/
|
|
262
|
+
getManagedBreadcrumbs(): Array<Element>;
|
|
159
263
|
/**
|
|
160
264
|
* Retrieves all breadcrumb elements that have the 'collapsed' attribute.
|
|
161
265
|
* @returns {Array<Element>} An array of DOM elements representing breadcrumbs with the 'collapsed' attribute.
|
|
@@ -10,6 +10,7 @@ import { default as WJElement } from '../wje-element/element.js';
|
|
|
10
10
|
* @property {string} alt - The alternative text for the image.
|
|
11
11
|
* @property {string} fallout - The action to perform when an error occurs while loading the image. The value can be a function or a predefined action like 'delete'.
|
|
12
12
|
* @property {string} loader - The URL of the image loader to display while the image is loading.
|
|
13
|
+
* @property {boolean} noLazy - Disables lazy loading and renders the image source immediately.
|
|
13
14
|
* @tag wje-img
|
|
14
15
|
*/
|
|
15
16
|
export default class Img extends WJElement {
|
|
@@ -71,6 +72,16 @@ export default class Img extends WJElement {
|
|
|
71
72
|
* @returns {string|null} The value of the 'loader' attribute if set, otherwise null.
|
|
72
73
|
*/
|
|
73
74
|
get loader(): string | null;
|
|
75
|
+
/**
|
|
76
|
+
* Enables or disables lazy loading for the image.
|
|
77
|
+
* @param {boolean} value True to disable lazy loading, false to restore the default lazy behavior.
|
|
78
|
+
*/
|
|
79
|
+
set noLazy(value: boolean);
|
|
80
|
+
/**
|
|
81
|
+
* Checks whether lazy loading is disabled.
|
|
82
|
+
* @returns {boolean} True when the `no-lazy` attribute is present.
|
|
83
|
+
*/
|
|
84
|
+
get noLazy(): boolean;
|
|
74
85
|
attributeChangedCallback(name: any, oldValue: any, newValue: any): void;
|
|
75
86
|
/**
|
|
76
87
|
* Creates and assembles a lazy-loaded image element within a document fragment.
|
|
@@ -68,6 +68,11 @@ export class Select extends FormAssociatedElement {
|
|
|
68
68
|
* @description A reference to the input element, initially null.
|
|
69
69
|
*/
|
|
70
70
|
input: HTMLElement | null;
|
|
71
|
+
/**
|
|
72
|
+
* @type {HTMLElement|null}
|
|
73
|
+
* @description A reference to the visible selected text element, initially null.
|
|
74
|
+
*/
|
|
75
|
+
displayText: HTMLElement | null;
|
|
71
76
|
/**
|
|
72
77
|
* @type {HTMLElement|null}
|
|
73
78
|
* @description A reference to the chips element, initially null.
|
|
@@ -14,6 +14,8 @@ import { default as WJElement } from '../wje-element/element.js';
|
|
|
14
14
|
* @cssproperty [--wje-toolbar-padding-top=1rem] - Specifies the padding at the top of the toolbar. Accepts any valid CSS length unit.
|
|
15
15
|
* @cssproperty [--wje-toolbar-padding-bottom=1rem] - Specifies the padding at the bottom of the toolbar. Helps create spacing between the content and the bottom edge.
|
|
16
16
|
* @cssproperty [--wje-toolbar-padding-inline=1.5rem] - Defines the horizontal padding (left and right) of the toolbar. Creates consistent spacing on both sides.
|
|
17
|
+
* @cssproperty [--wje-toolbar-margin-block=0] - Defines the vertical margin outside the toolbar. Accepts any valid CSS length value.
|
|
18
|
+
* @cssproperty [--wje-toolbar-margin-inline=0] - Defines the horizontal margin outside the toolbar. Accepts any valid CSS length value.
|
|
17
19
|
* @cssproperty [--wje-toolbar-border-color=var(--wje-border-color)] - Sets the color of the toolbar's border. Accepts any valid CSS color value.
|
|
18
20
|
* @cssproperty [--wje-toolbar-top=0] - Specifies the vertical position of the toolbar relative to its container. Useful for fixed or sticky toolbars.
|
|
19
21
|
* @tag wje-toolbar
|
package/dist/wje-breadcrumb.js
CHANGED
|
@@ -4,7 +4,7 @@ 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
|
+
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 &.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
8
|
class Breadcrumb extends WJElement {
|
|
9
9
|
/**
|
|
10
10
|
* Breadcrumb constructor method.
|
|
@@ -18,6 +18,40 @@ class Breadcrumb extends WJElement {
|
|
|
18
18
|
__publicField(this, "className", "Breadcrumb");
|
|
19
19
|
this._showSeparator = true;
|
|
20
20
|
this._showCollapsedIndicator = false;
|
|
21
|
+
this.handleNativeClick = (e) => this.handleDisabledNativeClick(e);
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Sets the breadcrumb link URL.
|
|
25
|
+
* @param {string|null} value Link URL.
|
|
26
|
+
*/
|
|
27
|
+
set href(value) {
|
|
28
|
+
if (value === null || value === void 0) this.removeAttribute("href");
|
|
29
|
+
else this.setAttribute("href", value);
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Gets the breadcrumb link URL.
|
|
33
|
+
* @returns {string|null}
|
|
34
|
+
*/
|
|
35
|
+
get href() {
|
|
36
|
+
return this.getAttribute("href");
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Sets the disabled state.
|
|
40
|
+
* @param {boolean} value Disabled state.
|
|
41
|
+
*/
|
|
42
|
+
set disabled(value) {
|
|
43
|
+
if (value === true || value === "" || value === "true" || value === 1 || value === "1") {
|
|
44
|
+
this.setAttribute("disabled", "");
|
|
45
|
+
} else {
|
|
46
|
+
this.removeAttribute("disabled");
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Gets the disabled state.
|
|
51
|
+
* @returns {boolean}
|
|
52
|
+
*/
|
|
53
|
+
get disabled() {
|
|
54
|
+
return this.hasAttribute("disabled");
|
|
21
55
|
}
|
|
22
56
|
/**
|
|
23
57
|
* Get show separator flag.
|
|
@@ -63,7 +97,7 @@ class Breadcrumb extends WJElement {
|
|
|
63
97
|
* @returns {Array<string>} - The observed attributes array for the Breadcrumb element.
|
|
64
98
|
*/
|
|
65
99
|
static get observedAttributes() {
|
|
66
|
-
return ["show-collapsed-indicator", "collapsed", "last"];
|
|
100
|
+
return ["show-collapsed-indicator", "collapsed", "last", "href", "target", "rel", "download", "disabled"];
|
|
67
101
|
}
|
|
68
102
|
/**
|
|
69
103
|
* Handles attribute changes for the custom element and updates its behavior or appearance accordingly.
|
|
@@ -72,25 +106,27 @@ class Breadcrumb extends WJElement {
|
|
|
72
106
|
* @param {string|null} newValue The new value of the attribute after it was changed. Null if the attribute was removed.
|
|
73
107
|
*/
|
|
74
108
|
attributeChangedCallback(name, oldValue, newValue) {
|
|
75
|
-
var _a;
|
|
76
|
-
|
|
109
|
+
var _a, _b;
|
|
110
|
+
if (oldValue === newValue) return;
|
|
77
111
|
if (name === "collapsed") {
|
|
78
|
-
const isCollapsed = WjElementUtils.stringToBoolean(newValue);
|
|
112
|
+
const isCollapsed = newValue !== null && WjElementUtils.stringToBoolean(newValue);
|
|
79
113
|
this.classList.toggle("collapsed", isCollapsed && !this.hasAttribute("show-collapsed-indicator"));
|
|
80
114
|
} else if (name === "show-collapsed-indicator") {
|
|
81
|
-
|
|
115
|
+
(_a = super.attributeChangedCallback) == null ? void 0 : _a.call(this, name, oldValue, newValue);
|
|
116
|
+
const isOn = newValue !== null && WjElementUtils.stringToBoolean(newValue);
|
|
82
117
|
this._showCollapsedIndicator = isOn;
|
|
83
118
|
this.refresh();
|
|
84
119
|
} else if (name === "last") {
|
|
85
|
-
|
|
120
|
+
(_b = super.attributeChangedCallback) == null ? void 0 : _b.call(this, name, oldValue, newValue);
|
|
121
|
+
const isLast = newValue !== null && WjElementUtils.stringToBoolean(newValue);
|
|
86
122
|
this.active = isLast;
|
|
87
123
|
this.showSeparator = !isLast;
|
|
88
124
|
this.syncAria();
|
|
89
|
-
|
|
90
|
-
if (isLast) this.native.setAttribute("aria-current", "page");
|
|
91
|
-
else this.native.removeAttribute("aria-current");
|
|
92
|
-
}
|
|
125
|
+
this.syncNativeAttributes();
|
|
93
126
|
this.refresh();
|
|
127
|
+
} else {
|
|
128
|
+
this.syncAria();
|
|
129
|
+
this.syncNativeAttributes();
|
|
94
130
|
}
|
|
95
131
|
}
|
|
96
132
|
/**
|
|
@@ -104,6 +140,8 @@ class Breadcrumb extends WJElement {
|
|
|
104
140
|
this.setAriaState({ role: "link" });
|
|
105
141
|
if (this.active) this.setAriaState({ current: "page" });
|
|
106
142
|
else this.removeAttribute("aria-current");
|
|
143
|
+
if (this.disabled) this.setAriaState({ disabled: true });
|
|
144
|
+
else this.removeAttribute("aria-disabled");
|
|
107
145
|
}
|
|
108
146
|
/**
|
|
109
147
|
* Draw method for the Breadcrumb element.
|
|
@@ -114,8 +152,8 @@ class Breadcrumb extends WJElement {
|
|
|
114
152
|
let native = document.createElement("a");
|
|
115
153
|
native.classList.add("native-breadcrumb");
|
|
116
154
|
native.setAttribute("part", "native");
|
|
117
|
-
|
|
118
|
-
|
|
155
|
+
this.native = native;
|
|
156
|
+
this.syncNativeAttributes();
|
|
119
157
|
let slot = document.createElement("slot");
|
|
120
158
|
let start = document.createElement("slot");
|
|
121
159
|
start.setAttribute("name", "start");
|
|
@@ -140,9 +178,66 @@ class Breadcrumb extends WJElement {
|
|
|
140
178
|
}
|
|
141
179
|
fragment.append(separator);
|
|
142
180
|
}
|
|
143
|
-
this.native = native;
|
|
144
181
|
return fragment;
|
|
145
182
|
}
|
|
183
|
+
/**
|
|
184
|
+
* Synchronizes host attributes to the internal anchor.
|
|
185
|
+
*/
|
|
186
|
+
syncNativeAttributes() {
|
|
187
|
+
var _a;
|
|
188
|
+
const native = this.native || ((_a = this.context) == null ? void 0 : _a.querySelector("a.native-breadcrumb"));
|
|
189
|
+
if (!native) return;
|
|
190
|
+
const isDisabled = this.disabled;
|
|
191
|
+
const href = this.href;
|
|
192
|
+
if (href !== null && href !== void 0 && !isDisabled) {
|
|
193
|
+
native.setAttribute("href", href);
|
|
194
|
+
} else {
|
|
195
|
+
native.removeAttribute("href");
|
|
196
|
+
}
|
|
197
|
+
["target", "rel", "download"].forEach((attr) => {
|
|
198
|
+
if (this.hasAttribute(attr) && !isDisabled) {
|
|
199
|
+
native.setAttribute(attr, this.getAttribute(attr));
|
|
200
|
+
} else {
|
|
201
|
+
native.removeAttribute(attr);
|
|
202
|
+
}
|
|
203
|
+
});
|
|
204
|
+
native.classList.toggle("active", Boolean(this.active));
|
|
205
|
+
native.classList.toggle("disabled", isDisabled);
|
|
206
|
+
if (this.active) native.setAttribute("aria-current", "page");
|
|
207
|
+
else native.removeAttribute("aria-current");
|
|
208
|
+
if (isDisabled) {
|
|
209
|
+
native.setAttribute("aria-disabled", "true");
|
|
210
|
+
native.setAttribute("tabindex", "-1");
|
|
211
|
+
} else {
|
|
212
|
+
native.removeAttribute("aria-disabled");
|
|
213
|
+
native.removeAttribute("tabindex");
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Sets up native anchor listeners after render.
|
|
218
|
+
*/
|
|
219
|
+
afterDraw() {
|
|
220
|
+
var _a;
|
|
221
|
+
(_a = this.native) == null ? void 0 : _a.addEventListener("click", this.handleNativeClick);
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* Removes native anchor listeners before redraw/disconnect.
|
|
225
|
+
*/
|
|
226
|
+
beforeDisconnect() {
|
|
227
|
+
var _a;
|
|
228
|
+
(_a = this.native) == null ? void 0 : _a.removeEventListener("click", this.handleNativeClick);
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* Prevents disabled breadcrumbs from navigating or bubbling click handlers.
|
|
232
|
+
* @param {MouseEvent} e Click event.
|
|
233
|
+
*/
|
|
234
|
+
handleDisabledNativeClick(e) {
|
|
235
|
+
var _a;
|
|
236
|
+
if (!this.disabled) return;
|
|
237
|
+
e.preventDefault();
|
|
238
|
+
e.stopPropagation();
|
|
239
|
+
(_a = e.stopImmediatePropagation) == null ? void 0 : _a.call(e);
|
|
240
|
+
}
|
|
146
241
|
/**
|
|
147
242
|
* Renders the collapsed indicator based on the current collapsed variant.
|
|
148
243
|
* If the collapsed variant is 'DROPDOWN', it invokes the collapseDropdown method.
|
|
@@ -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,QAAQ,YAAW;AAAA,EAC9B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAaA,WAAW,gBAAgB;AACvB,WAAO;AAAA,EACX;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,WAAW,qBAAqB;AAC5B,WAAO,CAAC,4BAA4B,aAAa,MAAM;AAAA,EAC3D;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,yBAAyB,MAAM,UAAU,UAAU;;AAC/C,gBAAM,6BAAN,8BAAiC,MAAM,UAAU;AAEjD,QAAI,SAAS,aAAa;AACt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;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 * @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'];\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.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.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 return fragment;\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 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 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;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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