# MedrecordUiComponents

[Components Demo](https://master-storybook.medvision360.org/)

## Installation

```shell script
npm i @medrecord/ui-components
```

Connect styles to you root styles file

```scss
@import "~@medrecord/ui-components/components";
```

Import `MedrecordUiComponentsModule` and `HttpClientModule` in root module of your application.

```angular2
@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    AppRoutingModule,
    ...
    MedrecordUiComponentsModule,
    HttpClientModule,
    ...
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }
```

## Troubleshooting

Take into account that starting with version 10, Angular now warns you when your build pulls in one of these bundles. If you’ve started seeing these warnings for your dependencies, let your dependency know that you’d prefer an ECMAScript module (ESM) bundle.
Here is an official documentation - [Configuring CommonJS dependencies](https://angular.io/guide/build#configuring-commonjs-dependencies)

Add into your `angular.json`

```json

"architect": {
"build": {
  "builder": "@angular-devkit/build-angular:browser",
  "options": {
    ...
    "allowedCommonJsDependencies": [
      "moment-timezone",
      "moment-range",
      "lodash/get",
      "lodash/uniqBy"
    ],
    ...
```

We are using i18n and Angular 9 introduced a global `$localize()` function that needs to be loaded.
Please run `ng add @angular/localize` from the Angular CLI.
(For non-CLI projects, add `import '@angular/localize/init';` to your `polyfills.ts` file.

