diff --git a/packages/docs/README.md b/packages/docs/README.md index 043a4f8a3..ccf5c607f 100644 --- a/packages/docs/README.md +++ b/packages/docs/README.md @@ -1,8 +1,18 @@ ## Development Setup -1. build:mosaic-examples - generate dynamic examples (for Stackblitz) -2. build:mosaic - generate our components for Docs App -3. build:docs - generate `docs-content` folder +1. generate dynamic examples (for Stackblitz) +```bash +yarn run build:mosaic-examples +``` + +2. generate components for Docs App +```bash +yarn run build:mosaic +``` +3. generate `docs-content` folder +```bash +yarn run build:docs +``` ## Development Server diff --git a/packages/docs/src/app/components/main-layout/main-layout.component.html b/packages/docs/src/app/components/main-layout/main-layout.component.html index 78752b290..8ba9dbceb 100644 --- a/packages/docs/src/app/components/main-layout/main-layout.component.html +++ b/packages/docs/src/app/components/main-layout/main-layout.component.html @@ -19,7 +19,7 @@ - +
diff --git a/packages/docs/src/app/components/main-layout/main-layout.component.ts b/packages/docs/src/app/components/main-layout/main-layout.component.ts index c46ad63d4..e7c9c30d5 100644 --- a/packages/docs/src/app/components/main-layout/main-layout.component.ts +++ b/packages/docs/src/app/components/main-layout/main-layout.component.ts @@ -1,5 +1,4 @@ -import {ChangeDetectionStrategy, Component, ViewEncapsulation} from '@angular/core'; -import {CdkTree} from '@ptsecurity/cdk/tree'; +import { Component } from '@angular/core'; @Component({ @@ -9,23 +8,3 @@ import {CdkTree} from '@ptsecurity/cdk/tree'; export class MainLayoutComponent { } - - - -@Component({ - selector: 'mat-tree', - exportAs: 'matTree', - template: ``, - host: { - 'class': 'mat-tree', - 'role': 'tree' - }, - encapsulation: ViewEncapsulation.None, - // See note on CdkTree for explanation on why this uses the default change detection strategy. - // tslint:disable-next-line:validate-decorators - changeDetection: ChangeDetectionStrategy.Default, - providers: [{provide: CdkTree, useExisting: MatTree}] -}) -export class MatTree extends CdkTree { - // Outlets within the tree's template where the dataNodes will be inserted. -} diff --git a/packages/docs/src/app/components/main-layout/main-layout.module.ts b/packages/docs/src/app/components/main-layout/main-layout.module.ts index 67831b300..90cb74d71 100644 --- a/packages/docs/src/app/components/main-layout/main-layout.module.ts +++ b/packages/docs/src/app/components/main-layout/main-layout.module.ts @@ -4,13 +4,12 @@ import { RouterModule } from '@angular/router'; import { McButtonModule } from '@ptsecurity/mosaic/button'; import { McDropdownModule } from '@ptsecurity/mosaic/dropdown'; import { McIconModule } from '@ptsecurity/mosaic/icon'; +import { McTreeModule } from '@ptsecurity/mosaic/tree'; import { McVerticalNavbarModule } from '@ptsecurity/mosaic/vertical-navbar'; -import {MainLayoutComponent, MatTree} from './main-layout.component'; -import {TreeComponent} from '../tree/tree.component'; -import {McTreeModule} from '@ptsecurity/mosaic/tree'; +import { TreeComponent } from '../tree/tree.component'; -import {CdkTreeModule} from '@ptsecurity/cdk/tree'; +import { MainLayoutComponent } from './main-layout.component'; @NgModule({ @@ -18,15 +17,13 @@ import {CdkTreeModule} from '@ptsecurity/cdk/tree'; CommonModule, RouterModule, - CdkTreeModule, McTreeModule, McVerticalNavbarModule, McButtonModule, McIconModule, McDropdownModule - ], exports: [MainLayoutComponent], - declarations: [MainLayoutComponent, MatTree, TreeComponent] + declarations: [MainLayoutComponent, TreeComponent] }) export class MainLayoutModule {} diff --git a/packages/docs/src/app/components/tree/tree.component.html b/packages/docs/src/app/components/tree/tree.component.html index 6a734c1ef..47ee3622b 100644 --- a/packages/docs/src/app/components/tree/tree.component.html +++ b/packages/docs/src/app/components/tree/tree.component.html @@ -1,5 +1,5 @@ diff --git a/packages/docs/src/app/components/tree/tree.component.ts b/packages/docs/src/app/components/tree/tree.component.ts index 7d2aea083..8a3fb51c3 100644 --- a/packages/docs/src/app/components/tree/tree.component.ts +++ b/packages/docs/src/app/components/tree/tree.component.ts @@ -113,7 +113,7 @@ export class FileDatabase { }) export class TreeComponent { treeControl: FlatTreeControl; - dataSource$: McTreeFlatDataSource; + dataSource: McTreeFlatDataSource; treeFlattener: McTreeFlattener; constructor(database: FileDatabase) { @@ -123,10 +123,10 @@ export class TreeComponent { ); this.treeControl = new FlatTreeControl(this._getLevel, this._isExpandable); - this.dataSource$ = new McTreeFlatDataSource(this.treeControl, this.treeFlattener); + this.dataSource = new McTreeFlatDataSource(this.treeControl, this.treeFlattener); database.dataChange.subscribe((data) => { - this.dataSource$.data = data; + this.dataSource.data = data; }); } diff --git a/packages/docs/tsconfig.json b/packages/docs/tsconfig.json index e349060f0..6db958ab7 100644 --- a/packages/docs/tsconfig.json +++ b/packages/docs/tsconfig.json @@ -1,25 +1,17 @@ { "compilerOptions": { - "allowSyntheticDefaultImports": true, + "baseUrl": "./", + "outDir": "./dist/out-tsc", + "sourceMap": true, "declaration": false, + "moduleResolution": "node", "emitDecoratorMetadata": true, "experimentalDecorators": true, + "target": "es5", "lib": [ "es2017", "dom" ], - - "module": "es2015", - "moduleResolution": "node", - "outDir": "./dist/out-tsc", - "sourceMap": true, - "skipLibCheck": true, - "resolveJsonModule": true, - "esModuleInterop": true, - "importHelpers": true, - "target": "es5", - "baseUrl": ".", - "stripInternal": false, "typeRoots": [ "../../node_modules/@types" ], @@ -29,64 +21,9 @@ "@ptsecurity/mosaic/*": ["../../dist/packages/mosaic/*"], "@ptsecurity/mosaic-moment-adapter/*": ["../../dist/packages/mosaic-moment-adapter/*"], -// "@ptsecurity/mosaic-moment-adapter": ["../../dist/packages/mosaic-moment-adapter"], "@ptsecurity/mosaic-examples/*": ["../../dist/packages/mosaic-examples/*"], "@ptsecurity/mosaic-examples": ["../../dist/packages/mosaic-examples"] -// -// -// "@ptsecurity/cdk": ["../../dist/release/cdk"], -// "@ptsecurity/cdk/a11y": ["../../dist/release/cdk/a11y"], -// "@ptsecurity/cdk/bidi": ["../../dist/release/cdk/bidi"], -// "@ptsecurity/cdk/datetime": ["../../dist/release/cdk/datetime"], -// "@ptsecurity/cdk/coercion": ["../../dist/release/cdk/coercion"], -// "@ptsecurity/cdk/collections": ["../../dist/release/cdk/collections"], -// "@ptsecurity/cdk/keycodes": ["../../dist/release/cdk/keycodes"], -// "@ptsecurity/cdk/layout": ["../../dist/release/cdk/layout"], -// "@ptsecurity/cdk/overlay": ["../../dist/release/cdk/overlay"], -// "@ptsecurity/cdk/platform": ["../../dist/release/cdk/platform"], -// "@ptsecurity/cdk/portal": ["../../dist/release/cdk/portal"], -// "@ptsecurity/cdk/scrolling": ["../../dist/release/cdk/scrolling"], -// "@ptsecurity/cdk/testing": ["../../dist/release/cdk/testing"], -// "@ptsecurity/cdk/tree": ["../../dist/release/cdk/tree"], -// -// "@ptsecurity/mosaic-moment-adapter": ["../../dist/release/mosaic-moment-adapter"], -// "@ptsecurity/mosaic-moment-adapter/adapter": ["../../dist/release/mosaic-moment-adapter/adapter"], -// -// "@ptsecurity/mosaic": ["../../dist/release/mosaic"], -// -// "@ptsecurity/mosaic/autocomplete": ["../../dist/release/mosaic/autocomplete"], -// "@ptsecurity/mosaic/button": ["../../dist/release/mosaic/button"], -// "@ptsecurity/mosaic/button-toggle": ["../../dist/release/mosaic/button-toggle"], -// "@ptsecurity/mosaic/core": ["../../dist/release/mosaic/core"], -// "@ptsecurity/mosaic/card": ["../../dist/release/mosaic/card"], -// "@ptsecurity/mosaic/datepicker": ["../../dist/release/mosaic/datepicker"], -// "@ptsecurity/mosaic/divider": ["../../dist/release/mosaic/divider"], -// "@ptsecurity/mosaic/dropdown": ["../../dist/release/mosaic/dropdown"], -// "@ptsecurity/mosaic/list": ["../../dist/release/mosaic/list"], -// "@ptsecurity/mosaic/navbar": ["../../dist/release/mosaic/navbar"], -// "@ptsecurity/mosaic/progress-bar": ["../../dist/release/mosaic/progress-bar"], -// "@ptsecurity/mosaic/progress-spinner": ["../../dist/release/mosaic/progress-spinner"], -// "@ptsecurity/mosaic/icon": ["../../dist/release/mosaic/icon"], -// "@ptsecurity/mosaic/layout": ["../../dist/release/mosaic/layout"], -// "@ptsecurity/mosaic/link": ["../../dist/release/mosaic/link"], -// "@ptsecurity/mosaic/radio": ["../../dist/release/mosaic/radio"], -// "@ptsecurity/mosaic/checkbox": ["../../dist/release/mosaic/checkbox"], -// "@ptsecurity/mosaic/input": ["../../dist/release/mosaic/input"], -// "@ptsecurity/mosaic/form-field": ["../../dist/release/mosaic/form-field"], -// "@ptsecurity/mosaic/tree": ["../../dist/release/mosaic/tree"], -// "@ptsecurity/mosaic/modal": ["../../dist/release/mosaic/modal"], -// "@ptsecurity/mosaic/tags": ["../../dist/release/mosaic/tags"], -// "@ptsecurity/mosaic/tabs": ["../../dist/release/mosaic/tabs"], -// "@ptsecurity/mosaic/select": ["../../dist/release/mosaic/select"], -// "@ptsecurity/mosaic/sidepanel": ["../../dist/release/mosaic/sidepanel"], -// "@ptsecurity/mosaic/textarea": ["../../dist/release/mosaic/textarea"], -// "@ptsecurity/mosaic/toggle": ["../../dist/release/mosaic/toggle"], -// "@ptsecurity/mosaic/tooltip": ["../../dist/release/mosaic/tooltip"], -// "@ptsecurity/mosaic/timepicker": ["../../dist/release/mosaic/timepicker"], -// "@ptsecurity/mosaic/tree-select": ["../../dist/release/mosaic/tree-select"], -// "@ptsecurity/mosaic/splitter": ["../../dist/release/mosaic/splitter"], -// "@ptsecurity/mosaic/vertical-navbar": ["../../dist/release/mosaic/vertical-navbar"] } }, "exclude": [ diff --git a/packages/mosaic/tree/tree-selection.ts b/packages/mosaic/tree/tree-selection.ts index 30094590a..5bc3efc8b 100644 --- a/packages/mosaic/tree/tree-selection.ts +++ b/packages/mosaic/tree/tree-selection.ts @@ -45,15 +45,15 @@ export class McTreeSelectionChange { constructor(public source: McTreeSelection, public option: McTreeOption) {} } -class McTreeSelectionBase extends CdkTree { - constructor(differs: IterableDiffers, changeDetectorRef: ChangeDetectorRef) { - super(differs, changeDetectorRef); - } -} - -/* tslint:disable-next-line:naming-convention */ -const McTreeSelectionBaseMixin: HasTabIndexCtor & CanDisableCtor & - typeof McTreeSelectionBase = mixinTabIndex(mixinDisabled(McTreeSelectionBase)); +// class McTreeSelectionBase extends CdkTree { +// constructor(differs: IterableDiffers, changeDetectorRef: ChangeDetectorRef) { +// super(differs, changeDetectorRef); +// } +// } +// +// /* tslint:disable-next-line:naming-convention */ +// const McTreeSelectionBaseMixin: HasTabIndexCtor & CanDisableCtor & +// typeof McTreeSelectionBase = mixinTabIndex(mixinDisabled(McTreeSelectionBase)); @Component({ @@ -76,7 +76,7 @@ const McTreeSelectionBaseMixin: HasTabIndexCtor & CanDisableCtor & { provide: CdkTree, useExisting: McTreeSelection } ] }) -export class McTreeSelection extends McTreeSelectionBaseMixin +export class McTreeSelection extends CdkTree implements AfterContentInit, CanDisable, HasTabIndex { @ViewChild(CdkTreeNodeOutlet, {static: true}) nodeOutlet: CdkTreeNodeOutlet;