|
|
|
|
@ -10,7 +10,7 @@ import { RadioButtonModule } from "./radio-button.module";
@@ -10,7 +10,7 @@ import { RadioButtonModule } from "./radio-button.module";
|
|
|
|
|
|
|
|
|
|
const template = ` |
|
|
|
|
<form [formGroup]="formObj"> |
|
|
|
|
<bit-radio-group formControlName="radio" aria-label="Example radio group"> |
|
|
|
|
<bit-radio-group [inline]="inline" formControlName="radio" aria-label="Example radio group"> |
|
|
|
|
<bit-label *ngIf="label">Group of radio buttons</bit-label> |
|
|
|
|
<bit-radio-button [value]="TestValue.First" id="radio-first">First</bit-radio-button> |
|
|
|
|
<bit-radio-button [value]="TestValue.Second" id="radio-second">Second</bit-radio-button> |
|
|
|
|
@ -35,6 +35,8 @@ class ExampleComponent {
@@ -35,6 +35,8 @@ class ExampleComponent {
|
|
|
|
|
radio: TestValue.First, |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
@Input() inline: boolean; |
|
|
|
|
|
|
|
|
|
@Input() label: boolean; |
|
|
|
|
|
|
|
|
|
@Input() set selected(value: TestValue) { |
|
|
|
|
@ -83,6 +85,7 @@ export default {
@@ -83,6 +85,7 @@ export default {
|
|
|
|
|
selected: TestValue.First, |
|
|
|
|
disabled: false, |
|
|
|
|
label: true, |
|
|
|
|
inline: false, |
|
|
|
|
}, |
|
|
|
|
argTypes: { |
|
|
|
|
selected: { |
|
|
|
|
@ -101,7 +104,12 @@ export default {
@@ -101,7 +104,12 @@ export default {
|
|
|
|
|
|
|
|
|
|
const DefaultTemplate: Story<ExampleComponent> = (args: ExampleComponent) => ({ |
|
|
|
|
props: args, |
|
|
|
|
template: `<app-example [selected]="selected" [disabled]="disabled" [label]="label"></app-example>`, |
|
|
|
|
template: `<app-example [selected]="selected" [disabled]="disabled" [label]="label" [inline]="inline"></app-example>`, |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
export const Default = DefaultTemplate.bind({}); |
|
|
|
|
|
|
|
|
|
export const Inline = DefaultTemplate.bind({}); |
|
|
|
|
Inline.args = { |
|
|
|
|
inline: true, |
|
|
|
|
}; |
|
|
|
|
|