Skip to content

Commit 9121285

Browse files
committed
Release 1.1.0
1 parent e54853f commit 9121285

20 files changed

+298
-36
lines changed

CHANGELOG.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,27 @@
1+
## 1.1.0 (06.09.2021)
2+
3+
### Fixes and improvements:
4+
5+
- Table pagination - resolved problem with disabled state of next button,
6+
- Input - resolved problem with disabled state updates using Angular form control methods,
7+
- Table - resolved problem with default filter function,
8+
- Datepicker - resolved problem with disabled state of toggle button,
9+
- Timepicker - resolved problem with setting default value in component with 24h format,
10+
- Sidenav - resolved problem with `Cannot read property destroy of undefined` error,
11+
- Select - resolved problem with disabled state of checkboxes in options,
12+
- Select - resolved problem with closing modal on clear button click,
13+
- Dropdown - menu will be now closed correctly on item click.
14+
15+
### New components:
16+
17+
- [Theming](https://mdbootstrap.com/docs/b5/angular/content-styles/theme)
18+
19+
### New features:
20+
21+
- Table pagination - added new `rowsPerPageText` input that allow to change default 'Rows per page' text
22+
23+
---
24+
125
## 1.0.0 (09.08.2021)
226

327
In this version we introduced some breaking changes, please check `Breaking changes` section and update your application accordingly.

README.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MDB 5 Angular
22

3-
Version: FREE 1.0.0
3+
Version: FREE 1.1.0
44

55
Documentation:
66
https://mdbootstrap.com/docs/b5/angular/

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mdb-angular-ui-kit-free",
3-
"version": "1.0.0",
3+
"version": "1.1.0",
44
"scripts": {
55
"ng": "ng",
66
"start": "ng serve",

projects/mdb-angular-ui-kit/CHANGELOG.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,27 @@
1+
## 1.1.0 (06.09.2021)
2+
3+
### Fixes and improvements:
4+
5+
- Table pagination - resolved problem with disabled state of next button,
6+
- Input - resolved problem with disabled state updates using Angular form control methods,
7+
- Table - resolved problem with default filter function,
8+
- Datepicker - resolved problem with disabled state of toggle button,
9+
- Timepicker - resolved problem with setting default value in component with 24h format,
10+
- Sidenav - resolved problem with `Cannot read property destroy of undefined` error,
11+
- Select - resolved problem with disabled state of checkboxes in options,
12+
- Select - resolved problem with closing modal on clear button click,
13+
- Dropdown - menu will be now closed correctly on item click.
14+
15+
### New components:
16+
17+
- [Theming](https://mdbootstrap.com/docs/b5/angular/content-styles/theme)
18+
19+
### New features:
20+
21+
- Table pagination - added new `rowsPerPageText` input that allow to change default 'Rows per page' text
22+
23+
---
24+
125
## 1.0.0 (09.08.2021)
226

327
In this version we introduced some breaking changes, please check `Breaking changes` section and update your application accordingly.

projects/mdb-angular-ui-kit/accordion/accordion.component.ts

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
import { startWith, switchMap } from 'rxjs/operators';
1111
import { merge } from 'rxjs';
1212
import { MdbAccordionItemComponent } from './accordion-item.component';
13+
import { BooleanInput, coerceBooleanProperty } from '@angular/cdk/coercion';
1314

1415
@Component({
1516
selector: 'mdb-accordion',
@@ -19,8 +20,23 @@ import { MdbAccordionItemComponent } from './accordion-item.component';
1920
export class MdbAccordionComponent implements AfterContentInit {
2021
@ContentChildren(MdbAccordionItemComponent) items: QueryList<MdbAccordionItemComponent>;
2122

22-
@Input() flush = false;
23-
@Input() multiple = false;
23+
@Input()
24+
get flush(): boolean {
25+
return this._flush;
26+
}
27+
set flush(value: boolean) {
28+
this._flush = coerceBooleanProperty(value);
29+
}
30+
private _flush = false;
31+
32+
@Input()
33+
get multiple(): boolean {
34+
return this._multiple;
35+
}
36+
set multiple(value: boolean) {
37+
this._multiple = coerceBooleanProperty(value);
38+
}
39+
private _multiple = false;
2440

2541
@HostBinding('class.accordion') accordion = true;
2642
@HostBinding('class.accordion-flush')
@@ -52,4 +68,7 @@ export class MdbAccordionComponent implements AfterContentInit {
5268
itemsToClose.forEach((item: MdbAccordionItemComponent) => item.hide());
5369
}
5470
}
71+
72+
static ngAcceptInputType_flush: BooleanInput;
73+
static ngAcceptInputType_multiple: BooleanInput;
5574
}

projects/mdb-angular-ui-kit/carousel/carousel.component.ts

Lines changed: 42 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { BooleanInput, coerceBooleanProperty } from '@angular/cdk/coercion';
12
import {
23
AfterViewInit,
34
ChangeDetectionStrategy,
@@ -34,10 +35,42 @@ export class MdbCarouselComponent implements AfterViewInit, OnDestroy {
3435
}
3536

3637
@Input() animation: 'slide' | 'fade' = 'slide';
37-
@Input() controls = false;
38-
@Input() dark = false;
39-
@Input() indicators = false;
40-
@Input() ride = true;
38+
39+
@Input()
40+
get controls(): boolean {
41+
return this._controls;
42+
}
43+
set controls(value: boolean) {
44+
this._controls = coerceBooleanProperty(value);
45+
}
46+
private _controls = false;
47+
48+
@Input()
49+
get dark(): boolean {
50+
return this._dark;
51+
}
52+
set dark(value: boolean) {
53+
this._dark = coerceBooleanProperty(value);
54+
}
55+
private _dark = false;
56+
57+
@Input()
58+
get indicators(): boolean {
59+
return this._indicators;
60+
}
61+
set indicators(value: boolean) {
62+
this._indicators = coerceBooleanProperty(value);
63+
}
64+
private _indicators = false;
65+
66+
@Input()
67+
get ride(): boolean {
68+
return this._ride;
69+
}
70+
set ride(value: boolean) {
71+
this._ride = coerceBooleanProperty(value);
72+
}
73+
private _ride = true;
4174

4275
@Input()
4376
get interval(): number {
@@ -352,4 +385,9 @@ export class MdbCarouselComponent implements AfterViewInit, OnDestroy {
352385
return this._activeSlide;
353386
}
354387
}
388+
389+
static ngAcceptInputType_controls: BooleanInput;
390+
static ngAcceptInputType_dark: BooleanInput;
391+
static ngAcceptInputType_indicators: BooleanInput;
392+
static ngAcceptInputType_ride: BooleanInput;
355393
}

projects/mdb-angular-ui-kit/checkbox/checkbox.directive.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { BooleanInput, coerceBooleanProperty } from '@angular/cdk/coercion';
12
import {
23
EventEmitter,
34
forwardRef,
@@ -32,7 +33,7 @@ export class MdbCheckboxDirective {
3233
return this._checked;
3334
}
3435
set checked(value: boolean) {
35-
this._checked = value;
36+
this._checked = coerceBooleanProperty(value);
3637
}
3738
private _checked = false;
3839

@@ -50,7 +51,7 @@ export class MdbCheckboxDirective {
5051
return this._disabled;
5152
}
5253
set disabled(value: boolean) {
53-
this._disabled = value;
54+
this._disabled = coerceBooleanProperty(value);
5455
}
5556
private _disabled = false;
5657

@@ -118,4 +119,7 @@ export class MdbCheckboxDirective {
118119
setDisabledState(isDisabled: boolean): void {
119120
this.disabled = isDisabled;
120121
}
122+
123+
static ngAcceptInputType_checked: BooleanInput;
124+
static ngAcceptInputType_disabled: BooleanInput;
121125
}

projects/mdb-angular-ui-kit/collapse/collapse.module.ts

100644100755
File mode changed.

projects/mdb-angular-ui-kit/collapse/index.ts

100644100755
File mode changed.

projects/mdb-angular-ui-kit/dropdown/dropdown.directive.ts

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import { MdbDropdownToggleDirective } from './dropdown-toggle.directive';
2828
import { MdbDropdownMenuDirective } from './dropdown-menu.directive';
2929
import { animate, state, style, transition, trigger, AnimationEvent } from '@angular/animations';
3030
import { BreakpointObserver } from '@angular/cdk/layout';
31+
import { BooleanInput, coerceBooleanProperty } from '@angular/cdk/coercion';
3132

3233
@Component({
3334
// eslint-disable-next-line @angular-eslint/component-selector
@@ -49,7 +50,15 @@ export class MdbDropdownDirective implements OnDestroy, AfterContentInit {
4950
@ContentChild(MdbDropdownToggleDirective, { read: ElementRef }) _dropdownToggle: ElementRef;
5051
@ContentChild(MdbDropdownMenuDirective, { read: ElementRef }) _dropdownMenu: ElementRef;
5152

52-
@Input() animation = true;
53+
@Input()
54+
get animation(): boolean {
55+
return this._animation;
56+
}
57+
set animation(value: boolean) {
58+
this._animation = coerceBooleanProperty(value);
59+
}
60+
private _animation = true;
61+
5362
@Input() offset = 0;
5463

5564
@Output() dropdownShow: EventEmitter<MdbDropdownDirective> = new EventEmitter();
@@ -230,11 +239,11 @@ export class MdbDropdownDirective implements OnDestroy, AfterContentInit {
230239
return fromEvent(document, 'click').pipe(
231240
filter((event: MouseEvent) => {
232241
const target = event.target as HTMLElement;
242+
const isInsideMenu = this._dropdownMenu.nativeElement.contains(target);
233243
const notTogglerIcon = !this._dropdownToggle.nativeElement.contains(target);
244+
const notCustomContent = !isInsideMenu || (target.classList && target.classList.contains('dropdown-item'));
234245
const notOrigin = target !== origin;
235-
const notValue = !this._dropdownMenu.nativeElement.contains(target);
236-
const notOverlay = !!overlayRef && overlayRef.overlayElement.contains(target) === false;
237-
return notOrigin && notValue && notOverlay && notTogglerIcon;
246+
return notOrigin && notTogglerIcon && notCustomContent;
238247
}),
239248
takeUntil(overlayRef.detachments())
240249
);
@@ -329,4 +338,6 @@ export class MdbDropdownDirective implements OnDestroy, AfterContentInit {
329338
this.show();
330339
}
331340
}
341+
342+
static ngAcceptInputType_animation: BooleanInput;
332343
}

projects/mdb-angular-ui-kit/forms/input.directive.ts

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
1+
import { BooleanInput, coerceBooleanProperty } from '@angular/cdk/coercion';
12
import {
23
Directive,
34
DoCheck,
45
ElementRef,
56
HostBinding,
67
HostListener,
78
Input,
9+
Optional,
810
Renderer2,
11+
Self,
912
} from '@angular/core';
13+
import { NgControl } from '@angular/forms';
1014
import { Subject } from 'rxjs';
1115
import { MdbAbstractFormControl } from './form-control';
1216

@@ -18,7 +22,11 @@ import { MdbAbstractFormControl } from './form-control';
1822
})
1923
// eslint-disable-next-line @angular-eslint/component-class-suffix
2024
export class MdbInputDirective implements MdbAbstractFormControl<any>, DoCheck {
21-
constructor(private _elementRef: ElementRef, private _renderer: Renderer2) {}
25+
constructor(
26+
private _elementRef: ElementRef,
27+
private _renderer: Renderer2,
28+
@Optional() @Self() private _ngControl: NgControl
29+
) {}
2230

2331
readonly stateChanges: Subject<void> = new Subject<void>();
2432

@@ -29,10 +37,13 @@ export class MdbInputDirective implements MdbAbstractFormControl<any>, DoCheck {
2937
@HostBinding('disabled')
3038
@Input('disabled')
3139
get disabled(): boolean {
40+
if (this._ngControl && this._ngControl.disabled !== null) {
41+
return this._ngControl.disabled;
42+
}
3243
return this._disabled;
3344
}
3445
set disabled(value: boolean) {
35-
this._disabled = value;
46+
this._disabled = coerceBooleanProperty(value);
3647
}
3748
private _disabled = false;
3849

@@ -46,7 +57,7 @@ export class MdbInputDirective implements MdbAbstractFormControl<any>, DoCheck {
4657
} else {
4758
this._renderer.removeAttribute(this._elementRef.nativeElement, 'readonly');
4859
}
49-
this._readonly = value;
60+
this._readonly = coerceBooleanProperty(value);
5061
}
5162
private _readonly = false;
5263

@@ -99,4 +110,7 @@ export class MdbInputDirective implements MdbAbstractFormControl<any>, DoCheck {
99110
get labelActive(): boolean {
100111
return this.focused || this.hasValue;
101112
}
113+
114+
static ngAcceptInputType_disabled: BooleanInput;
115+
static ngAcceptInputType_readonly: BooleanInput;
102116
}

projects/mdb-angular-ui-kit/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"repository": "https://github.com/mdbootstrap/mdb-angular-ui-kit",
44
"author": "MDBootstrap",
55
"license": "MIT",
6-
"version": "1.0.0",
6+
"version": "1.1.0",
77
"peerDependencies": {
88
"@angular/common": "^12.0.0",
99
"@angular/core": "^12.0.0",

projects/mdb-angular-ui-kit/popover/popover.directive.ts

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import { ComponentPortal, TemplatePortal } from '@angular/cdk/portal';
2121
import { MdbPopoverComponent } from './popover.component';
2222
import { fromEvent, Subject } from 'rxjs';
2323
import { first, takeUntil } from 'rxjs/operators';
24+
import { BooleanInput, coerceBooleanProperty } from '@angular/cdk/coercion';
2425

2526
@Directive({
2627
// eslint-disable-next-line @angular-eslint/directive-selector
@@ -31,10 +32,28 @@ import { first, takeUntil } from 'rxjs/operators';
3132
export class MdbPopoverDirective implements OnInit, OnDestroy {
3233
@Input() mdbPopover = '';
3334
@Input() mdbPopoverTitle = '';
34-
@Input() popoverDisabled = false;
35+
36+
@Input()
37+
get popoverDisabled(): boolean {
38+
return this._popoverDisabled;
39+
}
40+
set popoverDisabled(value: boolean) {
41+
this._popoverDisabled = coerceBooleanProperty(value);
42+
}
43+
private _popoverDisabled = false;
44+
3545
@Input() placement = 'top';
3646
@Input() template: TemplateRef<any>;
37-
@Input() animation = true;
47+
48+
@Input()
49+
get animation(): boolean {
50+
return this._animation;
51+
}
52+
set animation(value: boolean) {
53+
this._animation = coerceBooleanProperty(value);
54+
}
55+
private _animation = false;
56+
3857
@Input() trigger = 'click';
3958
@Input() delayShow = 0;
4059
@Input() delayHide = 0;
@@ -228,4 +247,7 @@ export class MdbPopoverDirective implements OnInit, OnDestroy {
228247
this.show();
229248
}
230249
}
250+
251+
static ngAcceptInputType_animation: BooleanInput;
252+
static ngAcceptInputType_popoverDisabled: BooleanInput;
231253
}

0 commit comments

Comments
 (0)