Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(theme): add progress-bar component #459

Merged
merged 144 commits into from
Jun 7, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
144 commits
Select commit Hold shift + click to select a range
c7c75a0
feat(overview): add overview block (#317)
tibing-old-email Mar 27, 2018
ee41c66
feat(overview): setup live-example renderer
tibing-old-email Mar 28, 2018
376d159
fix(docs): use global tokens
Tibing Apr 19, 2018
166b079
feat(docs): add example renderer
tibing-old-email Apr 21, 2018
4b06cd6
feat(docs): add theme switcher
tibing-old-email Apr 21, 2018
71c4925
feat(docs): new home page (WIP)
nnixaa Apr 23, 2018
0ae204a
feat(docs): responsive styles
nnixaa Apr 23, 2018
3c6eeed
feat(docs): footer fix
nnixaa Apr 23, 2018
fb906ac
feat(docs): icons
nnixaa Apr 23, 2018
872e94c
feat(docs): hove page detailing
nnixaa Apr 24, 2018
3bf1149
feat(docs): docs page (WIP)
nnixaa Apr 24, 2018
ba6b68b
feat(example): add capability pass first and last inline example line…
tibing-old-email Apr 24, 2018
ef54cf0
fix(docs): fix incorrect code styling
tibing-old-email Apr 24, 2018
b2ee435
feat(docs): docs page (WIP)
nnixaa Apr 27, 2018
a4ea687
refactor(docs): prepare menu refactoring
nnixaa Apr 28, 2018
4d95acd
feat(docs): md block
nnixaa Apr 28, 2018
23593d7
refactor(docs): remove files prefix
nnixaa Apr 30, 2018
3ae484f
feat(docs): small code fixes
nnixaa May 2, 2018
fab85b9
feat(docs): blocks an services refactoring
nnixaa May 4, 2018
dcc47d6
feat(docs): page tabs styles
nnixaa May 7, 2018
bd6282b
feat(docs): code block style
nnixaa May 7, 2018
0085322
feat(docs): props
nnixaa May 7, 2018
c796f3d
feat(docs): fragment scroll fix
nnixaa May 7, 2018
71bba1d
feat(docs): add css style for live example component, update feather …
denStrigo May 15, 2018
1e691e9
refactor(docs): place overview content on a tab
nnixaa May 15, 2018
dd063c1
refactor(live-example): add themes to example, simplify styles
nnixaa May 15, 2018
e3e1c58
feat(docs): inline example stylization, add switcher between live and…
denStrigo May 17, 2018
dce1aa7
refactor(docs): make use of nebular theme system
nnixaa May 16, 2018
233a749
fix(tabs): make tabset detect changes for a tab activity
nnixaa May 16, 2018
31a9f0a
refactor(docs): make use of onpush works fine
nnixaa May 16, 2018
2accbd6
feat(docs): add nebular version
nnixaa May 16, 2018
8066bb8
fix(tabs): revert mark for check
nnixaa May 16, 2018
cabfa3c
fix(docs): add loading for examples
nnixaa May 16, 2018
5619e57
feat(docs): component block
nnixaa May 17, 2018
9ca5c53
feat(docs): sync scroll and toc
nnixaa May 18, 2018
204bb17
fix(fragment): fragments handling fix
nnixaa May 18, 2018
cde3cda
refactor(docs): update to angular 6
nnixaa May 18, 2018
d6c634c
feat(docs): better margins
nnixaa May 18, 2018
5a0de49
refactor(docs): images clean up
nnixaa May 18, 2018
0ed6256
feat(docs): footer & contact block
nnixaa May 18, 2018
e4212d5
feat(docs): examples block
nnixaa May 18, 2018
4af2882
refactor(docs): has view switch
nnixaa May 18, 2018
9c55f29
feat(docs): add pagination block, fix navigation issue with equal pag…
denStrigo May 21, 2018
3778679
refactor(playground): popover playground and docs
Tibing May 20, 2018
5f97996
refactor(playground): add more live examples in the popover
Tibing May 20, 2018
eb81b12
refactor(spec): fix popover spec to use updated playground
Tibing May 20, 2018
f9b64cc
refactor(playground): add checkbox examples
Tibing May 20, 2018
d3f809b
refactor(docs): change hero message
nnixaa May 21, 2018
9b5a216
fix(pager): fix title
nnixaa May 21, 2018
8c1c2d8
refactor(playground): on folder of examples per component
nnixaa May 21, 2018
0e8598d
refactor(playground): layout examples
nnixaa May 21, 2018
a32b1c2
fix(playground): rollback popover tests (#434)
tibing-old-email May 21, 2018
cbd3de3
refactor(playground): sidebar examples
nnixaa May 21, 2018
c59ebff
fix(build): remove examples assets before copy (#435)
tibing-old-email May 21, 2018
cf3a041
fix(build): remove examples assets before copy
tibing-old-email May 21, 2018
895ed80
feat(docs): rework articles, simplify structure
nnixaa May 21, 2018
9684121
feat(docs): wording fix
nnixaa May 21, 2018
93c7a68
feat(playground): card examples
nnixaa May 21, 2018
25008d5
feat(docs): not found example
nnixaa May 21, 2018
ae988d3
refactor(spec): fix popover spec to use updated playground
Tibing May 20, 2018
d32c96c
fix(playground): rollback popover tests (#434)
tibing-old-email May 21, 2018
d6bc4a1
feat(docs): fix layout examples
nnixaa May 22, 2018
fb1d3cc
feat(playground): flip & reveal cards
nnixaa May 22, 2018
a2db6e7
feat(docs): other docs udpate
nnixaa May 22, 2018
bd98b74
feat(playground): menu playground
nnixaa May 22, 2018
8877359
feat(docs): layout and sidebar better backgrounds
nnixaa May 22, 2018
d561565
feat(playground): add actions example
nnixaa May 22, 2018
210a1a3
fix(popover): hide when host was removed (#430)
tibing-old-email May 19, 2018
9ddf994
refactor(spec): fix popover spec to use updated playground
Tibing May 20, 2018
593f844
fix(playground): rollback popover tests (#434)
tibing-old-email May 21, 2018
fdbdfb1
feat(playground): search showcase
nnixaa May 23, 2018
09862c3
feat(playground): add search example
nnixaa May 23, 2018
d2f1961
feat(playground): add tabset examples
nnixaa May 23, 2018
49e9950
feat(playground): badge
nnixaa May 23, 2018
574ed30
feat(playground): badge
nnixaa May 23, 2018
8ad7d33
refactor(examples): use common patter for each example (#440)
tibing-old-email May 24, 2018
13df411
refactor(docs): use additional examples instead of more-live-examples
tibing-old-email May 24, 2018
8f11c36
refactor(theme): add context-menu examples
tibing-old-email May 24, 2018
1d8e49a
feat(playground): update names
nnixaa May 25, 2018
24ade0f
feat(docs): add the themes block (#445)
lexzhukov May 25, 2018
3c5c241
feat(docs): fix fragment handler and scrolling issues
nnixaa May 25, 2018
432d721
feat(docs): update styles to make use of nb-theme
nnixaa May 28, 2018
bbe10d7
fix(docs): fix page not being scrolled properly
nnixaa May 28, 2018
7e6cfab
feat(docs): update header and footer styles
nnixaa May 28, 2018
ac8522c
chore: update docs build script to include parsing step
nnixaa May 28, 2018
cd15cfb
feat(dosc): wrap footer elements
yggg May 30, 2018
a924792
feat(docs): responsive sidebar
yggg May 30, 2018
1cd171b
feat(docs): wrap live example header elements
yggg May 30, 2018
b4e9bc6
feat(docs): add shadow to fixed sidebar
yggg May 30, 2018
22ff8d8
feat(docs): horizontal tabs
yggg May 30, 2018
b9f425b
feat(docs): add horizontal tabs for small screens
yggg May 30, 2018
9b19b15
feat(docs): horizontal tabs in two rows
yggg May 31, 2018
339c15a
feat(docs): move sidebar toggle
yggg May 31, 2018
a33dfa1
feat(docs): show version starting from medium screen
yggg May 31, 2018
f4d3c3f
feat(docs): responsive pager block
yggg May 31, 2018
36369de
feat(docs): add docsearch by algolia
nnixaa May 31, 2018
0876faf
feat(docs): styled outline
yggg May 31, 2018
bbd2d35
feat(docs): fix search colors
nnixaa May 31, 2018
122cd85
feat(docs): add the components overview page (#462)
lexzhukov May 31, 2018
69f9dbe
feat(docs): algolia styles
nnixaa May 31, 2018
f870ec5
feat(docs): multiple fixes & udpates
nnixaa May 31, 2018
7509afd
refactor(docs): mobile first styles
yggg Jun 1, 2018
ab6c9b9
feat(cocs): hide advantages beard on small screens
yggg Jun 1, 2018
db2204c
refactor(spec): fix popover spec to use updated playground
Tibing May 20, 2018
962aa91
fix(playground): rollback popover tests (#434)
tibing-old-email May 21, 2018
c5450ae
feat(progress-bar): init
SashaSkywalker May 25, 2018
349de38
feat(progress-bar): add styling
SashaSkywalker May 25, 2018
6f607a8
refactor(progress-bar): styles
SashaSkywalker May 28, 2018
7d87f77
feat(progress-bar): display value
SashaSkywalker May 28, 2018
110a3b4
feat(progress-bar): size attribute
SashaSkywalker May 28, 2018
a59d4bf
refactor(progress-bar): optimize font-system
SashaSkywalker May 28, 2018
3caaa62
refactor(progress-bar): add docs
SashaSkywalker May 28, 2018
a146a8c
feat(progress-bar): add tests
SashaSkywalker May 28, 2018
e34dbf3
feat(progress-bar): add playground components
SashaSkywalker May 28, 2018
d066462
feat(progress-bar): add more playground components
SashaSkywalker May 28, 2018
60a3ec2
feat(progress-bar): update examples
SashaSkywalker May 28, 2018
506c704
feat(progress-bar): add interactive example
SashaSkywalker May 29, 2018
a2dbf5f
refactor(progress-bar): rename type prop to status
SashaSkywalker May 29, 2018
ef03cff
feat(progress-bar): docs
SashaSkywalker May 29, 2018
663ec4a
refactor(progress-bar): import code styling
SashaSkywalker Jun 4, 2018
ef8ebbc
fix(progress-bar): docs
SashaSkywalker Jun 4, 2018
4c5f2a5
refactor(progress-bar): rename style vars
SashaSkywalker Jun 4, 2018
c26bd79
feat(docs): hide shield block completely on small screens
yggg Jun 4, 2018
c549341
feat(components-overview): fewer columns on small screens
yggg Jun 4, 2018
a0c7f05
feat(docs): add contact us padding on mid screens
yggg Jun 4, 2018
d46c267
fix(example-card): add space between title actions
yggg Jun 4, 2018
a48bf31
fix(docs): decrease sidebar toggle left margin
yggg Jun 4, 2018
5cb2895
feat(docs): header with search responsive
yggg Jun 4, 2018
6c4fcd6
feat(docs): decrease padding on search imput
yggg Jun 4, 2018
7cbeed7
feat(docs): remove hero top margin for smallest screens
yggg Jun 4, 2018
95fe7ff
feat(docs): show buttons in one line
yggg Jun 4, 2018
7c88013
refactor(playground): move e2e test components to playground
nnixaa Jun 5, 2018
e500a3a
refactor(playground): make playground accessible from docs
nnixaa Jun 5, 2018
6b811ac
refactor(live-example): hide loading after receiving height
yggg Jun 4, 2018
0beb7ea
feat(docs): hide example button text on small screens
yggg Jun 4, 2018
124aae1
feat(docs): remove default padding on button
yggg Jun 5, 2018
c30ebae
feat(docs): remove horizontal scroll on small screens
yggg Jun 5, 2018
7208423
feat(docs): hide searchbar on small screens
yggg Jun 5, 2018
28b82e0
feat(docs): align menu with logo
yggg Jun 5, 2018
f0c8659
feat(docs): remove bootstrap leaks
yggg Jun 5, 2018
1c88c2f
feat(docs): turn on prefixing
yggg Jun 5, 2018
713cf60
Merge branch 'feat/new-design' into feat/progress-bar
nnixaa Jun 5, 2018
a49b8e8
Merge branch 'master' into feat/progress-bar
nnixaa Jun 7, 2018
dfa9b32
fix after merge
nnixaa Jun 7, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions DEV_DOCS.md
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ For example, if you wanna add getting started article you have to do the followi

### Component block


If you have to render all the information about componend parsed with typedoc
you have to use component blocks:

Expand Down Expand Up @@ -342,6 +343,46 @@ To start a new release (publish the framework packages on NPM) you need:
8. build demo with npm run build:prod
9. upload demo using `scp -r dist/ server_details`


# create a new component guide
- create directory in `src/framework/theme/components/your-component` with following files:
````
your-component.component.ts (component file)
your-component.module.ts (module file)
your-component.component.html (optional, html file)
your-component.component.scss (optional, common styles for your component)
_your-component.component.theme.scss (optional, styles that depends on theme vars)

````

- register your component in framework
````
src/framework/theme/index.ts (add exports of your component and module)
src/framework/theme/styles/global/_components.scss (if you create _your-component.component.theme.scss you have to register mixin)

````

- tests
````
src/framework/theme/components/your-component/your-component.spec.ts if you want to test basic rendering
e2e/your-component.e2e-spec.ts if you need to test complex actions such as user interaction
````

- register your component in docs
````
add it to docs/structure.ts

src/playground/your-component/your-component-showcase.component.ts (create example usage of your component)
src/playground/your-component/your-component-showcase.component.html (most probably looks like <nb-your-component></nb-your-component>)

src/playground/playground.module.ts (register your component in module)
src/playground/playground-routing.module.ts (routing)

your-component.component.ts (add line in docs section- * @stacked-example(Your component, your-component/your-component-showcase.component)
````
- after `npm run docs:serve` you can see your component at `http://localhost:4100/#/docs/components/your-component`


# TODO
- steps to start the development
- describe framework and demo dependencies
Expand Down
5 changes: 4 additions & 1 deletion docs/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ import {
NbLayoutModule,
NbMenuModule,
NbTabsetModule,
NbCheckboxModule, NbSearchModule,
NbProgressBarModule,
NbCheckboxModule,
NbSearchModule,
} from '@nebular/theme';
import { NgdAppComponent } from './app.component';
import { routes } from './app.routes';
Expand All @@ -37,6 +39,7 @@ export const DOCS = new InjectionToken<any>('Docs Structure');
NbLayoutModule,
NbTabsetModule,
NbCheckboxModule,
NbProgressBarModule,
NbMenuModule.forRoot(),
NbThemeModule.forRoot({ name: '' }),
NbSidebarModule.forRoot(),
Expand Down
7 changes: 7 additions & 0 deletions docs/structure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,13 @@ export const structure = [
'NbCheckboxComponent',
],
},
{
type: 'tabs',
name: 'Progress Bar',
source: [
'NbProgressBarComponent',
],
},
{
type: 'tabs',
name: 'Badge',
Expand Down
9 changes: 9 additions & 0 deletions e2e/popover.e2e-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,4 +191,13 @@ describe('nb-popover', () => {
done();
})
});

it('have to hide popover when host removed', done => {
element(contentTemplate).click();
expect(element(popover).isPresent()).toBeTruthy();
browser.get('#/').then(() => {
expect(element(popover).isPresent()).toBeFalsy();
done();
})
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
/**
* @license
* Copyright Akveo. All Rights Reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*/

@mixin nb-progress-bar-theme() {

.progress-container {
height: nb-theme(progress-bar-height);
border-radius: nb-theme(progress-bar-radius);
background-color: nb-theme(progress-bar-bg);
&.xlg {
.progress-value {
font-size: nb-theme(progress-bar-font-size-xlg);
}
height: nb-theme(progress-bar-height-xlg);
}
&.lg {
.progress-value {
font-size: nb-theme(progress-bar-font-size-lg);
}
height: nb-theme(progress-bar-height-lg);
}
&.sm {
.progress-value {
font-size: nb-theme(progress-bar-font-size-sm);
}
height: nb-theme(progress-bar-height-sm);
}
&.xs {
.progress-value {
font-size: nb-theme(progress-bar-font-size-xs);
}
height: nb-theme(progress-bar-height-xs);
}
}
.progress-value {
background-color: nb-theme(progress-bar-default-bg);
color: nb-theme(progress-bar-font-color);
font-size: nb-theme(progress-bar-font-size);
font-weight: nb-theme(progress-bar-font-weight);
line-height: nb-theme(progress-bar-line-height);
transition-duration: nb-theme(progress-bar-animation-duration);
transition-property: width, background-color;
&.primary {
background-color: nb-theme(progress-bar-primary-bg);
}
&.info {
background-color: nb-theme(progress-bar-info-bg);
}
&.success {
background-color: nb-theme(progress-bar-success-bg);
}
&.warning {
background-color: nb-theme(progress-bar-warning-bg);
}
&.danger {
background-color: nb-theme(progress-bar-danger-bg);
}
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/**
* @license
* Copyright Akveo. All Rights Reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*/

:host {
display: block;
}

.progress-container {
overflow: hidden;
}

.progress-value {
height: 100%;
text-align: center;
overflow: hidden;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
/**
* @license
* Copyright Akveo. All Rights Reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*/

import { Component, Input } from '@angular/core';

/**
* Progress Bar is a component for indicating progress.
*
* Simple usage:
*
* ```html
* <nb-progress-bar [value]="50"></nb-progress-bar>
* ```
*
* Progress bar accepts property `value` in range 0-100
* @stacked-example(Progress bar, progress-bar/progress-bar-showcase.component)
*
* Progress bar background could be configured by providing a `status` property:
* @stacked-example(Progress bar status, progress-bar/progress-bar-status.component)
*
* Progress bar size (height and font-size) could be configured by providing a `size` property:
* @stacked-example(Progress bar size, progress-bar/progress-bar-size.component)
*
* `displayValue` property shows current value inside progress bar. It's also possible to add custom text inside:
* @stacked-example(Progress bar value, progress-bar/progress-bar-value.component)
*
* Progress bar supports `width` and `background-color` transition:
* @stacked-example(Progress bar interactive, progress-bar/progress-bar-interactive.component)
*
* @styles
*
* progress-bar-height-xlg:
* progress-bar-height-lg:
* progress-bar-height:
* progress-bar-height-sm:
* progress-bar-height-xs:
* progress-bar-font-size-xlg:
* progress-bar-font-size-lg:
* progress-bar-font-size:
* progress-bar-font-size-sm:
* progress-bar-font-size-xs:
* progress-bar-radius:
* progress-bar-bg-color:
* progress-bar-font-color:
* progress-bar-font-weight:
* progress-bar-default-bg-color:
* progress-bar-primary-bg-color:
* progress-bar-success-bg-color:
* progress-bar-info-bg-color:
* progress-bar-warning-bg-color:
* progress-bar-danger-bg-color:
*/
@Component({
selector: 'nb-progress-bar',
styleUrls: ['./progress-bar.component.scss'],
template: `
<div class="progress-container {{ size ? '' + size : '' }}">
<div class="progress-value {{ status ? '' + status : '' }}" [style.width.%]="value">
<span *ngIf="displayValue">{{ value }}%</span>
<ng-content></ng-content>
</div>
</div>
`,
})
export class NbProgressBarComponent {

/**
* Progress bar value in percent (0 - 100)
* @type {number}
* @private
*/
@Input() value: number = 0;

/**
* Progress bar background (primary, info success, warning, danger)
* @param {string} val
*/
@Input() status: string;

/**
* Progress bar size (xs, sm, lg, xlg)
* @param {string} val
*/
@Input() size: string;

/**
* Displays value inside progress bar
* @param {string} val
*/
@Input() displayValue: boolean = false;

}
19 changes: 19 additions & 0 deletions src/framework/theme/components/progress-bar/progress-bar.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/**
* @license
* Copyright Akveo. All Rights Reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*/

import { NgModule } from '@angular/core';

import { NbSharedModule } from '../shared/shared.module';
import { NbProgressBarComponent } from './progress-bar.component';

@NgModule({
imports: [
NbSharedModule,
],
declarations: [NbProgressBarComponent],
exports: [NbProgressBarComponent],
})
export class NbProgressBarModule { }
60 changes: 60 additions & 0 deletions src/framework/theme/components/progress-bar/progress-bar.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
import { NbProgressBarComponent } from './progress-bar.component';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { By } from '@angular/platform-browser';

describe('Component: NbProgressBar', () => {

let progressBar: NbProgressBarComponent;
let fixture: ComponentFixture<NbProgressBarComponent>;

beforeEach(() => {
TestBed.configureTestingModule({
declarations: [NbProgressBarComponent],
});

fixture = TestBed.createComponent(NbProgressBarComponent);
progressBar = fixture.componentInstance;
});

it('Setting value 50 should set width to 50%', () => {
progressBar.value = 50;
fixture.detectChanges();
expect(
fixture
.debugElement
.query(By.css('.progress-value')).nativeElement.style.width)
.toBe('50%');
});

it('Setting status danger should set class danger', () => {
progressBar.status = 'danger';
fixture.detectChanges();
expect(
fixture
.debugElement
.query(By.css('.progress-value')).nativeElement.classList.contains('danger'))
.toBeTruthy()
});

it('Setting size sm should set class sm', () => {
progressBar.size = 'sm';
fixture.detectChanges();
expect(
fixture
.debugElement
.query(By.css('.progress-container')).nativeElement.classList.contains('sm'))
.toBeTruthy()
});

it('Setting displayValue should create span with value label', () => {
progressBar.value = 40;
progressBar.displayValue = true;
fixture.detectChanges();
expect(
fixture
.debugElement
.query(By.css('.progress-value span')).nativeElement.innerHTML)
.toContain('40%')
});

});
2 changes: 2 additions & 0 deletions src/framework/theme/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,5 @@ export * from './components/popover/popover.directive';
export * from './components/popover/popover.module';
export * from './components/context-menu/context-menu.directive';
export * from './components/context-menu/context-menu.module';
export * from './components/progress-bar/progress-bar.component';
export * from './components/progress-bar/progress-bar.module';
2 changes: 2 additions & 0 deletions src/framework/theme/styles/global/_components.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
@import '../../components/actions/actions.component.theme';
@import '../../components/search/search.component.theme';
@import '../../components/checkbox/checkbox.component.theme';
@import '../../components/progress-bar/progress-bar.component.theme';
@import '../../components/badge/badge.component.theme';
@import '../../components/popover/popover.component.theme';
@import '../../components/context-menu/context-menu.component.theme';
Expand All @@ -34,6 +35,7 @@
@include nb-actions-theme();
@include nb-search-theme();
@include nb-checkbox-theme();
@include nb-progress-bar-theme();
@include nb-badge-theme();
@include nb-popover-theme();
@include nb-context-menu-theme();
Expand Down
Loading