Skip to content

Commit

Permalink
fix(): type 'string' is not assignable to type 'boolean' in Inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
Enlcxx committed Jan 6, 2024
1 parent 0cb996a commit cdd5569
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/lib/checkbox/checkbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ export class LyCheckbox extends LyCheckboxMixinBase implements WithStyles,
*/
@Input()
get checked(): boolean { return this._checked; }
set checked(val: boolean) {
set checked(val: BooleanInput) {
const newVal = coerceBooleanProperty(val);
if (newVal !== this.checked) {
this._checked = newVal;
Expand Down Expand Up @@ -332,7 +332,7 @@ export class LyCheckbox extends LyCheckboxMixinBase implements WithStyles,
get disabled() {
return this._disabled;
}
set disabled(val: boolean) {
set disabled(val: BooleanInput) {
const newVal = coerceBooleanProperty(val);
if (newVal !== this.disabled) {
this._disabled = newVal;
Expand Down
18 changes: 9 additions & 9 deletions src/lib/typography/typography.directive.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { Directive, ElementRef, Renderer2, Input, OnInit, OnChanges } from '@angular/core';
import { LyTheme2,
toBoolean,
ThemeVariables,
mixinStyleUpdater,
mixinColor,
StyleCollection,
StyleTemplate,
lyl,
StyleRenderer} from '@alyle/ui';
import { BooleanInput, coerceBooleanProperty } from '@angular/cdk/coercion';

export interface LyTypographyTheme {
/** Styles for Typography Component */
Expand Down Expand Up @@ -107,8 +107,8 @@ export class LyTypography extends LyTypographyMixinBase implements OnInit, OnCha

/** The text will truncate with an ellipsis. */
@Input()
set noWrap(val: boolean) {
const newValue = toBoolean(val);
set noWrap(val: BooleanInput) {
const newValue = coerceBooleanProperty(val);
if (newValue) {
this._noWrapClass = this._theme.addSimpleStyle('lyTyp.noWrap', {
overflow: 'hidden',
Expand All @@ -126,8 +126,8 @@ export class LyTypography extends LyTypographyMixinBase implements OnInit, OnCha
}

@Input()
set gutter(val: boolean) {
const newVal = toBoolean(val);
set gutter(val: BooleanInput) {
const newVal = coerceBooleanProperty(val);
if (newVal !== this.gutter) {
this._gutter = newVal;
this.sRenderer.toggleClass(this.classes.gutter, newVal);
Expand All @@ -138,8 +138,8 @@ export class LyTypography extends LyTypographyMixinBase implements OnInit, OnCha
}

@Input()
set gutterTop(val: boolean) {
const newVal = toBoolean(val);
set gutterTop(val: BooleanInput) {
const newVal = coerceBooleanProperty(val);
if (newVal !== this.gutterTop) {
this._gutterTop = newVal;
this.sRenderer.toggleClass(this.classes.gutterTop, newVal);
Expand All @@ -150,8 +150,8 @@ export class LyTypography extends LyTypographyMixinBase implements OnInit, OnCha
}

@Input()
set gutterBottom(val: boolean) {
const newVal = toBoolean(val);
set gutterBottom(val: BooleanInput) {
const newVal = coerceBooleanProperty(val);
if (newVal !== this.gutterBottom) {
this._gutterBottom = newVal;
this.sRenderer.toggleClass(this.classes.gutterBottom, newVal);
Expand Down

0 comments on commit cdd5569

Please sign in to comment.