Skip to content

Commit

Permalink
feat: Add simple spinner implementation in BS3 Button
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjenni committed Aug 31, 2024
1 parent d8333d6 commit ea34110
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,20 @@ <h2>Button</h2>
text="Validate"
role="link"
></sac-button>
<div>Primary Loading Button</div>
<sac-button
(clicked)="debugAction1()"
text="Validate"
role="primary"
isloading="true"
></sac-button>
<div>Default Loading Button</div>
<sac-button
(clicked)="debugAction1()"
text="Validate"
isloading="true"
></sac-button>

<div>Button Group</div>
<div class="btn-toolbar">
<sac-button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,15 @@
(click)="buttonClick()"
>
<i
*ngIf="icon !== ''"
*ngIf="isloading"
class=""
role="status"
aria-hidden="true"
class="glyphicon glyphicon-repeat spin"
[ngStyle]="{ 'margin-right': text ? '0.5rem': null}"
></i>
<i
*ngIf="!isloading && icon !== ''"
[ngClass]="icon"
[ngStyle]="{ 'margin-right': text ? '0.5rem': null}"
></i>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { SacButtonCommon } from '@simpleangularcontrols/sac-common';
@Component({
selector: 'sac-button',
templateUrl: './button.html',
styles: ['sac-button+sac-button {margin-left: 5px}'], // Workaround: Abstand zwischen 2 Buttons setzen, da Boostrap3 nicht mit Host Items umgehen kann
styles: ['sac-button+sac-button {margin-left: 5px}', '.spin { animation: spin 1.5s infinite; } @keyframes spin { 0% { transform: rotate(0); } 100% { transform: rotate(360deg); } }'], // Workaround: Abstand zwischen 2 Buttons setzen, da Boostrap3 nicht mit Host Items umgehen kann
encapsulation: ViewEncapsulation.None, // Workaround: Abstand zwischen 2 Buttons setzen, da Boostrap3 nicht mit Host Items umgehen kann
})
export class SacButtonComponent extends SacButtonCommon {}

0 comments on commit ea34110

Please sign in to comment.