1.1.5 • Published 5 years ago

idevotion-ionic-components v1.1.5

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

idevotion-ionic-components

Some custom ionic 4 components. I will add new components on regular intervals. If you use it and like it, please feel free to:

rating-display component

  • A component to display rating similar to Amazon display Rating display component

search-places component

  • A component to search google places Rating display component

imageGallery component

  • A component to display a gallery of images. Two layout supported : standard and pinterest Rating display component

Installation

To install the components.

$ npm install idevotion-ionic-components

How to use:

If you are using Lazy Loading in your application, add the IDevotionIonicComponentModule to the imports section of the page module where you want to display the rating component otherwise import it to your global app.module.ts

import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { IonicModule } from '@ionic/angular';
import { FormsModule } from '@angular/forms';
import { RouterModule } from '@angular/router';

import { HomePage } from './home.page';
import {IDevotionIonicComponentModule} from 'idevotion-ionic-component'

@NgModule({
  imports: [
    CommonModule,
    FormsModule,
    IonicModule,
    IDevotionIonicComponentModule,
    RouterModule.forChild([
      {
        path: '',
        component: HomePage
      }
    ])
  ],
  declarations: [HomePage],
  entryComponents:[]
})
export class HomePageModule {}

How to use rating-display:

On your html page you can use :

 <rating-display title="YourTitle" totalNote="7" note=3.5 nbNoteOne=0 nbNoteTwo=1 nbNoteThree=3 nbNoteFour=1 nbNote5=2></rating-display>

You can customize the following parameters:

ParametersDefinition
titleThe label you want to display
labelStarsThe label for stars
noteThe note to display
totalNoteTotal number of vote received
nbNoteOneTotal number received for one star
nbNoteTwoTotal number received for two star
nbNotethreeTotal number received for three star
nbNoteFourTotal number received for four star
nbNoteFiveTotal number received for five star
activeColorColor for active star (default is #ffa500)
defaultColorDefault color for inactive star (default is #767676)

How to use search-places:

To be able to use the component, you need to include the Google Map library to your index.html of your app with a valid API KEY for using places api.

<script src="https://maps.googleapis.com/maps/api/js?v=3&key=<yourapikey>&libraries=places"></script>

Please notice that this component use Storage (https://ionicframework.com/docs/building/storage) so we need to include it in your page or app module.

On your html page you can use :

 <search-places withHistory=true (itemSelected)="itemSelected($event)"></search-places>

You can customize the following parameters:

ParametersDefinition
withHistorySet true if you want the component to save your selected places and display them for futur use
restrictCountrytrue or false (default is true). Use to indicate if your want Google Places to restrict the country in the search
countryRestrictedList of country iso code you want to restrict. (default is "FR")

use (itemSelected) event to know when a place is selected.

  itemSelected(item){
    console.log(item)
  }

How to use imageGallery:

Just include the imageGallery tag in your html

  <imageGallery galleryType="standard" 
  imagesToDisplay="{{images}}"
  (imagesSelected)="imagesSelected($event)">

    </imageGallery>

You can customize the following parameters:

ParametersDefinition
galleryTypestandard or pinterest
imagesToDisplaya list of images url to display

Exemple:

let image1 = 'https://images.unsplash.com/photo-1422004707501-e8dad229e17a?fm=jpg';
let image2 = 'https://images.unsplash.com/photo-1439931444800-9bcc83f804a6?fm=jpg';
let image3 = 'https://images.unsplash.com/photo-1417128281290-30a42da46277?fm=jpg';

    this.images=[]
    this.images.push(image1)
    this.images.push(image2)
    this.images.push(image3)
    this.images.push(image1)
    this.images.push(image2)
    this.images.push(image3)
    this.images.push(image1)

use (imagesSelected) event to know when an image is selected.

  imagesSelected(url){
    console.log("Image selected "+url)
  }

ⒸChristophe Surbier 2019

1.1.5

5 years ago

1.1.4

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago