-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(button-toggle): added new component button-toggle (#101)
- Loading branch information
1 parent
3fa8704
commit 37abf64
Showing
21 changed files
with
1,694 additions
and
0 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -9,6 +9,7 @@ module.exports = { | |
'badge', | ||
'build', | ||
'button', | ||
'button-toggle', | ||
'ci', | ||
'cdk', | ||
'card', | ||
|
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
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,44 @@ | ||
import { Component, NgModule, ViewEncapsulation } from '@angular/core'; | ||
import { FormsModule } from '@angular/forms'; | ||
import { BrowserModule } from '@angular/platform-browser'; | ||
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; | ||
import { McIconModule } from '@ptsecurity/mosaic/icon'; | ||
|
||
import { McButtonModule } from '../../lib/button'; | ||
import { McButtonToggleModule } from '../../lib/button-toggle'; | ||
|
||
|
||
@Component({ | ||
selector: 'app', | ||
template: require('./template.html'), | ||
styleUrls: ['./styles.scss'], | ||
encapsulation: ViewEncapsulation.None | ||
}) | ||
export class ButtonToggleDemoComponent { | ||
modelResult: any; | ||
disabled: boolean; | ||
} | ||
|
||
|
||
@NgModule({ | ||
declarations: [ | ||
ButtonToggleDemoComponent | ||
], | ||
imports: [ | ||
BrowserModule, | ||
McButtonModule, | ||
McButtonToggleModule, | ||
McIconModule, | ||
FormsModule | ||
], | ||
bootstrap: [ | ||
ButtonToggleDemoComponent | ||
] | ||
}) | ||
export class ButtonToggleDemoModule {} | ||
|
||
platformBrowserDynamic() | ||
.bootstrapModule(ButtonToggleDemoModule) | ||
// tslint:disable-next-line:no-console | ||
.catch((error) => console.error(error)); | ||
|
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,4 @@ | ||
@import '~@ptsecurity/mosaic-icons/dist/styles/mc-icons'; | ||
|
||
// @import '../../lib/core/theming/prebuilt/default-theme'; | ||
@import '../../lib/core/theming/prebuilt/dark-theme'; |
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,124 @@ | ||
<div> | ||
<label>Horizontal Group</label> | ||
<mc-button-toggle-group #group1="mcButtonToggleGroup"> | ||
<mc-button-toggle value="1"> | ||
default 1 | ||
</mc-button-toggle> | ||
<mc-button-toggle value="2"> | ||
default 2 | ||
</mc-button-toggle> | ||
<mc-button-toggle value="3"> | ||
default 3 | ||
</mc-button-toggle> | ||
<mc-button-toggle value="4" disabled> | ||
default 4 | ||
</mc-button-toggle> | ||
<mc-button-toggle value="5"> | ||
<i mc-icon="mc-angle-down-L_16"></i> | ||
</mc-button-toggle> | ||
<mc-button-toggle value="6"> | ||
default 6 | ||
</mc-button-toggle> | ||
<mc-button-toggle value="7"> | ||
<i mc-icon="mc-angle-down-L_16"></i> | ||
</mc-button-toggle> | ||
</mc-button-toggle-group> | ||
<div class="example-selected-value">Selected value: {{group1.value}}</div> | ||
|
||
<br> | ||
|
||
<label>DisableGroup</label> | ||
|
||
<br> | ||
|
||
<button mc-button (click)="disabled = !disabled">Toggle Disabled</button> | ||
|
||
<br> | ||
<br> | ||
|
||
<mc-button-toggle-group [disabled]="disabled" #disabledGroup="mcButtonToggleGroup"> | ||
<mc-button-toggle value="1"> | ||
default 1 | ||
</mc-button-toggle> | ||
<mc-button-toggle value="2" disabled> | ||
default 2 | ||
</mc-button-toggle> | ||
<mc-button-toggle value="3"> | ||
default 3 | ||
</mc-button-toggle> | ||
<mc-button-toggle value="4"> | ||
<i mc-icon="mc-angle-down-L_16"></i> | ||
</mc-button-toggle> | ||
</mc-button-toggle-group> | ||
<div class="example-selected-value">Selected value: {{disabledGroup.value}}</div> | ||
|
||
<br> | ||
|
||
<label>Multiple Group</label> | ||
<mc-button-toggle-group multiple #multipleGroup="mcButtonToggleGroup"> | ||
<mc-button-toggle value="1"> | ||
default 1 | ||
</mc-button-toggle> | ||
<mc-button-toggle value="2" disabled> | ||
default 2 | ||
</mc-button-toggle> | ||
<mc-button-toggle value="3"> | ||
default 3 | ||
</mc-button-toggle> | ||
<mc-button-toggle value="4"> | ||
<i mc-icon="mc-angle-down-L_16"></i> | ||
</mc-button-toggle> | ||
</mc-button-toggle-group> | ||
<div class="example-selected-value">Selected value: {{multipleGroup.value}}</div> | ||
|
||
<br> | ||
|
||
<label>Standalone Toggle</label> | ||
|
||
<br> | ||
|
||
<mc-button-toggle value="123" #standAloneToggle="mcButtonToggle"> | ||
default | ||
</mc-button-toggle> | ||
<div class="example-selected-value">Selected value: {{standAloneToggle.checked}}</div> | ||
|
||
<br> | ||
|
||
<label>Vertical Group</label> | ||
|
||
<mc-button-toggle-group #group3="mcButtonToggleGroup" [vertical]="true"> | ||
<mc-button-toggle value="1"> | ||
default 1 | ||
</mc-button-toggle> | ||
<mc-button-toggle value="2" disabled> | ||
default 2 | ||
</mc-button-toggle> | ||
<mc-button-toggle value="3"> | ||
default 3 | ||
</mc-button-toggle> | ||
<mc-button-toggle value="4"> | ||
<i mc-icon="mc-angle-down-L_16"></i> | ||
</mc-button-toggle> | ||
</mc-button-toggle-group> | ||
<div class="example-selected-value">Selected value: {{group3.value}}</div> | ||
|
||
<br> | ||
|
||
<label>Group With Model</label> | ||
|
||
<mc-button-toggle-group [(ngModel)]="modelResult"> | ||
<mc-button-toggle value="1"> | ||
default 1 | ||
</mc-button-toggle> | ||
<mc-button-toggle value="2" disabled> | ||
default 2 | ||
</mc-button-toggle> | ||
<mc-button-toggle value="3"> | ||
default 3 | ||
</mc-button-toggle> | ||
<mc-button-toggle value="4"> | ||
<i mc-icon="mc-angle-down-L_16"></i> | ||
</mc-button-toggle> | ||
</mc-button-toggle-group> | ||
<div class="example-selected-value">Model result: {{modelResult}}</div> | ||
</div> |
Empty file.
Oops, something went wrong.