Skip to content

Commit 12cf9c6

Browse files
Merge branch 'main' into title_spacing_radio_button
2 parents fa89b62 + 11705d0 commit 12cf9c6

File tree

5 files changed

+45
-28
lines changed

5 files changed

+45
-28
lines changed

package-lock.json

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

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
"d3-shape": "^1.3.5",
5959
"d3-transition": "^1.2.0",
6060
"d3-zoom": "^1.8.3",
61-
"graphql": "^15.5.2",
61+
"graphql": "^15.5.3",
6262
"graphql-tag": "^2.12.5",
6363
"iso8601-duration": "^1.3.0",
6464
"lodash-es": "^4.17.21",
@@ -74,7 +74,7 @@
7474
"@angular/compiler-cli": "~12.2.1",
7575
"@angular/language-service": "~12.2.1",
7676
"@commitlint/cli": "^12.1.4",
77-
"@commitlint/config-conventional": "^12.1.4",
77+
"@commitlint/config-conventional": "^13.1.0",
7878
"@compodoc/compodoc": "^1.1.14",
7979
"@ngneat/spectator": "^8.0.4",
8080
"@types/d3-array": "^2.9.0",
@@ -90,7 +90,7 @@
9090
"@types/d3-zoom": "^1.7.5",
9191
"@types/jest": "^26.0.24",
9292
"@types/lodash-es": "^4.17.4",
93-
"@types/node": "^16.7.7",
93+
"@types/node": "^16.7.10",
9494
"@types/uuid": "^8.3.1",
9595
"@types/webpack-env": "^1.16.2",
9696
"codelyzer": "^6.0.2",

projects/assets-library/assets/styles/_layout.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ $paginator-height: 48px;
4646
border: 1px solid $color-border;
4747
}
4848

49+
@mixin frame-box-shadow {
50+
border-radius: 10px;
51+
box-shadow: 0 1px 3px rgba(63, 71, 74, 0.16), 0 2px 2px rgba(63, 71, 74, 0.12), 0 0 2px rgba(63, 71, 74, 0.16);
52+
}
53+
4954
@mixin vertical-divider($height: 16px) {
5055
height: $height;
5156
margin: 0 2px;

projects/components/src/radio/radio-group.component.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ChangeDetectionStrategy, Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
1+
import { ChangeDetectionStrategy, Component, EventEmitter, Input, OnInit, Output, TemplateRef } from '@angular/core';
22
import { MatRadioChange } from '@angular/material/radio';
33
import { LoggerService } from '@hypertrace/common';
44
import { RadioOption } from './radio-option';
@@ -22,10 +22,16 @@ import { RadioOption } from './radio-option';
2222
[ngClass]="[this.optionsDirection, this.disabled ? 'disabled' : '']"
2323
[value]="option.value"
2424
>
25-
<ht-label class="radio-button-label" [label]="option.label"></ht-label>
25+
<ng-container
26+
*ngTemplateOutlet="
27+
this.isLabelAString(option.label) ? defaultLabel : option.label;
28+
context: { $implicit: option.label }
29+
"
30+
></ng-container>
2631
<span *ngIf="option.description" class="radio-button-description">{{ option.description }}</span>
2732
</mat-radio-button>
2833
</mat-radio-group>
34+
<ng-template #defaultLabel let-label><ht-label class="radio-button-label" [label]="label"></ht-label></ng-template>
2935
`
3036
})
3137
export class RadioGroupComponent implements OnInit {
@@ -67,6 +73,10 @@ export class RadioGroupComponent implements OnInit {
6773
this.selected = this.options.find(option => option.value === event.value);
6874
this.selectedChange.emit(event.value);
6975
}
76+
77+
public isLabelAString(label: string | TemplateRef<unknown>): boolean {
78+
return typeof label === 'string';
79+
}
7080
}
7181

7282
export const enum OptionsDirection {
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
import { TemplateRef } from '@angular/core';
2+
13
export interface RadioOption {
24
value: string;
3-
label: string;
5+
label: string | TemplateRef<unknown>;
46
description?: string;
57
}

0 commit comments

Comments
 (0)