Browse Source

Format code

pull/332/head
Thomas Kaul 4 years ago
committed by Thomas
parent
commit
38bfb71156
  1. 13
      libs/ui/src/lib/ui.module.ts
  2. 7
      libs/ui/src/lib/value/value.component.html
  3. 5
      libs/ui/src/lib/value/value.component.spec.ts
  4. 15
      libs/ui/src/lib/value/value.component.stories.ts
  5. 2
      libs/ui/src/lib/value/value.component.ts

13
libs/ui/src/lib/ui.module.ts

@ -1,15 +1,12 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { ValueComponent } from './value/value.component';
// import { GfValueModule } from './value/value.module';
@NgModule({
imports: [CommonModule/*, GfValueModule*/],
declarations: [
ValueComponent
],
exports: [
ValueComponent
]
imports: [CommonModule /*, GfValueModule*/],
declarations: [ValueComponent],
exports: [ValueComponent]
})
export class UiModule {}

7
libs/ui/src/lib/value/value.component.html

@ -33,14 +33,13 @@
<small *ngIf="label">
{{ label }}
</small>
</ng-container>
</ng-container>
<ngx-skeleton-loader
<ngx-skeleton-loader
*ngIf="value === undefined"
animation="pulse"
[theme]="{
height: '1.5rem',
width: '5rem'
}"
></ngx-skeleton-loader>
></ngx-skeleton-loader>

5
libs/ui/src/lib/value/value.component.spec.ts

@ -8,9 +8,8 @@ describe('ValueComponent', () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ ValueComponent ]
})
.compileComponents();
declarations: [ValueComponent]
}).compileComponents();
});
beforeEach(() => {

15
libs/ui/src/lib/value/value.component.stories.ts

@ -1,5 +1,6 @@
import { moduleMetadata, Story, Meta } from '@storybook/angular';
import { Meta, Story, moduleMetadata } from '@storybook/angular';
import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader';
import { ValueComponent } from './value.component';
export default {
@ -7,26 +8,26 @@ export default {
component: ValueComponent,
decorators: [
moduleMetadata({
imports: [NgxSkeletonLoaderModule],
imports: [NgxSkeletonLoaderModule]
})
],
]
} as Meta<ValueComponent>;
const Template: Story<ValueComponent> = (args: ValueComponent) => ({
props: args,
props: args
});
export const Loading = Template.bind({});
Loading.args = {
value: undefined
}
};
export const Integer = Template.bind({});
Integer.args = {
isInteger: true,
locale: 'en',
value: 7
}
};
export const Currency = Template.bind({});
Currency.args = {
@ -35,4 +36,4 @@ Currency.args = {
label: 'Label',
locale: 'en',
value: 7
}
};

2
libs/ui/src/lib/value/value.component.ts

@ -2,7 +2,7 @@ import {
ChangeDetectionStrategy,
Component,
Input,
OnChanges,
OnChanges
} from '@angular/core';
import { DEFAULT_DATE_FORMAT } from '@ghostfolio/common/config';
import { format, isDate } from 'date-fns';

Loading…
Cancel
Save