Skip to content

Commit a40efed

Browse files
committed
refactor: make EffectRef private #
1 parent ae1aa1c commit a40efed

File tree

16 files changed

+50
-50
lines changed

16 files changed

+50
-50
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export class AccordionItemComponent implements OnInit, OnDestroy {
4141

4242
readonly itemVisible = signal(false);
4343

44-
visibleInputChange = effect(() => {
44+
readonly #visibleInputChange = effect(() => {
4545
setTimeout(() => {
4646
this.itemVisible.set(this.visibleInput());
4747
});

projects/coreui-angular/src/lib/button/button-close.directive.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
import { ButtonCloseDirective } from './button-close.directive';
2-
import { ComponentFixture, TestBed } from '@angular/core/testing';
31
import { Component, DebugElement, ElementRef } from '@angular/core';
2+
import { ComponentFixture, TestBed } from '@angular/core/testing';
43
import { By } from '@angular/platform-browser';
4+
import { ButtonCloseDirective } from './button-close.directive';
55

66
class MockElementRef extends ElementRef {}
77

88
@Component({
9-
template: '<button cButtonClose></button>',
10-
imports: [ButtonCloseDirective]
9+
template: '<button cButtonClose></button>',
10+
imports: [ButtonCloseDirective]
1111
})
1212
class TestComponent {}
1313

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ export class ModalComponent implements OnInit, OnDestroy, AfterViewInit {
153153
*/
154154
readonly visibleInput = input(false, { transform: booleanAttribute, alias: 'visible' });
155155

156-
readonly visibleEffect = effect(() => {
156+
readonly #visibleInputEffect = effect(() => {
157157
const visible = this.visibleInput();
158158
untracked(() => {
159159
this.visible = visible;

projects/coreui-angular/src/lib/nav/nav-link.directive.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export class NavLinkDirective {
3939
attrTabindex: '-1' | null = null;
4040
styleCursor: 'pointer' | null = null;
4141

42-
readonly disabledEffect = effect(() => {
42+
readonly #disabledEffect = effect(() => {
4343
const disabled = this.disabled();
4444
this.ariaDisabled = disabled || null;
4545
this.attrDisabled = disabled ? '' : null;

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,19 +48,19 @@ export class PopoverDirective implements OnDestroy, OnInit, AfterViewInit {
4848
*/
4949
readonly content = input<string | TemplateRef<any> | undefined>(undefined, { alias: 'cPopover' });
5050

51-
readonly contentEffect = effect(() => {
51+
readonly #contentEffect = effect(() => {
5252
if (this.content()) {
5353
this.destroyTooltipElement();
5454
}
5555
});
5656

5757
/**
5858
* Optional popper Options object, takes precedence over cPopoverPlacement prop
59-
* @type Partial<Options>
59+
* @return Partial<Options>
6060
*/
6161
readonly popperOptions = input<Partial<Options>>({}, { alias: 'cPopoverOptions' });
6262

63-
readonly popperOptionsEffect = effect(() => {
63+
readonly #popperOptionsEffect = effect(() => {
6464
this._popperOptions = {
6565
...this._popperOptions,
6666
placement: this.placement(),
@@ -100,7 +100,7 @@ export class PopoverDirective implements OnDestroy, OnInit, AfterViewInit {
100100
*/
101101
readonly visible = model(false, { alias: 'cPopoverVisible' });
102102

103-
readonly visibleEffect = effect(() => {
103+
readonly #visibleEffect = effect(() => {
104104
this.visible() ? this.addTooltipElement() : this.removeTooltipElement();
105105
});
106106

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ import {
1414
import { NgClass } from '@angular/common';
1515

1616
@Component({
17-
selector: 'c-popover',
18-
templateUrl: './popover.component.html',
19-
imports: [NgClass],
20-
host: {
21-
class: 'popover fade bs-popover-auto',
22-
'[class]': 'hostClasses()',
23-
'[attr.role]': 'role()',
24-
'[attr.id]': 'id()'
25-
}
17+
selector: 'c-popover',
18+
templateUrl: './popover.component.html',
19+
imports: [NgClass],
20+
host: {
21+
class: 'popover fade bs-popover-auto',
22+
'[class]': 'hostClasses()',
23+
'[attr.role]': 'role()',
24+
'[attr.id]': 'id()'
25+
}
2626
})
2727
export class PopoverComponent implements OnDestroy {
2828
readonly renderer = inject(Renderer2);
@@ -33,7 +33,7 @@ export class PopoverComponent implements OnDestroy {
3333
*/
3434
readonly content = input<string | TemplateRef<any>>('');
3535

36-
readonly contentEffect = effect(() => {
36+
readonly #contentEffect = effect(() => {
3737
this.updateView(this.content());
3838
});
3939

projects/coreui-angular/src/lib/services/color-mode.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export class ColorModeService {
1919
readonly localStorageItemName$ = toObservable(this.localStorageItemName);
2020
readonly colorMode: WritableSignal<ColorMode> = signal(undefined);
2121

22-
readonly colorModeEffect = effect(() => {
22+
readonly #colorModeEffect = effect(() => {
2323
const colorMode = this.colorMode();
2424
if (colorMode) {
2525
const localStorageItemName = this.localStorageItemName();

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export class HtmlAttributesDirective {
1010
readonly #renderer = inject(Renderer2);
1111
readonly #elementRef = inject(ElementRef);
1212

13-
readonly attrEffect = effect(() => {
13+
readonly #attrEffect = effect(() => {
1414
const attribs = this.cHtmlAttr();
1515
for (const attr in attribs) {
1616
if (attr === 'style' && typeof attribs[attr] === 'object') {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ export class SidebarNavGroupComponent implements OnInit, OnDestroy {
194194
SidebarNavLabelComponent,
195195
SidebarNavTitleComponent,
196196
SidebarNavDividerComponent,
197-
SidebarNavGroupComponent,
197+
forwardRef(() => SidebarNavGroupComponent),
198198
SidebarNavItemClassPipe,
199199
RouterModule
200200
]

projects/coreui-angular/src/lib/tabs-2/tabs-list/tabs-list.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export class TabsListComponent {
5959
readonly tabs = contentChildren(TabDirective);
6060
#focusKeyManager!: FocusKeyManager<TabDirective>;
6161

62-
readonly tabsEffect = effect(() => {
62+
readonly #tabsEffect = effect(() => {
6363
const tabs = this.tabs();
6464
if (tabs.length === 0) {
6565
return;
@@ -91,7 +91,7 @@ export class TabsListComponent {
9191
});
9292
});
9393

94-
readonly tabsServiceEffect = effect(() => {
94+
readonly #tabsServiceEffect = effect(() => {
9595
const activeItemIndex = this.tabs().findIndex(
9696
(tab) => untracked(tab.isActive) && untracked(tab.itemKey) === this.tabsService.activeItemKey()
9797
);

0 commit comments

Comments
 (0)