Skip to content

Commit

Permalink
fix(progress-spinner): Rename ProgressCircle to ProgressSpinner (#2300)
Browse files Browse the repository at this point in the history
* Rename ProgressCircle to ProgressSpinner

* Make old selectors work

* Added progres-circle file
  • Loading branch information
tinayuangao authored and jelbourn committed Dec 21, 2016
1 parent bde8734 commit 221c234
Show file tree
Hide file tree
Showing 28 changed files with 125 additions and 120 deletions.
17 changes: 0 additions & 17 deletions e2e/components/progress-circle/progress-circle.e2e.ts

This file was deleted.

17 changes: 17 additions & 0 deletions e2e/components/progress-spinner/progress-spinner.e2e.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import {browser, by, element} from 'protractor';

describe('progress-spinner', () => {
beforeEach(() => browser.get('/progress-spinner'));

it('should render a determinate progress spinner', () => {
expect(element(by.css('md-progress-spinner')).isPresent()).toBe(true);
});

it('should render an indeterminate progress spinner', () => {
expect(element(by.css('md-progress-spinner[mode="indeterminate"]')).isPresent()).toBe(true);
});

it('should render a spinner', () => {
expect(element(by.css('md-spinner')).isPresent()).toBe(true);
});
});
4 changes: 2 additions & 2 deletions src/demo-app/demo-app-module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {CardDemo} from './card/card-demo';
import {ChipsDemo} from './chips/chips-demo';
import {RadioDemo} from './radio/radio-demo';
import {ButtonToggleDemo} from './button-toggle/button-toggle-demo';
import {ProgressCircleDemo} from './progress-circle/progress-circle-demo';
import {ProgressSpinnerDemo} from './progress-spinner/progress-spinner-demo';
import {TooltipDemo} from './tooltip/tooltip-demo';
import {ListDemo} from './list/list-demo';
import {BaselineDemo} from './baseline/baseline-demo';
Expand Down Expand Up @@ -74,7 +74,7 @@ import {InputContainerDemo} from './input/input-container-demo';
OverlayDemo,
PortalDemo,
ProgressBarDemo,
ProgressCircleDemo,
ProgressSpinnerDemo,
ProjectionDemo,
ProjectionTestComponent,
RadioDemo,
Expand Down
2 changes: 1 addition & 1 deletion src/demo-app/demo-app/demo-app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export class DemoApp {
{name: 'Portal', route: 'portal'},
{name: 'Projection', route: 'projection'},
{name: 'Progress Bar', route: 'progress-bar'},
{name: 'Progress Circle', route: 'progress-circle'},
{name: 'Progress Spinner', route: 'progress-spinner'},
{name: 'Radio', route: 'radio'},
{name: 'Ripple', route: 'ripple'},
{name: 'Select', route: 'select'},
Expand Down
4 changes: 2 additions & 2 deletions src/demo-app/demo-app/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {CheckboxDemo} from '../checkbox/checkbox-demo';
import {OverlayDemo} from '../overlay/overlay-demo';
import {PortalDemo} from '../portal/portal-demo';
import {ProgressBarDemo} from '../progress-bar/progress-bar-demo';
import {ProgressCircleDemo} from '../progress-circle/progress-circle-demo';
import {ProgressSpinnerDemo} from '../progress-spinner/progress-spinner-demo';
import {SelectDemo} from '../select/select-demo';
import {SidenavDemo} from '../sidenav/sidenav-demo';
import {SlideToggleDemo} from '../slide-toggle/slide-toggle-demo';
Expand Down Expand Up @@ -45,7 +45,7 @@ export const DEMO_APP_ROUTES: Routes = [
{path: 'sidenav', component: SidenavDemo},
{path: 'slide-toggle', component: SlideToggleDemo},
{path: 'slider', component: SliderDemo},
{path: 'progress-circle', component: ProgressCircleDemo},
{path: 'progress-spinner', component: ProgressSpinnerDemo},
{path: 'progress-bar', component: ProgressBarDemo},
{path: 'portal', component: PortalDemo},
{path: 'projection', component: ProjectionDemo},
Expand Down
21 changes: 0 additions & 21 deletions src/demo-app/progress-circle/progress-circle-demo.html

This file was deleted.

21 changes: 21 additions & 0 deletions src/demo-app/progress-spinner/progress-spinner-demo.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<h1>Determinate</h1>
<div class="demo-progress-spinner">
<md-progress-spinner mode="determinate"
[value]="progressValue"
class="md-primary"></md-progress-spinner>
<md-progress-spinner [value]="progressValue"
color="accent"></md-progress-spinner>
</div>
<span>Value: {{progressValue}}</span>
<button md-raised-button (click)="step(10)">Increase</button>
<button md-raised-button (click)="step(-10)">Decrease</button>



<h1>Indeterminate</h1>
<div class="demo-progress-spinner">
<md-progress-spinner mode="indeterminate"></md-progress-spinner>
<md-progress-spinner mode="indeterminate"
color="accent"></md-progress-spinner>
<md-spinner></md-spinner>
</div>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.demo-progress-circle {
.demo-progress-spinner {
width: 100%;

md-progress-circle,
md-progress-spinner,
md-spinner {
display: inline-block;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import {Component} from '@angular/core';

@Component({
moduleId: module.id,
selector: 'progress-circle-demo',
templateUrl: 'progress-circle-demo.html',
styleUrls: ['progress-circle-demo.css'],
selector: 'progress-spinner-demo',
templateUrl: 'progress-spinner-demo.html',
styleUrls: ['progress-spinner-demo.css'],
})
export class ProgressCircleDemo {
export class ProgressSpinnerDemo {
progressValue: number = 40;

step(val: number) {
Expand Down
4 changes: 2 additions & 2 deletions src/e2e-app/e2e-app-module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {DialogE2E, TestDialog} from './dialog/dialog-e2e';
import {GridListE2E} from './grid-list/grid-list-e2e';
import {ListE2E} from './list/list-e2e';
import {ProgressBarE2E} from './progress-bar/progress-bar-e2e';
import {ProgressCircleE2E} from './progress-circle/progress-circle-e2e';
import {ProgressSpinnerE2E} from './progress-spinner/progress-spinner-e2e';
import {MaterialModule} from '@angular/material';
import {E2E_APP_ROUTES} from './e2e-app/routes';
import {SlideToggleE2E} from './slide-toggle/slide-toggle-e2e';
Expand All @@ -38,7 +38,7 @@ import {SlideToggleE2E} from './slide-toggle/slide-toggle-e2e';
GridListE2E,
ListE2E,
ProgressBarE2E,
ProgressCircleE2E,
ProgressSpinnerE2E,
SlideToggleE2E
],
bootstrap: [E2EApp],
Expand Down
2 changes: 1 addition & 1 deletion src/e2e-app/e2e-app/e2e-app.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<a md-list-item [routerLink]="['list']">List</a>
<a md-list-item [routerLink]="['menu']">Menu</a>
<a md-list-item [routerLink]="['progress-bar']">Progress bar</a>
<a md-list-item [routerLink]="['progress-circle']">Progress circle</a>
<a md-list-item [routerLink]="['progress-spinner']">Progress Spinner</a>
<a md-list-item [routerLink]="['radio']">Radios</a>
<a md-list-item [routerLink]="['slide-toggle']">Slide Toggle</a>
<a md-list-item [routerLink]="['tabs']">Tabs</a>
Expand Down
4 changes: 2 additions & 2 deletions src/e2e-app/e2e-app/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {DialogE2E} from '../dialog/dialog-e2e';
import {GridListE2E} from '../grid-list/grid-list-e2e';
import {ListE2E} from '../list/list-e2e';
import {ProgressBarE2E} from '../progress-bar/progress-bar-e2e';
import {ProgressCircleE2E} from '../progress-circle/progress-circle-e2e';
import {ProgressSpinnerE2E} from '../progress-spinner/progress-spinner-e2e';
import {SlideToggleE2E} from '../slide-toggle/slide-toggle-e2e';

export const E2E_APP_ROUTES: Routes = [
Expand All @@ -25,6 +25,6 @@ export const E2E_APP_ROUTES: Routes = [
{path: 'grid-list', component: GridListE2E},
{path: 'list', component: ListE2E},
{path: 'progress-bar', component: ProgressBarE2E},
{path: 'progress-circle', component: ProgressCircleE2E},
{path: 'progress-spinner', component: ProgressSpinnerE2E},
{path: 'slide-toggle', component: SlideToggleE2E}
];
3 changes: 0 additions & 3 deletions src/e2e-app/progress-circle/progress-circle-e2e.html

This file was deleted.

8 changes: 0 additions & 8 deletions src/e2e-app/progress-circle/progress-circle-e2e.ts

This file was deleted.

3 changes: 3 additions & 0 deletions src/e2e-app/progress-spinner/progress-spinner-e2e.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<md-progress-spinner [value]="57"></md-progress-spinner>
<md-progress-spinner mode="indeterminate"></md-progress-spinner>
<md-spinner></md-spinner>
8 changes: 8 additions & 0 deletions src/e2e-app/progress-spinner/progress-spinner-e2e.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import {Component} from '@angular/core';

@Component({
moduleId: module.id,
selector: 'progress-spinner-e2e',
templateUrl: 'progress-spinner-e2e.html',
})
export class ProgressSpinnerE2E { }
4 changes: 2 additions & 2 deletions src/lib/core/theming/_all-theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
@import '../../list/list-theme';
@import '../../menu/menu-theme';
@import '../../progress-bar/progress-bar-theme';
@import '../../progress-circle/progress-circle-theme';
@import '../../progress-spinner/progress-spinner-theme';
@import '../../radio/radio-theme';
@import '../../select/select-theme';
@import '../../sidenav/sidenav-theme';
Expand All @@ -40,7 +40,7 @@
@include md-list-theme($theme);
@include md-menu-theme($theme);
@include md-progress-bar-theme($theme);
@include md-progress-circle-theme($theme);
@include md-progress-spinner-theme($theme);
@include md-radio-theme($theme);
@include md-select-theme($theme);
@include md-sidenav-theme($theme);
Expand Down
2 changes: 1 addition & 1 deletion src/lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export * from './input/index';
export * from './list/index';
export * from './menu/index';
export * from './progress-bar/index';
export * from './progress-circle/index';
export * from './progress-spinner/index';
export * from './radio/index';
export * from './select/index';
export * from './sidenav/index';
Expand Down
6 changes: 3 additions & 3 deletions src/lib/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import {MdGridListModule} from './grid-list/index';
import {MdCardModule} from './card/index';
import {MdChipsModule} from './chips/index';
import {MdIconModule} from './icon/index';
import {MdProgressCircleModule} from './progress-circle/index';
import {MdProgressSpinnerModule} from './progress-spinner/index';
import {MdProgressBarModule} from './progress-bar/index';
import {MdInputModule} from './input/index';
import {MdSnackBarModule} from './snack-bar/snack-bar';
Expand All @@ -50,7 +50,7 @@ const MATERIAL_MODULES = [
MdListModule,
MdMenuModule,
MdProgressBarModule,
MdProgressCircleModule,
MdProgressSpinnerModule,
MdRadioModule,
MdRippleModule,
MdSelectModule,
Expand Down Expand Up @@ -82,7 +82,7 @@ const MATERIAL_MODULES = [
MdInputModule.forRoot(),
MdListModule.forRoot(),
MdProgressBarModule.forRoot(),
MdProgressCircleModule.forRoot(),
MdProgressSpinnerModule.forRoot(),
MdRippleModule.forRoot(),
MdSelectModule.forRoot(),
MdSidenavModule.forRoot(),
Expand Down
1 change: 0 additions & 1 deletion src/lib/progress-circle/index.ts

This file was deleted.

File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
@import '../core/theming/theming';


@mixin md-progress-circle-theme($theme) {
@mixin md-progress-spinner-theme($theme) {
$primary: map-get($theme, primary);
$accent: map-get($theme, accent);
$warn: map-get($theme, warn);

md-progress-circle, md-spinner {
md-progress-spinner, md-progress-circle, md-spinner {
path {
stroke: md-color($primary, 600);
}
Expand Down
2 changes: 2 additions & 0 deletions src/lib/progress-spinner/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from './progress-circle';
export * from './progress-spinner';
4 changes: 4 additions & 0 deletions src/lib/progress-spinner/progress-circle.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/** @deprecated */
export {MdProgressSpinner as MdProgressCircle} from './progress-spinner';
/** @deprecated */
export {MdProgressSpinnerModule as MdProgressCircleModule} from './progress-spinner';
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,22 @@


// Animation Durations
$md-progress-circle-duration: 5250ms !default;
$md-progress-circle-constant-rotate-duration: $md-progress-circle-duration * 0.55 !default;
$md-progress-circle-sporadic-rotate-duration: $md-progress-circle-duration !default;
$md-progress-spinner-duration: 5250ms !default;
$md-progress-spinner-constant-rotate-duration: $md-progress-spinner-duration * 0.55 !default;
$md-progress-spinner-sporadic-rotate-duration: $md-progress-spinner-duration !default;

// Component sizing
$md-progress-circle-stroke-width: 10px !default;
// Height and weight of the viewport for md-progress-circle.
$md-progress-circle-viewport-size: 100px !default;
$md-progress-spinner-stroke-width: 10px !default;
// Height and weight of the viewport for md-progress-spinner.
$md-progress-spinner-viewport-size: 100px !default;


:host {
display: block;
// Height and width are provided for md-progress-circle to act as a default.
// Height and width are provided for md-progress-spinner to act as a default.
// The height and width are expected to be overwritten by application css.
height: $md-progress-circle-viewport-size;
width: $md-progress-circle-viewport-size;
height: $md-progress-spinner-viewport-size;
width: $md-progress-spinner-viewport-size;
overflow: hidden;

// SVG's viewBox is defined as 0 0 100 100, this means that all SVG children will placed
Expand All @@ -34,15 +34,15 @@ $md-progress-circle-viewport-size: 100px !default;
fill: transparent;

// Stroke width of 10px defines stroke as 10% of the viewBox.
stroke-width: $md-progress-circle-stroke-width;
stroke-width: $md-progress-spinner-stroke-width;
}


&[mode='indeterminate'] svg {
animation-duration: $md-progress-circle-sporadic-rotate-duration,
$md-progress-circle-constant-rotate-duration;
animation-name: md-progress-circle-sporadic-rotate,
md-progress-circle-linear-rotate;
animation-duration: $md-progress-spinner-sporadic-rotate-duration,
$md-progress-spinner-constant-rotate-duration;
animation-name: md-progress-spinner-sporadic-rotate,
md-progress-spinner-linear-rotate;
animation-timing-function: $ease-in-out-curve-function,
linear;
animation-iteration-count: infinite;
Expand All @@ -52,11 +52,11 @@ $md-progress-circle-viewport-size: 100px !default;


// Animations for indeterminate mode
@keyframes md-progress-circle-linear-rotate {
@keyframes md-progress-spinner-linear-rotate {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
@keyframes md-progress-circle-sporadic-rotate {
@keyframes md-progress-spinner-sporadic-rotate {
12.5% { transform: rotate( 135deg); }
25% { transform: rotate( 270deg); }
37.5% { transform: rotate( 405deg); }
Expand Down
Loading

0 comments on commit 221c234

Please sign in to comment.