-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: (core) added selected button with group (#1543)
* added selected button with group * added selected button with group * fixed stackblitz and added toggle * fixed stackblitz and added toggle * self contained button styling fix * self contained button styling fix * fixed netlify * add button import * remove unecessary files * remove unecessary files * rerun netlify * revert files
- Loading branch information
1 parent
7bf6cc6
commit 4c990e5
Showing
15 changed files
with
104 additions
and
133 deletions.
There are no files selected for viewing
34 changes: 11 additions & 23 deletions
34
apps/docs/src/app/core/component-docs/button-group/button-group-docs.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 0 additions & 10 deletions
10
...app/core/component-docs/button-group/examples/button-group-compact-example.component.html
This file was deleted.
Oops, something went wrong.
17 changes: 9 additions & 8 deletions
17
...app/core/component-docs/button-group/examples/button-group-default-example.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
<fd-button-group style="margin-right: 10px; margin-left: 10px;"> | ||
<button fd-button-grouped [glyph]="'survey'" [state]="'selected'"></button> | ||
<button fd-button-grouped [glyph]="'pie-chart'"></button> | ||
<button fd-button-grouped [glyph]="'pool'"></button> | ||
<button fd-button-grouped [glyph]="'survey'" (click)="setLocaleIcon(0)" [state]="isSelectedIcon(0)"> | ||
survey | ||
</button> | ||
<button fd-button-grouped [glyph]="'pie-chart'" (click)="setLocaleIcon(1)" [state]="isSelectedIcon(1)"> | ||
pie-chart | ||
</button> | ||
<button fd-button-grouped [glyph]="'pool'" (click)="setLocaleIcon(2)" [state]="isSelectedIcon(2)"> | ||
pool | ||
</button> | ||
</fd-button-group> | ||
<fd-button-group> | ||
<button fd-button-grouped>Left</button> | ||
<button fd-button-grouped [state]="'selected'">Middle</button> | ||
<button fd-button-grouped>Right</button> | ||
</fd-button-group> |
32 changes: 32 additions & 0 deletions
32
...c/app/core/component-docs/button-group/examples/button-group-default-example.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { Component, OnInit } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'fd-button-group-default-example', | ||
templateUrl: './button-group-default-example.component.html', | ||
|
||
}) | ||
export class ButtonGroupDefaultExampleComponent { | ||
|
||
icon: number = 0; | ||
lmr: boolean[] = [false, false, false]; | ||
|
||
constructor() { | ||
} | ||
|
||
|
||
isSelectedIcon(x: number): string { | ||
return this.icon === x ? 'selected' : ''; | ||
} | ||
|
||
isSelectedLMR(x: number): string { | ||
return this.lmr[x] ? 'selected' : ''; | ||
} | ||
|
||
setLocaleIcon(x: number): void { | ||
this.icon = x; | ||
} | ||
|
||
toggleLMR(x: number): void { | ||
this.lmr[x] = !this.lmr[x]; | ||
} | ||
} |
25 changes: 0 additions & 25 deletions
25
...docs/src/app/core/component-docs/button-group/examples/button-group-examples.component.ts
This file was deleted.
Oops, something went wrong.
10 changes: 0 additions & 10 deletions
10
...s/src/app/core/component-docs/button-group/examples/button-group-s-example.component.html
This file was deleted.
Oops, something went wrong.
5 changes: 5 additions & 0 deletions
5
.../app/core/component-docs/button-group/examples/button-group-toggle-example.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<fd-button-group> | ||
<button fd-button-grouped (click)="toggleLMR(0)" [state]="isSelectedLMR(0)">Left</button> | ||
<button fd-button-grouped (click)="toggleLMR(1)" [state]="isSelectedLMR(1)">Middle</button> | ||
<button fd-button-grouped (click)="toggleLMR(2)" [state]="isSelectedLMR(2)">Right</button> | ||
</fd-button-group> |
22 changes: 22 additions & 0 deletions
22
...rc/app/core/component-docs/button-group/examples/button-group-toggle-example.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { Component, OnInit } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'fd-button-group-toggle-example', | ||
templateUrl: './button-group-toggle-example.component.html', | ||
|
||
}) | ||
export class ButtonGroupToggleExampleComponent { | ||
|
||
lmr: boolean[] = [false, false, false]; | ||
|
||
constructor() { | ||
} | ||
|
||
isSelectedLMR(x: number): string { | ||
return this.lmr[x] ? 'selected' : ''; | ||
} | ||
|
||
toggleLMR(x: number): void { | ||
this.lmr[x] = !this.lmr[x]; | ||
} | ||
} |
10 changes: 0 additions & 10 deletions
10
.../src/app/core/component-docs/button-group/examples/button-group-xs-example.component.html
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
@import "~fundamental-styles/dist/button-group"; | ||
@import '~fundamental-styles/dist/button-group'; | ||
@import '~fundamental-styles/dist/button'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters