mirror of
https://github.com/Redocly/redoc.git
synced 2025-02-07 13:30:33 +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: `
|
||||
<span [style.width]='progress + "%"'> </span>
|
||||
`,
|
||||
styles: [`
|
||||
: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;
|
||||
}
|
||||
`]
|
||||
styleUrls: ['loading-bar.scss']
|
||||
})
|
||||
export class LoadingBar implements OnChanges {
|
||||
@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({
|
||||
selector: 'drop-down',
|
||||
template: `
|
||||
<select (change)=onChange($event.target.value)>
|
||||
<ng-content></ng-content>
|
||||
</select>
|
||||
`,
|
||||
templateUrl: 'drop-down.html',
|
||||
styleUrls: ['./drop-down.css']
|
||||
})
|
||||
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({
|
||||
selector: 'tabs',
|
||||
template: `
|
||||
<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>
|
||||
`,
|
||||
templateUrl: 'tabs.html',
|
||||
styleUrls: ['tabs.css'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush
|
||||
})
|
||||
|
@ -63,23 +57,8 @@ export class Tabs implements OnInit {
|
|||
|
||||
@Component({
|
||||
selector: 'tab',
|
||||
template: `
|
||||
<div class="tab-wrap" [ngClass]="{'active': active}">
|
||||
<ng-content></ng-content>
|
||||
</div>
|
||||
`,
|
||||
styles: [`
|
||||
:host {
|
||||
display: block;
|
||||
}
|
||||
.tab-wrap {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.tab-wrap.active {
|
||||
display: block;
|
||||
}`
|
||||
]
|
||||
templateUrl: 'tab.html',
|
||||
styleUrls: ['tab.css']
|
||||
})
|
||||
export class Tab {
|
||||
@Input() active: boolean = false;
|
||||
|
|
Loading…
Reference in New Issue
Block a user