-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from nontangent/feat/rename-prop-names
Feat/rename prop names
- Loading branch information
Showing
41 changed files
with
276 additions
and
171 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
export interface ActionItem<ID = number | string> { | ||
id: ID; | ||
import { Action } from "./action"; | ||
|
||
export interface ActionItem<T = any> extends Action<T> { | ||
name: string; | ||
icon?: string; | ||
color?: string; | ||
} | ||
|
||
export type ActionItemEvent<T = any> = [ActionItem, T]; |
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,4 @@ | ||
export interface Action<T = any> { | ||
id: string; | ||
payload?: T; | ||
} |
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,2 +1,3 @@ | ||
export * from './action'; | ||
export * from './action-item'; | ||
export * from './menu-item'; |
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
14 changes: 7 additions & 7 deletions
14
libs/components/src/atoms/smart-menu-button/smart-menu-button.atom.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,21 +1,21 @@ | ||
<ng-container [ngSwitch]="actionItems.length"> | ||
<ng-container [ngSwitch]="items?.length ?? 0"> | ||
<ng-container *ngSwitchCase="0"></ng-container> | ||
<ng-container *ngSwitchCase="1"> | ||
<button mat-icon-button (click)="actionItemClick.emit([actionItems[0]])"> | ||
<mat-icon>{{ actionItems[0]?.icon }}</mat-icon> | ||
<button mat-icon-button (click)="action.emit(items[0])"> | ||
<mat-icon>{{ items[0]?.icon }}</mat-icon> | ||
</button> | ||
</ng-container> | ||
<ng-container *ngSwitchDefault> | ||
<button mat-icon-button [matMenuTriggerFor]="menu" *ngIf="actionItems.length"> | ||
<button mat-icon-button [matMenuTriggerFor]="menu" *ngIf="items.length"> | ||
<mat-icon>menu</mat-icon> | ||
</button> | ||
</ng-container> | ||
</ng-container> | ||
|
||
<mat-menu #menu="matMenu"> | ||
<button | ||
*ngFor="let actionItem of actionItems" | ||
*ngFor="let item of items" | ||
mat-menu-item | ||
(click)="actionItemClick.emit([actionItem])" | ||
>{{ actionItem.name }}</button> | ||
(click)="action.emit(item)" | ||
>{{ item.name }}</button> | ||
</mat-menu> |
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
2 changes: 1 addition & 1 deletion
2
libs/components/src/molecules/chips-input-field/chips-input-field.molecule.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
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,18 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { CommonModule } from '@angular/common'; | ||
import { HeaderMolecule } from './header.molecule'; | ||
|
||
|
||
|
||
@NgModule({ | ||
declarations: [ | ||
HeaderMolecule | ||
], | ||
imports: [ | ||
CommonModule | ||
], | ||
exports: [ | ||
HeaderMolecule | ||
] | ||
}) | ||
export class HeaderModule { } |
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,2 @@ | ||
<span class="title">{{ title ?? '' }}</span> | ||
<span class="description">{{ description ?? '' }}</span> |
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,20 @@ | ||
@use 'scoped-var/strict' as * with ($host: 'header'); | ||
@use 'atomic/molecule' as *; | ||
|
||
:host { | ||
@include molecule($host); | ||
} | ||
|
||
:host { | ||
display: flex; | ||
flex-direction: row; | ||
justify-content: center; | ||
align-items: flex-end; | ||
|
||
.description { | ||
line-height: 1em; | ||
font-size: 12px; | ||
margin-bottom: 8px; | ||
margin-left: 4px; | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
libs/components/src/molecules/header/header.molecule.spec.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,25 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { HeaderMolecule } from './header.molecule'; | ||
|
||
describe('HeaderMolecule', () => { | ||
let component: HeaderMolecule; | ||
let fixture: ComponentFixture<HeaderMolecule>; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
declarations: [ HeaderMolecule ] | ||
}) | ||
.compileComponents(); | ||
}); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(HeaderMolecule); | ||
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,17 @@ | ||
import { Component, ChangeDetectionStrategy, Input } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'molecules-header', | ||
templateUrl: './header.molecule.html', | ||
styleUrls: ['./header.molecule.scss'], | ||
changeDetection: ChangeDetectionStrategy.OnPush | ||
}) | ||
export class HeaderMolecule { | ||
|
||
@Input() | ||
title = 'title'; | ||
|
||
@Input() | ||
description?: string; | ||
|
||
} |
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 { BrowserAnimationsModule } from '@angular/platform-browser/animations'; | ||
import { Meta, Story } from '@storybook/angular'; | ||
import { action } from '@storybook/addon-actions'; | ||
import { HeaderMolecule, HeaderModule } from '.'; | ||
|
||
export default { | ||
title: 'Molecules/Header', | ||
component: HeaderMolecule, | ||
} as Meta; | ||
|
||
const ACTIONS = { | ||
// eventEmitterName: action('eventEmitterName'), | ||
}; | ||
|
||
|
||
const Template: Story = (args) => ({ | ||
props: {...args, ...ACTIONS}, | ||
moduleMetadata: { | ||
imports: [ | ||
HeaderModule, | ||
] | ||
} | ||
}); | ||
|
||
export const Default = Template.bind({}); | ||
Default.args = {}; |
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,2 @@ | ||
export { HeaderMolecule } from './header.molecule'; | ||
export { HeaderModule } from './header.module'; |
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 @@ | ||
{ | ||
"$schema": "../../node_modules/ng-packagr/ng-package.schema.json", | ||
"dest": "../../dist/libs/components", | ||
"lib": { | ||
"entryFile": "index.ts", | ||
"styleIncludePaths": [ | ||
"../../../../node_modules", | ||
"../../styles" | ||
] | ||
} | ||
} |
4 changes: 2 additions & 2 deletions
4
libs/components/src/organisms/action-buttons-section/action-buttons-section.organism.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,3 +1,3 @@ | ||
<ng-container *ngFor="let item of actionItems; trackBy: trackById"> | ||
<button mat-raised-button color="primary" (click)="actionItemClick.emit([item])">{{ item?.name }}</button> | ||
<ng-container *ngFor="let item of items; trackBy: trackById"> | ||
<button mat-raised-button color="primary" (click)="action.emit(item)">{{ item?.name }}</button> | ||
</ng-container> |
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.