Skip to content

Commit

Permalink
Merge branch 'next' into onpush/batch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
zvonimirfras authored Dec 17, 2024
2 parents 90a4f0a + f3a9173 commit c367c9e
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 17 deletions.
15 changes: 11 additions & 4 deletions src/combobox/combobox.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ import {
AfterContentInit,
HostBinding,
TemplateRef,
OnDestroy
OnDestroy,
ChangeDetectionStrategy,
ChangeDetectorRef
} from "@angular/core";
import { AbstractDropdownView, DropdownService } from "carbon-components-angular/dropdown";
import { ListItem } from "carbon-components-angular/dropdown";
Expand Down Expand Up @@ -138,7 +140,6 @@ import { Observable } from "rxjs";
[placeholder]="placeholder"/>
@if (invalid) {
<svg
cdsIcon="warning--filled"
size="16"
class="cds--list-box__invalid-icon">
Expand Down Expand Up @@ -222,7 +223,8 @@ import { Observable } from "rxjs";
useExisting: ComboBox,
multi: true
}
]
],
changeDetection: ChangeDetectionStrategy.OnPush
})
export class ComboBox implements OnChanges, AfterViewInit, AfterContentInit, OnDestroy {
/**
Expand Down Expand Up @@ -500,7 +502,8 @@ export class ComboBox implements OnChanges, AfterViewInit, AfterContentInit, OnD
constructor(
protected elementRef: ElementRef,
protected dropdownService: DropdownService,
protected i18n: I18n
protected i18n: I18n,
protected cdr: ChangeDetectorRef
) {}

/**
Expand Down Expand Up @@ -743,6 +746,8 @@ export class ComboBox implements OnChanges, AfterViewInit, AfterContentInit, OnD
}

document.removeEventListener("click", this.outsideClick, true);

this.cdr.markForCheck();
}

/**
Expand All @@ -766,6 +771,8 @@ export class ComboBox implements OnChanges, AfterViewInit, AfterContentInit, OnD
this._dropUp = this._shouldDropUp();
}
}, 0);

this.cdr.markForCheck();
}

/**
Expand Down
6 changes: 4 additions & 2 deletions src/content-switcher/content-switcher.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import {
EventEmitter,
AfterViewInit,
HostListener,
ElementRef
ElementRef,
ChangeDetectionStrategy
} from "@angular/core";
import { ContentSwitcherOption } from "./content-switcher-option.directive";
import { isFocusInLastItem, isFocusInFirstItem } from "carbon-components-angular/common";
Expand Down Expand Up @@ -46,7 +47,8 @@ import { isFocusInLastItem, isFocusInFirstItem } from "carbon-components-angular
role="tablist">
<ng-content />
</div>
`
`,
changeDetection: ChangeDetectionStrategy.OnPush
})
export class ContentSwitcher implements AfterViewInit {
@Input() ariaLabel = "content switcher";
Expand Down
5 changes: 3 additions & 2 deletions src/context-menu/context-menu-divider.component.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { Component, HostBinding } from "@angular/core";
import { ChangeDetectionStrategy, Component, HostBinding } from "@angular/core";

@Component({
selector: "cds-context-menu-divider, ibm-context-menu-divider",
template: ""
template: "",
changeDetection: ChangeDetectionStrategy.OnPush
})
export class ContextMenuDividerComponent {
@HostBinding("class.cds--menu-item-divider") dividerClass = true;
Expand Down
4 changes: 3 additions & 1 deletion src/context-menu/context-menu-group.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {
ChangeDetectionStrategy,
Component,
EventEmitter,
HostBinding,
Expand All @@ -17,7 +18,8 @@ import { ContextMenuSelectionService } from "./context-menu-selection.service";
template: `
<ng-content />
`,
providers: [ContextMenuSelectionService]
providers: [ContextMenuSelectionService],
changeDetection: ChangeDetectionStrategy.OnPush
})
export class ContextMenuGroupComponent implements OnInit, OnChanges, OnDestroy {
@HostBinding("attr.role") role = "group";
Expand Down
6 changes: 4 additions & 2 deletions src/context-menu/context-menu-item.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import {
Optional,
OnInit,
AfterContentInit,
OnDestroy
OnDestroy,
ChangeDetectionStrategy
} from "@angular/core";
import { Subscription } from "rxjs";
import { ContextMenuSelectionService } from "./context-menu-selection.service";
Expand Down Expand Up @@ -41,7 +42,8 @@ import { ContextMenuComponent } from "./context-menu.component";
:host {
grid-template-columns: 1rem 1fr max-content;
}
`]
`],
changeDetection: ChangeDetectionStrategy.OnPush
})
export class ContextMenuItemComponent implements OnInit, AfterContentInit, OnDestroy {
@HostBinding("class.cds--menu-item") optionClass = true;
Expand Down
6 changes: 4 additions & 2 deletions src/context-menu/context-menu.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import {
Input,
SimpleChanges,
OnChanges,
HostBinding
HostBinding,
ChangeDetectionStrategy
} from "@angular/core";

/**
Expand All @@ -26,7 +27,8 @@ import {
:host {
display: block;
}
`]
`],
changeDetection: ChangeDetectionStrategy.OnPush
})
export class ContextMenuComponent implements OnChanges {
@Input() open = false;
Expand Down
6 changes: 4 additions & 2 deletions src/datepicker-input/datepicker-input.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import {
EventEmitter,
ElementRef,
TemplateRef,
ViewChild
ViewChild,
ChangeDetectionStrategy
} from "@angular/core";
import { NG_VALUE_ACCESSOR } from "@angular/forms";

Expand Down Expand Up @@ -124,7 +125,8 @@ import { NG_VALUE_ACCESSOR } from "@angular/forms";
useExisting: DatePickerInput,
multi: true
}
]
],
changeDetection: ChangeDetectionStrategy.OnPush
})
export class DatePickerInput {
private static datePickerCount = 0;
Expand Down
6 changes: 4 additions & 2 deletions src/datepicker/datepicker.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ import {
AfterViewInit,
ViewChild,
OnInit,
SimpleChange
SimpleChange,
ChangeDetectionStrategy
} from "@angular/core";
import rangePlugin from "flatpickr/dist/plugins/rangePlugin";
import flatpickr from "flatpickr";
Expand Down Expand Up @@ -120,7 +121,8 @@ if (languages.default?.default["en"]?.weekdays) {
multi: true
}
],
encapsulation: ViewEncapsulation.None
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush
})
export class DatePicker implements
OnInit,
Expand Down

0 comments on commit c367c9e

Please sign in to comment.