@aurodesignsystem-dev/auro-flightline 0.0.0-pr101.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/CHANGELOG.md +359 -0
- package/LICENSE +201 -0
- package/NOTICE +2 -0
- package/README.md +137 -0
- package/demo/api.html +56 -0
- package/demo/api.js +1 -0
- package/demo/api.md +386 -0
- package/demo/api.min.js +4 -0
- package/demo/auro-flightline.min.js +432 -0
- package/demo/dotCompliance.md +194 -0
- package/demo/index.html +56 -0
- package/demo/index.js +7 -0
- package/demo/index.md +57 -0
- package/demo/index.min.js +7 -0
- package/dist/auro-flightline-Ua1BdkHT.js +27 -0
- package/dist/index.d.ts +33 -0
- package/dist/index.js +1 -0
- package/dist/registered.js +1 -0
- package/package.json +87 -0
|
@@ -0,0 +1,432 @@
|
|
|
1
|
+
// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
2
|
+
// See LICENSE in the project root for license information.
|
|
3
|
+
|
|
4
|
+
// ---------------------------------------------------------------------
|
|
5
|
+
|
|
6
|
+
/* eslint-disable line-comment-position, no-inline-comments, no-confusing-arrow, no-nested-ternary, implicit-arrow-linebreak */
|
|
7
|
+
|
|
8
|
+
class AuroLibraryRuntimeUtils {
|
|
9
|
+
|
|
10
|
+
/* eslint-disable jsdoc/require-param */
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* This will register a new custom element with the browser.
|
|
14
|
+
* @param {String} name - The name of the custom element.
|
|
15
|
+
* @param {Object} componentClass - The class to register as a custom element.
|
|
16
|
+
* @returns {void}
|
|
17
|
+
*/
|
|
18
|
+
registerComponent(name, componentClass) {
|
|
19
|
+
if (!customElements.get(name)) {
|
|
20
|
+
customElements.define(name, class extends componentClass {});
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Finds and returns the closest HTML Element based on a selector.
|
|
26
|
+
* @returns {void}
|
|
27
|
+
*/
|
|
28
|
+
closestElement(
|
|
29
|
+
selector, // selector like in .closest()
|
|
30
|
+
base = this, // extra functionality to skip a parent
|
|
31
|
+
__Closest = (el, found = el && el.closest(selector)) =>
|
|
32
|
+
!el || el === document || el === window
|
|
33
|
+
? null // standard .closest() returns null for non-found selectors also
|
|
34
|
+
: found
|
|
35
|
+
? found // found a selector INside this element
|
|
36
|
+
: __Closest(el.getRootNode().host) // recursion!! break out to parent DOM
|
|
37
|
+
) {
|
|
38
|
+
return __Closest(base);
|
|
39
|
+
}
|
|
40
|
+
/* eslint-enable jsdoc/require-param */
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* If the element passed is registered with a different tag name than what is passed in, the tag name is added as an attribute to the element.
|
|
44
|
+
* @param {Object} elem - The element to check.
|
|
45
|
+
* @param {String} tagName - The name of the Auro component to check for or add as an attribute.
|
|
46
|
+
* @returns {void}
|
|
47
|
+
*/
|
|
48
|
+
handleComponentTagRename(elem, tagName) {
|
|
49
|
+
const tag = tagName.toLowerCase();
|
|
50
|
+
const elemTag = elem.tagName.toLowerCase();
|
|
51
|
+
|
|
52
|
+
if (elemTag !== tag) {
|
|
53
|
+
elem.setAttribute(tag, true);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Validates if an element is a specific Auro component.
|
|
59
|
+
* @param {Object} elem - The element to validate.
|
|
60
|
+
* @param {String} tagName - The name of the Auro component to check against.
|
|
61
|
+
* @returns {Boolean} - Returns true if the element is the specified Auro component.
|
|
62
|
+
*/
|
|
63
|
+
elementMatch(elem, tagName) {
|
|
64
|
+
const tag = tagName.toLowerCase();
|
|
65
|
+
const elemTag = elem.tagName.toLowerCase();
|
|
66
|
+
|
|
67
|
+
return elemTag === tag || elem.hasAttribute(tag);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Gets the text content of a named slot.
|
|
72
|
+
* @returns {String}
|
|
73
|
+
* @private
|
|
74
|
+
*/
|
|
75
|
+
getSlotText(elem, name) {
|
|
76
|
+
const slot = elem.shadowRoot?.querySelector(`slot[name="${name}"]`);
|
|
77
|
+
const nodes = slot?.assignedNodes({ flatten: true }) || [];
|
|
78
|
+
const text = nodes.map(n => n.textContent?.trim()).join(' ').trim();
|
|
79
|
+
|
|
80
|
+
return text || null;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* @license
|
|
86
|
+
* Copyright 2019 Google LLC
|
|
87
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
88
|
+
*/
|
|
89
|
+
const t$2=globalThis,e$4=t$2.ShadowRoot&&(void 0===t$2.ShadyCSS||t$2.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,s$2=Symbol(),o$4=new WeakMap;let n$3 = class n{constructor(t,e,o){if(this._$cssResult$=true,o!==s$2)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e;}get styleSheet(){let t=this.o;const s=this.t;if(e$4&&void 0===t){const e=void 0!==s&&1===s.length;e&&(t=o$4.get(s)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&o$4.set(s,t));}return t}toString(){return this.cssText}};const r$2=t=>new n$3("string"==typeof t?t:t+"",void 0,s$2),i$4=(t,...e)=>{const o=1===t.length?t[0]:e.reduce(((e,s,o)=>e+(t=>{if(true===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+t[o+1]),t[0]);return new n$3(o,t,s$2)},S$1=(s,o)=>{if(e$4)s.adoptedStyleSheets=o.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const e of o){const o=document.createElement("style"),n=t$2.litNonce;void 0!==n&&o.setAttribute("nonce",n),o.textContent=e.cssText,s.appendChild(o);}},c$2=e$4?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return r$2(e)})(t):t;
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* @license
|
|
93
|
+
* Copyright 2017 Google LLC
|
|
94
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
95
|
+
*/const{is:i$3,defineProperty:e$3,getOwnPropertyDescriptor:h$1,getOwnPropertyNames:r$1,getOwnPropertySymbols:o$3,getPrototypeOf:n$2}=Object,a$2=globalThis,c$1=a$2.trustedTypes,l$2=c$1?c$1.emptyScript:"",p$1=a$2.reactiveElementPolyfillSupport,d$1=(t,s)=>t,u$2={toAttribute(t,s){switch(s){case Boolean:t=t?l$2:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t);}return t},fromAttribute(t,s){let i=t;switch(s){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t);}catch(t){i=null;}}return i}},f$1=(t,s)=>!i$3(t,s),b={attribute:true,type:String,converter:u$2,reflect:false,useDefault:false,hasChanged:f$1};Symbol.metadata??=Symbol("metadata"),a$2.litPropertyMetadata??=new WeakMap;let y$1 = class y extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t);}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,s=b){if(s.state&&(s.attribute=false),this._$Ei(),this.prototype.hasOwnProperty(t)&&((s=Object.create(s)).wrapped=true),this.elementProperties.set(t,s),!s.noAccessor){const i=Symbol(),h=this.getPropertyDescriptor(t,i,s);void 0!==h&&e$3(this.prototype,t,h);}}static getPropertyDescriptor(t,s,i){const{get:e,set:r}=h$1(this.prototype,t)??{get(){return this[s]},set(t){this[s]=t;}};return {get:e,set(s){const h=e?.call(this);r?.call(this,s),this.requestUpdate(t,h,i);},configurable:true,enumerable:true}}static getPropertyOptions(t){return this.elementProperties.get(t)??b}static _$Ei(){if(this.hasOwnProperty(d$1("elementProperties")))return;const t=n$2(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties);}static finalize(){if(this.hasOwnProperty(d$1("finalized")))return;if(this.finalized=true,this._$Ei(),this.hasOwnProperty(d$1("properties"))){const t=this.properties,s=[...r$1(t),...o$3(t)];for(const i of s)this.createProperty(i,t[i]);}const t=this[Symbol.metadata];if(null!==t){const s=litPropertyMetadata.get(t);if(void 0!==s)for(const[t,i]of s)this.elementProperties.set(t,i);}this._$Eh=new Map;for(const[t,s]of this.elementProperties){const i=this._$Eu(t,s);void 0!==i&&this._$Eh.set(i,t);}this.elementStyles=this.finalizeStyles(this.styles);}static finalizeStyles(s){const i=[];if(Array.isArray(s)){const e=new Set(s.flat(1/0).reverse());for(const s of e)i.unshift(c$2(s));}else void 0!==s&&i.push(c$2(s));return i}static _$Eu(t,s){const i=s.attribute;return false===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=false,this.hasUpdated=false,this._$Em=null,this._$Ev();}_$Ev(){this._$ES=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)));}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.();}removeController(t){this._$EO?.delete(t);}_$E_(){const t=new Map,s=this.constructor.elementProperties;for(const i of s.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t);}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return S$1(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(true),this._$EO?.forEach((t=>t.hostConnected?.()));}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach((t=>t.hostDisconnected?.()));}attributeChangedCallback(t,s,i){this._$AK(t,i);}_$ET(t,s){const i=this.constructor.elementProperties.get(t),e=this.constructor._$Eu(t,i);if(void 0!==e&&true===i.reflect){const h=(void 0!==i.converter?.toAttribute?i.converter:u$2).toAttribute(s,i.type);this._$Em=t,null==h?this.removeAttribute(e):this.setAttribute(e,h),this._$Em=null;}}_$AK(t,s){const i=this.constructor,e=i._$Eh.get(t);if(void 0!==e&&this._$Em!==e){const t=i.getPropertyOptions(e),h="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:u$2;this._$Em=e,this[e]=h.fromAttribute(s,t.type)??this._$Ej?.get(e)??null,this._$Em=null;}}requestUpdate(t,s,i){if(void 0!==t){const e=this.constructor,h=this[t];if(i??=e.getPropertyOptions(t),!((i.hasChanged??f$1)(h,s)||i.useDefault&&i.reflect&&h===this._$Ej?.get(t)&&!this.hasAttribute(e._$Eu(t,i))))return;this.C(t,s,i);} false===this.isUpdatePending&&(this._$ES=this._$EP());}C(t,s,{useDefault:i,reflect:e,wrapped:h},r){i&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,r??s??this[t]),true!==h||void 0!==r)||(this._$AL.has(t)||(this.hasUpdated||i||(s=void 0),this._$AL.set(t,s)),true===e&&this._$Em!==t&&(this._$Eq??=new Set).add(t));}async _$EP(){this.isUpdatePending=true;try{await this._$ES;}catch(t){Promise.reject(t);}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,s]of this._$Ep)this[t]=s;this._$Ep=void 0;}const t=this.constructor.elementProperties;if(t.size>0)for(const[s,i]of t){const{wrapped:t}=i,e=this[s];true!==t||this._$AL.has(s)||void 0===e||this.C(s,void 0,i,e);}}let t=false;const s=this._$AL;try{t=this.shouldUpdate(s),t?(this.willUpdate(s),this._$EO?.forEach((t=>t.hostUpdate?.())),this.update(s)):this._$EM();}catch(s){throw t=false,this._$EM(),s}t&&this._$AE(s);}willUpdate(t){}_$AE(t){this._$EO?.forEach((t=>t.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=true,this.firstUpdated(t)),this.updated(t);}_$EM(){this._$AL=new Map,this.isUpdatePending=false;}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return true}update(t){this._$Eq&&=this._$Eq.forEach((t=>this._$ET(t,this[t]))),this._$EM();}updated(t){}firstUpdated(t){}};y$1.elementStyles=[],y$1.shadowRootOptions={mode:"open"},y$1[d$1("elementProperties")]=new Map,y$1[d$1("finalized")]=new Map,p$1?.({ReactiveElement:y$1}),(a$2.reactiveElementVersions??=[]).push("2.1.0");
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* @license
|
|
99
|
+
* Copyright 2017 Google LLC
|
|
100
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
101
|
+
*/
|
|
102
|
+
const t$1=globalThis,i$2=t$1.trustedTypes,s$1=i$2?i$2.createPolicy("lit-html",{createHTML:t=>t}):void 0,e$2="$lit$",h=`lit$${Math.random().toFixed(9).slice(2)}$`,o$2="?"+h,n$1=`<${o$2}>`,r=document,l$1=()=>r.createComment(""),c=t=>null===t||"object"!=typeof t&&"function"!=typeof t,a$1=Array.isArray,u$1=t=>a$1(t)||"function"==typeof t?.[Symbol.iterator],d="[ \t\n\f\r]",f=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,v=/-->/g,_=/>/g,m=RegExp(`>|${d}(?:([^\\s"'>=/]+)(${d}*=${d}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),p=/'/g,g=/"/g,$=/^(?:script|style|textarea|title)$/i,y=t=>(i,...s)=>({_$litType$:t,strings:i,values:s}),x=y(1),T=Symbol.for("lit-noChange"),E=Symbol.for("lit-nothing"),A=new WeakMap,C=r.createTreeWalker(r,129);function P(t,i){if(!a$1(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==s$1?s$1.createHTML(i):i}const V=(t,i)=>{const s=t.length-1,o=[];let r,l=2===i?"<svg>":3===i?"<math>":"",c=f;for(let i=0;i<s;i++){const s=t[i];let a,u,d=-1,y=0;for(;y<s.length&&(c.lastIndex=y,u=c.exec(s),null!==u);)y=c.lastIndex,c===f?"!--"===u[1]?c=v:void 0!==u[1]?c=_:void 0!==u[2]?($.test(u[2])&&(r=RegExp("</"+u[2],"g")),c=m):void 0!==u[3]&&(c=m):c===m?">"===u[0]?(c=r??f,d=-1):void 0===u[1]?d=-2:(d=c.lastIndex-u[2].length,a=u[1],c=void 0===u[3]?m:'"'===u[3]?g:p):c===g||c===p?c=m:c===v||c===_?c=f:(c=m,r=void 0);const x=c===m&&t[i+1].startsWith("/>")?" ":"";l+=c===f?s+n$1:d>=0?(o.push(a),s.slice(0,d)+e$2+s.slice(d)+h+x):s+h+(-2===d?i:x);}return [P(t,l+(t[s]||"<?>")+(2===i?"</svg>":3===i?"</math>":"")),o]};class N{constructor({strings:t,_$litType$:s},n){let r;this.parts=[];let c=0,a=0;const u=t.length-1,d=this.parts,[f,v]=V(t,s);if(this.el=N.createElement(f,n),C.currentNode=this.el.content,2===s||3===s){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes);}for(;null!==(r=C.nextNode())&&d.length<u;){if(1===r.nodeType){if(r.hasAttributes())for(const t of r.getAttributeNames())if(t.endsWith(e$2)){const i=v[a++],s=r.getAttribute(t).split(h),e=/([.?@])?(.*)/.exec(i);d.push({type:1,index:c,name:e[2],strings:s,ctor:"."===e[1]?H:"?"===e[1]?I:"@"===e[1]?L:k}),r.removeAttribute(t);}else t.startsWith(h)&&(d.push({type:6,index:c}),r.removeAttribute(t));if($.test(r.tagName)){const t=r.textContent.split(h),s=t.length-1;if(s>0){r.textContent=i$2?i$2.emptyScript:"";for(let i=0;i<s;i++)r.append(t[i],l$1()),C.nextNode(),d.push({type:2,index:++c});r.append(t[s],l$1());}}}else if(8===r.nodeType)if(r.data===o$2)d.push({type:2,index:c});else {let t=-1;for(;-1!==(t=r.data.indexOf(h,t+1));)d.push({type:7,index:c}),t+=h.length-1;}c++;}}static createElement(t,i){const s=r.createElement("template");return s.innerHTML=t,s}}function S(t,i,s=t,e){if(i===T)return i;let h=void 0!==e?s._$Co?.[e]:s._$Cl;const o=c(i)?void 0:i._$litDirective$;return h?.constructor!==o&&(h?._$AO?.(false),void 0===o?h=void 0:(h=new o(t),h._$AT(t,s,e)),void 0!==e?(s._$Co??=[])[e]=h:s._$Cl=h),void 0!==h&&(i=S(t,h._$AS(t,i.values),h,e)),i}class M{constructor(t,i){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=i;}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:i},parts:s}=this._$AD,e=(t?.creationScope??r).importNode(i,true);C.currentNode=e;let h=C.nextNode(),o=0,n=0,l=s[0];for(;void 0!==l;){if(o===l.index){let i;2===l.type?i=new R(h,h.nextSibling,this,t):1===l.type?i=new l.ctor(h,l.name,l.strings,this,t):6===l.type&&(i=new z(h,this,t)),this._$AV.push(i),l=s[++n];}o!==l?.index&&(h=C.nextNode(),o++);}return C.currentNode=r,e}p(t){let i=0;for(const s of this._$AV) void 0!==s&&(void 0!==s.strings?(s._$AI(t,s,i),i+=s.strings.length-2):s._$AI(t[i])),i++;}}class R{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,i,s,e){this.type=2,this._$AH=E,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=s,this.options=e,this._$Cv=e?.isConnected??true;}get parentNode(){let t=this._$AA.parentNode;const i=this._$AM;return void 0!==i&&11===t?.nodeType&&(t=i.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){t=S(this,t,i),c(t)?t===E||null==t||""===t?(this._$AH!==E&&this._$AR(),this._$AH=E):t!==this._$AH&&t!==T&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):u$1(t)?this.k(t):this._(t);}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t));}_(t){this._$AH!==E&&c(this._$AH)?this._$AA.nextSibling.data=t:this.T(r.createTextNode(t)),this._$AH=t;}$(t){const{values:i,_$litType$:s}=t,e="number"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=N.createElement(P(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===e)this._$AH.p(i);else {const t=new M(e,this),s=t.u(this.options);t.p(i),this.T(s),this._$AH=t;}}_$AC(t){let i=A.get(t.strings);return void 0===i&&A.set(t.strings,i=new N(t)),i}k(t){a$1(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let s,e=0;for(const h of t)e===i.length?i.push(s=new R(this.O(l$1()),this.O(l$1()),this,this.options)):s=i[e],s._$AI(h),e++;e<i.length&&(this._$AR(s&&s._$AB.nextSibling,e),i.length=e);}_$AR(t=this._$AA.nextSibling,i){for(this._$AP?.(false,true,i);t&&t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i;}}setConnected(t){ void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t));}}class k{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,i,s,e,h){this.type=1,this._$AH=E,this._$AN=void 0,this.element=t,this.name=i,this._$AM=e,this.options=h,s.length>2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=E;}_$AI(t,i=this,s,e){const h=this.strings;let o=false;if(void 0===h)t=S(this,t,i,0),o=!c(t)||t!==this._$AH&&t!==T,o&&(this._$AH=t);else {const e=t;let n,r;for(t=h[0],n=0;n<h.length-1;n++)r=S(this,e[s+n],i,n),r===T&&(r=this._$AH[n]),o||=!c(r)||r!==this._$AH[n],r===E?t=E:t!==E&&(t+=(r??"")+h[n+1]),this._$AH[n]=r;}o&&!e&&this.j(t);}j(t){t===E?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"");}}class H extends k{constructor(){super(...arguments),this.type=3;}j(t){this.element[this.name]=t===E?void 0:t;}}class I extends k{constructor(){super(...arguments),this.type=4;}j(t){this.element.toggleAttribute(this.name,!!t&&t!==E);}}class L extends k{constructor(t,i,s,e,h){super(t,i,s,e,h),this.type=5;}_$AI(t,i=this){if((t=S(this,t,i,0)??E)===T)return;const s=this._$AH,e=t===E&&s!==E||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,h=t!==E&&(s===E||e);e&&this.element.removeEventListener(this.name,this,s),h&&this.element.addEventListener(this.name,this,t),this._$AH=t;}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t);}}class z{constructor(t,i,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=s;}get _$AU(){return this._$AM._$AU}_$AI(t){S(this,t);}}const j=t$1.litHtmlPolyfillSupport;j?.(N,R),(t$1.litHtmlVersions??=[]).push("3.3.0");const B=(t,i,s)=>{const e=s?.renderBefore??i;let h=e._$litPart$;if(void 0===h){const t=s?.renderBefore??null;e._$litPart$=h=new R(i.insertBefore(l$1(),t),t,void 0,s??{});}return h._$AI(t),h};
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* @license
|
|
106
|
+
* Copyright 2017 Google LLC
|
|
107
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
108
|
+
*/const s=globalThis;let i$1 = class i extends y$1{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0;}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=B(r,this.renderRoot,this.renderOptions);}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(true);}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(false);}render(){return T}};i$1._$litElement$=true,i$1["finalized"]=true,s.litElementHydrateSupport?.({LitElement:i$1});const o$1=s.litElementPolyfillSupport;o$1?.({LitElement:i$1});(s.litElementVersions??=[]).push("4.2.0");
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* @license
|
|
112
|
+
* Copyright 2017 Google LLC
|
|
113
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
114
|
+
*/
|
|
115
|
+
const t={ATTRIBUTE:1},e$1=t=>(...e)=>({_$litDirective$:t,values:e});class i{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i;}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* @license
|
|
119
|
+
* Copyright 2018 Google LLC
|
|
120
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
121
|
+
*/const e=e$1(class extends i{constructor(t$1){if(super(t$1),t$1.type!==t.ATTRIBUTE||"class"!==t$1.name||t$1.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return " "+Object.keys(t).filter((s=>t[s])).join(" ")+" "}update(s,[i]){if(void 0===this.st){this.st=new Set,void 0!==s.strings&&(this.nt=new Set(s.strings.join(" ").split(/\s/).filter((t=>""!==t))));for(const t in i)i[t]&&!this.nt?.has(t)&&this.st.add(t);return this.render(i)}const r=s.element.classList;for(const t of this.st)t in i||(r.remove(t),this.st.delete(t));for(const t in i){const s=!!i[t];s===this.st.has(t)||this.nt?.has(t)||(s?(r.add(t),this.st.add(t)):(r.remove(t),this.st.delete(t)));}return T}});
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* @license
|
|
125
|
+
* Copyright 2020 Google LLC
|
|
126
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
127
|
+
*/
|
|
128
|
+
const a=Symbol.for(""),o=t=>{if(t?.r===a)return t?._$litStatic$},l=new Map,n=t=>(r,...e)=>{const a=e.length;let s,i;const n=[],u=[];let c,$=0,f=false;for(;$<a;){for(c=r[$];$<a&&void 0!==(i=e[$],s=o(i));)c+=s+r[++$],f=true;$!==a&&u.push(i),n.push(c),$++;}if($===a&&n.push(r[a]),f){const t=n.join("$$lit$$");void 0===(r=l.get(t))&&(n.raw=n,l.set(t,r=n)),e=u;}return t(r,...e)},u=n(x);
|
|
129
|
+
|
|
130
|
+
var colorCss$1 = i$4`.wrapper:before{border-top-color:var(--ds-auro-flightline-segment-line-color)}.wrapper:after{border-top-color:var(--ds-auro-flightline-destination-line-color)}.iata{color:var(--ds-auro-flightline-segment-iata-text-color)}.duration{color:var(--ds-auro-flightline-layover-duration-color)}.leg{border-color:var(--ds-auro-flightline-layover-marker-border-color);background-color:var(--ds-auro-flightline-layover-marker-container-color)}.leg--stopover{--ds-auro-flightline-layover-marker-container-color: var(--ds-basic-color-surface-default, #ffffff)}.leg--canceled{--ds-auro-flightline-layover-marker-border-color: var(--ds-basic-color-status-error, #e31f26);--ds-auro-flightline-layover-marker-container-color: var(--ds-basic-color-status-error, #e31f26)}:host([nextday]){--ds-auro-flightline-layover-duration-color: var(--ds-basic-color-status-error, #e31f26)}:host([canceled]){--ds-auro-flightline-segment-line-color: var(--ds-basic-color-status-error, #e31f26)}:host([destinationCanceled]){--ds-auro-flightline-layover-duration-color: var(--ds-basic-color-status-error, #e31f26);--ds-auro-flightline-destination-line-color: var(--ds-basic-color-status-error, #e31f26)}
|
|
131
|
+
`;
|
|
132
|
+
|
|
133
|
+
var styleCss$1 = i$4`.util_displayInline{display:inline}.util_displayInlineBlock{display:inline-block}.util_displayBlock{display:block}.util_displayFlex{display:flex}.util_displayHidden{display:none}.util_displayHiddenVisually{position:absolute;overflow:hidden;clip:rect(1px,1px,1px,1px);width:1px;height:1px;padding:0;border:0}.body-default{font-size:var(--wcss-body-default-font-size, 1rem);line-height:var(--wcss-body-default-line-height, 1.5rem)}.body-default,.body-lg{font-family:var(--wcss-body-family, "AS Circular"),system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;font-weight:var(--wcss-body-weight, 450);letter-spacing:var(--wcss-body-letter-spacing, 0)}.body-lg{font-size:var(--wcss-body-lg-font-size, 1.125rem);line-height:var(--wcss-body-lg-line-height, 1.625rem)}.body-sm{font-size:var(--wcss-body-sm-font-size, .875rem);line-height:var(--wcss-body-sm-line-height, 1.25rem)}.body-sm,.body-xs{font-family:var(--wcss-body-family, "AS Circular"),system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;font-weight:var(--wcss-body-weight, 450);letter-spacing:var(--wcss-body-letter-spacing, 0)}.body-xs{font-size:var(--wcss-body-xs-font-size, .75rem);line-height:var(--wcss-body-xs-line-height, 1rem)}.body-2xs{font-family:var(--wcss-body-family, "AS Circular"),system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;font-size:var(--wcss-body-2xs-font-size, .625rem);font-weight:var(--wcss-body-weight, 450);letter-spacing:var(--wcss-body-letter-spacing, 0);line-height:var(--wcss-body-2xs-line-height, .875rem)}.display-2xl{font-family:var(--wcss-display-2xl-family, "AS Circular"),var(--wcss-display-2xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-2xl-font-size, clamp(3.5rem, 6vw, 5.375rem));font-weight:var(--wcss-display-2xl-weight, 300);letter-spacing:var(--wcss-display-2xl-letter-spacing, 0);line-height:var(--wcss-display-2xl-line-height, 1.3)}.display-xl{font-family:var(--wcss-display-xl-family, "AS Circular"),var(--wcss-display-xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-xl-font-size, clamp(3rem, 5.3333333333vw, 4.5rem));font-weight:var(--wcss-display-xl-weight, 300);letter-spacing:var(--wcss-display-xl-letter-spacing, 0);line-height:var(--wcss-display-xl-line-height, 1.3)}.display-lg{font-family:var(--wcss-display-lg-family, "AS Circular"),var(--wcss-display-lg-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-lg-font-size, clamp(2.75rem, 4.6666666667vw, 4rem));font-weight:var(--wcss-display-lg-weight, 300);letter-spacing:var(--wcss-display-lg-letter-spacing, 0);line-height:var(--wcss-display-lg-line-height, 1.3)}.display-md{font-family:var(--wcss-display-md-family, "AS Circular"),var(--wcss-display-md-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-md-font-size, clamp(2.5rem, 4vw, 3.5rem));font-weight:var(--wcss-display-md-weight, 300);letter-spacing:var(--wcss-display-md-letter-spacing, 0);line-height:var(--wcss-display-md-line-height, 1.3)}.display-sm{font-family:var(--wcss-display-sm-family, "AS Circular"),var(--wcss-display-sm-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-sm-font-size, clamp(2rem, 3.6666666667vw, 3rem));font-weight:var(--wcss-display-sm-weight, 300);letter-spacing:var(--wcss-display-sm-letter-spacing, 0);line-height:var(--wcss-display-sm-line-height, 1.3)}.display-xs{font-family:var(--wcss-display-xs-family, "AS Circular"),var(--wcss-display-xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-xs-font-size, clamp(1.75rem, 3vw, 2.375rem));font-weight:var(--wcss-display-xs-weight, 300);letter-spacing:var(--wcss-display-xs-letter-spacing, 0);line-height:var(--wcss-display-xs-line-height, 1.3)}.heading-xl{font-family:var(--wcss-heading-xl-family, "AS Circular"),var(--wcss-heading-xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-xl-font-size, clamp(2rem, 3vw, 2.5rem));font-weight:var(--wcss-heading-xl-weight, 300);letter-spacing:var(--wcss-heading-xl-letter-spacing, 0);line-height:var(--wcss-heading-xl-line-height, 1.3)}.heading-lg{font-family:var(--wcss-heading-lg-family, "AS Circular"),var(--wcss-heading-lg-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-lg-font-size, clamp(1.75rem, 2.6666666667vw, 2.25rem));font-weight:var(--wcss-heading-lg-weight, 300);letter-spacing:var(--wcss-heading-lg-letter-spacing, 0);line-height:var(--wcss-heading-lg-line-height, 1.3)}.heading-md{font-family:var(--wcss-heading-md-family, "AS Circular"),var(--wcss-heading-md-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-md-font-size, clamp(1.625rem, 2.3333333333vw, 1.75rem));font-weight:var(--wcss-heading-md-weight, 300);letter-spacing:var(--wcss-heading-md-letter-spacing, 0);line-height:var(--wcss-heading-md-line-height, 1.3)}.heading-sm{font-family:var(--wcss-heading-sm-family, "AS Circular"),var(--wcss-heading-sm-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-sm-font-size, clamp(1.375rem, 2vw, 1.5rem));font-weight:var(--wcss-heading-sm-weight, 300);letter-spacing:var(--wcss-heading-sm-letter-spacing, 0);line-height:var(--wcss-heading-sm-line-height, 1.3)}.heading-xs{font-family:var(--wcss-heading-xs-family, "AS Circular"),var(--wcss-heading-xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-xs-font-size, clamp(1.25rem, 1.6666666667vw, 1.25rem));font-weight:var(--wcss-heading-xs-weight, 450);letter-spacing:var(--wcss-heading-xs-letter-spacing, 0);line-height:var(--wcss-heading-xs-line-height, 1.3)}.heading-2xs{font-family:var(--wcss-heading-2xs-family, "AS Circular"),var(--wcss-heading-2xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-2xs-font-size, clamp(1.125rem, 1.5vw, 1.125rem));font-weight:var(--wcss-heading-2xs-weight, 450);letter-spacing:var(--wcss-heading-2xs-letter-spacing, 0);line-height:var(--wcss-heading-2xs-line-height, 1.3)}.accent-2xl{font-family:var(--wcss-accent-2xl-family, "Good OT"),var(--wcss-accent-2xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-2xl-font-size, clamp(2rem, 3.1666666667vw, 2.375rem));font-weight:var(--wcss-accent-2xl-weight, 450);letter-spacing:var(--wcss-accent-2xl-letter-spacing, .05em);line-height:var(--wcss-accent-2xl-line-height, 1)}.accent-2xl,.accent-xl{text-transform:uppercase}.accent-xl{font-family:var(--wcss-accent-xl-family, "Good OT"),var(--wcss-accent-xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-xl-font-size, clamp(1.625rem, 2.3333333333vw, 2rem));font-weight:var(--wcss-accent-xl-weight, 450);letter-spacing:var(--wcss-accent-xl-letter-spacing, .05em);line-height:var(--wcss-accent-xl-line-height, 1.3)}.accent-lg{font-family:var(--wcss-accent-lg-family, "Good OT"),var(--wcss-accent-lg-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-lg-font-size, clamp(1.5rem, 2.1666666667vw, 1.75rem));font-weight:var(--wcss-accent-lg-weight, 450);letter-spacing:var(--wcss-accent-lg-letter-spacing, .05em);line-height:var(--wcss-accent-lg-line-height, 1.3)}.accent-lg,.accent-md{text-transform:uppercase}.accent-md{font-family:var(--wcss-accent-md-family, "Good OT"),var(--wcss-accent-md-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-md-font-size, clamp(1.375rem, 1.8333333333vw, 1.5rem));font-weight:var(--wcss-accent-md-weight, 500);letter-spacing:var(--wcss-accent-md-letter-spacing, .05em);line-height:var(--wcss-accent-md-line-height, 1.3)}.accent-sm{font-family:var(--wcss-accent-sm-family, "Good OT"),var(--wcss-accent-sm-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-sm-font-size, clamp(1.125rem, 1.5vw, 1.25rem));font-weight:var(--wcss-accent-sm-weight, 500);letter-spacing:var(--wcss-accent-sm-letter-spacing, .05em);line-height:var(--wcss-accent-sm-line-height, 1.3)}.accent-sm,.accent-xs{text-transform:uppercase}.accent-xs{font-family:var(--wcss-accent-xs-family, "Good OT"),var(--wcss-accent-xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-xs-font-size, clamp(1rem, 1.3333333333vw, 1rem));font-weight:var(--wcss-accent-xs-weight, 500);letter-spacing:var(--wcss-accent-xs-letter-spacing, .1em);line-height:var(--wcss-accent-xs-line-height, 1.3)}.accent-2xs{font-family:var(--wcss-accent-2xs-family, "Good OT"),var(--wcss-accent-2xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-2xs-font-size, clamp(.875rem, 1.1666666667vw, .875rem));font-weight:var(--wcss-accent-2xs-weight, 450);letter-spacing:var(--wcss-accent-2xs-letter-spacing, .1em);line-height:var(--wcss-accent-2xs-line-height, 1.3);text-transform:uppercase}:host{flex-grow:1;flex-basis:0}.wrapper{position:relative}.wrapper:before,.wrapper:after{border-top-width:var(--ds-size-25, .125rem);border-top-style:solid;position:absolute;top:.5rem;z-index:1}.wrapper:before{content:"";right:50%;width:100%}.wrapper:after{left:50%;width:50%}:host(:first-child) .wrapper:before,:host(:only-of-type) .wrapper:before{width:50%}:host(:last-child) .wrapper:after,:host(:only-of-type) .wrapper:after{content:""}:host([canceled]) .wrapper:before{border-top-width:var(--ds-size-25, .125rem);border-top-style:dashed}:host([destinationCanceled]) .wrapper:after{border-top-width:var(--ds-size-25, .125rem);border-top-style:dashed}.layout{display:inline-flex;align-items:center;justify-content:center;flex-direction:column;z-index:2;width:100%}.leg{border-style:solid;border-width:var(--ds-size-25, .125rem);border-radius:50%;width:var(--ds-size-150, .75rem);height:var(--ds-size-150, .75rem)}@media screen and (min-width: 576px){.leg{width:var(--ds-size-200, 1rem);height:var(--ds-size-200, 1rem)}}.iata{margin-top:var(--ds-size-150, .75rem)}
|
|
134
|
+
`;
|
|
135
|
+
|
|
136
|
+
var tokensCss = i$4`:host{--ds-auro-flightline-destination-line-color: var(--ds-advanced-color-flightline-line, #00274a);--ds-auro-flightline-segment-iata-text-color: var(--ds-basic-color-texticon-muted, #676767);--ds-auro-flightline-segment-line-color: var(--ds-advanced-color-flightline-line, #00274a);--ds-auro-flightline-layover-duration-color: var(--ds-basic-color-texticon-muted, #676767);--ds-auro-flightline-layover-marker-border-color: var(--ds-advanced-color-flightline-indicator, #00274a);--ds-auro-flightline-layover-marker-container-color: var(--ds-advanced-color-flightline-indicator, #00274a)}
|
|
137
|
+
`;
|
|
138
|
+
|
|
139
|
+
// Copyright (c) 2021 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
140
|
+
// See LICENSE in the project root for license information.
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
// See https://git.io/JJ6SJ for "How to document your components using JSDoc"
|
|
144
|
+
/**
|
|
145
|
+
* The auro-flight-segment component is a standard for indicating stopovers and layovers.
|
|
146
|
+
* @customElement auro-flight-segment
|
|
147
|
+
*
|
|
148
|
+
* Stopovers do not have duration information and are indicated differently.
|
|
149
|
+
* Layovers contain duration information and are indicated with a solid fill.
|
|
150
|
+
* For more information about the difference between a layover and a stopover,
|
|
151
|
+
* [please see this article](https://www.turkishairlines.com/en-int/any-questions/what-is-the-difference-between-a-layover-and-a-stopover/).
|
|
152
|
+
*/
|
|
153
|
+
|
|
154
|
+
class AuroFlightSegment extends i$1 {
|
|
155
|
+
constructor() {
|
|
156
|
+
super();
|
|
157
|
+
|
|
158
|
+
this._initializeDefaults();
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
_initializeDefaults() {
|
|
162
|
+
this.stopover = false;
|
|
163
|
+
this.canceled = false;
|
|
164
|
+
this.destinationCanceled = false;
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* @private
|
|
168
|
+
*/
|
|
169
|
+
this.partialCancel = false;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
// function to define props used within the scope of this component
|
|
173
|
+
static get properties() {
|
|
174
|
+
return {
|
|
175
|
+
/**
|
|
176
|
+
* Whether the segment is canceled. The line leading to the segment will be red.
|
|
177
|
+
*/
|
|
178
|
+
canceled: {
|
|
179
|
+
type: Boolean,
|
|
180
|
+
reflect: true
|
|
181
|
+
},
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Whether the following segment is canceled, will only affect the last segment in a flightline. The line after the segment will be red.
|
|
185
|
+
*/
|
|
186
|
+
destinationCanceled: {
|
|
187
|
+
type: Boolean,
|
|
188
|
+
reflect: true
|
|
189
|
+
},
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* Indicates time duration of a stop.
|
|
193
|
+
*/
|
|
194
|
+
duration: { type: String },
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* Text to display, typically a station code (SEA, PVD, AVP).
|
|
198
|
+
*/
|
|
199
|
+
iata: { type: String },
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* Indicates time is on the following calendar day.
|
|
203
|
+
*/
|
|
204
|
+
nextDay: {
|
|
205
|
+
type: Boolean,
|
|
206
|
+
reflect: true
|
|
207
|
+
},
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* @private
|
|
211
|
+
*/
|
|
212
|
+
partialCancel: {
|
|
213
|
+
type: Boolean,
|
|
214
|
+
reflect: true,
|
|
215
|
+
},
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* Indicates a stopover. Do not provide duration.
|
|
219
|
+
*/
|
|
220
|
+
stopover: {
|
|
221
|
+
type: Boolean,
|
|
222
|
+
reflect: true
|
|
223
|
+
}
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
static get styles() {
|
|
228
|
+
return [i$4`${styleCss$1}`, i$4`${colorCss$1}`, i$4`${tokensCss}`];
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* This will register this element with the browser.
|
|
233
|
+
* @param {string} [name="auro-flightline"] - The name of the element that you want to register.
|
|
234
|
+
*
|
|
235
|
+
* @example
|
|
236
|
+
* AuroFlightSegment.register("auro-flight-segment") // this will register this element to <auro-flight-segment/>
|
|
237
|
+
*
|
|
238
|
+
*/
|
|
239
|
+
static register(name = "auro-flight-segment") {
|
|
240
|
+
AuroLibraryRuntimeUtils.prototype.registerComponent(
|
|
241
|
+
name,
|
|
242
|
+
AuroFlightSegment,
|
|
243
|
+
);
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
firstUpdated() {
|
|
247
|
+
// Add the tag name as an attribute if it is different than the component name
|
|
248
|
+
AuroLibraryRuntimeUtils.prototype.handleComponentTagRename(
|
|
249
|
+
this,
|
|
250
|
+
"auro-flight-segment",
|
|
251
|
+
);
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
// function that renders the HTML and CSS into the scope of the component
|
|
255
|
+
render() {
|
|
256
|
+
const legClasses = {
|
|
257
|
+
leg: true,
|
|
258
|
+
layout: true,
|
|
259
|
+
"leg--stopover": this.stopover,
|
|
260
|
+
"leg--canceled": this.canceled || this.partialCancel,
|
|
261
|
+
};
|
|
262
|
+
|
|
263
|
+
return u`
|
|
264
|
+
<div class="wrapper">
|
|
265
|
+
<div class="layout">
|
|
266
|
+
<slot></slot>
|
|
267
|
+
<div class="${e(legClasses)}"></div>
|
|
268
|
+
<span class="iata body-default">${this.iata}</span>
|
|
269
|
+
${this.duration ? u`<span class="duration body-xs">${this.duration}</span>` : undefined}
|
|
270
|
+
</div>
|
|
271
|
+
</div>
|
|
272
|
+
`;
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
var colorCss = i$4`.nonstop:before,.canceled:before{border-top-color:var(--ds-auro-flightline-segment-line-color)}:host([canceled]){--ds-auro-flightline-segment-line-color: var(--ds-basic-color-status-error, #e31f26)}
|
|
277
|
+
`;
|
|
278
|
+
|
|
279
|
+
var styleCss = i$4`:focus:not(:focus-visible){outline:3px solid transparent}:host{display:block;isolation:isolate}.nonstop:before{content:"";height:var(--ds-size-25, .125rem);width:100%;position:relative;top:10px;border-width:var(--ds-size-25, .125rem) 0 0 0;border-style:solid}.canceled:before{border-style:dashed}.multiple ::slotted(*){display:block}@container (max-width: 320px){.multiple ::slotted(*){display:none}}.showNoStops{display:none}@container (max-width: 320px){.showNoStops{display:block}}.slotContainer{display:flex;justify-content:space-around;min-height:var(--ds-size-300, 1.5rem);container-type:inline-size}
|
|
280
|
+
`;
|
|
281
|
+
|
|
282
|
+
/* eslint-disable object-property-newline */
|
|
283
|
+
// Copyright (c) 2021 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
284
|
+
// See LICENSE in the project root for license information.
|
|
285
|
+
|
|
286
|
+
|
|
287
|
+
// See https://git.io/JJ6SJ for "How to document your components using JSDoc"
|
|
288
|
+
/**
|
|
289
|
+
* The auro-flightline component provides a responsive flight timeline experience by placing dots indicating stopovers and layovers on a timeline.
|
|
290
|
+
* @customElement auro-flightline
|
|
291
|
+
*
|
|
292
|
+
* @slot - fill in with `<auro-flight-segment>` components of a given leg.
|
|
293
|
+
*/
|
|
294
|
+
|
|
295
|
+
class AuroFlightline extends i$1 {
|
|
296
|
+
constructor() {
|
|
297
|
+
super();
|
|
298
|
+
|
|
299
|
+
this._initializeDefaults();
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
_initializeDefaults() {
|
|
303
|
+
this.canceled = false;
|
|
304
|
+
|
|
305
|
+
/**
|
|
306
|
+
* @private
|
|
307
|
+
*/
|
|
308
|
+
this.hasCanceledSegment = false;
|
|
309
|
+
|
|
310
|
+
/**
|
|
311
|
+
* @private
|
|
312
|
+
*/
|
|
313
|
+
this.firstSegmentCanceled = false;
|
|
314
|
+
|
|
315
|
+
/**
|
|
316
|
+
* @private
|
|
317
|
+
*/
|
|
318
|
+
this.lastSegmentCanceled = false;
|
|
319
|
+
|
|
320
|
+
/**
|
|
321
|
+
* @private
|
|
322
|
+
*/
|
|
323
|
+
this.runtimeUtils = new AuroLibraryRuntimeUtils();
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
static get properties() {
|
|
327
|
+
return {
|
|
328
|
+
/**
|
|
329
|
+
* If true, demonstrates a canceled flightline UI.
|
|
330
|
+
*/
|
|
331
|
+
canceled: {
|
|
332
|
+
type: Boolean,
|
|
333
|
+
reflect: true
|
|
334
|
+
},
|
|
335
|
+
|
|
336
|
+
/**
|
|
337
|
+
* @private
|
|
338
|
+
*/
|
|
339
|
+
firstSegmentCanceled: { type: Boolean, reflect: true },
|
|
340
|
+
|
|
341
|
+
/**
|
|
342
|
+
* @private
|
|
343
|
+
*/
|
|
344
|
+
hasCanceledSegment: { type: Boolean, reflect: true },
|
|
345
|
+
|
|
346
|
+
/**
|
|
347
|
+
* @private
|
|
348
|
+
*/
|
|
349
|
+
lastSegmentCanceled: { type: Boolean, reflect: true },
|
|
350
|
+
};
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
static get styles() {
|
|
354
|
+
return [styleCss, colorCss, tokensCss];
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
/**
|
|
358
|
+
* This will register this element with the browser.
|
|
359
|
+
* @param {string} [name="auro-flightline"] - The name of the element that you want to register.
|
|
360
|
+
*
|
|
361
|
+
* @example
|
|
362
|
+
* AuroFlightLine.register("custom-flightline") // this will register this element to <custom-flightline/>
|
|
363
|
+
*
|
|
364
|
+
*/
|
|
365
|
+
static register(name = "auro-flightline") {
|
|
366
|
+
AuroLibraryRuntimeUtils.prototype.registerComponent(name, AuroFlightline);
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
firstUpdated() {
|
|
370
|
+
// Add the tag name as an attribute if it is different than the component name
|
|
371
|
+
this.runtimeUtils.handleComponentTagRename(this, "auro-flightline");
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
/** @private */
|
|
375
|
+
containsCanceledSegment() {
|
|
376
|
+
const segments = this.querySelectorAll(
|
|
377
|
+
"auro-flight-segment, [auro-flight-segment]",
|
|
378
|
+
);
|
|
379
|
+
for (let idx = 0; idx < segments.length; idx += 1) {
|
|
380
|
+
const segment = segments[idx];
|
|
381
|
+
if (this.canceled) {
|
|
382
|
+
segment.canceled = true;
|
|
383
|
+
segment.destinationCanceled = true;
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
if (segment.canceled || segment.hasAttribute("canceled")) {
|
|
387
|
+
this.hasCanceledSegment = true;
|
|
388
|
+
if (idx === 0) {
|
|
389
|
+
this.firstSegmentCanceled = true;
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
if (
|
|
394
|
+
segment.hasAttribute("destinationCanceled") &&
|
|
395
|
+
idx === segments.length - 1
|
|
396
|
+
) {
|
|
397
|
+
this.lastSegmentCanceled = true;
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
// function that renders the HTML and CSS into the scope of the component
|
|
403
|
+
render() {
|
|
404
|
+
const isMultiple = this.children.length > 1;
|
|
405
|
+
const classes = {
|
|
406
|
+
slotContainer: true,
|
|
407
|
+
nonstop: !this.children.length,
|
|
408
|
+
multiple: isMultiple,
|
|
409
|
+
canceled: this.canceled,
|
|
410
|
+
};
|
|
411
|
+
|
|
412
|
+
return x`
|
|
413
|
+
<div class="${e(classes)}">
|
|
414
|
+
<slot @slotchange=${this.containsCanceledSegment}></slot>
|
|
415
|
+
${
|
|
416
|
+
isMultiple
|
|
417
|
+
? x`
|
|
418
|
+
<auro-flight-segment
|
|
419
|
+
class="showNoStops"
|
|
420
|
+
?canceled=${this.firstSegmentCanceled}
|
|
421
|
+
?partialCancel=${this.hasCanceledSegment}
|
|
422
|
+
?destinationCanceled=${this.lastSegmentCanceled}
|
|
423
|
+
iata="${this.children.length} stops"
|
|
424
|
+
></auro-flight-segment>
|
|
425
|
+
`
|
|
426
|
+
: x``
|
|
427
|
+
}
|
|
428
|
+
</div>`;
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
export { AuroFlightline as A, AuroFlightSegment as a };
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
# Airline information, DoT compliance
|
|
2
|
+
|
|
3
|
+
Below are example markets searchable in ITA and Sabre for availability.
|
|
4
|
+
|
|
5
|
+
[Change of Gauge flights](https://www.travelweekly.com/Mark-Pestronk/Agents-must-identify-change-of-gauge-services) are flights with the same flight number, but with an equipment swap at an intermediate stop.
|
|
6
|
+
|
|
7
|
+
<auro-alerts information>Change of Gauge flights are a pain point for guests with physical disabilities who may not expect to need to depart the aircraft. Even with the physical change of planes, these flights are still considered Direct. Qantas runs a COG JFK-SYD.</auro-alerts>
|
|
8
|
+
|
|
9
|
+
## Nonstop (SEAEWR)
|
|
10
|
+
|
|
11
|
+
<div class="exampleWrapper">
|
|
12
|
+
<auro-flightline></auro-flightline>
|
|
13
|
+
</div>
|
|
14
|
+
|
|
15
|
+
<auro-accordion alignRight>
|
|
16
|
+
<span slot="trigger">See code</span>
|
|
17
|
+
|
|
18
|
+
```html
|
|
19
|
+
<auro-flightline></auro-flightline>
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Sabre output for this flight
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
10FEB WED SEA/PST EWR/EST¥3
|
|
26
|
+
1 8 F7 D7 P7 I7 U5*SEAEWR 066 730A 355P 73J S 0 /E
|
|
27
|
+
A2 Y7 Z7 S7 B7 M7 H7 Q7 L7 V7
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
</auro-accordion>
|
|
31
|
+
|
|
32
|
+
## Flight with a Change of Gauge
|
|
33
|
+
|
|
34
|
+
Ask a TPO to load a CERT flight for you
|
|
35
|
+
|
|
36
|
+
<div class="exampleWrapper">
|
|
37
|
+
<auro-flightline>
|
|
38
|
+
<auro-flight-segment iata="LAX"></auro-flight-segment>
|
|
39
|
+
</auro-flightline>
|
|
40
|
+
</div>
|
|
41
|
+
|
|
42
|
+
<auro-accordion alignRight>
|
|
43
|
+
<span slot="trigger">See code</span>
|
|
44
|
+
|
|
45
|
+
```html
|
|
46
|
+
<auro-flightline>
|
|
47
|
+
<auro-flight-segment iata="LAX"></auro-flight-segment>
|
|
48
|
+
</auro-flightline>
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
</auro-accordion>
|
|
52
|
+
|
|
53
|
+
## Flight with a single layover (SEAAVP)
|
|
54
|
+
|
|
55
|
+
The following illustrates a flight with one layover, for example, SEA to AVP.
|
|
56
|
+
|
|
57
|
+
<div class="exampleWrapper">
|
|
58
|
+
<auro-flightline>
|
|
59
|
+
<auro-flight-segment iata="ORD" duration="3h 40m"></auro-flight-segment>
|
|
60
|
+
</auro-flightline>
|
|
61
|
+
</div>
|
|
62
|
+
|
|
63
|
+
<auro-accordion alignRight>
|
|
64
|
+
<span slot="trigger">See code</span>
|
|
65
|
+
|
|
66
|
+
```html
|
|
67
|
+
<auro-flightline>
|
|
68
|
+
<auro-flight-segment iata="ORD" duration="3h 40m"></auro-flight-segment>
|
|
69
|
+
</auro-flightline>
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Sabre output for this flight
|
|
73
|
+
|
|
74
|
+
```
|
|
75
|
+
10FEB WED SEA/PST AVP/EST¥3
|
|
76
|
+
1 34 F7 D7 P7 A0 Y7 Z7*SEAORD 080 810A 208P 73J S 0 /E
|
|
77
|
+
S7 B7 M7 H7 Q7 L7 V7 K7 G7
|
|
78
|
+
2 *4121 Y7 S7 B7 M7 H7 Q7 AVP N 455P 752P ERJ 0 XJS /E
|
|
79
|
+
L7 V7 K7 G7 T7 R7
|
|
80
|
+
OPERATED BY /ENVOY AIR AS AMERICAN EAGLE
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
</auro-accordion>
|
|
84
|
+
|
|
85
|
+
## Flight with a single stopover (ANCADK)
|
|
86
|
+
|
|
87
|
+
The following illustrates a flight with one stopover, for example, ANC to ADK.
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
<div class="exampleWrapper">
|
|
91
|
+
<auro-flightline>
|
|
92
|
+
<auro-flight-segment stopover iata="CDB"></auro-flight-segment>
|
|
93
|
+
</auro-flightline>
|
|
94
|
+
</div>
|
|
95
|
+
|
|
96
|
+
<auro-accordion alignRight>
|
|
97
|
+
<span slot="trigger">See code</span>
|
|
98
|
+
|
|
99
|
+
```html
|
|
100
|
+
<auro-flightline>
|
|
101
|
+
<auro-flight-segment stopover iata="CDB"></auro-flight-segment>
|
|
102
|
+
</auro-flightline>
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Sabre output for this flight
|
|
106
|
+
|
|
107
|
+
```
|
|
108
|
+
14FEB SUN ANC/Z-9 ADK/HST-1
|
|
109
|
+
1 184 F7 D7 P7 I7 U4 A2*ANCADK 000 -1 1000A 1255P 73G 1 WJ /E
|
|
110
|
+
Y7 Z7 S7 B7 M7 H7 Q7 L7 V7
|
|
111
|
+
2 184 F7 D7 P7 I7 U6 A3*ANCADK 000 3¥1000A 1255P 73G 1 WJ /E
|
|
112
|
+
Y7 Z7 S7 B7 M7 H7 Q7 L7 V7
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
</auro-accordion>
|
|
116
|
+
|
|
117
|
+
## Flight with a stopover and a layover (ADKSEA)
|
|
118
|
+
|
|
119
|
+
The following illustrates a flight with a stopover and a layover, for example, ADK to SEA.
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
<div class="exampleWrapper">
|
|
123
|
+
<auro-flightline>
|
|
124
|
+
<auro-flight-segment stopover iata="YAK"></auro-flight-segment>
|
|
125
|
+
<auro-flight-segment iata="SEA" duration="0h 40m"></auro-flight-segment>
|
|
126
|
+
</auro-flightline>
|
|
127
|
+
</div>
|
|
128
|
+
|
|
129
|
+
<auro-accordion alignRight>
|
|
130
|
+
<span slot="trigger">See code</span>
|
|
131
|
+
|
|
132
|
+
```html
|
|
133
|
+
<auro-flightline>
|
|
134
|
+
<auro-flight-segment stopover iata="YAK"></auro-flight-segment>
|
|
135
|
+
<auro-flight-segment iata="SEA" duration="0h 40m"></auro-flight-segment>
|
|
136
|
+
</auro-flightline>
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
Sabre output for this flight
|
|
140
|
+
|
|
141
|
+
```
|
|
142
|
+
10FEB WED ADK/HST SEA/PST¥2
|
|
143
|
+
1 187 F7 D7 P7 I7 U4 A3*ADKANC 016 205P 725P 73H 1 WJ /E
|
|
144
|
+
Y7 Z7 S7 B7 M7 H7 Q7 L7 V7
|
|
145
|
+
2 114 F1 D1 P0 I0 U0 A0* SEA 100 1¥ 225A 650A 73G 0 /E
|
|
146
|
+
Y7 Z7 S7 B7 M7 H6 Q6 L5 V4
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
</auro-accordion>
|
|
150
|
+
|
|
151
|
+
## Flight with layovers and stopovers (ADKBCN)
|
|
152
|
+
|
|
153
|
+
The following illustrates an international flight with stopovers and layovers, for example, ADK to BCN.
|
|
154
|
+
|
|
155
|
+
<div class="exampleWrapper">
|
|
156
|
+
<auro-flightline>
|
|
157
|
+
<auro-flight-segment stopover iata="YAK"></auro-flight-segment>
|
|
158
|
+
<auro-flight-segment stopover iata="WRG"></auro-flight-segment>
|
|
159
|
+
<auro-flight-segment iata="SEA" duration="0h 40m"></auro-flight-segment>
|
|
160
|
+
<auro-flight-segment iata="BOS" duration="1h 40m"></auro-flight-segment>
|
|
161
|
+
<auro-flight-segment iata="DUB" duration="13h 40m"></auro-flight-segment>
|
|
162
|
+
</auro-flightline>
|
|
163
|
+
</div>
|
|
164
|
+
|
|
165
|
+
<auro-accordion alignRight>
|
|
166
|
+
<span slot="trigger">See code</span>
|
|
167
|
+
|
|
168
|
+
```html
|
|
169
|
+
<auro-flightline>
|
|
170
|
+
<auro-flight-segment stopover iata="YAK"></auro-flight-segment>
|
|
171
|
+
<auro-flight-segment stopover iata="WRG"></auro-flight-segment>
|
|
172
|
+
<auro-flight-segment iata="SEA" duration="0h 40m"></auro-flight-segment>
|
|
173
|
+
<auro-flight-segment iata="BOS" duration="1h 40m"></auro-flight-segment>
|
|
174
|
+
<auro-flight-segment iata="DUB" duration="13h 40m"></auro-flight-segment>
|
|
175
|
+
</auro-flightline>
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
Sabre output for this flight
|
|
179
|
+
|
|
180
|
+
```
|
|
181
|
+
14FEB SUN ADK/HST BCN/¥11
|
|
182
|
+
1 187 F6 D6 P6 I6*ADKANC 016 - 155P 715P 73G 1 WJ /E
|
|
183
|
+
U0 A2 Y7 Z7 S7 B7 M7 H7 Q7 L7 V7
|
|
184
|
+
2 82 F6 D6 P5 I2* SEA 085 1¥ 600A 1025A 73J S 0 /E
|
|
185
|
+
U0 A0 Y7 Z7 S7 B7 M7 H7 Q7 L7 V7
|
|
186
|
+
3 *2352 F3 D3 P2 I0* SFO 066 355P 603P E75 S 0 /E
|
|
187
|
+
U0 A0 Y7 Z7 S7 B7 M7 H7 Q7 L7 V7
|
|
188
|
+
OPERATED BY /HORIZON AIR AS ALASKAHORIZON
|
|
189
|
+
4LV*2622 W4 E4 T4 Y4* BCN 800P 430P¥1 332 DS/G 0 QS
|
|
190
|
+
B4 H4 K4 M4 L4 F4 V4 S4 Z4 N4 Q4
|
|
191
|
+
OPERATED BY IBERIA FOR LEVEL SPAIN
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
</auro-accordion>
|