Skip to content

Commit 7c6d9e9

Browse files
committed
chore: sync with v4.5.25
1 parent 3454d4f commit 7c6d9e9

File tree

14 files changed

+114
-23
lines changed

14 files changed

+114
-23
lines changed

projects/coreui-angular/src/lib/breadcrumb/breadcrumb-item/breadcrumb-item.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { Component, HostBinding, Input } from '@angular/core';
2-
import { CommonModule, NgIf, NgTemplateOutlet } from '@angular/common';
2+
import { NgIf, NgTemplateOutlet } from '@angular/common';
33
import { RouterModule } from '@angular/router';
44

5-
import { HtmlAttributesDirective, SharedModule } from '../../shared';
5+
import { HtmlAttributesDirective } from '../../shared';
66
import { INavAttributes, INavLinkProps } from './breadcrumb-item';
77

88
@Component({

projects/coreui-angular/src/lib/collapse/collapse.directive.spec.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ import { NoopAnimationsModule } from '@angular/platform-browser/animations';
88
class MockElementRef extends ElementRef {}
99

1010
@Component({
11-
template: `
12-
<div cCollapse></div>`
11+
template: `<div cCollapse></div>`
1312
})
1413
class TestComponent {}
1514

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

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { BooleanInput, coerceBooleanProperty } from '@angular/cdk/coercion';
77
})
88
export class FormCheckInputDirective {
99

10+
static ngAcceptInputType_checked: BooleanInput;
1011
static ngAcceptInputType_indeterminate: BooleanInput;
1112

1213
/**
@@ -23,15 +24,21 @@ export class FormCheckInputDirective {
2324
*/
2425
@Input()
2526
set indeterminate(value: boolean) {
26-
const newValue = coerceBooleanProperty(value);
27-
if (this._indeterminate !== newValue) {
28-
this._indeterminate = newValue;
29-
this.renderer.setProperty(this.hostElement.nativeElement, 'indeterminate', newValue);
27+
const indeterminate = coerceBooleanProperty(value);
28+
if (this._indeterminate !== indeterminate) {
29+
this._indeterminate = indeterminate;
30+
const htmlInputElement = this.hostElement.nativeElement as HTMLInputElement;
31+
if (indeterminate) {
32+
this.renderer.setProperty(htmlInputElement, 'checked', false);
33+
}
34+
this.renderer.setProperty(htmlInputElement, 'indeterminate', indeterminate);
3035
}
3136
};
37+
3238
get indeterminate() {
3339
return this._indeterminate;
3440
}
41+
3542
private _indeterminate = false;
3643

3744
/**
@@ -49,6 +56,15 @@ export class FormCheckInputDirective {
4956
};
5057
}
5158

59+
@Input()
60+
set checked(value: boolean) {
61+
const checked = coerceBooleanProperty(value);
62+
const htmlInputElement = this.hostElement?.nativeElement as HTMLInputElement;
63+
if (htmlInputElement) {
64+
this.renderer.setProperty(htmlInputElement, 'checked', checked);
65+
}
66+
}
67+
5268
get checked(): boolean {
5369
return this.hostElement?.nativeElement?.checked;
5470
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export class FormControlDirective implements OnInit {
1919
@Input() sizing?: '' | 'sm' | 'lg' | string = '';
2020
/**
2121
* Set component validation state to valid.
22-
* @type boolean
22+
* @type boolean | undefined
2323
*/
2424
@Input() valid?: boolean;
2525

@@ -57,7 +57,7 @@ export class FormControlDirective implements OnInit {
5757
ngOnInit(): void {
5858
const hostTag = this.hostTag.toLowerCase();
5959
if (hostTag !== 'input' && hostTag !== 'textarea') {
60-
console.warn(`CoreUI [cFormControl] works with '<input>' and '<texarea>' - not with '<${hostTag}>'`);
60+
console.warn(`CoreUI [cFormControl] works with '<input>' and '<textarea>' - not with '<${hostTag}>'`);
6161
}
6262
}
6363

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ import { By } from '@angular/platform-browser';
66
class MockElementRef extends ElementRef {}
77

88
@Component({
9-
template: `
10-
<li cListGroupItem></li>`
9+
template: `<li cListGroupItem></li>`
1110
})
1211
class TestComponent {}
1312

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { CollapseDirective } from '../collapse';
66
import { Colors } from '../coreui.types';
77

88
// todo: fix container prop issue not rendering children
9-
// todo: workaroud - use <c-container> component directly in template
9+
// todo: workaround - use <c-container> component directly in template
1010

1111
@Component({
1212
selector: 'c-navbar',

projects/coreui-angular/src/lib/pagination/page-item/page-item.directive.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ import {
66
HostBinding,
77
Input,
88
OnChanges,
9-
Renderer2, SimpleChanges
9+
Renderer2,
10+
SimpleChanges
1011
} from '@angular/core';
1112

1213
import { PageLinkDirective } from '../page-link/page-link.directive';

projects/coreui-angular/src/lib/services/class-toggle.service.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ export class ClassToggleService {
1919
const element = document.querySelector(selector);
2020
if (element) {
2121
element.classList.contains(className) ?
22-
this.renderer.removeClass(element, className) :
23-
this.renderer.addClass(element, className);
22+
this.renderer.removeClass(element, className) :
23+
this.renderer.addClass(element, className);
2424
}
2525
}
2626
}

projects/coreui-angular/src/lib/shared/html-attr.directive.spec.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ import { By } from '@angular/platform-browser';
55
import { HtmlAttributesDirective } from './html-attr.directive';
66

77
@Component({
8-
template: `
9-
<div [cHtmlAttr]="{class: 'test', style: {backgroundColor: 'red'}, id: 'id-1'}"></div>`
8+
template: `<div [cHtmlAttr]="{class: 'test', style: {backgroundColor: 'red'}, id: 'id-1'}"></div>`
109
})
1110
class TestComponent {}
1211

projects/coreui-angular/src/lib/shared/shared.module.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import { TemplateIdDirective } from './template-id.directive';
1212
HtmlAttributesDirective,
1313
TemplateIdDirective
1414
],
15-
providers: []
1615
})
1716
export class SharedModule {
1817

0 commit comments

Comments
 (0)