0.3.2 • Published 5 years ago

@welight/ngx-components v0.3.2

Weekly downloads
1
License
-
Repository
-
Last release
5 years ago

Welight Components

Components for Angular to use in Welight projects.

npm (scoped)

Installation

Step 1

npm install @welight/ngx-components

Step 2

Configure AppModule to use Welight components.

import { WelightComponentsModule } from '@welight/ngx-components';

@NgModule({
  imports: [
    // others modules...
    WelightComponentsModule
  ]
})
export class AppModule {}

Components

WelightCardOng <welight-card-ong>

Inputs

NameTypeDescription
showTitlebooleanDisplay name of Ong.
showDescriptionbooleanDisplay description of Ong.
isCheckablebooleanDisplay checkbox into card
checkedbooleanCheckbox initial value.
showButtonsbooleanDisplay footer buttons into card.
ongObject\<Ong>An object of type Ong with data.

Outputs

NameTypeDescription
checkboxChangeEventEmitter\<WelightCardOngChange>When checkbox clicked

Example

Demo

Note: To make the best use of the library, install in you project @welight/welight-api-ts.

<welight-card-ong
  *ngIf="ong"
  [ong]="ong"
  [isCheckable]="true"
  [checked]="true"
  [showDescription]="false"
  (checkboxChange)="changeOng($event)"
></welight-card-ong>
import { WelightCardOngChange } from '@welight/ngx-components';

@Component({
  selector: 'example'
})
export class ExampleComponent {
  ong: Ong;

  constructor(private service: WelightService){}

  async ngOnInit() {
    this.ong = await this.service.ongs.objects.find()[0];
  }

  changeOng(event: WelightCardOngChange) {
    console.log(event);
  }
}

WelightShimmerPlaceholder <welight-shimmer-placeholder>

Inputs

NameTypeDescription
dataPromise | string | string[]Array of URLs or Promise to resolve.
forceResultbooleanForce display result when exists error.

Outputs

NameTypeDescription
onCompleteEventEmitter\<any>When finish load.
onSuccessEventEmitter\<any>When finish load with success.
onErrorEventEmitter\<any>When finish load with error.

Example

Demo

<welight-shimmer-placeholder [data]="data">
  <welight-placeholder-container>
    <p wePlaceholderItem height="20px"></p>
  </welight-placeholder-container>

  <welight-shimmer-result>
    <p>Lorem Ipsum...<p>
  </welight-shimmer-result>
</welight-shimmer-placeholder>
@Component({
  selector: 'example'
})
export class ExampleComponent {
  data: Promise<any>;

  ngOnInit() {
    this.ong = new Promise((resolve, reject) => {
      setTimeout(() => {
        resolve();
      }, 5000);
    });
  }
}
0.3.2

5 years ago

0.3.1

5 years ago

0.3.0

5 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago