@telia-ace/widget-components-area-flamingo 1.0.13 → 1.1.12-rc.10
Sign up to get free protection for your applications and to get access to all the features.
- package/area-24a6c0a9.mjs +1266 -0
- package/area-component.d.ts +2 -0
- package/area-f6373f40.js +264 -0
- package/area.d.ts +9 -0
- package/get-css-props.d.ts +5 -0
- package/{dist/index-9688347a-02584d39.js → index-5087564d.mjs} +126 -127
- package/index-6dd00f59.js +1 -0
- package/index.d.ts +2 -0
- package/index.js +1 -0
- package/index.mjs +6 -0
- package/package.json +7 -41
- package/dist/area-3c634387.js +0 -752
- package/dist/area-3c634387.js.map +0 -1
- package/dist/area-component.d.ts +0 -28
- package/dist/area-component.d.ts.map +0 -1
- package/dist/area.d.ts +0 -10
- package/dist/area.d.ts.map +0 -1
- package/dist/index-9688347a-02584d39.js.map +0 -1
- package/dist/index-dccce6e5.js +0 -2312
- package/dist/index-dccce6e5.js.map +0 -1
- package/dist/index.d.ts +0 -3
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -5
- package/dist/index.js.map +0 -1
package/area-f6373f40.js
ADDED
@@ -0,0 +1,264 @@
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});/**
|
2
|
+
* @license
|
3
|
+
* Copyright 2019 Google LLC
|
4
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
5
|
+
*/const B=globalThis,Q=B.ShadowRoot&&(B.ShadyCSS===void 0||B.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,X=Symbol(),nt=new WeakMap;let $t=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==X)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(Q&&t===void 0){const s=e!==void 0&&e.length===1;s&&(t=nt.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&nt.set(e,t))}return t}toString(){return this.cssText}};const Tt=i=>new $t(typeof i=="string"?i:i+"",void 0,X),S=(i,...t)=>{const e=i.length===1?i[0]:t.reduce((s,r,n)=>s+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(r)+i[n+1],i[0]);return new $t(e,i,X)},Ut=(i,t)=>{if(Q)i.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(const e of t){const s=document.createElement("style"),r=B.litNonce;r!==void 0&&s.setAttribute("nonce",r),s.textContent=e.cssText,i.appendChild(s)}},ot=Q?i=>i:i=>i instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return Tt(e)})(i):i;/**
|
6
|
+
* @license
|
7
|
+
* Copyright 2017 Google LLC
|
8
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
9
|
+
*/const{is:Mt,defineProperty:Nt,getOwnPropertyDescriptor:kt,getOwnPropertyNames:Ht,getOwnPropertySymbols:Rt,getPrototypeOf:Lt}=Object,_=globalThis,at=_.trustedTypes,Dt=at?at.emptyScript:"",Y=_.reactiveElementPolyfillSupport,O=(i,t)=>i,I={toAttribute(i,t){switch(t){case Boolean:i=i?Dt:null;break;case Object:case Array:i=i==null?i:JSON.stringify(i)}return i},fromAttribute(i,t){let e=i;switch(t){case Boolean:e=i!==null;break;case Number:e=i===null?null:Number(i);break;case Object:case Array:try{e=JSON.parse(i)}catch{e=null}}return e}},tt=(i,t)=>!Mt(i,t),ct={attribute:!0,type:String,converter:I,reflect:!1,hasChanged:tt};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),_.litPropertyMetadata??(_.litPropertyMetadata=new WeakMap);class E extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??(this.l=[])).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=ct){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){const s=Symbol(),r=this.getPropertyDescriptor(t,s,e);r!==void 0&&Nt(this.prototype,t,r)}}static getPropertyDescriptor(t,e,s){const{get:r,set:n}=kt(this.prototype,t)??{get(){return this[e]},set(o){this[e]=o}};return{get(){return r==null?void 0:r.call(this)},set(o){const c=r==null?void 0:r.call(this);n.call(this,o),this.requestUpdate(t,c,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??ct}static _$Ei(){if(this.hasOwnProperty(O("elementProperties")))return;const t=Lt(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(O("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(O("properties"))){const e=this.properties,s=[...Ht(e),...Rt(e)];for(const r of s)this.createProperty(r,e[r])}const t=this[Symbol.metadata];if(t!==null){const e=litPropertyMetadata.get(t);if(e!==void 0)for(const[s,r]of e)this.elementProperties.set(s,r)}this._$Eh=new Map;for(const[e,s]of this.elementProperties){const r=this._$Eu(e,s);r!==void 0&&this._$Eh.set(r,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const s=new Set(t.flat(1/0).reverse());for(const r of s)e.unshift(ot(r))}else t!==void 0&&e.push(ot(t));return e}static _$Eu(t,e){const s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var t;this._$Eg=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),(t=this.constructor.l)==null||t.forEach(e=>e(this))}addController(t){var e;(this._$ES??(this._$ES=[])).push(t),this.renderRoot!==void 0&&this.isConnected&&((e=t.hostConnected)==null||e.call(t))}removeController(t){var e;(e=this._$ES)==null||e.splice(this._$ES.indexOf(t)>>>0,1)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Ut(t,this.constructor.elementStyles),t}connectedCallback(){var t;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$ES)==null||t.forEach(e=>{var s;return(s=e.hostConnected)==null?void 0:s.call(e)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$ES)==null||t.forEach(e=>{var s;return(s=e.hostDisconnected)==null?void 0:s.call(e)})}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EO(t,e){var n;const s=this.constructor.elementProperties.get(t),r=this.constructor._$Eu(t,s);if(r!==void 0&&s.reflect===!0){const o=(((n=s.converter)==null?void 0:n.toAttribute)!==void 0?s.converter:I).toAttribute(e,s.type);this._$Em=t,o==null?this.removeAttribute(r):this.setAttribute(r,o),this._$Em=null}}_$AK(t,e){var n;const s=this.constructor,r=s._$Eh.get(t);if(r!==void 0&&this._$Em!==r){const o=s.getPropertyOptions(r),c=typeof o.converter=="function"?{fromAttribute:o.converter}:((n=o.converter)==null?void 0:n.fromAttribute)!==void 0?o.converter:I;this._$Em=r,this[r]=c.fromAttribute(e,o.type),this._$Em=null}}requestUpdate(t,e,s,r=!1,n){if(t!==void 0){if(s??(s=this.constructor.getPropertyOptions(t)),!(s.hasChanged??tt)(r?n:this[t],e))return;this.C(t,e,s)}this.isUpdatePending===!1&&(this._$Eg=this._$EP())}C(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$Em!==t&&(this._$Ej??(this._$Ej=new Set)).add(t)}async _$EP(){this.isUpdatePending=!0;try{await this._$Eg}catch(e){Promise.reject(e)}const t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var s;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this._$Ep){for(const[n,o]of this._$Ep)this[n]=o;this._$Ep=void 0}const r=this.constructor.elementProperties;if(r.size>0)for(const[n,o]of r)o.wrapped!==!0||this._$AL.has(n)||this[n]===void 0||this.C(n,this[n],o)}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),(s=this._$ES)==null||s.forEach(r=>{var n;return(n=r.hostUpdate)==null?void 0:n.call(r)}),this.update(e)):this._$ET()}catch(r){throw t=!1,this._$ET(),r}t&&this._$AE(e)}willUpdate(t){}_$AE(t){var e;(e=this._$ES)==null||e.forEach(s=>{var r;return(r=s.hostUpdated)==null?void 0:r.call(s)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$ET(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$Eg}shouldUpdate(t){return!0}update(t){this._$Ej&&(this._$Ej=this._$Ej.forEach(e=>this._$EO(e,this[e]))),this._$ET()}updated(t){}firstUpdated(t){}}E.elementStyles=[],E.shadowRootOptions={mode:"open"},E[O("elementProperties")]=new Map,E[O("finalized")]=new Map,Y==null||Y({ReactiveElement:E}),(_.reactiveElementVersions??(_.reactiveElementVersions=[])).push("2.0.1");/**
|
10
|
+
* @license
|
11
|
+
* Copyright 2017 Google LLC
|
12
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
13
|
+
*/const T=globalThis,G=T.trustedTypes,ht=G?G.createPolicy("lit-html",{createHTML:i=>i}):void 0,mt="$lit$",m=`lit$${(Math.random()+"").slice(9)}$`,_t="?"+m,jt=`<${_t}>`,b=document,M=()=>b.createComment(""),N=i=>i===null||typeof i!="object"&&typeof i!="function",yt=Array.isArray,zt=i=>yt(i)||typeof(i==null?void 0:i[Symbol.iterator])=="function",F=`[
|
14
|
+
\f\r]`,P=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,lt=/-->/g,dt=/>/g,y=RegExp(`>|${F}(?:([^\\s"'>=/]+)(${F}*=${F}*(?:[^
|
15
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),pt=/'/g,ut=/"/g,vt=/^(?:script|style|textarea|title)$/i,Bt=i=>(t,...e)=>({_$litType$:i,strings:t,values:e}),k=Bt(1),w=Symbol.for("lit-noChange"),l=Symbol.for("lit-nothing"),gt=new WeakMap,A=b.createTreeWalker(b,129);function At(i,t){if(!Array.isArray(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return ht!==void 0?ht.createHTML(t):t}const It=(i,t)=>{const e=i.length-1,s=[];let r,n=t===2?"<svg>":"",o=P;for(let c=0;c<e;c++){const a=i[c];let d,p,h=-1,g=0;for(;g<a.length&&(o.lastIndex=g,p=o.exec(a),p!==null);)g=o.lastIndex,o===P?p[1]==="!--"?o=lt:p[1]!==void 0?o=dt:p[2]!==void 0?(vt.test(p[2])&&(r=RegExp("</"+p[2],"g")),o=y):p[3]!==void 0&&(o=y):o===y?p[0]===">"?(o=r??P,h=-1):p[1]===void 0?h=-2:(h=o.lastIndex-p[2].length,d=p[1],o=p[3]===void 0?y:p[3]==='"'?ut:pt):o===ut||o===pt?o=y:o===lt||o===dt?o=P:(o=y,r=void 0);const $=o===y&&i[c+1].startsWith("/>")?" ":"";n+=o===P?a+jt:h>=0?(s.push(d),a.slice(0,h)+mt+a.slice(h)+m+$):a+m+(h===-2?c:$)}return[At(i,n+(i[e]||"<?>")+(t===2?"</svg>":"")),s]};class H{constructor({strings:t,_$litType$:e},s){let r;this.parts=[];let n=0,o=0;const c=t.length-1,a=this.parts,[d,p]=It(t,e);if(this.el=H.createElement(d,s),A.currentNode=this.el.content,e===2){const h=this.el.content.firstChild;h.replaceWith(...h.childNodes)}for(;(r=A.nextNode())!==null&&a.length<c;){if(r.nodeType===1){if(r.hasAttributes())for(const h of r.getAttributeNames())if(h.endsWith(mt)){const g=p[o++],$=r.getAttribute(h).split(m),j=/([.?@])?(.*)/.exec(g);a.push({type:1,index:n,name:j[2],strings:$,ctor:j[1]==="."?Wt:j[1]==="?"?Vt:j[1]==="@"?qt:V}),r.removeAttribute(h)}else h.startsWith(m)&&(a.push({type:6,index:n}),r.removeAttribute(h));if(vt.test(r.tagName)){const h=r.textContent.split(m),g=h.length-1;if(g>0){r.textContent=G?G.emptyScript:"";for(let $=0;$<g;$++)r.append(h[$],M()),A.nextNode(),a.push({type:2,index:++n});r.append(h[g],M())}}}else if(r.nodeType===8)if(r.data===_t)a.push({type:2,index:n});else{let h=-1;for(;(h=r.data.indexOf(m,h+1))!==-1;)a.push({type:7,index:n}),h+=m.length-1}n++}}static createElement(t,e){const s=b.createElement("template");return s.innerHTML=t,s}}function C(i,t,e=i,s){var o,c;if(t===w)return t;let r=s!==void 0?(o=e._$Co)==null?void 0:o[s]:e._$Cl;const n=N(t)?void 0:t._$litDirective$;return(r==null?void 0:r.constructor)!==n&&((c=r==null?void 0:r._$AO)==null||c.call(r,!1),n===void 0?r=void 0:(r=new n(i),r._$AT(i,e,s)),s!==void 0?(e._$Co??(e._$Co=[]))[s]=r:e._$Cl=r),r!==void 0&&(t=C(i,r._$AS(i,t.values),r,s)),t}class Gt{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:s}=this._$AD,r=((t==null?void 0:t.creationScope)??b).importNode(e,!0);A.currentNode=r;let n=A.nextNode(),o=0,c=0,a=s[0];for(;a!==void 0;){if(o===a.index){let d;a.type===2?d=new R(n,n.nextSibling,this,t):a.type===1?d=new a.ctor(n,a.name,a.strings,this,t):a.type===6&&(d=new Yt(n,this,t)),this._$AV.push(d),a=s[++c]}o!==(a==null?void 0:a.index)&&(n=A.nextNode(),o++)}return A.currentNode=b,r}p(t){let e=0;for(const s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}}class R{get _$AU(){var t;return((t=this._$AM)==null?void 0:t._$AU)??this._$Cv}constructor(t,e,s,r){this.type=2,this._$AH=l,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=r,this._$Cv=(r==null?void 0:r.isConnected)??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return e!==void 0&&(t==null?void 0:t.nodeType)===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=C(this,t,e),N(t)?t===l||t==null||t===""?(this._$AH!==l&&this._$AR(),this._$AH=l):t!==this._$AH&&t!==w&&this._(t):t._$litType$!==void 0?this.g(t):t.nodeType!==void 0?this.$(t):zt(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!==l&&N(this._$AH)?this._$AA.nextSibling.data=t:this.$(b.createTextNode(t)),this._$AH=t}g(t){var n;const{values:e,_$litType$:s}=t,r=typeof s=="number"?this._$AC(t):(s.el===void 0&&(s.el=H.createElement(At(s.h,s.h[0]),this.options)),s);if(((n=this._$AH)==null?void 0:n._$AD)===r)this._$AH.p(e);else{const o=new Gt(r,this),c=o.u(this.options);o.p(e),this.$(c),this._$AH=o}}_$AC(t){let e=gt.get(t.strings);return e===void 0&>.set(t.strings,e=new H(t)),e}T(t){yt(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let s,r=0;for(const n of t)r===e.length?e.push(s=new R(this.k(M()),this.k(M()),this,this.options)):s=e[r],s._$AI(n),r++;r<e.length&&(this._$AR(s&&s._$AB.nextSibling,r),e.length=r)}_$AR(t=this._$AA.nextSibling,e){var s;for((s=this._$AP)==null?void 0:s.call(this,!1,!0,e);t&&t!==this._$AB;){const r=t.nextSibling;t.remove(),t=r}}setConnected(t){var e;this._$AM===void 0&&(this._$Cv=t,(e=this._$AP)==null||e.call(this,t))}}class V{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,r,n){this.type=1,this._$AH=l,this._$AN=void 0,this.element=t,this.name=e,this._$AM=r,this.options=n,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=l}_$AI(t,e=this,s,r){const n=this.strings;let o=!1;if(n===void 0)t=C(this,t,e,0),o=!N(t)||t!==this._$AH&&t!==w,o&&(this._$AH=t);else{const c=t;let a,d;for(t=n[0],a=0;a<n.length-1;a++)d=C(this,c[s+a],e,a),d===w&&(d=this._$AH[a]),o||(o=!N(d)||d!==this._$AH[a]),d===l?t=l:t!==l&&(t+=(d??"")+n[a+1]),this._$AH[a]=d}o&&!r&&this.O(t)}O(t){t===l?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class Wt extends V{constructor(){super(...arguments),this.type=3}O(t){this.element[this.name]=t===l?void 0:t}}class Vt extends V{constructor(){super(...arguments),this.type=4}O(t){this.element.toggleAttribute(this.name,!!t&&t!==l)}}class qt extends V{constructor(t,e,s,r,n){super(t,e,s,r,n),this.type=5}_$AI(t,e=this){if((t=C(this,t,e,0)??l)===w)return;const s=this._$AH,r=t===l&&s!==l||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,n=t!==l&&(s===l||r);r&&this.element.removeEventListener(this.name,this,s),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e;typeof this._$AH=="function"?this._$AH.call(((e=this.options)==null?void 0:e.host)??this.element,t):this._$AH.handleEvent(t)}}class Yt{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){C(this,t)}}const J=T.litHtmlPolyfillSupport;J==null||J(H,R),(T.litHtmlVersions??(T.litHtmlVersions=[])).push("3.0.2");const Ft=(i,t,e)=>{const s=(e==null?void 0:e.renderBefore)??t;let r=s._$litPart$;if(r===void 0){const n=(e==null?void 0:e.renderBefore)??null;s._$litPart$=r=new R(t.insertBefore(M(),n),n,void 0,e??{})}return r._$AI(i),r};/**
|
16
|
+
* @license
|
17
|
+
* Copyright 2017 Google LLC
|
18
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
19
|
+
*/let f=class extends E{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e;const t=super.createRenderRoot();return(e=this.renderOptions).renderBefore??(e.renderBefore=t.firstChild),t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=Ft(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this._$Do)==null||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Do)==null||t.setConnected(!1)}render(){return w}};var ft;f._$litElement$=!0,f.finalized=!0,(ft=globalThis.litElementHydrateSupport)==null||ft.call(globalThis,{LitElement:f});const K=globalThis.litElementPolyfillSupport;K==null||K({LitElement:f});(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.0.1");/**
|
20
|
+
* @license
|
21
|
+
* Copyright 2021 Google LLC
|
22
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
23
|
+
*/function*bt(i,t){if(i!==void 0){let e=0;for(const s of i)yield t(s,e++)}}/**
|
24
|
+
* @license
|
25
|
+
* Copyright 2017 Google LLC
|
26
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
27
|
+
*/const Jt={attribute:!0,type:String,converter:I,reflect:!1,hasChanged:tt},Kt=(i=Jt,t,e)=>{const{kind:s,metadata:r}=e;let n=globalThis.litPropertyMetadata.get(r);if(n===void 0&&globalThis.litPropertyMetadata.set(r,n=new Map),n.set(e.name,i),s==="accessor"){const{name:o}=e;return{set(c){const a=t.get.call(this);t.set.call(this,c),this.requestUpdate(o,a,i)},init(c){return c!==void 0&&this.C(o,void 0,i),c}}}if(s==="setter"){const{name:o}=e;return function(c){const a=this[o];t.call(this,c),this.requestUpdate(o,a,i)}}throw Error("Unsupported decorator location: "+s)};function u(i){return(t,e)=>typeof e=="object"?Kt(i,t,e):((s,r,n)=>{const o=r.hasOwnProperty(n);return r.constructor.createProperty(n,o?{...s,wrapped:!0}:s),o?Object.getOwnPropertyDescriptor(r,n):void 0})(i,t,e)}/**
|
28
|
+
* @license
|
29
|
+
* Copyright 2017 Google LLC
|
30
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
31
|
+
*/function L(i){return u({...i,state:!0,attribute:!1})}/**
|
32
|
+
* @license
|
33
|
+
* Copyright 2017 Google LLC
|
34
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
35
|
+
*/const wt={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},xt=i=>(...t)=>({_$litDirective$:i,values:t});class Et{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,s){this._$Ct=t,this._$AM=e,this._$Ci=s}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}/**
|
36
|
+
* @license
|
37
|
+
* Copyright 2018 Google LLC
|
38
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
39
|
+
*/const Zt=xt(class extends Et{constructor(i){var t;if(super(i),i.type!==wt.ATTRIBUTE||i.name!=="class"||((t=i.strings)==null?void 0:t.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(i){return" "+Object.keys(i).filter(t=>i[t]).join(" ")+" "}update(i,[t]){var s,r;if(this.it===void 0){this.it=new Set,i.strings!==void 0&&(this.st=new Set(i.strings.join(" ").split(/\s/).filter(n=>n!=="")));for(const n in t)t[n]&&!((s=this.st)!=null&&s.has(n))&&this.it.add(n);return this.render(t)}const e=i.element.classList;for(const n of this.it)n in t||(e.remove(n),this.it.delete(n));for(const n in t){const o=!!t[n];o===this.it.has(n)||(r=this.st)!=null&&r.has(n)||(o?(e.add(n),this.it.add(n)):(e.remove(n),this.it.delete(n)))}return w}}),z=(i,t,e)=>{i&&e.style.setProperty(t,i)},Ct=(i,t)=>{var e,s,r,n;z((e=i.colors)==null?void 0:e.primaryBackground,"--primary-background",t),z((s=i.colors)==null?void 0:s.textOnPrimaryBackground,"--text-on-primary-background",t),z((r=i.colors)==null?void 0:r.secondaryBackground,"--secondary-background",t),z((n=i.colors)==null?void 0:n.textOnSecondaryBackground,"--text-on-secondary-background",t)};var Qt=Object.defineProperty,Xt=Object.getOwnPropertyDescriptor,q=(i,t,e,s)=>{for(var r=s>1?void 0:s?Xt(t,e):t,n=i.length-1,o;n>=0;n--)(o=i[n])&&(r=(s?o(t,e,r):o(r))||r);return s&&r&&Qt(t,e,r),r};class x extends f{constructor(){super(...arguments),this.active=!1,this.loaded=!1}async connectedCallback(){super.connectedCallback(),this.icon=await this._renderSymbol(),this.loaded=!0,this._applyBranding()}_toggleActive(){var t;if(!((t=this.application)!=null&&t.root)){console.warn("Could not activate widget. No root element assigned to widget.");return}this.active=!this.active,this.active?this.application.appendToDOM():this.application.removeFromDOM()}_applyBranding(){var t;(t=this.application)!=null&&t.settings&&Ct(this.application.settings.branding,this)}async _renderSymbol(){var n;const t=(n=this.application)==null?void 0:n.triggerIcon;if(!t)return l;const e=async o=>await Promise.resolve().then(()=>require("./index-6dd00f59.js")).then(a=>a[o]),{type:s,content:r}=t;switch(s){case"Telia":{const o=await e(r);return o?k`<telia-icon
|
40
|
+
class="trigger-icon"
|
41
|
+
svg=${o.svg}
|
42
|
+
size="lg"
|
43
|
+
></telia-icon>`:l}default:return l}}render(){return k`<button
|
44
|
+
class=${Zt({trigger:!0,active:this.active,rendered:this.loaded})}
|
45
|
+
@click=${this._toggleActive}
|
46
|
+
>
|
47
|
+
${this.icon}
|
48
|
+
<span class="trigger-close">
|
49
|
+
<svg
|
50
|
+
width="18"
|
51
|
+
height="9"
|
52
|
+
viewBox="0 0 18 9"
|
53
|
+
fill="none"
|
54
|
+
xmlns="http://www.w3.org/2000/svg"
|
55
|
+
>
|
56
|
+
<path
|
57
|
+
d="M9 9C8.81794 9.00045 8.63759 8.96634 8.46939 8.89965C8.3012 8.83295 8.14851 8.735 8.02015 8.61145L0.194523 1.12367C0.068294 0.99862 -0.00155266 0.831133 2.61958e-05 0.657285C0.00160506 0.483436 0.0744832 0.317136 0.202964 0.194202C0.331445 0.0712675 0.505249 0.00153576 0.686941 2.50649e-05C0.868634 -0.00148563 1.04368 0.0653456 1.17437 0.186125L9 7.6739L16.8256 0.186125C16.9563 0.0653456 17.1314 -0.00148563 17.3131 2.50649e-05C17.4948 0.00153576 17.6686 0.0712675 17.797 0.194202C17.9255 0.317136 17.9984 0.483436 18 0.657285C18.0016 0.831133 17.9317 0.99862 17.8055 1.12367L9.97985 8.61145C9.85149 8.735 9.6988 8.83295 9.53061 8.89965C9.36241 8.96634 9.18206 9.00045 9 9Z"
|
58
|
+
fill="white"
|
59
|
+
/>
|
60
|
+
</svg>
|
61
|
+
</span>
|
62
|
+
<span class="trigger-loader">
|
63
|
+
<svg viewBox="25 25 50 50">
|
64
|
+
<circle
|
65
|
+
cx="50"
|
66
|
+
cy="50"
|
67
|
+
r="20"
|
68
|
+
fill="none"
|
69
|
+
stroke="#000"
|
70
|
+
stroke-width="2"
|
71
|
+
stroke-miterlimit="10"
|
72
|
+
/>
|
73
|
+
</svg>
|
74
|
+
</span>
|
75
|
+
</button>`}}x.styles=[S`
|
76
|
+
:host {
|
77
|
+
--voca-rem-multiplier: 0.625;
|
78
|
+
display: block;
|
79
|
+
box-sizing: border-box;
|
80
|
+
}
|
81
|
+
|
82
|
+
.trigger {
|
83
|
+
position: fixed;
|
84
|
+
transform: scale(0);
|
85
|
+
box-shadow: rgba(0, 0, 0, 0.16) 0px 5px 40px;
|
86
|
+
bottom: 20px;
|
87
|
+
right: 20px;
|
88
|
+
z-index: 5;
|
89
|
+
display: flex;
|
90
|
+
align-items: center;
|
91
|
+
justify-content: center;
|
92
|
+
border: none;
|
93
|
+
line-height: 55px;
|
94
|
+
height: 55px;
|
95
|
+
width: 55px;
|
96
|
+
border-radius: 55px;
|
97
|
+
cursor: pointer;
|
98
|
+
background-color: var(--trigger-bg, var(--primary-background));
|
99
|
+
font-family: Lato;
|
100
|
+
text-decoration: none;
|
101
|
+
border: 3px dashed transparent;
|
102
|
+
box-sizing: border-box;
|
103
|
+
transition: transform 200ms ease-out;
|
104
|
+
}
|
105
|
+
.trigger:hover {
|
106
|
+
transform: scale(1.1) !important;
|
107
|
+
}
|
108
|
+
.trigger.rendered {
|
109
|
+
transform: scale(1);
|
110
|
+
}
|
111
|
+
.trigger.active .trigger-icon {
|
112
|
+
opacity: 0;
|
113
|
+
transform: rotate(-180deg) scale(0);
|
114
|
+
}
|
115
|
+
.trigger.active .trigger-close {
|
116
|
+
opacity: 1;
|
117
|
+
transform: rotate(0deg) scale(1);
|
118
|
+
}
|
119
|
+
|
120
|
+
.trigger-icon {
|
121
|
+
display: inline-block;
|
122
|
+
line-height: inherit;
|
123
|
+
text-align: center;
|
124
|
+
opacity: 1;
|
125
|
+
transform: rotate(0deg) scale(1);
|
126
|
+
transition: opacity 200ms ease-out, transform 200ms ease-out;
|
127
|
+
color: var(--trigger-text-color, var(--text-on-primary-background));
|
128
|
+
}
|
129
|
+
.trigger-close {
|
130
|
+
opacity: 0;
|
131
|
+
transition: transform 200ms ease-out;
|
132
|
+
transform: rotate(180deg) scale(0);
|
133
|
+
position: absolute;
|
134
|
+
top: 0;
|
135
|
+
bottom: 0;
|
136
|
+
left: 0;
|
137
|
+
right: 0;
|
138
|
+
display: flex;
|
139
|
+
justify-content: center;
|
140
|
+
align-items: center;
|
141
|
+
fill: var(--trigger-text-color, var(--text-on-primary-background));
|
142
|
+
}
|
143
|
+
`];q([u({attribute:!1})],x.prototype,"application",2);q([L()],x.prototype,"active",2);q([L()],x.prototype,"loaded",2);q([L()],x.prototype,"icon",2);var te=Object.defineProperty,ee=Object.getOwnPropertyDescriptor,v=(i,t,e,s)=>{for(var r=s>1?void 0:s?ee(t,e):t,n=i.length-1,o;n>=0;n--)(o=i[n])&&(r=(s?o(t,e,r):o(r))||r);return s&&r&&te(t,e,r),r};const St=i=>{class t extends i{constructor(){super(...arguments),this.properties={},this.context={},this.layout={},this.nodes=[]}writeProperties(s){this.properties=s}writeLayout(s){this.layout=s}writeContext(s){this.context=s}addChild(s){s.parent=this,this.nodes.push(s)}connectedCallback(){super.connectedCallback(),this.renderRoot.host.style.setProperty("--width",this.layout.size==="full"?"var(--columns, 1)":`min(${this.layout.size||"var(--columns)"}, var(--columns))`)}}return t.styles=[S`
|
144
|
+
:host {
|
145
|
+
font-family: var(--font-family);
|
146
|
+
grid-column: span var(--width);
|
147
|
+
max-width: 100%;
|
148
|
+
overflow: hidden;
|
149
|
+
box-sizing: border-box;
|
150
|
+
display: block;
|
151
|
+
}
|
152
|
+
* {
|
153
|
+
box-sizing: border-box;
|
154
|
+
}
|
155
|
+
`],v([u()],t.prototype,"properties",2),v([u()],t.prototype,"context",2),v([u()],t.prototype,"layout",2),v([u()],t.prototype,"name",2),v([u()],t.prototype,"type",2),v([u({attribute:!1})],t.prototype,"application",2),v([u({attribute:!1})],t.prototype,"parent",2),t};class Pt extends St(f){render(){return k`Non resolved component`}}Pt.styles=[S`
|
156
|
+
:host {
|
157
|
+
display: block;
|
158
|
+
}
|
159
|
+
`];/**
|
160
|
+
* @license
|
161
|
+
* Copyright 2020 Google LLC
|
162
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
163
|
+
*/const se=i=>i.strings===void 0;/**
|
164
|
+
* @license
|
165
|
+
* Copyright 2017 Google LLC
|
166
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
167
|
+
*/const U=(i,t)=>{var s;const e=i._$AN;if(e===void 0)return!1;for(const r of e)(s=r._$AO)==null||s.call(r,t,!1),U(r,t);return!0},W=i=>{let t,e;do{if((t=i._$AM)===void 0)break;e=t._$AN,e.delete(i),i=t}while((e==null?void 0:e.size)===0)},Ot=i=>{for(let t;t=i._$AM;i=t){let e=t._$AN;if(e===void 0)t._$AN=e=new Set;else if(e.has(i))break;e.add(i),ne(t)}};function ie(i){this._$AN!==void 0?(W(this),this._$AM=i,Ot(this)):this._$AM=i}function re(i,t=!1,e=0){const s=this._$AH,r=this._$AN;if(r!==void 0&&r.size!==0)if(t)if(Array.isArray(s))for(let n=e;n<s.length;n++)U(s[n],!1),W(s[n]);else s!=null&&(U(s,!1),W(s));else U(this,i)}const ne=i=>{i.type==wt.CHILD&&(i._$AP??(i._$AP=re),i._$AQ??(i._$AQ=ie))};class oe extends Et{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,s){super._$AT(t,e,s),Ot(this),this.isConnected=t._$AU}_$AO(t,e=!0){var s,r;t!==this.isConnected&&(this.isConnected=t,t?(s=this.reconnected)==null||s.call(this):(r=this.disconnected)==null||r.call(this)),e&&(U(this,t),W(this))}setValue(t){if(se(this._$Ct))this._$Ct._$AI(t,this);else{const e=[...this._$Ct._$AH];e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}}/**
|
168
|
+
* @license
|
169
|
+
* Copyright 2020 Google LLC
|
170
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
171
|
+
*/const ae=()=>new ce;class ce{}const Z=new WeakMap,he=xt(class extends oe{render(i){return l}update(i,[t]){var s;const e=t!==this.G;return e&&this.G!==void 0&&this.ot(void 0),(e||this.rt!==this.lt)&&(this.G=t,this.ct=(s=i.options)==null?void 0:s.host,this.ot(this.lt=i.element)),l}ot(i){if(typeof this.G=="function"){const t=this.ct??globalThis;let e=Z.get(t);e===void 0&&(e=new WeakMap,Z.set(t,e)),e.get(this.G)!==void 0&&this.G.call(this.ct,void 0),e.set(this.G,i),i!==void 0&&this.G.call(this.ct,i)}else this.G.value=i}get rt(){var i,t;return typeof this.G=="function"?(i=Z.get(this.ct??globalThis))==null?void 0:i.get(this.G):(t=this.G)==null?void 0:t.value}disconnected(){this.rt===this.lt&&this.ot(void 0)}reconnected(){this.ot(this.lt)}});var et=(i=>(i.Inline="inline",i.Trigger="trigger",i))(et||{}),le=Object.defineProperty,de=Object.getOwnPropertyDescriptor,pe=(i,t,e,s)=>{for(var r=s>1?void 0:s?de(t,e):t,n=i.length-1,o;n>=0;n--)(o=i[n])&&(r=(s?o(t,e,r):o(r))||r);return s&&r&&le(t,e,r),r};class st extends f{constructor(){super(...arguments),this.nodes=[],this.wrapperRef=ae()}addChild(t){t.parent=this,this.nodes.push(t)}applyBranding(){if(this.wrapperRef.value){const t=this.application.settings;t!=null&&t.branding&&Ct(t.branding,this.wrapperRef.value)}}firstUpdated(t){this.applyBranding()}render(){return this.application.renderStrategy===et.Trigger&&this.renderRoot.host.classList.add("floating"),k`<div class="widget-container" ${he(this.wrapperRef)}>
|
172
|
+
${bt(this.nodes,t=>t)}
|
173
|
+
</div>`}}st.styles=S`
|
174
|
+
:host {
|
175
|
+
--font-family: TeliaSans, Helvetica, Arial, Lucida Grande, sans-serif;
|
176
|
+
--spacing-xs: 0.2rem;
|
177
|
+
--spacing-sm: 0.5rem;
|
178
|
+
--spacing-md: 1rem;
|
179
|
+
--spacing-lg: 1.2rem;
|
180
|
+
--spacing-xl: 1.8rem;
|
181
|
+
|
182
|
+
--text-color: #222222;
|
183
|
+
--link-color: #990ae3;
|
184
|
+
--gray-color: #f3f3f8;
|
185
|
+
--gray-dark-color: #a6a6a6;
|
186
|
+
|
187
|
+
--box-shadow: rgba(149, 157, 165, 0.2) 0px 8px 24px;
|
188
|
+
--border-radius: var(--spacing-sm);
|
189
|
+
--border-radius-sm: var(--spacing-sm);
|
190
|
+
}
|
191
|
+
:host {
|
192
|
+
--voca-rem-multiplier: 0.625;
|
193
|
+
box-sizing: border-box;
|
194
|
+
display: block;
|
195
|
+
}
|
196
|
+
|
197
|
+
:host(.floating) {
|
198
|
+
position: fixed;
|
199
|
+
z-index: 6;
|
200
|
+
inset: auto 20px 95px auto;
|
201
|
+
max-height: calc(100vh - 120px);
|
202
|
+
width: 400px;
|
203
|
+
height: 700px;
|
204
|
+
}
|
205
|
+
:host(.floating) .widget-container {
|
206
|
+
box-shadow: rgba(0, 0, 0, 0.16) 0px 5px 40px;
|
207
|
+
border-radius: 0.7rem;
|
208
|
+
}
|
209
|
+
:host(.inline) {
|
210
|
+
height: 100%;
|
211
|
+
position: fixed;
|
212
|
+
inset: 0 0 0 0;
|
213
|
+
}
|
214
|
+
|
215
|
+
* {
|
216
|
+
box-sizing: border-box;
|
217
|
+
}
|
218
|
+
.widget-container {
|
219
|
+
height: 100%;
|
220
|
+
background-color: var(--primary-background);
|
221
|
+
padding: 0 var(--spacing-sm);
|
222
|
+
}
|
223
|
+
.widget-container.expanded {
|
224
|
+
opacity: 1;
|
225
|
+
animation: slideUp 0.5s;
|
226
|
+
}
|
227
|
+
.widget-container.hidden {
|
228
|
+
opacity: 0;
|
229
|
+
animation: slideDown 0.5s;
|
230
|
+
}
|
231
|
+
@keyframes slideDown {
|
232
|
+
from {
|
233
|
+
transform: translateY(0);
|
234
|
+
opacity: 1;
|
235
|
+
}
|
236
|
+
to {
|
237
|
+
transform: translateY(100%);
|
238
|
+
opacity: 0;
|
239
|
+
}
|
240
|
+
}
|
241
|
+
@keyframes slideUp {
|
242
|
+
from {
|
243
|
+
transform: translateY(100%);
|
244
|
+
opacity: 0;
|
245
|
+
}
|
246
|
+
to {
|
247
|
+
transform: translateY(0);
|
248
|
+
opacity: 1;
|
249
|
+
}
|
250
|
+
}
|
251
|
+
`;pe([u({attribute:!1})],st.prototype,"application",2);var ue=Object.defineProperty,ge=Object.getOwnPropertyDescriptor,it=(i,t,e,s)=>{for(var r=s>1?void 0:s?ge(t,e):t,n=i.length-1,o;n>=0;n--)(o=i[n])&&(r=(s?o(t,e,r):o(r))||r);return s&&r&&ue(t,e,r),r};class D extends f{constructor(){super(),this.status="deactivated",this.addEventListener("environment-created",this.onEnvironmentCreated)}async connectedCallback(){super.connectedCallback(),await this.getGlobalEnvironment()}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("environment-created",this.onEnvironmentCreated)}async onEnvironmentCreated(t){this.widget=t.detail.widget,await this.activate(),this.requestUpdate()}async activate(){this.widget&&(await this.widget.activate(),this.status="activated")}async getGlobalEnvironment(){const t=globalThis.widgets;t&&(this.widget=t.applications.find(e=>e.name===this.name),await this.activate())}render(){if(!this.widget||this.status!=="activated")return l;if(this.widget.renderStrategy===et.Trigger){const t=new x;return t.application=this.widget,t}return this.widget.render()}}D.styles=[S`
|
252
|
+
:host {
|
253
|
+
display: block;
|
254
|
+
}
|
255
|
+
`];it([u({attribute:!0})],D.prototype,"name",2);it([L()],D.prototype,"widget",2);it([L()],D.prototype,"status",2);customElements.get("ace-trigger")||customElements.define("ace-trigger",x);customElements.get("ace-unresolved-component")||customElements.define("ace-unresolved-component",Pt);customElements.get("ace-wrapper")||customElements.define("ace-wrapper",st);customElements.get("ace-widget")||customElements.define("ace-widget",D);const fe=i=>{const t={};return Object.keys(i).forEach(e=>{e.indexOf("css-")>-1&&(t[e]=i[e])}),t},$e=(i,t)=>{const e=fe(t);Object.entries(e).forEach(([s,r])=>{i.style.setProperty(s.replace("css-",""),r)})};class rt extends St(f){constructor(){super(...arguments),this.nodes=[]}render(){var t;return $e(this.renderRoot.host,this.properties),this.renderRoot.host.style.setProperty("--columns",((t=this.properties.columns)==null?void 0:t.toString())||"1"),k`${bt(this.nodes,e=>e)}`}}rt.styles=[S`
|
256
|
+
:host {
|
257
|
+
height: 100%;
|
258
|
+
display: grid;
|
259
|
+
justify-content: center;
|
260
|
+
grid-auto-rows: max-content;
|
261
|
+
grid-template-rows: auto;
|
262
|
+
grid-template-columns: repeat(var(--columns), 1fr);
|
263
|
+
}
|
264
|
+
`];exports.Area=rt;exports.default=rt;
|
package/area.d.ts
ADDED
@@ -0,0 +1,9 @@
|
|
1
|
+
import { LitElement } from 'lit';
|
2
|
+
import { WidgetComponentType } from '@telia-ace/widget-core-flamingo';
|
3
|
+
declare const Area_base: (new (...args: any[]) => WidgetComponentType) & typeof LitElement;
|
4
|
+
export declare class Area extends Area_base {
|
5
|
+
nodes: WidgetComponentType[];
|
6
|
+
static styles: import("lit").CSSResult[];
|
7
|
+
render(): import("lit").TemplateResult<1>;
|
8
|
+
}
|
9
|
+
export default Area;
|