2.11.19 • Published 2 years ago

@eff-custom-plugins/location-radius v2.11.19

Weekly downloads
56
License
ISC
Repository
-
Last release
2 years ago

Location Radius

LocationRadius is a reusable component using Angular v8.2.0

Installation

NPM

npm i @eff-custom-plugins/location-radius

Usage

HTML

<app-location    [locationList]="[{  key: "AM",
                                     name: "Армения",
                                     type: "country",
                                     country_code: "AM",
                                     country_name: "Армения",
                                     supports_region: true,
                                     supports_city: true }]"
                 [radiusRangeConfig]="{ min:0, max:25,
                                        radiusSizeType: 'mi',
                                        defaultValue: 'Current city only',
                                        selectRadiusTitle: 'Cities within radius'}"
                 (selectedLocation)="onSelectedLocation($event)"
                 (searchedLocation)="onSearchedLocation($event)"></app-location>

Attributes

AttributesDescription
@Input() locationList: ILocationList[]This Location data list
@Input() radiusRangeConfig: ILocationRadiusValueConfigThis Location radius validation config not required defaults {default: {radius: {min: 10, max: 50, unit: 'mi'}, {min: 16, max: 80, unit: 'km'}}, custom: {MX: {radius: {min: 10, max: 50, unit: 'mi'}, {min: 16, max: 80, unit: 'km'}}}}
@Input() availableCountryCodes: string[]Items belonging to availableCountryCodes only can be selected
@Input() expendedListing: booleanIf 'true' locations will combine by groups. If 'false' it will appear all together ('true' by default)
@Input() disabled: booleandisable all actions ('true' by default)
@Output() selectedLocationEvent:EventEmitter<ILocationList[]>()This event emits all selected Location Items
@Output() searchedLocation:EventEmitter<string.>()This event emits searched text
@Output() unavailableOptionEvent:EventEmitter<ILocationList.>()Trigger event in case if selected item doesn't match to availableCountryCodes requirement

Example and Sample Code

1) Import 'LocationRadiusModule' in your app module

import { LocationRadiusModule } from "@eff-custom-plugins/location-radius";

@NgModule({
  imports:[
    ..
    LocationRadiusModule
    ..
  ]
})

1) Add bootstrap and main styles to your app

npm i bootstrap
"styles": [
  ..
  "node_modules/bootstrap/dist/css/bootstrap.min.css",
  "node_modules/@eff-custom-plugins/location-radius/lib/assets/main.scss",
  ..
],

3) Add 'location-radius' in your component html

<location-radius [locationList]="[{  key: "AM",
                                     name: "Армения",
                                     type: "country",
                                     country_code: "AM",
                                     country_name: "Армения",
                                     supports_region: true,
                                     supports_city: true }]"
                 [radiusRangeConfig]="{ min:0, max:25,
                                        radiusSizeType: 'mi',
                                        defaultValue: 'Current city only',
                                        selectRadiusTitle: 'Cities within radius'}"
                 (selectedLocation)="onSelectedLocation($event)"
                 (searchedLocation)="onSearchedLocation($event)"></location-radius>
3.0.1

2 years ago

2.11.17

2 years ago

2.11.18

2 years ago

2.11.19

2 years ago

3.0.0

2 years ago

2.11.16

2 years ago

2.11.15

2 years ago

2.11.0

2 years ago

2.11.1

2 years ago

2.11.8

2 years ago

2.11.9

2 years ago

2.11.6

2 years ago

2.11.7

2 years ago

2.11.4

2 years ago

2.11.5

2 years ago

2.11.2

2 years ago

2.11.3

2 years ago

2.11.10

2 years ago

2.11.11

2 years ago

2.11.12

2 years ago

2.11.13

2 years ago

2.11.14

2 years ago

2.10.2

2 years ago

2.10.3

2 years ago

2.10.1

3 years ago

2.10.0

3 years ago

2.8.0

3 years ago

2.9.0

3 years ago

2.7.0

3 years ago

2.6.13

4 years ago

2.6.12

4 years ago

2.6.11

4 years ago

2.6.10

4 years ago

2.6.9

4 years ago

2.6.7

4 years ago

2.6.8

4 years ago

2.6.6

4 years ago

2.6.5

4 years ago

2.6.4

4 years ago

2.6.3

4 years ago

2.6.2

4 years ago

2.6.1

4 years ago

2.5.4

4 years ago

2.5.3

4 years ago

2.5.2

4 years ago

2.5.1

4 years ago

2.5.0

4 years ago

2.4.1

4 years ago

2.4.0

4 years ago

2.3.9

4 years ago

2.3.8

4 years ago

2.3.6

4 years ago

2.3.7

4 years ago

2.3.4

4 years ago

2.3.5

4 years ago

2.3.3

4 years ago

2.3.2

4 years ago

2.3.1

4 years ago

2.3.0

4 years ago

2.2.11

4 years ago

2.2.10

4 years ago

2.2.9

4 years ago

2.2.8

4 years ago

2.2.7

4 years ago

2.2.5

4 years ago

2.2.6

4 years ago

2.2.4

4 years ago

2.2.3

4 years ago

2.2.2

4 years ago

2.2.1

4 years ago

2.2.0

4 years ago

2.1.0

4 years ago

2.0.0

4 years ago

1.2.0

4 years ago

1.1.3

4 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.0

4 years ago