-
-
Notifications
You must be signed in to change notification settings - Fork 32
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
40 changed files
with
1,223 additions
and
0 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,21 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { | ||
Routes, | ||
RouterModule, | ||
} from '@angular/router'; | ||
|
||
import { DesignLandTreeComponent } from './tree.component'; | ||
|
||
export const treeRoutes: Routes = [ | ||
{ path: '', component: DesignLandTreeComponent }, | ||
]; | ||
|
||
@NgModule({ | ||
imports: [ | ||
RouterModule.forChild(treeRoutes), | ||
], | ||
exports: [ | ||
RouterModule, | ||
], | ||
}) | ||
export class DesignLandTreeRoutingModule {} |
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 @@ | ||
<daff-article> | ||
<h1 daffArticleTitle>Tree</h1> | ||
<p daffArticleLead>Tree is used to display hierarchial data.</p> | ||
|
||
<h2>Basic Tree</h2> | ||
<design-land-example-viewer-container example="basic-tree"></design-land-example-viewer-container> | ||
|
||
<h2>Nested Tree</h2> | ||
<design-land-example-viewer-container example="nested-tree"></design-land-example-viewer-container> | ||
</daff-article> |
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 @@ | ||
daff-accordion { | ||
max-width: 800px; | ||
} | ||
|
||
.design-land-accordion-example { | ||
margin-bottom: 40px; | ||
} | ||
|
||
a { | ||
font-weight: 400; | ||
} |
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,31 @@ | ||
import { | ||
waitForAsync, | ||
ComponentFixture, | ||
TestBed, | ||
} from '@angular/core/testing'; | ||
|
||
import { DesignLandTreeComponent } from './tree.component'; | ||
|
||
describe('DesignLandTreeComponent', () => { | ||
let component: DesignLandTreeComponent; | ||
let fixture: ComponentFixture<DesignLandTreeComponent>; | ||
|
||
beforeEach(waitForAsync(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [ | ||
DesignLandTreeComponent, | ||
], | ||
}) | ||
.compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(DesignLandTreeComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
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: 'design-land-tree', | ||
templateUrl: './tree.component.html', | ||
styleUrls: ['./tree.component.scss'], | ||
}) | ||
export class DesignLandTreeComponent {} |
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,47 @@ | ||
import { CommonModule } from '@angular/common'; | ||
import { | ||
ComponentFactoryResolver, | ||
Injector, | ||
NgModule, | ||
} from '@angular/core'; | ||
import { createCustomElement } from '@angular/elements'; | ||
|
||
import { DaffArticleModule } from '@daffodil/design'; | ||
import { DaffTreeModule } from '@daffodil/design/tree'; | ||
import { TREE_EXAMPLES } from '@daffodil/design/tree/examples'; | ||
|
||
import { DesignLandExampleViewerModule } from '../core/code-preview/container/example-viewer.module'; | ||
import { DesignLandTreeRoutingModule } from './tree-routing.module'; | ||
import { DesignLandTreeComponent } from './tree.component'; | ||
|
||
@NgModule({ | ||
declarations: [ | ||
DesignLandTreeComponent, | ||
], | ||
imports: [ | ||
CommonModule, | ||
DesignLandTreeRoutingModule, | ||
DesignLandExampleViewerModule, | ||
DaffTreeModule, | ||
DaffArticleModule, | ||
], | ||
}) | ||
export class DesignLandTreeModule { | ||
constructor( | ||
injector: Injector, | ||
private componentFactoryResolver: ComponentFactoryResolver, | ||
) { | ||
TREE_EXAMPLES | ||
.map((classConstructor) => ({ | ||
element: createCustomElement(classConstructor, { injector }), | ||
class: classConstructor, | ||
})) | ||
.map((customElement) => { | ||
// Register the custom element with the browser. | ||
customElements.define( | ||
this.componentFactoryResolver.resolveComponentFactory<unknown>(customElement.class).selector + '-example', | ||
customElement.element, | ||
); | ||
}); | ||
} | ||
} |
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 @@ | ||
{ | ||
"$schema": "../../node_modules/ng-packagr/ng-package.schema.json", | ||
"dest": "../../dist/design/examples", | ||
"deleteDestPath": false, | ||
"lib": { | ||
"entryFile": "src/index.ts", | ||
"styleIncludePaths": ["../../src/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,3 @@ | ||
{ | ||
"name": "@daffodil/design/tree/examples" | ||
} |
26 changes: 26 additions & 0 deletions
26
libs/design/tree/examples/src/basic-tree/basic-tree.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,26 @@ | ||
<daff-tree> | ||
<daff-tree-item> | ||
<div daffTreeItemTitle>Foundations</div> | ||
<a daff-tree-item [selected]="rla.isActive" routerLink="/tree" routerLinkActive #rla="routerLinkActive"> | ||
<div daffTreeItemTitle>Color</div> | ||
</a> | ||
<a daff-tree-item routerLink="/tree"> | ||
<div daffTreeItemTitle>Typography</div> | ||
</a> | ||
</daff-tree-item> | ||
<daff-tree-item> | ||
<div daffTreeItemTitle>Packages</div> | ||
<daff-tree-item> | ||
<div daffTreeItemTitle>@daffodil/authorizenet</div> | ||
<a daff-tree-item> | ||
<div daffTreeItemTitle>Installation</div> | ||
</a> | ||
</daff-tree-item> | ||
<a daff-tree-item> | ||
<div daffTreeItemTitle>@daffodil/cart</div> | ||
</a> | ||
<a daff-tree-item> | ||
<div daffTreeItemTitle>@daffodil/category</div> | ||
</a> | ||
</daff-tree-item> | ||
</daff-tree> |
8 changes: 8 additions & 0 deletions
8
libs/design/tree/examples/src/basic-tree/basic-tree.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,8 @@ | ||
import { Component } from '@angular/core'; | ||
|
||
@Component({ | ||
// eslint-disable-next-line @angular-eslint/component-selector | ||
selector: 'basic-tree', | ||
templateUrl: './basic-tree.component.html', | ||
}) | ||
export class BasicTreeComponent {} |
21 changes: 21 additions & 0 deletions
21
libs/design/tree/examples/src/basic-tree/basic-tree.module.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,21 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { RouterModule } from '@angular/router'; | ||
|
||
import { DaffTreeModule } from '@daffodil/design/tree'; | ||
|
||
import { BasicTreeComponent } from './basic-tree.component'; | ||
|
||
|
||
@NgModule({ | ||
declarations: [ | ||
BasicTreeComponent, | ||
], | ||
exports: [ | ||
BasicTreeComponent, | ||
], | ||
imports: [ | ||
DaffTreeModule, | ||
RouterModule, | ||
], | ||
}) | ||
export class BasicTreeModule { } |
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 @@ | ||
export * from './public_api'; |
44 changes: 44 additions & 0 deletions
44
libs/design/tree/examples/src/nested-tree/nested-tree.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,44 @@ | ||
<daff-tree> | ||
<daff-tree-item> | ||
<div daffTreeItemTitle>Design</div> | ||
<daff-tree-item> | ||
<div daffTreeItemTitle>Foundations</div> | ||
<a daff-tree-item [selected]="rla.isActive" routerLink="/tree" routerLinkActive #rla="routerLinkActive"> | ||
<div daffTreeItemTitle>Color</div> | ||
</a> | ||
<a daff-tree-item routerLink="/tree"> | ||
<div daffTreeItemTitle>Typography</div> | ||
</a> | ||
</daff-tree-item> | ||
<daff-tree-item> | ||
<div daffTreeItemTitle>Components</div> | ||
<daff-tree-item> | ||
<div daffTreeItemTitle>Atoms</div> | ||
<a daff-tree-item> | ||
<div daffTreeItemTitle>Button</div> | ||
</a> | ||
<a daff-tree-item> | ||
<div daffTreeItemTitle>Forms</div> | ||
<a daff-tree-item> | ||
<div daffTreeItemTitle>Checkbox</div> | ||
</a> | ||
<a daff-tree-item> | ||
<div daffTreeItemTitle>Form Field</div> | ||
</a> | ||
<a daff-tree-item> | ||
<div daffTreeItemTitle>Input</div> | ||
</a> | ||
<a daff-tree-item> | ||
<div daffTreeItemTitle>Radio</div> | ||
</a> | ||
<a daff-tree-item> | ||
<div daffTreeItemTitle>Select</div> | ||
</a> | ||
<a daff-tree-item> | ||
<div daffTreeItemTitle>Textarea</div> | ||
</a> | ||
</a> | ||
</daff-tree-item> | ||
</daff-tree-item> | ||
</daff-tree-item> | ||
</daff-tree> |
8 changes: 8 additions & 0 deletions
8
libs/design/tree/examples/src/nested-tree/nested-tree.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,8 @@ | ||
import { Component } from '@angular/core'; | ||
|
||
@Component({ | ||
// eslint-disable-next-line @angular-eslint/component-selector | ||
selector: 'nested-tree', | ||
templateUrl: './nested-tree.component.html', | ||
}) | ||
export class NestedTreeComponent {} |
21 changes: 21 additions & 0 deletions
21
libs/design/tree/examples/src/nested-tree/nested-tree.module.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,21 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { RouterModule } from '@angular/router'; | ||
|
||
import { DaffTreeModule } from '@daffodil/design/tree'; | ||
|
||
import { NestedTreeComponent } from './nested-tree.component'; | ||
|
||
|
||
@NgModule({ | ||
declarations: [ | ||
NestedTreeComponent, | ||
], | ||
exports: [ | ||
NestedTreeComponent, | ||
], | ||
imports: [ | ||
DaffTreeModule, | ||
RouterModule, | ||
], | ||
}) | ||
export class NestedTreeModule { } |
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 { BasicTreeComponent } from './basic-tree/basic-tree.component'; | ||
import { NestedTreeComponent } from './nested-tree/nested-tree.component'; | ||
export { BasicTreeModule } from './basic-tree/basic-tree.module'; | ||
export { NestedTreeModule } from './nested-tree/nested-tree.module'; | ||
|
||
export const TREE_EXAMPLES = [ | ||
BasicTreeComponent, | ||
NestedTreeComponent, | ||
]; |
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 @@ | ||
{ | ||
"$schema": "../../../node_modules/ng-packagr/ng-package.schema.json", | ||
"dest": "../../dist/design/tree", | ||
"deleteDestPath": false, | ||
"lib": { | ||
"entryFile": "src/index.ts", | ||
"styleIncludePaths": ["../src/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,3 @@ | ||
{ | ||
"name": "@daffodil/design/tree" | ||
} |
Oops, something went wrong.