Skip to content

Commit 68bbe2b

Browse files
authored
Merge branch 'master' into chore/onboard-to-ibm-telemetry
2 parents 923482a + 1a64860 commit 68bbe2b

13 files changed

+75
-29
lines changed

integration/ng14/package-lock.json

Lines changed: 7 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

integration/ng15/package-lock.json

Lines changed: 7 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

integration/ng16/package-lock.json

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

integration/ng17/package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/popover/popover.directive.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import {
2+
ChangeDetectorRef,
23
Directive,
34
EventEmitter,
45
HostBinding,
@@ -95,6 +96,8 @@ export class PopoverContainer {
9596
"left" | "left-bottom" | "left-top" |
9697
"right" | "right-bottom" | "right-top" = "bottom";
9798

99+
constructor(private changeDetectorRef: ChangeDetectorRef) {}
100+
98101
handleChange(open: boolean, event: Event) {
99102
if (this.isOpen !== open) {
100103
this.isOpenChange.emit(open);
@@ -106,5 +109,6 @@ export class PopoverContainer {
106109
this.onClose.emit(event);
107110
}
108111
this.isOpen = open;
112+
this.changeDetectorRef.markForCheck();
109113
}
110114
}

src/table/cell/table-radio.component.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
} from "@angular/core";
77
import { I18n } from "carbon-components-angular/i18n";
88
import { TableItem } from "../table-item.class";
9+
import { TableRow } from "../table-row.class";
910
import { Observable } from "rxjs";
1011

1112
@Component({
@@ -17,6 +18,7 @@ import { Observable } from "rxjs";
1718
[attr.aria-label]="getLabel() | i18nReplace:getSelectionLabelValue(row) | async"
1819
[ariaLabel]="getLabel() | i18nReplace:getSelectionLabelValue(row) | async"
1920
[checked]="selected"
21+
[disabled]="disabled"
2022
(change)="change.emit()">
2123
</cds-radio>
2224
`
@@ -35,6 +37,10 @@ export class TableRadio {
3537
return this._label.value;
3638
}
3739

40+
get disabled(): boolean {
41+
return this.row ? !!(this.row as TableRow).disabled : false;
42+
}
43+
3844
/**
3945
* Used to populate the row selection checkbox label with a useful value if set.
4046
*

src/toggletip/toggletip.component.spec.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,4 +102,11 @@ describe("Toggletip", () => {
102102
fixture.detectChanges();
103103
expect(toggletipEl.componentInstance.isOpen).toBeFalsy();
104104
}));
105+
106+
it("should markForCheck given the changeDetectorRef is set", () => {
107+
const spy = spyOn(toggletipEl.componentInstance.ref, "markForCheck");
108+
buttonEl.nativeElement.click();
109+
fixture.detectChanges();
110+
expect(spy).toHaveBeenCalled();
111+
});
105112
});

src/toggletip/toggletip.component.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import {
22
AfterViewInit,
3+
ChangeDetectionStrategy,
4+
ChangeDetectorRef,
35
Component,
46
ContentChild,
57
ElementRef,
@@ -23,6 +25,7 @@ import { ToggletipButton } from "./toggletip-button.directive";
2325
*/
2426
@Component({
2527
selector: "cds-toggletip, ibm-toggletip",
28+
changeDetection: ChangeDetectionStrategy.OnPush,
2629
template: `
2730
<ng-content select="[cdsToggletipButton]"></ng-content>
2831
<cds-popover-content>
@@ -42,8 +45,8 @@ export class Toggletip extends PopoverContainer implements AfterViewInit {
4245

4346
documentClick = this.handleFocusOut.bind(this);
4447

45-
constructor(private hostElement: ElementRef, private renderer: Renderer2) {
46-
super();
48+
constructor(private hostElement: ElementRef, private renderer: Renderer2, private ref: ChangeDetectorRef) {
49+
super(ref);
4750
this.highContrast = true;
4851
this.dropShadow = false;
4952
}

src/tooltip/definition-tooltip.component.spec.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,11 @@ describe("Definition tooltip", () => {
5151
fixture.detectChanges();
5252
expect(tooltipEl.componentInstance.isOpenChange.emit).toHaveBeenCalled();
5353
});
54+
55+
it("should markForCheck given the changeDetectorRef is set", () => {
56+
const spy = spyOn(tooltipEl.componentInstance.ref, "markForCheck");
57+
buttonEl.triggerEventHandler("click", null);
58+
fixture.detectChanges();
59+
expect(spy).toHaveBeenCalled();
60+
});
5461
});

0 commit comments

Comments
 (0)