Skip to content

Commit dc57f7e

Browse files
committed
chore(): format
1 parent 2a1718b commit dc57f7e

14 files changed

+101
-89
lines changed

.prettierrc

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"singleQuote": true
3+
}

package-lock.json

+8-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
"test": "ng test",
2727
"lint": "ng lint",
2828
"e2e": "ng e2e",
29+
"format": "prettier --write \"src/**/*{.ts,.scss}\"",
30+
"format:plugin": "prettier --write \"projects/**/*{.ts,.scss}\"",
2931
"build:plugin": "ng build lottie",
3032
"build:prod:plugin": "ng build lottie --prod && cp README.md dist/@fivethree/lottie/.",
3133
"version": "conventional-changelog -p angular -i CHANGELOG.md -s"
@@ -58,9 +60,9 @@
5860
"@angular/compiler-cli": "7.2.11",
5961
"@angular/language-service": "7.2.11",
6062
"@ionic/angular-toolkit": "1.5.0",
61-
"@types/node": "10.12.24",
6263
"@types/jasmine": "3.3.10",
6364
"@types/jasminewd2": "2.0.6",
65+
"@types/node": "10.12.24",
6466
"codelyzer": "4.5.0",
6567
"jasmine-core": "3.3.0",
6668
"jasmine-spec-reporter": "4.2.1",
@@ -70,6 +72,7 @@
7072
"karma-jasmine": "2.0.1",
7173
"karma-jasmine-html-reporter": "1.4.0",
7274
"ng-packagr": "4.7.1",
75+
"prettier": "~1.18.2",
7376
"protractor": "5.4.2",
7477
"ts-node": "8.0.3",
7578
"tsickle": "0.34.3",

projects/lottie/src/lib/lottie.component.ts

+13-6
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,19 @@ import { isPlatformServer } from '@angular/common';
1616
@Component({
1717
selector: 'fiv-lottie',
1818
template: `
19-
<div #lottieContainer [ngStyle]="{'width': viewWidth, 'height': viewHeight, 'overflow':'hidden', 'margin': '0 auto'}">
20-
</div>
19+
<div
20+
#lottieContainer
21+
[ngStyle]="{
22+
width: viewWidth,
23+
height: viewHeight,
24+
overflow: 'hidden',
25+
margin: '0 auto'
26+
}"
27+
></div>
2128
`,
2229
styles: []
2330
})
2431
export class LottieComponent implements OnInit {
25-
2632
@Input() params: LottieParams;
2733
@Input() width: number;
2834
@Input() height: number;
@@ -36,10 +42,12 @@ export class LottieComponent implements OnInit {
3642

3743
private _params: LottieParams;
3844

39-
constructor(@Inject(PLATFORM_ID) private platformId: string) { }
45+
constructor(@Inject(PLATFORM_ID) private platformId: string) {}
4046

4147
ngOnInit() {
42-
if (isPlatformServer(this.platformId)) { return; }
48+
if (isPlatformServer(this.platformId)) {
49+
return;
50+
}
4351

4452
this._params = {
4553
autoplay: this.params.autoplay,
@@ -61,5 +69,4 @@ export class LottieComponent implements OnInit {
6169
this.animationCreated.emit(animation);
6270
});
6371
}
64-
6572
}

projects/lottie/src/lib/lottie.module.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ import { LottieComponent } from './lottie.component';
77
imports: [CommonModule],
88
exports: [LottieComponent]
99
})
10-
export class LottieModule { }
10+
export class LottieModule {}

projects/lottie/src/lib/symbols.ts

+60-60
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,68 @@
11
export interface LottieParams {
2-
autoplay?: boolean;
3-
animationData?: any;
4-
container?: any;
5-
loop?: boolean | number;
6-
name?: string;
7-
path: string;
8-
renderer?: 'svg' | 'canvas' | 'html';
9-
rendererSettings?: LottieRenderSettings;
2+
autoplay?: boolean;
3+
animationData?: any;
4+
container?: any;
5+
loop?: boolean | number;
6+
name?: string;
7+
path: string;
8+
renderer?: 'svg' | 'canvas' | 'html';
9+
rendererSettings?: LottieRenderSettings;
1010
}
1111

1212
export interface LottieRenderSettings {
13-
context: any;
14-
scaleMode: 'noScale' | string;
15-
clearCanvas: boolean;
16-
progressiveLoad: boolean;
17-
hideOnTransparent: boolean;
18-
className: string;
13+
context: any;
14+
scaleMode: 'noScale' | string;
15+
clearCanvas: boolean;
16+
progressiveLoad: boolean;
17+
hideOnTransparent: boolean;
18+
className: string;
1919
}
2020

2121
export interface LottieAnimation {
22-
/**
23-
* @param name to target a specific animation
24-
*/
25-
play(name?: string): void;
26-
/**
27-
* @param name to target a specific animation
28-
*/
29-
pause(name?: string): void;
30-
/**
31-
* @param name to target a specific animation
32-
*/
33-
stop(name?: string): void;
34-
destroy(): void;
35-
/**
36-
* @param href usually pass as location.href. Its useful when you experience mask issue in safari where your url does not have # symbol.
37-
*/
38-
setLocationHref(href: string);
39-
/**
40-
* @param speed 1 is normal speed, plays reverse if minus
41-
* @param name to target a specific animation
42-
*/
43-
setSpeed(speed: number, name?: string);
44-
/**
45-
* @param value frame value
46-
* @param isFrame defines if first argument is a time based value or a frame based (default false)
47-
*/
48-
goToAndStop(value: number, isFrame?: boolean);
49-
/**
50-
* @param value frame value
51-
* @param isFrame defines if first argument is a time based value or a frame based (default false)
52-
*/
53-
goToAndPlay(value: number, isFrame?: boolean);
54-
/**
55-
* @param direction 1 is forward, -1 is reverse
56-
*/
57-
setDirection(direction: 1 | -1);
58-
/**
59-
* @param inFrames If true, returns duration in frames, if false, in seconds
60-
*/
61-
getDuration(inFrames?: boolean): number;
62-
/**
63-
* @param segments Can contain 2 numeric values that will be used as first and last frame of the animation.
64-
* Or can contain a sequence of arrays each with 2 numeric values.
65-
* @param forceFlag If set to false, it will wait until the current segment is complete. If true, it will update values immediately.
66-
*/
67-
playSegments(segments: any[], forceFlag?: boolean);
22+
/**
23+
* @param name to target a specific animation
24+
*/
25+
play(name?: string): void;
26+
/**
27+
* @param name to target a specific animation
28+
*/
29+
pause(name?: string): void;
30+
/**
31+
* @param name to target a specific animation
32+
*/
33+
stop(name?: string): void;
34+
destroy(): void;
35+
/**
36+
* @param href usually pass as location.href. Its useful when you experience mask issue in safari where your url does not have # symbol.
37+
*/
38+
setLocationHref(href: string);
39+
/**
40+
* @param speed 1 is normal speed, plays reverse if minus
41+
* @param name to target a specific animation
42+
*/
43+
setSpeed(speed: number, name?: string);
44+
/**
45+
* @param value frame value
46+
* @param isFrame defines if first argument is a time based value or a frame based (default false)
47+
*/
48+
goToAndStop(value: number, isFrame?: boolean);
49+
/**
50+
* @param value frame value
51+
* @param isFrame defines if first argument is a time based value or a frame based (default false)
52+
*/
53+
goToAndPlay(value: number, isFrame?: boolean);
54+
/**
55+
* @param direction 1 is forward, -1 is reverse
56+
*/
57+
setDirection(direction: 1 | -1);
58+
/**
59+
* @param inFrames If true, returns duration in frames, if false, in seconds
60+
*/
61+
getDuration(inFrames?: boolean): number;
62+
/**
63+
* @param segments Can contain 2 numeric values that will be used as first and last frame of the animation.
64+
* Or can contain a sequence of arrays each with 2 numeric values.
65+
* @param forceFlag If set to false, it will wait until the current segment is complete. If true, it will update values immediately.
66+
*/
67+
playSegments(segments: any[], forceFlag?: boolean);
6868
}

src/app/app-routing.module.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ import { Routes, RouterModule } from '@angular/router';
33

44
const routes: Routes = [
55
{ path: '', redirectTo: 'home', pathMatch: 'full' },
6-
{ path: 'home', loadChildren: './home/home.module#HomePageModule' },
6+
{ path: 'home', loadChildren: './home/home.module#HomePageModule' }
77
];
88

99
@NgModule({
1010
imports: [RouterModule.forRoot(routes)],
1111
exports: [RouterModule]
1212
})
13-
export class AppRoutingModule { }
13+
export class AppRoutingModule {}

src/app/app.component.spec.ts

+2-4
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import { StatusBar } from '@ionic-native/status-bar/ngx';
88
import { AppComponent } from './app.component';
99

1010
describe('AppComponent', () => {
11-
1211
let statusBarSpy, splashScreenSpy, platformReadySpy, platformSpy;
1312

1413
beforeEach(async(() => {
@@ -23,8 +22,8 @@ describe('AppComponent', () => {
2322
providers: [
2423
{ provide: StatusBar, useValue: statusBarSpy },
2524
{ provide: SplashScreen, useValue: splashScreenSpy },
26-
{ provide: Platform, useValue: platformSpy },
27-
],
25+
{ provide: Platform, useValue: platformSpy }
26+
]
2827
}).compileComponents();
2928
}));
3029

@@ -43,5 +42,4 @@ describe('AppComponent', () => {
4342
});
4443

4544
// TODO: add more tests!
46-
4745
});

src/app/home/home.module.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
import { NgModule } from '@angular/core';
32
import { CommonModule } from '@angular/common';
43
import { IonicModule } from '@ionic/angular';
@@ -23,4 +22,4 @@ import { LottieModule } from '@fivethree/lottie';
2322
],
2423
declarations: [HomePage]
2524
})
26-
export class HomePageModule { }
25+
export class HomePageModule {}

src/app/home/home.page.scss

-1
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-

src/app/home/home.page.spec.ts

+3-4
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,9 @@ describe('HomePage', () => {
99

1010
beforeEach(async(() => {
1111
TestBed.configureTestingModule({
12-
declarations: [ HomePage ],
13-
schemas: [CUSTOM_ELEMENTS_SCHEMA],
14-
})
15-
.compileComponents();
12+
declarations: [HomePage],
13+
schemas: [CUSTOM_ELEMENTS_SCHEMA]
14+
}).compileComponents();
1615
}));
1716

1817
beforeEach(() => {

src/app/home/home.page.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@ import { LottieAnimation, LottieParams } from '@fivethree/lottie';
55
@Component({
66
selector: 'app-home',
77
templateUrl: 'home.page.html',
8-
styleUrls: ['home.page.scss'],
8+
styleUrls: ['home.page.scss']
99
})
1010
export class HomePage {
11-
1211
lottieParams: LottieParams = {
1312
path: 'assets/lottie/empty_box.json',
1413
renderer: 'svg',
@@ -19,7 +18,6 @@ export class HomePage {
1918
onAnimationCreated(animation: LottieAnimation) {
2019
// animation.play();
2120
// animation.setSpeed(0.8);
22-
2321
// timer(1000).subscribe(() => animation.pause());
2422
}
2523
}

src/main.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@ if (environment.production) {
88
enableProdMode();
99
}
1010

11-
platformBrowserDynamic().bootstrapModule(AppModule)
11+
platformBrowserDynamic()
12+
.bootstrapModule(AppModule)
1213
.catch(err => console.log(err));

src/polyfills.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,7 @@
8181
/***************************************************************************************************
8282
* Zone JS is required by default for Angular itself.
8383
*/
84-
import 'zone.js/dist/zone'; // Included with Angular CLI.
85-
84+
import 'zone.js/dist/zone'; // Included with Angular CLI.
8685

8786
/***************************************************************************************************
8887
* APPLICATION IMPORTS

0 commit comments

Comments
 (0)