This repository has been archived by the owner on Dec 8, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* starting files for list-toolbar * Add standalone toolbar component Also: - tweak input-group and search styles to not use table display since we can use flex instead. - Used toolbar component in search demo. TODO: - toolbar unit tests - toolbar visual tests - toolbar docs - use toolbar in list-toolbar component * Remove list-toolbar stuff and add unit tests for standalone toolbar * Update search screenshots for new input group styles and toolbar component
- Loading branch information
1 parent
a37d2ed
commit 830c51c
Showing
35 changed files
with
273 additions
and
67 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<sky-demo-page title="Toolbar"> | ||
<sky-demo-page-summary> | ||
The toolbar component displays a SKY UX-themed toolbar. The <code>sky-toolbar</code> component should be used in conjunction with the <code>sky-toolbar-item</code> child component. | ||
</sky-demo-page-summary> | ||
|
||
<sky-demo-page-example> | ||
<sky-toolbar-demo></sky-toolbar-demo> | ||
<sky-demo-page-code demoName="Toolbar"></sky-demo-page-code> | ||
</sky-demo-page-example> | ||
|
||
</sky-demo-page> |
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 @@ | ||
<sky-toolbar> | ||
<sky-toolbar-item> | ||
<button class="sky-btn sky-btn-default">Button 1</button> | ||
</sky-toolbar-item> | ||
<sky-toolbar-item> | ||
<button class="sky-btn sky-btn-default">Button 2</button> | ||
</sky-toolbar-item> | ||
</sky-toolbar> |
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 @@ | ||
import { Component } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'sky-toolbar-demo', | ||
templateUrl: './toolbar-demo.component.html' | ||
}) | ||
export class SkyToolbarDemoComponent { | ||
|
||
} |
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
36 changes: 13 additions & 23 deletions
36
src/modules/search/fixtures/search.component.visual-fixture.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,36 +1,26 @@ | ||
<style type="text/css"> | ||
.sky-search-docs-inline { | ||
display: inline-block; | ||
margin-bottom: 0; | ||
vertical-align: middle; | ||
} | ||
input.sky-form-control.sky-search-input { | ||
color: transparent; | ||
text-shadow: 0px 0px 0px #000; | ||
} | ||
|
||
.sky-search-docs-toolbar { | ||
padding: 5px; | ||
position: relative; | ||
} | ||
|
||
</style> | ||
|
||
<div style="background-color: #fff;"> | ||
<div id="screenshot-search-full"> | ||
<div class="sky-search-docs-toolbar"> | ||
<div class="sky-search-docs-inline"> | ||
<button | ||
type="button" | ||
(click)="applySearchText('Robert')" | ||
class="sky-btn sky-btn-secondary"> | ||
Set search text | ||
</button> | ||
</div> | ||
<div id="screenshot-search-full"> | ||
<sky-toolbar> | ||
<sky-toolbar-item> | ||
<button | ||
type="button" | ||
(click)="applySearchText('Robert')" | ||
class="sky-btn sky-btn-secondary"> | ||
Set search text | ||
</button> | ||
</sky-toolbar-item> | ||
<sky-toolbar-item> | ||
<sky-search | ||
[searchText]="searchText" | ||
(searchApply)="applySearchText(searchText)"> | ||
</sky-search> | ||
</div> | ||
</div> | ||
</sky-toolbar-item> | ||
</sky-toolbar> | ||
</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
10 changes: 10 additions & 0 deletions
10
src/modules/toolbar/fixtures/toolbar.component.fixture.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,10 @@ | ||
<div id="screenshot-toolbar"> | ||
<sky-toolbar> | ||
<sky-toolbar-item> | ||
<button class="sky-btn sky-btn-default">Button 1</button> | ||
</sky-toolbar-item> | ||
<sky-toolbar-item> | ||
<button class="sky-btn sky-btn-default">Button 2</button> | ||
</sky-toolbar-item> | ||
</sky-toolbar> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { Component } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'sky-test-cmp', | ||
templateUrl: './toolbar.component.fixture.html' | ||
}) | ||
export class ToolbarTestComponent { | ||
} |
10 changes: 10 additions & 0 deletions
10
src/modules/toolbar/fixtures/toolbar.component.visual-fixture.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,10 @@ | ||
<div id="screenshot-toolbar"> | ||
<sky-toolbar> | ||
<sky-toolbar-item> | ||
<button class="sky-btn sky-btn-default">Button 1</button> | ||
</sky-toolbar-item> | ||
<sky-toolbar-item> | ||
<button class="sky-btn sky-btn-default">Button 2</button> | ||
</sky-toolbar-item> | ||
</sky-toolbar> | ||
</div> |
29 changes: 29 additions & 0 deletions
29
src/modules/toolbar/fixtures/toolbar.component.visual-fixture.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,29 @@ | ||
import { Component, NgModule } from '@angular/core'; | ||
import { BrowserModule } from '@angular/platform-browser'; | ||
|
||
import { SkyModule } from '../../../../src/core'; | ||
|
||
import { Bootstrapper } from '../../../../visual/bootstrapper'; | ||
|
||
@Component({ | ||
selector: 'sky-demo-app', | ||
templateUrl: './toolbar.component.visual-fixture.html' | ||
}) | ||
class AppComponent { | ||
} | ||
|
||
@NgModule({ | ||
imports: [ | ||
BrowserModule, | ||
SkyModule | ||
], | ||
declarations: [ | ||
AppComponent | ||
], | ||
bootstrap: [ | ||
AppComponent | ||
] | ||
}) | ||
class AppModule { } | ||
|
||
Bootstrapper.bootstrapModule(AppModule); |
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,3 @@ | ||
export { SkyToolbarComponent } from './toolbar.component'; | ||
export { SkyToolbarItemComponent } from './toolbar-item.component'; | ||
export { SkyToolbarModule } from './toolbar.module'; |
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,3 @@ | ||
<div class="sky-toolbar-item"> | ||
<ng-content></ng-content> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
@import '../../scss/mixins'; | ||
|
||
.sky-toolbar-item { | ||
margin-right: $sky-margin-half; | ||
} |
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,12 @@ | ||
import { | ||
Component | ||
} from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'sky-toolbar-item', | ||
styleUrls: ['./toolbar-item.component.scss'], | ||
templateUrl: './toolbar-item.component.html' | ||
}) | ||
export class SkyToolbarItemComponent { | ||
|
||
} |
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,3 @@ | ||
<div class="sky-toolbar-container"> | ||
<ng-content></ng-content> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
@import '../../scss/mixins'; | ||
|
||
.sky-toolbar-container { | ||
min-height: $sky-toolbar-min-height; | ||
background-color: $sky-toolbar-background-color; | ||
padding: $sky-padding-half $sky-padding; | ||
@include sky-border(dark, top, bottom); | ||
display: flex; | ||
align-items: center; | ||
position: relative; | ||
} |
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,38 @@ | ||
import { | ||
TestBed | ||
} from '@angular/core/testing'; | ||
|
||
import { BrowserModule } from '@angular/platform-browser'; | ||
|
||
import { ToolbarTestComponent } from './fixtures/toolbar.component.fixture'; | ||
|
||
import { SkyToolbarModule } from '.'; | ||
|
||
import { expect } from '../testing'; | ||
|
||
describe('toolbar component', () => { | ||
beforeEach(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [ | ||
ToolbarTestComponent | ||
], | ||
imports: [ | ||
BrowserModule, | ||
SkyToolbarModule | ||
] | ||
}); | ||
}); | ||
|
||
it('should create a toolbar with transcluded items', () => { | ||
let fixture = TestBed.createComponent(ToolbarTestComponent); | ||
let el = fixture.nativeElement as HTMLElement; | ||
|
||
fixture.detectChanges(); | ||
|
||
let buttonEls = el.querySelectorAll('.sky-toolbar-container .sky-toolbar-item .sky-btn'); | ||
|
||
expect(buttonEls.item(0)).toHaveText('Button 1'); | ||
expect(buttonEls.item(1)).toHaveText('Button 2'); | ||
|
||
}); | ||
}); |
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,12 @@ | ||
import { | ||
Component | ||
} from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'sky-toolbar', | ||
styleUrls: ['./toolbar.component.scss'], | ||
templateUrl: './toolbar.component.html' | ||
}) | ||
export class SkyToolbarComponent { | ||
|
||
} |
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,13 @@ | ||
describe('Toolbar', function () { | ||
'use strict'; | ||
|
||
it('should match previous toolbar screenshot', function () { | ||
return browser | ||
.setupTest('/toolbar.html') | ||
.compareScreenshot({ | ||
screenshotName: 'toolbar', | ||
selector: '#screenshot-toolbar', | ||
checkAccessibility: true | ||
}); | ||
}); | ||
}); |
Oops, something went wrong.