@scania/tegel 1.30.0-beta-enhance-focus-dropdown.0 → 1.31.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/loader.cjs.js +1 -1
- package/dist/cjs/tds-accordion-item.cjs.entry.js +25 -3
- package/dist/cjs/tds-dropdown_2.cjs.entry.js +9 -30
- package/dist/cjs/tds-modal.cjs.entry.js +14 -4
- package/dist/cjs/tds-popover-core.cjs.entry.js +1 -1
- package/dist/cjs/tegel.cjs.js +1 -1
- package/dist/collection/components/accordion/accordion-item/accordion-item.js +77 -4
- package/dist/collection/components/dropdown/dropdown.js +9 -30
- package/dist/collection/components/modal/modal.js +45 -4
- package/dist/collection/components/popover-core/tds-popover-core.css +359 -89
- package/dist/components/{p-e7d40d15.js → p-4420365f.js} +1 -1
- package/dist/components/{p-c54d2efe.js → p-516d8085.js} +1 -1
- package/dist/components/p-96e83134.js +2098 -0
- package/dist/components/{p-0f58e26f.js → p-adbf32b9.js} +9 -30
- package/dist/components/tds-accordion-item.js +30 -5
- package/dist/components/tds-dropdown.js +1 -1
- package/dist/components/tds-header-dropdown.js +2 -2
- package/dist/components/tds-header-launcher.js +2 -2
- package/dist/components/tds-modal.js +15 -4
- package/dist/components/tds-popover-canvas.js +1 -1
- package/dist/components/tds-popover-core.js +1 -1
- package/dist/components/tds-popover-menu.js +1 -1
- package/dist/components/tds-table-footer.js +1 -1
- package/dist/components/tds-textarea.js +2 -2
- package/dist/components/tds-tooltip.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/tds-accordion-item.entry.js +25 -3
- package/dist/esm/tds-dropdown_2.entry.js +9 -30
- package/dist/esm/tds-modal.entry.js +14 -4
- package/dist/esm/tds-popover-core.entry.js +1 -1
- package/dist/esm/tegel.js +1 -1
- package/dist/tegel/p-2b8e97e1.entry.js +1 -0
- package/dist/tegel/p-3e4707fb.entry.js +1 -0
- package/dist/tegel/p-ae0fed95.entry.js +1 -0
- package/dist/tegel/p-b58c7bed.entry.js +1 -0
- package/dist/tegel/tegel.css +1 -3
- package/dist/tegel/tegel.esm.js +1 -1
- package/dist/types/components/accordion/accordion-item/accordion-item.d.ts +6 -0
- package/dist/types/components/modal/modal.d.ts +6 -2
- package/dist/types/components.d.ts +21 -0
- package/package.json +1 -1
- package/dist/components/p-405c5512.js +0 -2098
- package/dist/tegel/p-acdd29b8.entry.js +0 -1
- package/dist/tegel/p-c3d91dfa.entry.js +0 -1
- package/dist/tegel/p-d56f426f.entry.js +0 -1
- package/dist/tegel/p-f71c3fca.entry.js +0 -1
|
@@ -9,14 +9,20 @@ const TdsModal = class {
|
|
|
9
9
|
constructor(hostRef) {
|
|
10
10
|
registerInstance(this, hostRef);
|
|
11
11
|
this.tdsClose = createEvent(this, "tdsClose", 7);
|
|
12
|
+
this.tdsOpen = createEvent(this, "tdsOpen", 7);
|
|
12
13
|
this.handleClose = (event) => {
|
|
13
14
|
const closeEvent = this.tdsClose.emit(event);
|
|
14
15
|
this.returnFocusOnClose();
|
|
15
|
-
if (
|
|
16
|
-
|
|
16
|
+
if (closeEvent.defaultPrevented) {
|
|
17
|
+
return;
|
|
17
18
|
}
|
|
19
|
+
this.isShown = false;
|
|
18
20
|
};
|
|
19
21
|
this.handleShow = () => {
|
|
22
|
+
const showEvent = this.tdsOpen.emit();
|
|
23
|
+
if (showEvent.defaultPrevented) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
20
26
|
this.isShown = true;
|
|
21
27
|
};
|
|
22
28
|
/** Checks if click on Modal is on overlay, if so it closes the Modal if prevent is not true. */
|
|
@@ -81,6 +87,10 @@ const TdsModal = class {
|
|
|
81
87
|
this.isShown = false;
|
|
82
88
|
this.returnFocusOnClose();
|
|
83
89
|
}
|
|
90
|
+
/** Returns the current open state of the Modal. */
|
|
91
|
+
async isOpen() {
|
|
92
|
+
return this.isShown;
|
|
93
|
+
}
|
|
84
94
|
connectedCallback() {
|
|
85
95
|
if (this.closable === undefined) {
|
|
86
96
|
this.closable = true;
|
|
@@ -197,10 +207,10 @@ const TdsModal = class {
|
|
|
197
207
|
const usesActionsSlot = hasSlot('actions', this.host);
|
|
198
208
|
const headerId = this.header ? `tds-modal-header-${generateUniqueId()}` : undefined;
|
|
199
209
|
const bodyId = `tds-modal-body-${generateUniqueId()}`;
|
|
200
|
-
return (h(Host, { key: '
|
|
210
|
+
return (h(Host, { key: '2d39760de58fd957585e4370aa88447d85249eca', role: this.tdsAlertDialog, "aria-modal": "true", "aria-describedby": bodyId, "aria-labelledby": headerId, class: {
|
|
201
211
|
show: this.isShown,
|
|
202
212
|
hide: !this.isShown,
|
|
203
|
-
}, onClick: (event) => this.handleOverlayClick(event) }, h("div", { key: '
|
|
213
|
+
}, onClick: (event) => this.handleOverlayClick(event) }, h("div", { key: '5eeaf5c29529bf77ddde4892067f13d312d1bba7', class: "tds-modal-backdrop" }), h("div", { key: '8a6ccd911dfec947a809320a0631d5f9904ef78d', class: `tds-modal tds-modal__actions-${this.actionsPosition} tds-modal-${this.size}` }, h("div", { key: 'b7c760ebded4e98319cec75c161002a579316902', id: headerId, class: "header" }, this.header && h("div", { key: 'db14e71913052ba5367ab95a41a366c7f2dea4a3', class: "header-text" }, this.header), usesHeaderSlot && h("slot", { key: '62b394718c78e564fd50e7ff3328e637a63679e6', name: "header" }), this.closable && (h("button", { key: '9ff8ad81be4f72ee6a298a9ba39a1024269d3ec2', class: "tds-modal-close", "aria-label": "close", onClick: (event) => this.handleClose(event) }, h("tds-icon", { key: 'b34b8a55c7f5c65ce7a3fdee6114c66ee4ab82c3', name: "cross", size: "20px" })))), h("div", { key: 'ab04e506dd94c69d8f91fb774fa85f355f3629d4', id: bodyId, class: "body" }, h("slot", { key: 'f4a8e2377b4cae3a9c4fa1032e896b0b0c58a06a', name: "body" })), usesActionsSlot && h("slot", { key: '09137d7c8b81f91dbf419b10c8a085de25df1272', name: "actions" }))));
|
|
204
214
|
}
|
|
205
215
|
get host() { return getElement(this); }
|
|
206
216
|
};
|