@aurodesignsystem/auro-dialog 1.0.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/.husky/commit-msg +4 -0
- package/.husky/pre-commit +4 -0
- package/CHANGELOG.md +24 -0
- package/LICENSE +201 -0
- package/README.md +226 -0
- package/demo/api.md +725 -0
- package/demo/index.md +200 -0
- package/dist/auro-dialog.d.ts +22 -0
- package/dist/auro-dialog.d.ts.map +1 -0
- package/dist/auro-dialog__bundled.js +362 -0
- package/dist/componentBase.d.ts +113 -0
- package/dist/componentBase.d.ts.map +1 -0
- package/dist/componentBase.js +278 -0
- package/dist/style-css.d.ts +3 -0
- package/dist/style-css.d.ts.map +1 -0
- package/dist/style-fixed-css.d.ts +3 -0
- package/dist/style-fixed-css.d.ts.map +1 -0
- package/dist/style-fixed-css.js +2 -0
- package/dist/style-unformatted-css.d.ts +3 -0
- package/dist/style-unformatted-css.d.ts.map +1 -0
- package/dist/style-unformatted-css.js +2 -0
- package/dist/style-unformatted-fixed-css.d.ts +3 -0
- package/dist/style-unformatted-fixed-css.d.ts.map +1 -0
- package/dist/style-unformatted-fixed-css.js +2 -0
- package/index.js +15 -0
- package/package.json +160 -0
- package/packageScripts/postinstall.mjs +28 -0
- package/src/auro-dialog.js +36 -0
- package/src/componentBase.js +278 -0
- package/src/style-css.js +2 -0
- package/src/style-fixed-css.js +2 -0
- package/src/style-unformatted-css.js +2 -0
- package/src/style-unformatted-fixed-css.js +2 -0
|
@@ -0,0 +1,362 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2019 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
+
*/
|
|
6
|
+
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$2=new WeakMap;let n$2 = class n{constructor(t,e,o){if(this._$cssResult$=!0,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$2.get(s)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&o$2.set(s,t));}return t}toString(){return this.cssText}};const r$3=t=>new n$2("string"==typeof t?t:t+"",void 0,s$2),i$3=(t,...e)=>{const o=1===t.length?t[0]:e.reduce(((e,s,o)=>e+(t=>{if(!0===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$2(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$3(e)})(t):t;
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* @license
|
|
10
|
+
* Copyright 2017 Google LLC
|
|
11
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
12
|
+
*/const{is:i$2,defineProperty:e$3,getOwnPropertyDescriptor:r$2,getOwnPropertyNames:h$1,getOwnPropertySymbols:o$1,getPrototypeOf:n$1}=Object,a$1=globalThis,c$1=a$1.trustedTypes,l$1=c$1?c$1.emptyScript:"",p$1=a$1.reactiveElementPolyfillSupport,d$1=(t,s)=>t,u$1={toAttribute(t,s){switch(s){case Boolean:t=t?l$1: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$2(t,s),y$1={attribute:!0,type:String,converter:u$1,reflect:!1,hasChanged:f$1};Symbol.metadata??=Symbol("metadata"),a$1.litPropertyMetadata??=new WeakMap;class b 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=y$1){if(s.state&&(s.attribute=!1),this._$Ei(),this.elementProperties.set(t,s),!s.noAccessor){const i=Symbol(),r=this.getPropertyDescriptor(t,i,s);void 0!==r&&e$3(this.prototype,t,r);}}static getPropertyDescriptor(t,s,i){const{get:e,set:h}=r$2(this.prototype,t)??{get(){return this[s]},set(t){this[s]=t;}};return {get(){return e?.call(this)},set(s){const r=e?.call(this);h.call(this,s),this.requestUpdate(t,r,i);},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??y$1}static _$Ei(){if(this.hasOwnProperty(d$1("elementProperties")))return;const t=n$1(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=!0,this._$Ei(),this.hasOwnProperty(d$1("properties"))){const t=this.properties,s=[...h$1(t),...o$1(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 !1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev();}_$Ev(){this._$Eg=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$ES(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)));}addController(t){(this._$E_??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.();}removeController(t){this._$E_?.delete(t);}_$ES(){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(!0),this._$E_?.forEach((t=>t.hostConnected?.()));}enableUpdating(t){}disconnectedCallback(){this._$E_?.forEach((t=>t.hostDisconnected?.()));}attributeChangedCallback(t,s,i){this._$AK(t,i);}_$EO(t,s){const i=this.constructor.elementProperties.get(t),e=this.constructor._$Eu(t,i);if(void 0!==e&&!0===i.reflect){const r=(void 0!==i.converter?.toAttribute?i.converter:u$1).toAttribute(s,i.type);this._$Em=t,null==r?this.removeAttribute(e):this.setAttribute(e,r),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),r="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:u$1;this._$Em=e,this[e]=r.fromAttribute(s,t.type),this._$Em=null;}}requestUpdate(t,s,i){if(void 0!==t){if(i??=this.constructor.getPropertyOptions(t),!(i.hasChanged??f$1)(this[t],s))return;this.C(t,s,i);}!1===this.isUpdatePending&&(this._$Eg=this._$EP());}C(t,s,i){this._$AL.has(t)||this._$AL.set(t,s),!0===i.reflect&&this._$Em!==t&&(this._$ET??=new Set).add(t);}async _$EP(){this.isUpdatePending=!0;try{await this._$Eg;}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)!0!==i.wrapped||this._$AL.has(s)||void 0===this[s]||this.C(s,this[s],i);}let t=!1;const s=this._$AL;try{t=this.shouldUpdate(s),t?(this.willUpdate(s),this._$E_?.forEach((t=>t.hostUpdate?.())),this.update(s)):this._$Ej();}catch(s){throw t=!1,this._$Ej(),s}t&&this._$AE(s);}willUpdate(t){}_$AE(t){this._$E_?.forEach((t=>t.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t);}_$Ej(){this._$AL=new Map,this.isUpdatePending=!1;}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$Eg}shouldUpdate(t){return !0}update(t){this._$ET&&=this._$ET.forEach((t=>this._$EO(t,this[t]))),this._$Ej();}updated(t){}firstUpdated(t){}}b.elementStyles=[],b.shadowRootOptions={mode:"open"},b[d$1("elementProperties")]=new Map,b[d$1("finalized")]=new Map,p$1?.({ReactiveElement:b}),(a$1.reactiveElementVersions??=[]).push("2.0.3");
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* @license
|
|
16
|
+
* Copyright 2017 Google LLC
|
|
17
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
18
|
+
*/
|
|
19
|
+
const t$1=globalThis,i$1=t$1.trustedTypes,s$1=i$1?i$1.createPolicy("lit-html",{createHTML:t=>t}):void 0,e$2="$lit$",h=`lit$${(Math.random()+"").slice(9)}$`,o="?"+h,n=`<${o}>`,r$1=document,l=()=>r$1.createComment(""),c=t=>null===t||"object"!=typeof t&&"function"!=typeof t,a=Array.isArray,u=t=>a(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),w=Symbol.for("lit-noChange"),T=Symbol.for("lit-nothing"),A=new WeakMap,E=r$1.createTreeWalker(r$1,129);function C(t,i){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==s$1?s$1.createHTML(i):i}const P=(t,i)=>{const s=t.length-1,o=[];let r,l=2===i?"<svg>":"",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:d>=0?(o.push(a),s.slice(0,d)+e$2+s.slice(d)+h+x):s+h+(-2===d?i:x);}return [C(t,l+(t[s]||"<?>")+(2===i?"</svg>":"")),o]};class V{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]=P(t,s);if(this.el=V.createElement(f,n),E.currentNode=this.el.content,2===s){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes);}for(;null!==(r=E.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]?k:"?"===e[1]?H:"@"===e[1]?I:R}),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$1?i$1.emptyScript:"";for(let i=0;i<s;i++)r.append(t[i],l()),E.nextNode(),d.push({type:2,index:++c});r.append(t[s],l());}}}else if(8===r.nodeType)if(r.data===o)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$1.createElement("template");return s.innerHTML=t,s}}function N(t,i,s=t,e){if(i===w)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?.(!1),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=N(t,h._$AS(t,i.values),h,e)),i}class S{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$1).importNode(i,!0);E.currentNode=e;let h=E.nextNode(),o=0,n=0,l=s[0];for(;void 0!==l;){if(o===l.index){let i;2===l.type?i=new M(h,h.nextSibling,this,t):1===l.type?i=new l.ctor(h,l.name,l.strings,this,t):6===l.type&&(i=new L(h,this,t)),this._$AV.push(i),l=s[++n];}o!==l?.index&&(h=E.nextNode(),o++);}return E.currentNode=r$1,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 M{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,i,s,e){this.type=2,this._$AH=T,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=s,this.options=e,this._$Cv=e?.isConnected??!0;}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=N(this,t,i),c(t)?t===T||null==t||""===t?(this._$AH!==T&&this._$AR(),this._$AH=T):t!==this._$AH&&t!==w&&this._(t):void 0!==t._$litType$?this.g(t):void 0!==t.nodeType?this.$(t):u(t)?this.T(t):this._(t);}k(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}$(t){this._$AH!==t&&(this._$AR(),this._$AH=this.k(t));}_(t){this._$AH!==T&&c(this._$AH)?this._$AA.nextSibling.data=t:this.$(r$1.createTextNode(t)),this._$AH=t;}g(t){const{values:i,_$litType$:s}=t,e="number"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=V.createElement(C(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===e)this._$AH.p(i);else {const t=new S(e,this),s=t.u(this.options);t.p(i),this.$(s),this._$AH=t;}}_$AC(t){let i=A.get(t.strings);return void 0===i&&A.set(t.strings,i=new V(t)),i}T(t){a(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 M(this.k(l()),this.k(l()),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?.(!1,!0,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 R{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,i,s,e,h){this.type=1,this._$AH=T,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=T;}_$AI(t,i=this,s,e){const h=this.strings;let o=!1;if(void 0===h)t=N(this,t,i,0),o=!c(t)||t!==this._$AH&&t!==w,o&&(this._$AH=t);else {const e=t;let n,r;for(t=h[0],n=0;n<h.length-1;n++)r=N(this,e[s+n],i,n),r===w&&(r=this._$AH[n]),o||=!c(r)||r!==this._$AH[n],r===T?t=T:t!==T&&(t+=(r??"")+h[n+1]),this._$AH[n]=r;}o&&!e&&this.O(t);}O(t){t===T?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"");}}class k extends R{constructor(){super(...arguments),this.type=3;}O(t){this.element[this.name]=t===T?void 0:t;}}class H extends R{constructor(){super(...arguments),this.type=4;}O(t){this.element.toggleAttribute(this.name,!!t&&t!==T);}}class I extends R{constructor(t,i,s,e,h){super(t,i,s,e,h),this.type=5;}_$AI(t,i=this){if((t=N(this,t,i,0)??T)===w)return;const s=this._$AH,e=t===T&&s!==T||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,h=t!==T&&(s===T||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 L{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){N(this,t);}}const Z=t$1.litHtmlPolyfillSupport;Z?.(V,M),(t$1.litHtmlVersions??=[]).push("3.1.1");const j=(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 M(i.insertBefore(l(),t),t,void 0,s??{});}return h._$AI(t),h};
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* @license
|
|
23
|
+
* Copyright 2017 Google LLC
|
|
24
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
25
|
+
*/class s extends b{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 i=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=j(i,this.renderRoot,this.renderOptions);}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0);}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1);}render(){return w}}s._$litElement$=!0,s[("finalized")]=!0,globalThis.litElementHydrateSupport?.({LitElement:s});const r=globalThis.litElementPolyfillSupport;r?.({LitElement:s});(globalThis.litElementVersions??=[]).push("4.0.3");
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* @license
|
|
29
|
+
* Copyright 2017 Google LLC
|
|
30
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
31
|
+
*/
|
|
32
|
+
const t={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},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)}}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* @license
|
|
36
|
+
* Copyright 2018 Google LLC
|
|
37
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
38
|
+
*/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.it){this.it=new Set,void 0!==s.strings&&(this.st=new Set(s.strings.join(" ").split(/\s/).filter((t=>""!==t))));for(const t in i)i[t]&&!this.st?.has(t)&&this.it.add(t);return this.render(i)}const r=s.element.classList;for(const t of this.it)t in i||(r.remove(t),this.it.delete(t));for(const t in i){const s=!!i[t];s===this.it.has(t)||this.st?.has(t)||(s?(r.add(t),this.it.add(t)):(r.remove(t),this.it.delete(t)));}return w}});
|
|
39
|
+
|
|
40
|
+
var styleCss = i$3`*,*:before,*:after{box-sizing:border-box}@media(prefers-reduced-motion: reduce){*,*:before,*:after{animation-duration:.01ms !important;animation-iteration-count:1 !important;transition-duration:.01ms !important}}*:focus-visible{outline:0}*:focus-visible{outline:0}:focus:not(:focus-visible){outline:3px solid transparent}.heading{margin:1.75rem 0;letter-spacing:var(--ds-text-heading-default-spacing, -0.2px);font-weight:var(--ds-text-heading-default-weight, 500)}.heading--display{margin-top:0;font-size:var(--ds-text-heading-display-size-breakpoint-sm, 2.75rem);font-weight:var(--ds-text-heading-display-weight, 100);line-height:var(--ds-text-heading-display-height-breakpoint-sm, 3.375rem)}@media screen and (min-width: 768px){.heading--display{font-size:var(--ds-text-heading-display-size-breakpoint-md, 3rem);line-height:var(--ds-text-heading-display-height-breakpoint-md, 3.75rem)}}@media screen and (min-width: 1024px){.heading--display{font-size:var(--ds-text-heading-display-size-breakpoint-lg, 3.5rem);line-height:var(--ds-text-heading-display-height-breakpoint-lg, 4.25rem)}}.heading--800{font-size:var(--ds-text-heading-800-size-breakpoint-sm, 2rem);font-weight:var(--ds-text-heading-800-weight, 500);line-height:var(--ds-text-heading-800-height-breakpoint-sm, 2.375rem)}@media screen and (min-width: 768px){.heading--800{font-size:var(--ds-text-heading-800-size-breakpoint-md, 2.25rem);line-height:var(--ds-text-heading-800-height-breakpoint-md, 2.625rem)}}@media screen and (min-width: 1024px){.heading--800{font-size:var(--ds-text-heading-800-size-breakpoint-lg, 2.5rem);line-height:var(--ds-text-heading-800-height-breakpoint-lg, 3rem)}}.heading--700{font-size:var(--ds-text-heading-700-size-breakpoint-sm, 1.75rem);font-weight:var(--ds-text-heading-700-weight, 500);line-height:var(--ds-text-heading-700-height-breakpoint-sm, 2.125rem)}@media screen and (min-width: 768px){.heading--700{font-size:var(--ds-text-heading-700-size-breakpoint-md, 2rem);line-height:var(--ds-text-heading-700-height-breakpoint-md, 2.375rem)}}@media screen and (min-width: 1024px){.heading--700{font-size:var(--ds-text-heading-700-size-breakpoint-lg, 2.25rem);line-height:var(--ds-text-heading-700-height-breakpoint-lg, 2.75rem)}}.heading--600{margin:1rem 0;font-size:var(--ds-text-heading-600-size-breakpoint-sm, 1.625rem);font-weight:var(--ds-text-heading-600-weight, 300);line-height:var(--ds-text-heading-600-height-breakpoint-sm, 1.875rem)}@media screen and (min-width: 768px){.heading--600{font-size:var(--ds-text-heading-600-size-breakpoint-md, 1.75rem);line-height:var(--ds-text-heading-600-height-breakpoint-md, 2.125rem)}}@media screen and (min-width: 1024px){.heading--600{font-size:var(--ds-text-heading-600-size-breakpoint-lg, 1.75rem);line-height:var(--ds-text-heading-600-height-breakpoint-lg, 2.25rem)}}.heading--500{margin:1rem 0;font-size:var(--ds-text-heading-500-size-breakpoint-sm, 1.375rem);font-weight:var(--ds-text-heading-500-weight, 300);line-height:var(--ds-text-heading-500-height-breakpoint-sm, 1.625rem)}@media screen and (min-width: 768px){.heading--500{font-size:var(--ds-text-heading-500-size-breakpoint-md, 1.5rem);line-height:var(--ds-text-heading-500-height-breakpoint-md, 1.875rem)}}@media screen and (min-width: 1024px){.heading--500{font-size:var(--ds-text-heading-500-size-breakpoint-lg, 1.5rem);line-height:var(--ds-text-heading-500-height-breakpoint-lg, 2rem)}}.heading--400{margin:.75rem 0;font-size:var(--ds-text-heading-400-size, 1.25rem);font-weight:var(--ds-text-heading-400-weight, 300);line-height:var(--ds-text-heading-400-height, 1.625rem)}.heading--300{margin:.75rem 0;font-size:var(--ds-text-heading-300-size, 1.125rem);font-weight:var(--ds-text-heading-300-weight, 300);line-height:var(--ds-text-heading-300-height, 1.625rem)}.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}.util_inlinePaddingNone--left{padding-left:0}.util_inlinePaddingNone--right{padding-right:0}.util_inlineMarginNone--left{margin-left:0}.util_inlineMarginNone--right{margin-right:0}.util_inlinePadding25--left{padding-left:.125rem}.util_inlinePadding25--right{padding-right:.125rem}.util_inlineMargin25--left{margin-left:.125rem}.util_inlineMargin25--right{margin-right:.125rem}.util_inlinePadding50--left{padding-left:.25rem}.util_inlinePadding50--right{padding-right:.25rem}.util_inlineMargin50--left{margin-left:.25rem}.util_inlineMargin50--right{margin-right:.25rem}.util_inlinePadding100--left{padding-left:.5rem}.util_inlinePadding100--right{padding-right:.5rem}.util_inlineMargin100--left{margin-left:.5rem}.util_inlineMargin100--right{margin-right:.5rem}.util_inlinePadding200--left{padding-left:1rem}.util_inlinePadding200--right{padding-right:1rem}.util_inlineMargin200--left{margin-left:1rem}.util_inlineMargin200--right{margin-right:1rem}.util_inlinePadding300--left{padding-left:1.5rem}.util_inlinePadding300--right{padding-right:1.5rem}.util_inlineMargin300--left{margin-left:1.5rem}.util_inlineMargin300--right{margin-right:1.5rem}.util_inlinePadding400--left{padding-left:2rem}.util_inlinePadding400--right{padding-right:2rem}.util_inlineMargin400--left{margin-left:2rem}.util_inlineMargin400--right{margin-right:2rem}.util_inlinePadding500--left{padding-left:2.5rem}.util_inlinePadding500--right{padding-right:2.5rem}.util_inlineMargin500--left{margin-left:2.5rem}.util_inlineMargin500--right{margin-right:2.5rem}.util_inlinePadding600--left{padding-left:3rem}.util_inlinePadding600--right{padding-right:3rem}.util_inlineMargin600--left{margin-left:3rem}.util_inlineMargin600--right{margin-right:3rem}.util_inlinePadding700--left{padding-left:3.5rem}.util_inlinePadding700--right{padding-right:3.5rem}.util_inlineMargin700--left{margin-left:3.5rem}.util_inlineMargin700--right{margin-right:3.5rem}.util_inlinePadding800--left{padding-left:4rem}.util_inlinePadding800--right{padding-right:4rem}.util_inlineMargin800--left{margin-left:4rem}.util_inlineMargin800--right{margin-right:4rem}.util_inlinePadding900--left{padding-left:4.5rem}.util_inlinePadding900--right{padding-right:4.5rem}.util_inlineMargin900--left{margin-left:4.5rem}.util_inlineMargin900--right{margin-right:4.5rem}.util_inlinePadding1000--left{padding-left:5rem}.util_inlinePadding1000--right{padding-right:5rem}.util_inlineMargin1000--left{margin-left:5rem}.util_inlineMargin1000--right{margin-right:5rem}.util_stackPaddingNone--top{padding-top:0}.util_stackPaddingNone--bottom{padding-bottom:0}.util_stackMarginNone--top{margin-top:0}.util_stackMarginNone--bottom{margin-bottom:0}.util_stackPadding25--top{padding-top:.125rem}.util_stackPadding25--bottom{padding-bottom:.125rem}.util_stackMargin25--top{margin-top:.125rem}.util_stackMargin25--bottom{margin-bottom:.125rem}.util_stackPadding50--top{padding-top:.25rem}.util_stackPadding50--bottom{padding-bottom:.25rem}.util_stackMargin50--top{margin-top:.25rem}.util_stackMargin50--bottom{margin-bottom:.25rem}.util_stackPadding100--top{padding-top:.5rem}.util_stackPadding100--bottom{padding-bottom:.5rem}.util_stackMargin100--top{margin-top:.5rem}.util_stackMargin100--bottom{margin-bottom:.5rem}.util_stackPadding200--top{padding-top:1rem}.util_stackPadding200--bottom{padding-bottom:1rem}.util_stackMargin200--top{margin-top:1rem}.util_stackMargin200--bottom{margin-bottom:1rem}.util_stackPadding300--top{padding-top:1.5rem}.util_stackPadding300--bottom{padding-bottom:1.5rem}.util_stackMargin300--top{margin-top:1.5rem}.util_stackMargin300--bottom{margin-bottom:1.5rem}.util_stackPadding400--top{padding-top:2rem}.util_stackPadding400--bottom{padding-bottom:2rem}.util_stackMargin400--top{margin-top:2rem}.util_stackMargin400--bottom{margin-bottom:2rem}.util_stackPadding500--top{padding-top:2.5rem}.util_stackPadding500--bottom{padding-bottom:2.5rem}.util_stackMargin500--top{margin-top:2.5rem}.util_stackMargin500--bottom{margin-bottom:2.5rem}.util_stackPadding600--top{padding-top:3rem}.util_stackPadding600--bottom{padding-bottom:3rem}.util_stackMargin600--top{margin-top:3rem}.util_stackMargin600--bottom{margin-bottom:3rem}.util_stackPadding700--top{padding-top:3.5rem}.util_stackPadding700--bottom{padding-bottom:3.5rem}.util_stackMargin700--top{margin-top:3.5rem}.util_stackMargin700--bottom{margin-bottom:3.5rem}.util_stackPadding800--top{padding-top:4rem}.util_stackPadding800--bottom{padding-bottom:4rem}.util_stackMargin800--top{margin-top:4rem}.util_stackMargin800--bottom{margin-bottom:4rem}.util_stackPadding900--top{padding-top:4.5rem}.util_stackPadding900--bottom{padding-bottom:4.5rem}.util_stackMargin900--top{margin-top:4.5rem}.util_stackMargin900--bottom{margin-bottom:4.5rem}.util_stackPadding1000--top{padding-top:5rem}.util_stackPadding1000--bottom{padding-bottom:5rem}.util_stackMargin1000--top{margin-top:5rem}.util_stackMargin1000--bottom{margin-bottom:5rem}:host{--insetPaddingXl:0 var(--ds-size-400, $ds-size-400) var(--ds-size-400, $ds-size-400) var(--ds-size-400, $ds-size-400);--insetPaddingXxl:0 var(--ds-size-600, $ds-size-600) var(--ds-size-600, $ds-size-600) var(--ds-size-600, $ds-size-600);--insetPaddingXxxl:0 var(--ds-size-800, $ds-size-800) var(--ds-size-800, $ds-size-800) var(--ds-size-800, $ds-size-800)}.dialogOverlay{position:fixed;z-index:-1;bottom:0;left:0;width:100%;height:100%}.dialogOverlay--open{z-index:var(--ds-depth-overlay);transition:background .3s cubic-bezier(0.4, 0, 0.2, 0);background:rgba(0, 0, 0, 0.2)}.dialogOverlay--modal{z-index:var(--ds-depth-overlay);transition:background .3s cubic-bezier(0.4, 0, 0.5, 0);background:rgba(0, 0, 0, 0.5)}.dialog{position:fixed;z-index:-1;right:0;bottom:0;left:0;display:block;visibility:hidden;overflow:visible;width:100%;max-height:90%;padding:var(--insetPaddingXl);transform:translateY(100%);opacity:0;border:0;background:var(--ds-color-background-lightest, #ffffff);color:var(--ds-color-text-primary-default, #222222);transition:all .3s ease-in-out}@media screen and (min-width: 768px){.dialog{top:10%;bottom:unset;max-width:80%;max-height:80%;margin:auto;padding:var(--insetPaddingXxxl);transform:scale(0);box-shadow:0 10px 20px 0 rgba(0, 0, 0, 0.12),0 1px 10px 0 rgba(0, 0, 0, 0.1)}.dialog--open{transform:scale(1)}}@media screen and (min-width: 1024px){.dialog{max-width:986px}}.dialog--open{z-index:var(--ds-depth-modal, 400);visibility:visible;transform:translateY(0%);opacity:1}.dialog-footer{padding-top:var(--ds-size-400, 2rem)}@media screen and (min-width: 768px){.dialog-footer ::slotted(*){display:flex;justify-content:flex-end}}.dialog-header{display:flex;align-items:flex-start;justify-content:space-between;padding-top:var(--ds-size-800, 4rem)}.dialog-header svg{fill:var(--ds-color-text-secondary-default, #626b79)}.dialog-header--action{margin:0;padding:0;border:none;border:2px solid transparent;border-radius:var(--ds-border-radius, 0.375rem);background-color:transparent}.dialog-header--action:hover{cursor:pointer}::slotted([slot=content]){position:relative}:host([unformatted]) .dialog-header--action{position:absolute;top:var(--ds-size-400, 2rem);right:var(--ds-size-400, 2rem)}@media screen and (min-width: 768px){:host([unformatted]) .dialog-header--action{top:var(--ds-size-800, 4rem);right:var(--ds-size-800, 4rem)}}:host([unformatted][onDark]) .dialog-header--action{color:var(--ds-color-base-white, #ffffff)}:host([sm]) .dialog{max-height:30%}@media screen and (min-width: 768px){:host([sm]) .dialog{top:10%;max-width:40%;max-height:80%;padding:var(--insetPaddingXxl)}}@media screen and (min-width: 1024px){:host([sm]) .dialog{max-width:740px}}:host([md]) .dialog{max-height:50%}@media screen and (min-width: 768px){:host([md]) .dialog{top:10%;max-width:70%;max-height:80%}}@media screen and (min-width: 1024px){:host([md]) .dialog{top:10%;max-width:986px}}@media screen and (min-width: 768px){:host([sm][lg]) .dialog,:host([md][lg]) .dialog{max-height:80%}}:host([sm][lg]) .dialog,:host([md][lg]) .dialog{max-height:90%}:host([unformatted]) .dialog{padding:0}`;
|
|
41
|
+
|
|
42
|
+
var styleCssFixed = i$3`:host([fixed]) *,:host([fixed]) *:before,:host([fixed]) *:after{box-sizing:border-box}@media(prefers-reduced-motion: reduce){:host([fixed]) *,:host([fixed]) *:before,:host([fixed]) *:after{animation-duration:.01ms !important;animation-iteration-count:1 !important;transition-duration:.01ms !important}}:host([fixed]) *:focus-visible{outline:0}:host([fixed]) *:focus-visible{outline:0}:host([fixed]) :focus:not(:focus-visible){outline:3px solid transparent}:host([fixed]) .heading{margin:1.75rem 0;letter-spacing:var(--ds-text-heading-default-spacing, -0.2px);font-weight:var(--ds-text-heading-default-weight, 500)}:host([fixed]) .heading--display{margin-top:0;font-size:var(--ds-text-heading-display-size-breakpoint-sm, 2.75rem);font-weight:var(--ds-text-heading-display-weight, 100);line-height:var(--ds-text-heading-display-height-breakpoint-sm, 3.375rem)}@media screen and (min-width: 768px){:host([fixed]) .heading--display{font-size:var(--ds-text-heading-display-size-breakpoint-md, 3rem);line-height:var(--ds-text-heading-display-height-breakpoint-md, 3.75rem)}}@media screen and (min-width: 1024px){:host([fixed]) .heading--display{font-size:var(--ds-text-heading-display-size-breakpoint-lg, 3.5rem);line-height:var(--ds-text-heading-display-height-breakpoint-lg, 4.25rem)}}:host([fixed]) .heading--800{font-size:var(--ds-text-heading-800-size-breakpoint-sm, 2rem);font-weight:var(--ds-text-heading-800-weight, 500);line-height:var(--ds-text-heading-800-height-breakpoint-sm, 2.375rem)}@media screen and (min-width: 768px){:host([fixed]) .heading--800{font-size:var(--ds-text-heading-800-size-breakpoint-md, 2.25rem);line-height:var(--ds-text-heading-800-height-breakpoint-md, 2.625rem)}}@media screen and (min-width: 1024px){:host([fixed]) .heading--800{font-size:var(--ds-text-heading-800-size-breakpoint-lg, 2.5rem);line-height:var(--ds-text-heading-800-height-breakpoint-lg, 3rem)}}:host([fixed]) .heading--700{font-size:var(--ds-text-heading-700-size-breakpoint-sm, 1.75rem);font-weight:var(--ds-text-heading-700-weight, 500);line-height:var(--ds-text-heading-700-height-breakpoint-sm, 2.125rem)}@media screen and (min-width: 768px){:host([fixed]) .heading--700{font-size:var(--ds-text-heading-700-size-breakpoint-md, 2rem);line-height:var(--ds-text-heading-700-height-breakpoint-md, 2.375rem)}}@media screen and (min-width: 1024px){:host([fixed]) .heading--700{font-size:var(--ds-text-heading-700-size-breakpoint-lg, 2.25rem);line-height:var(--ds-text-heading-700-height-breakpoint-lg, 2.75rem)}}:host([fixed]) .heading--600{margin:1rem 0;font-size:var(--ds-text-heading-600-size-breakpoint-sm, 1.625rem);font-weight:var(--ds-text-heading-600-weight, 300);line-height:var(--ds-text-heading-600-height-breakpoint-sm, 1.875rem)}@media screen and (min-width: 768px){:host([fixed]) .heading--600{font-size:var(--ds-text-heading-600-size-breakpoint-md, 1.75rem);line-height:var(--ds-text-heading-600-height-breakpoint-md, 2.125rem)}}@media screen and (min-width: 1024px){:host([fixed]) .heading--600{font-size:var(--ds-text-heading-600-size-breakpoint-lg, 1.75rem);line-height:var(--ds-text-heading-600-height-breakpoint-lg, 2.25rem)}}:host([fixed]) .heading--500{margin:1rem 0;font-size:var(--ds-text-heading-500-size-breakpoint-sm, 1.375rem);font-weight:var(--ds-text-heading-500-weight, 300);line-height:var(--ds-text-heading-500-height-breakpoint-sm, 1.625rem)}@media screen and (min-width: 768px){:host([fixed]) .heading--500{font-size:var(--ds-text-heading-500-size-breakpoint-md, 1.5rem);line-height:var(--ds-text-heading-500-height-breakpoint-md, 1.875rem)}}@media screen and (min-width: 1024px){:host([fixed]) .heading--500{font-size:var(--ds-text-heading-500-size-breakpoint-lg, 1.5rem);line-height:var(--ds-text-heading-500-height-breakpoint-lg, 2rem)}}:host([fixed]) .heading--400{margin:.75rem 0;font-size:var(--ds-text-heading-400-size, 1.25rem);font-weight:var(--ds-text-heading-400-weight, 300);line-height:var(--ds-text-heading-400-height, 1.625rem)}:host([fixed]) .heading--300{margin:.75rem 0;font-size:var(--ds-text-heading-300-size, 1.125rem);font-weight:var(--ds-text-heading-300-weight, 300);line-height:var(--ds-text-heading-300-height, 1.625rem)}:host([fixed]) .util_displayInline{display:inline}:host([fixed]) .util_displayInlineBlock{display:inline-block}:host([fixed]) .util_displayBlock{display:block}:host([fixed]) .util_displayFlex{display:flex}:host([fixed]) .util_displayHidden{display:none}:host([fixed]) .util_displayHiddenVisually{position:absolute;overflow:hidden;clip:rect(1px, 1px, 1px, 1px);width:1px;height:1px;padding:0;border:0}:host([fixed]) .util_inlinePaddingNone--left{padding-left:0}:host([fixed]) .util_inlinePaddingNone--right{padding-right:0}:host([fixed]) .util_inlineMarginNone--left{margin-left:0}:host([fixed]) .util_inlineMarginNone--right{margin-right:0}:host([fixed]) .util_inlinePadding25--left{padding-left:.125rem}:host([fixed]) .util_inlinePadding25--right{padding-right:.125rem}:host([fixed]) .util_inlineMargin25--left{margin-left:.125rem}:host([fixed]) .util_inlineMargin25--right{margin-right:.125rem}:host([fixed]) .util_inlinePadding50--left{padding-left:.25rem}:host([fixed]) .util_inlinePadding50--right{padding-right:.25rem}:host([fixed]) .util_inlineMargin50--left{margin-left:.25rem}:host([fixed]) .util_inlineMargin50--right{margin-right:.25rem}:host([fixed]) .util_inlinePadding100--left{padding-left:.5rem}:host([fixed]) .util_inlinePadding100--right{padding-right:.5rem}:host([fixed]) .util_inlineMargin100--left{margin-left:.5rem}:host([fixed]) .util_inlineMargin100--right{margin-right:.5rem}:host([fixed]) .util_inlinePadding200--left{padding-left:1rem}:host([fixed]) .util_inlinePadding200--right{padding-right:1rem}:host([fixed]) .util_inlineMargin200--left{margin-left:1rem}:host([fixed]) .util_inlineMargin200--right{margin-right:1rem}:host([fixed]) .util_inlinePadding300--left{padding-left:1.5rem}:host([fixed]) .util_inlinePadding300--right{padding-right:1.5rem}:host([fixed]) .util_inlineMargin300--left{margin-left:1.5rem}:host([fixed]) .util_inlineMargin300--right{margin-right:1.5rem}:host([fixed]) .util_inlinePadding400--left{padding-left:2rem}:host([fixed]) .util_inlinePadding400--right{padding-right:2rem}:host([fixed]) .util_inlineMargin400--left{margin-left:2rem}:host([fixed]) .util_inlineMargin400--right{margin-right:2rem}:host([fixed]) .util_inlinePadding500--left{padding-left:2.5rem}:host([fixed]) .util_inlinePadding500--right{padding-right:2.5rem}:host([fixed]) .util_inlineMargin500--left{margin-left:2.5rem}:host([fixed]) .util_inlineMargin500--right{margin-right:2.5rem}:host([fixed]) .util_inlinePadding600--left{padding-left:3rem}:host([fixed]) .util_inlinePadding600--right{padding-right:3rem}:host([fixed]) .util_inlineMargin600--left{margin-left:3rem}:host([fixed]) .util_inlineMargin600--right{margin-right:3rem}:host([fixed]) .util_inlinePadding700--left{padding-left:3.5rem}:host([fixed]) .util_inlinePadding700--right{padding-right:3.5rem}:host([fixed]) .util_inlineMargin700--left{margin-left:3.5rem}:host([fixed]) .util_inlineMargin700--right{margin-right:3.5rem}:host([fixed]) .util_inlinePadding800--left{padding-left:4rem}:host([fixed]) .util_inlinePadding800--right{padding-right:4rem}:host([fixed]) .util_inlineMargin800--left{margin-left:4rem}:host([fixed]) .util_inlineMargin800--right{margin-right:4rem}:host([fixed]) .util_inlinePadding900--left{padding-left:4.5rem}:host([fixed]) .util_inlinePadding900--right{padding-right:4.5rem}:host([fixed]) .util_inlineMargin900--left{margin-left:4.5rem}:host([fixed]) .util_inlineMargin900--right{margin-right:4.5rem}:host([fixed]) .util_inlinePadding1000--left{padding-left:5rem}:host([fixed]) .util_inlinePadding1000--right{padding-right:5rem}:host([fixed]) .util_inlineMargin1000--left{margin-left:5rem}:host([fixed]) .util_inlineMargin1000--right{margin-right:5rem}:host([fixed]) .util_stackPaddingNone--top{padding-top:0}:host([fixed]) .util_stackPaddingNone--bottom{padding-bottom:0}:host([fixed]) .util_stackMarginNone--top{margin-top:0}:host([fixed]) .util_stackMarginNone--bottom{margin-bottom:0}:host([fixed]) .util_stackPadding25--top{padding-top:.125rem}:host([fixed]) .util_stackPadding25--bottom{padding-bottom:.125rem}:host([fixed]) .util_stackMargin25--top{margin-top:.125rem}:host([fixed]) .util_stackMargin25--bottom{margin-bottom:.125rem}:host([fixed]) .util_stackPadding50--top{padding-top:.25rem}:host([fixed]) .util_stackPadding50--bottom{padding-bottom:.25rem}:host([fixed]) .util_stackMargin50--top{margin-top:.25rem}:host([fixed]) .util_stackMargin50--bottom{margin-bottom:.25rem}:host([fixed]) .util_stackPadding100--top{padding-top:.5rem}:host([fixed]) .util_stackPadding100--bottom{padding-bottom:.5rem}:host([fixed]) .util_stackMargin100--top{margin-top:.5rem}:host([fixed]) .util_stackMargin100--bottom{margin-bottom:.5rem}:host([fixed]) .util_stackPadding200--top{padding-top:1rem}:host([fixed]) .util_stackPadding200--bottom{padding-bottom:1rem}:host([fixed]) .util_stackMargin200--top{margin-top:1rem}:host([fixed]) .util_stackMargin200--bottom{margin-bottom:1rem}:host([fixed]) .util_stackPadding300--top{padding-top:1.5rem}:host([fixed]) .util_stackPadding300--bottom{padding-bottom:1.5rem}:host([fixed]) .util_stackMargin300--top{margin-top:1.5rem}:host([fixed]) .util_stackMargin300--bottom{margin-bottom:1.5rem}:host([fixed]) .util_stackPadding400--top{padding-top:2rem}:host([fixed]) .util_stackPadding400--bottom{padding-bottom:2rem}:host([fixed]) .util_stackMargin400--top{margin-top:2rem}:host([fixed]) .util_stackMargin400--bottom{margin-bottom:2rem}:host([fixed]) .util_stackPadding500--top{padding-top:2.5rem}:host([fixed]) .util_stackPadding500--bottom{padding-bottom:2.5rem}:host([fixed]) .util_stackMargin500--top{margin-top:2.5rem}:host([fixed]) .util_stackMargin500--bottom{margin-bottom:2.5rem}:host([fixed]) .util_stackPadding600--top{padding-top:3rem}:host([fixed]) .util_stackPadding600--bottom{padding-bottom:3rem}:host([fixed]) .util_stackMargin600--top{margin-top:3rem}:host([fixed]) .util_stackMargin600--bottom{margin-bottom:3rem}:host([fixed]) .util_stackPadding700--top{padding-top:3.5rem}:host([fixed]) .util_stackPadding700--bottom{padding-bottom:3.5rem}:host([fixed]) .util_stackMargin700--top{margin-top:3.5rem}:host([fixed]) .util_stackMargin700--bottom{margin-bottom:3.5rem}:host([fixed]) .util_stackPadding800--top{padding-top:4rem}:host([fixed]) .util_stackPadding800--bottom{padding-bottom:4rem}:host([fixed]) .util_stackMargin800--top{margin-top:4rem}:host([fixed]) .util_stackMargin800--bottom{margin-bottom:4rem}:host([fixed]) .util_stackPadding900--top{padding-top:4.5rem}:host([fixed]) .util_stackPadding900--bottom{padding-bottom:4.5rem}:host([fixed]) .util_stackMargin900--top{margin-top:4.5rem}:host([fixed]) .util_stackMargin900--bottom{margin-bottom:4.5rem}:host([fixed]) .util_stackPadding1000--top{padding-top:5rem}:host([fixed]) .util_stackPadding1000--bottom{padding-bottom:5rem}:host([fixed]) .util_stackMargin1000--top{margin-top:5rem}:host([fixed]) .util_stackMargin1000--bottom{margin-bottom:5rem}:host([fixed]) :host{--insetPaddingXl:0 var(--ds-size-400, $ds-size-400) var(--ds-size-400, $ds-size-400) var(--ds-size-400, $ds-size-400);--insetPaddingXxl:0 var(--ds-size-600, $ds-size-600) var(--ds-size-600, $ds-size-600) var(--ds-size-600, $ds-size-600);--insetPaddingXxxl:0 var(--ds-size-800, $ds-size-800) var(--ds-size-800, $ds-size-800) var(--ds-size-800, $ds-size-800)}:host([fixed]) .dialogOverlay{position:fixed;z-index:-1;bottom:0;left:0;width:100%;height:100%}:host([fixed]) .dialogOverlay--open{z-index:var(--ds-depth-overlay);transition:background .3s cubic-bezier(0.4, 0, 0.2, 0);background:rgba(0, 0, 0, 0.2)}:host([fixed]) .dialogOverlay--modal{z-index:var(--ds-depth-overlay);transition:background .3s cubic-bezier(0.4, 0, 0.5, 0);background:rgba(0, 0, 0, 0.5)}:host([fixed]) .dialog{position:fixed;z-index:-1;right:0;bottom:0;left:0;display:block;visibility:hidden;overflow:visible;width:100%;max-height:90%;padding:var(--insetPaddingXl);transform:translateY(100%);opacity:0;border:0;background:var(--ds-color-background-lightest, #ffffff);color:var(--ds-color-text-primary-default, #222222);transition:all .3s ease-in-out}@media screen and (min-width: 768px){:host([fixed]) .dialog{top:10%;bottom:unset;max-width:80%;max-height:80%;margin:auto;padding:var(--insetPaddingXxxl);transform:scale(0);box-shadow:0 10px 20px 0 rgba(0, 0, 0, 0.12),0 1px 10px 0 rgba(0, 0, 0, 0.1)}:host([fixed]) .dialog--open{transform:scale(1)}}@media screen and (min-width: 1024px){:host([fixed]) .dialog{max-width:986px}}:host([fixed]) .dialog--open{z-index:var(--ds-depth-modal, 400);visibility:visible;transform:translateY(0%);opacity:1}:host([fixed]) .dialog-footer{padding-top:var(--ds-size-400, 2rem)}@media screen and (min-width: 768px){:host([fixed]) .dialog-footer ::slotted(*){display:flex;justify-content:flex-end}}:host([fixed]) .dialog-header{display:flex;align-items:flex-start;justify-content:space-between;padding-top:var(--ds-size-800, 4rem)}:host([fixed]) .dialog-header svg{fill:var(--ds-color-text-secondary-default, #626b79)}:host([fixed]) .dialog-header--action{margin:0;padding:0;border:none;border:2px solid transparent;border-radius:var(--ds-border-radius, 0.375rem);background-color:transparent}:host([fixed]) .dialog-header--action:hover{cursor:pointer}:host([fixed]) ::slotted([slot=content]){position:relative}:host([fixed]) :host([unformatted]) .dialog-header--action{position:absolute;top:var(--ds-size-400, 2rem);right:var(--ds-size-400, 2rem)}@media screen and (min-width: 768px){:host([fixed]) :host([unformatted]) .dialog-header--action{top:var(--ds-size-800, 4rem);right:var(--ds-size-800, 4rem)}}:host([fixed]) :host([unformatted][onDark]) .dialog-header--action{color:var(--ds-color-base-white, #ffffff)}:host([fixed]) :host([sm]) .dialog{max-height:30%}@media screen and (min-width: 768px){:host([fixed]) :host([sm]) .dialog{top:10%;max-width:40%;max-height:80%;padding:var(--insetPaddingXxl)}}@media screen and (min-width: 1024px){:host([fixed]) :host([sm]) .dialog{max-width:740px}}:host([fixed]) :host([md]) .dialog{max-height:50%}@media screen and (min-width: 768px){:host([fixed]) :host([md]) .dialog{top:10%;max-width:70%;max-height:80%}}@media screen and (min-width: 1024px){:host([fixed]) :host([md]) .dialog{top:10%;max-width:986px}}@media screen and (min-width: 768px){:host([fixed]) :host([sm][lg]) .dialog,:host([fixed]) :host([md][lg]) .dialog{max-height:80%}}:host([fixed]) :host([sm][lg]) .dialog,:host([fixed]) :host([md][lg]) .dialog{max-height:90%}:host([fixed]) :host([unformatted]) .dialog{padding:0}`;
|
|
43
|
+
|
|
44
|
+
var styleUnformattedCss = i$3`[unformatted] .unformattedWrapper{padding:var(--ds-size-400, 2rem)}@media screen and (min-width: 768px){[unformatted] .unformattedWrapper{padding:var(--ds-size-800, 4rem);padding-top:var(--ds-size-400, 2rem)}}`;
|
|
45
|
+
|
|
46
|
+
var styleUnformattedCssFixed = i$3`:host([fixed]) [unformatted] .unformattedWrapper{padding:var(--ds-size-400, 2rem)}@media screen and (min-width: 768px){:host([fixed]) [unformatted] .unformattedWrapper{padding:var(--ds-size-800, 4rem);padding-top:var(--ds-size-400, 2rem)}}`;
|
|
47
|
+
|
|
48
|
+
var closeIcon = {"role":"img","color":"currentColor","title":"","desc":"","width":"var(--auro-size-lg, var(--ds-size-300, 1.5rem))","height":"var(--auro-size-lg, var(--ds-size-300, 1.5rem))","xmlns":"http://www.w3.org/2000/svg","xmlns_xlink":"http://www.w3.org/1999/xlink","viewBox":"0 0 24 24","path":"/icons","style":"ico_squareLarge","name":"x-lg","category":"interface","svg":"<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" aria-hidden=\"true\" class=\"ico_squareLarge\" role=\"img\" style=\"min-width:var(--auro-size-lg, var(--ds-size-300, 1.5rem));height:var(--auro-size-lg, var(--ds-size-300, 1.5rem));fill:currentColor\" viewBox=\"0 0 24 24\"><title/><path d=\"m5.397 5.554.073-.084a.75.75 0 0 1 .976-.073l.084.073L12 10.939l5.47-5.47a.75.75 0 0 1 .976-.072l.084.073a.75.75 0 0 1 .073.976l-.073.084L13.061 12l5.47 5.47a.75.75 0 0 1 .072.976l-.073.084a.75.75 0 0 1-.976.073l-.084-.073L12 13.061l-5.47 5.47a.75.75 0 0 1-.976.072l-.084-.073a.75.75 0 0 1-.073-.976l.073-.084L10.939 12l-5.47-5.47a.75.75 0 0 1-.072-.976l.073-.084-.073.084Z\"/></svg>"};
|
|
49
|
+
|
|
50
|
+
// Copyright (c) 2024 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
51
|
+
// See LICENSE in the project root for license information.
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
/* eslint-disable one-var, prefer-destructuring */
|
|
55
|
+
|
|
56
|
+
const ESCAPE_KEYCODE = 27,
|
|
57
|
+
FOCUS_TIMEOUT = 50;
|
|
58
|
+
|
|
59
|
+
// See https://git.io/JJ6SJ for "How to document your components using JSDoc"
|
|
60
|
+
/**
|
|
61
|
+
* auro-dialog appear above the page and require the user's attention.
|
|
62
|
+
*
|
|
63
|
+
* @attr {Boolean} modal - Modal dialog restricts the user to take an action (no default close actions)
|
|
64
|
+
* @attr {Boolean} fixed - Uses fixed pixel values for element shape
|
|
65
|
+
* @attr {Boolean} unformatted - Unformatted dialog window, edge-to-edge fill for content
|
|
66
|
+
* @attr {Boolean} sm - Sets dialog box to small style. Adding both sm and lg will set the dialog to sm for desktop and lg for mobile.
|
|
67
|
+
* @attr {Boolean} md - Sets dialog box to medium style. Adding both md and lg will set the dialog to md for desktop and lg for mobile.
|
|
68
|
+
* @attr {Boolean} onDark - Sets close icon to white for dark backgrounds
|
|
69
|
+
* @attr {Boolean} open - Sets state of dialog to open
|
|
70
|
+
* @prop {HTMLElement} triggerElement - The element to focus when the dialog is closed. If not set, defaults to the value of document.activeElement when the dialog is opened.
|
|
71
|
+
* @slot header - Text to display as the header of the modal
|
|
72
|
+
* @slot content - Injects content into the body of the modal
|
|
73
|
+
* @slot footer - Used for action options, e.g. buttons
|
|
74
|
+
* @function toggleViewable - toggles the 'open' property on the element
|
|
75
|
+
* @event toggle - Event fires when the element is closed
|
|
76
|
+
* @csspart close-button - adjust position of the close X icon in the dialog window
|
|
77
|
+
* @csspart dialog-overlay - apply CSS on the overlay of the dialog
|
|
78
|
+
* @csspart dialog - apply CSS to the entire dialog
|
|
79
|
+
* @csspart dialog-header - apply CSS to the header of the dialog
|
|
80
|
+
* @csspart dialog-content - apply CSS to the content of the dialog
|
|
81
|
+
* @csspart dialog-footer - apply CSS to the footer of the dialog
|
|
82
|
+
*/
|
|
83
|
+
|
|
84
|
+
class ComponentBase extends s {
|
|
85
|
+
constructor() {
|
|
86
|
+
super();
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* @private
|
|
90
|
+
*/
|
|
91
|
+
this.dom = new DOMParser().parseFromString(closeIcon.svg, 'text/html');
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* @private
|
|
95
|
+
*/
|
|
96
|
+
this.svg = this.dom.body.firstChild;
|
|
97
|
+
|
|
98
|
+
this.modal = false;
|
|
99
|
+
this.unformatted = false;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
static get properties() {
|
|
103
|
+
return {
|
|
104
|
+
modal: { type: Boolean },
|
|
105
|
+
unformatted: {
|
|
106
|
+
type: Boolean,
|
|
107
|
+
reflect: true
|
|
108
|
+
},
|
|
109
|
+
open: {
|
|
110
|
+
type: Boolean,
|
|
111
|
+
reflect: true
|
|
112
|
+
},
|
|
113
|
+
triggerElement: {
|
|
114
|
+
attribute: false
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
firstUpdated() {
|
|
120
|
+
const slot = this.shadowRoot.querySelector("#footer"),
|
|
121
|
+
slotWrapper = this.shadowRoot.querySelector("#footerWrapper");
|
|
122
|
+
|
|
123
|
+
this.dialog = this.shadowRoot.getElementById('dialog');
|
|
124
|
+
|
|
125
|
+
if (!this.unformatted && slot.assignedNodes().length === 0) {
|
|
126
|
+
slotWrapper.classList.remove("dialog-footer");
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* LitElement lifecycle method. Called after the DOM has been updated.
|
|
132
|
+
* @param {Map<string, any>} changedProperties - Keys are the names of changed properties, values are the corresponding previous values.
|
|
133
|
+
* @returns {void}
|
|
134
|
+
*/
|
|
135
|
+
updated(changedProperties) {
|
|
136
|
+
if (changedProperties.has('open')) {
|
|
137
|
+
if (this.open) {
|
|
138
|
+
this.openDialog();
|
|
139
|
+
} else {
|
|
140
|
+
this.closeDialog();
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
connectedCallback() {
|
|
146
|
+
super.connectedCallback();
|
|
147
|
+
this.keydownEventHandler = this.handleKeydown.bind(this);
|
|
148
|
+
window.addEventListener('keydown', this.keydownEventHandler);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
disconnectedCallback() {
|
|
152
|
+
super.disconnectedCallback();
|
|
153
|
+
window.removeEventListener('keydown', this.keydownEventHandler);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* @private
|
|
158
|
+
* @returns {void}
|
|
159
|
+
*/
|
|
160
|
+
openDialog() {
|
|
161
|
+
this.defaultTrigger = document.activeElement;
|
|
162
|
+
|
|
163
|
+
setTimeout(() => {
|
|
164
|
+
this.focus();
|
|
165
|
+
|
|
166
|
+
this.handleFocusLoss();
|
|
167
|
+
}, FOCUS_TIMEOUT);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* @private
|
|
172
|
+
* @returns {void}
|
|
173
|
+
*/
|
|
174
|
+
closeDialog() {
|
|
175
|
+
this.dispatchToggleEvent();
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* @private
|
|
180
|
+
* @returns {void}
|
|
181
|
+
*/
|
|
182
|
+
dispatchToggleEvent() {
|
|
183
|
+
// replace with Event constructor once IE support dropped
|
|
184
|
+
const toggleEvent = document.createEvent("HTMLEvents");
|
|
185
|
+
|
|
186
|
+
toggleEvent.initEvent("toggle", true, false);
|
|
187
|
+
this.dispatchEvent(toggleEvent);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* @private
|
|
192
|
+
* @returns {void} Determines if dropdown bib should be closed on focus change.
|
|
193
|
+
*/
|
|
194
|
+
handleFocusLoss() {
|
|
195
|
+
const focusable = [...this.querySelectorAll('button, auro-button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])')];
|
|
196
|
+
|
|
197
|
+
const firstFocusableElement = focusable[0];
|
|
198
|
+
const lastFocusableElement = focusable[focusable.length - 1];
|
|
199
|
+
|
|
200
|
+
const closeButton = this.shadowRoot.getElementById('dialog-close');
|
|
201
|
+
|
|
202
|
+
lastFocusableElement.addEventListener('focusout', () => {
|
|
203
|
+
if (closeButton !== null) { // eslint-disable-line no-negated-condition
|
|
204
|
+
closeButton.focus();
|
|
205
|
+
} else {
|
|
206
|
+
firstFocusableElement.focus();
|
|
207
|
+
}
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* @private
|
|
213
|
+
* @returns {void}
|
|
214
|
+
*/
|
|
215
|
+
handleOverlayClick() {
|
|
216
|
+
if (this.open && !this.modal) {
|
|
217
|
+
this.handleCloseButtonClick();
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* @private
|
|
223
|
+
* @returns {void}
|
|
224
|
+
*/
|
|
225
|
+
handleCloseButtonClick() {
|
|
226
|
+
this.open = false;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* @private
|
|
231
|
+
* @param {KeyboardEvent} event - The keyboard event containing the key and keyCode.
|
|
232
|
+
* @returns {void}
|
|
233
|
+
*/
|
|
234
|
+
handleKeydown({ key, keyCode }) {
|
|
235
|
+
if (this.open && !this.modal && (key === 'Escape' || keyCode === ESCAPE_KEYCODE)) {
|
|
236
|
+
this.open = false;
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
* Focus the dialog.
|
|
242
|
+
* @private
|
|
243
|
+
* @returns {void}
|
|
244
|
+
*/
|
|
245
|
+
focus() {
|
|
246
|
+
if (this.open) {
|
|
247
|
+
this.dialog.focus();
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
static get styles() {
|
|
252
|
+
return [
|
|
253
|
+
styleCss,
|
|
254
|
+
styleCssFixed,
|
|
255
|
+
styleUnformattedCss,
|
|
256
|
+
styleUnformattedCssFixed
|
|
257
|
+
];
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
/**
|
|
261
|
+
* @private
|
|
262
|
+
* @returns {TemplateResult} - The close button template.
|
|
263
|
+
*/
|
|
264
|
+
getCloseButton() {
|
|
265
|
+
return this.modal
|
|
266
|
+
? x``
|
|
267
|
+
: x`
|
|
268
|
+
<button class="dialog-header--action" id="dialog-close" @click="${this.handleCloseButtonClick}" part="close-button">
|
|
269
|
+
<span>${this.svg}</span>
|
|
270
|
+
<span class="util_displayHiddenVisually">Close</span>
|
|
271
|
+
</button>
|
|
272
|
+
`;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
render() {
|
|
276
|
+
const classes = {
|
|
277
|
+
'dialogOverlay': true,
|
|
278
|
+
'dialogOverlay--modal': this.modal && this.open,
|
|
279
|
+
'dialogOverlay--open': this.open,
|
|
280
|
+
'util_displayHidden': !this.open
|
|
281
|
+
},
|
|
282
|
+
|
|
283
|
+
contentClasses = {
|
|
284
|
+
'dialog': true,
|
|
285
|
+
'dialog--open': this.open
|
|
286
|
+
};
|
|
287
|
+
|
|
288
|
+
return x`
|
|
289
|
+
<div class="${e(classes)}" id="dialog-overlay" part="dialog-overlay" @click=${this.handleOverlayClick}></div>
|
|
290
|
+
|
|
291
|
+
<div role="dialog" id="dialog" class="${e(contentClasses)}" part="dialog" aria-labelledby="dialog-header" tabindex="-1">
|
|
292
|
+
${this.unformatted
|
|
293
|
+
? x`
|
|
294
|
+
<slot name="content"></slot>
|
|
295
|
+
${this.getCloseButton()}
|
|
296
|
+
`
|
|
297
|
+
: x`
|
|
298
|
+
<div class="dialog-header" part="dialog-header">
|
|
299
|
+
<h1 class="heading heading--700 util_stackMarginNone--top" id="dialog-header">
|
|
300
|
+
<slot name="header">Default header ...</slot>
|
|
301
|
+
</h1>
|
|
302
|
+
${this.getCloseButton()}
|
|
303
|
+
</div>
|
|
304
|
+
<div class="dialog-content" part="dialog-content">
|
|
305
|
+
<slot name="content"></slot>
|
|
306
|
+
</div>
|
|
307
|
+
<div class="dialog-footer" id="footerWrapper" part="dialog-footer">
|
|
308
|
+
<slot name="footer" id="footer"></slot>
|
|
309
|
+
</div>
|
|
310
|
+
`
|
|
311
|
+
}
|
|
312
|
+
</div>
|
|
313
|
+
`;
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
// Copyright (c) 2024 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
318
|
+
// See LICENSE in the project root for license information.
|
|
319
|
+
|
|
320
|
+
|
|
321
|
+
// build the component class
|
|
322
|
+
class AuroDialog extends ComponentBase {
|
|
323
|
+
// constructor() {
|
|
324
|
+
// super();
|
|
325
|
+
// }
|
|
326
|
+
|
|
327
|
+
// function to define props used within the scope of this component
|
|
328
|
+
static get properties() {
|
|
329
|
+
return {
|
|
330
|
+
...super.properties,
|
|
331
|
+
// use custom accessors on base class
|
|
332
|
+
open: {
|
|
333
|
+
...super.properties.open,
|
|
334
|
+
noAccessor: true
|
|
335
|
+
}
|
|
336
|
+
};
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
static get styles() {
|
|
340
|
+
return [super.styles];
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
/* istanbul ignore else */
|
|
345
|
+
// define the name of the custom component
|
|
346
|
+
if (!customElements.get("auro-dialog")) {
|
|
347
|
+
customElements.define("auro-dialog", AuroDialog);
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
/**
|
|
351
|
+
* Register Custom Element.
|
|
352
|
+
* @param {Object} name - Name to use for custom element.
|
|
353
|
+
* @returns {void}
|
|
354
|
+
*/
|
|
355
|
+
const registerComponent = (name = 'custom-dialog') => {
|
|
356
|
+
// alias definition
|
|
357
|
+
if (!customElements.get(name)) {
|
|
358
|
+
customElements.define(name, class extends AuroDialog {});
|
|
359
|
+
}
|
|
360
|
+
};
|
|
361
|
+
|
|
362
|
+
export { registerComponent };
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* auro-dialog appear above the page and require the user's attention.
|
|
3
|
+
*
|
|
4
|
+
* @attr {Boolean} modal - Modal dialog restricts the user to take an action (no default close actions)
|
|
5
|
+
* @attr {Boolean} fixed - Uses fixed pixel values for element shape
|
|
6
|
+
* @attr {Boolean} unformatted - Unformatted dialog window, edge-to-edge fill for content
|
|
7
|
+
* @attr {Boolean} sm - Sets dialog box to small style. Adding both sm and lg will set the dialog to sm for desktop and lg for mobile.
|
|
8
|
+
* @attr {Boolean} md - Sets dialog box to medium style. Adding both md and lg will set the dialog to md for desktop and lg for mobile.
|
|
9
|
+
* @attr {Boolean} onDark - Sets close icon to white for dark backgrounds
|
|
10
|
+
* @attr {Boolean} open - Sets state of dialog to open
|
|
11
|
+
* @prop {HTMLElement} triggerElement - The element to focus when the dialog is closed. If not set, defaults to the value of document.activeElement when the dialog is opened.
|
|
12
|
+
* @slot header - Text to display as the header of the modal
|
|
13
|
+
* @slot content - Injects content into the body of the modal
|
|
14
|
+
* @slot footer - Used for action options, e.g. buttons
|
|
15
|
+
* @function toggleViewable - toggles the 'open' property on the element
|
|
16
|
+
* @event toggle - Event fires when the element is closed
|
|
17
|
+
* @csspart close-button - adjust position of the close X icon in the dialog window
|
|
18
|
+
* @csspart dialog-overlay - apply CSS on the overlay of the dialog
|
|
19
|
+
* @csspart dialog - apply CSS to the entire dialog
|
|
20
|
+
* @csspart dialog-header - apply CSS to the header of the dialog
|
|
21
|
+
* @csspart dialog-content - apply CSS to the content of the dialog
|
|
22
|
+
* @csspart dialog-footer - apply CSS to the footer of the dialog
|
|
23
|
+
*/
|
|
24
|
+
export default class ComponentBase extends LitElement {
|
|
25
|
+
static get properties(): {
|
|
26
|
+
modal: {
|
|
27
|
+
type: BooleanConstructor;
|
|
28
|
+
};
|
|
29
|
+
unformatted: {
|
|
30
|
+
type: BooleanConstructor;
|
|
31
|
+
reflect: boolean;
|
|
32
|
+
};
|
|
33
|
+
open: {
|
|
34
|
+
type: BooleanConstructor;
|
|
35
|
+
reflect: boolean;
|
|
36
|
+
};
|
|
37
|
+
triggerElement: {
|
|
38
|
+
attribute: boolean;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
static get styles(): import("lit").CSSResult[];
|
|
42
|
+
/**
|
|
43
|
+
* @private
|
|
44
|
+
*/
|
|
45
|
+
private dom;
|
|
46
|
+
/**
|
|
47
|
+
* @private
|
|
48
|
+
*/
|
|
49
|
+
private svg;
|
|
50
|
+
modal: boolean;
|
|
51
|
+
unformatted: boolean;
|
|
52
|
+
firstUpdated(): void;
|
|
53
|
+
dialog: HTMLElement;
|
|
54
|
+
/**
|
|
55
|
+
* LitElement lifecycle method. Called after the DOM has been updated.
|
|
56
|
+
* @param {Map<string, any>} changedProperties - Keys are the names of changed properties, values are the corresponding previous values.
|
|
57
|
+
* @returns {void}
|
|
58
|
+
*/
|
|
59
|
+
updated(changedProperties: Map<string, any>): void;
|
|
60
|
+
keydownEventHandler: any;
|
|
61
|
+
/**
|
|
62
|
+
* @private
|
|
63
|
+
* @returns {void}
|
|
64
|
+
*/
|
|
65
|
+
private openDialog;
|
|
66
|
+
defaultTrigger: Element;
|
|
67
|
+
/**
|
|
68
|
+
* @private
|
|
69
|
+
* @returns {void}
|
|
70
|
+
*/
|
|
71
|
+
private closeDialog;
|
|
72
|
+
/**
|
|
73
|
+
* @private
|
|
74
|
+
* @returns {void}
|
|
75
|
+
*/
|
|
76
|
+
private dispatchToggleEvent;
|
|
77
|
+
/**
|
|
78
|
+
* @private
|
|
79
|
+
* @returns {void} Determines if dropdown bib should be closed on focus change.
|
|
80
|
+
*/
|
|
81
|
+
private handleFocusLoss;
|
|
82
|
+
/**
|
|
83
|
+
* @private
|
|
84
|
+
* @returns {void}
|
|
85
|
+
*/
|
|
86
|
+
private handleOverlayClick;
|
|
87
|
+
/**
|
|
88
|
+
* @private
|
|
89
|
+
* @returns {void}
|
|
90
|
+
*/
|
|
91
|
+
private handleCloseButtonClick;
|
|
92
|
+
open: boolean;
|
|
93
|
+
/**
|
|
94
|
+
* @private
|
|
95
|
+
* @param {KeyboardEvent} event - The keyboard event containing the key and keyCode.
|
|
96
|
+
* @returns {void}
|
|
97
|
+
*/
|
|
98
|
+
private handleKeydown;
|
|
99
|
+
/**
|
|
100
|
+
* Focus the dialog.
|
|
101
|
+
* @private
|
|
102
|
+
* @returns {void}
|
|
103
|
+
*/
|
|
104
|
+
private focus;
|
|
105
|
+
/**
|
|
106
|
+
* @private
|
|
107
|
+
* @returns {TemplateResult} - The close button template.
|
|
108
|
+
*/
|
|
109
|
+
private getCloseButton;
|
|
110
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
111
|
+
}
|
|
112
|
+
import { LitElement } from "lit";
|
|
113
|
+
//# sourceMappingURL=componentBase.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"componentBase.d.ts","sourceRoot":"","sources":["../src/componentBase.js"],"names":[],"mappings":"AAsBA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH;IAkBE;;;;;;;;;;;;;;;MAeC;IAsID,+CAOC;IA1KC;;OAEG;IACH,YAAsE;IAEtE;;OAEG;IACH,YAAmC;IAEnC,eAAkB;IAClB,qBAAwB;IAoB1B,qBASC;IALC,oBAAsD;IAOxD;;;;OAIG;IACH,2BAHW,IAAI,MAAM,EAAE,GAAG,CAAC,GACd,IAAI,CAUhB;IAIC,yBAAwD;IAS1D;;;OAGG;IACH,mBAQC;IAPC,wBAA4C;IAS9C;;;OAGG;IACH,oBAEC;IAED;;;OAGG;IACH,4BAMC;IAED;;;OAGG;IACH,wBAeC;IAED;;;OAGG;IACH,2BAIC;IAED;;;OAGG;IACH,+BAEC;IADC,cAAiB;IAGnB;;;;OAIG;IACH,sBAIC;IAED;;;;OAIG;IACH,cAIC;IAWD;;;OAGG;IACH,uBASC;IAED,+CAuCC;CACF;2BA9QgC,KAAK"}
|