xv-webcomponents 1.19.2 → 1.20.1-staging.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/cjs/{_vars-A07oKwJ_.js → _vars-DMytunQw.js} +9 -6
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{xv-accordion-v2_47.cjs.entry.js → xv-accordion-v2_48.cjs.entry.js} +448 -90
- package/dist/cjs/xv-header-next.cjs.entry.js +2 -2
- package/dist/cjs/xv-mega-menu-next.cjs.entry.js +2 -2
- package/dist/cjs/xv-webcomponents.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/xv-button/xv-button-v2.css +8 -8
- package/dist/collection/components/xv-button/xv-button.js +25 -2
- package/dist/collection/components/xv-button-group/xv-button-group.css +173 -0
- package/dist/collection/components/xv-button-group/xv-button-group.js +206 -0
- package/dist/collection/components/xv-card/xv-card.js +1 -1
- package/dist/collection/components/xv-checkbox/xv-checkbox.js +2 -2
- package/dist/collection/components/xv-content-switcher/xv-content-switcher-item/xv-content-switcher-item.js +1 -1
- package/dist/collection/components/xv-content-switcher/xv-content-switcher.js +2 -2
- package/dist/collection/components/xv-data-table/xv-data-table-cell/xv-data-table-cell.js +1 -1
- package/dist/collection/components/xv-data-table/xv-data-table-collapse/xv-data-table-collapse.js +1 -1
- package/dist/collection/components/xv-data-table/xv-data-table-row/xv-data-table-row.js +2 -2
- package/dist/collection/components/xv-data-table/xv-data-table.js +1 -1
- package/dist/collection/components/xv-datepicker/xv-datepicker.js +2 -2
- package/dist/collection/components/xv-dropdown/xv-dropdown-item/xv-dropdown-item.js +1 -1
- package/dist/collection/components/xv-dropdown/xv-dropdown.js +1 -1
- package/dist/collection/components/xv-file-uploader/xv-file-uploader.js +1 -1
- package/dist/collection/components/xv-footer/xv-footer.js +1 -1
- package/dist/collection/components/xv-header/xv-header.css +4 -71
- package/dist/collection/components/xv-header/xv-header.js +10 -4
- package/dist/collection/components/xv-header-next/xv-header-next.js +1 -1
- package/dist/collection/components/xv-image-viewer/xv-image-viewer.js +1 -1
- package/dist/collection/components/xv-link/xv-link.js +1 -1
- package/dist/collection/components/xv-mega-menu/xv-mega-menu.js +2 -2
- package/dist/collection/components/xv-mega-menu-next/xv-mega-menu-next.js +2 -2
- package/dist/collection/components/xv-modal/xv-modal.js +1 -1
- package/dist/collection/components/xv-notification/xv-notification.js +1 -1
- package/dist/collection/components/xv-number-input/xv-number-input.js +2 -2
- package/dist/collection/components/xv-overflow-menu/_vars.js +7 -6
- package/dist/collection/components/xv-overflow-menu/xv-overflow-menu-item/xv-overflow-menu-item.css +48 -8
- package/dist/collection/components/xv-overflow-menu/xv-overflow-menu-item/xv-overflow-menu-item.js +84 -2
- package/dist/collection/components/xv-overflow-menu/xv-overflow-menu.css +28 -2
- package/dist/collection/components/xv-overflow-menu/xv-overflow-menu.js +373 -22
- package/dist/collection/components/xv-pagination/xv-pagination.js +1 -1
- package/dist/collection/components/xv-progress-indicator/xv-progress-indicator-item/xv-progress-indicator-item.js +1 -1
- package/dist/collection/components/xv-progress-indicator/xv-progress-indicator.js +1 -1
- package/dist/collection/components/xv-radio/xv-radio.js +2 -2
- package/dist/collection/components/xv-slider/xv-slider.js +1 -1
- package/dist/collection/components/xv-table/xv-table-cell/xv-table-cell.js +1 -1
- package/dist/collection/components/xv-table/xv-table-expand/xv-table-expand.js +1 -1
- package/dist/collection/components/xv-table/xv-table-row/xv-table-row.js +1 -1
- package/dist/collection/components/xv-table/xv-table.js +1 -1
- package/dist/collection/components/xv-tabs/xv-tab/xv-tab.js +1 -1
- package/dist/collection/components/xv-tag/xv-tag.js +1 -1
- package/dist/collection/components/xv-tag-combobox/xv-tag-combobox.css +7 -0
- package/dist/collection/components/xv-tag-combobox/xv-tag-combobox.js +37 -9
- package/dist/collection/components/xv-text-input/xv-text-input.js +2 -2
- package/dist/collection/components/xv-textarea/xv-textarea.js +2 -2
- package/dist/collection/components/xv-tile/xv-tile.js +2 -2
- package/dist/collection/components/xv-toggle/xv-toggle.js +1 -1
- package/dist/collection/components/xv-toggle-tip/xv-toggle-tip.js +1 -1
- package/dist/collection/components/xv-tooltip/xv-tooltip.js +2 -2
- package/dist/esm/{_vars-C6jsOjam.js → _vars-CDEU4jkD.js} +7 -7
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{xv-accordion-v2_47.entry.js → xv-accordion-v2_48.entry.js} +448 -91
- package/dist/esm/xv-header-next.entry.js +2 -2
- package/dist/esm/xv-mega-menu-next.entry.js +2 -2
- package/dist/esm/xv-webcomponents.js +1 -1
- package/dist/types/components/xv-button/xv-button.d.ts +2 -0
- package/dist/types/components/xv-button-group/xv-button-group.d.ts +54 -0
- package/dist/types/components/xv-overflow-menu/_vars.d.ts +14 -5
- package/dist/types/components/xv-overflow-menu/xv-overflow-menu-item/xv-overflow-menu-item.d.ts +10 -0
- package/dist/types/components/xv-overflow-menu/xv-overflow-menu.d.ts +43 -3
- package/dist/types/components/xv-tag-combobox/xv-tag-combobox.d.ts +1 -0
- package/dist/types/components.d.ts +177 -0
- package/dist/xv-webcomponents/{p-9284f4be.entry.js → p-0b0ce8e2.entry.js} +1 -1
- package/dist/xv-webcomponents/p-9edaba20.entry.js +8 -0
- package/dist/xv-webcomponents/p-CDEU4jkD.js +1 -0
- package/dist/xv-webcomponents/{p-3a20074c.entry.js → p-fa1779f0.entry.js} +1 -1
- package/dist/xv-webcomponents/xv-webcomponents.esm.js +1 -1
- package/package.json +1 -1
- package/dist/xv-webcomponents/p-6bb184f5.entry.js +0 -8
- package/dist/xv-webcomponents/p-C6jsOjam.js +0 -1
|
@@ -1,61 +1,291 @@
|
|
|
1
1
|
import { h, Host } from "@stencil/core";
|
|
2
|
+
import { createPopper } from "@popperjs/core";
|
|
2
3
|
import { SIZE_VAR } from "../../types/enum";
|
|
4
|
+
import { OverflowMenuItemSelector } from "./_vars";
|
|
5
|
+
let overflowMenuUid = 0;
|
|
3
6
|
export class XvOverflowMenu {
|
|
4
7
|
constructor() {
|
|
5
8
|
this.open = false;
|
|
6
9
|
this.disabled = false;
|
|
7
10
|
this.position = 'left';
|
|
8
11
|
this.size = SIZE_VAR.MD;
|
|
9
|
-
this.
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
12
|
+
this.anchorEl = null;
|
|
13
|
+
this.menuId = `xv-overflow-menu-${overflowMenuUid++}`;
|
|
14
|
+
this.activeItem = null;
|
|
15
|
+
this.optIdSeq = 0;
|
|
16
|
+
/** Whether the current open was triggered by the keyboard — only then do we pre-highlight an item. */
|
|
17
|
+
this.openViaKeyboard = false;
|
|
18
|
+
this.openEdge = 'first';
|
|
13
19
|
this.removeListeners = () => {
|
|
14
20
|
this.el.removeEventListener('itemClick', this.handleSelectItem);
|
|
15
|
-
document.
|
|
21
|
+
document.removeEventListener('click', this.handleClickOutside, { capture: true });
|
|
16
22
|
};
|
|
17
|
-
this.
|
|
18
|
-
|
|
23
|
+
this.handleClickOutside = (ev) => {
|
|
24
|
+
var _a, _b, _c;
|
|
25
|
+
if (!this.open)
|
|
19
26
|
return;
|
|
20
|
-
ev.
|
|
21
|
-
|
|
22
|
-
|
|
27
|
+
// A shadow-DOM click retargets ev.target to the host in the browser (covered by el.contains).
|
|
28
|
+
// Also check the shadow trigger/list directly so it works when there is no retargeting (jsdom).
|
|
29
|
+
const target = ev.target;
|
|
30
|
+
if (this.el.contains(target))
|
|
31
|
+
return;
|
|
32
|
+
if ((_a = this.triggerButtonEl) === null || _a === void 0 ? void 0 : _a.contains(target))
|
|
33
|
+
return;
|
|
34
|
+
if ((_b = this.listEl) === null || _b === void 0 ? void 0 : _b.contains(target))
|
|
35
|
+
return;
|
|
36
|
+
// A click on the anchor is handled by its own listener (toggle) — don't treat it as "outside".
|
|
37
|
+
if ((_c = this.anchorEl) === null || _c === void 0 ? void 0 : _c.contains(target))
|
|
38
|
+
return;
|
|
39
|
+
this.open = false;
|
|
23
40
|
};
|
|
24
41
|
this.onOpenToggle = () => {
|
|
42
|
+
this.openViaKeyboard = false; // mouse open: don't pre-highlight the first item
|
|
25
43
|
this.open = !this.open;
|
|
26
44
|
};
|
|
27
45
|
this.handleSelectItem = ({ detail }) => {
|
|
28
46
|
this.selectItem.emit(detail);
|
|
29
|
-
this.
|
|
47
|
+
this.open = false;
|
|
30
48
|
};
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
ev.stopPropagation();
|
|
49
|
+
this.anchorClickHandler = (ev) => {
|
|
50
|
+
if (this.disabled)
|
|
51
|
+
return;
|
|
35
52
|
ev.preventDefault();
|
|
36
|
-
this.
|
|
37
|
-
|
|
53
|
+
this.openViaKeyboard = false; // mouse open: don't pre-highlight the first item
|
|
54
|
+
this.open = !this.open;
|
|
55
|
+
};
|
|
56
|
+
this.getNavigableItems = () => Array.from(this.el.querySelectorAll(OverflowMenuItemSelector))
|
|
57
|
+
.filter((el) => !el.hasAttribute('disabled') && !el.hasAttribute('hidden') && el.getAttribute('variant') !== 'ghost');
|
|
58
|
+
this.moveActive = (delta) => {
|
|
59
|
+
const items = this.getNavigableItems();
|
|
60
|
+
if (!items.length)
|
|
61
|
+
return;
|
|
62
|
+
const current = this.activeItem ? items.indexOf(this.activeItem) : -1;
|
|
63
|
+
let next = current + delta;
|
|
64
|
+
if (next < 0)
|
|
65
|
+
next = items.length - 1;
|
|
66
|
+
else if (next >= items.length)
|
|
67
|
+
next = 0;
|
|
68
|
+
this.setActiveItem(items[next]);
|
|
69
|
+
};
|
|
70
|
+
this.setActiveByEdge = (edge) => {
|
|
71
|
+
const items = this.getNavigableItems();
|
|
72
|
+
if (!items.length)
|
|
73
|
+
return;
|
|
74
|
+
this.setActiveItem(edge === 'first' ? items[0] : items[items.length - 1]);
|
|
75
|
+
};
|
|
76
|
+
this.setActiveItem = (item, scroll = true) => {
|
|
77
|
+
var _a;
|
|
78
|
+
if (this.activeItem === item)
|
|
79
|
+
return;
|
|
80
|
+
(_a = this.activeItem) === null || _a === void 0 ? void 0 : _a.removeAttribute('active');
|
|
81
|
+
this.activeItem = item;
|
|
82
|
+
if (!item) {
|
|
83
|
+
this.activeId = undefined;
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
if (!item.id)
|
|
87
|
+
item.id = `${this.menuId}-opt-${this.optIdSeq++}`;
|
|
88
|
+
item.setAttribute('active', '');
|
|
89
|
+
this.activeId = item.id;
|
|
90
|
+
if (scroll)
|
|
91
|
+
item.scrollIntoView({ block: 'nearest' });
|
|
92
|
+
};
|
|
93
|
+
/** Runs once per open, after the panel is in the DOM: highlight the first item and place focus. */
|
|
94
|
+
this.initOpenState = () => {
|
|
95
|
+
var _a;
|
|
96
|
+
if (!this.open)
|
|
97
|
+
return;
|
|
98
|
+
if (this.openViaKeyboard) {
|
|
99
|
+
const items = this.getNavigableItems();
|
|
100
|
+
this.setActiveItem((this.openEdge === 'last' ? items[items.length - 1] : items[0]) || null, false);
|
|
101
|
+
}
|
|
102
|
+
else {
|
|
103
|
+
this.setActiveItem(null);
|
|
104
|
+
}
|
|
105
|
+
this.openViaKeyboard = false;
|
|
106
|
+
(_a = this.listEl) === null || _a === void 0 ? void 0 : _a.focus();
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
get isAnchorMode() {
|
|
110
|
+
return this.anchor !== undefined && this.anchor !== null && this.anchor !== '';
|
|
111
|
+
}
|
|
112
|
+
get effectivePosition() {
|
|
113
|
+
if (this.alignment === 'start')
|
|
114
|
+
return 'left';
|
|
115
|
+
if (this.alignment === 'end')
|
|
116
|
+
return 'right';
|
|
117
|
+
return this.position;
|
|
38
118
|
}
|
|
39
119
|
openChangeHandle() {
|
|
40
|
-
|
|
120
|
+
this.syncOpenState();
|
|
121
|
+
this.openChange.emit(!!this.open);
|
|
122
|
+
}
|
|
123
|
+
anchorChangeHandle() {
|
|
124
|
+
this.teardownAnchor();
|
|
125
|
+
this.setupAnchor();
|
|
126
|
+
}
|
|
127
|
+
/* region public API */
|
|
128
|
+
async openMenu() {
|
|
129
|
+
if (!this.disabled)
|
|
130
|
+
this.open = true;
|
|
131
|
+
}
|
|
132
|
+
async closeMenu() {
|
|
133
|
+
this.open = false;
|
|
134
|
+
}
|
|
135
|
+
async toggleMenu() {
|
|
136
|
+
if (!this.disabled)
|
|
137
|
+
this.open = !this.open;
|
|
138
|
+
}
|
|
139
|
+
/* endregion public API */
|
|
140
|
+
syncOpenState() {
|
|
141
|
+
var _a;
|
|
142
|
+
if (this.disabled) {
|
|
143
|
+
if (this.open)
|
|
144
|
+
this.open = false;
|
|
41
145
|
return;
|
|
146
|
+
}
|
|
42
147
|
if (this.open) {
|
|
43
148
|
this.el.addEventListener('itemClick', this.handleSelectItem);
|
|
44
|
-
document.
|
|
149
|
+
document.addEventListener('click', this.handleClickOutside, { capture: true });
|
|
150
|
+
requestAnimationFrame(() => {
|
|
151
|
+
if (this.isAnchorMode)
|
|
152
|
+
this.createPopper();
|
|
153
|
+
this.initOpenState();
|
|
154
|
+
});
|
|
45
155
|
}
|
|
46
156
|
else {
|
|
47
157
|
this.removeListeners();
|
|
158
|
+
this.destroyPopper();
|
|
159
|
+
this.setActiveItem(null);
|
|
160
|
+
}
|
|
161
|
+
(_a = this.anchorEl) === null || _a === void 0 ? void 0 : _a.setAttribute('aria-expanded', this.open ? 'true' : 'false');
|
|
162
|
+
}
|
|
163
|
+
/* region anchor mode */
|
|
164
|
+
resolveAnchor() {
|
|
165
|
+
if (!this.isAnchorMode)
|
|
166
|
+
return null;
|
|
167
|
+
if (typeof this.anchor === 'string')
|
|
168
|
+
return document.querySelector(this.anchor);
|
|
169
|
+
return this.anchor;
|
|
170
|
+
}
|
|
171
|
+
setupAnchor() {
|
|
172
|
+
if (!this.isAnchorMode)
|
|
173
|
+
return;
|
|
174
|
+
this.anchorEl = this.resolveAnchor();
|
|
175
|
+
if (this.anchorEl) {
|
|
176
|
+
this.anchorEl.addEventListener('click', this.anchorClickHandler);
|
|
177
|
+
this.anchorEl.setAttribute('aria-haspopup', 'menu');
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
teardownAnchor() {
|
|
181
|
+
if (this.anchorEl) {
|
|
182
|
+
this.anchorEl.removeEventListener('click', this.anchorClickHandler);
|
|
183
|
+
this.anchorEl.removeAttribute('aria-haspopup');
|
|
184
|
+
this.anchorEl.removeAttribute('aria-expanded');
|
|
185
|
+
this.anchorEl = null;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
popperPlacement() {
|
|
189
|
+
switch (this.effectivePosition) {
|
|
190
|
+
case 'right': return 'bottom-end';
|
|
191
|
+
case 'center': return 'bottom';
|
|
192
|
+
default: return 'bottom-start';
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
createPopper() {
|
|
196
|
+
const anchorEl = this.resolveAnchor();
|
|
197
|
+
if (!anchorEl || !this.listEl)
|
|
198
|
+
return;
|
|
199
|
+
this.destroyPopper();
|
|
200
|
+
this.popperInstance = createPopper(anchorEl, this.listEl, {
|
|
201
|
+
strategy: 'fixed',
|
|
202
|
+
placement: this.popperPlacement(),
|
|
203
|
+
modifiers: [
|
|
204
|
+
{ name: 'offset', options: { offset: [0, 4] } },
|
|
205
|
+
{ name: 'flip', options: { fallbackPlacements: ['top-start', 'top-end', 'top'] } },
|
|
206
|
+
{ name: 'preventOverflow', options: { boundary: 'viewport', padding: 8 } },
|
|
207
|
+
],
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
destroyPopper() {
|
|
211
|
+
if (this.popperInstance) {
|
|
212
|
+
this.popperInstance.destroy();
|
|
213
|
+
this.popperInstance = undefined;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
/* endregion anchor mode */
|
|
217
|
+
/* region keyboard navigation */
|
|
218
|
+
handleKeyDown(ev) {
|
|
219
|
+
var _a;
|
|
220
|
+
if (this.disabled)
|
|
221
|
+
return;
|
|
222
|
+
if (!this.open) {
|
|
223
|
+
if (['ArrowDown', 'ArrowUp', 'Enter', ' ', 'Spacebar'].includes(ev.key)) {
|
|
224
|
+
ev.preventDefault();
|
|
225
|
+
this.openViaKeyboard = true;
|
|
226
|
+
this.openEdge = ev.key === 'ArrowUp' ? 'last' : 'first';
|
|
227
|
+
this.open = true;
|
|
228
|
+
}
|
|
229
|
+
return;
|
|
230
|
+
}
|
|
231
|
+
switch (ev.key) {
|
|
232
|
+
case 'ArrowDown':
|
|
233
|
+
ev.preventDefault();
|
|
234
|
+
this.moveActive(1);
|
|
235
|
+
break;
|
|
236
|
+
case 'ArrowUp':
|
|
237
|
+
ev.preventDefault();
|
|
238
|
+
this.moveActive(-1);
|
|
239
|
+
break;
|
|
240
|
+
case 'Home':
|
|
241
|
+
ev.preventDefault();
|
|
242
|
+
this.setActiveByEdge('first');
|
|
243
|
+
break;
|
|
244
|
+
case 'End':
|
|
245
|
+
ev.preventDefault();
|
|
246
|
+
this.setActiveByEdge('last');
|
|
247
|
+
break;
|
|
248
|
+
case 'Enter':
|
|
249
|
+
case ' ':
|
|
250
|
+
case 'Spacebar':
|
|
251
|
+
ev.preventDefault();
|
|
252
|
+
(_a = this.activeItem) === null || _a === void 0 ? void 0 : _a.click(); // reuse the mouse-click selection path (also fires routerLink/href)
|
|
253
|
+
break;
|
|
254
|
+
case 'Escape':
|
|
255
|
+
ev.preventDefault();
|
|
256
|
+
ev.stopPropagation();
|
|
257
|
+
this.open = false;
|
|
258
|
+
this.restoreFocus();
|
|
259
|
+
break;
|
|
260
|
+
case 'Tab':
|
|
261
|
+
this.open = false; // let focus leave naturally
|
|
262
|
+
break;
|
|
48
263
|
}
|
|
49
264
|
}
|
|
265
|
+
restoreFocus() {
|
|
266
|
+
var _a, _b;
|
|
267
|
+
if (this.isAnchorMode)
|
|
268
|
+
(_a = this.anchorEl) === null || _a === void 0 ? void 0 : _a.focus();
|
|
269
|
+
else
|
|
270
|
+
(_b = this.triggerButtonEl) === null || _b === void 0 ? void 0 : _b.focus();
|
|
271
|
+
}
|
|
272
|
+
/* endregion keyboard navigation */
|
|
50
273
|
render() {
|
|
51
|
-
const
|
|
52
|
-
|
|
274
|
+
const list = (h("div", { class: { list: true, open: this.open, [`position-${this.effectivePosition}`]: !this.isAnchorMode }, role: "menu", tabindex: -1, "aria-orientation": "vertical", "aria-activedescendant": this.activeId, ref: (el) => (this.listEl = el) }, h("slot", null)));
|
|
275
|
+
if (this.isAnchorMode) {
|
|
276
|
+
return (h(Host, { class: { 'xv-overflow-menu': true, anchored: true }, size: this.size }, list));
|
|
277
|
+
}
|
|
278
|
+
const button = (h("button", { class: { btn: true, open: this.open }, onClick: this.onOpenToggle, disabled: this.disabled, "aria-haspopup": "menu", "aria-expanded": this.open ? 'true' : 'false', ref: (el) => (this.triggerButtonEl = el) }, h("slot", { name: "trigger" }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", viewBox: "0 0 128 512" }, h("path", { d: "M64 368a48 48 0 1 0 0 96 48 48 0 1 0 0-96zm0-160a48 48 0 1 0 0 96 48 48 0 1 0 0-96zM112 96A48 48 0 1 0 16 96a48 48 0 1 0 96 0z" })))));
|
|
279
|
+
return (h(Host, { class: "xv-overflow-menu", size: this.size }, this.tooltip ? h("xv-tooltip-v2", { message: this.tooltip }, button) : button, list));
|
|
53
280
|
}
|
|
54
281
|
componentDidLoad() {
|
|
55
|
-
this.
|
|
282
|
+
this.setupAnchor();
|
|
283
|
+
this.syncOpenState();
|
|
56
284
|
}
|
|
57
285
|
disconnectedCallback() {
|
|
58
286
|
this.removeListeners();
|
|
287
|
+
this.destroyPopper();
|
|
288
|
+
this.teardownAnchor();
|
|
59
289
|
}
|
|
60
290
|
static get is() { return "xv-overflow-menu-v2"; }
|
|
61
291
|
static get encapsulation() { return "shadow"; }
|
|
@@ -131,6 +361,25 @@ export class XvOverflowMenu {
|
|
|
131
361
|
"attribute": "position",
|
|
132
362
|
"defaultValue": "'left'"
|
|
133
363
|
},
|
|
364
|
+
"alignment": {
|
|
365
|
+
"type": "string",
|
|
366
|
+
"mutable": false,
|
|
367
|
+
"complexType": {
|
|
368
|
+
"original": "'start' | 'end'",
|
|
369
|
+
"resolved": "\"end\" | \"start\"",
|
|
370
|
+
"references": {}
|
|
371
|
+
},
|
|
372
|
+
"required": false,
|
|
373
|
+
"optional": true,
|
|
374
|
+
"docs": {
|
|
375
|
+
"tags": [],
|
|
376
|
+
"text": "Alias for `position` following the design-system wording. `start` \u2192 left, `end` \u2192 right."
|
|
377
|
+
},
|
|
378
|
+
"getter": false,
|
|
379
|
+
"setter": false,
|
|
380
|
+
"reflect": false,
|
|
381
|
+
"attribute": "alignment"
|
|
382
|
+
},
|
|
134
383
|
"size": {
|
|
135
384
|
"type": "string",
|
|
136
385
|
"mutable": false,
|
|
@@ -175,9 +424,38 @@ export class XvOverflowMenu {
|
|
|
175
424
|
"setter": false,
|
|
176
425
|
"reflect": false,
|
|
177
426
|
"attribute": "tooltip"
|
|
427
|
+
},
|
|
428
|
+
"anchor": {
|
|
429
|
+
"type": "string",
|
|
430
|
+
"mutable": false,
|
|
431
|
+
"complexType": {
|
|
432
|
+
"original": "string | HTMLElement",
|
|
433
|
+
"resolved": "HTMLElement | string",
|
|
434
|
+
"references": {
|
|
435
|
+
"HTMLElement": {
|
|
436
|
+
"location": "global",
|
|
437
|
+
"id": "global::HTMLElement"
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
},
|
|
441
|
+
"required": false,
|
|
442
|
+
"optional": true,
|
|
443
|
+
"docs": {
|
|
444
|
+
"tags": [],
|
|
445
|
+
"text": "Open the menu from an arbitrary element instead of the built-in trigger button.\nAccepts an element or a CSS selector; a click on it toggles the menu, which is then\npositioned against that element."
|
|
446
|
+
},
|
|
447
|
+
"getter": false,
|
|
448
|
+
"setter": false,
|
|
449
|
+
"reflect": false,
|
|
450
|
+
"attribute": "anchor"
|
|
178
451
|
}
|
|
179
452
|
};
|
|
180
453
|
}
|
|
454
|
+
static get states() {
|
|
455
|
+
return {
|
|
456
|
+
"activeId": {}
|
|
457
|
+
};
|
|
458
|
+
}
|
|
181
459
|
static get events() {
|
|
182
460
|
return [{
|
|
183
461
|
"method": "selectItem",
|
|
@@ -200,13 +478,86 @@ export class XvOverflowMenu {
|
|
|
200
478
|
}
|
|
201
479
|
}
|
|
202
480
|
}
|
|
481
|
+
}, {
|
|
482
|
+
"method": "openChange",
|
|
483
|
+
"name": "openChange",
|
|
484
|
+
"bubbles": false,
|
|
485
|
+
"cancelable": true,
|
|
486
|
+
"composed": true,
|
|
487
|
+
"docs": {
|
|
488
|
+
"tags": [],
|
|
489
|
+
"text": ""
|
|
490
|
+
},
|
|
491
|
+
"complexType": {
|
|
492
|
+
"original": "boolean",
|
|
493
|
+
"resolved": "boolean",
|
|
494
|
+
"references": {}
|
|
495
|
+
}
|
|
203
496
|
}];
|
|
204
497
|
}
|
|
498
|
+
static get methods() {
|
|
499
|
+
return {
|
|
500
|
+
"openMenu": {
|
|
501
|
+
"complexType": {
|
|
502
|
+
"signature": "() => Promise<void>",
|
|
503
|
+
"parameters": [],
|
|
504
|
+
"references": {
|
|
505
|
+
"Promise": {
|
|
506
|
+
"location": "global",
|
|
507
|
+
"id": "global::Promise"
|
|
508
|
+
}
|
|
509
|
+
},
|
|
510
|
+
"return": "Promise<void>"
|
|
511
|
+
},
|
|
512
|
+
"docs": {
|
|
513
|
+
"text": "",
|
|
514
|
+
"tags": []
|
|
515
|
+
}
|
|
516
|
+
},
|
|
517
|
+
"closeMenu": {
|
|
518
|
+
"complexType": {
|
|
519
|
+
"signature": "() => Promise<void>",
|
|
520
|
+
"parameters": [],
|
|
521
|
+
"references": {
|
|
522
|
+
"Promise": {
|
|
523
|
+
"location": "global",
|
|
524
|
+
"id": "global::Promise"
|
|
525
|
+
}
|
|
526
|
+
},
|
|
527
|
+
"return": "Promise<void>"
|
|
528
|
+
},
|
|
529
|
+
"docs": {
|
|
530
|
+
"text": "",
|
|
531
|
+
"tags": []
|
|
532
|
+
}
|
|
533
|
+
},
|
|
534
|
+
"toggleMenu": {
|
|
535
|
+
"complexType": {
|
|
536
|
+
"signature": "() => Promise<void>",
|
|
537
|
+
"parameters": [],
|
|
538
|
+
"references": {
|
|
539
|
+
"Promise": {
|
|
540
|
+
"location": "global",
|
|
541
|
+
"id": "global::Promise"
|
|
542
|
+
}
|
|
543
|
+
},
|
|
544
|
+
"return": "Promise<void>"
|
|
545
|
+
},
|
|
546
|
+
"docs": {
|
|
547
|
+
"text": "",
|
|
548
|
+
"tags": []
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
};
|
|
552
|
+
}
|
|
205
553
|
static get elementRef() { return "el"; }
|
|
206
554
|
static get watchers() {
|
|
207
555
|
return [{
|
|
208
556
|
"propName": "open",
|
|
209
557
|
"methodName": "openChangeHandle"
|
|
558
|
+
}, {
|
|
559
|
+
"propName": "anchor",
|
|
560
|
+
"methodName": "anchorChangeHandle"
|
|
210
561
|
}];
|
|
211
562
|
}
|
|
212
563
|
static get listeners() {
|
|
@@ -89,7 +89,7 @@ export class XvPagination {
|
|
|
89
89
|
this.observer.disconnect();
|
|
90
90
|
}
|
|
91
91
|
render() {
|
|
92
|
-
return (h(Host, { key: '
|
|
92
|
+
return (h(Host, { key: '7c5589c5954a364956c471c8b214f7e5c6e2d217', class: { block: this.block, [this.currentVariant]: true, [this.size]: !!this.size } }, this.currentVariant === 'full' && (h("div", { key: '72a9851f3c53fca042f3a5cbefc87e2a4beddd8d', class: "block" }, h("select", { key: '31c16503e23de7c5e6b03b80db3df72a7bf68edb', class: "options-select", name: "options", onChange: this.handleItemsPerPageChange }, this.itemsPerPageOptions.map((v) => h("option", { value: v }, v))))), this.currentVariant === 'full' && (h("span", { key: 'e5d45975abec39806344a36b518129d327a589d5', class: "block block_full" }, `${(this.page - 1) * this.itemsPerPage + 1} – ${Math.min(this.page * this.itemsPerPage, this.totalItems)} von ${this.totalItems} Einträgen`)), this.currentVariant === 'full' && (h("div", { key: '0a97d5ec8e6163ec5f2acd1f613469be984ad829', class: "block" }, h("select", { key: 'f9e2ee52b8243e738e899a32578412853bf0dae3', class: "options-select", name: "pages", onChange: this.handlePageSelectChange }, Array.from({ length: this.total }, (_, i) => (h("option", { selected: this.page === i + 1, value: i + 1 }, i + 1)))), h("span", { key: '95b453e07438aac43c85cf0260415c4781517c24' }, "von ", this.total, " Seiten"))), this.currentVariant === 'compact' && h("span", { key: '591dc8b9ef95f0a94604937a6c3fd23ea5624850', class: "block" }, "Seite ", this.page), h("xv-button-v2", { key: 'd06344e19ef7a0cfc1cf3136c98ed579542a86f2', variant: "ghost", size: this.size, onClick: () => this.handlePageChange(this.page - 1), disabled: this.page <= 1 }, h("span", { key: '1e4dbe879f5fabfcc2ca4af2859124e99491ebae', slot: "icon-left", class: "icon icon_prev" })), this.currentVariant === 'regular' && (h("ul", { key: '8deafa7283a58edc710c5298821878c7de89d5bd', class: "list" }, this.visiblePagesWithDots.map((page) => (h("li", { class: { active: this.page === page } }, page === 'dots-start' ? (h("div", { class: "list_dots" }, h("xv-button-v2", { variant: "ghost", size: this.size, tabindex: -1 }, h("span", { slot: "icon-left", class: "list_dots__icon" }, "...")), h("select", { name: "start", onChange: this.handlePageSelectChange }, Array.from({ length: this.page - 3 }, (_, i) => (h("option", { value: i + 2 }, i + 2)))))) : page === 'dots-end' ? (h("div", { class: "list_dots" }, h("xv-button-v2", { variant: "ghost", size: this.size, tabindex: -1 }, h("span", { slot: "icon-left", class: "list_dots__icon" }, "...")), h("select", { name: "end", onChange: this.handlePageSelectChange }, Array.from({ length: this.total - (this.page + 2) }, (_, i) => (h("option", { value: i + this.page + 2 }, i + this.page + 2)))))) : (h("xv-button-v2", { variant: "ghost", size: this.size, disabled: this.page === page, onClick: () => this.handlePageChange(page) }, h("span", { class: "list_page", slot: "icon-left" }, page)))))))), h("xv-button-v2", { key: '14054db39c36ea71b040fbd40d22b109e46ecb27', variant: "ghost", size: this.size, onClick: () => this.handlePageChange(this.page + 1), disabled: this.page >= this.total }, h("span", { key: 'a42a8b4bd9f297d99b973ea016b98250f3498130', slot: "icon-left", class: "icon icon_next" }))));
|
|
93
93
|
}
|
|
94
94
|
static get is() { return "xv-pagination"; }
|
|
95
95
|
static get encapsulation() { return "shadow"; }
|
|
@@ -5,7 +5,7 @@ export class XvProgressIndicatorItem {
|
|
|
5
5
|
this.status = PROGRESS_ITEM_STATUS.NO_STARTED;
|
|
6
6
|
}
|
|
7
7
|
render() {
|
|
8
|
-
return (h(Host, { key: '
|
|
8
|
+
return (h(Host, { key: '33ae32003398c17a6b31ea573f05d6cd33b164c1', status: this.status, class: { 'xv-progress-indicator-item': true } }, h("span", { key: '560ce3943bf693aa586a9e6df458910b66dad315', class: "line" }), h("span", { key: 'fab068e39c9e79c78b08fc145978d0e266c52ef0', class: "icon" }, h("svg", { key: '9c23f9e6e1b746b73771eb70bea8b2e5d02ec3d0', xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 448 512" }, h("path", { key: '852ef6777fb171fdde85a82fd18b2ec8bc4be96f', fill: "currentColor", d: "M438.6 105.4c12.5 12.5 12.5 32.8 0 45.3l-256 256c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 338.7 393.4 105.4c12.5-12.5 32.8-12.5 45.3 0z" }))), h("p", { key: 'b873572c5b27c14a182e5adad80c6d07f45d84f2', class: "label" }, h("slot", { key: '480bb80167ad0e136577083b99a411ce080aa88e' }))));
|
|
9
9
|
}
|
|
10
10
|
static get is() { return "xv-progress-indicator-v2-item"; }
|
|
11
11
|
static get encapsulation() { return "shadow"; }
|
|
@@ -55,7 +55,7 @@ export class XvProgressIndicator {
|
|
|
55
55
|
this.updateChildItems();
|
|
56
56
|
}
|
|
57
57
|
render() {
|
|
58
|
-
return (h(Host, { key: '
|
|
58
|
+
return (h(Host, { key: '3fcba0ade362eac7bde5ed929617608425e7e386', variant: this.variant, size: this.size, class: { 'xv-progress-indicator': true } }, h("slot", { key: '297b19bda35040fd8d51457b16cce7a09af8fb84' })));
|
|
59
59
|
}
|
|
60
60
|
static get is() { return "xv-progress-indicator-v2"; }
|
|
61
61
|
static get encapsulation() { return "shadow"; }
|
|
@@ -23,12 +23,12 @@ export class XvRadio {
|
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
render() {
|
|
26
|
-
return (h("div", { key: '
|
|
26
|
+
return (h("div", { key: '9847de4eae9fd57ad9292e5796232f7ec3c3e0c7', class: {
|
|
27
27
|
'xv-radio': true,
|
|
28
28
|
'xv-radio--reverse': this.reverse,
|
|
29
29
|
'xv-radio--block': this.block,
|
|
30
30
|
[`xv-radio--size-${this.size}`]: !!this.size,
|
|
31
|
-
} }, this.label && h("p", { key: '
|
|
31
|
+
} }, this.label && h("p", { key: '85abe464f3c4810bb2809aa256d7a8e42c074e1c', class: "xv-radio_label" }, this.label), h("label", { key: '088ab7d61d11b0ca5fc40bdc4ab7f4db07821309', class: { 'xv-radio_container': true, disabled: this.disabled } }, h("div", { key: '4eae897aaed7152d15d4f2fc5919f2c743041d85', class: { 'xv-radio_input': true, 'xv-radio_input--error': !!this.error || this.error === '' } }, h("input", { key: '9f78ff31e667f9c12b86da027db29735d09b7532', ref: el => (this.inputEl = el), type: "radio", name: this.name, value: this.value, checked: this.checked, readonly: this.readonly, disabled: this.disabled }), h("span", { key: 'dcecc4aec28c50d13ccd1c45b18b106b8f99ef93', class: "xv-radio_input__mark" })), h("span", { key: '52e51eb01131ecdecb5047f1990ed120aa3c12d7', class: "xv-radio_container__label" }, h("slot", { key: 'cb9bbb0d79f29a268828204f482a27a49d9bd798' }))), this.error && typeof this.error === 'string' && (h("span", { key: 'c085f9c2b913cb4c27c4f9fe88b8941877eb00c4', class: "xv-radio_msg xv-radio_msg--error" }, h("span", { key: '16d52c226306e20272b08a7dbdeda4ff8ebb4688', class: "xv-radio_msg__status", "aria-hidden": "true" }, "!"), this.error)), this.warning && typeof this.warning === 'string' && (h("span", { key: '7f67291cc785e20762960a1e183245927e96797c', class: "xv-radio_msg xv-radio_msg--warning" }, h("span", { key: '9546dfa2c8faf77d4ec949cba0c16a74bd5e8595', class: "xv-radio_msg__status", "aria-hidden": "true" }, "\u26A0"), this.warning)), h("slot", { key: '59a998219c4e88dfb7fce33fa19a4bced0146b8d', name: "info" })));
|
|
32
32
|
}
|
|
33
33
|
connectedCallback() {
|
|
34
34
|
var _a;
|
|
@@ -38,7 +38,7 @@ export class XvSlider {
|
|
|
38
38
|
this.setValue(this.min);
|
|
39
39
|
}
|
|
40
40
|
render() {
|
|
41
|
-
return (h(Host, { key: '
|
|
41
|
+
return (h(Host, { key: '65f76b767cc84856069973e15e0382a960e95d86', class: { disabled: this.disabled, readonly: this.readonly } }, this.label && h("label", { key: '72090f7ebd313d9c0787bfe4c52c7f100605fea6', class: "label" }, this.label), h("div", { key: '21e5907cdf8d0fc5eb8c1a715e0c19c0f43ca03a', class: "control" }, h("span", { key: '5b2714841a384961abeeadb714f869ce975a047f', class: "control_label" }, this.min), h("input", { key: '314b30eaa27c94b85d746bdb1b08650e65189653', type: "range", disabled: this.disabled || this.readonly, readonly: this.readonly, name: this.name, min: this.min, max: this.max, step: this.step, value: this.value, onInput: this.handleInput, style: { backgroundSize: `${((this.value - this.min) * 100) / (this.max - this.min)}% 100%` } }), h("span", { key: '1fd6ebcf2d08c1b86dcddd0cba504c874821d122', class: "control_label" }, this.max), !this.notEditable && (h("input", { key: 'bd6d3809e9e09dddd067eedd927279700016ff49', type: "number", disabled: this.disabled, readonly: this.readonly, name: `${this.name}-number-input`, step: this.step, min: this.min, max: this.max, value: this.value, onInput: this.handleNumberInput, onBlur: this.handleNumberBlur })))));
|
|
42
42
|
}
|
|
43
43
|
static get is() { return "xv-slider-v2"; }
|
|
44
44
|
static get encapsulation() { return "shadow"; }
|
|
@@ -22,7 +22,7 @@ export class XvTableCell {
|
|
|
22
22
|
}
|
|
23
23
|
;
|
|
24
24
|
render() {
|
|
25
|
-
return (h(Host, { key: '
|
|
25
|
+
return (h(Host, { key: '6869366153dd26000e2440df9109daa9df77e777' }, h("slot", { key: '33baf3aa330babd0e3ee07a6455d83ddf9d3638b' })));
|
|
26
26
|
}
|
|
27
27
|
static get is() { return "xv-table-v2-cell"; }
|
|
28
28
|
static get encapsulation() { return "shadow"; }
|
|
@@ -10,7 +10,7 @@ export class XvTableExpand {
|
|
|
10
10
|
};
|
|
11
11
|
}
|
|
12
12
|
render() {
|
|
13
|
-
return (h(Host, { key: '
|
|
13
|
+
return (h(Host, { key: 'ccc90f12cd72b5be45d10764413fbf289a3f0811' }, h("button", { key: '01b2a423cfd638c2791e643ba23e7204d6537d43', class: { 'expand-btn': true, open: this.open }, disabled: this.disabled, onClick: this.handleExpand }), h("slot", { key: '805d0c9f40a2649d69876f3b2d277e16a9283dc6', name: XV_EXPANDABLE_KEY }), h("div", { key: 'cb98360d80b2bef84c6c1917caca61b44f7837e8', class: { expandableContent: true, open: this.open } }, h("slot", { key: '82b80292c259a05f9c493be080c8006f154b6efb' }))));
|
|
14
14
|
}
|
|
15
15
|
componentDidLoad() {
|
|
16
16
|
setAttr(this.el.parentElement, XV_EXPANDABLE_KEY, true);
|
|
@@ -42,7 +42,7 @@ export class XvTableRow {
|
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
render() {
|
|
45
|
-
return (h(Host, { key: '
|
|
45
|
+
return (h(Host, { key: '84abfd18de14b5e6988b99fad17f46dcef62900a' }, this.variant !== undefined && (h("xv-table-v2-cell", { key: '901ec86f5753adf2f41f6fae88c816bf462ffd45', class: "cell-control" }, this.variant === 'checkbox' && (h("xv-checkbox-v2", { key: 'f00b54d81da7148b35b93e60711d7b3b35096af6', name: this.name, partial: this.partial, checked: this.checked || this.partial, disabled: this.disabled, required: this.required, readonly: this.readonly, onEventChange: this.checkHandle })), this.variant === 'radio' && (h("input", { key: '8363e1d39f4280841618c4ff50d75638af674879', type: "radio", name: this.name, checked: this.checked || this.partial, disabled: this.disabled, required: this.required, readonly: this.readonly })))), h("slot", { key: '6a8073f779bf9644d757a620253d29167b458ffb' })));
|
|
46
46
|
}
|
|
47
47
|
componentWillLoad() {
|
|
48
48
|
this.setInitialAttrs();
|
|
@@ -32,7 +32,7 @@ export class XvTable {
|
|
|
32
32
|
.join(' ') + ' repeat(auto-fit, minmax(0, 1fr))');
|
|
33
33
|
}
|
|
34
34
|
render() {
|
|
35
|
-
return (h(Host, { key: '
|
|
35
|
+
return (h(Host, { key: '3ba40f0c65621b3d748e21ef79d64f7fcaff7241', class: { batchVisible: !!this.selectedCount } }, h("slot", { key: '157beb3344e8c5ecd87e54eaf8b08448fe6bd573', name: "title" }, !!this.el.title && h("h2", { key: '95b0ee401a1168c696da0d457d89194c886743f2', class: "xv-table-title" }, this.el.title)), h("slot", { key: '654a069ce7f51bb9d073ea503b6cf7137b80cf2b', name: "toolbar" }), h("div", { key: 'bf4fdac5b559f406d9d907252ef8acfbeb397441', class: "xv-table" }, h("div", { key: '714eca6ae436694503b6af2eb580868d3788b191', class: "batch-actions" }, h(Fragment, { key: '8ac8c13cf22de4b14507d0176cf85522abb1c8b5' }, h("div", { key: '768759186883cec8dbd6ba52dba2e49d94949936', class: "batch-actions_content" }, h("slot", { key: 'bf6b50edd02317f5cedeb06a95930ef251f5fd2c', name: "batch" })), h("p", { key: 'b71c2c31bf17acc4c9582aa23f909d9991311f00', class: "batch-actions_count" }, !!this.selectedCount && `${this.selectedCount} ${this.selectedCount === 1 ? 'Position ausgewählt' : 'Positionen ausgewählt'}`))), h("div", { key: '7b53ba114ec7c9ae56c10e5f85eee416c29428ed', class: "xv-table_wrapper" }, h("slot", { key: '2e9a401645d0b0a650f7df8d276b5dc8e6b264cc' }), h("slot", { key: '2d3cd237aea826b672da473ada6e028b37f22a03', name: "footer" })), !!this.loading && (h("div", { key: '61918a11ff660deac23575a04a3bf44c253ace41', class: "xv-table_loading" }, h("xv-loader-v2", { key: 'bc3108a52d5f21ba690a25568fe6b8f2b9ea33ac', size: SIZE_VAR.LG }))))));
|
|
36
36
|
}
|
|
37
37
|
componentWillLoad() {
|
|
38
38
|
this.setColsSizeTemplate();
|
|
@@ -6,7 +6,7 @@ export class XvTab {
|
|
|
6
6
|
this.loading = false;
|
|
7
7
|
}
|
|
8
8
|
render() {
|
|
9
|
-
return (h(Host, { key: '
|
|
9
|
+
return (h(Host, { key: '7b49de1203b60a0a7b1b25552907eb8339f001ec', disabled: this.disabled, name: this.name }, this.loading ? h("xv-loader-v2", { size: SIZE_VAR.LG }) : h("slot", null)));
|
|
10
10
|
}
|
|
11
11
|
static get is() { return "xv-tab-v2"; }
|
|
12
12
|
static get encapsulation() { return "shadow"; }
|
|
@@ -13,7 +13,7 @@ export class XvTag {
|
|
|
13
13
|
this.closeClick.emit(e);
|
|
14
14
|
}
|
|
15
15
|
render() {
|
|
16
|
-
return (h(Host, { key: '
|
|
16
|
+
return (h(Host, { key: '6b2f00a5acec63848ec53f4c23d5444cfd9d9c65', style: { color: this.color, background: this.bg }, class: `xv-tag ${this.disabled ? 'disabled' : ''} ${this.size}` }, h("div", { key: '7fd4e3e61903755c50668d0c9923afc7915afb5a', class: "xv-tag_content", part: "details-content" }, h("slot", { key: '26a6b95e5c3dd33b8bcb5b81fa2399338c72fb22' })), this.closeable && (h("button", { key: 'd14081f320bd61f23c09a99bbafa1abac5f11517', onClick: this.closeHandler.bind(this), class: "xv-tag_close" }))));
|
|
17
17
|
}
|
|
18
18
|
static get is() { return "xv-tag-v2"; }
|
|
19
19
|
static get encapsulation() { return "shadow"; }
|
|
@@ -181,6 +181,13 @@
|
|
|
181
181
|
gap: 6px;
|
|
182
182
|
width: 100%;
|
|
183
183
|
}
|
|
184
|
+
:host .control-loader {
|
|
185
|
+
flex: 0 0 auto;
|
|
186
|
+
display: inline-flex;
|
|
187
|
+
align-items: center;
|
|
188
|
+
margin-left: var(--spacing-03);
|
|
189
|
+
pointer-events: none;
|
|
190
|
+
}
|
|
184
191
|
:host .control-input {
|
|
185
192
|
flex: 1;
|
|
186
193
|
min-width: 120px;
|