From 6876d10c8fc20abbf1ff87e9bd6b4b2581cf5389 Mon Sep 17 00:00:00 2001 From: Licen-it <35496522+Licen-it@users.noreply.github.com> Date: Tue, 9 Apr 2024 19:22:29 +0100 Subject: [PATCH 1/3] feat(Tooltip, TooltipDefinition): expose data input to be passed as template outlet context when rendering the tooltip --- src/tooltip/definition-tooptip.component.ts | 6 +++++- src/tooltip/tooltip.component.ts | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/tooltip/definition-tooptip.component.ts b/src/tooltip/definition-tooptip.component.ts index db49019d59..eab3b39bf5 100644 --- a/src/tooltip/definition-tooptip.component.ts +++ b/src/tooltip/definition-tooptip.component.ts @@ -41,7 +41,7 @@ import { PopoverContainer } from "carbon-components-angular/popover"; role="tooltip"> {{description}} - + @@ -57,6 +57,10 @@ export class TooltipDefinition extends PopoverContainer { * The string or template content to be exposed by the tooltip. */ @Input() description: string | TemplateRef; + /** + * Optional data for templates + */ + @Input() data = {} constructor( protected elementRef: ElementRef, diff --git a/src/tooltip/tooltip.component.ts b/src/tooltip/tooltip.component.ts index d47336dc80..6d96958ad7 100644 --- a/src/tooltip/tooltip.component.ts +++ b/src/tooltip/tooltip.component.ts @@ -39,7 +39,7 @@ import { PopoverContainer } from "carbon-components-angular/popover"; {{description}} - + @@ -69,6 +69,10 @@ export class Tooltip extends PopoverContainer implements AfterContentChecked { * The string or template content to be exposed by the tooltip. */ @Input() description: string | TemplateRef; + /** + * Optional data for templates + */ + @Input() data = {} @ViewChild("contentWrapper") wrapper: ElementRef; From b42b8653e434130426d264ae71f08fbb8b845f12 Mon Sep 17 00:00:00 2001 From: Licen-it <35496522+Licen-it@users.noreply.github.com> Date: Wed, 10 Apr 2024 12:52:18 +0100 Subject: [PATCH 2/3] fix(IconButtonStories): IconButtonStories are now showing the correct input kind instead of cdsButton --- src/button/icon-button.stories.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/button/icon-button.stories.ts b/src/button/icon-button.stories.ts index a89d1d7088..e42a273f6f 100644 --- a/src/button/icon-button.stories.ts +++ b/src/button/icon-button.stories.ts @@ -41,7 +41,7 @@ export default { "danger--ghost" ], control: { type: "select" }, - name: "cdsButton" + name: "kind" }, size: { options: ["sm", "md", "lg", "xl", "2xl"], From 3aff8752399e7f52c58c70ef66749e6bc6028d37 Mon Sep 17 00:00:00 2001 From: Licen-it <35496522+Licen-it@users.noreply.github.com> Date: Wed, 10 Apr 2024 16:18:36 +0100 Subject: [PATCH 3/3] chore(Tooltip, TooltipDefinition): renaming data into templateContext and exposing as $implicit in the templateOutlet --- src/tooltip/definition-tooptip.component.ts | 6 +++--- src/tooltip/tooltip.component.ts | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/tooltip/definition-tooptip.component.ts b/src/tooltip/definition-tooptip.component.ts index eab3b39bf5..04286d063e 100644 --- a/src/tooltip/definition-tooptip.component.ts +++ b/src/tooltip/definition-tooptip.component.ts @@ -41,7 +41,7 @@ import { PopoverContainer } from "carbon-components-angular/popover"; role="tooltip"> {{description}} - + @@ -58,9 +58,9 @@ export class TooltipDefinition extends PopoverContainer { */ @Input() description: string | TemplateRef; /** - * Optional data for templates + * Optional data for templates passed as implicit context */ - @Input() data = {} + @Input() templateContext: any; constructor( protected elementRef: ElementRef, diff --git a/src/tooltip/tooltip.component.ts b/src/tooltip/tooltip.component.ts index 6d96958ad7..47cc1938e2 100644 --- a/src/tooltip/tooltip.component.ts +++ b/src/tooltip/tooltip.component.ts @@ -39,7 +39,7 @@ import { PopoverContainer } from "carbon-components-angular/popover"; {{description}} - + @@ -70,9 +70,9 @@ export class Tooltip extends PopoverContainer implements AfterContentChecked { */ @Input() description: string | TemplateRef; /** - * Optional data for templates + * Optional data for templates passed as implicit context */ - @Input() data = {} + @Input() templateContext: any @ViewChild("contentWrapper") wrapper: ElementRef;