-
-
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.
feat(design): implement daffArticleEncapsulatedMixin (#1917)
- Loading branch information
Showing
10 changed files
with
123 additions
and
16 deletions.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
apps/design-land/src/app/core/article-encapsulated/article-encapsulated.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,26 @@ | ||
import { | ||
Component, | ||
ElementRef, | ||
Renderer2, | ||
} from '@angular/core'; | ||
|
||
import { daffArticleEncapsulatedMixin } from '@daffodil/design'; | ||
|
||
/** | ||
* An _elementRef and an instance of renderer2 are needed for the link set mixins | ||
*/ | ||
class DesignLandArticleEncapsulatedBase { | ||
constructor(public _elementRef: ElementRef, public _renderer: Renderer2) {} | ||
} | ||
|
||
const _designLandArticleEncapsulatedBase = daffArticleEncapsulatedMixin((DesignLandArticleEncapsulatedBase)); | ||
|
||
@Component({ | ||
selector: 'design-land-article-encapsulated', | ||
template: '<ng-content></ng-content>', | ||
}) | ||
export class DesignLandArticleEncapsulatedComponent extends _designLandArticleEncapsulatedBase { | ||
constructor(private elementRef: ElementRef, private renderer: Renderer2) { | ||
super(elementRef, renderer); | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
apps/design-land/src/app/core/article-encapsulated/article-encapsulated.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,17 @@ | ||
import { CommonModule } from '@angular/common'; | ||
import { NgModule } from '@angular/core'; | ||
|
||
import { DesignLandArticleEncapsulatedComponent } from './article-encapsulated.component'; | ||
|
||
@NgModule({ | ||
imports: [ | ||
CommonModule, | ||
], | ||
declarations: [ | ||
DesignLandArticleEncapsulatedComponent, | ||
], | ||
exports: [ | ||
DesignLandArticleEncapsulatedComponent, | ||
], | ||
}) | ||
export class DesignLandArticleEncapsulatedModule { } |
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
19 changes: 17 additions & 2 deletions
19
libs/design/src/molecules/accordion/accordion/accordion.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,15 +1,30 @@ | ||
import { | ||
ChangeDetectionStrategy, | ||
Component, | ||
ElementRef, | ||
Renderer2, | ||
} from '@angular/core'; | ||
|
||
import { daffArticleEncapsulatedMixin } from '../../../core/article-encapsulated/public_api'; | ||
|
||
/** | ||
* An _elementRef and an instance of renderer2 are needed for the link set mixins | ||
*/ | ||
class DaffAccordionBase { | ||
constructor(public _elementRef: ElementRef, public _renderer: Renderer2) {} | ||
} | ||
|
||
const _daffAccordionBase = daffArticleEncapsulatedMixin((DaffAccordionBase)); | ||
|
||
@Component({ | ||
selector: 'daff-accordion', | ||
templateUrl: './accordion.component.html', | ||
styleUrls: ['./accordion.component.scss'], | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
}) | ||
|
||
export class DaffAccordionComponent { | ||
|
||
export class DaffAccordionComponent extends _daffAccordionBase { | ||
constructor(private elementRef: ElementRef, private renderer: Renderer2) { | ||
super(elementRef, renderer); | ||
} | ||
} |
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
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