Skip to content

Commit 7e0d1e3

Browse files
leozhang14xelaint
andauthored
style(design): add docs-private-hostbinding-lifecycle linting rule (#3639)
--------- Co-authored-by: xelaint <xelaint@gmail.com>
1 parent ce1c315 commit 7e0d1e3

51 files changed

Lines changed: 361 additions & 2 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

libs/design/.eslintrc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ module.exports = {
4444
style: 'camelCase'
4545
}
4646
],
47+
'custom-rules/docs-private-hostbinding-lifecycle': 'error',
4748
}
4849
},
4950
{

libs/design/breadcrumb/src/breadcrumb/breadcrumb.component.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ export class DaffBreadcrumbComponent implements AfterContentInit {
4747
*/
4848
@ContentChildren(DaffBreadcrumbItemDirective) breadcrumbItems!: QueryList<DaffBreadcrumbItemDirective>;
4949

50+
/**
51+
* @docs-private
52+
*/
5053
ngAfterContentInit() {
5154
this.updateActiveState();
5255

libs/design/card/src/card/basic/basic.component.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,8 @@ import { DaffCardBaseDirective } from '../../card-base.directive';
1818
})
1919

2020
export class DaffCardComponent extends DaffCardBaseDirective {
21+
/**
22+
* @docs-private
23+
*/
2124
@HostBinding('class.daff-card') class = true;
2225
}

libs/design/card/src/card/raised/raised.component.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,8 @@ import { DaffCardBaseDirective } from '../../card-base.directive';
1818
})
1919

2020
export class DaffRaisedCardComponent extends DaffCardBaseDirective {
21+
/**
22+
* @docs-private
23+
*/
2124
@HostBinding('class.daff-raised-card') class = true;
2225
}

libs/design/card/src/card/stroked/stroked.component.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,8 @@ import { DaffCardBaseDirective } from '../../card-base.directive';
1818
})
1919

2020
export class DaffStrokedCardComponent extends DaffCardBaseDirective {
21+
/**
22+
* @docs-private
23+
*/
2124
@HostBinding('class.daff-stroked-card') class = true;
2225
}

libs/design/checkbox/examples/src/basic-checkbox/basic-checkbox.component.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ import { DaffButtonComponent } from '@daffodil/design/button';
2525
export class BasicCheckboxComponent implements OnInit {
2626
checkboxExample = new UntypedFormControl();
2727

28+
/**
29+
* @docs-private
30+
*/
2831
ngOnInit() {
2932
this.checkboxExample.setValue(true);
3033
}

libs/design/checkbox/examples/src/checkbox-set/checkbox-set.component.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ export class CheckboxSetComponent implements OnInit {
3434
checkboxArray = new UntypedFormArray([new UntypedFormControl(), new UntypedFormControl(), new UntypedFormControl()]);
3535
selectedValues = [];
3636

37+
/**
38+
* @docs-private
39+
*/
3740
ngOnInit() {
3841
this.checkboxArray.setValue([false, false, false]);
3942
}

libs/design/menu/src/menu-activator/menu-activator.component.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ export class DaffMenuActivatorDirective implements OnDestroy {
2525
private _destroyed$ = new Subject<boolean>();
2626
private _open: boolean;
2727

28+
/**
29+
* @docs-private
30+
*/
2831
@HostBinding('class.open') get openClass() {
2932
return this._open;
3033
}

libs/design/menu/src/menu/menu.component.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,17 @@ import { DaffMenuService } from '../services/menu.service';
3131
],
3232
})
3333
export class DaffMenuComponent implements AfterContentInit, AfterViewInit {
34+
/**
35+
* @docs-private
36+
*/
3437
@HostBinding('class.daff-menu') class = true;
38+
/**
39+
* @docs-private
40+
*/
3541
@HostBinding('tabindex') tabindex = 0;
42+
/**
43+
* @docs-private
44+
*/
3645
@HostBinding('attr.role') role = 'menu';
3746

3847
private _focusTrap: ConfigurableFocusTrap;
@@ -62,12 +71,18 @@ export class DaffMenuComponent implements AfterContentInit, AfterViewInit {
6271
});
6372
}
6473

74+
/**
75+
* @docs-private
76+
*/
6577
ngAfterContentInit() {
6678
this._focusTrap = this._focusTrapFactory.create(
6779
this._elementRef.nativeElement,
6880
);
6981
}
7082

83+
/**
84+
* @docs-private
85+
*/
7186
ngAfterViewInit() {
7287
const focusableChild = (<HTMLElement>this._elementRef.nativeElement.querySelector(
7388
daffFocusableElementsSelector)

libs/design/modal/src/modal-actions/modal-actions.component.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,8 @@ import {
1111
standalone: true,
1212
})
1313
export class DaffModalActionsComponent {
14+
/**
15+
* @docs-private
16+
*/
1417
@HostBinding('class.daff-modal-actions') class = true;
1518
}

0 commit comments

Comments
 (0)