Skip to content

Commit 35dcfd9

Browse files
committed
Release 9.3.0
1 parent 8cedb5b commit 35dcfd9

File tree

11 files changed

+51
-16
lines changed

11 files changed

+51
-16
lines changed

angular-bootstrap-md-9.2.0.tgz

-1.52 MB
Binary file not shown.

angular-bootstrap-md-9.3.0.tgz

1.52 MB
Binary file not shown.

changelog

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
9.3.0
2+
In version 9.3.0 we added some fixes and a new version of Select component, check what changed below:
3+
4+
**Fixes:**
5+
6+
* Select - resolved problem with tabindex attribute,
7+
* Modals - resolved problems with focus trap.
8+
9+
**New features:**
10+
11+
* Added new version of Select component, which includes new mdb-option component, updated material design and modified HTML structure. The old version of this component is still available and will not be removed before the next major release.
12+
113
9.2.0
214
In version 9.2.0 we added some fixes and a new version of Timepicker component, check what changed below
315

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-bootstrap-md-lib",
3-
"version": "9.2.0",
3+
"version": "9.3.0",
44
"scripts": {
55
"ng": "ng",
66
"start": "ng serve",
@@ -32,7 +32,7 @@
3232
"@angular/router": "~9.0.4",
3333
"@fortawesome/fontawesome-free": "^5.6.3",
3434
"@types/chart.js": "^2.7.42",
35-
"angular-bootstrap-md": "file:angular-bootstrap-md-9.2.0.tgz",
35+
"angular-bootstrap-md": "file:angular-bootstrap-md-9.3.0.tgz",
3636
"chart.js": "^2.5.0",
3737
"core-js": "^2.5.4",
3838
"hammerjs": "^2.0.8",

projects/angular-bootstrap-md/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "angular-bootstrap-md",
33
"repository": "https://github.com/mdbootstrap/Angular-Bootstrap-with-Material-Design",
4-
"version": "9.2.0",
4+
"version": "9.3.0",
55
"schematics": "./schematics/collection.json",
66
"ng-update": {
77
"migrations": "./schematics/migration.json"

projects/angular-bootstrap-md/src/lib/changelog

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
9.3.0
2+
In version 9.3.0 we added some fixes and a new version of Select component, check what changed below:
3+
4+
**Fixes:**
5+
6+
* Select - resolved problem with tabindex attribute,
7+
* Modals - resolved problems with focus trap.
8+
9+
**New features:**
10+
11+
* Added new version of Select component, which includes new mdb-option component, updated material design and modified HTML structure. The old version of this component is still available and will not be removed before the next major release.
12+
113
9.2.0
214
In version 9.2.0 we added some fixes and a new version of Timepicker component, check what changed below
315

projects/angular-bootstrap-md/src/lib/free/modals/modal.directive.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import { ModalBackdropComponent } from './modalBackdrop.component';
2222
import { ClassName, DISMISS_REASONS, modalConfigDefaults, ModalOptions } from './modal.options';
2323
import { ComponentLoader } from '../utils/component-loader/component-loader.class';
2424
import { ComponentLoaderFactory } from '../utils/component-loader/component-loader.factory';
25+
import { FocusTrap, ConfigurableFocusTrapFactory } from '@angular/cdk/a11y';
2526

2627
const TRANSITION_DURATION = 300;
2728
const BACKDROP_TRANSITION_DURATION = 150;
@@ -87,17 +88,19 @@ export class ModalDirective implements AfterViewInit, OnDestroy, OnChanges {
8788
// reference to backdrop component
8889
protected backdrop: ComponentRef<ModalBackdropComponent> | undefined;
8990
private _backdrop: ComponentLoader<ModalBackdropComponent>;
91+
92+
private _focusTrap: FocusTrap;
9093
// todo: implement _dialog
9194
_dialog: any;
9295

9396
isNested = false;
9497

9598
utils: Utils = new Utils();
9699

97-
@HostListener('keydown', ['$event']) onKeyDown(event: any) {
100+
/* @HostListener('keydown', ['$event']) onKeyDown(event: any) {
98101
this.utils.focusTrapModal(event, this._element);
99102
}
100-
103+
*/
101104
@HostListener('click', ['$event'])
102105
public onClick(event: any): void {
103106
if (
@@ -122,6 +125,7 @@ export class ModalDirective implements AfterViewInit, OnDestroy, OnChanges {
122125

123126
public constructor(
124127
protected _element: ElementRef,
128+
private _focusTrapFactory: ConfigurableFocusTrapFactory,
125129
_viewContainerRef: ViewContainerRef,
126130
protected _renderer: Renderer2,
127131
clf: ComponentLoaderFactory
@@ -149,6 +153,8 @@ export class ModalDirective implements AfterViewInit, OnDestroy, OnChanges {
149153
this.show();
150154
}
151155
}, 0);
156+
157+
this._createFocusTrap();
152158
}
153159

154160
public ngOnChanges(): any {
@@ -292,6 +298,12 @@ export class ModalDirective implements AfterViewInit, OnDestroy, OnChanges {
292298
}
293299
}
294300

301+
private _createFocusTrap() {
302+
if (!this._focusTrap) {
303+
this._focusTrap = this._focusTrapFactory.create(this._element.nativeElement);
304+
}
305+
}
306+
295307
/** @internal */
296308
protected hideModal(): void {
297309
this._renderer.setAttribute(this._element.nativeElement, 'aria-hidden', 'true');

projects/angular-bootstrap-md/src/lib/free/modals/modal.module.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@ import { PositioningService } from '../utils/positioning/positioning.service';
66
import { ComponentLoaderFactory } from '../utils/component-loader/component-loader.factory';
77
import { ModalContainerComponent } from './modalContainer.component';
88
import { MDBModalService } from './modal.service';
9+
import { A11yModule } from '@angular/cdk/a11y';
910

1011
@NgModule({
1112
declarations: [ModalBackdropComponent, ModalDirective, ModalContainerComponent],
13+
imports: [A11yModule],
1214
exports: [ModalBackdropComponent, ModalDirective],
1315
entryComponents: [ModalBackdropComponent, ModalContainerComponent],
1416
schemas: [NO_ERRORS_SCHEMA],
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1-
<div [class]="'modal-dialog' + (config.class ? ' ' + config.class : '')" role="document">
1+
<div
2+
[class]="'modal-dialog' + (config.class ? ' ' + config.class : '')"
3+
role="document"
4+
cdkTrapFocus
5+
>
26
<div class="modal-content modal-dynamic"><ng-content></ng-content></div>
37
</div>

0 commit comments

Comments
 (0)