@florid-kit/components 0.4.8 → 0.4.10
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/components/side-panel.d.ts +1 -0
- package/index.js +38 -28
- package/index.mjs +237 -222
- package/package.json +1 -1
|
@@ -14,6 +14,7 @@ export declare class OccitaneSidePanel extends LitElement {
|
|
|
14
14
|
onSecondaryButtonClick?: () => void;
|
|
15
15
|
disablePortal: boolean;
|
|
16
16
|
zIndex: number;
|
|
17
|
+
initialized: boolean;
|
|
17
18
|
private previousFocusedElement;
|
|
18
19
|
static styles: import('lit').CSSResult;
|
|
19
20
|
connectedCallback(): void;
|
package/index.js
CHANGED
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
* @license
|
|
3
3
|
* Copyright 2019 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
-
*/const X=globalThis,ht=X.ShadowRoot&&(X.ShadyCSS===void 0||X.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,dt=Symbol(),
|
|
5
|
+
*/const X=globalThis,ht=X.ShadowRoot&&(X.ShadyCSS===void 0||X.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,dt=Symbol(),vt=new WeakMap;let St=class{constructor(t,e,o){if(this._$cssResult$=!0,o!==dt)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(ht&&t===void 0){const o=e!==void 0&&e.length===1;o&&(t=vt.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),o&&vt.set(e,t))}return t}toString(){return this.cssText}};const It=n=>new St(typeof n=="string"?n:n+"",void 0,dt),A=(n,...t)=>{const e=n.length===1?n[0]:t.reduce((o,s,r)=>o+(i=>{if(i._$cssResult$===!0)return i.cssText;if(typeof i=="number")return i;throw Error("Value passed to 'css' function must be a 'css' function result: "+i+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+n[r+1],n[0]);return new St(e,n,dt)},Bt=(n,t)=>{if(ht)n.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(const e of t){const o=document.createElement("style"),s=X.litNonce;s!==void 0&&o.setAttribute("nonce",s),o.textContent=e.cssText,n.appendChild(o)}},bt=ht?n=>n:n=>n instanceof CSSStyleSheet?(t=>{let e="";for(const o of t.cssRules)e+=o.cssText;return It(e)})(n):n;/**
|
|
6
6
|
* @license
|
|
7
7
|
* Copyright 2017 Google LLC
|
|
8
8
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
9
|
-
*/const{is:Ot,defineProperty:zt,getOwnPropertyDescriptor:
|
|
9
|
+
*/const{is:Ot,defineProperty:zt,getOwnPropertyDescriptor:Ht,getOwnPropertyNames:Mt,getOwnPropertySymbols:Tt,getPrototypeOf:Dt}=Object,C=globalThis,gt=C.trustedTypes,Ut=gt?gt.emptyScript:"",ot=C.reactiveElementPolyfillSupport,R=(n,t)=>n,J={toAttribute(n,t){switch(t){case Boolean:n=n?Ut:null;break;case Object:case Array:n=n==null?n:JSON.stringify(n)}return n},fromAttribute(n,t){let e=n;switch(t){case Boolean:e=n!==null;break;case Number:e=n===null?null:Number(n);break;case Object:case Array:try{e=JSON.parse(n)}catch{e=null}}return e}},pt=(n,t)=>!Ot(n,t),yt={attribute:!0,type:String,converter:J,reflect:!1,useDefault:!1,hasChanged:pt};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),C.litPropertyMetadata??(C.litPropertyMetadata=new WeakMap);let T=class 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=yt){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){const o=Symbol(),s=this.getPropertyDescriptor(t,o,e);s!==void 0&&zt(this.prototype,t,s)}}static getPropertyDescriptor(t,e,o){const{get:s,set:r}=Ht(this.prototype,t)??{get(){return this[e]},set(i){this[e]=i}};return{get:s,set(i){const c=s==null?void 0:s.call(this);r==null||r.call(this,i),this.requestUpdate(t,c,o)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??yt}static _$Ei(){if(this.hasOwnProperty(R("elementProperties")))return;const t=Dt(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(R("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(R("properties"))){const e=this.properties,o=[...Mt(e),...Tt(e)];for(const s of o)this.createProperty(s,e[s])}const t=this[Symbol.metadata];if(t!==null){const e=litPropertyMetadata.get(t);if(e!==void 0)for(const[o,s]of e)this.elementProperties.set(o,s)}this._$Eh=new Map;for(const[e,o]of this.elementProperties){const s=this._$Eu(e,o);s!==void 0&&this._$Eh.set(s,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const o=new Set(t.flat(1/0).reverse());for(const s of o)e.unshift(bt(s))}else t!==void 0&&e.push(bt(t));return e}static _$Eu(t,e){const o=e.attribute;return o===!1?void 0:typeof o=="string"?o: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._$ES=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._$EO??(this._$EO=new Set)).add(t),this.renderRoot!==void 0&&this.isConnected&&((e=t.hostConnected)==null||e.call(t))}removeController(t){var e;(e=this._$EO)==null||e.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const o of e.keys())this.hasOwnProperty(o)&&(t.set(o,this[o]),delete this[o]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Bt(t,this.constructor.elementStyles),t}connectedCallback(){var t;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$EO)==null||t.forEach(e=>{var o;return(o=e.hostConnected)==null?void 0:o.call(e)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$EO)==null||t.forEach(e=>{var o;return(o=e.hostDisconnected)==null?void 0:o.call(e)})}attributeChangedCallback(t,e,o){this._$AK(t,o)}_$ET(t,e){var r;const o=this.constructor.elementProperties.get(t),s=this.constructor._$Eu(t,o);if(s!==void 0&&o.reflect===!0){const i=(((r=o.converter)==null?void 0:r.toAttribute)!==void 0?o.converter:J).toAttribute(e,o.type);this._$Em=t,i==null?this.removeAttribute(s):this.setAttribute(s,i),this._$Em=null}}_$AK(t,e){var r,i;const o=this.constructor,s=o._$Eh.get(t);if(s!==void 0&&this._$Em!==s){const c=o.getPropertyOptions(s),l=typeof c.converter=="function"?{fromAttribute:c.converter}:((r=c.converter)==null?void 0:r.fromAttribute)!==void 0?c.converter:J;this._$Em=s,this[s]=l.fromAttribute(e,c.type)??((i=this._$Ej)==null?void 0:i.get(s))??null,this._$Em=null}}requestUpdate(t,e,o){var s;if(t!==void 0){const r=this.constructor,i=this[t];if(o??(o=r.getPropertyOptions(t)),!((o.hasChanged??pt)(i,e)||o.useDefault&&o.reflect&&i===((s=this._$Ej)==null?void 0:s.get(t))&&!this.hasAttribute(r._$Eu(t,o))))return;this.C(t,e,o)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,e,{useDefault:o,reflect:s,wrapped:r},i){o&&!(this._$Ej??(this._$Ej=new Map)).has(t)&&(this._$Ej.set(t,i??e??this[t]),r!==!0||i!==void 0)||(this._$AL.has(t)||(this.hasUpdated||o||(e=void 0),this._$AL.set(t,e)),s===!0&&this._$Em!==t&&(this._$Eq??(this._$Eq=new Set)).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var o;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[r,i]of this._$Ep)this[r]=i;this._$Ep=void 0}const s=this.constructor.elementProperties;if(s.size>0)for(const[r,i]of s){const{wrapped:c}=i,l=this[r];c!==!0||this._$AL.has(r)||l===void 0||this.C(r,void 0,i,l)}}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),(o=this._$EO)==null||o.forEach(s=>{var r;return(r=s.hostUpdate)==null?void 0:r.call(s)}),this.update(e)):this._$EM()}catch(s){throw t=!1,this._$EM(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){var e;(e=this._$EO)==null||e.forEach(o=>{var s;return(s=o.hostUpdated)==null?void 0:s.call(o)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&(this._$Eq=this._$Eq.forEach(e=>this._$ET(e,this[e]))),this._$EM()}updated(t){}firstUpdated(t){}};T.elementStyles=[],T.shadowRootOptions={mode:"open"},T[R("elementProperties")]=new Map,T[R("finalized")]=new Map,ot==null||ot({ReactiveElement:T}),(C.reactiveElementVersions??(C.reactiveElementVersions=[])).push("2.1.0");/**
|
|
10
10
|
* @license
|
|
11
11
|
* Copyright 2017 Google LLC
|
|
12
12
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
13
|
-
*/const V=globalThis,Q=V.trustedTypes,mt=Q?Q.createPolicy("lit-html",{createHTML:n=>n}):void 0,Ct="$lit$",S=`lit$${Math.random().toFixed(9).slice(2)}$`,Lt="?"+S,Nt=`<${Lt}>`,B=document,F=()=>B.createComment(""),q=n=>n===null||typeof n!="object"&&typeof n!="function",ut=Array.isArray,jt=n=>ut(n)||typeof(n==null?void 0:n[Symbol.iterator])=="function",
|
|
14
|
-
\f\r]`,j=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,$t=/-->/g,wt=/>/g,P=RegExp(`>|${
|
|
15
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),xt=/'/g,_t=/"/g,Pt=/^(?:script|style|textarea|title)$/i,Rt=n=>(t,...e)=>({_$litType$:n,strings:t,values:e}),h=Rt(1),O=Symbol.for("lit-noChange"),d=Symbol.for("lit-nothing"),At=new WeakMap,k=B.createTreeWalker(B,129);function kt(n,t){if(!ut(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return mt!==void 0?mt.createHTML(t):t}const Vt=(n,t)=>{const e=n.length-1,
|
|
13
|
+
*/const V=globalThis,Q=V.trustedTypes,mt=Q?Q.createPolicy("lit-html",{createHTML:n=>n}):void 0,Ct="$lit$",S=`lit$${Math.random().toFixed(9).slice(2)}$`,Lt="?"+S,Nt=`<${Lt}>`,B=document,F=()=>B.createComment(""),q=n=>n===null||typeof n!="object"&&typeof n!="function",ut=Array.isArray,jt=n=>ut(n)||typeof(n==null?void 0:n[Symbol.iterator])=="function",st=`[
|
|
14
|
+
\f\r]`,j=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,$t=/-->/g,wt=/>/g,P=RegExp(`>|${st}(?:([^\\s"'>=/]+)(${st}*=${st}*(?:[^
|
|
15
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),xt=/'/g,_t=/"/g,Pt=/^(?:script|style|textarea|title)$/i,Rt=n=>(t,...e)=>({_$litType$:n,strings:t,values:e}),h=Rt(1),O=Symbol.for("lit-noChange"),d=Symbol.for("lit-nothing"),At=new WeakMap,k=B.createTreeWalker(B,129);function kt(n,t){if(!ut(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return mt!==void 0?mt.createHTML(t):t}const Vt=(n,t)=>{const e=n.length-1,o=[];let s,r=t===2?"<svg>":t===3?"<math>":"",i=j;for(let c=0;c<e;c++){const l=n[c];let f,b,p=-1,w=0;for(;w<l.length&&(i.lastIndex=w,b=i.exec(l),b!==null);)w=i.lastIndex,i===j?b[1]==="!--"?i=$t:b[1]!==void 0?i=wt:b[2]!==void 0?(Pt.test(b[2])&&(s=RegExp("</"+b[2],"g")),i=P):b[3]!==void 0&&(i=P):i===P?b[0]===">"?(i=s??j,p=-1):b[1]===void 0?p=-2:(p=i.lastIndex-b[2].length,f=b[1],i=b[3]===void 0?P:b[3]==='"'?_t:xt):i===_t||i===xt?i=P:i===$t||i===wt?i=j:(i=P,s=void 0);const E=i===P&&n[c+1].startsWith("/>")?" ":"";r+=i===j?l+Nt:p>=0?(o.push(f),l.slice(0,p)+Ct+l.slice(p)+S+E):l+S+(p===-2?c:E)}return[kt(n,r+(n[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),o]};class Z{constructor({strings:t,_$litType$:e},o){let s;this.parts=[];let r=0,i=0;const c=t.length-1,l=this.parts,[f,b]=Vt(t,e);if(this.el=Z.createElement(f,o),k.currentNode=this.el.content,e===2||e===3){const p=this.el.content.firstChild;p.replaceWith(...p.childNodes)}for(;(s=k.nextNode())!==null&&l.length<c;){if(s.nodeType===1){if(s.hasAttributes())for(const p of s.getAttributeNames())if(p.endsWith(Ct)){const w=b[i++],E=s.getAttribute(p).split(S),K=/([.?@])?(.*)/.exec(w);l.push({type:1,index:r,name:K[2],strings:E,ctor:K[1]==="."?qt:K[1]==="?"?Zt:K[1]==="@"?Wt:Y}),s.removeAttribute(p)}else p.startsWith(S)&&(l.push({type:6,index:r}),s.removeAttribute(p));if(Pt.test(s.tagName)){const p=s.textContent.split(S),w=p.length-1;if(w>0){s.textContent=Q?Q.emptyScript:"";for(let E=0;E<w;E++)s.append(p[E],F()),k.nextNode(),l.push({type:2,index:++r});s.append(p[w],F())}}}else if(s.nodeType===8)if(s.data===Lt)l.push({type:2,index:r});else{let p=-1;for(;(p=s.data.indexOf(S,p+1))!==-1;)l.push({type:7,index:r}),p+=S.length-1}r++}}static createElement(t,e){const o=B.createElement("template");return o.innerHTML=t,o}}function D(n,t,e=n,o){var i,c;if(t===O)return t;let s=o!==void 0?(i=e._$Co)==null?void 0:i[o]:e._$Cl;const r=q(t)?void 0:t._$litDirective$;return(s==null?void 0:s.constructor)!==r&&((c=s==null?void 0:s._$AO)==null||c.call(s,!1),r===void 0?s=void 0:(s=new r(n),s._$AT(n,e,o)),o!==void 0?(e._$Co??(e._$Co=[]))[o]=s:e._$Cl=s),s!==void 0&&(t=D(n,s._$AS(n,t.values),s,o)),t}class Ft{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:o}=this._$AD,s=((t==null?void 0:t.creationScope)??B).importNode(e,!0);k.currentNode=s;let r=k.nextNode(),i=0,c=0,l=o[0];for(;l!==void 0;){if(i===l.index){let f;l.type===2?f=new G(r,r.nextSibling,this,t):l.type===1?f=new l.ctor(r,l.name,l.strings,this,t):l.type===6&&(f=new Gt(r,this,t)),this._$AV.push(f),l=o[++c]}i!==(l==null?void 0:l.index)&&(r=k.nextNode(),i++)}return k.currentNode=B,s}p(t){let e=0;for(const o of this._$AV)o!==void 0&&(o.strings!==void 0?(o._$AI(t,o,e),e+=o.strings.length-2):o._$AI(t[e])),e++}}class G{get _$AU(){var t;return((t=this._$AM)==null?void 0:t._$AU)??this._$Cv}constructor(t,e,o,s){this.type=2,this._$AH=d,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=o,this.options=s,this._$Cv=(s==null?void 0:s.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=D(this,t,e),q(t)?t===d||t==null||t===""?(this._$AH!==d&&this._$AR(),this._$AH=d):t!==this._$AH&&t!==O&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):jt(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==d&&q(this._$AH)?this._$AA.nextSibling.data=t:this.T(B.createTextNode(t)),this._$AH=t}$(t){var r;const{values:e,_$litType$:o}=t,s=typeof o=="number"?this._$AC(t):(o.el===void 0&&(o.el=Z.createElement(kt(o.h,o.h[0]),this.options)),o);if(((r=this._$AH)==null?void 0:r._$AD)===s)this._$AH.p(e);else{const i=new Ft(s,this),c=i.u(this.options);i.p(e),this.T(c),this._$AH=i}}_$AC(t){let e=At.get(t.strings);return e===void 0&&At.set(t.strings,e=new Z(t)),e}k(t){ut(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let o,s=0;for(const r of t)s===e.length?e.push(o=new G(this.O(F()),this.O(F()),this,this.options)):o=e[s],o._$AI(r),s++;s<e.length&&(this._$AR(o&&o._$AB.nextSibling,s),e.length=s)}_$AR(t=this._$AA.nextSibling,e){var o;for((o=this._$AP)==null?void 0:o.call(this,!1,!0,e);t&&t!==this._$AB;){const s=t.nextSibling;t.remove(),t=s}}setConnected(t){var e;this._$AM===void 0&&(this._$Cv=t,(e=this._$AP)==null||e.call(this,t))}}class Y{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,o,s,r){this.type=1,this._$AH=d,this._$AN=void 0,this.element=t,this.name=e,this._$AM=s,this.options=r,o.length>2||o[0]!==""||o[1]!==""?(this._$AH=Array(o.length-1).fill(new String),this.strings=o):this._$AH=d}_$AI(t,e=this,o,s){const r=this.strings;let i=!1;if(r===void 0)t=D(this,t,e,0),i=!q(t)||t!==this._$AH&&t!==O,i&&(this._$AH=t);else{const c=t;let l,f;for(t=r[0],l=0;l<r.length-1;l++)f=D(this,c[o+l],e,l),f===O&&(f=this._$AH[l]),i||(i=!q(f)||f!==this._$AH[l]),f===d?t=d:t!==d&&(t+=(f??"")+r[l+1]),this._$AH[l]=f}i&&!s&&this.j(t)}j(t){t===d?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class qt extends Y{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===d?void 0:t}}class Zt extends Y{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==d)}}class Wt extends Y{constructor(t,e,o,s,r){super(t,e,o,s,r),this.type=5}_$AI(t,e=this){if((t=D(this,t,e,0)??d)===O)return;const o=this._$AH,s=t===d&&o!==d||t.capture!==o.capture||t.once!==o.once||t.passive!==o.passive,r=t!==d&&(o===d||s);s&&this.element.removeEventListener(this.name,this,o),r&&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 Gt{constructor(t,e,o){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=o}get _$AU(){return this._$AM._$AU}_$AI(t){D(this,t)}}const it=V.litHtmlPolyfillSupport;it==null||it(Z,G),(V.litHtmlVersions??(V.litHtmlVersions=[])).push("3.3.0");const Kt=(n,t,e)=>{const o=(e==null?void 0:e.renderBefore)??t;let s=o._$litPart$;if(s===void 0){const r=(e==null?void 0:e.renderBefore)??null;o._$litPart$=s=new G(t.insertBefore(F(),r),r,void 0,e??{})}return s._$AI(n),s};/**
|
|
16
16
|
* @license
|
|
17
17
|
* Copyright 2017 Google LLC
|
|
18
18
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
* @license
|
|
25
25
|
* Copyright 2017 Google LLC
|
|
26
26
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
27
|
-
*/const Xt={attribute:!0,type:String,converter:J,reflect:!1,hasChanged:pt},Jt=(n=Xt,t,e)=>{const{kind:
|
|
27
|
+
*/const Xt={attribute:!0,type:String,converter:J,reflect:!1,hasChanged:pt},Jt=(n=Xt,t,e)=>{const{kind:o,metadata:s}=e;let r=globalThis.litPropertyMetadata.get(s);if(r===void 0&&globalThis.litPropertyMetadata.set(s,r=new Map),o==="setter"&&((n=Object.create(n)).wrapped=!0),r.set(e.name,n),o==="accessor"){const{name:i}=e;return{set(c){const l=t.get.call(this);t.set.call(this,c),this.requestUpdate(i,l,n)},init(c){return c!==void 0&&this.C(i,void 0,n,c),c}}}if(o==="setter"){const{name:i}=e;return function(c){const l=this[i];t.call(this,c),this.requestUpdate(i,l,n)}}throw Error("Unsupported decorator location: "+o)};function a(n){return(t,e)=>typeof e=="object"?Jt(n,t,e):((o,s,r)=>{const i=s.hasOwnProperty(r);return s.constructor.createProperty(r,o),i?Object.getOwnPropertyDescriptor(s,r):void 0})(n,t,e)}/**
|
|
28
28
|
* @license
|
|
29
29
|
* Copyright 2017 Google LLC
|
|
30
30
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -40,17 +40,17 @@
|
|
|
40
40
|
* @license
|
|
41
41
|
* Copyright 2023 Google LLC
|
|
42
42
|
* SPDX-License-Identifier: Apache-2.0
|
|
43
|
-
*/const
|
|
43
|
+
*/const ft=Symbol("internals"),at=Symbol("privateInternals");function te(n){var t;class e extends n{get[(t=ft,t)](){return this[at]||(this[at]=this.attachInternals()),this[at]}}return e}/**
|
|
44
44
|
* @license
|
|
45
45
|
* Copyright 2023 Google LLC
|
|
46
46
|
* SPDX-License-Identifier: Apache-2.0
|
|
47
|
-
*/function ee(n){n.addInitializer(t=>{const e=t;e.addEventListener("click",async
|
|
47
|
+
*/function ee(n){n.addInitializer(t=>{const e=t;e.addEventListener("click",async o=>{const{type:s,[ft]:r}=e,{form:i}=r;if(!(!i||s==="button")&&(await new Promise(c=>{setTimeout(c)}),!o.defaultPrevented)){if(s==="reset"){i.reset();return}i.addEventListener("submit",c=>{Object.defineProperty(c,"submitter",{configurable:!0,enumerable:!0,get:()=>e})},{capture:!0,once:!0}),r.setFormValue(e.value),i.requestSubmit()}})})}const ne=`<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
48
48
|
<path d="M8 3.6275C7.06799 0.971489 3.25399 -0.0226278 1.67414 2.30983C0.0877404 4.65197 1.67414 6.99412 2.62598 8.33249C3.0147 8.87905 8 14 8 14C8 14 12.9853 8.87905 13.374 8.33249C14.3259 6.99412 15.9123 4.65197 14.3259 2.30983C12.746 -0.0226277 8.97167 0.971489 8 3.6275Z" stroke="#3F2B2E" stroke-linecap="round"/>
|
|
49
49
|
</svg>
|
|
50
|
-
`,
|
|
50
|
+
`,oe=`<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
51
51
|
<path d="M16 8L4 0V16L16 8Z" fill="#3F2B2E"/>
|
|
52
52
|
</svg>
|
|
53
|
-
`,
|
|
53
|
+
`,se=`<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
54
54
|
<path d="M12.2266 8.16162C11.0953 9.26599 8.72489 11.8788 5.11546 16L4.63062 15.7172C5.78886 13.4007 7.17607 10.8283 8.79223 8C7.17607 5.17172 5.78886 2.59933 4.63062 0.282827L5.11546 0C8.72489 4.12121 11.0953 6.73401 12.2266 7.83838V8.16162Z" fill="#3F2B2E"/>
|
|
55
55
|
</svg>
|
|
56
56
|
`,ie=`<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
<path class="st0" d="M40,20c0,0.7-0.6,1.2-1.2,1.2H21.2v17.5c0,0.7-0.6,1.2-1.2,1.2s-1.2-0.6-1.2-1.2V21.2H1.2C0.6,21.2,0,20.7,0,20
|
|
89
89
|
s0.6-1.2,1.2-1.2h17.5V1.2C18.8,0.6,19.3,0,20,0s1.2,0.6,1.2,1.2v17.5h17.5C39.4,18.8,40,19.3,40,20z"/>
|
|
90
90
|
</svg>
|
|
91
|
-
`,
|
|
91
|
+
`,fe=`<?xml version="1.0" encoding="utf-8"?>
|
|
92
92
|
<!-- Generator: $$$/GeneralStr/196=Adobe Illustrator 27.6.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
|
93
93
|
<svg version="1.1" id="Calque_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
|
94
94
|
viewBox="0 0 40 40" style="enable-background:new 0 0 40 40;" xml:space="preserve">
|
|
@@ -97,19 +97,19 @@
|
|
|
97
97
|
</style>
|
|
98
98
|
<path class="st0" d="M38.8,20.5H1.2c-0.7,0-1.2-0.6-1.2-1.2S0.6,18,1.2,18h37.5c0.7,0,1.2,0.6,1.2,1.2S39.4,20.5,38.8,20.5z"/>
|
|
99
99
|
</svg>
|
|
100
|
-
`,tt={wishlist:ne,playerv:
|
|
100
|
+
`,tt={wishlist:ne,playerv:oe,chevronRight:se,chevronLeft:ie,icoPlus:ue,icoMinus:fe,"star-0":re,"star-25":ae,"star-50":le,"star-75":ce,"star-100":he,cross:de,search:pe};/**
|
|
101
101
|
* @license
|
|
102
102
|
* Copyright 2017 Google LLC
|
|
103
103
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
104
|
-
*/const
|
|
104
|
+
*/const ve={CHILD:2},be=n=>(...t)=>({_$litDirective$:n,values:t});class ge{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,o){this._$Ct=t,this._$AM=e,this._$Ci=o}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}/**
|
|
105
105
|
* @license
|
|
106
106
|
* Copyright 2017 Google LLC
|
|
107
107
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
108
|
-
*/class lt extends ge{constructor(t){if(super(t),this.it=d,t.type!==
|
|
108
|
+
*/class lt extends ge{constructor(t){if(super(t),this.it=d,t.type!==ve.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===d||t==null)return this._t=void 0,this.it=t;if(t===O)return t;if(typeof t!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this._t;this.it=t;const e=[t];return e.raw=e,this._t={_$litType$:this.constructor.resultType,strings:e,values:[]}}}lt.directiveName="unsafeHTML",lt.resultType=1;/**
|
|
109
109
|
* @license
|
|
110
110
|
* Copyright 2017 Google LLC
|
|
111
111
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
112
|
-
*/class ct extends lt{}ct.directiveName="unsafeSVG",ct.resultType=2;const W=be(ct);var ye=Object.defineProperty,me=Object.getOwnPropertyDescriptor,g=(n,t,e,
|
|
112
|
+
*/class ct extends lt{}ct.directiveName="unsafeSVG",ct.resultType=2;const W=be(ct);var ye=Object.defineProperty,me=Object.getOwnPropertyDescriptor,g=(n,t,e,o)=>{for(var s=o>1?void 0:o?me(t,e):t,r=n.length-1,i;r>=0;r--)(i=n[r])&&(s=(o?i(t,e,s):i(s))||s);return o&&s&&ye(t,e,s),s};const $e=te(m);let u=class extends $e{constructor(){super(...arguments),this.type="submit",this.value="",this.variant="primary",this.text="",this.textsecond="",this.fullwidth=!1,this.disabled=!1,this.startIconModel="search",this.endIconModel="chevronRight",this.startIcon=!1,this.endIcon=!1,this.panelTarget="",this.href="",this.target=""}get name(){return this.getAttribute("name")??""}set name(n){this.setAttribute("name",n)}get form(){return this[ft].form}handleClick(){if(this.panelTarget){const n=document.getElementById(this.panelTarget);n!=null&&n.openPanel&&typeof n.openPanel=="function"?n.openPanel():console.warn(`[o-button] No side panel with id="${this.panelTarget}" found or it does not have an openPanel method.`)}}render(){return this.href?this.renderLink():this.renderButton()}renderIcon(n){const t=n==="start"?this.startIconModel:this.endIconModel;if(!t)return d;const e=tt[t].replace("<svg",'<svg aria-hidden="true" focusable="false" part="svg"');return h`<span class="${n==="start"?"icon-start":"icon-end"}">${W(e)}</span>`}renderButton(){const n=this.text||this.textsecond;return h`
|
|
113
113
|
<button type=${this.type} class="button" ?disabled=${this.disabled} @click=${this.handleClick}>
|
|
114
114
|
${this.startIcon?this.renderIcon("start"):d}
|
|
115
115
|
${n?h`
|
|
@@ -289,7 +289,7 @@
|
|
|
289
289
|
transform: translateX(4px);
|
|
290
290
|
}
|
|
291
291
|
//End icon movment on hover
|
|
292
|
-
`;g([a()],u.prototype,"type",2);g([a({reflect:!0})],u.prototype,"value",2);g([a({type:String,reflect:!0})],u.prototype,"variant",2);g([a({type:String})],u.prototype,"text",2);g([a({type:String})],u.prototype,"textsecond",2);g([a({type:Boolean,reflect:!0})],u.prototype,"fullwidth",2);g([a({type:Boolean,reflect:!0})],u.prototype,"disabled",2);g([a({type:String,reflect:!0})],u.prototype,"startIconModel",2);g([a({type:String,reflect:!0})],u.prototype,"endIconModel",2);g([a({type:Boolean,reflect:!0,attribute:"starticon"})],u.prototype,"startIcon",2);g([a({type:Boolean,reflect:!0,attribute:"endicon"})],u.prototype,"endIcon",2);g([a({type:String,attribute:"paneltarget",reflect:!0})],u.prototype,"panelTarget",2);g([a({type:String})],u.prototype,"href",2);g([a({type:String})],u.prototype,"target",2);u=g([z("o-button")],u);var we=Object.defineProperty,xe=Object.getOwnPropertyDescriptor,et=(n,t,e,
|
|
292
|
+
`;g([a()],u.prototype,"type",2);g([a({reflect:!0})],u.prototype,"value",2);g([a({type:String,reflect:!0})],u.prototype,"variant",2);g([a({type:String})],u.prototype,"text",2);g([a({type:String})],u.prototype,"textsecond",2);g([a({type:Boolean,reflect:!0})],u.prototype,"fullwidth",2);g([a({type:Boolean,reflect:!0})],u.prototype,"disabled",2);g([a({type:String,reflect:!0})],u.prototype,"startIconModel",2);g([a({type:String,reflect:!0})],u.prototype,"endIconModel",2);g([a({type:Boolean,reflect:!0,attribute:"starticon"})],u.prototype,"startIcon",2);g([a({type:Boolean,reflect:!0,attribute:"endicon"})],u.prototype,"endIcon",2);g([a({type:String,attribute:"paneltarget",reflect:!0})],u.prototype,"panelTarget",2);g([a({type:String})],u.prototype,"href",2);g([a({type:String})],u.prototype,"target",2);u=g([z("o-button")],u);var we=Object.defineProperty,xe=Object.getOwnPropertyDescriptor,et=(n,t,e,o)=>{for(var s=o>1?void 0:o?xe(t,e):t,r=n.length-1,i;r>=0;r--)(i=n[r])&&(s=(o?i(t,e,s):i(s))||s);return o&&s&&we(t,e,s),s};let U=class extends m{constructor(){super(...arguments),this.status="empty",this.ariaDescribedBy="a-product-name",this.label="Add to wishlist",this.toggleStatus=()=>{this.status=this.status==="empty"?"filled":"empty",this.setAttribute("aria-pressed",String(this.status==="filled")),this.dispatchEvent(new CustomEvent("wishlist-toggle",{detail:{status:this.status},bubbles:!0,composed:!0}))}}connectedCallback(){super.connectedCallback(),this.setAttribute("tabindex","0"),this.setAttribute("role","button"),this.setAttribute("aria-pressed",String(this.status==="filled"))}firstUpdated(){this.addEventListener("click",this.toggleStatus),this.addEventListener("keydown",this.handleKeydown)}handleKeydown(n){(n.key==="Enter"||n.key===" ")&&(n.preventDefault(),this.toggleStatus())}render(){const n=tt.wishlist.replace("<svg",'<svg aria-hidden="true" focusable="false" part="svg"');return h`
|
|
293
293
|
<button type="button" aria-describedby="${this.ariaDescribedBy}" class="wishlist-button">
|
|
294
294
|
<span class="sr-only">${this.label}</span>
|
|
295
295
|
${W(n)}
|
|
@@ -349,7 +349,7 @@
|
|
|
349
349
|
width: 0.1rem !important;
|
|
350
350
|
white-space: nowrap !important;
|
|
351
351
|
}
|
|
352
|
-
`;et([a({type:String,reflect:!0})],U.prototype,"status",2);et([a({type:String,reflect:!0})],U.prototype,"ariaDescribedBy",2);et([a({type:String,reflect:!0})],U.prototype,"label",2);U=et([z("o-wishlist-button")],U);var _e=Object.defineProperty,Ae=Object.getOwnPropertyDescriptor,L=(n,t,e,
|
|
352
|
+
`;et([a({type:String,reflect:!0})],U.prototype,"status",2);et([a({type:String,reflect:!0})],U.prototype,"ariaDescribedBy",2);et([a({type:String,reflect:!0})],U.prototype,"label",2);U=et([z("o-wishlist-button")],U);var _e=Object.defineProperty,Ae=Object.getOwnPropertyDescriptor,L=(n,t,e,o)=>{for(var s=o>1?void 0:o?Ae(t,e):t,r=n.length-1,i;r>=0;r--)(i=n[r])&&(s=(o?i(t,e,s):i(s))||s);return o&&s&&_e(t,e,s),s};let $=class extends m{constructor(){super(...arguments),this.bgstyle="background-light",this.size="medium",this.status="empty",this.type="button",this.strokewidth="1",this.icon="wishlist",this.disabled=!1}updated(n){super.updated(n),this.style.setProperty("--icon-stroke-width",this.strokewidth)}render(){const n=tt[this.icon]??"",t=`icon-${this.icon}`,e=n.replace("<svg",'<svg aria-hidden="true" focusable="false" part="svg"');return h`
|
|
353
353
|
${this.type==="span"?h`
|
|
354
354
|
<span class="icon icon-button ${this.size} ${this.bgstyle} ${this.status} ${t}" ?disabled="${this.disabled}">
|
|
355
355
|
${W(e)}
|
|
@@ -563,7 +563,7 @@
|
|
|
563
563
|
}
|
|
564
564
|
|
|
565
565
|
}
|
|
566
|
-
`;L([a({type:String,reflect:!0})],$.prototype,"bgstyle",2);L([a({type:String,reflect:!0})],$.prototype,"size",2);L([a({type:String,reflect:!0})],$.prototype,"status",2);L([a({type:String,reflect:!0})],$.prototype,"type",2);L([a({type:String})],$.prototype,"strokewidth",2);L([a({type:String})],$.prototype,"icon",2);L([a({type:Boolean,reflect:!0})],$.prototype,"disabled",2);$=L([z("o-icon-button")],$);var Ee=Object.defineProperty,Se=Object.getOwnPropertyDescriptor,
|
|
566
|
+
`;L([a({type:String,reflect:!0})],$.prototype,"bgstyle",2);L([a({type:String,reflect:!0})],$.prototype,"size",2);L([a({type:String,reflect:!0})],$.prototype,"status",2);L([a({type:String,reflect:!0})],$.prototype,"type",2);L([a({type:String})],$.prototype,"strokewidth",2);L([a({type:String})],$.prototype,"icon",2);L([a({type:Boolean,reflect:!0})],$.prototype,"disabled",2);$=L([z("o-icon-button")],$);var Ee=Object.defineProperty,Se=Object.getOwnPropertyDescriptor,H=(n,t,e,o)=>{for(var s=o>1?void 0:o?Se(t,e):t,r=n.length-1,i;r>=0;r--)(i=n[r])&&(s=(o?i(t,e,s):i(s))||s);return o&&s&&Ee(t,e,s),s};let x=class extends m{constructor(){super(...arguments),this.href="",this.target="",this.template="standard",this.inverse=!1,this.endIcon=!1,this.reverseEndIcon=!1}render(){return h`
|
|
567
567
|
<a href="${this.href}" target="${this.target}">
|
|
568
568
|
${this.endIcon&&this.reverseEndIcon?h`
|
|
569
569
|
<o-icon-button
|
|
@@ -672,7 +672,7 @@
|
|
|
672
672
|
height: 1px;
|
|
673
673
|
}
|
|
674
674
|
/* End of underline effect */
|
|
675
|
-
`;
|
|
675
|
+
`;H([a({type:String})],x.prototype,"href",2);H([a({type:String})],x.prototype,"target",2);H([a({type:String,reflect:!0})],x.prototype,"template",2);H([a({type:Boolean,reflect:!0})],x.prototype,"inverse",2);H([a({type:Boolean,reflect:!0})],x.prototype,"endIcon",2);H([a({type:Boolean,reflect:!0})],x.prototype,"reverseEndIcon",2);x=H([z("o-link")],x);var Ce=Object.defineProperty,Le=Object.getOwnPropertyDescriptor,nt=(n,t,e,o)=>{for(var s=o>1?void 0:o?Le(t,e):t,r=n.length-1,i;r>=0;r--)(i=n[r])&&(s=(o?i(t,e,s):i(s))||s);return o&&s&&Ce(t,e,s),s};let N=class extends m{constructor(){super(...arguments),this.rating=0}getStarKeys(){const n=[];for(let t=0;t<5;t++){const e=this.rating-t;let o;e>=1?o=100:e<=0?o=0:o=Math.round(e*100/25)*25,n.push(`star-${o}`)}return n}render(){const n=this.getStarKeys();return h`
|
|
676
676
|
<div class="rating">
|
|
677
677
|
<div class="stars">
|
|
678
678
|
${n.map(t=>h`<span class="star">${W(tt[t]??"")}</span>`)}
|
|
@@ -712,7 +712,7 @@
|
|
|
712
712
|
text-decoration: underline;
|
|
713
713
|
cursor: pointer;
|
|
714
714
|
}
|
|
715
|
-
`;nt([a({type:Number})],N.prototype,"rating",2);nt([a({type:String})],N.prototype,"reviewCount",2);nt([a({type:String})],N.prototype,"href",2);N=nt([z("o-rating")],N);var Pe=Object.defineProperty,ke=Object.getOwnPropertyDescriptor,y=(n,t,e,
|
|
715
|
+
`;nt([a({type:Number})],N.prototype,"rating",2);nt([a({type:String})],N.prototype,"reviewCount",2);nt([a({type:String})],N.prototype,"href",2);N=nt([z("o-rating")],N);var Pe=Object.defineProperty,ke=Object.getOwnPropertyDescriptor,y=(n,t,e,o)=>{for(var s=o>1?void 0:o?ke(t,e):t,r=n.length-1,i;r>=0;r--)(i=n[r])&&(s=(o?i(t,e,s):i(s))||s);return o&&s&&Pe(t,e,s),s};let v=class extends m{constructor(){super(...arguments),this.open=!1,this.showHeader=!0,this.showFooter=!1,this.headerTitle="",this.closeButtonLabel="Close the modal",this.firstButtonLabel="Close",this.firstButtonVariant="primary",this.secondaryButtonLabel="",this.secondaryButtonVariant="secondary",this.disablePortal=!1,this.zIndex=99,this.initialized=!1,this.previousFocusedElement=null,this.handleKeyDown=n=>{this.open&&(n.key==="Escape"?this.closePanel():n.key==="Tab"&&this.trapFocus(n))}}connectedCallback(){super.connectedCallback(),!this.disablePortal&&this.parentElement!==document.body&&document.body.appendChild(this),window.addEventListener("keydown",this.handleKeyDown),this.updateComplete.then(()=>{this.initialized=!0})}disconnectedCallback(){document.body.style.overflow="",document.body.removeAttribute("data-side-panel"),window.removeEventListener("keydown",this.handleKeyDown),super.disconnectedCallback()}trapFocus(n){const t=this.getFocusableElements();if(t.length===0)return;const e=t[0],o=t[t.length-1];n.shiftKey&&document.activeElement===e?(n.preventDefault(),o.focus()):!n.shiftKey&&document.activeElement===o&&(n.preventDefault(),e.focus())}getFocusableElements(){const n=this.renderRoot.querySelector(".panel");return n?Array.from(n.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])')).filter(t=>!t.hasAttribute("disabled")):[]}openPanel(){this.previousFocusedElement=document.activeElement,this.open=!0,document.body.style.overflow="hidden",document.body.setAttribute("data-side-panel","open"),this.updateComplete.then(()=>{const n=this.getFocusableElements()[0];n==null||n.focus()})}closePanel(){var n;this.open=!1,document.body.style.overflow="",document.body.removeAttribute("data-side-panel"),(n=this.previousFocusedElement)==null||n.focus(),this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0}))}handleFirstClick(){typeof this.onFirstButtonClick=="function"&&this.onFirstButtonClick(),this.closePanel()}handleSecondaryClick(){typeof this.onSecondaryButtonClick=="function"&&this.onSecondaryButtonClick(),this.closePanel()}updated(){this.style.setProperty("--z-overlay",`${this.zIndex}`),this.style.setProperty("--z-panel",`${this.zIndex+1}`)}render(){return h`
|
|
716
716
|
<div class="overlay" style="z-index: ${this.zIndex}" @click=${this.closePanel}></div>
|
|
717
717
|
<div
|
|
718
718
|
class="panel"
|
|
@@ -755,7 +755,7 @@
|
|
|
755
755
|
</div>
|
|
756
756
|
`:null}
|
|
757
757
|
</div>
|
|
758
|
-
`}};
|
|
758
|
+
`}};v.styles=A`
|
|
759
759
|
:host {
|
|
760
760
|
--z-overlay: 99;
|
|
761
761
|
--z-panel: 100;
|
|
@@ -768,6 +768,16 @@
|
|
|
768
768
|
z-index: var(--z-overlay);
|
|
769
769
|
}
|
|
770
770
|
|
|
771
|
+
/* Hide content until it is initialized */
|
|
772
|
+
:host(:not([initialized])) .content {
|
|
773
|
+
display: none;
|
|
774
|
+
}
|
|
775
|
+
|
|
776
|
+
/* hide the host completely until its initialized */
|
|
777
|
+
:host(:not([initialized])) {
|
|
778
|
+
display: none !important;
|
|
779
|
+
}
|
|
780
|
+
|
|
771
781
|
.overlay {
|
|
772
782
|
position: absolute;
|
|
773
783
|
inset: 0;
|
|
@@ -852,31 +862,31 @@
|
|
|
852
862
|
max-width: none;
|
|
853
863
|
}
|
|
854
864
|
}
|
|
855
|
-
`;y([a({type:Boolean,reflect:!0})],
|
|
865
|
+
`;y([a({type:Boolean,reflect:!0})],v.prototype,"open",2);y([a({type:Boolean,reflect:!0})],v.prototype,"showHeader",2);y([a({type:Boolean,reflect:!0})],v.prototype,"showFooter",2);y([a({type:String,reflect:!0})],v.prototype,"headerTitle",2);y([a({type:String,reflect:!0})],v.prototype,"closeButtonLabel",2);y([a({type:String,reflect:!0})],v.prototype,"firstButtonLabel",2);y([a({type:String,reflect:!0})],v.prototype,"firstButtonVariant",2);y([a({type:Function})],v.prototype,"onFirstButtonClick",2);y([a({type:String,reflect:!0})],v.prototype,"secondaryButtonLabel",2);y([a({type:String,reflect:!0})],v.prototype,"secondaryButtonVariant",2);y([a({type:Function})],v.prototype,"onSecondaryButtonClick",2);y([a({type:Boolean,reflect:!0})],v.prototype,"disablePortal",2);y([a({type:Number,reflect:!0})],v.prototype,"zIndex",2);y([a({type:Boolean,reflect:!0})],v.prototype,"initialized",2);v=y([z("o-side-panel")],v);var Ie=Object.defineProperty,Be=Object.getOwnPropertyDescriptor,M=(n,t,e,o)=>{for(var s=o>1?void 0:o?Be(t,e):t,r=n.length-1,i;r>=0;r--)(i=n[r])&&(s=(o?i(t,e,s):i(s))||s);return o&&s&&Ie(t,e,s),s};let _=class extends m{constructor(){super(...arguments),this.thumbnails=[],this.activeIndex=0,this.disabledIndexes=[],this.maxWidth="100%",this.focusedIndex=0,this.playerIconTemplate=h`
|
|
856
866
|
<o-icon-button
|
|
857
867
|
icon="playerv"
|
|
858
|
-
size="
|
|
868
|
+
size="smallxs"
|
|
859
869
|
bgstyle="background-light"
|
|
860
870
|
type="span"
|
|
861
871
|
status="filled"
|
|
862
|
-
strokewidth="
|
|
872
|
+
strokewidth="0"
|
|
863
873
|
></o-icon-button>
|
|
864
874
|
`}handleKeyDown(n){n.key==="ArrowRight"?(n.preventDefault(),this.focusNext()):n.key==="ArrowLeft"?(n.preventDefault(),this.focusPrevious()):(n.key==="Enter"||n.key===" ")&&(n.preventDefault(),this.selectThumbnail(this.focusedIndex))}focusNext(){let n=this.focusedIndex+1;for(;this.disabledIndexes.includes(n)&&n<this.thumbnails.length;)n++;n<this.thumbnails.length&&(this.focusedIndex=n,this.focusThumbnail(n))}focusPrevious(){let n=this.focusedIndex-1;for(;this.disabledIndexes.includes(n)&&n>=0;)n--;n>=0&&(this.focusedIndex=n,this.focusThumbnail(n))}focusThumbnail(n){const t=this.renderRoot.querySelector(`[data-index="${n}"]`);t==null||t.focus()}selectThumbnail(n){this.disabledIndexes.includes(n)||(this.activeIndex=n,this.swiperInstance&&typeof this.swiperInstance.slideTo=="function"&&this.swiperInstance.slideTo(n),this.dispatchEvent(new CustomEvent("thumbnail-select",{detail:{index:n}})))}render(){return h`
|
|
865
875
|
<div class="scroll-container" style="max-width: ${this.maxWidth};">
|
|
866
|
-
${this.thumbnails.map((n,t)=>{const e=this.disabledIndexes.includes(t),
|
|
876
|
+
${this.thumbnails.map((n,t)=>{const e=this.disabledIndexes.includes(t),o=this.activeIndex===t,s=n.type==="video";return h`
|
|
867
877
|
<div class="thumb-wrapper">
|
|
868
878
|
<button
|
|
869
879
|
class="thumb"
|
|
870
880
|
data-index="${t}"
|
|
871
881
|
?disabled=${e}
|
|
872
|
-
aria-selected=${
|
|
882
|
+
aria-selected=${o}
|
|
873
883
|
tabindex="${this.focusedIndex===t?0:-1}"
|
|
874
884
|
@click=${()=>this.selectThumbnail(t)}
|
|
875
885
|
@keydown=${this.handleKeyDown}
|
|
876
886
|
>
|
|
877
887
|
<img src="${n.src}" />
|
|
878
888
|
</button>
|
|
879
|
-
${
|
|
889
|
+
${s?h`<div class="play-icon-wrapper">${this.playerIconTemplate}</div>`:null}
|
|
880
890
|
</div>
|
|
881
891
|
`})}
|
|
882
892
|
</div>
|
|
@@ -983,4 +993,4 @@
|
|
|
983
993
|
height: 0;
|
|
984
994
|
width: 0;
|
|
985
995
|
}
|
|
986
|
-
`;
|
|
996
|
+
`;M([a({type:Array})],_.prototype,"thumbnails",2);M([a({type:Number})],_.prototype,"activeIndex",2);M([a({type:Array})],_.prototype,"disabledIndexes",2);M([a({type:String})],_.prototype,"maxWidth",2);M([a({type:Object})],_.prototype,"swiperInstance",2);M([Qt()],_.prototype,"focusedIndex",2);_=M([z("thumbnail-navigation")],_);
|