-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* refactor(demo pages): new add-nav and content dynamic loading [WIP] * refactor(demo pages): new add-nav and content dynamic loading [WIP] * refactor(demo pages): new add-nav and content dynamic loading [WIP] * refactor(demo pages): new add-nav and content dynamic loading [WIP] * refactor(demo pages): new add-nav and content dynamic loading [WIP] * refactor(demo pages): new add-nav and content dynamic loading [WIP] * refactor(demo pages): new add-nav and content dynamic loading [WIP] * WIP feat(docs): new aside menu * WIP feat(docs): new aside menu * WIP feat(docs): new aside menu * WIP feat(docs): new aside menu * WIP feat(docs): new aside menu * WIP feat(docs): new aside menu * WIP feat(docs): new aside menu * WIP feat(docs): new aside menu * chore(docs): added docs-section component * chore(demo): made docs section to run on push * chore(demo): unified demo section component * feat(docs): New content management and generation logic for demo pages * feat(docs): New content management and generation logic for demo pages * feat(docs): New content management and generation logic for demo pages
- Loading branch information
1 parent
a86e549
commit 4e3e456
Showing
145 changed files
with
3,172 additions
and
2,356 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,9 @@ | ||
<ul *ngIf="componentContent" (click)="goToSection($event)"> | ||
<li *ngFor="let item of componentContent"> | ||
<a routerLink="." [fragment]="item.anchor" [attr.data-anchor]="item.anchor">{{ item.name }}</a> | ||
<ul *ngIf="item.content && item.content.length"> | ||
<li *ngFor="let subItem of item.content"> | ||
<a routerLink="." [fragment]="subItem.anchor" [attr.data-anchor]="item.anchor">{{ subItem.title }}</a> | ||
</ul> | ||
</li> | ||
</ul> |
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,13 +1,26 @@ | ||
import { Component } from '@angular/core'; | ||
import { Router } from '@angular/router'; | ||
import { routes } from '../../app.routing'; | ||
import { StyleManager } from '../../theme/style-manager'; | ||
import { ThemeStorage } from '../../theme/theme-storage'; | ||
import { Component, Inject, Input } from '@angular/core'; | ||
import { DOCUMENT } from '@angular/common'; | ||
|
||
import { ContentSection } from '../../docs/models/content-section.model'; | ||
|
||
@Component({ | ||
selector: 'add-nav', | ||
templateUrl: './add-nav.component.html' | ||
}) | ||
export class AddNavComponent { | ||
constructor() {} | ||
@Input() componentContent: ContentSection[]; | ||
|
||
constructor(@Inject(DOCUMENT) private document: Document) { } | ||
|
||
goToSection(event): void { | ||
const item: HTMLElement = event.target; | ||
|
||
if (item.dataset.anchor) { | ||
const anchor: string = item.dataset.anchor; | ||
const target: HTMLElement = this.document.getElementById(anchor); | ||
const header: HTMLElement = this.document.getElementById('header'); | ||
const headerIndent: number = header.offsetHeight + 6; | ||
this.document.body.scrollTop = target.offsetTop - headerIndent; | ||
} | ||
} | ||
} |
13 changes: 0 additions & 13 deletions
13
demo/src/app/common/documentation/documentation.component.html
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
13 changes: 6 additions & 7 deletions
13
demo/src/app/components/+accordion/accordion-section.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 |
---|---|---|
@@ -1,19 +1,18 @@ | ||
// todo: add more samples https://jqueryui.com/accordion/#default | ||
// todo: add more samples http://getbootstrap.com/components/#panels-alternatives | ||
|
||
import { Component } from '@angular/core'; | ||
import { DEMOS } from './demos'; | ||
import { ChangeDetectionStrategy, Component } from '@angular/core'; | ||
import { demoComponentContent } from './accordion-section.list'; | ||
import { ContentSection } from '../../docs/models/content-section.model'; | ||
|
||
// webpack html imports | ||
let titleDoc = require('html-loader!markdown-loader!./docs/usage.md'); | ||
|
||
@Component({ | ||
selector: 'accordion-section', | ||
templateUrl: './accordion-section.components.html' | ||
templateUrl: './accordion-section.components.html', | ||
changeDetection: ChangeDetectionStrategy.OnPush | ||
}) | ||
export class AccordionSectionComponent { | ||
name = 'Accordion'; | ||
src = 'https://github.com/valor-software/ngx-bootstrap/tree/development/src/accordion'; | ||
titleDoc: string = titleDoc; | ||
demos: any = DEMOS; | ||
componentContent: ContentSection[] = demoComponentContent; | ||
} |
68 changes: 4 additions & 64 deletions
68
demo/src/app/components/+accordion/accordion-section.components.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,67 +1,7 @@ | ||
<demo-section [name]="name" [src]="src"> | ||
<demo-section [name]="name" [src]="src" [componentContent]="componentContent"> | ||
<p>Displays collapsible content panels for presenting information in a limited amount of space</p> | ||
<p>The <strong>accordion component</strong> builds on top of the collapse directive to provide a list of items, with collapsible bodies that are collapsed or expanded by clicking on the item's header.</p> | ||
<p>The <strong>accordion component</strong> builds on top of the collapse directive to provide a list | ||
of items, with collapsible bodies that are collapsed or expanded by clicking on the item's header.</p> | ||
|
||
<h2>Contents</h2> | ||
<ul> | ||
<li><a routerLink="." fragment="usage">Usage</a></li> | ||
<li><a routerLink="." fragment="examples">Examples</a> | ||
<ul> | ||
<li><a routerLink="." fragment="simple">Simple accordion</a></li> | ||
<li><a routerLink="." fragment="disabled">Disabled</a></li> | ||
<li><a routerLink="." fragment="dynamic">Dynamic accordion</a></li> | ||
<li><a routerLink="." fragment="one-time">Open only one at a time</a></li> | ||
<li><a routerLink="." fragment="styling">Styling</a></li> | ||
<li><a routerLink="." fragment="config">Configuring defaults</a></li> | ||
</ul> | ||
</li> | ||
<li><a routerLink="." fragment="api-reference">API Reference</a> | ||
<ul> | ||
<li><a routerLink="." fragment="accordion-panel-component">AccordionPanelComponent</a></li> | ||
<li><a routerLink="." fragment="accordion-config">AccordionConfig</a></li> | ||
</ul> | ||
</li> | ||
</ul> | ||
|
||
<h2 routerLink="." fragment="usage" id="usage">Usage</h2> | ||
|
||
<p [innerHtml]="titleDoc"></p> | ||
|
||
<h2 routerLink="." fragment="examples" id="examples">Examples</h2> | ||
|
||
<p>Click headers to expand/collapse content that is broken into logical sections, much like tabs.</p> | ||
|
||
<h3 routerLink="." fragment="simple" id="simple">Simple accordion</h3> | ||
<ng-sample-box [ts]="demos.basic.component" [html]="demos.basic.html"> | ||
<demo-accordion-basic></demo-accordion-basic> | ||
</ng-sample-box> | ||
|
||
<h3 routerLink="." fragment="disabled" id="disabled">Disabled</h3> | ||
<ng-sample-box [ts]="demos.disabled.component" [html]="demos.disabled.html"> | ||
<demo-accordion-disabled></demo-accordion-disabled> | ||
</ng-sample-box> | ||
|
||
<h3 routerLink="." fragment="dynamic" id="dynamic">Dynamic accordion</h3> | ||
<ng-sample-box [ts]="demos.dynamic.component" [html]="demos.dynamic.html"> | ||
<demo-accordion-dynamic></demo-accordion-dynamic> | ||
</ng-sample-box> | ||
|
||
<h3 routerLink="." fragment="one-time" id="one-time">Open only one at a time</h3> | ||
<ng-sample-box [ts]="demos.oneAtATime.component" [html]="demos.oneAtATime.html"> | ||
<demo-accordion-one-time></demo-accordion-one-time> | ||
</ng-sample-box> | ||
|
||
<h3 routerLink="." fragment="styling" id="styling">Styling</h3> | ||
<ng-sample-box [ts]="demos.styling.component" [html]="demos.styling.html" [style]="demos.styling.css"> | ||
<demo-accordion-styling></demo-accordion-styling> | ||
</ng-sample-box> | ||
|
||
<h3 routerLink="." fragment="config" id="config">Configuring defaults</h3> | ||
<ng-sample-box [ts]="demos.config.component" [html]="demos.config.html"> | ||
<demo-accordion-config></demo-accordion-config> | ||
</ng-sample-box> | ||
|
||
<h2 routerLink="." fragment="api-reference" id="api-reference">API Reference</h2> | ||
<ng-api-doc routerLink="." fragment="accordion-panel-component" id="accordion-panel-component" directive="AccordionPanelComponent"></ng-api-doc> | ||
<ng-api-doc-config routerLink="." fragment="accordion-config" id="accordion-config" type="AccordionConfig"></ng-api-doc-config> | ||
<docs-section [content]="componentContent"></docs-section> | ||
</demo-section> |
96 changes: 96 additions & 0 deletions
96
demo/src/app/components/+accordion/accordion-section.list.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,96 @@ | ||
import { DemoAccordionBasicComponent } from './demos/basic/basic'; | ||
import { DemoAccordionDisabledComponent } from './demos/disabled/disabled'; | ||
import { DemoAccordionDynamicComponent } from './demos/dymanic/dynamic'; | ||
import { DemoAccordionOneAtATimeComponent } from './demos/one-at-a-time/one-at-a-time'; | ||
import { DemoAccordionStylingComponent } from './demos/styling/styling'; | ||
import { DemoAccordionConfigComponent } from './demos/config/config'; | ||
|
||
import { ContentSection } from '../../docs/models/content-section.model'; | ||
import { DemoTopSectionComponent } from '../../docs/demo-section-components/demo-top-section/index'; | ||
import { ExamplesComponent } from '../../docs/demo-section-components/demo-examples-section/index'; | ||
import { ApiSectionsComponent } from '../../docs/demo-section-components/demo-api-section/index'; | ||
|
||
import { | ||
NgApiDocComponent, | ||
NgApiDocConfigComponent | ||
} from '../../docs/api-docs'; | ||
|
||
export const demoComponentContent: ContentSection[] = [ | ||
{ | ||
name: 'Usage', | ||
anchor: 'usage', | ||
outlet: DemoTopSectionComponent, | ||
content: { | ||
doc: require('html-loader!markdown-loader!./docs/usage.md') | ||
} | ||
}, | ||
{ | ||
name: 'Examples', | ||
anchor: 'examples', | ||
outlet: ExamplesComponent, | ||
content: [ | ||
{ | ||
title: 'Simple accordion', | ||
anchor: 'simple-accordion', | ||
description: `<p>Click headers to expand/collapse content that is broken into logical sections, much | ||
like tabs.</p>`, | ||
component: require('!!raw-loader?lang=typescript!./demos/basic/basic'), | ||
html: require('!!raw-loader?lang=markup!./demos/basic/basic.html'), | ||
outlet: DemoAccordionBasicComponent | ||
}, | ||
{ | ||
title: 'Disabled', | ||
anchor: 'disabled', | ||
component: require('!!raw-loader?lang=typescript!./demos/disabled/disabled'), | ||
html: require('!!raw-loader?lang=markup!./demos/disabled/disabled.html'), | ||
outlet: DemoAccordionDisabledComponent | ||
}, | ||
{ | ||
title: 'Dynamic accordion', | ||
anchor: 'dynamic-accordion', | ||
component: require('!!raw-loader?lang=typescript!./demos/dymanic/dynamic'), | ||
html: require('!!raw-loader?lang=markup!./demos/dymanic/dynamic.html'), | ||
outlet: DemoAccordionDynamicComponent | ||
}, | ||
{ | ||
title: 'Open only one at a time', | ||
anchor: 'one-time', | ||
component: require('!!raw-loader?lang=typescript!./demos/one-at-a-time/one-at-a-time'), | ||
html: require('!!raw-loader?lang=markup!./demos/one-at-a-time/one-at-a-time.html'), | ||
outlet: DemoAccordionOneAtATimeComponent | ||
}, | ||
{ | ||
title: 'Styling', | ||
anchor: 'styling', | ||
component: require('!!raw-loader?lang=typescript!./demos/styling/styling'), | ||
html: require('!!raw-loader?lang=markup!./demos/styling/styling.html'), | ||
css: require('!!raw-loader?lang=markup!./demos/styling/styling.css'), | ||
outlet: DemoAccordionStylingComponent | ||
}, | ||
{ | ||
title: 'Configuring defaults', | ||
anchor: 'config', | ||
component: require('!!raw-loader?lang=typescript!./demos/config/config'), | ||
html: require('!!raw-loader?lang=markup!./demos/config/config.html'), | ||
outlet: DemoAccordionConfigComponent | ||
} | ||
] | ||
}, | ||
{ | ||
name: 'API Reference', | ||
anchor: 'api-reference', | ||
outlet: ApiSectionsComponent, | ||
content: [ | ||
{ | ||
title: 'AccordionPanelComponent', | ||
anchor: 'AccordionPanelComponent', | ||
outlet: NgApiDocComponent | ||
}, | ||
{ | ||
title: 'AccordionConfig', | ||
anchor: 'AccordionConfig', | ||
outlet: NgApiDocConfigComponent | ||
} | ||
] | ||
} | ||
]; |
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
Oops, something went wrong.