Skip to content

Commit f99829d

Browse files
committed
refactor: type hostClasses() as Record<string, boolean>
1 parent 0787927 commit f99829d

26 files changed

+31
-31
lines changed

projects/coreui-angular/src/lib/accordion/accordion-button/accordion-button.directive.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export class AccordionButtonDirective {
2222
return {
2323
'accordion-button': true,
2424
collapsed: this.collapsed()
25-
};
25+
} as Record<string, boolean>;
2626
});
2727

2828
readonly ariaExpanded = computed(() => !this.collapsed());

projects/coreui-angular/src/lib/accordion/accordion/accordion.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ export class AccordionComponent {
2929
this.#accordionService.alwaysOpen = this.alwaysOpen();
3030
});
3131

32-
readonly hostClasses = computed<Record<string, boolean>>(() => ({
32+
readonly hostClasses = computed(() => ({
3333
accordion: true,
3434
'accordion-flush': this.flush()
35-
}));
35+
}) as Record<string, boolean>);
3636
}

projects/coreui-angular/src/lib/button-group/button-group/button-group.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,6 @@ export class ButtonGroupComponent {
3030
'btn-group': !this.vertical(),
3131
'btn-group-vertical': this.vertical(),
3232
[`btn-group-${this.size()}`]: !!this.size()
33-
};
33+
} as Record<string, boolean>;
3434
});
3535
}

projects/coreui-angular/src/lib/form/form-check/form-check.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,6 @@ export class FormCheckComponent {
4949
[`form-switch-${sizing}`]: isSwitch && !!sizing,
5050
'form-check-inline': this.inline(),
5151
'form-check-reverse': this.reverse()
52-
};
52+
} as Record<string, boolean>;
5353
});
5454
}

projects/coreui-angular/src/lib/form/form-feedback/form-feedback.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@ export class FormFeedbackComponent {
2727
// 'valid-tooltip': valid === true && tooltip,
2828
// 'invalid-feedback': valid !== true && !tooltip,
2929
// 'invalid-tooltip': valid !== true && tooltip
30-
};
30+
} as Record<string, boolean>;
3131
});
3232
}

projects/coreui-angular/src/lib/form/form-floating/form-floating.directive.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ export class FormFloatingDirective {
1414
readonly hostClasses = computed(() => {
1515
return {
1616
'form-floating': this.floating()
17-
};
17+
} as Record<string, boolean>;
1818
});
1919
}

projects/coreui-angular/src/lib/form/form-select/form-select.directive.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@ export class FormSelectDirective {
2525
[`form-select-${sizing}`]: !!sizing,
2626
'is-valid': valid === true,
2727
'is-invalid': valid === false
28-
};
28+
} as Record<string, boolean>;
2929
});
3030
}

projects/coreui-angular/src/lib/form/form/form.directive.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ export class FormDirective {
1515
readonly hostClasses = computed(() => {
1616
return {
1717
'was-validated': this.validated()
18-
};
18+
} as Record<string, boolean>;
1919
});
2020
}

projects/coreui-angular/src/lib/list-group/list-group-item.directive.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export class ListGroupItemDirective {
5050
active: !!this.active(),
5151
disabled: this._disabled(),
5252
[`list-group-item-${this.color()}`]: !!this.color()
53-
};
53+
} as Record<string, boolean>;
5454
});
5555

5656
readonly _disabled = computed(() => this.disabled());

projects/coreui-angular/src/lib/modal/modal-dialog/modal-dialog.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,6 @@ export class ModalDialogComponent {
4343
[`modal-fullscreen-${fullscreen}-down`]: typeof fullscreen === 'string',
4444
'modal-dialog-scrollable': this.scrollable(),
4545
[`modal-${size}`]: !!size
46-
};
46+
} as Record<string, boolean>;
4747
});
4848
}

0 commit comments

Comments
 (0)