Skip to content

Commit

Permalink
feat(side-bar): add side-bar angular 7 component
Browse files Browse the repository at this point in the history
  • Loading branch information
daanishnasir authored and pauljeter committed May 15, 2019
1 parent 87143eb commit 0060992
Show file tree
Hide file tree
Showing 37 changed files with 1,046 additions and 12 deletions.
29 changes: 20 additions & 9 deletions angular/src/docs/app/playground/playground.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,27 @@ import { Component, OnInit } from '@angular/core';
@Component({
selector: 'docs-playground',
template: `
<div className="row">
<div className="example-spacing">
<example-popover-default></example-popover-default>
<example-popover-direction></example-popover-direction>
<example-popover-trigger></example-popover-trigger>
<example-popover-showarrow></example-popover-showarrow>
</div>
</div>
<!-- Insert example here -->
<example-sidebar-default></example-sidebar-default>
<!-- <br>
<example-sidebar-dark></example-sidebar-dark>
<br>
<example-sidebar-with-icons></example-sidebar-with-icons>
<br>
<example-sidebar-page-level></example-sidebar-page-level> -->
`,
})
export class PlaygroundComponent implements OnInit {
ngOnInit() {}
}

onSelect (event) {
console.info('custom onSelect working');
}
}
3 changes: 3 additions & 0 deletions angular/src/lib/examples.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import { ToggleSwitchExamplesModule } from './toggle-switch/examples/toggle-swit
import { EditableTextfieldExamplesModule } from './editable-textfield/examples/editable-textfield-examples.module';
import { TopbarExamplesModule } from './topbar/examples/examples.module';
import { AccordionExamplesModule } from './accordion/examples/accordion-examples.module';
import { SideBarExamplesModule } from './sidebar/examples/sidebar-examples.module';
import { TimePickerExamplesModule } from './time-picker/examples/examples.module';
import { DatePickerExamplesModule } from './date-picker/examples/examples.module';
import { ModalExamplesModule } from './modal/examples/modal-examples.module';
Expand Down Expand Up @@ -55,6 +56,7 @@ import { PageHeaderExamplesModule } from './page-header/examples/page-header-exa
EditableTextfieldExamplesModule,
TopbarExamplesModule,
AccordionExamplesModule,
SideBarExamplesModule,
TimePickerExamplesModule,
DatePickerExamplesModule,
ModalExamplesModule,
Expand Down Expand Up @@ -87,6 +89,7 @@ import { PageHeaderExamplesModule } from './page-header/examples/page-header-exa
EditableTextfieldExamplesModule,
TopbarExamplesModule,
AccordionExamplesModule,
SideBarExamplesModule,
TimePickerExamplesModule,
DatePickerExamplesModule,
ModalExamplesModule,
Expand Down
1 change: 1 addition & 0 deletions angular/src/lib/list-item/list-item.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export class OptionSelectionChange {
<ng-content></ng-content>
</ng-template>
</md-list-item-section>
<md-list-item-section key="child-1" position='right'>
<md-icon *ngIf="selected" name="check_20" color="blue-50"></md-icon>
</md-list-item-section>
Expand Down
3 changes: 2 additions & 1 deletion angular/src/lib/list/examples/list-default.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import { Component, OnInit } from '@angular/core';
<md-list
[ngClass]="'my-ng-class'"
class="custom-class"
(select)="onSelect($event)">
(select)="onSelect($event)"
>
<div md-list-item label='List Item A'></div>
<div md-list-item label='List Item B'></div>
</md-list>
Expand Down
6 changes: 6 additions & 0 deletions angular/src/lib/public_api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ export * from './tabs';
export * from './toggle-switch';
export * from './topbar';
export * from './accordion';
export * from './sidebar';
export * from './sidebar-body';
export * from './sidebar-nav';
export * from './sidebar-nav-item';
export * from './sidebar-header';
export * from './sidebar-footer';
export * from './time-picker';
export * from './date-picker';
export * from './breadcrumbs';
Expand Down
2 changes: 2 additions & 0 deletions angular/src/lib/sidebar-body/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from './sidebar-body.module';
export * from './sidebar-body.component';
18 changes: 18 additions & 0 deletions angular/src/lib/sidebar-body/sidebar-body.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { Component, OnInit } from '@angular/core';

@Component({
selector: 'md-sidebar-body',
template: `<ng-content></ng-content>`,
styles: [],
host: {
'class': 'md-sidebar__body'
}
})
export class SideBarBodyComponent implements OnInit {

constructor() { }

ngOnInit() {
}

}
14 changes: 14 additions & 0 deletions angular/src/lib/sidebar-body/sidebar-body.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { CommonModule } from '@angular/common';
import { SideBarBodyComponent } from './sidebar-body.component';

@NgModule({
declarations: [SideBarBodyComponent],
imports: [
CommonModule
],
exports: [SideBarBodyComponent],
schemas: [ CUSTOM_ELEMENTS_SCHEMA ]

})
export class SideBarBodyModule { }
2 changes: 2 additions & 0 deletions angular/src/lib/sidebar-footer/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from './sidebar-footer.module';
export * from './sidebar-footer.component';
19 changes: 19 additions & 0 deletions angular/src/lib/sidebar-footer/sidebar-footer.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { Component, OnInit } from '@angular/core';

@Component({
selector: 'md-sidebar-footer',
template: `<ng-content></ng-content>`,
styles: [],
host: {
'class': 'md-sidebar__footer'
}

})
export class SidebarFooterComponent implements OnInit {

constructor() { }

ngOnInit() {
}

}
13 changes: 13 additions & 0 deletions angular/src/lib/sidebar-footer/sidebar-footer.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { CommonModule } from '@angular/common';
import { SidebarFooterComponent } from './sidebar-footer.component';

@NgModule({
declarations: [SidebarFooterComponent],
imports: [
CommonModule
],
exports: [SidebarFooterComponent],
schemas: [ CUSTOM_ELEMENTS_SCHEMA ]
})
export class SidebarFooterModule { }
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';

import { SidebarFooterComponent } from '../sidebar-footer.component';

describe('SidebarFooterComponent', () => {
let component: SidebarFooterComponent;
let fixture: ComponentFixture<SidebarFooterComponent>;

beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ SidebarFooterComponent ]
})
.compileComponents();
}));

beforeEach(() => {
fixture = TestBed.createComponent(SidebarFooterComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});
2 changes: 2 additions & 0 deletions angular/src/lib/sidebar-header/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from './sidebar-header.module';
export * from './sidebar-header.component';
18 changes: 18 additions & 0 deletions angular/src/lib/sidebar-header/sidebar-header.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { Component, OnInit } from '@angular/core';

@Component({
selector: 'md-sidebar-header',
template: `<ng-content></ng-content>`,
styles: [],
host: {
'class': 'md-sidebar__header'
}
})
export class SidebarHeaderComponent implements OnInit {

constructor() { }

ngOnInit() {
}

}
13 changes: 13 additions & 0 deletions angular/src/lib/sidebar-header/sidebar-header.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { CommonModule } from '@angular/common';
import { SidebarHeaderComponent } from './sidebar-header.component';

@NgModule({
declarations: [SidebarHeaderComponent],
imports: [
CommonModule
],
exports: [SidebarHeaderComponent],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
export class SidebarHeaderModule { }
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';

import { SidebarHeaderComponent } from '../sidebar-header.component';

describe('SidebarHeaderComponent', () => {
let component: SidebarHeaderComponent;
let fixture: ComponentFixture<SidebarHeaderComponent>;

beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ SidebarHeaderComponent ]
})
.compileComponents();
}));

beforeEach(() => {
fixture = TestBed.createComponent(SidebarHeaderComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});
2 changes: 2 additions & 0 deletions angular/src/lib/sidebar-nav-item/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from './sidebar-nav-item.module';
export * from './sidebar-nav-item.component';
Loading

0 comments on commit 0060992

Please sign in to comment.