Skip to content

Commit ed6a9d6

Browse files
committed
Release 8.8.0
1 parent e73e80e commit ed6a9d6

File tree

14 files changed

+321
-180
lines changed

14 files changed

+321
-180
lines changed

angular-bootstrap-md-8.7.0.tgz

-2.56 MB
Binary file not shown.

angular-bootstrap-md-8.8.0.tgz

2.56 MB
Binary file not shown.

changelog

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
8.8.0
2+
In version 8.8.0 we added some fixes and new tree view component. Check what changed below:
3+
4+
**Fixes:**
5+
6+
* Sticky header - resolved problem with navbar z-index,
7+
* Table search/Table editor - resolved problem with filtering when a property value is null,
8+
* Datepicker - resolved problem with setting minYear and maxYear options,
9+
* Select - clear button will no longer be displayed if no option is selected,
10+
* Timepicker - component view will be now updated correctly on form control value change,
11+
* Color picker plugin - resolved problem with displaying wrong rgba color on component initialization,
12+
* Resolved problem with memory leaks caused by unsubscribed subscriptions.
13+
14+
**New Features:**
15+
16+
* Added new tree view component.
17+
118
8.7.0
219
In version 8.7.0 we added some fixes and new features. Check what changed below:
320

package-lock.json

Lines changed: 135 additions & 93 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": "8.7.0",
3+
"version": "8.8.0",
44
"scripts": {
55
"ng": "ng",
66
"start": "ng serve",
@@ -29,7 +29,7 @@
2929
"@angular/router": "~8.0.0",
3030
"@fortawesome/fontawesome-free": "^5.6.3",
3131
"@types/chart.js": "^2.7.42",
32-
"angular-bootstrap-md": "file:angular-bootstrap-md-8.7.0.tgz",
32+
"angular-bootstrap-md": "file:angular-bootstrap-md-8.8.0.tgz",
3333
"chart.js": "^2.5.0",
3434
"core-js": "^2.5.4",
3535
"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": "8.7.0",
4+
"version": "8.8.0",
55
"schematics": "./schematics/collection.json",
66
"files": [
77
"**/*"

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

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
8.8.0
2+
In version 8.8.0 we added some fixes and new tree view component. Check what changed below:
3+
4+
**Fixes:**
5+
6+
* Sticky header - resolved problem with navbar z-index,
7+
* Table search/Table editor - resolved problem with filtering when a property value is null,
8+
* Datepicker - resolved problem with setting minYear and maxYear options,
9+
* Select - clear button will no longer be displayed if no option is selected,
10+
* Timepicker - component view will be now updated correctly on form control value change,
11+
* Color picker plugin - resolved problem with displaying wrong rgba color on component initialization,
12+
* Resolved problem with memory leaks caused by unsubscribed subscriptions.
13+
14+
**New Features:**
15+
16+
* Added new tree view component.
17+
118
8.7.0
219
In version 8.7.0 we added some fixes and new features. Check what changed below:
320

projects/angular-bootstrap-md/src/lib/free/carousel/carousel.component.ts

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ import { SlideComponent } from './slide.component';
2222
import { CarouselConfig } from './carousel.config';
2323
import { isPlatformBrowser } from '@angular/common';
2424
import { LEFT_ARROW, RIGHT_ARROW } from '../utils/keyboard-navigation';
25+
import { takeUntil } from 'rxjs/operators';
26+
import { Subject } from 'rxjs';
2527

2628
export enum Direction {
2729
UNKNOWN,
@@ -47,6 +49,8 @@ export class CarouselComponent implements OnDestroy, AfterViewInit {
4749
return this._slidesList.toArray();
4850
}
4951

52+
private _destroy$: Subject<void> = new Subject();
53+
5054
protected currentInterval: any;
5155
protected isPlaying: boolean;
5256
protected destroyed = false;
@@ -127,16 +131,20 @@ export class CarouselComponent implements OnDestroy, AfterViewInit {
127131

128132
public ngOnDestroy(): void {
129133
this.destroyed = true;
134+
this._destroy$.next();
135+
this._destroy$.complete();
130136
}
131137

132138
ngAfterViewInit() {
133139
this.play();
134-
this._slidesList.changes.subscribe((slidesList: QueryList<SlideComponent>) => {
135-
this._slidesList = slidesList;
136-
setTimeout(() => {
137-
this._select(0);
138-
}, 0);
139-
});
140+
this._slidesList.changes
141+
.pipe(takeUntil(this._destroy$))
142+
.subscribe((slidesList: QueryList<SlideComponent>) => {
143+
this._slidesList = slidesList;
144+
setTimeout(() => {
145+
this._select(0);
146+
}, 0);
147+
});
140148

141149
if (this.activeSlideIndex) {
142150
setTimeout(() => {

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

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
ViewEncapsulation,
1414
ChangeDetectorRef,
1515
} from '@angular/core';
16-
import { Subscription } from 'rxjs';
16+
import { Subscription, Subject } from 'rxjs';
1717

1818
import { ComponentLoader } from '../utils/component-loader/component-loader.class';
1919
import { ComponentLoaderFactory } from '../utils/component-loader/component-loader.factory';
@@ -23,6 +23,7 @@ import { BsDropdownState } from './dropdown.state';
2323
import { BsComponentRef } from '../utils/component-loader/bs-component-ref.class';
2424
import { BsDropdownMenuDirective } from './dropdown-menu.directive';
2525
import { isBs3 } from '../utils/ng2-bootstrap-config';
26+
import { takeUntil } from 'rxjs/operators';
2627

2728
@Component({
2829
// tslint:disable-next-line:component-selector
@@ -136,6 +137,8 @@ export class BsDropdownDirective implements OnInit, OnDestroy {
136137
@Output() onHidden: EventEmitter<any>;
137138
@Output() hidden: EventEmitter<any>;
138139

140+
private _destroy$: Subject<void> = new Subject();
141+
139142
get isBs4(): boolean {
140143
return !isBs3();
141144
}
@@ -196,18 +199,16 @@ export class BsDropdownDirective implements OnInit, OnDestroy {
196199
});
197200

198201
// toggle visibility on toggle element click
199-
this._subscriptions.push(
200-
this._state.toggleClick.subscribe((value: boolean) => this.toggle(value))
201-
);
202+
this._state.toggleClick
203+
.pipe(takeUntil(this._destroy$))
204+
.subscribe((value: boolean) => this.toggle(value));
202205

203206
// hide dropdown if set disabled while opened
204-
this._subscriptions.push(
205-
this._state.isDisabledChange.subscribe((element: any) => {
206-
if (element === true) {
207-
this.hide();
208-
}
209-
})
210-
);
207+
this._state.isDisabledChange.pipe(takeUntil(this._destroy$)).subscribe((element: any) => {
208+
if (element === true) {
209+
this.hide();
210+
}
211+
});
211212

212213
// attach dropdown menu inside of dropdown
213214
if (this._showInline) {
@@ -216,7 +217,7 @@ export class BsDropdownDirective implements OnInit, OnDestroy {
216217
});
217218
}
218219

219-
this._state.isOpenChange.subscribe(() => {
220+
this._state.isOpenChange.pipe(takeUntil(this._destroy$)).subscribe(() => {
220221
setTimeout(() => {
221222
const dropdownContainer = this._elementRef.nativeElement.querySelector('.dropdown-menu');
222223
const left = dropdownContainer.getBoundingClientRect().left;
@@ -378,9 +379,8 @@ export class BsDropdownDirective implements OnInit, OnDestroy {
378379

379380
ngOnDestroy(): void {
380381
// clean up subscriptions and destroy dropdown
381-
for (const sub of this._subscriptions) {
382-
sub.unsubscribe();
383-
}
382+
this._destroy$.next();
383+
this._destroy$.complete();
384384
this._dropdown.dispose();
385385
}
386386
}

projects/angular-bootstrap-md/src/lib/free/navbars/navbar.component.ts

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,12 @@ import {
1515
ChangeDetectionStrategy,
1616
Inject,
1717
NgZone,
18+
OnDestroy,
1819
} from '@angular/core';
19-
import { Subscription, fromEvent } from 'rxjs';
20+
import { fromEvent, Subject } from 'rxjs';
2021
import { LinksComponent } from './links.component';
2122
import { DOCUMENT } from '@angular/common';
23+
import { takeUntil } from 'rxjs/operators';
2224

2325
@Component({
2426
selector: 'mdb-navbar',
@@ -27,15 +29,16 @@ import { DOCUMENT } from '@angular/common';
2729
encapsulation: ViewEncapsulation.None,
2830
changeDetection: ChangeDetectionStrategy.OnPush,
2931
})
30-
export class NavbarComponent implements AfterViewInit, OnInit, AfterContentChecked {
32+
export class NavbarComponent implements AfterViewInit, OnInit, AfterContentChecked, OnDestroy {
3133
@Input() iconBackground: string | string[];
3234
@Input() SideClass: string;
3335
@Input() containerInside = true;
3436
@Input() collapseId = 'navbarCollapse';
3537
@Input() scrollSensitivity = 120;
3638
@Input() scrollableNavbar = false;
3739

38-
subscription: Subscription;
40+
private _destroy$: Subject<void> = new Subject();
41+
3942
navbarLinkClicks: any;
4043
shown = false;
4144

@@ -65,10 +68,12 @@ export class NavbarComponent implements AfterViewInit, OnInit, AfterContentCheck
6568
private _ngZone: NgZone,
6669
@Inject(DOCUMENT) private _document: any
6770
) {
68-
// tslint:disable-next-line:max-line-length
69-
this.subscription = this._navbarService.getNavbarLinkClicks().subscribe(navbarLinkClicks => {
70-
this.closeNavbarOnClick(navbarLinkClicks);
71-
});
71+
this._navbarService
72+
.getNavbarLinkClicks()
73+
.pipe(takeUntil(this._destroy$))
74+
.subscribe(navbarLinkClicks => {
75+
this.closeNavbarOnClick(navbarLinkClicks);
76+
});
7277
}
7378

7479
closeNavbarOnClick(navbarLinkClicks: any) {
@@ -92,13 +97,15 @@ export class NavbarComponent implements AfterViewInit, OnInit, AfterContentCheck
9297

9398
private _listenToScroll() {
9499
this._ngZone.runOutsideAngular(() => {
95-
fromEvent(this._document, 'scroll').subscribe(() => {
96-
if (window.pageYOffset > this.scrollSensitivity) {
97-
this.renderer.addClass(this.navbar.nativeElement, 'top-nav-collapse');
98-
} else {
99-
this.renderer.removeClass(this.navbar.nativeElement, 'top-nav-collapse');
100-
}
101-
});
100+
fromEvent(this._document, 'scroll')
101+
.pipe(takeUntil(this._destroy$))
102+
.subscribe(() => {
103+
if (window.pageYOffset > this.scrollSensitivity) {
104+
this.renderer.addClass(this.navbar.nativeElement, 'top-nav-collapse');
105+
} else {
106+
this.renderer.removeClass(this.navbar.nativeElement, 'top-nav-collapse');
107+
}
108+
});
102109
});
103110
}
104111

@@ -236,4 +243,9 @@ export class NavbarComponent implements AfterViewInit, OnInit, AfterContentCheck
236243
}
237244
this._cdRef.markForCheck();
238245
}
246+
247+
ngOnDestroy() {
248+
this._destroy$.next();
249+
this._destroy$.complete();
250+
}
239251
}

0 commit comments

Comments
 (0)