Skip to content

Commit 246cc3b

Browse files
committed
fix(progress-button): fix styling & add playground page
1 parent 65794b9 commit 246cc3b

File tree

7 files changed

+134
-1
lines changed

7 files changed

+134
-1
lines changed

projects/angular/directives/ui-progress-button/src/internal/ui-button-progress-bar.component.scss

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
ui-button-progress-bar {
22
display: block;
3-
width: 100%;
3+
width: 0;
4+
padding: 0;
5+
margin: 0;
46

57
.mat-mdc-progress-bar {
68
position: absolute;

projects/playground/src/app/app-routing.module.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {
99
Routes,
1010
} from '@angular/router';
1111
import { TreeSelectPageComponent } from 'projects/playground/src/app/pages/tree-select/tree-select.page';
12+
import { ProgressButtonPageComponent } from 'projects/playground/src/app/pages/progress-button/progress-button.page';
1213

1314
const routes: Routes = [
1415
{
@@ -31,6 +32,10 @@ const routes: Routes = [
3132
path: 'tree',
3233
component: TreeSelectPageComponent,
3334
},
35+
{
36+
path: 'progress-button',
37+
component: ProgressButtonPageComponent,
38+
},
3439
{
3540
path: '**',
3641
redirectTo: 'home',

projects/playground/src/app/app.component.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ export class AppComponent {
2626
name: 'Suggest',
2727
link: '/suggest',
2828
},
29+
{
30+
name: 'Progress button',
31+
link: '/progress-button',
32+
},
2933
{
3034
name: 'Tree select',
3135
link: '/tree',
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { CommonModule } from '@angular/common';
2+
import { NgModule } from '@angular/core';
3+
4+
import { UiProgressButtonModule } from '@uipath/angular/directives/ui-progress-button';
5+
import { MatButtonModule } from '@angular/material/button';
6+
import { MatIconModule } from '@angular/material/icon';
7+
import { ProgressButtonPageComponent } from './progress-button.page';
8+
9+
@NgModule({
10+
declarations: [
11+
ProgressButtonPageComponent,
12+
],
13+
imports: [
14+
CommonModule,
15+
UiProgressButtonModule,
16+
MatButtonModule,
17+
MatIconModule,
18+
],
19+
})
20+
export class SuggestModule { }
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
<button mat-flat-button
2+
color="primary"
3+
(click)="toggle()">
4+
<mat-icon>radio_button_partial</mat-icon>
5+
Toggle loading state</button>
6+
7+
<div class="group">
8+
<button mat-button
9+
ui-progress-button
10+
[progressButtonLoading]="isLoading">test</button>
11+
<button mat-button
12+
ui-progress-button
13+
[progressButtonLoading]="isLoading"
14+
color="primary">test</button>
15+
<button mat-button
16+
ui-progress-button
17+
[progressButtonLoading]="isLoading"
18+
color="warn">test</button>
19+
<button mat-button
20+
ui-progress-button
21+
[progressButtonLoading]="isLoading"
22+
color="accent">test</button>
23+
24+
</div>
25+
26+
<div class="group">
27+
<button mat-flat-button
28+
ui-progress-button
29+
[progressButtonLoading]="isLoading">test</button>
30+
<button mat-flat-button
31+
ui-progress-button
32+
[progressButtonLoading]="isLoading"
33+
color="primary">test</button>
34+
<button mat-flat-button
35+
ui-progress-button
36+
[progressButtonLoading]="isLoading"
37+
color="warn">test</button>
38+
<button mat-flat-button
39+
ui-progress-button
40+
[progressButtonLoading]="isLoading"
41+
color="accent">test</button>
42+
43+
</div>
44+
45+
<div class="group">
46+
<button mat-flat-button
47+
ui-progress-button
48+
[progressButtonLoading]="isLoading">
49+
<mat-icon>home</mat-icon>
50+
test</button>
51+
<button mat-flat-button
52+
ui-progress-button
53+
[progressButtonLoading]="isLoading"
54+
color="primary">
55+
<mat-icon>home</mat-icon>
56+
test</button>
57+
<button mat-flat-button
58+
ui-progress-button
59+
[progressButtonLoading]="isLoading"
60+
color="warn">
61+
<mat-icon>home</mat-icon>
62+
test</button>
63+
<button mat-flat-button
64+
ui-progress-button
65+
[progressButtonLoading]="isLoading"
66+
color="accent">
67+
<mat-icon>home</mat-icon>
68+
test</button>
69+
70+
</div>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
:host {
2+
display: flex;
3+
flex-direction: column;
4+
gap: 10px;
5+
6+
> button {
7+
width: fit-content;
8+
}
9+
10+
.group {
11+
display: flex;
12+
gap: 10px;
13+
}
14+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import {
2+
ChangeDetectionStrategy,
3+
Component,
4+
} from '@angular/core';
5+
6+
@Component({
7+
selector: 'ui-app-progress-button',
8+
templateUrl: './progress-button.page.html',
9+
styleUrls: ['./progress-button.page.scss'],
10+
changeDetection: ChangeDetectionStrategy.OnPush,
11+
})
12+
export class ProgressButtonPageComponent {
13+
isLoading = false;
14+
15+
toggle() {
16+
this.isLoading = !this.isLoading;
17+
}
18+
}

0 commit comments

Comments
 (0)