Skip to content

Commit

Permalink
refactor(stark-ui): remove 'StarkComponentUtil.isInputEnabled' in fav…
Browse files Browse the repository at this point in the history
…or of Angular CDK function 'coerceBooleanProperty'

ISSUES CLOSED: NationalBankBelgium#1190

BREAKING CHANGE: `StarkComponentUtil.isInputEnabled()` function has been removed. To coerce boolean inputs in your components you can use the `coerceBooleanProperty()` function from `@angular/cdk/coercion` instead.
  • Loading branch information
christophercr committed Jun 4, 2019
1 parent 2801685 commit 3889c88
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 47 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ import {
import { AbstractStarkUiComponent } from "../../../common/classes/abstract-component";
import { StarkPaginationComponent, StarkPaginationConfig } from "../../pagination/components";
import { StarkPaginateEvent } from "../../pagination/components/paginate-event.intf";
import { StarkComponentUtil } from "../../../util/component";
import { StarkMinimapComponentMode, StarkMinimapItemProperties } from "../../minimap/components";
import find from "lodash-es/find";

Expand Down Expand Up @@ -375,7 +374,7 @@ export class StarkTableComponent extends AbstractStarkUiComponent implements OnI
* Whether the multiple row selection is enabled.
*/
public get isMultiSelectEnabled(): boolean {
return StarkComponentUtil.isInputEnabled(this.multiSelect);
return coerceBooleanProperty(this.multiSelect);
}

/**
Expand Down Expand Up @@ -496,11 +495,11 @@ export class StarkTableComponent extends AbstractStarkUiComponent implements OnI
}

if (changes["fixedHeader"]) {
this.isFixedHeaderEnabled = StarkComponentUtil.isInputEnabled(this.fixedHeader);
this.isFixedHeaderEnabled = coerceBooleanProperty(this.fixedHeader);
}

if (changes["multiSort"]) {
this.isMultiSortEnabled = StarkComponentUtil.isInputEnabled(this.multiSort);
this.isMultiSortEnabled = coerceBooleanProperty(this.multiSort);
}

if (changes["rowsSelectable"]) {
Expand Down
1 change: 0 additions & 1 deletion packages/stark-ui/src/util.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
export * from "./util/component";
export * from "./util/dom";
export * from "./util/form";
1 change: 0 additions & 1 deletion packages/stark-ui/src/util/component.ts

This file was deleted.

29 changes: 0 additions & 29 deletions packages/stark-ui/src/util/component/component.util.spec.ts

This file was deleted.

12 changes: 0 additions & 12 deletions packages/stark-ui/src/util/component/component.util.ts

This file was deleted.

0 comments on commit 3889c88

Please sign in to comment.