wj-elements 0.5.1 → 0.6.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/packages/wje-breadcrumb/breadcrumb.element.d.ts +145 -1
- package/dist/packages/wje-breadcrumbs/breadcrumbs.element.d.ts +15 -1
- package/dist/packages/wje-dialog/dialog.element.d.ts +1 -0
- package/dist/packages/wje-orgchart/orgchart.element.d.ts +12 -0
- package/dist/packages/wje-orgchart-item/orgchart-item.element.d.ts +16 -0
- package/dist/packages/wje-toolbar-action/toolbar-action.element.d.ts +6 -0
- package/dist/wje-breadcrumb.js +336 -37
- package/dist/wje-breadcrumb.js.map +1 -1
- package/dist/wje-breadcrumbs.js +41 -3
- package/dist/wje-breadcrumbs.js.map +1 -1
- package/dist/wje-dialog.js +11 -4
- package/dist/wje-dialog.js.map +1 -1
- package/dist/wje-orgchart-item.js +24 -3
- package/dist/wje-orgchart-item.js.map +1 -1
- package/dist/wje-orgchart.js +15 -1
- package/dist/wje-orgchart.js.map +1 -1
- package/dist/wje-relative-time.js +1 -1
- package/dist/wje-relative-time.js.map +1 -1
- package/dist/wje-toolbar-action.js +22 -1
- package/dist/wje-toolbar-action.js.map +1 -1
- package/package.json +1 -1
|
@@ -77,6 +77,11 @@ export default class Breadcrumb extends WJElement {
|
|
|
77
77
|
*/
|
|
78
78
|
get collapsedVariant(): string;
|
|
79
79
|
_collapsedVariant: string;
|
|
80
|
+
/**
|
|
81
|
+
* Get collapsed variant token.
|
|
82
|
+
* @returns {string}
|
|
83
|
+
*/
|
|
84
|
+
get collapsedVariantName(): string;
|
|
80
85
|
/**
|
|
81
86
|
* Handles attribute changes for the custom element and updates its behavior or appearance accordingly.
|
|
82
87
|
* @param {string} name The name of the attribute that was changed.
|
|
@@ -124,10 +129,15 @@ export default class Breadcrumb extends WJElement {
|
|
|
124
129
|
/**
|
|
125
130
|
* Renders the collapsed indicator based on the current collapsed variant.
|
|
126
131
|
* If the collapsed variant is 'DROPDOWN', it invokes the collapseDropdown method.
|
|
127
|
-
*
|
|
132
|
+
* Mobile breakpoint variants render compact breadcrumb summaries, otherwise the default button is used.
|
|
128
133
|
* @returns {any} The rendered collapsed indicator, either as a dropdown or a button.
|
|
129
134
|
*/
|
|
130
135
|
drawCollapsedIndicator(): any;
|
|
136
|
+
/**
|
|
137
|
+
* Returns whether the current collapsed variant is a compact mobile layout.
|
|
138
|
+
* @returns {boolean}
|
|
139
|
+
*/
|
|
140
|
+
isMobileCollapsedVariant(): boolean;
|
|
131
141
|
/**
|
|
132
142
|
* Creates and returns a dropdown UI component for collapsed breadcrumbs.
|
|
133
143
|
* This method generates a dropdown element with a button trigger and a menu populated with items corresponding
|
|
@@ -137,6 +147,134 @@ export default class Breadcrumb extends WJElement {
|
|
|
137
147
|
* @returns {HTMLElement} A configured dropdown element containing a button as trigger and a menu with breadcrumb items.
|
|
138
148
|
*/
|
|
139
149
|
collapseDropdown(): HTMLElement;
|
|
150
|
+
/**
|
|
151
|
+
* Creates a dropdown containing breadcrumb menu items.
|
|
152
|
+
* @param {object} options Configuration for the dropdown shell.
|
|
153
|
+
* @param {Array<HTMLElement>} options.breadcrumbs Breadcrumb elements to mirror in the menu.
|
|
154
|
+
* @param {HTMLElement} options.trigger Element assigned to the dropdown trigger slot.
|
|
155
|
+
* @param {string} options.placement Floating UI placement token for the popup.
|
|
156
|
+
* @returns {HTMLElement}
|
|
157
|
+
*/
|
|
158
|
+
createBreadcrumbDropdown({ breadcrumbs, trigger, placement }: {
|
|
159
|
+
breadcrumbs: Array<HTMLElement>;
|
|
160
|
+
trigger: HTMLElement;
|
|
161
|
+
placement: string;
|
|
162
|
+
}): HTMLElement;
|
|
163
|
+
/**
|
|
164
|
+
* Creates the menu used by collapsed dropdown variants.
|
|
165
|
+
* @param {Array<HTMLElement>} breadcrumbs Breadcrumb items represented by menu items.
|
|
166
|
+
* @returns {HTMLElement}
|
|
167
|
+
*/
|
|
168
|
+
createCollapsedBreadcrumbMenu(breadcrumbs: Array<HTMLElement>): HTMLElement;
|
|
169
|
+
/**
|
|
170
|
+
* Returns breadcrumbs that should be exposed in a collapsed menu.
|
|
171
|
+
* @param {boolean} isBreakpointMenuIndicator Whether this trigger controls the full breakpoint menu.
|
|
172
|
+
* @returns {Array<HTMLElement>}
|
|
173
|
+
*/
|
|
174
|
+
getCollapsedMenuBreadcrumbs(isBreakpointMenuIndicator: boolean): Array<HTMLElement>;
|
|
175
|
+
/**
|
|
176
|
+
* Renders one of the compact mobile breakpoint variants.
|
|
177
|
+
* @param {string} variant Normalized uppercase variant token.
|
|
178
|
+
* @returns {HTMLElement}
|
|
179
|
+
*/
|
|
180
|
+
collapseMobileVariant(variant: string): HTMLElement;
|
|
181
|
+
/**
|
|
182
|
+
* Renders only the current breadcrumb title.
|
|
183
|
+
* @returns {HTMLElement}
|
|
184
|
+
*/
|
|
185
|
+
collapseMobileText(): HTMLElement;
|
|
186
|
+
/**
|
|
187
|
+
* Renders a parent back action above the current title.
|
|
188
|
+
* @returns {HTMLElement}
|
|
189
|
+
*/
|
|
190
|
+
collapseMobileBack(): HTMLElement;
|
|
191
|
+
/**
|
|
192
|
+
* Renders parent context above the current title.
|
|
193
|
+
* @returns {HTMLElement}
|
|
194
|
+
*/
|
|
195
|
+
collapseMobileParentTitle(): HTMLElement;
|
|
196
|
+
/**
|
|
197
|
+
* Renders a menu trigger with the current title.
|
|
198
|
+
* @returns {HTMLElement}
|
|
199
|
+
*/
|
|
200
|
+
collapseMobileMenuTitle(): HTMLElement;
|
|
201
|
+
/**
|
|
202
|
+
* Renders the future sheet variant using the dropdown fallback for now.
|
|
203
|
+
* @returns {HTMLElement}
|
|
204
|
+
*/
|
|
205
|
+
collapseMobileSheet(): HTMLElement;
|
|
206
|
+
/**
|
|
207
|
+
* Creates a dropdown fallback for mobile menu-like variants.
|
|
208
|
+
* @param {HTMLElement} trigger Element that opens the fallback dropdown.
|
|
209
|
+
* @returns {HTMLElement}
|
|
210
|
+
*/
|
|
211
|
+
createMobileDropdown(trigger: HTMLElement): HTMLElement;
|
|
212
|
+
/**
|
|
213
|
+
* Creates a compact mobile dropdown trigger.
|
|
214
|
+
* @param {object} options Visual settings for the compact trigger.
|
|
215
|
+
* @param {string} options.icon Icon shown next to the title.
|
|
216
|
+
* @param {string} options.iconPosition Whether the icon renders at the start or end.
|
|
217
|
+
* @param {string} options.label Current breadcrumb label shown beside the icon.
|
|
218
|
+
* @param {string} options.ariaLabel Accessible name for the dropdown trigger.
|
|
219
|
+
* @param {string} options.className Variant-specific class applied to the trigger.
|
|
220
|
+
* @returns {HTMLElement}
|
|
221
|
+
*/
|
|
222
|
+
createMobileDropdownTrigger({ icon, iconPosition, label, ariaLabel, className }: {
|
|
223
|
+
icon: string;
|
|
224
|
+
iconPosition: string;
|
|
225
|
+
label: string;
|
|
226
|
+
ariaLabel: string;
|
|
227
|
+
className: string;
|
|
228
|
+
}): HTMLElement;
|
|
229
|
+
/**
|
|
230
|
+
* Creates a wrapper for compact mobile breadcrumb variants.
|
|
231
|
+
* @param {string} className Variant class.
|
|
232
|
+
* @returns {HTMLElement}
|
|
233
|
+
*/
|
|
234
|
+
createMobileContainer(className: string): HTMLElement;
|
|
235
|
+
/**
|
|
236
|
+
* Creates a text or button control for a breadcrumb.
|
|
237
|
+
* @param {HTMLElement|null} breadcrumb Source breadcrumb.
|
|
238
|
+
* @param {string} className Class applied to the created control.
|
|
239
|
+
* @param {object} options Behavior and accessibility settings for the control.
|
|
240
|
+
* @param {boolean} options.actionable Whether clicks should forward to the source breadcrumb.
|
|
241
|
+
* @param {boolean} options.ariaCurrent Whether the control marks the current page.
|
|
242
|
+
* @param {string} options.ariaLabel Accessible name for action controls.
|
|
243
|
+
* @param {string} options.icon Optional icon shown before the label.
|
|
244
|
+
* @returns {HTMLElement}
|
|
245
|
+
*/
|
|
246
|
+
createMobileBreadcrumbControl(breadcrumb: HTMLElement | null, className: string, { actionable, ariaCurrent, ariaLabel, icon }?: {
|
|
247
|
+
actionable: boolean;
|
|
248
|
+
ariaCurrent: boolean;
|
|
249
|
+
ariaLabel: string;
|
|
250
|
+
icon: string;
|
|
251
|
+
}): HTMLElement;
|
|
252
|
+
/**
|
|
253
|
+
* Returns the full trail of sibling breadcrumbs.
|
|
254
|
+
* @returns {Array<HTMLElement>}
|
|
255
|
+
*/
|
|
256
|
+
getTrailBreadcrumbs(): Array<HTMLElement>;
|
|
257
|
+
/**
|
|
258
|
+
* Returns the current breadcrumb item.
|
|
259
|
+
* @returns {HTMLElement|null}
|
|
260
|
+
*/
|
|
261
|
+
getCurrentBreadcrumb(): HTMLElement | null;
|
|
262
|
+
/**
|
|
263
|
+
* Returns the parent breadcrumb item.
|
|
264
|
+
* @returns {HTMLElement|null}
|
|
265
|
+
*/
|
|
266
|
+
getParentBreadcrumb(): HTMLElement | null;
|
|
267
|
+
/**
|
|
268
|
+
* Returns whether a breadcrumb has a known action to forward.
|
|
269
|
+
* @param {HTMLElement|null} breadcrumb Breadcrumb to inspect.
|
|
270
|
+
* @returns {boolean}
|
|
271
|
+
*/
|
|
272
|
+
isBreadcrumbActionable(breadcrumb: HTMLElement | null): boolean;
|
|
273
|
+
/**
|
|
274
|
+
* Forwards a compact control or menu item click to the original breadcrumb.
|
|
275
|
+
* @param {HTMLElement|null} breadcrumb Source breadcrumb.
|
|
276
|
+
*/
|
|
277
|
+
forwardBreadcrumbClick(breadcrumb: HTMLElement | null): void;
|
|
140
278
|
/**
|
|
141
279
|
* Creates the dropdown trigger for collapsed breadcrumbs.
|
|
142
280
|
* @param {boolean} isBreakpointMenuIndicator Whether this trigger controls the full breakpoint menu.
|
|
@@ -155,6 +293,12 @@ export default class Breadcrumb extends WJElement {
|
|
|
155
293
|
* @param {HTMLElement} breadcrumb Source breadcrumb.
|
|
156
294
|
*/
|
|
157
295
|
populateCollapsedMenuItem(menuItem: HTMLElement, breadcrumb: HTMLElement): void;
|
|
296
|
+
/**
|
|
297
|
+
* Resolves a readable label for a breadcrumb item.
|
|
298
|
+
* @param {HTMLElement|null} breadcrumb Source breadcrumb.
|
|
299
|
+
* @returns {string}
|
|
300
|
+
*/
|
|
301
|
+
getBreadcrumbLabel(breadcrumb: HTMLElement | null): string;
|
|
158
302
|
/**
|
|
159
303
|
* Resolves a readable label for icon-only collapsed menu items.
|
|
160
304
|
* @param {HTMLElement} breadcrumb Source breadcrumb.
|
|
@@ -11,7 +11,7 @@ import { default as WJElement } from '../wje-element/element.js';
|
|
|
11
11
|
* @attribute {number} max-items - The maximum number of visible breadcrumbs before collapsing.
|
|
12
12
|
* @attribute {number} items-before-collapse - The number of breadcrumbs to show before the collapsed indicator.
|
|
13
13
|
* @attribute {number} items-after-collapse - The number of breadcrumbs to show after the collapsed indicator.
|
|
14
|
-
* @attribute {string} collapsed-variant - The UI used for collapsed breadcrumbs. Use "dropdown" to render a menu.
|
|
14
|
+
* @attribute {string} collapsed-variant - The UI used for collapsed breadcrumbs. Use "dropdown" to render a menu, or "text", "back", "parent-title", "menu-title", and "sheet" for compact breakpoint menu layouts.
|
|
15
15
|
* @attribute {string} breakpoint - The viewport breakpoint where collapsing starts.
|
|
16
16
|
* @attribute {string} breakpoint-collapse - The collapse behavior used below the breakpoint. Use "menu" to put the whole trail into one menu.
|
|
17
17
|
* @attribute {string} breakpoint-collapse-icon - Icon used by the default breakpoint menu trigger.
|
|
@@ -90,6 +90,11 @@ export default class Breadcrumbs extends WJElement {
|
|
|
90
90
|
* @returns {string}
|
|
91
91
|
*/
|
|
92
92
|
get collapsedVariant(): string;
|
|
93
|
+
/**
|
|
94
|
+
* Gets the collapsed indicator variant as a normalized token.
|
|
95
|
+
* @returns {string}
|
|
96
|
+
*/
|
|
97
|
+
get normalizedCollapsedVariant(): string;
|
|
93
98
|
/**
|
|
94
99
|
* Sets the collapse breakpoint token or value.
|
|
95
100
|
* @param {string} value Breakpoint token or CSS size.
|
|
@@ -157,6 +162,10 @@ export default class Breadcrumbs extends WJElement {
|
|
|
157
162
|
* @param {string|null} newValue Next value.
|
|
158
163
|
*/
|
|
159
164
|
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
165
|
+
/**
|
|
166
|
+
* Syncs host navigation semantics while preserving user-provided names.
|
|
167
|
+
*/
|
|
168
|
+
syncAria(): void;
|
|
160
169
|
/**
|
|
161
170
|
* Draw method for the Breadcrumbs element.
|
|
162
171
|
* @returns {object} fragment - The document fragment
|
|
@@ -275,6 +284,11 @@ export default class Breadcrumbs extends WJElement {
|
|
|
275
284
|
* @returns {boolean}
|
|
276
285
|
*/
|
|
277
286
|
isBreakpointMenuCollapseActive(): boolean;
|
|
287
|
+
/**
|
|
288
|
+
* Returns whether the active collapsed variant is one of the mobile compact layouts.
|
|
289
|
+
* @returns {boolean}
|
|
290
|
+
*/
|
|
291
|
+
usesMobileCollapsedVariant(): boolean;
|
|
278
292
|
/**
|
|
279
293
|
* Clears attributes/classes managed by the collapse algorithm.
|
|
280
294
|
* @param {Array<Element>} breadcrumbs Breadcrumb items.
|
|
@@ -33,6 +33,7 @@ export default class Dialog extends WJElement {
|
|
|
33
33
|
*/
|
|
34
34
|
static get observedAttributes(): any[];
|
|
35
35
|
_instanceId: number;
|
|
36
|
+
_opening: boolean;
|
|
36
37
|
/**
|
|
37
38
|
* Sets the value of the 'headline' attribute.
|
|
38
39
|
* @param {string} value The new value for the 'headline' attribute.
|
|
@@ -4,7 +4,9 @@ import { default as WJElement } from '../wje-element/element.js';
|
|
|
4
4
|
* @documentation https://elements.webjet.sk/components/Orgchart
|
|
5
5
|
* @status stable
|
|
6
6
|
* @augments WJElement
|
|
7
|
+
* @attribute {boolean} flat - Removes the incoming connector spacing for nested charts that should visually continue on the same level.
|
|
7
8
|
* @csspart - Styles the element.
|
|
9
|
+
* @csspart native - Styles the native element.
|
|
8
10
|
* @tag wje-orgchart
|
|
9
11
|
* @example
|
|
10
12
|
*/
|
|
@@ -15,6 +17,16 @@ export default class Orgchart extends WJElement {
|
|
|
15
17
|
* @returns {CSSStyleSheet}
|
|
16
18
|
*/
|
|
17
19
|
static get cssStyleSheet(): CSSStyleSheet;
|
|
20
|
+
/**
|
|
21
|
+
* Sets whether the chart should omit its incoming connector spacing.
|
|
22
|
+
* @param {boolean} value True when the chart should render without top connector spacing.
|
|
23
|
+
*/
|
|
24
|
+
set flat(value: boolean);
|
|
25
|
+
/**
|
|
26
|
+
* Gets whether the chart omits its incoming connector spacing.
|
|
27
|
+
* @returns {boolean} True when the chart has the flat attribute.
|
|
28
|
+
*/
|
|
29
|
+
get flat(): boolean;
|
|
18
30
|
/**
|
|
19
31
|
* Draws the component for the org chart.
|
|
20
32
|
* @returns {DocumentFragment}
|
|
@@ -5,6 +5,7 @@ import { default as WJElement } from '../wje-element/element.js';
|
|
|
5
5
|
* @status stable
|
|
6
6
|
* @augments WJElement
|
|
7
7
|
* @attribute {boolean} boss - The boss of the orgchart item (default: false).
|
|
8
|
+
* @attribute {boolean} virtual - Renders the item as a structural connector without its own card or expander.
|
|
8
9
|
* @slot - The default slot for the orgchart item.
|
|
9
10
|
* @slot child - The child slot for the orgchart item.
|
|
10
11
|
* @csspart - Styles the element.
|
|
@@ -19,6 +20,11 @@ export default class OrgchartItem extends WJElement {
|
|
|
19
20
|
* @returns {CSSStyleSheet}
|
|
20
21
|
*/
|
|
21
22
|
static get cssStyleSheet(): CSSStyleSheet;
|
|
23
|
+
/**
|
|
24
|
+
* Returns attributes that trigger a redraw when they change.
|
|
25
|
+
* @returns {Array<string>} Attribute names that require a new template render.
|
|
26
|
+
*/
|
|
27
|
+
static get observedAttributes(): Array<string>;
|
|
22
28
|
/**
|
|
23
29
|
* Sets the boss of the orgchart item.
|
|
24
30
|
* @param value
|
|
@@ -29,6 +35,16 @@ export default class OrgchartItem extends WJElement {
|
|
|
29
35
|
* @returns {boolean}
|
|
30
36
|
*/
|
|
31
37
|
get boss(): boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Sets whether the item should render only as a structural connector.
|
|
40
|
+
* @param {boolean} value True when the item should not render its own card.
|
|
41
|
+
*/
|
|
42
|
+
set virtual(value: boolean);
|
|
43
|
+
/**
|
|
44
|
+
* Gets whether the item renders only as a structural connector.
|
|
45
|
+
* @returns {boolean} True when the item has the virtual attribute.
|
|
46
|
+
*/
|
|
47
|
+
get virtual(): boolean;
|
|
32
48
|
beforeDraw(): void;
|
|
33
49
|
/**
|
|
34
50
|
* Draws the component for the org chart item.
|
|
@@ -161,6 +161,12 @@ export default class ToolbarAction extends WJElement {
|
|
|
161
161
|
* @returns {HTMLElement}
|
|
162
162
|
*/
|
|
163
163
|
createMenuItem(action: HTMLElement): HTMLElement;
|
|
164
|
+
/**
|
|
165
|
+
* Resolves readable text for a toolbar action copied into an overflow menu.
|
|
166
|
+
* @param {HTMLElement} action The original action element.
|
|
167
|
+
* @returns {string}
|
|
168
|
+
*/
|
|
169
|
+
getActionLabel(action: HTMLElement): string;
|
|
164
170
|
/**
|
|
165
171
|
* Creates a divider separating existing dropdown actions from responsive overflow actions.
|
|
166
172
|
* @returns {HTMLElement}
|