@aurodesignsystem-dev/auro-flight 0.0.0-pr166.0 → 0.0.0-pr168.0
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 +77 -70
- package/demo/api.md +372 -198
- package/demo/auro-flight.min.js +128 -41
- package/demo/index.md +23 -511
- package/dist/{auro-flight-hKw-4WrK.js → auro-flight-DI2Zb2qR.js} +8 -8
- package/dist/index.d.ts +218 -132
- package/dist/index.js +1 -1
- package/dist/registered.js +1 -1
- package/package.json +15 -9
package/README.md
CHANGED
|
@@ -23,10 +23,6 @@ The following sections are editable by making changes to the following files:
|
|
|
23
23
|
<!-- The below content is automatically added from ./docs/partials/description.md -->
|
|
24
24
|
The `<auro-flight>` element encapsulates Alaska's flight result logic. A departure station and an arrival station are displayed in tandem with all sectors of the flight in an [auro-flightline](https://auro.alaskaair.com/components/auro/flightline) element.
|
|
25
25
|
|
|
26
|
-
## Attributes
|
|
27
|
-
|
|
28
|
-
The `<auro-flight>` custom element's API consists of a series of attributes to be defined at the time of use. Be sure to review the [api documentation](https://auro.alaskaair.com/components/auro/flight/api) for this element.
|
|
29
|
-
|
|
30
26
|
## Dependencies
|
|
31
27
|
|
|
32
28
|
The `<auro-flight>` element has dependencies on the following additional Auro custom elements.
|
|
@@ -37,28 +33,47 @@ The `<auro-flight>` element has dependencies on the following additional Auro cu
|
|
|
37
33
|
|
|
38
34
|
└── @aurodesignsystem/auro-flight
|
|
39
35
|
| ├── (internal dependency) @aurodesignsystem/auro-flight-header
|
|
40
|
-
| ├── (internal dependency) @aurodesignsystem/auro-flight-
|
|
36
|
+
| ├── (internal dependency) @aurodesignsystem/auro-flight-main
|
|
41
37
|
| └── (external dependency) @aurodesignsystem/auro-datetime
|
|
42
38
|
```
|
|
43
39
|
|
|
44
40
|
See [documentation](https://auro.alaskaair.com/components/auro/flightline/api) for additional information regarding the `<auro-flight-segment>` API.
|
|
45
41
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
46
42
|
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./docs/partials/readmeAddlInfo.md) -->
|
|
47
|
-
<!-- The below content is automatically added from ./docs/partials/readmeAddlInfo.md -->
|
|
48
|
-
|
|
43
|
+
<!-- The below content is automatically added from ./docs/partials/readmeAddlInfo.md -->
|
|
44
|
+
|
|
45
|
+
## Dependencies
|
|
46
|
+
|
|
47
|
+
The `<auro-flight>` element has dependencies on the following additional Auro custom elements.
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
└── @aurodesignsystem/auro-flightline
|
|
51
|
+
| ├── (internal dependency) @aurodesignsystem/auro-flight-segment
|
|
52
|
+
|
|
53
|
+
└── @aurodesignsystem/auro-flight
|
|
54
|
+
| ├── (internal dependency) @aurodesignsystem/auro-flight-header
|
|
55
|
+
| ├── (internal dependency) @aurodesignsystem/auro-flight-main
|
|
56
|
+
| └── (external dependency) @aurodesignsystem/auro-datetime
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
See [documentation](https://auro.alaskaair.com/components/auro/flightline/api) for additional information regarding the `<auro-flight-segment>` API.
|
|
49
60
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
50
61
|
|
|
51
|
-
##
|
|
62
|
+
## Use Cases
|
|
52
63
|
|
|
53
|
-
<!-- AURO-GENERATED-CONTENT:START (
|
|
54
|
-
|
|
64
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./docs/partials/useCases.md) -->
|
|
65
|
+
<!-- The below content is automatically added from ./docs/partials/useCases.md -->
|
|
66
|
+
The `<auro-flight>` element should be used in situations where users may:
|
|
55
67
|
|
|
68
|
+
* list all the available data for a flight
|
|
69
|
+
* list all stopovers or layovers for a flight
|
|
70
|
+
* list connecting flights or other important information
|
|
56
71
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
57
72
|
|
|
58
73
|
## Install
|
|
59
74
|
|
|
60
75
|
<!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/usage/componentInstall.md) -->
|
|
61
|
-
[](https://github.com/AlaskaAirlines/auro-flight/actions/workflows/release.yml)
|
|
62
77
|
[](https://www.npmjs.com/package/@aurodesignsystem/auro-flight)
|
|
63
78
|
[](https://www.apache.org/licenses/LICENSE-2.0)
|
|
64
79
|

|
|
@@ -69,17 +84,10 @@ $ npm i @aurodesignsystem/auro-flight
|
|
|
69
84
|
|
|
70
85
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
71
86
|
|
|
72
|
-
###
|
|
73
|
-
|
|
74
|
-
<!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/development/designTokens.md) -->
|
|
75
|
-
The use of any Auro custom element has a dependency on the [Auro Design Tokens](https://auro.alaskaair.com/getting-started/developers/design-tokens).
|
|
76
|
-
|
|
77
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
78
|
-
|
|
79
|
-
### Define dependency in project component
|
|
87
|
+
### Define Dependency in Project
|
|
80
88
|
|
|
81
89
|
<!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/usage/componentImportDescription.md) -->
|
|
82
|
-
Defining the
|
|
90
|
+
Defining the dependency within each project that is using the `<auro-flight>` component.
|
|
83
91
|
|
|
84
92
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
85
93
|
<!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/usage/componentImport.md) -->
|
|
@@ -88,25 +96,9 @@ Defining the component dependency within each component that is using the `<auro
|
|
|
88
96
|
import "@aurodesignsystem/auro-flight";
|
|
89
97
|
```
|
|
90
98
|
|
|
91
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
92
|
-
**Reference component in HTML**
|
|
93
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./apiExamples/basic.html) -->
|
|
94
|
-
<!-- The below code snippet is automatically added from ./apiExamples/basic.html -->
|
|
95
|
-
|
|
96
|
-
```html
|
|
97
|
-
<auro-flight
|
|
98
|
-
flights='["AS 1436"]'
|
|
99
|
-
duration="161"
|
|
100
|
-
departureTime="2022-07-13T12:15:00-07:00"
|
|
101
|
-
departureStation="SEA"
|
|
102
|
-
arrivalTime="2022-07-13T14:56:00-07:00"
|
|
103
|
-
arrivalStation="LAX">
|
|
104
|
-
<auro-flightline></auro-flightline>
|
|
105
|
-
</auro-flight>
|
|
106
|
-
```
|
|
107
99
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
108
100
|
|
|
109
|
-
|
|
101
|
+
### Use CDN
|
|
110
102
|
|
|
111
103
|
<!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/usage/bundleInstallDescription.md) -->
|
|
112
104
|
In cases where the project is not able to process JS assets, there are pre-processed assets available for use. Legacy browsers such as IE11 are no longer supported.
|
|
@@ -117,20 +109,7 @@ In cases where the project is not able to process JS assets, there are pre-proce
|
|
|
117
109
|
|
|
118
110
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
119
111
|
|
|
120
|
-
##
|
|
121
|
-
|
|
122
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./docs/partials/useCases.md) -->
|
|
123
|
-
<!-- The below content is automatically added from ./docs/partials/useCases.md -->
|
|
124
|
-
The `<auro-flight>` element should be used in situations where users may:
|
|
125
|
-
|
|
126
|
-
* list all the available data for a flight
|
|
127
|
-
* list all stopovers or layovers for a flight
|
|
128
|
-
* list connecting flights or other important information
|
|
129
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
130
|
-
|
|
131
|
-
## API Code Examples
|
|
132
|
-
|
|
133
|
-
### Default auro-flight
|
|
112
|
+
## Basic Example
|
|
134
113
|
|
|
135
114
|
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./apiExamples/basic.html) -->
|
|
136
115
|
<!-- The below code snippet is automatically added from ./apiExamples/basic.html -->
|
|
@@ -148,31 +127,59 @@ The `<auro-flight>` element should be used in situations where users may:
|
|
|
148
127
|
```
|
|
149
128
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
150
129
|
|
|
151
|
-
##
|
|
130
|
+
## Custom Component Registration for Version Management
|
|
152
131
|
|
|
153
|
-
|
|
154
|
-
|
|
132
|
+
There are two key parts to every Auro component: the <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes">class</a> and the custom element definition.
|
|
133
|
+
The class defines the component’s behavior, while the custom element registers it under a specific name so it can be used in HTML.
|
|
155
134
|
|
|
156
|
-
|
|
135
|
+
When you install the component as described on the `Install` page, the class is imported automatically, and the component is registered globally for you.
|
|
157
136
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
### Start development environment
|
|
137
|
+
However, if you need to load multiple versions of the same component on a single page (for example, when two projects depend on different versions), you can manually register the class under a custom element name to avoid conflicts.
|
|
161
138
|
|
|
162
|
-
|
|
163
|
-
Once the project has been cloned to your local resource and you have installed all the dependencies you will need to open a shell session to run the **dev server**.
|
|
139
|
+
You can do this by importing only the component class and using the `register(name)` method with a unique name:
|
|
164
140
|
|
|
165
|
-
|
|
166
|
-
|
|
141
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./docs/partials/customRegistration.md) -->
|
|
142
|
+
<!-- The below content is automatically added from ./docs/partials/customRegistration.md -->
|
|
143
|
+
|
|
144
|
+
```js
|
|
145
|
+
// Import the class only
|
|
146
|
+
import { AuroFlight } from '@aurodesignsystem/auro-flight/class';
|
|
147
|
+
|
|
148
|
+
// Register with a custom name if desired
|
|
149
|
+
AuroFlight.register('custom-flight');
|
|
167
150
|
```
|
|
168
151
|
|
|
169
|
-
|
|
170
|
-
|
|
152
|
+
This will create a new custom element `<custom-flight>` that behaves exactly like `<auro-flight>`, allowing both to coexist on the same page without interfering with each other.
|
|
171
153
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
154
|
+
<div class="exampleWrapper exampleWrapper--flex">
|
|
155
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./apiExamples/custom.html) -->
|
|
156
|
+
<!-- The below content is automatically added from ./apiExamples/custom.html -->
|
|
157
|
+
<custom-flight
|
|
158
|
+
flights='["AS 1436"]'
|
|
159
|
+
duration="161"
|
|
160
|
+
departureTime="2022-07-13T12:15:00-07:00"
|
|
161
|
+
departureStation="SEA"
|
|
162
|
+
arrivalTime="2022-07-13T14:56:00-07:00"
|
|
163
|
+
arrivalStation="LAX">
|
|
164
|
+
<auro-flightline></auro-flightline>
|
|
165
|
+
</custom-flight>
|
|
166
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
167
|
+
</div>
|
|
168
|
+
<auro-accordion alignRight>
|
|
169
|
+
<span slot="trigger">See code</span>
|
|
170
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./apiExamples/custom.html) -->
|
|
171
|
+
<!-- The below code snippet is automatically added from ./apiExamples/custom.html -->
|
|
172
172
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
173
|
+
```html
|
|
174
|
+
<custom-flight
|
|
175
|
+
flights='["AS 1436"]'
|
|
176
|
+
duration="161"
|
|
177
|
+
departureTime="2022-07-13T12:15:00-07:00"
|
|
178
|
+
departureStation="SEA"
|
|
179
|
+
arrivalTime="2022-07-13T14:56:00-07:00"
|
|
180
|
+
arrivalStation="LAX">
|
|
181
|
+
<auro-flightline></auro-flightline>
|
|
182
|
+
</custom-flight>
|
|
183
|
+
```
|
|
184
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
185
|
+
</auro-accordion>
|