1.0.45 • Published 7 years ago

eurostar-location-select v1.0.45

Weekly downloads
-
License
ISC
Repository
-
Last release
7 years ago

Eurostar Location select Component

The location-select component selects a train station using typeahead within this component. Includes data caching.

Installation

Base Styles must be installed in order to use the component. For more detailed explaination please review the Styleguide README here

The location-select has 1 third party library which is preinstalled with Base Styles along with the location-select component itself. For more detailed explaination please review the Styleguide README: /docs/documentation.html#consuming.

Third party dependencies:

  • breakpoint-sass

Eurostar:

  • eurostar-location-select

Usage

  1. Extract the HTML markup as defined under Expand Markup under the specific variant type: (https://style.eurostar.com/components/detail/location-select.html)

  2. Import styles:

    // Using JSPM:
    @import "jspm:eurostar-location-select/location-select";
    // Using Webpack:
    @import "~eurostar-location-select/_location-select.scss";
  1. Import JS and Component Initialisation:
    // Using JSPM:
    import LocationSelect from 'eurostar-location-select/location-select';
    const locationSelect = new LocationSelect();
  1. Static data

You must pass in a json path for stations data. The default for this is /data/stationData.json. You can change it by doing the following in your main.js file:

const locationSelect = new LocationSelect({
    stationDataURL: 'MY/JSON/PATH.json'
});

The validation rule currently allows Any UK to continental station and vise versa. There are exceptions to this rule and they can be defined as follows:

const locationSelect = new LocationSelect({
    odPairExceptions: [
        // Brussels > Calais
        '8814001,8728107',
        // Calais > Brussels
        '8728107,8814001',
        // Calais > Lille
        '8728107,8722326',
        // Lille > Calais
        '8722326,8728107'
    ]
});
1.0.45

7 years ago

1.0.44

7 years ago

1.0.43

7 years ago

1.0.42

7 years ago

1.0.41

7 years ago

1.0.40

7 years ago

1.0.39

7 years ago

1.0.38

7 years ago

1.0.37

7 years ago

1.0.36

7 years ago

1.0.35

7 years ago

1.0.34

7 years ago

1.0.33

7 years ago

1.0.32

7 years ago

1.0.32-alpha.4

7 years ago

1.0.32-alpha.3

7 years ago

1.0.32-alpha.2

7 years ago

1.0.32-alpha.1

7 years ago

1.0.31

7 years ago

1.0.30

7 years ago

1.0.29

7 years ago

1.0.28

7 years ago

1.0.27

7 years ago

1.0.27-alpha.1

7 years ago

1.0.26

7 years ago

1.0.24

7 years ago

1.0.23

7 years ago

1.0.22

8 years ago

1.0.21

8 years ago

1.0.20

8 years ago

1.0.19

8 years ago

1.0.1-9.alpha-1

8 years ago

1.0.18

8 years ago

1.0.17

8 years ago

1.0.16

8 years ago

1.0.15

8 years ago

1.0.14

8 years ago

1.0.13

8 years ago

1.0.12

8 years ago

1.0.11

8 years ago

1.0.10

8 years ago

1.0.9

8 years ago

1.0.8

8 years ago

1.0.7

8 years ago

1.0.6

8 years ago

1.0.5

8 years ago

1.0.4

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago