airport-one-embeddable-widgets 2.5.2 → 2.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +41 -19
- package/dist/airport-one-embeddable-widgets.iife.js +37 -37
- package/package.json +12 -13
package/README.md
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
# Flight Search Form Custom Element
|
|
2
|
+
|
|
2
3
|
The Flight Search Form Custom Element is a web component that you can use in your website to display a flight search form. You can use it as a standard HTML element, and you don't need to have a React application to use it.
|
|
3
4
|
|
|
4
5
|
## Installation
|
|
6
|
+
|
|
5
7
|
To include the flight-search-form custom element in your project, add the following script tag to your HTML file:
|
|
6
8
|
|
|
7
9
|
```html
|
|
@@ -9,6 +11,7 @@ To include the flight-search-form custom element in your project, add the follow
|
|
|
9
11
|
```
|
|
10
12
|
|
|
11
13
|
## Usage
|
|
14
|
+
|
|
12
15
|
To use the flight-search-form custom element, simply add the following HTML tag to your markup:
|
|
13
16
|
|
|
14
17
|
```html
|
|
@@ -17,22 +20,22 @@ To use the flight-search-form custom element, simply add the following HTML tag
|
|
|
17
20
|
|
|
18
21
|
You can customize the behavior and appearance of the element by setting its attributes. The available attributes are listed in the table below:
|
|
19
22
|
|
|
20
|
-
Attribute
|
|
21
|
-
|
|
22
|
-
origin
|
|
23
|
-
destination
|
|
24
|
-
airlines
|
|
25
|
-
providers
|
|
26
|
-
destinations
|
|
27
|
-
primaryColor
|
|
28
|
-
secondaryColor
|
|
29
|
-
locationId
|
|
30
|
-
experimentId
|
|
31
|
-
clickId
|
|
32
|
-
arrivalAirportLabel
|
|
33
|
-
departureAirportLabel | string | null
|
|
34
|
-
departureDateLabel
|
|
35
|
-
returnDateLabel
|
|
23
|
+
| Attribute | Type | Default | Description |
|
|
24
|
+
| --------------------- | ------ | ------- | ------------------------------------------- |
|
|
25
|
+
| origin | string | null | The origin airport code |
|
|
26
|
+
| destination | string | null | The destination airport code |
|
|
27
|
+
| airlines | string | null | A comma-separated list of airline codes |
|
|
28
|
+
| providers | string | null | A comma-separated list of provider codes |
|
|
29
|
+
| destinations | string | null | A comma-separated list of destination codes |
|
|
30
|
+
| primaryColor | string | null | The primary color of the form |
|
|
31
|
+
| secondaryColor | string | null | The secondary color of the form |
|
|
32
|
+
| locationId | string | null | The location identifier |
|
|
33
|
+
| experimentId | string | null | The experiment identifier |
|
|
34
|
+
| clickId | string | null | The click identifier |
|
|
35
|
+
| arrivalAirportLabel | string | null | The label for the arrival airport input |
|
|
36
|
+
| departureAirportLabel | string | null | The label for the departure airport input |
|
|
37
|
+
| departureDateLabel | string | null | The label for the departure date input |
|
|
38
|
+
| returnDateLabel | string | null | The label for the return date input |
|
|
36
39
|
|
|
37
40
|
## Examples
|
|
38
41
|
|
|
@@ -47,54 +50,71 @@ For example, to set the origin and destination airports, you can use the followi
|
|
|
47
50
|
## Flight Search Widget: Element Descriptions
|
|
48
51
|
|
|
49
52
|
### 1. `flight-search-widget-container`
|
|
53
|
+
|
|
50
54
|
The main container wrapping the entire flight search widget. Target this to style the overall appearance.
|
|
51
55
|
|
|
52
56
|
### 2. `flight-search-widget-form`
|
|
57
|
+
|
|
53
58
|
The form inside the widget that contains the search inputs and buttons. Customize this to modify the form layout and styling.
|
|
54
59
|
|
|
55
60
|
### 3. `flight-search-widget-autocomplete-container`
|
|
61
|
+
|
|
56
62
|
Holds the autocomplete functionality for the departure and arrival airports. Style this container to enhance the autocomplete feature.
|
|
57
63
|
|
|
58
64
|
### 4. `flight-search-widget-autocomplete-wrapper`
|
|
65
|
+
|
|
59
66
|
Wraps each autocomplete input. Target this to customize the wrapper around the autocomplete input fields.
|
|
60
67
|
|
|
61
68
|
### 5. `flight-search-widget-autocomplete-icon`
|
|
69
|
+
|
|
62
70
|
The icon associated with the autocomplete input field. Style this to change the icon's appearance.
|
|
63
71
|
|
|
64
72
|
### 6. `flight-search-widget-autocomplete-input`
|
|
73
|
+
|
|
65
74
|
The input field for the autocomplete feature. Modify its appearance and behavior as needed.
|
|
66
75
|
|
|
67
76
|
### 7. `flight-search-widget-switch`
|
|
77
|
+
|
|
68
78
|
The switch button that allows users to swap departure and arrival airports. Style this to improve visual appeal and click-feedback.
|
|
69
79
|
|
|
70
80
|
### 8. `flight-search-widget-switch-svg`
|
|
81
|
+
|
|
71
82
|
The SVG graphic within the switch button. Customize this for the desired visual effect.
|
|
72
83
|
|
|
73
84
|
### 9. `flight-search-widget-date-range-container`
|
|
85
|
+
|
|
74
86
|
Holds the date range inputs for selecting departure and return dates. Customize this for layout and styling of the date inputs.
|
|
75
87
|
|
|
76
88
|
### 10. `flight-search-widget-date-range-icon`
|
|
89
|
+
|
|
77
90
|
The icon within the date range inputs. Style this to change the appearance of the date selection icons.
|
|
78
91
|
|
|
79
92
|
### 11. `flight-search-widget-date-range-start-date-input`
|
|
93
|
+
|
|
80
94
|
The input field for selecting the departure date. Modify its appearance and behavior as needed.
|
|
81
95
|
|
|
82
96
|
### 12. `flight-search-widget-date-range-vertical-line-separator`
|
|
97
|
+
|
|
83
98
|
The vertical line separator between the departure and return date inputs. Style this to create a distinct separator effect.
|
|
84
99
|
|
|
85
100
|
### 13. `flight-search-widget-date-range-end-date-input`
|
|
101
|
+
|
|
86
102
|
The input field for selecting the return date. Modify its appearance and behavior as needed.
|
|
87
103
|
|
|
88
104
|
### 14. `flight-search-widget-search-button-container`
|
|
105
|
+
|
|
89
106
|
The container that holds the search button. Customize this to adjust the button's position within the widget.
|
|
90
107
|
|
|
91
108
|
### 15. `flight-search-widget-search-button`
|
|
109
|
+
|
|
92
110
|
The search button that submits the flight search. Style this for visual appeal and interactive feedback.
|
|
93
111
|
|
|
94
112
|
### 16. `flight-search-widget-search-button-svg`
|
|
113
|
+
|
|
95
114
|
The SVG graphic within the search button. Customize this for the desired visual effect.
|
|
96
115
|
|
|
97
116
|
### Example usage
|
|
117
|
+
|
|
98
118
|
```css
|
|
99
119
|
/* Targeting the main container */
|
|
100
120
|
flight-search-form::part(flight-search-widget-container) {
|
|
@@ -131,7 +151,7 @@ flight-search-form::part(flight-search-widget-autocomplete-input) {
|
|
|
131
151
|
|
|
132
152
|
/* Styling the switch button */
|
|
133
153
|
flight-search-form::part(flight-search-widget-switch) {
|
|
134
|
-
background-color: #
|
|
154
|
+
background-color: #007bff;
|
|
135
155
|
color: #fff;
|
|
136
156
|
}
|
|
137
157
|
|
|
@@ -158,7 +178,9 @@ flight-search-form::part(flight-search-widget-date-range-start-date-input) {
|
|
|
158
178
|
}
|
|
159
179
|
|
|
160
180
|
/* Styling the vertical line separator */
|
|
161
|
-
flight-search-form::part(
|
|
181
|
+
flight-search-form::part(
|
|
182
|
+
flight-search-widget-date-range-vertical-line-separator
|
|
183
|
+
) {
|
|
162
184
|
border-left: 1px solid #ddd;
|
|
163
185
|
}
|
|
164
186
|
|
|
@@ -175,7 +197,7 @@ flight-search-form::part(flight-search-widget-search-button-container) {
|
|
|
175
197
|
|
|
176
198
|
/* Styling the search button */
|
|
177
199
|
flight-search-form::part(flight-search-widget-search-button) {
|
|
178
|
-
background-color: #
|
|
200
|
+
background-color: #007bff;
|
|
179
201
|
color: #fff;
|
|
180
202
|
padding: 10px 20px;
|
|
181
203
|
border-radius: 5px;
|