-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(core): replace spinner animation and add loading state to button (…
…#583) Co-authored-by: Daniel Leroux <daniel.leroux@siemens.com>
- Loading branch information
1 parent
932b051
commit 2c5b183
Showing
31 changed files
with
1,111 additions
and
493 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 |
---|---|---|
|
@@ -108,6 +108,7 @@ | |
"cli": { | ||
"cache": { | ||
"enabled": false | ||
} | ||
}, | ||
"analytics": false | ||
} | ||
} |
84 changes: 84 additions & 0 deletions
84
packages/angular-test-app/src/preview-examples/button-loading.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,84 @@ | ||
/* | ||
* SPDX-FileCopyrightText: 2023 Siemens AG | ||
* | ||
* SPDX-License-Identifier: MIT | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
import { Component } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'app-example', | ||
template: ` | ||
<ix-button | ||
(click)="toggle()" | ||
[loading]="loading" | ||
class="m-1" | ||
outline | ||
variant="Primary" | ||
> | ||
Button | ||
</ix-button> | ||
<ix-button | ||
(click)="toggle2()" | ||
[loading]="loading2" | ||
icon="star" | ||
class="m-1" | ||
outline | ||
variant="Primary" | ||
> | ||
Button | ||
</ix-button> | ||
<ix-icon-button | ||
(click)="toggle3()" | ||
[loading]="loading3" | ||
icon="star" | ||
class="m-1" | ||
outline | ||
variant="Primary" | ||
> | ||
</ix-icon-button> | ||
<ix-button loading class="m-1" outline variant="Primary"> | ||
Button | ||
</ix-button> | ||
<ix-icon-button | ||
loading | ||
icon="star" | ||
class="m-1" | ||
outline | ||
variant="Primary" | ||
></ix-icon-button> | ||
`, | ||
}) | ||
export default class ButtonLoading { | ||
loading = false; | ||
loading2 = false; | ||
loading3 = false; | ||
|
||
toggle() { | ||
this.loading = true; | ||
setTimeout(() => { | ||
this.loading = false; | ||
}, 2500); | ||
} | ||
|
||
toggle2() { | ||
this.loading2 = true; | ||
setTimeout(() => { | ||
this.loading2 = false; | ||
}, 2500); | ||
} | ||
|
||
toggle3() { | ||
this.loading3 = true; | ||
setTimeout(() => { | ||
this.loading3 = false; | ||
}, 2500); | ||
} | ||
} |
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
Oops, something went wrong.