mirror of
https://github.com/Redocly/redoc.git
synced 2025-02-07 21:40:32 +03:00
Move some templates + css into separate files
This commit is contained in:
parent
899c2b8398
commit
58ccf3938d
21
lib/components/LoadingBar/loading-bar.scss
Normal file
21
lib/components/LoadingBar/loading-bar.scss
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
:host {
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
display: block;
|
||||||
|
|
||||||
|
height: 5px;
|
||||||
|
z-index: 100;
|
||||||
|
}
|
||||||
|
|
||||||
|
span {
|
||||||
|
display: block;
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
bottom: 0;
|
||||||
|
right: attr(progress percentage);
|
||||||
|
background-color: #5f7fc3;
|
||||||
|
transition: right 0.2s linear;
|
||||||
|
}
|
|
@ -6,29 +6,7 @@ import { Input, HostBinding, Component, OnChanges } from '@angular/core';
|
||||||
template: `
|
template: `
|
||||||
<span [style.width]='progress + "%"'> </span>
|
<span [style.width]='progress + "%"'> </span>
|
||||||
`,
|
`,
|
||||||
styles: [`
|
styleUrls: ['loading-bar.scss']
|
||||||
:host {
|
|
||||||
position: fixed;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
display: block;
|
|
||||||
|
|
||||||
height: 5px;
|
|
||||||
z-index: 100;
|
|
||||||
}
|
|
||||||
|
|
||||||
span {
|
|
||||||
display: block;
|
|
||||||
position: absolute;
|
|
||||||
left: 0;
|
|
||||||
top: 0;
|
|
||||||
bottom: 0;
|
|
||||||
right: attr(progress percentage);
|
|
||||||
background-color: #5f7fc3;
|
|
||||||
transition: right 0.2s linear;
|
|
||||||
}
|
|
||||||
`]
|
|
||||||
})
|
})
|
||||||
export class LoadingBar implements OnChanges {
|
export class LoadingBar implements OnChanges {
|
||||||
@Input() progress:number = 0;
|
@Input() progress:number = 0;
|
||||||
|
|
3
lib/shared/components/DropDown/drop-down.html
Normal file
3
lib/shared/components/DropDown/drop-down.html
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
<select (change)=onChange($event.target.value)>
|
||||||
|
<ng-content></ng-content>
|
||||||
|
</select>
|
|
@ -5,11 +5,7 @@ import * as DropKick from 'dropkickjs';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'drop-down',
|
selector: 'drop-down',
|
||||||
template: `
|
templateUrl: 'drop-down.html',
|
||||||
<select (change)=onChange($event.target.value)>
|
|
||||||
<ng-content></ng-content>
|
|
||||||
</select>
|
|
||||||
`,
|
|
||||||
styleUrls: ['./drop-down.css']
|
styleUrls: ['./drop-down.css']
|
||||||
})
|
})
|
||||||
export class DropDown implements AfterContentInit {
|
export class DropDown implements AfterContentInit {
|
||||||
|
|
3
lib/shared/components/Tabs/tab.html
Normal file
3
lib/shared/components/Tabs/tab.html
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
<div class="tab-wrap" [ngClass]="{'active': active}">
|
||||||
|
<ng-content></ng-content>
|
||||||
|
</div>
|
10
lib/shared/components/Tabs/tab.scss
Normal file
10
lib/shared/components/Tabs/tab.scss
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
:host {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
.tab-wrap {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tab-wrap.active {
|
||||||
|
display: block;
|
||||||
|
}
|
5
lib/shared/components/Tabs/tabs.html
Normal file
5
lib/shared/components/Tabs/tabs.html
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
<ul>
|
||||||
|
<li *ngFor="let tab of tabs" [ngClass]="{active: tab.active}" (click)="selectTab(tab)"
|
||||||
|
class="tab-{{tab.tabStatus}}">{{tab.tabTitle}}</li>
|
||||||
|
</ul>
|
||||||
|
<ng-content></ng-content>
|
|
@ -5,13 +5,7 @@ import { ChangeDetectorRef, ChangeDetectionStrategy } from '@angular/core';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'tabs',
|
selector: 'tabs',
|
||||||
template: `
|
templateUrl: 'tabs.html',
|
||||||
<ul>
|
|
||||||
<li *ngFor="let tab of tabs" [ngClass]="{active: tab.active}" (click)="selectTab(tab)"
|
|
||||||
class="tab-{{tab.tabStatus}}">{{tab.tabTitle}}</li>
|
|
||||||
</ul>
|
|
||||||
<ng-content></ng-content>
|
|
||||||
`,
|
|
||||||
styleUrls: ['tabs.css'],
|
styleUrls: ['tabs.css'],
|
||||||
changeDetection: ChangeDetectionStrategy.OnPush
|
changeDetection: ChangeDetectionStrategy.OnPush
|
||||||
})
|
})
|
||||||
|
@ -63,23 +57,8 @@ export class Tabs implements OnInit {
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'tab',
|
selector: 'tab',
|
||||||
template: `
|
templateUrl: 'tab.html',
|
||||||
<div class="tab-wrap" [ngClass]="{'active': active}">
|
styleUrls: ['tab.css']
|
||||||
<ng-content></ng-content>
|
|
||||||
</div>
|
|
||||||
`,
|
|
||||||
styles: [`
|
|
||||||
:host {
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
.tab-wrap {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tab-wrap.active {
|
|
||||||
display: block;
|
|
||||||
}`
|
|
||||||
]
|
|
||||||
})
|
})
|
||||||
export class Tab {
|
export class Tab {
|
||||||
@Input() active: boolean = false;
|
@Input() active: boolean = false;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user