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

+2-2
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

+1-2
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

+20-4
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

+2-2
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

+1-2
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

+1-1
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

+2-1
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

+2-2
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

+1-2
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

-1
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

projects/coreui-angular/src/lib/sidebar/sidebar-nav/sidebar-nav-label.component.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Component, Input, OnInit } from '@angular/core';
2-
import { CommonModule, NgClass, NgIf } from '@angular/common';
2+
import { NgClass, NgIf } from '@angular/common';
33

44
import { HtmlAttributesDirective } from '../../shared';
55
import { SidebarNavHelper } from './sidebar-nav.service';

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

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import { booleanAttribute, Directive, ElementRef, HostBinding, Input, OnInit, Renderer2 } from '@angular/core';
22
import { Breakpoints, Colors } from '../coreui.types';
3+
import { ITable } from './table.type';
34

45
@Directive({
5-
selector: '[cTable]',
6+
selector: 'table[cTable]',
67
standalone: true
78
})
8-
export class TableDirective implements OnInit {
9+
export class TableDirective implements ITable, OnInit {
910

1011
constructor(
1112
private renderer: Renderer2,
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
import { Breakpoints, Colors } from '../coreui.types';
2+
3+
export interface ITable {
4+
/**
5+
* Set the vertical alignment.
6+
* @type string
7+
* @values 'bottom' | 'middle' | 'top'
8+
*/
9+
align?: 'bottom' | 'middle' | 'top';
10+
/**
11+
* Sets the border color of the component to one of CoreUI’s themed colors.
12+
* @type Colors
13+
*/
14+
borderColor?: Colors;
15+
/**
16+
* Add borders on all sides of the table and cells.
17+
* @type boolean
18+
*/
19+
bordered?: boolean | string;
20+
/**
21+
* Remove borders on all sides of the table and cells.
22+
* @type boolean
23+
*/
24+
borderless?: boolean | string;
25+
/**
26+
* Put the `<caption>` on the top of the table.
27+
* @values 'top'
28+
*/
29+
caption?: 'top';
30+
/**
31+
* Sets the color context of the component to one of CoreUI’s themed colors.
32+
* @type Colors
33+
*/
34+
color?: Colors;
35+
/**
36+
* Enable a hover state on table rows within table body.
37+
* @type boolean
38+
*/
39+
hover?: boolean | string;
40+
/**
41+
* Make table responsive across all viewports or pick a maximum breakpoint with which to have a responsive table up to.
42+
* @type: {boolean | 'sm' | 'md' | 'lg' | 'xl' | 'xxl'}
43+
*/
44+
responsive?: boolean | Omit<Breakpoints, 'xs'>;
45+
/**
46+
* Make table more compact by cutting all cell `padding` in half.
47+
* @type boolean
48+
*/
49+
small?: boolean | string;
50+
/**
51+
* Add zebra-striping to any table row within the table body`.
52+
* @type boolean
53+
*/
54+
striped?: boolean | string;
55+
attributes?: {[key: string]: any};
56+
}
57+
58+
export interface ITableElementProps {
59+
/**
60+
* Set the vertical alignment.
61+
@type 'bottom' | 'middle' | 'top'
62+
*/
63+
align?: ('bottom' | 'middle' | 'top')
64+
/**
65+
* Sets the color context of the component to one of CoreUI’s themed colors.
66+
* @type Colors
67+
*/
68+
color?: Colors
69+
}
70+
71+
export interface ITableRowCellProps extends ITableElementProps {
72+
/**
73+
* Highlight a table row or cell
74+
@type boolean
75+
*/
76+
active?: boolean
77+
}

projects/coreui-angular/src/lib/tabs/tab-content/tab-content.component.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export class TabContentComponent implements AfterContentChecked, AfterContentIni
5050
private _activeTabPaneIdx = -1;
5151

5252
/**
53-
* Event emited on the active tab pane index change.
53+
* Event emitted on the active tab pane index change.
5454
*/
5555
@Output() activeTabPaneIdxChange: EventEmitter<number> = new EventEmitter<number>();
5656

0 commit comments

Comments
 (0)