-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
177 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 0 additions & 6 deletions
6
projects/ngx-explorer/src/lib/components/breadcrumbs/breadcrumbs.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 10 additions & 3 deletions
13
projects/ngx-explorer/src/lib/components/explorer/explorer.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,15 @@ | ||
<div class="nxe-explorer-container"> | ||
<nxe-menu-bar></nxe-menu-bar> | ||
<nxe-breadcrumbs></nxe-breadcrumbs> | ||
<nxe-second-menu-bar></nxe-second-menu-bar> | ||
<div class="nxe-explorer-view-container"> | ||
<!-- <nxe-icons></nxe-icons> --> | ||
<nxe-list></nxe-list> | ||
|
||
<ng-container *ngIf="view === avialableView.Icon"> | ||
<nxe-icons></nxe-icons> | ||
</ng-container> | ||
|
||
<ng-container *ngIf="view === avialableView.List"> | ||
<nxe-list></nxe-list> | ||
</ng-container> | ||
|
||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
projects/ngx-explorer/src/lib/components/second-menu-bar/second-menu-bar.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<div class="nxe-second-menu-bar"> | ||
<div class="nxe-second-menu-bar-left"> | ||
<nxe-breadcrumbs></nxe-breadcrumbs> | ||
</div> | ||
<div class="nxe-second-menu-bar-right"> | ||
<nxe-view-switcher></nxe-view-switcher> | ||
</div> | ||
|
||
</div> |
10 changes: 10 additions & 0 deletions
10
projects/ngx-explorer/src/lib/components/second-menu-bar/second-menu-bar.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
.nxe-second-menu-bar { | ||
display: flex; | ||
border: solid #ccc; | ||
border-width: 0 0 1px 0; | ||
|
||
.nxe-second-menu-bar-left { | ||
flex-grow: 1; | ||
} | ||
|
||
} |
25 changes: 25 additions & 0 deletions
25
projects/ngx-explorer/src/lib/components/second-menu-bar/second-menu-bar.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { SecondMenuBarComponent } from './second-menu-bar.component'; | ||
|
||
describe('SecondMenuBarComponent', () => { | ||
let component: SecondMenuBarComponent; | ||
let fixture: ComponentFixture<SecondMenuBarComponent>; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [ SecondMenuBarComponent ] | ||
}) | ||
.compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(SecondMenuBarComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
10 changes: 10 additions & 0 deletions
10
projects/ngx-explorer/src/lib/components/second-menu-bar/second-menu-bar.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { Component, ViewEncapsulation } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'nxe-second-menu-bar', | ||
templateUrl: './second-menu-bar.component.html', | ||
styleUrls: ['./second-menu-bar.component.scss'], | ||
encapsulation: ViewEncapsulation.None | ||
}) | ||
export class SecondMenuBarComponent { | ||
} |
4 changes: 4 additions & 0 deletions
4
projects/ngx-explorer/src/lib/components/view-switcher/view-switcher.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<div class="nxe-view-switcher"> | ||
<button (click)="setView(avialableView.Icon)"><i class="fa fa-th" aria-hidden="true"></i></button> | ||
<button (click)="setView(avialableView.List)"><i class="fa fa-list" aria-hidden="true"></i></button> | ||
</div> |
24 changes: 24 additions & 0 deletions
24
projects/ngx-explorer/src/lib/components/view-switcher/view-switcher.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
.nxe-view-switcher { | ||
padding: 10px; | ||
|
||
button { | ||
cursor: pointer; | ||
padding: 5px 5px; | ||
border-radius: 5px; | ||
background: transparent; | ||
border: 0; | ||
font-family: inherit; | ||
font-size: inherit; | ||
font-weight: inherit; | ||
|
||
i { | ||
&.fa { | ||
-webkit-text-stroke: 1px white; | ||
} | ||
} | ||
|
||
&:hover { | ||
background-color: #d7edff; | ||
} | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
projects/ngx-explorer/src/lib/components/view-switcher/view-switcher.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { ViewSwitcherComponent } from './view-switcher.component.ts'; | ||
|
||
describe('ViewSwitcherComponent', () => { | ||
let component: ViewSwitcherComponent; | ||
let fixture: ComponentFixture<ViewSwitcherComponent>; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [ ViewSwitcherComponent ] | ||
}) | ||
.compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(ViewSwitcherComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
23 changes: 23 additions & 0 deletions
23
projects/ngx-explorer/src/lib/components/view-switcher/view-switcher.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { Component, Inject, ViewEncapsulation } from '@angular/core'; | ||
import { AvialableView } from 'ngx-explorer'; | ||
import { BehaviorSubject } from 'rxjs'; | ||
import { CURRENT_VIEW } from '../../injection-tokens/current-view.token'; | ||
|
||
@Component({ | ||
selector: 'nxe-view-switcher', | ||
templateUrl: './view-switcher.component.html', | ||
styleUrls: ['./view-switcher.component.scss'], | ||
encapsulation: ViewEncapsulation.None | ||
}) | ||
export class ViewSwitcherComponent { | ||
|
||
public avialableView = AvialableView; | ||
|
||
constructor(@Inject(CURRENT_VIEW) private currentView: BehaviorSubject<AvialableView>) { | ||
} | ||
|
||
setView(view: AvialableView) { | ||
this.currentView.next(view); | ||
} | ||
|
||
} |
8 changes: 8 additions & 0 deletions
8
projects/ngx-explorer/src/lib/injection-tokens/current-view.token.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { InjectionToken } from '@angular/core'; | ||
import { BehaviorSubject } from 'rxjs'; | ||
import { AvialableView } from '../common/types'; | ||
|
||
export const CURRENT_VIEW = new InjectionToken<BehaviorSubject<AvialableView>>('CURRENT_VIEW', { | ||
providedIn: 'root', | ||
factory: () => new BehaviorSubject(AvialableView.Icon), | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters